From 66f46980f04377fee4abbb5ca80035977b18970e Mon Sep 17 00:00:00 2001 From: jdysya <1912377458@qq.com> Date: Mon, 9 Jun 2025 23:42:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=92=8C=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改应用 ID 为 top.jdysya.dashboard - 添加互联网权限 - 更新签名配置 - 修改测试目标应用 ID - 更新依赖版本: - async: 2.12.0 -> 2.13.0 - fake_async: 1.3.2 -> 1.3.3 - leak_tracker: 10.0.8 -> 10.0.9 - vm_service: 14.3.1 -> 15.0.0 - 移除了一些冗余的代码和配置 --- android/app/build.gradle.kts | 30 ++++++++++++++++--- android/app/src/main/AndroidManifest.xml | 1 + .../com/example/dashboard/MainActivity.kt | 2 +- ios/Runner.xcodeproj/project.pbxproj | 12 ++++---- lib/services/auth_service.dart | 2 +- lib/widgets/leetcode_card.dart | 2 +- linux/CMakeLists.txt | 2 +- macos/Runner.xcodeproj/project.pbxproj | 6 ++-- macos/Runner/Configs/AppInfo.xcconfig | 2 +- pubspec.lock | 16 +++++----- 10 files changed, 49 insertions(+), 26 deletions(-) diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 9dc8235..6569a09 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -1,3 +1,6 @@ +import java.util.Properties +import java.io.FileInputStream + plugins { id("com.android.application") id("kotlin-android") @@ -5,8 +8,14 @@ plugins { id("dev.flutter.flutter-gradle-plugin") } +val keystoreProperties = Properties() +val keystorePropertiesFile = rootProject.file("key.properties") +if (keystorePropertiesFile.exists()) { + keystoreProperties.load(FileInputStream(keystorePropertiesFile)) +} + android { - namespace = "com.example.dashboard" + namespace = "top.jdysya.dashboard" compileSdk = flutter.compileSdkVersion ndkVersion = "27.0.12077973" @@ -21,7 +30,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId = "com.example.dashboard" + applicationId = "top.jdysya.dashboard" // 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 +39,24 @@ android { versionName = flutter.versionName } + signingConfigs { + create("release") { + keyAlias = keystoreProperties["keyAlias"] as String + keyPassword = keystoreProperties["keyPassword"] as String + storeFile = keystoreProperties["storeFile"]?.let { file(it) } + storePassword = keystoreProperties["storePassword"] as String + } + } + buildTypes { - release { + 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 = signingConfigs.getByName("release") + } + debug { + // Debug 版本添加后缀,例如 ".debug" + applicationIdSuffix = ".debug" } } } diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 460bc86..dddc87a 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,4 +1,5 @@ + _credentials = {}; + final Map _credentials = {}; bool get isAuthenticated => _isAuthenticated; Map get credentials => _credentials; diff --git a/lib/widgets/leetcode_card.dart b/lib/widgets/leetcode_card.dart index 656d2d7..e7de190 100644 --- a/lib/widgets/leetcode_card.dart +++ b/lib/widgets/leetcode_card.dart @@ -148,7 +148,7 @@ class _LeetCodeCardState extends State { children: [Text(difficulty), Text('$count 题')], ), ); - }).toList(), + }), const Divider(), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt index 98f6037..43231aa 100644 --- a/linux/CMakeLists.txt +++ b/linux/CMakeLists.txt @@ -7,7 +7,7 @@ project(runner LANGUAGES CXX) set(BINARY_NAME "dashboard") # The unique GTK application identifier for this application. See: # https://wiki.gnome.org/HowDoI/ChooseApplicationID -set(APPLICATION_ID "com.example.dashboard") +set(APPLICATION_ID "top.jdysya.dashboard") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 3bba5b5..77ca2d3 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -479,7 +479,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.dashboard.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = top.jdysya.dashboard.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/dashboard.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/dashboard"; @@ -494,7 +494,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.dashboard.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = top.jdysya.dashboard.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/dashboard.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/dashboard"; @@ -509,7 +509,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.dashboard.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = top.jdysya.dashboard.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/dashboard.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/dashboard"; diff --git a/macos/Runner/Configs/AppInfo.xcconfig b/macos/Runner/Configs/AppInfo.xcconfig index f903920..659fa9b 100644 --- a/macos/Runner/Configs/AppInfo.xcconfig +++ b/macos/Runner/Configs/AppInfo.xcconfig @@ -8,7 +8,7 @@ PRODUCT_NAME = dashboard // The application's bundle identifier -PRODUCT_BUNDLE_IDENTIFIER = com.example.dashboard +PRODUCT_BUNDLE_IDENTIFIER = top.jdysya.dashboard // The copyright displayed in application information PRODUCT_COPYRIGHT = Copyright © 2025 com.example. All rights reserved. diff --git a/pubspec.lock b/pubspec.lock index c6dfd74..510478d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: async - sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted - version: "2.12.0" + version: "2.13.0" boolean_selector: dependency: transitive description: @@ -85,10 +85,10 @@ packages: dependency: transitive description: name: fake_async - sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted - version: "1.3.2" + version: "1.3.3" ffi: dependency: transitive description: @@ -228,10 +228,10 @@ packages: dependency: transitive description: name: leak_tracker - sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec + sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted - version: "10.0.8" + version: "10.0.9" leak_tracker_flutter_testing: dependency: transitive description: @@ -585,10 +585,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" + sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02 url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted - version: "14.3.1" + version: "15.0.0" web: dependency: transitive description: