Skip to content

Commit 45e7c5c

Browse files
committed
Update proguard-rules.pro
1 parent c4acb6e commit 45e7c5c

2 files changed

Lines changed: 20 additions & 3 deletions

File tree

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ dependencies {
1717
}
1818
```
1919

20+
If minification is enabled, add these rules to the app's ProGuard/R8 configuration:
21+
22+
```proguard
23+
-dontwarn io.github.libxposed.annotation.**
24+
-adaptresourcefilecontents META-INF/xposed/java_init.list
25+
-keep,allowoptimization,allowobfuscation public class * extends io.github.libxposed.api.XposedModule {
26+
public <init>();
27+
}
28+
```
29+
30+
These rules keep module entry classes from being removed and rewrite `META-INF/xposed/java_init.list` when entry classes are obfuscated.
31+
2032
### For Framework Developers
2133

2234
```kotlin

api/proguard-rules.pro

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
# These rules are for the framework. Module rules should refer to README.md.
12
-dontwarn io.github.libxposed.annotation.**
2-
-adaptresourcefilecontents META-INF/xposed/java_init.list
3-
-keep,allowoptimization,allowobfuscation public class * extends io.github.libxposed.api.XposedModule {
4-
public <init>();
3+
-keep,allowoptimization public class io.github.libxposed.api.** {
4+
public <fields>;
5+
protected <fields>;
6+
public <methods>;
7+
protected <methods>;
8+
public <init>(...);
9+
protected <init>(...);
510
}

0 commit comments

Comments
 (0)