在Android Go上修改Google SetupWizard

I need to modify Google SetupWizard app's first page which choose language and add some information,but now there has a fatal exception when i click let's go to next Google base page like that: base image modify image

01-03 13:25:59.970 E/AndroidRuntime( 1711): FATAL EXCEPTION: main
01-03 13:25:59.970 E/AndroidRuntime( 1711): Process:com.google.android.setupwizard, PID: 1711
01-03 13:25:59.970 E/AndroidRuntime( 1711): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.google.android.setupwizard/com.google.android.setupwizard.WizardManagerActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.wizardmanager.WizardAction com.google.android.wizardmanager.WizardScript.getNextAction(int, int)' on a null object reference
01-03 13:25:59.970 E/AndroidRuntime( 1711):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2805)
01-03 13:25:59.970 E/AndroidRuntime( 1711):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2883)
01-03 13:25:59.970 E/AndroidRuntime( 1711):     at android.app.ActivityThread.-wrap11(Unknown Source:0)
01-03 13:25:59.970 E/AndroidRuntime( 1711):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1613)
01-03 13:25:59.970 E/AndroidRuntime( 1711):     at android.os.Handler.dispatchMessage(Handler.java:106)
01-03 13:25:59.970 E/AndroidRuntime( 1711):     at android.os.Looper.loop(Looper.java:164)
01-03 13:25:59.970 E/AndroidRuntime( 1711):     at android.app.ActivityThread.main(ActivityThread.java:6523)
01-03 13:25:59.970 E/AndroidRuntime( 1711):     at java.lang.reflect.Method.invoke(Native Method)
01-03 13:25:59.970 E/AndroidRuntime( 1711):     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
01-03 13:25:59.970 E/AndroidRuntime( 1711):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:857)
01-03 13:25:59.970 E/AndroidRuntime( 1711): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.wizardmanager.WizardAction com.google.android.wizardmanager.WizardScript.getNextAction(int, int)' on a null object reference
01-03 13:25:59.970 E/AndroidRuntime( 1711):     at com.google.android.wizardmanager.WizardManager.onNext(WizardManager.java:328)
01-03 13:25:59.970 E/AndroidRuntime( 1711):     at com.google.android.wizardmanager.WizardManagerActivity.onCreate(WizardManagerActivity.java:63)
01-03 13:25:59.970 E/AndroidRuntime( 1711):     at android.app.Activity.performCreate(Activity.java:7022)
01-03 13:25:59.970 E/AndroidRuntime( 1711):     at android.app.Activity.performCreate(Activity.java:7013)
01-03 13:25:59.970 E/AndroidRuntime( 1711):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
01-03 13:25:59.970 E/AndroidRuntime( 1711):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2758)
01-03 13:25:59.970 E/AndroidRuntime( 1711):     ... 9 more
01-03 13:25:59.979 W/ActivityManager(  836):   Force finishing activity com.google.android.setupwizard/.WizardManagerActivity

in my AndroidManifest.xml

<activity
        android:name=".WelcomeActivity"
        android:label="@string/app_name" 
        android:launchMode="singleTop"
        android:configChanges="keyboard|keyboardHidden|layoutDirection|locale|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode" android:directBootAware="true" 
        android:immersive="true">
        <intent-filter>
            <category android:name="android.intent.category.DEFAULT"/>
            <action android:name="android.intent.action.MAIN"/>
            <action android:name="com.android.setupwizard.aaaaaaa" />
        </intent-filter>
    </activity>

    <receiver android:name=".SuwCustomizationReceiver">
        <intent-filter>
            <action android:name="com.android.setupwizard.action.PARTNER_CUSTOMIZATION" />
        </intent-filter>
    </receiver>

in my res/raw/kingfly_wizard_script.xml

<WizardScript wizard:firstAction="oem_pre_setup" xmlns:wizard="http://schemas.android.com/apk/res/com.google.android.setupwizard"
wizard:version="2">

<!-- Preliminary setup for OEMs [CUSTOMIZABLE] -->
<WizardAction id="oem_pre_setup"
    wizard:uri="intent:#Intent;action=com.android.setupwizard.OEM_PRE_SETUP;end" >
    <result wizard:action="welcome" />
</WizardAction>
<!-- Preliminary setup for OEMs [CUSTOMIZABLE] -->
<!-- **the Google base WizardAction lick that,i only change the uri** -->
<!--
    <WizardAction id="welcome"
    wizard:uri="intent:#Intent;action=com.android.setupwizard.WELCOME;end">
    <result wizard:name="start_qr_provision"
        wizard:resultCode="101"
        wizard:action="check_user_unlock_qr" />
    <result wizard:name="dpm_user_complete"
        wizard:resultCode="111"
        wizard:action="check_user_unlock_dpm_user_complete" />
    <result wizard:action="check_user_unlock" />
</WizardAction>
-->
<WizardAction 
    wizard:uri="intent:#Intent;action=com.android.setupwizard.aaaaaaa;end" id="welcome">
    <result wizard:name="start_qr_provision"
        wizard:resultCode="101"
        wizard:action="check_user_unlock_qr" />
    <result wizard:name="dpm_user_complete"
        wizard:resultCode="111"
        wizard:action="check_user_unlock_dpm_user_complete" />
    <result wizard:action="check_user_unlock0" />
</WizardAction>

<WizardAction id="check_user_unlock_qr"
    wizard:uri="intent:#Intent;action=com.android.setupwizard.CHECK_USER_UNLOCK;end">
    <result wizard:action="qr_provision_flow" />
</WizardAction>

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

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


<!-- Notify user if expected SIM is not found [RECOMMENDED, CUSTOMIZABLE] -->
<WizardAction id="sim_missing"
    wizard:uri="intent:#Intent;action=com.android.setupwizard.SIM_MISSING;end">
    <result wizard:name="esim"
        wizard:resultCode="101"
        wizard:action="esim_intro" />
    <result wizard:action="carrier_setup" />
</WizardAction>

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


<!-- Activate carrier services [RECOMMENDED] -->
<WizardAction id="carrier_setup"
    wizard:uri="intent:#Intent;action=com.android.setupwizard.CARRIER_SETUP;end" />


<!-- On multi-SIM devices, choose which SIM to use for voice, data, and text [RECOMMENDED, CUSTOMIZABLE] -->
<WizardAction id="sim_setup"
    wizard:uri="intent:#Intent;action=com.android.setupwizard.SIM_SETUP;end" />


<!-- Security warning (for enterprise) [RECOMMENDED] -->
<WizardAction id="device_owner_warning"
    wizard:uri="intent:#Intent;action=com.google.android.setupwizard.DEVICE_OWNER_WARNING;end">
    <result wizard:name="skip"
        wizard:resultCode="1"
        wizard:action="check_frp" />
</WizardAction>

<!-- Factory reset should cause a reboot, but if it returns unexpectedly, continue on to check_frp -->
<WizardAction id="factory_reset"
    wizard:uri="intent:#Intent;action=com.google.android.setupwizard.FACTORY_RESET;end" />


<!-- Wait to check factory reset protection status [RECOMMENDED] -->
<WizardAction id="check_frp"
    wizard:uri="intent:#Intent;action=com.google.android.setupwizard.CHECK_FRP;end" />


<!-- Network selection and packages update [REQUIRED, CUSTOMIZABLE] -->
<WizardAction id="connect_and_update"
    wizard:script="android.resource://com.google.android.gmsintegration/raw/wizard_script_connect_and_update_flow">
    <result wizard:name="no_connection"
        wizard:resultCode="1"
        wizard:action="no_network_flow" />
</WizardAction>


<!-- Zero touch provisioning (for enterprise) [RECOMMENDED] -->
<WizardAction id="zero_touch"
    wizard:script="android.resource://com.google.android.gmsintegration/raw/wizard_script_zero_touch_flow" >
    <result wizard:name="dpm_user_complete"
        wizard:resultCode="111"
        wizard:action="oem_post_setup" />
</WizardAction>


<!-- Choose between restoring or set up as new device [RECOMMENDED, CUSTOMIZABLE] -->
<WizardAction id="flow_choice"
    wizard:uri="intent:#Intent;action=com.android.setupwizard.FLOW_CHOICE;end">
    <result wizard:name="skip"
        wizard:resultCode="1"
        wizard:action="setup_as_new_flow" />
    <result wizard:name="demo_mode_flow"
        wizard:resultCode="101"
        wizard:action="exit" />
</WizardAction>


<!-- Restore from an existing account or device [RECOMMENDED, CUSTOMIZABLE] -->
<WizardAction id="restore_flow"
    wizard:script="android.resource://com.google.android.gmsintegration/raw/wizard_script_restore_flow">
    <result wizard:action="oem_post_setup"/>
</WizardAction>


<!-- Set up as a new device [REQUIRED, CUSTOMIZABLE] -->
<WizardAction id="setup_as_new_flow"
    wizard:script="android.resource://com.google.android.gmsintegration/raw/wizard_script_setup_as_new_flow">
    <result wizard:action="oem_post_setup" />
</WizardAction>


<!-- Set up without a network connection [RECOMMENDED] -->
<WizardAction id="no_network_flow"
    wizard:script="android.resource://com.google.android.gmsintegration/raw/wizard_script_no_network_flow">
    <result wizard:action="oem_post_setup" />
</WizardAction>

<!-- QR provision flow (for enterprise) [RECOMMENDED] -->
<WizardAction id="qr_provision_flow"
    wizard:script="android.resource://com.google.android.gmsintegration/raw/wizard_script_qr_provision_flow" />


<!-- OEM completion [CUSTOMIZABLE] -->
<WizardAction id="oem_post_setup"
    wizard:uri="intent:#Intent;action=com.android.setupwizard.OEM_POST_SETUP;end" />


<!-- Google kid account setup. Must be the last setup action. [REQUIRED] -->
<WizardAction id="kid_post_setup"
    wizard:uri="intent:#Intent;action=com.google.android.setupwizard.KID_POST_SETUP;end" />


<!-- Leave Setup Wizard [REQUIRED] -->
<WizardAction id="exit"
    wizard:uri="intent:#Intent;action=com.android.setupwizard.EXIT;end" />

in my res/values/config.xml

<resources>
<string name="wizard_script_uri" translatable="false">android.resource://com.kingfly.googlesetupwizardcustom/raw/megafone_wizard_script</string>

in my src WelcomeActivity.java the main source:

new Handler().postDelayed(new Runnable() {
                public void run() {
                    Intent intent = getIntent();
                    Bundle bundle = new Bundle();
                    bundle.putByteArray("stack", var4);
                    intent.putExtra("scriptUri", "android.resource://com.kingfly.googlesetupwizardcustom/raw/kingfly_wizard_script");
                    intent.putExtra("actionId", "welcome");
                    intent.putExtra("wizardBundle", bundle);
                    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                    startActivityForResult(WizardManagerHelper.getNextIntent(intent, -1), NEXT_REQUEST_CODE);
                }
            }, (long) 1000);
down_load1117
down_load1117 同样的问题...,如果发现,请提供者答复
接近 2 年之前 回复
duanna5749
duanna5749 你能解释更多吗?xml文件是做什么用的?您是否正在使用SetupWizard中的代码?
接近 2 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问