Repository navigation
fix(android): 避免覆盖安装后恢复旧视图状态并修复首帧绘制 - #40
Merged
Merged
Conversation
zilorn
marked this pull request as draft
October 28, 2026 15:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
解决的问题 / Problem
Related to #24。Android 覆盖安装后首次启动白屏,强制杀进程后恢复。
改动后的行为 / Resulting behavior
MainActivity.onCreate使用super.onCreate(null),避免 Android 在 APK 覆盖安装后恢复过期的 Activity 视图层级,由 Tauri 重建其 WebView。ReaderXActivity生命周期日志,以便排查 WebView 未创建和未绘制两类问题。setup移到页面启动后的readerx_startup_migratecommand:迁移不再占住主线程阻塞 WebView 装配与首帧;前端等待迁移完成后再读取书库 / 分组 / 规则,同步服务也只在迁移成功后启动。验证 / Validation
tsc --noEmit、i18n:check、vite build均通过。cargo check -p readerx通过;cargo test -p readerx --lib sync::28 项通过;cargo test -p readerx --test sync_bridge26 项通过。adb logcat -s ReaderXActivity:I核对 WebView 创建和重绘日志。另需测试正常冷启动、旋转屏幕及后台恢复。数据与兼容性 / Data and compatibility
不修改用户数据格式、SQLite schema、配置或依赖。迁移逻辑本身未改,仍可重跑并在失败时保留原数据;只调整执行时机,且迁移完成前不会读取依赖稳定 ID 的数据。跳过 Android Activity savedInstanceState 的恢复,可能影响系统级视图状态恢复,但 Tauri 的应用持久化数据不受影响。
风险 / 未解决项: Android 覆盖安装后的真实首启仍待实机验证;如果根因位于 Tauri/tao/wry 的窗口装配而非启动迁移阻塞,本补丁仍可能无法修复。待覆盖安装验证通过前保持 Draft,不自动关闭 #24。
提交前检查 / Checklist