Support for iPhone3,3 on iPhone4Down

- not very tested
- also add restore to 7.1.2 support for all iphone 4 models
This commit is contained in:
LukeZGD 2022-09-20 20:29:49 +08:00
parent b05d79c3b8
commit 8a90bf4723
6 changed files with 65 additions and 4 deletions

1
.gitignore vendored
View File

@ -19,6 +19,7 @@ resources/jailbreak/bin.tar
resources/jailbreak/cydia.tar
resources/jailbreak/untether.tar
resources/libimobiledevice*/
resources/powdersn0w/
resources/ramdisk/
saved/
sshdeb.tar

View File

@ -21,7 +21,7 @@
- **iPhone 5C and iPad mini 3 devices are NOT supported!**
- iPhone 5C can still be restored to versions that you have SHSH blobs for
- iPhone 4 devices also support restoring with SHSH blobs
- **iPhone4Down supports the iPhone 4 GSM (iPhone3,1) only**
- **iPhone4Down supports iPhone 4 GSM and CDMA (iPhone3,1 and iPhone3,3)**
<table>
<thead>
@ -48,10 +48,11 @@
<tr><td>iPad mini 1</td></tr>
<tr><td>iPod touch 5</td></tr>
<tr>
<td rowspan=2>iOS 6.1.3</td>
<td rowspan=3>iOS 6.1.3</td>
<td>iPhone 4S</td>
</tr>
<tr><td>iPad 2 (except iPad2,4)</td></tr>
<tr><td>iPhone 4 GSM, CDMA</td></tr>
<tr>
<td>iOS 7.1.2</td>
<td>iPhone 4 (all models)</td></tr>

View File

@ -118,6 +118,10 @@ SaveExternal() {
Link=https://web.archive.org/web/20210529174714if_/https://codeload.github.com/dora2-iOS/ch3rryflower/zip/316d2cdc5351c918e9db9650247b91632af3f11f
Name=ch3rryflower
SHA1=790d56db354151b9740c929e52c097ba57f2929d
elif [[ $1 == "powdersn0w" ]]; then
Link=https://dora2ios.github.io/download/konayuki/powdersn0w_v2.0b3.zip
Name=powdersn0w
SHA1=c733aac4a0833558ef9f5517f2a11ca547110b6e
fi
if [[ -d ./resources/$Name ]]; then
return

View File

@ -158,7 +158,7 @@ GetDeviceValues() {
if [[ $ProductType == "iPhone3"* ]]; then
DeviceProc=4
if [[ $ProductType == "iPhone3,1" ]]; then
if [[ $ProductType != "iPhone3,2" ]]; then
Log "$ProductType detected. iPhone4Down functions enabled."
Echo "* This script uses powdersn0w by dora2ios"
else

View File

@ -42,6 +42,11 @@ JailbreakSet() {
}
JailbreakOption() {
if [[ $ProductType == "iPhone3,3" && $OSVer != "7.1.2" ]]; then
IPSWCustom="${ProductType}_${OSVer}_${BuildVer}_Custom"
return
fi
Input "Jailbreak Option"
Echo "* When this option is enabled, your device will be jailbroken on restore."
if [[ $OSVer == "6.1.3" ]]; then
@ -257,6 +262,9 @@ IPSW4() {
if [[ $OSVer == "4.3"* ]]; then
IPSW4Cherry
return
elif [[ $ProductType == "iPhone3,3" && $OSVer != "7.1.2" ]]; then
IPSW4Powder
return
else
local JBURL2="https://github.com/LukeZGD/powdersn0w_pub/raw/main/xpwn/src/target/n90/11D257/exploit"
JailbreakFiles $JBURL2 exploit bedd10a96ba0f305a0af74a15e1eee88946070a1
@ -416,6 +424,46 @@ IPSW4Cherry() {
cd ../../..
}
IPSW4Powder() {
Log "powdersn0w v2.0b3 will be used instead of powdersn0w_pub for iPhone3,3" # powdersn0w_pub doesn't have n92 exploit
SaveExternal powdersn0w # downloads powdersn0w from https://dora2ios.github.io/download/konayuki/powdersn0w_v2.0b3.zip
powderdir="../resources/powdersn0w/macosx_x86_64"
cd tmp
cp -rf $powderdir/FirmwareBundles $powderdir/src .
powdersn0w="$powderdir/ipsw"
if [[ $platform != "macos" ]]; then
echo "QlNESUZGNDA2AAAAAAAAAEkAAAAAAAAA4HscAAAAAABCWmg5MUFZJlNZcLcTFwAAB+DBQKAABAAIQCBCACAAIjEaNCDJiDaAhcW9PF3JFOFCQcLcTFxCWmg5MUFZJlNZidWPbQAOTMKswAAAAJAAEAAACKAAAAigAFCDJiBNUpoPU+qqe5IkMxAqd8VISW223BKUbv4u5IpwoSETqx7aQlpoORdyRThQkAAAAAA=" | base64 -d | tee ipsw.patch >/dev/null
$bspatch $powderdir/ipsw $powderdir/ipsw_patched ipsw.patch
powdersn0w="darling $(pwd)/$powderdir/ipsw_patched"
if [[ ! $(which darling) ]]; then
Error "Cannot find darling. darling is required to create custom IPSW."
fi
fi
# above patch changes temp path from /tmp to ././ (current dir)
# only modifies xpwn part, hopefully doesn't violate nbsk license. here is the equivalent diff (based on gpl code released):
: '
main.c:
187c188
< strcpy(tmpFileBuffer, "/tmp/rootXXXXXX");
---
> strcpy(tmpFileBuffer, "././/rootXXXXXX");
outputstate.c:
292c292
< strcpy(tmpFileBuffer, "/tmp/pwnXXXXXX");
---
> strcpy(tmpFileBuffer, "././/pwnXXXXXX");
'
Log "Preparing custom IPSW with powdersn0w..."
$powdersn0w ../$IPSW.ipsw ../$IPSWCustom.ipsw -useDRA ../$IPSW7.ipsw
cd ..
if [[ ! -e $IPSWCustom.ipsw ]]; then
Error "Failed to find custom IPSW. Please run the script again"
fi
}
IPSW64() {
if [[ -e $IPSWCustom.ipsw ]]; then
Log "Found existing Custom IPSW. Skipping IPSW creation."

View File

@ -321,9 +321,10 @@ SelectVersion() {
if [[ $ProductType == "iPhone3"* ]]; then
[[ $Mode == "IPSW32" ]] && Selection+=("7.1.2")
[[ $ProductType != "iPhone3,2" ]] && Selection+=("6.1.3")
if [[ $ProductType == "iPhone3,1" ]]; then
Selection+=("6.1.3 ""5.1.1 (9B208)" "5.1.1 (9B206)")
Selection+=("5.1.1 (9B208)" "5.1.1 (9B206)")
Selection2=("6.1.2" "6.1" "6.0.1" "6.0" "5.1" "5.0.1" "5.0")
if [[ $platform != "linux" ]]; then
Echo "* iOS 4.3.x downgrades are supported on Linux only"
@ -334,6 +335,12 @@ SelectVersion() {
Selection2+=("4.3.3" "4.3")
fi
Selection+=("More versions")
elif [[ $ProductType == "iPhone3,3" && $platform != "macos" && $Mode != "Restore712" ]]; then
Echo "* For creating 6.1.3 custom IPSW, make sure to have darling installed: https://github.com/darlinghq/darling"
Echo "* For Ubuntu/Debian, you may install the .deb from releases."
Echo "* For Arch, you may install darling-bin from AUR."
Echo "* For other distros, you might need to build darling yourself."
fi
if [[ $Mode == "Restore712" ]]; then