Commit 362ec7eb authored by Max Lv's avatar Max Lv

bump version

parent a27336ae
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.github.shadowsocks" package="com.github.shadowsocks"
android:versionCode="123" android:versionCode="124"
android:versionName="2.9.1"> android:versionName="2.9.2">
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
......
Subproject commit d462e4cd8d44d7275957afab9255b98e54bb2630 Subproject commit c5155e4a59c1965203b2f894c4f3c06358fa3a65
...@@ -49,7 +49,7 @@ import com.github.shadowsocks.utils.{State, TrafficMonitor, TrafficMonitorThread ...@@ -49,7 +49,7 @@ import com.github.shadowsocks.utils.{State, TrafficMonitor, TrafficMonitorThread
trait BaseService extends Service { trait BaseService extends Service {
@volatile private var state = State.INIT @volatile private var state = State.STOPPED
@volatile private var callbackCount = 0 @volatile private var callbackCount = 0
var timer: Timer = null var timer: Timer = null
...@@ -76,7 +76,7 @@ trait BaseService extends Service { ...@@ -76,7 +76,7 @@ trait BaseService extends Service {
timer.cancel() timer.cancel()
timer = null timer = null
} }
if (callbackCount == 0 && state != State.CONNECTING && state != State.CONNECTED) { if (callbackCount == 0 && state == State.STOPPED) {
stopBackgroundService() stopBackgroundService()
} }
} }
...@@ -101,13 +101,13 @@ trait BaseService extends Service { ...@@ -101,13 +101,13 @@ trait BaseService extends Service {
} }
override def stop() { override def stop() {
if (state != State.CONNECTING && state != State.STOPPING) { if (state == State.CONNECTED) {
stopRunner() stopRunner()
} }
} }
override def start(config: Config) { override def start(config: Config) {
if (state != State.CONNECTING && state != State.STOPPING) { if (state == State.STOPPED) {
startRunner(config) startRunner(config)
} }
} }
......
...@@ -150,7 +150,7 @@ class Shadowsocks ...@@ -150,7 +150,7 @@ class Shadowsocks
var fabProgressCircle: FABProgressCircle = _ var fabProgressCircle: FABProgressCircle = _
var progressDialog: ProgressDialog = _ var progressDialog: ProgressDialog = _
var progressTag = -1 var progressTag = -1
var state = State.INIT var state = State.STOPPED
var prepared = false var prepared = false
var currentProfile = new Profile var currentProfile = new Profile
var vpnEnabled = -1 var vpnEnabled = -1
...@@ -165,8 +165,6 @@ class Shadowsocks ...@@ -165,8 +165,6 @@ class Shadowsocks
if (!ShadowsocksApplication.settings.getBoolean(ShadowsocksApplication.getVersionName, false)) { if (!ShadowsocksApplication.settings.getBoolean(ShadowsocksApplication.getVersionName, false)) {
ShadowsocksApplication.settings.edit.putBoolean(ShadowsocksApplication.getVersionName, true).apply() ShadowsocksApplication.settings.edit.putBoolean(ShadowsocksApplication.getVersionName, true).apply()
recovery()
try { try {
// Workaround that convert port(String) to port(Int) // Workaround that convert port(String) to port(Int)
val oldLocalPort = ShadowsocksApplication.settings.getString("port", "-1") val oldLocalPort = ShadowsocksApplication.settings.getString("port", "-1")
...@@ -181,6 +179,8 @@ class Shadowsocks ...@@ -181,6 +179,8 @@ class Shadowsocks
} catch { } catch {
case ex: Exception => // Ignore case ex: Exception => // Ignore
} }
recovery()
} }
} }
......
...@@ -98,7 +98,6 @@ object Mode { ...@@ -98,7 +98,6 @@ object Mode {
} }
object State { object State {
val INIT = 0
val CONNECTING = 1 val CONNECTING = 1
val CONNECTED = 2 val CONNECTED = 2
val STOPPING = 3 val STOPPING = 3
......
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