Last active
March 17, 2020 23:31
-
-
Save amsterdatech/a4dbd44f781369c9af4d68e5ce0b5f8e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Get Pseudo Unique ID | |
| //Add permission to AndroidManifest.xml | |
| <uses-permission android:name=”android.permission.READ_PHONE_STATE”/> | |
| //IMEI/IMSI/ESN/PhoneNumber | |
| val telephonyManager = context.getSystemService(Context.TELEPHONY_SERVICE) | |
| val imei = telephonyManager.getDeviceId() | |
| val simSerial = telephonyManager.getSimSerialNumber() | |
| val imsi = telephonyManager.getSubscriberId() | |
| val phoneNumber = telephonyManager.getLine1Number() | |
| //Secure ID | |
| val secureId = Secure.getString(getContentResolver(), Secure.ANDROID_ID) | |
| //Build.Serial | |
| val serialId = android.os.Build.SERIAL | |
| // 12 digits | |
| val pseudoId = Build.BOARD.length % 10 + Build.BRAND.length % 10 + Build.DEVICE.length % 10 + Build.DISPLAY.length % 10 + Build.HOST.length % 10 + Build.ID.length % 10 + Build.MANUFACTURER.length % 10 + Build.MODEL.length % 10 + Build.PRODUCT.length % 10+ Build.TAGS.length % 10 + Build.TYPE + Build.USER.length % 10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment