Skip to content

Commit 32551ed

Browse files
committed
Merge remote-tracking branch 'origin/more-explicit-texts' into specific-functions-for-tool-commands
2 parents 056f142 + 3ee43f4 commit 32551ed

File tree

7 files changed

+56
-92
lines changed

7 files changed

+56
-92
lines changed

openandroidinstaller/assets/configs/FP2.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,9 @@ steps:
3131
This will remove encryption and delete all files stored in the internal storage, as well as format your cache partition (if you have one).
3232
- title: "Flash LineageOS"
3333
type: confirm_button
34-
content: Return to the main menu on the phone.
35-
- title: "Flash LineageOS"
36-
type: confirm_button
37-
content: On the device, select “Apply Update”, then “Apply from ADB” to begin sideload. Then confirm here.
34+
content: >
35+
Return to the main menu on the phone by pressing the back button on the screen.
36+
On the device, select “Apply Update”, then “Apply from ADB” to begin sideload. Then confirm here.
3837
- title: "Flash LineageOS"
3938
type: call_button
4039
content: >

openandroidinstaller/assets/configs/FP3.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,9 @@ steps:
3737
This will remove encryption and delete all files stored in the internal storage, as well as format your cache partition (if you have one).
3838
- title: "Flash LineageOS"
3939
type: confirm_button
40-
content: Return to the main menu on the phone.
41-
- title: "Flash LineageOS"
42-
type: confirm_button
43-
content: On the device, select “Apply Update”, then “Apply from ADB” to begin sideload. Then confirm here.
40+
content: >
41+
Return to the main menu on the phone by pressing the back button.
42+
On the device, select “Apply Update”, then “Apply from ADB” to begin sideload. Then confirm here.
4443
- title: "Flash LineageOS"
4544
type: call_button
4645
content: >

openandroidinstaller/assets/configs/sargo.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,18 @@ steps:
4141
content: Flash a custom recovery (temporarily) by pressing 'Confirm and run'. Once it's done continue.
4242
command: fastboot_flash_recovery
4343
install_os:
44-
- type: confirm_button
45-
content: In this step, you finally flash LineageOS. Confirm to continue.
4644
- type: confirm_button
47-
content: Select 'Recovery Mode' on your smartphone screen and press the Start-Button to confirm. Then confirm here.
45+
content: >
46+
In the next steps, you finally flash LineageOS.
47+
Select 'Recovery Mode' on your smartphone screen and press the Start-Button to confirm. Then confirm here.
4848
- type: confirm_button
4949
content: >
5050
Now tap Factory Reset, then Format data / Factory reset on your phone screen and continue with the formatting process.
5151
This will remove encryption and delete all files stored in the internal storage, as well as format your cache partition (if you have one).
5252
- type: confirm_button
53-
content: Return to the main menu on the phone.
54-
- type: confirm_button
55-
content: On the device, select “Apply Update”, then “Apply from ADB” to begin sideload. Then confirm here.
53+
content: >
54+
Return to the main menu on the phone by pressing the back button.
55+
On the device, select “Apply Update”, then “Apply from ADB” to begin sideload. Then confirm here.
5656
- type: call_button
5757
content: >
5858
Now it's time to flash the LineageOS image. Don't remove the USB-Cable and press 'Confirm and run' to start!

openandroidinstaller/openandroidinstaller.py

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
UserControl,
4747
FloatingActionButton,
4848
VerticalDivider,
49+
Markdown,
4950
colors,
5051
icons,
5152
)
@@ -68,8 +69,8 @@
6869
from widgets import call_button, confirm_button, get_title, link_button
6970

7071
# Toggle to True for development purposes
71-
DEVELOPMENT = False
72-
DEVELOPMENT_CONFIG = "yuga" # "a3y17lte" # "sargo"
72+
DEVELOPMENT = False
73+
DEVELOPMENT_CONFIG = "sargo" # "a3y17lte" # "sargo"
7374

7475

7576
PLATFORM = sys.platform
@@ -125,8 +126,13 @@ def build(self):
125126
self.dlg_help_developer_options = AlertDialog(
126127
modal=True,
127128
title=Text("How to enable developer options and OEM unlocking"),
128-
content=Text(
129-
"To do this, tap seven times on the build number in the 'System'- or 'About the phone'-Menu in Settings. Then in developer options, toggle OEM unlocking and USB-Debugging."
129+
content=Markdown(
130+
"""
131+
To do this, tap seven times on the build number in the 'System'- or 'About the phone'-Menu in Settings. You can also use the phones own search to look for `build number`.
132+
Then go back to the main menu and look for 'developer options'. You can also search for it in your phone.
133+
When you are in developer options, toggle OEM unlocking and USB-Debugging. If your phone is already connected to your PC, a pop-up might appear. Allow USB debugging in the pop-up on your phone.
134+
Now you are ready to continue.
135+
"""
130136
),
131137
actions=[
132138
TextButton("Close", on_click=self.close_developer_options_dlg),
@@ -174,7 +180,7 @@ def check_bootloader_unlocked(e):
174180
),
175181
Row(
176182
[
177-
FilledButton(
183+
ElevatedButton(
178184
"How do I enable developer mode?",
179185
on_click=self.open_developer_options_dlg,
180186
expand=True,
@@ -196,7 +202,7 @@ def check_bootloader_unlocked(e):
196202
),
197203
Row(
198204
[
199-
ElevatedButton(
205+
FilledButton(
200206
"Search device",
201207
on_click=self.search_devices,
202208
icon=icons.PHONE_ANDROID,
@@ -309,7 +315,7 @@ def build(self):
309315
Column(
310316
[
311317
Text(
312-
"You can download supported image and recovery file for your device here:"
318+
"You can bring your own image and recovery or you download the officially supported image and recovery file for your device here:"
313319
),
314320
Row(
315321
[
@@ -323,6 +329,13 @@ def build(self):
323329
),
324330
]
325331
),
332+
Markdown(
333+
f"""
334+
The image file should look something like `lineage-19.1-20221101-nightly-{self.state.config.metadata.get('devicecode')}-signed.zip`
335+
and the recovery like `lineage-19.1-20221101-recovery-{self.state.config.metadata.get('devicecode')}.img`
336+
or `twrp-3.6.2_9-0-{self.state.config.metadata.get('devicecode')}.img`.
337+
"""
338+
),
326339
Divider(),
327340
]
328341
)
@@ -382,11 +395,11 @@ def enable_button_if_ready(self, e):
382395
recovery_path=self.state.recovery_path,
383396
):
384397
# if image and recovery work for device allow to move on, otherwise display message
385-
self.info_field.controls.append(
398+
self.info_field.controls = [
386399
Text(
387400
"Image and recovery don't work with the device. Please select different ones."
388401
)
389-
)
402+
]
390403
self.right_view.update()
391404
return
392405
self.info_field.controls = []
@@ -518,8 +531,9 @@ def load_config(self, device_code: str) -> Optional[str]:
518531
return self.config.metadata.get("devicename", "No device name in config.")
519532

520533
def pick_image_result(self, e: FilePickerResultEvent):
521-
self.selected_image.value += (
522-
", ".join(map(lambda f: f.name, e.files)) if e.files else "Cancelled!"
534+
path = ", ".join(map(lambda f: f.name, e.files)) if e.files else "Cancelled!"
535+
self.selected_image.value = (
536+
self.selected_image.value.split(":")[0] + f": {path}"
523537
)
524538
if e.files:
525539
self.image_path = e.files[0].path
@@ -530,8 +544,9 @@ def pick_image_result(self, e: FilePickerResultEvent):
530544
self.selected_image.update()
531545

532546
def pick_recovery_result(self, e: FilePickerResultEvent):
533-
self.selected_recovery.value += (
534-
", ".join(map(lambda f: f.name, e.files)) if e.files else "Cancelled!"
547+
path = ", ".join(map(lambda f: f.name, e.files)) if e.files else "Cancelled!"
548+
self.selected_recovery.value = (
549+
self.selected_recovery.value.split(":")[0] + f": {path}"
535550
)
536551
if e.files:
537552
self.recovery_path = e.files[0].path
@@ -713,15 +728,14 @@ def close_banner(e):
713728
bgcolor=colors.AMBER_100,
714729
leading=Icon(icons.WARNING_AMBER_ROUNDED, color=colors.AMBER, size=40),
715730
content=Text(
716-
"Important: Please read through the instructions at least once before actually following them, so as to avoid any problems due to any missed steps!"
731+
"These instructions only work if you follow every section and step precisely. Do not continue after something fails!"
717732
),
718733
actions=[
719734
TextButton("I understand", on_click=close_banner),
720735
],
721736
)
722-
# TODO: disable the banner for now
723-
# page.banner.open = True
724-
# page.update()
737+
page.banner.open = True
738+
page.update()
725739

726740
# create application instance
727741
app = MainView()

openandroidinstaller/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
def get_download_link(devicecode: str) -> Optional[str]:
2424
"""Check if a lineageOS version for this device exists on lineageosroms.com and return the respective download link."""
25-
url = f"https://download.lineageos.org/{devicecode.lower()}/"
25+
url = f"https://download.lineageos.org/{devicecode.lower()}"
2626
try:
2727
logger.info(f"Checking {url}")
2828
# Get Url

openandroidinstaller/widgets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def get_title(title: str):
3737

3838

3939
def confirm_button(
40-
confirm_func: Callable, confirm_text: str = "Confirm and continue"
40+
confirm_func: Callable, confirm_text: str = "Continue"
4141
) -> ElevatedButton:
4242
"""Get a button, that calls a given function when clicked."""
4343
return ElevatedButton(

poetry.lock

Lines changed: 11 additions & 59 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)