2023-01-11 18:31:20 +00:00
|
|
|
plugins {
|
2024-03-01 15:38:03 +00:00
|
|
|
alias(libs.plugins.androidApplication)
|
|
|
|
alias(libs.plugins.jetbrainsKotlinAndroid)
|
|
|
|
alias(libs.plugins.googleServices)
|
2023-01-11 18:31:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
android {
|
|
|
|
namespace 'com.vitorpamplona.amethyst'
|
2023-08-18 23:32:30 +00:00
|
|
|
compileSdk 34
|
2023-01-11 18:31:20 +00:00
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
applicationId "com.vitorpamplona.amethyst"
|
|
|
|
minSdk 26
|
2023-08-18 23:32:30 +00:00
|
|
|
targetSdk 34
|
2024-03-04 14:08:06 +00:00
|
|
|
versionCode 359
|
|
|
|
versionName "0.85.0"
|
|
|
|
buildConfigField "String", "RELEASE_NOTES_ID", "\"d8da33fd13d129d86c53564aedefafbe3716f007c520431be4a8e488d3925afb\""
|
2023-01-11 18:31:20 +00:00
|
|
|
|
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
|
|
vectorDrawables {
|
|
|
|
useSupportLibrary true
|
|
|
|
}
|
2023-11-08 22:08:23 +00:00
|
|
|
resourceConfigurations += [
|
2023-12-11 17:50:44 +00:00
|
|
|
'ar',
|
|
|
|
'bn-rBD',
|
|
|
|
'cs',
|
|
|
|
'cy-rGB',
|
|
|
|
'da-rDK',
|
|
|
|
'de',
|
2024-01-30 13:30:25 +00:00
|
|
|
'el-rGR',
|
2023-12-11 17:50:44 +00:00
|
|
|
'en-rGB',
|
|
|
|
'eo',
|
|
|
|
'es',
|
|
|
|
'es-rES',
|
|
|
|
'es-rMX',
|
|
|
|
'es-rUS',
|
|
|
|
'et-rEE',
|
|
|
|
'fa',
|
|
|
|
'fi-rFI',
|
|
|
|
'fo-rFO',
|
|
|
|
'fr',
|
|
|
|
'fr-rCA',
|
|
|
|
'gu-rIN',
|
|
|
|
'hi-rIN',
|
|
|
|
'hr-rHR',
|
|
|
|
'hu',
|
|
|
|
'in',
|
|
|
|
'in-rID',
|
|
|
|
'it-rIT',
|
|
|
|
'iw-rIL',
|
|
|
|
'ja',
|
|
|
|
'kk-rKZ',
|
|
|
|
'ko-rKR',
|
|
|
|
'ks-rIN',
|
|
|
|
'ku-rTR',
|
|
|
|
'lt-rLT',
|
|
|
|
'ne-rNP',
|
|
|
|
'night',
|
|
|
|
'nl',
|
|
|
|
'nl-rBE',
|
|
|
|
'pcm-rNG',
|
|
|
|
'pl-rPL',
|
|
|
|
'pt-rBR',
|
|
|
|
'pt-rPT',
|
|
|
|
'ru',
|
|
|
|
'ru-rUA',
|
|
|
|
'sa-rIN',
|
|
|
|
'sl-rSI',
|
|
|
|
'so-rSO',
|
|
|
|
'sr-rSP',
|
|
|
|
'ss-rZA',
|
|
|
|
'sv-rSE',
|
|
|
|
'sw-rKE',
|
|
|
|
'sw-rTZ',
|
|
|
|
'ta',
|
|
|
|
'th',
|
|
|
|
'tr',
|
|
|
|
'uk',
|
|
|
|
'ur-rIN',
|
|
|
|
'uz-rUZ',
|
|
|
|
'vi-rVN',
|
|
|
|
'zh',
|
|
|
|
'zh-rCN',
|
|
|
|
'zh-rHK',
|
|
|
|
'zh-rSG',
|
|
|
|
'zh-rTW'
|
2023-11-08 22:08:23 +00:00
|
|
|
]
|
2023-01-11 18:31:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
buildTypes {
|
|
|
|
release {
|
2023-08-02 01:49:30 +00:00
|
|
|
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), 'proguard-rules.pro'
|
|
|
|
minifyEnabled true
|
2023-02-06 14:15:18 +00:00
|
|
|
resValue "string", "app_name", "@string/app_name_release"
|
|
|
|
}
|
|
|
|
debug {
|
|
|
|
applicationIdSuffix '.debug'
|
|
|
|
versionNameSuffix '-DEBUG'
|
|
|
|
resValue "string", "app_name", "@string/app_name_debug"
|
2023-01-11 18:31:20 +00:00
|
|
|
}
|
2024-01-06 15:48:11 +00:00
|
|
|
create("benchmark") {
|
|
|
|
initWith(getByName("release"))
|
2024-01-18 16:35:53 +00:00
|
|
|
profileable true
|
2024-01-06 15:48:11 +00:00
|
|
|
signingConfig signingConfigs.debug
|
|
|
|
}
|
2023-01-11 18:31:20 +00:00
|
|
|
}
|
2023-03-14 18:34:50 +00:00
|
|
|
|
2023-07-30 22:10:23 +00:00
|
|
|
flavorDimensions = ["channel"]
|
2023-03-14 18:34:50 +00:00
|
|
|
|
|
|
|
productFlavors {
|
|
|
|
play {
|
2023-03-17 20:54:57 +00:00
|
|
|
getIsDefault().set(true)
|
2023-03-14 18:34:50 +00:00
|
|
|
dimension "channel"
|
|
|
|
}
|
|
|
|
|
|
|
|
fdroid {
|
|
|
|
dimension "channel"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
splits {
|
|
|
|
abi {
|
|
|
|
enable true
|
|
|
|
reset()
|
2023-09-05 02:03:35 +00:00
|
|
|
include "x86", "x86_64", "arm64-v8a", "armeabi-v7a"
|
2023-03-14 19:55:08 +00:00
|
|
|
universalApk true
|
2023-03-14 18:34:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-01-11 18:31:20 +00:00
|
|
|
compileOptions {
|
2023-04-19 15:27:20 +00:00
|
|
|
sourceCompatibility JavaVersion.VERSION_17
|
|
|
|
targetCompatibility JavaVersion.VERSION_17
|
2023-01-11 18:31:20 +00:00
|
|
|
}
|
2023-03-14 18:34:50 +00:00
|
|
|
|
2023-01-11 18:31:20 +00:00
|
|
|
kotlinOptions {
|
2023-04-19 15:27:20 +00:00
|
|
|
jvmTarget = '17'
|
2023-01-11 18:31:20 +00:00
|
|
|
}
|
2023-03-14 18:34:50 +00:00
|
|
|
|
2023-01-11 18:31:20 +00:00
|
|
|
buildFeatures {
|
|
|
|
compose true
|
2023-12-14 15:45:14 +00:00
|
|
|
buildConfig true
|
2023-01-11 18:31:20 +00:00
|
|
|
}
|
2023-03-14 18:34:50 +00:00
|
|
|
|
2023-01-11 18:31:20 +00:00
|
|
|
composeOptions {
|
2024-01-31 21:05:00 +00:00
|
|
|
// Should match compose version : https://developer.android.com/jetpack/androidx/releases/compose-kotlin
|
|
|
|
kotlinCompilerExtensionVersion "1.5.8"
|
2023-01-11 18:31:20 +00:00
|
|
|
}
|
|
|
|
packagingOptions {
|
|
|
|
resources {
|
2024-03-01 13:03:58 +00:00
|
|
|
excludes += ['/META-INF/{AL2.0,LGPL2.1}', '**/libscrypt.dylib']
|
2023-01-11 18:31:20 +00:00
|
|
|
}
|
|
|
|
}
|
2023-10-21 20:24:58 +00:00
|
|
|
|
2024-03-01 13:03:58 +00:00
|
|
|
|
2023-04-20 21:18:20 +00:00
|
|
|
lint {
|
2023-04-19 15:33:03 +00:00
|
|
|
disable 'MissingTranslation'
|
|
|
|
}
|
2023-10-21 20:24:58 +00:00
|
|
|
|
|
|
|
testOptions {
|
|
|
|
unitTests.returnDefaultValues = true
|
|
|
|
}
|
2023-01-11 18:31:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2023-08-16 21:58:25 +00:00
|
|
|
implementation project(path: ':quartz')
|
2024-02-05 23:18:33 +00:00
|
|
|
implementation project(path: ':commons')
|
2024-03-01 15:38:03 +00:00
|
|
|
implementation libs.androidx.core.ktx
|
|
|
|
implementation libs.androidx.activity.compose
|
|
|
|
|
|
|
|
implementation platform(libs.androidx.compose.bom)
|
|
|
|
|
|
|
|
implementation libs.androidx.ui
|
|
|
|
implementation libs.androidx.ui.graphics
|
|
|
|
implementation libs.androidx.ui.tooling.preview
|
2023-01-11 18:31:20 +00:00
|
|
|
|
2023-03-05 01:55:52 +00:00
|
|
|
// Needs this to open gallery / image upload
|
2024-03-01 15:38:03 +00:00
|
|
|
implementation libs.androidx.fragment.ktx
|
2023-03-05 01:55:52 +00:00
|
|
|
|
2023-01-11 18:31:20 +00:00
|
|
|
// Navigation
|
2024-03-01 15:38:03 +00:00
|
|
|
implementation libs.androidx.navigation.compose
|
2023-01-26 01:33:37 +00:00
|
|
|
|
|
|
|
// Observe Live data as State
|
2024-03-01 15:38:03 +00:00
|
|
|
implementation libs.androidx.runtime.livedata
|
2023-01-11 18:31:20 +00:00
|
|
|
|
2023-10-21 20:23:34 +00:00
|
|
|
// Material 3 Design
|
2024-03-01 15:38:03 +00:00
|
|
|
implementation libs.androidx.material3
|
|
|
|
implementation libs.androidx.material.icons
|
2023-01-26 01:33:37 +00:00
|
|
|
|
2023-10-21 20:23:34 +00:00
|
|
|
// Adaptive Layout / Two Pane
|
2024-03-01 15:38:03 +00:00
|
|
|
implementation libs.androidx.material3.windowSize
|
|
|
|
implementation libs.accompanist.adaptive
|
2023-10-21 20:23:34 +00:00
|
|
|
|
2023-01-26 01:33:37 +00:00
|
|
|
// Lifecycle
|
2024-03-01 15:38:03 +00:00
|
|
|
implementation libs.androidx.lifecycle.runtime.ktx
|
|
|
|
implementation libs.androidx.lifecycle.runtime.compose
|
|
|
|
implementation libs.androidx.lifecycle.viewmodel.compose
|
|
|
|
implementation libs.androidx.lifecycle.livedata.ktx
|
2023-01-11 18:31:20 +00:00
|
|
|
|
2023-08-20 05:16:08 +00:00
|
|
|
// Zoomable images
|
2024-03-01 15:38:03 +00:00
|
|
|
implementation libs.zoomable
|
2023-03-24 16:33:16 +00:00
|
|
|
|
2023-03-04 14:26:06 +00:00
|
|
|
// Biometrics
|
2024-03-01 15:38:03 +00:00
|
|
|
implementation libs.androidx.biometric.ktx
|
2023-03-04 14:26:06 +00:00
|
|
|
|
2023-01-11 18:31:20 +00:00
|
|
|
// Websockets API
|
2024-03-01 15:38:03 +00:00
|
|
|
implementation libs.okhttp
|
2023-01-11 18:31:20 +00:00
|
|
|
|
2023-08-20 05:16:08 +00:00
|
|
|
// HTML Parsing for Link Preview
|
2024-03-01 15:38:03 +00:00
|
|
|
implementation libs.jsoup
|
2023-02-25 21:18:31 +00:00
|
|
|
|
|
|
|
// Encrypted Key Storage
|
2024-03-01 15:38:03 +00:00
|
|
|
implementation libs.androidx.security.crypto.ktx
|
2023-01-13 02:14:44 +00:00
|
|
|
|
2023-01-13 03:40:39 +00:00
|
|
|
// view videos
|
2024-03-01 15:38:03 +00:00
|
|
|
implementation libs.androidx.media3.exoplayer
|
|
|
|
implementation libs.androidx.media3.exoplayer.hls
|
|
|
|
implementation libs.androidx.media3.ui
|
|
|
|
implementation libs.androidx.media3.session
|
2023-11-21 18:29:48 +00:00
|
|
|
|
2023-05-29 22:00:29 +00:00
|
|
|
// important for proxy / tor
|
2024-03-01 15:38:03 +00:00
|
|
|
implementation libs.androidx.media3.datasource.okhttp
|
2023-01-13 03:40:39 +00:00
|
|
|
|
2023-01-26 01:33:37 +00:00
|
|
|
// Load images from the web.
|
2024-03-01 15:38:03 +00:00
|
|
|
implementation libs.coil.compose
|
2023-01-16 17:57:23 +00:00
|
|
|
// view gifs
|
2024-03-01 15:38:03 +00:00
|
|
|
implementation libs.coil.gif
|
2023-01-16 17:57:23 +00:00
|
|
|
// view svgs
|
2024-03-01 15:38:03 +00:00
|
|
|
implementation libs.coil.svg
|
2023-01-16 17:57:23 +00:00
|
|
|
|
2023-04-21 21:01:42 +00:00
|
|
|
// create blurhash
|
2024-03-01 15:38:03 +00:00
|
|
|
implementation libs.trbl.blurhash
|
2023-04-21 21:01:42 +00:00
|
|
|
|
2023-01-26 01:33:37 +00:00
|
|
|
// Permission to upload pictures:
|
2024-03-01 15:38:03 +00:00
|
|
|
implementation libs.accompanist.permissions
|
2023-01-26 01:33:37 +00:00
|
|
|
|
2023-01-29 03:56:13 +00:00
|
|
|
// For QR generation
|
2024-03-01 15:38:03 +00:00
|
|
|
implementation libs.zxing
|
|
|
|
implementation libs.zxing.embedded
|
2023-02-05 00:43:31 +00:00
|
|
|
|
2023-03-02 00:18:07 +00:00
|
|
|
// Markdown
|
2023-06-11 01:18:30 +00:00
|
|
|
//implementation "com.halilibo.compose-richtext:richtext-ui:0.16.0"
|
|
|
|
//implementation "com.halilibo.compose-richtext:richtext-ui-material:0.16.0"
|
|
|
|
//implementation "com.halilibo.compose-richtext:richtext-commonmark:0.16.0"
|
|
|
|
|
|
|
|
// Markdown (With fix for full-image bleeds)
|
2024-03-01 15:38:03 +00:00
|
|
|
implementation libs.markdown.ui
|
|
|
|
implementation libs.markdown.ui.material3
|
|
|
|
implementation libs.markdown.commonmark
|
2023-03-02 00:18:07 +00:00
|
|
|
|
2023-07-12 14:27:34 +00:00
|
|
|
// Language picker and Theme chooser
|
2024-03-01 15:38:03 +00:00
|
|
|
implementation libs.androidx.appcompat
|
2023-07-12 14:27:34 +00:00
|
|
|
|
2023-02-24 21:02:54 +00:00
|
|
|
// Local model for language identification
|
2024-03-01 15:38:03 +00:00
|
|
|
playImplementation libs.google.mlkit.language.id
|
2023-02-24 21:02:54 +00:00
|
|
|
|
|
|
|
// Google services model the translate text
|
2024-03-01 15:38:03 +00:00
|
|
|
playImplementation libs.google.mlkit.translate
|
2023-02-24 21:02:54 +00:00
|
|
|
|
2023-05-10 15:16:47 +00:00
|
|
|
// PushNotifications
|
2024-03-01 15:38:03 +00:00
|
|
|
playImplementation platform(libs.firebase.bom)
|
|
|
|
playImplementation libs.firebase.messaging
|
2023-05-10 15:16:47 +00:00
|
|
|
|
2023-10-12 17:36:59 +00:00
|
|
|
//PushNotifications(FDroid)
|
2024-03-01 15:38:03 +00:00
|
|
|
fdroidImplementation libs.unifiedpush
|
2023-10-12 17:36:59 +00:00
|
|
|
|
2023-05-17 02:41:47 +00:00
|
|
|
// Charts
|
2024-03-01 15:38:03 +00:00
|
|
|
implementation libs.vico.charts.core
|
|
|
|
implementation libs.vico.charts.compose
|
|
|
|
implementation libs.vico.charts.views
|
|
|
|
implementation libs.vico.charts.m3
|
2023-05-17 02:41:47 +00:00
|
|
|
|
2023-07-25 20:52:32 +00:00
|
|
|
// GeoHash
|
2024-03-01 15:38:03 +00:00
|
|
|
implementation libs.drfonfon.geohash
|
2023-07-25 20:52:32 +00:00
|
|
|
|
2023-08-19 03:42:24 +00:00
|
|
|
// Waveform visualizer
|
2024-03-01 15:38:03 +00:00
|
|
|
implementation libs.audiowaveform
|
2023-08-19 03:42:24 +00:00
|
|
|
|
2023-06-08 16:14:26 +00:00
|
|
|
// Video compression lib
|
2024-03-01 15:38:03 +00:00
|
|
|
implementation libs.abedElazizShe.image.compressor
|
2023-06-08 16:14:26 +00:00
|
|
|
// Image compression lib
|
2024-03-01 15:38:03 +00:00
|
|
|
implementation libs.zelory.video.compressor
|
|
|
|
|
|
|
|
testImplementation libs.junit
|
|
|
|
testImplementation libs.mockk
|
|
|
|
androidTestImplementation libs.androidx.junit
|
|
|
|
androidTestImplementation libs.androidx.junit.ktx
|
|
|
|
androidTestImplementation libs.androidx.espresso.core
|
|
|
|
debugImplementation libs.androidx.ui.tooling
|
|
|
|
debugImplementation libs.androidx.ui.test.manifest
|
2023-03-05 21:42:19 +00:00
|
|
|
}
|
2023-03-07 18:09:26 +00:00
|
|
|
|
2023-03-15 01:37:57 +00:00
|
|
|
// https://gitlab.com/fdroid/wiki/-/wikis/HOWTO:-diff-&-fix-APKs-for-Reproducible-Builds#differing-assetsdexoptbaselineprofm-easy-to-fix
|
|
|
|
// NB: Android Studio can't find the imports; this does not affect the
|
|
|
|
// actual build since Gradle can find them just fine.
|
|
|
|
import com.android.tools.profgen.ArtProfileKt
|
|
|
|
import com.android.tools.profgen.ArtProfileSerializer
|
|
|
|
import com.android.tools.profgen.DexFile
|
|
|
|
|
|
|
|
project.afterEvaluate {
|
|
|
|
tasks.each { task ->
|
|
|
|
if (task.name.startsWith("compile") && task.name.endsWith("ReleaseArtProfile")) {
|
|
|
|
task.doLast {
|
|
|
|
outputs.files.each { file ->
|
|
|
|
if (file.name.endsWith(".profm")) {
|
|
|
|
println("Sorting ${file} ...")
|
|
|
|
def version = ArtProfileSerializer.valueOf("METADATA_0_0_2")
|
|
|
|
def profile = ArtProfileKt.ArtProfile(file)
|
|
|
|
def keys = new ArrayList(profile.profileData.keySet())
|
|
|
|
def sortedData = new LinkedHashMap()
|
|
|
|
Collections.sort keys, new DexFile.Companion()
|
|
|
|
keys.each { key -> sortedData[key] = profile.profileData[key] }
|
|
|
|
new FileOutputStream(file).with {
|
|
|
|
write(version.magicBytes$profgen)
|
|
|
|
write(version.versionBytes$profgen)
|
|
|
|
version.write$profgen(it, sortedData, "")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|