有人玩过 android setup wizard 吗?在添加新的引导内容时遇到了问题

2023-02-16 16:28:38 +08:00
 Vindroid

现用的 SetupWizard 是 google 自己的 com.google.android.setupwizard ,非开源,无法修改。 流程画面是:Hello -> network setting -> pin setting -> oem setup -> goto launcher

现在是引导界面后面通过 com.android.setupwizard.OEM_POST_SETUP 这个 action 处理自己的授权事项。 自己新增了一个 apk ,非 system uid ,普通安装,非特权应用。

现在 oem setup 显示没问题,后退到 pin setting 也没问题,但是 next 的步骤走不通,通过

Intent intent = WizardManagerHelper.getNextIntent(getIntent(), Activity.RESULT_OK);
startActivityForResult(intent, 1000);

或者

startActivity(new Intent("com.android.setupwizard.EXIT"));

都无法结束 wizard 流程,会自动跳回“hello”画面,然后无限循环。是跳转的代码不对吗?网上查来查去都是这么写的啊。

<WizardAction wizard:uri="intent:#Intent;action=com.android.setupwizard.OEM_POST_SETUP;end" id="oem_post_setup"/>

原有的 wizard_script.xml 中的 OEM_POST_SETUP 是没有 result 的指向的,如果通过 RRO 更改 wizard_script.xml ,将脚本添加 result 是否能解决这个问题?

<WizardAction wizard:uri="intent:#Intent;action=com.android.setupwizard.OEM_POST_SETUP;end" id="oem_post_setup">
    <result wizard:action="exit"/>
</WizardAction>
4232 次点击
所在节点    Android
3 条回复
learningman
2023-02-16 16:36:58 +08:00
Vindroid
2023-02-16 16:47:25 +08:00
@learningman 这个只是 setupwizard 的 UI 库,里面只有布局文件,没有引导的处理 code
ysc3839
2023-02-16 18:47:51 +08:00
@learningman 开源的是 AOSP setup wizard ,GMS 那个是不开源的。

@Vindroid 建议参考一下 LineageOS 的代码,印象中加装 GMS 后也会有 LineageOS 自己的页面

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/916701

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX