[core] service client as inheritable for better compatibility (#761)
This commit is contained in:
parent
44079d2c56
commit
bcd7f99de5
|
|
@ -0,0 +1,33 @@
|
|||
package org.lsposed.lspd.config;
|
||||
|
||||
import android.os.IBinder;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
|
||||
import org.lsposed.lspd.service.ILSPApplicationService;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
abstract public class ApplicationServiceClient implements ILSPApplicationService {
|
||||
|
||||
public static ApplicationServiceClient serviceClient = null;
|
||||
|
||||
@Override
|
||||
abstract public IBinder requestModuleBinder();
|
||||
|
||||
@Override
|
||||
abstract public IBinder requestManagerBinder(String packageName);
|
||||
|
||||
@Override
|
||||
abstract public boolean isResourcesHookEnabled();
|
||||
|
||||
@Override
|
||||
abstract public Map getModulesList(String processName);
|
||||
|
||||
abstract public Map<String, String> getModulesList();
|
||||
|
||||
@Override
|
||||
abstract public String getPrefsPath(String packageName);
|
||||
|
||||
@Override
|
||||
abstract public ParcelFileDescriptor getModuleLogger();
|
||||
}
|
||||
|
|
@ -29,13 +29,12 @@ import org.lsposed.lspd.util.Utils;
|
|||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
public class LSPApplicationServiceClient implements ILSPApplicationService {
|
||||
public class LSPApplicationServiceClient extends ApplicationServiceClient {
|
||||
static ILSPApplicationService service = null;
|
||||
static IBinder serviceBinder = null;
|
||||
|
||||
static String processName = null;
|
||||
|
||||
public static LSPApplicationServiceClient serviceClient = null;
|
||||
private static final IBinder.DeathRecipient recipient = new IBinder.DeathRecipient() {
|
||||
@Override
|
||||
public void binderDied() {
|
||||
|
|
@ -96,6 +95,7 @@ public class LSPApplicationServiceClient implements ILSPApplicationService {
|
|||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getModulesList() {
|
||||
return getModulesList(processName);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ public class Main {
|
|||
}
|
||||
}
|
||||
|
||||
private static void forkPostCommon(boolean isSystem, String appDataDir, String niceName) {
|
||||
public static void forkPostCommon(boolean isSystem, String appDataDir, String niceName) {
|
||||
// init logger
|
||||
YahfaHooker.init();
|
||||
ModuleLogger.initLogger(serviceClient.getModuleLogger());
|
||||
|
|
|
|||
Loading…
Reference in New Issue