-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android] The CertificateVerifier class not included in the output apk #36
Comments
Hi there @neevek, thanks for giving the project a try.
I think this is something I forgot in the current version of the README, sorry. Internally we used this to get it picked up by Gradle, let me know if this works for you: implementation 'rustls:rustls-platform-verifier' May I ask if you're using any proguard/optimization rules in your release builds as well? The verifier class appears entirely unused to optimization tools because no Java/Kotlin ever calls it, so its a prime candidate to get stripped without rules to allowlist it. FWIW we're working on re-doing the way the Android component is built and distributed in #32, which should hopefully make things much simpler long-term. |
Hi @complexspaces, thank you for the reply and for this great project. I am wondering if it is possible to do the verification directly from Rust through JNI, I mean without the |
Sorry the delay replying here. Its certainly possible to do purely through JNI but so far we haven't deemed it worthwhile because it would put a huge maintenance burden on that area of the code. The Kotlin code does a fair amount and trying to do all that through JNI would, AFAICT, result in a large mess of |
I think this can be closed, but if I'm mistaken and there is work to track here we can re-open. |
I followed the steps in the README to have added the
rustls-platform-verifier
module to my Android project, therustls
project and therustls-platform-verifier
module appear in the project view as expected. Then I tried./gradlew assembleRelease
from command line and directly build the project from inside Android Studio, all showed "BUILD SUCCESSFUL", but when I unzip the apk I can see all the class files from main project, but there's noorg.rustls.platformverifier.CertificateVerifier
class.I don't know how the
rustls-platform-verifier
module can be picked up when building my main module, there seems no connection between the verifier module and my main module.I tried adding the following in my app's
build.gradle
:Android Studio failed to build with:
The text was updated successfully, but these errors were encountered: