diff --git a/src/main/scala/com/github/shadowsocks/Shadowsocks.scala b/src/main/scala/com/github/shadowsocks/Shadowsocks.scala index a7660d8a..39878af8 100644 --- a/src/main/scala/com/github/shadowsocks/Shadowsocks.scala +++ b/src/main/scala/com/github/shadowsocks/Shadowsocks.scala @@ -275,7 +275,7 @@ class Shadowsocks } } - private def crashRecovery() { + def crashRecovery() { val cmd = new ArrayBuffer[String]() for (task <- Array("ss-local", "ss-tunnel", "pdnsd", "redsocks", "tun2socks")) { @@ -477,7 +477,9 @@ class Shadowsocks handler.removeCallbacksAndMessages(null) } - def install() { + def reset() { + crashRecovery() + copyAssets(System.getABI) val ab = new ArrayBuffer[String] @@ -487,12 +489,6 @@ class Shadowsocks Console.runCommand(ab.toArray) } - def reset() { - crashRecovery() - - install() - } - def recovery() { serviceStop() val h = showProgress(R.string.recovering) diff --git a/src/main/scala/com/github/shadowsocks/ShadowsocksDeathRecipient.scala b/src/main/scala/com/github/shadowsocks/ShadowsocksDeathRecipient.scala index 1fddc083..5d3ab775 100644 --- a/src/main/scala/com/github/shadowsocks/ShadowsocksDeathRecipient.scala +++ b/src/main/scala/com/github/shadowsocks/ShadowsocksDeathRecipient.scala @@ -16,6 +16,7 @@ class ShadowsocksDeathRecipient(val mContext: ServiceBoundContext) mContext match { case ss: Shadowsocks => ss.deattachService + ss.crashRecovery ss.attachService case _ => }