886d3ece18
Adds an opt-in Tor mode that routes all app traffic through a local SOCKS5 proxy backed by arti (Tor in Rust), bundled via the org.torproject:arti-mobile:1.7.0.1 AAR. - TorController starts/stops arti and installs a fail-closed WebView proxy override (no direct fallback) so traffic can't leak while Tor is connecting or down. Connectivity is verified against check.torproject.org (IsTor) and re-checked continuously; the exit IP is surfaced for verification, and the status isn't latched so a dropped circuit downgrades honestly. - TorPlugin bridges enable/disable/status to the Capacitor/JS layer. Toggling applies live, in place, with no app restart. - UI: a slim fail-closed status banner (replacing the old full-screen gate), the Tor toggle in Advanced settings reachable while logged out, and Settings/Search/About added to the logged-out menu. - R8 keep rules for org.torproject.arti.** so the JNI native-method classes aren't stripped/renamed; androidx.webkit on the compile classpath for the WebView proxy APIs.
89 lines
3.7 KiB
Groovy
89 lines
3.7 KiB
Groovy
apply plugin: 'com.android.application'
|
|
|
|
def keystorePropertiesFile = rootProject.file("key.properties")
|
|
def keystoreProperties = new Properties()
|
|
if (keystorePropertiesFile.exists()) {
|
|
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
|
}
|
|
|
|
android {
|
|
namespace = "spot.agora.app"
|
|
compileSdk = rootProject.ext.compileSdkVersion
|
|
defaultConfig {
|
|
applicationId "spot.agora.app"
|
|
minSdkVersion rootProject.ext.minSdkVersion
|
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
|
versionCode 1
|
|
versionName "2.8.9"
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
// The arti-mobile AAR bundles large native Rust libraries for every
|
|
// ABI (~45 MB total). Restrict to the ABIs we actually ship/test:
|
|
// arm64-v8a + armeabi-v7a (real devices) and x86_64 (emulators).
|
|
// Drop x86_64 here if you only ever test on physical devices.
|
|
ndk {
|
|
abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86_64'
|
|
}
|
|
aaptOptions {
|
|
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
|
|
// Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61
|
|
ignoreAssetsPattern = '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
|
|
}
|
|
}
|
|
signingConfigs {
|
|
release {
|
|
if (keystorePropertiesFile.exists()) {
|
|
keyAlias keystoreProperties['keyAlias']
|
|
keyPassword keystoreProperties['keyPassword']
|
|
storeFile file(keystoreProperties['storeFile'])
|
|
storePassword keystoreProperties['storePassword']
|
|
}
|
|
}
|
|
}
|
|
buildTypes {
|
|
release {
|
|
signingConfig signingConfigs.release
|
|
minifyEnabled true
|
|
shrinkResources true
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
}
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
flatDir{
|
|
dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
|
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
|
implementation "androidx.core:core:$androidxCoreVersion"
|
|
implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
|
|
implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion"
|
|
implementation project(':capacitor-android')
|
|
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
|
|
// Tor in Rust (arti) — prebuilt AAR from Guardian Project's gpmaven repo.
|
|
// Provides org.torproject.arti.ArtiProxy used by TorController.
|
|
implementation 'org.torproject:arti-mobile:1.7.0.1'
|
|
// arti pulls androidx.webkit in transitively but only at runtime; we
|
|
// compile against ProxyController/WebViewFeature in TorController, so
|
|
// declare it explicitly on the app's compile classpath.
|
|
implementation "androidx.webkit:webkit:$androidxWebkitVersion"
|
|
testImplementation "junit:junit:$junitVersion"
|
|
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
|
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
|
implementation project(':capacitor-cordova-android-plugins')
|
|
}
|
|
|
|
apply from: 'capacitor.build.gradle'
|
|
|
|
try {
|
|
def servicesJSON = file('google-services.json')
|
|
if (servicesJSON.text) {
|
|
apply plugin: 'com.google.gms.google-services'
|
|
}
|
|
} catch(Exception e) {
|
|
logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
|
|
}
|