Created
January 27, 2024 22:00
-
-
Save joaociocca/b5e0bda324da1ed2c816d64325aebe37 to your computer and use it in GitHub Desktop.
process print-pit file from Heimdall to flash Samsung Galaxy devices
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
heimdall print-pit > print-pit.txt | |
grep -Poz "(?<=Partition Name: ).*\nFlash Filename:.*" print-pit.txt | sed ':a;N;$!ba;s#\n##g;s#Flash Filename:##g;s#\x00#\n#g' > prep-pit.1 | |
while read line; do file=$(echo "$line" | cut -d' ' -f2); if [[ -f $file ]]; then echo "$line" >> prep-pit.2; fi; done < prep-pit.1 | |
sudo heimdall flash "$(cat -p prep-pit.2 | sort -u | tr '\n' ' ')" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment