Explorar el Código

Fix Android release network acces

Tim Jones hace 1 día
padre
commit
f9e3f4768d

+ 37 - 5
mobile/android/app/build.gradle.kts

@@ -1,3 +1,5 @@
+import java.util.Properties
+
 plugins {
     id("com.android.application")
     id("kotlin-android")
@@ -5,8 +7,19 @@ plugins {
     id("dev.flutter.flutter-gradle-plugin")
 }
 
+val releaseSigningPropertiesPath = System.getenv("RACKPEEK_ANDROID_SIGNING_PROPERTIES")
+val releaseSigningProperties = Properties()
+
+if (releaseSigningPropertiesPath != null) {
+    val releaseSigningPropertiesFile = file(releaseSigningPropertiesPath)
+    require(releaseSigningPropertiesFile.isFile) {
+        "RACKPEEK_ANDROID_SIGNING_PROPERTIES must point to an existing properties file."
+    }
+    releaseSigningPropertiesFile.inputStream().use(releaseSigningProperties::load)
+}
+
 android {
-    namespace = "com.rackpeek.rackpeek_mobile"
+    namespace = "com.rackpeek.rackpeekMobile"
     compileSdk = flutter.compileSdkVersion
     ndkVersion = flutter.ndkVersion
 
@@ -21,7 +34,7 @@ android {
 
     defaultConfig {
         // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
-        applicationId = "com.rackpeek.rackpeek_mobile"
+        applicationId = "com.rackpeek.rackpeekMobile"
         // 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
@@ -30,11 +43,30 @@ android {
         versionName = flutter.versionName
     }
 
+    signingConfigs {
+        if (releaseSigningPropertiesPath != null) {
+            create("release") {
+                keyAlias = releaseSigningProperties.getProperty("keyAlias")
+                    ?: error("Missing keyAlias in Android signing properties.")
+                keyPassword = releaseSigningProperties.getProperty("keyPassword")
+                    ?: error("Missing keyPassword in Android signing properties.")
+                storeFile = file(
+                    releaseSigningProperties.getProperty("storeFile")
+                        ?: error("Missing storeFile in Android signing properties.")
+                )
+                storePassword = releaseSigningProperties.getProperty("storePassword")
+                    ?: error("Missing storePassword in Android signing properties.")
+            }
+        }
+    }
+
     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 (releaseSigningPropertiesPath == null) {
+                signingConfigs.getByName("debug")
+            } else {
+                signingConfigs.getByName("release")
+            }
         }
     }
 }

+ 2 - 1
mobile/android/app/src/main/AndroidManifest.xml

@@ -1,6 +1,7 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android">
+    <uses-permission android:name="android.permission.INTERNET" />
     <application
-        android:label="rackpeek_mobile"
+        android:label="RackPeek"
         android:name="${applicationName}"
         android:icon="@mipmap/ic_launcher">
         <activity

+ 1 - 1
mobile/android/app/src/main/kotlin/com/rackpeek/rackpeek_mobile/MainActivity.kt

@@ -1,4 +1,4 @@
-package com.rackpeek.rackpeek_mobile
+package com.rackpeek.rackpeekMobile
 
 import io.flutter.embedding.android.FlutterActivity
 

BIN
mobile/android/app/src/main/res/mipmap-hdpi/ic_launcher.png


BIN
mobile/android/app/src/main/res/mipmap-mdpi/ic_launcher.png


BIN
mobile/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png


BIN
mobile/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png


BIN
mobile/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png


+ 1 - 1
mobile/pubspec.yaml

@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
 # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
 # In Windows, build-name is used as the major, minor, and patch parts
 # of the product and file versions while build-number is used as the build suffix.
-version: 1.0.0+2
+version: 1.0.0+5
 
 environment:
   sdk: ^3.11.1

+ 7 - 0
mobile/store-assets/google-play/README.md

@@ -0,0 +1,7 @@
+# Google Play listing assets
+
+- `app-icon-512.png` — 512 × 512 PNG app icon.
+- `feature-graphic.jpg` — 1024 × 500 JPEG feature graphic.
+- `phone/` — four 1080 × 1920 JPEG screenshots.
+
+The phone images use the existing App Store captures of the shared Flutter UI, fitted to Google Play's 9:16 size while preserving the full screen content.

BIN
mobile/store-assets/google-play/app-icon-512.png


BIN
mobile/store-assets/google-play/feature-graphic.jpg


BIN
mobile/store-assets/google-play/phone/01-overview.jpg


BIN
mobile/store-assets/google-play/phone/02-inventory.jpg


BIN
mobile/store-assets/google-play/phone/03-resource-detail.jpg


BIN
mobile/store-assets/google-play/phone/04-containment-tree.jpg