From f30aa8d2733c940862d9ec943158f03adf1a8bf2 Mon Sep 17 00:00:00 2001 From: bvandeusen Date: Sun, 1 Mar 2026 18:16:44 -0500 Subject: [PATCH] Add release signing config and fix missing INTERNET permission - Configure release signing via key.properties + Gradle Kotlin DSL - Add INTERNET and ACCESS_NETWORK_STATE permissions to AndroidManifest (Flutter injects INTERNET automatically in debug builds but not release, causing DNS failures in sideloaded APKs) - Restore android/.gitignore entries lost during signing setup - Gitignore key.properties and fabled-release-key.jks Co-Authored-By: Claude Sonnet 4.6 --- android/.gitignore | 6 ++--- android/app/build.gradle.kts | 29 +++++++++++++++++++----- android/app/src/main/AndroidManifest.xml | 2 ++ 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/android/.gitignore b/android/.gitignore index be3943c..746e499 100644 --- a/android/.gitignore +++ b/android/.gitignore @@ -7,8 +7,6 @@ gradle-wrapper.jar GeneratedPluginRegistrant.java .cxx/ -# Remember to never publicly share your keystore. -# See https://flutter.dev/to/reference-keystore +# Signing secrets — never commit these key.properties -**/*.keystore -**/*.jks +fabled-release-key.jks diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 5d0f187..1eeb08e 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -1,3 +1,6 @@ +import java.io.FileInputStream +import java.util.Properties + plugins { id("com.android.application") id("kotlin-android") @@ -5,6 +8,12 @@ plugins { id("dev.flutter.flutter-gradle-plugin") } +val keystorePropertiesFile = rootProject.file("key.properties") +val keystoreProperties = Properties() +if (keystorePropertiesFile.exists()) { + keystoreProperties.load(FileInputStream(keystorePropertiesFile)) +} + android { namespace = "com.fabledapp.fabled_app" compileSdk = flutter.compileSdkVersion @@ -20,21 +29,29 @@ android { } defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId = "com.fabledapp.fabled_app" - // You can update the following values to match your application needs. - // For more information, see: https://flutter.dev/to/review-gradle-config. minSdk = flutter.minSdkVersion targetSdk = flutter.targetSdkVersion versionCode = flutter.versionCode versionName = flutter.versionName } + signingConfigs { + create("release") { + keyAlias = keystoreProperties["keyAlias"] as String + keyPassword = keystoreProperties["keyPassword"] as String + storeFile = file(keystoreProperties["storeFile"] as String) + storePassword = keystoreProperties["storePassword"] as String + } + } + buildTypes { release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig = signingConfigs.getByName("debug") + signingConfig = if (keystorePropertiesFile.exists()) { + signingConfigs.getByName("release") + } else { + signingConfigs.getByName("debug") + } } } diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 5f139e5..ba1763a 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,4 +1,6 @@ + +