From bbfc8e8c769e7ff1f13faff6340ba6fdf1e20f59 Mon Sep 17 00:00:00 2001 From: iHTCboy Date: Sun, 28 Feb 2021 22:15:25 +0800 Subject: [PATCH] Finished package android apk --- app/android/app/build.gradle | 29 +++++++++++++++++-- app/android/app/proguard-rules.pro | 8 +++++ .../com/iHTCboy/iPomodoro/MainActivity.kt | 5 ++-- app/lib/config/app_config.dart | 4 ++- app/lib/ui/page/me_page.dart | 4 ++- 5 files changed, 43 insertions(+), 7 deletions(-) create mode 100644 app/android/app/proguard-rules.pro diff --git a/app/android/app/build.gradle b/app/android/app/build.gradle index db3e787..308263d 100644 --- a/app/android/app/build.gradle +++ b/app/android/app/build.gradle @@ -21,6 +21,12 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } +def keystoreProperties = new Properties() +def keystorePropertiesFile = rootProject.file('key.properties') +if (keystorePropertiesFile.exists()) { + keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) +} + apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" @@ -37,7 +43,6 @@ android { } defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.iHTCboy.iPomodoro" minSdkVersion 16 targetSdkVersion 30 @@ -45,11 +50,29 @@ android { versionName flutterVersionName } + signingConfigs { + release { + keyAlias keystoreProperties['keyAlias'] + keyPassword keystoreProperties['keyPassword'] + storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null + storePassword keystoreProperties['storePassword'] + } + } + 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.release + ndk { + //设置支持的SO库架构 + abiFilters 'arm64-v8a' + } + } + debug { signingConfig signingConfigs.debug + ndk { + //设置支持的SO库架构 + abiFilters 'arm64-v8a', 'x86', 'x86_64' + } } } } diff --git a/app/android/app/proguard-rules.pro b/app/android/app/proguard-rules.pro new file mode 100644 index 0000000..5aad577 --- /dev/null +++ b/app/android/app/proguard-rules.pro @@ -0,0 +1,8 @@ +## Flutter wrapper +-keep class io.flutter.app.** { *; } +-keep class io.flutter.plugin.** { *; } +-keep class io.flutter.util.** { *; } +-keep class io.flutter.view.** { *; } +-keep class io.flutter.** { *; } +-keep class io.flutter.plugins.** { *; } +-dontwarn io.flutter.embedding.** diff --git a/app/android/app/src/main/kotlin/com/iHTCboy/iPomodoro/MainActivity.kt b/app/android/app/src/main/kotlin/com/iHTCboy/iPomodoro/MainActivity.kt index 9f91fe0..b2b7426 100644 --- a/app/android/app/src/main/kotlin/com/iHTCboy/iPomodoro/MainActivity.kt +++ b/app/android/app/src/main/kotlin/com/iHTCboy/iPomodoro/MainActivity.kt @@ -96,9 +96,10 @@ class MainActivity : FlutterActivity() { val appName = call.argument("appname") val title = "${appName} Feedback" val appVersion = "${getAppVersionName()}(${getAppVersionCode()})" + val systemVersion = "${android.os.Build.VERSION.RELEASE}(${android.os.Build.VERSION.SDK_INT})" + val deviceInfo = "${android.os.Build.BRAND}(${android.os.Build.MANUFACTURER}) - ${android.os.Build.MODEL}" val message = """欢迎来信,写下你的问题吧~ - 当前 ${appName} 版本 ${appVersion},系统版本:${android.os.Build.VERSION.RELEASE}, - 设备信息:${android.os.Build.BRAND} - ${android.os.Build.MODEL}""" + 当前 ${appName} 版本 ${appVersion},系统版本:v${systemVersion},设备信息:${deviceInfo} """ val emialIntent: Intent = Intent().apply { action = Intent.ACTION_SENDTO setData(Uri.parse("mailto:${call.argument("email")}")) diff --git a/app/lib/config/app_config.dart b/app/lib/config/app_config.dart index 4aaadbc..40152e5 100644 --- a/app/lib/config/app_config.dart +++ b/app/lib/config/app_config.dart @@ -2,9 +2,11 @@ import 'package:flutter/material.dart'; class AppConfig { static const AppName = "iPomodoro"; - static const AppAppleId = "iPomodoro"; + static const AppAppleId = "1439666929"; + static const AppPackageName = "com.iHTCboy.iPomodoro"; static const AppAppStoreUrl = "https://apps.apple.com/cn/app/ipomodoro/id1439666929"; static const AppAppStoreReviewAction = "&action=write-review"; + static const AppPlayStoreUrl = "https://play.google.com/store/apps/details?id=" + AppPackageName; static const AppGitHubUrl = "https://github.com/iHTCboy/iPomodoro-Flutter"; static const AppLicenseUrl = "https://raw.githubusercontent.com/iHTCboy/iPomodoro-Flutter/master/LICENSE"; static const AppShareText = "Hello, ${AppName}! 这是一款番茄时间管理规划的App,不再分心!不再拖延!高效!专注!学习必备的好工具哦!iOS下载链接:${AppAppStoreUrl}"; diff --git a/app/lib/ui/page/me_page.dart b/app/lib/ui/page/me_page.dart index 46b606b..3d486da 100644 --- a/app/lib/ui/page/me_page.dart +++ b/app/lib/ui/page/me_page.dart @@ -13,10 +13,12 @@ class MePage extends StatelessWidget { slivers: [ //頂 SliverAppBar( - backgroundColor: AppColors.ME_SUB_COLOR, pinned: true, + centerTitle: true, + backgroundColor: AppColors.ME_SUB_COLOR, expandedHeight: DeviceUtils.get_size(context, 200, 220, 300), flexibleSpace: FlexibleSpaceBar( + centerTitle: true, title: Text("爱番茄", style: TextStyle(fontSize: 20, fontWeight: FontWeight.normal)), background: Container(