Unverified Commit ca4249fe authored by Tobias Sterbak's avatar Tobias Sterbak Committed by GitHub
Browse files

Merge branch 'dev' into garden

parents f9351ddc 12e61ffd
......@@ -6,7 +6,7 @@ patreon: # Replace with a single Patreon username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
liberapay: OpenAndroidInstaller
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
......
......@@ -2,7 +2,7 @@
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
labels: 'bug'
assignees: ''
---
......
---
name: Device support request
about: Request support for a new device
title: ''
labels: ''
assignees: ''
---
**Device name**
Please enter the name of the device you would like to request support for.
If you know the device code, please also add it here.
**Device images**
Please provide links to any available images of the device, such as official stock firmware or custom ROMs you would like to install.
**Do you own the device and would be willing to test the installer?**
- [ ]
**Additional context**
Please provide any additional context or information that may be helpful in adding support for this device.
name: Device support request
description: Request support for a new device
title: Add support for <DEVICE>
labels: ["device"]
body:
- type: markdown
attributes:
value: "Thank you for your interest in OpenAndroidInstaller!"
- type: markdown
attributes:
value: "To get your device supported, please take the time to fill out this form."
- type: markdown
attributes:
value: "---"
- type: checkboxes
attributes:
label: Is your device already requested?
description: Please search to see if an issue for your device already exists.
options:
- label: I have searched the existing issues
required: true
- type: markdown
attributes:
value: "---"
- type: markdown
attributes:
value: "**Please input your device's details below:**"
- type: input
attributes:
label: Brand
description: The brand / manufacturer of your device
placeholder: Google
validations:
required: true
- type: input
attributes:
label: Name
description: The name of your device
placeholder: Pixel 3a
validations:
required: true
- type: input
attributes:
label: Device code
description: The device code OAI gave you in the error message
placeholder: sargo
validations:
required: true
- type: input
attributes:
label: Model
description: The model name of your device (only required, if there are several models)
placeholder: G020F
validations:
required: false
- type: markdown
attributes:
value: "---"
- type: textarea
attributes:
label: Device images
description: "Please provide links to any available images for the device, such as official stock firmware, Custom ROMs and Recoveries you would like to install."
placeholder: |
- Custom ROM: https://wiki.lineageos.org/devices/sargo
- Recovery: https://twrp.me/google/googlepixel3a.html
#value: |
# - Custom ROM:
# - Recovery:
# - Stock firmware (if needed & existing):
render: Markdown
validations:
required: false
- type: markdown
attributes:
value: "---"
- type: checkboxes
attributes:
label: Do you own the device and would be willing to test the installer?
options:
- label: I own the device and am willing to test the installer on it.
required: true
- type: markdown
attributes:
value: "---"
- type: textarea
attributes:
label: Additional context
description: Please provide any additional context or information that might be helpful in adding support for this device.
render: Markdown
......@@ -2,7 +2,7 @@
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
labels: 'enhancement'
assignees: ''
---
......
......@@ -14,8 +14,8 @@ jobs:
matrix:
os: ['ubuntu-20.04', 'ubuntu-latest']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.9
- run: pip install -r requirements.txt
......@@ -32,8 +32,8 @@ jobs:
matrix:
os: ['ubuntu-20.04', 'ubuntu-latest', 'macos-latest']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.9
- run: pip install -r requirements.txt
......@@ -48,8 +48,8 @@ jobs:
needs: ci
runs-on: 'windows-latest'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.9
- run: pip install -r requirements.txt
......@@ -66,7 +66,7 @@ jobs:
- build-windows
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v3
- name: Display structure of downloaded files
......@@ -86,7 +86,7 @@ jobs:
- name: Display structure of downloaded files
run: ls -R
- name: Create release
uses: marvinpinto/action-automatic-releases@latest
uses: dciborow/action-github-releases@v1.0.1
if: startsWith(github.ref, 'refs/tags/')
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
......
......@@ -13,8 +13,8 @@ jobs:
os: ['ubuntu-20.04', 'ubuntu-latest', 'macos-latest', 'windows-latest']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.9
- run: pip install -r requirements.txt
......
......@@ -27,20 +27,21 @@
</p>
</div>
> **Warning**: This application is currently in beta state, so use at your own risk! While many people tested the application so far and we heard of no bricked devices, things might still go wrong.
> **Note**: Unlocking the bootloader will erase all data on your device!
This also includes your DRM keys, which are stored in the Trim Area partition (also called TA) in case your device is fairly recent and supports DRM L1. Those devices will be downgraded to DRM L3. Devices on DRM L3 by default will not be affected.
Before proceeding, ensure the data you would like to retain is backed up to your PC and/or your Google account, or equivalent. Please note that OEM backup solutions like Samsung and Motorola backup may not be accessible from LineageOS once installed.
If you wish to backup the TA partition first, you can find tutorials related to your device on the internet.
> [!WARNING]
> This application is currently in beta state, so use at your own risk! While many people tested the application so far and we heard of no bricked devices, things might still go wrong.
> [!IMPORTANT]
> Unlocking the bootloader will erase all data on your device!
> This also includes your DRM keys, which are stored in the Trim Area partition (also called TA) in case your device is fairly recent and supports DRM L1. Those devices will be downgraded to DRM L3. Devices on DRM L3 by default will not be affected.
> Before proceeding, ensure the data you would like to retain is backed up to your PC and/or your Google account, or equivalent. Please note that OEM backup solutions like Samsung and Motorola backup may not be accessible from LineageOS once installed.
> If you wish to backup the TA partition first, you can find tutorials related to your device on the internet.
## Usage
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.
1. Download the [.exe or appropriate executable file for your OS](https://github.com/openandroidinstaller-dev/openandroidinstaller/releases) from the releases or get the [official flatpak from flathub](https://flathub.org/apps/org.openandroidinstaller.OpenAndroidInstaller). You might need to change permissions to run the executable.
- On Windows also [install the Universal USB Drivers](https://adb.clockworkmod.com/) and other potentially drivers needed for your device.
- On Windows also [install the Universal USB Drivers](https://adb.clockworkmod.com) and other potentially drivers needed for your device.
2. Download the custom ROM image and the TWRP recovery image for your device and optionally some addons. A source for files can be found on the following websites:
- some custom ROMs:
- [LineageOS](https://wiki.lineageos.org/devices)
......@@ -82,11 +83,12 @@ 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 S5 | [klte](https://wiki.lineageos.org/devices/klte) | G900F/M/R4/R7/T/V/W8 | tested
Samsung | Galaxy S6 | [zerofltexx](https://wiki.lineageos.org/devices/zerofltexx) | | tested
Samsung | Galaxy S6 Edge | [zeroltexx](https://wiki.lineageos.org/devices/zeroltexx) | | tested
Samsung | Galaxy S7 | [herolte](https://wiki.lineageos.org/devices/herolte) | SM-G930F | tested
Samsung | Galaxy S7 Edge | [hero2lte](https://wiki.lineageos.org/devices/hero2lte) | | tested
Samsung | Galaxy S8 | [dreamlte](https://wiki.lineageos.org/devices/dreamlte) | | tested
Samsung | Galaxy S8 | dreamlte | | tested
Samsung | Galaxy S9 | [starlte](https://wiki.lineageos.org/devices/starlte) | | tested
Samsung | Galaxy S10 | [beyond1lte](https://wiki.lineageos.org/devices/beyond1lte) | | tested
Samsung | Galaxy S10e | [beyond0lte](https://wiki.lineageos.org/devices/beyond0lte) | | tested
......@@ -173,21 +175,15 @@ OnePlus | 9 | lemonade | | under development
Vendor | Device Name | CodeName | Models | Status
---|---|---|---|---
Xiaomi | Redmi Note 7 | [lavender](https://wiki.lineageos.org/devices/lavender) | | tested
Xiaomi | Redmi 7A / 8 / 8A / 8A Dual | [Mi439](https://wiki.lineageos.org/devices/Mi439) : pine / olive / olivelite / olivewood | | tested
Xiaomi | Redmi Note 8 / 8T | [ginkgo](https://wiki.lineageos.org/devices/ginkgo) / willow | | untested
Xiaomi | Redmi 9A / 9C / 9AT / 9i / 9A Sport / 10A / 10A Sport | garden / dandelion / blossom / angelican | | tested
</details>
And more to come!
## Run OpenAndroidInstaller for development
Currently development is only supported on Ubuntu Linux. MacOS and Windows should also work fine. You might need to install additional USB-drivers on Windows.
1. Clone the main branch of this repository
2. Run `make poetry` and `make install` to install poetry to manage python and install the required dependencies like adb, fastboot and heimdall.
3. Run `make app` to start the desktop app from the source.
## Contributing
All kinds of contributions are welcome. These include:
......@@ -199,62 +195,17 @@ All kinds of contributions are welcome. These include:
- Add features and/or improve the code base.
- Report bugs.
More details on how to contribute can be found [here](https://github.com/openandroidinstaller-dev/openandroidinstaller/blob/main/CONTRIBUTING.md).
Please have a look before opening an issue or starting to contribute.
A detailed list can be found [here](https://openandroidinstaller.org/#contribute).
### How to contribute your own installation configurations
If you want to use the tool for a non-supported smartphone, the fastest way is to adapt an [existing config file](https://github.com/openandroidinstaller-dev/openandroidinstaller/tree/main/openandroidinstaller/assets/configs). The file should be named after the official `device code` of the device. Add the code output by `adb shell getprop | grep ro.product.device` (when the devices is connected to the computer) as well as the official device code to the `supported_device_codes` list in the config. You can also get the device code by connecting the device to the computer and run OpenAndroidInstaller to detect the device.
[How to contribute your own installation configurations](https://github.com/openandroidinstaller-dev/openandroidinstaller/blob/main/docs/how_to_contribute_your_own_installation_configurations.md)
**To test your config file with the executable** without using the developer setup, place it in the same directory as the executable. There it will be detected by name. After you created a config file and it works fine, you can open a pull request to make the file available to other users. Please also add the device to the supported devices table above.
[How to build the application for your platform](https://github.com/openandroidinstaller-dev/openandroidinstaller/blob/main/docs/building_the_application_for_your_platform.md)
#### Content of a config file
[On unlocking the bootloader](https://github.com/openandroidinstaller-dev/openandroidinstaller/blob/main/docs/unlocking_the_bootloader.md)
A config file consists of two parts. The first part are some metadata about the device and the second parts are the steps to unlock the bootloader, boot a recovery and install the ROMs.
##### How to write Metadata
Every config file should have `metadata` with the following fields:
- `maintainer`: str; Maintainer and author of the config file.
- `device_name`: str; Name of the device.
- `is_ab_device`: bool; A boolean to determine if the device is a/b-partitioned or not.
- `device_code`: str; The official device code.
- `supported_device_codes`: List[str]; A list of supported device codes for the config. The config will be loaded based on this field.
- `twrp-link`: [OPTIONAL] str; name of the corresponding twrp page.
In addition to these metadata, every config can have optional `requirements`. If these are set, the user is asked to check if they are meet.
- `android`: [OPTIONAL] int|str; Android version to install prior to installing a custom ROM.
- `firmware`: [OPTIONAL] str; specific firmware version to install before installing a custom ROM.
##### How to write steps:
Every step in the config file corresponds to one view in the application. These steps should contain the following fields:
- `type`: str; Corresponds to the type of view to generate. There are the following options:
- `text`: Just display the text given in content.
- `confirm_button`: Display the content, as well as a button to allow the user to go to the next step.
- `call_button`: Display the content text and a button that runs a given command. After the command is run, a confirm button is displayed to allow the user to move to the next step.
- `call_button_with_input`: Display the content text, an input field and a button that runs a given command. The inputtext, can be used in the command by using the `<inputtext>` placeholder in the command field. After the command is run, a confirm button is displayed to allow the user to move to the next step.
- `link_button_with_confirm`: Display a button that opens a browser with a given link, confirm afterwards. Link is given in `link`.
- `img`: [OPTIONAL] Display an image on the left pane of the step view. Images are loaded from `openandroidinstaller/assets/imgs/`.
- `content`: str; The content text displayed alongside the action of the step. Used to inform the user about what's going on. For consistency and better readability the text should be moved into the next line using `>`.
- `link`: [OPTIONAL] Link to use for the link button if type is `link_button_with_confirm`.
- `command`: [ONLY for call_button* steps] str; The command to run. One of `adb_reboot`, `adb_reboot_bootloader`, `adb_reboot_download`, `adb_sideload`, `adb_twrp_wipe_and_install`, `adb_twrp_copy_partitions`, `fastboot_boot_recovery`, `fastboot_unlock_with_code`, `fastboot_unlock`, `fastboot_oem_unlock`, `fastboot_get_unlock_data`, `fastboot_reboot`, `heimdall_flash_recovery`.
- `allow_skip`: [OPTIONAL] boolean; If a skip button should be displayed to allow skipping this step. Can be useful when the bootloader is already unlocked.
**Please try to retain this order of these fields in your config to ensure consistency.**
## How to build the application for your platform
The executables for the OpenAndroidInstaller are build with [pyinstaller](https://pyinstaller.org/en/stable/index.html). You can create builds for MacOS or Linux with `make build-app`. For Windows the paths need to be modified. For now, you can have a look [here](https://github.com/openandroidinstaller-dev/openandroidinstaller/blob/v0.1.2-alpha/.github/workflows/manual-build-windows.yml#L22) on how it's done.
If you build the application for your platform and want to contribute the build, please reach out to me.
#### On unlocking the bootloader
Devices by *Samsung*, *Google* and *Fairphone* make it fairly easy to unlock the bootloader and receive good support in the installer.
More details on how to contribute can be found [here](https://github.com/openandroidinstaller-dev/openandroidinstaller/blob/main/CONTRIBUTING.md).
Please have a look before opening an issue or starting to contribute.
Some devices with require manual steps to unlock the bootloader. In general you will need to create an account at a vendor website and receive some code from there. OpenAndroidInstaller will try to guide you as far as possible. These vendors include *Sony, Motorola, Xiaomi* and *OnePlus* among others.
A detailed list can be found [here](https://openandroidinstaller.org/#contribute).
Other phone vendors stops allowing to unlock the bootloader all together. There is nothing to be done if you didn't unlock your device in time. These vendors include *Huawei and LG* among others. Support for these vendors will always be very limited.
## Tools
......
## How to build the application for your platform
The executables for the OpenAndroidInstaller are build with [pyinstaller](https://pyinstaller.org/en/stable/index.html). You can create builds for MacOS or Linux with `make build-app`. For Windows the paths need to be modified. For now, you can have a look [here](https://github.com/openandroidinstaller-dev/openandroidinstaller/blob/v0.1.2-alpha/.github/workflows/manual-build-windows.yml#L22) on how it's done.
If you build the application for your platform and want to contribute the build, please reach out to me.
## Run OpenAndroidInstaller for development
Currently development is only supported on Ubuntu Linux. MacOS and Windows should also work fine. You might need to install additional USB-drivers on Windows.
1. Clone the main branch of this repository
2. Run `make poetry` and `make install` to install poetry to manage python and install the required dependencies like adb, fastboot and heimdall.
3. Run `make app` to start the desktop app from the source.
### How to contribute your own installation configurations
If you want to use the tool for a non-supported smartphone, the fastest way is to adapt an [existing config file](https://github.com/openandroidinstaller-dev/openandroidinstaller/tree/main/openandroidinstaller/assets/configs). The file should be named after the official `device code` of the device. Add the code output by `adb shell getprop | grep ro.product.device` (when the devices is connected to the computer) as well as the official device code to the `supported_device_codes` list in the config. You can also get the device code by connecting the device to the computer and run OpenAndroidInstaller to detect the device.
**To test your config file with the executable** without using the developer setup, place it in the same directory as the executable. There it will be detected by name. After you created a config file and it works fine, you can open a pull request to make the file available to other users. Please also add the device to the supported devices table above.
#### Content of a config file
A config file consists of two parts. The first part are some metadata about the device and the second parts are the steps to unlock the bootloader, boot a recovery and install the ROMs.
##### How to write Metadata
Every config file should have `metadata` with the following fields:
- `maintainer`: str; Maintainer and author of the config file.
- `device_name`: str; Name of the device.
- `brand`: [OPTIONAL] str; Name of the brand. Can be used to make brand specific actions.
- `is_ab_device`: bool; A boolean to determine if the device is a/b-partitioned or not.
- `device_code`: str; The official device code.
- `supported_device_codes`: List[str]; A list of supported device codes for the config. The config will be loaded based on this field.
- `twrp-link`: [OPTIONAL] str; name of the corresponding twrp page.
- `additional_steps` : [OPTIONAL] List[str]; A list of additional steps. Can be `dtbo`, `vbmeta`, `vendor_boot` or `super_empty`.
- `notes`: [OPTIONAL] List[str]; specific phone information, showed before choosing ROM / recovery
- `untested`: [OPTIONAL] bool; If `true`, a warning message is showed during installation process.
In addition to these metadata, every config can have optional `requirements`. If these are set, the user is asked to check if they are meet.
- `android`: [OPTIONAL] int|str; Android version to install prior to installing a custom ROM.
- `firmware`: [OPTIONAL] str; specific firmware version to install before installing a custom ROM.
##### How to write steps:
Every step in the config file corresponds to one view in the application. These steps should contain the following fields:
- `type`: str; Corresponds to the type of view to generate. There are the following options:
- `text`: Just display the text given in content.
- `confirm_button`: Display the content, as well as a button to allow the user to go to the next step.
- `call_button`: Display the content text and a button that runs a given command. After the command is run, a confirm button is displayed to allow the user to move to the next step.
- `call_button_with_input`: Display the content text, an input field and a button that runs a given command. The inputtext, can be used in the command by using the `<inputtext>` placeholder in the command field. After the command is run, a confirm button is displayed to allow the user to move to the next step.
- `link_button_with_confirm`: Display a button that opens a browser with a given link, confirm afterwards. Link is given in `link`.
- `img`: [OPTIONAL] Display an image on the left pane of the step view. Images are loaded from `openandroidinstaller/assets/imgs/`.
- `content`: str; The content text displayed alongside the action of the step. Used to inform the user about what's going on. For consistency and better readability the text should be moved into the next line using `>`.
- `link`: [OPTIONAL] Link to use for the link button if type is `link_button_with_confirm`.
- `command`: [ONLY for call_button* steps] str; The command to run. One of `adb_reboot`, `adb_reboot_bootloader`, `adb_reboot_download`, `adb_sideload`, `adb_twrp_wipe_and_install`, `adb_twrp_copy_partitions`, `fastboot_boot_recovery`, `fastboot_flash_recovery`, `fastboot_reboot_recovery`, `fastboot_flash_additional_partitions`, `fastboot_unlock_with_code`, `fastboot_unlock`, `fastboot_unlock_critical`, `fastboot_oem_unlock`, `fastboot_get_unlock_data`, `fastboot_reboot`, `heimdall_flash_recovery`.
- `allow_skip`: [OPTIONAL] boolean; If a skip button should be displayed to allow skipping this step. Can be useful when the bootloader is already unlocked.
**Please try to retain this order of these fields in your config to ensure consistency.**
#### On unlocking the bootloader
First of all, this tool will not help you bypass any vender locked bootloaders in non-official ways.
Devices by *Samsung, Google, OnePlus, Fairphone* and others make it relatively easy to unlock the bootloader and get good support in the installer.
For some devices, it is necessary to unlock the bootloader manually. You usually need to create an account on the manufacturer's website, wait for a certain time and obtain a code from there. OpenAndroidInstaller will try to guide you as far as possible. These vendors include *Sony, Motorola and Xiaomi* amongst others.
Other phone manufacturers no longer allow you to unlock the bootloader. Nothing can be done if you have not unlocked your device in time. These manufacturers include *Huawei, Honor, LG and ASUS*. Support for these manufacturers will always be very limited.
<details>
<summary>
<b>Here is a brief overview of the bootloader policies of some of the most popular brands (may be incomplete/inaccurate)</b>
</summary>
| Brand | Flashing tool | Unlocking Method | Loss of guarantee\* | Supported models |
|---|---|---|---|---|
| Google | Fastboot | OEM/Flashing unlock | No | Pixel and Nexus |
| Samsung | ODIN or Heimdall | Download mode | **Yes** | Galaxy S and A series<br>(Increasing complexity **on and after S10**) |
| OnePlus | Fastboot | OEM/Flashing unlock | No | All |
| Fairphone | Fastboot | [Code from manufacturer](https://support.fairphone.com/hc/en-us/articles/10492476238865-Manage-the-Bootloader)<br>(**Already unlocked until FP2**) | No | All |
| Xiaomi | Fastboot | [Mi Unlock Tool](https://new.c.mi.com/global/post/101245) | **Yes** | Mi 4c, Redmi Note 3, Mi Note Pro, Redmi 3, Mi 4S, Mi 5 and all devices from 2016 onwards |
| Motorola | Fastboot | [Code from manufacturer](https://en-us.support.motorola.com/app/standalone/bootloader/unlock-your-device-a) | **Yes** | Almost all **except** carrier specific models (e.g. Verizon, AT&T, Tracfone) and certain other models |
| Sony | Fastboot | [Code from manufacturer](https://developer.sony.com/open-source/aosp-on-xperia-open-devices/get-started/unlock-bootloader) | **Yes** | All **except** XQ-CT62 (1Ⅳ US) & XQ-CQ62 (5Ⅳ US) |
| Huawei | Fastboot | No official codes since 2017/2018<br>(**Unofficial methods available**) | **Yes** | Mate 9/9Pro, P10/P10Plus |
| Honor | Fastboot | No official codes since 2017/2018<br>(**Unofficial methods available**) | **Yes** | Honor 8 |
| LG | Fastboot | Impossible since December 2021 | **Yes** | |
| ASUS | Fastboot | Impossible since May 2023 (ASUS unlocking App) | **Yes** | |
**\*** In the EU you won't loose your standard 2 years of the warranty when you unlock your bootloader, flash your device or root it. ([source](https://forum.xda-developers.com/t/info-eu-rooting-and-flashing-dont-void-the-warranty.1998801/))
</details>
<br>
You can find more information about the brands and their bootloader policies [here](https://wikilibriste.fr/fr/tutoriels-android/bootloader-unlock) (in French).
......@@ -16,8 +16,9 @@
import copy
from pathlib import Path
from typing import List, Optional
from loguru import logger
from installer_config import _load_config
from installer_config import _load_config, Step
class AppState:
......@@ -37,6 +38,10 @@ class AppState:
self.test = test
self.test_config = test_config
# store state
self.unlock_bootloader = True
self.flash_recovery = True
# placeholders
self.advanced = False
self.install_addons = False
......@@ -44,6 +49,9 @@ class AppState:
self.config = None
self.image_path = None
self.recovery_path = None
self.dtbo_path = None
self.vbmeta_path = None
self.super_empty_path = None
# store views
self.default_views: List = []
......@@ -69,3 +77,48 @@ class AppState:
self.steps = copy.deepcopy(self.config.unlock_bootloader) + copy.deepcopy(
self.config.boot_recovery
)
def toggle_flash_unlock_bootloader(self):
"""Toggle flashing of unlock bootloader."""
self.unlock_bootloader = not self.unlock_bootloader
if self.unlock_bootloader:
logger.info("Enabled unlocking the bootloader again.")
self.steps = copy.deepcopy(self.config.unlock_bootloader)
else:
logger.info("Skipping bootloader unlocking.")
self.steps = []
# if the recovery is already flashed, skip flashing it again
if self.flash_recovery:
self.steps += copy.deepcopy(self.config.boot_recovery)
else:
self.steps = [
Step(
title="Boot custom recovery",
type="confirm_button",
content="If you already flashed TWRP, boot into it by pressing 'Confirm and run'. Otherwise restart the process. Once your phone screen looks like the picture on the left, continue.",
command="adb_reboot_recovery",
img="twrp-start.jpeg",
)
]
def toggle_flash_recovery(self):
"""Toggle flashing of recovery."""
self.flash_recovery = not self.flash_recovery
if self.unlock_bootloader:
self.steps = copy.deepcopy(self.config.unlock_bootloader)
else:
self.steps = []
if self.flash_recovery:
logger.info("Enabled flashing recovery again.")
self.steps += copy.deepcopy(self.config.boot_recovery)
else:
logger.info("Skipping flashing recovery.")
self.steps = [
Step(
title="Boot custom recovery",
type="call_button",
content="If you already flashed TWRP, boot into it by pressing 'Confirm and run'. Otherwise restart the process. Once your phone screen looks like the picture on the left, continue.",
command="adb_reboot_recovery",
img="twrp-start.jpeg",
)
]
metadata:
maintainer: A non (anon)
brand: xiaomi
device_name: Xiaomi Redmi 7A / 8 / 8A / 8A Dual
is_ab_device: false
device_code: Mi439
additional_steps:
- dtbo
- vbmeta
- super_empty
supported_device_codes:
- Mi439
- mi439
- pine
- olive
- olivelite
- olivewood
notes:
- Be careful when choosing OrangeFox version, Android 12 & 13 ROM needs OrangeFox version code with `A12`, for example `R11.1_5_A12`. Android 10 & 11 ROM needs OrangeFox version code without `A12` (bellow on the page)
requirements:
firmware: MiUI 12.5 (Q)
steps:
unlock_bootloader:
- type: confirm_button
content: >
As a first step, you need to unlock 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. This will reset your phone.
- type: link_button_with_confirm
content: >
- Create a Mi account on Xiaomi’s website. Beware that one account is only allowed to unlock one unique device every 30 days.
- Add a phone number to your Mi account, insert a SIM into your phone.
- Enable developer options in `Settings` > `About Phone` by repeatedly tapping MIUI Version.
- Link the device to your Mi account in `Settings` > `Additional settings` > `Developer options` > `Mi Unlock status`.
- Download the Mi Unlock app with the link bellow (Windows is required to run the app), and follow the instructions provided by the app. It may tell you that you have to wait, usually 7 days. If it does so, please wait the quoted amount of time before continuing to the next step!
- After device and Mi account are successfully verified, the bootloader should be unlocked.
- Since the device resets completely, you will need to re-enable USB debugging to continue : `Settings` > `Additional settings` > `Developer options` > `USB debugging`
link: https://en.miui.com/unlock/download_en.html
boot_recovery:
- type: call_button
content: >
Now you need to install a custom recovery system on the phone. A recovery is a small subsystem on your phone,
that manages updating, adapting and repairing of the operating system.
Once the device is fully booted, you need to reboot into the bootloader again by pressing 'Confirm and run' here. Then continue.
command: adb_reboot_bootloader
- type: call_button
content: >
Install additional partitions selected before by pressing 'Confirm and run'. Once it's done continue.
Note : If you have not selected this partition, it will do nothing.
command: fastboot_flash_additional_partitions
- type: call_button
content: >
Install the recovery you chosen before by pressing 'Confirm and run'. Once it's done continue.
command: fastboot_flash_recovery
- type: call_button
img: ofox.png
content: >
Reboot to recovery by pressing 'Confirm and run', and hold the Vol+ button of your phone UNTIL you see the recovery.
If MiUI starts, you have to start the process again, since MiUI delete the recovery you just flashed.
Once it's done continue.
command: fastboot_reboot_recovery
\ No newline at end of file
......@@ -5,6 +5,7 @@ metadata:
device_code: a5y17lte
supported_device_codes:
- a5y17lte
- a5y17ltecan
steps:
unlock_bootloader:
boot_recovery:
......
......@@ -4,7 +4,8 @@ metadata:
is_ab_device: false
device_code: beyond0lte
supported_device_codes:
- beyond0lte
- beyond0lte
- beyond0
requirements:
android: 12
steps:
......
......@@ -4,7 +4,8 @@ metadata:
is_ab_device: false
device_code: beyond1lte
supported_device_codes:
- beyond1lte
- beyond1lte
- beyond1
requirements:
android: 12
steps:
......
......@@ -7,18 +7,20 @@ metadata:
- dreamlte
twrp-link: dreamlte
requirements:
android: "9.0"
android: 9
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 who to start and run an operating system (like Android). Your device should be turned on.
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 boot a custom recovery on your device. Press 'Confirm and run' to start the process. Confirm afterwards to continue.
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-bixby.png
......
metadata:
maintainer: A non (anon)
brand: xiaomi
device_name: Xiaomi Redmi Note 8 / 8T
is_ab_device: false
device_code: ginkgo
supported_device_codes:
- ginkgo
- willow
untested: true
notes:
- You should install Android 10 or newer ROM.
requirements:
android: 10 (Q)
steps:
unlock_bootloader:
- type: confirm_button
content: >
As a first step, you need to unlock 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. This will reset your phone.
- type: link_button_with_confirm
content: >
- Create a Mi account on Xiaomi’s website. Beware that one account is only allowed to unlock one unique device every 30 days.
- Add a phone number to your Mi account, insert a SIM into your phone.
- Enable developer options in `Settings` > `About Phone` by repeatedly tapping MIUI Version.
- Link the device to your Mi account in `Settings` > `Additional settings` > `Developer options` > `Mi Unlock status`.
- Download the Mi Unlock app with the link bellow (Windows is required to run the app), and follow the instructions provided by the app. It may tell you that you have to wait, usually 7 days. If it does so, please wait the quoted amount of time before continuing to the next step!
- After device and Mi account are successfully verified, the bootloader should be unlocked.
- Since the device resets completely, you will need to re-enable USB debugging to continue : `Settings` > `Additional settings` > `Developer options` > `USB debugging`
link: https://en.miui.com/unlock/download_en.html
boot_recovery:
- type: confirm_button
content: >
Now you need to boot a custom recovery system on the phone. A recovery is a small subsystem on your phone, that manages updating,
adapting and repairing of the operating system.
- type: call_button
content: >
Once the device is fully booted, you need to reboot into the bootloader again by pressing 'Confirm and run' here. Then continue.
command: adb_reboot_bootloader
- type: call_button
content: >
Install the recovery you chosen before by pressing 'Confirm and run'. Once it's done continue.
command: fastboot_flash_recovery
- type: call_button
img: ofox.png
content: >
Reboot to recovery by pressing 'Confirm and run', and hold the Vol+ button of your phone UNTIL you see the recovery.
If MiUI starts, you have to start the process again, since MiUI delete the recovery you just flashed.
Once it's done continue.
command: fastboot_reboot_recovery
\ No newline at end of file
......@@ -14,11 +14,13 @@ steps:
- 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 who to start and run an operating system (like Android). Your device should be turned on.
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 boot a custom recovery on your device. Press 'Confirm and run' to start the process. Confirm afterwards to continue.
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
......
metadata:
maintainer: Tobias Sterbak (tsterbak)
device_name: Samsung Galaxy S5 LTE
is_ab_device: false
device_code: klte
supported_device_codes:
- klte
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*.
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment