Skip to content

Commit

Permalink
Release 0.4.4-beta (#169)
Browse files Browse the repository at this point in the history
This Release adds:

- Samsung A5 2017 (a5y17lte) thanks to @Gredin67
- Support for device code `beyond2` for Samsung Galaxy S10+.
- Support for device code `evert_n` for Motorola Moto G6 plus.
- Add config file for Samsung Tab S2 gts210vewifi T813 thanks to
@freechelmi
- a "request support for device" button if no config for the device code
is found

Fixes:
- Update the unlocking instructions for FP3/4 and add
fastboot_unlock_critical command.

Changes:
- Set a min width/height for the window to solve basic responsiveness
issues
  • Loading branch information
tsterbak authored Jul 26, 2023
2 parents a75022b + 49d6017 commit f656346
Show file tree
Hide file tree
Showing 20 changed files with 1,493 additions and 1,094 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Linux is currently the best supported platform (tested with Ubuntu 20.04/22.04 L

## Officially supported devices

Currently, the **we support 60 devices** by various vendors and working on adding more soon!
Currently, the **we support 62 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 @@ -76,9 +76,11 @@ Vendor | Device Name | CodeName | Models | Status
Samsung | Galaxy J7 2015 | j7elte | | tested
Samsung | Galaxy A3 2017 | a3y17lte | SM-A320FL | tested
Samsung | Galaxy A5 2016 | [a5xelte](https://wiki.lineageos.org/devices/a5xelte) | SM-A510F | tested
Samsung | Galaxy A5 2017 | [a5y17lte](https://wiki.lineageos.org/devices/a5y17lte) | | tested
Samsung | Galaxy A7 2016 | a7xelte | | tested
Samsung | Galaxy Grand Prime VE | grandprimevelte | SM-G531F | tested
Samsung | Galaxy S III Neo | s3ve3g | GT-I9301I | tested
Samsung | Galaxy Tab S2 | [gts210vewifi](https://wiki.lineageos.org/devices/gts210vewifi/) | T813 | tested
Samsung | Galaxy S4 Mini LTE| [serranoltexx](https://wiki.lineageos.org/devices/serranoltexx) | | tested
Samsung | Galaxy S6 | [zerofltexx](https://wiki.lineageos.org/devices/zerofltexx) | | tested
Samsung | Galaxy S6 Edge | [zeroltexx](https://wiki.lineageos.org/devices/zeroltexx) | | tested
Expand Down
16 changes: 12 additions & 4 deletions openandroidinstaller/assets/configs/FP3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,25 @@ steps:
content: >
Press 'Confirm and run' to reboot into the bootloader.
command: adb_reboot_bootloader
- type: confirm_button
content: >
Select 'Restart bootloader' on your smartphone screen by pressing the volume button and the confirm by pushing the power button.
Then press 'Confirm and continue' here.
- type: call_button
content: >
In this step you actually unlock the bootloader. Just press 'Confirm and run' here. Once it's done, press continue here.
command: fastboot_unlock
- type: confirm_button
content: >
Follow the instructions on the Fairphone screen. This command will wipe all the personal data on your phone.
- type: call_button
content: >
After the phone reboots, boot into the fastboot mode once again by pressing 'Confirm and run' here. Then continue.
command: adb_reboot_bootloader
- type: call_button
content: >
When you are in fastboot mode again, you need to run another unlock step here.
Just press 'Confirm and run' here. Once it's done, press continue here.
command: fastboot_unlock_critical
- type: confirm_button
content: >
Follow the instructions on the Fairphone screen. This command will wipe all the personal data on your phone.
- type: call_button
content: >
To finish the unlocking, the phone needs to reboot. Just press 'Confirm and run' here to reboot. Then continue.
Expand Down
18 changes: 13 additions & 5 deletions openandroidinstaller/assets/configs/FP4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,30 @@ steps:
how to start and run an operating system (like Android). Your device should be turned on.
Click on the button to open the instructions on the Fairphone Support official unlocking website to generate an unlock code for your device.
Once you've done that, continue.
link: https://support.fairphone.com/hc/en-us/articles/4405858258961-FP4-Manage-the-bootloader
link: https://www.fairphone.com/en/bootloader-unlocking-code-for-fairphone-3/
- type: call_button
content: >
Press 'Confirm and run' to reboot into the bootloader.
command: adb_reboot_bootloader
- type: confirm_button
content: >
Select 'Restart bootloader' on your smartphone screen by pressing the volume button and the confirm by pushing the power button.
Then press 'Confirm and continue' here.
- type: call_button
content: >
In this step you actually unlock the bootloader. Just press 'Confirm and run' here. Once it's done, press continue here.
command: fastboot_unlock
- type: confirm_button
content: >
Follow the instructions on the Fairphone screen. This command will wipe all the personal data on your phone.
- type: call_button
content: >
After the phone reboots, boot into the fastboot mode once again by pressing 'Confirm and run' here. Then continue.
command: adb_reboot_bootloader
- type: call_button
content: >
When you are in fastboot mode again, you need to run another unlock step here.
Just press 'Confirm and run' here. Once it's done, press continue here.
command: fastboot_unlock_critical
- type: confirm_button
content: >
Follow the instructions on the Fairphone screen. This command will wipe all the personal data on your phone.
- type: call_button
content: >
To finish the unlocking, the phone needs to reboot. Just press 'Confirm and run' here to reboot. Then continue.
Expand Down
27 changes: 27 additions & 0 deletions openandroidinstaller/assets/configs/a5y17lte.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
metadata:
maintainer: Tobias Sterbak (tsterbak)
device_name: Samsung Galaxy A5 (2017)
is_ab_device: false
device_code: a5y17lte
supported_device_codes:
- a5y17lte
steps:
unlock_bootloader:
boot_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 how 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.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 & release the buttons immediately when it does, then boot to recovery with the device powered off,
hold *Volume Up* + *Home* + *Power button*.
3 changes: 2 additions & 1 deletion openandroidinstaller/assets/configs/beyond2lte.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ metadata:
device_code: beyond2lte
supported_device_codes:
- beyond2lte
- beyond2
requirements:
android: 12
steps:
Expand Down Expand Up @@ -40,4 +41,4 @@ steps:
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*.
hold *Volume Up* + *Bixby* + *Power button*.
5 changes: 3 additions & 2 deletions openandroidinstaller/assets/configs/evert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ metadata:
is_ab_device: true
device_code: evert
supported_device_codes:
- evert
- evert
- evert_n
steps:
unlock_bootloader:
- type: call_button
Expand Down Expand Up @@ -59,4 +60,4 @@ steps:
img: twrp-start.jpeg
content: >
Now we need to boot into recovery again. Press run and when you see the TWRP screen you can continue.
command: fastboot_boot_recovery
command: fastboot_boot_recovery
27 changes: 27 additions & 0 deletions openandroidinstaller/assets/configs/gts210vewifi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
metadata:
maintainer: Michel Memeteau (freechelmi)
device_name: Samsung Galaxy Tab S2 (T813 2016)
is_ab_device: false
device_code: gts210vewifi
supported_device_codes:
- gts210vewifi
steps:
unlock_bootloader:
boot_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 how 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.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 & release the buttons immediately when it does, then boot to recovery with the device powered off,
hold *Volume Up* + *Home* + *Power button*.
6 changes: 3 additions & 3 deletions openandroidinstaller/installer_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ def from_file(cls, path):
metadata = config["metadata"]
requirements = config.get("requirements", None)
else:
logger.info("Validation of config failed.")
logger.error(f"Validation of config at {path} failed.")
return None
except yaml.YAMLError as exc:
logger.info(exc)
logger.error(f"Loading the config from {path} failed with {exc}")
return None

if raw_steps.get("unlock_bootloader") is not None:
Expand Down Expand Up @@ -137,7 +137,7 @@ def _load_config(device_code: str, config_path: Path) -> Optional[InstallerConfi
logger.info(f"Config metadata: {config.metadata}.")
return config
else:
logger.info(f"No device config found for {path}.")
logger.info(f"No device config found for device code '{device_code}'.")
return None


Expand Down
12 changes: 7 additions & 5 deletions openandroidinstaller/openandroidinstaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
from tooling import run_command

# VERSION number
VERSION = "0.4.3-beta"
VERSION = "0.4.4-beta"

# detect platform
PLATFORM = sys.platform
Expand Down Expand Up @@ -193,6 +193,8 @@ def configure(page: Page):
page.window_left = 120
page.scroll = "adaptive"
page.horizontal_alignment = "center"
page.window_min_width = 1000
page.window_min_height = 600


def log_version_infos(bin_path):
Expand Down Expand Up @@ -228,13 +230,13 @@ def main(page: Page, test: bool = False, test_config: str = "sargo"):

# header
page.appbar = AppBar(
leading=Image(
src="/assets/logo-192x192.png", height=40, width=40, border_radius=40
),
leading=Image(src="/logo-192x192.png", height=40, width=40, border_radius=40),
leading_width=56,
toolbar_height=72,
elevation=0,
title=Text(f"OpenAndroidInstaller version {VERSION}", style="displaySmall"),
title=Text(
f"OpenAndroidInstaller version {VERSION}"
), # , style="displaySmall"),
center_title=False,
bgcolor="#00d886",
actions=[
Expand Down
9 changes: 8 additions & 1 deletion openandroidinstaller/tooling.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,13 @@ def fastboot_unlock(bin_path: Path) -> TerminalResponse:
yield line


@add_logging("Critically unlocking the device with fastboot without code.")
def fastboot_unlock_critical(bin_path: Path) -> TerminalResponse:
"""Unlock critical the device with fastboot and without code."""
for line in run_command("fastboot flashing unlock_critical", bin_path):
yield line


@add_logging("OEM unlocking the device with fastboot.")
def fastboot_oem_unlock(bin_path: Path) -> TerminalResponse:
"""OEM unlock the device with fastboot and without code."""
Expand Down Expand Up @@ -485,7 +492,7 @@ def search_device(platform: str, bin_path: Path) -> Optional[str]:
else:
raise Exception(f"Unknown platform {platform}.")
device_code = output.split("[")[-1].strip()[:-1].strip()
logger.info(device_code)
logger.info(f"Found device code '{device_code}'")
return device_code
except CalledProcessError:
logger.error("Failed to detect a device.")
Expand Down
2 changes: 1 addition & 1 deletion openandroidinstaller/views/addon_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
FilePicker,
FilePickerResultEvent,
)
from flet.buttons import CountinuosRectangleBorder
from flet_core.buttons import CountinuosRectangleBorder

from styles import (
Text,
Expand Down
2 changes: 1 addition & 1 deletion openandroidinstaller/views/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(self, state: AppState, image: str = "placeholder.png"):
# left part of the display: used for displaying the images
self.left_view = Column(
width=self.column_width,
controls=[Image(src=f"/assets/imgs/{image}", height=600)],
controls=[Image(src=f"/imgs/{image}", height=600)],
expand=True,
horizontal_alignment="center",
)
Expand Down
2 changes: 1 addition & 1 deletion openandroidinstaller/views/requirements_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
TextButton,
AlertDialog,
)
from flet.buttons import CountinuosRectangleBorder
from flet_core.buttons import CountinuosRectangleBorder

from styles import (
Text,
Expand Down
2 changes: 1 addition & 1 deletion openandroidinstaller/views/select_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
FilePicker,
FilePickerResultEvent,
)
from flet.buttons import CountinuosRectangleBorder
from flet_core.buttons import CountinuosRectangleBorder

from styles import (
Text,
Expand Down
39 changes: 28 additions & 11 deletions openandroidinstaller/views/start_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# Author: Tobias Sterbak

import copy
import webbrowser
from loguru import logger
from typing import Callable

Expand All @@ -30,7 +31,7 @@
colors,
icons,
)
from flet.buttons import CountinuosRectangleBorder
from flet_core.buttons import CountinuosRectangleBorder

from styles import (
Text,
Expand Down Expand Up @@ -122,6 +123,13 @@ def check_bootloader_unlocked(e):
self.device_detection_infobox = Row(
[Text("Detected device:"), self.device_name]
)
self.device_request_row = Row([], alignment="center")
self.device_infobox = Column(
[
self.device_detection_infobox,
self.device_request_row,
]
)

def build(self):
self.clear()
Expand Down Expand Up @@ -162,6 +170,7 @@ def build(self):
Now
- **connect your device to this computer via USB** and
- **allow USB debugging in the pop-up on your phone**.
- You might also need to **activate "data transfer"** in the connection settings.
- Then **press the button 'Search device'**.
When everything works correctly you should see your device name here and you can continue.
Expand All @@ -176,17 +185,13 @@ def build(self):
),
Row([self.bootloader_switch]),
Divider(),
Column(
[
self.device_detection_infobox,
]
),
self.device_infobox,
Row(
[
self.back_button,
FilledButton(
"Search for device",
on_click=self.search_devices,
on_click=self.search_devices_clicked,
icon=icons.DEVICES_OTHER_OUTLINED,
expand=True,
tooltip="Search for a connected device.",
Expand All @@ -210,8 +215,9 @@ def close_developer_options_dlg(self, e):
self.dlg_help_developer_options.open = False
self.page.update()

def search_devices(self, e):
def search_devices_clicked(self, e):
"""Search the device when the button is clicked."""
self.device_request_row.controls.clear()
# search the device
if self.state.test:
# this only happens for testing
Expand Down Expand Up @@ -258,10 +264,21 @@ def search_devices(self, e):
if len(self.state.config.unlock_bootloader) == 0:
self.bootloader_switch.value = True
else:
# failed to load config
logger.error(f"Failed to load config for {device_code}.")
# failed to load config or device is not supported
logger.error(
f"Device with code '{device_code}' is not supported or the config is corrupted. Please check the logs for more information."
)
self.device_name.value = (
f"Failed to load config for device with code {device_code}."
f"Device with code '{device_code}' is not supported yet."
)
# add request support for device button
request_url = f"https://github.com/openandroidinstaller-dev/openandroidinstaller/issues/new?assignees=&labels=device&projects=&template=device-support-request.md&title=Add support for {device_code}"
self.device_request_row.controls.append(
ElevatedButton(
"Request support for this device",
icon=icons.PHONELINK_SETUP_OUTLINED,
on_click=lambda _: webbrowser.open(request_url),
)
)
self.device_name.color = colors.RED
self.view.update()
2 changes: 1 addition & 1 deletion openandroidinstaller/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def get_title(
content = Column(
controls=[
Image(
src=f"/assets/imgs/{step_indicator_img}",
src=f"/imgs/{step_indicator_img}",
fit="fitWidth",
tooltip=f"Current step: {title}",
width=600,
Expand Down
Loading

0 comments on commit f656346

Please sign in to comment.