bump version
This commit is contained in:
@@ -610,8 +610,10 @@ class Shadowsocks
|
||||
if (bgService == null) {
|
||||
val isRoot = status.getBoolean(Key.isRoot, false)
|
||||
val s = if (isRoot) classOf[ShadowsocksNatService] else classOf[ShadowsocksVpnService]
|
||||
bindService(new Intent(s.getName), connection, Context.BIND_AUTO_CREATE)
|
||||
startService(new Intent(Shadowsocks.this, s))
|
||||
val intent = new Intent(this, s)
|
||||
intent.setAction(Action.SERVICE)
|
||||
bindService(intent, connection, Context.BIND_AUTO_CREATE)
|
||||
startService(new Intent(this, s))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -253,7 +253,7 @@ class ShadowsocksNatService extends Service with BaseService {
|
||||
}
|
||||
|
||||
def onBind(intent: Intent): IBinder = {
|
||||
if (classOf[ShadowsocksNatService].getName equals intent.getAction) {
|
||||
if (Action.SERVICE == intent.getAction) {
|
||||
binder
|
||||
} else {
|
||||
null
|
||||
|
||||
@@ -64,7 +64,9 @@ class ShadowsocksReceiver extends BroadcastReceiver {
|
||||
val isAutoConnect: Boolean = settings.getBoolean(Key.isAutoConnect, false)
|
||||
val isInstalled: Boolean = status.getBoolean(versionName, false)
|
||||
if (isAutoConnect && isInstalled) {
|
||||
context.startActivity(new Intent(context, classOf[ShadowsocksRunnerActivity]))
|
||||
val intent = new Intent(context, classOf[ShadowsocksRunnerActivity])
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
context.startActivity(intent)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,9 @@ class ShadowsocksRunnerActivity extends Activity {
|
||||
def attachService() {
|
||||
if (bgService == null) {
|
||||
val s = if (isRoot) classOf[ShadowsocksNatService] else classOf[ShadowsocksVpnService]
|
||||
bindService(new Intent(s.getName), connection, Context.BIND_AUTO_CREATE)
|
||||
val intent = new Intent(this, s)
|
||||
intent.setAction(Action.SERVICE)
|
||||
bindService(intent, connection, Context.BIND_AUTO_CREATE)
|
||||
startService(new Intent(this, s))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
|
||||
val action = intent.getAction
|
||||
if (VpnService.SERVICE_INTERFACE == action) {
|
||||
return super.onBind(intent)
|
||||
} else if (classOf[ShadowsocksVpnService].getName == action) {
|
||||
} else if (Action.SERVICE == action) {
|
||||
return binder
|
||||
}
|
||||
null
|
||||
|
||||
@@ -59,7 +59,8 @@ object State {
|
||||
}
|
||||
|
||||
object Action {
|
||||
val SERVICE = "com.github.shadowsocks.SERVICE"
|
||||
val CLOSE = "com.github.shadowsocks.CLOSE"
|
||||
val UPDATE_FRAGMENT = "com.github.shadowsocks.ACTION_UPDATE_FRAGMENT"
|
||||
val UPDATE_PREFS = "com.github.shadowsocks.ACTION_UPDATE_PREFS"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user