Skip to content

Commit c8e8d84

Browse files
committed
Add note about possible issues due to Proguard optimizing out the Android component
1 parent 3e7a309 commit c8e8d84

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,15 @@ successfully, resulting in a `rustls` group appearing in Android Studio's projec
101101
After this, everything should be ready to use. Future updates of `rustls-platform-verifier` won't need any maintenance beyond the
102102
expected `cargo update`.
103103

104+
#### Proguard
105+
106+
If your Android application makes use of Proguard for optimizations, its important to make sure that the Android verifier component isn't optimized
107+
out because it looks like dead code. Proguard is unable to see any JNI usage, so your rules must manually opt into keeping it. THe following rule
108+
can do this for you:
109+
```text
110+
-keep, includedescriptorclasses class org.rustls.platformverifier.** { *; }
111+
```
112+
104113
#### Crate initialization
105114

106115
In order for the crate to call into the JVM, it needs handles from Android. These

0 commit comments

Comments
 (0)