This is with reference to this SO answer. It states that the code below can be used to uniquely identify a machine:
import java.util.Scanner;
public class GetBiosSerialNumber {
public static void main(String[] args) throws Throwable {
// wmic command for diskdrive id: wmic DISKDRIVE GET SerialNumber
// wmic command for cpu id : wmic cpu get ProcessorId
Process process = Runtime.getRuntime().exec(new String[] { "wmic", "bios", "get", "serialnumber" });
process.getOutputStream().close();
Scanner sc = new Scanner(process.getInputStream());
String property = sc.next();
String serial = sc.next();
System.out.println(property + ": " + serial);
}
}
But this is for windows only. How do I make it work for OSX? And if its not possible to find an equivalent way of working on MAC, whats the other way to get unique machine id?(for Hardware Locking an application). Unfortunately I do not have a MAC PC to test this(I'm making it for a client), so please let me know a way that would work across all OSX devices.
I do not want to use the MAC address as the question in response to which above answer was there suggests several limitations of MAC address.
This post is not a duplicate of this other post. My first line of this question references an answer to that question only.