142 lines
4.7 KiB
Groovy
142 lines
4.7 KiB
Groovy
apply plugin: 'com.android.application'
|
|
apply plugin: 'kotlin-android'
|
|
|
|
if (hasProperty("disableCryFS")) {
|
|
ext.disableCryFS = getProperty("disableCryFS")
|
|
} else {
|
|
ext.disableCryFS = false
|
|
}
|
|
|
|
if (hasProperty("disableGocryptfs")) {
|
|
ext.disableGocryptfs = getProperty("disableGocryptfs")
|
|
} else {
|
|
ext.disableGocryptfs = false
|
|
}
|
|
|
|
android {
|
|
compileSdk 34
|
|
ndkVersion '25.2.9519653'
|
|
namespace "sushi.hardcore.droidfs"
|
|
|
|
compileOptions {
|
|
targetCompatibility JavaVersion.VERSION_17
|
|
sourceCompatibility JavaVersion.VERSION_17
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = "17"
|
|
}
|
|
|
|
def abiCodes = [ "arm64-v8a": 1, "armeabi-v7a": 2, "x86_64": 3, "x86": 4]
|
|
|
|
defaultConfig {
|
|
applicationId "sushi.hardcore.droidfs"
|
|
minSdkVersion 21
|
|
targetSdkVersion 34
|
|
versionCode 37
|
|
versionName "2.2.0"
|
|
|
|
splits {
|
|
abi {
|
|
enable true
|
|
reset() // fix unknown bug (https://ru.stackoverflow.com/questions/1557805/abis-armeabi-mips-mips64-riscv64-are-not-supported-for-platform)
|
|
if (project.hasProperty("abi")) {
|
|
include project.getProperty("abi")
|
|
} else {
|
|
abiCodes.keySet().each { abi -> include abi }
|
|
universalApk !project.hasProperty("nouniversal")
|
|
}
|
|
}
|
|
}
|
|
|
|
externalNativeBuild.cmake {
|
|
if (project.ext.disableGocryptfs) {
|
|
arguments "-DGOCRYPTFS=OFF"
|
|
}
|
|
if (project.ext.disableCryFS) {
|
|
arguments "-DCRYFS=OFF"
|
|
}
|
|
}
|
|
}
|
|
|
|
applicationVariants.configureEach { variant ->
|
|
variant.resValue "string", "versionName", variant.versionName
|
|
buildConfigField "boolean", "CRYFS_DISABLED", "${project.ext.disableCryFS}"
|
|
buildConfigField "boolean", "GOCRYPTFS_DISABLED", "${project.ext.disableGocryptfs}"
|
|
variant.outputs.each { output ->
|
|
def abi = output.getFilter(com.android.build.OutputFile.ABI)
|
|
if (abi == null) { // universal
|
|
output.versionCodeOverride = variant.versionCode*10
|
|
output.outputFileName = "DroidFS-v${variant.versionName}-${variant.name}-universal.apk"
|
|
} else {
|
|
output.versionCodeOverride = variant.versionCode*10 + abiCodes[abi]
|
|
output.outputFileName = "DroidFS-v${variant.versionName}-${variant.name}-${abi}.apk"
|
|
}
|
|
}
|
|
}
|
|
|
|
buildFeatures {
|
|
viewBinding true
|
|
buildConfig true
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
postprocessing {
|
|
removeUnusedCode true
|
|
removeUnusedResources true
|
|
obfuscate false
|
|
optimizeCode true
|
|
proguardFiles 'proguard-rules.pro'
|
|
}
|
|
}
|
|
}
|
|
|
|
externalNativeBuild {
|
|
cmake {
|
|
path file('CMakeLists.txt')
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
main {
|
|
java {
|
|
exclude 'androidx/camera/video/originals/**'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation project(":libpdfviewer:app")
|
|
implementation 'androidx.core:core-ktx:1.13.1'
|
|
implementation "androidx.appcompat:appcompat:1.7.0"
|
|
implementation "androidx.constraintlayout:constraintlayout:2.1.4"
|
|
def lifecycle_version = "2.8.3"
|
|
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
|
|
implementation "androidx.lifecycle:lifecycle-process:$lifecycle_version"
|
|
|
|
implementation "androidx.preference:preference-ktx:1.2.1"
|
|
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
|
|
implementation 'com.google.android.material:material:1.12.0'
|
|
implementation 'com.github.bumptech.glide:glide:4.16.0'
|
|
implementation "androidx.biometric:biometric-ktx:1.2.0-alpha05"
|
|
|
|
def media3_version = "1.3.1"
|
|
implementation "androidx.media3:media3-exoplayer:$media3_version"
|
|
implementation "androidx.media3:media3-ui:$media3_version"
|
|
implementation "androidx.media3:media3-datasource:$media3_version"
|
|
|
|
def camerax_version = "1.3.4"
|
|
implementation "androidx.camera:camera-camera2:$camerax_version"
|
|
implementation "androidx.camera:camera-lifecycle:$camerax_version"
|
|
implementation "androidx.camera:camera-view:$camerax_version"
|
|
implementation "androidx.camera:camera-extensions:$camerax_version"
|
|
|
|
// dependencies needed by CameraX patch
|
|
implementation "androidx.concurrent:concurrent-futures:1.2.0"
|
|
def autoValueVersion = '1.10.4'
|
|
implementation "com.google.auto.value:auto-value-annotations:$autoValueVersion"
|
|
annotationProcessor "com.google.auto.value:auto-value:$autoValueVersion"
|
|
}
|