diff --git a/README.md b/README.md index f73e9314..df33c803 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ Linux is currently the best supported platform (tested with Ubuntu 20.04/22.04 L ## Officially supported devices -Currently, the **we support 52 devices** by various vendors and working on adding more soon! +Currently, the **we support 56 devices** by various vendors and working on adding more soon! Support for these devices is provided as best effort, but things might still go wrong. @@ -82,9 +82,13 @@ Samsung | Galaxy S6 Edge | [zeroltexx](https://wiki.lineageos.org/devices/zerolt Samsung | Galaxy S7 | [herolte](https://wiki.lineageos.org/devices/herolte/) | SM-G930F | tested Samsung | Galaxy S7 Edge | [hero2lte](https://wiki.lineageos.org/devices/hero2lte/) | | tested Samsung | Galaxy S9 | [starlte](https://wiki.lineageos.org/devices/starlte/) | | tested +Samsung | Galaxy Note 8 | greatlte | SM-N950F | tested Samsung | Galaxy Note 9 | [crownlte](https://wiki.lineageos.org/devices/crownlte/) | | tested Samsung | Galaxy S10 | [beyond1lte](https://wiki.lineageos.org/devices/beyond1lte/) | | tested +Samsung | Galaxy S10e | [beyond0lte](https://wiki.lineageos.org/devices/beyond0lte/) | | tested +Samsung | Galaxy S10+ | [beyond2lte](https://wiki.lineageos.org/devices/beyond2lte/) | | tested Samsung | Galaxy Note 10 | [d1](https://wiki.lineageos.org/devices/d1/) | | tested +Samsung | Galaxy Note 10+ | [d2s](https://wiki.lineageos.org/devices/d2s/) | | tested Samsung | Galaxy Note 3 LTE | [hltetmo](https://wiki.lineageos.org/devices/hltetmo/) | N900T/V/W8 | tested diff --git a/openandroidinstaller/assets/configs/beyond0lte.yaml b/openandroidinstaller/assets/configs/beyond0lte.yaml new file mode 100644 index 00000000..01bf3524 --- /dev/null +++ b/openandroidinstaller/assets/configs/beyond0lte.yaml @@ -0,0 +1,38 @@ +metadata: + maintainer: Tobias Sterbak (tsterbak) + devicename: Samsung Galaxy S10e + devicecode: beyond0lte +requirements: + android: 12 +steps: + unlock_bootloader: + - type: call_button + content: > + As a first step, you need to unlock the bootloader. A bootloader is the piece of software, that tells your phone + how to start and run an operating system (like Android). Your device should be turned on. + Press 'Confirm and run' to reboot into download mode. Then continue. + command: adb_reboot_download + - type: confirm_button + content: > + Now, click the button that the onscreen instructions correlate to “Continue” and/or “Unlock Bootloader”. + Your device will reboot, you may now unplug the USB cable from your device. + The device will demand you format userdata, please follow the onscreen instructions to do so. + - type: confirm_button + content: > + The bootloader is now unlocked. Go through Android Setup skipping everything you can, then connect the device to a Wi-Fi network. + Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. + flash_recovery: + - type: call_button + content: > + Now plug the USB-cable to your device. As a first step, you need to boot into download mode. Your device should be turned on. + Then press 'Confirm and run' to reboot into download mode. Continue once it's done. + command: adb_reboot_download + - type: call_button + content: In this step, you need to flash a custom recovery on your device. Press 'Confirm and run' to start the process. Confirm afterwards to continue. + command: heimdall_flash_recovery + - type: confirm_button + img: samsung-buttons-bixby.png + content: > + Unplug the USB cable from your device. Then manually reboot into recovery by pressing the *Volume Down* + *Bixby* for 8~10 seconds + until the screen turns black & release the buttons immediately when it does, then boot to recovery with the device powered off, + hold *Volume Up* + *Bixby* + *Power button*. \ No newline at end of file diff --git a/openandroidinstaller/assets/configs/beyond1lte.yaml b/openandroidinstaller/assets/configs/beyond1lte.yaml index 6deef617..914d178e 100644 --- a/openandroidinstaller/assets/configs/beyond1lte.yaml +++ b/openandroidinstaller/assets/configs/beyond1lte.yaml @@ -6,18 +6,32 @@ requirements: android: 12 steps: unlock_bootloader: + - type: call_button + content: > + As a first step, you need to unlock the bootloader. A bootloader is the piece of software, that tells your phone + how to start and run an operating system (like Android). Your device should be turned on. + Press 'Confirm and run' to reboot into download mode. Then continue. + command: adb_reboot_download + - type: confirm_button + content: > + Now, click the button that the onscreen instructions correlate to “Continue” and/or “Unlock Bootloader”. + Your device will reboot, you may now unplug the USB cable from your device. + The device will demand you format userdata, please follow the onscreen instructions to do so. + - type: confirm_button + content: > + The bootloader is now unlocked. Go through Android Setup skipping everything you can, then connect the device to a Wi-Fi network. + Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. flash_recovery: - type: call_button content: > - As a first step, you need to boot into the bootloader. A bootloader is the piece of software, - that tells your phone who to start and run an operating system (like Android). Your device should be turned on. - Then press 'Confirm and run' to reboot into the bootloader. Continue once it's done. + Now plug the USB-cable to your device. As a first step, you need to boot into download mode. Your device should be turned on. + Then press 'Confirm and run' to reboot into download mode. Continue once it's done. command: adb_reboot_download - type: call_button content: In this step, you need to flash a custom recovery on your device. Press 'Confirm and run' to start the process. Confirm afterwards to continue. command: heimdall_flash_recovery - type: confirm_button - img: samsung-buttons.png + img: samsung-buttons-bixby.png content: > Unplug the USB cable from your device. Then manually reboot into recovery by pressing the *Volume Down* + *Bixby* for 8~10 seconds until the screen turns black & release the buttons immediately when it does, then boot to recovery with the device powered off, diff --git a/openandroidinstaller/assets/configs/beyond2lte.yaml b/openandroidinstaller/assets/configs/beyond2lte.yaml new file mode 100644 index 00000000..ff8a529a --- /dev/null +++ b/openandroidinstaller/assets/configs/beyond2lte.yaml @@ -0,0 +1,38 @@ +metadata: + maintainer: Tobias Sterbak (tsterbak) + devicename: Samsung Galaxy S10+ + devicecode: beyond2lte +requirements: + android: 12 +steps: + unlock_bootloader: + - type: call_button + content: > + As a first step, you need to unlock the bootloader. A bootloader is the piece of software, that tells your phone + how to start and run an operating system (like Android). Your device should be turned on. + Press 'Confirm and run' to reboot into download mode. Then continue. + command: adb_reboot_download + - type: confirm_button + content: > + Now, click the button that the onscreen instructions correlate to “Continue” and/or “Unlock Bootloader”. + Your device will reboot, you may now unplug the USB cable from your device. + The device will demand you format userdata, please follow the onscreen instructions to do so. + - type: confirm_button + content: > + The bootloader is now unlocked. Go through Android Setup skipping everything you can, then connect the device to a Wi-Fi network. + Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. + flash_recovery: + - type: call_button + content: > + Now plug the USB-cable to your device. As a first step, you need to boot into download mode. Your device should be turned on. + Then press 'Confirm and run' to reboot into download mode. Continue once it's done. + command: adb_reboot_download + - type: call_button + content: In this step, you need to flash a custom recovery on your device. Press 'Confirm and run' to start the process. Confirm afterwards to continue. + command: heimdall_flash_recovery + - type: confirm_button + img: samsung-buttons-bixby.png + content: > + Unplug the USB cable from your device. Then manually reboot into recovery by pressing the *Volume Down* + *Bixby* for 8~10 seconds + until the screen turns black & release the buttons immediately when it does, then boot to recovery with the device powered off, + hold *Volume Up* + *Bixby* + *Power button*. \ No newline at end of file diff --git a/openandroidinstaller/assets/configs/crownlte.yaml b/openandroidinstaller/assets/configs/crownlte.yaml index 38a922c4..8b759e6b 100644 --- a/openandroidinstaller/assets/configs/crownlte.yaml +++ b/openandroidinstaller/assets/configs/crownlte.yaml @@ -17,7 +17,7 @@ steps: content: In this step, you need to flash a custom recovery on your device. Press 'Confirm and run' to start the process. Confirm afterwards to continue. command: heimdall_flash_recovery - type: confirm_button - img: samsung-buttons.png + img: samsung-buttons-bixby.png content: > Unplug the USB cable from your device. Then manually reboot into recovery by pressing the *Volume Down* + *Bixby* for 8~10 seconds until the screen turns black & release the buttons immediately when it does, then boot to recovery with the device powered off, diff --git a/openandroidinstaller/assets/configs/d1.yaml b/openandroidinstaller/assets/configs/d1.yaml index 431d49a0..8ae30aeb 100644 --- a/openandroidinstaller/assets/configs/d1.yaml +++ b/openandroidinstaller/assets/configs/d1.yaml @@ -6,18 +6,32 @@ requirements: android: 12 steps: unlock_bootloader: + - type: call_button + content: > + As a first step, you need to unlock the bootloader. A bootloader is the piece of software, that tells your phone + how to start and run an operating system (like Android). Your device should be turned on. + Press 'Confirm and run' to reboot into download mode. Then continue. + command: adb_reboot_download + - type: confirm_button + content: > + Now, click the button that the onscreen instructions correlate to “Continue” and/or “Unlock Bootloader”. + Your device will reboot, you may now unplug the USB cable from your device. + The device will demand you format userdata, please follow the onscreen instructions to do so. + - type: confirm_button + content: > + The bootloader is now unlocked. Go through Android Setup skipping everything you can, then connect the device to a Wi-Fi network. + Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. flash_recovery: - type: call_button content: > - As a first step, you need to boot into the bootloader. A bootloader is the piece of software, - that tells your phone who to start and run an operating system (like Android). Your device should be turned on. - Then press 'Confirm and run' to reboot into the bootloader. Continue once it's done. + Now plug the USB-cable to your device. As a first step, you need to boot into download mode. Your device should be turned on. + Then press 'Confirm and run' to reboot into download mode. Continue once it's done. command: adb_reboot_download - type: call_button content: In this step, you need to flash a custom recovery on your device. Press 'Confirm and run' to start the process. Confirm afterwards to continue. command: heimdall_flash_recovery - type: confirm_button - img: samsung-buttons.png + img: samsung-buttons-bixby.png content: > Unplug the USB cable from your device. Then manually reboot into recovery by pressing the *Volume Down* + *Bixby* for 8~10 seconds until the screen turns black & release the buttons immediately when it does, then boot to recovery with the device powered off, diff --git a/openandroidinstaller/assets/configs/d2s.yaml b/openandroidinstaller/assets/configs/d2s.yaml new file mode 100644 index 00000000..07bd6819 --- /dev/null +++ b/openandroidinstaller/assets/configs/d2s.yaml @@ -0,0 +1,38 @@ +metadata: + maintainer: Tobias Sterbak (tsterbak) + devicename: Samsung Galaxy Note 10+ + devicecode: d2s +requirements: + android: 12 +steps: + unlock_bootloader: + - type: call_button + content: > + As a first step, you need to unlock the bootloader. A bootloader is the piece of software, that tells your phone + how to start and run an operating system (like Android). Your device should be turned on. + Press 'Confirm and run' to reboot into download mode. Then continue. + command: adb_reboot_download + - type: confirm_button + content: > + Now, click the button that the onscreen instructions correlate to “Continue” and/or “Unlock Bootloader”. + Your device will reboot, you may now unplug the USB cable from your device. + The device will demand you format userdata, please follow the onscreen instructions to do so. + - type: confirm_button + content: > + The bootloader is now unlocked. Go through Android Setup skipping everything you can, then connect the device to a Wi-Fi network. + Since the device resets completely, you will need to re-enable Developer Options and USB debugging to continue. + flash_recovery: + - type: call_button + content: > + Now plug the USB-cable to your device. As a first step, you need to boot into download mode. Your device should be turned on. + Then press 'Confirm and run' to reboot into download mode. Continue once it's done. + command: adb_reboot_download + - type: call_button + content: In this step, you need to flash a custom recovery on your device. Press 'Confirm and run' to start the process. Confirm afterwards to continue. + command: heimdall_flash_recovery + - type: confirm_button + img: samsung-buttons-bixby.png + content: > + Unplug the USB cable from your device. Then manually reboot into recovery by pressing the *Volume Down* + *Bixby* for 8~10 seconds + until the screen turns black & release the buttons immediately when it does, then boot to recovery with the device powered off, + hold *Volume Up* + *Bixby* + *Power button*. \ No newline at end of file diff --git a/openandroidinstaller/assets/configs/greatlte.yaml b/openandroidinstaller/assets/configs/greatlte.yaml new file mode 100644 index 00000000..01e54325 --- /dev/null +++ b/openandroidinstaller/assets/configs/greatlte.yaml @@ -0,0 +1,21 @@ +metadata: + maintainer: Michel Memeteau (freechelmi) + devicename: Samsung Galaxy note 8 + devicecode: greatlte +steps: + unlock_bootloader: + flash_recovery: + - type: call_button + content: > + As a first step, you need to boot into the bootloader. A bootloader is the piece of software, + that tells your phone who to start and run an operating system (like Android). Your device should be turned on. + Then press 'Confirm and run' to reboot into the bootloader. Continue once it's done. + command: adb_reboot_download + - type: call_button + content: In this step, you need to flash a custom recovery on your device. Press 'Confirm and run' to start the process. Confirm afterwards to continue. + command: heimdall_flash_recovery + - type: confirm_button + img: samsung-buttons-bixby.png + content: > + Unplug the USB cable from your device. Then manually reboot into recovery by pressing the *Volume Down* + *Power buttons* for 8~10 seconds + until the screen turns black to reboot & release the buttons immediately when it does, then immediately hold *Volume Up* + *Bixby* + *Power button* until you are in recovery mode. \ No newline at end of file diff --git a/openandroidinstaller/assets/configs/taimen.yaml b/openandroidinstaller/assets/configs/taimen.yaml index 64382154..8bed3bbf 100644 --- a/openandroidinstaller/assets/configs/taimen.yaml +++ b/openandroidinstaller/assets/configs/taimen.yaml @@ -3,7 +3,7 @@ metadata: devicename: Google Pixel 2 XL devicecode: taimen requirements: - android: 12 + android: 11 steps: unlock_bootloader: - type: call_button diff --git a/openandroidinstaller/assets/configs/walleye.yaml b/openandroidinstaller/assets/configs/walleye.yaml index 7b95c9ba..1daae392 100644 --- a/openandroidinstaller/assets/configs/walleye.yaml +++ b/openandroidinstaller/assets/configs/walleye.yaml @@ -3,7 +3,7 @@ metadata: devicename: Google Pixel 2 devicecode: walleye requirements: - android: 12 + android: 11 steps: unlock_bootloader: - type: call_button diff --git a/openandroidinstaller/assets/imgs/samsung-buttons-bixby.png b/openandroidinstaller/assets/imgs/samsung-buttons-bixby.png new file mode 100644 index 00000000..33364051 Binary files /dev/null and b/openandroidinstaller/assets/imgs/samsung-buttons-bixby.png differ diff --git a/openandroidinstaller/widgets.py b/openandroidinstaller/widgets.py index fe479767..d57c006f 100644 --- a/openandroidinstaller/widgets.py +++ b/openandroidinstaller/widgets.py @@ -42,7 +42,12 @@ def __init__(self, expand: bool = True, visible: bool = False): def build(self): self._box = Container( - content=Column(scroll="auto", expand=True, auto_scroll=True), + content=Column( + controls=[Text("", selectable=True)], + scroll="auto", + expand=True, + auto_scroll=True, + ), margin=10, padding=10, alignment=alignment.top_left, @@ -61,7 +66,10 @@ def write_line(self, line: str): Ignores empty lines. """ if (type(line) == str) and line.strip(): - self._box.content.controls.append(Text(f">{line.strip()}", selectable=True)) + self._box.content.controls[0].value += f"\n>{line.strip()}" + self._box.content.controls[0].value = self._box.content.controls[ + 0 + ].value.strip("\n") self.update() def toggle_visibility(self): @@ -72,7 +80,7 @@ def toggle_visibility(self): def clear(self): """Clear terminal output.""" - self._box.content.controls = [] + self._box.content.controls[0].value = "" self.update() def update(self): diff --git a/tests/test_app.py b/tests/test_app.py index 93d25509..cb11a16e 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -34,7 +34,7 @@ def send_commands(self, command, other): return MockResult() -def test_app(): +def test_app_sargo(): page = ft.Page(conn=MockConn(), session_id=1) # test if it would start up main(page=page, test=True, test_config="sargo") @@ -47,3 +47,18 @@ def test_app(): for _ in range(number_of_steps): page.controls[0].to_next_view(None) assert "SuccessView" in str(page.controls[0].view.controls[0]) + + +def test_app_beyond2lte(): + page = ft.Page(conn=MockConn(), session_id=1) + # test if it would start up + main(page=page, test=True, test_config="beyond2lte") + + # test if you can go through all views + state = page.controls[0].state + state.load_config(device_code="sargo") + state.default_views.extend(state.addon_views) + number_of_steps = 14 + for _ in range(number_of_steps): + page.controls[0].to_next_view(None) + assert "SuccessView" in str(page.controls[0].view.controls[0]) diff --git a/tests/test_terminal_box.py b/tests/test_terminal_box.py index 526254c5..6a530e50 100644 --- a/tests/test_terminal_box.py +++ b/tests/test_terminal_box.py @@ -42,8 +42,8 @@ def test_write_lines(mocker): for line in ["test", "test_line2", True]: terminal_box.write_line(line) - # two text elements should appear - assert len(terminal_box._box.content.controls) == 2 + # two lines of text should appear + assert len(terminal_box._box.content.controls[0].value.split("\n")) == 2 def test_toggle_visibility(mocker): @@ -87,5 +87,5 @@ def test_clear_terminal(mocker): # now clear terminal_box.clear() - # two text elements should appear - assert len(terminal_box._box.content.controls) == 0 + # text element should be empty + assert terminal_box._box.content.controls[0].value == ""