From fdc137246da11188625c276447c81566cc1045b2 Mon Sep 17 00:00:00 2001 From: Tobias Sterbak Date: Tue, 15 Nov 2022 11:44:32 +0100 Subject: [PATCH 1/3] Add preliminary config for Samsung Galaxy S III Neo (s3ve3g) --- .../assets/configs/s3ve3g.yaml | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 openandroidinstaller/assets/configs/s3ve3g.yaml diff --git a/openandroidinstaller/assets/configs/s3ve3g.yaml b/openandroidinstaller/assets/configs/s3ve3g.yaml new file mode 100644 index 00000000..c0e753d1 --- /dev/null +++ b/openandroidinstaller/assets/configs/s3ve3g.yaml @@ -0,0 +1,45 @@ +metadata: + maintainer: Tobias Sterbak (tsterbak) + devicename: Samsung Galaxy S III Neo + devicecode: s3ve3g +steps: + unlock_bootloader: + flash_recovery: + - type: confirm_button + content: > + There are two possible hardware configurations of this phone regardless of model number. Some phones were released with a Sony IMX 175 rear camera sensor, while others with a Samsung s5k4h5yb rear camera sensor. As such, we’ve separated this devices builds into two separate builds. The procedure to distinguish which to use is as follows: + + - Make sure to be on the latest stock firmware of your variant (you can check updates with Settings, Updates); + + - Make sure the rear camera is working on the stock ROM; + + - Open the phone app and dial *#*#34971539#*#* to access to the hidden menu; + - Tap on ‘Phone/Cam FW Check’ and take note of the numbers shown in the notification: + - For E08QT, install the s3ve3gjv builds + - For B08QT, install the s3ve3gxx builds + I you are not sure what you used, you can safely restart here and pick the correct image and 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. + 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*. Confirm when the recovery screen appears. + install_os: + - type: call_button + content: > + In the next steps, you finally flash the selected OS image. + Connect your device with your computer with the USB-Cable. + This step will format your phone and wipe all the data. It will also remove encryption and delete all files stored + in the internal storage. Then the OS image will be installed. Confirm to run. This might take a while. At the end your phone will boot into the new OS. + command: adb_twrp_wipe_and_install \ No newline at end of file From 81fce3a4671d580f39562118d3375e7b9022fe31 Mon Sep 17 00:00:00 2001 From: Tobias Sterbak Date: Tue, 15 Nov 2022 12:15:06 +0100 Subject: [PATCH 2/3] Update readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 37c8ab5a..3315eab4 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ If you wish to backup the TA partition first, you can find tutorials related to Vendor | Device Name | CodeName | Models | Status ---|---|---|---|--- Samsung | Galaxy A3 2017 | a3y17lte | SM-A320FL | tested +Samsung | Galaxy S III Neo | s3ve3g | GT-I9301I | under development Samsung | Galaxy A5 2016 | a5xelte | SM-A510F | tested Samsung | Galaxy S7 | herolte | SM-G930F | tested Samsung | Galaxy S9 | starlte | | under development From 176ffa52a6abf31cd314296539e135588d00b37a Mon Sep 17 00:00:00 2001 From: Tobias Sterbak Date: Thu, 9 Feb 2023 18:10:16 +0000 Subject: [PATCH 3/3] Allow to add a specific link to a twrp page for the download button to config --- README.md | 14 ++++++++++++++ .../assets/configs/cheeseburger.yaml | 1 + openandroidinstaller/assets/configs/dumpling.yaml | 1 + openandroidinstaller/installer_config.py | 2 ++ openandroidinstaller/views/select_view.py | 3 ++- 5 files changed, 20 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0538dadc..50e00d32 100644 --- a/README.md +++ b/README.md @@ -179,6 +179,20 @@ If you want to use the tool for a non-supported smartphone, the fastest way is t #### 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, flash 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. +- `devicename`: str; Name of the device. +- `devicecode`: str; The official device code. +- `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. diff --git a/openandroidinstaller/assets/configs/cheeseburger.yaml b/openandroidinstaller/assets/configs/cheeseburger.yaml index f162ed98..2c708d41 100644 --- a/openandroidinstaller/assets/configs/cheeseburger.yaml +++ b/openandroidinstaller/assets/configs/cheeseburger.yaml @@ -2,6 +2,7 @@ metadata: maintainer: SirRGB devicename: OnePlus 5 devicecode: cheeseburger + twrp-link: cheeseburger_dumpling steps: unlock_bootloader: - type: call_button diff --git a/openandroidinstaller/assets/configs/dumpling.yaml b/openandroidinstaller/assets/configs/dumpling.yaml index c52e87df..78626267 100644 --- a/openandroidinstaller/assets/configs/dumpling.yaml +++ b/openandroidinstaller/assets/configs/dumpling.yaml @@ -2,6 +2,7 @@ metadata: maintainer: SirRGB devicename: OnePlus 5T devicecode: dumpling + twrp-link: cheeseburger_dumpling steps: unlock_bootloader: - type: call_button diff --git a/openandroidinstaller/installer_config.py b/openandroidinstaller/installer_config.py index 38b876ba..4fb8580c 100644 --- a/openandroidinstaller/installer_config.py +++ b/openandroidinstaller/installer_config.py @@ -81,6 +81,7 @@ def __init__( self.metadata = metadata self.requirements = requirements self.device_code = metadata.get("devicecode") + self.twrp_link = metadata.get("twrp-link") inverted_mapping = dict(map(reversed, self.device_code_mapping.items())) self.alternative_device_code = inverted_mapping.get( self.device_code, self.device_code @@ -175,6 +176,7 @@ def validate_config(config: str) -> bool: "maintainer": str, "devicename": str, "devicecode": str, + schema.Optional("twrp-link"): str, }, schema.Optional("requirements"): { schema.Optional("android"): schema.Or(str, int), diff --git a/openandroidinstaller/views/select_view.py b/openandroidinstaller/views/select_view.py index e3c6c35d..705880b9 100644 --- a/openandroidinstaller/views/select_view.py +++ b/openandroidinstaller/views/select_view.py @@ -145,6 +145,7 @@ def build(self): self.info_field = Row() # if there is an available download, show the button to the page if self.download_link: + twrp_download_link = f"https://dl.twrp.me/{self.state.config.twrp_link if self.state.config.twrp_link else self.state.config.device_code}" self.right_view.controls.append(Divider()) self.right_view.controls.append( Column( @@ -166,7 +167,7 @@ def build(self): "Download TWRP recovery", icon=icons.DOWNLOAD_OUTLINED, on_click=lambda _: webbrowser.open( - f"https://dl.twrp.me/{self.state.config.device_code}" + twrp_download_link ), expand=True, ),