fix: ASW-195 job 执行playbook初始化关闭第三方app
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
package net.geedge.api.util;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.log.Log;
|
||||
import net.geedge.api.entity.EnvApiYml;
|
||||
@@ -11,7 +9,6 @@ import net.geedge.common.RCode;
|
||||
import net.geedge.common.T;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class PlaybookRunnable implements Runnable {
|
||||
@@ -85,8 +82,7 @@ public class PlaybookRunnable implements Runnable {
|
||||
|
||||
//Close other apps
|
||||
if (interrupt) return;
|
||||
List<String> packageNameList = adbUtil.findPackageNameList();
|
||||
this.closeApp(packageNameList, packageName);
|
||||
adbUtil.closeOtherApps();
|
||||
|
||||
// clear app data
|
||||
if (interrupt) return;
|
||||
@@ -153,7 +149,9 @@ public class PlaybookRunnable implements Runnable {
|
||||
AdbUtil.CommandResult allTcpdump = adbUtil.stopTcpdump(tcpdumpAll.output());
|
||||
adbUtil.execShellCommand(String.format("shell rm -rf %s", allTcpdump.output()));
|
||||
}
|
||||
this.closeApp(ListUtil.empty(), packageName);
|
||||
|
||||
adbUtil.stopApp(packageName);
|
||||
|
||||
if (unInstall) {
|
||||
adbUtil.uninstall(packageName);
|
||||
}
|
||||
@@ -167,15 +165,6 @@ public class PlaybookRunnable implements Runnable {
|
||||
adbUtil.setInterrupt(true);
|
||||
}
|
||||
|
||||
private void closeApp(List<String> packageNameList, String packageName) {
|
||||
if (CollUtil.isNotEmpty(packageNameList)) {
|
||||
for (String name : packageNameList) {
|
||||
adbUtil.stopApp(name);
|
||||
}
|
||||
}
|
||||
adbUtil.stopApp(packageName);
|
||||
}
|
||||
|
||||
private void stopTcpdump(AdbUtil.CommandResult tcpdump, File logFile, String packageName) {
|
||||
// stop tcpdump
|
||||
AdbUtil.CommandResult stopTcpdump = adbUtil.stopTcpdump(tcpdump.output());
|
||||
|
||||
Reference in New Issue
Block a user