From c8e8d84aeea63a2d7f652eaf36be0327f7299fbb Mon Sep 17 00:00:00 2001 From: ComplexSpaces Date: Fri, 8 Sep 2023 02:48:17 -0500 Subject: [PATCH] Add note about possible issues due to Proguard optimizing out the Android component --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index c3626b0e..57e29f9d 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,15 @@ successfully, resulting in a `rustls` group appearing in Android Studio's projec After this, everything should be ready to use. Future updates of `rustls-platform-verifier` won't need any maintenance beyond the expected `cargo update`. +#### Proguard + +If your Android application makes use of Proguard for optimizations, its important to make sure that the Android verifier component isn't optimized +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 +can do this for you: +```text +-keep, includedescriptorclasses class org.rustls.platformverifier.** { *; } +``` + #### Crate initialization In order for the crate to call into the JVM, it needs handles from Android. These