Skip to content

Commit 554a113

Browse files
authored
Release v0.3.4 (#63)
This Release adds: - Enable auto_scroll on the TerminalBox for advanced output - Keep advanced output TerminalBox visible between steps - Don't open a terminal window on Windows - Display version number in app and logs - Add a back-button to the default views New devices: - Samsung Galaxy S6 - Samsung Galaxy S6 Edge - Samsung Galaxy S7 Edge
2 parents 3ffb2de + 9e8203b commit 554a113

File tree

15 files changed

+551
-302
lines changed

15 files changed

+551
-302
lines changed

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
</p>
2727
</div>
2828

29-
> **Warning**: This application is currently in early alpha state, so use at your own risk! I take no responsibility for bricked devices or dead SD cards.
29+
> **Warning**: This application is currently in alpha state, so use at your own risk! While many people tested the application so far and we heard of no bricked devices, thinks might still go wrong.
3030
3131
> **Note**: Unlocking the bootloader will erase all data on your device!
3232
This also includes your DRM keys, which are stored in the Trim Area partition (also called TA).
@@ -36,7 +36,7 @@ If you wish to backup the TA partition first, you can find tutorials related to
3636

3737
## Usage
3838

39-
Linux is currently the best supported platform (tested with Ubuntu 20.04 LTS). Windows and MacOS are also supported but you might experience more issues. So far there is no support for ARM-based systems.
39+
Linux is currently the best supported platform (tested with Ubuntu 20.04/22.04 LTS). Windows and MacOS are also supported but you might experience more issues. So far there is no support for ARM-based systems.
4040

4141
1. Download the AppImage, .exe or appropriate executable file for your OS. You might need to change permissions to run the executable.
4242
- On Windows also [install the Universal USB Drivers](https://adb.clockworkmod.com/) and other potentially drivers needed for your device.
@@ -55,7 +55,7 @@ Linux is currently the best supported platform (tested with Ubuntu 20.04 LTS). W
5555

5656
## Officially supported devices
5757

58-
Currently, the **we support 45 devices** by various vendors and working on adding more soon!
58+
Currently, the **we support 48 devices** by various vendors and working on adding more soon!
5959

6060

6161
Support for these devices is provided as best effort, but things might still go wrong.
@@ -69,7 +69,10 @@ Samsung | Galaxy J7 2015 | j7elte | | tested
6969
Samsung | Galaxy A3 2017 | a3y17lte | SM-A320FL | tested
7070
Samsung | Galaxy A5 2016 | [a5xelte](https://wiki.lineageos.org/devices/a5xelte/) | SM-A510F | tested
7171
Samsung | Galaxy A7 2016 | a7xelte | | tested
72+
Samsung | Galaxy S6 | [zerofltexx](https://wiki.lineageos.org/devices/zerofltexx/) | | tested
73+
Samsung | Galaxy S6 Edge | [zeroltexx](https://wiki.lineageos.org/devices/zeroltexx/) | | tested
7274
Samsung | Galaxy S7 | [herolte](https://wiki.lineageos.org/devices/herolte/) | SM-G930F | tested
75+
Samsung | Galaxy S7 Edge | [hero2lte](https://wiki.lineageos.org/devices/hero2lte/) | | tested
7376
Samsung | Galaxy S9 | [starlte](https://wiki.lineageos.org/devices/starlte/) | | tested
7477
Samsung | Galaxy Note 9 | [crownlte](https://wiki.lineageos.org/devices/crownlte/) | | tested
7578
Samsung | Galaxy S10 | [beyond1lte](https://wiki.lineageos.org/devices/beyond1lte/) | | tested
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
metadata:
2+
maintainer: Tobias Sterbak (tsterbak)
3+
devicename: Samsung Galaxy S7 Edge
4+
devicecode: hero2lte
5+
steps:
6+
unlock_bootloader:
7+
flash_recovery:
8+
- type: call_button
9+
content: >
10+
As a first step, you need to boot into the bootloader. A bootloader is the piece of software,
11+
that tells your phone who to start and run an operating system (like Android). Your device should be turned on.
12+
Then press 'Confirm and run' to reboot into the bootloader. Continue once it's done.
13+
command: adb_reboot_download
14+
- type: call_button
15+
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.
16+
command: heimdall_flash_recovery
17+
- type: confirm_button
18+
img: samsung-buttons.png
19+
content: >
20+
Unplug the USB cable from your device. Then manually reboot into recovery by pressing the *Volume Down* + *Power buttons* for 8~10 seconds
21+
until the screen turns black & release the buttons immediately when it does, then boot to recovery with the device powered off,
22+
hold *Volume Up* + *Home* + *Power button*.
23+
install_os:
24+
- type: call_button
25+
content: >
26+
In the next steps, you finally flash the selected OS image.
27+
Connect your device with your computer with the USB-Cable.
28+
This step will format your phone and wipe all the data. It will also remove encryption and delete all files stored
29+
in the internal storage. Then the OS image will be installed. Confirm to run. This might take a while. At the end your phone will boot into the new OS.
30+
command: adb_twrp_wipe_and_install
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
metadata:
2+
maintainer: Tobias Sterbak (tsterbak)
3+
devicename: Samsung Galaxy S6
4+
devicecode: zerofltexx
5+
steps:
6+
unlock_bootloader:
7+
flash_recovery:
8+
- type: call_button
9+
content: >
10+
As a first step, you need to boot into the bootloader. A bootloader is the piece of software,
11+
that tells your phone who to start and run an operating system (like Android). Your device should be turned on.
12+
Then press 'Confirm and run' to reboot into the bootloader. Continue once it's done.
13+
command: adb_reboot_download
14+
- type: call_button
15+
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.
16+
command: heimdall_flash_recovery
17+
- type: confirm_button
18+
img: samsung-buttons.png
19+
content: >
20+
Unplug the USB cable from your device. Then manually reboot into recovery by pressing the *Volume Down* + *Power buttons* for 8~10 seconds
21+
until the screen turns black & release the buttons immediately when it does, then boot to recovery with the device powered off,
22+
hold *Volume Up* + *Home* + *Power button*.
23+
install_os:
24+
- type: call_button
25+
content: >
26+
In the next steps, you finally flash the selected OS image.
27+
Connect your device with your computer with the USB-Cable.
28+
This step will format your phone and wipe all the data. It will also remove encryption and delete all files stored
29+
in the internal storage. Then the OS image will be installed. Confirm to run. This might take a while. At the end your phone will boot into the new OS.
30+
command: adb_twrp_wipe_and_install
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
metadata:
2+
maintainer: Tobias Sterbak (tsterbak)
3+
devicename: Samsung Galaxy S6 Edge
4+
devicecode: zeroltexx
5+
steps:
6+
unlock_bootloader:
7+
flash_recovery:
8+
- type: call_button
9+
content: >
10+
As a first step, you need to boot into the bootloader. A bootloader is the piece of software,
11+
that tells your phone who to start and run an operating system (like Android). Your device should be turned on.
12+
Then press 'Confirm and run' to reboot into the bootloader. Continue once it's done.
13+
command: adb_reboot_download
14+
- type: call_button
15+
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.
16+
command: heimdall_flash_recovery
17+
- type: confirm_button
18+
img: samsung-buttons.png
19+
content: >
20+
Unplug the USB cable from your device. Then manually reboot into recovery by pressing the *Volume Down* + *Power buttons* for 8~10 seconds
21+
until the screen turns black & release the buttons immediately when it does, then boot to recovery with the device powered off,
22+
hold *Volume Up* + *Home* + *Power button*.
23+
install_os:
24+
- type: call_button
25+
content: >
26+
In the next steps, you finally flash the selected OS image.
27+
Connect your device with your computer with the USB-Cable.
28+
This step will format your phone and wipe all the data. It will also remove encryption and delete all files stored
29+
in the internal storage. Then the OS image will be installed. Confirm to run. This might take a while. At the end your phone will boot into the new OS.
30+
command: adb_twrp_wipe_and_install

openandroidinstaller/openandroidinstaller.py

Lines changed: 45 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252
# where to write the logs
5353
logger.add("openandroidinstaller.log")
5454

55+
# VERSION number
56+
VERSION = "0.3.4-alpha"
5557

5658
# detect platform
5759
PLATFORM = sys.platform
@@ -71,19 +73,22 @@ def __init__(self, state: AppState):
7173

7274
# create default starter views
7375
welcome_view = WelcomeView(
74-
on_confirm=self.confirm,
76+
on_confirm=self.to_next_view,
7577
state=self.state,
7678
)
7779
start_view = StartView(
78-
on_confirm=self.confirm,
80+
on_confirm=self.to_next_view,
81+
on_back=self.to_previous_view,
7982
state=self.state,
8083
)
8184
requirements_view = RequirementsView(
82-
on_confirm=self.confirm,
85+
on_confirm=self.to_next_view,
86+
on_back=self.to_previous_view,
8387
state=self.state,
8488
)
8589
select_files_view = SelectFilesView(
86-
on_confirm=self.confirm,
90+
on_confirm=self.to_next_view,
91+
on_back=self.to_previous_view,
8792
state=self.state,
8893
)
8994
# ordered to allow for pop
@@ -96,15 +101,28 @@ def __init__(self, state: AppState):
96101
# create the final success view
97102
self.final_view = SuccessView(state=self.state)
98103

99-
self.state.default_views = self.default_views
100-
self.state.final_view = self.final_view
104+
# stack of previous default views for the back-button
105+
self.previous_views = []
101106

102107
def build(self):
103108
self.view.controls.append(self.default_views.pop())
104109
return self.view
105110

106-
def confirm(self, e):
111+
def to_previous_view(self, e):
112+
"""Method to display the previous view."""
113+
# store the current view
114+
self.default_views.append(self.view.controls[-1])
115+
# clear the current view
116+
self.view.controls = []
117+
# retrieve the new view and update
118+
self.view.controls.append(self.previous_views.pop())
119+
logger.info("One step back.")
120+
self.view.update()
121+
122+
def to_next_view(self, e):
107123
"""Confirmation event handler to use in views."""
124+
# store the current view
125+
self.previous_views.append(self.view.controls[-1])
108126
# remove all elements from column view
109127
self.view.controls = []
110128
# if there are default views left, display them first
@@ -115,13 +133,13 @@ def confirm(self, e):
115133
StepView(
116134
step=self.state.steps.pop(0),
117135
state=self.state,
118-
on_confirm=self.confirm,
136+
on_confirm=self.to_next_view,
119137
)
120138
)
121139
else:
122140
# display the final view
123141
self.view.controls.append(self.final_view)
124-
logger.info("Confirmed.")
142+
logger.info("Confirmed and moved to next step.")
125143
self.view.update()
126144

127145

@@ -141,19 +159,28 @@ def configure(page: Page):
141159
def log_version_infos(bin_path):
142160
"""Log the version infos of adb, fastboot and heimdall."""
143161
# adb
144-
adbversion = [line for line in run_command("adb", ["version"], bin_path)]
145-
adbversion = "\n".join(adbversion[:1])
146-
logger.info(f"{adbversion}")
162+
adbversion = [
163+
line for line in run_command("adb", ["version"], bin_path, enable_logging=False)
164+
]
165+
logger.info(f"{adbversion[1].strip()}")
147166
# fastboot
148-
fbversion = [line for line in run_command("fastboot", ["--version"], bin_path)]
149-
logger.info(f"{fbversion[0]}")
167+
fbversion = [
168+
line
169+
for line in run_command(
170+
"fastboot", ["--version"], bin_path, enable_logging=False
171+
)
172+
]
173+
logger.info(f"{fbversion[1].strip()}")
150174
# heimdall
151-
hdversion = [line for line in run_command("heimdall", ["info"], bin_path)]
152-
logger.info(f"Heimdall version: {hdversion[0]}")
175+
hdversion = [
176+
line
177+
for line in run_command("heimdall", ["info"], bin_path, enable_logging=False)
178+
]
179+
logger.info(f"Heimdall version: {hdversion[1].strip()}")
153180

154181

155182
def main(page: Page, test: bool = False, test_config: str = "sargo"):
156-
logger.info(f"Running OpenAndroidInstaller on {PLATFORM}")
183+
logger.info(f"Running OpenAndroidInstaller version '{VERSION}' on '{PLATFORM}'.")
157184
log_version_infos(bin_path=BIN_PATH)
158185
logger.info(100 * "-")
159186

@@ -168,7 +195,7 @@ def main(page: Page, test: bool = False, test_config: str = "sargo"):
168195
leading_width=56,
169196
toolbar_height=72,
170197
elevation=0,
171-
title=Text("OpenAndroidInstaller alpha version", style="displaySmall"),
198+
title=Text(f"OpenAndroidInstaller version {VERSION}", style="displaySmall"),
172199
center_title=False,
173200
bgcolor="#00d886",
174201
actions=[

openandroidinstaller/tooling.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
import sys
1717
from pathlib import Path
18+
import subprocess
1819
from subprocess import (
1920
Popen,
2021
PIPE,
@@ -31,21 +32,35 @@
3132
PLATFORM = sys.platform
3233

3334

34-
def run_command(tool: str, command: List[str], bin_path: Path) -> CompletedProcess:
35+
def run_command(
36+
tool: str, command: List[str], bin_path: Path, enable_logging: bool = True
37+
) -> CompletedProcess:
3538
"""Run a command with a tool (adb, fastboot, heimdall)."""
3639
yield f"${' '.join([tool] + command )}"
3740
if tool not in ["adb", "fastboot", "heimdall"]:
3841
raise Exception(f"Unknown tool {tool}. Use adb, fastboot or heimdall.")
3942
if PLATFORM == "win32":
4043
full_command = [str(bin_path.joinpath(Path(f"{tool}"))) + ".exe"] + command
44+
# prevent Windows from opening terminal windows
45+
si = subprocess.STARTUPINFO()
46+
si.dwFlags |= subprocess.STARTF_USESHOWWINDOW
4147
else:
4248
full_command = [str(bin_path.joinpath(Path(f"{tool}")))] + command
43-
logger.info(f"Run command: {full_command}")
49+
si = None
50+
if enable_logging:
51+
logger.info(f"Run command: {full_command}")
52+
# run the command
4453
with Popen(
45-
full_command, stdout=PIPE, stderr=STDOUT, bufsize=1, universal_newlines=True
54+
full_command,
55+
stdout=PIPE,
56+
stderr=STDOUT,
57+
bufsize=1,
58+
universal_newlines=True,
59+
startupinfo=si,
4660
) as p:
4761
for line in p.stdout:
48-
logger.info(line.strip())
62+
if enable_logging:
63+
logger.info(line.strip())
4964
yield line
5065

5166
yield p.returncode == 0

openandroidinstaller/views/base.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,10 @@ def __init__(self, state: AppState, image: str = "placeholder.png"):
5252
],
5353
alignment="spaceEvenly",
5454
)
55+
56+
def clear(
57+
self,
58+
):
59+
"""Clear the right view."""
60+
self.right_view.controls = []
61+
self.right_view_header.controls = []

0 commit comments

Comments
 (0)