Skip to content

Commit 1d99e9b

Browse files
committed
Add note about possible issues due to Proguard optimizing out the Android component
1 parent 25041d1 commit 1d99e9b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ 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+
If your Android application makes use of Proguard for optimizations, its important to make sure that the Android verifier component isn't optimized
105+
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
106+
can do this for you:
107+
```text
108+
-keep, includedescriptorclasses class org.rustls.platformverifier.** { *; }
109+
```
110+
104111
#### Crate initialization
105112

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

0 commit comments

Comments
 (0)