기존에는 아래와 같은 방식으로 고유값을 생성했었는데요.
M 버전부터는 전화 관련 정보를 가져오기 위해서는 권한 체크를 해야되는 것으로 알아서
아래와 같은 방식으로 고유값을 만들기에는 무리가 있는것 같아서요.
혹시 다른분들은 고유값 어떤식으로 만들어 쓰시는지 궁금합니다.
final TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
final String tmDevice, tmSerial, androidId;
tmDevice = "" + tm.getDeviceId();
tmSerial = "" + tm.getSimSerialNumber();
androidId = "" + android.provider.Settings.Secure.getString(context.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
UUID deviceUuid = new UUID(androidId.hashCode(), ((long)tmDevice.hashCode() << 32) | tmSerial.hashCode());
String deviceId = deviceUuid.toString();