From 6f1bad5176f9df1995c29a9dc64fd07377ce59aa Mon Sep 17 00:00:00 2001 From: Administrator Date: Wed, 25 Jun 2025 15:29:08 +0800 Subject: [PATCH] . --- .../com/example/studyapp/MainActivity.java | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/com/example/studyapp/MainActivity.java b/app/src/main/java/com/example/studyapp/MainActivity.java index e8e6c20..6a42e8b 100644 --- a/app/src/main/java/com/example/studyapp/MainActivity.java +++ b/app/src/main/java/com/example/studyapp/MainActivity.java @@ -95,19 +95,20 @@ public class MainActivity extends AppCompatActivity { * @return 设备的 ANDROID_ID,若无法获取,则返回 null */ private String getAndroidId(Context context) { - if (context == null) { - LogFileUtil.logAndWrite(Log.ERROR, "MainActivity", "getAndroidId: Context cannot be null",null); - throw new IllegalArgumentException("Context cannot be null"); - } - try { - return Settings.Secure.getString( - context.getContentResolver(), - Settings.Secure.ANDROID_ID - ); - } catch (Exception e) { - LogFileUtil.logAndWrite(Log.ERROR, "MainActivity", "getAndroidId: Failed to get ANDROID_ID",e); - return null; - } +// if (context == null) { +// LogFileUtil.logAndWrite(Log.ERROR, "MainActivity", "getAndroidId: Context cannot be null",null); +// throw new IllegalArgumentException("Context cannot be null"); +// } +// try { +// return Settings.Secure.getString( +// context.getContentResolver(), +// Settings.Secure.ANDROID_ID +// ); +// } catch (Exception e) { +// LogFileUtil.logAndWrite(Log.ERROR, "MainActivity", "getAndroidId: Failed to get ANDROID_ID",e); +// return null; +// } + return "FyZqWrStUvOpKlMn"; }