diff --git a/flash-scripts/linux/check_macos.sh b/flash-scripts/linux/check_macos.sh
new file mode 100755
index 0000000000000000000000000000000000000000..37988fdecba0fff6c715651928e318b5811f5516
--- /dev/null
+++ b/flash-scripts/linux/check_macos.sh
@@ -0,0 +1,72 @@
+#!/bin/bash
+
+# Copyright (C) 2022 - 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: ARCHIVE_PATH path to the /e/ archive to flash
+# $2: FASTBOOT_FOLDER_PATH: the path where runnable fastboot is stored
+# $3: JAVA_FOLDER_PATH: the path where runnable jar is stored (to unpack ZIP file)
+
+# Exit status
+# - 0 : Fastboot functionnal
+# - 101 : ARCHIVE_PATH missing
+
+# Context
+# On MacOS Fastboot starts not to work anymore (in case of fFP4 precisely during the flash of the partitions (it is systematic)
+# Fastboot is locked and returns < waiting for any device > whereas some time before it still worked)
+# The only remedy I found to continue the process is to restart in recovery from the recovery menu.
+# This script is a trigger to perform this action
+
+ARCHIVE_PATH=$1
+ARCHIVE_FOLDER_PATH=$(dirname "$1")"/"
+FASTBOOT_FOLDER_PATH=$2
+FASTBOOT_PATH=${FASTBOOT_FOLDER_PATH}"fastboot"
+
+echo "archive path : $ARCHIVE_PATH"
+echo "archive folder path : $ARCHIVE_FOLDER_PATH"
+echo "fastboot path : $FASTBOOT_PATH"
+
+if [ -z "$ARCHIVE_PATH" ]
+then
+ exit 101
+fi
+
+cd "$ARCHIVE_FOLDER_PATH"
+
+if [[ $OSTYPE == 'darwin'* ]]; then
+ CHECK_FASTBOOT=1
+ while [ $CHECK_FASTBOOT = 1 ]
+ do
+ echo "CHECK..."
+ ("$FASTBOOT_PATH" flashing get_unlock_ability) & pid=$!
+ ( sleep 10 && kill -HUP $pid ) 2>/dev/null & watcher=$!
+ if wait $pid 2>/dev/null; then
+ echo "fastboot works finished"
+ pkill -HUP -P $watcher
+ wait $watcher
+ CHECK_FASTBOOT=0
+ else
+ (killall -9 fastboot) &
+ echo "fastboot failed"
+ CHECK_FASTBOOT=1
+ sleep 10
+ fi
+ done
+fi
+
+exit 0
+
+
diff --git a/flash-scripts/linux/fp4_check_bootloader.sh b/flash-scripts/linux/fp4_check_bootloader.sh
new file mode 100755
index 0000000000000000000000000000000000000000..da5ca37c676ef2209dbfe7c38fd3e0f79f7fddb0
--- /dev/null
+++ b/flash-scripts/linux/fp4_check_bootloader.sh
@@ -0,0 +1,69 @@
+#!/bin/bash
+
+# Copyright (C) 2022 - 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 .
+
+# TODO: What if 2 devices detected?
+# Parameter
+# $1: The folder where fastboot runnable is stored
+# $2: The archive folder path
+# $3: THe model of the device
+
+# Exit status
+# - 0 : Device in fastboot mode detected
+
+# Store ROM information on the file system
+
+FASTBOOT_FOLDER_PATH=$1
+FASTBOOT_PATH=${FASTBOOT_FOLDER_PATH}"fastboot"
+
+
+ARCHIVE_PATH=$2
+ARCHIVE_FOLDER_PATH=$(dirname "$2")"/"
+
+echo "Archive Path="$ARCHIVE_FOLDER_PATH
+
+device_model=$3
+
+echo "Model="$device_model
+
+SECURITY_PATCH=${ARCHIVE_FOLDER_PATH}""${device_model}"-security-patch"
+ORIGINAL_SECURITY_PATCH=$(cat "$SECURITY_PATCH")
+MURENA_ROM_INFO=${ARCHIVE_FOLDER_PATH}""${device_model}"-rom-info"
+MURENA__SECURITY_PATCH=`sed -n 's/^ro.build.version.security_patch=//p' $MURENA_ROM_INFO`
+echo "MURENA__SECURITY_PATCH=$MURENA__SECURITY_PATCH"
+
+# ---------
+# Assuming format is xxxx-yy-zz with otional extra info ..
+function versionToInt { printf "%03d%03d%03d%03d" $(echo "$1" | tr '-' ' '); }
+
+I_ORIGINAL_SECURITY_PATCH=$(versionToInt "$ORIGINAL_SECURITY_PATCH")
+I_MURENA__SECURITY_PATCH=$(versionToInt $MURENA__SECURITY_PATCH)
+
+if [[ "$I_ORIGINAL_SECURITY_PATCH" -lt "1" ]]
+then
+ echo "ORIGINAL ROM INFO NOT AVAILABLE => DO NOT PROCESS"
+ "$FASTBOOT_PATH" reboot
+ sleep 30
+elif [[ $I_MURENA__SECURITY_PATCH -ge $I_ORIGINAL_SECURITY_PATCH ]]
+then
+ echo "GREATER OR EQUALS => PROCESS"
+else
+ echo "LOWER => DO NOT PROCESS"
+ "$FASTBOOT_PATH" reboot
+ sleep 30
+fi
+
+exit 0
diff --git a/flash-scripts/linux/fp4_install-from-fastboot.sh b/flash-scripts/linux/fp4_install-from-fastboot.sh
new file mode 100755
index 0000000000000000000000000000000000000000..7ed14e3caa4e6dcdb5ce1dd194365fd77f328d35
--- /dev/null
+++ b/flash-scripts/linux/fp4_install-from-fastboot.sh
@@ -0,0 +1,262 @@
+#!/bin/bash
+
+# Copyright (C) 2020 - Author: Ingo; update and adoption to FP4, 2022 by ff2u
+#
+# 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: ARCHIVE_PATH path to the /e/ archive to flash
+# $2: FASTBOOT_FOLDER_PATH: the path where runnable fastboot is stored
+# $3: JAVA_FOLDER_PATH: the path where runnable jar is stored (to unpack ZIP file)
+
+# Exit status
+# - 0 : /e/ installed
+# - 1 : erasing userdata or metadata failed
+# - 2 : flashing of a non-critical partition failed
+# - 4 : setting active slot to a failed
+# - 5 : flashing of a critical partition failed
+# namely: {devcfg_ab, xbl_ab, tz_ab, hyp_ab, keymaster_ab, abl_ab, aop_ab, imagefv_ab, multiimgoem_ab, qupfw_ab, uefisecapp_ab, xbl_config_ab}
+# - 101 : ARCHIVE_PATH missing
+# - 102 : archive could not be unpacked
+
+ARCHIVE_PATH=$1
+ARCHIVE_FOLDER_PATH=$(dirname "$1")"/"
+FASTBOOT_FOLDER_PATH=$2
+FASTBOOT_PATH=${FASTBOOT_FOLDER_PATH}"fastboot"
+JAVA_FOLDER_PATH=$3
+JAR_PATH=${JAVA_FOLDER_PATH}"/bin/jar"
+
+echo "archive path : $ARCHIVE_PATH"
+echo "archive folder path : $ARCHIVE_FOLDER_PATH"
+echo "fastboot path : $FASTBOOT_PATH"
+echo "jar path : $JAR_PATH"
+
+if [ -z "$ARCHIVE_PATH" ]
+then
+ exit 101
+fi
+
+cd "$ARCHIVE_FOLDER_PATH"
+sleep 1
+
+if ! "$JAR_PATH" -x -v -f "$ARCHIVE_PATH" ;
+then
+ exit 102
+fi
+
+echo "unpacked archive"
+sleep 1
+
+echo "=== Flash slot a ==="
+
+if ! "$FASTBOOT_PATH" flash bluetooth_a bluetooth.img ; then exit 2 ; fi
+echo "flashed bluetooth"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash devcfg_a devcfg.img ; then exit 5 ; fi
+echo "flashed devcfg"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash dsp_a dsp.img ; then exit 2 ; fi
+echo "flashed dsp"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash modem_a modem.img ; then exit 2 ; fi
+echo "flashed modem"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash xbl_a xbl.img ; then exit 5 ; fi
+echo "flashed xbl"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash tz_a tz.img ; then exit 5 ; fi
+echo "flashed tz"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash hyp_a hyp.img ; then exit 5 ; fi
+echo "flashed hyp"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash keymaster_a keymaster.img ; then exit 5 ; fi
+echo "flashed keymaster"
+sleep 1
+
+
+if ! "$FASTBOOT_PATH" flash abl_a abl.img ; then exit 5 ; fi
+echo "flashed abl"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash boot_a boot.img ; then exit 2 ; fi
+echo "flashed boot"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash recovery_a recovery.img ; then exit 2 ; fi
+echo "flashed recovery"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash dtbo_a dtbo.img ; then exit 2 ; fi
+echo "flashed dtbo"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash vbmeta_system_a vbmeta_system.img ; then exit 2 ; fi
+echo "flashed vbmeta_system"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash vbmeta_a vbmeta.img ; then exit 2 ; fi
+echo "flashed vbmeta"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash super super.img ; then exit 2 ; fi
+echo "flashed super"
+sleep 1
+
+
+if ! "$FASTBOOT_PATH" flash aop_a aop.img ; then exit 5 ; fi
+echo "flashed aop"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash featenabler_a featenabler.img ; then exit 2 ; fi
+echo "flashed featenabler"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash imagefv_a imagefv.img ; then exit 5 ; fi
+echo "flashed imagefv"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash multiimgoem_a multiimgoem.img ; then exit 5 ; fi
+echo "flashed multiimgoem"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash qupfw_a qupfw.img ; then exit 5 ; fi
+echo "flashed qupfw"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash uefisecapp_a uefisecapp.img ; then exit 5 ; fi
+echo "flashed uefisecapp"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash xbl_config_a xbl_config.img ; then exit 5 ; fi
+echo "flashed xbl_config"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash core_nhlos_a core_nhlos.img ; then exit 2 ; fi
+echo "flashed core_nhlos"
+sleep 1
+
+
+echo "=== Flash slot b ==="
+
+if ! "$FASTBOOT_PATH" flash bluetooth_b bluetooth.img ; then exit 2 ; fi
+echo "flashed bluetooth_b"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash devcfg_b devcfg.img ; then exit 5 ; fi
+echo "flashed devcfg_b"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash dsp_b dsp.img ; then exit 2 ; fi
+echo "flashed dsp_b"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash modem_b modem.img ; then exit 2 ; fi
+echo "flashed modem_b"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash xbl_b xbl.img ; then exit 5 ; fi
+echo "flashed xbl_b"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash tz_b tz.img ; then exit 5 ; fi
+echo "flashed tz_b"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash hyp_b hyp.img ; then exit 5 ; fi
+echo "flashed hyp_b"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash keymaster_b keymaster.img ; then exit 5 ; fi
+echo "flashed keymaster_b"
+sleep 1
+
+
+if ! "$FASTBOOT_PATH" flash abl_b abl.img ; then exit 5 ; fi
+echo "flashed abl_b"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash boot_b boot.img ; then exit 2 ; fi
+echo "flashed boot_b"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash recovery_b recovery.img ; then exit 2 ; fi
+echo "flashed recovery_b"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash dtbo_b dtbo.img ; then exit 2 ; fi
+echo "flashed dtbo_b"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash vbmeta_system_b vbmeta_system.img ; then exit 2 ; fi
+echo "flashed vbmeta_system_b"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash vbmeta_b vbmeta.img ; then exit 2 ; fi
+echo "flashed vbmeta_b"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash aop_b aop.img ; then exit 5 ; fi
+echo "flashed aop_b"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash featenabler_b featenabler.img ; then exit 2 ; fi
+echo "flashed featenabler_b"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash imagefv_b imagefv.img ; then exit 5 ; fi
+echo "flashed imagefv_b"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash multiimgoem_b multiimgoem.img ; then exit 5 ; fi
+echo "flashed multiimgoem_b"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash qupfw_b qupfw.img ; then exit 5 ; fi
+echo "flashed qupfw_b"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash uefisecapp_b uefisecapp.img ; then exit 5 ; fi
+echo "flashed uefisecapp_b"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash xbl_config_b xbl_config.img ; then exit 5 ; fi
+echo "flashed xbl_config_b"
+sleep 1
+
+if ! "$FASTBOOT_PATH" flash core_nhlos_b core_nhlos.img ; then exit 2 ; fi
+echo "flashed core_nhlos_b"
+sleep 1
+
+echo "=== Wiping userdata and metadata ==="
+sleep 3
+
+if ! "$FASTBOOT_PATH" erase userdata ; then exit 1 ; fi
+echo "wiped userdata"
+sleep 1
+
+if ! "$FASTBOOT_PATH" erase metadata ; then exit 1 ; fi
+echo "wiped metadata"
+sleep 3
+
+echo "=== Setting active slot to a ==="
+if ! "$FASTBOOT_PATH" --set-active=a ; then exit 4 ; fi
+echo "switched to slot a"
diff --git a/flash-scripts/linux/fp4_lock.sh b/flash-scripts/linux/fp4_lock.sh
new file mode 100755
index 0000000000000000000000000000000000000000..819a43758d234b9e7801e3ffb9bc3f97a38cce0e
--- /dev/null
+++ b/flash-scripts/linux/fp4_lock.sh
@@ -0,0 +1,81 @@
+#!/bin/bash
+
+# Copyright (C) 2020-2022 ECORP SAS - Author: Vincent Bourgmayer, 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: ADB_FOLDER_PATH: the path where runnable adb is stored
+# $2: The archive folder path
+# $3: THe model of the device
+
+# Exit status
+# - 0 : success
+# - 1 : Error
+# - 101 : no device found in fastboot
+# - 102 : locking the bootloader failed
+
+FASTBOOT_FOLDER_PATH=$1
+FASTBOOT_PATH=${FASTBOOT_FOLDER_PATH}"fastboot"
+
+echo "fastboot path: $FASTBOOT_PATH"
+
+ARCHIVE_PATH=$2
+ARCHIVE_FOLDER_PATH=$(dirname "$2")"/"
+
+echo "Archive Path="$ARCHIVE_FOLDER_PATH
+
+device_model=$3
+
+echo "Model="$device_model
+
+SECURITY_PATCH=${ARCHIVE_FOLDER_PATH}""${device_model}"-security-patch"
+ORIGINAL_SECURITY_PATCH=$(cat "$SECURITY_PATCH")
+MURENA_ROM_INFO=${ARCHIVE_FOLDER_PATH}""${device_model}"-rom-info"
+MURENA__SECURITY_PATCH=`sed -n 's/^ro.build.version.security_patch=//p' $MURENA_ROM_INFO`
+echo "MURENA__SECURITY_PATCH=$MURENA__SECURITY_PATCH"
+
+# Assuming format is xxxx-yy-zz with otional extra info ..
+function versionToInt { printf "%03d%03d%03d%03d" $(echo "$1" | tr '-' ' '); }
+
+I_ORIGINAL_SECURITY_PATCH=$(versionToInt "$ORIGINAL_SECURITY_PATCH")
+I_MURENA__SECURITY_PATCH=$(versionToInt $MURENA__SECURITY_PATCH)
+
+if [[ "$I_ORIGINAL_SECURITY_PATCH" -lt "1" ]]
+then
+ echo "ORIGINAL ROM INFO NOT AVAILABLE => DO NOT PROCESS"
+ exit 0
+elif [[ $I_MURENA__SECURITY_PATCH -ge $I_ORIGINAL_SECURITY_PATCH ]]
+then
+ echo "GREATER OR EQUALS => PROCESS"
+else
+ echo "LOWER => DO NOT PROCESS"
+ exit 0
+fi
+
+#1 On check that device is in recovery mode
+if ! "$FASTBOOT_PATH" devices 2>&1 | grep "fastboot"
+then
+ echo "Device not detected in fastboot"
+ exit 101
+fi
+
+# Lock the bootloader
+if ! "$FASTBOOT_PATH" flashing lock
+then
+ exit 102
+fi
+
+sleep 10
diff --git a/flash-scripts/linux/fp4_lock_critical.sh b/flash-scripts/linux/fp4_lock_critical.sh
new file mode 100755
index 0000000000000000000000000000000000000000..3b0b1323ac135207b7ff2c94a0a15d7859e2fbc4
--- /dev/null
+++ b/flash-scripts/linux/fp4_lock_critical.sh
@@ -0,0 +1,82 @@
+#!/bin/bash
+
+# Copyright (C) 2020 ECORP SAS - Author: Vincent Bourgmayer
+# Updated ff2u
+#
+# 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: ADB_FOLDER_PATH: the path where runnable adb is stored
+# $2: The archive folder path
+# $3: THe model of the device
+
+# Exit status
+# - 0 : success
+# - 1 : Error
+# - 101 : locking the bootloader failed
+
+FASTBOOT_FOLDER_PATH=$1
+FASTBOOT_PATH=${FASTBOOT_FOLDER_PATH}"fastboot"
+
+
+ARCHIVE_PATH=$2
+ARCHIVE_FOLDER_PATH=$(dirname "$2")"/"
+
+echo "Archive Path="$ARCHIVE_FOLDER_PATH
+
+device_model=$3
+
+echo "Model="$device_model
+
+SECURITY_PATCH=${ARCHIVE_FOLDER_PATH}""${device_model}"-security-patch"
+ORIGINAL_SECURITY_PATCH=$(cat "$SECURITY_PATCH")
+MURENA_ROM_INFO=${ARCHIVE_FOLDER_PATH}""${device_model}"-rom-info"
+MURENA__SECURITY_PATCH=`sed -n 's/^ro.build.version.security_patch=//p' $MURENA_ROM_INFO`
+echo "MURENA__SECURITY_PATCH=$MURENA__SECURITY_PATCH"
+
+# Assuming format is xxxx-yy-zz with otional extra info ..
+function versionToInt { printf "%03d%03d%03d%03d" $(echo "$1" | tr '-' ' '); }
+
+I_ORIGINAL_SECURITY_PATCH=$(versionToInt "$ORIGINAL_SECURITY_PATCH")
+I_MURENA__SECURITY_PATCH=$(versionToInt $MURENA__SECURITY_PATCH)
+
+if [[ "$I_ORIGINAL_SECURITY_PATCH" -lt "1" ]]
+then
+ echo "ORIGINAL ROM INFO NOT AVAILABLE => DO NOT PROCESS"
+ exit 0
+elif [[ $I_MURENA__SECURITY_PATCH -ge $I_ORIGINAL_SECURITY_PATCH ]]
+then
+ echo "GREATER OR EQUALS => PROCESS"
+else
+ echo "LOWER DO NOT PROCESS"
+ "$FASTBOOT_PATH" reboot
+ sleep 1
+ exit 0
+fi
+
+# Lock the bootloader
+if [ "$($FASTBOOT_PATH flashing lock_critical; echo $?)" = 1 ]
+then
+ echo "Lock Critical fails!"
+ exit 101
+fi
+sleep 10
+echo "Critical locked!"
+
+#Then we wait that it left this state
+while [ "$($FASTBOOT_PATH devices | grep -q fastboot; echo $?)" = 0 ]
+do
+ sleep 1
+done
diff --git a/flash-scripts/linux/fp4_oem-unlock-critical.sh b/flash-scripts/linux/fp4_oem-unlock-critical.sh
new file mode 100755
index 0000000000000000000000000000000000000000..9e5d991e9503231673d15768c4ce44fde6b9f549
--- /dev/null
+++ b/flash-scripts/linux/fp4_oem-unlock-critical.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+# Copyright (C) 2020 - Author: Ingo; update and adoption to FP4, 2022 by ff2u
+#
+# 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: The folder where fastboot runnable is stored
+
+# Exit status
+# - 0 : OEM unlocked on device
+# - 10 : fastboot error
+
+FASTBOOT_FOLDER_PATH=$1
+FASTBOOT_PATH=${FASTBOOT_FOLDER_PATH}"fastboot"
+
+echo "fastboot path: $FASTBOOT_PATH"
+
+if [ "$($FASTBOOT_PATH oem device-info 2>&1 | grep -q "critical unlocked: true"; echo $?)" = 0 ]
+then
+ sleep 10
+ echo "Device already critically unlocked!"
+else
+ if [ "$($FASTBOOT_PATH flashing unlock_critical; echo $?)" = 1 ]
+ then
+ echo "Crtical unlock fails!"
+ exit 10
+ fi
+ sleep 10
+ echo "Critical unlocked!"
+fi
diff --git a/flash-scripts/linux/fp4_oem-unlock.sh b/flash-scripts/linux/fp4_oem-unlock.sh
new file mode 100755
index 0000000000000000000000000000000000000000..4a0ee123bb2e7dd81c3f68fd0322bae869c33d1e
--- /dev/null
+++ b/flash-scripts/linux/fp4_oem-unlock.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+# Copyright (C) 2020 - Author: Ingo; update and adoption to FP4, 2022 by ff2u
+#
+# 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: The folder where fastboot runnable is stored
+
+# Exit status
+# - 0 : OEM unlocked on device
+# - 10 : fastboot error
+
+FASTBOOT_FOLDER_PATH=$1
+FASTBOOT_PATH=${FASTBOOT_FOLDER_PATH}"fastboot"
+
+echo "fastboot path: $FASTBOOT_PATH"
+
+if [ "$($FASTBOOT_PATH getvar unlocked 2>&1 | grep -q yes; echo $?)" = 0 ]
+then
+ sleep 10
+ echo "Device already unlocked"
+else
+ if [ "$($FASTBOOT_PATH flashing unlock; echo $?)" = 1 ]
+ then
+ echo "OEM-unlock fails"
+ exit 10
+ fi
+ sleep 10
+ echo "OEM unlocked"
+fi
diff --git a/flash-scripts/linux/store-rom-info.sh b/flash-scripts/linux/store-rom-info.sh
new file mode 100755
index 0000000000000000000000000000000000000000..e05ac853f27c13c8659f9d537f95121164808dfe
--- /dev/null
+++ b/flash-scripts/linux/store-rom-info.sh
@@ -0,0 +1,73 @@
+#!/bin/bash
+
+# Copyright (C) 2022 - 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 .
+
+# TODO: What if 2 devices detected?
+# Parameter
+# $1: The folder where fastboot runnable is stored
+
+# Exit status
+# - 0 : Device in fastboot mode detected
+# - 1 : Error (adb)
+# - 2 : Error (device locked)
+
+# Store ROM information on the file system
+
+FASTBOOT_FOLDER_PATH=$1
+ADB_PATH=${FASTBOOT_FOLDER_PATH}"adb"
+
+ARCHIVE_PATH=$2
+ARCHIVE_FOLDER_PATH=$(dirname "$2")"/"
+
+echo "Archive Path="$ARCHIVE_FOLDER_PATH
+
+device_model=$3
+
+echo "Model="$device_model
+
+
+if ! "$ADB_PATH" shell getprop ro.build.version.security_patch
+then
+ exit 1
+fi
+
+SECURITY_PATCH=${ARCHIVE_FOLDER_PATH}""${device_model}"-security-patch"
+DEVICE_STATE=${ARCHIVE_FOLDER_PATH}""${device_model}"-device-state"
+MURENA_ROM_INFO=${ARCHIVE_FOLDER_PATH}""${device_model}"-rom-info"
+
+curl -o $MURENA_ROM_INFO https://images.ecloud.global/stable/FP4/e-latest-FP4.zip.prop
+
+MURENA__SECURITY_PATCH=`sed -n 's/^ro.build.version.security_patch=//p' $MURENA_ROM_INFO`
+echo "MURENA__SECURITY_PATCH=$MURENA__SECURITY_PATCH"
+
+# For FP4 on stock ROM the key [ro.build.flavor] returns [qssi-user].
+# On Murena OS: returns [lineage_FP4-userdebug]
+# This seems to be the most sane way to assert if we are on stock ROM
+echo "" > $SECURITY_PATCH
+if "$ADB_PATH" shell getprop ro.build.flavor 2>&1 | grep "qssi-user"
+then
+ if "$ADB_PATH" shell getprop ro.boot.vbmeta.device_state 2>&1 | grep "unlocked"
+ then
+ echo "Device is unlocked"
+ else
+ echo "Device is locked"
+ # Device is locked and on stock ROM. The prop will NOT be spoofed and can be trusted.
+ # NOTE: In case of an empty result we will skip locking later.
+ "$ADB_PATH" shell getprop ro.build.version.security_patch> $SECURITY_PATCH
+ fi
+fi
+
+exit 0
diff --git a/flash-scripts/linux/wait-fastboot-locked.sh b/flash-scripts/linux/wait-fastboot-locked.sh
new file mode 100755
index 0000000000000000000000000000000000000000..258a9dafcb7c0b369ba19a4fa7279106bba01cde
--- /dev/null
+++ b/flash-scripts/linux/wait-fastboot-locked.sh
@@ -0,0 +1,72 @@
+#!/bin/bash
+
+# Copyright (C) 2020 - Author: Ingo
+#
+# 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 .
+
+# TODO: What if 2 devices detected?
+# Parameter
+# $1: The folder where fastboot runnable is stored
+# $2: The archive folder path
+# $3: THe model of the device
+
+# Exit status
+# - 0 : Device in fastboot mode detected and bootloader unlocked
+# - 1 : Error
+
+FASTBOOT_FOLDER_PATH=$1
+FASTBOOT_PATH=${FASTBOOT_FOLDER_PATH}"fastboot"
+
+echo "fastboot path: $FASTBOOT_PATH"
+
+ARCHIVE_PATH=$2
+ARCHIVE_FOLDER_PATH=$(dirname "$2")"/"
+
+echo "Archive Path="$ARCHIVE_FOLDER_PATH
+
+device_model=$3
+
+echo "Model="$device_model
+
+SECURITY_PATCH=${ARCHIVE_FOLDER_PATH}""${device_model}"-security-patch"
+ORIGINAL_SECURITY_PATCH=$(cat "$SECURITY_PATCH")
+MURENA_ROM_INFO=${ARCHIVE_FOLDER_PATH}""${device_model}"-rom-info"
+MURENA__SECURITY_PATCH=`sed -n 's/^ro.build.version.security_patch=//p' $MURENA_ROM_INFO`
+echo "MURENA__SECURITY_PATCH=$MURENA__SECURITY_PATCH"
+
+# Assuming format is xxxx-yy-zz with otional extra info ..
+function versionToInt { printf "%03d%03d%03d%03d" $(echo "$1" | tr '-' ' '); }
+
+I_ORIGINAL_SECURITY_PATCH=$(versionToInt "$ORIGINAL_SECURITY_PATCH")
+I_MURENA__SECURITY_PATCH=$(versionToInt $MURENA__SECURITY_PATCH)
+
+if [[ "$I_ORIGINAL_SECURITY_PATCH" -lt "1" ]]
+then
+ echo "ORIGINAL ROM INFO NOT AVAILABLE => DO NOT PROCESS"
+ exit 0
+elif [[ $I_MURENA__SECURITY_PATCH -ge $I_ORIGINAL_SECURITY_PATCH ]]
+then
+ echo "GREATER OR EQUALS => PROCESS"
+else
+ echo "LOWER => DO NOT PROCESS"
+ exit 0
+fi
+
+while [ "$($FASTBOOT_PATH getvar unlocked 2>&1 | grep -q "unlocked: no"; echo $?)" = 1 ]
+do
+ sleep 2
+done
+
+#sleep 5
+echo "fastboot mode detected, phone is unlocked"
diff --git a/flash-scripts/linux/wait-fastboot-unlocked-critical.sh b/flash-scripts/linux/wait-fastboot-unlocked-critical.sh
new file mode 100755
index 0000000000000000000000000000000000000000..d0cd00191821a4721023669e92d6523401c0b9f6
--- /dev/null
+++ b/flash-scripts/linux/wait-fastboot-unlocked-critical.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+# Copyright (C) 2022 ECORP SAS - Author: merothh
+#
+# 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 .
+
+# TODO: What if 2 devices detected?
+# Parameter
+# $1: The folder where fastboot runnable is stored
+
+# Exit status
+# - 0 : Device in fastboot mode detected and bootloader critically unlocked
+# - 1 : Error
+
+FASTBOOT_FOLDER_PATH=$1
+FASTBOOT_PATH=${FASTBOOT_FOLDER_PATH}"fastboot"
+
+echo "fastboot path: $FASTBOOT_PATH"
+
+
+while [ "$($FASTBOOT_PATH oem device-info 2>&1 | grep -q "critical unlocked: true"; echo $?)" = 1 ]
+do
+ sleep 2
+done
+
+#sleep 5
+echo "fastboot mode detected, phone is critically unlocked"
diff --git a/flash-scripts/linux/wait-fastboot-unlocked.sh b/flash-scripts/linux/wait-fastboot-unlocked.sh
index 589008d370506b84b518ff70bd457c61fa5dba9e..b202b82cbf2deab500808daccff21d0a1b687ce8 100755
--- a/flash-scripts/linux/wait-fastboot-unlocked.sh
+++ b/flash-scripts/linux/wait-fastboot-unlocked.sh
@@ -33,5 +33,5 @@ do
sleep 2
done
-sleep 5
-echo "fastboot mode detected, phone is unlocked"
\ No newline at end of file
+#sleep 5
+echo "fastboot mode detected, phone is unlocked"
diff --git a/flash-scripts/windows/check_macos.bat b/flash-scripts/windows/check_macos.bat
new file mode 100755
index 0000000000000000000000000000000000000000..7ae108f271c5f61df13fafcf4e3b7a722bb7b214
--- /dev/null
+++ b/flash-scripts/windows/check_macos.bat
@@ -0,0 +1,23 @@
+@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 .
+
+:: Parameter
+
+:: Exit status
+:: - 0 : Always true
+
+exit /b 0
diff --git a/flash-scripts/windows/fp4_check_bootloader.bat b/flash-scripts/windows/fp4_check_bootloader.bat
new file mode 100644
index 0000000000000000000000000000000000000000..a05427054ffa55e02498c68edfea53773b6f1e3c
--- /dev/null
+++ b/flash-scripts/windows/fp4_check_bootloader.bat
@@ -0,0 +1,94 @@
+:: Copyright (C) 2020 - Author: Ingo; update and adoption to FP4, 2022 by ff2u
+:: Copyright (C) 2020 ECORP SAS - Author: Vincent Bourgmayer
+::
+:: 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: ARCHIVE_PATH path to the /e/ archive to flash
+:: $2: The archive folder
+:: $3: The device model
+
+:: Exit status
+:: - 0 : Fine
+:: - 1 : Error
+
+@echo OFF
+
+set FASTBOOT_FOLDER_PATH=%~1
+set FASTBOOT_PATH="%FASTBOOT_FOLDER_PATH%fastboot"
+echo "FASTBOOT path:"%FASTBOOT_PATH%
+
+::-----------
+set ARCHIVE_PATH=%~2
+echo "Archive Path=%ARCHIVE_PATH%"
+for %%a in ("%ARCHIVE_PATH%") do (
+ set ARCHIVE_FOLDER_PATH="%%~dpa
+)
+
+echo "Archive Folder Path="%ARCHIVE_FOLDER_PATH%
+
+set device_model=%~3
+echo "Model=%device_model%"
+
+set SECURITY_PATCH=%ARCHIVE_FOLDER_PATH%%device_model%-security-patch"
+set /p ORIGINAL_SECURITY_PATCH=<%SECURITY_PATCH%
+call:versionToInt %ORIGINAL_SECURITY_PATCH%
+set I_ORIGINAL_SECURITY_PATCH=%var1%
+echo "I_ORIGINAL_SECURITY_PATCH====>%I_ORIGINAL_SECURITY_PATCH%"
+
+set MURENA__SECURITY_PATCH=
+set MURENA_ROM_INFO=%ARCHIVE_FOLDER_PATH%%device_model%-rom-info"
+for /f %%i in ('findstr /b "ro.build.version.security_patch" %MURENA_ROM_INFO%') do (
+ set MURENA__SECURITY_PATCH=%%i
+ )
+SET MURENA__SECURITY_PATCH=%MURENA__SECURITY_PATCH:~32%
+echo "MURENA__SECURITY_PATCH=%MURENA__SECURITY_PATCH%"
+call:versionToInt %MURENA__SECURITY_PATCH%
+set I_MURENA__SECURITY_PATCH=%var1%
+echo "I_MURENA__SECURITY_PATCH====>%I_MURENA__SECURITY_PATCH%"
+
+if %I_ORIGINAL_SECURITY_PATCH% LSS 1 (
+ echo "ORIGINAL ROM INFO NOT AVAILABLE => DO NOT PROCESS"
+ %FASTBOOT_PATH% reboot
+ waitfor /t 30 pause 2>nul
+ exit /b 0
+)
+
+if %I_MURENA__SECURITY_PATCH% GEQ %I_ORIGINAL_SECURITY_PATCH% (
+ echo "GREATER OR EQUALS OR ORIGINAL ROM INFO NOT AVAILABLE => PROCESS"
+) else (
+ echo "LOWER DO NOT PROCESS"
+ %FASTBOOT_PATH% reboot
+ waitfor /t 30 pause 2>nul
+)
+ exit /b 0
+:: ------------------
+
+
+:: Assuming format is xxxx-yy-zz with otional will return xxyyzz
+:versionToInt
+ setlocal enabledelayedexpansion
+ set str_sum=
+ set version=%~1
+ set version=%version:-= %
+
+ for %%a in (%version%) do (
+ set "formattedValue=000000%%a"
+ set str_sum=!str_sum!!formattedValue:~-2!
+ )
+
+ ( endlocal
+ set "var1=%str_sum%"
+ )
+ goto:eof
diff --git a/flash-scripts/windows/fp4_install-from-fastboot.bat b/flash-scripts/windows/fp4_install-from-fastboot.bat
new file mode 100755
index 0000000000000000000000000000000000000000..92838e7c17e55c32f30abc7e84fda8341cf8661a
--- /dev/null
+++ b/flash-scripts/windows/fp4_install-from-fastboot.bat
@@ -0,0 +1,315 @@
+:: Copyright (C) 2020 - Author: Ingo; update and adoption to FP4, 2022 by ff2u
+:: Copyright (C) 2020 ECORP SAS - Author: Vincent Bourgmayer
+::
+:: 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: ARCHIVE_PATH path to the /e/ archive to flash
+:: $2: FASTBOOT_FOLDER_PATH: the path where runnable fastboot is stored
+:: $3: JAVA_FOLDER_PATH: the path where runnable jar is stored (to unpack ZIP file)
+
+:: Exit status
+:: - 0 : /e/ installed
+:: - 1 : erasing userdata or metadata failed
+:: - 2 : flashing of a non-critical partition failed
+:: - 4 : setting active slot to a failed
+:: - 5 : flashing of a critical partition failed
+:: namely: {devcfg_ab, xbl_ab, tz_ab, hyp_ab, keymaster_ab, abl_ab, aop_ab, imagefv_ab, multiimgoem_ab, qupfw_ab, uefisecapp_ab, xbl_config_ab}
+:: - 101 : ARCHIVE_PATH missing
+:: - 102 : archive could not be unpacked
+
+set ARCHIVE_PATH=%~1
+set FASTBOOT_FOLDER_PATH=%~2
+set FASTBOOT_PATH="%FASTBOOT_FOLDER_PATH%fastboot"
+set JAVA_FOLDER_PATH=%~3
+set JAR_PATH="%JAVA_FOLDER_PATH%\bin\jar"
+
+if not defined %ARCHIVE_PATH (
+ exit /b 101
+)
+
+for %%a in ("%ARCHIVE_PATH%") do (
+ set ARCHIVE_NAME="%%~na"
+)
+
+for %%a in ("%ARCHIVE_PATH%") do (
+ set ARCHIVE_FOLDER_PATH="%%~dpa"
+)
+
+echo "archive path : "%ARCHIVE_PATH%
+echo "archive folder path : "%ARCHIVE_FOLDER_PATH%
+echo "fastboot path : "%FASTBOOT_PATH%
+echo "jar path : "%JAR_PATH%
+
+cd "%ARCHIVE_FOLDER_PATH%"
+waitfor /t 1 pause 2>nul
+
+%JAR_PATH% -x -v -f "%ARCHIVE_PATH%"
+if errorLevel 1 ( exit /b 102 )
+echo "unpacked archive"
+waitfor /t 1 pause 2>nul
+
+echo "=== Flash slot a ==="
+
+%FASTBOOT_PATH% flash bluetooth_a bluetooth.img
+if errorLevel 1 ( exit /b 2 )
+echo "flashed bluetooth"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash devcfg_a devcfg.img
+if errorLevel 1 ( exit /b 5 )
+echo "flashed devcfg"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash dsp_a dsp.img
+if errorLevel 1 ( exit /b 2 )
+echo "flashed dsp"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash modem_a modem.img
+if errorLevel 1 ( exit /b 2 )
+echo "flashed modem"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash xbl_a xbl.img
+if errorLevel 1 ( exit /b 5 )
+echo "flashed xbl"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash tz_a tz.img
+if errorLevel 1 ( exit /b 5 )
+echo "flashed tz"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash hyp_a hyp.img
+if errorLevel 1 ( exit /b 5 )
+echo "flashed hyp"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash keymaster_a keymaster.img
+if errorLevel 1 ( exit /b 5 )
+echo "flashed keymaster"
+waitfor /t 1 pause 2>nul
+
+
+%FASTBOOT_PATH% flash abl_a abl.img
+if errorLevel 1 ( exit /b 5 )
+echo "flashed abl"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash boot_a boot.img
+if errorLevel 1 ( exit /b 2 )
+echo "flashed boot"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash recovery_a recovery.img
+if errorLevel 1 ( exit /b 2 )
+echo "flashed recovery"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash dtbo_a dtbo.img
+if errorLevel 1 ( exit /b 2 )
+echo "flashed dtbo"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash vbmeta_system_a vbmeta_system.img
+if errorLevel 1 ( exit /b 2 )
+echo "flashed vbmeta_system"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash vbmeta_a vbmeta.img
+if errorLevel 1 ( exit /b 2 )
+echo "flashed vbmeta"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash super super.img
+if errorLevel 1 ( exit /b 2 )
+echo "flashed super"
+waitfor /t 1 pause 2>nul
+
+
+%FASTBOOT_PATH% flash aop_a aop.img
+if errorLevel 1 ( exit /b 5 )
+echo "flashed aop"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash featenabler_a featenabler.img
+if errorLevel 1 ( exit /b 2 )
+echo "flashed featenabler"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash imagefv_a imagefv.img
+if errorLevel 1 ( exit /b 5 )
+echo "flashed imagefv"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash multiimgoem_a multiimgoem.img
+if errorLevel 1 ( exit /b 5 )
+echo "flashed multiimgoem"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash qupfw_a qupfw.img
+if errorLevel 1 ( exit /b 5 )
+echo "flashed qupfw"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash uefisecapp_a uefisecapp.img
+if errorLevel 1 ( exit /b 5 )
+echo "flashed uefisecapp"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash xbl_config_a xbl_config.img
+if errorLevel 1 ( exit /b 5 )
+echo "flashed xbl_config"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash core_nhlos_a core_nhlos.img
+if errorLevel 1 ( exit /b 2 )
+echo "flashed core_nhlos"
+waitfor /t 1 pause 2>nul
+
+
+echo "=== Flash slot b ==="
+
+%FASTBOOT_PATH% flash bluetooth_b bluetooth.img
+if errorLevel 1 ( exit /b 2 )
+echo "flashed bluetooth_b"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash devcfg_b devcfg.img
+if errorLevel 1 ( exit /b 5 )
+echo "flashed devcfg_b"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash dsp_b dsp.img
+if errorLevel 1 ( exit /b 2 )
+echo "flashed dsp_b"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash modem_b modem.img
+if errorLevel 1 ( exit /b 2 )
+echo "flashed modem_b"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash xbl_b xbl.img
+if errorLevel 1 ( exit /b 5 )
+echo "flashed xbl_b"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash tz_b tz.img
+if errorLevel 1 ( exit /b 5 )
+echo "flashed tz_b"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash hyp_b hyp.img
+if errorLevel 1 ( exit /b 5 )
+echo "flashed hyp_b"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash keymaster_b keymaster.img
+if errorLevel 1 ( exit /b 5 )
+echo "flashed keymaster_b"
+waitfor /t 1 pause 2>nul
+
+
+%FASTBOOT_PATH% flash abl_b abl.img
+if errorLevel 1 ( exit /b 5 )
+echo "flashed abl_b"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash boot_b boot.img
+if errorLevel 1 ( exit /b 2 )
+echo "flashed boot_b"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash recovery_b recovery.img
+if errorLevel 1 ( exit /b 2 )
+echo "flashed recovery_b"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash dtbo_b dtbo.img
+if errorLevel 1 ( exit /b 2 )
+echo "flashed dtbo_b"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash vbmeta_system_b vbmeta_system.img
+if errorLevel 1 ( exit /b 2 )
+echo "flashed vbmeta_system_b"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash vbmeta_b vbmeta.img
+if errorLevel 1 ( exit /b 2 )
+echo "flashed vbmeta_b"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash aop_b aop.img
+if errorLevel 1 ( exit /b 5 )
+echo "flashed aop_b"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash featenabler_b featenabler.img
+if errorLevel 1 ( exit /b 2 )
+echo "flashed featenabler_b"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash imagefv_b imagefv.img
+if errorLevel 1 ( exit /b 5 )
+echo "flashed imagefv_b"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash multiimgoem_b multiimgoem.img
+if errorLevel 1 ( exit /b 5 )
+echo "flashed multiimgoem_b"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash qupfw_b qupfw.img
+if errorLevel 1 ( exit /b 5 )
+echo "flashed qupfw_b"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash uefisecapp_b uefisecapp.img
+if errorLevel 1 ( exit /b 5 )
+echo "flashed uefisecapp_b"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash xbl_config_b xbl_config.img
+if errorLevel 1 ( exit /b 5 )
+echo "flashed xbl_config_b"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% flash core_nhlos_b core_nhlos.img
+if errorLevel 1 ( exit /b 2 )
+echo "flashed core_nhlos_b"
+waitfor /t 1 pause 2>nul
+
+echo "=== Wiping userdata and metadata ==="
+waitfor /t 3 pause 2>nul
+
+%FASTBOOT_PATH% erase userdata
+if errorLevel 1 ( exit /b 1 )
+echo "wiped userdata"
+waitfor /t 1 pause 2>nul
+
+%FASTBOOT_PATH% erase metadata
+if errorLevel 1 ( exit /b 1 )
+echo "wiped metadata"
+waitfor /t 3 pause 2>nul
+
+echo "=== Setting active slot to a ==="
+%FASTBOOT_PATH% --set-active=a
+if errorLevel 1 ( exit /b 4 )
+echo "switched slot to a"
+waitfor /t 1 pause 2>nul
+
+exit /b 0
diff --git a/flash-scripts/windows/fp4_lock.bat b/flash-scripts/windows/fp4_lock.bat
new file mode 100755
index 0000000000000000000000000000000000000000..cc33bb0c51a2489cf02e21e6ac75835c2a826614
--- /dev/null
+++ b/flash-scripts/windows/fp4_lock.bat
@@ -0,0 +1,104 @@
+:: Copyright (C) 2020 - Author: Ingo; update and adoption to FP4, 2022 by ff2u
+:: Copyright (C) 2020 ECORP SAS - Author: Vincent Bourgmayer
+::
+:: 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: The folder where fastboot runnable is stored
+:: $2: The archive folder
+:: $3: The device model
+
+:: Exit status
+:: - 0 : success
+:: - 1 : Error
+:: - 102 : locking the bootloader failed
+
+@echo OFF
+
+set FASTBOOT_FOLDER_PATH=%~1
+set FASTBOOT_PATH="%FASTBOOT_FOLDER_PATH%fastboot"
+echo "FASTBOOT path:"%FASTBOOT_PATH%
+
+::-----------
+set ARCHIVE_PATH=%~2
+echo "Archive Path=%ARCHIVE_PATH%"
+for %%a in ("%ARCHIVE_PATH%") do (
+ set ARCHIVE_FOLDER_PATH="%%~dpa
+)
+
+echo "Archive Folder Path="%ARCHIVE_FOLDER_PATH%
+
+set device_model=%~3
+
+echo "Model=%device_model%"
+
+set SECURITY_PATCH=%ARCHIVE_FOLDER_PATH%%device_model%-security-patch"
+set /p ORIGINAL_SECURITY_PATCH=<%SECURITY_PATCH%
+call:versionToInt %ORIGINAL_SECURITY_PATCH%
+set I_ORIGINAL_SECURITY_PATCH=%var1%
+echo "I_ORIGINAL_SECURITY_PATCH====>%I_ORIGINAL_SECURITY_PATCH%"
+
+set MURENA__SECURITY_PATCH=
+set MURENA_ROM_INFO=%ARCHIVE_FOLDER_PATH%%device_model%-rom-info"
+for /f %%i in ('findstr /b "ro.build.version.security_patch" %MURENA_ROM_INFO%') do (
+ set MURENA__SECURITY_PATCH=%%i
+ )
+SET MURENA__SECURITY_PATCH=%MURENA__SECURITY_PATCH:~32%
+echo "MURENA__SECURITY_PATCH=%MURENA__SECURITY_PATCH%"
+call:versionToInt %MURENA__SECURITY_PATCH%
+set I_MURENA__SECURITY_PATCH=%var1%
+echo "I_MURENA__SECURITY_PATCH====>%I_MURENA__SECURITY_PATCH%"
+
+
+if %I_ORIGINAL_SECURITY_PATCH% LSS 1 (
+ echo "ORIGINAL ROM INFO NOT AVAILABLE => DO NOT PROCESS"
+ exit /b 0
+)
+
+if %I_MURENA__SECURITY_PATCH% GEQ %I_ORIGINAL_SECURITY_PATCH% (
+ echo "GREATER OR EQUALS OR ORIGINAL ROM INFO NOT AVAILABLE => PROCESS"
+) else (
+ echo "LOWER DO NOT PROCESS"
+ exit /b 0
+)
+:: ------------------
+
+%FASTBOOT_PATH% flashing lock
+
+if errorLevel 1 (
+ echo "flashing lock fails"
+ exit /b 102
+)
+
+waitfor /t 10 pause 2>nul
+
+exit /b 0
+
+
+:: Assuming format is xxxx-yy-zz with otional will return xxyyzz
+:versionToInt
+ setlocal enabledelayedexpansion
+ set str_sum=
+ set version=%~1
+ set version=%version:-= %
+
+ for %%a in (%version%) do (
+ set "formattedValue=000000%%a"
+ set str_sum=!str_sum!!formattedValue:~-2!
+ )
+
+ ( endlocal
+ set "var1=%str_sum%"
+ )
+ goto:eof
\ No newline at end of file
diff --git a/flash-scripts/windows/fp4_lock_critical.bat b/flash-scripts/windows/fp4_lock_critical.bat
new file mode 100755
index 0000000000000000000000000000000000000000..06a55f91cde7bd544a666a65f0168452ef546f21
--- /dev/null
+++ b/flash-scripts/windows/fp4_lock_critical.bat
@@ -0,0 +1,110 @@
+:: Copyright (C) 2020 - Author: Ingo; update and adoption to FP4, 2022 by ff2u
+:: Copyright (C) 2020 ECORP SAS - Author: Vincent Bourgmayer
+::
+:: 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: The folder where fastboot runnable is stored
+:: $2: The archive folder
+:: $3: The device model
+
+:: Exit status
+:: - 0 : success
+:: - 1 : Error
+:: - 101 : locking the bootloader failed
+
+@echo OFF
+
+set FASTBOOT_FOLDER_PATH=%~1
+set FASTBOOT_PATH="%FASTBOOT_FOLDER_PATH%fastboot"
+echo "FASTBOOT path:"%FASTBOOT_PATH%
+
+
+::-----------
+set ARCHIVE_PATH=%~2
+echo "Archive Path=%ARCHIVE_PATH%"
+for %%a in ("%ARCHIVE_PATH%") do (
+ set ARCHIVE_FOLDER_PATH="%%~dpa
+)
+
+echo "Archive Folder Path="%ARCHIVE_FOLDER_PATH%
+
+set device_model=%~3
+
+echo "Model=%device_model%"
+
+set SECURITY_PATCH=%ARCHIVE_FOLDER_PATH%%device_model%-security-patch"
+set /p ORIGINAL_SECURITY_PATCH=<%SECURITY_PATCH%
+call:versionToInt %ORIGINAL_SECURITY_PATCH%
+set I_ORIGINAL_SECURITY_PATCH=%var1%
+echo "I_ORIGINAL_SECURITY_PATCH====>%I_ORIGINAL_SECURITY_PATCH%"
+
+set MURENA__SECURITY_PATCH=
+set MURENA_ROM_INFO=%ARCHIVE_FOLDER_PATH%%device_model%-rom-info"
+for /f %%i in ('findstr /b "ro.build.version.security_patch" %MURENA_ROM_INFO%') do (
+ set MURENA__SECURITY_PATCH=%%i
+ )
+SET MURENA__SECURITY_PATCH=%MURENA__SECURITY_PATCH:~32%
+echo "MURENA__SECURITY_PATCH=%MURENA__SECURITY_PATCH%"
+call:versionToInt %MURENA__SECURITY_PATCH%
+set I_MURENA__SECURITY_PATCH=%var1%
+echo "I_MURENA__SECURITY_PATCH====>%I_MURENA__SECURITY_PATCH%"
+
+if %I_ORIGINAL_SECURITY_PATCH% LSS 1 (
+ echo "ORIGINAL ROM INFO NOT AVAILABLE => DO NOT PROCESS"
+ exit /b 0
+)
+
+if %I_MURENA__SECURITY_PATCH% GEQ %I_ORIGINAL_SECURITY_PATCH% (
+ echo "GREATER OR EQUALS OR ORIGINAL ROM INFO NOT AVAILABLE => PROCESS"
+) else (
+ echo "LOWER DO NOT PROCESS"
+ exit /b 0
+)
+:: ------------------
+
+%FASTBOOT_PATH% flashing lock_critical
+
+if errorLevel 1 (
+ echo "Lock Critical fails!"
+ exit /b 101
+)
+
+:wait-leave-fastboot
+%FASTBOOT_PATH% devices 2>nul | findstr fastboot
+if %ERRORLEVEL% EQU 0 (
+ waitfor /t 1 pause 2>nul
+ goto :wait-leave-fastboot
+)
+
+exit /b 0
+
+
+
+:: Assuming format is xxxx-yy-zz with otional will return xxyyzz
+:versionToInt
+ setlocal enabledelayedexpansion
+ set str_sum=
+ set version=%~1
+ set version=%version:-= %
+
+ for %%a in (%version%) do (
+ set "formattedValue=000000%%a"
+ set str_sum=!str_sum!!formattedValue:~-2!
+ )
+
+ ( endlocal
+ set "var1=%str_sum%"
+ )
+ goto:eof
\ No newline at end of file
diff --git a/flash-scripts/windows/fp4_oem-unlock-critical.bat b/flash-scripts/windows/fp4_oem-unlock-critical.bat
new file mode 100755
index 0000000000000000000000000000000000000000..c47ba1394fa7410468330fc3eb743eaef772a674
--- /dev/null
+++ b/flash-scripts/windows/fp4_oem-unlock-critical.bat
@@ -0,0 +1,43 @@
+:: Copyright (C) 2020 - Author: Ingo; update and adoption to FP4, 2022 by ff2u
+:: Copyright (C) 2020 ECORP SAS - Author: Vincent Bourgmayer
+::
+:: 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: The folder where fastboot runnable is stored
+
+:: Exit status
+:: - 0 : OEM unlocked on device
+:: - 10 : fastboot error
+
+set FASTBOOT_FOLDER_PATH=%~1
+set FASTBOOT_PATH="%FASTBOOT_FOLDER_PATH%fastboot"
+
+echo "FASTBOOT path:"%FASTBOOT_PATH%
+
+%FASTBOOT_PATH% oem device-info 2>&1 | findstr /c:"critical unlocked: true"
+if %ERRORLEVEL% EQU 0 (
+ waitfor /t 10 pause 2>nul
+ echo "Device already critically unlocked!"
+) else (
+ %FASTBOOT_PATH% flashing unlock_critical
+ if errorLevel 1 (
+ echo "Critical unlock fails!"
+ exit /b 10
+ )
+ waitfor /t 10 pause 2>nul
+ echo "Critical unlocked!"
+)
+
+exit /b 0
diff --git a/flash-scripts/windows/fp4_oem-unlock.bat b/flash-scripts/windows/fp4_oem-unlock.bat
new file mode 100755
index 0000000000000000000000000000000000000000..c4c3509dfc5376bba285438e96391ecdd36240cb
--- /dev/null
+++ b/flash-scripts/windows/fp4_oem-unlock.bat
@@ -0,0 +1,43 @@
+:: Copyright (C) 2020 - Author: Ingo; update and adoption to FP4, 2022 by ff2u
+:: Copyright (C) 2020 ECORP SAS - Author: Vincent Bourgmayer
+::
+:: 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: The folder where fastboot runnable is stored
+
+:: Exit status
+:: - 0 : OEM unlocked on device
+:: - 10 : fastboot error
+
+set FASTBOOT_FOLDER_PATH=%~1
+set FASTBOOT_PATH="%FASTBOOT_FOLDER_PATH%fastboot"
+
+echo "FASTBOOT path:"%FASTBOOT_PATH%
+
+%FASTBOOT_PATH% getvar unlocked 2>&1 | findstr yes
+if %ERRORLEVEL% EQU 0 (
+ waitfor /t 10 pause 2>nul
+ echo "Device already unlocked"
+) else (
+ %FASTBOOT_PATH% flashing unlock
+ if errorLevel 1 (
+ echo "flashing unlock fails"
+ exit /b 10
+ )
+ waitfor /t 10 pause 2>nul
+ echo "flashing unlocked"
+)
+
+exit /b 0
diff --git a/flash-scripts/windows/store-rom-info.bat b/flash-scripts/windows/store-rom-info.bat
new file mode 100644
index 0000000000000000000000000000000000000000..db0597ce3ddf961c305b5b0c6863c656e5b4baed
--- /dev/null
+++ b/flash-scripts/windows/store-rom-info.bat
@@ -0,0 +1,83 @@
+:: Copyright (C) 2022 - 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 .
+::
+:: TODO: What if 2 devices detected?
+:: Parameter
+:: $1: The folder where fastboot runnable is stored
+:: $2: The archive folder
+:: $3: The device model
+::
+:: Exit status
+:: - 0 : Device in fastboot mode detected
+:: - 1 : Error (adb)
+:: - 2 : Error (device locked)
+
+:: Store ROM information on the file system
+
+@echo OFF
+
+
+
+set FASTBOOT_FOLDER_PATH=%~1
+set ADB_PATH="%FASTBOOT_FOLDER_PATH%adb"
+
+echo "adb command=%ADB_PATH%""
+
+set ARCHIVE_PATH=%~2
+echo "Archive Path=%ARCHIVE_PATH%"
+for %%a in ("%ARCHIVE_PATH%") do (
+ set ARCHIVE_FOLDER_PATH="%%~dpa
+)
+
+echo "Archive Folder Path="%ARCHIVE_FOLDER_PATH%
+
+set device_model=%~3
+
+echo "Model=%device_model%"
+
+%ADB_PATH% shell getprop ro.build.version.security_patch
+
+if errorLevel 1 (
+ echo "adb error (1)"
+ exit /b 1
+)
+
+set SECURITY_PATCH=%ARCHIVE_FOLDER_PATH%%device_model%-security-patch"
+set DEVICE_STATE=%ARCHIVE_FOLDER_PATH%%device_model%-device-state"
+set MURENA_ROM_INFO=%ARCHIVE_FOLDER_PATH%%device_model%-rom-info"
+
+bitsadmin.exe /transfer "RomInfo" https://images.ecloud.global/stable/FP4/e-latest-FP4.zip.prop %MURENA_ROM_INFO% > nul
+
+:: For FP4 on stock ROM the key [ro.build.flavor] returns [qssi-user].
+:: On Murena OS: returns [lineage_FP4-userdebug]
+:: This seems to be the most sane way to assert if we are on stock ROM
+copy /y NUL %SECURITY_PATCH% >NUL
+
+%ADB_PATH% shell getprop ro.build.flavor 2>&1 | findstr "qssi-user"
+if errorLevel 1 (
+ ::We are NOT on a stock ROM let's assume the job (unlock) is done and continue the process.
+ echo "Custom ROM case"
+ exit /b 0
+)
+
+echo "Stock ROM"
+%ADB_PATH% shell getprop ro.boot.vbmeta.device_state 2>&1 | findstr "unlocked"
+if errorLevel 1 (
+ echo "The device is locked"
+ %ADB_PATH% shell getprop ro.build.version.security_patch> %SECURITY_PATCH%
+)
+
+exit /b 0
+
diff --git a/flash-scripts/windows/wait-fastboot-locked.bat b/flash-scripts/windows/wait-fastboot-locked.bat
new file mode 100755
index 0000000000000000000000000000000000000000..5e85a348cf71d869f23a91a1daefa80b0c5d9b44
--- /dev/null
+++ b/flash-scripts/windows/wait-fastboot-locked.bat
@@ -0,0 +1,107 @@
+:: Copyright (C) 2020 - Author: Ingo
+:: Copyright (C) 2020 ECORP SAS - Author: Vincent Bourgmayer
+::
+:: 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 .
+
+:: TODO: What if 2 devices detected?
+:: $1: The folder where fastboot runnable is stored
+:: $2: The archive folder
+:: $3: The device model
+
+:: Exit status
+:: - 0 : Device in fastboot mode detected
+:: - 1 : Error
+
+@echo OFF
+
+
+::-----------
+set ARCHIVE_PATH=%~2
+echo "Archive Path=%ARCHIVE_PATH%"
+for %%a in ("%ARCHIVE_PATH%") do (
+ set ARCHIVE_FOLDER_PATH="%%~dpa
+)
+
+echo "Archive Folder Path="%ARCHIVE_FOLDER_PATH%
+
+set device_model=%~3
+
+echo "Model=%device_model%"
+
+set SECURITY_PATCH=%ARCHIVE_FOLDER_PATH%%device_model%-security-patch"
+set /p ORIGINAL_SECURITY_PATCH=<%SECURITY_PATCH%
+call:versionToInt %ORIGINAL_SECURITY_PATCH%
+set I_ORIGINAL_SECURITY_PATCH=%var1%
+echo "I_ORIGINAL_SECURITY_PATCH====>%I_ORIGINAL_SECURITY_PATCH%"
+
+set MURENA__SECURITY_PATCH=
+set MURENA_ROM_INFO=%ARCHIVE_FOLDER_PATH%%device_model%-rom-info"
+for /f %%i in ('findstr /b "ro.build.version.security_patch" %MURENA_ROM_INFO%') do (
+ set MURENA__SECURITY_PATCH=%%i
+ )
+SET MURENA__SECURITY_PATCH=%MURENA__SECURITY_PATCH:~32%
+echo "MURENA__SECURITY_PATCH=%MURENA__SECURITY_PATCH%"
+call:versionToInt %MURENA__SECURITY_PATCH%
+set I_MURENA__SECURITY_PATCH=%var1%
+echo "I_MURENA__SECURITY_PATCH====>%I_MURENA__SECURITY_PATCH%"
+
+if %I_ORIGINAL_SECURITY_PATCH% LSS 1 (
+ echo "ORIGINAL ROM INFO NOT AVAILABLE => DO NOT PROCESS"
+ exit /b 0
+)
+
+if %I_MURENA__SECURITY_PATCH% GEQ %I_ORIGINAL_SECURITY_PATCH% (
+ echo "GREATER OR EQUALS OR ORIGINAL ROM INFO NOT AVAILABLE => PROCESS"
+) else (
+ echo "LOWER DO NOT PROCESS"
+ exit /b 0
+)
+:: ------------------
+
+set FASTBOOT_FOLDER_PATH=%~1
+set FASTBOOT_PATH="%FASTBOOT_FOLDER_PATH%fastboot"
+echo "FASTBOOT path:"%FASTBOOT_PATH%
+
+:fastboot_detect
+%FASTBOOT_PATH% getvar unlocked 2>&1 | findstr /c:"unlocked: no"
+if errorLevel 1 (
+ waitfor /t 2 pause 2>nul
+ goto :fastboot_detect
+)
+
+call fastboot_detect
+
+:: waitfor /t 5 pause 2>nul
+echo "fastboot mode detected, phone is unlocked"
+
+exit /b 0
+
+
+
+:: Assuming format is xxxx-yy-zz with otional will return xxyyzz
+:versionToInt
+ setlocal enabledelayedexpansion
+ set str_sum=
+ set version=%~1
+ set version=%version:-= %
+
+ for %%a in (%version%) do (
+ set "formattedValue=000000%%a"
+ set str_sum=!str_sum!!formattedValue:~-2!
+ )
+
+ ( endlocal
+ set "var1=%str_sum%"
+ )
+ goto:eof
\ No newline at end of file
diff --git a/flash-scripts/windows/wait-fastboot-unlocked-critical.bat b/flash-scripts/windows/wait-fastboot-unlocked-critical.bat
new file mode 100755
index 0000000000000000000000000000000000000000..3dbaa63b1938c420188249f09b983d24b7d54bc3
--- /dev/null
+++ b/flash-scripts/windows/wait-fastboot-unlocked-critical.bat
@@ -0,0 +1,46 @@
+:: Copyright (C) 2020 - Author: Ingo
+:: Copyright (C) 2020 ECORP SAS - Author: Vincent Bourgmayer
+::
+:: 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 .
+
+:: TODO: What if 2 devices detected?
+:: $1: The folder where fastboot runnable is stored
+
+:: Exit status
+:: - 0 : Device in fastboot mode detected
+:: - 1 : Error
+
+@echo Off
+
+set FASTBOOT_FOLDER_PATH=%~1
+set ADB_PATH="%FASTBOOT_FOLDER_PATH%adb"
+set FASTBOOT_PATH="%FASTBOOT_FOLDER_PATH%fastboot"
+
+
+:fastboot_detect
+%FASTBOOT_PATH% oem device-info 2>&1 | findstr /c:"critical unlocked: true"
+if errorLevel 1 (
+ waitfor /t 2 pause 2>nul
+ goto :fastboot_detect
+)
+
+call fastboot_detect
+
+:: waitfor /t 5 pause 2>nul
+echo "fastboot mode detected, phone is critically unlocked"
+
+exit /b 0
+
+
+
\ No newline at end of file
diff --git a/flash-scripts/windows/wait-fastboot-unlocked.bat b/flash-scripts/windows/wait-fastboot-unlocked.bat
index 5db8ceb379fcbbe197e2a26b9670e63f187cd9af..997653fbacab3ea925017d12adfd3fe5dc6761e6 100755
--- a/flash-scripts/windows/wait-fastboot-unlocked.bat
+++ b/flash-scripts/windows/wait-fastboot-unlocked.bat
@@ -28,13 +28,13 @@ echo "FASTBOOT path:"%FASTBOOT_PATH%
:fastboot_detect
%FASTBOOT_PATH% getvar unlocked 2>&1 | findstr yes
if errorLevel 1 (
- timeout 2 >nul 2>&1
+ waitfor /t 2 pause 2>nul
goto :fastboot_detect
)
call fastboot_detect
-timeout 5 >nul
+:: waitfor /t 5 pause 2>nul
echo "fastboot mode detected, phone is unlocked"
-exit /b 0
\ No newline at end of file
+exit /b 0
diff --git a/flash-scripts/windows/wait-fastboot.bat b/flash-scripts/windows/wait-fastboot.bat
index 769a8ad5b59d50ab5718a609c373ce772e83c42a..5bcf5e5114a93e5de589d06b275b94b772a45855 100755
--- a/flash-scripts/windows/wait-fastboot.bat
+++ b/flash-scripts/windows/wait-fastboot.bat
@@ -28,13 +28,13 @@ echo "FASTBOOT path:"%FASTBOOT_PATH%
:fastboot_detect
%FASTBOOT_PATH% devices 2>&1 | findstr fastboot
if errorLevel 1 (
- timeout 1 >nul 2>&1
+ waitfor /t 1 pause 2>nul
goto :fastboot_detect
)
call fastboot_detect
-timeout 5 >nul
+waitfor /t 5 pause 2>nul
echo "fastboot mode detected"
-exit /b 0
\ No newline at end of file
+exit /b 0
diff --git a/src/main/java/ecorp/easy/installer/AppConstants.java b/src/main/java/ecorp/easy/installer/AppConstants.java
index 12a71106bc2dc26d28dae0476487a6a96460e2e1..015bc23e41a099fc3718b91b2693787a61a51f92 100644
--- a/src/main/java/ecorp/easy/installer/AppConstants.java
+++ b/src/main/java/ecorp/easy/installer/AppConstants.java
@@ -82,6 +82,13 @@ public abstract class AppConstants {
DEVICE_MODEL = deviceModel;
}
+ /**
+ * This methods get the model of the device
+ */
+ public static String getDeviceModel(){
+ return DEVICE_MODEL;
+ }
+
/**
* Get the path to eel OS archive to flash
* @return can return null if not already setted
diff --git a/src/main/java/ecorp/easy/installer/controllers/subcontrollers/DownloadSrcController.java b/src/main/java/ecorp/easy/installer/controllers/subcontrollers/DownloadSrcController.java
index a8ed2fc46ad62e33c1d7001a35d9da2dc3a5e374..1fdc5f6c23f7d1b6d45d5a6ff9c0d1df97a78ff8 100644
--- a/src/main/java/ecorp/easy/installer/controllers/subcontrollers/DownloadSrcController.java
+++ b/src/main/java/ecorp/easy/installer/controllers/subcontrollers/DownloadSrcController.java
@@ -142,6 +142,7 @@ public class DownloadSrcController extends AbstractSubController {
CommandExecutionTask.updateCommonParam("TWRP_IMAGE_PATH", sourcesFolderPath+AppConstants.getTwrpImgPath());
CommandExecutionTask.updateCommonParam("ARCHIVE_PATH", sourcesFolderPath+AppConstants.getEArchivePath());
CommandExecutionTask.updateCommonParam("PATCH_PATH", sourcesFolderPath+AppConstants.getPatchPath());
+ CommandExecutionTask.updateCommonParam("DEVICE_MODEL", AppConstants.getDeviceModel());
parentController.disableNextButton(false);
}
diff --git a/src/main/java/ecorp/easy/installer/helpers/DeviceHelper.java b/src/main/java/ecorp/easy/installer/helpers/DeviceHelper.java
index 99b1e2c876577f18229de9bfd467c68a93cd1a68..eecdce9e272dff1f1b9699bbd7e7dec34c19ed76 100644
--- a/src/main/java/ecorp/easy/installer/helpers/DeviceHelper.java
+++ b/src/main/java/ecorp/easy/installer/helpers/DeviceHelper.java
@@ -61,6 +61,7 @@ public class DeviceHelper {
put("flame", "0016");
put("coral", "0017");
put("keyword", "0018"); //OnePlus7 Pro
+ put("FP4", "0019");
put("OnePlus8Pro", "0021");
put("OnePlusNord", "0022"); //avicii
}};
diff --git a/src/main/java/ecorp/easy/installer/tasks/CommandExecutionTask.java b/src/main/java/ecorp/easy/installer/tasks/CommandExecutionTask.java
index 395b1f201202cfe6fe6a3c3a6dcacbd88aed11d4..dd8dc9c0c676cbe2ab953ad73133499ce96fbdd1 100644
--- a/src/main/java/ecorp/easy/installer/tasks/CommandExecutionTask.java
+++ b/src/main/java/ecorp/easy/installer/tasks/CommandExecutionTask.java
@@ -56,6 +56,7 @@ public class CommandExecutionTask extends Task {
COMMON_PARAMS.put("ADB_FOLDER_PATH", AppConstants.getADBFolderPath());
COMMON_PARAMS.put("HEIMDALL_FOLDER_PATH", AppConstants.getHeimdallFolderPath());
COMMON_PARAMS.put("JAVA_FOLDER_PATH", AppConstants.JavaHome);
+ COMMON_PARAMS.put("DEVICE_MODEL", AppConstants.getDeviceModel());
}
/**
@@ -131,7 +132,7 @@ public class CommandExecutionTask extends Task {
line = br.readLine();
//I don't remember the reason of the second part of the below test...
- if( line != null && !line.equals("null") ){
+ if( line != null && !line.equals("null") && line.length() > 1 ){
sb.append("\n\n").append(line);
logger.debug("\n (debug)"+line);
}
diff --git a/src/main/resources/images/FP4_bootscreen_warning-2.png b/src/main/resources/images/FP4_bootscreen_warning-2.png
new file mode 100644
index 0000000000000000000000000000000000000000..9cf46deb29250f12206cfece6e8e24358bc3e983
Binary files /dev/null and b/src/main/resources/images/FP4_bootscreen_warning-2.png differ
diff --git a/src/main/resources/images/FP4_fastboot_mode.png b/src/main/resources/images/FP4_fastboot_mode.png
new file mode 100644
index 0000000000000000000000000000000000000000..22034b40fed7f106fedfcffc34ebc488f9884712
Binary files /dev/null and b/src/main/resources/images/FP4_fastboot_mode.png differ
diff --git a/src/main/resources/images/FP4_lock_bootloader-2.png b/src/main/resources/images/FP4_lock_bootloader-2.png
new file mode 100644
index 0000000000000000000000000000000000000000..6766d49e276c3092c97bea372cdc50ea61d880f7
Binary files /dev/null and b/src/main/resources/images/FP4_lock_bootloader-2.png differ
diff --git a/src/main/resources/images/FP4_prepare_fastboot_mode.png b/src/main/resources/images/FP4_prepare_fastboot_mode.png
new file mode 100644
index 0000000000000000000000000000000000000000..a8070ab9e2ee6e5de70b5f4846afd833545a22cc
Binary files /dev/null and b/src/main/resources/images/FP4_prepare_fastboot_mode.png differ
diff --git a/src/main/resources/images/FP4_rejoinBootloader.png b/src/main/resources/images/FP4_rejoinBootloader.png
new file mode 100644
index 0000000000000000000000000000000000000000..6670ea6d0dd02bed598456625a509497db4c1e62
Binary files /dev/null and b/src/main/resources/images/FP4_rejoinBootloader.png differ
diff --git a/src/main/resources/images/FP4_select_lock_bootloader.png b/src/main/resources/images/FP4_select_lock_bootloader.png
new file mode 100644
index 0000000000000000000000000000000000000000..ee9bdde91d14ac408c03728d9b5d5b81aa2a3392
Binary files /dev/null and b/src/main/resources/images/FP4_select_lock_bootloader.png differ
diff --git a/src/main/resources/images/FP4_select_unlock_bootloader.png b/src/main/resources/images/FP4_select_unlock_bootloader.png
new file mode 100644
index 0000000000000000000000000000000000000000..7a9982036b32e75a8cd1a71b0564b07c15b32840
Binary files /dev/null and b/src/main/resources/images/FP4_select_unlock_bootloader.png differ
diff --git a/src/main/resources/images/FP4_select_unlock_bootloader_2.png b/src/main/resources/images/FP4_select_unlock_bootloader_2.png
new file mode 100644
index 0000000000000000000000000000000000000000..bf1c3342359e8caa3caac8e58a95cce8ea64df25
Binary files /dev/null and b/src/main/resources/images/FP4_select_unlock_bootloader_2.png differ
diff --git a/src/main/resources/instructions/imageName_en_EN_0019.properties b/src/main/resources/instructions/imageName_en_EN_0019.properties
new file mode 100644
index 0000000000000000000000000000000000000000..8873360cf6861918b944ff56f71d7f07b8a96f0e
--- /dev/null
+++ b/src/main/resources/instructions/imageName_en_EN_0019.properties
@@ -0,0 +1,28 @@
+# Copyright 2019-2020 - 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 .
+
+
+
+install_instr_prepareFastboot_FP4=FP4_prepare_fastboot_mode.png
+install_instr_showFastboot=FP4_fastboot_mode.png
+install_instr_waitFastbootmodeDetected=FP4_fastboot_mode.png
+
+install_instr_selectUnlockBootloader=FP4_select_unlock_bootloader.png
+install_instr_unlockBootloader=FP4_select_unlock_bootloader_2.png
+install_instr_rejoinBootloader=FP4_rejoinBootloader.png
+install_instr_ifYouMissedTimeout_FP4=FP4_fastboot_mode.png
+
+install_instr_selectLockBootloader=FP4_select_lock_bootloader.png
+install_instr_lockBootloader=FP4_lock_bootloader-2.png
diff --git a/src/main/resources/lang/translation.properties b/src/main/resources/lang/translation.properties
index 8c8c0e8edabd844b1ed9f9108b91ab6188e20bbd..98c0a371fe7d2bffde62157524a5330df6837529 100644
--- a/src/main/resources/lang/translation.properties
+++ b/src/main/resources/lang/translation.properties
@@ -129,8 +129,24 @@ install_instr_unlockBootloader=Confirm with "Power" button. After that the phone
install_instr_unlockBootloader_already=If your phone is already unlocked, you don't have to do anything. The phone will then restart automatically
install_instr_selectLockBootloader=Select "LOCK BOOTLOADER" with "Volume" button
install_instr_lockBootloader=Confirm with "Power" button. After that the phone will reboot automatically
-install_instr_bootWarning= On the boot warning screen, you have 5 seconds to press "Volume Down", to enter options menu.
+install_instr_bootWarning=On the boot warning screen, you have 5 seconds to press "Volume Down", to enter options menu.
+install_instr_rejoinBootloader=Immediately hold down the Vol. Down button to enter Fastboot Mode. You have around 3 secs to do so.
install_instr_ifYouMissedTimeout=If you missed it, don't panic! Restart in Fastboot mode : turn off device then keep pressing "Power" & "Volume Down".
+##FP4
+#stepTitles
+stepTitle_lockBootloaderCritical=Lock Critical Partitions
+#install_instructions
+install_instr_prepareFastboot_FP4=When the phone is completely off, press and hold the "Volume Down" button and reconnect the USB cable.
+install_instr_showFastboot=Wait until the device shows up into fastboot mode.
+install_instr_ifYouMissedTimeout_FP4=If you missed it, dont't panic! Restart your device again into the fastboot mode:\nPull off the USB cable and turn off your device\nKeeping "Volume Down" button pressed, connect the USB cable again\nYou should now be in fastboot mode.
+script_error_store_rom_info_1=Cannot get security patch information.
+stepTitle_checkLock=Checking the lock
+install_instr_lockfailed=if you see this message, it means that the bootloader has not been locked. In this case you will see a screen that the bootloader is not locked every time you start the device. You can ignore the message displayed at the startup of the phone and start it normally.
+stepTitle_checkLock_mac_bootloader=Restart in bootloader mode
+install_instr_mac_bootloader=Using only the menu on the phone, select "Restart Bootloader" with the volume keys and confirm with "Power".
+install_instr_mac_bootloader_1=The phone will reboot and should proceed to the next step "Installation of /e/". If this is not the case, you must redo the operation below once again.
+
+#
## General
install_title_Log=Log
install_btn_sendLog=Send to support
@@ -243,6 +259,8 @@ script_error_installFromRecovery_102 = Can't locate the required file
script_error_installFromFastboot_1 = Could not wipe user data
script_error_installFromFastboot_2 = Flashing of one partition failed
script_error_installFromFastboot_3 = Could not lock the bootloader
+script_error_installFromFastboot_4 = Setting boot slot has failed
+script_error_installFromFastboot_5 = Flashing of one critical partition failed
script_error_installFromFastboot_101 = No /e/ install archive provided
script_error_installFromFastboot_102 = Could not unpack /e/ install archive
script_error_installFromSideload = Could not install /e/ from eRecovery
@@ -349,9 +367,13 @@ installationTitle = Installation
# Title
stepTitle1On7 = Connect device and start Download mode
-stepTitle2On7 = Unlock OEM
+stepTitleOemUnlock = Unlock OEM
+stepTitle_criticalUnlock = Critical Unlock
+stepTitleCheckSPL = Checking Security Patch Level
stepTitle3On7 = Restart device in Download mode
-stepTitle3On7FP3 = Unlock Bootloader and restart device in Fastboot mode
+stepTitle_unlockBootloader = Unlock Bootloader and restart device in Fastboot mode
+stepTitle_unlockBootloaderCritical = Critical Unlock Bootloader and restart device in Fastboot mode
+stepTitle_lockBootloader = Lock Bootloader and restart device in Fastboot mode
stepTitle4On7 = Recovery installation
stepTitle5On7 = Restart device in Recovery mode
stepTitle6On7 = /e/ Installation
diff --git a/src/main/resources/lang/translation_de.properties b/src/main/resources/lang/translation_de.properties
index 3e6f9fb6b457ee1e242136f0029de4a5112ba985..bf20875403053fec9e0043c385e51c93cb6a1a5d 100644
--- a/src/main/resources/lang/translation_de.properties
+++ b/src/main/resources/lang/translation_de.properties
@@ -78,6 +78,10 @@ download_lbl_noInternet=Keine Internet-Verbindung
download_lbl_complete=Das Herunterladen war erfolgreich, du kannst nun /e/-OS auf dein Smartphone installieren!
download_lbl_bePatient=Das kann einige Zeit dauern, bitte habe etwas Geduld.
download_lbl_download=Wir laden nun die erforderlichen Dateien auf deinen Computer herunter
+##FP4
+install_instr_ifYouMissedTimeout_FP4=Wenn du es verpasst hast, keine Panik! Starte neu in den Fastboot-Modus:\nZiehe das USB-Kabel ab, schalte dein Gerät aus, halte die „Lautstärke leiser“-Taste gedrückt und verbinde gleichzeitig das USB-Kabel. Warte, bis Du wieder im Fastboot-Modus bist (grünes „START“ erscheint).
+install_instr_prepareFastboot_FP4=Wenn das Telefon komplett aus ist die "Lautstärke leiser"-Taste drücken und gedrückt lassen und das USB-Kabel wieder anstecken.
+##General
#Download
download_mTitle=Herunterladen von /e/OS und den notwendigen Dateien
detect_btn_tryWithAnotherDevice=Versuche es mit einem anderen Gerät
@@ -127,6 +131,8 @@ script_error_waitReboot_101=Die Instruktionen können nicht auf dem Gerät ausge
script_error_waitReboot_10=Die Seriennummer des Gerätes ist nicht angegeben
script_error_installFromFastboot_102=Das /e/-Installationsarchiv konnte nicht entpackt werden
script_error_installFromFastboot_101=Kein /e/-Installationsarchiv bereitgestellt
+script_error_installFromFastboot_5=Das Flashen einer der critical-Partitionen ist fehlgeschlagen
+script_error_installFromFastboot_4=Das Setzen des Boot-Slot ist fehlgeschlagen
script_error_installFromFastboot_3=Der Bootloader konnte nicht gesperrt werden
script_error_installFromFastboot_2=Das Flashen einer der Partitionen ist fehlgeschlagen
script_error_installFromFastboot_1=Die Benutzerdaten konnten nicht gelöscht werden
@@ -159,7 +165,7 @@ stepTitle7On7=Größe der Dateipartition ändern
stepTitle6On7=/e/-Installation
stepTitle5On7=Starte das Gerät neu in den Wiederstellungs-Modus
stepTitle4On7=Installation des Wiederherstellungs-Programms
-stepTitle3On7FP3=Entsperre den Bootloader und starte das Gerät neu in den Fastboot-Modus
+stepTitle_unlockBootloader=Entsperre den Bootloader und starte das Gerät neu in den Fastboot-Modus
### Flash
installationTitle=Installation
feedback_btn_sendTryAgain=Fehler. Bitte sende die Rückmeldung nochmals.
@@ -199,7 +205,7 @@ flash_process_cancelled=Der Installationsprozess wurde abgebrochen
java_error_unknow=Der Installationsprozess ist auf einen internen Fehler gestoßen
script_error_unknown=Der Installationsprozess ist auf einen Fehler gestoßen
stepTitle3On7=Starte das Gerät neu in den Download-Modus
-stepTitle2On7=OEM-Entsperrung
+stepTitleOemUnlock=OEM-Entsperrung
# Title
stepTitle1On7=Schließe das Gerät an und starte den Download-Modus
#credits
diff --git a/src/main/resources/lang/translation_en_EN.properties b/src/main/resources/lang/translation_en_EN.properties
index e18a4f12a56b1a3be1dfaf73b091d577c6bd58f6..cf39a27082ed7910d494cf403162fceca0966ce4 100644
--- a/src/main/resources/lang/translation_en_EN.properties
+++ b/src/main/resources/lang/translation_en_EN.properties
@@ -145,7 +145,7 @@ installationTitle = Installation
# Title
stepTitle1On7 = Connect device and start Download mode
-stepTitle2On7 = Unlock OEM
+stepTitleOemUnlock = Unlock OEM
stepTitle3On7 = Restart device in Download mode
stepTitle4On7 = Recovery installation
stepTitle5On7 = Restart device in Recovery mode
diff --git a/src/main/resources/lang/translation_eu.properties b/src/main/resources/lang/translation_eu.properties
index 04822c275b3df52c346efbda3842cb26e3dd1b46..c34c7339cf80c41736cc115549f8530c721f2747 100644
--- a/src/main/resources/lang/translation_eu.properties
+++ b/src/main/resources/lang/translation_eu.properties
@@ -201,9 +201,9 @@ stepTitle_verifyHeimdall=Egiaztatu Heimdall
stepTitle7On7=Aldatu Data partizioaren tamaina
stepTitle5On7=Berrabiarazi gailua Recovery moduan
stepTitle4On7=Recovery moduko instalazioa
-stepTitle3On7FP3=Desblokeatu Bootloader-a eta berrabiarazi gailua Fastboot moduan
+stepTitle_unlockBootloader=Desblokeatu Bootloader-a eta berrabiarazi gailua Fastboot moduan
stepTitle3On7=Berrabiarazi gailua Deskarga moduan
-stepTitle2On7=Desblokeatu OEM
+stepTitleOemUnlock=Desblokeatu OEM
# Title
stepTitle1On7=Konektatu gailua eta hasi Deskarga modua
### Flash
diff --git a/src/main/resources/lang/translation_fr_FR.properties b/src/main/resources/lang/translation_fr_FR.properties
index a5fed257b1f4ed70ca6f6c0d5733bf5492981a50..fec99af84fb11d3f90111c6869f12a374c009806 100644
--- a/src/main/resources/lang/translation_fr_FR.properties
+++ b/src/main/resources/lang/translation_fr_FR.properties
@@ -151,7 +151,7 @@ stepTitle6On7=Installation de /e/
stepTitle5On7=Redémarrer l'appareil en mode récupération
stepTitle4On7=Installation du mode de récupération
stepTitle3On7=Redémarrez l'appareil en mode de Téléchargement
-stepTitle2On7=Déverrouillage OEM
+stepTitleOemUnlock=Déverrouillage OEM
# Title
stepTitle1On7=Connectez l'appareil et démarrez le mode de Téléchargement
#credits
@@ -243,6 +243,21 @@ install_instr_openSettings=Ouvrez 'Paramètres'
install_instr_verifyHeimdall=Vérifiez Heimdall
install_instr_tapRebootPowerOff=Tapez sur 'Éteindre'
#install
+
+##FP4
+#stepTitles
+stepTitle_lockBootloaderCritical=Verrouillage des partitions critiques
+#install_instructions
+install_instr_prepareFastboot_FP4=Lorsque le téléphone est complètement éteint, appuyez sur le bouton " Volume bas " et maintenez-le enfoncé, puis rebranchez le câble USB.
+install_instr_showFastboot=Attendez que l'appareil démarre en mode fastboot.
+install_instr_ifYouMissedTimeout_FP4=Si vous l'avez manqué, pas de panique ! Redémarrez votre appareil en mode fastboot : \nDébranchez le câble USB et éteignez votre appareil\nEn maintenant le bouton "Volume bas" enfoncé, rebranchez le câble USB\nVous devriez maintenant être en mode fastboot.
+script_error_store_rom_info_1=Impossible d'obtenir des informations sur les correctifs de sécurité.
+stepTitle_checkLock=Vérification du lock
+install_instr_lockfailed=Si vous voyez ce message, cela signifie que le chargeur de démarrage n'a pas été verrouillé. Dans ce cas, vous verrez un écran indiquant que le chargeur de démarrage n'est pas verrouillé chaque fois que vous démarrez l'appareil. Vous pouvez ignorer le message affiché au démarrage du téléphone et le démarrer normalement.
+stepTitle_checkLock_mac_bootloader=Redémarrage en mode bootloader
+install_instr_mac_bootloader=En utilisant uniquement le menu du téléphone, sélectionnez "Restart Bootloader" avec les touches de volume et confirmez avec "Power".
+install_instr_mac_bootloader_1=Le téléphone va redémarrer et devrait passer à l'étape suivante "Installation de /e/". Si ce n'est pas le cas, vous devez refaire l'opération ci dessous une nouvelle fois.
+
##FP3
install_instr_followOfficialGuidanceAt=Suivez le guide officiel sur
install_instr_selectUnlockBootloader=Sélectionnez "UNLOCK BOOTLOADER" avec le bouton "Volume"
@@ -260,7 +275,7 @@ stepTitle_startRecovery=Démarrer sur le mode de récupération
stepTitle_installRecovery=Installer le mode de récupération
stepTitle_oemUnlock=Déverrouillage OEM
stepTitle_verifyHeimdall=Vérifier Heimdall
-stepTitle3On7FP3=Déverrouiller le Bootloader et redémarrer l'appareil en Fastboot mode
+stepTitle_unlockBootloader=Déverrouiller le Bootloader et redémarrer l'appareil en Fastboot mode
stepTitle_installation = Réinitialisation d'usine et installation
script_error_waitRebootFromFastboot_101=L'instruction n'a pas pu être lancée sur l'appareil
script_error_installFromFastboot_102=L'archive d'installation de /e/ n'a pas pu être décompressée
diff --git a/src/main/resources/lang/translation_it.properties b/src/main/resources/lang/translation_it.properties
index f44490fc60e1c0650a2bbb65ad0a0e36ad45715b..3e54c7ab78946d6e4763ff4cb8de5a82731657b8 100644
--- a/src/main/resources/lang/translation_it.properties
+++ b/src/main/resources/lang/translation_it.properties
@@ -167,9 +167,9 @@ stepTitle7On7=Ridimensiona la partizione Dati
stepTitle6On7=Installazione di /e/
stepTitle5On7=Riavvia il dispositivo in modalità Recovery
stepTitle4On7=Installazione Recovery
-stepTitle3On7FP3=Sblocca il Bootloader e riavvia il dispositivo in modalità Fastboot
+stepTitle_unlockBootloader=Sblocca il Bootloader e riavvia il dispositivo in modalità Fastboot
stepTitle3On7=Riavvia il dispositivo in modalità Download
-stepTitle2On7=Sblocco OEM
+stepTitleOemUnlock=Sblocco OEM
# Title
stepTitle1On7=Collega il dispositivo ed avvia la modalità Download
diff --git a/src/main/resources/lang/translation_nl.properties b/src/main/resources/lang/translation_nl.properties
index 7881cfa9959e1bd1d85ce1e7593f249278dd489f..b2813361e2600d738dfdbe4622082ab8be76a78a 100644
--- a/src/main/resources/lang/translation_nl.properties
+++ b/src/main/resources/lang/translation_nl.properties
@@ -156,7 +156,7 @@ stepTitle6On7=/e/ Installatie
stepTitle5On7=Herstart apparaat in Recovery modus
stepTitle4On7=Recovery installatie
stepTitle3On7=Herstart apparaat in Download modus
-stepTitle2On7=Ontgrendel OEM
+stepTitleOemUnlock=Ontgrendel OEM
# Title
stepTitle1On7=Sluit apparaat aan en start Download mode
### Flash
@@ -223,7 +223,7 @@ install_instr_ifYouMissedTimeout=Als je het heb gemist, geen paniek! Herstart in
install_instr_bootWarning=Op het opstart scherm, heb je 5 seconden om "Volume Beneden" in te drukken, om in het optie menu te komen.
install_instr_followOfficialGuidanceAt=Volg officiële begeleiding op
install_instr_startFastboot=Houd gelijktijdig de knoppen "Power" & "Volume omlaag" ingedrukt totdat een groene "START" verschijnt om toegang te krijgen tot Fastboot Modus
-stepTitle3On7FP3=Ontgrendel bootloader en herstart het apparaat in Fastboot modus
+stepTitle_unlockBootloader=Ontgrendel bootloader en herstart het apparaat in Fastboot modus
feedback_lbl_sendPrecision=Er zal geen identificerende informatie verstuurd worden
script_error_waitRebootFromFastboot_101=Kan installatie niet op het apparaat starten
script_error_installFromFastboot_102=Kon het /e/ installatie archief niet uitpakken
diff --git a/src/main/resources/lang/translation_ru.properties b/src/main/resources/lang/translation_ru.properties
index 4508c564f2d4388f3a10626bce0b1ed22691de5a..def49ba5d054f00ad6583634c55a6a7fed0ec315 100644
--- a/src/main/resources/lang/translation_ru.properties
+++ b/src/main/resources/lang/translation_ru.properties
@@ -173,7 +173,7 @@ stepTitle6On7=Установка /e/
stepTitle5On7=Перезапуск устройства в режиме Recovery
stepTitle4On7=Установка Recovery
stepTitle3On7=Перезагрузите устройство в Режиме загрузки
-stepTitle2On7=Разблокировать OEM
+stepTitleOemUnlock=Разблокировать OEM
# Title
stepTitle1On7=Подключите устройство и запустите режим загрузки
### Flash
@@ -209,7 +209,7 @@ eAccount_lbl_emailNotSent=Ваше письмо не было отправлен
eAccount_lbl_unsupportedFormat=Ваш адрес электронной почты имеет неподдерживаемый формат
eAccount_lbl_invitationSent=Отлично! Вы получите письмо с приглашением. Не забудьте проверить свой СПАМ-ящик.
stepTitle_StartInFastbootFP3=Запуск устройства в Fastboot режиме
-stepTitle3On7FP3=Разблокировка загрузчика и перезагрузка устройства в Fastboot режиме
+stepTitle_unlockBootloader=Разблокировка загрузчика и перезагрузка устройства в Fastboot режиме
script_error_waitRebootFromFastboot_101=Не могу запустить инструкцию на устройстве
script_error_installFromFastboot_102=Не получилось распаковать установочный архив с /e/
script_error_installFromFastboot_101=Не предоставлен установочный архив с /e/
diff --git a/src/main/resources/yaml/FP3_flash.yml b/src/main/resources/yaml/FP3_flash.yml
index e1aff8f2ecfc31f6eb81412973f67c0cbacd5546..0a863a02806988ea6e6264c0a01f4a619b3cbb37 100644
--- a/src/main/resources/yaml/FP3_flash.yml
+++ b/src/main/resources/yaml/FP3_flash.yml
@@ -41,7 +41,7 @@ steps:
type: load
stepNumber: 3
nextStepKey: f3
- titleKey: stepTitle2On7
+ titleKey: stepTitleOemUnlock
instructions:
- install_instr_oemUnlock
averageTime: 12
@@ -56,7 +56,7 @@ steps:
type: custom-executable
stepNumber: 4
nextStepKey: f4
- titleKey: stepTitle3On7FP3
+ titleKey: stepTitle_unlockBootloader
titleIconName: icon-download.png
instructions:
- install_instr_readAllWarning
diff --git a/src/main/resources/yaml/FP4_flash.yml b/src/main/resources/yaml/FP4_flash.yml
new file mode 100644
index 0000000000000000000000000000000000000000..8bd849d719994c442b86a897c4d692299d3cf3c9
--- /dev/null
+++ b/src/main/resources/yaml/FP4_flash.yml
@@ -0,0 +1,243 @@
+## Copyright 2021-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: Vincent Bourgmayer, Frank
+---
+stepsCount: 14
+steps:
+ f0:
+ type: enableOemUnlock
+ stepNumber: 1
+ nextStepKey: f1
+ f1:
+ type: load
+ stepNumber: 2
+ nextStepKey: f2
+ titleKey: stepTitleCheckSPL
+ instructions:
+ - install_instr_oemUnlock
+ averageTime: 1
+ script: store-rom-info
+ parameters:
+ fastboot_folder_path: ${ADB_FOLDER_PATH}
+ archive_path: ${ARCHIVE_PATH}
+ device_model: ${DEVICE_MODEL}
+ okCodes:
+ 0: ~
+ koCodes:
+ 1: script_error_store_rom_info_1
+ f2:
+ type: custom-executable
+ stepNumber: 3
+ nextStepKey: f3
+ titleKey: stepTitle_StartInFastbootFP3
+ titleIcon: icon-download.png
+ instructions:
+ - install_instr_turnOff
+ - install_instr_prepareFastboot_FP4
+ - install_instr_showFastboot
+ - install_instr_waitFastbootmodeDetected
+ script: wait-fastboot
+ parameters:
+ fastboot_folder_path: ${ADB_FOLDER_PATH}
+ okCodes:
+ 0: ~
+ koCodes:
+ 1: script_error_waitFastboot_1
+ f3:
+ type: load
+ stepNumber: 4
+ nextStepKey: f4
+ titleKey: stepTitleOemUnlock
+ instructions:
+ - install_instr_oemUnlock
+ averageTime: 5
+ script: fp4_oem-unlock
+ parameters:
+ fastboot_folder_path: ${ADB_FOLDER_PATH}
+ okCodes:
+ 0: ~
+ koCodes:
+ 10: script_error_oemUnlock_10
+ f4:
+ type: custom-executable
+ stepNumber: 5
+ nextStepKey: f5
+ titleKey: stepTitle_unlockBootloader
+ titleIconName: icon-download.png
+ instructions:
+ - install_instr_readAllWarning
+ - install_instr_selectUnlockBootloader
+ - install_instr_unlockBootloader
+ - install_instr_rejoinBootloader
+ - install_instr_ifYouMissedTimeout_FP4
+ script: wait-fastboot-unlocked
+ parameters:
+ fastboot_folder_path: ${ADB_FOLDER_PATH}
+ okCodes:
+ 0: ~
+ koCodes:
+ 1: script_error_waitFastboot_1
+ f5:
+ type: load
+ stepNumber: 6
+ nextStepKey: f6
+ titleKey: stepTitle_criticalUnlock
+ instructions:
+ - install_instr_oemUnlock
+ averageTime: 4
+ script: fp4_oem-unlock-critical
+ parameters:
+ fastboot_folder_path: ${ADB_FOLDER_PATH}
+ okCodes:
+ 0: ~
+ koCodes:
+ 10: script_error_oemUnlock_10
+ f6:
+ type: custom-executable
+ stepNumber: 7
+ nextStepKey: f7
+ titleKey: stepTitle_unlockBootloaderCritical
+ titleIconName: icon-download.png
+ instructions:
+ - install_instr_readAllWarning
+ - install_instr_selectUnlockBootloader
+ - install_instr_unlockBootloader
+ - install_instr_rejoinBootloader
+ - install_instr_ifYouMissedTimeout_FP4
+ script: wait-fastboot-unlocked-critical
+ parameters:
+ fastboot_folder_path: ${ADB_FOLDER_PATH}
+ okCodes:
+ 0: ~
+ koCodes:
+ 1: script_error_waitFastboot_1
+ f7:
+ type: custom-executable
+ stepNumber: 8
+ nextStepKey: f8
+ titleKey: stepTitle_checkLock_mac_bootloader
+ instructions:
+ - install_instr_mac_bootloader
+ - install_instr_mac_bootloader_1
+ script: check_macos
+ parameters:
+ archive_path: ${ARCHIVE_PATH}
+ fastboot_folder_path: ${ADB_FOLDER_PATH}
+ okCodes:
+ 0: ~
+ koCodes:
+ 101: script_error_installFromFastboot_101
+ f8:
+ type: load
+ stepNumber: 9
+ nextStepKey: f9
+ titleKey: stepTitle6On7
+ instructions:
+ - install_instr_eosInstall
+ averageTime: 300
+ script: fp4_install-from-fastboot
+ parameters:
+ archive_path: ${ARCHIVE_PATH}
+ fastboot_folder_path: ${ADB_FOLDER_PATH}
+ java_folder_path: ${JAVA_FOLDER_PATH}
+ okCodes:
+ 0: ~
+ koCodes:
+ 1: script_error_installFromFastboot_1
+ 2: script_error_installFromFastboot_2
+ 4: script_error_installFromFastboot_4
+ 5: script_error_installFromFastboot_5
+ 101: script_error_installFromFastboot_101
+ 102: script_error_installFromFastboot_102
+ f9:
+ type: askAccount
+ stepNumber: 10
+ nextStepKey: f10
+ f10:
+ type: load
+ stepNumber: 11
+ nextStepKey: f11
+ titleKey: install_title_lockBootloader
+ instructions:
+ - install_instr_oemUnlock
+ averageTime: 5
+ script: fp4_lock
+ parameters:
+ fastboot_folder_path: ${ADB_FOLDER_PATH}
+ archive_path: ${ARCHIVE_PATH}
+ device_model: ${DEVICE_MODEL}
+ okCodes:
+ 0: ~
+ koCodes:
+ 101: script_error_waitRebootFromFastboot_101
+ 102: script_error_installFromFastboot_3
+ f11:
+ type: custom-executable
+ stepNumber: 12
+ nextStepKey: f12
+ titleKey: stepTitle_lockBootloader
+ titleIconName: icon-download.png
+ instructions:
+ - install_instr_readAllWarning
+ - install_instr_selectLockBootloader
+ - install_instr_lockBootloader
+ - install_instr_rejoinBootloader
+ - install_instr_ifYouMissedTimeout_FP4
+ script: wait-fastboot-locked
+ parameters:
+ fastboot_folder_path: ${ADB_FOLDER_PATH}
+ archive_path: ${ARCHIVE_PATH}
+ device_model: ${DEVICE_MODEL}
+ okCodes:
+ 0: ~
+ koCodes:
+ 1: script_error_waitFastboot_1
+ f12:
+ type: custom-executable
+ stepNumber: 13
+ nextStepKey: f13
+ titleKey: stepTitle_lockBootloaderCritical
+ titleIconName: icon-download.png
+ instructions:
+ - install_instr_selectLockBootloader
+ - install_instr_lockBootloader
+ script: fp4_lock_critical
+ parameters:
+ fastboot_folder_path: ${ADB_FOLDER_PATH}
+ archive_path: ${ARCHIVE_PATH}
+ device_model: ${DEVICE_MODEL}
+ okCodes:
+ 0: ~
+ koCodes:
+ 1: script_error_unknown
+ 101: script_error_installFromFastboot_3
+ f13:
+ type: custom-executable
+ stepNumber: 14
+ nextStepKey: end
+ titleKey: stepTitle_checkLock
+ titleIconName: icon-download.png
+ instructions:
+ - install_instr_lockfailed
+ script: fp4_check_bootloader
+ parameters:
+ fastboot_folder_path: ${ADB_FOLDER_PATH}
+ archive_path: ${ARCHIVE_PATH}
+ device_model: ${DEVICE_MODEL}
+ okCodes:
+ 0: ~
+ koCodes:
+ 1: script_error_unknown
+ 101: script_error_installFromFastboot_3
diff --git a/src/main/resources/yaml/FP4_fs.yml b/src/main/resources/yaml/FP4_fs.yml
new file mode 100644
index 0000000000000000000000000000000000000000..c6193e5db263e627e7c484a4189e87e452a2d810
--- /dev/null
+++ b/src/main/resources/yaml/FP4_fs.yml
@@ -0,0 +1,20 @@
+## Copyright 2019-2020 - 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: Vincent Bourgmayer
+---
+sources:
+ rom:
+ url: https://images.ecloud.global/stable/FP4/IMG-e-latest-s-FP4.zip
+ filePath: IMG-e-latest-s-FP4.zip