Commit a3f44403 authored by Max Lv's avatar Max Lv

bump version

parent 0b8114ad
...@@ -5,8 +5,8 @@ import sbtandroid._ ...@@ -5,8 +5,8 @@ import sbtandroid._
import sbtandroid.AndroidPlugin._ import sbtandroid.AndroidPlugin._
object App { object App {
val version = "2.0.7" val version = "2.0.8"
val versionCode = 58 val versionCode = 59
} }
object General { object General {
......
...@@ -73,9 +73,6 @@ ...@@ -73,9 +73,6 @@
android:name=".ShadowsocksNatService" android:name=".ShadowsocksNatService"
android:process=":proxy" android:process=":proxy"
android:exported="false"> android:exported="false">
<intent-filter>
<action android:name="com.github.shadowsocks.ShadowsocksNatService"/>
</intent-filter>
</service> </service>
<service <service
...@@ -85,7 +82,6 @@ ...@@ -85,7 +82,6 @@
android:permission="android.permission.BIND_VPN_SERVICE" android:permission="android.permission.BIND_VPN_SERVICE"
android:exported="false"> android:exported="false">
<intent-filter> <intent-filter>
<action android:name="com.github.shadowsocks.ShadowsocksVpnService"/>
<action android:name="android.net.VpnService"/> <action android:name="android.net.VpnService"/>
</intent-filter> </intent-filter>
</service> </service>
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
<string name="forward_stop">后台服务已停止。</string> <string name="forward_stop">后台服务已停止。</string>
<string name="service_failed">请检查你的网络状态后并重试。</string> <string name="service_failed">请检查你的网络状态后并重试。</string>
<string name="stop">停止服务</string> <string name="stop">停止服务</string>
<string name="vpn_status">您仅能通过通知栏关闭 VPN 服务</string> <string name="vpn_status">推荐通过通知栏关闭 VPN 服务</string>
<string name="vpn_error">无法启动 VPN 服务:\"%s\"。看来和你的设备存在兼容性问题,请使用 Root 模式。</string> <string name="vpn_error">无法启动 VPN 服务:\"%s\"。看来和你的设备存在兼容性问题,请使用 Root 模式。</string>
<string name="ok_iknow">确定</string> <string name="ok_iknow">确定</string>
<string name="port_alert">端口号应大于1024</string> <string name="port_alert">端口号应大于1024</string>
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<string name="forward_stop">Shadowsocks stopped.</string> <string name="forward_stop">Shadowsocks stopped.</string>
<string name="service_failed">Please check your network status and try again.</string> <string name="service_failed">Please check your network status and try again.</string>
<string name="stop">Stop the service</string> <string name="stop">Stop the service</string>
<string name="vpn_status">You can only disable the VPN service through the notification bar.</string> <string name="vpn_status">Recommend to disable the VPN service through the notification bar.</string>
<string name="vpn_error">Unable to start VPN service: "%s". It seems to be a compatibility issue with your device. Please consider using ROOT mode instead.</string> <string name="vpn_error">Unable to start VPN service: "%s". It seems to be a compatibility issue with your device. Please consider using ROOT mode instead.</string>
<!-- alert category --> <!-- alert category -->
......
...@@ -610,8 +610,10 @@ class Shadowsocks ...@@ -610,8 +610,10 @@ class Shadowsocks
if (bgService == null) { if (bgService == null) {
val isRoot = status.getBoolean(Key.isRoot, false) val isRoot = status.getBoolean(Key.isRoot, false)
val s = if (isRoot) classOf[ShadowsocksNatService] else classOf[ShadowsocksVpnService] 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)
startService(new Intent(Shadowsocks.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 { ...@@ -253,7 +253,7 @@ class ShadowsocksNatService extends Service with BaseService {
} }
def onBind(intent: Intent): IBinder = { def onBind(intent: Intent): IBinder = {
if (classOf[ShadowsocksNatService].getName equals intent.getAction) { if (Action.SERVICE == intent.getAction) {
binder binder
} else { } else {
null null
......
...@@ -64,7 +64,9 @@ class ShadowsocksReceiver extends BroadcastReceiver { ...@@ -64,7 +64,9 @@ class ShadowsocksReceiver extends BroadcastReceiver {
val isAutoConnect: Boolean = settings.getBoolean(Key.isAutoConnect, false) val isAutoConnect: Boolean = settings.getBoolean(Key.isAutoConnect, false)
val isInstalled: Boolean = status.getBoolean(versionName, false) val isInstalled: Boolean = status.getBoolean(versionName, false)
if (isAutoConnect && isInstalled) { 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 { ...@@ -77,7 +77,9 @@ class ShadowsocksRunnerActivity extends Activity {
def attachService() { def attachService() {
if (bgService == null) { if (bgService == null) {
val s = if (isRoot) classOf[ShadowsocksNatService] else classOf[ShadowsocksVpnService] 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)) startService(new Intent(this, s))
} }
} }
......
...@@ -254,7 +254,7 @@ class ShadowsocksVpnService extends VpnService with BaseService { ...@@ -254,7 +254,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
val action = intent.getAction val action = intent.getAction
if (VpnService.SERVICE_INTERFACE == action) { if (VpnService.SERVICE_INTERFACE == action) {
return super.onBind(intent) return super.onBind(intent)
} else if (classOf[ShadowsocksVpnService].getName == action) { } else if (Action.SERVICE == action) {
return binder return binder
} }
null null
......
...@@ -59,7 +59,8 @@ object State { ...@@ -59,7 +59,8 @@ object State {
} }
object Action { object Action {
val SERVICE = "com.github.shadowsocks.SERVICE"
val CLOSE = "com.github.shadowsocks.CLOSE" val CLOSE = "com.github.shadowsocks.CLOSE"
val UPDATE_FRAGMENT = "com.github.shadowsocks.ACTION_UPDATE_FRAGMENT" val UPDATE_FRAGMENT = "com.github.shadowsocks.ACTION_UPDATE_FRAGMENT"
val UPDATE_PREFS = "com.github.shadowsocks.ACTION_UPDATE_PREFS" val UPDATE_PREFS = "com.github.shadowsocks.ACTION_UPDATE_PREFS"
} }
\ No newline at end of file
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