V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Vindroid
V2EX  ›  Android

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

  •  
  •   Vindroid · 2023-02-16 16:28:38 +08:00 · 4022 次点击
    这是一个创建于 435 天前的主题,其中的信息可能已经有所发展或是发生改变。

    现用的 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>
    
    3 条回复    2023-02-16 18:47:51 +08:00
    learningman
        1
    learningman  
       2023-02-16 16:36:58 +08:00
    Vindroid
        2
    Vindroid  
    OP
       2023-02-16 16:47:25 +08:00
    @learningman 这个只是 setupwizard 的 UI 库,里面只有布局文件,没有引导的处理 code
    ysc3839
        3
    ysc3839  
       2023-02-16 18:47:51 +08:00 via Android
    @learningman 开源的是 AOSP setup wizard ,GMS 那个是不开源的。

    @Vindroid 建议参考一下 LineageOS 的代码,印象中加装 GMS 后也会有 LineageOS 自己的页面
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   984 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 20:09 · PVG 04:09 · LAX 13:09 · JFK 16:09
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.