feat(m6): store hardening with r8, release pipeline, symbols and store assets
This commit is contained in:
@@ -1,9 +1,19 @@
|
||||
import java.io.FileInputStream
|
||||
import java.util.Properties
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
||||
id("dev.flutter.flutter-gradle-plugin")
|
||||
}
|
||||
|
||||
// Optional release signing; without key.properties the build falls back to debug keys.
|
||||
val keystoreProperties = Properties()
|
||||
val keystorePropertiesFile = rootProject.file("key.properties")
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
FileInputStream(keystorePropertiesFile).use { keystoreProperties.load(it) }
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.ironarc.iron_arc"
|
||||
compileSdk = 36
|
||||
@@ -15,25 +25,38 @@ android {
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId = "com.ironarc.iron_arc"
|
||||
// You can update the following values to match your application needs.
|
||||
// For more information, see: https://flutter.dev/to/review-gradle-config.
|
||||
minSdk = 24
|
||||
targetSdk = 36
|
||||
// Uses the version code from pubspec.yaml. When using split APKs, 1000 * ABI_VERSION
|
||||
// is added automatically by Flutter. (https://developer.android.com/studio/build/configure-apk-splits#configure-APK-versions)
|
||||
// You can force using the value of versionCode by specifying the `-P force-version-code-ignoring-abi=true`
|
||||
// flag during build.
|
||||
versionCode = flutter.versionCode
|
||||
versionName = flutter.versionName
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
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 {
|
||||
// Local/dev builds only - a real upload key is required for Play.
|
||||
signingConfigs.getByName("debug")
|
||||
}
|
||||
isMinifyEnabled = true
|
||||
isShrinkResources = true
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro",
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
# Iron Arc R8 rules.
|
||||
#
|
||||
# The app talks to Rust through dart:ffi (no JNI, no reflection), so only the
|
||||
# Flutter engine entry points need to survive shrinking; the Flutter Gradle
|
||||
# plugin contributes its own consumer rules for that.
|
||||
-keep class io.flutter.** { *; }
|
||||
-keep class io.flutter.plugins.** { *; }
|
||||
|
||||
# Keep annotations used by shared_preferences' platform channel.
|
||||
-keepattributes *Annotation*
|
||||
|
||||
# Do not warn about optional Flutter/AndroidX classes.
|
||||
-dontwarn io.flutter.embedding.**
|
||||
-dontwarn androidx.**
|
||||
@@ -0,0 +1,6 @@
|
||||
# Copy to app/android/key.properties and fill in for a signed release build.
|
||||
# The file is git-ignored; without it the release build falls back to debug keys.
|
||||
storePassword=CHANGE_ME
|
||||
keyPassword=CHANGE_ME
|
||||
keyAlias=ironarc
|
||||
storeFile=/absolute/path/to/ironarc-upload.jks
|
||||
Reference in New Issue
Block a user