mirror of
https://github.com/palera1n/palera1n.git
synced 2026-12-01 05:43:37 +01:00
fix dfuhelper & code cleanup (#256)
This commit is contained in:
1 parent
6fc00a598b
commit
ed56cfabbb
1 file changed
+9
-14
+9
-14
@@ -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"
|
||||||
|
if [[ "$1" = 0x801* && "$deviceid" != *"iPad"* ]]; then
|
||||||
step 10 'Release side button, but keep holding volume down'
|
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
|
||||||
@@ -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