mirror of
https://github.com/palera1n/palera1n.git
synced 2026-10-28 03:59:48 +01:00
fix dfuhelper & code cleanup (#256)
This commit is contained in:
1 parent
6fc00a598b
commit
ed56cfabbb
1 file changed
+11
-16
+11
-16
@@ -249,7 +249,8 @@ _wait() {
|
|||||||
|
|
||||||
_dfuhelper() {
|
_dfuhelper() {
|
||||||
local step_one;
|
local step_one;
|
||||||
if [[ "$1" = 0x801* ]]; then
|
deviceid=$(_info normal ProductType)
|
||||||
|
if [[ "$1" = 0x801* && "$deviceid" != *"iPad"* ]]; then
|
||||||
step_one="Hold volume down + side button"
|
step_one="Hold volume down + side button"
|
||||||
else
|
else
|
||||||
step_one="Hold home + power button"
|
step_one="Hold home + power button"
|
||||||
@@ -261,7 +262,11 @@ _dfuhelper() {
|
|||||||
sleep 3
|
sleep 3
|
||||||
"$dir"/irecovery -c "reset"
|
"$dir"/irecovery -c "reset"
|
||||||
step 1 "Keep holding"
|
step 1 "Keep holding"
|
||||||
step 10 'Release side button, but keep holding volume down'
|
if [[ "$1" = 0x801* && "$deviceid" != *"iPad"* ]]; then
|
||||||
|
step 10 'Release side button, but keep holding volume down'
|
||||||
|
else
|
||||||
|
step 10 'Release power button, but keep holding home button'
|
||||||
|
fi
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
if [ "$(get_device_mode)" = "dfu" ]; then
|
if [ "$(get_device_mode)" = "dfu" ]; then
|
||||||
@@ -282,18 +287,6 @@ _kill_if_running() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
_beta_url() {
|
|
||||||
if [[ "$deviceid" == *"iPad"* ]]; then
|
|
||||||
json=$(curl -s 'https://api.appledb.dev/ios/iPadOS;19B5060d.json')
|
|
||||||
else
|
|
||||||
json=$(curl -s 'https://api.appledb.dev/ios/iOS;19B5060d.json')
|
|
||||||
fi
|
|
||||||
|
|
||||||
sources=$(echo "$json" | $dir/jq -r '.sources')
|
|
||||||
beta_url=$(echo "$sources" | $dir/jq -r --arg deviceid "$deviceid" '.[] | select(.type == "ota" and (.deviceMap | index($deviceid))) | .links[0].url')
|
|
||||||
echo "$beta_url"
|
|
||||||
}
|
|
||||||
|
|
||||||
_exit_handler() {
|
_exit_handler() {
|
||||||
if [ "$os" = 'Darwin' ]; then
|
if [ "$os" = 'Darwin' ]; then
|
||||||
defaults write -g ignore-devices -bool false
|
defaults write -g ignore-devices -bool false
|
||||||
@@ -661,7 +654,7 @@ if [ ! -f blobs/"$deviceid"-"$version".shsh2 ]; then
|
|||||||
"$dir"/pzb -g "$(awk "/""$model""/{x=1}x&&/kernelcache.release/{print;exit}" BuildManifest.plist | grep '<string>' | cut -d\> -f2 | cut -d\< -f1)" "$ipswurl"
|
"$dir"/pzb -g "$(awk "/""$model""/{x=1}x&&/kernelcache.release/{print;exit}" BuildManifest.plist | grep '<string>' | cut -d\> -f2 | cut -d\< -f1)" "$ipswurl"
|
||||||
|
|
||||||
mv kernelcache.release.* work/kernelcache
|
mv kernelcache.release.* work/kernelcache
|
||||||
if [[ "$deviceid" == "iPhone8"* ]] || [[ "$deviceid" == "iPad6"* ]]|| [[ "$deviceid" == *'iPad5'* ]]; then
|
if [[ "$deviceid" == "iPhone8"* ]] || [[ "$deviceid" == "iPad6"* ]] || [[ "$deviceid" == *'iPad5'* ]]; then
|
||||||
python3 -m pyimg4 im4p extract -i work/kernelcache -o work/kcache.raw --extra work/kpp.bin
|
python3 -m pyimg4 im4p extract -i work/kernelcache -o work/kcache.raw --extra work/kpp.bin
|
||||||
else
|
else
|
||||||
python3 -m pyimg4 im4p extract -i work/kernelcache -o work/kcache.raw
|
python3 -m pyimg4 im4p extract -i work/kernelcache -o work/kcache.raw
|
||||||
@@ -817,7 +810,9 @@ fi
|
|||||||
|
|
||||||
cd logs
|
cd logs
|
||||||
for file in *.log; do
|
for file in *.log; do
|
||||||
mv "$file" SUCCESS_${file}
|
if [[ "$file" != "SUCCESS_"* ]]; then
|
||||||
|
sudo mv "$file" SUCCESS_${file}
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user