Loading Dockerfile +16 −1 Original line number Diff line number Diff line Loading @@ -19,4 +19,19 @@ ENV SNAP="/snap/snapcraft/current" ENV SNAP_NAME="snapcraft" ENV SNAP_ARCH="amd64" RUN apt-get install -y openjdk-11-jdk nsis rsync No newline at end of file RUN apt-get install -y nsis rsync wget RUN mkdir /usr/lib/jdk && \ cd /usr/lib/jdk && \ wget https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.15_10.tar.gz && \ tar -xvf OpenJDK11U-jdk_x64_linux_hotspot_11.0.15_10.tar.gz RUN echo 'PATH="${PATH}:/usr/lib/jdk/jdk-11.0.15+10/bin"' >> /etc/environment && \ echo 'JAVA_HOME="/usr/lib/jdk/jdk-11.0.15+10"' >> /etc/environment && \ update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jdk/jdk-11.0.15+10/bin/java" 0 && \ update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jdk/jdk-11.0.15+10/bin/javac" 0 && \ update-alternatives --set java /usr/lib/jdk/jdk-11.0.15+10/bin/java && \ update-alternatives --set javac /usr/lib/jdk/jdk-11.0.15+10/bin/javac && \ update-alternatives --list java && \ update-alternatives --list javac && \ rm /usr/lib/jdk/OpenJDK11U-jdk_x64_linux_hotspot_11.0.15_10.tar.gz README.md +6 −2 Original line number Diff line number Diff line Loading @@ -45,10 +45,14 @@ developer: - Israel Yago pereira ## Changelogs ### v0.16.0 (candidate) - OnePlus 8 Pro ### v0.15.1 - 431 optionally lock bootloader after flashing - 432 Check the path to the files in MSWindows - 434 Easy Installer detect 2e as not compatible ### v0.15.0 - No shortcut created when installing from a non-admin account on Windows - e-recovery assets Loading flash-scripts/linux/emerald-flashingLock.sh 0 → 100755 +53 −0 Original line number Diff line number Diff line #!/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 <https://www.gnu.org/licenses/>. # Parameter # $1: device id # $2: fastboot folder path # Exit status # - 0 : bootloader locked # - 1 : unknown error # - 2 : Flashing locked 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" # Lock bootloader if ! ${FASTBOOT_PATH} flashing lock ; then exit 2 fi sleep 1 flash-scripts/linux/emerald-install-from-bootloader.sh +11 −8 Original line number Diff line number Diff line Loading @@ -27,15 +27,16 @@ # - 1 : generic error # - 10: can't unpack system.img # - 11: can't wipe userdata # - 11: can't wipe metadata # - 12: can't wipe metadata # - 13: can't active partition # - 20-30 : see partition_name index below # - 101 : DEVICE_ID missing # - 102 : ARCHIVE_PATH missing # - 103 : fastboot folder path missing partition_name=(gz_a lk_a md1img_a scp_a spmfw_a sspm_a tee_a boot_a dtbo_a vbmeta_a super) partition_image=(gz.img lk.img md1img.img scp.img spmfw.img sspm.img tee.img boot.img dtbo.img vbmeta.img super.img) partition_error=(20 21 22 23 24 25 26 27 28 29 30) partition_name=(boot_a dtbo_a vbmeta_a vbmeta_system_a vbmeta_vendor_a super lk_a logo preloader_a) partition_image=(boot.img dtbo.img vbmeta.img vbmeta_system.img vbmeta_vendor.img super.img lk.img logo-verified.bin preloader_yk673v6_lwg62_64.bin) partition_error=(20 21 22 23 24 25 26 27 28) DEVICE_ID=$1 ARCHIVE_PATH=$2 Loading Loading @@ -87,7 +88,6 @@ echo "unpacked archive" sleep 1 # Wipe user data if ! "$FASTBOOT_PATH" erase userdata ; then Loading @@ -97,12 +97,12 @@ fi echo "user data wiped" sleep 5 if ! "$FASTBOOT_PATH" erase metadata ; if ! "$FASTBOOT_PATH" format md_udc ; then exit 12 fi echo "meta data wiped" echo "format md_udc" sleep 5 #Flash partition Loading @@ -116,5 +116,8 @@ for i in ${!partition_name[@]}; do done "$FASTBOOT_PATH" --set-active=a if ! "$FASTBOOT_PATH" --set-active=a ; then exit 13 fi flash-scripts/windows/emerald-flashingLock.bat 0 → 100644 +47 −0 Original line number Diff line number Diff line @echo off :: Coyright (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 <https://www.gnu.org/licenses/>. :: 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% -s %DEVICE_ID% flashing lock if errorlevel 1 ( exit /b 2 ) timeout 1 >nul 2>&1 exit /b 0 Loading
Dockerfile +16 −1 Original line number Diff line number Diff line Loading @@ -19,4 +19,19 @@ ENV SNAP="/snap/snapcraft/current" ENV SNAP_NAME="snapcraft" ENV SNAP_ARCH="amd64" RUN apt-get install -y openjdk-11-jdk nsis rsync No newline at end of file RUN apt-get install -y nsis rsync wget RUN mkdir /usr/lib/jdk && \ cd /usr/lib/jdk && \ wget https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.15_10.tar.gz && \ tar -xvf OpenJDK11U-jdk_x64_linux_hotspot_11.0.15_10.tar.gz RUN echo 'PATH="${PATH}:/usr/lib/jdk/jdk-11.0.15+10/bin"' >> /etc/environment && \ echo 'JAVA_HOME="/usr/lib/jdk/jdk-11.0.15+10"' >> /etc/environment && \ update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jdk/jdk-11.0.15+10/bin/java" 0 && \ update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jdk/jdk-11.0.15+10/bin/javac" 0 && \ update-alternatives --set java /usr/lib/jdk/jdk-11.0.15+10/bin/java && \ update-alternatives --set javac /usr/lib/jdk/jdk-11.0.15+10/bin/javac && \ update-alternatives --list java && \ update-alternatives --list javac && \ rm /usr/lib/jdk/OpenJDK11U-jdk_x64_linux_hotspot_11.0.15_10.tar.gz
README.md +6 −2 Original line number Diff line number Diff line Loading @@ -45,10 +45,14 @@ developer: - Israel Yago pereira ## Changelogs ### v0.16.0 (candidate) - OnePlus 8 Pro ### v0.15.1 - 431 optionally lock bootloader after flashing - 432 Check the path to the files in MSWindows - 434 Easy Installer detect 2e as not compatible ### v0.15.0 - No shortcut created when installing from a non-admin account on Windows - e-recovery assets Loading
flash-scripts/linux/emerald-flashingLock.sh 0 → 100755 +53 −0 Original line number Diff line number Diff line #!/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 <https://www.gnu.org/licenses/>. # Parameter # $1: device id # $2: fastboot folder path # Exit status # - 0 : bootloader locked # - 1 : unknown error # - 2 : Flashing locked 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" # Lock bootloader if ! ${FASTBOOT_PATH} flashing lock ; then exit 2 fi sleep 1
flash-scripts/linux/emerald-install-from-bootloader.sh +11 −8 Original line number Diff line number Diff line Loading @@ -27,15 +27,16 @@ # - 1 : generic error # - 10: can't unpack system.img # - 11: can't wipe userdata # - 11: can't wipe metadata # - 12: can't wipe metadata # - 13: can't active partition # - 20-30 : see partition_name index below # - 101 : DEVICE_ID missing # - 102 : ARCHIVE_PATH missing # - 103 : fastboot folder path missing partition_name=(gz_a lk_a md1img_a scp_a spmfw_a sspm_a tee_a boot_a dtbo_a vbmeta_a super) partition_image=(gz.img lk.img md1img.img scp.img spmfw.img sspm.img tee.img boot.img dtbo.img vbmeta.img super.img) partition_error=(20 21 22 23 24 25 26 27 28 29 30) partition_name=(boot_a dtbo_a vbmeta_a vbmeta_system_a vbmeta_vendor_a super lk_a logo preloader_a) partition_image=(boot.img dtbo.img vbmeta.img vbmeta_system.img vbmeta_vendor.img super.img lk.img logo-verified.bin preloader_yk673v6_lwg62_64.bin) partition_error=(20 21 22 23 24 25 26 27 28) DEVICE_ID=$1 ARCHIVE_PATH=$2 Loading Loading @@ -87,7 +88,6 @@ echo "unpacked archive" sleep 1 # Wipe user data if ! "$FASTBOOT_PATH" erase userdata ; then Loading @@ -97,12 +97,12 @@ fi echo "user data wiped" sleep 5 if ! "$FASTBOOT_PATH" erase metadata ; if ! "$FASTBOOT_PATH" format md_udc ; then exit 12 fi echo "meta data wiped" echo "format md_udc" sleep 5 #Flash partition Loading @@ -116,5 +116,8 @@ for i in ${!partition_name[@]}; do done "$FASTBOOT_PATH" --set-active=a if ! "$FASTBOOT_PATH" --set-active=a ; then exit 13 fi
flash-scripts/windows/emerald-flashingLock.bat 0 → 100644 +47 −0 Original line number Diff line number Diff line @echo off :: Coyright (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 <https://www.gnu.org/licenses/>. :: 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% -s %DEVICE_ID% flashing lock if errorlevel 1 ( exit /b 2 ) timeout 1 >nul 2>&1 exit /b 0