Commit 1b626207 authored by Max Lv's avatar Max Lv

Fix all our own issues.

Waiting for Android's official fix for their broken NAT implementation.
parent 250e4171
...@@ -801,6 +801,8 @@ class Shadowsocks ...@@ -801,6 +801,8 @@ class Shadowsocks
ab.append("mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system") ab.append("mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system")
for (executable <- Shadowsocks.EXECUTABLES) { for (executable <- Shadowsocks.EXECUTABLES) {
ab.append("cp %s%s /system/bin/".format(Path.BASE, executable)) ab.append("cp %s%s /system/bin/".format(Path.BASE, executable))
ab.append("chmod 755 /system/bin/" + executable)
ab.append("chown root:shell /system/bin/" + executable)
} }
ab.append("mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system") ab.append("mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system")
Console.runRootCommand(ab.toArray) Console.runRootCommand(ab.toArray)
...@@ -826,6 +828,7 @@ class Shadowsocks ...@@ -826,6 +828,7 @@ class Shadowsocks
ab.append("chmod 755 " + Path.BASE + executable) ab.append("chmod 755 " + Path.BASE + executable)
} }
Console.runCommand(ab.toArray) Console.runCommand(ab.toArray)
} }
private def recovery() { private def recovery() {
......
...@@ -151,7 +151,7 @@ class ShadowsocksNatService extends Service with BaseService { ...@@ -151,7 +151,7 @@ class ShadowsocksNatService extends Service with BaseService {
} }
val cmd = if (Build.VERSION.SDK_INT >= 20) { val cmd = if (Build.VERSION.SDK_INT >= 20) {
args "system/bin/" + args
} else { } else {
Path.BASE + args Path.BASE + args
} }
...@@ -185,7 +185,7 @@ class ShadowsocksNatService extends Service with BaseService { ...@@ -185,7 +185,7 @@ class ShadowsocksNatService extends Service with BaseService {
p.println(conf) p.println(conf)
}) })
val cmd = if (Build.VERSION.SDK_INT >= 20) { val cmd = if (Build.VERSION.SDK_INT >= 20) {
args "system/bin/" + args
} else { } else {
Path.BASE + args Path.BASE + args
} }
...@@ -195,10 +195,10 @@ class ShadowsocksNatService extends Service with BaseService { ...@@ -195,10 +195,10 @@ class ShadowsocksNatService extends Service with BaseService {
/** Called when the activity is first created. */ /** Called when the activity is first created. */
def handleConnection: Boolean = { def handleConnection: Boolean = {
startShadowsocksDaemon()
startDnsDaemon() startDnsDaemon()
startRedsocksDaemon() startRedsocksDaemon()
setupIptables startShadowsocksDaemon()
setupIptables()
flushDNS() flushDNS()
true true
......
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