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
|
||||
@@ -12,6 +12,9 @@ const double kWorldWidth = 2048;
|
||||
const double kWorldHeight = 1152;
|
||||
const int kSamplePx = 2;
|
||||
|
||||
/// Must match `sim::state::MAX_HP`.
|
||||
const int kTankMaxHp = 150;
|
||||
|
||||
/// Immutable HUD snapshot, only replaced when something actually changed.
|
||||
@immutable
|
||||
class HudState {
|
||||
@@ -380,7 +383,7 @@ class IronArcGame extends FlameGame {
|
||||
);
|
||||
|
||||
// Health bar.
|
||||
final hp = _match.tankHp(player).clamp(0, 100) / 100.0;
|
||||
final hp = _match.tankHp(player).clamp(0, kTankMaxHp) / kTankMaxHp;
|
||||
final barRect = RRect.fromRectAndRadius(
|
||||
Rect.fromLTWH(x - 30, y - 46, 60, 8),
|
||||
const Radius.circular(4),
|
||||
|
||||
+1
-1
@@ -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+1
|
||||
version: 0.6.0+6
|
||||
|
||||
environment:
|
||||
sdk: ^3.13.4
|
||||
|
||||
@@ -90,7 +90,7 @@ class FakeMatch extends MatchSource {
|
||||
int tankY(int player) => _heights[tankX(player) ~/ 2];
|
||||
|
||||
@override
|
||||
int tankHp(int player) => player == 0 ? 100 : 62;
|
||||
int tankHp(int player) => player == 0 ? 150 : 93;
|
||||
|
||||
@override
|
||||
int get terrainVersion => _terrainVersion;
|
||||
|
||||
Reference in New Issue
Block a user