Skip to content

实现应用更新清单与关于页 - #297

Draft
utopiafar wants to merge 2 commits into
memex-lab:mainfrom
utopiafar:codex/issue-296-update-manifest-about
Draft

实现应用更新清单与关于页#297
utopiafar wants to merge 2 commits into
memex-lab:mainfrom
utopiafar:codex/issue-296-update-manifest-about

Conversation

@utopiafar

Copy link
Copy Markdown
Contributor

关联 issue

Closes #296

变更

  • 新增 AppInfo、UpdateManifest、AppUpdateRouter 等服务,支持读取构建信息、解析更新清单、校验安装包大小/hash,并处理有界超时。
  • 新增 About Memex 页面与设置入口,展示版本、build、flavor、channel、installer/package,并提供诊断信息复制。
  • 接入 Android 原生 app info channel、启动后台检查和本地化文案。

测试

  • flutter test --no-pub test/data/services/update_manifest_service_test.dart test/data/services/app_update_service_test.dart test/data/services/app_update_router_test.dart test/ui/settings/widgets/about_memex_page_test.dart
  • flutter build apk --debug --flavor globalDev --no-pub
  • git diff --check
  • Android emulator Medium_Phone_API_35:进入 Personal Center → Settings → About Memex,确认版本/build/flavor/channel/installer/package 可见;Copy Diagnostics 只包含 app/package/version/platform/flavor/region/channel/installer/updateChannel;Check now 在无 manifest/404 场景会结束为可见错误,不会无限 spinner。

@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown

PR AI Review / PR AI 语义预检

中文

  • 风险等级:中风险
  • 需要人工审核:
  • 黄金链路影响:可能
  • 置信度:high
  • Workflow run:27593290914

新增统一应用更新系统和关于页面。引入 UpdateManifestService(支持 SHA256 完整性校验和多端点降级)、AppUpdateRouter(多 provider 路由:GitHub APK、Google Play、App Store、Android 商店重定向)和 AppInfoService(构建信息和安装来源查询)。新增 About Memex 设置页面展示版本/渠道/安装来源/更新诊断。替换原有 Early-only 更新卡片,扩展为全渠道统一更新。测试覆盖充分,包含 7 个新测试文件。

影响范围

  • service
  • ui
  • view_model
  • i18n
  • platform_android
  • tests

黄金链路

  • platform_entry
  • 说明:PR 修改了应用更新检查和安装流程,影响 Android 平台入口行为。更新机制涉及远程 manifest 拉取、APK 下载和 SHA256 校验,属于安全敏感路径。

风险项

  • info AppUpdateRouter 包含较多业务逻辑。证据:lib/data/services/app_update_router.dart (561 lines)。
    建议:AppUpdateRouter 作为 service 层协调多个 update provider,当前结构清晰(provider 模式 + 策略选择),但如果后续扩展建议拆分 provider 注册和结果构建逻辑。
  • info 更新清单拉取和 APK 校验安全措施到位。证据:lib/data/services/update_manifest_service.dart: verifyManifestSha256=true by default, sha256 sidecar file verification, lib/data/services/app_update_service.dart: _fileSha256(), _normalizeSha256(), SHA256 validation on download and cache reuse, lib/domain/models/update_manifest.dart: _validateProviderFields() enforces sha256 format for github_apk provider。
    建议:安全措施设计良好。建议确认 manifest URL 不会通过日志或诊断信息泄露给用户。
  • info 更新检查从 Early-only 扩展为全渠道。证据:lib/main.dart: _scheduleAppUpdateCheck() replaces _scheduleEarlyUpdateCheck(), removed AppUpdateService.isSupported guard, lib/ui/settings/widgets/settings_page.dart: AboutMemexPage replaces EarlyUpdateSettingsCard, removed Platform.isAndroid && AppFlavor.isEarly guard。
    建议:确认 stable 渠道用户看到更新提示是预期行为。当前实现中 Dev 渠道在非手动检查时会跳过(buildInfo.isDev),这是合理的。

测试缺口

  • 未发现新的测试缺口。

English

  • Risk level: MEDIUM
  • Human review required: YES
  • Golden path impact: POSSIBLE
  • Confidence: high
  • Workflow run: 27593290914

Adds a unified app update system and About page. Introduces UpdateManifestService (SHA256 integrity verification with multi-endpoint fallback), AppUpdateRouter (multi-provider routing: GitHub APK, Google Play, App Store, Android store redirect), and AppInfoService (build info and installer source). Adds About Memex settings page showing version/channel/installer/update diagnostics. Replaces the old Early-only update card with a unified cross-channel update system. Test coverage is thorough with 7 new test files.

Affected Areas

  • service
  • ui
  • view_model
  • i18n
  • platform_android
  • tests

Golden Path

  • platform_entry
  • Rationale: The PR modifies app update checking and installation flow, affecting Android platform entry behavior. The update mechanism involves remote manifest fetching, APK download, and SHA256 verification, which is a security-sensitive path.

Findings

  • info AppUpdateRouter contains substantial business logic. Evidence: lib/data/services/app_update_router.dart (561 lines).
    Recommendation: AppUpdateRouter coordinates multiple update providers as a service layer. The current structure is clear (provider pattern + strategy selection), but consider splitting provider registration and result-building logic if it grows further.
  • info Update manifest fetching and APK verification security measures are sound. Evidence: lib/data/services/update_manifest_service.dart: verifyManifestSha256=true by default, sha256 sidecar file verification, lib/data/services/app_update_service.dart: _fileSha256(), _normalizeSha256(), SHA256 validation on download and cache reuse, lib/domain/models/update_manifest.dart: _validateProviderFields() enforces sha256 format for github_apk provider.
    Recommendation: Security measures are well-designed. Recommend confirming manifest URLs are not leaked to users via logs or diagnostics output.
  • info Update check expanded from Early-only to all channels. Evidence: lib/main.dart: _scheduleAppUpdateCheck() replaces _scheduleEarlyUpdateCheck(), removed AppUpdateService.isSupported guard, lib/ui/settings/widgets/settings_page.dart: AboutMemexPage replaces EarlyUpdateSettingsCard, removed Platform.isAndroid && AppFlavor.isEarly guard.
    Recommendation: Confirm that showing update prompts to stable channel users is intentional. The current implementation skips auto-check for Dev builds (buildInfo.isDev), which is reasonable.

Test Gaps

  • No new test gap was reported.

AI review is advisory. Maintainers should verify the result before merging.

@github-actions github-actions Bot added ai: medium risk AI review classified the PR as medium risk golden path impact AI review found possible impact to a core user flow needs human review AI review or policy signals require maintainer review labels Jun 16, 2026
@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown

PR Preflight Summary / PR 预检汇总

中文

  • 统一结论:低风险:两个预检均已完成,质量预检通过,可走普通手动合并流程。
  • Policy preflight:低风险。未命中打回或高风险规则。
  • Flutter quality:通过。Analyzer 和 test baseline 均未发现新增问题。
  • PR head:1a278323a7deb4ae10792bcf5554e76c65849559
  • Policy run:27593290903
  • Flutter run:27593292482

English

  • Combined result: Low risk: both preflights completed and quality passed; use the normal manual merge flow.
  • Policy preflight: LOW RISK. No blocking or high-risk policy signal was found.
  • Flutter quality: PASS. Analyzer and test baselines found no newly introduced issue.
  • PR head: 1a278323a7deb4ae10792bcf5554e76c65849559
  • Policy run: 27593290903
  • Flutter run: 27593292482
PR Policy Preflight / PR 规则预检

PR Policy Preflight / PR 规则预检

中文

  • 判定:低风险
  • 变更文件数:26
  • 变更行数:3824
  • Diff 是否截断:false

未发现确定性规则问题。

English

  • Decision: LOW RISK
  • Changed files: 26
  • Changed lines: 3824
  • Diff truncated: false

No deterministic policy findings.

PR Flutter Quality / Flutter 质量预检

PR Flutter Quality / Flutter 质量预检

中文

  • 总体:通过
  • Analyzer baseline:通过
  • Test baseline:通过

English

  • Overall: PASS
  • Analyzer baseline: PASS
  • Test baseline: PASS

Flutter Analyzer Baseline

  • Base issues: 284
  • PR issues: 284
  • New issues: 0

No new analyzer issues introduced by this PR.

Flutter Test Baseline

  • Base failures: 0
  • PR failures: 0
  • New failures: 0

No new Flutter test failures introduced by this PR.

@github-actions github-actions Bot added ai: medium risk AI review classified the PR as medium risk golden path impact AI review found possible impact to a core user flow needs human review AI review or policy signals require maintainer review and removed ai: medium risk AI review classified the PR as medium risk needs human review AI review or policy signals require maintainer review golden path impact AI review found possible impact to a core user flow labels Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai: medium risk AI review classified the PR as medium risk golden path impact AI review found possible impact to a core user flow needs human review AI review or policy signals require maintainer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

统一官方站 Manifest 与全渠道检查更新架构

1 participant