Files
internaluploader/android/app/build.gradle.kts
Michal ec2a332c88 app v1.2.0: cancel with confirmation, queue dedupe by content hash
- Pending/uploading rows get a cancel button; every cancel is confirmed
  in a dialog and the source file is always kept — only a confirmed
  upload deletes originals. The in-flight HTTP transfer aborts
  immediately (async OkHttp call instead of blocking execute()).
- Enqueue refuses content whose SHA-256 is already pending/uploading,
  so sharing or picking the same file twice no longer uploads it twice
  in parallel (content URIs are opaque; the hash is the identity).
- Cancel/finish races resolved with conditional DB updates: a cancel
  landing mid-flight keeps the source; a cancel after completion is
  refused with a toast instead of flipping a finished row.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-10-02 00:29:42 +01:00

88 lines
2.9 KiB
Kotlin

import java.util.Properties
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("com.google.devtools.ksp")
}
// Release signing is read from ~/.internaluploader/signing.properties so the
// keystore never enters the repo. Absent that file, release builds are simply
// unsigned (still useful for CI compile checks).
val signingProps = Properties().apply {
val f = file("${System.getProperty("user.home")}/.internaluploader/signing.properties")
if (f.exists()) f.inputStream().use { load(it) }
}
android {
namespace = "eu.itaz.internaluploader"
compileSdk = 36
defaultConfig {
applicationId = "eu.itaz.internaluploader"
minSdk = 26
targetSdk = 35
versionCode = 4
versionName = "1.2.0"
// The one place the server address exists. Never rendered in the UI;
// a pairing QR can carry a different origin and overrides this.
buildConfigField("String", "DEFAULT_SERVER_URL", "\"https://puploader.ad.itaz.eu\"")
}
signingConfigs {
if (signingProps.getProperty("storeFile") != null) {
create("release") {
storeFile = file(signingProps.getProperty("storeFile"))
storePassword = signingProps.getProperty("storePassword")
keyAlias = signingProps.getProperty("keyAlias")
keyPassword = signingProps.getProperty("keyPassword")
}
}
}
buildTypes {
release {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
signingConfig = signingConfigs.findByName("release")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
buildFeatures {
viewBinding = true
buildConfig = true
}
}
dependencies {
implementation("androidx.core:core-ktx:1.16.0")
implementation("androidx.appcompat:appcompat:1.7.1")
implementation("com.google.android.material:material:1.12.0")
implementation("androidx.constraintlayout:constraintlayout:2.2.1")
implementation("androidx.recyclerview:recyclerview:1.4.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.9.1")
implementation("androidx.browser:browser:1.8.0")
implementation("androidx.security:security-crypto:1.1.0-alpha06")
implementation("androidx.work:work-runtime-ktx:2.10.1")
implementation("androidx.room:room-runtime:2.7.1")
implementation("androidx.room:room-ktx:2.7.1")
ksp("androidx.room:room-compiler:2.7.1")
implementation("com.squareup.okhttp3:okhttp:4.12.0")
implementation("com.journeyapps:zxing-android-embedded:4.3.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2")
}