Commit 32f4d6af authored by Mygod's avatar Mygod

Fix #838 #839

parent 264b177b
...@@ -28,8 +28,8 @@ object TcpFastOpen { ...@@ -28,8 +28,8 @@ object TcpFastOpen {
file.canRead && (Utils.readAllLines(file).toInt & 1) > 0 file.canRead && (Utils.readAllLines(file).toInt & 1) > 0
} }
def enabled(value: Boolean) = def enabled(value: Boolean) = {
Shell.run("su", Array( val result = Shell.run("su", Array(
"if echo " + (if (value) 3 else 0) + " > /proc/sys/net/ipv4/tcp_fastopen; then", "if echo " + (if (value) 3 else 0) + " > /proc/sys/net/ipv4/tcp_fastopen; then",
" success=-1", " success=-1",
" if mount -o rw,remount /dev/block/platform/msm_sdcc.1/by-name/system /system; then", " if mount -o rw,remount /dev/block/platform/msm_sdcc.1/by-name/system /system; then",
...@@ -46,5 +46,7 @@ object TcpFastOpen { ...@@ -46,5 +46,7 @@ object TcpFastOpen {
" fi", " fi",
"else", "else",
" echo Failed.", " echo Failed.",
"fi"), null, true).asScala.mkString("\n") "fi"), null, true)
if (result == null) "Root access failed." else result.asScala.mkString("\n")
}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment