Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Verified Commit 6845eca8 authored by frankpreel's avatar frankpreel Committed by Nicolas Gelot
Browse files

Add MSWindows script files

parent 407dd730
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

:: Parameter
:: $1: The folder where fastboot runnable is stored
:: $2: The device model

:: Exit status
:: - 0 : success
@@ -26,6 +27,33 @@ set FASTBOOT_FOLDER_PATH=%~1
set 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")

      # 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 2020-12-05)

      if [[ $I_MURENA__SECURITY_PATCH -ge $I_ORIGINAL_SECURITY_PATCH ]]
      then
          echo "GREATER OR EQUALS OR ORIGINAL ROM INFO NOT AVAILABLE => PROCESS"
      else
          echo "LOWER DO NOT PROCESS"
          exit 0
      fi

%FASTBOOT_PATH% flashing lock

if errorLevel 1 (
+3 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

:: Parameter
:: $1: The folder where fastboot runnable is stored
:: $2: The device model

:: Exit status
:: - 0 : success
@@ -26,6 +27,8 @@ set FASTBOOT_FOLDER_PATH=%~1
set FASTBOOT_PATH="%FASTBOOT_FOLDER_PATH%fastboot"
echo "FASTBOOT path:"%FASTBOOT_PATH%

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

%FASTBOOT_PATH% flashing lock_critical

if errorLevel 1 (
+3 −0
Original line number Diff line number Diff line
@@ -16,11 +16,14 @@

:: TODO: What if 2 devices detected?
:: $1: The folder where fastboot runnable is stored
:: $2: The device model

:: Exit status
:: - 0 : Device in fastboot mode detected
:: - 1 : Error

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

set FASTBOOT_FOLDER_PATH=%~1
set FASTBOOT_PATH="%FASTBOOT_FOLDER_PATH%fastboot"
echo "FASTBOOT path:"%FASTBOOT_PATH%
+3 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

:: TODO: What if 2 devices detected?
:: $1: The folder where fastboot runnable is stored
:: $2: The device model

:: Exit status
:: - 0 : Device in fastboot mode detected
@@ -25,6 +26,8 @@ set FASTBOOT_FOLDER_PATH=%~1
set FASTBOOT_PATH="%FASTBOOT_FOLDER_PATH%fastboot"
echo "FASTBOOT path:"%FASTBOOT_PATH%

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

:fastboot_detect
%FASTBOOT_PATH% oem device-info 2>&1 | findstr /c:"critical unlocked: true"
if errorLevel 1 (