prevent R8 shrinking from removing Tor’s private JNI fields

This commit is contained in:
Fabian Freund committed 2026-05-26 19:09:13 +02:00
1 parent 7e3c933bef
commit 99a1839f0e
2 files changed
+12

No files matched your search

@@ -56,6 +56,7 @@ android {
defaultConfig {
minSdk = 24
consumerProguardFiles("consumer-rules.pro")
}
dependencies {
@@ -0,0 +1,11 @@
####################################################################################################
# tor-android JNI
####################################################################################################
# libtor accesses these fields and native methods by their Java names/signatures.
# Release R8 shrinking can otherwise remove private fields that are only used from JNI.
-keep class org.torproject.jni.TorService {
long torConfiguration;
int torControlFd;
native <methods>;
}