Skip to content

Commit b37452c

Browse files
authored
Merge pull request #44 from mgatelabs/2019.10.4
2019.10.4
2 parents 9f1e544 + ee8a4c1 commit b37452c

14 files changed

Lines changed: 472 additions & 163 deletions

File tree

build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<copydir src="./extra" dest="./release"/>
99
<copy file="./target/phone-piper.jar" tofile="./release/phone-piper.jar"/>
1010
<copy file="./LICENSE.txt" tofile="./release/LICENSE.txt"/>
11-
<zip destfile="./target/PhonePiper2019.10.3.zip">
11+
<zip destfile="./target/PhonePiper2019.10.4.zip">
1212
<fileset dir="./release" includes="**/*"/>
1313
</zip>
1414
<delete dir="./release"/>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.mgatelabs</groupId>
88
<artifactId>PhonePiper</artifactId>
9-
<version>2019.10.3-SNAPSHOT</version>
9+
<version>2019.10.4-SNAPSHOT</version>
1010

1111
<properties>
1212
<maven.compiler.source>1.8</maven.compiler.source>

src/main/java/com/mgatelabs/piper/runners/ScriptRunner.java

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -182,35 +182,6 @@ public int compare(VarDefinition o1, VarDefinition o2) {
182182
status = Status.INIT;
183183
}
184184

185-
public void stopShell() {
186-
/*
187-
if (shell != null) {
188-
try {
189-
shell.shutdown();
190-
} catch (Exception ex) {
191-
ex.printStackTrace();
192-
}
193-
shell = null;
194-
}
195-
*/
196-
}
197-
198-
public String restartShell() {
199-
StringBuilder sb = new StringBuilder();
200-
201-
sb.append(AdbShell.disconnect());
202-
// Kill the Server
203-
sb.append(" - ");
204-
sb.append(AdbShell.killServer());
205-
// Bring it back up
206-
sb.append(" - ");
207-
sb.append(AdbShell.devices());
208-
// Bring the shell back up
209-
sb.append(" - Connect: ").append(shell.connect());
210-
211-
return sb.toString();
212-
}
213-
214185
public Date getLastImageDate() {
215186
return lastImageDate;
216187
}
@@ -830,13 +801,15 @@ private StateResult executableStateProcessor(Stack<ProcessingStateInfo> stateSta
830801
} else {
831802
if (!results.contains(connectionDefinition.getApp())) {
832803
logger.error("App: " + connectionDefinition.getApp() + " is not running, will restart");
833-
shell.exec("monkey -p " + connectionDefinition.getApp() + " -c android.intent.category.LAUNCHER 1");
804+
shell.exec("monkey --pct-syskeys 0 -p " + connectionDefinition.getApp() +" 1");
834805
}
835806
}
836807
}
837808
} else if (StringUtils.equalsIgnoreCase(actionDefinition.getValue(), "CLOSE")) {
838-
logger.error("Closing App: " + connectionDefinition.getApp());
839-
shell.exec("am force-stop " + connectionDefinition.getApp());
809+
if (StringUtils.isNotBlank(connectionDefinition.getApp())) {
810+
logger.error("Closing App: " + connectionDefinition.getApp());
811+
shell.exec("am force-stop " + connectionDefinition.getApp());
812+
}
840813
}
841814
} break;
842815
case REFRESH: {

src/main/java/com/mgatelabs/piper/server/EditHolder.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -78,22 +78,6 @@ public AdbWrapper getShell() {
7878
return shell;
7979
}
8080

81-
public String restartShell() {
82-
StringBuilder sb = new StringBuilder();
83-
84-
sb.append(AdbShell.disconnect());
85-
// Kill the Server
86-
sb.append(" - ");
87-
sb.append(AdbShell.killServer());
88-
// Bring it back up
89-
sb.append(" - ");
90-
sb.append(AdbShell.devices());
91-
// Bring the shell back up
92-
sb.append(" - Connect: ").append(shell.connect());
93-
94-
return sb.toString();
95-
}
96-
9781
public ConnectionDefinition getConnectionDefinition() {
9882
return connectionDefinition;
9983
}

0 commit comments

Comments
 (0)