Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What alternatives to ANDROID_ID can be used with Android LVL?

Due to the well known issue of Secure.ANDROID_ID not being unique what alternatives are there for identifying a device in LVL?

If I were to use an installation unique generated ID would that not cause issues for the user who has purchased the app? E.g. if they re-install or switch devices will they have to re-purchase the app because the ID has changed?

// Try to use more data here. ANDROID_ID is a single point of attack.
String deviceId = Secure.getString(getContentResolver(), Secure.ANDROID_ID);
like image 694
Johnny Avatar asked Dec 10 '25 19:12

Johnny


1 Answers

You should generally provide more context when asking a question: this single line doesn't mean much. Assuming you are referring to the LVL sample app, this deviceId is only used to derive an encryption key for obfuscating the app's preferences. Actual purchases are tied to the user's Google account, not to their device. So if they change devices and use the same account, purchases will be restored.

like image 151
Nikolay Elenkov Avatar answered Dec 13 '25 08:12

Nikolay Elenkov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!