From b12f23969beb3a5e622c9a85507510ce8bada1f0 Mon Sep 17 00:00:00 2001 From: MagicLike Date: Fri, 24 Mar 2023 19:05:20 +0100 Subject: [PATCH 01/13] Removed extra reboot step --- openandroidinstaller/assets/configs/avicii.yaml | 11 +++-------- openandroidinstaller/assets/configs/cheeseburger.yaml | 11 +++-------- openandroidinstaller/assets/configs/dre.yaml | 11 +++-------- openandroidinstaller/assets/configs/dumpling.yaml | 11 +++-------- openandroidinstaller/assets/configs/enchilada.yaml | 11 +++-------- openandroidinstaller/assets/configs/fajita.yaml | 11 +++-------- openandroidinstaller/assets/configs/guacamole.yaml | 11 +++-------- openandroidinstaller/assets/configs/guacamoleb.yaml | 11 +++-------- openandroidinstaller/assets/configs/hotdog.yaml | 11 +++-------- openandroidinstaller/assets/configs/hotdogb.yaml | 11 +++-------- 10 files changed, 30 insertions(+), 80 deletions(-) diff --git a/openandroidinstaller/assets/configs/avicii.yaml b/openandroidinstaller/assets/configs/avicii.yaml index 7e2e2cae..5e8443b2 100644 --- a/openandroidinstaller/assets/configs/avicii.yaml +++ b/openandroidinstaller/assets/configs/avicii.yaml @@ -16,15 +16,10 @@ steps: Press 'Confirm and run' to reboot into the bootloader. command: adb_reboot_bootloader - type: call_button - content: In this step you actually unlock the bootloader. Just press 'Confirm and run' here. Once it's done, press continue here. - command: fastboot_oem_unlock - - type: confirm_button content: > - At this point the device may display on-screen prompts which will require interaction to continue the process of unlocking the bootloader. - Please take whatever actions the device asks you to to proceed. - - type: call_button - content: To finish the unlocking, the phone needs to reboot. Just press 'Confirm and run' here to reboot. Then continue. - command: fastboot_reboot + In this step you actually unlock the bootloader. Just press 'Confirm and run' here. The phone will automatically reboot and reformat. + Once it's done, press continue here. + command: fastboot_oem_unlock - type: confirm_button content: The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. boot_recovery: diff --git a/openandroidinstaller/assets/configs/cheeseburger.yaml b/openandroidinstaller/assets/configs/cheeseburger.yaml index 832ea06f..a04fd467 100644 --- a/openandroidinstaller/assets/configs/cheeseburger.yaml +++ b/openandroidinstaller/assets/configs/cheeseburger.yaml @@ -15,15 +15,10 @@ steps: Press 'Confirm and run' to reboot into the bootloader. command: adb_reboot_bootloader - type: call_button - content: In this step you actually unlock the bootloader. Just press 'Confirm and run' here. Once it's done, press continue here. - command: fastboot_oem_unlock - - type: confirm_button content: > - At this point the device may display on-screen prompts which will require interaction to continue the process of unlocking the bootloader. - Please take whatever actions the device asks you to to proceed. - - type: call_button - content: To finish the unlocking, the phone needs to reboot. Just press 'Confirm and run' here to reboot. Then continue. - command: fastboot_reboot + In this step you actually unlock the bootloader. Just press 'Confirm and run' here. The phone will automatically reboot and reformat. + Once it's done, press continue here. + command: fastboot_oem_unlock - type: confirm_button content: The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. boot_recovery: diff --git a/openandroidinstaller/assets/configs/dre.yaml b/openandroidinstaller/assets/configs/dre.yaml index fa04addf..528035ce 100644 --- a/openandroidinstaller/assets/configs/dre.yaml +++ b/openandroidinstaller/assets/configs/dre.yaml @@ -16,15 +16,10 @@ steps: Press 'Confirm and run' to reboot into the bootloader. command: adb_reboot_bootloader - type: call_button - content: In this step you actually unlock the bootloader. Just press 'Confirm and run' here. Once it's done, press continue here. - command: fastboot_oem_unlock - - type: confirm_button content: > - At this point the device may display on-screen prompts which will require interaction to continue the process of unlocking the bootloader. - Please take whatever actions the device asks you to to proceed. - - type: call_button - content: To finish the unlocking, the phone needs to reboot. Just press 'Confirm and run' here to reboot. Then continue. - command: fastboot_reboot + In this step you actually unlock the bootloader. Just press 'Confirm and run' here. The phone will automatically reboot and reformat. + Once it's done, press continue here. + command: fastboot_oem_unlock - type: confirm_button content: The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. boot_recovery: diff --git a/openandroidinstaller/assets/configs/dumpling.yaml b/openandroidinstaller/assets/configs/dumpling.yaml index 329280cf..684f8a62 100644 --- a/openandroidinstaller/assets/configs/dumpling.yaml +++ b/openandroidinstaller/assets/configs/dumpling.yaml @@ -15,15 +15,10 @@ steps: Press 'Confirm and run' to reboot into the bootloader. command: adb_reboot_bootloader - type: call_button - content: In this step you actually unlock the bootloader. Just press 'Confirm and run' here. Once it's done, press continue here. - command: fastboot_oem_unlock - - type: confirm_button content: > - At this point the device may display on-screen prompts which will require interaction to continue the process of unlocking the bootloader. - Please take whatever actions the device asks you to to proceed. - - type: call_button - content: To finish the unlocking, the phone needs to reboot. Just press 'Confirm and run' here to reboot. Then continue. - command: fastboot_reboot + In this step you actually unlock the bootloader. Just press 'Confirm and run' here. The phone will automatically reboot and reformat. + Once it's done, press continue here. + command: fastboot_oem_unlock - type: confirm_button content: The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. boot_recovery: diff --git a/openandroidinstaller/assets/configs/enchilada.yaml b/openandroidinstaller/assets/configs/enchilada.yaml index 5456fd84..63ae03c3 100644 --- a/openandroidinstaller/assets/configs/enchilada.yaml +++ b/openandroidinstaller/assets/configs/enchilada.yaml @@ -16,15 +16,10 @@ steps: Press 'Confirm and run' to reboot into the bootloader. command: adb_reboot_bootloader - type: call_button - content: In this step you actually unlock the bootloader. Just press 'Confirm and run' here. Once it's done, press continue here. - command: fastboot_oem_unlock - - type: confirm_button content: > - At this point the device may display on-screen prompts which will require interaction to continue the process of unlocking the bootloader. - Please take whatever actions the device asks you to to proceed. - - type: call_button - content: To finish the unlocking, the phone needs to reboot. Just press 'Confirm and run' here to reboot. Then continue. - command: fastboot_reboot + In this step you actually unlock the bootloader. Just press 'Confirm and run' here. The phone will automatically reboot and reformat. + Once it's done, press continue here. + command: fastboot_oem_unlock - type: confirm_button content: The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. boot_recovery: diff --git a/openandroidinstaller/assets/configs/fajita.yaml b/openandroidinstaller/assets/configs/fajita.yaml index 9eb558d6..bf40e645 100644 --- a/openandroidinstaller/assets/configs/fajita.yaml +++ b/openandroidinstaller/assets/configs/fajita.yaml @@ -16,15 +16,10 @@ steps: Press 'Confirm and run' to reboot into the bootloader. command: adb_reboot_bootloader - type: call_button - content: In this step you actually unlock the bootloader. Just press 'Confirm and run' here. Once it's done, press continue here. - command: fastboot_oem_unlock - - type: confirm_button content: > - At this point the device may display on-screen prompts which will require interaction to continue the process of unlocking the bootloader. - Please take whatever actions the device asks you to to proceed. - - type: call_button - content: To finish the unlocking, the phone needs to reboot. Just press 'Confirm and run' here to reboot. Then continue. - command: fastboot_reboot + In this step you actually unlock the bootloader. Just press 'Confirm and run' here. The phone will automatically reboot and reformat. + Once it's done, press continue here. + command: fastboot_oem_unlock - type: confirm_button content: The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. boot_recovery: diff --git a/openandroidinstaller/assets/configs/guacamole.yaml b/openandroidinstaller/assets/configs/guacamole.yaml index e6f54988..cafa1880 100644 --- a/openandroidinstaller/assets/configs/guacamole.yaml +++ b/openandroidinstaller/assets/configs/guacamole.yaml @@ -16,15 +16,10 @@ steps: Press 'Confirm and run' to reboot into the bootloader. command: adb_reboot_bootloader - type: call_button - content: In this step you actually unlock the bootloader. Just press 'Confirm and run' here. Once it's done, press continue here. - command: fastboot_oem_unlock - - type: confirm_button content: > - At this point the device may display on-screen prompts which will require interaction to continue the process of unlocking the bootloader. - Please take whatever actions the device asks you to to proceed. - - type: call_button - content: To finish the unlocking, the phone needs to reboot. Just press 'Confirm and run' here to reboot. Then continue. - command: fastboot_reboot + In this step you actually unlock the bootloader. Just press 'Confirm and run' here. The phone will automatically reboot and reformat. + Once it's done, press continue here. + command: fastboot_oem_unlock - type: confirm_button content: The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. boot_recovery: diff --git a/openandroidinstaller/assets/configs/guacamoleb.yaml b/openandroidinstaller/assets/configs/guacamoleb.yaml index 28c93690..5035a23a 100644 --- a/openandroidinstaller/assets/configs/guacamoleb.yaml +++ b/openandroidinstaller/assets/configs/guacamoleb.yaml @@ -16,15 +16,10 @@ steps: Press 'Confirm and run' to reboot into the bootloader. command: adb_reboot_bootloader - type: call_button - content: In this step you actually unlock the bootloader. Just press 'Confirm and run' here. Once it's done, press continue here. - command: fastboot_oem_unlock - - type: confirm_button content: > - At this point the device may display on-screen prompts which will require interaction to continue the process of unlocking the bootloader. - Please take whatever actions the device asks you to to proceed. - - type: call_button - content: To finish the unlocking, the phone needs to reboot. Just press 'Confirm and run' here to reboot. Then continue. - command: fastboot_reboot + In this step you actually unlock the bootloader. Just press 'Confirm and run' here. The phone will automatically reboot and reformat. + Once it's done, press continue here. + command: fastboot_oem_unlock - type: confirm_button content: The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. boot_recovery: diff --git a/openandroidinstaller/assets/configs/hotdog.yaml b/openandroidinstaller/assets/configs/hotdog.yaml index cbe7c5bf..a7b652a5 100644 --- a/openandroidinstaller/assets/configs/hotdog.yaml +++ b/openandroidinstaller/assets/configs/hotdog.yaml @@ -16,15 +16,10 @@ steps: Press 'Confirm and run' to reboot into the bootloader. command: adb_reboot_bootloader - type: call_button - content: In this step you actually unlock the bootloader. Just press 'Confirm and run' here. Once it's done, press continue here. - command: fastboot_oem_unlock - - type: confirm_button content: > - At this point the device may display on-screen prompts which will require interaction to continue the process of unlocking the bootloader. - Please take whatever actions the device asks you to to proceed. - - type: call_button - content: To finish the unlocking, the phone needs to reboot. Just press 'Confirm and run' here to reboot. Then continue. - command: fastboot_reboot + In this step you actually unlock the bootloader. Just press 'Confirm and run' here. The phone will automatically reboot and reformat. + Once it's done, press continue here. + command: fastboot_oem_unlock - type: confirm_button content: The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. boot_recovery: diff --git a/openandroidinstaller/assets/configs/hotdogb.yaml b/openandroidinstaller/assets/configs/hotdogb.yaml index 555b5c0a..ca2bdeda 100644 --- a/openandroidinstaller/assets/configs/hotdogb.yaml +++ b/openandroidinstaller/assets/configs/hotdogb.yaml @@ -16,15 +16,10 @@ steps: Press 'Confirm and run' to reboot into the bootloader. command: adb_reboot_bootloader - type: call_button - content: In this step you actually unlock the bootloader. Just press 'Confirm and run' here. Once it's done, press continue here. - command: fastboot_oem_unlock - - type: confirm_button content: > - At this point the device may display on-screen prompts which will require interaction to continue the process of unlocking the bootloader. - Please take whatever actions the device asks you to to proceed. - - type: call_button - content: To finish the unlocking, the phone needs to reboot. Just press 'Confirm and run' here to reboot. Then continue. - command: fastboot_reboot + In this step you actually unlock the bootloader. Just press 'Confirm and run' here. The phone will automatically reboot and reformat. + Once it's done, press continue here. + command: fastboot_oem_unlock - type: confirm_button content: The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. boot_recovery: From 69f73dd839751e0fe33b09ba105a13eca4814a28 Mon Sep 17 00:00:00 2001 From: MagicLike Date: Fri, 24 Mar 2023 19:06:20 +0100 Subject: [PATCH 02/13] Code formatting --- openandroidinstaller/assets/configs/avicii.yaml | 12 +++++++----- .../assets/configs/cheeseburger.yaml | 6 ++++-- openandroidinstaller/assets/configs/dre.yaml | 12 +++++++----- openandroidinstaller/assets/configs/dumpling.yaml | 6 ++++-- openandroidinstaller/assets/configs/enchilada.yaml | 12 +++++++----- openandroidinstaller/assets/configs/fajita.yaml | 12 +++++++----- openandroidinstaller/assets/configs/guacamole.yaml | 6 ++++-- openandroidinstaller/assets/configs/guacamoleb.yaml | 6 ++++-- openandroidinstaller/assets/configs/hotdog.yaml | 6 ++++-- openandroidinstaller/assets/configs/hotdogb.yaml | 6 ++++-- 10 files changed, 52 insertions(+), 32 deletions(-) diff --git a/openandroidinstaller/assets/configs/avicii.yaml b/openandroidinstaller/assets/configs/avicii.yaml index 5e8443b2..f9008bcb 100644 --- a/openandroidinstaller/assets/configs/avicii.yaml +++ b/openandroidinstaller/assets/configs/avicii.yaml @@ -21,7 +21,8 @@ steps: Once it's done, press continue here. command: fastboot_oem_unlock - type: confirm_button - content: The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. + content: > + The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. boot_recovery: - type: call_button content: > @@ -30,14 +31,15 @@ steps: Make sure your device is turned on. You need to reboot into the bootloader again by pressing 'Confirm and run' here. Then continue. command: adb_reboot_bootloader - type: call_button - content: Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue. + content: > + Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue. command: fastboot_boot_recovery - type: call_button - command: adb_twrp_copy_partitions content: > In some cases, the inactive slot can be unpopulated or contain much older firmware than the active slot, leading to various issues including a potential hard-brick. We can ensure none of that will happen by copying the contents of the active slot to the inactive slot. Press 'confirm and run' to to this. Once you are in the bootloader again, continue. + command: adb_twrp_copy_partitions - type: call_button - command: fastboot_boot_recovery content: > - Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue. \ No newline at end of file + Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue. + command: fastboot_boot_recovery \ No newline at end of file diff --git a/openandroidinstaller/assets/configs/cheeseburger.yaml b/openandroidinstaller/assets/configs/cheeseburger.yaml index a04fd467..f24ce440 100644 --- a/openandroidinstaller/assets/configs/cheeseburger.yaml +++ b/openandroidinstaller/assets/configs/cheeseburger.yaml @@ -20,7 +20,8 @@ steps: Once it's done, press continue here. command: fastboot_oem_unlock - type: confirm_button - content: The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. + content: > + The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. boot_recovery: - type: call_button content: > @@ -29,5 +30,6 @@ steps: Make sure your device is turned on. You need to reboot into the bootloader again by pressing 'Confirm and run' here. Then continue. command: adb_reboot_bootloader - type: call_button - content: Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue. + content: > + Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue. command: fastboot_boot_recovery \ No newline at end of file diff --git a/openandroidinstaller/assets/configs/dre.yaml b/openandroidinstaller/assets/configs/dre.yaml index 528035ce..ffefc560 100644 --- a/openandroidinstaller/assets/configs/dre.yaml +++ b/openandroidinstaller/assets/configs/dre.yaml @@ -21,7 +21,8 @@ steps: Once it's done, press continue here. command: fastboot_oem_unlock - type: confirm_button - content: The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. + content: > + The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. boot_recovery: - type: call_button content: > @@ -30,14 +31,15 @@ steps: Make sure your device is turned on. You need to reboot into the bootloader again by pressing 'Confirm and run' here. Then continue. command: adb_reboot_bootloader - type: call_button - content: Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue. + content: > + Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue. command: fastboot_boot_recovery - type: call_button - command: adb_twrp_copy_partitions content: > In some cases, the inactive slot can be unpopulated or contain much older firmware than the active slot, leading to various issues including a potential hard-brick. We can ensure none of that will happen by copying the contents of the active slot to the inactive slot. Press 'confirm and run' to to this. Once you are in the bootloader again, continue. + command: adb_twrp_copy_partitions - type: call_button - command: fastboot_boot_recovery content: > - Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue. \ No newline at end of file + Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue. + command: fastboot_boot_recovery \ No newline at end of file diff --git a/openandroidinstaller/assets/configs/dumpling.yaml b/openandroidinstaller/assets/configs/dumpling.yaml index 684f8a62..289ef905 100644 --- a/openandroidinstaller/assets/configs/dumpling.yaml +++ b/openandroidinstaller/assets/configs/dumpling.yaml @@ -20,7 +20,8 @@ steps: Once it's done, press continue here. command: fastboot_oem_unlock - type: confirm_button - content: The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. + content: > + The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. boot_recovery: - type: call_button content: > @@ -29,5 +30,6 @@ steps: Make sure your device is turned on. You need to reboot into the bootloader again by pressing 'Confirm and run' here. Then continue. command: adb_reboot_bootloader - type: call_button - content: Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue. + content: > + Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue. command: fastboot_boot_recovery \ No newline at end of file diff --git a/openandroidinstaller/assets/configs/enchilada.yaml b/openandroidinstaller/assets/configs/enchilada.yaml index 63ae03c3..ad8de76f 100644 --- a/openandroidinstaller/assets/configs/enchilada.yaml +++ b/openandroidinstaller/assets/configs/enchilada.yaml @@ -21,7 +21,8 @@ steps: Once it's done, press continue here. command: fastboot_oem_unlock - type: confirm_button - content: The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. + content: > + The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. boot_recovery: - type: call_button content: > @@ -30,14 +31,15 @@ steps: Make sure your device is turned on. You need to reboot into the bootloader again by pressing 'Confirm and run' here. Then continue. command: adb_reboot_bootloader - type: call_button - content: Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue. + content: > + Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue. command: fastboot_boot_recovery - type: call_button - command: adb_twrp_copy_partitions content: > In some cases, the inactive slot can be unpopulated or contain much older firmware than the active slot, leading to various issues including a potential hard-brick. We can ensure none of that will happen by copying the contents of the active slot to the inactive slot. Press 'confirm and run' to to this. Once you are in the bootloader again, continue. + command: adb_twrp_copy_partitions - type: call_button - command: fastboot_boot_recovery content: > - Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue. \ No newline at end of file + Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue. + command: fastboot_boot_recovery \ No newline at end of file diff --git a/openandroidinstaller/assets/configs/fajita.yaml b/openandroidinstaller/assets/configs/fajita.yaml index bf40e645..146b8faa 100644 --- a/openandroidinstaller/assets/configs/fajita.yaml +++ b/openandroidinstaller/assets/configs/fajita.yaml @@ -21,7 +21,8 @@ steps: Once it's done, press continue here. command: fastboot_oem_unlock - type: confirm_button - content: The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. + content: > + The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. boot_recovery: - type: call_button content: > @@ -30,14 +31,15 @@ steps: Make sure your device is turned on. You need to reboot into the bootloader again by pressing 'Confirm and run' here. Then continue. command: adb_reboot_bootloader - type: call_button - content: Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue. + content: > + Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue. command: fastboot_boot_recovery - type: call_button - command: adb_twrp_copy_partitions content: > In some cases, the inactive slot can be unpopulated or contain much older firmware than the active slot, leading to various issues including a potential hard-brick. We can ensure none of that will happen by copying the contents of the active slot to the inactive slot. Press 'confirm and run' to to this. Once you are in the bootloader again, continue. + command: adb_twrp_copy_partitions - type: call_button - command: fastboot_boot_recovery content: > - Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue. \ No newline at end of file + Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue. + command: fastboot_boot_recovery \ No newline at end of file diff --git a/openandroidinstaller/assets/configs/guacamole.yaml b/openandroidinstaller/assets/configs/guacamole.yaml index cafa1880..15735b45 100644 --- a/openandroidinstaller/assets/configs/guacamole.yaml +++ b/openandroidinstaller/assets/configs/guacamole.yaml @@ -21,7 +21,8 @@ steps: Once it's done, press continue here. command: fastboot_oem_unlock - type: confirm_button - content: The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. + content: > + The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. boot_recovery: - type: call_button content: > @@ -30,5 +31,6 @@ steps: Make sure your device is turned on. You need to reboot into the bootloader again by pressing 'Confirm and run' here. Then continue. command: adb_reboot_bootloader - type: call_button - content: Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue. + content: > + Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue. command: fastboot_boot_recovery \ No newline at end of file diff --git a/openandroidinstaller/assets/configs/guacamoleb.yaml b/openandroidinstaller/assets/configs/guacamoleb.yaml index 5035a23a..83b93a50 100644 --- a/openandroidinstaller/assets/configs/guacamoleb.yaml +++ b/openandroidinstaller/assets/configs/guacamoleb.yaml @@ -21,7 +21,8 @@ steps: Once it's done, press continue here. command: fastboot_oem_unlock - type: confirm_button - content: The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. + content: > + The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. boot_recovery: - type: call_button content: > @@ -30,5 +31,6 @@ steps: Make sure your device is turned on. You need to reboot into the bootloader again by pressing 'Confirm and run' here. Then continue. command: adb_reboot_bootloader - type: call_button - content: Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue. + content: > + Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue. command: fastboot_boot_recovery \ No newline at end of file diff --git a/openandroidinstaller/assets/configs/hotdog.yaml b/openandroidinstaller/assets/configs/hotdog.yaml index a7b652a5..bbf5e103 100644 --- a/openandroidinstaller/assets/configs/hotdog.yaml +++ b/openandroidinstaller/assets/configs/hotdog.yaml @@ -21,7 +21,8 @@ steps: Once it's done, press continue here. command: fastboot_oem_unlock - type: confirm_button - content: The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. + content: > + The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. boot_recovery: - type: call_button content: > @@ -30,5 +31,6 @@ steps: Make sure your device is turned on. You need to reboot into the bootloader again by pressing 'Confirm and run' here. Then continue. command: adb_reboot_bootloader - type: call_button - content: Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue. + content: > + Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue. command: fastboot_boot_recovery \ No newline at end of file diff --git a/openandroidinstaller/assets/configs/hotdogb.yaml b/openandroidinstaller/assets/configs/hotdogb.yaml index ca2bdeda..2d55d948 100644 --- a/openandroidinstaller/assets/configs/hotdogb.yaml +++ b/openandroidinstaller/assets/configs/hotdogb.yaml @@ -21,7 +21,8 @@ steps: Once it's done, press continue here. command: fastboot_oem_unlock - type: confirm_button - content: The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. + content: > + The bootloader is now unlocked. Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. boot_recovery: - type: call_button content: > @@ -30,5 +31,6 @@ steps: Make sure your device is turned on. You need to reboot into the bootloader again by pressing 'Confirm and run' here. Then continue. command: adb_reboot_bootloader - type: call_button - content: Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue. + content: > + Boot a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue. command: fastboot_boot_recovery \ No newline at end of file From 2df4a66377b2889efb81994a1d8ff87ffbd2991d Mon Sep 17 00:00:00 2001 From: Tobias Sterbak Date: Mon, 27 Mar 2023 11:09:21 +0200 Subject: [PATCH 03/13] Replace detect_is_ab_device by field in the config --- openandroidinstaller/app_state.py | 1 - .../assets/configs/sargo.yaml | 3 +- openandroidinstaller/installer_config.py | 2 + openandroidinstaller/tooling.py | 40 ----------------- .../views/install_addons_view.py | 2 +- openandroidinstaller/views/install_view.py | 2 +- openandroidinstaller/views/start_view.py | 4 +- openandroidinstaller/views/step_view.py | 2 +- tests/test_tooling.py | 43 +------------------ 9 files changed, 9 insertions(+), 90 deletions(-) diff --git a/openandroidinstaller/app_state.py b/openandroidinstaller/app_state.py index 40fb427d..49f69155 100644 --- a/openandroidinstaller/app_state.py +++ b/openandroidinstaller/app_state.py @@ -43,7 +43,6 @@ def __init__( self.config = None self.image_path = None self.recovery_path = None - self.is_ab = None # store views self.default_views: List = [] diff --git a/openandroidinstaller/assets/configs/sargo.yaml b/openandroidinstaller/assets/configs/sargo.yaml index af1b6da4..68ada457 100644 --- a/openandroidinstaller/assets/configs/sargo.yaml +++ b/openandroidinstaller/assets/configs/sargo.yaml @@ -1,7 +1,8 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Pixel 3a - device_code: sargo + is_ab_device: true + device_code: sargo supported_device_codes: - sargo requirements: diff --git a/openandroidinstaller/installer_config.py b/openandroidinstaller/installer_config.py index 0707423b..70ca5a01 100644 --- a/openandroidinstaller/installer_config.py +++ b/openandroidinstaller/installer_config.py @@ -61,6 +61,7 @@ def __init__( self.metadata = metadata self.requirements = requirements self.device_code = metadata.get("device_code") + self.is_ab = metadata.get("is_ab_device", False) self.supported_device_codes = metadata.get("supported_device_codes") self.twrp_link = metadata.get("twrp-link") @@ -161,6 +162,7 @@ def validate_config(config: str) -> bool: "metadata": { "maintainer": str, "device_name": str, + "is_ab_device": bool, "device_code": str, "supported_device_codes": [str], schema.Optional("twrp-link"): str, diff --git a/openandroidinstaller/tooling.py b/openandroidinstaller/tooling.py index 097c35e6..c8b95dfd 100644 --- a/openandroidinstaller/tooling.py +++ b/openandroidinstaller/tooling.py @@ -468,43 +468,3 @@ def search_device(platform: str, bin_path: Path) -> Optional[str]: except CalledProcessError: logger.error("Failed to detect a device.") return None - - -def check_ab_partition(platform: str, bin_path: Path) -> Optional[bool]: - """Figure out, if its an a/b-partitioned device.""" - logger.info(f"Run on {platform} with {bin_path}...") - try: - # check if ab device - if platform in ("linux", "darwin"): - output = check_output( - [ - str(bin_path.joinpath(Path("adb"))), - "shell", - "getprop", - "|", - "grep", - "ro.boot.slot_suffix", - ], - stderr=STDOUT, - ).decode() - elif platform in ("windows", "win32"): - output = check_output( - [ - str(bin_path.joinpath(Path("adb.exe"))), - "shell", - "getprop", - "|", - "findstr", - "ro.boot.slot_suffix", - ], - stderr=STDOUT, - shell=True, - ).decode() - else: - raise Exception(f"Unknown platform {platform}.") - logger.info(output) - logger.info("This is an a/b-partitioned device.") - return True - except CalledProcessError: - logger.info("This is not an a/b-partitioned device.") - return False diff --git a/openandroidinstaller/views/install_addons_view.py b/openandroidinstaller/views/install_addons_view.py index 7bb71e42..64560fd1 100644 --- a/openandroidinstaller/views/install_addons_view.py +++ b/openandroidinstaller/views/install_addons_view.py @@ -158,7 +158,7 @@ def run_install_addons(self, e): for line in adb_twrp_install_addons( addons=self.state.addon_paths, bin_path=self.state.bin_path, - is_ab=self.state.is_ab, + is_ab=self.state.config.is_ab, ): # write the line to advanced output terminal self.terminal_box.write_line(line) diff --git a/openandroidinstaller/views/install_view.py b/openandroidinstaller/views/install_view.py index 29283fab..22c0372d 100644 --- a/openandroidinstaller/views/install_view.py +++ b/openandroidinstaller/views/install_view.py @@ -189,7 +189,7 @@ def run_install(self, e): config_path=self.state.config_path, bin_path=self.state.bin_path, install_addons=self.state.install_addons, - is_ab=self.state.is_ab, + is_ab=self.state.config.is_ab, recovery=self.state.recovery_path, ): # write the line to advanced output terminal diff --git a/openandroidinstaller/views/start_view.py b/openandroidinstaller/views/start_view.py index abf64064..65bf8f52 100644 --- a/openandroidinstaller/views/start_view.py +++ b/openandroidinstaller/views/start_view.py @@ -213,7 +213,7 @@ def search_devices(self, e): # search the device if self.state.test: # this only happens for testing - device_code, is_ab = self.state.test_config, True + device_code = self.state.test_config logger.info( f"Running search in development mode and loading config {device_code}.yaml." ) @@ -239,8 +239,6 @@ def search_devices(self, e): self.device_name.value = device_code # load config from file self.state.load_config(device_code) - # write ab-info to state - self.state.is_ab = is_ab if self.state.config: device_name = self.state.config.metadata.get( "device_name", "No device name in config." diff --git a/openandroidinstaller/views/step_view.py b/openandroidinstaller/views/step_view.py index eb484eb3..597d069a 100644 --- a/openandroidinstaller/views/step_view.py +++ b/openandroidinstaller/views/step_view.py @@ -220,7 +220,7 @@ def call_to_phone(self, e, command: str): "fastboot_boot_recovery": partial( fastboot_boot_recovery, recovery=self.state.recovery_path, - is_ab=self.state.is_ab, + is_ab=self.state.config.is_ab, ), "fastboot_flash_boot": partial( fastboot_flash_boot, diff --git a/tests/test_tooling.py b/tests/test_tooling.py index c66f6e97..6e666c1e 100644 --- a/tests/test_tooling.py +++ b/tests/test_tooling.py @@ -19,7 +19,6 @@ from openandroidinstaller.tooling import ( adb_reboot, search_device, - check_ab_partition, ) @@ -95,44 +94,4 @@ def patched_check_output(*args, **kwargs): platform="linux", bin_path=Path("openandroidinstaller/bin/") ) - assert device_code == None - - -def test_check_ab_device_is_ab(mocker): - """Test if checking for ab device works fine.""" - mocker.patch( - "openandroidinstaller.tooling.check_output", - return_value=b"[ro.boot.slot_suffix]: [_b]", - ) - - # test linux - is_ab = check_ab_partition( - platform="linux", bin_path=Path("openandroidinstaller/bin/") - ) - - assert is_ab - - # test windows - is_ab = check_ab_partition( - platform="windows", bin_path=Path("openandroidinstaller/bin/") - ) - - assert is_ab - - -def test_check_ab_device_not_ab(mocker): - """Test if checking for ab device returns False if it fails.""" - - def patched_check_output(*args, **kwargs): - raise CalledProcessError(returncode=1, cmd="output is None") - - mocker.patch( - "openandroidinstaller.tooling.check_output", - patched_check_output, - ) - - is_ab = check_ab_partition( - platform="linux", bin_path=Path("openandroidinstaller/bin/") - ) - - assert not is_ab + assert device_code == None \ No newline at end of file From 523b9c74425257f0d99384a5f56db66e25c4d0af Mon Sep 17 00:00:00 2001 From: Tobias Sterbak Date: Mon, 27 Mar 2023 11:13:43 +0200 Subject: [PATCH 04/13] Update configs accordinly --- openandroidinstaller/assets/configs/FP2.yaml | 1 + openandroidinstaller/assets/configs/FP3.yaml | 1 + openandroidinstaller/assets/configs/FP4.yaml | 1 + openandroidinstaller/assets/configs/a3y17lte.yaml | 1 + openandroidinstaller/assets/configs/a5xelte.yaml | 1 + openandroidinstaller/assets/configs/a72q.yaml | 1 + openandroidinstaller/assets/configs/a7xelte.yaml | 1 + openandroidinstaller/assets/configs/akari.yaml | 1 + openandroidinstaller/assets/configs/akatsuki.yaml | 1 + openandroidinstaller/assets/configs/avicii.yaml | 1 + openandroidinstaller/assets/configs/bacon.yaml | 1 + openandroidinstaller/assets/configs/barbet.yaml | 1 + openandroidinstaller/assets/configs/beyond0lte.yaml | 1 + openandroidinstaller/assets/configs/beyond1lte.yaml | 1 + openandroidinstaller/assets/configs/beyond2lte.yaml | 1 + openandroidinstaller/assets/configs/blueline.yaml | 1 + openandroidinstaller/assets/configs/bonito.yaml | 1 + openandroidinstaller/assets/configs/cedric.yaml | 1 + openandroidinstaller/assets/configs/cheeseburger.yaml | 1 + openandroidinstaller/assets/configs/coral.yaml | 1 + openandroidinstaller/assets/configs/crosshatch.yaml | 1 + openandroidinstaller/assets/configs/crownlte.yaml | 1 + openandroidinstaller/assets/configs/d1.yaml | 1 + openandroidinstaller/assets/configs/d2s.yaml | 1 + openandroidinstaller/assets/configs/dre.yaml | 1 + openandroidinstaller/assets/configs/dumpling.yaml | 1 + openandroidinstaller/assets/configs/enchilada.yaml | 1 + openandroidinstaller/assets/configs/evert.yaml | 1 + openandroidinstaller/assets/configs/fajita.yaml | 1 + openandroidinstaller/assets/configs/flame.yaml | 1 + openandroidinstaller/assets/configs/greatlte.yaml | 1 + openandroidinstaller/assets/configs/griffin.yaml | 1 + openandroidinstaller/assets/configs/guacamole.yaml | 1 + openandroidinstaller/assets/configs/guacamoleb.yaml | 1 + openandroidinstaller/assets/configs/hero2lte.yaml | 1 + openandroidinstaller/assets/configs/herolte.yaml | 1 + openandroidinstaller/assets/configs/hltetmo.yaml | 1 + openandroidinstaller/assets/configs/hotdog.yaml | 1 + openandroidinstaller/assets/configs/hotdogb.yaml | 1 + openandroidinstaller/assets/configs/j7elte.yaml | 1 + openandroidinstaller/assets/configs/kiev.yaml | 1 + openandroidinstaller/assets/configs/kirin.yaml | 1 + openandroidinstaller/assets/configs/mermaid.yaml | 1 + openandroidinstaller/assets/configs/nairo.yaml | 1 + openandroidinstaller/assets/configs/ocean.yaml | 1 + openandroidinstaller/assets/configs/pioneer.yaml | 1 + openandroidinstaller/assets/configs/racer.yaml | 1 + openandroidinstaller/assets/configs/redfin.yaml | 1 + openandroidinstaller/assets/configs/s3ve3g.yaml | 1 + openandroidinstaller/assets/configs/starlte.yaml | 1 + openandroidinstaller/assets/configs/sunfish.yaml | 1 + openandroidinstaller/assets/configs/taimen.yaml | 1 + openandroidinstaller/assets/configs/walleye.yaml | 1 + openandroidinstaller/assets/configs/yuga.yaml | 1 + openandroidinstaller/assets/configs/z3.yaml | 1 + openandroidinstaller/assets/configs/zerofltexx.yaml | 1 + openandroidinstaller/assets/configs/zeroltexx.yaml | 1 + openandroidinstaller/views/start_view.py | 5 +---- tests/test_tooling.py | 2 +- 59 files changed, 59 insertions(+), 5 deletions(-) diff --git a/openandroidinstaller/assets/configs/FP2.yaml b/openandroidinstaller/assets/configs/FP2.yaml index c00c70dc..55588617 100644 --- a/openandroidinstaller/assets/configs/FP2.yaml +++ b/openandroidinstaller/assets/configs/FP2.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Fairphone 2 + is_ab_device: true device_code: FP2 supported_device_codes: - FP2 diff --git a/openandroidinstaller/assets/configs/FP3.yaml b/openandroidinstaller/assets/configs/FP3.yaml index 19bdb5a5..b6b775d0 100644 --- a/openandroidinstaller/assets/configs/FP3.yaml +++ b/openandroidinstaller/assets/configs/FP3.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Fairphone 3 + is_ab_device: true device_code: FP3 supported_device_codes: - FP3 diff --git a/openandroidinstaller/assets/configs/FP4.yaml b/openandroidinstaller/assets/configs/FP4.yaml index ebf59f4f..7fdc1fd1 100644 --- a/openandroidinstaller/assets/configs/FP4.yaml +++ b/openandroidinstaller/assets/configs/FP4.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Fairphone 4 + is_ab_device: true device_code: FP4 supported_device_codes: - FP4 diff --git a/openandroidinstaller/assets/configs/a3y17lte.yaml b/openandroidinstaller/assets/configs/a3y17lte.yaml index e0ec7461..5e6f8d83 100644 --- a/openandroidinstaller/assets/configs/a3y17lte.yaml +++ b/openandroidinstaller/assets/configs/a3y17lte.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy A3 (2017) + is_ab_device: true device_code: a3y17lte supported_device_codes: - a3y17lte diff --git a/openandroidinstaller/assets/configs/a5xelte.yaml b/openandroidinstaller/assets/configs/a5xelte.yaml index 06b0769c..c9dc541f 100644 --- a/openandroidinstaller/assets/configs/a5xelte.yaml +++ b/openandroidinstaller/assets/configs/a5xelte.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy A5 (2016) + is_ab_device: true device_code: a5xelte supported_device_codes: - a5xelte diff --git a/openandroidinstaller/assets/configs/a72q.yaml b/openandroidinstaller/assets/configs/a72q.yaml index 87721275..4b663e48 100644 --- a/openandroidinstaller/assets/configs/a72q.yaml +++ b/openandroidinstaller/assets/configs/a72q.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy A72 + is_ab_device: true device_code: a72q supported_device_codes: - a72q diff --git a/openandroidinstaller/assets/configs/a7xelte.yaml b/openandroidinstaller/assets/configs/a7xelte.yaml index 856ba6b6..8d1d9c8c 100644 --- a/openandroidinstaller/assets/configs/a7xelte.yaml +++ b/openandroidinstaller/assets/configs/a7xelte.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy A7 (2016) + is_ab_device: true device_code: a7xelte supported_device_codes: - a7xelte diff --git a/openandroidinstaller/assets/configs/akari.yaml b/openandroidinstaller/assets/configs/akari.yaml index e5bf40d6..20b7ed8d 100644 --- a/openandroidinstaller/assets/configs/akari.yaml +++ b/openandroidinstaller/assets/configs/akari.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Sony Xperia XZ2 + is_ab_device: true device_code: akari supported_device_codes: - akari diff --git a/openandroidinstaller/assets/configs/akatsuki.yaml b/openandroidinstaller/assets/configs/akatsuki.yaml index bc825a25..41b8e7bf 100644 --- a/openandroidinstaller/assets/configs/akatsuki.yaml +++ b/openandroidinstaller/assets/configs/akatsuki.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Sony Xperia XZ3 + is_ab_device: true device_code: akatsuki supported_device_codes: - akatsuki diff --git a/openandroidinstaller/assets/configs/avicii.yaml b/openandroidinstaller/assets/configs/avicii.yaml index 7a828956..a548cfd6 100644 --- a/openandroidinstaller/assets/configs/avicii.yaml +++ b/openandroidinstaller/assets/configs/avicii.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: OnePlus Nord + is_ab_device: true device_code: avicii supported_device_codes: - avicii diff --git a/openandroidinstaller/assets/configs/bacon.yaml b/openandroidinstaller/assets/configs/bacon.yaml index d1739cfe..fb251e99 100644 --- a/openandroidinstaller/assets/configs/bacon.yaml +++ b/openandroidinstaller/assets/configs/bacon.yaml @@ -1,6 +1,7 @@ metadata: maintainer: MagicLike device_name: OnePlus One + is_ab_device: true device_code: bacon supported_device_codes: - bacon diff --git a/openandroidinstaller/assets/configs/barbet.yaml b/openandroidinstaller/assets/configs/barbet.yaml index cef8f74a..00c14fb5 100644 --- a/openandroidinstaller/assets/configs/barbet.yaml +++ b/openandroidinstaller/assets/configs/barbet.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Pixel 5a + is_ab_device: true device_code: barbet supported_device_codes: - barbet diff --git a/openandroidinstaller/assets/configs/beyond0lte.yaml b/openandroidinstaller/assets/configs/beyond0lte.yaml index e5c6be64..c3d54b1d 100644 --- a/openandroidinstaller/assets/configs/beyond0lte.yaml +++ b/openandroidinstaller/assets/configs/beyond0lte.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy S10e + is_ab_device: true device_code: beyond0lte supported_device_codes: - beyond0lte diff --git a/openandroidinstaller/assets/configs/beyond1lte.yaml b/openandroidinstaller/assets/configs/beyond1lte.yaml index b915be41..0839f0b8 100644 --- a/openandroidinstaller/assets/configs/beyond1lte.yaml +++ b/openandroidinstaller/assets/configs/beyond1lte.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy S10 + is_ab_device: true device_code: beyond1lte supported_device_codes: - beyond1lte diff --git a/openandroidinstaller/assets/configs/beyond2lte.yaml b/openandroidinstaller/assets/configs/beyond2lte.yaml index 7df64b5e..239cc07b 100644 --- a/openandroidinstaller/assets/configs/beyond2lte.yaml +++ b/openandroidinstaller/assets/configs/beyond2lte.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy S10+ + is_ab_device: true device_code: beyond2lte supported_device_codes: - beyond2lte diff --git a/openandroidinstaller/assets/configs/blueline.yaml b/openandroidinstaller/assets/configs/blueline.yaml index ffb418a3..b60ec55a 100644 --- a/openandroidinstaller/assets/configs/blueline.yaml +++ b/openandroidinstaller/assets/configs/blueline.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Google Pixel 3 + is_ab_device: true device_code: blueline supported_device_codes: - blueline diff --git a/openandroidinstaller/assets/configs/bonito.yaml b/openandroidinstaller/assets/configs/bonito.yaml index 219c0daa..d26bfa34 100644 --- a/openandroidinstaller/assets/configs/bonito.yaml +++ b/openandroidinstaller/assets/configs/bonito.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Google Pixel 3a XL + is_ab_device: true device_code: bonito supported_device_codes: - bonito diff --git a/openandroidinstaller/assets/configs/cedric.yaml b/openandroidinstaller/assets/configs/cedric.yaml index 16311c8c..6e63df41 100644 --- a/openandroidinstaller/assets/configs/cedric.yaml +++ b/openandroidinstaller/assets/configs/cedric.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Motorola Moto G5 + is_ab_device: true device_code: cedric supported_device_codes: - cedric diff --git a/openandroidinstaller/assets/configs/cheeseburger.yaml b/openandroidinstaller/assets/configs/cheeseburger.yaml index 832ea06f..5436b439 100644 --- a/openandroidinstaller/assets/configs/cheeseburger.yaml +++ b/openandroidinstaller/assets/configs/cheeseburger.yaml @@ -1,6 +1,7 @@ metadata: maintainer: SirRGB device_name: OnePlus 5 + is_ab_device: true device_code: cheeseburger supported_device_codes: - cheeseburger diff --git a/openandroidinstaller/assets/configs/coral.yaml b/openandroidinstaller/assets/configs/coral.yaml index 4a7f194b..a469e721 100644 --- a/openandroidinstaller/assets/configs/coral.yaml +++ b/openandroidinstaller/assets/configs/coral.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Google Pixel 4 XL + is_ab_device: true device_code: coral supported_device_codes: - coral diff --git a/openandroidinstaller/assets/configs/crosshatch.yaml b/openandroidinstaller/assets/configs/crosshatch.yaml index e42609a9..7ae26231 100644 --- a/openandroidinstaller/assets/configs/crosshatch.yaml +++ b/openandroidinstaller/assets/configs/crosshatch.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Google Pixel 3 XL + is_ab_device: true device_code: crosshatch supported_device_codes: - crosshatch diff --git a/openandroidinstaller/assets/configs/crownlte.yaml b/openandroidinstaller/assets/configs/crownlte.yaml index 19dfbe9b..97e8eb2e 100644 --- a/openandroidinstaller/assets/configs/crownlte.yaml +++ b/openandroidinstaller/assets/configs/crownlte.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy Note 9 + is_ab_device: true device_code: crownlte supported_device_codes: - crownlte diff --git a/openandroidinstaller/assets/configs/d1.yaml b/openandroidinstaller/assets/configs/d1.yaml index e28a3906..25c0481b 100644 --- a/openandroidinstaller/assets/configs/d1.yaml +++ b/openandroidinstaller/assets/configs/d1.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy Note 10 + is_ab_device: true device_code: d1 supported_device_codes: - d1 diff --git a/openandroidinstaller/assets/configs/d2s.yaml b/openandroidinstaller/assets/configs/d2s.yaml index 3e0b705f..adb537ff 100644 --- a/openandroidinstaller/assets/configs/d2s.yaml +++ b/openandroidinstaller/assets/configs/d2s.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy Note 10+ + is_ab_device: true device_code: d2s supported_device_codes: - d2s diff --git a/openandroidinstaller/assets/configs/dre.yaml b/openandroidinstaller/assets/configs/dre.yaml index fa04addf..dba46996 100644 --- a/openandroidinstaller/assets/configs/dre.yaml +++ b/openandroidinstaller/assets/configs/dre.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: OnePlus Nord N200 + is_ab_device: true device_code: dre supported_device_codes: - dre diff --git a/openandroidinstaller/assets/configs/dumpling.yaml b/openandroidinstaller/assets/configs/dumpling.yaml index 329280cf..fff6074f 100644 --- a/openandroidinstaller/assets/configs/dumpling.yaml +++ b/openandroidinstaller/assets/configs/dumpling.yaml @@ -1,6 +1,7 @@ metadata: maintainer: SirRGB device_name: OnePlus 5T + is_ab_device: true device_code: dumpling supported_device_codes: - dumpling diff --git a/openandroidinstaller/assets/configs/enchilada.yaml b/openandroidinstaller/assets/configs/enchilada.yaml index 5456fd84..67a155bc 100644 --- a/openandroidinstaller/assets/configs/enchilada.yaml +++ b/openandroidinstaller/assets/configs/enchilada.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: OnePlus 6 + is_ab_device: true device_code: enchilada supported_device_codes: - enchilada diff --git a/openandroidinstaller/assets/configs/evert.yaml b/openandroidinstaller/assets/configs/evert.yaml index 24a9e602..5dd98f0f 100644 --- a/openandroidinstaller/assets/configs/evert.yaml +++ b/openandroidinstaller/assets/configs/evert.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Motorola moto g6 plus + is_ab_device: true device_code: evert supported_device_codes: - evert diff --git a/openandroidinstaller/assets/configs/fajita.yaml b/openandroidinstaller/assets/configs/fajita.yaml index 9eb558d6..3c42c730 100644 --- a/openandroidinstaller/assets/configs/fajita.yaml +++ b/openandroidinstaller/assets/configs/fajita.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: OnePlus 6T + is_ab_device: true device_code: fajita supported_device_codes: - fajita diff --git a/openandroidinstaller/assets/configs/flame.yaml b/openandroidinstaller/assets/configs/flame.yaml index 4e2e38b6..1d41b157 100644 --- a/openandroidinstaller/assets/configs/flame.yaml +++ b/openandroidinstaller/assets/configs/flame.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Pixel 4 + is_ab_device: true device_code: flame supported_device_codes: - flame diff --git a/openandroidinstaller/assets/configs/greatlte.yaml b/openandroidinstaller/assets/configs/greatlte.yaml index c5464fa4..443db5ab 100644 --- a/openandroidinstaller/assets/configs/greatlte.yaml +++ b/openandroidinstaller/assets/configs/greatlte.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Michel Memeteau (freechelmi) device_name: Samsung Galaxy note 8 + is_ab_device: true device_code: greatlte supported_device_codes: - greatlte diff --git a/openandroidinstaller/assets/configs/griffin.yaml b/openandroidinstaller/assets/configs/griffin.yaml index b4fb3fb3..ab21f87e 100644 --- a/openandroidinstaller/assets/configs/griffin.yaml +++ b/openandroidinstaller/assets/configs/griffin.yaml @@ -1,6 +1,7 @@ metadata: maintainer: SirRGB device_name: Motorola Moto Z + is_ab_device: true device_code: griffin supported_device_codes: - griffin diff --git a/openandroidinstaller/assets/configs/guacamole.yaml b/openandroidinstaller/assets/configs/guacamole.yaml index e6f54988..86e4f1d4 100644 --- a/openandroidinstaller/assets/configs/guacamole.yaml +++ b/openandroidinstaller/assets/configs/guacamole.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: OnePlus 7 Pro + is_ab_device: true device_code: guacamole supported_device_codes: - guacamole diff --git a/openandroidinstaller/assets/configs/guacamoleb.yaml b/openandroidinstaller/assets/configs/guacamoleb.yaml index 28c93690..c3a87d1b 100644 --- a/openandroidinstaller/assets/configs/guacamoleb.yaml +++ b/openandroidinstaller/assets/configs/guacamoleb.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: OnePlus 7 + is_ab_device: true device_code: guacamoleb supported_device_codes: - guacamoleb diff --git a/openandroidinstaller/assets/configs/hero2lte.yaml b/openandroidinstaller/assets/configs/hero2lte.yaml index 44c0101c..b94b7dac 100644 --- a/openandroidinstaller/assets/configs/hero2lte.yaml +++ b/openandroidinstaller/assets/configs/hero2lte.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy S7 Edge + is_ab_device: true device_code: hero2lte supported_device_codes: - hero2lte diff --git a/openandroidinstaller/assets/configs/herolte.yaml b/openandroidinstaller/assets/configs/herolte.yaml index 4e102e61..bdcf513b 100644 --- a/openandroidinstaller/assets/configs/herolte.yaml +++ b/openandroidinstaller/assets/configs/herolte.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy S7 + is_ab_device: true device_code: herolte supported_device_codes: - herolte diff --git a/openandroidinstaller/assets/configs/hltetmo.yaml b/openandroidinstaller/assets/configs/hltetmo.yaml index 57776fa1..013aa7f0 100644 --- a/openandroidinstaller/assets/configs/hltetmo.yaml +++ b/openandroidinstaller/assets/configs/hltetmo.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy Note 3 LTE (N900T/V/W8) + is_ab_device: true device_code: hltetmo supported_device_codes: - hltetmo diff --git a/openandroidinstaller/assets/configs/hotdog.yaml b/openandroidinstaller/assets/configs/hotdog.yaml index cbe7c5bf..7faddfc6 100644 --- a/openandroidinstaller/assets/configs/hotdog.yaml +++ b/openandroidinstaller/assets/configs/hotdog.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: OnePlus 7T Pro + is_ab_device: true device_code: hotdog supported_device_codes: - hotdog diff --git a/openandroidinstaller/assets/configs/hotdogb.yaml b/openandroidinstaller/assets/configs/hotdogb.yaml index 555b5c0a..194d0990 100644 --- a/openandroidinstaller/assets/configs/hotdogb.yaml +++ b/openandroidinstaller/assets/configs/hotdogb.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: OnePlus 7T + is_ab_device: true device_code: hotdogb supported_device_codes: - hotdogb diff --git a/openandroidinstaller/assets/configs/j7elte.yaml b/openandroidinstaller/assets/configs/j7elte.yaml index fa63cece..1fc0a5d9 100644 --- a/openandroidinstaller/assets/configs/j7elte.yaml +++ b/openandroidinstaller/assets/configs/j7elte.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy J7 (2015) + is_ab_device: true device_code: j7elte supported_device_codes: - j7elte diff --git a/openandroidinstaller/assets/configs/kiev.yaml b/openandroidinstaller/assets/configs/kiev.yaml index 743ae743..11b45d54 100644 --- a/openandroidinstaller/assets/configs/kiev.yaml +++ b/openandroidinstaller/assets/configs/kiev.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Motorola moto g 5G / one 5G ace + is_ab_device: true device_code: kiev supported_device_codes: - kiev diff --git a/openandroidinstaller/assets/configs/kirin.yaml b/openandroidinstaller/assets/configs/kirin.yaml index 626df4f4..20a44be8 100644 --- a/openandroidinstaller/assets/configs/kirin.yaml +++ b/openandroidinstaller/assets/configs/kirin.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Sony Xperia 10 + is_ab_device: true device_code: kirin supported_device_codes: - kirin diff --git a/openandroidinstaller/assets/configs/mermaid.yaml b/openandroidinstaller/assets/configs/mermaid.yaml index 3660cb4f..cdaa5a22 100644 --- a/openandroidinstaller/assets/configs/mermaid.yaml +++ b/openandroidinstaller/assets/configs/mermaid.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Sony Xperia 10 Plus + is_ab_device: true device_code: mermaid supported_device_codes: - mermaid diff --git a/openandroidinstaller/assets/configs/nairo.yaml b/openandroidinstaller/assets/configs/nairo.yaml index 422c40fd..214d35a8 100644 --- a/openandroidinstaller/assets/configs/nairo.yaml +++ b/openandroidinstaller/assets/configs/nairo.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Motorola moto g 5G plus / one 5G + is_ab_device: true device_code: nairo supported_device_codes: - nairo diff --git a/openandroidinstaller/assets/configs/ocean.yaml b/openandroidinstaller/assets/configs/ocean.yaml index 7c6c9a7c..975a2432 100644 --- a/openandroidinstaller/assets/configs/ocean.yaml +++ b/openandroidinstaller/assets/configs/ocean.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Motorola Moto G7 power + is_ab_device: true device_code: ocean supported_device_codes: - ocean diff --git a/openandroidinstaller/assets/configs/pioneer.yaml b/openandroidinstaller/assets/configs/pioneer.yaml index 7480b263..bc07d885 100644 --- a/openandroidinstaller/assets/configs/pioneer.yaml +++ b/openandroidinstaller/assets/configs/pioneer.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Sony Xperia XA2 + is_ab_device: true device_code: pioneer supported_device_codes: - pioneer diff --git a/openandroidinstaller/assets/configs/racer.yaml b/openandroidinstaller/assets/configs/racer.yaml index f67ae11c..252e1e7c 100644 --- a/openandroidinstaller/assets/configs/racer.yaml +++ b/openandroidinstaller/assets/configs/racer.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Motorola edge + is_ab_device: true device_code: racer supported_device_codes: - racer diff --git a/openandroidinstaller/assets/configs/redfin.yaml b/openandroidinstaller/assets/configs/redfin.yaml index e40ef553..36c13980 100644 --- a/openandroidinstaller/assets/configs/redfin.yaml +++ b/openandroidinstaller/assets/configs/redfin.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Pixel 5 + is_ab_device: true device_code: redfin supported_device_codes: - redfin diff --git a/openandroidinstaller/assets/configs/s3ve3g.yaml b/openandroidinstaller/assets/configs/s3ve3g.yaml index 19dbf51e..cfe232ea 100644 --- a/openandroidinstaller/assets/configs/s3ve3g.yaml +++ b/openandroidinstaller/assets/configs/s3ve3g.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy S III Neo + is_ab_device: true device_code: s3ve3g supported_device_codes: - s3ve3g diff --git a/openandroidinstaller/assets/configs/starlte.yaml b/openandroidinstaller/assets/configs/starlte.yaml index 71c6f7f2..31411a9f 100644 --- a/openandroidinstaller/assets/configs/starlte.yaml +++ b/openandroidinstaller/assets/configs/starlte.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy S9 + is_ab_device: true device_code: starlte supported_device_codes: - starlte diff --git a/openandroidinstaller/assets/configs/sunfish.yaml b/openandroidinstaller/assets/configs/sunfish.yaml index 53b80d01..2a2baa5f 100644 --- a/openandroidinstaller/assets/configs/sunfish.yaml +++ b/openandroidinstaller/assets/configs/sunfish.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Pixel 4a + is_ab_device: true device_code: sunfish supported_device_codes: - sunfish diff --git a/openandroidinstaller/assets/configs/taimen.yaml b/openandroidinstaller/assets/configs/taimen.yaml index d4a371df..8457584e 100644 --- a/openandroidinstaller/assets/configs/taimen.yaml +++ b/openandroidinstaller/assets/configs/taimen.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Google Pixel 2 XL + is_ab_device: true device_code: taimen supported_device_codes: - taimen diff --git a/openandroidinstaller/assets/configs/walleye.yaml b/openandroidinstaller/assets/configs/walleye.yaml index 88e450ed..d1482869 100644 --- a/openandroidinstaller/assets/configs/walleye.yaml +++ b/openandroidinstaller/assets/configs/walleye.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Google Pixel 2 + is_ab_device: true device_code: walleye supported_device_codes: - walleye diff --git a/openandroidinstaller/assets/configs/yuga.yaml b/openandroidinstaller/assets/configs/yuga.yaml index d2a97434..1d751eb0 100644 --- a/openandroidinstaller/assets/configs/yuga.yaml +++ b/openandroidinstaller/assets/configs/yuga.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Sony Xperia Z + is_ab_device: true device_code: yuga supported_device_codes: - yuga diff --git a/openandroidinstaller/assets/configs/z3.yaml b/openandroidinstaller/assets/configs/z3.yaml index 410c07d2..cb626895 100644 --- a/openandroidinstaller/assets/configs/z3.yaml +++ b/openandroidinstaller/assets/configs/z3.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Sony Xperia Z3 + is_ab_device: true device_code: z3 supported_device_codes: - z3 diff --git a/openandroidinstaller/assets/configs/zerofltexx.yaml b/openandroidinstaller/assets/configs/zerofltexx.yaml index f823b726..9009af85 100644 --- a/openandroidinstaller/assets/configs/zerofltexx.yaml +++ b/openandroidinstaller/assets/configs/zerofltexx.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy S6 + is_ab_device: true device_code: zerofltexx supported_device_codes: - zerofltexx diff --git a/openandroidinstaller/assets/configs/zeroltexx.yaml b/openandroidinstaller/assets/configs/zeroltexx.yaml index f2a080e9..f60e8b3a 100644 --- a/openandroidinstaller/assets/configs/zeroltexx.yaml +++ b/openandroidinstaller/assets/configs/zeroltexx.yaml @@ -1,6 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy S6 Edge + is_ab_device: true device_code: zeroltexx supported_device_codes: - zeroltexx diff --git a/openandroidinstaller/views/start_view.py b/openandroidinstaller/views/start_view.py index 65bf8f52..69a70503 100644 --- a/openandroidinstaller/views/start_view.py +++ b/openandroidinstaller/views/start_view.py @@ -37,7 +37,7 @@ from views import BaseView from app_state import AppState from widgets import get_title -from tooling import search_device, check_ab_partition +from tooling import search_device class StartView(BaseView): @@ -221,9 +221,6 @@ def search_devices(self, e): device_code = search_device( platform=self.state.platform, bin_path=self.state.bin_path ) - is_ab = check_ab_partition( - platform=self.state.platform, bin_path=self.state.bin_path - ) if device_code: self.device_name.value = device_code self.device_name.color = colors.BLACK diff --git a/tests/test_tooling.py b/tests/test_tooling.py index 6e666c1e..ffcaeb5a 100644 --- a/tests/test_tooling.py +++ b/tests/test_tooling.py @@ -94,4 +94,4 @@ def patched_check_output(*args, **kwargs): platform="linux", bin_path=Path("openandroidinstaller/bin/") ) - assert device_code == None \ No newline at end of file + assert device_code == None From ece1e2514a0fadb2d02e991d8913428e0f12f9b9 Mon Sep 17 00:00:00 2001 From: Tobias Sterbak Date: Mon, 27 Mar 2023 11:15:30 +0200 Subject: [PATCH 05/13] Update readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e2da6142..9b4384a4 100644 --- a/README.md +++ b/README.md @@ -198,6 +198,7 @@ A config file consists of two parts. The first part are some metadata about the Every config file should have metadata with the following fields: - `maintainer`: str; Maintainer and author of the config file. - `device_name`: str; Name of the device. +- `is_ab_device`: bool; A boolean to determine if the device is a/b-partitioned or not. - `device_code`: str; The official device code. - `supported_device_codes`: List[str]; A list of supported device codes for the config. The config will be loaded based on this field. - `twrp-link`: [OPTIONAL] str; name of the corresponding twrp page. From 150700d78b96845eb5cdd97dccdf9c7073e11902 Mon Sep 17 00:00:00 2001 From: Tobias Sterbak Date: Mon, 27 Mar 2023 11:33:51 +0200 Subject: [PATCH 06/13] Make all text and markdown elements selectable --- openandroidinstaller/openandroidinstaller.py | 4 ++- openandroidinstaller/styles.py | 30 +++++++++++++++++++ openandroidinstaller/views/addon_view.py | 6 ++-- .../views/install_addons_view.py | 5 +++- openandroidinstaller/views/install_view.py | 5 +++- .../views/requirements_view.py | 6 ++-- openandroidinstaller/views/select_view.py | 6 ++-- openandroidinstaller/views/start_view.py | 6 ++-- openandroidinstaller/views/step_view.py | 6 +++- openandroidinstaller/views/success_view.py | 4 ++- openandroidinstaller/views/welcome_view.py | 7 +++-- openandroidinstaller/widgets.py | 7 +++-- 12 files changed, 75 insertions(+), 17 deletions(-) create mode 100644 openandroidinstaller/styles.py diff --git a/openandroidinstaller/openandroidinstaller.py b/openandroidinstaller/openandroidinstaller.py index a04bea42..1862c3fd 100644 --- a/openandroidinstaller/openandroidinstaller.py +++ b/openandroidinstaller/openandroidinstaller.py @@ -31,7 +31,6 @@ Icon, Image, Page, - Text, TextButton, UserControl, colors, @@ -39,6 +38,9 @@ ) from loguru import logger +from styles import ( + Text, +) from app_state import AppState from views import ( SelectFilesView, diff --git a/openandroidinstaller/styles.py b/openandroidinstaller/styles.py new file mode 100644 index 00000000..6d8f8aa8 --- /dev/null +++ b/openandroidinstaller/styles.py @@ -0,0 +1,30 @@ +"""This module contains different pre-configured style elements for building the application.""" + +# This file is part of OpenAndroidInstaller. +# OpenAndroidInstaller is free software: you can redistribute it and/or modify it under the terms of +# the GNU General Public License as published by the Free Software Foundation, +# either version 3 of the License, or (at your option) any later version. + +# OpenAndroidInstaller is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License along with OpenAndroidInstaller. +# If not, see .""" +# Author: Tobias Sterbak + +import flet as ft + + +class Text(ft.Text): + """Text element to replace the default text element from flet but is selectable.""" + + def __init__(self, *args, **kwargs): + super().__init__(selectable=True, *args, **kwargs) + + +class Markdown(ft.Markdown): + """Markdown element to replace the markdown element from flet but is selectable.""" + + def __init__(self, *args, **kwargs): + super().__init__(selectable=True, *args, **kwargs) diff --git a/openandroidinstaller/views/addon_view.py b/openandroidinstaller/views/addon_view.py index d9d89333..93171ece 100644 --- a/openandroidinstaller/views/addon_view.py +++ b/openandroidinstaller/views/addon_view.py @@ -23,9 +23,7 @@ ElevatedButton, OutlinedButton, FilledButton, - Markdown, Row, - Text, colors, icons, TextButton, @@ -35,6 +33,10 @@ ) from flet.buttons import CountinuosRectangleBorder +from styles import ( + Text, + Markdown, +) from views import BaseView from app_state import AppState from widgets import get_title, confirm_button diff --git a/openandroidinstaller/views/install_addons_view.py b/openandroidinstaller/views/install_addons_view.py index 7bb71e42..6470a840 100644 --- a/openandroidinstaller/views/install_addons_view.py +++ b/openandroidinstaller/views/install_addons_view.py @@ -21,10 +21,13 @@ Column, ElevatedButton, Row, - Text, icons, Switch, colors, +) + +from styles import ( + Text, Markdown, ) diff --git a/openandroidinstaller/views/install_view.py b/openandroidinstaller/views/install_view.py index 29283fab..54b90e77 100644 --- a/openandroidinstaller/views/install_view.py +++ b/openandroidinstaller/views/install_view.py @@ -21,10 +21,13 @@ Column, ElevatedButton, Row, - Text, icons, Switch, colors, +) + +from styles import ( + Text, Markdown, ) diff --git a/openandroidinstaller/views/requirements_view.py b/openandroidinstaller/views/requirements_view.py index 327649d6..3d3d7efd 100644 --- a/openandroidinstaller/views/requirements_view.py +++ b/openandroidinstaller/views/requirements_view.py @@ -22,17 +22,19 @@ Container, Divider, ElevatedButton, - Markdown, Row, colors, OutlinedButton, - Text, icons, TextButton, AlertDialog, ) from flet.buttons import CountinuosRectangleBorder +from styles import ( + Text, + Markdown, +) from views import BaseView from app_state import AppState from widgets import get_title diff --git a/openandroidinstaller/views/select_view.py b/openandroidinstaller/views/select_view.py index ac65fd5d..0f851241 100644 --- a/openandroidinstaller/views/select_view.py +++ b/openandroidinstaller/views/select_view.py @@ -23,9 +23,7 @@ ElevatedButton, OutlinedButton, FilledButton, - Markdown, Row, - Text, colors, icons, TextButton, @@ -35,6 +33,10 @@ ) from flet.buttons import CountinuosRectangleBorder +from styles import ( + Text, + Markdown, +) from views import BaseView from app_state import AppState from widgets import get_title, confirm_button diff --git a/openandroidinstaller/views/start_view.py b/openandroidinstaller/views/start_view.py index abf64064..31c2d85f 100644 --- a/openandroidinstaller/views/start_view.py +++ b/openandroidinstaller/views/start_view.py @@ -25,15 +25,17 @@ ElevatedButton, OutlinedButton, FilledButton, - Markdown, Row, - Text, TextButton, colors, icons, ) from flet.buttons import CountinuosRectangleBorder +from styles import ( + Text, + Markdown, +) from views import BaseView from app_state import AppState from widgets import get_title diff --git a/openandroidinstaller/views/step_view.py b/openandroidinstaller/views/step_view.py index eb484eb3..03aefe9d 100644 --- a/openandroidinstaller/views/step_view.py +++ b/openandroidinstaller/views/step_view.py @@ -22,13 +22,17 @@ Column, ElevatedButton, Row, - Text, icons, TextField, Switch, colors, ) + +from styles import ( + Text, +) + from views import BaseView from installer_config import Step from app_state import AppState diff --git a/openandroidinstaller/views/success_view.py b/openandroidinstaller/views/success_view.py index 30a1dc8a..697b59d7 100644 --- a/openandroidinstaller/views/success_view.py +++ b/openandroidinstaller/views/success_view.py @@ -17,10 +17,12 @@ from flet import ( ElevatedButton, Row, +) + +from styles import ( Text, Markdown, ) - from views import BaseView from app_state import AppState from widgets import get_title diff --git a/openandroidinstaller/views/welcome_view.py b/openandroidinstaller/views/welcome_view.py index 59de038b..a3560ea7 100644 --- a/openandroidinstaller/views/welcome_view.py +++ b/openandroidinstaller/views/welcome_view.py @@ -18,12 +18,15 @@ from flet import ( Divider, ElevatedButton, - Markdown, Row, - Text, icons, ) +from styles import ( + Text, + Markdown, +) + from views import BaseView from app_state import AppState from widgets import get_title diff --git a/openandroidinstaller/widgets.py b/openandroidinstaller/widgets.py index d57c006f..c488d36c 100644 --- a/openandroidinstaller/widgets.py +++ b/openandroidinstaller/widgets.py @@ -26,7 +26,6 @@ ProgressRing, ProgressBar, Row, - Text, alignment, icons, IconButton, @@ -34,6 +33,10 @@ Column, ) +from styles import ( + Text, +) + class TerminalBox(UserControl): def __init__(self, expand: bool = True, visible: bool = False): @@ -43,7 +46,7 @@ def __init__(self, expand: bool = True, visible: bool = False): def build(self): self._box = Container( content=Column( - controls=[Text("", selectable=True)], + controls=[Text("")], scroll="auto", expand=True, auto_scroll=True, From a9a421dacee6bc67a5e927a35d458aafefd5026f Mon Sep 17 00:00:00 2001 From: Tobias Sterbak Date: Mon, 27 Mar 2023 11:43:02 +0200 Subject: [PATCH 07/13] If there are not instructions to unlock the bootloader, assume that there is nothing to do and toggle the switch by default --- openandroidinstaller/views/start_view.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openandroidinstaller/views/start_view.py b/openandroidinstaller/views/start_view.py index 31c2d85f..e1927816 100644 --- a/openandroidinstaller/views/start_view.py +++ b/openandroidinstaller/views/start_view.py @@ -259,6 +259,8 @@ def search_devices(self, e): f"{device_name} (code: {self.state.config.device_code})" ) self.device_name.color = colors.GREEN + # if there are no steps for bootloader unlocking, assume there is nothing to do and toggle the switch + self.bootloader_switch.value = True else: # failed to load config logger.error(f"Failed to load config for {device_code}.") From 1736ccf0eede78c8f5656ca416a2857dff737384 Mon Sep 17 00:00:00 2001 From: Tobias Sterbak Date: Mon, 27 Mar 2023 12:09:36 +0200 Subject: [PATCH 08/13] Adjust configs for a/b partition info --- openandroidinstaller/assets/configs/FP2.yaml | 2 +- openandroidinstaller/assets/configs/a3y17lte.yaml | 2 +- openandroidinstaller/assets/configs/a5xelte.yaml | 2 +- openandroidinstaller/assets/configs/a72q.yaml | 2 +- openandroidinstaller/assets/configs/a7xelte.yaml | 2 +- openandroidinstaller/assets/configs/bacon.yaml | 2 +- openandroidinstaller/assets/configs/beyond0lte.yaml | 2 +- openandroidinstaller/assets/configs/beyond1lte.yaml | 2 +- openandroidinstaller/assets/configs/beyond2lte.yaml | 2 +- openandroidinstaller/assets/configs/cedric.yaml | 2 +- openandroidinstaller/assets/configs/cheeseburger.yaml | 2 +- openandroidinstaller/assets/configs/crownlte.yaml | 2 +- openandroidinstaller/assets/configs/d1.yaml | 2 +- openandroidinstaller/assets/configs/d2s.yaml | 2 +- openandroidinstaller/assets/configs/dumpling.yaml | 2 +- openandroidinstaller/assets/configs/greatlte.yaml | 2 +- openandroidinstaller/assets/configs/griffin.yaml | 2 +- openandroidinstaller/assets/configs/hero2lte.yaml | 2 +- openandroidinstaller/assets/configs/herolte.yaml | 2 +- openandroidinstaller/assets/configs/hltetmo.yaml | 2 +- openandroidinstaller/assets/configs/j7elte.yaml | 2 +- openandroidinstaller/assets/configs/s3ve3g.yaml | 2 +- openandroidinstaller/assets/configs/starlte.yaml | 2 +- openandroidinstaller/assets/configs/yuga.yaml | 2 +- openandroidinstaller/assets/configs/z3.yaml | 2 +- openandroidinstaller/assets/configs/zerofltexx.yaml | 2 +- openandroidinstaller/assets/configs/zeroltexx.yaml | 2 +- 27 files changed, 27 insertions(+), 27 deletions(-) diff --git a/openandroidinstaller/assets/configs/FP2.yaml b/openandroidinstaller/assets/configs/FP2.yaml index 55588617..afcf3976 100644 --- a/openandroidinstaller/assets/configs/FP2.yaml +++ b/openandroidinstaller/assets/configs/FP2.yaml @@ -1,7 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Fairphone 2 - is_ab_device: true + is_ab_device: false device_code: FP2 supported_device_codes: - FP2 diff --git a/openandroidinstaller/assets/configs/a3y17lte.yaml b/openandroidinstaller/assets/configs/a3y17lte.yaml index 5e6f8d83..27f86cc4 100644 --- a/openandroidinstaller/assets/configs/a3y17lte.yaml +++ b/openandroidinstaller/assets/configs/a3y17lte.yaml @@ -1,7 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy A3 (2017) - is_ab_device: true + is_ab_device: false device_code: a3y17lte supported_device_codes: - a3y17lte diff --git a/openandroidinstaller/assets/configs/a5xelte.yaml b/openandroidinstaller/assets/configs/a5xelte.yaml index c9dc541f..7f1761b0 100644 --- a/openandroidinstaller/assets/configs/a5xelte.yaml +++ b/openandroidinstaller/assets/configs/a5xelte.yaml @@ -1,7 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy A5 (2016) - is_ab_device: true + is_ab_device: false device_code: a5xelte supported_device_codes: - a5xelte diff --git a/openandroidinstaller/assets/configs/a72q.yaml b/openandroidinstaller/assets/configs/a72q.yaml index 4b663e48..70a58bf4 100644 --- a/openandroidinstaller/assets/configs/a72q.yaml +++ b/openandroidinstaller/assets/configs/a72q.yaml @@ -1,7 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy A72 - is_ab_device: true + is_ab_device: false device_code: a72q supported_device_codes: - a72q diff --git a/openandroidinstaller/assets/configs/a7xelte.yaml b/openandroidinstaller/assets/configs/a7xelte.yaml index 8d1d9c8c..ae575de3 100644 --- a/openandroidinstaller/assets/configs/a7xelte.yaml +++ b/openandroidinstaller/assets/configs/a7xelte.yaml @@ -1,7 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy A7 (2016) - is_ab_device: true + is_ab_device: false device_code: a7xelte supported_device_codes: - a7xelte diff --git a/openandroidinstaller/assets/configs/bacon.yaml b/openandroidinstaller/assets/configs/bacon.yaml index fb251e99..9412527b 100644 --- a/openandroidinstaller/assets/configs/bacon.yaml +++ b/openandroidinstaller/assets/configs/bacon.yaml @@ -1,7 +1,7 @@ metadata: maintainer: MagicLike device_name: OnePlus One - is_ab_device: true + is_ab_device: false device_code: bacon supported_device_codes: - bacon diff --git a/openandroidinstaller/assets/configs/beyond0lte.yaml b/openandroidinstaller/assets/configs/beyond0lte.yaml index c3d54b1d..d357ac95 100644 --- a/openandroidinstaller/assets/configs/beyond0lte.yaml +++ b/openandroidinstaller/assets/configs/beyond0lte.yaml @@ -1,7 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy S10e - is_ab_device: true + is_ab_device: false device_code: beyond0lte supported_device_codes: - beyond0lte diff --git a/openandroidinstaller/assets/configs/beyond1lte.yaml b/openandroidinstaller/assets/configs/beyond1lte.yaml index 0839f0b8..d9952f38 100644 --- a/openandroidinstaller/assets/configs/beyond1lte.yaml +++ b/openandroidinstaller/assets/configs/beyond1lte.yaml @@ -1,7 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy S10 - is_ab_device: true + is_ab_device: false device_code: beyond1lte supported_device_codes: - beyond1lte diff --git a/openandroidinstaller/assets/configs/beyond2lte.yaml b/openandroidinstaller/assets/configs/beyond2lte.yaml index 239cc07b..7a0c0c23 100644 --- a/openandroidinstaller/assets/configs/beyond2lte.yaml +++ b/openandroidinstaller/assets/configs/beyond2lte.yaml @@ -1,7 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy S10+ - is_ab_device: true + is_ab_device: false device_code: beyond2lte supported_device_codes: - beyond2lte diff --git a/openandroidinstaller/assets/configs/cedric.yaml b/openandroidinstaller/assets/configs/cedric.yaml index 6e63df41..5f7e9728 100644 --- a/openandroidinstaller/assets/configs/cedric.yaml +++ b/openandroidinstaller/assets/configs/cedric.yaml @@ -1,7 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Motorola Moto G5 - is_ab_device: true + is_ab_device: false device_code: cedric supported_device_codes: - cedric diff --git a/openandroidinstaller/assets/configs/cheeseburger.yaml b/openandroidinstaller/assets/configs/cheeseburger.yaml index d3b1cba8..e321a1e7 100644 --- a/openandroidinstaller/assets/configs/cheeseburger.yaml +++ b/openandroidinstaller/assets/configs/cheeseburger.yaml @@ -1,7 +1,7 @@ metadata: maintainer: SirRGB device_name: OnePlus 5 - is_ab_device: true + is_ab_device: false device_code: cheeseburger supported_device_codes: - cheeseburger diff --git a/openandroidinstaller/assets/configs/crownlte.yaml b/openandroidinstaller/assets/configs/crownlte.yaml index 97e8eb2e..27291a6a 100644 --- a/openandroidinstaller/assets/configs/crownlte.yaml +++ b/openandroidinstaller/assets/configs/crownlte.yaml @@ -1,7 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy Note 9 - is_ab_device: true + is_ab_device: false device_code: crownlte supported_device_codes: - crownlte diff --git a/openandroidinstaller/assets/configs/d1.yaml b/openandroidinstaller/assets/configs/d1.yaml index 25c0481b..feceec7c 100644 --- a/openandroidinstaller/assets/configs/d1.yaml +++ b/openandroidinstaller/assets/configs/d1.yaml @@ -1,7 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy Note 10 - is_ab_device: true + is_ab_device: false device_code: d1 supported_device_codes: - d1 diff --git a/openandroidinstaller/assets/configs/d2s.yaml b/openandroidinstaller/assets/configs/d2s.yaml index adb537ff..5e1af505 100644 --- a/openandroidinstaller/assets/configs/d2s.yaml +++ b/openandroidinstaller/assets/configs/d2s.yaml @@ -1,7 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy Note 10+ - is_ab_device: true + is_ab_device: false device_code: d2s supported_device_codes: - d2s diff --git a/openandroidinstaller/assets/configs/dumpling.yaml b/openandroidinstaller/assets/configs/dumpling.yaml index 15bdea7e..c2dd40f4 100644 --- a/openandroidinstaller/assets/configs/dumpling.yaml +++ b/openandroidinstaller/assets/configs/dumpling.yaml @@ -1,7 +1,7 @@ metadata: maintainer: SirRGB device_name: OnePlus 5T - is_ab_device: true + is_ab_device: false device_code: dumpling supported_device_codes: - dumpling diff --git a/openandroidinstaller/assets/configs/greatlte.yaml b/openandroidinstaller/assets/configs/greatlte.yaml index 443db5ab..16b140d4 100644 --- a/openandroidinstaller/assets/configs/greatlte.yaml +++ b/openandroidinstaller/assets/configs/greatlte.yaml @@ -1,7 +1,7 @@ metadata: maintainer: Michel Memeteau (freechelmi) device_name: Samsung Galaxy note 8 - is_ab_device: true + is_ab_device: false device_code: greatlte supported_device_codes: - greatlte diff --git a/openandroidinstaller/assets/configs/griffin.yaml b/openandroidinstaller/assets/configs/griffin.yaml index ab21f87e..8eb80ca6 100644 --- a/openandroidinstaller/assets/configs/griffin.yaml +++ b/openandroidinstaller/assets/configs/griffin.yaml @@ -1,7 +1,7 @@ metadata: maintainer: SirRGB device_name: Motorola Moto Z - is_ab_device: true + is_ab_device: false device_code: griffin supported_device_codes: - griffin diff --git a/openandroidinstaller/assets/configs/hero2lte.yaml b/openandroidinstaller/assets/configs/hero2lte.yaml index b94b7dac..da44a6b5 100644 --- a/openandroidinstaller/assets/configs/hero2lte.yaml +++ b/openandroidinstaller/assets/configs/hero2lte.yaml @@ -1,7 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy S7 Edge - is_ab_device: true + is_ab_device: false device_code: hero2lte supported_device_codes: - hero2lte diff --git a/openandroidinstaller/assets/configs/herolte.yaml b/openandroidinstaller/assets/configs/herolte.yaml index bdcf513b..871f70b0 100644 --- a/openandroidinstaller/assets/configs/herolte.yaml +++ b/openandroidinstaller/assets/configs/herolte.yaml @@ -1,7 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy S7 - is_ab_device: true + is_ab_device: false device_code: herolte supported_device_codes: - herolte diff --git a/openandroidinstaller/assets/configs/hltetmo.yaml b/openandroidinstaller/assets/configs/hltetmo.yaml index 013aa7f0..b9fbc135 100644 --- a/openandroidinstaller/assets/configs/hltetmo.yaml +++ b/openandroidinstaller/assets/configs/hltetmo.yaml @@ -1,7 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy Note 3 LTE (N900T/V/W8) - is_ab_device: true + is_ab_device: false device_code: hltetmo supported_device_codes: - hltetmo diff --git a/openandroidinstaller/assets/configs/j7elte.yaml b/openandroidinstaller/assets/configs/j7elte.yaml index 1fc0a5d9..05d11897 100644 --- a/openandroidinstaller/assets/configs/j7elte.yaml +++ b/openandroidinstaller/assets/configs/j7elte.yaml @@ -1,7 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy J7 (2015) - is_ab_device: true + is_ab_device: false device_code: j7elte supported_device_codes: - j7elte diff --git a/openandroidinstaller/assets/configs/s3ve3g.yaml b/openandroidinstaller/assets/configs/s3ve3g.yaml index cfe232ea..7fb97bf4 100644 --- a/openandroidinstaller/assets/configs/s3ve3g.yaml +++ b/openandroidinstaller/assets/configs/s3ve3g.yaml @@ -1,7 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy S III Neo - is_ab_device: true + is_ab_device: false device_code: s3ve3g supported_device_codes: - s3ve3g diff --git a/openandroidinstaller/assets/configs/starlte.yaml b/openandroidinstaller/assets/configs/starlte.yaml index 31411a9f..bfb87684 100644 --- a/openandroidinstaller/assets/configs/starlte.yaml +++ b/openandroidinstaller/assets/configs/starlte.yaml @@ -1,7 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy S9 - is_ab_device: true + is_ab_device: false device_code: starlte supported_device_codes: - starlte diff --git a/openandroidinstaller/assets/configs/yuga.yaml b/openandroidinstaller/assets/configs/yuga.yaml index 1d751eb0..b9f23348 100644 --- a/openandroidinstaller/assets/configs/yuga.yaml +++ b/openandroidinstaller/assets/configs/yuga.yaml @@ -1,7 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Sony Xperia Z - is_ab_device: true + is_ab_device: false device_code: yuga supported_device_codes: - yuga diff --git a/openandroidinstaller/assets/configs/z3.yaml b/openandroidinstaller/assets/configs/z3.yaml index cb626895..c75fb8a4 100644 --- a/openandroidinstaller/assets/configs/z3.yaml +++ b/openandroidinstaller/assets/configs/z3.yaml @@ -1,7 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Sony Xperia Z3 - is_ab_device: true + is_ab_device: false device_code: z3 supported_device_codes: - z3 diff --git a/openandroidinstaller/assets/configs/zerofltexx.yaml b/openandroidinstaller/assets/configs/zerofltexx.yaml index 9009af85..3f6cd24e 100644 --- a/openandroidinstaller/assets/configs/zerofltexx.yaml +++ b/openandroidinstaller/assets/configs/zerofltexx.yaml @@ -1,7 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy S6 - is_ab_device: true + is_ab_device: false device_code: zerofltexx supported_device_codes: - zerofltexx diff --git a/openandroidinstaller/assets/configs/zeroltexx.yaml b/openandroidinstaller/assets/configs/zeroltexx.yaml index f60e8b3a..b891d4e9 100644 --- a/openandroidinstaller/assets/configs/zeroltexx.yaml +++ b/openandroidinstaller/assets/configs/zeroltexx.yaml @@ -1,7 +1,7 @@ metadata: maintainer: Tobias Sterbak (tsterbak) device_name: Samsung Galaxy S6 Edge - is_ab_device: true + is_ab_device: false device_code: zeroltexx supported_device_codes: - zeroltexx From c8aaaa0ef9d1cd8a26bd04f197787c58ac35f774 Mon Sep 17 00:00:00 2001 From: Tobias Sterbak Date: Mon, 27 Mar 2023 12:17:27 +0200 Subject: [PATCH 09/13] Support fajita OnePlus6TSingle --- openandroidinstaller/assets/configs/fajita.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/openandroidinstaller/assets/configs/fajita.yaml b/openandroidinstaller/assets/configs/fajita.yaml index 1f9a4050..a19da40e 100644 --- a/openandroidinstaller/assets/configs/fajita.yaml +++ b/openandroidinstaller/assets/configs/fajita.yaml @@ -6,6 +6,7 @@ metadata: supported_device_codes: - fajita - OnePlus6T + - OnePlus6TSingle requirements: android: 11 steps: From c9857269c24ee15ad29e1a02bb7ef991abf2b949 Mon Sep 17 00:00:00 2001 From: Tobias Sterbak Date: Mon, 27 Mar 2023 18:41:58 +0200 Subject: [PATCH 10/13] Fix unlock bootloader toggle when no instructions in cofnig --- openandroidinstaller/views/start_view.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openandroidinstaller/views/start_view.py b/openandroidinstaller/views/start_view.py index 6d177771..b2c912b5 100644 --- a/openandroidinstaller/views/start_view.py +++ b/openandroidinstaller/views/start_view.py @@ -255,7 +255,8 @@ def search_devices(self, e): ) self.device_name.color = colors.GREEN # if there are no steps for bootloader unlocking, assume there is nothing to do and toggle the switch - self.bootloader_switch.value = True + if len(self.state.config.unlock_bootloader) == 0: + self.bootloader_switch.value = True else: # failed to load config logger.error(f"Failed to load config for {device_code}.") From 21a79811ba4fd6590425fddee34d42f9aa0755f9 Mon Sep 17 00:00:00 2001 From: Tobias Sterbak Date: Mon, 27 Mar 2023 19:38:01 +0200 Subject: [PATCH 11/13] Check a different url if lineageos exists --- openandroidinstaller/utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openandroidinstaller/utils.py b/openandroidinstaller/utils.py index ea34997f..0c17baf5 100644 --- a/openandroidinstaller/utils.py +++ b/openandroidinstaller/utils.py @@ -22,15 +22,16 @@ def get_download_link(devicecode: str) -> Optional[str]: """Check if a lineageOS version for this device exists on download.lineageos.com and return the respective download link.""" - url = f"https://download.lineageos.org/{devicecode}" + url = f"https://download.lineageos.org/api/v2/devices/{devicecode}" try: logger.info(f"Checking {url}") # Get Url res = requests.get(url, timeout=5) # if the request succeeds if res.status_code == 200: - logger.info(f"{url} exists.") - return url + download_url = f"https://download.lineageos.org/devices/{devicecode}/builds" + logger.info(f"{download_url} exists.") + return download_url else: logger.info(f"{url} doesn't exist, status_code: {res.status_code}") return None From e481ab4790481911f903b2059e2f7ec02e22620d Mon Sep 17 00:00:00 2001 From: Tobias Sterbak Date: Mon, 3 Apr 2023 12:47:40 +0100 Subject: [PATCH 12/13] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 36 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature-request.md | 20 +++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature-request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..0bf5e19c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,36 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. Windows 10] + - Version [e.g. 0.4.2] + +**Smartphone (please complete the following information):** + - Device: [e.g. Samsung Galaxy S10] + - OS: [e.g. LineageOS] + - Version [e.g. 0.4.2] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md new file mode 100644 index 00000000..bbcbbe7d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. From 2132de71525f9ffe09386c390253f9ad4ded09f1 Mon Sep 17 00:00:00 2001 From: Tobias Sterbak Date: Mon, 3 Apr 2023 12:54:21 +0100 Subject: [PATCH 13/13] Update issue templates --- .../ISSUE_TEMPLATE/device-support-request.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/device-support-request.md diff --git a/.github/ISSUE_TEMPLATE/device-support-request.md b/.github/ISSUE_TEMPLATE/device-support-request.md new file mode 100644 index 00000000..325b5f8e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/device-support-request.md @@ -0,0 +1,21 @@ +--- +name: Device support request +about: Request support for a new device +title: '' +labels: '' +assignees: '' + +--- + +**Device name** +Please enter the name of the device you would like to request support for. +If you know the device code, please also add it here. + +**Device images** +Please provide links to any available images of the device, such as official stock firmware or custom ROMs you would like to install. + +**Do you own the device and would be willing to test the installer?** +- [ ] + +**Additional context** +Please provide any additional context or information that may be helpful in adding support for this device.