diff --git a/.gitignore b/.gitignore index abb6d3d..2d76328 100644 --- a/.gitignore +++ b/.gitignore @@ -188,3 +188,9 @@ ume_kit/ # Claude Code 本地配置 .claude/ + +# 混淆调试符号(保留本地用于崩溃符号化,勿提交/外传) +/build/symbols/ + +# 旧签名备份(本地保留,勿提交/外传) +/keystore_backup/ diff --git a/android/app/build.gradle b/android/app/build.gradle index 5ea8f9e..19d9ecb 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -7,12 +7,12 @@ plugins { apply plugin: 'top.niunaijun.blackobfuscator' apply plugin: 'walle' -def bundledReleaseKeystore = file('../keystore/nut.jks') -def legacyBundledReleaseKeystore = file('../keystore/nut.jks.old') +def bundledReleaseKeystore = file('../keystore/app-release.jks') +def legacyBundledReleaseKeystore = file('../keystore/app-release.jks.old') def resolvedReleaseKeystore = bundledReleaseKeystore.exists() ? bundledReleaseKeystore : legacyBundledReleaseKeystore android { - namespace "com.xvproject" + namespace "com.hgdj.app" compileSdk 36 ndkVersion "28.2.13676358" @@ -31,7 +31,7 @@ android { } defaultConfig { - applicationId "com.noporn.newchatone_twelve_five" + applicationId "com.hgdj.app" minSdk = 24 targetSdk = 36 versionCode = 1 @@ -43,7 +43,7 @@ android { storeFile resolvedReleaseKeystore storePassword 'jiahua123456' storeType 'jks' - keyAlias 'nut' + keyAlias 'release' keyPassword 'jiahua123456' v1SigningEnabled false v2SigningEnabled true diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 8684e5f..35be3de 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ + package="com.hgdj.app"> @@ -36,256 +36,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - when (call.method) { - METHOD_CHANGE_ICON -> { - val index = call.argument(ARG_ICON_INDEX) ?: -1 - ICON_ALIASES.getOrNull(index)?.let { switchIcon("$ALIAS_PACKAGE.$it") } - result.success(true) - } - // 不回 result 的话 Dart 那边的 Future 永远不完成 - else -> result.notImplemented() - } - } - } - - /// 切换启动图标:禁用当前入口 + 启用目标 alias,再杀掉桌面进程让图标立刻刷新 - private fun switchIcon(alias: String) { - val pm = packageManager - pm.setComponentEnabledSetting( - componentName, - PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP - ) - pm.setComponentEnabledSetting( - ComponentName(this, alias), - PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP - ) - restartLauncher(pm) - } - - /// 杀掉桌面进程,强制它重读图标 - @SuppressLint("ServiceCast") - private fun restartLauncher(pm: PackageManager) { - val am = getSystemService(ACTIVITY_SERVICE) as ActivityManager - val intent = Intent(Intent.ACTION_MAIN) - .addCategory(Intent.CATEGORY_HOME) - .addCategory(Intent.CATEGORY_DEFAULT) - for (info in pm.queryIntentActivities(intent, 0)) { - am.killBackgroundProcesses(info.activityInfo?.packageName ?: continue) - } - } - - companion object { - //这个跟flutter的通道名称保持一致 - private const val CHANNEL = "com.yinse/request" - - private const val METHOD_CHANGE_ICON = "changeIcon" - private const val ARG_ICON_INDEX = "iconIndex" - - /// 图标 alias 所在包名:AndroidManifest 里 activity-alias 写的是相对名(manifest package=com.xvproject), - /// 与 applicationId 不同,不能用 packageName 拼 - private const val ALIAS_PACKAGE = "com.xvproject" - - /// 下标即 Flutter 传来的 iconIndex,顺序必须与 manifest 里 activity-alias 的声明顺序一致 - private val ICON_ALIASES = listOf( - "lld", "aiyinyue", "aiyuedu", "alipay", "bilibili", "binggandazhuozhan", - "meisijiejian", "myworld", "shenxuanzhizhan", "shuixinwuxian", "texuanxiaoshuo", - "tiantianmajiang", "tuyou", "weichat", "wendao", "yinyutusujiao", - "icon_16", "icon_17", "icon_18", //清明 / 端午 / 劳动 - ) - } -} diff --git a/android/app/src/main/res/mipmap-xxhdpi/icon_1.webp b/android/app/src/main/res/mipmap-xxhdpi/icon_1.webp deleted file mode 100644 index 98b0c1f..0000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/icon_1.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/icon_10.webp b/android/app/src/main/res/mipmap-xxhdpi/icon_10.webp deleted file mode 100644 index 5e3fda6..0000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/icon_10.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/icon_11.webp b/android/app/src/main/res/mipmap-xxhdpi/icon_11.webp deleted file mode 100644 index 810a9df..0000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/icon_11.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/icon_12.webp b/android/app/src/main/res/mipmap-xxhdpi/icon_12.webp deleted file mode 100644 index 959d53d..0000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/icon_12.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/icon_13.webp b/android/app/src/main/res/mipmap-xxhdpi/icon_13.webp deleted file mode 100644 index f6a6cc0..0000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/icon_13.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/icon_14.webp b/android/app/src/main/res/mipmap-xxhdpi/icon_14.webp deleted file mode 100644 index 88f6569..0000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/icon_14.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/icon_15.webp b/android/app/src/main/res/mipmap-xxhdpi/icon_15.webp deleted file mode 100644 index 6df2642..0000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/icon_15.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/icon_16.webp b/android/app/src/main/res/mipmap-xxhdpi/icon_16.webp deleted file mode 100644 index 68c3a78..0000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/icon_16.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/icon_17.webp b/android/app/src/main/res/mipmap-xxhdpi/icon_17.webp deleted file mode 100644 index 2f184df..0000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/icon_17.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/icon_18.webp b/android/app/src/main/res/mipmap-xxhdpi/icon_18.webp deleted file mode 100644 index 1a67467..0000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/icon_18.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/icon_2.webp b/android/app/src/main/res/mipmap-xxhdpi/icon_2.webp deleted file mode 100644 index 5a3aa85..0000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/icon_2.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/icon_3.webp b/android/app/src/main/res/mipmap-xxhdpi/icon_3.webp deleted file mode 100644 index 366adf8..0000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/icon_3.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/icon_4.webp b/android/app/src/main/res/mipmap-xxhdpi/icon_4.webp deleted file mode 100644 index f711ca4..0000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/icon_4.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/icon_5.webp b/android/app/src/main/res/mipmap-xxhdpi/icon_5.webp deleted file mode 100644 index 0677cdf..0000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/icon_5.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/icon_6.webp b/android/app/src/main/res/mipmap-xxhdpi/icon_6.webp deleted file mode 100644 index 06bcb20..0000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/icon_6.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/icon_7.webp b/android/app/src/main/res/mipmap-xxhdpi/icon_7.webp deleted file mode 100644 index ae5d1ea..0000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/icon_7.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/icon_8.webp b/android/app/src/main/res/mipmap-xxhdpi/icon_8.webp deleted file mode 100644 index 816b789..0000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/icon_8.webp and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/icon_9.webp b/android/app/src/main/res/mipmap-xxhdpi/icon_9.webp deleted file mode 100644 index f66aeda..0000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/icon_9.webp and /dev/null differ diff --git a/assets/images/app_icon/icon_1.webp b/assets/images/app_icon/icon_1.webp deleted file mode 100644 index f866bb9..0000000 Binary files a/assets/images/app_icon/icon_1.webp and /dev/null differ diff --git a/assets/images/app_icon/icon_10.webp b/assets/images/app_icon/icon_10.webp deleted file mode 100644 index 3b34124..0000000 Binary files a/assets/images/app_icon/icon_10.webp and /dev/null differ diff --git a/assets/images/app_icon/icon_11.webp b/assets/images/app_icon/icon_11.webp deleted file mode 100644 index 53e3c8e..0000000 Binary files a/assets/images/app_icon/icon_11.webp and /dev/null differ diff --git a/assets/images/app_icon/icon_12.webp b/assets/images/app_icon/icon_12.webp deleted file mode 100644 index b9e6590..0000000 Binary files a/assets/images/app_icon/icon_12.webp and /dev/null differ diff --git a/assets/images/app_icon/icon_13.webp b/assets/images/app_icon/icon_13.webp deleted file mode 100644 index 3aebe99..0000000 Binary files a/assets/images/app_icon/icon_13.webp and /dev/null differ diff --git a/assets/images/app_icon/icon_14.webp b/assets/images/app_icon/icon_14.webp deleted file mode 100644 index 07d8560..0000000 Binary files a/assets/images/app_icon/icon_14.webp and /dev/null differ diff --git a/assets/images/app_icon/icon_15.webp b/assets/images/app_icon/icon_15.webp deleted file mode 100644 index a0d2353..0000000 Binary files a/assets/images/app_icon/icon_15.webp and /dev/null differ diff --git a/assets/images/app_icon/icon_2.webp b/assets/images/app_icon/icon_2.webp deleted file mode 100644 index 1656a29..0000000 Binary files a/assets/images/app_icon/icon_2.webp and /dev/null differ diff --git a/assets/images/app_icon/icon_3.webp b/assets/images/app_icon/icon_3.webp deleted file mode 100644 index 497d307..0000000 Binary files a/assets/images/app_icon/icon_3.webp and /dev/null differ diff --git a/assets/images/app_icon/icon_4.webp b/assets/images/app_icon/icon_4.webp deleted file mode 100644 index 37f6281..0000000 Binary files a/assets/images/app_icon/icon_4.webp and /dev/null differ diff --git a/assets/images/app_icon/icon_5.webp b/assets/images/app_icon/icon_5.webp deleted file mode 100644 index 52f2194..0000000 Binary files a/assets/images/app_icon/icon_5.webp and /dev/null differ diff --git a/assets/images/app_icon/icon_6.webp b/assets/images/app_icon/icon_6.webp deleted file mode 100644 index ef40822..0000000 Binary files a/assets/images/app_icon/icon_6.webp and /dev/null differ diff --git a/assets/images/app_icon/icon_7.webp b/assets/images/app_icon/icon_7.webp deleted file mode 100644 index 799acb7..0000000 Binary files a/assets/images/app_icon/icon_7.webp and /dev/null differ diff --git a/assets/images/app_icon/icon_8.webp b/assets/images/app_icon/icon_8.webp deleted file mode 100644 index bf67ebc..0000000 Binary files a/assets/images/app_icon/icon_8.webp and /dev/null differ diff --git a/assets/images/app_icon/icon_9.webp b/assets/images/app_icon/icon_9.webp deleted file mode 100644 index 6b0b9b3..0000000 Binary files a/assets/images/app_icon/icon_9.webp and /dev/null differ diff --git a/build_apk.sh b/build_apk.sh index 0b6a4d8..2c50173 100755 --- a/build_apk.sh +++ b/build_apk.sh @@ -82,6 +82,22 @@ RAW_VERSION=$(grep '^version:' "$PUBSPEC_FILE" | awk '{print $2}') SAFE_VERSION=${RAW_VERSION//+/_} TIME_TAG=$(date +"%m%d-%H%M") +# 混淆 + 抽离调试信息: +# --obfuscate 混淆 Dart 符号;--split-debug-info 把调试信息(含 libapp.so 里 +# 嵌入的本机绝对路径 .../huangguo_android/.dart_tool/.../dart_plugin_registrant.dart) +# 抽到单独目录,不再残留在产物里。反编译后搜不到本机用户名/工程路径。 +# 仅 release/profile 生效(debug 为 JIT,不支持也无需)。symbols 目录务必保留、勿外传, +# 崩溃堆栈符号化要用它。 +OBFUSCATE_ARGS="" +if [ "$MODE" = "release" ] || [ "$MODE" = "profile" ]; then + SYMBOLS_DIR="$(pwd)/build/symbols/${MODE}_${SAFE_VERSION}_${TIME_TAG}" + mkdir -p "$SYMBOLS_DIR" + # 注意:本项目已启用 BlackObfuscator,再叠加 Flutter --obfuscate 会导致启动黑屏,故关闭。 + # 去除 libapp.so 内嵌构建路径改由出包后的 strip_build_path 二进制替换完成,与此无关。 + OBFUSCATE_ARGS="" + # OBFUSCATE_ARGS="--obfuscate --split-debug-info=$SYMBOLS_DIR" +fi + # 读取应用内 Config.isDebug(lib/config/config.dart),决定产物命名标识: # isDebug=true → 命名标识固定为 debug(如 hgdj_debug_xxxx),方便区分内测包 # isDebug=false → 正式环境,命名沿用构建模式(release/profile),保持不变 @@ -119,15 +135,77 @@ echo "==========================================" echo "确认无误?(按回车继续,Ctrl+C 取消)" read -r CONFIRM +# 清除 libapp.so 里嵌入的本机工程绝对路径(.../<工程>/.dart_tool/.../dart_plugin_registrant.dart) +# 做法:对该 URI 字符串做「等长」替换为中性路径(不含用户名/工程名),再 zipalign + 用原 keystore 重签。 +# 等长替换保证 Dart String 长度字段不变、运行时安全;该 URI 仅为元数据,不参与运行逻辑。 +strip_build_path() { + local APK="$1" + [ -f "$APK" ] || return 0 + local BT; BT=$(ls -d "$HOME/Library/Android/sdk/build-tools/"* 2>/dev/null | sort -V | tail -1) + # 优先用 gradle 指定的 keystore(android/keystore/app-release.jks),避免误选到同目录备份 + local KS="" + for cand in android/keystore/app-release.jks android/app/../keystore/app-release.jks; do + [ -f "$cand" ] && { KS="$cand"; break; } + done + [ -z "$KS" ] && KS=$(find android -name '*.jks' ! -name '*old*' ! -name '*bak*' 2>/dev/null | head -1) + local SP KP KA + SP=$(grep -E "storePassword" android/app/build.gradle | head -1 | sed -E "s/.*['\"]([^'\"]+)['\"].*/\1/") + KP=$(grep -E "keyPassword" android/app/build.gradle | head -1 | sed -E "s/.*['\"]([^'\"]+)['\"].*/\1/") + KA=$(grep -E "keyAlias" android/app/build.gradle | head -1 | sed -E "s/.*['\"]([^'\"]+)['\"].*/\1/") + if [ -z "$BT" ] || [ -z "$KS" ] || [ -z "$SP" ] || [ -z "$KA" ]; then + echo "⚠️ 跳过路径清理:缺少 build-tools / keystore / 签名信息"; return 0 + fi + echo "🧹 清理 libapp.so 内嵌构建路径..." + local TMP; TMP=$(mktemp -d) + PROJ="$(pwd)" python3 - "$APK" "$TMP/patched.apk" <<'PY' +import sys, os, zipfile +from urllib.parse import quote +src, dst = sys.argv[1], sys.argv[2] +TAIL = b'/.dart_tool/flutter_build/dart_plugin_registrant.dart' +proj = os.environ["PROJ"] +# Flutter 以百分号编码嵌入非 ASCII 路径段;精确构造「当前工程」那条完整字节串 +needle = quote(proj, safe="/").encode() + TAIL +# 等长中性替换:保留结构性尾巴,头部用 /aaa.../ 填满到同样长度(不含用户名/工程名) +repl = b'/' + b'a' * (len(needle) - 1 - len(TAIL)) + TAIL +assert len(repl) == len(needle) +def patch(d): + c = d.count(needle) + return (d.replace(needle, repl), c) if c else (d, 0) +zin = zipfile.ZipFile(src); zout = zipfile.ZipFile(dst, 'w'); total = 0 +for it in zin.infolist(): + data = zin.read(it.filename) + if it.filename.endswith('/libapp.so'): + data, n = patch(data); total += n + zi = zipfile.ZipInfo(it.filename, date_time=it.date_time) + zi.compress_type = it.compress_type; zi.external_attr = it.external_attr + zi.internal_attr = it.internal_attr; zi.create_system = it.create_system + zout.writestr(zi, data) +zout.close(); zin.close() +print(" 精确替换次数:", total) +if total == 0: + print(" ⚠️ 未找到工程路径字节串,未改动(宁可保留也不乱替换)") +PY + "$BT/zipalign" -f -p 4 "$TMP/patched.apk" "$TMP/aligned.apk" >/dev/null 2>&1 \ + && "$BT/apksigner" sign --ks "$KS" --ks-pass "pass:$SP" --ks-key-alias "$KA" --key-pass "pass:${KP:-$SP}" \ + --v1-signing-enabled false --v2-signing-enabled true --out "$TMP/signed.apk" "$TMP/aligned.apk" >/dev/null 2>&1 \ + && "$BT/apksigner" verify "$TMP/signed.apk" >/dev/null 2>&1 + if [ $? -eq 0 ]; then + cp "$TMP/signed.apk" "$APK"; echo "✅ 已清理并重签:$APK" + else + echo "⚠️ 清理失败,保留原包未改动:$APK" + fi + rm -rf "$TMP" +} + # Android 构建 build_android() { echo "▶️ 开始构建 Android $MODE 包..." if [ "$MODE" = "release" ]; then - flutter build apk --release --target-platform android-arm64 + flutter build apk --release --target-platform android-arm64 $OBFUSCATE_ARGS APK_SOURCE="build/app/outputs/flutter-apk/app-release.apk" elif [ "$MODE" = "profile" ]; then - flutter build apk --profile --target-platform android-arm64 + flutter build apk --profile --target-platform android-arm64 $OBFUSCATE_ARGS APK_SOURCE="build/app/outputs/flutter-apk/app-profile.apk" else flutter build apk --debug --target-platform android-arm64 @@ -143,7 +221,10 @@ build_android() { APK_DEST="${DIST_DIR}/${APK_NAME}" cp "$APK_SOURCE" "$APK_DEST" - APK_SIZE=$(du -h "$APK_DEST" | awk '{print $1}') + # 注意:本 App 有运行时自校验,任何出包后修改 libapp.so(即使等长精确替换并重签)都会 + # 导致启动卡在启动页。故不再对产物做二进制补丁。去除内嵌构建路径改用“中性目录构建”方案。 + # strip_build_path 函数保留备查,但默认不调用。 + echo "✅ Android 构建成功!" echo "📁 输出路径: $APK_DEST" echo "📏 文件大小: $APK_SIZE" @@ -164,19 +245,19 @@ build_ios() { if [ "$MODE" = "release" ]; then if [ "$SIGN_MODE" = "nocodesign" ]; then - flutter build ipa --release --no-codesign + flutter build ipa --release --no-codesign $OBFUSCATE_ARGS elif [ -n "$EXPORT_OPTIONS_PLIST" ]; then - flutter build ipa --release --export-options-plist="$EXPORT_OPTIONS_PLIST" + flutter build ipa --release --export-options-plist="$EXPORT_OPTIONS_PLIST" $OBFUSCATE_ARGS else - flutter build ipa --release --export-method "$EXPORT_METHOD" + flutter build ipa --release --export-method "$EXPORT_METHOD" $OBFUSCATE_ARGS fi else if [ "$SIGN_MODE" = "nocodesign" ]; then - flutter build ipa --profile --no-codesign + flutter build ipa --profile --no-codesign $OBFUSCATE_ARGS elif [ -n "$EXPORT_OPTIONS_PLIST" ]; then - flutter build ipa --profile --export-options-plist="$EXPORT_OPTIONS_PLIST" + flutter build ipa --profile --export-options-plist="$EXPORT_OPTIONS_PLIST" $OBFUSCATE_ARGS else - flutter build ipa --profile --export-method "$EXPORT_METHOD" + flutter build ipa --profile --export-method "$EXPORT_METHOD" $OBFUSCATE_ARGS fi fi diff --git a/lib/assets_tool/images.dart b/lib/assets_tool/images.dart index ebcab7d..22433e3 100644 --- a/lib/assets_tool/images.dart +++ b/lib/assets_tool/images.dart @@ -20,6 +20,4 @@ extension ImageLoad on String { String get mineImgPath => 'assets/images/mine/$this'; //启动页 String get launchPath => 'assets/images/launch/$this'; - //app icon - String get appImgPath => 'assets/images/app_icon/$this'; } diff --git a/lib/hj_page/mine/home_mine_logic.dart b/lib/hj_page/mine/home_mine_logic.dart index e08cdc6..edfed32 100644 --- a/lib/hj_page/mine/home_mine_logic.dart +++ b/lib/hj_page/mine/home_mine_logic.dart @@ -1,8 +1,6 @@ import 'dart:async'; -import 'package:flutter/services.dart'; import 'package:get/get.dart'; -import 'package:hgdj/assets_tool/images.dart'; import 'package:hgdj/hj_page/pre_sale/pre_sale_provider.dart'; import 'package:hgdj/hj_utils/api_service/vid_service.dart'; import 'package:hgdj/hj_utils/light_model.dart'; @@ -11,10 +9,8 @@ import 'package:hgdj/tools_base/global_store/store.dart'; import 'package:hgdj/tools_base/loading/loading_helper.dart'; import 'package:hgdj/tools_base/toast.dart'; import 'package:hgdj/tools_base/widget/common_alert.dart'; -import 'package:hgdj/track_event_manager/device_service.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; -import '../../config/config.dart'; import '../../hj_model/user/user_info_model.dart'; import '../main_page/provider/msg_provider.dart'; import '../web_page/h5_page.dart'; @@ -30,14 +26,6 @@ import 'mine_share/mine_share_page.dart'; import 'more_question/mine_feedback_page.dart'; import 'welfare/welfare_home_page.dart'; -//图标 -class IconBean { - String image; - String name; - - IconBean(this.image, this.name); -} - class MineMainLogic extends GetxController with GetTickerProviderStateMixin { RefreshController? refreshCtr; @@ -54,25 +42,6 @@ class MineMainLogic extends GetxController with GetTickerProviderStateMixin { "我的消息", ]; - List iconList = [ - IconBean('ic_launcher.webp'.commonImgPath, Config.appName), - IconBean('icon_1.webp'.appImgPath, "爱音乐"), - IconBean('icon_2.webp'.appImgPath, "爱阅读"), - IconBean('icon_3.webp'.appImgPath, "支付宝"), - IconBean('icon_4.webp'.appImgPath, "哔哩哔哩"), - IconBean('icon_5.webp'.appImgPath, "饼干大作战"), - IconBean('icon_6.webp'.appImgPath, "美食借鉴"), - IconBean('icon_7.webp'.appImgPath, "我的世界"), - IconBean('icon_8.webp'.appImgPath, "神选之战"), - IconBean('icon_9.webp'.appImgPath, "随心无线"), - IconBean('icon_10.webp'.appImgPath, "特轩小说"), - IconBean('icon_11.webp'.appImgPath, "天天麻将"), - IconBean('icon_12.webp'.appImgPath, "途游"), - IconBean('icon_13.webp'.appImgPath, "微信"), - IconBean('icon_14.webp'.appImgPath, "问道"), - IconBean('icon_15.webp'.appImgPath, "英语图书角"), - ]; - @override void onReady() async { super.onReady(); @@ -198,9 +167,4 @@ class MineMainLogic extends GetxController with GetTickerProviderStateMixin { popGesture: true); } - changeIcon(int index) async { - if (!await CommonAlert.show(content: '您确定要更换图标吗?')) return; - const platform = MethodChannel(DeviceInfoService.requestChannel); - platform.invokeMethod('changeIcon', {"iconIndex": index}); - } } diff --git a/lib/hj_page/mine/home_mine_page.dart b/lib/hj_page/mine/home_mine_page.dart index b181718..890b04e 100644 --- a/lib/hj_page/mine/home_mine_page.dart +++ b/lib/hj_page/mine/home_mine_page.dart @@ -1,4 +1,3 @@ -import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -167,66 +166,6 @@ class HomeMinePage extends StatelessWidget { ); }, ), - // iOS 换图标需弹系统弹窗且要预置图标资源,暂不支持,仅 Android 显示该入口 - if (!Platform.isIOS) ...[ - Padding( - padding: EdgeInsets.only(left: 12, top: 10, right: 12), - child: Row( - children: [ - Text( - '设置桌面图标', - style: TextStyle( - color: Color(0xffEFEFEF), - fontSize: 14, - fontWeight: FontWeight.w500), - ), - Spacer(), - InkWell( - enableFeedback: false, - onTap: () => logic.changeIcon(0), - child: Text( - '恢复默认', - style: TextStyle( - color: Color(0xff989898), - fontSize: 12, - fontWeight: FontWeight.w400), - ), - ), - ], - ), - ), - 11.sizeBoxH, - SizedBox( - height: 76, - child: ListView.separated( - padding: EdgeInsets.symmetric(horizontal: 16), - scrollDirection: Axis.horizontal, - separatorBuilder: (_, __) => 7.sizeBoxW, - itemCount: logic.iconList.length, - itemBuilder: (BuildContext context, int index) { - final data = logic.iconList[index]; - return InkWell( - enableFeedback: false, - onTap: () => logic.changeIcon(index), - child: Column( - children: [ - Image.asset(data.image, width: 54), - 4.sizeBoxH, - Text( - data.name, - style: TextStyle( - color: Colors.white.withValues(alpha: 0.9), - fontSize: 12, - ), - ) - ], - ), - ); - }, - ), - ), - 10.sizeBoxH, - ], ], ), ), diff --git a/lib/track_event_manager/device_service.dart b/lib/track_event_manager/device_service.dart index 83c6898..1d709ef 100644 --- a/lib/track_event_manager/device_service.dart +++ b/lib/track_event_manager/device_service.dart @@ -82,8 +82,6 @@ class DeviceInfoService { /// note_this:不要修改这个值 static const iosBundleId = "yinse_opera"; static const naticeChannel = 'com.yinse/device'; //原生通道(设备/视频/编解码信息) - static const requestChannel = - 'com.yinse/request'; //原生系统桥(现只剩换启动图标 changeIcon) /// 外部调用入口 static Future init() async { diff --git a/pubspec.yaml b/pubspec.yaml index 14297a2..e10acf2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -107,7 +107,6 @@ flutter: - assets/images/video/ - assets/images/comment/ - assets/images/launch/ - - assets/images/app_icon/ - assets/images/ai/ - assets/images/live_images/ - assets/images/acg/