From 563a38c1211b24b721e281feffa9b771b1838dd5 Mon Sep 17 00:00:00 2001 From: Michael W Date: Sun, 20 Mar 2022 13:42:50 +0100 Subject: [PATCH] SetupWizard: exit_wizard.sh: Don't throw errors * Instead of showing an exception when exiting the SuW via the script, check if we have to enable and run the Google SuW stuff and only do it then Change-Id: I628e1ee40a97db9af1975825f059227446a9ee18 --- exit_wizard.sh | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/exit_wizard.sh b/exit_wizard.sh index 302a1526..5031c2ab 100755 --- a/exit_wizard.sh +++ b/exit_wizard.sh @@ -2,12 +2,19 @@ adb root wait ${!} +has_google_suw=$(adb shell pm list packages com.google.android.setupwizard) adb shell pm enable org.lineageos.setupwizard/org.lineageos.setupwizard.SetupWizardExitActivity || true -wait ${!} -adb shell pm enable com.google.android.setupwizard/com.google.android.setupwizard.SetupWizardExitActivity || true -wait ${!} +if [[ ! -z "$has_google_suw" ]] +then + wait ${!} + adb shell pm enable com.google.android.setupwizard/com.google.android.setupwizard.SetupWizardExitActivity || true + wait ${!} +fi sleep 1 adb shell am start org.lineageos.setupwizard/org.lineageos.setupwizard.SetupWizardExitActivity || true -wait ${!} -sleep 1 -adb shell am start com.google.android.setupwizard/com.google.android.setupwizard.SetupWizardExitActivity +if [[ ! -z "$has_google_suw" ]] +then + wait ${!} + sleep 1 + adb shell am start com.google.android.setupwizard/com.google.android.setupwizard.SetupWizardExitActivity +fi