mirror of
https://github.com/palera1n/palera1n.git
synced 2026-11-01 05:59:48 +01:00
implement rootful setup and revert
This commit is contained in:
1 parent
ed2ca6066f
commit
ee355b34d0
4 files changed
+28
-9
No files matched your search
@@ -43,7 +43,7 @@ jobs:
|
|||||||
- name: Download dependencies (embedded binaries)
|
- name: Download dependencies (embedded binaries)
|
||||||
run: |
|
run: |
|
||||||
cd src
|
cd src
|
||||||
curl -LOOO https://github.com/guacaplushy/checkp4le/raw/main/binaries/checkra1n-kpf-pongo \
|
curl -LOOO https://cdn.nickchan.lol/palera1n/c-rewrite/deps/checkra1n-kpf-pongo \
|
||||||
https://cdn.nickchan.lol/palera1n/c-rewrite/deps/binpack.dmg \
|
https://cdn.nickchan.lol/palera1n/c-rewrite/deps/binpack.dmg \
|
||||||
https://cdn.nickchan.lol/palera1n/c-rewrite/deps/ramdisk.dmg
|
https://cdn.nickchan.lol/palera1n/c-rewrite/deps/ramdisk.dmg
|
||||||
cd ..
|
cd ..
|
||||||
@@ -381,7 +381,7 @@ jobs:
|
|||||||
- name: Download dependencies (embedded binaries)
|
- name: Download dependencies (embedded binaries)
|
||||||
run: |
|
run: |
|
||||||
cd src
|
cd src
|
||||||
curl -LOOO https://github.com/guacaplushy/checkp4le/raw/main/binaries/checkra1n-kpf-pongo \
|
curl -LOOO https://cdn.nickchan.lol/palera1n/c-rewrite/deps/checkra1n-kpf-pongo \
|
||||||
https://cdn.nickchan.lol/palera1n/c-rewrite/deps/binpack.dmg \
|
https://cdn.nickchan.lol/palera1n/c-rewrite/deps/binpack.dmg \
|
||||||
https://cdn.nickchan.lol/palera1n/c-rewrite/deps/ramdisk.dmg
|
https://cdn.nickchan.lol/palera1n/c-rewrite/deps/ramdisk.dmg
|
||||||
cd ..
|
cd ..
|
||||||
|
|||||||
+4
-2
@@ -54,8 +54,10 @@
|
|||||||
#define checkrain_option_force_revert (1 << 7) /* keep this at 7 */
|
#define checkrain_option_force_revert (1 << 7) /* keep this at 7 */
|
||||||
|
|
||||||
// palera1n option
|
// palera1n option
|
||||||
#define palerain_option_rootful (1 << 0)
|
#define palerain_option_rootful (1 << 0) /* rootful jailbreak */
|
||||||
#define palerain_option_jbinit_log_to_file (1 << 1)
|
#define palerain_option_jbinit_log_to_file (1 << 1) /* log to /cores/jbinit.log */
|
||||||
|
#define palerain_option_setup_rootful (1 << 2) /* create fakefs */
|
||||||
|
#define palerain_option_setup_rootful_forced (1 << 3) /* create fakefs over an existing one */
|
||||||
|
|
||||||
#define PALEINFO_MAGIC 'PLSH'
|
#define PALEINFO_MAGIC 'PLSH'
|
||||||
#define PALEINFO_CIGAM 'HSLP'
|
#define PALEINFO_CIGAM 'HSLP'
|
||||||
|
|||||||
+18
-4
@@ -13,6 +13,8 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
static struct option longopts[] = {
|
static struct option longopts[] = {
|
||||||
|
{"setup-fakefs", no_argument, NULL, 'c'},
|
||||||
|
{"setup-fakefs-forced", 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'},
|
||||||
@@ -32,16 +34,19 @@ static struct option longopts[] = {
|
|||||||
{"override-ramdisk", required_argument, NULL, 'r'},
|
{"override-ramdisk", required_argument, NULL, 'r'},
|
||||||
{"override-kpf", required_argument, NULL, 'K'},
|
{"override-kpf", required_argument, NULL, 'K'},
|
||||||
{"disable-ohio", no_argument, NULL, 'O'},
|
{"disable-ohio", no_argument, NULL, 'O'},
|
||||||
{NULL, 0, NULL, 0}};
|
{NULL, 0, NULL, 0}
|
||||||
|
};
|
||||||
|
|
||||||
static int usage(int e, char* prog_name)
|
static int usage(int e, char* prog_name)
|
||||||
{
|
{
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Usage: %s [-DhpPvVldsOL] [-e boot arguments] [-f root device] [-k Pongo image] [-o overlay file] [-r ramdisk file] [-K KPF file]\n"
|
"Usage: %s [-cCDhpPvVldsOL] [-e boot arguments] [-f root device] [-k Pongo image] [-o overlay file] [-r ramdisk file] [-K KPF file]\n"
|
||||||
"Copyright (C) 2023, palera1n team, All Rights Reserved.\n\n"
|
"Copyright (C) 2023, palera1n team, All Rights Reserved.\n\n"
|
||||||
"iOS/iPadOS 15+ arm64 jailbreaking tool\n\n"
|
"iOS/iPadOS 15+ 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 (on rootless)\n"
|
"\t--force-revert\t\t\t\tRemove jailbreak\n"
|
||||||
|
"\t-c, --setup-fakefs\t\t\tSetup fakefs\n"
|
||||||
|
"\t-C, --setup-fakefs-forced\t\tSetup fakefs and overwrite any existing ones\n"
|
||||||
"\t-D, --dfuhelper-only\t\t\tExit after entering DFU\n"
|
"\t-D, --dfuhelper-only\t\t\tExit after entering DFU\n"
|
||||||
"\t-h, --help\t\t\t\tShow this help\n"
|
"\t-h, --help\t\t\t\tShow this help\n"
|
||||||
"\t-p, --pongo-shell\t\t\tBoots to PongoOS shell\n"
|
"\t-p, --pongo-shell\t\t\tBoots to PongoOS shell\n"
|
||||||
@@ -67,9 +72,18 @@ static int usage(int e, char* prog_name)
|
|||||||
int optparse(int argc, char* argv[]) {
|
int optparse(int argc, char* argv[]) {
|
||||||
int opt;
|
int opt;
|
||||||
int index;
|
int index;
|
||||||
while ((opt = getopt_long(argc, argv, "DhpvVldsOLe:f:o:r:K:k:", longopts, NULL)) != -1)
|
while ((opt = getopt_long(argc, argv, "cCDhpvVldsOLe:f:o:r:K:k:", longopts, NULL)) != -1)
|
||||||
{
|
{
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
|
case 'c':
|
||||||
|
palerain_flags |= palerain_option_setup_rootful;
|
||||||
|
kpf_flags |= checkrain_option_verbose_boot;
|
||||||
|
break;
|
||||||
|
case 'C':
|
||||||
|
palerain_flags |= palerain_option_setup_rootful;
|
||||||
|
palerain_flags |= palerain_option_setup_rootful_forced;
|
||||||
|
kpf_flags |= checkrain_option_verbose_boot;
|
||||||
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
pongo_exit = true;
|
pongo_exit = true;
|
||||||
break;
|
break;
|
||||||
|
|||||||
+4
-1
@@ -29,6 +29,10 @@ void *pongo_usb_callback(void *arg) {
|
|||||||
if (found_pongo)
|
if (found_pongo)
|
||||||
return NULL;
|
return NULL;
|
||||||
found_pongo = 1;
|
found_pongo = 1;
|
||||||
|
strncat(xargs_cmd, " rootdev=md0", 0x270);
|
||||||
|
if (checkrain_option_enabled(palerain_flags, palerain_option_setup_rootful)) {
|
||||||
|
strncat(xargs_cmd, " wdt=-1", 0x270);
|
||||||
|
}
|
||||||
LOG(LOG_INFO, "Found PongoOS USB Device");
|
LOG(LOG_INFO, "Found PongoOS USB Device");
|
||||||
usb_device_handle_t handle = *(usb_device_handle_t *)arg;
|
usb_device_handle_t handle = *(usb_device_handle_t *)arg;
|
||||||
issue_pongo_command(handle, NULL);
|
issue_pongo_command(handle, NULL);
|
||||||
@@ -44,7 +48,6 @@ void *pongo_usb_callback(void *arg) {
|
|||||||
issue_pongo_command(handle, rootfs_cmd);
|
issue_pongo_command(handle, rootfs_cmd);
|
||||||
issue_pongo_command(handle, dtpatch_cmd);
|
issue_pongo_command(handle, dtpatch_cmd);
|
||||||
}
|
}
|
||||||
strncat(xargs_cmd, " rootdev=md0", 0x270);
|
|
||||||
upload_pongo_file(handle, **ramdisk_to_upload, ramdisk_dmg_len);
|
upload_pongo_file(handle, **ramdisk_to_upload, ramdisk_dmg_len);
|
||||||
issue_pongo_command(handle, "ramdisk");
|
issue_pongo_command(handle, "ramdisk");
|
||||||
upload_pongo_file(handle, **overlay_to_upload, binpack_dmg_len);
|
upload_pongo_file(handle, **overlay_to_upload, binpack_dmg_len);
|
||||||
|
|||||||
Reference in new issue
Block a user