Update lineage build zip and commands

This commit is contained in:
Waldemar Tomme 2025-01-12 20:55:14 +01:00
parent 41b0cd3e4e
commit 33db199859

View File

@ -8,16 +8,13 @@
devShells = {
default =
let
lineageBuildZipUrl = "https://mirrorbits.lineageos.org/full/a71/20241225/lineage-21.0-20241225-nightly-a71-signed.zip";
lineageBuildZip = pkgs.fetchurl {
url = lineageBuildZipUrl;
hash = "sha256-G+ibXe1crfhFnB2sfSKtI4XDx1qysMj75H7aTJcUUm0=";
};
lineageBuildZipContent = pkgs.fetchzip {
url = lineageBuildZipUrl;
hash = "sha256-nBn26btXmW5u1oYCqucAbk6ixzMxGNapuMofBisv56o=";
stripRoot = false;
url = "https://mirrorbits.lineageos.org/full/a71/20250108/lineage-22.1-20250108-nightly-a71-signed.zip";
hash = "sha256-LD2tmHDhgT8idugF9Uv2L7B76I0dccnX5b/gfimvVtw";
};
lineageBuildBootImg = pkgs.runCommand "lineageos-build-boot-img" {} ''
${pkgs.unzip}/bin/unzip -p ${lineageBuildZip} boot.img > $out
'';
magiskApk = pkgs.fetchurl {
url = "https://github.com/topjohnwu/Magisk/releases/download/v28.1/Magisk-v28.1.apk";
hash = "sha256-i/0zRrPaWBT4Lv9vGxtf7dCtWF85olcJsj61SqxFaR0=";
@ -38,6 +35,8 @@
]))
(writeShellScriptBin "flash-lineage-magisk" ''
set -e
rootDir="${rootDir}"
lineageBootImg="$rootDir/.cache/lineageos-magisk-boot.img"
@ -49,18 +48,19 @@
installedMagisk=$(adb shell pm list packages com.topjohnwu.magisk)
if [[ -z "$installedMagisk" ]]; then
echo "Magisk not found on device. Installing now..."
adb sideload "${magiskApk}"
adb install "${magiskApk}"
fi
adb push "${lineageBuildZipContent}/boot.img" "/storage/emulated/0/Download/lineageos-boot.img"
echo "Launching Magisk. Patch the boot image located in the downloads directory."
adb push "${lineageBuildBootImg}" "/storage/emulated/0/Download/lineageos-boot.img"
adb shell monkey -p com.topjohnwu.magisk 1
echo "Launched Magisk. Patch the boot image located in the downloads directory."
read -p "Press enter to continue..."
adb shell 'cp /storage/emulated/0/Download/magisk_patched*.img /storage/emulated/0/Download/magisk-boot.img'
sleep 1
adb shell 'rm /storage/emulated/0/Download/magisk_patched*.img'
adb pull "/storage/emulated/0/Download/magisk-boot.img" "$lineageBootImg"
adb reboot download
fi
echo "Boot into download mode."
@ -68,6 +68,7 @@
heimdall flash --BOOT "$lineageBootImg"
'')
(writeShellScriptBin "flash-lineage" ''
set -e
echo "Installing LineageOS..."
adb sideload ${lineageBuildZip}