获取唯一的设备ID

时间:2019-07-24 16:02:37

标签: android device

我使用此方法,但有时同一用户在同一台​​手机上的结果会更改:

                    sDeviceId = "35" + //we make this look like a valid IMEI
                    Build.BOARD.length() % 10 + Build.BRAND.length() % 10 +
                    (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP ? Build.SUPPORTED_ABIS[0].length() % 10 : Build.CPU_ABI.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.length() % 10 +
                    Build.USER.length() % 10 + //13 digits
                    Settings.Secure.getString(
                            MyApplication.getInstance().getContentResolver(), Settings.Secure.ANDROID_ID));

你有个主意吗?非常感谢你!

0 个答案:

没有答案