Repository navigation
Conversation
启用执行桥的实例,每次开机收尾(installerx.sh postboot,和防停用的覆盖在同一步)用 pm disable --user 0 只关掉 InstallerX-Revived 的桌面入口组件 com.rosan.installer.ui.activity.LauncherAlias,不停用包、不动别的组件;安装、卸载走的 InstallerActivity、UninstallerActivity、InstallerService 不受影响。每次开机重做(它自己的设置能把图标开回来),失败只记日志,不挡开机。 Refs ModAVD/ModAVD#331
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.
启用执行桥的实例,桌面上不再显示应用安装器 InstallerX-Revived 的图标,安装功能不变(ModAVD/ModAVD#331)。
改了什么
internal/guest/scripts/installerx.sh的postboot(每次开机收尾、以 root 跑,就是现有施加「停用」变灰覆盖的那一步)在覆盖之后多做一件事:pm disable --user 0 com.rosan.installer.x.revived/com.rosan.installer.ui.activity.LauncherAlias只关这一个组件,不停用包(不用
pm disable-user),别的组件都不动。输出里有new state: disabled就打一行LAUNCHER hidden,否则打LAUNCHER failed <pm 的第一行>,RESULT照旧(不因此变成 failed)。/data/system/users/0/package-restrictions.xml,重启后本来就保留;已经关着时再关一次不改东西。重做是因为 InstallerX 自己设置里有「显示桌面图标」开关,打开会把同一个组件开回来。internal/emu/installerx.go的setupGuestInstaller:看到LAUNCHER failed记一行日志「实例 N 没能藏起应用安装器的桌面图标,下次开机再试: …」,不挡开机。changelog.d/331-installerx-no-icon.change.md。入口组件和安装功能怎么核的
InstallerX-Revived-online-26.09.apk)的 AndroidManifest(build-tools 36.1.0 的aapt2 dump xmltree),对照源码的 26.09 标签:MAIN+LAUNCHER的只有 activity-aliascom.rosan.installer.ui.activity.LauncherAlias(targetActivity是SettingsActivity)。InstallerActivity(VIEW/INSTALL_PACKAGE带 apk 类型、SEND/SEND_MULTIPLE、CONFIRM_INSTALL/CONFIRM_PERMISSIONS/CONFIRM_PRE_APPROVAL),卸载走UninstallerActivity(DELETE/UNINSTALL_PACKAGE),后台是InstallerService。它们是各自的组件、各自的 intent filter,关掉 alias 不影响。系统开机时getRequiredInstallerLPr找的是INSTALL_PACKAGE的处理者,也就是InstallerActivity,所以 明日方舟应用内更新完成后,系统安装完成弹窗显示为 com.u8.sdk.U8Application 和默认图标 ModAVD#294 里那种「找不到唯一安装器、system_server 起不来」不会因为这一步出现。SystemEnvProviderImpl.setLauncherAliasEnabled)改的就是这个组件,只在用户在它的设置里点时调用,启动时不会自己改回来。/system/priv-app,是系统应用;Android 给没有桌面入口的应用补「应用信息」快捷图标那一套不管系统应用,所以关掉以后桌面上不会换成别的图标。SettingsActivity本身没关,它还带APPLICATION_PREFERENCES,系统设置里它的应用信息页也许还能进去,没在实机上看。测试
pm/cmd的脚本测试(internal/guest/installerx_sh_test.go):postboot正好调一次上面那条pm disable,输出LAUNCHER hidden;pm里没有别的disable(包本身、别的组件都不碰);模拟重启后第二次postboot再调一次。pm disable失败时打LAUNCHER failed …,RESULT ok不变,通知权限和标记照常做完。/data/app的那份不是系统的,不碰它的组件。TestInstallerXLauncherFailure(解析LAUNCHER failed行)。SettingsActivity、改成pm disable-user停用整个包、失败时让postboot报 failed、Go 侧认错前缀,各有测试失败。go test ./internal/guest ./internal/emu ./internal/i18n ./internal/root(-skip TestProductionRootReadOnly)、全部 node 界面测试、scripts/repo_checks.py都过了,只有internal/emu的TestClone*三个在本机失败:本机 20010–20012 被正在运行的实例占着,不改动的 upstream/main 上同样失败,和这个 PR 无关。脚本测试要sh,本机是把 Git 自带的sh放进 PATH 跑的。Refs ModAVD/ModAVD#331, ModAVD/ModAVD#294