chore: 发布v6.36.1版本,鸿蒙适配+隐私合规收尾

### 变更详情
1.  **多语言国际化**:新增`rejectAndExit`翻译键,覆盖14种语言的拒绝退出文案
2.  **鸿蒙端适配**:
    - 修复USB事件监听报错,仅Android端启用原生USB监听
    - 调整小部件管理页交互,鸿蒙端跳过Beta弹窗并显示"敬请期待"提示
    - 适配通用设置页和功能检查的鸿蒙端toast替代弹窗逻辑
    - 调整句子详情页"编辑"按钮的鸿蒙端交互
3.  **隐私合规优化**:
    - 移除剪贴板定时轮询,改为被动触发模式,仅在用户主动进入稍后读页面时检查剪贴板
    - 移除Android端非核心权限,精简权限声明
    - 新增启动页SplashActivity作为协议守门人,从根本上阻止敏感插件在协议前初始化
    - 为Android端引导页新增双按钮布局,优化未勾选协议时的用户操作引导
4.  **依赖与代码清理**:
    - 修复macOS端flutter_secure_storage插件导入路径
    - 简化字体导入逻辑,移除冗余的readAsBytes降级逻辑
    - 更新CHANGELOG文档,记录版本变更细节
This commit is contained in:
Developer
2026-06-11 01:23:32 +08:00
parent 3a38c69521
commit b36b9bcf9e
38 changed files with 1422 additions and 542 deletions

View File

@@ -7,6 +7,7 @@
// ============================================================
import 'dart:async';
import 'dart:io';
import 'dart:isolate'
if (dart.library.js) 'core/utils/platform/isolate_stub.dart';
@@ -71,7 +72,8 @@ Future<void> _appMain() async {
});
}
if (pu.isOhos) Log.i('🟢 [OHOS] main() 开始执行', null, null, LogCategory.general);
if (pu.isOhos)
Log.i('🟢 [OHOS] main() 开始执行', null, null, LogCategory.general);
// 初始化平台能力注册表(必须在其他服务初始化之前)
PlatformCapabilities.init();
@@ -117,7 +119,8 @@ Future<void> _appMain() async {
if (!pu.isWeb) {
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
}
if (pu.isOhos) Log.i('🟢 [OHOS] SystemChrome 配置完成', null, null, LogCategory.general);
if (pu.isOhos)
Log.i('🟢 [OHOS] SystemChrome 配置完成', null, null, LogCategory.general);
try {
await AppVersion.init();
@@ -129,7 +132,8 @@ Future<void> _appMain() async {
try {
await KvStorage.init();
kvStorageReady = true;
if (pu.isOhos) Log.i('🟢 [OHOS] KvStorage 初始化完成', null, null, LogCategory.storage);
if (pu.isOhos)
Log.i('🟢 [OHOS] KvStorage 初始化完成', null, null, LogCategory.storage);
} catch (e, st) {
Log.e('KV 存储初始化失败', e, st, LogCategory.storage);
}
@@ -158,7 +162,12 @@ Future<void> _appMain() async {
try {
await LiquidGlassWidgets.initialize();
_liquidGlassReady = true;
Log.i('LiquidGlassWidgets 初始化完成 (ohos=${pu.isOhos})', null, null, LogCategory.ui);
Log.i(
'LiquidGlassWidgets 初始化完成 (ohos=${pu.isOhos})',
null,
null,
LogCategory.ui,
);
} catch (e, st) {
Log.e('LiquidGlassWidgets 初始化失败', e, st, LogCategory.ui);
}
@@ -198,7 +207,8 @@ Future<void> _appMain() async {
try {
await DeepLinkService.init();
if (pu.isOhos) Log.i('🟢 [OHOS] 深度链接服务初始化完成', null, null, LogCategory.router);
if (pu.isOhos)
Log.i('🟢 [OHOS] 深度链接服务初始化完成', null, null, LogCategory.router);
} catch (e, st) {
Log.e('深度链接服务初始化失败', e, st, LogCategory.router);
}
@@ -241,6 +251,8 @@ Future<void> _appMain() async {
if (PostAgreementInitializer.shouldInit()) {
Log.i('检测到老用户已完成引导,立即初始化权限敏感服务', null, null, LogCategory.general);
// 通知原生端协议已同意(确保老用户升级后原生端也注册敏感插件)
await _notifyNativeAgreementForExistingUsers();
try {
await PostAgreementInitializer.init();
} catch (e, st) {
@@ -276,7 +288,12 @@ void _validatePageRegistry() {
Log.e('页面注册表验证失败: $e', null, null, LogCategory.general);
}
} else {
Log.i('页面注册表验证通过,共 ${PageRegistry.pageCount} 个页面已注册', null, null, LogCategory.general);
Log.i(
'页面注册表验证通过,共 ${PageRegistry.pageCount} 个页面已注册',
null,
null,
LogCategory.general,
);
}
const route = AppRoutes.home;
@@ -284,3 +301,15 @@ void _validatePageRegistry() {
Log.e('页面注册表验证: 首页路由 $route 未注册!', null, null, LogCategory.general);
}
}
/// 通知原生端协议已同意(老用户升级后确保原生端注册敏感插件)
Future<void> _notifyNativeAgreementForExistingUsers() async {
if (!Platform.isAndroid) return;
try {
const channel = MethodChannel('apps.xy.xianyan/agreement');
await channel.invokeMethod<bool>('markAgreementAccepted');
Log.i('老用户原生端协议通知成功', null, null, LogCategory.general);
} catch (e) {
Log.e('老用户原生端协议通知失败', e, null, LogCategory.general);
}
}