Commit 408e7438 authored by Mygod's avatar Mygod

Debugging an HTC device

parent 52cd6d15
...@@ -337,7 +337,7 @@ class Shadowsocks ...@@ -337,7 +337,7 @@ class Shadowsocks
if (intent != null) { if (intent != null) {
startActivityForResult(intent, Shadowsocks.REQUEST_CONNECT) startActivityForResult(intent, Shadowsocks.REQUEST_CONNECT)
} else { } else {
onActivityResult(Shadowsocks.REQUEST_CONNECT, Activity.RESULT_OK, null) handler.post(() => onActivityResult(Shadowsocks.REQUEST_CONNECT, Activity.RESULT_OK, null))
} }
} else { } else {
serviceStart() serviceStart()
......
...@@ -442,11 +442,14 @@ class ShadowsocksVpnService extends VpnService with BaseService { ...@@ -442,11 +442,14 @@ class ShadowsocksVpnService extends VpnService with BaseService {
try { try {
conn = builder.establish() conn = builder.establish()
if (conn == null) throw new Exception("Application not prepared.")
} catch { } catch {
case ex: IllegalStateException => case ex: IllegalStateException =>
changeState(State.STOPPED, ex.getMessage) changeState(State.STOPPED, ex.getMessage)
conn = null conn = null
case ex: Exception => conn = null case ex: Exception =>
ex.printStackTrace()
conn = null
} }
if (conn == null) { if (conn == null) {
......
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