diff --git a/core/src/main/java/org/lsposed/lspd/service/ServiceManager.java b/core/src/main/java/org/lsposed/lspd/service/ServiceManager.java index e7f2d4a0..dfc32dd1 100644 --- a/core/src/main/java/org/lsposed/lspd/service/ServiceManager.java +++ b/core/src/main/java/org/lsposed/lspd/service/ServiceManager.java @@ -19,15 +19,12 @@ package org.lsposed.lspd.service; -import android.app.ActivityThread; import android.content.Context; import android.ddm.DdmHandleAppName; -import android.os.Build; import android.os.IBinder; import android.os.IServiceManager; import android.os.Looper; import android.os.Process; -import android.os.StrictMode; import android.system.Os; import android.util.Log; @@ -36,6 +33,7 @@ import com.android.internal.os.BinderInternal; import org.lsposed.lspd.BuildConfig; import java.util.concurrent.ConcurrentHashMap; + import hidden.HiddenApiBridge; public class ServiceManager { @@ -44,7 +42,6 @@ public class ServiceManager { private static LSPApplicationService applicationService = null; private static LSPManagerService managerService = null; private static LSPSystemServerService systemServerService = null; - private static Context systemContext = null; public static final String TAG = "LSPosedService"; private static void waitSystemService(String name) { @@ -90,7 +87,7 @@ public class ServiceManager { Process.killProcess(Os.getppid()); - createSystemContext(); + DdmHandleAppName.setAppName("lspd", 0); waitSystemService("package"); waitSystemService("activity"); @@ -151,23 +148,4 @@ public class ServiceManager { return systemServerService.systemServerRequested(); } - private static void createSystemContext() { - ActivityThread activityThread = ActivityThread.systemMain(); - systemContext = activityThread.getSystemContext(); - systemContext.setTheme(android.R.style.Theme_DeviceDefault_Light_DarkActionBar); - DdmHandleAppName.setAppName("lspd", 0); - var vmPolicy = new StrictMode.VmPolicy.Builder(); - if (BuildConfig.DEBUG) { - vmPolicy.detectAll().penaltyLog(); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { - vmPolicy.penaltyListener(systemContext.getMainExecutor(), - v -> Log.w(TAG, v.getMessage(), v)); - } - } - StrictMode.setVmPolicy(vmPolicy.build()); - } - - public static Context getSystemContext() { - return systemContext; - } }