From 7882b4b14bf1eabd8c2c679a9b498fb628cb5c35 Mon Sep 17 00:00:00 2001 From: lxm <1274844347@qq.com> Date: Fri, 18 Apr 2025 11:59:31 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=B0=86SpotifyService=E7=9A=84=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E8=B7=AF=E5=BE=84=E6=94=B9=E4=B8=BA=E7=9B=B8=E5=AF=B9?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=A0=B9=E7=9B=AE=E5=BD=95=E7=9A=84=E8=B7=AF?= =?UTF-8?q?=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/modules/chat/controllers/chat_controller.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/modules/chat/controllers/chat_controller.dart b/lib/modules/chat/controllers/chat_controller.dart index 74ea42005..0146789fe 100644 --- a/lib/modules/chat/controllers/chat_controller.dart +++ b/lib/modules/chat/controllers/chat_controller.dart @@ -1,7 +1,7 @@ import 'dart:async'; import 'dart:convert'; import 'package:amap_flutter/amap_flutter.dart'; -import 'package:deep_voice/data/services/spotify_service.dart'; +import '../../../data/services/spotify_service.dart'; import 'package:get/get.dart'; import 'package:flutter/widgets.dart'; import 'package:get_storage/get_storage.dart'; From a654609c8ade6dfbf046e466f9bbf4bea8cc48c8 Mon Sep 17 00:00:00 2001 From: lxm <1274844347@qq.com> Date: Mon, 21 Apr 2025 18:07:00 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=90=AF=E7=94=A8=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=B7=B7=E6=B7=86=E5=92=8C=E8=B5=84=E6=BA=90=E5=8E=8B=E7=BC=A9?= =?UTF-8?q?=E4=BB=A5=E4=BC=98=E5=8C=96=E5=8F=91=E5=B8=83=E5=92=8C=E8=B0=83?= =?UTF-8?q?=E8=AF=95=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/app/build.gradle.kts | 14 +++++- android/app/proguard-rules.pro | 87 ++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+), 2 deletions(-) create mode 100644 android/app/proguard-rules.pro diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 883dea602..609facd8c 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -97,12 +97,22 @@ android { release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. - isMinifyEnabled = false - isShrinkResources = false + isMinifyEnabled = true + isShrinkResources = true + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) signingConfig = signingConfigs.getByName("release") // signingConfig = signingConfigs.getByName("debug") } debug { + isMinifyEnabled = true + isShrinkResources = true + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) signingConfig = signingConfigs.getByName("debug") } } diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro new file mode 100644 index 000000000..62f534c82 --- /dev/null +++ b/android/app/proguard-rules.pro @@ -0,0 +1,87 @@ +# Flutter Framework +# 这些规则保留了 Flutter 引擎和插件系统正常运行所需的类。 +-ignorewarnings +-keep class io.flutter.app.** { *; } +-keep class io.flutter.plugin.** { *; } +-keep class io.flutter.util.** { *; } +-keep class io.flutter.view.** { *; } +-keep class io.flutter.embedding.android.** { *; } +-keep class io.flutter.embedding.engine.** { *; } +-keep class io.flutter.embedding.engine.plugins.** { *; } +-keep class io.flutter.plugin.common.** { *; } +-keep class io.flutter.plugins.** { *; } +-keep class io.flutter.plugin.platform.** { *; } + +# 保留你的应用程序的主 Activity。 +# !!! 请将 com.example.deep_voice.MainActivity 替换为你的实际包名和 Activity 类名 !!! +-keep class com.yunqiinnovation.deepsound.MainActivity { *; } + +# 保留 open_ai_service 包下的所有类 +-keep class com.yunqiinnovation.open_ai_service.** { *; } + +# 保留 MCPClient 相关类 +-keep class com.yunqiinnovation.open_ai_service.MCPClient { *; } +-keep class com.yunqiinnovation.open_ai_service.MCPSubClient { *; } +-keep class com.yunqiinnovation.open_ai_service.FunctionHandler { *; } +-keep class com.yunqiinnovation.open_ai_service.ToolType { *; } +-keep class com.yunqiinnovation.open_ai_service.mcp.** { *; } +-keep class com.yunqiinnovation.open_ai_service.mcp.CustomSseClientTransport { *; } +-keep class com.yunqiinnovation.open_ai_service.SystemFunctionHandler { *; } +-keep class com.yunqiinnovation.open_ai_service.OpenAIService { *; } +-keep class com.yunqiinnovation.open_ai_service.OpenAIService$* { *; } + +# 保留 OpenAIServicePlugin 类 +-keep class com.yunqiinnovation.open_ai_service.OpenAIServicePlugin { *; } + +# 保留 Jackson 相关类 +-keep class com.fasterxml.jackson.** { *; } +-keep class com.fasterxml.jackson.databind.** { *; } +-keep class com.fasterxml.jackson.core.** { *; } + +# 保留 Ktor 相关类 +-keep class io.ktor.** { *; } +-keep class kotlinx.coroutines.** { *; } +-keep class kotlinx.serialization.** { *; } + +# 如果你的应用直接使用了 AndroidX 的某些特定类(例如,通过原生代码或插件),可能需要保留它们。 +# 例如,保留所有 Parcelable 实现类,如果它们被跨进程使用或序列化。 +# -keep class * implements android.os.Parcelable { +# public static final android.os.Parcelable$Creator *; +# } + +# 保留 MCP 相关依赖库 +-keep class io.modelcontextprotocol.** { *; } +-keep class com.anthropic.** { *; } + +# 保留 OkHttp 相关类 +-keep class okhttp3.** { *; } +-keep class okio.** { *; } + +# 如果你使用了特定的第三方库,并且这些库需要特定的 ProGuard 规则,请在此处添加。 +# 例如,OkHttp/Retrofit, Gson, Glide 等通常需要保留模型类或特定方法。 +# 查看库的官方文档通常会提供所需的 ProGuard 规则。 + +# -keepclasseswithmembers class * { +# @android.webkit.JavascriptInterface ; +# } + +# -keepattributes Signature +# -keepattributes *Annotation* + +# 如果你有自定义的原生插件,需要保留它们的类。 +# !!! 将 com.yourcompany.yourplugin.** 替换为你的插件的实际包名 !!! +# -keep class com.yourcompany.yourplugin.** { *; } + +# 保留枚举类,防止 switch 语句因混淆出错 +-keepclassmembers enum * { + public static **[] values(); + public static ** valueOf(java.lang.String); +} + +# 保留 R 类及其内部类,防止资源访问出错 +-keep class **.R$* { *; } + +# 保留 native 方法 +-keepclasseswithmembernames class * { + native ; +} \ No newline at end of file From 4da0e040998054c2286d46439836950e5cba1944 Mon Sep 17 00:00:00 2001 From: lxm <1274844347@qq.com> Date: Thu, 24 Apr 2025 20:00:10 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8B=BE=E9=80=89?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8D=8F=E8=AE=AE=E5=92=8C=E9=9A=90=E7=A7=81?= =?UTF-8?q?=E5=8D=8F=E8=AE=AE=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/app/build.gradle.kts | 8 ++-- lib/modules/login/views/login_view.dart | 63 +++++++++++++++---------- 2 files changed, 41 insertions(+), 30 deletions(-) diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 609facd8c..be42f1334 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -97,8 +97,8 @@ android { release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. - isMinifyEnabled = true - isShrinkResources = true + isMinifyEnabled = false + isShrinkResources = false proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" @@ -107,8 +107,8 @@ android { // signingConfig = signingConfigs.getByName("debug") } debug { - isMinifyEnabled = true - isShrinkResources = true + isMinifyEnabled = false + isShrinkResources = false proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" diff --git a/lib/modules/login/views/login_view.dart b/lib/modules/login/views/login_view.dart index 9bc34934b..43776c799 100644 --- a/lib/modules/login/views/login_view.dart +++ b/lib/modules/login/views/login_view.dart @@ -526,33 +526,44 @@ class LoginView extends GetView { children: [ Row( mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, // 添加这行 + crossAxisAlignment: CrossAxisAlignment.center, children: [ - SizedBox( - width: 12.w, - height: 16.w, - child: Transform.scale( - scale: 0.7, - child: Obx(() => Checkbox( - value: controller.hasAcceptedPrivacy, - onChanged: (value) => - controller.hasAcceptedPrivacy = value ?? false, - activeColor: const Color(0xFF3B82F6), - materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, - visualDensity: VisualDensity.compact, - side: BorderSide( - width: 1.6, - color: Colors.grey[600]!, - ), - )), - ), - ), - SizedBox(width: 4.w), - Text( - 'expressConsent'.tr, - style: TextStyle( - fontSize: 13.sp, - color: isDarkMode ? Colors.grey[400] : Colors.grey[700], + // 将勾选框和文本包装在 GestureDetector 中 + GestureDetector( + onTap: () => controller.hasAcceptedPrivacy = + !controller.hasAcceptedPrivacy, + behavior: HitTestBehavior.opaque, // 确保透明区域也能响应点击 + child: Row( + children: [ + SizedBox( + width: 12.w, + height: 16.w, + child: Transform.scale( + scale: 0.7, + child: Obx(() => Checkbox( + value: controller.hasAcceptedPrivacy, + onChanged: (value) => + controller.hasAcceptedPrivacy = value ?? false, + activeColor: const Color(0xFF3B82F6), + materialTapTargetSize: + MaterialTapTargetSize.shrinkWrap, + visualDensity: VisualDensity.compact, + side: BorderSide( + width: 1.6, + color: Colors.grey[600]!, + ), + )), + ), + ), + SizedBox(width: 4.w), + Text( + 'expressConsent'.tr, + style: TextStyle( + fontSize: 13.sp, + color: isDarkMode ? Colors.grey[400] : Colors.grey[700], + ), + ), + ], ), ), ],