From 5951cef1328e30d16b96807c5ae678e7f9634bf8 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 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 6226481a..52d7c9b8 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,13 @@ new releases of `rustls-platform-verifier` are published. If you only use publis These script snippets can be tweaked as best suits your project, but the `cargo metadata` invocation must be included so that the Android implementation part can be located on disk. +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: +``` +-keep, includedescriptorclasses class org.rustls.platformverifier.** { *; } +``` + #### Crate initialization In order for the crate to call into the JVM, it needs handles from Android. These