Commit 958d387b authored by Mygod's avatar Mygod

Fix su detection

parent eee89774
......@@ -305,9 +305,11 @@ class ShadowsocksNatService extends BaseService {
override def startRunner(profile: Profile) = if (su == null) {
su = new Shell.Builder().useSU().setWantSTDERR(true).setWatchdogTimeout(10).open((_, exitCode, _) =>
if (exitCode == 0) super.startRunner(profile) else {
Log.wtf(TAG, "libsuperuser#55 has been fixed. Please remove the redundant code.")
su.close()
su = null
if (su != null) {
Log.wtf(TAG, "libsuperuser#55 has been fixed. Please remove the redundant code.")
su.close()
su = null
}
super.stopRunner(true, getString(R.string.nat_no_root))
})
su.waitForIdle()
......
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