93 lines
2.8 KiB
Plaintext
93 lines
2.8 KiB
Plaintext
// Copyright 2026 Umbra Tools (umbratools.com)
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import java.io.FileInputStream
|
|
import java.util.Properties
|
|
|
|
plugins {
|
|
id("com.android.application")
|
|
id("org.jetbrains.kotlin.android")
|
|
}
|
|
|
|
// Release signing credentials live in keystore.properties, which is kept out of
|
|
// version control. When it is missing the release APK is left unsigned so that
|
|
// `assembleDebug` and secret-less CI builds still work.
|
|
val keystorePropsFile = rootProject.file("keystore.properties")
|
|
val keystoreProps = Properties().apply {
|
|
if (keystorePropsFile.exists()) {
|
|
FileInputStream(keystorePropsFile).use { load(it) }
|
|
}
|
|
}
|
|
|
|
android {
|
|
namespace = "com.bm.andpictures"
|
|
compileSdk = 36
|
|
|
|
defaultConfig {
|
|
applicationId = "com.bm.andpictures"
|
|
minSdk = 26
|
|
targetSdk = 34
|
|
versionCode = 1
|
|
versionName = "1.0"
|
|
}
|
|
|
|
signingConfigs {
|
|
if (keystorePropsFile.exists()) {
|
|
create("release") {
|
|
storeFile = rootProject.file(keystoreProps.getProperty("storeFile"))
|
|
storePassword = keystoreProps.getProperty("storePassword")
|
|
keyAlias = keystoreProps.getProperty("keyAlias")
|
|
keyPassword = keystoreProps.getProperty("keyPassword")
|
|
}
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
isMinifyEnabled = false
|
|
proguardFiles(
|
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
"proguard-rules.pro"
|
|
)
|
|
if (keystorePropsFile.exists()) {
|
|
signingConfig = signingConfigs.getByName("release")
|
|
}
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = "17"
|
|
}
|
|
|
|
// smbj ships several META-INF files that collide inside an APK.
|
|
packaging {
|
|
resources {
|
|
excludes += setOf(
|
|
"META-INF/DEPENDENCIES",
|
|
"META-INF/LICENSE*",
|
|
"META-INF/NOTICE*",
|
|
"META-INF/*.kotlin_module",
|
|
"META-INF/versions/9/OSGI-INF/MANIFEST.MF"
|
|
)
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation("androidx.core:core-ktx:1.15.0")
|
|
implementation("androidx.appcompat:appcompat:1.7.0")
|
|
implementation("androidx.activity:activity-ktx:1.10.0")
|
|
implementation("androidx.recyclerview:recyclerview:1.3.2")
|
|
implementation("androidx.work:work-runtime-ktx:2.10.0")
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")
|
|
|
|
// Pure-Java SMB2/3 client. Works on Android and speaks the SMB dialect the
|
|
// Synology exposes (SMB1 is disabled on this NAS).
|
|
implementation("com.hierynomus:smbj:0.13.0")
|
|
}
|