I'm generating a key for obfuscate information.
That key must change between devices so for the generation I was using:
Secure.getString(getContentResolver(), Secure.ANDROID_ID)
TelephonyManager.getSimSerialNumber()
TelephonyManager.getDeviceId()
- A random persistent String generated if all of the options above are
null
But testing I realised that since TelephonyManager.getSimSerialNumber() changes with the SIM in the device (and in airplane mode always return null) the key also changes and the obfuscated data cant be recovered.
My question is: Does TelephonyManager.getDeviceId() return always the same value (null or a value but always the same result)?
Note: I tested and it returns a valid value for me even in "Airplane mode"