There is currently no means of getting the primary HD serial number or CPU serial number in the juce::SystemStats classes.
It is possible on both mac OS and Windows to retrieve these numbers.
This feature would be very useful for uniquely identifying a user’s computer.
I’m currently using my own versions of the code presented in those links. However, I trust the JUCE code for this kind of thing much more than I trust my own code, and having an official JUCE way to retrieve these values would be a welcome addition to the framework.
I’m not sure iOS and Android supports those features? Would be curious to see if permissions get in the way.
FWIW, I’ve been using juce::File::hashCode64 for the purpose of uniquely identifying machines by looking up each fixed hard disk. Here’s an example from my modules: sp::createSystemHash. This is all used in production code in various projects. Do note that the drives weren’t the only source for creating a unique hash.
You don’t get issues with installations where multiple different users on a single machine are using your software? Or do you store your license file within the user and not a system shared folder?
I’m considering attempting to split my machine ID implementation to use the device identifiers (stable) on Mac – and then root folder stuff on win (which I need to check)
One other thing I noticed is SystemStats::getComputerName() ← back when I was using this a few years ago – I noticed it was changing depending on the network the user was connected to.
Not sure if you’re having a problem with that – but fairly confident that was the case
Hm I’m guessing that was on Windows? Thanks for the heads up.
To be totally transparent - I think the approach of using any of these details for the purpose of identifying a machine is probably the wrong way to go. It’s good for framing some user control logic, but the factors stack up against this method because of the lack of consistency for the information from the APIs - that and the data from those APIs can be possible security holes and/or they’re frowned upon because it requires user permissions and may be construed as tracking.
My thinking is that it’s probably safer and less hassle for a user if a developer were to cache a UUID somewhere. If that UUID goes away or changes in some fashion, the user would be required to login again.
Yeah – I tried the root folder hash thing and I think it would suffer a collision of being the same on multiple machines as well.
The UUID thing is a good approach – but it’s pretty loose security wise, if anyone was to catch on, moving the license along with that UUID would be equivalent to cracking the software – however I suppose using that in conjunction with some computer name symbols in a hash would be able as stable & secure as any other approach.
I just wish there was a reliable cross platform machine ID in the framework and it’d be all solved!