mirror of
https://github.com/palera1n/palera1n.git
synced 2026-10-21 09:47:01 +02:00
Compare commits
45
Commits
v2.0.0-beta.6.2
...
gui
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe6a3a8c13 | ||
|
|
1a3e99640b | ||
|
|
f80e2a8849 | ||
|
|
a30e2ef32a | ||
|
|
2825ccaf17 | ||
|
|
e1e0304b98 | ||
|
|
5f4ef51da9 | ||
|
|
98f7d032eb | ||
|
|
5b32d61a1e | ||
|
|
fd80f9e63f | ||
|
|
52ff0b2e62 | ||
|
|
aa0c3a77b3 | ||
|
|
a5fbf1b18b | ||
|
|
7d3bf14ea6 | ||
|
|
a8325474cf | ||
|
|
8a09d2670a | ||
|
|
30d8241e2d | ||
|
|
e33d50860b | ||
|
|
3b4340525d | ||
|
|
e6033f31cc | ||
|
|
c14d93b008 | ||
|
|
ed48d4fcb4 | ||
|
|
2541330a07 | ||
|
|
58aaf508fc | ||
|
|
e6644c0601 | ||
|
|
194f568363 | ||
|
|
963fbb6ed8 | ||
|
|
88185b7a88 | ||
|
|
3c6213774b | ||
|
|
c35d199809 | ||
|
|
67ca5a9d24 | ||
|
|
8edc991786 | ||
|
|
f59ef6dcee | ||
|
|
1ca25ceca8 | ||
|
|
0a0410d506 | ||
|
|
5f8b503ae3 | ||
|
|
9e253f98f4 | ||
|
|
d17af1fbc7 | ||
|
|
f3920b883d | ||
|
|
1abfdf5441 | ||
|
|
1c3613c669 | ||
|
|
627f9b3363 | ||
|
|
e5a618682f | ||
|
|
cee71af2a6 | ||
|
|
0278d19df8 |
No files matched your search
+60
-12
@@ -24,7 +24,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build-docs:
|
build-docs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
@@ -39,6 +39,10 @@ jobs:
|
|||||||
mkdir ready
|
mkdir ready
|
||||||
cp docs/*.html docs/mandoc.css docs/palera1n.1 ready
|
cp docs/*.html docs/mandoc.css docs/palera1n.1 ready
|
||||||
|
|
||||||
|
- name: Get branch name
|
||||||
|
id: branch-name
|
||||||
|
uses: tj-actions/branch-names@v7
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
uses: wangyucode/[email protected]
|
uses: wangyucode/[email protected]
|
||||||
@@ -48,9 +52,9 @@ jobs:
|
|||||||
username: palera1n
|
username: palera1n
|
||||||
privateKey: ${{ secrets.NICKCHAN_FTP_KEY }}
|
privateKey: ${{ secrets.NICKCHAN_FTP_KEY }}
|
||||||
forceUpload: true
|
forceUpload: true
|
||||||
dryRun: false
|
dryRun: true
|
||||||
localDir: 'ready/'
|
localDir: 'ready/'
|
||||||
remoteDir: '/palera1n/artifacts/c-rewrite'
|
remoteDir: "/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch || github.ref_name }}/${{ github.run_number }}"
|
||||||
|
|
||||||
build-darwin:
|
build-darwin:
|
||||||
strategy:
|
strategy:
|
||||||
@@ -70,7 +74,7 @@ jobs:
|
|||||||
minos: 7.0
|
minos: 7.0
|
||||||
runs-on: macos-12
|
runs-on: macos-12
|
||||||
env:
|
env:
|
||||||
MBEDTLS_VERSION: 3.3.0
|
MBEDTLS_VERSION: 3.4.0
|
||||||
READLINE_VERSION: 8.2
|
READLINE_VERSION: 8.2
|
||||||
SLANG_VERSION: 2.3.3
|
SLANG_VERSION: 2.3.3
|
||||||
NEWT_VERSION: 0.52.23
|
NEWT_VERSION: 0.52.23
|
||||||
@@ -325,6 +329,10 @@ jobs:
|
|||||||
mkdir -p ready
|
mkdir -p ready
|
||||||
tar -zcf ready/dep_root-${{ matrix.os }}-${{ matrix.arch }}.tgz dep_root
|
tar -zcf ready/dep_root-${{ matrix.os }}-${{ matrix.arch }}.tgz dep_root
|
||||||
|
|
||||||
|
- name: Get branch name
|
||||||
|
id: branch-name
|
||||||
|
uses: tj-actions/branch-names@v7
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
uses: wangyucode/[email protected]
|
uses: wangyucode/[email protected]
|
||||||
@@ -334,9 +342,9 @@ jobs:
|
|||||||
username: palera1n
|
username: palera1n
|
||||||
privateKey: ${{ secrets.NICKCHAN_FTP_KEY }}
|
privateKey: ${{ secrets.NICKCHAN_FTP_KEY }}
|
||||||
forceUpload: true
|
forceUpload: true
|
||||||
dryRun: false
|
dryRun: true
|
||||||
localDir: 'ready/'
|
localDir: 'ready/'
|
||||||
remoteDir: '/palera1n/artifacts/c-rewrite'
|
remoteDir: "/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch || github.ref }}/${{ github.run_number }}"
|
||||||
|
|
||||||
- name: Upload ${{ matrix.os }} thin ${{ matrix.arch }} build
|
- name: Upload ${{ matrix.os }} thin ${{ matrix.arch }} build
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
@@ -353,7 +361,7 @@ jobs:
|
|||||||
name: palera1n-${{ matrix.os }}-${{ matrix.arch }}.dSYM
|
name: palera1n-${{ matrix.os }}-${{ matrix.arch }}.dSYM
|
||||||
path: palera1n-${{ matrix.os }}-${{ matrix.arch }}.dSYM
|
path: palera1n-${{ matrix.os }}-${{ matrix.arch }}.dSYM
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
darwin-dist:
|
darwin-dist:
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
@@ -461,6 +469,19 @@ jobs:
|
|||||||
dpkg-deb -Zzstd -b stage palera1n_iphoneos-arm64.deb
|
dpkg-deb -Zzstd -b stage palera1n_iphoneos-arm64.deb
|
||||||
mv palera1n*.deb ready/
|
mv palera1n*.deb ready/
|
||||||
rm -rf stage
|
rm -rf stage
|
||||||
|
|
||||||
|
- name: Save build tag
|
||||||
|
run: echo "$(git describe --dirty --tags --abbrev=7 | sed 's|-dirty||')" > build-tag.txt
|
||||||
|
|
||||||
|
- name: Upload build tag
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: build-tag
|
||||||
|
path: build-tag.txt
|
||||||
|
|
||||||
|
- name: Get branch name
|
||||||
|
id: branch-name
|
||||||
|
uses: tj-actions/branch-names@v7
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
@@ -471,9 +492,9 @@ jobs:
|
|||||||
username: palera1n
|
username: palera1n
|
||||||
privateKey: ${{ secrets.NICKCHAN_FTP_KEY }}
|
privateKey: ${{ secrets.NICKCHAN_FTP_KEY }}
|
||||||
forceUpload: true
|
forceUpload: true
|
||||||
dryRun: false
|
dryRun: true
|
||||||
localDir: 'ready/'
|
localDir: 'ready/'
|
||||||
remoteDir: '/palera1n/artifacts/c-rewrite'
|
remoteDir: "/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch || github.ref }}/${{ github.run_number }}"
|
||||||
|
|
||||||
build-Linux:
|
build-Linux:
|
||||||
strategy:
|
strategy:
|
||||||
@@ -485,7 +506,7 @@ jobs:
|
|||||||
- aarch64-linux-musl
|
- aarch64-linux-musl
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
MBEDTLS_VERSION: 3.3.0
|
MBEDTLS_VERSION: 3.4.0
|
||||||
LIBUSB_VERSION: 1.0.26
|
LIBUSB_VERSION: 1.0.26
|
||||||
READLINE_VERSION: 8.2
|
READLINE_VERSION: 8.2
|
||||||
SLANG_VERSION: 2.3.3
|
SLANG_VERSION: 2.3.3
|
||||||
@@ -771,6 +792,10 @@ jobs:
|
|||||||
mv palera1n*.deb ready/
|
mv palera1n*.deb ready/
|
||||||
rm -rf stage
|
rm -rf stage
|
||||||
|
|
||||||
|
- name: Get branch name
|
||||||
|
id: branch-name
|
||||||
|
uses: tj-actions/branch-names@v7
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
uses: wangyucode/[email protected]
|
uses: wangyucode/[email protected]
|
||||||
@@ -780,6 +805,29 @@ jobs:
|
|||||||
username: palera1n
|
username: palera1n
|
||||||
privateKey: ${{ secrets.NICKCHAN_FTP_KEY }}
|
privateKey: ${{ secrets.NICKCHAN_FTP_KEY }}
|
||||||
forceUpload: true
|
forceUpload: true
|
||||||
dryRun: false
|
dryRun: true
|
||||||
localDir: 'ready/'
|
localDir: 'ready/'
|
||||||
remoteDir: '/palera1n/artifacts/c-rewrite'
|
remoteDir: "/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch || github.ref }}/${{ github.run_number }}"
|
||||||
|
|
||||||
|
finish-build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
|
needs: [build-docs, build-darwin, darwin-dist, build-Linux]
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Get branch name
|
||||||
|
id: branch-name
|
||||||
|
uses: tj-actions/branch-names@v7
|
||||||
|
|
||||||
|
- name: Download build tag
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: build-tag
|
||||||
|
|
||||||
|
- name: Send Discord build message
|
||||||
|
run: |
|
||||||
|
COMMITMESSAGE=`git log --pretty=format:'- \`%h\` %s' -1 --reverse` &&
|
||||||
|
(curl "${{ secrets.DISCORD_WEBHOOK }}" -sS -H "Content-Type:application/json" -X POST -d "{\"content\":null,\"embeds\":[{\"title\":\"[palera1n:${{ steps.branch-name.outputs.ref_branch }}] Nightly Build ${{ github.run_number }}\",\"url\":\"https://github.com/palera1n/palera1n/actions/runs/${GITHUB_RUN_ID}\",\"color\":2829617,\"fields\":[{\"name\":\"Build tag\",\"value\":\"- \`$(cat build-tag.txt | sed 's|\n||')\`\"},{\"name\":\"Destination\",\"value\":\"- https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch }}/${{ github.run_number }}\"},{\"name\":\"Documentation\",\"value\":\"- [palera1n.1.html](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch }}/${{ github.run_number }}/palera1n.1.html)\"},{\"name\":\"Main Artifacts\",\"value\":\"- [palera1n-ios](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch }}/${{ github.run_number }}/palera1n-ios)\n- [palera1n-linux-arm64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch }}/${{ github.run_number }}/palera1n-linux-arm64)\n- [palera1n-linux-armel](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch }}/${{ github.run_number }}/palera1n-linux-armel)\n- [palera1n-linux-x86](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/$${{ steps.branch-name.outputs.ref_branch }}/${{ github.run_number }}/palera1n-linux-x86)\n- [palera1n-linux-x86_64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch }}/${{ github.run_number }}/palera1n-linux-x86_64)\n- [palera1n-macos-universal](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch }}/${{ github.run_number }}/palera1n-macos-universal)\"}],\"footer\":{\"text\":\"${{ github.actor }}\", \"icon_url\": \"https://github.com/${{ github.actor }}.png\",\"timestamp\":\"$(date -u +"%FT%TZ")\"}}],\"username\":\"GitHub Actions\",\"avatar_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}")
|
||||||
|
|
||||||
@@ -4,11 +4,13 @@ SRC = $(shell pwd)
|
|||||||
DEP = $(SRC)/dep_root
|
DEP = $(SRC)/dep_root
|
||||||
STRIP = strip
|
STRIP = strip
|
||||||
CC ?= cc
|
CC ?= cc
|
||||||
CFLAGS += -I$(DEP)/include -I$(SRC)/include -I$(SRC)
|
CXX ?= c++
|
||||||
|
CFLAGS += -I$(DEP)/include -I$(SRC)/include -I$(SRC) -D_XOPEN_SOURCE=500
|
||||||
CFLAGS += -Wall -Wextra -Wno-unused-parameter -DPALERAIN_VERSION=\"2.0.0\"
|
CFLAGS += -Wall -Wextra -Wno-unused-parameter -DPALERAIN_VERSION=\"2.0.0\"
|
||||||
CFLAGS += -Wno-unused-variable -I$(SRC)/src -std=c99 -pedantic-errors -D_C99_SOURCE -D_POSIX_C_SOURCE=200112L
|
CFLAGS += -Wno-unused-variable -I$(SRC)/src -std=c99 -pedantic-errors -D_C99_SOURCE -D_POSIX_C_SOURCE=200112L
|
||||||
|
CXXFLAGS += -I$(DEP)/include -I$(SRC)/include -I$(SRC) -std=c++11
|
||||||
LIBS += $(DEP)/lib/libimobiledevice-1.0.a $(DEP)/lib/libirecovery-1.0.a $(DEP)/lib/libusbmuxd-2.0.a
|
LIBS += $(DEP)/lib/libimobiledevice-1.0.a $(DEP)/lib/libirecovery-1.0.a $(DEP)/lib/libusbmuxd-2.0.a
|
||||||
LIBS += $(DEP)/lib/libimobiledevice-glue-1.0.a $(DEP)/lib/libplist-2.0.a -pthread
|
LIBS += $(DEP)/lib/libimobiledevice-glue-1.0.a $(DEP)/lib/libplist-2.0.a -pthread -lm
|
||||||
ifeq ($(TARGET_OS),)
|
ifeq ($(TARGET_OS),)
|
||||||
TARGET_OS = $(shell uname -s)
|
TARGET_OS = $(shell uname -s)
|
||||||
endif
|
endif
|
||||||
@@ -31,6 +33,13 @@ ifeq ($(TARGET_OS),Linux)
|
|||||||
LIBS += $(DEP)/lib/libgpm.a
|
LIBS += $(DEP)/lib/libgpm.a
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(GUI),1)
|
||||||
|
LIBS += $(DEP)/lib/libguira1n.a
|
||||||
|
ifeq ($(TARGET_OS),Darwin)
|
||||||
|
LIBS += -framework Foundation -framework AppKit
|
||||||
|
CXXFLAGS += -x objective-c++
|
||||||
|
endif
|
||||||
|
endif
|
||||||
ifeq ($(DEV_BUILD),1)
|
ifeq ($(DEV_BUILD),1)
|
||||||
CFLAGS += -O0 -g -DDEV_BUILD -fno-omit-frame-pointer
|
CFLAGS += -O0 -g -DDEV_BUILD -fno-omit-frame-pointer
|
||||||
ifeq ($(ASAN),1)
|
ifeq ($(ASAN),1)
|
||||||
@@ -64,7 +73,7 @@ CFLAGS += -DBUILD_WHOAMI="\"$(BUILD_WHOAMI)\"" -DBUILD_TAG="\"$(BUILD_TAG)\""
|
|||||||
CFLAGS += -DBUILD_NUMBER="\"$(BUILD_NUMBER)\"" -DBUILD_BRANCH="\"$(BUILD_BRANCH)\""
|
CFLAGS += -DBUILD_NUMBER="\"$(BUILD_NUMBER)\"" -DBUILD_BRANCH="\"$(BUILD_BRANCH)\""
|
||||||
CFLAGS += -DBUILD_COMMIT="\"$(BUILD_COMMIT)\""
|
CFLAGS += -DBUILD_COMMIT="\"$(BUILD_COMMIT)\""
|
||||||
|
|
||||||
export SRC DEP CC CFLAGS LDFLAGS LIBS TARGET_OS DEV_BUILD BUILD_DATE BUILD_TAG BUILD_WHOAMI BUILD_STYLE BUILD_NUMBER BUILD_BRANCH
|
export SRC DEP CC CXX CFLAGS CXXFLAGS LDFLAGS LIBS TARGET_OS DEV_BUILD BUILD_DATE BUILD_TAG BUILD_WHOAMI BUILD_STYLE BUILD_NUMBER BUILD_BRANCH
|
||||||
|
|
||||||
all: palera1n
|
all: palera1n
|
||||||
|
|
||||||
|
|||||||
@@ -2,36 +2,20 @@
|
|||||||
<source media="(prefers-color-scheme: light)" srcset="https://cdn.discordapp.com/attachments/1028398976640229380/1088049124441604136/IMG_0033.png">
|
<source media="(prefers-color-scheme: light)" srcset="https://cdn.discordapp.com/attachments/1028398976640229380/1088049124441604136/IMG_0033.png">
|
||||||
<img align="left" height="120" src="https://cdn.discordapp.com/attachments/1017854329887129611/1073858292159352862/thing.png" alt="palera1n logo" style="float: left;"/>
|
<img align="left" height="120" src="https://cdn.discordapp.com/attachments/1017854329887129611/1073858292159352862/thing.png" alt="palera1n logo" style="float: left;"/>
|
||||||
</picture>
|
</picture>
|
||||||
<h3 align="right">An iOS 15.0-16.4.1 work-in-progress, <br>semi-tethered checkm8 jailbreak</h3>
|
|
||||||
|
|
||||||
<p align="right" >
|
<br clear="both"/>
|
||||||
<strong><a href="https://cdn.nickchan.lol/palera1n/c-rewrite/releases/v2.0.0-beta.4/palera1n.1.html">Usage</a></strong>
|
|
||||||
•
|
|
||||||
<strong><a href="https://github.com/palera1n/palera1n/graphs/contributors">Contributors</a></strong>
|
|
||||||
•
|
|
||||||
<strong><a href="https://dsc.gg/palera1n">Discord</a></strong>
|
|
||||||
•
|
|
||||||
<strong><a href="https://twitter.com/palera1n">Twitter</a></strong>
|
|
||||||
</p>
|
|
||||||
<div class="clear"></div>
|
|
||||||
|
|
||||||
## If you want a jailbreak, you should read the [guide](https://palera.in).
|
## Information
|
||||||
|
- Guides to palera1n can be found [here](https://ios.cfw.guide/installing-palera1n).
|
||||||
### You can obtain v2.0.0 beta [here](https://github.com/palera1n/palera1n/releases).
|
- Full documentation can be also found [here](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n.1.html).
|
||||||
If you need an older v2.0.0 beta, please get it [here](https://github.com/palera1n/palera1n-c/releases/tag/v2.0.0-beta.4).
|
|
||||||
|
|
||||||
# Warnings
|
|
||||||
- This palera1n rewrite has noticeably different arguments compared to the shell version of palera1n.
|
|
||||||
- Highly recommended that you take a look at how to use palera1n-c [here](https://cdn.nickchan.lol/palera1n/c-rewrite/releases/v2.0.0-beta.1/palera1n.1.html).
|
|
||||||
|
|
||||||
- This does **NOT** support tethered creation or booting. You must use the older [shell version of palera1n](https://github.com/palera1n/palera1n/tree/legacy) (clone with `-b legacy`).
|
|
||||||
|
|
||||||
|
## Warnings
|
||||||
- We are **NOT** responsible for any data loss, or the result of a device being bricked. The user of this program accepts responsibility should something happen to their device. While nothing should happen, jailbreaking has risks in itself.
|
- We are **NOT** responsible for any data loss, or the result of a device being bricked. The user of this program accepts responsibility should something happen to their device. While nothing should happen, jailbreaking has risks in itself.
|
||||||
- If your device is stuck in recovery, please run futurerestore `--exit-recovery`, or use `irecovery -n`.
|
- If your device is stuck in recovery, please run futurerestore `--exit-recovery`, or use `irecovery -n`.
|
||||||
|
|
||||||
- palera1n will never work in VirtualBox, VMware or any virtual machine that doesn't support PCI passthrough.
|
- palera1n will never work in VirtualBox, VMware or any virtual machine that doesn't support PCI passthrough.
|
||||||
|
|
||||||
# Requirements
|
## Requirements
|
||||||
- A checkm8 vulnerable iOS device on iOS 15.x or 16.x (`A8` - `A11`)
|
- A checkm8 vulnerable iOS device on iOS 15.x or 16.x (`A8` - `A11`)
|
||||||
- If using rootful, you will need **5-10GB of space** for the fakefs. This means 16GB devices cannot use the full fakefs creation. However, you can change the arguments to `-Bf` to create a fakefs with bind mounts, so it uses a smaller size, at the expense having unwritable parts in rarely-written paths, and then boot it
|
- If using rootful, you will need **5-10GB of space** for the fakefs. This means 16GB devices cannot use the full fakefs creation. However, you can change the arguments to `-Bf` to create a fakefs with bind mounts, so it uses a smaller size, at the expense having unwritable parts in rarely-written paths, and then boot it
|
||||||
- On `A11`, **you must disable your passcode while in the jailbroken state** (on iOS 16, you need to **reset your device** before proceeding with palera1n).
|
- On `A11`, **you must disable your passcode while in the jailbroken state** (on iOS 16, you need to **reset your device** before proceeding with palera1n).
|
||||||
@@ -46,7 +30,7 @@ If you need an older v2.0.0 beta, please get it [here](https://github.com/palera
|
|||||||
- USB-C port on Apple Silicon Macs may require manual unplugging and replugging of the lightning cable after checkm8 exploit.
|
- USB-C port on Apple Silicon Macs may require manual unplugging and replugging of the lightning cable after checkm8 exploit.
|
||||||
- This problem may be solved by connecting via USBHub.
|
- This problem may be solved by connecting via USBHub.
|
||||||
|
|
||||||
# Need help?
|
## Need help?
|
||||||
|
|
||||||
Make sure you provide full details on your device, such as:
|
Make sure you provide full details on your device, such as:
|
||||||
- iDevice
|
- iDevice
|
||||||
@@ -54,19 +38,15 @@ Make sure you provide full details on your device, such as:
|
|||||||
- Passcode enabled?
|
- Passcode enabled?
|
||||||
- Logs, if panicked then send latest `panic-full` log from your iDevice.
|
- Logs, if panicked then send latest `panic-full` log from your iDevice.
|
||||||
|
|
||||||
Using `-V` and `-v` would help with debugging.
|
Using `-VvL` would help with debugging.
|
||||||
|
|
||||||
Join the [Support Discord](https://dsc.gg/palera1n), and create a thread in [#support](https://discord.com/channels/1028398973452570725/1028730487700738130) or ask in [#general](https://discord.com/channels/1028398973452570725/1028398976640229380).
|
Join the [Support Discord](https://dsc.gg/palera1n), and create a thread in [#support](https://discord.com/channels/1028398973452570725/1028730487700738130) or ask in [#general](https://discord.com/channels/1028398973452570725/1028398976640229380).
|
||||||
|
|
||||||
# Credits
|
## Credits
|
||||||
<details><summary>palera1n-c Contributors and Credits</summary>
|
<details><summary>Credits</summary>
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
- [Nick Chan](https://github.com/asdfugil) for the rewrite
|
- [Lakhan Lothiyi](https://github.com/llsc12) for older palera1n loader app
|
||||||
- [Nebula](https://github.com/itsnebulalol) - palera1n owner and manager
|
|
||||||
- [Mineek](https://github.com/mineek)
|
|
||||||
- [Tom](https://github.com/plooshi) for updated ploosh kpf and universal loader
|
|
||||||
- [Lakhan Lothiyi](https://github.com/llsc12) for palera1n loader app
|
|
||||||
- [checkra1n](https://github.com/checkra1n) for the base of the kpf
|
- [checkra1n](https://github.com/checkra1n) for the base of the kpf
|
||||||
- [the Procursus Team](https://github.com/ProcursusTeam) for the amazing [bootstrap](https://github.com/ProcursusTeam/Procursus)
|
- [the Procursus Team](https://github.com/ProcursusTeam) for the amazing [bootstrap](https://github.com/ProcursusTeam/Procursus)
|
||||||
- [Évelyne](https://github.com/evelyneee) for [ElleKit](https://github.com/evelyneee/ellekit), rootless tweak injection
|
- [Évelyne](https://github.com/evelyneee) for [ElleKit](https://github.com/evelyneee/ellekit), rootless tweak injection
|
||||||
|
|||||||
+15
-3
@@ -6,7 +6,7 @@
|
|||||||
.Dt palera1n 1
|
.Dt palera1n 1
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
.Nm palera1n
|
.Nm palera1n
|
||||||
.Nd iOS 15.0-16.4.1 arm64 iOS/iPadOS jailbreaking tool
|
.Nd iOS 15.0-16.5 arm64 iOS/iPadOS jailbreaking tool
|
||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.Nm
|
.Nm
|
||||||
.Op Fl cCdDEfhIlLnpRsSvV
|
.Op Fl cCdDEfhIlLnpRsSvV
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
.Op Fl -force-revert
|
.Op Fl -force-revert
|
||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
.Nm
|
.Nm
|
||||||
jailbreaks any iOS/iPadOS device with an arm64 (arm64e excluded) on iOS 15.0-16.4.1,
|
jailbreaks any iOS/iPadOS device with an arm64 (arm64e excluded) on iOS 15.0-16.5,
|
||||||
utilizing the
|
utilizing the
|
||||||
.Em checkm8
|
.Em checkm8
|
||||||
bootROM exploit.
|
bootROM exploit.
|
||||||
@@ -52,7 +52,7 @@ In the remainder of this document, the term "iOS" and "iPadOS" will be used inte
|
|||||||
as the difference is negligible as far as the jailbreak is concerened.
|
as the difference is negligible as far as the jailbreak is concerened.
|
||||||
.Pp
|
.Pp
|
||||||
.Sh SUPPORTED DEVICES
|
.Sh SUPPORTED DEVICES
|
||||||
As described above, arm64 iOS 15.0-16.4.1 devices are supported, here is an explicit
|
As described above, arm64 iOS 15.0-16.5 devices are supported, here is an explicit
|
||||||
list of supported devicecs:
|
list of supported devicecs:
|
||||||
|
|
||||||
.Bl -tag -compact
|
.Bl -tag -compact
|
||||||
@@ -113,6 +113,18 @@ This option currently does not work on iOS 16.
|
|||||||
When used with
|
When used with
|
||||||
.Fl f , -fakefs ,
|
.Fl f , -fakefs ,
|
||||||
creates the new APFS volume required for rootful. Will fail if one already exists.
|
creates the new APFS volume required for rootful. Will fail if one already exists.
|
||||||
|
.It Fl C , -clean-fakefs
|
||||||
|
This reverts the fakefs to the
|
||||||
|
.Em orig-fs
|
||||||
|
snapshot that is created when the fakefs
|
||||||
|
is first created, then the device will continue to boot jailbroken. This option
|
||||||
|
allows resetting the rootful environment without deleting the entire fakefs.
|
||||||
|
Note that this option will not work if the fakefs is created in an older version
|
||||||
|
of palera1n that does not create the
|
||||||
|
.Em orig-fs
|
||||||
|
snapshot on the fakefs. This option will also remove some jailbreak files inside
|
||||||
|
of /var. The files in /var will not be deleted when a userspace reboot is done
|
||||||
|
with this flag set.
|
||||||
.It Fl d , -demote
|
.It Fl d , -demote
|
||||||
Set the effective production fuse to 0, so as to enable hardware debugging features.
|
Set the effective production fuse to 0, so as to enable hardware debugging features.
|
||||||
.It Fl D , -dfuhelper
|
.It Fl D , -dfuhelper
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
#ifndef COMMON_H
|
||||||
|
#define COMMON_H
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
extern "C" {
|
||||||
|
#include <palerain.h>
|
||||||
|
#include <gui.h>
|
||||||
|
}
|
||||||
|
|
||||||
|
#define DISCONNECTED 0
|
||||||
|
#define NORMAL 1
|
||||||
|
#define RECOVERY 2
|
||||||
|
#define DFU 3
|
||||||
|
#define rest(a) std::this_thread::sleep_for(std::chrono::seconds(a))
|
||||||
|
#define FLOAT_TO_INT(x) ((x)>=0?(int)((x)+0.5):(int)((x)-0.5))
|
||||||
|
|
||||||
|
void guifree(void);
|
||||||
|
void dfuhelper();
|
||||||
|
void send_alert(const char *title, const char *msg);
|
||||||
|
|
||||||
|
extern devinfo_t dev;
|
||||||
|
extern bool waiting_for_device;
|
||||||
|
extern bool unsupported_device;
|
||||||
|
extern bool supported_device;
|
||||||
|
extern bool recovery_wait;
|
||||||
|
extern bool jailbreak;
|
||||||
|
extern bool enter_dfu;
|
||||||
|
extern bool dfu_helper;
|
||||||
|
extern int device_status;
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
#ifndef DESIGN_H
|
||||||
|
#define DESIGN_H
|
||||||
|
|
||||||
|
#define set_pos(a,b) ImGui::SetCursorPos(ImVec2(a,b))
|
||||||
|
#define font(a) ImGui::PushFont(io.Fonts->Fonts[a])
|
||||||
|
#define btn_text_on colors[ImGuiCol_Text] = ImVec4{.05f, .05f, .05f, 1.0f}
|
||||||
|
#define btn_text_off colors[ImGuiCol_Text] = ImVec4{1.0f, 1.0f, 1.0f, 1.0f}
|
||||||
|
#define dfu_text_light colors[ImGuiCol_Text] = ImVec4{1.0f, 1.0f, 1.0f, 1.0f}
|
||||||
|
#define dfu_text_dark colors[ImGuiCol_Text] = ImVec4{1.0f, 1.0f, 1.0f, 0.3f}
|
||||||
|
#define size(x,y) ImVec2(x,y)
|
||||||
|
#define pos(x,y) ImVec2(x,y)
|
||||||
|
|
||||||
|
/* Fonts we have loaded into memory */
|
||||||
|
#define SF_Reg 0
|
||||||
|
#define SF_Med 2
|
||||||
|
#define SF_Bold 1
|
||||||
|
#define SF_Sm_Bold 3
|
||||||
|
#define Hack 4
|
||||||
|
#define SF_RoundBold 5
|
||||||
|
#define SF_RegMed 6
|
||||||
|
#define SF_BoldLarge 7
|
||||||
|
#define WHITE ImVec4{1.0f, 1.0f, 1.0f, 1.0f}
|
||||||
|
|
||||||
|
void ImageRotated(ImTextureID tex_id, ImVec2 center, ImVec2 size, float angle);
|
||||||
|
void draw_box(ImVec2 location, ImVec2 size, ImVec4 color, float radius);
|
||||||
|
void reset_design(void);
|
||||||
|
void reset_views(void);
|
||||||
|
bool is_hovered(const char* id, int w, int h);
|
||||||
|
bool is_pressed(const char* id, int w, int h);
|
||||||
|
void anim_btn(const char* id, ImVec2 size, ImVec2 size_to, ImVec2 pos, ImVec2 pos_to);
|
||||||
|
void anim_box(const char* id, ImVec2 size, ImVec2 size_to, ImVec2 pos, ImVec2 pos_to);
|
||||||
|
void label(const char *text, ImVec2 location, ImVec4 color, int font);
|
||||||
|
void rotate_image(const char *image, ImVec2 pos, ImVec2 size, float angle, float speed);
|
||||||
|
std::string addstr2(const char *str1, const char *str2);
|
||||||
|
std::string addstr3(const char *str1, const char *str2, const char *str3);
|
||||||
|
std::string addstr4(const char *str1, const char *str2, const char *str3, const char *str4);
|
||||||
|
|
||||||
|
void image_btn_style_alt(void);
|
||||||
|
void init_style(void);
|
||||||
|
void init_colors(void);
|
||||||
|
ImVec4 hex_color(int hex, float alpha);
|
||||||
|
ImColor hex_imcolor(int hex, float alpha);
|
||||||
|
void image_btn_style();
|
||||||
|
|
||||||
|
extern float btn_w;
|
||||||
|
extern float btn_h;
|
||||||
|
extern float btn_x;
|
||||||
|
extern float btn_y;
|
||||||
|
|
||||||
|
extern float box_w;
|
||||||
|
extern float box_h;
|
||||||
|
extern float box_x;
|
||||||
|
extern float box_y;
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
#ifndef GUI_H
|
||||||
|
#define GUI_H
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#define WINDOW_X 0
|
||||||
|
#define WINDOW_Y 0
|
||||||
|
#define WINDOW_SIZE_X 550
|
||||||
|
#define WINDOW_SIZE_Y 300
|
||||||
|
|
||||||
|
#define WINDOW_TITLE "palera1n"
|
||||||
|
#define WINDOW_RESIZE false
|
||||||
|
#define WINDOW_RESTORE true
|
||||||
|
#define WINDOW_ALLOW_FULLSCREEN false
|
||||||
|
#define WINDOW_BORDERLESS false
|
||||||
|
#define WINDOW_DECORATIONS true
|
||||||
|
|
||||||
|
#define IDLE false
|
||||||
|
#define TARGET_FPS 60
|
||||||
|
#define CONFIG_FILE "palera1n.ini"
|
||||||
|
#define EMBED_ASSETS true
|
||||||
|
#define ASSETS_DIRECTORY "assets"
|
||||||
|
|
||||||
|
#define NORMAL_MODE 1
|
||||||
|
#define RECOVERY_MODE 2
|
||||||
|
#define DFU_MODE 3
|
||||||
|
#define NONE 4
|
||||||
|
#define PONGO_MODE 5
|
||||||
|
|
||||||
|
int palera1n(int argc, char *argv[]);
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -61,6 +61,11 @@
|
|||||||
#define palerain_option_setup_partial_root (1 << 4) /* fakefs creating should be partial */
|
#define palerain_option_setup_partial_root (1 << 4) /* fakefs creating should be partial */
|
||||||
#define palerain_option_checkrain_is_clone (1 << 5) /* supplied checkra1n is checkra1n clone */
|
#define palerain_option_checkrain_is_clone (1 << 5) /* supplied checkra1n is checkra1n clone */
|
||||||
#define palerain_option_rootless_livefs (1 << 6) /* mount root livefs on rootless */
|
#define palerain_option_rootless_livefs (1 << 6) /* mount root livefs on rootless */
|
||||||
|
/* reserved values */
|
||||||
|
// #define palerain_option_no_ssv (1 << 7) /* no signed system volume */
|
||||||
|
// #define palerain_option_force_fakefs (1 << 8) /* force fakefs, even without SSV */
|
||||||
|
// #define palerain_option_rootless (1 << 9) /* rootless jailbreak */
|
||||||
|
#define palerain_option_clean_fakefs (1 << 10) /* clean fakefs, but does not delete it */
|
||||||
|
|
||||||
#ifdef DEV_BUILD
|
#ifdef DEV_BUILD
|
||||||
#define palerain_option_test1 (1 << 29)
|
#define palerain_option_test1 (1 << 29)
|
||||||
|
|||||||
+2
-2
@@ -8,8 +8,8 @@ Depends: usbmuxd
|
|||||||
Section: Utilities
|
Section: Utilities
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Homepage: https://palera.in
|
Homepage: https://palera.in
|
||||||
Description: iOS 15.0-16.4.1 semi-tethered checkm8 jailbreak
|
Description: iOS 15.0-16.5 semi-tethered checkm8 jailbreak
|
||||||
palera1n is an iOS/iPadOS 15.0-15.3.1 semi tethered jailbreak
|
palera1n is an iOS/iPadOS 15.0-16.5 semi tethered jailbreak
|
||||||
based on the checkm8 exploit.
|
based on the checkm8 exploit.
|
||||||
.
|
.
|
||||||
palera1n is able to jailbreak the device in fakefs-rootful mode,
|
palera1n is able to jailbreak the device in fakefs-rootful mode,
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ Author: palera1n team
|
|||||||
Section: Utilities
|
Section: Utilities
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Homepage: https://palera.in
|
Homepage: https://palera.in
|
||||||
Description: iOS 15.0-16.4.1 semi-tethered checkm8 jailbreak
|
Description: iOS 15.0-16.5 semi-tethered checkm8 jailbreak
|
||||||
palera1n is an iOS/iPadOS 15.0-15.3.1 semi tethered jailbreak
|
palera1n is an iOS/iPadOS 15.0-16.5 semi tethered jailbreak
|
||||||
based on the checkm8 exploit.
|
based on the checkm8 exploit.
|
||||||
.
|
.
|
||||||
palera1n is able to jailbreak the device in fakefs-rootful mode,
|
palera1n is able to jailbreak the device in fakefs-rootful mode,
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
class Palera1n < Formula
|
||||||
|
desc "iOS 15.0-16.3.1 semi-tethered checkm8 jailbreak"
|
||||||
|
homepage "https://palera.in/"
|
||||||
|
url ""
|
||||||
|
version "2.0.0"
|
||||||
|
sha256 ""
|
||||||
|
license "MIT"
|
||||||
|
|
||||||
|
depends_on "cmake" => :build
|
||||||
|
depends_on "libimobiledevice" => :build
|
||||||
|
depends_on "libirecovery" => :build
|
||||||
|
depends_on "libusb" => :build
|
||||||
|
depends_on "libusbmuxd" => :build
|
||||||
|
depends_on "mbedtls" => :build
|
||||||
|
depends_on "pkg-config" => :build
|
||||||
|
depends_on "readline" => :build
|
||||||
|
|
||||||
|
def install
|
||||||
|
system "cmake", "."
|
||||||
|
system "make"
|
||||||
|
bin.install "output/palera1n" => "palera1n"
|
||||||
|
end
|
||||||
|
|
||||||
|
test do
|
||||||
|
system "false"
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Name=palera1n
|
||||||
|
Exec=~/usr/local/bin
|
||||||
|
Icon=~/.palera1n/icon.ico
|
||||||
|
Terminal=false
|
||||||
|
Type=Application
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
From 632cdb6de3f1693fb90d60d81552b723e8dd5e84 Mon Sep 17 00:00:00 2001
|
From a2d012f3ba459f6debe636b576ad9aeab7b3c2aa Mon Sep 17 00:00:00 2001
|
||||||
From: Nick Chan <[email protected]>
|
From: Nick Chan <[email protected]>
|
||||||
Date: Wed, 25 Jan 2023 01:53:00 +0800
|
Date: Sat, 27 May 2023 23:50:23 +0800
|
||||||
Subject: [PATCH] Allow empty x509 cert issuer
|
Subject: [PATCH] Allow empty x509 cert issuer
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -8,25 +8,24 @@ Subject: [PATCH] Allow empty x509 cert issuer
|
|||||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
diff --git a/library/x509_crt.c b/library/x509_crt.c
|
diff --git a/library/x509_crt.c b/library/x509_crt.c
|
||||||
index 0eee97cb6..46702f683 100644
|
index cf62532f2..ef25b3d77 100644
|
||||||
--- a/library/x509_crt.c
|
--- a/library/x509_crt.c
|
||||||
+++ b/library/x509_crt.c
|
+++ b/library/x509_crt.c
|
||||||
@@ -1185,14 +1185,14 @@ static int x509_crt_parse_der_core( mbedtls_x509_crt *crt,
|
@@ -1061,13 +1061,13 @@ static int x509_crt_parse_der_core(mbedtls_x509_crt *crt,
|
||||||
if( ( ret = mbedtls_asn1_get_tag( &p, end, &len,
|
|
||||||
MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE ) ) != 0 )
|
if ((ret = mbedtls_asn1_get_tag(&p, end, &len,
|
||||||
{
|
MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE)) != 0) {
|
||||||
- mbedtls_x509_crt_free( crt );
|
- mbedtls_x509_crt_free(crt);
|
||||||
- return( MBEDTLS_ERROR_ADD( MBEDTLS_ERR_X509_INVALID_FORMAT, ret ) );
|
- return MBEDTLS_ERROR_ADD(MBEDTLS_ERR_X509_INVALID_FORMAT, ret);
|
||||||
+ // mbedtls_x509_crt_free( crt );
|
+ /*mbedtls_x509_crt_free(crt);
|
||||||
+ // return( MBEDTLS_ERROR_ADD( MBEDTLS_ERR_X509_INVALID_FORMAT, ret ) );
|
+ return MBEDTLS_ERROR_ADD(MBEDTLS_ERR_X509_INVALID_FORMAT, ret);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ( ret = mbedtls_x509_get_name( &p, p + len, &crt->issuer ) ) != 0 )
|
if ((ret = mbedtls_x509_get_name(&p, p + len, &crt->issuer)) != 0) {
|
||||||
{
|
- mbedtls_x509_crt_free(crt);
|
||||||
- mbedtls_x509_crt_free( crt );
|
- return ret;
|
||||||
- return( ret );
|
+ /*mbedtls_x509_crt_free(crt);
|
||||||
+ // mbedtls_x509_crt_free( crt );
|
+ return ret;*/
|
||||||
+ // return( ret );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
crt->issuer_raw.len = p - crt->issuer_raw.p;
|
crt->issuer_raw.len = p - crt->issuer_raw.p;
|
||||||
|
|||||||
+14
-1
@@ -56,6 +56,12 @@ BUILD_OPTIONS += TUI
|
|||||||
CFLAGS += -DTUI
|
CFLAGS += -DTUI
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(GUI),1)
|
||||||
|
CXXOBJECTS = gui_alerts.o gui_design.o gui_device.o gui_main.o
|
||||||
|
BUILD_OPTIONS += GUI
|
||||||
|
CFLAGS += -DGUI
|
||||||
|
endif
|
||||||
|
|
||||||
CHECKRA1N_VERSION ?= 0.1337.1
|
CHECKRA1N_VERSION ?= 0.1337.1
|
||||||
LIPO = lipo
|
LIPO = lipo
|
||||||
LDID = ldid
|
LDID = ldid
|
||||||
@@ -125,8 +131,15 @@ xxd-%.c: %
|
|||||||
%.o: %.c $(wildcard ../include/*.h)
|
%.o: %.c $(wildcard ../include/*.h)
|
||||||
$(CC) -c $(CFLAGS) $<
|
$(CC) -c $(CFLAGS) $<
|
||||||
|
|
||||||
|
%.o: %.cpp $(wildcard ../include/*.h)
|
||||||
|
$(CXX) -c $(CXXFLAGS) $<
|
||||||
|
|
||||||
palera1n: $(OBJECTS)
|
palera1n: $(OBJECTS)
|
||||||
|
ifeq ($(GUI),1)
|
||||||
|
$(CXX) $(LDFLAGS) $(OBJECTS) $(CXXOBJECTS) $(LIBS) -o palera1n
|
||||||
|
else
|
||||||
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJECTS) $(LIBS) -o palera1n
|
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJECTS) $(LIBS) -o palera1n
|
||||||
|
endif
|
||||||
ifeq (,$(findstring macosx, $(CFLAGS)))
|
ifeq (,$(findstring macosx, $(CFLAGS)))
|
||||||
ifneq (,$(findstring version-min=, $(CFLAGS)))
|
ifneq (,$(findstring version-min=, $(CFLAGS)))
|
||||||
$(LDID) -Susb.xml palera1n
|
$(LDID) -Susb.xml palera1n
|
||||||
@@ -140,7 +153,7 @@ checkra1n-kpf-pongo:
|
|||||||
curl -LO https://cdn.nickchan.lol/palera1n/artifacts/kpf/checkra1n-kpf-pongo
|
curl -LO https://cdn.nickchan.lol/palera1n/artifacts/kpf/checkra1n-kpf-pongo
|
||||||
|
|
||||||
ramdisk.dmg:
|
ramdisk.dmg:
|
||||||
curl -LO https://cdn.nickchan.lol/palera1n/artifacts/jbinit_rootless/ramdisk.dmg
|
curl -LO https://cdn.nickchan.lol/palera1n/c-rewrite/deps/ramdisk.dmg
|
||||||
|
|
||||||
binpack.dmg:
|
binpack.dmg:
|
||||||
curl -LO https://cdn.nickchan.lol/palera1n/c-rewrite/deps/binpack.dmg
|
curl -LO https://cdn.nickchan.lol/palera1n/c-rewrite/deps/binpack.dmg
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
#include <stdbool.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <limits.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <gui.h>
|
||||||
|
|
||||||
|
// 50/50 chance this will be removed for in-window alerts
|
||||||
|
#if __APPLE__
|
||||||
|
#include <CoreFoundation/CoreFoundation.h>
|
||||||
|
#define IDOK 1
|
||||||
|
#define IDCANCEL 2
|
||||||
|
#define AL kCFUserNotificationNoteAlertLevel
|
||||||
|
#elif _WIN32
|
||||||
|
#include <windows.h>
|
||||||
|
#include <winuser.h>
|
||||||
|
#elif __linux__
|
||||||
|
// #include <gtk/gtk.h>
|
||||||
|
#elif BSD
|
||||||
|
#elif __ANDROID__
|
||||||
|
#else
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void send_alert(const char *title, const char *msg) {
|
||||||
|
#if __APPLE__
|
||||||
|
CFStringRef header_ref = CFStringCreateWithCString(NULL, title, strlen(title));
|
||||||
|
CFStringRef message_ref = CFStringCreateWithCString(NULL, msg, strlen(msg));
|
||||||
|
// CFStringRef url_ref = CFStringCreateWithCString( NULL, "", strlen("") );
|
||||||
|
CFURLRef icon_ref = CFURLCreateWithString(kCFAllocatorDefault, NULL, NULL);
|
||||||
|
CFOptionFlags result;
|
||||||
|
|
||||||
|
CFUserNotificationDisplayAlert(0, AL, icon_ref, NULL, NULL, header_ref, message_ref, NULL, NULL, NULL, &result);
|
||||||
|
CFRelease(header_ref);
|
||||||
|
CFRelease(message_ref);
|
||||||
|
#elif _WIN32
|
||||||
|
MessageBox(0, msg, title, MB_OK);
|
||||||
|
#elif __linux__
|
||||||
|
char line[256];
|
||||||
|
FILE *fp;
|
||||||
|
|
||||||
|
fp=popen("zenity --version","r");
|
||||||
|
if (fp==NULL) {
|
||||||
|
perror("Pipe returned a error");
|
||||||
|
} else {
|
||||||
|
while (fgets(line,sizeof(line),fp)) printf("%s",line);
|
||||||
|
pclose(fp);
|
||||||
|
}
|
||||||
|
|
||||||
|
char *str_msg = (char*)malloc(40+strlen(title)+strlen(msg)+1);
|
||||||
|
sprintf(str_msg, "zenity --info --title '%s' --text '%s'", title, msg);
|
||||||
|
fp=popen(str_msg, "r");
|
||||||
|
|
||||||
|
if (fp==NULL) {
|
||||||
|
perror("Pipe returned a error");
|
||||||
|
} else {
|
||||||
|
printf("Exit code: %i\n",WEXITSTATUS(pclose(fp)));
|
||||||
|
}
|
||||||
|
#elif BSD
|
||||||
|
#elif __ANDROID__
|
||||||
|
#else
|
||||||
|
#endif
|
||||||
|
}
|
||||||
@@ -0,0 +1,372 @@
|
|||||||
|
#include <stdbool.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <hello_imgui/hello_imgui.h>
|
||||||
|
#include <imgui/imgui_internal.h>
|
||||||
|
|
||||||
|
#include <common.h>
|
||||||
|
#include <design.h>
|
||||||
|
|
||||||
|
|
||||||
|
/* ----------------- [ Animation Varibles ] ----------------- */
|
||||||
|
|
||||||
|
float btn_w = 0.0f;
|
||||||
|
float btn_h = 0.0f;
|
||||||
|
float btn_x = 0.0f;
|
||||||
|
float btn_y = 0.0f;
|
||||||
|
float box_w = 0.0f;
|
||||||
|
float box_h = 0.0f;
|
||||||
|
float box_x = 0.0f;
|
||||||
|
float box_y = 0.0f;
|
||||||
|
|
||||||
|
|
||||||
|
/* ----------------- [ UI Init/Reset ] ----------------- */
|
||||||
|
|
||||||
|
void init_colors() {
|
||||||
|
auto &colors = ImGui::GetStyle().Colors;
|
||||||
|
colors[ImGuiCol_WindowBg] = ImVec4{0.21f, 0.23f, 0.31f, 1.0f};
|
||||||
|
colors[ImGuiCol_MenuBarBg] = ImVec4{0.16f, 0.16f, 0.21f, 1.0f};
|
||||||
|
|
||||||
|
// Border
|
||||||
|
colors[ImGuiCol_Border] = ImVec4{0.44f, 0.37f, 0.61f, 0.0f};
|
||||||
|
colors[ImGuiCol_BorderShadow] = ImVec4{0.0f, 0.0f, 0.0f, 0.0f};
|
||||||
|
|
||||||
|
// Text
|
||||||
|
colors[ImGuiCol_Text] = ImVec4{1.0f, 1.0f, 1.0f, 1.0f};
|
||||||
|
colors[ImGuiCol_TextDisabled] = ImVec4{0.5f, 0.5f, 0.5f, 1.0f};
|
||||||
|
|
||||||
|
// Headers
|
||||||
|
colors[ImGuiCol_Header] = ImVec4{0.13f, 0.13f, 0.17, 1.0f};
|
||||||
|
colors[ImGuiCol_HeaderHovered] = ImVec4{0.19f, 0.2f, 0.25f, 1.0f};
|
||||||
|
colors[ImGuiCol_HeaderActive] = ImVec4{0.16f, 0.16f, 0.21f, 1.0f};
|
||||||
|
|
||||||
|
// Buttons
|
||||||
|
colors[ImGuiCol_Button] = ImVec4{0.9f, 0.9f, 0.9f, 1.0f};
|
||||||
|
colors[ImGuiCol_ButtonHovered] = ImVec4{0.9f, 0.9f, 0.9f, 1.0f};
|
||||||
|
colors[ImGuiCol_ButtonActive] = ImVec4{0.9f, 0.9f, 0.9f, 1.0f};
|
||||||
|
colors[ImGuiCol_CheckMark] = ImVec4{0.9f, 0.9f, 0.9f, 1.0f};
|
||||||
|
|
||||||
|
// Popups
|
||||||
|
colors[ImGuiCol_PopupBg] = ImVec4{0.1f, 0.1f, 0.13f, 0.92f};
|
||||||
|
|
||||||
|
// Slider
|
||||||
|
colors[ImGuiCol_SliderGrab] = ImVec4{0.44f, 0.37f, 0.61f, 0.54f};
|
||||||
|
colors[ImGuiCol_SliderGrabActive] = ImVec4{0.74f, 0.58f, 0.98f, 0.54f};
|
||||||
|
|
||||||
|
// Frame BG
|
||||||
|
colors[ImGuiCol_FrameBg] = ImVec4{0.13f, 0.13f, 0.15f, 0.7f};
|
||||||
|
colors[ImGuiCol_FrameBgHovered] = ImVec4{0.13f, 0.13f, 0.15f, 0.7f};
|
||||||
|
colors[ImGuiCol_FrameBgActive] = ImVec4{0.13f, 0.13f, 0.15f, 0.7f};
|
||||||
|
|
||||||
|
// Tabs
|
||||||
|
colors[ImGuiCol_Tab] = ImVec4{0.16f, 0.16f, 0.21f, 1.0f};
|
||||||
|
colors[ImGuiCol_TabHovered] = ImVec4{0.24, 0.24f, 0.32f, 1.0f};
|
||||||
|
colors[ImGuiCol_TabActive] = ImVec4{0.2f, 0.22f, 0.27f, 1.0f};
|
||||||
|
colors[ImGuiCol_TabUnfocused] = ImVec4{0.16f, 0.16f, 0.21f, 1.0f};
|
||||||
|
colors[ImGuiCol_TabUnfocusedActive] = ImVec4{0.16f, 0.16f, 0.21f, 1.0f};
|
||||||
|
|
||||||
|
// Title
|
||||||
|
colors[ImGuiCol_TitleBg] = ImVec4{0.16f, 0.16f, 0.21f, 1.0f};
|
||||||
|
colors[ImGuiCol_TitleBgActive] = ImVec4{0.16f, 0.16f, 0.21f, 1.0f};
|
||||||
|
colors[ImGuiCol_TitleBgCollapsed] = ImVec4{0.16f, 0.16f, 0.21f, 1.0f};
|
||||||
|
|
||||||
|
// Scrollbar
|
||||||
|
colors[ImGuiCol_ScrollbarBg] = ImVec4{0.1f, 0.1f, 0.13f, 1.0f};
|
||||||
|
colors[ImGuiCol_ScrollbarGrab] = ImVec4{0.16f, 0.16f, 0.21f, 1.0f};
|
||||||
|
colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4{0.19f, 0.2f, 0.25f, 1.0f};
|
||||||
|
colors[ImGuiCol_ScrollbarGrabActive] = ImVec4{0.24f, 0.24f, 0.32f, 1.0f};
|
||||||
|
|
||||||
|
// Seperator
|
||||||
|
colors[ImGuiCol_Separator] = ImVec4{0.44f, 0.37f, 0.61f, 1.0f};
|
||||||
|
colors[ImGuiCol_SeparatorHovered] = ImVec4{0.74f, 0.58f, 0.98f, 1.0f};
|
||||||
|
colors[ImGuiCol_SeparatorActive] = ImVec4{0.84f, 0.58f, 1.0f, 1.0f};
|
||||||
|
|
||||||
|
// Resize Grip
|
||||||
|
colors[ImGuiCol_ResizeGrip] = ImVec4{0.44f, 0.37f, 0.61f, 0.29f};
|
||||||
|
colors[ImGuiCol_ResizeGripHovered] = ImVec4{0.74f, 0.58f, 0.98f, 0.29f};
|
||||||
|
colors[ImGuiCol_ResizeGripActive] = ImVec4{0.84f, 0.58f, 1.0f, 0.29f};
|
||||||
|
|
||||||
|
// Docking
|
||||||
|
colors[ImGuiCol_DockingPreview] = ImVec4{0.44f, 0.37f, 0.61f, 1.0f};
|
||||||
|
}
|
||||||
|
|
||||||
|
void init_style() {
|
||||||
|
auto &style = ImGui::GetStyle();
|
||||||
|
style.TabRounding = 0;
|
||||||
|
style.ScrollbarRounding = 0;
|
||||||
|
style.WindowRounding = 0;
|
||||||
|
style.GrabRounding = 0;
|
||||||
|
style.FrameRounding = 20;
|
||||||
|
style.PopupRounding = 0;
|
||||||
|
style.ChildRounding = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void reset_design() {
|
||||||
|
ImGui::SetCursorPos(ImVec2(0, 0));
|
||||||
|
init_colors();
|
||||||
|
init_style();
|
||||||
|
}
|
||||||
|
|
||||||
|
void reset_views() {
|
||||||
|
waiting_for_device = false;
|
||||||
|
unsupported_device = false;
|
||||||
|
supported_device = false;
|
||||||
|
recovery_wait = false;
|
||||||
|
jailbreak = false;
|
||||||
|
enter_dfu = false;
|
||||||
|
dfu_helper = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* ----------------- [ UI Element Styles ] ----------------- */
|
||||||
|
|
||||||
|
void image_btn_style() {
|
||||||
|
auto &colors = ImGui::GetStyle().Colors;
|
||||||
|
colors[ImGuiCol_Button] = ImVec4{1.0f, 1.0f, 1.0f, 1.0f};
|
||||||
|
colors[ImGuiCol_ButtonHovered] = ImVec4{0.95f, 0.95f, 0.95f, 1.0f};
|
||||||
|
colors[ImGuiCol_ButtonActive] = ImVec4{0.95f, 0.95f, 0.95f, 1.0f};
|
||||||
|
colors[ImGuiCol_CheckMark] = ImVec4{0.95f, 0.95f, 0.95f, 1.0f};
|
||||||
|
colors[ImGuiCol_Text] = ImVec4{0.1f, 0.1f, 0.1f, 1.0f};
|
||||||
|
}
|
||||||
|
|
||||||
|
void image_btn_style_alt() {
|
||||||
|
auto &colors = ImGui::GetStyle().Colors;
|
||||||
|
colors[ImGuiCol_Button] = ImVec4{0.0f, 0.0f, 0.0f, 0.0f};
|
||||||
|
colors[ImGuiCol_ButtonHovered] = ImVec4{0.0f, 0.0f, 0.0f, 0.0f};
|
||||||
|
colors[ImGuiCol_ButtonActive] = ImVec4{0.0f, 0.0f, 0.0f, 0.0f};
|
||||||
|
colors[ImGuiCol_CheckMark] = ImVec4{0.0f, 0.0f, 0.0f, 0.0f};
|
||||||
|
colors[ImGuiCol_Text] = ImVec4{0.0f, 0.0f, 0.0f, 0.0f};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* ----------------- [ IDK Anymore ] ----------------- */
|
||||||
|
|
||||||
|
std::string addstr2(const char *str1, const char *str2) {
|
||||||
|
size_t str1_len = strlen(str1);
|
||||||
|
size_t str2_len = strlen(str2);
|
||||||
|
int buf_size = (int)str1_len + (int)str2_len + 1;
|
||||||
|
char buffer[buf_size];
|
||||||
|
sprintf(buffer, str1, str2);
|
||||||
|
return buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string addstr3(const char *str1, const char *str2, const char *str3) {
|
||||||
|
size_t str1_len = strlen(str1);
|
||||||
|
size_t str2_len = strlen(str2);
|
||||||
|
size_t str3_len = strlen(str3);
|
||||||
|
int buf_size = (int)str1_len + (int)str2_len + (int)str3_len + 1;
|
||||||
|
char buffer[buf_size];
|
||||||
|
sprintf(buffer, str1, str2, str3);
|
||||||
|
return buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string addstr4(const char *str1, const char *str2, const char *str3, const char *str4) {
|
||||||
|
size_t str1_len = strlen(str1);
|
||||||
|
size_t str2_len = strlen(str2);
|
||||||
|
size_t str3_len = strlen(str3);
|
||||||
|
size_t str4_len = strlen(str4);
|
||||||
|
int buf_size = (int)str1_len + (int)str2_len + (int)str3_len + (int)str4_len + 1;
|
||||||
|
char buffer[buf_size];
|
||||||
|
sprintf(buffer, str1, str2, str3, str4);
|
||||||
|
return buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* ----------------- [ UI Colors ] ----------------- */
|
||||||
|
|
||||||
|
ImVec4 hex_color(int hex, float alpha) {
|
||||||
|
float r = ((hex >> 16) & 0xFF) / 255.0f;
|
||||||
|
float g = ((hex >> 8) & 0xFF) / 255.0f;
|
||||||
|
float b = ((hex) & 0xFF) / 255.0f;
|
||||||
|
|
||||||
|
return ImVec4{r, g, b, alpha};
|
||||||
|
}
|
||||||
|
|
||||||
|
ImColor hex_imcolor(int hex, float alpha) {
|
||||||
|
float r = ((hex >> 16) & 0xFF) / 255.0f;
|
||||||
|
float g = ((hex >> 8) & 0xFF) / 255.0f;
|
||||||
|
float b = ((hex) & 0xFF) / 255.0f;
|
||||||
|
|
||||||
|
return ImColor{r, g, b, alpha};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* ----------------- [ UI Element States ] ----------------- */
|
||||||
|
|
||||||
|
bool is_hovered(const char* id, int w, int h) {
|
||||||
|
ImGuiContext& g = *GImGui;
|
||||||
|
ImGuiWindow* window = ImGui::GetCurrentWindow();
|
||||||
|
ImGuiID btn_id = window->GetID(id);
|
||||||
|
const ImRect bb(window->DC.CursorPos, ImVec2(window->DC.CursorPos.x + w, window->DC.CursorPos.x + h));
|
||||||
|
bool hovered = false;
|
||||||
|
ImGui::ButtonBehavior(bb,btn_id,&hovered,NULL);
|
||||||
|
return hovered;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool is_pressed(const char* id, int w, int h) {
|
||||||
|
ImGuiContext& g = *GImGui;
|
||||||
|
ImGuiWindow* window = ImGui::GetCurrentWindow();
|
||||||
|
ImGuiID btn_id = window->GetID(id);
|
||||||
|
const ImRect bb(window->DC.CursorPos, ImVec2(window->DC.CursorPos.x + w, window->DC.CursorPos.x + h));
|
||||||
|
bool pressed = false;
|
||||||
|
ImGui::ButtonBehavior(bb,btn_id,NULL,&pressed);
|
||||||
|
return pressed;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* ----------------- [ Common UI Types ] ----------------- */
|
||||||
|
|
||||||
|
void label(const char *text, ImVec2 location, ImVec4 color, int font) {
|
||||||
|
auto &style = ImGui::GetStyle();
|
||||||
|
ImGuiIO &io = ImGui::GetIO();
|
||||||
|
|
||||||
|
ImGui::SetCursorPos(location);
|
||||||
|
ImGui::PushFont(io.Fonts->Fonts[font]);
|
||||||
|
|
||||||
|
auto &colors = ImGui::GetStyle().Colors;
|
||||||
|
colors[ImGuiCol_Text] = color;
|
||||||
|
|
||||||
|
|
||||||
|
ImGui::Text(text);
|
||||||
|
ImGui::PopFont();
|
||||||
|
reset_design();
|
||||||
|
}
|
||||||
|
|
||||||
|
void draw_box(ImVec2 location, ImVec2 size, ImVec4 color, float radius) {
|
||||||
|
auto &colors = ImGui::GetStyle().Colors;
|
||||||
|
auto &style = ImGui::GetStyle();
|
||||||
|
|
||||||
|
float temp_rounding = style.FrameRounding;
|
||||||
|
ImVec4 temp_color_idle = colors[ImGuiCol_FrameBg];
|
||||||
|
ImVec4 temp_color_hover = colors[ImGuiCol_FrameBgHovered];
|
||||||
|
ImVec4 temp_color_active = colors[ImGuiCol_FrameBgActive];
|
||||||
|
|
||||||
|
style.FrameRounding = radius;
|
||||||
|
colors[ImGuiCol_FrameBg] = color;
|
||||||
|
colors[ImGuiCol_FrameBgHovered] = color;
|
||||||
|
colors[ImGuiCol_FrameBgActive] = color;
|
||||||
|
|
||||||
|
ImGui::SetCursorPos(location);
|
||||||
|
ImGui::ProgressBar(0.0f, size, "");
|
||||||
|
|
||||||
|
style.FrameRounding = temp_rounding;
|
||||||
|
colors[ImGuiCol_FrameBg] = temp_color_idle;
|
||||||
|
colors[ImGuiCol_FrameBgHovered] = temp_color_hover;
|
||||||
|
colors[ImGuiCol_FrameBgActive] = temp_color_active;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* ----------------- [ Animation Systems ] ----------------- */
|
||||||
|
|
||||||
|
void anim_btn(const char* id, ImVec2 size, ImVec2 size_to, ImVec2 pos, ImVec2 pos_to) {
|
||||||
|
ImGuiIO &io = ImGui::GetIO();
|
||||||
|
float global = 25.0f;
|
||||||
|
bool new_w_positive,new_h_positive,new_x_positive,new_y_positive = false;
|
||||||
|
float new_w,new_h,new_x,new_y = 0.0f;
|
||||||
|
float lrg_size,lrg_pos,lrg = 0.0f;
|
||||||
|
|
||||||
|
if (size.x > size_to.x) {new_w = size.x - size_to.x; new_w_positive = false;}
|
||||||
|
else {new_w = size_to.x - size.x; new_w_positive = true;}
|
||||||
|
if (size.y > size_to.y) {new_h = size.y - size_to.y; new_h_positive = false;}
|
||||||
|
else {new_h = size_to.y - size.y;new_h_positive = true;}
|
||||||
|
if (pos.x > pos_to.x) {new_x = pos.x - pos_to.x; new_x_positive = false;}
|
||||||
|
else {new_x = pos_to.x - pos.x;new_x_positive = true;}
|
||||||
|
if (pos.y > pos_to.y) {new_y = pos.y - pos_to.y; new_y_positive = false;}
|
||||||
|
else {new_y = pos_to.y - pos.y;new_y_positive = true;}
|
||||||
|
|
||||||
|
if (new_w > new_h) lrg_size = new_w;
|
||||||
|
else lrg_size = new_h;
|
||||||
|
if (new_x > new_y) lrg_pos = new_x;
|
||||||
|
else lrg_pos = new_y;
|
||||||
|
if (lrg_size > lrg_pos) lrg = lrg_size;
|
||||||
|
else lrg = lrg_pos;
|
||||||
|
|
||||||
|
if (new_w_positive) {if (btn_w < size_to.x) btn_w += (new_w / lrg) * global * io.DeltaTime;}
|
||||||
|
else {if (btn_w > size_to.x) btn_w -= (new_w / lrg) * global * io.DeltaTime;}
|
||||||
|
if (new_h_positive) {if (btn_h < size_to.y) btn_h += (new_h / lrg) * global * io.DeltaTime;}
|
||||||
|
else {if (btn_h > size_to.y) btn_h -= (new_h / lrg) * global * io.DeltaTime;}
|
||||||
|
if (new_x_positive) {if (btn_x < pos_to.x) btn_x += (new_x / lrg) * global * io.DeltaTime;}
|
||||||
|
else {if (btn_x > pos_to.x) btn_x -= (new_x / lrg) * global * io.DeltaTime;}
|
||||||
|
if (new_y_positive) {if (btn_y < pos_to.y) btn_y += (new_y / lrg) * global * io.DeltaTime;}
|
||||||
|
else {if (btn_y > pos_to.y) btn_y -= (new_y / lrg) * global * io.DeltaTime;}
|
||||||
|
}
|
||||||
|
|
||||||
|
void anim_box(const char* id, ImVec2 size, ImVec2 size_to, ImVec2 pos, ImVec2 pos_to) {
|
||||||
|
ImGuiIO &io = ImGui::GetIO();
|
||||||
|
float global = 500.0f;
|
||||||
|
bool new_w_positive,new_h_positive,new_x_positive,new_y_positive = false;
|
||||||
|
float new_w,new_h,new_x,new_y = 0.0f;
|
||||||
|
float lrg_size,lrg_pos,lrg = 0.0f;
|
||||||
|
|
||||||
|
if (size.x > size_to.x) {new_w = size.x - size_to.x; new_w_positive = false;}
|
||||||
|
else {new_w = size_to.x - size.x; new_w_positive = true;}
|
||||||
|
if (size.y > size_to.y) {new_h = size.y - size_to.y; new_h_positive = false;}
|
||||||
|
else {new_h = size_to.y - size.y;new_h_positive = true;}
|
||||||
|
if (pos.x > pos_to.x) {new_x = pos.x - pos_to.x; new_x_positive = false;}
|
||||||
|
else {new_x = pos_to.x - pos.x;new_x_positive = true;}
|
||||||
|
if (pos.y > pos_to.y) {new_y = pos.y - pos_to.y; new_y_positive = false;}
|
||||||
|
else {new_y = pos_to.y - pos.y;new_y_positive = true;}
|
||||||
|
|
||||||
|
if (new_w > new_h) lrg_size = new_w;
|
||||||
|
else lrg_size = new_h;
|
||||||
|
if (new_x > new_y) lrg_pos = new_x;
|
||||||
|
else lrg_pos = new_y;
|
||||||
|
if (lrg_size > lrg_pos) lrg = lrg_size;
|
||||||
|
else lrg = lrg_pos;
|
||||||
|
|
||||||
|
if (new_w_positive) {if (box_w < size_to.x) box_w += (new_w / lrg) * global * io.DeltaTime;}
|
||||||
|
else {if (box_w > size_to.x) box_w -= (new_w / lrg) * global * io.DeltaTime;}
|
||||||
|
if (new_h_positive) {if (box_h < size_to.y) box_h += (new_h / lrg) * global * io.DeltaTime;}
|
||||||
|
else {if (box_h > size_to.y) box_h -= (new_h / lrg) * global * io.DeltaTime;}
|
||||||
|
if (new_x_positive) {if (box_x < pos_to.x) box_x += (new_x / lrg) * global * io.DeltaTime;}
|
||||||
|
else {if (box_x > pos_to.x) box_x -= (new_x / lrg) * global * io.DeltaTime;}
|
||||||
|
if (new_y_positive) {if (box_y < pos_to.y) box_y += (new_y / lrg) * global * io.DeltaTime;}
|
||||||
|
else {if (box_y > pos_to.y) box_y -= (new_y / lrg) * global * io.DeltaTime;}
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline ImVec2 operator+(const ImVec2 &lhs, const ImVec2 &rhs) {
|
||||||
|
return ImVec2(lhs.x + rhs.x, lhs.y + rhs.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImageRotated(ImTextureID tex_id, ImVec2 center, ImVec2 size, float angle) {
|
||||||
|
ImDrawList *draw_list = ImGui::GetWindowDrawList();
|
||||||
|
float cos_a = cosf(angle);
|
||||||
|
float sin_a = sinf(angle);
|
||||||
|
|
||||||
|
ImVec2 pos[4] = {
|
||||||
|
center + ImRotate(ImVec2(-size.x * 0.5f, -size.y * 0.5f), cos_a, sin_a),
|
||||||
|
center + ImRotate(ImVec2(+size.x * 0.5f, -size.y * 0.5f), cos_a, sin_a),
|
||||||
|
center + ImRotate(ImVec2(+size.x * 0.5f, +size.y * 0.5f), cos_a, sin_a),
|
||||||
|
center + ImRotate(ImVec2(-size.x * 0.5f, +size.y * 0.5f), cos_a, sin_a)};
|
||||||
|
|
||||||
|
ImVec2 uvs[4] = {
|
||||||
|
ImVec2(0.0f, 0.0f),
|
||||||
|
ImVec2(1.0f, 0.0f),
|
||||||
|
ImVec2(1.0f, 1.0f),
|
||||||
|
ImVec2(0.0f, 1.0f)};
|
||||||
|
|
||||||
|
draw_list->AddImageQuad(tex_id, pos[0], pos[1], pos[2], pos[3], uvs[0], uvs[1], uvs[2], uvs[3], IM_COL32_WHITE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void rotate_image(const char *image, ImVec2 pos, ImVec2 size, float angle, float speed) {
|
||||||
|
ImGuiIO &io = ImGui::GetIO();
|
||||||
|
ImTextureID image_texture = HelloImGui::ImTextureIdFromAsset(image);
|
||||||
|
|
||||||
|
static float image_angle = angle;
|
||||||
|
image_angle += io.DeltaTime * speed;
|
||||||
|
ImVec2 image_center = ImVec2(pos.x, pos.y);
|
||||||
|
|
||||||
|
ImGui::SetCursorPos(pos);
|
||||||
|
ImageRotated(image_texture, image_center, size, image_angle);
|
||||||
|
}
|
||||||
@@ -0,0 +1,133 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
#include <libimobiledevice/libimobiledevice.h>
|
||||||
|
#include <libimobiledevice/lockdown.h>
|
||||||
|
#include <libimobiledevice/diagnostics_relay.h>
|
||||||
|
#include <plist/plist.h>
|
||||||
|
#include <libirecovery.h>
|
||||||
|
#include <usbmuxd.h>
|
||||||
|
#include <common.h>
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
#include <palerain.h>
|
||||||
|
#include <gui.h>
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
This will all be removed and merged
|
||||||
|
into devhelper.c and dfuhelper.c
|
||||||
|
later on, so for now it stays ig
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
irecv_device_event_context_t irecvctx_gui = NULL;
|
||||||
|
usbmuxd_subscription_context_t usbmuxdctx_gui = NULL;
|
||||||
|
int device_status = DISCONNECTED;
|
||||||
|
devinfo_t dev;
|
||||||
|
char const *udid_gui;
|
||||||
|
|
||||||
|
int connected_normal_mode_gui(const usbmuxd_device_info_t *usbmuxd_device) {
|
||||||
|
int ret;
|
||||||
|
ret = devinfo_cmd(&dev, usbmuxd_device->udid);
|
||||||
|
if (ret != 0) {
|
||||||
|
LOG(LOG_ERROR, "Unable to get device information");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
udid_gui = usbmuxd_device->udid;
|
||||||
|
device_status = NORMAL;
|
||||||
|
if (strcmp(dev.CPUArchitecture, "arm64")) {
|
||||||
|
LOG(LOG_WARNING, "Ignoring non-arm64 device...");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (!strncmp(dev.productType, "iPhone10,", strlen("iPhone10,"))) {
|
||||||
|
if (!checkrain_option_enabled(host_flags, host_option_device_info))
|
||||||
|
LOG(LOG_VERBOSE2, "Product %s requires passcode to be disabled", dev.productType);
|
||||||
|
unsigned char passcode_state = 0;
|
||||||
|
ret = passstat_cmd(&passcode_state, usbmuxd_device->udid);
|
||||||
|
if (ret != 0) {
|
||||||
|
LOG(LOG_ERROR, "Failed to get passcode state");
|
||||||
|
devinfo_free(&dev);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (passcode_state) {
|
||||||
|
LOG(LOG_ERROR, "Passcode must be disabled on this device");
|
||||||
|
if (!checkrain_option_enabled(host_flags, host_option_device_info))
|
||||||
|
LOG(LOG_ERROR, "Additionally, passcode must never be set since restore on iOS 16+");
|
||||||
|
devinfo_free(&dev);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void device_event_cb_gui(const usbmuxd_event_t *event, void* userdata) {
|
||||||
|
if (event->device.conn_type != CONNECTION_TYPE_USB) return;
|
||||||
|
switch (event->event) {
|
||||||
|
case UE_DEVICE_ADD:
|
||||||
|
fprintf(stderr, "Normal mode device connected\n");
|
||||||
|
connected_normal_mode_gui(&event->device);
|
||||||
|
break;
|
||||||
|
case UE_DEVICE_REMOVE:
|
||||||
|
fprintf(stderr, "Normal mode device disconnected\n");
|
||||||
|
device_status = DISCONNECTED;
|
||||||
|
devinfo_free(&dev);
|
||||||
|
if (supported_device || unsupported_device) {
|
||||||
|
supported_device = false;
|
||||||
|
unsupported_device = false;
|
||||||
|
waiting_for_device = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void irecv_device_event_cb_gui(const irecv_device_event_t *event, void* userdata) {
|
||||||
|
switch(event->type) {
|
||||||
|
case IRECV_DEVICE_ADD:
|
||||||
|
if (event->mode == IRECV_K_RECOVERY_MODE_1 || event->mode == IRECV_K_RECOVERY_MODE_2 || event->mode == IRECV_K_RECOVERY_MODE_3 || event->mode == IRECV_K_RECOVERY_MODE_4) {
|
||||||
|
fprintf(stderr, "Recovery mode device %llu connected\n", event->device_info->ecid);
|
||||||
|
recvinfo_t info;
|
||||||
|
recvinfo_cmd(&info, event->device_info->ecid);
|
||||||
|
printf("Mode: recovery\n");
|
||||||
|
printf("ProductType: %s\n", info.product_type);
|
||||||
|
printf("DisplayName: %s\n", info.display_name);
|
||||||
|
device_status = RECOVERY;
|
||||||
|
|
||||||
|
if (waiting_for_device) {
|
||||||
|
device_status = RECOVERY;
|
||||||
|
exitrecv_cmd(event->device_info->ecid);
|
||||||
|
send_alert("Device in Recovery", "Exiting recovery, device must start from normal mode.");
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (event->mode == IRECV_K_DFU_MODE) {
|
||||||
|
device_status == DFU;
|
||||||
|
fprintf(stderr, "DFU mode device %llu connected\n", event->device_info->ecid);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case IRECV_DEVICE_REMOVE:
|
||||||
|
fprintf(stderr, "Recovery mode device disconnected\n");
|
||||||
|
device_status = DISCONNECTED;
|
||||||
|
if (enter_dfu) {
|
||||||
|
device_status = DISCONNECTED;
|
||||||
|
enter_dfu = false;
|
||||||
|
waiting_for_device = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void dfuhelper() {
|
||||||
|
subscribe_cmd(device_event_cb_gui, irecv_device_event_cb_gui);
|
||||||
|
}
|
||||||
|
|
||||||
|
void guifree() {
|
||||||
|
devinfo_free(&dev);
|
||||||
|
unsubscribe_cmd();
|
||||||
|
}
|
||||||
@@ -0,0 +1,350 @@
|
|||||||
|
#include <thread>
|
||||||
|
#include <iostream>
|
||||||
|
#include <math.h>
|
||||||
|
#include<unistd.h>
|
||||||
|
|
||||||
|
#include <imgui/imgui_internal.h>
|
||||||
|
#include <hello_imgui/hello_imgui.h>
|
||||||
|
#include <hello_imgui/app_window_params.h>
|
||||||
|
|
||||||
|
#include <design.h>
|
||||||
|
#include <common.h>
|
||||||
|
extern "C" {
|
||||||
|
#include <gui.h>
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Bools for which view to show */
|
||||||
|
bool waiting_for_device = true;
|
||||||
|
bool unsupported_device = false;
|
||||||
|
bool supported_device = false;
|
||||||
|
bool recovery_wait = false;
|
||||||
|
bool jailbreak = false;
|
||||||
|
bool enter_dfu = false;
|
||||||
|
bool dfu_helper = false;
|
||||||
|
bool settings = false;
|
||||||
|
bool execjb = false;
|
||||||
|
|
||||||
|
uint64_t ms() {
|
||||||
|
using namespace std::chrono;
|
||||||
|
return duration_cast<milliseconds>(system_clock::now().time_since_epoch()).count();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ----------------- [ Main Function ] ----------------- */
|
||||||
|
|
||||||
|
int main(int argc, char *argv[]) {
|
||||||
|
if (argc >= 2) {
|
||||||
|
// temp for testing
|
||||||
|
return palera1n(argc, argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
dfuhelper();
|
||||||
|
|
||||||
|
/* Vars for DFU Healper */
|
||||||
|
int dfu_step1 = 3;
|
||||||
|
int dfu_step2 = 5;
|
||||||
|
int dfu_step3 = 10;
|
||||||
|
bool dfu_done = false;
|
||||||
|
bool set_ms = true;
|
||||||
|
auto desired = ms() + 1000;
|
||||||
|
|
||||||
|
/* HelloImGui Stuff */
|
||||||
|
HelloImGui::RunnerParams params;
|
||||||
|
params.fpsIdling.fpsIdle = 60.f;
|
||||||
|
params.appWindowParams.borderless = false;
|
||||||
|
params.appWindowParams.resizable = false;
|
||||||
|
params.appWindowParams.windowGeometry.size = {550, 300};
|
||||||
|
params.appWindowParams.windowTitle = "palera1n";
|
||||||
|
params.appWindowParams.restorePreviousGeometry = false;
|
||||||
|
params.imGuiWindowParams.defaultImGuiWindowType = HelloImGui::DefaultImGuiWindowType::NoDefaultWindow;
|
||||||
|
|
||||||
|
/* Color & Size Stuff */
|
||||||
|
bool open = true;
|
||||||
|
ImColor grad_color_left = ImColor(255, 177, 35);
|
||||||
|
ImColor grad_color_right = ImColor(4, 121, 168);
|
||||||
|
|
||||||
|
int grad_color_left_r = 255;
|
||||||
|
float text_alpha = 0.0f;
|
||||||
|
bool reverse_gradient = false;
|
||||||
|
|
||||||
|
|
||||||
|
/* ImGui Loop */
|
||||||
|
params.callbacks.ShowGui = [&]() {
|
||||||
|
{
|
||||||
|
/* Init colors, style, and fonts */
|
||||||
|
auto &colors = ImGui::GetStyle().Colors;
|
||||||
|
auto &style = ImGui::GetStyle();
|
||||||
|
ImGuiIO &io = ImGui::GetIO();
|
||||||
|
init_colors();
|
||||||
|
init_style();
|
||||||
|
|
||||||
|
/* Init window size and start ImGui */
|
||||||
|
ImGui::SetNextWindowSize(ImVec2(560, 300));
|
||||||
|
ImGui::SetNextWindowPos(ImVec2(-5, 0));
|
||||||
|
ImGui::Begin("palera1n", &open, ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoTitleBar);
|
||||||
|
|
||||||
|
/* Set our background gradient */
|
||||||
|
ImGui::SetCursorPos(ImVec2(0, 0));
|
||||||
|
ImGuiWindow* window = ImGui::GetCurrentWindow();
|
||||||
|
if (!reverse_gradient) grad_color_left_r -= FLOAT_TO_INT(io.DeltaTime * 100.f) /2;
|
||||||
|
else grad_color_left_r += FLOAT_TO_INT(io.DeltaTime * 100.f) /2;
|
||||||
|
if (grad_color_left_r <= 140) reverse_gradient = true;
|
||||||
|
if (grad_color_left_r >= 255) reverse_gradient = false;
|
||||||
|
grad_color_left = ImColor(135, 63, grad_color_left_r) ;
|
||||||
|
grad_color_right = ImColor(4, 160, grad_color_left_r) ;
|
||||||
|
|
||||||
|
auto dl(ImGui::GetWindowDrawList());
|
||||||
|
dl->AddRectFilledMultiColor(ImVec2(0, 0), // pos - x y
|
||||||
|
ImVec2(560, 300), // size - width height
|
||||||
|
grad_color_left, // color top left
|
||||||
|
hex_imcolor(0x2390b4, 1.0f), // color
|
||||||
|
hex_imcolor(0x04c2a8, 1.0f), // color
|
||||||
|
grad_color_right); // color
|
||||||
|
|
||||||
|
|
||||||
|
if (!recovery_wait && !dfu_helper && !jailbreak) {
|
||||||
|
ImTextureID settings_icon = HelloImGui::ImTextureIdFromAsset("s60.png"); // pngs will be embedded soon
|
||||||
|
ImTextureID about_icon = HelloImGui::ImTextureIdFromAsset("i60.png"); // pngs will be embedded soon
|
||||||
|
image_btn_style_alt();
|
||||||
|
ImGui::SetCursorPos(ImVec2(455, 245));
|
||||||
|
ImGui::ImageButton(about_icon, ImVec2(33.0f, 33.0f));
|
||||||
|
ImGui::SetCursorPos(ImVec2(500, 245));
|
||||||
|
ImGui::ImageButton(settings_icon, ImVec2(33.0f, 33.0f));
|
||||||
|
reset_design();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Waiting for device view */
|
||||||
|
if (waiting_for_device) {
|
||||||
|
if (device_status == NORMAL) {
|
||||||
|
const char *name = dev.displayName;
|
||||||
|
char *arch = dev.CPUArchitecture;
|
||||||
|
char *type = dev.productType;
|
||||||
|
char *version = dev.productVersion;
|
||||||
|
if (strcmp("arm64", arch) != 0) {
|
||||||
|
waiting_for_device = false;
|
||||||
|
unsupported_device = true;
|
||||||
|
btn_x = 213.0f;
|
||||||
|
btn_y = 190.0f;
|
||||||
|
btn_w = 125.0f;
|
||||||
|
btn_h = 35.0f;
|
||||||
|
} else if (strstr(version, "15") != 0 || strstr(version, "16") != 0) {
|
||||||
|
waiting_for_device = false;
|
||||||
|
supported_device = true;
|
||||||
|
btn_x = 213.0f;
|
||||||
|
btn_y = 190.0f;
|
||||||
|
btn_w = 125.0f;
|
||||||
|
btn_h = 35.0f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
box_x = 55.0f; box_y = 75.0f; box_w = 450.0f; box_h = 150.0f;
|
||||||
|
|
||||||
|
draw_box(pos(55, 75), size(450, 150), hex_color(0x000000, 0.25f), 20.0f); // box in center
|
||||||
|
rotate_image("spinner.png", pos(95, 150), size(40, 40), 0.0f, 4.0f); // loading anim in box
|
||||||
|
label("Waiting for connection...", pos(135,122), WHITE, SF_BoldLarge); // Large title
|
||||||
|
label("Connect your device in normal mode to get started!", pos(138, 157), WHITE, SF_Reg); // Sub title
|
||||||
|
|
||||||
|
|
||||||
|
/* Unsupported device view */
|
||||||
|
} else if (unsupported_device) {
|
||||||
|
|
||||||
|
anim_box("Jailbreak", ImVec2(450,150),ImVec2(300,200),ImVec2(54,75),ImVec2(129,50));
|
||||||
|
draw_box(ImVec2(box_x, box_y),ImVec2(box_w, box_h), hex_color(0x000000, 0.25f), 20.0f);
|
||||||
|
|
||||||
|
set_pos(167, 90); font(SF_Bold);
|
||||||
|
ImGui::Text("%s", dev.displayName);
|
||||||
|
ImGui::PopFont();
|
||||||
|
|
||||||
|
set_pos(167, 120); font(SF_RegMed);
|
||||||
|
ImGui::Text("%s running iOS %s (%s)", dev.productType, dev.productVersion, dev.CPUArchitecture);
|
||||||
|
|
||||||
|
colors[ImGuiCol_Text] = hex_color(0xEB5160, 1.0f);
|
||||||
|
set_pos(167, 147); ImGui::Text(ICON_FA_BAN);
|
||||||
|
colors[ImGuiCol_Text] = hex_color(0xFFFFFF, 1.0f);
|
||||||
|
|
||||||
|
ImGui::SameLine(); ImGui::Text("Unsupported device connected");
|
||||||
|
ImGui::PopFont();
|
||||||
|
|
||||||
|
set_pos(213, 190); font(SF_RoundBold); btn_text_on;
|
||||||
|
bool hovered = is_hovered("Exit", 125, 35);
|
||||||
|
bool pressed = is_pressed("Exit", 125, 35);
|
||||||
|
ImVec2 btn_size = ImVec2(120, 30);
|
||||||
|
|
||||||
|
if (hovered) {
|
||||||
|
anim_btn("Exit", ImVec2(125,35),ImVec2(127,37),ImVec2(213,190),ImVec2(212,189));
|
||||||
|
btn_size = ImVec2(btn_w, btn_h);
|
||||||
|
ImGui::SetCursorPos(ImVec2(btn_x,btn_y));
|
||||||
|
} else {
|
||||||
|
anim_btn("Exit", ImVec2(127,37),ImVec2(125,35),ImVec2(212,189),ImVec2(213,190));
|
||||||
|
btn_size = ImVec2(btn_w, btn_h);
|
||||||
|
ImGui::SetCursorPos(ImVec2(btn_x,btn_y));
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui::Button("Exit", btn_size);
|
||||||
|
if (pressed) {
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Supported device view */
|
||||||
|
} else if (supported_device) {
|
||||||
|
anim_box("Jailbreak", ImVec2(450,150),ImVec2(300,200),ImVec2(54,75),ImVec2(129,50));
|
||||||
|
draw_box(ImVec2(box_x, box_y),ImVec2(box_w, box_h), hex_color(0x000000, 0.25f), 20.0f);
|
||||||
|
|
||||||
|
set_pos(167, 90); font(SF_Bold);
|
||||||
|
ImGui::Text("%s", dev.displayName);
|
||||||
|
ImGui::PopFont();
|
||||||
|
|
||||||
|
set_pos(167, 120); font(SF_RegMed);
|
||||||
|
ImGui::Text("%s running iOS %s (%s)", dev.productType, dev.productVersion, dev.CPUArchitecture);
|
||||||
|
|
||||||
|
colors[ImGuiCol_Text] = hex_color(0x3CFF55, 1.0f);
|
||||||
|
set_pos(167, 147); ImGui::Text(ICON_FA_CHECK_CIRCLE);
|
||||||
|
colors[ImGuiCol_Text] = hex_color(0xFFFFFF, 1.0f);
|
||||||
|
|
||||||
|
ImGui::SameLine(); ImGui::Text("Connected and ready.");
|
||||||
|
ImGui::PopFont();
|
||||||
|
|
||||||
|
set_pos(213, 190); font(SF_RoundBold); btn_text_on;
|
||||||
|
bool hovered = is_hovered("Jailbreak", 125, 35);
|
||||||
|
bool pressed = is_pressed("Jailbreak", 125, 35);
|
||||||
|
ImVec2 btn_size = ImVec2(120, 30);
|
||||||
|
|
||||||
|
if (hovered) {
|
||||||
|
anim_btn("Jailbreak", ImVec2(125,35),ImVec2(127,37),ImVec2(213,190),ImVec2(212,189));
|
||||||
|
btn_size = ImVec2(btn_w, btn_h);
|
||||||
|
ImGui::SetCursorPos(ImVec2(btn_x,btn_y));
|
||||||
|
} else {
|
||||||
|
anim_btn("Jailbreak", ImVec2(127,37),ImVec2(125,35),ImVec2(212,189),ImVec2(213,190));
|
||||||
|
btn_size = ImVec2(btn_w, btn_h);
|
||||||
|
ImGui::SetCursorPos(ImVec2(btn_x,btn_y));
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui::Button("Jailbreak", btn_size);
|
||||||
|
if (pressed) {
|
||||||
|
enter_recovery_cmd(0);
|
||||||
|
box_x = 140.0f; box_y = 55.0f; box_w = 320.0f; box_h = 240.0f;
|
||||||
|
supported_device = false;
|
||||||
|
recovery_wait = true;
|
||||||
|
btn_text_off;
|
||||||
|
ImGui::PopFont();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Waiting for recovery view */
|
||||||
|
} else if (recovery_wait) {
|
||||||
|
|
||||||
|
draw_box(ImVec2(125, 105),ImVec2(300, 90), hex_color(0x000000, 0.25f), 20.0f);
|
||||||
|
//ImageRotated(loader, ImVec2(160, 150), ImVec2(40.0f, 40.0f), angle);
|
||||||
|
|
||||||
|
set_pos(210, 138); font(SF_Bold);
|
||||||
|
ImGui::Text("Entering recovery...");
|
||||||
|
ImGui::PopFont();
|
||||||
|
|
||||||
|
if (device_status == RECOVERY) {
|
||||||
|
recovery_wait = false;
|
||||||
|
enter_dfu = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ready for DFU view */
|
||||||
|
} else if (enter_dfu) {
|
||||||
|
|
||||||
|
draw_box(ImVec2(65, 105),ImVec2(450, 90), hex_color(0x000000, 0.25f), 20.0f);
|
||||||
|
|
||||||
|
set_pos(110, 128); font(SF_Bold);
|
||||||
|
ImGui::Text("Time to enter DFU mode!");
|
||||||
|
ImGui::PopFont();
|
||||||
|
|
||||||
|
set_pos(110, 153); font(SF_Reg);
|
||||||
|
ImGui::Text("Locate the power and volume down button before you proceed.");
|
||||||
|
|
||||||
|
set_pos(108, 210); font(SF_Sm_Bold); btn_text_on;
|
||||||
|
if (ImGui::Button("Start", ImVec2(125, 35))) {
|
||||||
|
enter_dfu = false;
|
||||||
|
dfu_helper = true;
|
||||||
|
btn_text_off;
|
||||||
|
ImGui::PopFont();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* DFU helper view */
|
||||||
|
} else if (dfu_helper) {
|
||||||
|
draw_box(ImVec2(75, 65),ImVec2(450, 220), hex_color(0x000000, 0.5f), 20.0f);
|
||||||
|
|
||||||
|
if (dfu_step1 > 0) dfu_text_light;
|
||||||
|
else dfu_text_dark;
|
||||||
|
set_pos(110, 110); font(SF_Reg);
|
||||||
|
ImGui::Text("1. Get Ready! %d", dfu_step1);
|
||||||
|
|
||||||
|
if (dfu_step2 > 0 && dfu_step1 == 0) dfu_text_light;
|
||||||
|
else dfu_text_dark;
|
||||||
|
set_pos(110, 160); ImGui::Text("2. Hold volume down + side button %d", dfu_step2);
|
||||||
|
|
||||||
|
if (dfu_step3 > 0 && dfu_step2 == 0) dfu_text_light;
|
||||||
|
else dfu_text_dark;;
|
||||||
|
set_pos(110, 210);ImGui::Text("3. Release side button, but keep holding volume down %d", dfu_step3);
|
||||||
|
ImGui::PopFont();
|
||||||
|
|
||||||
|
if (!dfu_done) {
|
||||||
|
if (set_ms) {
|
||||||
|
desired = ms() + 1000;
|
||||||
|
set_ms = false;
|
||||||
|
}
|
||||||
|
if (ms() >= desired) {
|
||||||
|
set_ms = true;
|
||||||
|
if (dfu_step1 > 0) dfu_step1 -= 1;
|
||||||
|
else if (dfu_step2 > 0) dfu_step2 -= 1;
|
||||||
|
else if (dfu_step3 > 0) dfu_step3 -= 1;
|
||||||
|
else dfu_done = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dfu_step2 == 2) exitrecv_cmd(dev.ecid);
|
||||||
|
if (dfu_done) {
|
||||||
|
if (device_status == DFU) {
|
||||||
|
guifree();
|
||||||
|
dfu_helper = false;
|
||||||
|
jailbreak = true;
|
||||||
|
} else {
|
||||||
|
send_alert("Failed to enter DFU", "Device failed to enter DFU mode, please try again.");
|
||||||
|
dfu_step1 = 3; dfu_step2 = 5; dfu_step3 = 10;
|
||||||
|
dfu_done = false;
|
||||||
|
dfu_helper = false;
|
||||||
|
waiting_for_device = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Main Jailbreak view */
|
||||||
|
} else if (jailbreak) {
|
||||||
|
pthread_t jb;
|
||||||
|
|
||||||
|
draw_box(ImVec2(25, 70),ImVec2(500, 200), hex_color(0x000000, 0.25f), 20.0f);
|
||||||
|
|
||||||
|
set_pos(20, 15); font(SF_Bold);
|
||||||
|
ImGui::Text("Installing jailbreak...");
|
||||||
|
ImGui::PopFont();
|
||||||
|
|
||||||
|
set_pos(20, 40); font(SF_Reg);
|
||||||
|
ImGui::Text("This will take a moment to jailbreak, hang tight!");
|
||||||
|
|
||||||
|
set_pos(50, 100); font(Hack);
|
||||||
|
if (!execjb) {
|
||||||
|
execjb = true;
|
||||||
|
palera1n(1, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
// redirect logs here...
|
||||||
|
ImGui::Text("[*] Running...");
|
||||||
|
set_pos(50, 125); ImGui::Text("[*] Some epic log stuff will go here :3");
|
||||||
|
set_pos(50, 150); ImGui::Text("[*] lorem ipsum :frcoal:");
|
||||||
|
ImGui::PopFont();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
if (settings) {
|
||||||
|
draw_box(ImVec2(50.0f, 65.0f),ImVec2(230.0f, 230.0f), hex_color(0x000000, 0.5f), 20.0f);
|
||||||
|
draw_box(ImVec2(320.0f, 65.0f),ImVec2(230.0f, 230.0f), hex_color(0x000000, 0.5f), 20.0f);
|
||||||
|
}
|
||||||
|
ImGui::End();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
HelloImGui::Run(params);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -28,6 +28,7 @@
|
|||||||
#include <palerain.h>
|
#include <palerain.h>
|
||||||
#include <xxd-embedded.h>
|
#include <xxd-embedded.h>
|
||||||
#include <kerninfo.h>
|
#include <kerninfo.h>
|
||||||
|
#include <gui.h>
|
||||||
|
|
||||||
#define CMD_LEN_MAX 512
|
#define CMD_LEN_MAX 512
|
||||||
#define OVERRIDE_MAGIC 0xd803b376
|
#define OVERRIDE_MAGIC 0xd803b376
|
||||||
@@ -185,6 +186,8 @@ cleanup:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef GUI
|
||||||
int main (int argc, char* argv[]) {
|
int main (int argc, char* argv[]) {
|
||||||
return palera1n(argc, argv);
|
return palera1n(argc, argv);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
+8
-3
@@ -21,6 +21,7 @@ static bool force_use_verbose_boot = false;
|
|||||||
static struct option longopts[] = {
|
static struct option longopts[] = {
|
||||||
{"setup-partial-fakefs", no_argument, NULL, 'B'},
|
{"setup-partial-fakefs", no_argument, NULL, 'B'},
|
||||||
{"setup-fakefs", no_argument, NULL, 'c'},
|
{"setup-fakefs", no_argument, NULL, 'c'},
|
||||||
|
{"clean-fakefs", no_argument, NULL, 'c'},
|
||||||
{"dfuhelper", no_argument, NULL, 'D'},
|
{"dfuhelper", no_argument, NULL, 'D'},
|
||||||
{"help", no_argument, NULL, 'h'},
|
{"help", no_argument, NULL, 'h'},
|
||||||
{"pongo-shell", no_argument, NULL, 'p'},
|
{"pongo-shell", no_argument, NULL, 'p'},
|
||||||
@@ -64,14 +65,14 @@ static int usage(int e, char* prog_name)
|
|||||||
"12"
|
"12"
|
||||||
#endif
|
#endif
|
||||||
#ifdef ROOTFUL
|
#ifdef ROOTFUL
|
||||||
"cfB"
|
"cCfB"
|
||||||
#endif
|
#endif
|
||||||
#ifdef TUI
|
#ifdef TUI
|
||||||
"t"
|
"t"
|
||||||
#endif
|
#endif
|
||||||
"] [-e boot arguments] [-k Pongo image] [-o overlay file] [-r ramdisk file] [-K KPF file] [-i checkra1n file]\n"
|
"] [-e boot arguments] [-k Pongo image] [-o overlay file] [-r ramdisk file] [-K KPF file] [-i checkra1n file]\n"
|
||||||
"Copyright (C) 2023, palera1n team, All Rights Reserved.\n\n"
|
"Copyright (C) 2023, palera1n team, All Rights Reserved.\n\n"
|
||||||
"iOS/iPadOS 15.0-16.4.1 arm64 jailbreaking tool\n\n"
|
"iOS/iPadOS 15.0-16.5 arm64 jailbreaking tool\n\n"
|
||||||
"\t--version\t\t\t\tPrint version\n"
|
"\t--version\t\t\t\tPrint version\n"
|
||||||
"\t--force-revert\t\t\t\tRemove jailbreak\n"
|
"\t--force-revert\t\t\t\tRemove jailbreak\n"
|
||||||
#ifdef DEV_BUILD
|
#ifdef DEV_BUILD
|
||||||
@@ -81,6 +82,7 @@ static int usage(int e, char* prog_name)
|
|||||||
#ifdef ROOTFUL
|
#ifdef ROOTFUL
|
||||||
"\t-B, --setup-partial-fakefs\t\tSetup partial fakefs\n"
|
"\t-B, --setup-partial-fakefs\t\tSetup partial fakefs\n"
|
||||||
"\t-c, --setup-fakefs\t\t\tSetup fakefs\n"
|
"\t-c, --setup-fakefs\t\t\tSetup fakefs\n"
|
||||||
|
"\t-C, --clean-fakefs\t\t\tClean fakefs\n"
|
||||||
#endif
|
#endif
|
||||||
"\t-d, --demote\t\t\t\tDemote\n"
|
"\t-d, --demote\t\t\t\tDemote\n"
|
||||||
"\t-D, --dfuhelper\t\t\t\tExit after entering DFU\n"
|
"\t-D, --dfuhelper\t\t\t\tExit after entering DFU\n"
|
||||||
@@ -126,7 +128,7 @@ int optparse(int argc, char* argv[]) {
|
|||||||
#ifdef DEV_BUILD
|
#ifdef DEV_BUILD
|
||||||
"12"
|
"12"
|
||||||
#endif
|
#endif
|
||||||
"fcB"
|
"fCcB"
|
||||||
,longopts, NULL)) != -1)
|
,longopts, NULL)) != -1)
|
||||||
{
|
{
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
@@ -139,6 +141,9 @@ int optparse(int argc, char* argv[]) {
|
|||||||
palerain_flags |= palerain_option_setup_rootful;
|
palerain_flags |= palerain_option_setup_rootful;
|
||||||
kpf_flags |= checkrain_option_verbose_boot;
|
kpf_flags |= checkrain_option_verbose_boot;
|
||||||
break;
|
break;
|
||||||
|
case 'C':
|
||||||
|
palerain_flags |= palerain_option_clean_fakefs;
|
||||||
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
host_flags |= host_option_pongo_exit;
|
host_flags |= host_option_pongo_exit;
|
||||||
break;
|
break;
|
||||||
|
|||||||
+51
-52
@@ -114,12 +114,12 @@ usb_ret_t USBBulkUpload(usb_device_handle_t handle, void *data, int len)
|
|||||||
|
|
||||||
static int FoundDevice(libusb_context *ctx, libusb_device *dev, libusb_hotplug_event event, void *arg)
|
static int FoundDevice(libusb_context *ctx, libusb_device *dev, libusb_hotplug_event event, void *arg)
|
||||||
{
|
{
|
||||||
LOG(LOG_VERBOSE, "PongoOS USB Device connected");
|
|
||||||
stuff_t *stuff = arg;
|
stuff_t *stuff = arg;
|
||||||
if(stuff->handle)
|
if(stuff->handle)
|
||||||
{
|
{
|
||||||
return LIBUSB_SUCCESS;
|
return LIBUSB_SUCCESS;
|
||||||
}
|
}
|
||||||
|
LOG(LOG_VERBOSE, "PongoOS USB Device connected");
|
||||||
|
|
||||||
libusb_device_handle *handle;
|
libusb_device_handle *handle;
|
||||||
int r = libusb_open(dev, &handle);
|
int r = libusb_open(dev, &handle);
|
||||||
@@ -162,12 +162,12 @@ static int FoundDevice(libusb_context *ctx, libusb_device *dev, libusb_hotplug_e
|
|||||||
|
|
||||||
static int LostDevice(libusb_context *ctx, libusb_device *dev, libusb_hotplug_event event, void *arg)
|
static int LostDevice(libusb_context *ctx, libusb_device *dev, libusb_hotplug_event event, void *arg)
|
||||||
{
|
{
|
||||||
LOG(LOG_VERBOSE, "PongoOS USB Device disconnected");
|
|
||||||
stuff_t *stuff = arg;
|
stuff_t *stuff = arg;
|
||||||
if(stuff->dev != dev)
|
if(stuff->dev != dev)
|
||||||
{
|
{
|
||||||
return LIBUSB_SUCCESS;
|
return LIBUSB_SUCCESS;
|
||||||
}
|
}
|
||||||
|
LOG(LOG_VERBOSE, "PongoOS USB Device disconnected");
|
||||||
|
|
||||||
io_stop(stuff);
|
io_stop(stuff);
|
||||||
libusb_close(stuff->handle);
|
libusb_close(stuff->handle);
|
||||||
@@ -181,6 +181,7 @@ static int LostDevice(libusb_context *ctx, libusb_device *dev, libusb_hotplug_ev
|
|||||||
int wait_for_pongo(void)
|
int wait_for_pongo(void)
|
||||||
{
|
{
|
||||||
stuff_t stuff;
|
stuff_t stuff;
|
||||||
|
stuff.handle = NULL;
|
||||||
libusb_hotplug_callback_handle hp[2];
|
libusb_hotplug_callback_handle hp[2];
|
||||||
libusb_context* ctx = NULL;
|
libusb_context* ctx = NULL;
|
||||||
|
|
||||||
@@ -198,14 +199,6 @@ int wait_for_pongo(void)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
r = libusb_hotplug_register_callback(ctx, LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED, 0, PONGO_USB_VENDOR, PONGO_USB_PRODUCT, LIBUSB_HOTPLUG_MATCH_ANY, FoundDevice, &stuff, &hp[0]);
|
|
||||||
if(r != LIBUSB_SUCCESS)
|
|
||||||
{
|
|
||||||
ERR("libusb_hotplug: %s", libusb_error_name(r));
|
|
||||||
libusb_exit(ctx);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
r = libusb_hotplug_register_callback(ctx, LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT, 0, PONGO_USB_VENDOR, PONGO_USB_PRODUCT, LIBUSB_HOTPLUG_MATCH_ANY, LostDevice, &stuff, &hp[1]);
|
r = libusb_hotplug_register_callback(ctx, LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT, 0, PONGO_USB_VENDOR, PONGO_USB_PRODUCT, LIBUSB_HOTPLUG_MATCH_ANY, LostDevice, &stuff, &hp[1]);
|
||||||
if(r != LIBUSB_SUCCESS)
|
if(r != LIBUSB_SUCCESS)
|
||||||
{
|
{
|
||||||
@@ -214,55 +207,61 @@ int wait_for_pongo(void)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
libusb_device **list;
|
while (1) {
|
||||||
ssize_t sz = libusb_get_device_list(ctx, &list);
|
|
||||||
if(sz < 0)
|
|
||||||
{
|
|
||||||
ERR("libusb_get_device_list: %s", libusb_error_name((int)sz));
|
|
||||||
libusb_exit(ctx);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
for(ssize_t i = 0; i < sz; ++i)
|
|
||||||
{
|
|
||||||
struct libusb_device_descriptor desc;
|
|
||||||
r = libusb_get_device_descriptor(list[i], &desc);
|
|
||||||
if(r != LIBUSB_SUCCESS)
|
|
||||||
{
|
|
||||||
ERR("libusb_get_device_descriptor: %s", libusb_error_name(r));
|
|
||||||
// continue anyway
|
|
||||||
}
|
|
||||||
if(desc.idVendor != PONGO_USB_VENDOR || desc.idProduct != PONGO_USB_PRODUCT)
|
|
||||||
{
|
|
||||||
libusb_unref_device(list[i]);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
r = FoundDevice(ctx, list[i], LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED, &stuff);
|
|
||||||
for(ssize_t j = i + 1; j < sz; ++j)
|
|
||||||
{
|
|
||||||
libusb_unref_device(list[j]);
|
|
||||||
}
|
|
||||||
if(r != LIBUSB_SUCCESS)
|
|
||||||
{
|
|
||||||
libusb_free_device_list(list, 0);
|
|
||||||
libusb_exit(ctx);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
libusb_free_device_list(list, 0);
|
|
||||||
|
|
||||||
while(get_spin())
|
|
||||||
{
|
|
||||||
r = libusb_handle_events(ctx);
|
r = libusb_handle_events(ctx);
|
||||||
if(r != LIBUSB_SUCCESS)
|
if(r != LIBUSB_SUCCESS)
|
||||||
{
|
{
|
||||||
ERR("libusb_handle_events: %s", libusb_error_name(r));
|
ERR("libusb_handle_events: %s", libusb_error_name(r));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
libusb_device **list;
|
||||||
|
ssize_t sz = libusb_get_device_list(ctx, &list);
|
||||||
|
bool done = false;
|
||||||
|
if(sz < 0)
|
||||||
|
{
|
||||||
|
ERR("libusb_get_device_list: %s", libusb_error_name((int)sz));
|
||||||
|
libusb_exit(ctx);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
for(ssize_t i = 0; i < sz; ++i)
|
||||||
|
{
|
||||||
|
struct libusb_device_descriptor desc;
|
||||||
|
r = libusb_get_device_descriptor(list[i], &desc);
|
||||||
|
if(r != LIBUSB_SUCCESS)
|
||||||
|
{
|
||||||
|
ERR("libusb_get_device_descriptor: %s", libusb_error_name(r));
|
||||||
|
// continue anyway
|
||||||
|
}
|
||||||
|
if(desc.idVendor != PONGO_USB_VENDOR || desc.idProduct != PONGO_USB_PRODUCT)
|
||||||
|
{
|
||||||
|
libusb_unref_device(list[i]);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
r = FoundDevice(ctx, list[i], LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED, &stuff);
|
||||||
|
for (ssize_t j = i; j < sz; ++j) {
|
||||||
|
libusb_unref_device(list[j]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(r != LIBUSB_SUCCESS)
|
||||||
|
{
|
||||||
|
libusb_free_device_list(list, 0);
|
||||||
|
libusb_exit(ctx);
|
||||||
|
return -1;
|
||||||
|
} else {
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
libusb_free_device_list(list, 0);
|
||||||
|
|
||||||
|
if (done) goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
libusb_exit(ctx);
|
end:
|
||||||
return 0;
|
libusb_exit(ctx);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
Reference in new issue
Block a user