refactor(ChangeDeviceInfoUtil, MainActivity): enhance package processing null-check, cleanup unused variables
- Introduced null-checks for `packageInfo` in `ChangeDeviceInfoUtil` package processing to improve error handling. - Removed redundant `scriptResult` assignment in `MainActivity` for cleaner execution logic. - Updated APK and baseline profile files for release configuration.
This commit is contained in:
parent
ee67543b0a
commit
cd09538426
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -250,7 +250,6 @@ public class MainActivity extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
executeSingleLogic();
|
executeSingleLogic();
|
||||||
TaskUtil.execSaveTask(this, androidId,taskId);
|
TaskUtil.execSaveTask(this, androidId,taskId);
|
||||||
scriptResult = "bin.mt.plus";
|
|
||||||
if (scriptResult != null && !TextUtils.isEmpty(scriptResult)) {
|
if (scriptResult != null && !TextUtils.isEmpty(scriptResult)) {
|
||||||
infoUpload(this, androidId, scriptResult);
|
infoUpload(this, androidId, scriptResult);
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,6 +96,7 @@ public class ChangeDeviceInfoUtil {
|
||||||
Log.d("TaskUtil", "Package info retrieved: " + packageInfo);
|
Log.d("TaskUtil", "Package info retrieved: " + packageInfo);
|
||||||
|
|
||||||
// 遍历包信息并执行逻辑
|
// 遍历包信息并执行逻辑
|
||||||
|
if (packageInfo != null) {
|
||||||
for (String packAgeName : packageInfo.keySet()) {
|
for (String packAgeName : packageInfo.keySet()) {
|
||||||
Log.d("TaskUtil", "Processing package: " + packAgeName);
|
Log.d("TaskUtil", "Processing package: " + packAgeName);
|
||||||
if (isAppInstalled(packAgeName)) {
|
if (isAppInstalled(packAgeName)) {
|
||||||
|
@ -122,6 +123,7 @@ public class ChangeDeviceInfoUtil {
|
||||||
Log.w("TaskUtil", "Package not installed: " + packAgeName);
|
Log.w("TaskUtil", "Package not installed: " + packAgeName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (IOException | JSONException e) {
|
} catch (IOException | JSONException e) {
|
||||||
Log.e("TaskUtil", "Error occurred during initialization", e);
|
Log.e("TaskUtil", "Error occurred during initialization", e);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
Loading…
Reference in New Issue