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.
|
||
|---|---|---|
| .github | ||
| app | ||
| core | ||
| daemon | ||
| dex2oat | ||
| external | ||
| gradle | ||
| hiddenapi | ||
| magisk-loader | ||
| services | ||
| xposed | ||
| .gitattributes | ||
| .gitignore | ||
| .gitmodules | ||
| LICENSE | ||
| README.md | ||
| build.gradle.kts | ||
| crowdin.yml | ||
| gradle.properties | ||
| gradlew | ||
| gradlew.bat | ||
| settings.gradle.kts | ||
README.md
LSPosed Framework
Introduction
A Zygisk module trying to provide an ART hooking framework which delivers consistent APIs with the OG Xposed, leveraging LSPlant hooking framework.
Xposed is a framework for modules that can change the behavior of the system and apps without touching any APKs. That's great because it means that modules can work for different versions and even ROMs without any changes (as long as the original code was not changed too much). It's also easy to undo. As all changes are done in the memory, you just need to deactivate the module and reboot to get your original system back. There are many other advantages, but here is just one more: multiple modules can do changes to the same part of the system or app. With modified APKs, you have to choose one. No way to combine them, unless the author builds multiple APKs with different combinations.
Supported Versions
Android 8.1 ~ 16
Install
- Install Magisk v26+
- Download and install LSPosed in Magisk app
- Reboot
- Open LSPosed manager from notification
- Have fun :)
Download
- For stable releases, please go to Github Releases page
- For canary build, please check Github Actions
Note: debug builds are only available in Github Actions.
Get Help
Only bug reports from THE LATEST DEBUG BUILD will be accepted.
For Developers
Developers are welcome to write Xposed modules with hooks based on LSPosed Framework. A module based on LSPosed framework is fully compatible with the original Xposed Framework, and vice versa, a Xposed Framework-based module will work well with LSPosed framework too.
We use our own module repository. We welcome developers to submit modules to our repository, and then modules can be downloaded in LSPosed.
Community Discussion
Troubleshooting guide and Disscusions.
Translation Contributing
You can contribute translation here.
Credits
- Magisk: makes all these possible
- XposedBridge: the OG Xposed framework APIs
- LSPlant: the core ART hooking framework
- Dobby: inline hooker for
LSPlantandnative_apiimplement - EdXposed: fork source
- xz-embedded: decompress
.gnu_debugdataheader section of strippedlibart.so Riru: provides a way to inject code into zygote process- ~SandHook: ART hooking framework for SandHook variant~
- ~YAHFA: previous ART hooking framework~
- ~dexmaker and dalvikdx: to dynamically generate YAHFA hooker classes~
- ~DexBuilder: to dynamically generate YAHFA hooker classes~
License
LSPosed is licensed under the GNU General Public License v3 (GPL-3) (http://www.gnu.org/copyleft/gpl.html).