Skip to content

Commit 1782fea

Browse files
committed
Shell
1 parent 85fef07 commit 1782fea

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

app/src/main/java/com/sevtinge/hyperceiler/utils/shell/ShellExec.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public class ShellExec {
9191
private final ArrayList<String> cList = new ArrayList<>();
9292

9393
private final boolean result;
94-
private final boolean init;
94+
private boolean init;
9595
private boolean destroy;
9696
private boolean appending = false;
9797
private boolean isFilter = false;
@@ -372,7 +372,7 @@ private void done(int count) {
372372
try {
373373
isFilter = true;
374374
os.writeBytes("result=$?; string=\"The execution of command <" + count + "> is complete. Return value: <$result>\"; " +
375-
"if [[ $result != 0 ]]; then echo $string 1>&2; else echo $string 2>/dev/null; fi");
375+
"if [[ $result != 0 ]]; then echo $string 1>&2; else echo $string 2>/dev/null; fi");
376376
// os.writeBytes("echo \"The execution of command <" + count + "> is complete. Return value: <$?>\" 1>&2 2>&1");
377377
os.writeBytes("\n");
378378
os.flush();
@@ -568,7 +568,7 @@ public boolean filter(String line) throws NumberFormatException {
568568
if (result != null && count != null) {
569569
if (use) {
570570
mIResult.result(command.passCommands.get(Integer.parseInt(count)),
571-
Integer.parseInt(result));
571+
Integer.parseInt(result));
572572
if (finish) mIResult.readOutput("Finish!!", true);
573573
}
574574
shellExec.setResult = Integer.parseInt(result);

app/src/main/java/com/sevtinge/hyperceiler/utils/shell/ShellInit.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ public static ShellExec getShell() {
7676
AndroidLogUtils.logW(TAG, "ShellExec is null!! Attempt to rewrite creation...");
7777
return new ShellExec(true, true, mResult);
7878
} else {
79-
throw new RuntimeException("ShellExec is null!! " +
80-
"And it seems like it has never been created successfully!");
79+
return new ShellExec(true, true, mResult);
80+
// throw new RuntimeException("ShellExec is null!! " +
81+
// "And it seems like it has never been created successfully!");
8182
}
8283
}
8384
}

0 commit comments

Comments
 (0)