From a5841f5626673d84bf72f36efcb96dec2ac21e50 Mon Sep 17 00:00:00 2001 From: frankpreel Date: Thu, 30 Mar 2023 10:15:41 +0200 Subject: [PATCH 1/6] Backend redfin --- src/main/java/ecorp/easy/installer/helpers/DeviceHelper.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/ecorp/easy/installer/helpers/DeviceHelper.java b/src/main/java/ecorp/easy/installer/helpers/DeviceHelper.java index eecdce9e..7587fe54 100644 --- a/src/main/java/ecorp/easy/installer/helpers/DeviceHelper.java +++ b/src/main/java/ecorp/easy/installer/helpers/DeviceHelper.java @@ -64,6 +64,7 @@ public class DeviceHelper { put("FP4", "0019"); put("OnePlus8Pro", "0021"); put("OnePlusNord", "0022"); //avicii + put("redfin", "0023"); }}; /** -- GitLab From b52ea118ab7e37ab28e6019a8ac8ac28df09238d Mon Sep 17 00:00:00 2001 From: frankpreel Date: Thu, 30 Mar 2023 10:16:09 +0200 Subject: [PATCH 2/6] Redfin model scripts and resources --- flash-scripts/linux/install-recovery-boot.sh | 39 +++++ flash-scripts/linux/pixel-flashingLock.sh | 76 ++++++++ .../linux/pixel-flashingUnlock-noreboot.sh | 65 +++++++ .../windows/install-recovery-boot.bat | 36 ++++ flash-scripts/windows/pixel-flashingLock.bat | 70 ++++++++ .../windows/pixel-flashingUnlock-noreboot.bat | 63 +++++++ src/main/resources/yaml/redfin_flash.yml | 162 ++++++++++++++++++ src/main/resources/yaml/redfin_fs.yml | 27 +++ 8 files changed, 538 insertions(+) create mode 100644 flash-scripts/linux/install-recovery-boot.sh create mode 100644 flash-scripts/linux/pixel-flashingLock.sh create mode 100644 flash-scripts/linux/pixel-flashingUnlock-noreboot.sh create mode 100644 flash-scripts/windows/install-recovery-boot.bat create mode 100644 flash-scripts/windows/pixel-flashingLock.bat create mode 100644 flash-scripts/windows/pixel-flashingUnlock-noreboot.bat create mode 100644 src/main/resources/yaml/redfin_flash.yml create mode 100644 src/main/resources/yaml/redfin_fs.yml diff --git a/flash-scripts/linux/install-recovery-boot.sh b/flash-scripts/linux/install-recovery-boot.sh new file mode 100644 index 00000000..6d459ce2 --- /dev/null +++ b/flash-scripts/linux/install-recovery-boot.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# Copyright (C) 2022-23 ECORP SAS - Author: Frank +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Parameter +# $1: TWRP_IMAGE_PATH need twrp path (${TWRP_FOLDER}/${TWRP}) +# $2: The folder where heimdall runnable is stored + +# Exit status +# - 0 : Recovery installed +# - 1 : No problems occurred (heimdall returns only 1 if an error occurs) +# - 101 : TWRP_IMAGE_PATH missing + +TWRP_IMAGE_PATH=$1 +FASTBOOT_FOLDER_PATH=$2 +FASTBOOT_PATH=${FASTBOOT_FOLDER_PATH}"fastboot" + +echo "fastboot path: $FASTBOOT_PATH" + +if [ -z "$TWRP_IMAGE_PATH" ] +then + echo "TWRP Image path is empty" + exit 101 +fi + +"$FASTBOOT_PATH" flash vendor_boot "$TWRP_IMAGE_PATH" \ No newline at end of file diff --git a/flash-scripts/linux/pixel-flashingLock.sh b/flash-scripts/linux/pixel-flashingLock.sh new file mode 100644 index 00000000..c56a36e0 --- /dev/null +++ b/flash-scripts/linux/pixel-flashingLock.sh @@ -0,0 +1,76 @@ +#!/bin/bash + +# Copyright (C) 2022 ECORP SAS - Author: Frank Preel +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Parameter +# $1: device id +# $2: fastboot folder path +# $3: Image to flash + +# Exit status +# - 0 : bootloader locked +# - 1 : unknown error +# - 2 : Flashing unlocked failed +# - 101 : $DEVICE_ID missing +# - 102 : $FASTBOOT_FOLDER_PATH is missing +# - 103 : $E_IMAGE_PATH is missing + +DEVICE_ID=$1 +FASTBOOT_FOLDER_PATH=$2 + +# check serial number has been provided +if [ -z "$DEVICE_ID" ] +then + exit 101 +fi + +# Check fastboot parent folder path has been provided +if [ -z "$FASTBOOT_FOLDER_PATH" ] +then + exit 102 +fi + +if [ -z "$E_IMAGE_PATH" ] +then + exit 103 +fi + +# Build fastboot path +FASTBOOT_PATH=${FASTBOOT_FOLDER_PATH}"fastboot" + +$FASTBOOT_PATH erase avb_custom_key +$FASTBOOT_PATH flash avb_custom_key "$E_IMAGE_PATH" + + +if [ "$($FASTBOOT_PATH getvar locked 2>&1 | grep -q yes; echo $?)" = 1 ] +then + # Unlock bootloader + if ! "$FASTBOOT_PATH" -s "$DEVICE_ID" flashing unlock + then + exit 2 + fi +else + exit 0 +fi + +while [ "$($FASTBOOT_PATH getvar unlocked 2>&1 | grep -q yes; echo $?)" = 1 ] +do + echo "locked" + sleep 1 +done + +echo "unlock.." +sleep 1 diff --git a/flash-scripts/linux/pixel-flashingUnlock-noreboot.sh b/flash-scripts/linux/pixel-flashingUnlock-noreboot.sh new file mode 100644 index 00000000..6164a715 --- /dev/null +++ b/flash-scripts/linux/pixel-flashingUnlock-noreboot.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +# Copyright (C) 2023 ECORP SAS - Author: Frank Preel +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Parameter +# $1: device id +# $2: fastboot folder path + +# Exit status +# - 0 : bootloader locked +# - 1 : unknown error +# - 2 : Flashing unlocked failed +# - 101 : $DEVICE_ID missing +# - 102 : $FASTBOOT_FOLDER_PATH is missing + +DEVICE_ID=$1 +FASTBOOT_FOLDER_PATH=$2 + +# check serial number has been provided +if [ -z "$DEVICE_ID" ] +then + exit 101 +fi + +# Check fastboot parent folder path has been provided +if [ -z "$FASTBOOT_FOLDER_PATH" ] +then + exit 102 +fi + +# Build fastboot path +FASTBOOT_PATH=${FASTBOOT_FOLDER_PATH}"fastboot" + +if [ "$($FASTBOOT_PATH getvar unlocked 2>&1 | grep -q yes; echo $?)" = 1 ] +then + # Unlock bootloader + if ! "$FASTBOOT_PATH" -s "$DEVICE_ID" flashing unlock --skip-reboot + then + exit 2 + fi +else + exit 0 +fi + +while [ "$($FASTBOOT_PATH getvar unlocked 2>&1 | grep -q yes; echo $?)" = 1 ] +do + echo "locked" + sleep 1 +done + +echo "unlock.." +sleep 1 diff --git a/flash-scripts/windows/install-recovery-boot.bat b/flash-scripts/windows/install-recovery-boot.bat new file mode 100644 index 00000000..859984b8 --- /dev/null +++ b/flash-scripts/windows/install-recovery-boot.bat @@ -0,0 +1,36 @@ +@echo off + +:: !/bin/bash + +:: Copyright (C) 2022-2023 ECORP SAS - Author: Frank Preel + +:: This program is free software: you can redistribute it and/or modify +:: it under the terms of the GNU General Public License as published by +:: the Free Software Foundation, either version 3 of the License, or +:: (at your option) any later version. + +:: This program is distributed in the hope that it will be useful, +:: but WITHOUT ANY WARRANTY; without even the implied warranty of +:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +:: GNU General Public License for more details. + +:: You should have received a copy of the GNU General Public License +:: along with this program. If not, see . + +:: Parameter +:: $1: FASTBOOT_PATH +:: $2: E_IMAGE_PATH need twrp path +:: Exit status +:: - 0 : Recovery installed +:: - 101 : E_IMAGE_PATH missing + +SET E_IMAGE_PATH=%~1 +SET FASTBOOT_PATH=%~2 + +IF not defined %E_IMAGE_PATH ( + echo "E Image path is empty" + exit /b 101 +) +SET FASTBOOT_CMD="%FASTBOOT_PATH%fastboot" + +%FASTBOOT_CMD% flash vendor_boot %E_IMAGE_PATH% diff --git a/flash-scripts/windows/pixel-flashingLock.bat b/flash-scripts/windows/pixel-flashingLock.bat new file mode 100644 index 00000000..6fad2464 --- /dev/null +++ b/flash-scripts/windows/pixel-flashingLock.bat @@ -0,0 +1,70 @@ +@echo off + +:: Coyright (C) 2023 ECORP SAS - Author: Frank Preel + +:: This program is free software: you can redistribute it and/or modify +:: it under the terms of the GNU General Public License as published by +:: the Free Software Foundation, either version 3 of the License, or +:: (at your option) any later version. + +:: This program is distributed in the hope that it will be useful, +:: but WITHOUT ANY WARRANTY; without even the implied warranty of +:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +:: GNU General Public License for more details. + +:: You should have received a copy of the GNU General Public License +:: along with this program. If not, see . + +:: Parameter +:: $1: device id +:: $2: fastboot folder path +:: $3: image to flash + +:: Exit status +:: - 0 : bootloader locked +:: - 1 : unknown error +:: - 2 : Flashing unlocked failed +:: - 101 : $DEVICE_ID missing +:: - 102 : $FASTBOOT_FOLDER_PATH is missing +:: - 103 : $E_IMAGE_PATH is missing + + +SET DEVICE_ID=%~1 +SET FASTBOOT_FOLDER_PATH=%~2 +SET E_IMAGE_PATH=%~3 + +IF not defined %DEVICE_ID ( + exit /b 101 +) +IF not defined %FASTBOOT_FOLDER_PATH ( + exit /b 102 +) +IF not defined %E_IMAGE_PATH ( + echo "E Image path is empty" + exit /b 103 +) + +SET FASTBOOT_PATH="%FASTBOOT_FOLDER_PATH%fastboot" + +%FASTBOOT_PATH% erase avb_custom_key +%FASTBOOT_PATH% flash avb_custom_key "%E_IMAGE_PATH%" + +%FASTBOOT_PATH% getvar unlocked 2>&1 | findstr "yes" +if %errorlevel% == 0 ( + echo "The device is unlocked" + %FASTBOOT_PATH% -s %DEVICE_ID% flashing lock +) else ( + exit /b 0 +) + +:fastboot_detect +%FASTBOOT_PATH% getvar unlocked 2>&1 | findstr "no" +if errorLevel 1 ( + echo "Wait lock" + timeout 2 >nul 2>&1 + goto :fastboot_detect +) + +call fastboot_detect + +exit /b 0 diff --git a/flash-scripts/windows/pixel-flashingUnlock-noreboot.bat b/flash-scripts/windows/pixel-flashingUnlock-noreboot.bat new file mode 100644 index 00000000..31e87f5d --- /dev/null +++ b/flash-scripts/windows/pixel-flashingUnlock-noreboot.bat @@ -0,0 +1,63 @@ +@echo off + +:: Coyright (C) 2023 ECORP SAS - Author: Frank Preel + +:: This program is free software: you can redistribute it and/or modify +:: it under the terms of the GNU General Public License as published by +:: the Free Software Foundation, either version 3 of the License, or +:: (at your option) any later version. + +:: This program is distributed in the hope that it will be useful, +:: but WITHOUT ANY WARRANTY; without even the implied warranty of +:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +:: GNU General Public License for more details. + +:: You should have received a copy of the GNU General Public License +:: along with this program. If not, see . + +:: Parameter +:: $1: device id +:: $2: fastboot folder path + +:: Exit status +:: - 0 : bootloader locked +:: - 1 : unknown error +:: - 2 : Flashing unlocked failed +:: - 101 : $DEVICE_ID missing +:: - 102 : $FASTBOOT_FOLDER_PATH is missing + + +SET DEVICE_ID=%~1 +SET FASTBOOT_FOLDER_PATH=%~2 + +IF not defined %DEVICE_ID ( + exit /b 101 +) +IF not defined %FASTBOOT_FOLDER_PATH ( + exit /b 102 +) + +SET FASTBOOT_PATH="%FASTBOOT_FOLDER_PATH%fastboot" + +%FASTBOOT_PATH% getvar unlocked 2>&1 | findstr "yes" +if %errorlevel% == 0 ( + echo "The device is unlocked" + timeout 1 >nul 2>&1 + exit /b 0 +) else ( + echo "The device is locked" + %FASTBOOT_PATH% -s %DEVICE_ID% flashing unlock --skip-reboot + if errorlevel 1 ( exit /b 2) +) + +:fastboot_detect +%FASTBOOT_PATH% getvar unlocked 2>&1 | findstr "yes" +if errorLevel 1 ( + echo "..." + timeout 2 >nul 2>&1 + goto :fastboot_detect +) + +call fastboot_detect + +exit /b 0 diff --git a/src/main/resources/yaml/redfin_flash.yml b/src/main/resources/yaml/redfin_flash.yml new file mode 100644 index 00000000..eb3f2b64 --- /dev/null +++ b/src/main/resources/yaml/redfin_flash.yml @@ -0,0 +1,162 @@ +## Copyright 2022-2023 - ECORP SAS + +## This program is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. + +## You should have received a copy of the GNU General Public License +## along with this program. If not, see . +## Author: Frank Preel +--- +stepsCount: 9 +steps: + f0: + type: custom + stepNumber: 1 + nextStepKey: f1 + titleKey: stepTitle_enableOemUnlock + titleIconName: icon-download.png + instructions: + - install_instr_openSettings + - install_instr_searchOEM + - install_instr_enableOEMUnlocking + - install_instr_acceptOEMUnlockWarning + - install_instr_onceDoneThenContinue + f1: + type: load + stepNumber: 2 + nextStepKey: f2 + titleKey: stepTitle_rebootBootloader + instructions: + - install_instr_rebootingOnBootloader + averageTime: 10 + script: reboot-fastboot + parameters: + device_id: ${DEVICE_ID} + fastboot_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_unknown + 10: script_error_cantRebootBootloader + 101: script_error_serialNumber_missing + 102: script_error_fastboot_path_missing + f2: + type: custom-executable + stepNumber: 3 + nextStepKey: f3 + titleKey: stepTitle_oemUnlock + titleIconName: icon-download.png + instructions: + - install_instr_unlockingOem + - install_instr_selectUnlockBootloader + - install_instr_unlockBootloader + script: pixel-flashingUnlock-noreboot + parameters: + device_id: ${DEVICE_ID} + fastboot_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_unknown + 2: script_error_fastboot_flashingUnlock_failed + 101: script_error_serialNumber_missing + 102: script_error_fastboot_path_missing + f3: + type: load + stepNumber: 4 + nextStepKey: f4 + titleKey: stepTitle4On7 + instructions: + - install_instr_recoveryInstall + averageTime: 3 + script: install-recovery-boot + parameters: + twrp_image_path: ${TWRP_IMAGE_PATH} + fastboot_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_unknown + 101: script_error_installRecovery_101 + f4: + type: custom-executable + stepNumber: 5 + nextStepKey: f5 + titleKey: stepTitle4On7 + instructions: + - install_instr_choose_e_recovery_select + - install_instr_choose_e_recovery_validate + - install_instr_e_recovery_factory_reset + - install_instr_e_recovery_factory_reset_format_data + - install_instr_e_recovery_factory_reset_format_data_validate + - install_instr_e_recovery_back + - install_instr_e_recovery_apply_update + - install_instr_e_recovery_apply_update_from_adb + - install_instr_e_recovery_apply_update_from_adb_wait_for_result + titleKeyIconName: icon-download.png + script: wait-e-recovery-sideload + parameters: + device_id: ${DEVICE_ID} + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 101: script_error_waitSideload_101 + f5: + type: load + stepNumber: 6 + nextStepKey: f6 + titleKey: install_instr_eosInstall + instructions: + - install_instr_eosInstall + averageTime: 200 + script: install-from-e-recovery + parameters: + device_id: ${DEVICE_ID} + archive_path: ${ARCHIVE_PATH} + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_installFromSideload + f6: + type: custom-executable + stepNumber: 7 + nextStepKey: f7 + titleKey: install_title_lockBootloader + instructions: + - install_instr_e_recovery_back + - install_pixel_advance + - install_pixel_reboot + - install_pixel_next + - install_instr_selectLockBootloader + - install_instr_lockBootloader + averageTime: 30 + script: pixel-flashingLock + parameters: + device_id: ${DEVICE_ID} + adb_folder_path: ${ADB_FOLDER_PATH} + archive_path: ${PATCH_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_installFromSideload + f7: + type: askAccount + stepNumber: 8 + nextStepKey: f8 + f8: + type: custom + stepNumber: 9 + nextStepKey: end + titleKey: stepTitle_rebootDevice + instructions: + - install_instr_adb_start + titleKeyIconName: icon-download.png diff --git a/src/main/resources/yaml/redfin_fs.yml b/src/main/resources/yaml/redfin_fs.yml new file mode 100644 index 00000000..0efd5ef0 --- /dev/null +++ b/src/main/resources/yaml/redfin_fs.yml @@ -0,0 +1,27 @@ +## Copyright 2022-2023 - ECORP SAS + +## This program is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. + +## You should have received a copy of the GNU General Public License +## along with this program. If not, see . +## Author: Frank Preel +--- +sources: + rom: + url: https://images.ecloud.global/stable/redfin/e-latest-s-redfin.zip + filePath: e-latest-s-redfin.zip + twrp: + url: https://images.ecloud.global/stable/redfin/recovery-e-latest-s-redfin.img + filePath: recovery-e-latest-s-redfin.img + patch: + url: https://images.ecloud.global/stable/pkmd_pixel.bin + filePath: pkmd_pixel.bin + -- GitLab From f635de981b3e888a3293bf2293227ccf9b92234f Mon Sep 17 00:00:00 2001 From: frankpreel Date: Thu, 30 Mar 2023 10:16:36 +0200 Subject: [PATCH 3/6] Redfin translation --- src/main/resources/lang/translation.properties | 9 +++++++++ src/main/resources/lang/translation_fr_FR.properties | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/src/main/resources/lang/translation.properties b/src/main/resources/lang/translation.properties index 2bcfbc7e..7d3535ee 100644 --- a/src/main/resources/lang/translation.properties +++ b/src/main/resources/lang/translation.properties @@ -30,6 +30,15 @@ all_btn_donate=Donate #oneplus install_instr_e_recovery_oneplus_select_recovery=Installing the partition +#pixel5 +install_pixel_advance=Select Advanced +install_pixel_reboot=Select Reboot to bootloader +install_pixel_next=Once the device has rebooted +install_instr_adb_advance= Select the item "Advanced" +install_instr_adb_sideload= Select the item "adb sideload" +install_instr_adb_swipe= Swipe to validate, the install process will start automatically +install_instr_adb_start= Finally, on the phone, press Start + # Welcome Scene welcome_mTitle=Welcome to the /e/OS Installer! welcome_lbl_body1=This program will enable you to install /e/OS on your phone in a few minutes. Don't worry, it is simple and easy. diff --git a/src/main/resources/lang/translation_fr_FR.properties b/src/main/resources/lang/translation_fr_FR.properties index 48916ba8..f37c34f1 100644 --- a/src/main/resources/lang/translation_fr_FR.properties +++ b/src/main/resources/lang/translation_fr_FR.properties @@ -233,6 +233,14 @@ all_lbl_tryAgain=Essayer à nouveau #oneplus install_instr_e_recovery_oneplus_select_recovery=Installation de la partition +#pixel5 +install_pixel_advance=Selectionned Advanced +install_pixel_reboot=Selectionner Reboot to bootloader +install_pixel_next=Une fois que le device a redémarré +install_instr_adb_advance= Select the bouton "Advanced" +install_instr_adb_sideload= Select the bouton "adb sideload" +install_instr_adb_swipe= faites glisser la barre fléchée en bas de l'écran pour valider, l'installation va démarrer. + #common view all_lbl_notImplemented=(Pas encore mis en œuvre) install_instr_acceptFactoryReset=Vous devrez continuer à appuyer sur « Power » & « Bixby » & « Volume Moins » jusqu'à ce que vous atteigniez le « Download mode » une fois que votre appareil est éteint. Lorsque vous êtes prêt, acceptez la réinitialisation. -- GitLab From e7be1d9d6e6d0168c16db82467cad5a9a1d2fdcc Mon Sep 17 00:00:00 2001 From: Frank PREEL Date: Thu, 30 Mar 2023 11:58:56 +0200 Subject: [PATCH 4/6] Permissions & lock --- flash-scripts/linux/install-recovery-boot.sh | 0 flash-scripts/linux/pixel-flashingLock.sh | 11 ++++++----- flash-scripts/linux/pixel-flashingUnlock-noreboot.sh | 0 3 files changed, 6 insertions(+), 5 deletions(-) mode change 100644 => 100755 flash-scripts/linux/install-recovery-boot.sh mode change 100644 => 100755 flash-scripts/linux/pixel-flashingLock.sh mode change 100644 => 100755 flash-scripts/linux/pixel-flashingUnlock-noreboot.sh diff --git a/flash-scripts/linux/install-recovery-boot.sh b/flash-scripts/linux/install-recovery-boot.sh old mode 100644 new mode 100755 diff --git a/flash-scripts/linux/pixel-flashingLock.sh b/flash-scripts/linux/pixel-flashingLock.sh old mode 100644 new mode 100755 index c56a36e0..948434ae --- a/flash-scripts/linux/pixel-flashingLock.sh +++ b/flash-scripts/linux/pixel-flashingLock.sh @@ -30,6 +30,7 @@ DEVICE_ID=$1 FASTBOOT_FOLDER_PATH=$2 +E_IMAGE_PATH=$3 # check serial number has been provided if [ -z "$DEVICE_ID" ] @@ -55,10 +56,10 @@ $FASTBOOT_PATH erase avb_custom_key $FASTBOOT_PATH flash avb_custom_key "$E_IMAGE_PATH" -if [ "$($FASTBOOT_PATH getvar locked 2>&1 | grep -q yes; echo $?)" = 1 ] +if [ "$($FASTBOOT_PATH getvar unlocked 2>&1 | grep -q yes; echo $?)" = 0 ] then # Unlock bootloader - if ! "$FASTBOOT_PATH" -s "$DEVICE_ID" flashing unlock + if ! "$FASTBOOT_PATH" -s "$DEVICE_ID" flashing lock then exit 2 fi @@ -66,11 +67,11 @@ else exit 0 fi -while [ "$($FASTBOOT_PATH getvar unlocked 2>&1 | grep -q yes; echo $?)" = 1 ] +while [ "$($FASTBOOT_PATH getvar unlocked 2>&1 | grep -q yes; echo $?)" = 0 ] do - echo "locked" + echo "unlock" sleep 1 done -echo "unlock.." +echo "unlocked" sleep 1 diff --git a/flash-scripts/linux/pixel-flashingUnlock-noreboot.sh b/flash-scripts/linux/pixel-flashingUnlock-noreboot.sh old mode 100644 new mode 100755 -- GitLab From 5e0b5ffa9d1e73159f2e49b6cd390c7ab2851fda Mon Sep 17 00:00:00 2001 From: Frank PREEL Date: Thu, 30 Mar 2023 14:55:26 +0200 Subject: [PATCH 5/6] Functional linux --- flash-scripts/linux/pixel-flashingLock.sh | 25 ++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/flash-scripts/linux/pixel-flashingLock.sh b/flash-scripts/linux/pixel-flashingLock.sh index 948434ae..ff099684 100755 --- a/flash-scripts/linux/pixel-flashingLock.sh +++ b/flash-scripts/linux/pixel-flashingLock.sh @@ -55,7 +55,6 @@ FASTBOOT_PATH=${FASTBOOT_FOLDER_PATH}"fastboot" $FASTBOOT_PATH erase avb_custom_key $FASTBOOT_PATH flash avb_custom_key "$E_IMAGE_PATH" - if [ "$($FASTBOOT_PATH getvar unlocked 2>&1 | grep -q yes; echo $?)" = 0 ] then # Unlock bootloader @@ -67,11 +66,23 @@ else exit 0 fi -while [ "$($FASTBOOT_PATH getvar unlocked 2>&1 | grep -q yes; echo $?)" = 0 ] -do - echo "unlock" - sleep 1 +sleep 5 + +# +while true; do + if [[ -z $("$FASTBOOT_PATH" devices) ]]; then + echo "Wait fastboot" + sleep 1 + fi + + unlocked=$("$FASTBOOT_PATH" getvar unlocked 2>&1 | grep -o "unlocked: yes") + if [[ -z $unlocked ]]; then + echo "Not unlocked" + sleep 1 + fi + + echo "Locked" + break done -echo "unlocked" -sleep 1 + -- GitLab From ee921a2d73b63463ca4c3744f079ae75a1c659dc Mon Sep 17 00:00:00 2001 From: Frank PREEL Date: Fri, 31 Mar 2023 09:44:07 +0200 Subject: [PATCH 6/6] Missing Android 12 warning --- src/main/resources/lang/translation.properties | 3 +++ src/main/resources/lang/translation_fr_FR.properties | 3 +++ src/main/resources/yaml/redfin_flash.yml | 1 + 3 files changed, 7 insertions(+) diff --git a/src/main/resources/lang/translation.properties b/src/main/resources/lang/translation.properties index 7d3535ee..d77181cd 100644 --- a/src/main/resources/lang/translation.properties +++ b/src/main/resources/lang/translation.properties @@ -27,6 +27,9 @@ all_btn_needHel=Need help all_btn_continue=Continue all_btn_donate=Donate +#warning +warn_android_12=Before following these instructions please ensure that the device is on the latest Android 12 firmware. + #oneplus install_instr_e_recovery_oneplus_select_recovery=Installing the partition diff --git a/src/main/resources/lang/translation_fr_FR.properties b/src/main/resources/lang/translation_fr_FR.properties index f37c34f1..fe08d969 100644 --- a/src/main/resources/lang/translation_fr_FR.properties +++ b/src/main/resources/lang/translation_fr_FR.properties @@ -62,6 +62,9 @@ removeAccounts_instr_selectAccounts=Sélectionnez puis supprimez tous les compte #detect # @TODO +#warning +warn_android_12=Avant de suivre ces instructions, assurez-vous que l'appareil est équipé du dernier firmware Android 12. + #Download download_mTitle=Téléchargement d'/e/OS et des fichiers nécessaires download_lbl_download=Nous téléchargerons les fichiers requis sur votre ordinateur diff --git a/src/main/resources/yaml/redfin_flash.yml b/src/main/resources/yaml/redfin_flash.yml index eb3f2b64..2c39dd0d 100644 --- a/src/main/resources/yaml/redfin_flash.yml +++ b/src/main/resources/yaml/redfin_flash.yml @@ -23,6 +23,7 @@ steps: titleKey: stepTitle_enableOemUnlock titleIconName: icon-download.png instructions: + - warn_android_12 - install_instr_openSettings - install_instr_searchOEM - install_instr_enableOEMUnlocking -- GitLab