libxposed API

repository·master·Indexed 20 days ago

https://github.com/libxposed/api

A modern, type-safe replacement for the legacy XposedBridge API used for building Xposed modules and frameworks. Includes integration guides for module and framework developers, including dependency configuration and ProGuard/R8 rules for preserving module entry classes.

Tokens
431
Snippets
3
Records
3
Agent score
21%

What's inside libxposed-api

  1. Integrate libxposed API as a Module Developer

    master

    To develop an Xposed module using the modern API, add the api dependency using compileOnly. This ensures the API is available during compilation but is not bundled into your module's APK, as the framework will provide it at runtime.

    If you are using ProGuard or R8 for minification, you must include specific rules to prevent your module entry class (the one extending XposedModule) from being obfuscated or removed, and to ensure the META-INF/xposed/java_init.list file is correctly updated.

    dependencies {
        compileOnly("io.github.libxposed:api:102.0.0")
    }
  2. Integrate libxposed API as a Framework Developer

    master

    If you are developing a framework that implements the libxposed API, add the dependency using implementation so the API is included in your framework build.

    dependencies {
        implementation("io.github.libxposed:api:102.0.0")
    }
  3. Configure ProGuard/R8 rules for libxposed modules

    master

    Add the following rules to your ProGuard or R8 configuration to support libxposed modules. These rules prevent the removal of module entry classes and ensure the java_init.list resource is correctly adapted when classes are obfuscated.

    -dontwarn io.github.libxposed.annotation.**
    -adaptresourcefilecontents META-INF/xposed/java_init.list
    -keep,allowoptimization,allowobfuscation public class * extends io.github.libxposed.api.XposedModule {
        public <init>();
    }