| @@ -43,10 +43,15 @@ public class DaemonService extends Service { | |||||
| @Override | @Override | ||||
| public void onCreate() { | public void onCreate() { | ||||
| super.onCreate(); | super.onCreate(); | ||||
| log("created"); | |||||
| } | |||||
| @Override | |||||
| public int onStartCommand(Intent intent, int flags, int startId) { | |||||
| log("started"); | |||||
| //利用 Android 漏洞提高进程优先级, 前台进程 | //利用 Android 漏洞提高进程优先级, 前台进程 | ||||
| String CHANNEL_ONE_ID = "CHANNEL_ONE_ID"; | |||||
| String CHANNEL_ONE_NAME= "CHANNEL_ONE_ID"; | |||||
| String CHANNEL_ONE_ID = "DaemonService"; | |||||
| String CHANNEL_ONE_NAME= "DaemonService"; | |||||
| NotificationChannel notificationChannel= null; | NotificationChannel notificationChannel= null; | ||||
| //进行8.0的判断 | //进行8.0的判断 | ||||
| if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { | if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { | ||||
| @@ -64,11 +69,6 @@ public class DaemonService extends Service { | |||||
| notification.flags|= Notification.FLAG_NO_CLEAR; | notification.flags|= Notification.FLAG_NO_CLEAR; | ||||
| startForeground(CORE_SERVICE_ID, notification); | startForeground(CORE_SERVICE_ID, notification); | ||||
| } | |||||
| @Override | |||||
| public int onStartCommand(Intent intent, int flags, int startId) { | |||||
| log("started"); | |||||
| executorService.submit(new Runnable() { | executorService.submit(new Runnable() { | ||||
| @Override | @Override | ||||
| public void run() { | public void run() { | ||||