LSPosed/core
JingMatrix fc718e739b Implement hookClassInitializer API for static initializers (#535)
Since standard Java Reflection cannot access the `<clinit>` method (class's static initializer), we add a new native function, `HookBridge.getStaticInitializer`, which uses JNI `GetStaticMethodID` to retrieve a `Method` handle for it. The `LSPosedContext` API then passes this handle to the existing `doHook` machinery.

There are two possible exceptions thrown by the API:

- `IllegalArgumentException`: Thrown for user-level errors, such as attempting to hook a class that has no static initializer block (`static { ... }`). This is a predictable failure based on the provided class.

- `HookFailedError`: Thrown when the underlying native hooking engine (`lsplant`) fails to install the hook. This indicates a framework or environment-level issue (e.g., ART incompatibility, method inlining by the JIT/AOT compiler) and is not a fault in the module's logic.
2026-02-14 16:04:58 +01:00
..
src/main Implement hookClassInitializer API for static initializers (#535) 2026-02-14 16:04:58 +01:00
.gitignore Stablize CMake arguments (#2266) 2022-12-03 06:41:54 +00:00
build.gradle.kts Centralize dependencies and migrate to submodules (#512) 2026-01-22 15:13:06 +01:00
proguard-rules.pro Adapt LSPosedBridge to convention-based hooker discovery (#534) 2026-02-14 16:03:50 +01:00