Fix #894
This commit is contained in:
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user