Skip to content

Commit 710223b

Browse files
authored
New fairphone unlocking instructions (#187)
- Update the unlocking instructions for FP3/4 and add fastboot_unlock_critical command. - Update tests and fix formatting.
2 parents 35d0d2d + 6b895c4 commit 710223b

File tree

5 files changed

+48
-15
lines changed

5 files changed

+48
-15
lines changed

openandroidinstaller/assets/configs/FP3.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,25 @@ steps:
1818
content: >
1919
Press 'Confirm and run' to reboot into the bootloader.
2020
command: adb_reboot_bootloader
21-
- type: confirm_button
22-
content: >
23-
Select 'Restart bootloader' on your smartphone screen by pressing the volume button and the confirm by pushing the power button.
24-
Then press 'Confirm and continue' here.
2521
- type: call_button
2622
content: >
2723
In this step you actually unlock the bootloader. Just press 'Confirm and run' here. Once it's done, press continue here.
2824
command: fastboot_unlock
2925
- type: confirm_button
3026
content: >
3127
Follow the instructions on the Fairphone screen. This command will wipe all the personal data on your phone.
28+
- type: call_button
29+
content: >
30+
After the phone reboots, boot into the fastboot mode once again by pressing 'Confirm and run' here. Then continue.
31+
command: adb_reboot_bootloader
32+
- type: call_button
33+
content: >
34+
When you are in fastboot mode again, you need to run another unlock step here.
35+
Just press 'Confirm and run' here. Once it's done, press continue here.
36+
command: fastboot_unlock_critical
37+
- type: confirm_button
38+
content: >
39+
Follow the instructions on the Fairphone screen. This command will wipe all the personal data on your phone.
3240
- type: call_button
3341
content: >
3442
To finish the unlocking, the phone needs to reboot. Just press 'Confirm and run' here to reboot. Then continue.

openandroidinstaller/assets/configs/FP4.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,30 @@ steps:
1313
how to start and run an operating system (like Android). Your device should be turned on.
1414
Click on the button to open the instructions on the Fairphone Support official unlocking website to generate an unlock code for your device.
1515
Once you've done that, continue.
16-
link: https://support.fairphone.com/hc/en-us/articles/4405858258961-FP4-Manage-the-bootloader
16+
link: https://www.fairphone.com/en/bootloader-unlocking-code-for-fairphone-3/
1717
- type: call_button
1818
content: >
1919
Press 'Confirm and run' to reboot into the bootloader.
2020
command: adb_reboot_bootloader
21-
- type: confirm_button
22-
content: >
23-
Select 'Restart bootloader' on your smartphone screen by pressing the volume button and the confirm by pushing the power button.
24-
Then press 'Confirm and continue' here.
2521
- type: call_button
2622
content: >
2723
In this step you actually unlock the bootloader. Just press 'Confirm and run' here. Once it's done, press continue here.
2824
command: fastboot_unlock
2925
- type: confirm_button
3026
content: >
3127
Follow the instructions on the Fairphone screen. This command will wipe all the personal data on your phone.
28+
- type: call_button
29+
content: >
30+
After the phone reboots, boot into the fastboot mode once again by pressing 'Confirm and run' here. Then continue.
31+
command: adb_reboot_bootloader
32+
- type: call_button
33+
content: >
34+
When you are in fastboot mode again, you need to run another unlock step here.
35+
Just press 'Confirm and run' here. Once it's done, press continue here.
36+
command: fastboot_unlock_critical
37+
- type: confirm_button
38+
content: >
39+
Follow the instructions on the Fairphone screen. This command will wipe all the personal data on your phone.
3240
- type: call_button
3341
content: >
3442
To finish the unlocking, the phone needs to reboot. Just press 'Confirm and run' here to reboot. Then continue.

openandroidinstaller/openandroidinstaller.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,13 @@ def main(page: Page, test: bool = False, test_config: str = "sargo"):
230230

231231
# header
232232
page.appbar = AppBar(
233-
leading=Image(
234-
src="/logo-192x192.png", height=40, width=40, border_radius=40
235-
),
233+
leading=Image(src="/logo-192x192.png", height=40, width=40, border_radius=40),
236234
leading_width=56,
237235
toolbar_height=72,
238236
elevation=0,
239-
title=Text(f"OpenAndroidInstaller version {VERSION}"), #, style="displaySmall"),
237+
title=Text(
238+
f"OpenAndroidInstaller version {VERSION}"
239+
), # , style="displaySmall"),
240240
center_title=False,
241241
bgcolor="#00d886",
242242
actions=[

openandroidinstaller/tooling.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,13 @@ def fastboot_unlock(bin_path: Path) -> TerminalResponse:
369369
yield line
370370

371371

372+
@add_logging("Critically unlocking the device with fastboot without code.")
373+
def fastboot_unlock_critical(bin_path: Path) -> TerminalResponse:
374+
"""Unlock critical the device with fastboot and without code."""
375+
for line in run_command("fastboot flashing unlock_critical", bin_path):
376+
yield line
377+
378+
372379
@add_logging("OEM unlocking the device with fastboot.")
373380
def fastboot_oem_unlock(bin_path: Path) -> TerminalResponse:
374381
"""OEM unlock the device with fastboot and without code."""

tests/test_app.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,12 @@ def test_app_sargo():
4646
number_of_steps = 14
4747
for _ in range(number_of_steps):
4848
page.controls[0].to_next_view(None)
49-
assert "SuccessView" in str(page.controls[0].view.controls[0])
49+
assert "Installation completed successfully!" in str(
50+
page.controls[0]
51+
.view.controls[0]
52+
.right_view_header.controls[0]
53+
.content.controls[0]
54+
)
5055

5156

5257
def test_app_beyond2lte():
@@ -61,4 +66,9 @@ def test_app_beyond2lte():
6166
number_of_steps = 14
6267
for _ in range(number_of_steps):
6368
page.controls[0].to_next_view(None)
64-
assert "SuccessView" in str(page.controls[0].view.controls[0])
69+
assert "Installation completed successfully!" in str(
70+
page.controls[0]
71+
.view.controls[0]
72+
.right_view_header.controls[0]
73+
.content.controls[0]
74+
)

0 commit comments

Comments
 (0)