chore: add hook counter
This commit is contained in:
@@ -77,6 +77,7 @@ import io.github.qauxv.startup.HybridClassLoader
|
||||
import io.github.qauxv.tlb.ConfigTable.cacheMap
|
||||
import io.github.qauxv.ui.CustomDialog
|
||||
import io.github.qauxv.util.Initiator
|
||||
import io.github.qauxv.util.LoaderExtensionHelper
|
||||
import io.github.qauxv.util.Natives
|
||||
import io.github.qauxv.util.Toasts
|
||||
import io.github.qauxv.util.dexkit.DexKit
|
||||
@@ -492,6 +493,7 @@ class TroubleshootFragment : BaseRootLayoutFragment() {
|
||||
}
|
||||
statusInfo += "XposedBridge: " + (if (xp != null) xp.name else "null") + "\n"
|
||||
statusInfo += hook.frameworkName + " " + hook.frameworkVersion + " (" + hook.frameworkVersionCode + ")\n"
|
||||
statusInfo += "Hook counter: " + LoaderExtensionHelper.getHookCounter();
|
||||
return statusInfo
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ import io.github.qauxv.poststartup.StartupInfo;
|
||||
public class LoaderExtensionHelper {
|
||||
|
||||
public static final String CMD_GET_XPOSED_BRIDGE_CLASS = "GetXposedBridgeClass";
|
||||
public static final String CMD_HOOK_COUNTER = "GetHookCounter";
|
||||
private static String sProbeLsposedNativeApiClassName = "Lorg/lsposed/lspd/nativebridge/NativeAPI;";
|
||||
|
||||
private LoaderExtensionHelper() {
|
||||
@@ -53,4 +54,14 @@ public class LoaderExtensionHelper {
|
||||
}
|
||||
}
|
||||
|
||||
public static int getHookCounter() {
|
||||
ILoaderInfo loaderInfo = StartupInfo.getLoaderInfo();
|
||||
Number n = (Number) loaderInfo.queryExtension(CMD_HOOK_COUNTER);
|
||||
if (n != null) {
|
||||
return n.intValue();
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -44,6 +44,8 @@ public class Lsp100ExtCmd {
|
||||
return null;
|
||||
case "GetInitErrors":
|
||||
return ModuleLoader.getInitErrors();
|
||||
case "GetHookCounter":
|
||||
return Lsp100HookWrapper.getHookCounter();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -390,4 +390,8 @@ public class Lsp100HookWrapper {
|
||||
|
||||
}
|
||||
|
||||
public static int getHookCounter() {
|
||||
return (int) (sNextHookId.get() - 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@ public class Xp51ExtCmd {
|
||||
return Xp51HookEntry.getInitZygoteStartupParam();
|
||||
case "GetInitErrors":
|
||||
return ModuleLoader.getInitErrors();
|
||||
case "GetHookCounter":
|
||||
return Xp51HookWrapper.getHookCounter();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -169,4 +169,8 @@ public class Xp51HookWrapper {
|
||||
|
||||
}
|
||||
|
||||
public static int getHookCounter() {
|
||||
return (int) (sNextHookId.get() - 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user