Update api

This commit is contained in:
Nullptr 2023-01-16 22:10:42 +08:00 committed by LoveSy
parent 295b0ee0ce
commit e1e716b52f
3 changed files with 6 additions and 33 deletions

View File

@ -69,8 +69,8 @@ public class LoadedApkGetCLHooker extends XC_MethodHook {
String packageName = ActivityThread.currentPackageName();
String processName = ActivityThread.currentProcessName();
boolean isFirstApplication = packageName != null && processName != null && packageName.equals(loadedApk.getPackageName());
if (!isFirstApplication) {
boolean isFirstPackage = packageName != null && processName != null && packageName.equals(loadedApk.getPackageName());
if (!isFirstPackage) {
packageName = loadedApk.getPackageName();
processName = AndroidAppHelper.currentProcessName();
} else if (packageName.equals("android")) {
@ -91,11 +91,11 @@ public class LoadedApkGetCLHooker extends XC_MethodHook {
lpparam.processName = processName;
lpparam.classLoader = classLoader;
lpparam.appInfo = loadedApk.getApplicationInfo();
lpparam.isFirstApplication = isFirstApplication;
lpparam.isFirstApplication = isFirstPackage;
hookNewXSP(lpparam);
Hookers.logD("Call handleLoadedPackage: packageName=" + lpparam.packageName + " processName=" + lpparam.processName + " isFirstApplication=" + isFirstApplication + " classLoader=" + lpparam.classLoader + " appInfo=" + lpparam.appInfo);
Hookers.logD("Call handleLoadedPackage: packageName=" + lpparam.packageName + " processName=" + lpparam.processName + " isFirstPackage=" + isFirstPackage + " classLoader=" + lpparam.classLoader + " appInfo=" + lpparam.appInfo);
XC_LoadPackage.callAll(lpparam);
LSPosedContext.callOnPackageLoaded(new XposedModuleInterface.PackageLoadedParam() {
@ -118,14 +118,8 @@ public class LoadedApkGetCLHooker extends XC_MethodHook {
}
@Override
public boolean isFirstApplication() {
return isFirstApplication;
}
@Nullable
@Override
public Bundle getExtras() {
return null;
public boolean isFirstPackage() {
return isFirstPackage;
}
});
} catch (Throwable t) {

View File

@ -22,10 +22,7 @@ package org.lsposed.lspd.hooker;
import static org.lsposed.lspd.util.Utils.logD;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import org.lsposed.lspd.impl.LSPosedContext;
import org.lsposed.lspd.util.Hookers;
@ -59,12 +56,6 @@ public class StartBootstrapServicesHooker extends XC_MethodHook {
public ClassLoader getClassLoader() {
return HandleSystemServerProcessHooker.systemServerCL;
}
@Override
@Nullable
public Bundle getExtras() {
return null;
}
});
} catch (Throwable t) {
Hookers.logE("error when hooking startBootstrapServices", t);

View File

@ -179,18 +179,6 @@ public class LSPosedContext extends XposedContext {
public String getProcessName() {
return processName;
}
@NonNull
@Override
public String getAppDataDir() {
return appDir;
}
@Nullable
@Override
public Bundle getExtras() {
return null;
}
});
modules.add(moduleContext);
} catch (Throwable e) {