From 6a31e9d78ede1197429a7f8716631040fbbb3339 Mon Sep 17 00:00:00 2001 From: Catfriend1 Date: Fri, 23 Feb 2018 16:58:13 +0100 Subject: [PATCH] Fix root startup of libsyncthing.so binary Call suOut.flush on starting the syncthing binary using root Fixes issue https://github.com/syncthing/syncthing-android/issues/1005 --- .../com/nutomic/syncthingandroid/service/SyncthingRunnable.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/com/nutomic/syncthingandroid/service/SyncthingRunnable.java b/app/src/main/java/com/nutomic/syncthingandroid/service/SyncthingRunnable.java index 71e73870..31e2a1fd 100644 --- a/app/src/main/java/com/nutomic/syncthingandroid/service/SyncthingRunnable.java +++ b/app/src/main/java/com/nutomic/syncthingandroid/service/SyncthingRunnable.java @@ -394,6 +394,8 @@ public class SyncthingRunnable implements Runnable { // If we did not use exec, we would wait infinitely for the process to terminate (ret = process.waitFor(); in run()). // With exec the whole process terminates when Syncthing exits. suOut.writeBytes("exec " + TextUtils.join(" ", mCommand) + "\n"); + // suOut.flush has to be called to fix issue - #1005 Endless loader after enabling "Superuser mode" + suOut.flush(); return process; } else { ProcessBuilder pb = new ProcessBuilder(mCommand);