From a70f338e060d29d71580e60ca32ac86b19c44cc4 Mon Sep 17 00:00:00 2001 From: Giovanni Harting <539@idlegandalf.com> Date: Fri, 19 Dec 2025 05:55:38 +0100 Subject: [PATCH] Add release build config and Play Store prep - Add signing config (reads from env vars) - Enable R8 minification and resource shrinking - Expand ProGuard rules for Gson - Update README with build instructions and Play Store checklist --- README.md | 41 ++++++++++++++++++++++++++++++++++++++--- app/build.gradle.kts | 16 +++++++++++++++- app/proguard-rules.pro | 7 +++++++ 3 files changed, 60 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a4f94ad..91717b1 100644 --- a/README.md +++ b/README.md @@ -185,9 +185,44 @@ curl -s http://192.168.42.1:8765/status | jq -r '"\(.connection.type) \(.connect ## Building -1. Open in Android Studio -2. Build > Build APK -3. Install APK on your phone +### Debug build + +```bash +./gradlew assembleDebug +# Output: app/build/outputs/apk/debug/app-debug.apk +``` + +### Release build + +1. Generate a keystore: +```bash +keytool -genkey -v -keystore keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias release +``` + +2. Build with signing: +```bash +export KEYSTORE_PASSWORD="your-password" +export KEY_ALIAS="release" +export KEY_PASSWORD="your-key-password" +./gradlew assembleRelease +# Output: app/build/outputs/apk/release/app-release.apk +``` + +## Play Store Publishing + +### Still needed: + +- [ ] **App icons** - Replace placeholder icons in `app/src/main/res/mipmap-*` with proper 512x512 adaptive icons +- [ ] **Privacy policy** - Required URL (app uses location permission) +- [ ] **Screenshots** - Phone screenshots for Play Store listing +- [ ] **Feature graphic** - 1024x500 banner image +- [ ] **Store description** - Short and full descriptions + +### Already configured: + +- [x] Release signing config +- [x] ProGuard/R8 minification +- [x] Target SDK 36 (meets Play Store requirements) ## License diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 93f2f78..0479c4c 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -15,13 +15,27 @@ android { versionName = "1.0.0" } + signingConfigs { + create("release") { + val keystoreFile = file("../keystore.jks") + if (keystoreFile.exists()) { + storeFile = keystoreFile + storePassword = System.getenv("KEYSTORE_PASSWORD") ?: "" + keyAlias = System.getenv("KEY_ALIAS") ?: "release" + keyPassword = System.getenv("KEY_PASSWORD") ?: "" + } + } + } + buildTypes { release { - isMinifyEnabled = false + isMinifyEnabled = true + isShrinkResources = true proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" ) + signingConfig = signingConfigs.findByName("release") } } diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index b4d16f4..21016ed 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -6,3 +6,10 @@ -keepattributes Signature -keepattributes *Annotation* -keep class dev.itsh.tetherapi.data.** { *; } +-keep class com.google.gson.** { *; } + +# Keep generic type info for Gson +-keepattributes EnclosingMethod +-keep class * implements com.google.gson.TypeAdapterFactory +-keep class * implements com.google.gson.JsonSerializer +-keep class * implements com.google.gson.JsonDeserializer