Skip to content

Commit 8c5d438

Browse files
committed
Merge remote-tracking branch 'origin/dev' into dev-flash-additional
2 parents b0e2a0b + 940e9d6 commit 8c5d438

File tree

8 files changed

+72
-18
lines changed

8 files changed

+72
-18
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ Samsung | Galaxy Grand Prime VE | grandprimevelte | SM-G531F | tested
8282
Samsung | Galaxy S III Neo | s3ve3g | GT-I9301I | tested
8383
Samsung | Galaxy Tab S2 | [gts210vewifi](https://wiki.lineageos.org/devices/gts210vewifi/) | T813 | tested
8484
Samsung | Galaxy S4 Mini LTE| [serranoltexx](https://wiki.lineageos.org/devices/serranoltexx) | | tested
85+
Samsung | Galaxy S5 | [klte](https://wiki.lineageos.org/devices/klte) | G900F/M/R4/R7/T/V/W8 | tested
8586
Samsung | Galaxy S6 | [zerofltexx](https://wiki.lineageos.org/devices/zerofltexx) | | tested
8687
Samsung | Galaxy S6 Edge | [zeroltexx](https://wiki.lineageos.org/devices/zeroltexx) | | tested
8788
Samsung | Galaxy S7 | [herolte](https://wiki.lineageos.org/devices/herolte) | SM-G930F | tested

openandroidinstaller/assets/configs/beyond0lte.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ metadata:
44
is_ab_device: false
55
device_code: beyond0lte
66
supported_device_codes:
7-
- beyond0lte
7+
- beyond0lte
8+
- beyond0
89
requirements:
910
android: 12
1011
steps:

openandroidinstaller/assets/configs/beyond1lte.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ metadata:
44
is_ab_device: false
55
device_code: beyond1lte
66
supported_device_codes:
7-
- beyond1lte
7+
- beyond1lte
8+
- beyond1
89
requirements:
910
android: 12
1011
steps:
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
metadata:
2+
maintainer: Tobias Sterbak (tsterbak)
3+
device_name: Samsung Galaxy S5 LTE
4+
is_ab_device: false
5+
device_code: klte
6+
supported_device_codes:
7+
- klte
8+
steps:
9+
unlock_bootloader:
10+
boot_recovery:
11+
- type: call_button
12+
content: >
13+
As a first step, you need to boot into the bootloader. A bootloader is the piece of software,
14+
that tells your phone how to start and run an operating system (like Android). Your device should be turned on.
15+
Then press 'Confirm and run' to reboot into the bootloader. Continue once it's done.
16+
command: adb_reboot_download
17+
- type: call_button
18+
content: >
19+
In this step, you need to flash a custom recovery on your device.
20+
Press 'Confirm and run' to start the process. Confirm afterwards to continue.
21+
command: heimdall_flash_recovery
22+
- type: confirm_button
23+
img: samsung-buttons.png
24+
content: >
25+
Unplug the USB cable from your device. Then manually reboot into recovery by pressing the *Volume Down* + *Power buttons* for 8~10 seconds
26+
until the screen turns black & release the buttons immediately when it does, then boot to recovery with the device powered off,
27+
hold *Volume Up* + *Home* + *Power button*.

openandroidinstaller/views/install_addons_view.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ def run_install_addons(self, e):
203203
self.error_text.value = "Installation failed! Try again or make sure everything is setup correctly."
204204
else:
205205
sleep(4) # wait to make sure everything is fine
206+
self.progress_indicator.set_progress_bar(100)
207+
self.progress_indicator.update()
206208
logger.success("Installation process was successful. Allow to continue.")
207209
# enable the confirm button and disable the call button
208210
self.confirm_button.disabled = False

openandroidinstaller/views/install_view.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ def run_install(self, e):
210210
self.error_text.value = "Installation failed! Try again or make sure everything is setup correctly."
211211
else:
212212
sleep(5) # wait to make sure everything is fine
213+
self.progress_indicator.set_progress_bar(100)
214+
self.progress_indicator.update()
213215
logger.success("Installation process was successful. Allow to continue.")
214216
# enable the confirm button and disable the call button
215217
self.confirm_button.disabled = False

openandroidinstaller/widgets.py

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,20 @@ def display_progress_bar(self, line: str):
114114
"""Display and update the progress bar for the given line."""
115115
percentage_done = None
116116
result = None
117+
# create the progress bar
118+
if self.progress_bar == None:
119+
self.progress_bar = ProgressBar(
120+
value=1 / 100,
121+
width=500,
122+
bar_height=32,
123+
color="#00d886",
124+
bgcolor="#eeeeee",
125+
)
126+
# text to display the percentage
127+
self.percentage_text = Text("1%")
128+
self._container.content.controls.append(
129+
Row([self.percentage_text, self.progress_bar])
130+
)
117131
# get the progress numbers from the output lines
118132
if (type(line) == str) and line.strip():
119133
result = re.search(
@@ -122,23 +136,29 @@ def display_progress_bar(self, line: str):
122136
)
123137
if result:
124138
if result.group(2):
125-
percentage_done = 100
139+
percentage_done = 99
126140
elif result.group(1):
127141
percentage_done = int(result.group(1))
142+
if percentage_done == 0:
143+
percentage_done = 1
144+
elif percentage_done == 100:
145+
percentage_done = 99
128146

129-
# create the progress bar on first occurrence
130-
if percentage_done == 0:
131-
self.progress_bar = ProgressBar(
132-
width=500, bar_height=32, color="#00d886", bgcolor="#eeeeee"
133-
)
134-
self.percentage_text = Text(f"{percentage_done}%")
135-
self._container.content.controls.append(
136-
Row([self.percentage_text, self.progress_bar])
137-
)
138147
# update the progress bar
139-
if self.progress_bar:
140-
self.progress_bar.value = percentage_done / 100
141-
self.percentage_text.value = f"{percentage_done}%"
148+
self.set_progress_bar(percentage_done)
149+
150+
def set_progress_bar(self, percentage_done: int):
151+
"""Set the progress bar to the given percentage.
152+
153+
Args:
154+
percentage_done (int): Percentage of the progress bar to be filled.
155+
"""
156+
assert (
157+
percentage_done >= 0 and percentage_done <= 100
158+
), "Percentage must be between 0 and 100"
159+
if self.progress_bar:
160+
self.progress_bar.value = percentage_done / 100
161+
self.percentage_text.value = f"{percentage_done}%"
142162

143163
def display_progress_ring(
144164
self,

tests/test_progress_bar.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ def test_init():
3030
def test_update_progress_bar():
3131
"""Test if the progress bar is updated properly based on lines."""
3232
progress_indicator = ProgressIndicator(expand=True)
33-
build_indicator = progress_indicator.build()
33+
progress_indicator.build()
3434

3535
# test if other line is fine
3636
progress_indicator.display_progress_bar(
3737
line="Failed to mount '/data' (Device or resource busy)"
3838
)
39-
assert not progress_indicator.progress_bar
39+
assert progress_indicator.progress_bar
4040

4141
# test if percentages are parsed correctly and update is performed
4242
for percentage in range(0, 47):
@@ -46,4 +46,4 @@ def test_update_progress_bar():
4646

4747
# test if the finishing print is detected and updated correctly.
4848
progress_indicator.display_progress_bar(line="Total xfer: 1.00x\n")
49-
assert progress_indicator.progress_bar.value == 1.0
49+
assert progress_indicator.progress_bar.value == 0.99

0 commit comments

Comments
 (0)