1、UUID+设备号序列号 唯一识别码(不可变)
public static String getDevUUID(Context mContext) { synchronized (DevInfo.class) { if (uniqueId == null) { final TelephonyManager tm = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE); final String tmDevice, tmSerial, tmPhone, androidId; tmDevice = "" + tm.getDeviceId(); tmSerial = "" + tm.getSimSerialNumber(); androidId = "" + android.provider.Settings.Secure.getString(mContext.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID); UUID deviceUuid = new UUID(androidId.hashCode(), ((long) tmDevice.hashCode() << 32) | tmSerial.hashCode()); uniqueId = deviceUuid.toString(); } } return uniqueId; }2、 Java 获取可变UUID
UUID uuid = UUID.randomUUID(); String uniqueId = uuid.toString();