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