mirror of
https://github.com/palera1n/palera1n.git
synced 2026-10-23 18:49:48 +02:00
Compare commits
11
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4219552729 | ||
|
|
db7e1e511d | ||
|
|
04f6d975ca | ||
|
|
74ebacf120 | ||
|
|
891a89d26f | ||
|
|
b0aa963b6f | ||
|
|
5a4bc455c3 | ||
|
|
ded58231fb | ||
|
|
6605a10b2f | ||
|
|
c24710eb83 | ||
|
|
d4b498ba7a |
No files matched your search
@@ -1,12 +0,0 @@
|
|||||||
name: No Template
|
|
||||||
description: Create a standard issue, no template involved.
|
|
||||||
labels: [palera1n]
|
|
||||||
body:
|
|
||||||
- type: textarea
|
|
||||||
id: description
|
|
||||||
attributes:
|
|
||||||
label: Description
|
|
||||||
description:
|
|
||||||
placeholder: Anyone else has issues with ...? If so, I found a solution.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
blank_issues_enabled: false
|
|
||||||
contact_links:
|
|
||||||
- name: Mention us on X (formerly known as Twitter)
|
|
||||||
url: https://twitter.com/palera1n
|
|
||||||
about: Mention us about your issue if you're not comfortable with using Github issues.
|
|
||||||
- name: Support Server
|
|
||||||
url: https://dsc.gg/palera1n
|
|
||||||
about: If you wanna ask support via Discord, thats an available option as well. Though, we recommend you do one of the previous options if possible.
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
name: Feature Request
|
|
||||||
description: Request a feature in palera1n!
|
|
||||||
labels: [enhancement, palera1n]
|
|
||||||
body:
|
|
||||||
- type: textarea
|
|
||||||
id: feature-request
|
|
||||||
attributes:
|
|
||||||
label: Feature Description
|
|
||||||
description:
|
|
||||||
placeholder: I want ... to be added to palera1n, because ...
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: detailed-description
|
|
||||||
attributes:
|
|
||||||
label: Start going into detail..
|
|
||||||
description:
|
|
||||||
placeholder: I think it should also include ..., because of convenience.
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
name: Create Issue
|
|
||||||
description: Ask help for palera1n regarding support or generally how it works!
|
|
||||||
labels: [palera1n]
|
|
||||||
assignees:
|
|
||||||
- ssalggnikool
|
|
||||||
- asdfugil
|
|
||||||
body:
|
|
||||||
- type: input
|
|
||||||
id: device
|
|
||||||
attributes:
|
|
||||||
label: Device
|
|
||||||
description: What is the device that you're using with palera1n? (iPhone, iPad, iPod Touch, appleTV, iBridge (T2))
|
|
||||||
placeholder: iPhone X
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: input
|
|
||||||
id: version
|
|
||||||
attributes:
|
|
||||||
label: Version
|
|
||||||
description: What is version you're running? (i.e. iOS, iPadOS, tvOS, bridgeOS
|
|
||||||
placeholder: iOS 15.6
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: checkboxes
|
|
||||||
id: passcode-enabled
|
|
||||||
attributes:
|
|
||||||
label: Passcode?
|
|
||||||
description: Is your passcode enabled?
|
|
||||||
options:
|
|
||||||
- label: Passcode is enabled.
|
|
||||||
required: false
|
|
||||||
- type: textarea
|
|
||||||
id: detailed-description
|
|
||||||
attributes:
|
|
||||||
label: Start going into detail..
|
|
||||||
description:
|
|
||||||
placeholder: My device couldn't boot jailbroken. I have checked ... using ..., none of the solutions I've been given are working for me. I don't know what to do.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: checkboxes
|
|
||||||
id: familiarity
|
|
||||||
attributes:
|
|
||||||
label: Familiarity with palera1n
|
|
||||||
description: Are you familiar with palera1n and how to use it?
|
|
||||||
options:
|
|
||||||
- label: I am familiar with palera1n and how to use it!
|
|
||||||
required: false
|
|
||||||
- type: checkboxes
|
|
||||||
id: familiarity-command-line
|
|
||||||
attributes:
|
|
||||||
label: Familiarity with CLI
|
|
||||||
description: Are you familiar with the command-line in anyway? (i.e. Terminal.app, Konsole)
|
|
||||||
options:
|
|
||||||
- label: I am familiar with the command-line!
|
|
||||||
required: false
|
|
||||||
+131
-8
@@ -74,8 +74,11 @@ jobs:
|
|||||||
minos: 7.0
|
minos: 7.0
|
||||||
runs-on: macos-12
|
runs-on: macos-12
|
||||||
env:
|
env:
|
||||||
MBEDTLS_VERSION: 3.5.2
|
MBEDTLS_VERSION: 3.5.0
|
||||||
READLINE_VERSION: 8.2
|
READLINE_VERSION: 8.2
|
||||||
|
SLANG_VERSION: 2.3.3
|
||||||
|
NEWT_VERSION: 0.52.23
|
||||||
|
POPT_VERSION: 1.19
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -97,12 +100,18 @@ jobs:
|
|||||||
|
|
||||||
- name: Download dependencies (source code)
|
- name: Download dependencies (source code)
|
||||||
run: |
|
run: |
|
||||||
curl -LOO \
|
curl -LOOOOOO \
|
||||||
https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/v${{ env.MBEDTLS_VERSION }}.tar.gz \
|
https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/v${{ env.MBEDTLS_VERSION }}.tar.gz \
|
||||||
https://mirror-hk.koddos.net/gnu/readline/readline-${{ env.READLINE_VERSION }}.tar.gz
|
https://mirror-hk.koddos.net/gnu/readline/readline-${{ env.READLINE_VERSION }}.tar.gz \
|
||||||
|
https://www.jedsoft.org/releases/slang/slang-${{ env.SLANG_VERSION }}.tar.bz2 \
|
||||||
|
https://releases.pagure.org/newt/newt-${{ env.NEWT_VERSION }}.tar.gz \
|
||||||
|
https://github.com/rpm-software-management/popt/archive/refs/tags/popt-${{ env.POPT_VERSION }}-release.tar.gz
|
||||||
|
|
||||||
tar -xf v${{ env.MBEDTLS_VERSION }}.tar.gz
|
tar -xf v${{ env.MBEDTLS_VERSION }}.tar.gz
|
||||||
tar -xf readline-${{ env.READLINE_VERSION }}.tar.gz
|
tar -xf readline-${{ env.READLINE_VERSION }}.tar.gz
|
||||||
|
tar -xjf slang-${{ env.SLANG_VERSION }}.tar.bz2
|
||||||
|
tar -xf newt-${{ env.NEWT_VERSION }}.tar.gz
|
||||||
|
tar -xf popt-${{ env.POPT_VERSION }}-release.tar.gz
|
||||||
git clone --depth=1 https://github.com/libimobiledevice/libplist
|
git clone --depth=1 https://github.com/libimobiledevice/libplist
|
||||||
git clone --depth=1 https://github.com/libimobiledevice/libimobiledevice-glue
|
git clone --depth=1 https://github.com/libimobiledevice/libimobiledevice-glue
|
||||||
git clone --depth=1 https://github.com/libimobiledevice/libirecovery
|
git clone --depth=1 https://github.com/libimobiledevice/libirecovery
|
||||||
@@ -205,6 +214,51 @@ jobs:
|
|||||||
gmake -j$(sysctl -n hw.ncpu) install DESTDIR=${{ env.DESTDIR }}
|
gmake -j$(sysctl -n hw.ncpu) install DESTDIR=${{ env.DESTDIR }}
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
|
- name: Build S-Lang
|
||||||
|
run: |
|
||||||
|
cd slang-${{ env.SLANG_VERSION }}
|
||||||
|
./configure \
|
||||||
|
${{ env.CONFIGURE_ARGS }} \
|
||||||
|
--without-x \
|
||||||
|
--without-pcre \
|
||||||
|
--without-onig \
|
||||||
|
--without-z \
|
||||||
|
--without-png \
|
||||||
|
--without-iconv
|
||||||
|
gmake -j$(sysctl -n hw.ncpu) static
|
||||||
|
gmake -j$(sysctl -n hw.ncpu) install-static DESTDIR=${{ env.DESTDIR }}
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
- name: Build popt
|
||||||
|
run: |
|
||||||
|
cd popt-popt-${{ env.POPT_VERSION }}-release
|
||||||
|
autoreconf -fiv
|
||||||
|
./configure \
|
||||||
|
${{ env.CONFIGURE_ARGS }} \
|
||||||
|
--without-libiconv-prefix \
|
||||||
|
--without-libintl-prefix \
|
||||||
|
--disable-nls \
|
||||||
|
--disable-werror
|
||||||
|
gmake -j$(sysctl -n hw.ncpu)
|
||||||
|
gmake -j$(sysctl -n hw.ncpu) install DESTDIR=${{ env.DESTDIR }}
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
- name: Build newt
|
||||||
|
run: |
|
||||||
|
cd newt-${{ env.NEWT_VERSION }}
|
||||||
|
./configure \
|
||||||
|
${{ env.CONFIGURE_ARGS }} \
|
||||||
|
--with-readline=gnu \
|
||||||
|
--without-python \
|
||||||
|
--without-tcl \
|
||||||
|
--disable-nls
|
||||||
|
gmake -j$(sysctl -n hw.ncpu) libnewt.a
|
||||||
|
mkdir -p ${{ env.DESTDIR }}/usr/local/{lib/pkgconfig,include}
|
||||||
|
install -m644 libnewt.pc ${{ env.DESTDIR }}/usr/local/lib/pkgconfig
|
||||||
|
install -m644 libnewt.a ${{ env.DESTDIR }}/usr/local/lib
|
||||||
|
install -m644 newt.h ${{ env.DESTDIR }}/usr/local/include
|
||||||
|
cd ..
|
||||||
|
|
||||||
- name: Build libplist
|
- name: Build libplist
|
||||||
run: |
|
run: |
|
||||||
cd libplist
|
cd libplist
|
||||||
@@ -262,7 +316,7 @@ jobs:
|
|||||||
cp -a sysroot/${{ env.PREFIX }}/{include,lib} dep_root
|
cp -a sysroot/${{ env.PREFIX }}/{include,lib} dep_root
|
||||||
find dep_root -name '*.dylib' -delete
|
find dep_root -name '*.dylib' -delete
|
||||||
find dep_root -name '*.la' -delete
|
find dep_root -name '*.la' -delete
|
||||||
gmake -j$(sysctl -n hw.ncpu) TUI=1
|
gmake -j$(sysctl -n hw.ncpu)
|
||||||
cp src/palera1n palera1n-${{ matrix.os }}-${{ matrix.arch }}
|
cp src/palera1n palera1n-${{ matrix.os }}-${{ matrix.arch }}
|
||||||
dsymutil palera1n-${{ matrix.os }}-${{ matrix.arch }}
|
dsymutil palera1n-${{ matrix.os }}-${{ matrix.arch }}
|
||||||
strip palera1n-${{ matrix.os }}-${{ matrix.arch }}
|
strip palera1n-${{ matrix.os }}-${{ matrix.arch }}
|
||||||
@@ -477,9 +531,13 @@ jobs:
|
|||||||
- aarch64-linux-musl
|
- aarch64-linux-musl
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
MBEDTLS_VERSION: 3.5.2
|
MBEDTLS_VERSION: 3.5.0
|
||||||
LIBUSB_VERSION: 1.0.26
|
LIBUSB_VERSION: 1.0.26
|
||||||
READLINE_VERSION: 8.2
|
READLINE_VERSION: 8.2
|
||||||
|
SLANG_VERSION: 2.3.3
|
||||||
|
NEWT_VERSION: 0.52.23
|
||||||
|
GPM_VERSION: 1.20.7
|
||||||
|
POPT_VERSION: 1.19
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -547,14 +605,22 @@ jobs:
|
|||||||
|
|
||||||
- name: Download dependencies (source code)
|
- name: Download dependencies (source code)
|
||||||
run: |
|
run: |
|
||||||
curl -LOOO \
|
curl -LOOOOOOO \
|
||||||
https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/v${{ env.MBEDTLS_VERSION }}.tar.gz \
|
https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/v${{ env.MBEDTLS_VERSION }}.tar.gz \
|
||||||
https://github.com/libusb/libusb/releases/download/v${{ env.LIBUSB_VERSION }}/libusb-${{ env.LIBUSB_VERSION }}.tar.bz2 \
|
https://github.com/libusb/libusb/releases/download/v${{ env.LIBUSB_VERSION }}/libusb-${{ env.LIBUSB_VERSION }}.tar.bz2 \
|
||||||
https://mirror-hk.koddos.net/gnu/readline/readline-${{ env.READLINE_VERSION }}.tar.gz
|
https://mirror-hk.koddos.net/gnu/readline/readline-${{ env.READLINE_VERSION }}.tar.gz \
|
||||||
|
https://www.jedsoft.org/releases/slang/slang-${{ env.SLANG_VERSION }}.tar.bz2 \
|
||||||
|
https://releases.pagure.org/newt/newt-${{ env.NEWT_VERSION }}.tar.gz \
|
||||||
|
https://github.com/telmich/gpm/archive/refs/tags/${{ env.GPM_VERSION }}.tar.gz \
|
||||||
|
https://github.com/rpm-software-management/popt/archive/refs/tags/popt-${{ env.POPT_VERSION }}-release.tar.gz
|
||||||
|
|
||||||
tar -xf v${{ env.MBEDTLS_VERSION }}.tar.gz
|
tar -xf v${{ env.MBEDTLS_VERSION }}.tar.gz
|
||||||
tar -xjf libusb-${{ env.LIBUSB_VERSION }}.tar.bz2
|
tar -xjf libusb-${{ env.LIBUSB_VERSION }}.tar.bz2
|
||||||
tar -xf readline-${{ env.READLINE_VERSION }}.tar.gz
|
tar -xf readline-${{ env.READLINE_VERSION }}.tar.gz
|
||||||
|
tar -xjf slang-${{ env.SLANG_VERSION }}.tar.bz2
|
||||||
|
tar -xf newt-${{ env.NEWT_VERSION }}.tar.gz
|
||||||
|
tar -xf ${{ env.GPM_VERSION }}.tar.gz
|
||||||
|
tar -xf popt-${{ env.POPT_VERSION }}-release.tar.gz
|
||||||
git clone --depth=1 https://github.com/libimobiledevice/libplist
|
git clone --depth=1 https://github.com/libimobiledevice/libplist
|
||||||
git clone --depth=1 https://github.com/libimobiledevice/libimobiledevice-glue
|
git clone --depth=1 https://github.com/libimobiledevice/libimobiledevice-glue
|
||||||
git clone --depth=1 https://github.com/libimobiledevice/libirecovery
|
git clone --depth=1 https://github.com/libimobiledevice/libirecovery
|
||||||
@@ -602,6 +668,63 @@ jobs:
|
|||||||
make -j$(nproc) install DESTDIR=${{ env.DESTDIR }}
|
make -j$(nproc) install DESTDIR=${{ env.DESTDIR }}
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
|
- name: Build S-Lang
|
||||||
|
run: |
|
||||||
|
cd slang-${{ env.SLANG_VERSION }}
|
||||||
|
./configure \
|
||||||
|
${{ env.CONFIGURE_ARGS }} \
|
||||||
|
--without-x \
|
||||||
|
--without-pcre \
|
||||||
|
--without-onig \
|
||||||
|
--without-z \
|
||||||
|
--without-png \
|
||||||
|
--without-iconv
|
||||||
|
gmake -j$(sysctl -n hw.ncpu) static
|
||||||
|
gmake -j$(sysctl -n hw.ncpu) install-static DESTDIR=${{ env.DESTDIR }}
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
- name: Build GPM
|
||||||
|
run: |
|
||||||
|
cd gpm-${{ env.GPM_VERSION }}
|
||||||
|
cat ../patches/gpm/*.patch | patch -sN -d . -p1
|
||||||
|
./autogen.sh
|
||||||
|
./configure \
|
||||||
|
${{ env.CONFIGURE_ARGS }}
|
||||||
|
gmake -j$(sysctl -n hw.ncpu)
|
||||||
|
gmake -j$(sysctl -n hw.ncpu) install DESTDIR=${{ env.DESTDIR }}
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
- name: Build popt
|
||||||
|
run: |
|
||||||
|
cd popt-popt-${{ env.POPT_VERSION }}-release
|
||||||
|
autoreconf -fiv
|
||||||
|
./configure \
|
||||||
|
${{ env.CONFIGURE_ARGS }} \
|
||||||
|
--without-libiconv-prefix \
|
||||||
|
--without-libintl-prefix \
|
||||||
|
--disable-nls \
|
||||||
|
--disable-werror
|
||||||
|
gmake -j$(sysctl -n hw.ncpu)
|
||||||
|
gmake -j$(sysctl -n hw.ncpu) install DESTDIR=${{ env.DESTDIR }}
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
- name: Build newt
|
||||||
|
run: |
|
||||||
|
cd newt-${{ env.NEWT_VERSION }}
|
||||||
|
./configure \
|
||||||
|
${{ env.CONFIGURE_ARGS }} \
|
||||||
|
--with-readline=gnu \
|
||||||
|
--without-python \
|
||||||
|
--without-tcl \
|
||||||
|
--disable-nls \
|
||||||
|
--with-gpm-support
|
||||||
|
gmake -j$(sysctl -n hw.ncpu) libnewt.a
|
||||||
|
mkdir -p ${{ env.DESTDIR }}/usr/local/{lib/pkgconfig,include}
|
||||||
|
install -m644 libnewt.pc ${{ env.DESTDIR }}/usr/local/lib/pkgconfig
|
||||||
|
install -m644 libnewt.a ${{ env.DESTDIR }}/usr/local/lib
|
||||||
|
install -m644 newt.h ${{ env.DESTDIR }}/usr/local/include
|
||||||
|
cd ..
|
||||||
|
|
||||||
- name: Build libplist
|
- name: Build libplist
|
||||||
run: |
|
run: |
|
||||||
cd libplist
|
cd libplist
|
||||||
@@ -675,7 +798,7 @@ jobs:
|
|||||||
cp -a ${{ env.DESTDIR }}/${{ env.PREFIX }}/{include,lib} dep_root
|
cp -a ${{ env.DESTDIR }}/${{ env.PREFIX }}/{include,lib} dep_root
|
||||||
find dep_root -name '*.so' -delete
|
find dep_root -name '*.so' -delete
|
||||||
find dep_root -name '*.la' -delete
|
find dep_root -name '*.la' -delete
|
||||||
CC="${{ matrix.triple }}-gcc" make -j$(nproc) TUI=1
|
CC="${{ matrix.triple }}-gcc" make -j$(nproc)
|
||||||
cp src/palera1n palera1n.release
|
cp src/palera1n palera1n.release
|
||||||
|
|
||||||
- name: Seperate debug symbols
|
- name: Seperate debug symbols
|
||||||
|
|||||||
@@ -24,5 +24,3 @@ src/*.dmg.c
|
|||||||
src/stage2/
|
src/stage2/
|
||||||
src/libcheckra1nhelper.dylib*
|
src/libcheckra1nhelper.dylib*
|
||||||
src/Pongo.bin
|
src/Pongo.bin
|
||||||
sysroot
|
|
||||||
compile.sh
|
|
||||||
@@ -3,7 +3,7 @@ DEP = $(SRC)/dep_root
|
|||||||
STRIP = strip
|
STRIP = strip
|
||||||
CC ?= cc
|
CC ?= cc
|
||||||
CFLAGS += -isystem $(DEP)/include -I$(SRC)/include -I$(SRC) -D_XOPEN_SOURCE=500
|
CFLAGS += -isystem $(DEP)/include -I$(SRC)/include -I$(SRC) -D_XOPEN_SOURCE=500
|
||||||
CFLAGS += -Wall -Wextra -Wno-unused-parameter -DPALERAIN_VERSION=\"2.0\" -DHAVE_LIBIMOBILEDEVICE
|
CFLAGS += -Wall -Wextra -Wno-unused-parameter -DPALERAIN_VERSION=\"2.0.0\" -DHAVE_LIBIMOBILEDEVICE
|
||||||
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
|
||||||
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 -lm
|
LIBS += $(DEP)/lib/libimobiledevice-glue-1.0.a $(DEP)/lib/libplist-2.0.a -pthread -lm
|
||||||
@@ -26,6 +26,12 @@ LDFLAGS += -Wl,--gc-sections
|
|||||||
endif
|
endif
|
||||||
LIBS += $(DEP)/lib/libmbedtls.a $(DEP)/lib/libmbedcrypto.a $(DEP)/lib/libmbedx509.a $(DEP)/lib/libreadline.a
|
LIBS += $(DEP)/lib/libmbedtls.a $(DEP)/lib/libmbedcrypto.a $(DEP)/lib/libmbedx509.a $(DEP)/lib/libreadline.a
|
||||||
|
|
||||||
|
ifeq ($(TUI),1)
|
||||||
|
LIBS += $(DEP)/lib/libnewt.a $(DEP)/lib/libpopt.a $(DEP)/lib/libslang.a
|
||||||
|
ifeq ($(TARGET_OS),Linux)
|
||||||
|
LIBS += $(DEP)/lib/libgpm.a
|
||||||
|
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)
|
||||||
@@ -65,9 +71,6 @@ 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)\""
|
||||||
|
|
||||||
CPATH =
|
|
||||||
LIBRARY_PATH =
|
|
||||||
|
|
||||||
export SRC DEP UNAME CC CFLAGS LDFLAGS LIBS SHELL TARGET_OS DEV_BUILD BUILD_DATE BUILD_TAG BUILD_WHOAMI BUILD_STYLE BUILD_NUMBER BUILD_BRANCH
|
export SRC DEP UNAME CC CFLAGS LDFLAGS LIBS SHELL TARGET_OS DEV_BUILD BUILD_DATE BUILD_TAG BUILD_WHOAMI BUILD_STYLE BUILD_NUMBER BUILD_BRANCH
|
||||||
|
|
||||||
all: palera1n
|
all: palera1n
|
||||||
|
|||||||
@@ -1,96 +1,54 @@
|
|||||||
# palera1n
|
<center>
|
||||||
[](https://github.com/palera1n/palera1n/releases)
|
<a href="#"><img src="https://cdn.discordapp.com/attachments/1103485261196832779/1126450758523572285/pxd.png" alt="Logo"></a>
|
||||||
[](https://github.com/palera1n/palera1n/releases)
|
</center>
|
||||||
[](https://github.com/palera1n/palera1n/blob/main/LICENSE)
|
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://cdn.nickchan.lol/palera1n/c-rewrite/releases/v2.0.0-beta.7/palera1n.1.html">Documentation</a> •
|
||||||
|
<a href="https://ios.cfw.guide/installing-palera1n">Installation Guide</a> •
|
||||||
|
<a href="#requirements">Requirements</a> •
|
||||||
|
<a href="https://discord.gg/palera1n">Support Discord</a> •
|
||||||
|
<a href="https://palera.in">Website</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
Jailbreak for A8 through A11, T2 devices, on iOS/iPadOS/tvOS 15.0, bridgeOS 5.0 and higher.
|
## Information
|
||||||
|
This is the official repo for the palera1n project, a jailbreak for arm64 devices on iOS 15.0+
|
||||||
|
|
||||||
|
- Loader application used in palera1n can be found [here](https://github.com/palera1n/loader).
|
||||||
|
- palera1ns jbinit can be found [here](https://github.com/palera1n/jbinit).
|
||||||
|
- palera1ns custom PongoOS can be found [here](https://github.com/palera1n/pongoos).
|
||||||
|
|
||||||
|
Website & credits can be found at https://palera.in (scroll down for credits).
|
||||||
|
|
||||||
|
## 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.
|
||||||
|:--: |
|
|
||||||
| A screenshot of palera1n being used in a Terminal |
|
|
||||||
|
|
||||||
## Device Support
|
|
||||||
|
|
||||||
> [!NOTE]
|
|
||||||
> Apple TV & iBridge support are not currently in the beta releases of palera1n, ETA s0n
|
|
||||||
|
|
||||||
<!--- Mobile --->
|
|
||||||
|
|
||||||
| iPhone(s) | iPad(s) | iPod(s) | Apple TV(s) |
|
|
||||||
|- |- |- |- |
|
|
||||||
| iPhone 6s | iPad mini 4 | iPod Touch (7th generation) | Apple TV HD |
|
|
||||||
| iPhone 6s Plus | iPad (5th generation) | | Apple TV 4K (1st generation) |
|
|
||||||
| iPhone SE (2016) | iPad (6th generation) | | |
|
|
||||||
| iPhone 7 | iPad (7th generation) | | |
|
|
||||||
| iPhone 7 Plus | iPad Pro (9.7") | | |
|
|
||||||
| iPhone 8 | iPad Pro (12.9") (1st generation) | | |
|
|
||||||
| iPhone 8 Plus | iPad Pro (10.5") | | |
|
|
||||||
| iPhone X | iPad Pro (12.9") (2nd generation) | | |
|
|
||||||
|
|
||||||
> Note that on `A11` (iPhone X, 8, 8 Plus), **you must disable your passcode while in the jailbroken state** (on iOS 16, you need to **reset your device** before proceeding with palera1n).
|
|
||||||
|
|
||||||
<!--- T2 --->
|
|
||||||
<details>
|
|
||||||
<summary>Apple T2 Device Support (click to expand)</summary>
|
|
||||||
|
|
||||||
| Apple T2 |
|
|
||||||
|- |
|
|
||||||
| Apple T2 iMac20,1 |
|
|
||||||
| Apple T2 iMac20,2 |
|
|
||||||
| |
|
|
||||||
| Apple T2 MacBookAir8,1 |
|
|
||||||
| Apple T2 MacBookAir8,2 |
|
|
||||||
| Apple T2 MacBookAir9,1 |
|
|
||||||
| |
|
|
||||||
| Apple T2 MacBookPro15,1 |
|
|
||||||
| Apple T2 MacBookPro15,2 |
|
|
||||||
| Apple T2 MacBookPro15,3 |
|
|
||||||
| Apple T2 MacBookPro15,4 |
|
|
||||||
| Apple T2 MacBookPro16,1 |
|
|
||||||
| Apple T2 MacBookPro16,2 |
|
|
||||||
| Apple T2 MacBookPro16,3 |
|
|
||||||
| Apple T2 MacBookPro16,4 |
|
|
||||||
| |
|
|
||||||
| Apple T2 iMacPro1,1 |
|
|
||||||
| Apple T2 Macmini8,1 |
|
|
||||||
| Apple T2 MacPro7,1 |
|
|
||||||
| |
|
|
||||||
| iBridge2,11 (Unknown Mac) |
|
|
||||||
| iBridge2,13 (Unknown Mac) |
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
|
|
||||||
## Computer Requirements
|
|
||||||
1. **USB-A** cables are recommended to use, USB-C to may have issues with palera1n and getting into DFU mode.
|
|
||||||
> Due to USB-C cables having different accessory IDs, your device may not be able to be recognized when using USB-C due to not being able to assert to its USB voltage pin.
|
|
||||||
|
|
||||||
2. **Linux or macOS computer**
|
|
||||||
> AMD CPUs (not AMD Mobile) have an issue where it causes them to have a very low success rate with checkm8 exploit. It is not recommended that you use them with palera1n.
|
|
||||||
|
|
||||||
> 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 USB hub, though extensions can vary.
|
|
||||||
|
|
||||||
## Installing
|
|
||||||
Visit https://palera.in
|
|
||||||
|
|
||||||
## Disclaimers
|
|
||||||
We are **NOT** responsible for any data loss, or the result of a device being bricked. When using palera1n, the user should accept responsibility if anything happens to their device during the process.
|
|
||||||
- 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`.
|
||||||
- If you're unable to get out of recovery via these methods please restore with iTunes or Finder.
|
|
||||||
- palera1n **will not work** in VirtualBox, VMware or any virtual machine that doesn't support PCI passthrough.
|
|
||||||
|
|
||||||
## Troubleshooting
|
- If you're unable to get out of recovery via these methods please restore with iTunes or Finder.
|
||||||
Make sure you're following the guides provided [here](https://palera.in), also when asking for support make sure you provide full details on your device, such as:
|
|
||||||
- iPhone/iPad/iPod
|
- palera1n will never work in VirtualBox, VMware or any virtual machine that doesn't support PCI passthrough.
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
- A checkm8 vulnerable iOS device on iOS 15+ (`A8` - `A11`)
|
||||||
|
- 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).
|
||||||
|
|
||||||
|
- **USB-A** cables are recommended to use, USB-C may have issues with palera1n and getting into DFU mode.<details><summary>Technical explanation</summary>The BootROM will only enter DFU if it detects USB voltage, which boils down to checking whether a certain pin is asserted from the Tristar chip. The Tristar does this based on the cable's accessory ID, and apparently USB-A and USB-C cables have different accessory IDs, and the one of the USB-C cables makes the Tristar not assert the USB voltage pin.</details>
|
||||||
|
|
||||||
|
- A Linux or macOS computer
|
||||||
|
- AMD CPUs (not AMD Mobile) have an issue [with (likely) their USB controllers] that causes them to have a very low success rate with checkm8. It is not recommended that you use them with palera1n.
|
||||||
|
- If your device does not successfully jailbreak, try a computer with an Intel or other CPU
|
||||||
|
|
||||||
|
- Apple Silicon Macs with USB-C
|
||||||
|
- 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 USB hub, though extensions can vary.
|
||||||
|
|
||||||
|
## Need help?
|
||||||
|
|
||||||
|
Make sure you provide full details on your device, such as:
|
||||||
|
- iDevice
|
||||||
- iOS Version
|
- iOS Version
|
||||||
- Passcode enabled?
|
- Passcode enabled?
|
||||||
- Verbose from palera1n (specifying `-Vv` within palera1n)
|
- Logs, if panicked then send latest `panic-full` log from your iDevice.
|
||||||
- Panic logs, if panicked then send latest `panic-full` log from your device.
|
|
||||||
|
|
||||||
Create an issue here: https://github.com/palera1n/palera1n/issues/new/choose
|
Using `-VvL` would help with debugging.
|
||||||
|
|
||||||
|
Join the [Support Discord](https://dsc.gg/palera1n)
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 287 KiB |
+3
-3
@@ -1,9 +1,9 @@
|
|||||||
PAGES = palera1n.1.html p1ctl.8.html
|
PAGES = palera1n.1.html
|
||||||
|
|
||||||
all: $(PAGES)
|
all: $(PAGES)
|
||||||
|
|
||||||
%.html: %
|
%.1.html: %.1
|
||||||
mandoc -T html -O style=mandoc.css $< > $@
|
mandoc -T html -O style=mandoc.css palera1n.1 > palera1n.1.html
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(PAGES)
|
rm -f $(PAGES)
|
||||||
-109
@@ -1,109 +0,0 @@
|
|||||||
.\"-
|
|
||||||
.\" Copyright (c.Xc 2024 Nick Chan
|
|
||||||
.\" SPDX-License-Identifier: MIT
|
|
||||||
.\"
|
|
||||||
.Dd "6 April 2024"
|
|
||||||
.Dt p1ctl 8
|
|
||||||
.Sh NAME
|
|
||||||
.Nm p1ctl
|
|
||||||
.Nd command-line access to palera1n loader
|
|
||||||
.Sh SYNOPSIS
|
|
||||||
.Nm
|
|
||||||
.Ar subcommand
|
|
||||||
.Op subcommand options
|
|
||||||
.Op subcommand arguments
|
|
||||||
.Sh DESCRIPTION
|
|
||||||
.Nm
|
|
||||||
provide a command-line interface to the graphical palera1n loader.
|
|
||||||
.Pp
|
|
||||||
.Nm
|
|
||||||
interfaces with the palera1n daemon as well as palera1n's launchd hook.
|
|
||||||
|
|
||||||
.Sh SUBCOMMANDS
|
|
||||||
.Bl -tag -width -indent
|
|
||||||
.It Xo Ar bootstrap Op Fl s
|
|
||||||
.Op Fl S Ar password
|
|
||||||
.Ar bootstrap-file
|
|
||||||
.Xc
|
|
||||||
Deploy a bootstrap from a zstd compressed tarball. With no additional options specified,
|
|
||||||
a new password for the mobile user will be prompted for. The bootstrap you are deploying
|
|
||||||
must match the jailbreak type (rootful or rootless) you are using.
|
|
||||||
.Bl -tag -width -indent
|
|
||||||
.It Fl s
|
|
||||||
Do not prompt for the password and do not set the mobile password.
|
|
||||||
.It Fl S Ar password
|
|
||||||
Do not prompt and set the mobile password to the password specified.
|
|
||||||
.El
|
|
||||||
.Pp
|
|
||||||
.Em NOTE:
|
|
||||||
Unlike the graphical palera1n loader, this command only deploys the bootstrap itself,
|
|
||||||
it does not add additional repositories nor install additional packages.
|
|
||||||
.It Xo Ar exitsafe
|
|
||||||
.Xc
|
|
||||||
Exit
|
|
||||||
.Nm palera1n
|
|
||||||
safe mode, and trigger a userspace reboot. This command will succeed
|
|
||||||
even if the device is not currently in safe mode. In this case, a userspace reboot
|
|
||||||
is still triggered.
|
|
||||||
.Pp
|
|
||||||
.Em NOTE:
|
|
||||||
Many tweak injection packages also provide their own safe mode, p1ctl does not
|
|
||||||
recognize and cannot control those safe modes.
|
|
||||||
.It Xo Ar help Op Ar subcommand
|
|
||||||
.Xc
|
|
||||||
Prints help text. If
|
|
||||||
.Ar subcommand
|
|
||||||
is specified, print help about the subcommand.
|
|
||||||
.It Xo Ar kbase
|
|
||||||
.Xc
|
|
||||||
Print a hexadecimal representation of the kernel base.
|
|
||||||
.It Xo Ar kslide
|
|
||||||
.Xc
|
|
||||||
Print a hexadecimal representation of the kernel slide.
|
|
||||||
.It Xo Ar palera1n_flags
|
|
||||||
.Xc
|
|
||||||
Print a representation of the palera1n flags, which corresponds to the options passed
|
|
||||||
to
|
|
||||||
.Xr palera1n 1
|
|
||||||
as well as hints to the palera1n userspace stack set by
|
|
||||||
.Nm PongoOS
|
|
||||||
\[char46]
|
|
||||||
By default, a hexadecimal representation of the flags will be printed.
|
|
||||||
.Bl -tag -width -indent
|
|
||||||
.It Fl d
|
|
||||||
Read the flags from the ramdisk block device instead of getting them by interfacing with palera1n daemon.
|
|
||||||
.It Fl s
|
|
||||||
Print a string representation of the flags. Each line will contain one flag, and the strings always start
|
|
||||||
with palerain_option_, and unknown flags are represented as palerain_option_undefined.
|
|
||||||
.El
|
|
||||||
.It Xo Ar reboot-userspace
|
|
||||||
.Xc
|
|
||||||
Unmount /Developer if mounted and then reboot the userspace.
|
|
||||||
This command exists because the /Developer mount will be broken
|
|
||||||
after a plain userspace reboot, which breaks debugging in Xcode.
|
|
||||||
.Nm palera1n
|
|
||||||
also hooks the
|
|
||||||
.Xr reboot3 3
|
|
||||||
call so that rebooting userspace using
|
|
||||||
.Xr launchctl 1
|
|
||||||
does not break the /Developer mount.
|
|
||||||
.It Xo Ar reload
|
|
||||||
.Xc
|
|
||||||
Causes the
|
|
||||||
.Nm palera1n
|
|
||||||
launchd hook to re-probe the environment and update its internal state.
|
|
||||||
This will affect the internal environmental variables passed onto new processes,
|
|
||||||
and is typically used after bootstrapping or reverting installs.
|
|
||||||
.It Xo Ar revert-install
|
|
||||||
.Xc
|
|
||||||
Remove jailbreak files from the device. This command is not supported on rootful with fakefs. On rootful with realfs, the device will reboot after issuing this command.
|
|
||||||
.Pp
|
|
||||||
To remove jailbreak files on rootful with fakefs, use
|
|
||||||
.Xr palera1n 1
|
|
||||||
on your computer with the
|
|
||||||
.Fl -force-revert
|
|
||||||
.Fl f
|
|
||||||
options instead.
|
|
||||||
.El
|
|
||||||
.Sh SEE ALSO
|
|
||||||
.Xr palera1n 1
|
|
||||||
+36
-165
@@ -1,15 +1,15 @@
|
|||||||
.\"-
|
.\"-
|
||||||
.\" Copyright (c) 2024 Nick Chan
|
.\" Copyright (c) 2023 Nick Chan
|
||||||
.\" SPDX-License-Identifier: MIT
|
.\" SPDX-License-Identifier: MIT
|
||||||
.\"
|
.\"
|
||||||
.Dd "30 March 2024"
|
.Dd "26 October 2023"
|
||||||
.Dt palera1n 1
|
.Dt palera1n 1
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
.Nm palera1n
|
.Nm palera1n
|
||||||
.Nd arm64 iOS/iPadOS/tvOS 15.0-17.5, bridgeOS 5.0-8.3 jailbreaking tool
|
.Nd iOS 15.0-17.1 arm64 iOS/iPadOS jailbreaking tool
|
||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.Nm
|
.Nm
|
||||||
.Op Fl cCdDEfhIlLnpRsSTvV
|
.Op Fl dDEhILnpRsSvV
|
||||||
.Op Fl e Ar Boot arguments
|
.Op Fl e Ar Boot arguments
|
||||||
.Op Fl k Ar Pongo image
|
.Op Fl k Ar Pongo image
|
||||||
.Op Fl o Ar overlay file
|
.Op Fl o Ar overlay file
|
||||||
@@ -20,20 +20,11 @@
|
|||||||
.Op Fl -force-revert
|
.Op Fl -force-revert
|
||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
.Nm
|
.Nm
|
||||||
jailbreaks an iOS/iPadOS/tvOS 15.0-17.5, bridgeOS 6.0-8.3 device with an arm64 (arm64e excluded) on iOS 15.0-17.5,
|
jailbreaks any iOS/iPadOS device with an arm64 (arm64e excluded) on iOS 15.0-16.5.1,
|
||||||
utilizing the
|
utilizing the
|
||||||
.Em checkm8
|
.Em checkm8
|
||||||
bootROM exploit.
|
bootROM exploit.
|
||||||
.Pp
|
.Pp
|
||||||
.Nm
|
|
||||||
provides rootful and rootless jailbreak modes.
|
|
||||||
On iOS/iPadOS,
|
|
||||||
.Nm
|
|
||||||
is able to jailbreak the device in fakefs-rootful mode, where /
|
|
||||||
is writable, as well as rootless mode, where / cannot be written to.
|
|
||||||
On tvOS and bridgeOS,
|
|
||||||
only rootful is supported, and it uses the actual filesystem instead of a fakefs.
|
|
||||||
.Pp
|
|
||||||
Due to the nature of the
|
Due to the nature of the
|
||||||
.Em checkm8
|
.Em checkm8
|
||||||
exploit,
|
exploit,
|
||||||
@@ -57,7 +48,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-17.5 devices are supported, here is an explicit
|
As described above, arm64 iOS 15.0-16.5.1 devices are supported, here is an explicit
|
||||||
list of supported devicecs:
|
list of supported devicecs:
|
||||||
|
|
||||||
.Bl -tag -compact
|
.Bl -tag -compact
|
||||||
@@ -87,34 +78,8 @@ list of supported devicecs:
|
|||||||
.It iPod Touch (7th generation)
|
.It iPod Touch (7th generation)
|
||||||
.El
|
.El
|
||||||
|
|
||||||
.Bl -tag -compact
|
Support for other arm64 Darwin devices, including Apple TV, HomePod and iBridge
|
||||||
.It Apple TV HD
|
on Darwin 21 and above could be added, but they are currently unsupported.
|
||||||
.It Apple TV 4K (1st generation)
|
|
||||||
.El
|
|
||||||
|
|
||||||
.Bl -tag -compact
|
|
||||||
.It Apple T2 iMacPro1,1
|
|
||||||
.It Apple T2 MacBookPro15,1
|
|
||||||
.It Apple T2 MacBookPro15,2
|
|
||||||
.It Apple T2 Macmini8,1
|
|
||||||
.It Apple T2 MacPro7,1
|
|
||||||
.It Apple T2 MacBookPro15,3
|
|
||||||
.It Apple T2 MacBookAir8,1
|
|
||||||
.It Apple T2 MacBookPro15,4
|
|
||||||
.It iBridge2,11 (Unknown Mac)
|
|
||||||
.It Apple T2 MacBookAir8,2
|
|
||||||
.It iBridge2,13 (Unknown Mac)
|
|
||||||
.It Apple T2 MacBookPro16,1
|
|
||||||
.It Apple T2 MacBookAir9,1
|
|
||||||
.It Apple T2 MacBookPro16,2
|
|
||||||
.It Apple T2 iMac20,1
|
|
||||||
.It Apple T2 iMac20,2
|
|
||||||
.It Apple T2 MacBookPro16,3
|
|
||||||
.It Apple T2 MacBookPro16,4
|
|
||||||
.El
|
|
||||||
|
|
||||||
Support for the A8 HomePod on Darwin 21 and above could be added,
|
|
||||||
but it is currently unsupported.
|
|
||||||
|
|
||||||
arm64e devices will NEVER be supported.
|
arm64e devices will NEVER be supported.
|
||||||
|
|
||||||
@@ -124,31 +89,9 @@ arm64e devices will NEVER be supported.
|
|||||||
Prints the program version and exit.
|
Prints the program version and exit.
|
||||||
.It Fl -force-revert
|
.It Fl -force-revert
|
||||||
Remove the jailbreak while keeping user data. Some jailbreak files may remain
|
Remove the jailbreak while keeping user data. Some jailbreak files may remain
|
||||||
after running this command. Additionally, jailbreak apps may remain on the
|
after running this command. Additionally, jailbreak apps will remain on the
|
||||||
home screen on for a while even when the files are deleted as the icon cache
|
home screen on for a while even when the files are deleted as the icon cache
|
||||||
still has their icons. When used with
|
still has their icons.
|
||||||
.Fl f , -fakefs ,
|
|
||||||
this will actually boot the device in rootless mode then delete the jailbreak
|
|
||||||
files. As a result, using the loader app to install the jailbreak environment
|
|
||||||
is not supported when this option is used together with
|
|
||||||
.Fl f , -fakefs
|
|
||||||
\[char46]
|
|
||||||
.It Fl B , -setup-fakefs-partial
|
|
||||||
Like
|
|
||||||
.Fl c , -setup-fakefs
|
|
||||||
but the size of the created fakefs is smaller at the expense of having unwritable
|
|
||||||
parts in rarely-written paths. When jailbreaking 16 GB devices, this option must be used
|
|
||||||
when setting up fakefs for rootful, as they do not have enough storage for full fakefs.
|
|
||||||
This flag is only supported on iOS/iPadOS.
|
|
||||||
.It Fl c , -setup-fakefs
|
|
||||||
When used with
|
|
||||||
.Fl f , -fakefs ,
|
|
||||||
creates the new APFS volume required for rootful. Will fail if one already exists.
|
|
||||||
This flag is only supported on iOS/iPadOS.
|
|
||||||
.It Fl C , -clean-fakefs
|
|
||||||
This option is not currently supported and is a no-operation in this version of
|
|
||||||
.Nm
|
|
||||||
\[char46]
|
|
||||||
.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
|
||||||
@@ -159,14 +102,9 @@ Specify custom XNU kernel command line. The
|
|||||||
.Em rootdev=md0
|
.Em rootdev=md0
|
||||||
argument is used by
|
argument is used by
|
||||||
.Nm
|
.Nm
|
||||||
and cannot be overriden. Additionally, the
|
and cannot be overriden.
|
||||||
.Em wdt=-1
|
|
||||||
argument is used during fakefs setup.
|
|
||||||
.It Fl E , -enter-recovery
|
.It Fl E , -enter-recovery
|
||||||
Exit after entering recovery mode.
|
Exit after entering recovery mode.
|
||||||
.It Fl f , -fakefs
|
|
||||||
Proceed in rootful mode. This applies to both full, partial fakefs, as well as realfs.
|
|
||||||
This option is not supported on iOS/iPadOS 17.
|
|
||||||
.It Fl h , -help
|
.It Fl h , -help
|
||||||
Prints help text.
|
Prints help text.
|
||||||
.It Fl i , -checkra1n-file Ar checkra1n file
|
.It Fl i , -checkra1n-file Ar checkra1n file
|
||||||
@@ -182,12 +120,10 @@ root filesystem in paleinfo with
|
|||||||
command. If in doubt, use
|
command. If in doubt, use
|
||||||
.Sy https://github.com/palera1n/PongoOS
|
.Sy https://github.com/palera1n/PongoOS
|
||||||
iOS15 branch or your own fork of it.
|
iOS15 branch or your own fork of it.
|
||||||
.It Fl l , -rootless
|
.Fl L , -jbinit-log-to-file
|
||||||
Proceed in rootless mode. This option is only supported on iOS/iPadOS.
|
Makes jbinit log to
|
||||||
.It Fl L , -jbinit-log-to-file
|
.Em /cores/jbinit.log
|
||||||
This option is not currently supported and is a no-operation in this version of
|
This file may be viewed from sandboxed applications while jailbroken.
|
||||||
.Nm
|
|
||||||
\[char46]
|
|
||||||
.It Fl n , -exit-recovery
|
.It Fl n , -exit-recovery
|
||||||
Exit recovery mode and exit.
|
Exit recovery mode and exit.
|
||||||
.It Fl o , -override-overlay Ar overlay file
|
.It Fl o , -override-overlay Ar overlay file
|
||||||
@@ -206,23 +142,21 @@ Like
|
|||||||
.Fl p , -pongo-shell
|
.Fl p , -pongo-shell
|
||||||
but default images and options have been uploaded and applied respectively.
|
but default images and options have been uploaded and applied respectively.
|
||||||
.It Fl r , -override-ramdisk Ar ramdisk file
|
.It Fl r , -override-ramdisk Ar ramdisk file
|
||||||
Override the ramdisk. At a very minimum, it should contain
|
Override the ramdisk. At a very minimum, it should contain a
|
||||||
.Em /cores/ploosh
|
.Em /sbin/launchd
|
||||||
as well as a fake dyld
|
as well as a fake dyld
|
||||||
.Em /usr/lib/dyld
|
.Em /usr/lib/dyld
|
||||||
where the logic is expected to be in.
|
where the logic is expected to be in.
|
||||||
.It Fl R , -reboot-device
|
.It Fl R , -reboot-device
|
||||||
Reboot device in normal mode and exit.
|
Reboot device in normal mode and exit.
|
||||||
.It Fl s , -safe-mode
|
.It Fl s , -safe-mode
|
||||||
Enter safe mode. An alert will be displayed on iOS/iPadOS/tvOS. Jailbreak daemons nor early boot executable files
|
Enter safe mode. An alert will be displayed. Jailbreak daemons nor early boot executable files
|
||||||
specified (see
|
specified (see
|
||||||
.Sy FILES
|
.Sy FILES
|
||||||
section below) will be executed. The loader app and the built in SSH server can still be used,
|
section below) will be executed. The loader app and the built in SSH server can still be used,
|
||||||
as well as any jailbreak-specific apps you have installed.
|
as well as any jailbreak-specific apps you have installed.
|
||||||
.It Fl S , -no-colors
|
.It Fl S , -no-colors
|
||||||
Disable colors on the command line. External programs like checkra1n clones may still output colors.
|
Disable colors on the command line. External programs like checkra1n clones may still output colors.
|
||||||
.It Fl T , -telnetd
|
|
||||||
Enable the TELNET daemon on port 46, all interfaces. Please note that there is no authentication and is therefore insecure.
|
|
||||||
.It Fl v , -debug-logging
|
.It Fl v , -debug-logging
|
||||||
Enable debug logging. The option may be repeated for extra verbosity.
|
Enable debug logging. The option may be repeated for extra verbosity.
|
||||||
.It Fl V , -verbose-boot
|
.It Fl V , -verbose-boot
|
||||||
@@ -244,32 +178,10 @@ To (re-)jailbreak in rootless mode:
|
|||||||
.Pp
|
.Pp
|
||||||
.Dl "palera1n"
|
.Dl "palera1n"
|
||||||
.Pp
|
.Pp
|
||||||
To setup fakefs for rootful mode:
|
|
||||||
.Pp
|
|
||||||
.Dl "palera1n -fc"
|
|
||||||
.Pp
|
|
||||||
After the device has rebooted, follow the following example.
|
|
||||||
.Pp
|
|
||||||
To re-jailbreak in rootful mode:
|
|
||||||
.Pp
|
|
||||||
.Dl "palera1n -f"
|
|
||||||
.Pp
|
|
||||||
To remove the jailbreak in rootful mode:
|
|
||||||
.Pp
|
|
||||||
.Dl "palera1n --force-revert -f"
|
|
||||||
.Pp
|
|
||||||
To remove the jailbreak in rootless mode:
|
To remove the jailbreak in rootless mode:
|
||||||
.Pp
|
.Pp
|
||||||
.Dl "palera1n --force-revert"
|
.Dl "palera1n --force-revert"
|
||||||
.Pp
|
.Pp
|
||||||
To verbose boot in rootful mode:
|
|
||||||
.Pp
|
|
||||||
.Dl "palera1n -Vf"
|
|
||||||
.Pp
|
|
||||||
To create a partial fakefs with bind mounts:
|
|
||||||
.Pp
|
|
||||||
.Dl "palera1n -Bf"
|
|
||||||
.Pp
|
|
||||||
To exit recovery mode:
|
To exit recovery mode:
|
||||||
.Pp
|
.Pp
|
||||||
.Dl "palera1n -n"
|
.Dl "palera1n -n"
|
||||||
@@ -283,8 +195,6 @@ To verbose boot, use the
|
|||||||
.Fl V , -verbose-boot
|
.Fl V , -verbose-boot
|
||||||
option when jailbreaking.
|
option when jailbreaking.
|
||||||
.Pp
|
.Pp
|
||||||
Fakefs takes up around 5-10 GB of storage, and take up to 10 minutes to setup.
|
|
||||||
.Pp
|
|
||||||
iOS 15.0 requires DER entitlements, and iOS 15.1 requires hash agility in code signatures.
|
iOS 15.0 requires DER entitlements, and iOS 15.1 requires hash agility in code signatures.
|
||||||
As a result, binaries with the old code signature format need to be resigned with a recent
|
As a result, binaries with the old code signature format need to be resigned with a recent
|
||||||
version of the Procursus fork of
|
version of the Procursus fork of
|
||||||
@@ -292,39 +202,17 @@ version of the Procursus fork of
|
|||||||
before they can be ran on a device jailbroken with
|
before they can be ran on a device jailbroken with
|
||||||
.Nm
|
.Nm
|
||||||
\[char46]
|
\[char46]
|
||||||
.Pp
|
.Sh POST INSTALLATION
|
||||||
When using rootful mode, the
|
|
||||||
.Fl f , -fakefs
|
|
||||||
flag must be specified at all times. It does not matter whether you want to create fakefs,
|
|
||||||
create partial fakefs, rejailbreak or remove jailbreak.
|
|
||||||
.Pp
|
|
||||||
Due to a stock bug, using the
|
|
||||||
.Fl V , -verbose-boot
|
|
||||||
option might cause some versions for tvOS to crash and not boot.
|
|
||||||
.Pp
|
|
||||||
Offical Apple USB-C cables as well as some other USB-C cables cannot be used to enter DFU mode.
|
|
||||||
USB-A cable with male USB-C to female USB-A adapter works fine.
|
|
||||||
.Sh POST INSTALLATION (iOS/iPadOS)
|
|
||||||
The palera1n loader app will take up to 30 seconds to appear on the homescreen after the
|
The palera1n loader app will take up to 30 seconds to appear on the homescreen after the
|
||||||
device has booted. If it does not appear, you can try using the shortcut:
|
device has booted. If it does not appear, you can try using the shortcut:
|
||||||
.Pp
|
.Pp
|
||||||
.Lk https://www.icloud.com/shortcuts/8cd5f489c8854ee0ab9ee38f2e62f87d
|
.Lk https://www.icloud.com/shortcuts/8cd5f489c8854ee0ab9ee38f2e62f87d
|
||||||
.Pp
|
.Pp
|
||||||
to open it. After opening the loader app, select a package manager to install.
|
to open it. After opening the loader app, press install to install a bootstrap as well as
|
||||||
This will also bootstrap your device.
|
the
|
||||||
.Pp
|
.Em Sileo
|
||||||
A built-in SSH server runs on port 44 on loopback interfaces.
|
package manager.
|
||||||
.Sh POST INSTALLATION (tvOS)
|
You can install other package managers from settings of the loader app.
|
||||||
.Pp
|
|
||||||
The palera1n loader app will appear on homescreen. Open the loader and select a package manager to install.
|
|
||||||
This will also bootstrap your device.
|
|
||||||
.Pp
|
|
||||||
A built-in SSH server runs on port 44 on all interfaces.
|
|
||||||
.Sh POST INSTALLATION (bridgeOS)
|
|
||||||
.Pp
|
|
||||||
A built-in SSH server runs on port 44 on all interfaces.
|
|
||||||
.Pp
|
|
||||||
Bootstrapping is currently not supported on this device.
|
|
||||||
.Sh FILES
|
.Sh FILES
|
||||||
During the jailbreak process, a temporary filesystem is mounted on /cores as a place
|
During the jailbreak process, a temporary filesystem is mounted on /cores as a place
|
||||||
to stash jailbreak files needed during the boot process. No files are ever written
|
to stash jailbreak files needed during the boot process. No files are ever written
|
||||||
@@ -334,18 +222,15 @@ loader app to install additional jailbreak files.
|
|||||||
.Bl -tag -width "/var/jb/Library/LaunchDaemons"
|
.Bl -tag -width "/var/jb/Library/LaunchDaemons"
|
||||||
.It Pa /cores
|
.It Pa /cores
|
||||||
The location of the temporary filesystem where jailbreak files are stash during boot.
|
The location of the temporary filesystem where jailbreak files are stash during boot.
|
||||||
.It Pa /Library/LaunchDaemons
|
.It Pa /cores/jbinit.log
|
||||||
The directory where jailbreak-specific
|
When
|
||||||
.Xr launchd.plist 5
|
.Fl L
|
||||||
property list files should be placed on rootful.
|
is used, the log file of jbinit.
|
||||||
|
The log file of jbinit.
|
||||||
.It Pa /var/jb/Library/LaunchDaemons
|
.It Pa /var/jb/Library/LaunchDaemons
|
||||||
The directory where jailbreak-specific
|
The directory where jailbreak-specific
|
||||||
.Xr launchd.plist 5
|
.Xr launchd.plist 5
|
||||||
property list files should be placed on rootless.
|
property list files should be placed on rootless.
|
||||||
.It Pa /etc/rc.d
|
|
||||||
The directory where executable filse that needs to be executed during boot, before
|
|
||||||
daemons are launched, are placed rootful. They are executed after all filesystems
|
|
||||||
has been mounted.
|
|
||||||
.It Pa /var/jb/etc/rc.d
|
.It Pa /var/jb/etc/rc.d
|
||||||
The directory where executable files that needs to be executed during boot, before
|
The directory where executable files that needs to be executed during boot, before
|
||||||
daemons are launched, are placed on rootless. They are executed after all filesystems
|
daemons are launched, are placed on rootless. They are executed after all filesystems
|
||||||
@@ -359,33 +244,19 @@ may crash if the machine it is running on:
|
|||||||
.Pp
|
.Pp
|
||||||
The exploit may also work less reliably on some hosts, like AMD desktops, or some MediaTek devices.
|
The exploit may also work less reliably on some hosts, like AMD desktops, or some MediaTek devices.
|
||||||
.Pp
|
.Pp
|
||||||
The device may randomly crash and reboot due to launchd using too much memory.
|
The device may randomly crash and reboot due to launchd exiting with code 7.
|
||||||
.Pp
|
.Sh NOTES
|
||||||
The built-in SSH server might be not accessible with password after bootstrapping rootful,
|
|
||||||
since the bootstrap uses a custom crypt() function that is not supported
|
|
||||||
by the built-in SSH server.
|
|
||||||
.Pp
|
|
||||||
There are no DFU instructions for iBridge T2 as there are no known ways to connect to the T2's USB
|
|
||||||
interface when macOS has been booted.
|
|
||||||
.Sh DEPRECATED AND REMOVED FUNCTIONALITY
|
|
||||||
There was an option in
|
|
||||||
.Nm
|
.Nm
|
||||||
to force create the fakefs even when one already exists (which would overwrite
|
injects a dylib into launchd to allow the
|
||||||
the existing fakefs), by setting the palerain_option_setup_rootful_forced flag
|
|
||||||
in palera1n flags. This option was removed because using
|
|
||||||
.Fl -force-revert
|
|
||||||
and
|
|
||||||
.Fl c
|
|
||||||
at the same time has exactly the same effect.
|
|
||||||
.Pp
|
|
||||||
The hook that enabled
|
|
||||||
.Sy launchctl runstats
|
.Sy launchctl runstats
|
||||||
has been removed, since it leaks memory in launchd.
|
command to be used on the device.
|
||||||
|
.Sh DEPRECATED AND REMOVED FUNCTIONALITY
|
||||||
|
.Pp
|
||||||
|
The fakefs functionality was removed.
|
||||||
.Sh SEE ALSO
|
.Sh SEE ALSO
|
||||||
.Xr launchd 8
|
.Xr launchd 8
|
||||||
.Xr launchd.plist 5
|
.Xr launchd.plist 5
|
||||||
.Xr ldid 1
|
.Xr ldid 1
|
||||||
.Xr p1ctl 8
|
|
||||||
.Sh HISTORY
|
.Sh HISTORY
|
||||||
The
|
The
|
||||||
.Nm
|
.Nm
|
||||||
|
|||||||
+1
-1
@@ -25,6 +25,7 @@ typedef uint64_t palerain_option_t;
|
|||||||
#define palerain_option_ssv (UINT64_C(1) << 7) /* has signed system volume */
|
#define palerain_option_ssv (UINT64_C(1) << 7) /* has signed system volume */
|
||||||
// (UINT64_C(1) << 8) /* reserved */
|
// (UINT64_C(1) << 8) /* reserved */
|
||||||
#define palerain_option_clean_fakefs (UINT64_C(1) << 9) /* clean fakefs, but does not delete it */
|
#define palerain_option_clean_fakefs (UINT64_C(1) << 9) /* clean fakefs, but does not delete it */
|
||||||
|
#define palerain_option_tui (UINT64_C(1) << 10) /* terminal user interface */
|
||||||
// #define palerain_option_gui (UINT64_C(1) << 11) /* graphical user interface*/
|
// #define palerain_option_gui (UINT64_C(1) << 11) /* graphical user interface*/
|
||||||
#define palerain_option_dfuhelper_only (UINT64_C(1) << 12) /* dfuhelper only */
|
#define palerain_option_dfuhelper_only (UINT64_C(1) << 12) /* dfuhelper only */
|
||||||
#define palerain_option_pongo_exit (UINT64_C(1) << 13) /* boot to clean pongo shell */
|
#define palerain_option_pongo_exit (UINT64_C(1) << 13) /* boot to clean pongo shell */
|
||||||
@@ -45,7 +46,6 @@ typedef uint64_t palerain_option_t;
|
|||||||
// #define palerain_option_sf_launchdaemons (UINT64_C(1) << 28) /* safe mode with launchdaemons */
|
// #define palerain_option_sf_launchdaemons (UINT64_C(1) << 28) /* safe mode with launchdaemons */
|
||||||
// #define palerain_option_emerg_mode (UINT64_C(1) << 29) /* emergency mode (early boot usb shell) */
|
// #define palerain_option_emerg_mode (UINT64_C(1) << 29) /* emergency mode (early boot usb shell) */
|
||||||
#define palerain_option_jbinit_log_to_file (UINT64_C(1) << 30) /* deprecated (kept for compatibility) */
|
#define palerain_option_jbinit_log_to_file (UINT64_C(1) << 30) /* deprecated (kept for compatibility) */
|
||||||
#define palerain_option_telnetd (UINT64_C(1) << 32) /* Enable TELNET daemon */
|
|
||||||
|
|
||||||
#define palerain_option_flower_chain (UINT64_C(1) << 61) /* Flower chain */
|
#define palerain_option_flower_chain (UINT64_C(1) << 61) /* Flower chain */
|
||||||
#define palerain_option_test1 (UINT64_C(1) << 62) /* Developer test option 1 */
|
#define palerain_option_test1 (UINT64_C(1) << 62) /* Developer test option 1 */
|
||||||
|
|||||||
+6
-4
@@ -24,9 +24,6 @@
|
|||||||
|
|
||||||
#define palerain_option_case_version palerain_option_case(0)
|
#define palerain_option_case_version palerain_option_case(0)
|
||||||
#define palerain_option_case_force_revert palerain_option_case(1)
|
#define palerain_option_case_force_revert palerain_option_case(1)
|
||||||
#define palerain_option_case_libcheckra1nhelper_path palerain_option_case(2)
|
|
||||||
#define palerain_option_case_cli palerain_option_case(3)
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef USE_LIBUSB
|
#ifdef USE_LIBUSB
|
||||||
#include <libusb-1.0/libusb.h>
|
#include <libusb-1.0/libusb.h>
|
||||||
@@ -72,7 +69,7 @@ usb_ret_t USBBulkUpload(usb_device_handle_t handle, void *data, uint32_t len);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef PALERAIN_VERSION
|
#ifndef PALERAIN_VERSION
|
||||||
#define PALERAIN_VERSION "2.0"
|
#define PALERAIN_VERSION "2.0.0"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
@@ -227,4 +224,9 @@ void io_stop(stuff_t *stuff);
|
|||||||
|
|
||||||
void print_credits(void);
|
void print_credits(void);
|
||||||
|
|
||||||
|
#ifdef TUI
|
||||||
|
#include <newt.h>
|
||||||
|
newtComponent get_tui_log(void);
|
||||||
|
newtComponent set_tui_log(newtComponent co);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
#ifndef TUI_H
|
||||||
|
#define TUI_H
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <locale.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <newt.h>
|
||||||
|
#include <paleinfo.h>
|
||||||
|
|
||||||
|
#define WIDTH 76
|
||||||
|
#define HEIGHT 19
|
||||||
|
|
||||||
|
#define PI_LOG_COLOR NEWT_COLORSET_CUSTOM(0)
|
||||||
|
#define PI_STEP_CURRENT NEWT_COLORSET_CUSTOM(1)
|
||||||
|
#define PI_STEP_OTHER NEWT_COLORSET_CUSTOM(2)
|
||||||
|
|
||||||
|
#define CHECKBOX_STATE(flags, opt) (flags & opt) != 0 ? '*' : ' '
|
||||||
|
|
||||||
|
typedef enum tui_screens {
|
||||||
|
ERROR_SCREEN = -1,
|
||||||
|
EXIT_SCREEN = 0,
|
||||||
|
MAIN_SCREEN = 1,
|
||||||
|
OPTIONS_SCREEN = 2,
|
||||||
|
ENTER_DFU_SCREEN = 3,
|
||||||
|
JAILBREAKING_SCREEN = 4,
|
||||||
|
ENTER_RECOVERY_SCREEN = 5
|
||||||
|
} tui_screen_t;
|
||||||
|
|
||||||
|
typedef struct bitfield_checkbox_info {
|
||||||
|
uint64_t* flags_p;
|
||||||
|
uint64_t opt;
|
||||||
|
} tui_bit_info_t;
|
||||||
|
|
||||||
|
tui_screen_t tui_screen_main(void);
|
||||||
|
tui_screen_t tui_screen_options(void);
|
||||||
|
tui_screen_t tui_screen_enter_recovery(void);
|
||||||
|
tui_screen_t tui_screen_enter_dfu(void);
|
||||||
|
tui_screen_t tui_screen_jailbreak(void);
|
||||||
|
|
||||||
|
int redraw_screen(void);
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
+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+ semi-tethered checkm8 jailbreak
|
Description: iOS 15.0-16.5.1 semi-tethered checkm8 jailbreak
|
||||||
palera1n is an iOS/iPadOS 15.0+ semi tethered jailbreak
|
palera1n is an iOS/iPadOS 15.0-16.5.1 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+ semi-tethered checkm8 jailbreak
|
Description: iOS 15.0-16.5 semi-tethered checkm8 jailbreak
|
||||||
palera1n is an iOS/iPadOS 15.0+ 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,
|
||||||
|
|||||||
+6
-13
@@ -9,24 +9,12 @@ OBJS = $(patsubst %,$(OBJDIR)/%,$(C_SRC:.c=.c.o))
|
|||||||
|
|
||||||
ifeq (,$(findstring macosx, $(CFLAGS)))
|
ifeq (,$(findstring macosx, $(CFLAGS)))
|
||||||
ifneq (,$(findstring version-min=, $(CFLAGS)))
|
ifneq (,$(findstring version-min=, $(CFLAGS)))
|
||||||
ifneq ($(NO_EMBED_HELPER),1)
|
|
||||||
C_SRC += $(GENDIR)/gen-libcheckra1nhelper.dylib.c
|
C_SRC += $(GENDIR)/gen-libcheckra1nhelper.dylib.c
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(NO_EMBED_HELPER),1)
|
|
||||||
CFLAGS += -DNO_EMBED_HELPER
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(DFUHELPER_AUTO_ONLY),1)
|
|
||||||
CFLAGS += -DDFUHELPER_AUTO_ONLY
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(FORCE_HELPER),1)
|
ifeq ($(FORCE_HELPER),1)
|
||||||
ifneq ($(NO_EMBED_HELPER),1)
|
|
||||||
C_SRC += $(GENDIR)/gen-libcheckra1nhelper.dylib.c
|
C_SRC += $(GENDIR)/gen-libcheckra1nhelper.dylib.c
|
||||||
endif
|
|
||||||
CFLAGS += -DFORCE_HELPER
|
CFLAGS += -DFORCE_HELPER
|
||||||
BUILD_OPTIONS += FORCE_HELPER
|
BUILD_OPTIONS += FORCE_HELPER
|
||||||
endif
|
endif
|
||||||
@@ -63,6 +51,11 @@ CFLAGS += -DNO_CUSTOM_PONGO
|
|||||||
BUILD_OPTIONS += NO_CUSTOM_PONGO
|
BUILD_OPTIONS += NO_CUSTOM_PONGO
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(TUI),1)
|
||||||
|
BUILD_OPTIONS += TUI
|
||||||
|
CFLAGS += -DTUI
|
||||||
|
endif
|
||||||
|
|
||||||
CHECKRA1N_VERSION ?= 0.1337.2
|
CHECKRA1N_VERSION ?= 0.1337.2
|
||||||
LIPO = lipo
|
LIPO = lipo
|
||||||
LDID = ldid
|
LDID = ldid
|
||||||
@@ -85,7 +78,7 @@ CFLAGS += -DUSE_LIBUSB=1
|
|||||||
LIBS += $(DEP)/lib/libusb-1.0.a
|
LIBS += $(DEP)/lib/libusb-1.0.a
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(ROOTFUL),0)
|
ifeq ($(ROOTFUL),1)
|
||||||
CFLAGS += -DROOTFUL=1
|
CFLAGS += -DROOTFUL=1
|
||||||
BUILD_OPTIONS += ROOTFUL
|
BUILD_OPTIONS += ROOTFUL
|
||||||
endif
|
endif
|
||||||
|
|||||||
+11
-11
@@ -7,17 +7,17 @@
|
|||||||
|
|
||||||
#define T void
|
#define T void
|
||||||
#define R print_credits(void) {
|
#define R print_credits(void) {
|
||||||
#define O fprintf(
|
#define O fprintf
|
||||||
#define U stderr,
|
#define U (
|
||||||
#define B "#\n# palera1n: " BUILD_TAG " \n#\n"
|
#define B stderr
|
||||||
#define L "# ======== Made by =======\n"
|
#define L ,
|
||||||
#define E "# Made by: Nick Chan, " THE_PLUSH ", Samara, Mineek, staturnz, " BAKERAIN_DEVELOPE_R "\n"
|
#define E "# == palera1n-c == \n#\n"
|
||||||
#define M "# ======== Thanks to =======\n"
|
#define M "# Made by: Nick Chan, " THE_PLUSH ", Samara, Nebula, staturnz, " BAKERAIN_DEVELOPE_R " \n#\n"
|
||||||
#define A "# Thanks to: llsc12, Nebula, Lrdsnow, nikias (libimobiledevice),\n"
|
#define A "# Thanks to: pythonplayer123, llsc12, Mineek, tihmstar, nikias\n"
|
||||||
#define K "# checkra1n team (Siguza, axi0mx, littlelailo et al.),\n"
|
#define K "# (libimobiledevice), checkra1n team (Siguza, axi0mx, littlelailo\n"
|
||||||
#define I "# Procursus Team (Hayden Seay, Cameron Katri, Keto et.al)\n"
|
#define I "# et al.), Procursus Team (Hayden Seay, Cameron Katri, Keto et.al)\n\n"
|
||||||
#define N "# ==========================\n\n"
|
#define N )
|
||||||
#define G );
|
#define G ;
|
||||||
#define S }
|
#define S }
|
||||||
|
|
||||||
T R O U B L E M A K I N G S
|
T R O U B L E M A K I N G S
|
||||||
+20
-70
@@ -30,13 +30,7 @@
|
|||||||
#define FORMAT_KEY_VALUE 1
|
#define FORMAT_KEY_VALUE 1
|
||||||
#define FORMAT_XML 2
|
#define FORMAT_XML 2
|
||||||
|
|
||||||
#define NO_PHYSICAL_HOME_BUTTON (cpid == 0x8015 || (cpid == 0x8010 && (bdid == 0x08 || bdid == 0x0a || bdid == 0x0c || bdid == 0x0e)))
|
#define NOHOME (cpid == 0x8015 || (cpid == 0x8010 && (bdid == 0x08 || bdid == 0x0a || bdid == 0x0c || bdid == 0x0e)))
|
||||||
#define IS_APPLE_TV_HD (cpid == 0x7000 && bdid == 0x34)
|
|
||||||
#define IS_APPLE_TV_4K (cpid == 0x8011 && bdid == 0x02)
|
|
||||||
#define IS_APPLE_HOME1 (cpid == 0x7000 && bdid == 0x38)
|
|
||||||
#define IS_APPLE_HOME2 (cpid == 0x7000 && bdid == 0x1a)
|
|
||||||
#define IS_APPLE_HOME (IS_APPLE_HOME1 || IS_APPLE_HOME1)
|
|
||||||
#define IS_APPLETV (IS_APPLE_TV_4K || IS_APPLE_TV_HD || IS_APPLE_HOME)
|
|
||||||
|
|
||||||
int dfuhelper_thr_running = false;
|
int dfuhelper_thr_running = false;
|
||||||
|
|
||||||
@@ -143,66 +137,27 @@ void* connected_recovery_mode(struct irecv_device_info* info) {
|
|||||||
LOG(LOG_ERROR, "Cannot set auto-boot back to true");
|
LOG(LOG_ERROR, "Cannot set auto-boot back to true");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#if !defined(DFUHELPER_AUTO_ONLY)
|
|
||||||
if (IS_APPLE_TV_4K) {
|
|
||||||
LOG(LOG_INFO, "Depending on your connection method, you might need to press a button on your cable/board during reboot");
|
|
||||||
}
|
|
||||||
LOG(LOG_INFO, "Press Enter when ready for DFU mode");
|
LOG(LOG_INFO, "Press Enter when ready for DFU mode");
|
||||||
getchar();
|
getchar();
|
||||||
#endif
|
step(3, 0, "Get ready", NULL, 0);
|
||||||
if (IS_APPLETV) {
|
if (NOHOME)
|
||||||
if (IS_APPLE_TV_HD) {
|
step(4, 2, "Hold volume down + side button", NULL, 0);
|
||||||
step(10, 8, "Hold menu + play button", NULL, 0);
|
else
|
||||||
set_ecid_wait_for_dfu(ecid);
|
step(4, 2, "Hold home + power button", NULL, 0);
|
||||||
ret = exitrecv_cmd(ecid);
|
set_ecid_wait_for_dfu(ecid);
|
||||||
if (ret) {
|
ret = exitrecv_cmd(ecid);
|
||||||
LOG(LOG_ERROR, "Cannot exit recovery mode");
|
if (ret) {
|
||||||
set_ecid_wait_for_dfu(0);
|
LOG(LOG_ERROR, "Cannot exit recovery mode");
|
||||||
return NULL;
|
set_ecid_wait_for_dfu(0);
|
||||||
}
|
return NULL;
|
||||||
printf("\r\033[K");
|
}
|
||||||
step(8, 0, "Hold menu + play button", conditional, ecid);
|
printf("\r\033[K");
|
||||||
} else if (IS_APPLE_TV_4K) {
|
if (NOHOME) {
|
||||||
step(2, 0, "About to reboot device", NULL, 0);
|
step(2, 0, "Hold volume down + side button", NULL, 0);
|
||||||
set_ecid_wait_for_dfu(ecid);
|
step(10, 0, "Hold volume down button", conditional, ecid);
|
||||||
ret = exitrecv_cmd(ecid);
|
} else {
|
||||||
if (ret) {
|
step(2, 0, "Hold home + power button", NULL, 0);
|
||||||
LOG(LOG_ERROR, "Cannot exit recovery mode");
|
step(10, 0, "Hold home button", conditional, ecid);
|
||||||
set_ecid_wait_for_dfu(0);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
step(4, 0, "Waiting for device to reconnect in DFU mode", conditional, ecid);
|
|
||||||
} else if (IS_APPLE_HOME) {
|
|
||||||
step(6, 4, "Put device in upside down orientation", NULL, 0);
|
|
||||||
set_ecid_wait_for_dfu(ecid);
|
|
||||||
ret = exitrecv_cmd(ecid);
|
|
||||||
if (ret) {
|
|
||||||
LOG(LOG_ERROR, "Cannot exit recovery mode");
|
|
||||||
set_ecid_wait_for_dfu(0);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
step(4, 0, "Put device upside down orientation", conditional, ecid);
|
|
||||||
}
|
|
||||||
} else if (cpid != 0x8012) {
|
|
||||||
if (NO_PHYSICAL_HOME_BUTTON)
|
|
||||||
step(4, 2, "Hold volume down + side button", NULL, 0);
|
|
||||||
else
|
|
||||||
step(4, 2, "Hold home + power button", NULL, 0);
|
|
||||||
set_ecid_wait_for_dfu(ecid);
|
|
||||||
ret = exitrecv_cmd(ecid);
|
|
||||||
if (ret) {
|
|
||||||
LOG(LOG_ERROR, "Cannot exit recovery mode");
|
|
||||||
set_ecid_wait_for_dfu(0);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
printf("\r\033[K");
|
|
||||||
if (NO_PHYSICAL_HOME_BUTTON) {
|
|
||||||
step(2, 0, "Hold volume down + side button", NULL, 0);
|
|
||||||
step(10, 0, "Hold volume down button", conditional, ecid);
|
|
||||||
} else {
|
|
||||||
step(2, 0, "Hold home + power button", NULL, 0);
|
|
||||||
step(10, 0, "Hold home button", conditional, ecid);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (get_ecid_wait_for_dfu() == ecid) {
|
if (get_ecid_wait_for_dfu() == ecid) {
|
||||||
LOG(LOG_WARNING, "Whoops, device did not enter DFU mode");
|
LOG(LOG_WARNING, "Whoops, device did not enter DFU mode");
|
||||||
@@ -221,11 +176,6 @@ void* connected_dfu_mode(struct irecv_device_info* info) {
|
|||||||
puts("");
|
puts("");
|
||||||
LOG(LOG_INFO, "Device entered DFU mode successfully");
|
LOG(LOG_INFO, "Device entered DFU mode successfully");
|
||||||
}
|
}
|
||||||
unsigned int bdid = info->bdid;
|
|
||||||
unsigned int cpid = info->cpid;
|
|
||||||
if (IS_APPLE_HOME) {
|
|
||||||
step(2, 0, "Put device in upright orientation", NULL, 0);
|
|
||||||
}
|
|
||||||
set_spin(0);
|
set_spin(0);
|
||||||
unsubscribe_cmd();
|
unsubscribe_cmd();
|
||||||
pthread_exit(NULL);
|
pthread_exit(NULL);
|
||||||
|
|||||||
+4
-13
@@ -23,7 +23,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern char **environ;
|
extern char **environ;
|
||||||
extern char* gOverrideLibcheckra1nHelper;
|
|
||||||
|
|
||||||
#include <palerain.h>
|
#include <palerain.h>
|
||||||
#include <xxd-embedded.h>
|
#include <xxd-embedded.h>
|
||||||
@@ -107,10 +106,6 @@ int exec_checkra1n(void) {
|
|||||||
#if !defined(FORCE_HELPER)
|
#if !defined(FORCE_HELPER)
|
||||||
if (darwinMajor < 20) {
|
if (darwinMajor < 20) {
|
||||||
#endif
|
#endif
|
||||||
if (gOverrideLibcheckra1nHelper) {
|
|
||||||
libcheckra1nhelper_dylib_path = gOverrideLibcheckra1nHelper;
|
|
||||||
goto setenv_ra1n;
|
|
||||||
}
|
|
||||||
libcheckra1nhelper_dylib_path = malloc(strlen(tmpdir) + 40);
|
libcheckra1nhelper_dylib_path = malloc(strlen(tmpdir) + 40);
|
||||||
if (libcheckra1nhelper_dylib_path == NULL) {
|
if (libcheckra1nhelper_dylib_path == NULL) {
|
||||||
LOG(LOG_FATAL, "memory allocation failed\n");
|
LOG(LOG_FATAL, "memory allocation failed\n");
|
||||||
@@ -136,7 +131,6 @@ int exec_checkra1n(void) {
|
|||||||
unlink(libcheckra1nhelper_dylib_path);
|
unlink(libcheckra1nhelper_dylib_path);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
setenv_ra1n:
|
|
||||||
setenv("DYLD_INSERT_LIBRARIES", libcheckra1nhelper_dylib_path, 1);
|
setenv("DYLD_INSERT_LIBRARIES", libcheckra1nhelper_dylib_path, 1);
|
||||||
#if !defined(FORCE_HELPER)
|
#if !defined(FORCE_HELPER)
|
||||||
}
|
}
|
||||||
@@ -156,10 +150,8 @@ checkra1n_exec: {};
|
|||||||
LOG(LOG_VERBOSE5, args);
|
LOG(LOG_VERBOSE5, args);
|
||||||
if (pongo_path != NULL) LOG(LOG_VERBOSE5, pongo_path);
|
if (pongo_path != NULL) LOG(LOG_VERBOSE5, pongo_path);
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
posix_spawn_file_actions_t action;
|
|
||||||
posix_spawn_file_actions_init(&action);
|
|
||||||
if (pongo_path != NULL) {
|
if (pongo_path != NULL) {
|
||||||
ret = posix_spawn(&pid, checkra1n_path, &action, NULL, (char* []){
|
ret = posix_spawn(&pid, checkra1n_path, NULL, NULL, (char* []){
|
||||||
checkra1n_path,
|
checkra1n_path,
|
||||||
args,
|
args,
|
||||||
"-k",
|
"-k",
|
||||||
@@ -167,13 +159,12 @@ checkra1n_exec: {};
|
|||||||
NULL
|
NULL
|
||||||
}, environ);
|
}, environ);
|
||||||
} else {
|
} else {
|
||||||
ret = posix_spawn(&pid, checkra1n_path, &action, NULL, (char* []){
|
ret = posix_spawn(&pid, checkra1n_path, NULL, NULL, (char* []){
|
||||||
checkra1n_path,
|
checkra1n_path,
|
||||||
args,
|
args,
|
||||||
NULL
|
NULL
|
||||||
}, environ);
|
}, environ);
|
||||||
}
|
}
|
||||||
posix_spawn_file_actions_destroy(&action);
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
LOG(LOG_FATAL, "Cannot posix spawn %s: %d (%s)", checkra1n_path, errno, strerror(errno));
|
LOG(LOG_FATAL, "Cannot posix spawn %s: %d (%s)", checkra1n_path, errno, strerror(errno));
|
||||||
if (ext_checkra1n != NULL) unlink(checkra1n_path);
|
if (ext_checkra1n != NULL) unlink(checkra1n_path);
|
||||||
@@ -194,10 +185,10 @@ checkra1n_exec: {};
|
|||||||
pongo_path = NULL;
|
pongo_path = NULL;
|
||||||
#if defined(__APPLE__) && defined(__arm64__) && (TARGET_OS_IPHONE || defined(FORCE_HELPER))
|
#if defined(__APPLE__) && defined(__arm64__) && (TARGET_OS_IPHONE || defined(FORCE_HELPER))
|
||||||
if (libcheckra1nhelper_dylib_path != NULL) {
|
if (libcheckra1nhelper_dylib_path != NULL) {
|
||||||
if (!gOverrideLibcheckra1nHelper) unlink(libcheckra1nhelper_dylib_path);
|
unlink(libcheckra1nhelper_dylib_path);
|
||||||
unsetenv("DYLD_INSERT_LIBRARIES");
|
unsetenv("DYLD_INSERT_LIBRARIES");
|
||||||
unsetenv("DYLD_FORCE_FLAT_NAMESPACE");
|
unsetenv("DYLD_FORCE_FLAT_NAMESPACE");
|
||||||
if (!gOverrideLibcheckra1nHelper) free(libcheckra1nhelper_dylib_path);
|
free(libcheckra1nhelper_dylib_path);
|
||||||
libcheckra1nhelper_dylib_path = NULL;
|
libcheckra1nhelper_dylib_path = NULL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -24,8 +24,3 @@ unsigned int binpack_dmg_len = 0;
|
|||||||
unsigned char* Pongo_bin = NULL;
|
unsigned char* Pongo_bin = NULL;
|
||||||
unsigned int Pongo_bin_len = 0;
|
unsigned int Pongo_bin_len = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef NO_EMBED_HELPER
|
|
||||||
unsigned char* libcheckra1nhelper_dylib = NULL;
|
|
||||||
unsigned int libcheckra1nhelper_dylib_len = 0;
|
|
||||||
#endif
|
|
||||||
@@ -30,6 +30,11 @@
|
|||||||
#include <paleinfo.h>
|
#include <paleinfo.h>
|
||||||
|
|
||||||
pthread_mutex_t spin_mutex, found_pongo_mutex, ecid_dfu_wait_mutex;
|
pthread_mutex_t spin_mutex, found_pongo_mutex, ecid_dfu_wait_mutex;
|
||||||
|
#ifdef TUI
|
||||||
|
#include <newt.h>
|
||||||
|
pthread_mutex_t tui_log_mutex;
|
||||||
|
newtComponent tui_log_output = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
bool spin, found_pongo = 0;
|
bool spin, found_pongo = 0;
|
||||||
uint64_t ecid_wait_for_dfu = 0;
|
uint64_t ecid_wait_for_dfu = 0;
|
||||||
@@ -83,3 +88,19 @@ uint64_t set_ecid_wait_for_dfu(uint64_t ecid) {
|
|||||||
pthread_mutex_unlock(&ecid_dfu_wait_mutex);
|
pthread_mutex_unlock(&ecid_dfu_wait_mutex);
|
||||||
return ecid;
|
return ecid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef TUI
|
||||||
|
newtComponent get_tui_log(void) {
|
||||||
|
pthread_mutex_lock(&tui_log_mutex);
|
||||||
|
newtComponent ret = tui_log_output;
|
||||||
|
pthread_mutex_unlock(&tui_log_mutex);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
newtComponent set_tui_log(newtComponent co) {
|
||||||
|
pthread_mutex_lock(&tui_log_mutex);
|
||||||
|
tui_log_output = co;
|
||||||
|
pthread_mutex_unlock(&tui_log_mutex);
|
||||||
|
return co;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -10,7 +10,11 @@
|
|||||||
|
|
||||||
int p1_log(log_level_t loglevel, const char *fname, int lineno, const char *fxname, const char *__restrict format, ...)
|
int p1_log(log_level_t loglevel, const char *fname, int lineno, const char *fxname, const char *__restrict format, ...)
|
||||||
{
|
{
|
||||||
if (verbose >= 5) fprintf(stderr, "p1_log: loglevel %d from %s:%d:%s()\n", loglevel, fname, lineno, fxname);
|
if (verbose >= 5
|
||||||
|
#ifdef TUI
|
||||||
|
&& !(palerain_flags & palerain_option_tui)
|
||||||
|
#endif
|
||||||
|
) fprintf(stderr, "p1_log: loglevel %d from %s:%d:%s()\n", loglevel, fname, lineno, fxname);
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
char type[0x10];
|
char type[0x10];
|
||||||
char colour[0x10];
|
char colour[0x10];
|
||||||
@@ -19,6 +23,9 @@ int p1_log(log_level_t loglevel, const char *fname, int lineno, const char *fxna
|
|||||||
va_start(args, format);
|
va_start(args, format);
|
||||||
if (verbose < (loglevel - 3) && loglevel > LOG_INFO) {
|
if (verbose < (loglevel - 3) && loglevel > LOG_INFO) {
|
||||||
if (verbose >= 5
|
if (verbose >= 5
|
||||||
|
#ifdef TUI
|
||||||
|
&& !tui_started
|
||||||
|
#endif
|
||||||
) fprintf(stderr, "p1_log: hid log with high log level (%d < %d)\n", verbose, loglevel - 3);
|
) fprintf(stderr, "p1_log: hid log with high log level (%d < %d)\n", verbose, loglevel - 3);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -54,6 +61,18 @@ int p1_log(log_level_t loglevel, const char *fname, int lineno, const char *fxna
|
|||||||
colour[0] = '\0';
|
colour[0] = '\0';
|
||||||
colour_bold[0] = '\0';
|
colour_bold[0] = '\0';
|
||||||
}
|
}
|
||||||
|
#ifdef TUI
|
||||||
|
if ((palerain_flags & palerain_option_tui) && tui_started) {
|
||||||
|
newtComponent co = get_tui_log();
|
||||||
|
if (co == NULL) {
|
||||||
|
return 0; /* 0 bytes printed */
|
||||||
|
}
|
||||||
|
char printbuf[0x200];
|
||||||
|
ret = vsnprintf(printbuf, 0x200, format, args);
|
||||||
|
pthread_mutex_lock(&log_mutex);
|
||||||
|
newtTextboxSetText(co, printbuf);
|
||||||
|
} else
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
pthread_mutex_lock(&log_mutex);
|
pthread_mutex_lock(&log_mutex);
|
||||||
char timestring[0x80];
|
char timestring[0x80];
|
||||||
|
|||||||
+13
-13
@@ -80,6 +80,9 @@ int build_checks(void) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef TUI
|
||||||
|
bool tui_started = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef USE_LIBUSB
|
#ifdef USE_LIBUSB
|
||||||
void log_cb(libusb_context *ctx, enum libusb_log_level level, const char *str) {
|
void log_cb(libusb_context *ctx, enum libusb_log_level level, const char *str) {
|
||||||
@@ -87,17 +90,7 @@ void log_cb(libusb_context *ctx, enum libusb_log_level level, const char *str) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// save argc, argv, and envp for restarting
|
int palera1n(int argc, char *argv[]) {
|
||||||
|
|
||||||
int saved_argc;
|
|
||||||
char** saved_argv;
|
|
||||||
char** saved_envp;
|
|
||||||
|
|
||||||
int palera1n(int argc, char *argv[], char *envp[]) {
|
|
||||||
saved_argc = argc;
|
|
||||||
saved_argv = argv;
|
|
||||||
saved_envp = envp;
|
|
||||||
|
|
||||||
print_credits();
|
print_credits();
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
pthread_mutex_init(&log_mutex, NULL);
|
pthread_mutex_init(&log_mutex, NULL);
|
||||||
@@ -107,6 +100,13 @@ int palera1n(int argc, char *argv[], char *envp[]) {
|
|||||||
if ((ret = build_checks())) return ret;
|
if ((ret = build_checks())) return ret;
|
||||||
if ((ret = optparse(argc, argv))) goto cleanup;
|
if ((ret = optparse(argc, argv))) goto cleanup;
|
||||||
if (!(palerain_flags & palerain_option_device_info) && (palerain_flags & palerain_option_palerain_version)) goto normal_exit;
|
if (!(palerain_flags & palerain_option_device_info) && (palerain_flags & palerain_option_palerain_version)) goto normal_exit;
|
||||||
|
#ifdef TUI
|
||||||
|
if ((palerain_flags & palerain_option_tui)) {
|
||||||
|
ret = tui();
|
||||||
|
if (ret) goto cleanup;
|
||||||
|
else goto normal_exit;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#ifdef USE_LIBUSB
|
#ifdef USE_LIBUSB
|
||||||
{
|
{
|
||||||
libusb_set_log_cb(NULL, log_cb, LIBUSB_LOG_CB_GLOBAL);
|
libusb_set_log_cb(NULL, log_cb, LIBUSB_LOG_CB_GLOBAL);
|
||||||
@@ -173,6 +173,6 @@ cleanup:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int main (int argc, char* argv[], char* envp[]) {
|
int main (int argc, char* argv[]) {
|
||||||
return palera1n(argc, argv, envp);
|
return palera1n(argc, argv);
|
||||||
}
|
}
|
||||||
+26
-51
@@ -17,12 +17,11 @@
|
|||||||
|
|
||||||
uint64_t* palerain_flags_p = &palerain_flags;
|
uint64_t* palerain_flags_p = &palerain_flags;
|
||||||
static bool force_use_verbose_boot = false;
|
static bool force_use_verbose_boot = false;
|
||||||
char* gOverrideLibcheckra1nHelper = NULL;
|
|
||||||
|
|
||||||
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'},
|
{"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'},
|
||||||
@@ -36,9 +35,7 @@ static struct option longopts[] = {
|
|||||||
{"force-revert", no_argument, NULL, palerain_option_case_force_revert},
|
{"force-revert", no_argument, NULL, palerain_option_case_force_revert},
|
||||||
{"no-colors", no_argument, NULL, 'S'},
|
{"no-colors", no_argument, NULL, 'S'},
|
||||||
{"safe-mode", no_argument, NULL, 's'},
|
{"safe-mode", no_argument, NULL, 's'},
|
||||||
{"telnetd", no_argument, NULL, 'T'},
|
|
||||||
{"version", no_argument, NULL, palerain_option_case_version},
|
{"version", no_argument, NULL, palerain_option_case_version},
|
||||||
{"override-libcheckra1nhelper", required_argument, NULL, palerain_option_case_libcheckra1nhelper_path},
|
|
||||||
{"override-pongo", required_argument, NULL, 'k'},
|
{"override-pongo", required_argument, NULL, 'k'},
|
||||||
{"override-overlay", required_argument, NULL, 'o'},
|
{"override-overlay", required_argument, NULL, 'o'},
|
||||||
{"override-ramdisk", required_argument, NULL, 'r'},
|
{"override-ramdisk", required_argument, NULL, 'r'},
|
||||||
@@ -51,6 +48,9 @@ static struct option longopts[] = {
|
|||||||
#ifdef DEV_BUILD
|
#ifdef DEV_BUILD
|
||||||
{"test1", no_argument, NULL, '1'},
|
{"test1", no_argument, NULL, '1'},
|
||||||
{"test2", no_argument, NULL, '2'},
|
{"test2", no_argument, NULL, '2'},
|
||||||
|
#endif
|
||||||
|
#ifdef TUI
|
||||||
|
{"tui", no_argument, NULL, 't'},
|
||||||
#endif
|
#endif
|
||||||
{NULL, 0, NULL, 0}
|
{NULL, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
@@ -59,16 +59,19 @@ static int usage(int e, char* prog_name)
|
|||||||
{
|
{
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Usage: %s [-"
|
"Usage: %s [-"
|
||||||
"DEhpvVldsSTLRnPI"
|
"DEhpvVdsSLRnPI"
|
||||||
#ifdef DEV_BUILD
|
#ifdef DEV_BUILD
|
||||||
"12"
|
"12"
|
||||||
#endif
|
#endif
|
||||||
#ifdef ROOTFUL
|
#ifdef ROOTFUL
|
||||||
"cCfB"
|
"cCfBl"
|
||||||
|
#endif
|
||||||
|
#ifdef TUI
|
||||||
|
"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) 2024, palera1n team, All Rights Reserved.\n\n"
|
"Copyright (C) 2023, palera1n team, All Rights Reserved.\n\n"
|
||||||
"iOS/iPadOS/tvOS 15.0-17.5, bridgeOS 5.0-8.3 arm64 jailbreaking tool\n\n"
|
"iOS/iPadOS 15.0-16.5.1 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
|
||||||
@@ -104,10 +107,13 @@ static int usage(int e, char* prog_name)
|
|||||||
"\t-R, --reboot-device\t\t\tReboot connected device in normal mode\n"
|
"\t-R, --reboot-device\t\t\tReboot connected device in normal mode\n"
|
||||||
"\t-s, --safe-mode\t\t\t\tEnter safe mode\n"
|
"\t-s, --safe-mode\t\t\t\tEnter safe mode\n"
|
||||||
"\t-S, --no-colors\t\t\t\tDisable colors on the command line\n"
|
"\t-S, --no-colors\t\t\t\tDisable colors on the command line\n"
|
||||||
"\t-T, --telnetd\t\t\t\tEnable TELNET daemon on port 46 (insecure)\n"
|
|
||||||
"\t-v, --debug-logging\t\t\tEnable debug logging\n"
|
"\t-v, --debug-logging\t\t\tEnable debug logging\n"
|
||||||
"\t\tThis option can be repeated for extra verbosity.\n"
|
"\t\tThis option can be repeated for extra verbosity.\n"
|
||||||
"\t-V, --verbose-boot\t\t\tVerbose boot\n"
|
"\t-V, --verbose-boot\t\t\tVerbose boot\n"
|
||||||
|
|
||||||
|
#ifdef TUI
|
||||||
|
"\t-t, --tui\t\t\t\tTerminal user interface\n"
|
||||||
|
#endif
|
||||||
"\nEnvironmental variables:\n"
|
"\nEnvironmental variables:\n"
|
||||||
"\tTMPDIR\t\ttemporary diretory (path the built-in checkra1n will be extracted to)\n"
|
"\tTMPDIR\t\ttemporary diretory (path the built-in checkra1n will be extracted to)\n"
|
||||||
,
|
,
|
||||||
@@ -119,17 +125,14 @@ int optparse(int argc, char* argv[]) {
|
|||||||
int opt;
|
int opt;
|
||||||
int index;
|
int index;
|
||||||
while ((opt = getopt_long(argc, argv,
|
while ((opt = getopt_long(argc, argv,
|
||||||
"DEhpvVlLdsSTtRnPIe:o:r:K:k:i:"
|
"DEhpvVlLdsStRnPIe:o:r:K:k:i:"
|
||||||
#ifdef DEV_BUILD
|
#ifdef DEV_BUILD
|
||||||
"12"
|
"12"
|
||||||
#endif
|
#endif
|
||||||
#ifdef ROOTFUL
|
|
||||||
"fCcB"
|
"fCcB"
|
||||||
#endif
|
|
||||||
,longopts, NULL)) != -1)
|
,longopts, NULL)) != -1)
|
||||||
{
|
{
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
#ifdef ROOTFUL
|
|
||||||
case 'B':
|
case 'B':
|
||||||
palerain_flags |= palerain_option_setup_partial_root;
|
palerain_flags |= palerain_option_setup_partial_root;
|
||||||
palerain_flags |= palerain_option_setup_rootful;
|
palerain_flags |= palerain_option_setup_rootful;
|
||||||
@@ -142,7 +145,6 @@ int optparse(int argc, char* argv[]) {
|
|||||||
case 'C':
|
case 'C':
|
||||||
palerain_flags |= palerain_option_clean_fakefs;
|
palerain_flags |= palerain_option_clean_fakefs;
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
case 'p':
|
case 'p':
|
||||||
palerain_flags |= palerain_option_pongo_exit;
|
palerain_flags |= palerain_option_pongo_exit;
|
||||||
break;
|
break;
|
||||||
@@ -172,12 +174,10 @@ int optparse(int argc, char* argv[]) {
|
|||||||
}
|
}
|
||||||
snprintf(xargs_cmd, sizeof(xargs_cmd), "xargs %s", optarg);
|
snprintf(xargs_cmd, sizeof(xargs_cmd), "xargs %s", optarg);
|
||||||
break;
|
break;
|
||||||
#ifdef ROOTFUL
|
|
||||||
case 'f':
|
case 'f':
|
||||||
palerain_flags |= palerain_option_rootful;
|
palerain_flags |= palerain_option_rootful;
|
||||||
palerain_flags &= ~palerain_option_rootless;
|
palerain_flags &= ~palerain_option_rootless;
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
case 'l':
|
case 'l':
|
||||||
palerain_flags &= ~palerain_option_rootful;
|
palerain_flags &= ~palerain_option_rootful;
|
||||||
palerain_flags |= palerain_option_rootless;
|
palerain_flags |= palerain_option_rootless;
|
||||||
@@ -194,9 +194,6 @@ int optparse(int argc, char* argv[]) {
|
|||||||
case 's':
|
case 's':
|
||||||
palerain_flags |= palerain_option_safemode;
|
palerain_flags |= palerain_option_safemode;
|
||||||
break;
|
break;
|
||||||
case 'T':
|
|
||||||
palerain_flags |= palerain_option_telnetd;
|
|
||||||
break;
|
|
||||||
case 'k':
|
case 'k':
|
||||||
if (access(optarg, F_OK) != 0) {
|
if (access(optarg, F_OK) != 0) {
|
||||||
LOG(LOG_FATAL, "Cannot access pongo file at %s: %d (%s)", optarg, errno, strerror(errno));
|
LOG(LOG_FATAL, "Cannot access pongo file at %s: %d (%s)", optarg, errno, strerror(errno));
|
||||||
@@ -285,6 +282,11 @@ int optparse(int argc, char* argv[]) {
|
|||||||
case 'S':
|
case 'S':
|
||||||
palerain_flags |= palerain_option_no_colors;
|
palerain_flags |= palerain_option_no_colors;
|
||||||
break;
|
break;
|
||||||
|
#ifdef TUI
|
||||||
|
case 't':
|
||||||
|
palerain_flags |= palerain_option_tui;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
#ifdef DEV_BUILD
|
#ifdef DEV_BUILD
|
||||||
case '1':
|
case '1':
|
||||||
palerain_flags |= palerain_option_test1;
|
palerain_flags |= palerain_option_test1;
|
||||||
@@ -299,14 +301,6 @@ int optparse(int argc, char* argv[]) {
|
|||||||
case palerain_option_case_version:
|
case palerain_option_case_version:
|
||||||
palerain_flags |= palerain_option_palerain_version;
|
palerain_flags |= palerain_option_palerain_version;
|
||||||
break;
|
break;
|
||||||
case palerain_option_case_libcheckra1nhelper_path:
|
|
||||||
printf("meow\n");
|
|
||||||
gOverrideLibcheckra1nHelper = calloc(1, strlen(optarg) + 1);
|
|
||||||
if (!gOverrideLibcheckra1nHelper) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
snprintf(gOverrideLibcheckra1nHelper, strlen(optarg) + 1, "%s", optarg);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
usage(1, argv[0]);
|
usage(1, argv[0]);
|
||||||
break;
|
break;
|
||||||
@@ -330,26 +324,15 @@ int optparse(int argc, char* argv[]) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (palerain_flags & palerain_option_telnetd) {
|
|
||||||
LOG(LOG_WARNING, "telnetd is enabled, this is a security hole");
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((strstr(xargs_cmd, "serial=") != NULL) && !force_use_verbose_boot && (palerain_flags & palerain_option_setup_rootful)) {
|
if ((strstr(xargs_cmd, "serial=") != NULL) && !force_use_verbose_boot && (palerain_flags & palerain_option_setup_rootful)) {
|
||||||
palerain_flags &= ~palerain_option_verbose_boot;
|
palerain_flags &= ~palerain_option_verbose_boot;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((palerain_flags & (palerain_option_exit_recovery | palerain_option_enter_recovery | palerain_option_reboot_device | palerain_option_device_info | palerain_option_dfuhelper_only | palerain_option_pongo_exit | palerain_option_pongo_full)) > 0) {
|
if ((palerain_flags & (palerain_option_rootless | palerain_option_rootful)) == 0) {
|
||||||
} else {
|
LOG(LOG_FATAL, "must specify -l option");
|
||||||
#ifdef ROOTFUL
|
return -1;
|
||||||
if ((palerain_flags & (palerain_option_rootless | palerain_option_rootful)) == 0) {
|
|
||||||
LOG(LOG_FATAL, "Please specify rootful (-f) or rootless (-l)");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
palerain_flags |= palerain_option_rootless;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf(palerain_flags_cmd, 0x30, "palera1n_flags 0x%" PRIx64, palerain_flags);
|
snprintf(palerain_flags_cmd, 0x30, "palera1n_flags 0x%" PRIx64, palerain_flags);
|
||||||
LOG(LOG_VERBOSE3, "palerain_flags: %s", palerain_flags_cmd);
|
LOG(LOG_VERBOSE3, "palerain_flags: %s", palerain_flags_cmd);
|
||||||
if (override_kpf.magic == OVERRIDE_MAGIC) {
|
if (override_kpf.magic == OVERRIDE_MAGIC) {
|
||||||
@@ -364,14 +347,13 @@ int optparse(int argc, char* argv[]) {
|
|||||||
LOG(LOG_VERBOSE4, "overlay override length %" PRIu32 " -> %" PRIu32, override_overlay.orig_len, binpack_dmg_len);
|
LOG(LOG_VERBOSE4, "overlay override length %" PRIu32 " -> %" PRIu32, override_overlay.orig_len, binpack_dmg_len);
|
||||||
LOG(LOG_VERBOSE4, "overlay override ptr %p -> %p", override_overlay.orig_ptr, **overlay_to_upload);
|
LOG(LOG_VERBOSE4, "overlay override ptr %p -> %p", override_overlay.orig_ptr, **overlay_to_upload);
|
||||||
}
|
}
|
||||||
#ifdef ROOTFUL
|
|
||||||
if (!(palerain_flags & palerain_option_rootful)) {
|
if (!(palerain_flags & palerain_option_rootful)) {
|
||||||
if ((palerain_flags & palerain_option_setup_rootful)) {
|
if ((palerain_flags & palerain_option_setup_rootful)) {
|
||||||
LOG(LOG_FATAL, "Cannot setup rootful when rootless is requested. Use -f to enable rootful mode.");
|
LOG(LOG_FATAL, "Cannot setup rootful when rootless is requested. Use -f to enable rootful mode.");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if (!(
|
if (!(
|
||||||
(palerain_flags & palerain_option_dfuhelper_only) ||
|
(palerain_flags & palerain_option_dfuhelper_only) ||
|
||||||
(palerain_flags & palerain_option_enter_recovery) ||
|
(palerain_flags & palerain_option_enter_recovery) ||
|
||||||
@@ -395,13 +377,6 @@ int optparse(int argc, char* argv[]) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef NO_EMBED_HELPER
|
|
||||||
if (libcheckra1nhelper_dylib_len == 0 && gOverrideLibcheckra1nHelper == NULL) {
|
|
||||||
LOG(LOG_FATAL, "checkra1n helper omitted in build but no override specified");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (index = optind; index < argc; index++)
|
for (index = optind; index < argc; index++)
|
||||||
|
|||||||
+1
-6
@@ -33,11 +33,9 @@ void *pongo_usb_callback(stuff_t *arg) {
|
|||||||
if (get_found_pongo())
|
if (get_found_pongo())
|
||||||
return NULL;
|
return NULL;
|
||||||
set_found_pongo(1);
|
set_found_pongo(1);
|
||||||
#ifdef ROOTFUL
|
|
||||||
if ((palerain_flags & palerain_option_setup_rootful)) {
|
if ((palerain_flags & palerain_option_setup_rootful)) {
|
||||||
strncat(xargs_cmd, " wdt=-1", 0x270 - strlen(xargs_cmd) - 1);
|
strncat(xargs_cmd, " wdt=-1", 0x270 - strlen(xargs_cmd) - 1);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
LOG(LOG_INFO, "Found PongoOS USB Device");
|
LOG(LOG_INFO, "Found PongoOS USB Device");
|
||||||
usb_device_handle_t handle = arg->handle;
|
usb_device_handle_t handle = arg->handle;
|
||||||
issue_pongo_command(handle, NULL);
|
issue_pongo_command(handle, NULL);
|
||||||
@@ -54,6 +52,7 @@ void *pongo_usb_callback(stuff_t *arg) {
|
|||||||
if (ramdisk_dmg_lzma_len != 0)
|
if (ramdisk_dmg_lzma_len != 0)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
// strncat(xargs_cmd, " rootdev=md0", 0x270 - strlen(xargs_cmd) - 1);
|
||||||
upload_pongo_file(handle, **ramdisk_to_upload, ramdisk_dmg_lzma_len);
|
upload_pongo_file(handle, **ramdisk_to_upload, ramdisk_dmg_lzma_len);
|
||||||
if ((*ramdisk_to_upload) == &ramdisk_dmg_lzma)
|
if ((*ramdisk_to_upload) == &ramdisk_dmg_lzma)
|
||||||
issue_pongo_command(handle, "ramdisk " RAMDISK_UNCOMPRESSED_SIZE);
|
issue_pongo_command(handle, "ramdisk " RAMDISK_UNCOMPRESSED_SIZE);
|
||||||
@@ -70,10 +69,8 @@ void *pongo_usb_callback(stuff_t *arg) {
|
|||||||
}
|
}
|
||||||
issue_pongo_command(handle, xargs_cmd);
|
issue_pongo_command(handle, xargs_cmd);
|
||||||
if ((palerain_flags & palerain_option_pongo_full)) goto done;
|
if ((palerain_flags & palerain_option_pongo_full)) goto done;
|
||||||
|
|
||||||
issue_pongo_command(handle, "bootx");
|
issue_pongo_command(handle, "bootx");
|
||||||
LOG(LOG_INFO, "Booting Kernel...");
|
LOG(LOG_INFO, "Booting Kernel...");
|
||||||
#ifdef ROOTFUL
|
|
||||||
if ((palerain_flags & palerain_option_setup_partial_root)) {
|
if ((palerain_flags & palerain_option_setup_partial_root)) {
|
||||||
LOG(LOG_INFO, "Please wait up to 5 minutes for the bindfs to be created.");
|
LOG(LOG_INFO, "Please wait up to 5 minutes for the bindfs to be created.");
|
||||||
LOG(LOG_INFO, "Once the device boots up to iOS, run again without the -B (Create BindFS) option to jailbreak.");
|
LOG(LOG_INFO, "Once the device boots up to iOS, run again without the -B (Create BindFS) option to jailbreak.");
|
||||||
@@ -81,14 +78,12 @@ void *pongo_usb_callback(stuff_t *arg) {
|
|||||||
LOG(LOG_INFO, "Please wait up to 10 minutes for the fakefs to be created.");
|
LOG(LOG_INFO, "Please wait up to 10 minutes for the fakefs to be created.");
|
||||||
LOG(LOG_INFO, "Once the device boots up to iOS, run again without the -c (Create FakeFS) option to jailbreak.");
|
LOG(LOG_INFO, "Once the device boots up to iOS, run again without the -c (Create FakeFS) option to jailbreak.");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if (dfuhelper_thr_running) {
|
if (dfuhelper_thr_running) {
|
||||||
pthread_cancel(dfuhelper_thread);
|
pthread_cancel(dfuhelper_thread);
|
||||||
dfuhelper_thr_running = false;
|
dfuhelper_thr_running = false;
|
||||||
}
|
}
|
||||||
done:
|
done:
|
||||||
device_has_booted = true;
|
device_has_booted = true;
|
||||||
|
|
||||||
#ifdef USE_LIBUSB
|
#ifdef USE_LIBUSB
|
||||||
libusb_unref_device(arg->dev);
|
libusb_unref_device(arg->dev);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+106
@@ -0,0 +1,106 @@
|
|||||||
|
#ifdef TUI
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <locale.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
#include <palerain.h>
|
||||||
|
#include <tui.h>
|
||||||
|
|
||||||
|
int redraw_screen(void) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int destroy_window(void) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int init_window(void) {
|
||||||
|
setlocale(LC_ALL, NULL);
|
||||||
|
setenv(
|
||||||
|
"NEWT_COLORS",
|
||||||
|
"root=,black\n"
|
||||||
|
"border=lightgray,black\n"
|
||||||
|
"title=lightgray,black\n"
|
||||||
|
"roottext=red,black\n"
|
||||||
|
"label=lightgray,black\n"
|
||||||
|
"entry=lightgray,black\n"
|
||||||
|
"window=red,black\n"
|
||||||
|
"textbox=lightgray,black\n"
|
||||||
|
"button=black,lightgray\n"
|
||||||
|
"compactbutton=lightgray,black\n"
|
||||||
|
"listbox=lightgray,black\n"
|
||||||
|
"actlistbox=black,lightgray\n"
|
||||||
|
"actsellistbox=black,lightgray\n"
|
||||||
|
"checkbox=lightgray,black\n"
|
||||||
|
"actcheckbox=black,lightgray\n",
|
||||||
|
0);
|
||||||
|
|
||||||
|
tui_started = true;
|
||||||
|
newtInit();
|
||||||
|
int cols, rows;
|
||||||
|
newtGetScreenSize(&cols, &rows);
|
||||||
|
if (cols < 80 || rows < 24) {
|
||||||
|
newtFinished();
|
||||||
|
tui_started = false;
|
||||||
|
LOG(LOG_FATAL, "Terminal size must be at least 80x24");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
LOG(LOG_VERBOSE3, "cols: %d, rows: %d\n", cols, rows);
|
||||||
|
newtCls();
|
||||||
|
newtSetColor(PI_LOG_COLOR, "yellow", "black");
|
||||||
|
newtSetColor(PI_STEP_CURRENT, "lightgray", "black");
|
||||||
|
newtSetColor(PI_STEP_OTHER, "gray", "black");
|
||||||
|
newtDrawRootText(0, 0, "palera1n version 2.0.0");
|
||||||
|
newtPushHelpLine(NULL);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int tui(void) {
|
||||||
|
int ret = 0;
|
||||||
|
if ((ret = init_window())) return ret;
|
||||||
|
ret = MAIN_SCREEN;
|
||||||
|
while (1) {
|
||||||
|
switch (ret) {
|
||||||
|
case ERROR_SCREEN:
|
||||||
|
goto out;
|
||||||
|
break;
|
||||||
|
case EXIT_SCREEN:
|
||||||
|
goto out;
|
||||||
|
break;
|
||||||
|
case MAIN_SCREEN:
|
||||||
|
ret = tui_screen_main();
|
||||||
|
break;
|
||||||
|
case OPTIONS_SCREEN:
|
||||||
|
ret = tui_screen_options();
|
||||||
|
break;
|
||||||
|
case ENTER_RECOVERY_SCREEN:
|
||||||
|
ret = tui_screen_enter_recovery();
|
||||||
|
break;
|
||||||
|
case ENTER_DFU_SCREEN:
|
||||||
|
ret = tui_screen_enter_dfu();
|
||||||
|
break;
|
||||||
|
case JAILBREAKING_SCREEN:
|
||||||
|
ret = tui_screen_jailbreak();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
assert(0);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
newtPopWindow();
|
||||||
|
}
|
||||||
|
out:
|
||||||
|
newtFinished();
|
||||||
|
tui_started = false;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
/* ISO C forbids an empty translation unit */
|
||||||
|
extern char** environ;
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
#ifdef TUI
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <locale.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
#include <palerain.h>
|
||||||
|
#include <tui.h>
|
||||||
|
|
||||||
|
tui_screen_t tui_screen_enter_dfu(void) { return JAILBREAKING_SCREEN; }
|
||||||
|
|
||||||
|
#else
|
||||||
|
/* ISO C forbids an empty translation unit */
|
||||||
|
extern char** environ;
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
#ifdef TUI
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <locale.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
#include <palerain.h>
|
||||||
|
#include <tui.h>
|
||||||
|
|
||||||
|
tui_screen_t tui_screen_enter_recovery(void) { return ENTER_DFU_SCREEN; }
|
||||||
|
|
||||||
|
#else
|
||||||
|
/* ISO C forbids an empty translation unit */
|
||||||
|
extern char** environ;
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
#ifdef TUI
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <locale.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
#include <palerain.h>
|
||||||
|
#include <tui.h>
|
||||||
|
|
||||||
|
tui_screen_t tui_screen_jailbreak(void) { return EXIT_SCREEN; }
|
||||||
|
|
||||||
|
#else
|
||||||
|
/* ISO C forbids an empty translation unit */
|
||||||
|
extern char** environ;
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
#ifdef TUI
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <locale.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
#include <palerain.h>
|
||||||
|
#include <tui.h>
|
||||||
|
|
||||||
|
tui_screen_t tui_screen_main(void) {
|
||||||
|
int ret = MAIN_SCREEN;
|
||||||
|
bool can_start = false;
|
||||||
|
newtCenteredWindow(WIDTH, HEIGHT, NULL);
|
||||||
|
newtComponent optionsButton = newtCompactButton(46, 18, "Options");
|
||||||
|
newtComponent startButton = newtCompactButton(57, 18, "Start");
|
||||||
|
newtComponent exitButton = newtCompactButton(66, 18, "Exit");
|
||||||
|
newtComponent welcome = newtLabel(1, 0, "Welcome to palera1n!");
|
||||||
|
newtComponent deviceMsg = newtTextbox(1, 2, 40, 3, NEWT_FLAG_WRAP);
|
||||||
|
set_tui_log(deviceMsg);
|
||||||
|
LOG(LOG_INFO, "Connect your iPhone, iPad or iPod Touch to begin.");
|
||||||
|
newtTextboxSetColors(deviceMsg, PI_LOG_COLOR, PI_LOG_COLOR);
|
||||||
|
set_tui_log(deviceMsg);
|
||||||
|
newtComponent form = newtForm(NULL, NULL, 0);
|
||||||
|
newtFormAddComponents(form, optionsButton, startButton, exitButton, welcome,
|
||||||
|
deviceMsg, NULL);
|
||||||
|
newtRunForm(form);
|
||||||
|
newtRefresh();
|
||||||
|
newtComponent buttonPressed = newtFormGetCurrent(form);
|
||||||
|
if (buttonPressed == optionsButton) {
|
||||||
|
ret = OPTIONS_SCREEN;
|
||||||
|
} else if (buttonPressed == startButton) {
|
||||||
|
if (can_start)
|
||||||
|
ret = ENTER_RECOVERY_SCREEN;
|
||||||
|
else
|
||||||
|
ret = MAIN_SCREEN;
|
||||||
|
} else if (buttonPressed == exitButton) {
|
||||||
|
ret = EXIT_SCREEN;
|
||||||
|
}
|
||||||
|
set_tui_log(NULL);
|
||||||
|
newtFormDestroy(form);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
/* ISO C forbids an empty translation unit */
|
||||||
|
extern char** environ;
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
#ifdef TUI
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <locale.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
#include <palerain.h>
|
||||||
|
#include <tui.h>
|
||||||
|
|
||||||
|
void bitfield_check_cb(newtComponent box, void* data) {
|
||||||
|
if (newtCheckboxGetValue(box) == ' ') {
|
||||||
|
*((tui_bit_info_t*)data)->flags_p = *((tui_bit_info_t*)data)->flags_p &~ ((tui_bit_info_t*)data)->opt;
|
||||||
|
} else if (newtCheckboxGetValue(box) == '*') {
|
||||||
|
*((tui_bit_info_t*)data)->flags_p |= ((tui_bit_info_t*)data)->opt;
|
||||||
|
} else assert(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
tui_screen_t tui_screen_options(void) {
|
||||||
|
tui_bit_info_t verbose_info = { &palerain_flags, palerain_option_verbose_boot };
|
||||||
|
tui_bit_info_t rootful_info = { &palerain_flags, palerain_option_rootful };
|
||||||
|
tui_bit_info_t setup_rootful_info = { &palerain_flags, palerain_option_setup_rootful };
|
||||||
|
tui_bit_info_t force_revert_info = { &palerain_flags, palerain_option_force_revert };
|
||||||
|
tui_bit_info_t safemode_info = { &palerain_flags, palerain_option_safemode };
|
||||||
|
tui_bit_info_t flower_chain_info = { &palerain_flags, palerain_option_flower_chain };
|
||||||
|
|
||||||
|
const char* bootargs_entered = NULL;
|
||||||
|
int ret = MAIN_SCREEN;
|
||||||
|
|
||||||
|
newtCenteredWindow(WIDTH, HEIGHT, NULL);
|
||||||
|
newtComponent backButton = newtCompactButton(66, 18, "Back");
|
||||||
|
|
||||||
|
newtComponent optionsNotice = newtTextbox(1, 0, WIDTH - 2, 3, NEWT_FLAG_WRAP);
|
||||||
|
newtTextboxSetText(optionsNotice, "You may set the following options. If you don't know what they mean you'll probably have no reason to set them.");
|
||||||
|
// newtTextboxSetColors(optionsNotice, NEWT_COLORSET_LABEL, NEWT_COLORSET_LABEL);
|
||||||
|
|
||||||
|
newtComponent verboseBootBox = newtCheckbox(1, 3, "Verbose boot", CHECKBOX_STATE(palerain_flags, palerain_option_verbose_boot), NULL, NULL);
|
||||||
|
newtComponent rootfulBox = newtCheckbox(1, 4, "Rootful", CHECKBOX_STATE(palerain_flags, palerain_option_rootful), NULL, NULL);
|
||||||
|
newtComponent rootfulSetupBox = newtCheckbox(1, 5, "Setup fakefs", CHECKBOX_STATE(palerain_flags, palerain_option_setup_rootful), NULL, NULL);
|
||||||
|
newtComponent forceRevertBox = newtCheckbox(1, 6, "Restore system", CHECKBOX_STATE(palerain_flags, palerain_option_force_revert), NULL, NULL);
|
||||||
|
newtComponent safeModeBox = newtCheckbox(1, 7, "Safe mode", CHECKBOX_STATE(palerain_flags, palerain_option_safemode), NULL, NULL);
|
||||||
|
|
||||||
|
newtComponentAddCallback(verboseBootBox, bitfield_check_cb, &verbose_info);
|
||||||
|
newtComponentAddCallback(rootfulBox, bitfield_check_cb, &rootful_info);
|
||||||
|
newtComponentAddCallback(rootfulSetupBox, bitfield_check_cb, &setup_rootful_info);
|
||||||
|
newtComponentAddCallback(forceRevertBox, bitfield_check_cb, &force_revert_info);
|
||||||
|
newtComponentAddCallback(safeModeBox, bitfield_check_cb, &safemode_info);
|
||||||
|
|
||||||
|
newtComponent bootCmdlineLabel = newtLabel(1, 8, "Kernel command line:");
|
||||||
|
newtComponent bootCmdlineEntry = newtEntry(1, 9, &xargs_cmd[6], WIDTH - 2, &bootargs_entered, NEWT_ENTRY_SCROLL);
|
||||||
|
|
||||||
|
newtComponent flowerChainBox = newtCheckbox(1, 10, "Flower chain", CHECKBOX_STATE(palerain_flags, palerain_option_flower_chain), NULL, NULL);
|
||||||
|
newtComponentAddCallback(flowerChainBox, bitfield_check_cb, &flower_chain_info);
|
||||||
|
|
||||||
|
|
||||||
|
newtComponent form = newtForm(NULL, NULL, 0);
|
||||||
|
newtFormAddComponents(form, backButton, verboseBootBox, rootfulBox,
|
||||||
|
rootfulSetupBox, forceRevertBox, safeModeBox, bootCmdlineLabel,
|
||||||
|
bootCmdlineEntry, flowerChainBox, optionsNotice,
|
||||||
|
NULL);
|
||||||
|
newtRunForm(form);
|
||||||
|
newtRefresh();
|
||||||
|
snprintf(xargs_cmd, 0x270, "xargs %s", bootargs_entered);
|
||||||
|
newtComponent buttonPressed = newtFormGetCurrent(form);
|
||||||
|
if (buttonPressed == backButton) {
|
||||||
|
ret = MAIN_SCREEN;
|
||||||
|
} else ret = MAIN_SCREEN;
|
||||||
|
newtFormDestroy(form);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
/* ISO C forbids an empty translation unit */
|
||||||
|
extern char** environ;
|
||||||
|
#endif
|
||||||
@@ -5,6 +5,8 @@
|
|||||||
<true/>
|
<true/>
|
||||||
<key>com.apple.private.security.no-container</key>
|
<key>com.apple.private.security.no-container</key>
|
||||||
<true/>
|
<true/>
|
||||||
|
<key>com.apple.private.skip-library-validation</key>
|
||||||
|
<true/>
|
||||||
<key>com.apple.security.iokit-user-client-class</key>
|
<key>com.apple.security.iokit-user-client-class</key>
|
||||||
<array>
|
<array>
|
||||||
<string>IOUserClient</string>
|
<string>IOUserClient</string>
|
||||||
|
|||||||
Reference in new issue
Block a user