Skip to content

Commit 8c7a0da

Browse files
committed
Give the binary updater a better chance of succeeding
1 parent 8051fba commit 8c7a0da

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/com/noshufou/android/su/service/UpdaterService.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,15 @@ public void run() {
386386

387387
// Ops check
388388
if (mCancelled || !stepSuccess) return;
389+
currentStep = currentStep.increment(UPDATER_STEPS);
389390
os.writeBytes("/system/su\n");
390-
stepSuccess = executeCommand(os, is, mSuToolsPath, "id");
391-
if (stepSuccess) os.writeBytes("exit\n");
391+
Process process2 = Runtime.getRuntime().exec("/system/su");
392+
DataOutputStream os2 = new DataOutputStream(process2.getOutputStream());
393+
BufferedReader is2 = new BufferedReader(new InputStreamReader(
394+
new DataInputStream(process2.getInputStream())));
395+
stepSuccess = executeCommand(os2, is2, mSuToolsPath, "id");
396+
currentStep.finish(stepSuccess);
397+
if (stepSuccess) os2.writeBytes("exit\n");
392398

393399
// Move su to where it belongs
394400
if (mCancelled || !stepSuccess) return;

0 commit comments

Comments
 (0)