fix(app): 开完安装权限回到 App,再点那个按钮要能装上
CI / backend (push) Canceled after 0s

只做了"送去系统设置",没接"回来":用户开完开关回到对话框,
按钮还是「去开启安装权限」,而 openInstallPermission() 发现已授权就直接 return,
点了毫无反应——只能杀掉 App 重来。

现在点之前先复查 canInstall():权限开了就直接交给安装器,没开才跳设置页。

顺带补上模拟器上的全流程验证与截图(弹窗、权限提示、系统安装器、首页入口)。
This commit is contained in:
Steven
2026-10-31 03:25:11 +08:00
parent 7668799040
commit 29aae12224
6 changed files with 11 additions and 1 deletions
@@ -96,7 +96,15 @@ fun UpdateDialog(
when (phase) {
UpdatePhase.Denied -> PrimaryButton(
text = "去开启安装权限",
onClick = { updater.openInstallPermission() },
onClick = {
// 用户可能是刚从系统设置回来:权限开了就直接装,没开才把人送过去
val downloaded = file
if (downloaded != null && updater.canInstall()) {
handToInstaller(downloaded)
} else {
updater.openInstallPermission()
}
},
)
UpdatePhase.Downloaded -> PrimaryButton(