diff --git a/flash-scripts/linux/install-recovery-boot.sh b/flash-scripts/linux/install-recovery-boot.sh new file mode 100755 index 0000000000000000000000000000000000000000..6d459ce22faa91533d2a23fb4c51bc31a2ea8bf3 --- /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 100755 index 0000000000000000000000000000000000000000..ff099684d636312a08b8981c75f21f51f6446664 --- /dev/null +++ b/flash-scripts/linux/pixel-flashingLock.sh @@ -0,0 +1,88 @@ +#!/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 +E_IMAGE_PATH=$3 + +# 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 unlocked 2>&1 | grep -q yes; echo $?)" = 0 ] +then + # Unlock bootloader + if ! "$FASTBOOT_PATH" -s "$DEVICE_ID" flashing lock + then + exit 2 + fi +else + exit 0 +fi + +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 + + diff --git a/flash-scripts/linux/pixel-flashingUnlock-noreboot.sh b/flash-scripts/linux/pixel-flashingUnlock-noreboot.sh new file mode 100755 index 0000000000000000000000000000000000000000..6164a7150d27dcd569d4cfe9a549926a84c856dd --- /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 0000000000000000000000000000000000000000..859984b8cb605172893e8fdeb4fa7eb91bc9f5c0 --- /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 0000000000000000000000000000000000000000..6fad24644fa318c7fa68868ce6802115790f8773 --- /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 0000000000000000000000000000000000000000..31e87f5db215192de72c24851ebb6d9e9f5be3a2 --- /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/java/ecorp/easy/installer/helpers/DeviceHelper.java b/src/main/java/ecorp/easy/installer/helpers/DeviceHelper.java index eecdce9e272dff1f1b9699bbd7e7dec34c19ed76..7587fe541008b6a0ecde6c470f161474d52f0619 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"); }}; /** diff --git a/src/main/resources/lang/translation.properties b/src/main/resources/lang/translation.properties index 2bcfbc7e946512ec549931c2fe46cf9cd00026db..d77181cdfefa8235e51022e800d00b622585e7b7 100644 --- a/src/main/resources/lang/translation.properties +++ b/src/main/resources/lang/translation.properties @@ -27,9 +27,21 @@ 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 +#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 48916ba8a2f6057852e051ec1290f8cf7c932247..fe08d9691347e041d7d43c87c0b461dbfa35eb0e 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 @@ -233,6 +236,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. diff --git a/src/main/resources/yaml/redfin_flash.yml b/src/main/resources/yaml/redfin_flash.yml new file mode 100644 index 0000000000000000000000000000000000000000..2c39dd0d0af3da9f1884f5a92c686ae100a3222e --- /dev/null +++ b/src/main/resources/yaml/redfin_flash.yml @@ -0,0 +1,163 @@ +## 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: + - warn_android_12 + - 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 0000000000000000000000000000000000000000..0efd5ef091bcf492afbc4ac5c53a4c12303752c6 --- /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 +