packageName空判断
This commit is contained in:
parent
076240c559
commit
ebe5f7df78
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -13,7 +13,7 @@
|
|||
"attributes": [],
|
||||
"versionCode": 1,
|
||||
"versionName": "1.0",
|
||||
"outputFile": "app-release.apk"
|
||||
"outputFile": "app-com.example.retention-v1.0-1.apk"
|
||||
}
|
||||
],
|
||||
"elementType": "File",
|
||||
|
@ -22,14 +22,14 @@
|
|||
"minApi": 28,
|
||||
"maxApi": 30,
|
||||
"baselineProfiles": [
|
||||
"baselineProfiles/1/app-release.dm"
|
||||
"baselineProfiles/1/app-com.example.retention-v1.0-1.dm"
|
||||
]
|
||||
},
|
||||
{
|
||||
"minApi": 31,
|
||||
"maxApi": 2147483647,
|
||||
"baselineProfiles": [
|
||||
"baselineProfiles/0/app-release.dm"
|
||||
"baselineProfiles/0/app-com.example.retention-v1.0-1.dm"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
|
|
@ -65,7 +65,7 @@ public class Utils {
|
|||
return;
|
||||
}
|
||||
}
|
||||
Log.d("TAG", "writePackageName: "+packageName);
|
||||
LogFileUtil.logAndWrite(Log.INFO,"TAG", "writePackageName: "+packageName, null);
|
||||
try (BufferedOutputStream bos = new BufferedOutputStream(
|
||||
new FileOutputStream(file))) {
|
||||
bos.write(packageName.getBytes(StandardCharsets.UTF_8));
|
||||
|
|
|
@ -42,25 +42,29 @@ public class LoadDeviceWorker extends CoroutineWorker {
|
|||
boolean result = ChangeDeviceInfoUtil.getDeviceInfoSync(taskId, androidId);
|
||||
String packageName = ChangeDeviceInfoUtil.packageName;
|
||||
String zipName = ChangeDeviceInfoUtil.zipName;
|
||||
Log.d("TAG", "doWork: " + result + " " + packageName + " " + zipName);
|
||||
LogFileUtil.logAndWrite(Log.INFO, "TAG","doWork: " + result + " " + packageName + " " + zipName, null);
|
||||
if (result && !TextUtils.isEmpty(packageName) && !TextUtils.isEmpty(zipName)) {
|
||||
boolean isSuccess = ChangeDeviceInfoUtil.processPackageInfoWithDeviceInfo(packageName, zipName, getApplicationContext(), androidId, taskId);
|
||||
if (isSuccess) {
|
||||
executeSingleLogic(context);
|
||||
executeSingleLogic(context, packageName);
|
||||
}
|
||||
} else {
|
||||
Log.d("TAG", "doWork: get Device info false");
|
||||
LogFileUtil.logAndWrite(Log.INFO, "TAG", "doWork: get Device info false", null);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
public void executeSingleLogic(Context context) {
|
||||
public void executeSingleLogic(Context context, String packageName) {
|
||||
if (packageName == null || packageName.isEmpty()){
|
||||
LogFileUtil.logAndWrite(Log.INFO, "MainActivity", "executeSingleLogic: Package name is empty", null);
|
||||
return;
|
||||
}
|
||||
LogFileUtil.logAndWrite(Log.INFO, "MainActivity", "executeSingleLogic: Proxy not active, starting VPN", null);
|
||||
startProxyVpn(context);
|
||||
LogFileUtil.logAndWrite(Log.INFO, "MainActivity", "executeSingleLogic: Changing device info", null);
|
||||
ChangeDeviceInfoUtil.changeDeviceInfo(context.getPackageName(), context, MainActivity.armClient);
|
||||
ChangeDeviceInfoUtil.changeDeviceInfo(packageName, context, MainActivity.armClient);
|
||||
LogFileUtil.logAndWrite(Log.INFO, "MainActivity", "executeSingleLogic: Running AutoJs script", null);
|
||||
Utils.writePackageName(ChangeDeviceInfoUtil.packageName);
|
||||
Utils.writePackageName(packageName);
|
||||
AutoJsUtil.runAutojsScript(context);
|
||||
}
|
||||
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue