Commit 0edbe012 authored by Max Lv's avatar Max Lv

Fix #894

parent c87882e5
......@@ -118,6 +118,7 @@
<service
android:name=".ShadowsocksRunnerService"
android:process=":bg"
android:exported="false">
</service>
......@@ -147,7 +148,7 @@
</intent-filter>
</service>
<receiver android:name=".BootReceiver" android:enabled="false">
<receiver android:name=".BootReceiver" android:process=":bg" android:enabled="false">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
......
......@@ -53,5 +53,7 @@ object BootReceiver {
}
class BootReceiver extends BroadcastReceiver {
def onReceive(context: Context, intent: Intent) = Utils.startSsService(context)
def onReceive(context: Context, intent: Intent) = {
Utils.startSsService(context)
}
}
......@@ -259,7 +259,7 @@ object Utils {
}
def startSsService(context: Context) {
val isInstalled: Boolean = app.settings.getBoolean(BuildConfig.VERSION_NAME, false)
val isInstalled = app.settings.getInt(Key.currentVersionCode, -1) == BuildConfig.VERSION_CODE
if (!isInstalled) return
val intent = new Intent(context, classOf[ShadowsocksRunnerService])
......
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