diff --git a/README.md b/README.md index 4bab30d728bdaeaf9da6e9c76a53abdf088c637b..fc1e8d01cdefc28bfa4cc60bae88bd2706e7be57 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,10 @@ developer: ## Changelogs -### v0.15.0 (candidate) +### v0.16.0 (candidate) +- Pixel 5 support + +### v0.15.0 - No shortcut created when installing from a non-admin account on Windows - e-recovery assets - Update German translation - by F. Wildermuth diff --git a/flash-scripts/linux/install-recovery-boot.sh b/flash-scripts/linux/install-recovery-boot.sh new file mode 100755 index 0000000000000000000000000000000000000000..3dad8d53bae34c07e56cbcb4e08afe117d03a3fc --- /dev/null +++ b/flash-scripts/linux/install-recovery-boot.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# Copyright (C) 2022 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" boot "$TWRP_IMAGE_PATH" \ No newline at end of file diff --git a/flash-scripts/windows/install-recovery-boot.bat b/flash-scripts/windows/install-recovery-boot.bat new file mode 100644 index 0000000000000000000000000000000000000000..c03b4a6c9bc44fc4da1d2b3e133ed7e0beb62cca --- /dev/null +++ b/flash-scripts/windows/install-recovery-boot.bat @@ -0,0 +1,36 @@ +@echo off + +:: !/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: 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% boot %E_IMAGE_PATH% diff --git a/src/main/java/ecorp/easy/installer/AppConstants.java b/src/main/java/ecorp/easy/installer/AppConstants.java index 62497b775cb49bb17327486301b551dde42f2a78..14cb30cac448b5c0c7b96a2e3fb930cda45c6ff7 100644 --- a/src/main/java/ecorp/easy/installer/AppConstants.java +++ b/src/main/java/ecorp/easy/installer/AppConstants.java @@ -27,7 +27,7 @@ import java.nio.file.Paths; */ public abstract class AppConstants { - public final static String APP_VERSION = "v0.15.0"; + public final static String APP_VERSION = "v0.16.0"; public final static String Separator = FileSystems.getDefault().getSeparator(); public final static String OsName = System.getProperty("os.name"); public final static String JavaHome = System.getProperty("java.home"); diff --git a/src/main/java/ecorp/easy/installer/helpers/DeviceHelper.java b/src/main/java/ecorp/easy/installer/helpers/DeviceHelper.java index b4db778951a029e82a2df30527231e06a99464af..a0f0e4c04816a177e95f4b6b50f946138992d331 100644 --- a/src/main/java/ecorp/easy/installer/helpers/DeviceHelper.java +++ b/src/main/java/ecorp/easy/installer/helpers/DeviceHelper.java @@ -57,6 +57,8 @@ public class DeviceHelper { put("flame", "0016"); put("coral", "0017"); put("keyword", "0018"); //OnePlus 7 Pro + + put("redfin", "0020"); }}; /** diff --git a/src/main/java/ecorp/easy/installer/tasks/CommandExecutionTask.java b/src/main/java/ecorp/easy/installer/tasks/CommandExecutionTask.java index 395b1f201202cfe6fe6a3c3a6dcacbd88aed11d4..2da197f0ea58161eef17ddfed40b06111eea914c 100644 --- a/src/main/java/ecorp/easy/installer/tasks/CommandExecutionTask.java +++ b/src/main/java/ecorp/easy/installer/tasks/CommandExecutionTask.java @@ -117,6 +117,9 @@ public class CommandExecutionTask extends Task { * @throws java.lang.InterruptedException */ protected void executeCommand(ProcessBuilder pb) throws IOException, InterruptedException{ + + logger.debug("\n (EXECUTE COMMAND)"); + pc= pb.start(); /* Collect stdout for further usage */ @@ -143,6 +146,8 @@ public class CommandExecutionTask extends Task { this.exitCode = -1; } + logger.debug("\n (END COMMAND)"); + this.shellOutput = sb.toString(); if(pc.isAlive()) diff --git a/src/main/java/ecorp/easy/installer/tasks/DownloadTask.java b/src/main/java/ecorp/easy/installer/tasks/DownloadTask.java index 235dc2f1e215ccbebf3051056940614922995fdb..90b41246ed06d1824d3b8fc41bae08b16abbe0f6 100644 --- a/src/main/java/ecorp/easy/installer/tasks/DownloadTask.java +++ b/src/main/java/ecorp/easy/installer/tasks/DownloadTask.java @@ -52,6 +52,7 @@ import org.slf4j.LoggerFactory; */ public class DownloadTask extends Task{ private final static String checkSumExtension = ".sha256sum"; + private final static String checkSumExtensionShort = ".sha256"; private final static Logger logger = LoggerFactory.getLogger(DownloadTask.class); /** * Constant size @@ -110,8 +111,10 @@ public class DownloadTask extends Task{ // Download checksum. If file not downloaded return false and stop downloadin because integrity isn't guaranteed if( !downloadFile(targetUrl+checkSumExtension, checksumFilePath,checksumLmdFile) ){ - updateMessage(i18n.getString("download_lbl_cantcheckIntegrity")); - return false; + if( !downloadFile(targetUrl+checkSumExtensionShort, checksumFilePath,checksumLmdFile) ){ // Allow to download outside Murena infra naming conveention + updateMessage(i18n.getString("download_lbl_cantcheckIntegrity")); + return false; + } } //If checksum valid it means that file is already there and up to date diff --git a/src/main/resources/lang/translation.properties b/src/main/resources/lang/translation.properties index e17910e3f872fed175d037e09c5b899641937426..b6908b3e53723eba8224a75acf49635f4f8195a1 100644 --- a/src/main/resources/lang/translation.properties +++ b/src/main/resources/lang/translation.properties @@ -208,6 +208,10 @@ install_instr_e_recovery_factory_reset_validate= Accept the warning by selecting install_instr_e_recovery_back= Select "Back", on the top left corner install_instr_e_recovery_reboot= Select "Reboot system now" +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_openSettingsThenDevOptions = Open "Settings" then "Developer options" install_instr_disableAutoUpdateSystem= Disable "Auto update system" install_instr_openSoftwareUpdate = Get back to "Settings" and open "Software update" diff --git a/src/main/resources/lang/translation_fr_FR.properties b/src/main/resources/lang/translation_fr_FR.properties index 0b672a30026d447887467abbe6b9730c9263daa2..8da25af4baae24f9966c0c7082dca4df2b2f7f8d 100644 --- a/src/main/resources/lang/translation_fr_FR.properties +++ b/src/main/resources/lang/translation_fr_FR.properties @@ -311,7 +311,7 @@ install_instr_waitFastbootmodeDetected=La prochaine étape va démarrer automati install_instr_choose_e_recovery_select= Sur le téléphone sélectionner l'option "Recovery Mode". install_instr_choose_e_recovery_select_details= La selection se fait en utilisant les touches de volume du téléphone. install_instr_choose_e_recovery_validate= Validez en appuyant sur la touche Power. -install_instr_choose_e_recovery_validate_wait_for_result= Le téléphone va rebooter en mode recovery au boot d'un certain temps. +install_instr_choose_e_recovery_validate_wait_for_result= Le téléphone va rebooter en mode recovery au bout d'un certain temps. install_instr_e_recovery_apply_update= Selectionnez "Apply update" install_instr_e_recovery_apply_update_from_adb= Selectionnez "Apply update from ADB" install_instr_e_recovery_apply_update_from_adb_wait_for_result= Soyez patient, l'installation est en cours de progression. @@ -325,6 +325,10 @@ install_instr_e_recovery_factory_reset_validate= Acceptez l'avertissement en sé install_instr_e_recovery_back= Selectionnez "Back", en haut à gauche de l'écran install_instr_e_recovery_reboot= Selectionnez "Reboot system now" +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. + checkDriverInstall_advice=Si ce n'est pas le cas, veuillez suivre cette documentation : checkDriverInstall_question=Avez-vous installé les pilotes pour votre téléphone ? # Check windows driver installation diff --git a/src/main/resources/yaml/redfin_flash.yml b/src/main/resources/yaml/redfin_flash.yml new file mode 100644 index 0000000000000000000000000000000000000000..efb29a118acdb6d9af1e56a06c0061d9245d9888 --- /dev/null +++ b/src/main/resources/yaml/redfin_flash.yml @@ -0,0 +1,141 @@ +## Copyright 2022 - 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: 8 +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 + 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_validate_wait_for_result + - install_instr_tapWipe + - install_instr_tapFormatData + - install_instr_writeYes + - install_instr_validate + - install_instr_backX3 + - install_instr_adb_advance + - install_instr_adb_sideload + - install_instr_adb_swipe + 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: askAccount + stepNumber: 7 + nextStepKey: f7 + f7: + type: custom + stepNumber: 8 + nextStepKey: end + titleKey: stepTitle_rebootDevice + instructions: + - install_instr_tapRebootSystem + - eAccount_lbl_alreadyAccount + 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..f0706b6e8fe9fad848c7a3e39c3177dd0b588f1d --- /dev/null +++ b/src/main/resources/yaml/redfin_fs.yml @@ -0,0 +1,24 @@ +## Copyright 2022 - 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-r-redfin.zip + filePath: e-latest-r-redfin.zip + twrp: + url: https://images.ecloud.global/stable/redfin/twrp-3.6.2_11-0-redfin.img + filePath: twrp-3.6.2_11-0-redfin.img +