Files
internaluploader/android/app/build.gradle.kts
michal 4c6c897b10 app v1.1.0: delete-after-upload, duplicate status, clear history, open-with
- Delete the source file once an upload is confirmed (best-effort: SAF
  picks get a persisted read+write grant and are removed; read-only
  shared streams are left in place). Cache copy always removed. A removed
  source shows as 'removed from phone'.
- Distinguish duplicates: a HEAD (or the server's 200 existed) marks the
  item 'Duplicate · already on server' — content is never re-sent or
  overwritten, since the name IS the sha256. Different content = different
  hash = a new file, not a duplicate.
- 'Clear history' app-bar button clears finished/duplicate/failed rows.
- Register as an 'Open with' target (ACTION_VIEW, content/file) in
  addition to the existing share-sheet target.
- Room schema v2 (destructive fallback; queue is ephemeral).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-29 00:07:30 +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 = 2
versionName = "1.1.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")
}