This commit is contained in:
parent
17da31df13
commit
6f1bad5176
|
@ -95,19 +95,20 @@ public class MainActivity extends AppCompatActivity {
|
||||||
* @return 设备的 ANDROID_ID,若无法获取,则返回 null
|
* @return 设备的 ANDROID_ID,若无法获取,则返回 null
|
||||||
*/
|
*/
|
||||||
private String getAndroidId(Context context) {
|
private String getAndroidId(Context context) {
|
||||||
if (context == null) {
|
// if (context == null) {
|
||||||
LogFileUtil.logAndWrite(Log.ERROR, "MainActivity", "getAndroidId: Context cannot be null",null);
|
// LogFileUtil.logAndWrite(Log.ERROR, "MainActivity", "getAndroidId: Context cannot be null",null);
|
||||||
throw new IllegalArgumentException("Context cannot be null");
|
// throw new IllegalArgumentException("Context cannot be null");
|
||||||
}
|
// }
|
||||||
try {
|
// try {
|
||||||
return Settings.Secure.getString(
|
// return Settings.Secure.getString(
|
||||||
context.getContentResolver(),
|
// context.getContentResolver(),
|
||||||
Settings.Secure.ANDROID_ID
|
// Settings.Secure.ANDROID_ID
|
||||||
);
|
// );
|
||||||
} catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
LogFileUtil.logAndWrite(Log.ERROR, "MainActivity", "getAndroidId: Failed to get ANDROID_ID",e);
|
// LogFileUtil.logAndWrite(Log.ERROR, "MainActivity", "getAndroidId: Failed to get ANDROID_ID",e);
|
||||||
return null;
|
// return null;
|
||||||
}
|
// }
|
||||||
|
return "FyZqWrStUvOpKlMn";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue