Skip to content

Commit

Permalink
New Samsung devices for release 0.4.1-beta (#89)
Browse files Browse the repository at this point in the history
This PR adds support for:
- Samsung Galaxy S10e (beyond0lte)
- Samsung Galaxy S10+ (beyond2lte)
- Samsung Galaxy Note 10+ (d2s)
- Samsung Galaxy Note 8 (greatlte) thanks to @freechelmi 

Adds:
- new image for samsung bixby button

Fixes:
- Add proper instructions to unlock the bootloader for recent Samsung
devices.
- Make text in advanced output easier to copy
  • Loading branch information
tsterbak committed Mar 6, 2023
2 parents d279f1d + f77e13e commit 939b1b8
Show file tree
Hide file tree
Showing 14 changed files with 210 additions and 20 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
</details>

Expand Down
38 changes: 38 additions & 0 deletions openandroidinstaller/assets/configs/beyond0lte.yaml
Original file line number Diff line number Diff line change
@@ -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*.
22 changes: 18 additions & 4 deletions openandroidinstaller/assets/configs/beyond1lte.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
38 changes: 38 additions & 0 deletions openandroidinstaller/assets/configs/beyond2lte.yaml
Original file line number Diff line number Diff line change
@@ -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*.
2 changes: 1 addition & 1 deletion openandroidinstaller/assets/configs/crownlte.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
22 changes: 18 additions & 4 deletions openandroidinstaller/assets/configs/d1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
38 changes: 38 additions & 0 deletions openandroidinstaller/assets/configs/d2s.yaml
Original file line number Diff line number Diff line change
@@ -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*.
21 changes: 21 additions & 0 deletions openandroidinstaller/assets/configs/greatlte.yaml
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion openandroidinstaller/assets/configs/taimen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ metadata:
devicename: Google Pixel 2 XL
devicecode: taimen
requirements:
android: 12
android: 11
steps:
unlock_bootloader:
- type: call_button
Expand Down
2 changes: 1 addition & 1 deletion openandroidinstaller/assets/configs/walleye.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ metadata:
devicename: Google Pixel 2
devicecode: walleye
requirements:
android: 12
android: 11
steps:
unlock_bootloader:
- type: call_button
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 11 additions & 3 deletions openandroidinstaller/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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):
Expand All @@ -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):
Expand Down
17 changes: 16 additions & 1 deletion tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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])
8 changes: 4 additions & 4 deletions tests/test_terminal_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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 == ""

0 comments on commit 939b1b8

Please sign in to comment.