Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. final TelephonyManager tm = (TelephonyManager) getBaseContext().getSystemService(Context.TELEPHONY_SERVICE);
  2.  
  3. final String tmDevice, tmSerial, androidId;
  4. tmDevice = "" + tm.getDeviceId();
  5. tmSerial = "" + tm.getSimSerialNumber();
  6. androidId = "" + android.provider.Settings.Secure.getString(getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
  7.  
  8. UUID deviceUuid = new UUID(androidId.hashCode(), ((long)tmDevice.hashCode() << 32) | tmSerial.hashCode());
  9. String deviceId = deviceUuid.toString();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement