mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-07-24 21:45:21 +00:00
* feat: Build and release per-architecture APKs This commit modifies the build process to generate separate APKs for different CPU architectures (arm64-v8a, x86_64) and a universal APK. This allows for smaller, optimized downloads for users and provides specific builds for platforms like Chromebooks. Key changes: - In `app/build.gradle.kts`, enables ABI splits to create `arm64-v8a`, `x86_64`, and `universal` APKs during the `assembleRelease` task. - Updates the `release.yml` GitHub Actions workflow to rename and upload each of these APKs as distinct release assets. - Removes the previous `arm64-v8a` only filter to allow for multi-architecture builds. * feat: Allow manual triggering of Android CI workflow This adds the `workflow_dispatch` event to the `android-build.yml` GitHub Actions workflow. This change enables the Android CI pipeline to be run manually from the GitHub UI, in addition to the existing triggers for pushes and pull requests.
147 lines
4.1 KiB
Kotlin
147 lines
4.1 KiB
Kotlin
plugins {
|
|
alias(libs.plugins.android.application)
|
|
alias(libs.plugins.kotlin.android)
|
|
alias(libs.plugins.kotlin.parcelize)
|
|
alias(libs.plugins.kotlin.compose)
|
|
}
|
|
|
|
android {
|
|
namespace = "com.bitchat.android"
|
|
compileSdk = libs.versions.compileSdk.get().toInt()
|
|
|
|
defaultConfig {
|
|
applicationId = "com.bitchat.droid"
|
|
minSdk = libs.versions.minSdk.get().toInt()
|
|
targetSdk = libs.versions.targetSdk.get().toInt()
|
|
versionCode = 29
|
|
versionName = "1.6.0"
|
|
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
vectorDrawables {
|
|
useSupportLibrary = true
|
|
}
|
|
}
|
|
|
|
dependenciesInfo {
|
|
// Disables dependency metadata when building APKs.
|
|
includeInApk = false
|
|
// Disables dependency metadata when building Android App Bundles.
|
|
includeInBundle = false
|
|
}
|
|
|
|
buildTypes {
|
|
debug {
|
|
ndk {
|
|
// Include x86_64 for emulator support during development
|
|
abiFilters += listOf("arm64-v8a", "x86_64")
|
|
}
|
|
}
|
|
release {
|
|
isMinifyEnabled = true
|
|
isShrinkResources = true
|
|
proguardFiles(
|
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
"proguard-rules.pro"
|
|
)
|
|
}
|
|
}
|
|
|
|
// APK splits for GitHub releases - creates arm64, x86_64, and universal APKs
|
|
// AAB for Play Store handles architecture distribution automatically
|
|
splits {
|
|
abi {
|
|
isEnable = true
|
|
reset()
|
|
include("arm64-v8a", "x86_64")
|
|
isUniversalApk = true // For F-Droid and fallback
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
|
}
|
|
kotlinOptions {
|
|
jvmTarget = "1.8"
|
|
}
|
|
buildFeatures {
|
|
compose = true
|
|
}
|
|
packaging {
|
|
resources {
|
|
excludes += "/META-INF/{AL2.0,LGPL2.1}"
|
|
}
|
|
}
|
|
lint {
|
|
baseline = file("lint-baseline.xml")
|
|
abortOnError = false
|
|
checkReleaseBuilds = false
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
// Core Android dependencies
|
|
implementation(libs.androidx.core.ktx)
|
|
implementation(libs.androidx.activity.compose)
|
|
implementation(libs.androidx.appcompat)
|
|
|
|
// Compose
|
|
implementation(platform(libs.androidx.compose.bom))
|
|
implementation(libs.bundles.compose)
|
|
|
|
// Lifecycle
|
|
implementation(libs.bundles.lifecycle)
|
|
implementation(libs.androidx.lifecycle.process)
|
|
|
|
// Navigation
|
|
implementation(libs.androidx.navigation.compose)
|
|
|
|
// Permissions
|
|
implementation(libs.accompanist.permissions)
|
|
|
|
// QR
|
|
implementation(libs.zxing.core)
|
|
implementation(libs.mlkit.barcode.scanning)
|
|
|
|
// CameraX
|
|
implementation(libs.androidx.camera.camera2)
|
|
implementation(libs.androidx.camera.lifecycle)
|
|
implementation(libs.androidx.camera.compose)
|
|
|
|
// Cryptography
|
|
implementation(libs.bundles.cryptography)
|
|
|
|
// JSON
|
|
implementation(libs.gson)
|
|
|
|
// Coroutines
|
|
implementation(libs.kotlinx.coroutines.android)
|
|
|
|
// Bluetooth
|
|
implementation(libs.nordic.ble)
|
|
|
|
// WebSocket
|
|
implementation(libs.okhttp)
|
|
|
|
// Arti (Tor in Rust) Android bridge - custom build from latest source
|
|
// Built with rustls, 16KB page size support, and onio//un service client
|
|
// Native libraries are in src/tor/jniLibs/ (extracted from arti-custom.aar)
|
|
// Only included in tor flavor to reduce APK size for standard builds
|
|
// Note: AAR is kept in libs/ for reference, but libraries loaded from jniLibs/
|
|
|
|
// Google Play Services Location
|
|
implementation(libs.gms.location)
|
|
|
|
// Security preferences
|
|
implementation(libs.androidx.security.crypto)
|
|
|
|
// EXIF orientation handling for images
|
|
implementation("androidx.exifinterface:exifinterface:1.3.7")
|
|
|
|
// Testing
|
|
testImplementation(libs.bundles.testing)
|
|
androidTestImplementation(platform(libs.androidx.compose.bom))
|
|
androidTestImplementation(libs.bundles.compose.testing)
|
|
debugImplementation(libs.androidx.compose.ui.tooling)
|
|
}
|