Skip to content

Commit

Permalink
fix(core): adjust ProGuard rules (#6588)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Mar 31, 2023
1 parent 56fa900 commit adf4627
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changes/fix-proguard-rules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri": patch
---

Fixes ProGuard rules.
12 changes: 11 additions & 1 deletion core/tauri/mobile/android/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
-keep class app.tauri.** {
@app.tauri.JniMethod public <methods>;
native <methods>;
}

-keep class app.tauri.JSArray,app.tauri.JSObject {
-keep class app.tauri.plugin.JSArray {
public <init>(...);
}

-keepclassmembers class org.json.JSONArray {
public put(...);
}

-keep class app.tauri.plugin.JSObject {
public <init>(...);
public put(...);
}

-keep @app.tauri.annotation.TauriPlugin public class * {
@app.tauri.annotation.Command public <methods>;
@app.tauri.annotation.PermissionCallback <methods>;
Expand Down
8 changes: 7 additions & 1 deletion core/tauri/mobile/proguard-tauri.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.

-keep class $PACKAGE.TauriActivity {
-keep class $PACKAGE.* {
native <methods>;
}

-keepclassmembers class $PACKAGE.TauriActivity {
getAppClass(...);
getVersion();
}
Expand All @@ -22,3 +26,5 @@
-keep class $PACKAGE.MainActivity {
public getPluginManager();
}

-keep class androidx.appcompat.app.AppCompatActivity { }

0 comments on commit adf4627

Please sign in to comment.