mirror of
https://github.com/greenart7c3/Amber.git
synced 2026-10-30 06:47:33 +00:00
Built-in Tor now runs Arti 2.7.0 (Tor in Rust) in-process through a small JNI wrapper (tools/arti, adapted from Amethyst's tools/arti-build) instead of the kmp-tor C tor daemon. TorManager keeps its public API, status flow, notification and restart behaviour on both platforms. - Prebuilt libraries are committed: Android (src/tor/jniLibs, all four ABIs, shared by the free and benchmark flavors) and desktop (appResources for Linux x64/arm64, Windows x64, macOS x64/arm64, shipped as Compose app resources). tools/arti/build.sh rebuilds them reproducibly. - Patch saturating-time 0.5.0 (used by tor-netdoc): its find_limit loops forever on Windows, where SystemTime has 100ns resolution, hanging the bootstrap at 15%. - Log callbacks attach native threads scoped, so they don't keep the desktop JVM alive on quit. - Reproducibility: pin the NDK AGP strips native libraries with, install it in the verification Dockerfile, and ship libamber_arti.so unstripped so the APK copy is byte-identical to the committed file.
83 lines
3.3 KiB
Prolog
83 lines
3.3 KiB
Prolog
# Add project specific ProGuard rules here.
|
|
# You can control the set of applied configuration files using the
|
|
# proguardFiles setting in build.gradle.
|
|
#
|
|
# For more details, see
|
|
# http://developer.android.com/guide/developing/tools/proguard.html
|
|
|
|
# preserve the line number information for debugging stack traces.
|
|
-dontobfuscate
|
|
-keepattributes LocalVariableTable
|
|
-keepattributes LocalVariableTypeTable
|
|
-keepattributes *Annotation*
|
|
-keepattributes SourceFile
|
|
-keepattributes LineNumberTable
|
|
-keepattributes Signature
|
|
-keepattributes Exceptions
|
|
-keepattributes InnerClasses
|
|
-keepattributes EnclosingMethod
|
|
-keepattributes MethodParameters
|
|
-keepparameternames
|
|
|
|
-keepdirectories libs
|
|
|
|
# Keep all names
|
|
-keepnames class ** { *; }
|
|
|
|
# Keep All enums
|
|
-keep enum ** { *; }
|
|
|
|
# preserve access to native classses
|
|
-keep class fr.acinq.secp256k1.** { *; }
|
|
|
|
# Arti (built-in Tor): JNI entry points, and the log callback the native side calls by name
|
|
-keep class com.greenart7c3.nostrsigner.tor.ArtiNative { native <methods>; }
|
|
-keep interface com.greenart7c3.nostrsigner.tor.ArtiLogCallback { *; }
|
|
-keep class * implements com.greenart7c3.nostrsigner.tor.ArtiLogCallback { public void onLogLine(java.lang.String); }
|
|
|
|
# JNA For Libsodium
|
|
-keep class com.goterl.lazysodium.** { *; }
|
|
|
|
# libscrypt
|
|
-keep class com.lambdaworks.codec.** { *; }
|
|
-keep class com.lambdaworks.crypto.** { *; }
|
|
-keep class com.lambdaworks.jni.** { *; }
|
|
|
|
# JNA also requires AWT, which Android does not have. So the classes are broken down to filter AWT out
|
|
-keep class com.sun.jna.ToNativeConverter { *; }
|
|
-keep class com.sun.jna.NativeMapped { *; }
|
|
-keep class com.sun.jna.CallbackReference { *; }
|
|
-keep class com.sun.jna.ptr.IntByReference { *; }
|
|
-keep class com.sun.jna.NativeLong { *; }
|
|
-keep class com.sun.jna.Structure { *; }
|
|
-keep class com.sun.jna.Structure$* { *; }
|
|
-keep class com.sun.jna.Native$ffi_callback { *; }
|
|
-keep class * implements com.sun.jna.Structure$* { *; }
|
|
-keep class * implements com.sun.jna.Native$* { *; }
|
|
-keep class com.sun.jna.Native {
|
|
private static com.sun.jna.NativeMapped fromNative(java.lang.Class, java.lang.Object);
|
|
private static com.sun.jna.NativeMapped fromNative(java.lang.reflect.Method, java.lang.Object);
|
|
private static java.lang.Class nativeType(java.lang.Class);
|
|
private static java.lang.Object toNative(com.sun.jna.ToNativeConverter, java.lang.Object);
|
|
private static java.lang.Object fromNative(com.sun.jna.FromNativeConverter, java.lang.Object, java.lang.reflect.Method);
|
|
}
|
|
|
|
# JSON parsing
|
|
-keep class com.vitorpamplona.quartz.crypto.** { *; }
|
|
-keep class com.vitorpamplona.quartz.encoders.** { *; }
|
|
-keep class com.vitorpamplona.quartz.events.** { *; }
|
|
-keep class com.vitorpamplona.amethyst.model.** { *; }
|
|
-keep class com.vitorpamplona.amethyst.service.** { *; }
|
|
-keep class com.greenart7c3.nostrsigner.models.** { *; }
|
|
-keep class com.greenart7c3.nostrsigner.service.** { *; }
|
|
|
|
-dontwarn edu.umd.cs.findbugs.annotations.NonNull
|
|
-dontwarn edu.umd.cs.findbugs.annotations.Nullable
|
|
-dontwarn edu.umd.cs.findbugs.annotations.SuppressFBWarnings
|
|
-dontwarn java.lang.instrument.ClassDefinition
|
|
-dontwarn java.lang.instrument.UnmodifiableClassException
|
|
-dontwarn com.google.errorprone.annotations.Immutable
|
|
|
|
-dontwarn java.lang.management.ManagementFactory
|
|
-dontwarn java.lang.management.RuntimeMXBean
|