-An iOS 15.0-16.4 work-in-progress, semi-tethered checkm8 jailbreak
+An iOS 15.0-16.4.1 work-in-progress, semi-tethered checkm8 jailbreak
Usage
diff --git a/docs/palera1n.1 b/docs/palera1n.1
index abe015a..777545e 100644
--- a/docs/palera1n.1
+++ b/docs/palera1n.1
@@ -6,7 +6,7 @@
.Dt palera1n 1
.Sh NAME
.Nm palera1n
-.Nd iOS 15.0-16.4 arm64 iOS/iPadOS jailbreaking tool
+.Nd iOS 15.0-16.4.1 arm64 iOS/iPadOS jailbreaking tool
.Sh SYNOPSIS
.Nm
.Op Fl cCdDEfhIlLnpRsSvV
@@ -20,7 +20,7 @@
.Op Fl -force-revert
.Sh DESCRIPTION
.Nm
-jailbreaks any iOS/iPadOS device with an arm64 (arm64e excluded) on iOS 15.0-16.4,
+jailbreaks any iOS/iPadOS device with an arm64 (arm64e excluded) on iOS 15.0-16.4.1,
utilizing the
.Em checkm8
bootROM exploit.
@@ -52,7 +52,7 @@ In the remainder of this document, the term "iOS" and "iPadOS" will be used inte
as the difference is negligible as far as the jailbreak is concerened.
.Pp
.Sh SUPPORTED DEVICES
-As described above, arm64 iOS 15.0-16.4 devices are supported, here is an explicit
+As described above, arm64 iOS 15.0-16.4.1 devices are supported, here is an explicit
list of supported devicecs:
.Bl -tag -compact
diff --git a/packaging/control b/packaging/control
index 8bf87dc..2a2bd58 100644
--- a/packaging/control
+++ b/packaging/control
@@ -8,7 +8,7 @@ Depends: usbmuxd
Section: Utilities
Priority: optional
Homepage: https://palera.in
-Description: iOS 15.0-16.4 semi-tethered checkm8 jailbreak
+Description: iOS 15.0-16.4.1 semi-tethered checkm8 jailbreak
palera1n is an iOS/iPadOS 15.0-15.3.1 semi tethered jailbreak
based on the checkm8 exploit.
.
diff --git a/packaging/control.macosx b/packaging/control.macosx
index 6687b8d..022c8ce 100644
--- a/packaging/control.macosx
+++ b/packaging/control.macosx
@@ -7,7 +7,7 @@ Author: palera1n team
Section: Utilities
Priority: optional
Homepage: https://palera.in
-Description: iOS 15.0-16.4 semi-tethered checkm8 jailbreak
+Description: iOS 15.0-16.4.1 semi-tethered checkm8 jailbreak
palera1n is an iOS/iPadOS 15.0-15.3.1 semi tethered jailbreak
based on the checkm8 exploit.
.
diff --git a/src/optparse.c b/src/optparse.c
index ce0c333..acba17d 100644
--- a/src/optparse.c
+++ b/src/optparse.c
@@ -75,7 +75,7 @@ static int usage(int e, char* prog_name)
#endif
"] [-e boot arguments] [-k Pongo image] [-o overlay file] [-r ramdisk file] [-K KPF file] [-i checkra1n file]\n"
"Copyright (C) 2023, palera1n team, All Rights Reserved.\n\n"
- "iOS/iPadOS 15.0-16.4 arm64 jailbreaking tool\n\n"
+ "iOS/iPadOS 15.0-16.4.1 arm64 jailbreaking tool\n\n"
"\t--version\t\t\t\tPrint version\n"
"\t--force-revert\t\t\t\tRemove jailbreak\n"
#ifdef DEV_BUILD
From 1422d45a9fd729bde6ed86523cc1c73ad5fab32e Mon Sep 17 00:00:00 2001
From: Nick Chan
Date: Wed, 19 Apr 2023 11:22:38 +0800
Subject: [PATCH 06/56] fix: limd-glue FTBFS with latest libplist
---
.github/workflows/build.yml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index a5c1620..8b07b88 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -24,7 +24,7 @@ on:
jobs:
build-docs:
runs-on: ubuntu-latest
- steps:
+ steps:
- name: Checkout
uses: actions/checkout@v3
@@ -258,6 +258,7 @@ jobs:
- name: Build libplist
run: |
cd libplist
+ git checkout bfc97788f081584ced9cd35d85b69b3fec6b907c
autoreconf -fiv
./configure ${{ env.CONFIGURE_ARGS }} --without-cython
gmake -j$(sysctl -n hw.ncpu)
@@ -680,6 +681,7 @@ jobs:
- name: Build libplist
run: |
cd libplist
+ git checkout bfc97788f081584ced9cd35d85b69b3fec6b907c
autoreconf -fiv
./configure ${{ env.CONFIGURE_ARGS }} --without-cython
make -j$(nproc)
From fe565b97add587a8b8b56fa238e14df508d18ca0 Mon Sep 17 00:00:00 2001
From: Nick Chan
Date: Wed, 19 Apr 2023 11:29:40 +0800
Subject: [PATCH 07/56] fix harder
---
.github/workflows/build.yml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 8b07b88..085e3fa 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -258,6 +258,7 @@ jobs:
- name: Build libplist
run: |
cd libplist
+ git fetch origin bfc97788f081584ced9cd35d85b69b3fec6b907c
git checkout bfc97788f081584ced9cd35d85b69b3fec6b907c
autoreconf -fiv
./configure ${{ env.CONFIGURE_ARGS }} --without-cython
@@ -681,6 +682,7 @@ jobs:
- name: Build libplist
run: |
cd libplist
+ git fetch origin bfc97788f081584ced9cd35d85b69b3fec6b907c
git checkout bfc97788f081584ced9cd35d85b69b3fec6b907c
autoreconf -fiv
./configure ${{ env.CONFIGURE_ARGS }} --without-cython
From a9e72b579e669c2c01873838693a9acdeb567786 Mon Sep 17 00:00:00 2001
From: justtryingthingsout
<31097061+justtryingthingsout@users.noreply.github.com>
Date: Thu, 20 Apr 2023 17:22:43 +0800
Subject: [PATCH 08/56] Add more error checking and improved readability
---
Makefile | 2 +-
include/kerninfo.h | 12 +--
include/palerain.h | 4 +-
include/tui.h | 2 +-
src/devhelper.c | 153 ++++++++++++++++++-----------------
src/dfuhelper.c | 181 ++++++++++++++++++++++++------------------
src/exec_checkra1n.c | 6 +-
src/lockdown_helper.c | 30 +++----
src/log.c | 20 ++---
src/main.c | 26 +++---
src/optparse.c | 18 ++---
src/pongo_helper.c | 20 ++---
12 files changed, 240 insertions(+), 234 deletions(-)
diff --git a/Makefile b/Makefile
index b413235..8a6df89 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ DEP = $(SRC)/dep_root
STRIP = strip
CC ?= cc
CFLAGS += -I$(DEP)/include -I$(SRC)/include -I$(SRC)
-CFLAGS += -Wall -Wextra -DPALERAIN_VERSION=\"2.0.0\" -Wall -Wextra -Wno-unused-parameter
+CFLAGS += -Wall -Wextra -Wno-unused-parameter -DPALERAIN_VERSION=\"2.0.0\"
CFLAGS += -Wno-unused-variable -I$(SRC)/src -std=c99 -pedantic-errors -D_C99_SOURCE -D_POSIX_C_SOURCE=200112L
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
diff --git a/include/kerninfo.h b/include/kerninfo.h
index 2df1407..b3979dd 100644
--- a/include/kerninfo.h
+++ b/include/kerninfo.h
@@ -122,18 +122,8 @@ struct kpfinfo {
options = (checkrain_option_t)(options & ~option); \
} while (0);
-static inline bool checkrain_option_enabled(checkrain_option_t flags, checkrain_option_t opt)
+static inline bool checkrain_options_enabled(checkrain_option_t flags, checkrain_option_t opt)
{
- if(flags == checkrain_option_failure)
- {
- switch(opt)
- {
- case checkrain_option_safemode:
- return true;
- default:
- return false;
- }
- }
return (flags & opt) != 0;
}
diff --git a/include/palerain.h b/include/palerain.h
index 17527df..09b370c 100644
--- a/include/palerain.h
+++ b/include/palerain.h
@@ -100,6 +100,8 @@ struct mach_header_64
};
#endif
+typedef void *(*pthread_start_t)(void *);
+
// Keep in sync with Pongo
#define PONGO_USB_VENDOR 0x05ac
#define PONGO_USB_PRODUCT 0x4141
@@ -203,7 +205,7 @@ boyermoore_horspool_memmem(const unsigned char* haystack, size_t hlen,
const unsigned char* needle, size_t nlen);
-extern void* pongo_usb_callback(void* arg);
+extern void* pongo_usb_callback(stuff_t* arg);
usb_ret_t USBControlTransfer(usb_device_handle_t handle, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint32_t wLength, void *data, uint32_t *wLenDone);
const char *usb_strerror(usb_ret_t err);
int wait_for_pongo(void);
diff --git a/include/tui.h b/include/tui.h
index bc61094..b31d528 100644
--- a/include/tui.h
+++ b/include/tui.h
@@ -20,7 +20,7 @@
#define PI_STEP_CURRENT NEWT_COLORSET_CUSTOM(1)
#define PI_STEP_OTHER NEWT_COLORSET_CUSTOM(2)
-#define CHECKBOX_STATE(flags, opt) checkrain_option_enabled(flags, opt) ? '*' : ' '
+#define CHECKBOX_STATE(flags, opt) checkrain_options_enabled(flags, opt) ? '*' : ' '
typedef enum tui_screens {
ERROR_SCREEN = -1,
diff --git a/src/devhelper.c b/src/devhelper.c
index d2e7174..913d276 100644
--- a/src/devhelper.c
+++ b/src/devhelper.c
@@ -76,27 +76,27 @@ bool cpid_is_arm64(unsigned int cpid) {
* ========== 0x8960 ===========
* (ARM64) A7
*/
- if (
- cpid == 0x8960 || cpid == 0x7000 || cpid == 0x7001
- || cpid == 0x8000 || cpid == 0x8001 || cpid == 0x8003
- || cpid == 0x8010 || cpid == 0x8011 || cpid == 0x8012
- || cpid == 0x8015
-
- ) return true;
- return false;
+ return (
+ cpid == 0x8960 || cpid == 0x7000 || cpid == 0x7001 ||
+ cpid == 0x8000 || cpid == 0x8001 || cpid == 0x8003 ||
+ cpid == 0x8010 || cpid == 0x8011 || cpid == 0x8012 ||
+ cpid == 0x8015
+ );
}
int subscribe_cmd(usbmuxd_event_cb_t device_event_cb, irecv_device_event_cb_t irecv_event_cb)
{
- usbmuxd_events_subscribe(&usbmuxdctx, device_event_cb, NULL);
- irecv_device_event_subscribe(&irecvctx, irecv_event_cb, NULL);
+ int ret;
+ if (ret = usbmuxd_events_subscribe(&usbmuxdctx, device_event_cb, NULL)) return ret;
+ if (ret = irecv_device_event_subscribe(&irecvctx, irecv_event_cb, NULL)) return ret;
return 0;
}
int unsubscribe_cmd(void)
{
- usbmuxd_events_unsubscribe(usbmuxdctx);
- irecv_device_event_unsubscribe(irecvctx);
+ int ret;
+ if (ret = usbmuxd_events_unsubscribe(usbmuxdctx)) return ret;
+ if (ret = irecv_device_event_unsubscribe(irecvctx)) return ret;
irecvctx = NULL;
usbmuxdctx = NULL;
return 0;
@@ -119,15 +119,15 @@ int devinfo_cmd(devinfo_t *dev, const char *udid)
}
if (lockdownd_client_new(device, &lockdown, "palera1n") != LOCKDOWN_E_SUCCESS)
{
- idevice_free(device);
+ (void)idevice_free(device);
LOG(LOG_ERROR, "Device is not in normal mode.");
return -1;
}
plist_t node = NULL;
if (lockdownd_get_value(lockdown, NULL, "UniqueChipID", &node) != LOCKDOWN_E_SUCCESS)
{
- lockdownd_client_free(lockdown);
- idevice_free(device);
+ (void)lockdownd_client_free(lockdown);
+ (void)idevice_free(device);
LOG(LOG_ERROR, "Error getting ECID");
return -1;
}
@@ -137,8 +137,8 @@ int devinfo_cmd(devinfo_t *dev, const char *udid)
node = NULL;
if (lockdownd_get_value(lockdown, NULL, "ProductType", &node) != LOCKDOWN_E_SUCCESS)
{
- lockdownd_client_free(lockdown);
- idevice_free(device);
+ (void)lockdownd_client_free(lockdown);
+ (void)idevice_free(device);
LOG(LOG_ERROR, "Error getting product type");
return -1;
}
@@ -148,8 +148,8 @@ int devinfo_cmd(devinfo_t *dev, const char *udid)
node = NULL;
if (lockdownd_get_value(lockdown, NULL, "CPUArchitecture", &node) != LOCKDOWN_E_SUCCESS)
{
- lockdownd_client_free(lockdown);
- idevice_free(device);
+ (void)lockdownd_client_free(lockdown);
+ (void)idevice_free(device);
LOG(LOG_ERROR, "Error getting CPU type");
return -1;
}
@@ -159,8 +159,8 @@ int devinfo_cmd(devinfo_t *dev, const char *udid)
node = NULL;
if (lockdownd_get_value(lockdown, NULL, "ProductVersion", &node) != LOCKDOWN_E_SUCCESS)
{
- lockdownd_client_free(lockdown);
- idevice_free(device);
+ (void)lockdownd_client_free(lockdown);
+ (void)idevice_free(device);
LOG(LOG_ERROR, "Error getting product version");
return -1;
}
@@ -170,21 +170,21 @@ int devinfo_cmd(devinfo_t *dev, const char *udid)
node = NULL;
if (lockdownd_get_value(lockdown, NULL, "BuildVersion", &node) != LOCKDOWN_E_SUCCESS)
{
- lockdownd_client_free(lockdown);
- idevice_free(device);
+ (void)lockdownd_client_free(lockdown);
+ (void)idevice_free(device);
LOG(LOG_ERROR, "Error getting build version");
return -1;
}
plist_get_string_val(node, &buildVersion);
plist_free(node);
- lockdownd_client_free(lockdown);
- idevice_free(device);
+ (void)lockdownd_client_free(lockdown);
+ (void)idevice_free(device);
+
irecv_device_t rcvydev;
if (irecv_devices_get_device_by_product_type(productType, &rcvydev) == IRECV_E_SUCCESS)
{
displayName = rcvydev->display_name;
- }
- else
+ } else
{
displayName = productType;
}
@@ -209,23 +209,22 @@ int enter_recovery_cmd(const char* udid) {
LOG(LOG_ERROR, "Could not connect to lockdownd: %s", lockdownd_strerror(ldret));
return -1;
}
- do {
- ldret = lockdownd_enter_recovery(lockdown);
- if (ldret == LOCKDOWN_E_SESSION_INACTIVE) {
- lockdownd_client_free(lockdown);
- lockdown = NULL;
- if (LOCKDOWN_E_SUCCESS != (ldret = lockdownd_client_new_with_handshake(device, &lockdown, "palera1n"))) {
- LOG(LOG_ERROR, "Could not connect to lockdownd: %s", lockdownd_strerror(ldret));
- return -1;
- }
- ldret = lockdownd_enter_recovery(lockdown);
- }
+ ldret = lockdownd_enter_recovery(lockdown);
+ if (ldret == LOCKDOWN_E_SESSION_INACTIVE) {
+ lockdownd_client_free(lockdown);
+ lockdown = NULL;
+ ldret = lockdownd_client_new_with_handshake(device, &lockdown, "palera1n");
if (ldret != LOCKDOWN_E_SUCCESS) {
- LOG(LOG_ERROR, "Could not trigger entering recovery mode: %s", lockdownd_strerror(ldret));
+ LOG(LOG_ERROR, "Could not connect to lockdownd: %s", lockdownd_strerror(ldret));
return -1;
}
- lockdownd_client_free(lockdown);
- } while (0);
+ ldret = lockdownd_enter_recovery(lockdown);
+ }
+ if (ldret != LOCKDOWN_E_SUCCESS) {
+ LOG(LOG_ERROR, "Could not trigger entering recovery mode: %s", lockdownd_strerror(ldret));
+ return -1;
+ }
+ lockdownd_client_free(lockdown);
idevice_free(device);
return 0;
}
@@ -242,8 +241,8 @@ int reboot_cmd(const char* udid) {
if (diagnostics_relay_restart(diag, DIAGNOSTICS_RELAY_ACTION_FLAG_WAIT_FOR_DISCONNECT) != DIAGNOSTICS_RELAY_E_SUCCESS) {
LOG(LOG_ERROR, "Could not reboot device.");
}
- diagnostics_relay_goodbye(diag);
- diagnostics_relay_client_free(diag);
+ (void)diagnostics_relay_goodbye(diag);
+ (void)diagnostics_relay_client_free(diag);
} else {
LOG(LOG_ERROR, "Could not connect to device.");
return -1;
@@ -302,9 +301,9 @@ int passstat_cmd(unsigned char* status, const char* udid) {
derr = diagnostics_relay_query_mobilegestalt(diagnostics_client, keys, &node);
plist_free(keys);
- diagnostics_relay_client_free(diagnostics_client);
- lockdownd_service_descriptor_free(service);
- idevice_free(dev);
+ (void)diagnostics_relay_client_free(diagnostics_client);
+ (void)lockdownd_service_descriptor_free(service);
+ (void)idevice_free(dev);
if (derr != DIAGNOSTICS_RELAY_E_SUCCESS || !node)
{
@@ -322,7 +321,7 @@ int passstat_cmd(unsigned char* status, const char* udid) {
plist_get_string_val(status_node, &passstat_status);
if (!status || strncmp(passstat_status, "Succ", 4))
{
- if (passstat_status)
+ if (passstat_status)
free(passstat_status);
passstat_status = NULL;
plist_free(node);
@@ -349,20 +348,16 @@ int passstat_cmd(unsigned char* status, const char* udid) {
int recvinfo_cmd(recvinfo_t* info, const uint64_t ecid) {
irecv_client_t client = NULL;
irecv_error_t err = irecv_open_with_ecid(&client, ecid);
- if (err != IRECV_E_SUCCESS) {
- LOG(LOG_ERROR, "libirecovery error: %d (%s)", err, irecv_strerror(err));
- return -1;
- }
+ if (err != IRECV_E_SUCCESS) goto err;
int mode = 0;
- irecv_get_mode(client, &mode);
+ err = irecv_get_mode(client, &mode);
+ if (err != IRECV_E_SUCCESS) goto err;
char *ibootver = NULL;
- irecv_getenv(client, "build-version", &ibootver);
+ err = irecv_getenv(client, "build-version", &ibootver);
+ if (err != IRECV_E_SUCCESS) goto err;
irecv_device_t device;
err = irecv_devices_get_device_by_client(client, &device);
- if (err != IRECV_E_SUCCESS) {
- LOG(LOG_ERROR, "libirecovery error: %d (%s)", err, irecv_strerror(err));
- return -1;
- }
+ if (err != IRECV_E_SUCCESS) goto err;
info->mode = mode;
info->cpid = device->chip_id;
snprintf(info->product_type, 0x20, "%s", device->product_type);
@@ -371,33 +366,41 @@ int recvinfo_cmd(recvinfo_t* info, const uint64_t ecid) {
free(ibootver);
irecv_close(client);
return 0;
+err:
+ LOG(LOG_ERROR, "libirecovery error: %d (%s)", err, irecv_strerror(err));
+ return -1;
}
int autoboot_cmd(const uint64_t ecid) {
irecv_client_t client = NULL;
irecv_error_t err = irecv_open_with_ecid(&client, ecid);
- if (err == IRECV_E_SUCCESS) {
- irecv_setenv(client, "auto-boot", "true");
- irecv_saveenv(client);
- irecv_close(client);
- return 0;
- } else {
- LOG(LOG_ERROR, "libirecovery error: %d (%s)", err, irecv_strerror(err));
+ if (err != IRECV_E_SUCCESS) goto err;
+ err = irecv_setenv(client, "auto-boot", "true");
+ if (err != IRECV_E_SUCCESS) goto err;
+ err = irecv_saveenv(client);
+ if (err != IRECV_E_SUCCESS) goto err;
+ err = irecv_close(client);
+ if (err != IRECV_E_SUCCESS) goto err;
+ return 0;
+err:
+ LOG(LOG_ERROR, "libirecovery error: %d (%s)", err, irecv_strerror(err));
return -1;
- }
}
int exitrecv_cmd(const uint64_t ecid) {
irecv_client_t client = NULL;
irecv_error_t err = irecv_open_with_ecid(&client, ecid);
- if (err == IRECV_E_SUCCESS) {
- irecv_setenv(client, "auto-boot", "true");
- irecv_saveenv(client);
- irecv_reboot(client);
- irecv_close(client);
- return 0;
- } else {
- LOG(LOG_ERROR, "libirecovery error: %d (%s)", err, irecv_strerror(err));
- return -1;
- }
+ if (err != IRECV_E_SUCCESS) goto err;
+ err = irecv_setenv(client, "auto-boot", "true");
+ if (err != IRECV_E_SUCCESS) goto err;
+ err = irecv_saveenv(client);
+ if (err != IRECV_E_SUCCESS) goto err;
+ err = irecv_reboot(client);
+ if (err != IRECV_E_SUCCESS) goto err;
+ err = irecv_close(client);
+ if (err != IRECV_E_SUCCESS) goto err;
+ return 0;
+err:
+ LOG(LOG_ERROR, "libirecovery error: %d (%s)", err, irecv_strerror(err));
+ return -1;
}
diff --git a/src/dfuhelper.c b/src/dfuhelper.c
index 2068591..8eed57f 100644
--- a/src/dfuhelper.c
+++ b/src/dfuhelper.c
@@ -36,12 +36,20 @@ int dfuhelper_thr_running = false;
void step(int time, int time2, char *text, bool (*cond)(uint64_t), uint64_t cond_arg) {
for (int i = time2; i < time; i++) {
- printf(checkrain_option_enabled(host_flags, host_option_no_colors) ? "\r\033[K%s (%d)" : BCYN "\r\033[K%s (%d)" CRESET, text, time - i + time2);
+ printf(
+ checkrain_options_enabled(host_flags, host_option_no_colors)
+ ? "\r\033[K%s (%d)"
+ : BCYN "\r\033[K%s (%d)" CRESET, text, time - i + time2
+ );
fflush(stdout);
sleep(1);
if (cond != NULL && cond(cond_arg)) pthread_exit(NULL);
}
- printf(checkrain_option_enabled(host_flags, host_option_no_colors) ? "\r%s (%d)" : CYN "\r%s (%d)" CRESET, text, time2);
+ printf(
+ checkrain_options_enabled(host_flags, host_option_no_colors)
+ ? "\r%s (%d)"
+ : CYN "\r%s (%d)" CRESET, text, time2
+ );
if (time2 == 0) puts("");
}
@@ -53,14 +61,14 @@ int connected_normal_mode(const usbmuxd_device_info_t *usbmuxd_device) {
LOG(LOG_ERROR, "Unable to get device information");
return 0;
}
- if (strcmp(dev.CPUArchitecture, "arm64")) {
+ if (strncmp(dev.CPUArchitecture, "arm64", strlen("arm64"))) {
devinfo_free(&dev);
LOG(LOG_WARNING, "Ignoring non-arm64 device...");
LOG(LOG_WARNING, "palera1n doesn't and never will work on A12+ (arm64e)");
return -1;
}
if (!strncmp(dev.productType, "iPhone10,", strlen("iPhone10,"))) {
- if (!checkrain_option_enabled(host_flags, host_option_device_info))
+ if (!checkrain_options_enabled(host_flags, host_option_device_info))
LOG(LOG_VERBOSE2, "Product %s requires passcode to be disabled", dev.productType);
unsigned char passcode_state = 0;
ret = passstat_cmd(&passcode_state, usbmuxd_device->udid);
@@ -71,14 +79,14 @@ int connected_normal_mode(const usbmuxd_device_info_t *usbmuxd_device) {
}
if (passcode_state) {
LOG(LOG_ERROR, "Passcode must be disabled on this device");
- if (!checkrain_option_enabled(host_flags, host_option_device_info))
+ if (!checkrain_options_enabled(host_flags, host_option_device_info))
LOG(LOG_ERROR, "Additionally, passcode must never be set since a restore on iOS 16+");
devinfo_free(&dev);
return -1;
}
}
- if (checkrain_option_enabled(host_flags, host_option_device_info)) {
+ if (checkrain_options_enabled(host_flags, host_option_device_info)) {
printf("Mode: normal\n");
printf("ProductType: %s\n", dev.productType);
printf("Architecture: %s\n", dev.CPUArchitecture);
@@ -93,7 +101,7 @@ int connected_normal_mode(const usbmuxd_device_info_t *usbmuxd_device) {
LOG(LOG_INFO, "Telling device with udid %s to enter recovery mode immediately", usbmuxd_device->udid);
enter_recovery_cmd(usbmuxd_device->udid);
devinfo_free(&dev);
- if (checkrain_option_enabled(host_flags, host_option_enter_recovery)) {
+ if (checkrain_options_enabled(host_flags, host_option_enter_recovery)) {
device_has_booted = true;
set_spin(0);
unsubscribe_cmd();
@@ -138,17 +146,14 @@ void* connected_recovery_mode(struct irecv_device_info* info) {
return NULL;
}
printf("\r\033[K");
- bool nohome = NOHOME;
- if (nohome)
+ if (NOHOME) {
step(2, 0, "Hold volume down + side button", NULL, 0);
- else
- step(2, 0, "Hold home + power button", NULL, 0);
- if (nohome)
step(10, 0, "Hold volume down button", conditional, ecid);
- else
- step(10, 0, "Hold home button", conditional, ecid);
- if (get_ecid_wait_for_dfu() != 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) {
LOG(LOG_WARNING, "Whoops, device did not enter DFU mode");
LOG(LOG_INFO, "Waiting for device to reconnect...");
set_ecid_wait_for_dfu(0);
@@ -176,13 +181,15 @@ void device_event_cb(const usbmuxd_event_t *event, void* userdata) {
switch (event->event) {
case UE_DEVICE_ADD:
LOG(LOG_VERBOSE, "Normal mode device connected");
- if (checkrain_option_enabled(host_flags, host_option_exit_recovery)) {
+ if (checkrain_options_enabled(host_flags, host_option_exit_recovery)) {
break;
- } else if (checkrain_option_enabled(host_flags, host_option_reboot_device)) {
- reboot_cmd(event->device.udid);
- LOG(LOG_INFO, "Restarted device");
- set_spin(0);
- unsubscribe_cmd();
+ } else if (checkrain_options_enabled(host_flags, host_option_reboot_device)) {
+ int ret = reboot_cmd(event->device.udid);
+ if (!ret) {
+ LOG(LOG_INFO, "Restarted device");
+ set_spin(0);
+ unsubscribe_cmd();
+ }
pthread_exit(NULL);
break;
}
@@ -196,69 +203,85 @@ void device_event_cb(const usbmuxd_event_t *event, void* userdata) {
void irecv_device_event_cb(const irecv_device_event_t *event, void* userdata) {
pthread_t recovery_thread, dfu_thread;
+ int ret;
switch(event->type) {
case IRECV_DEVICE_ADD:
- if (event->mode == IRECV_K_RECOVERY_MODE_1 || event->mode == IRECV_K_RECOVERY_MODE_2 || event->mode == IRECV_K_RECOVERY_MODE_3 || event->mode == IRECV_K_RECOVERY_MODE_4) {
- if (!checkrain_option_enabled(host_flags, host_option_device_info))
- LOG(LOG_VERBOSE, "Recovery mode device %ld connected", event->device_info->ecid);
- if (checkrain_option_enabled(host_flags, host_option_exit_recovery)) {
- exitrecv_cmd(event->device_info->ecid);
- LOG(LOG_INFO, "Exited recovery mode");
- device_has_booted = true;
- set_spin(0);
- unsubscribe_cmd();
- if (dfuhelper_thr_running) pthread_cancel(dfuhelper_thread);
- pthread_exit(NULL);
- break;
- }
-
- if (checkrain_option_enabled(host_flags, host_option_device_info)) {
- recvinfo_t info;
- recvinfo_cmd(&info, event->device_info->ecid);
- printf("Mode: recovery\n");
- printf("ProductType: %s\n", info.product_type);
- printf("DisplayName: %s\n", info.display_name);
-
- device_has_booted = true;
- set_spin(0);
- unsubscribe_cmd();
- if (dfuhelper_thr_running) pthread_cancel(dfuhelper_thread);
- pthread_exit(NULL);
- break;
- }
-
- if (checkrain_option_enabled(host_flags, host_option_enter_recovery) ||
- checkrain_option_enabled(host_flags, host_option_reboot_device)) return;
- pthread_create(&recovery_thread, NULL, (void* (*)(void*))connected_recovery_mode, event->device_info);
- } else if (event->mode == IRECV_K_DFU_MODE) {
- if (!checkrain_option_enabled(host_flags, host_option_device_info))
- LOG(LOG_VERBOSE, "DFU mode device %ld connected", event->device_info->ecid);
-
- if (checkrain_option_enabled(host_flags, host_option_device_info)) {
- recvinfo_t info;
- recvinfo_cmd(&info, event->device_info->ecid);
- printf("Mode: dfu\n");
- printf("ProductType: %s\n", info.product_type);
- printf("DisplayName: %s\n", info.display_name);
-
- device_has_booted = true;
- set_spin(0);
- unsubscribe_cmd();
- if (dfuhelper_thr_running) pthread_cancel(dfuhelper_thread);
- pthread_exit(NULL);
- break;
- }
-
- if (
- checkrain_option_enabled(host_flags, host_option_exit_recovery) ||
- checkrain_option_enabled(host_flags, host_option_enter_recovery) ||
- checkrain_option_enabled(host_flags, host_option_reboot_device)) {
+ if (event->mode == IRECV_K_RECOVERY_MODE_1 ||
+ event->mode == IRECV_K_RECOVERY_MODE_2 ||
+ event->mode == IRECV_K_RECOVERY_MODE_3 ||
+ event->mode == IRECV_K_RECOVERY_MODE_4) {
+ if (!checkrain_options_enabled(host_flags, host_option_device_info))
+ LOG(LOG_VERBOSE, "Recovery mode device %ld connected", event->device_info->ecid);
+ if (checkrain_options_enabled(host_flags, host_option_exit_recovery)) {
+ ret = exitrecv_cmd(event->device_info->ecid);
+ if (!ret) {
+ LOG(LOG_INFO, "Exited recovery mode");
+ device_has_booted = true;
+ set_spin(0);
+ unsubscribe_cmd();
+ } else {
+ LOG(LOG_WARNING, "Could not exit recovery mode");
+ }
+ if (dfuhelper_thr_running) pthread_cancel(dfuhelper_thread);
+ pthread_exit(NULL);
break;
+ }
+
+ if (checkrain_options_enabled(host_flags, host_option_device_info)) {
+ recvinfo_t info;
+ ret = recvinfo_cmd(&info, event->device_info->ecid);
+ if (ret) {
+ LOG(LOG_WARNING, "Could not get info from device");
+ } else {
+ printf("Mode: Recovery\n");
+ printf("ProductType: %s\n", info.product_type);
+ printf("DisplayName: %s\n", info.display_name);
+
+ device_has_booted = true;
+ set_spin(0);
+ unsubscribe_cmd();
+ }
+ if (dfuhelper_thr_running) pthread_cancel(dfuhelper_thread);
+ pthread_exit(NULL);
+ break;
+ }
+
+ if (checkrain_options_enabled(host_flags, host_option_enter_recovery) ||
+ checkrain_options_enabled(host_flags, host_option_reboot_device)) return;
+ pthread_create(&recovery_thread, NULL, (pthread_start_t)connected_recovery_mode, event->device_info);
+ } else if (event->mode == IRECV_K_DFU_MODE) {
+ if (!checkrain_options_enabled(host_flags, host_option_device_info))
+ LOG(LOG_VERBOSE, "DFU mode device %ld connected", event->device_info->ecid);
+
+ if (checkrain_options_enabled(host_flags, host_option_device_info)) {
+ recvinfo_t info;
+ ret = recvinfo_cmd(&info, event->device_info->ecid);
+ if (ret) {
+ LOG(LOG_WARNING, "Could not get info from device");
+ } else {
+ printf("Mode: DFU\n");
+ printf("ProductType: %s\n", info.product_type);
+ printf("DisplayName: %s\n", info.display_name);
+
+ device_has_booted = true;
+ set_spin(0);
+ unsubscribe_cmd();
+ }
+ if (dfuhelper_thr_running) pthread_cancel(dfuhelper_thread);
+ pthread_exit(NULL);
+ break;
+ }
+
+ if (
+ checkrain_options_enabled(host_flags, host_option_exit_recovery) ||
+ checkrain_options_enabled(host_flags, host_option_enter_recovery) ||
+ checkrain_options_enabled(host_flags, host_option_reboot_device)) {
+ break;
+ }
+ pthread_create(&dfu_thread, NULL, (pthread_start_t)connected_dfu_mode, event->device_info);
}
- pthread_create(&dfu_thread, NULL, (void* (*)(void*))connected_dfu_mode, event->device_info);
- }
- break;
+ break;
case IRECV_DEVICE_REMOVE:
LOG(LOG_VERBOSE, "Recovery mode device disconnected");
break;
diff --git a/src/exec_checkra1n.c b/src/exec_checkra1n.c
index 60686bd..64962a6 100644
--- a/src/exec_checkra1n.c
+++ b/src/exec_checkra1n.c
@@ -126,11 +126,11 @@ int exec_checkra1n(void) {
#endif
checkra1n_exec: {};
char args[0x10] = "-E";
- if (checkrain_option_enabled(host_flags, host_option_demote)) strncat(args, "d", 0xf);
- if (!checkrain_option_enabled(host_flags, palerain_option_checkrain_is_clone)) {
+ if (checkrain_options_enabled(host_flags, host_option_demote)) strncat(args, "d", 0xf);
+ if (!checkrain_options_enabled(host_flags, palerain_option_checkrain_is_clone)) {
strncat(args, "p", 0xf);
if (verbose >= 2) strncat(args, "v", 0xf);
- if (checkrain_option_enabled(host_flags, host_option_no_colors)) strncat(args, "n", 0xf);
+ if (checkrain_options_enabled(host_flags, host_option_no_colors)) strncat(args, "n", 0xf);
} else {
strncat(args, "R", 0xf);
}
diff --git a/src/lockdown_helper.c b/src/lockdown_helper.c
index 5e7f0cc..b7b941c 100644
--- a/src/lockdown_helper.c
+++ b/src/lockdown_helper.c
@@ -11,22 +11,19 @@
#ifdef DEBUG
#define log_debug(...) fprintf(stderr, __VA_ARGS__); fputc('\n', stderr)
#else
-#define log_debug(...)
+#define log_debug(...) do {} while (0)
#endif
#define log_error(...) fprintf(stderr, __VA_ARGS__); fputc('\n', stderr)
-int lockdown_connect_handle(uint32_t handle)
-{
+int lockdown_connect_handle(uint32_t handle) {
int fd = usbmuxd_connect(handle, 62078);
if (fd < 0) {
log_debug("Can't connect to lockownd on device #%u", handle);
- return fd;
}
return fd;
}
-int lockdown_connect_udid(const char* udid)
-{
+int lockdown_connect_udid(const char* udid) {
usbmuxd_device_info_t device;
if (usbmuxd_get_device_by_udid(udid, &device) < 0) {
log_debug("Can't find device %s", udid);
@@ -35,8 +32,7 @@ int lockdown_connect_udid(const char* udid)
return lockdown_connect_handle(device.handle);
}
-void lockdown_disconnect(int fd)
-{
+void lockdown_disconnect(int fd) {
usbmuxd_disconnect(fd);
}
@@ -56,8 +52,7 @@ static const int INTEGER_NODE_SIZE = sizeof(INTEGER_NODE)-1;
static const int STRING_NODE_SIZE = sizeof(STRING_NODE)-1;
static const int ERROR_KEY_NODE_SIZE = sizeof(ERROR_KEY_NODE)-1;
-static void skip_ws(char** cur, char* end)
-{
+static void skip_ws(char** cur, char* end) {
char* p = *cur;
while (p < end && ((*p == ' ') || (*p == '\t') || (*p == '\r') || (*p == '\n'))) {
p++;
@@ -65,8 +60,7 @@ static void skip_ws(char** cur, char* end)
*cur = p;
}
-static char* _send_request_and_get_reply(int fd, const char* request, uint32_t len, uint32_t* received)
-{
+static char* _send_request_and_get_reply(int fd, const char* request, uint32_t len, uint32_t* received) {
uint32_t sent_bytes = 0;
usbmuxd_send(fd, request, len, &sent_bytes);
if (sent_bytes != len) {
@@ -100,8 +94,7 @@ static char* _send_request_and_get_reply(int fd, const char* request, uint32_t l
return resp;
}
-int lockdown_check_type(int fd, const char* type_match)
-{
+int lockdown_check_type(int fd, const char* type_match) {
unsigned char tmp[512];
uint32_t len = (uint32_t)snprintf((char*)tmp, 512, QUERY_TYPE_REQUEST);
uint32_t belen = htonl(len-4);
@@ -119,8 +112,7 @@ int lockdown_check_type(int fd, const char* type_match)
return result;
}
-int lockdown_get_uint_value(int fd, const char* domain, const char* key, uint64_t* value)
-{
+int lockdown_get_uint_value(int fd, const char* domain, const char* key, uint64_t* value) {
char tmp[1024];
uint32_t len;
if (domain) {
@@ -159,8 +151,7 @@ int lockdown_get_uint_value(int fd, const char* domain, const char* key, uint64_
return 0;
}
-int lockdown_get_string_value(int fd, const char* domain, const char* key, char** value)
-{
+int lockdown_get_string_value(int fd, const char* domain, const char* key, char** value) {
char tmp[1024];
uint32_t len;
if (domain) {
@@ -212,8 +203,7 @@ int lockdown_get_string_value(int fd, const char* domain, const char* key, char*
return 0;
}
-int lockdown_enter_recovery(int fd)
-{
+int lockdown_enter_recovery(int fd) {
char tmp[512];
uint32_t len = (uint32_t)snprintf(tmp, 512, ENTER_RECOVERY_REQUEST);
*(uint32_t*)&tmp = htonl(len-4);
diff --git a/src/log.c b/src/log.c
index 5c286f8..4d5a8e6 100644
--- a/src/log.c
+++ b/src/log.c
@@ -12,7 +12,7 @@ int p1_log(log_level_t loglevel, const char *fname, int lineno, const char *fxna
{
if (verbose >= 5
#ifdef TUI
- && !checkrain_option_enabled(host_flags, host_option_tui)
+ && !checkrain_options_enabled(host_flags, host_option_tui)
#endif
) fprintf(stderr, "p1_log: loglevel %d from %s:%d:%s()\n", loglevel, fname, lineno, fxname);
int ret = 0;
@@ -57,12 +57,12 @@ int p1_log(log_level_t loglevel, const char *fname, int lineno, const char *fxna
snprintf(colour_bold, 0x10, "%s", BWHT);
break;
}
- if (checkrain_option_enabled(host_flags, host_option_no_colors)) {
+ if (checkrain_options_enabled(host_flags, host_option_no_colors)) {
colour[0] = '\0';
colour_bold[0] = '\0';
}
#ifdef TUI
- if (checkrain_option_enabled(host_flags, host_option_tui) && tui_started) {
+ if (checkrain_options_enabled(host_flags, host_option_tui) && tui_started) {
newtComponent co = get_tui_log();
if (co == NULL) {
return 0; /* 0 bytes printed */
@@ -79,26 +79,26 @@ int p1_log(log_level_t loglevel, const char *fname, int lineno, const char *fxna
time_t curtime;
time(&curtime);
struct tm* timeinfo = localtime(&curtime);
- if (!checkrain_option_enabled(host_flags, host_option_no_colors))
+ if (!checkrain_options_enabled(host_flags, host_option_no_colors))
snprintf(timestring, 0x80, "%s[%s%02d/%02d/%d %02d:%02d:%02d%s]", CRESET, HBLK, timeinfo->tm_mon + 1, timeinfo->tm_mday, timeinfo->tm_year - 100, timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec, CRESET);
else
snprintf(timestring, 0x80, "[%02d/%02d/%d %02d:%02d:%02d]", timeinfo->tm_mon + 1, timeinfo->tm_mday, timeinfo->tm_year - 100, timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec);
- if (verbose >= 2 && !checkrain_option_enabled(host_flags, host_option_no_colors)) {
+ if (verbose >= 2 && !checkrain_options_enabled(host_flags, host_option_no_colors)) {
printf("%s| - %s%s <%s> " CRESET "%s" HBLU "%s" CRESET ":" BLU "%d" CRESET ":" BMAG "%s()" CRESET ": \n%s| ----> ", colour_bold, timestring, colour_bold, type, WHT, fname, lineno, fxname, colour_bold);
- } else if (!checkrain_option_enabled(host_flags, host_option_no_colors)) {
+ } else if (!checkrain_options_enabled(host_flags, host_option_no_colors)) {
printf(" - %s %s<%s>%s: ", timestring, colour_bold, type, CRESET);
- } else if (verbose >= 2 && checkrain_option_enabled(host_flags, host_option_no_colors)) {
+ } else if (verbose >= 2 && checkrain_options_enabled(host_flags, host_option_no_colors)) {
printf("%s| - %s%s <%s> %s:%d:%s(): \n%s| ----> ", colour_bold, timestring, colour_bold, type, fname, lineno, fxname, colour_bold);
- } else if (checkrain_option_enabled(host_flags, host_option_no_colors)) {
+ } else if (checkrain_options_enabled(host_flags, host_option_no_colors)) {
printf(" - %s %s<%s>: ", timestring, colour_bold, type);
}
printf("%s", colour);
ret = vprintf(format, args);
va_end(args);
- if (verbose < 2 && !checkrain_option_enabled(host_flags, host_option_no_colors))
+ if (verbose < 2 && !checkrain_options_enabled(host_flags, host_option_no_colors))
printf(CRESET "\n");
- else if (!checkrain_option_enabled(host_flags, host_option_no_colors))
+ else if (!checkrain_options_enabled(host_flags, host_option_no_colors))
printf("\n%s-%s\n", colour, CRESET);
else if (verbose < 2)
printf("\n");
diff --git a/src/main.c b/src/main.c
index 6fc3dc2..84d60a0 100644
--- a/src/main.c
+++ b/src/main.c
@@ -72,7 +72,7 @@ int build_checks(void) {
if (checkra1n_len <= (UCHAR_MAX + 1)) {
LOG(LOG_FATAL, "checkra1n too small");
}
- if (boyermoore_horspool_memmem(&checkra1n[0], checkra1n_len, (const unsigned char*)"[ra1npoc15-part] thanks to", strlen("[ra1npoc15-part] thanks to")) != NULL) {
+ if (boyermoore_horspool_memmem(&checkra1n[0], checkra1n_len, (const unsigned char *)"[ra1npoc15-part] thanks to", strlen("[ra1npoc15-part] thanks to")) != NULL) {
host_flags |= palerain_option_checkrain_is_clone;
}
#endif
@@ -81,8 +81,7 @@ int build_checks(void) {
if (kpf_hdr->magic != MH_MAGIC_64 && kpf_hdr->magic != MH_CIGAM_64) {
LOG(LOG_FATAL, "Broken build: Invalid kernel patchfinder: Not thin 64-bit Mach-O");
return -1;
- } else
- if (kpf_hdr->filetype != MH_KEXT_BUNDLE) {
+ } else if (kpf_hdr->filetype != MH_KEXT_BUNDLE) {
LOG(LOG_FATAL, "Broken build: Invalid kernel patchfinder: Not a kext bundle");
return -1;
} else if (kpf_hdr->cputype != CPU_TYPE_ARM64) {
@@ -112,10 +111,9 @@ int palera1n(int argc, char *argv[]) {
pthread_mutex_init(&ecid_dfu_wait_mutex, NULL);
if ((ret = build_checks())) return ret;
if ((ret = optparse(argc, argv))) goto cleanup;
- if (!checkrain_option_enabled(host_flags, host_option_device_info))
- if (checkrain_option_enabled(host_flags, host_option_palerain_version)) goto normal_exit;
+ if (!checkrain_options_enabled(host_flags, host_option_device_info) && checkrain_options_enabled(host_flags, host_option_palerain_version)) goto normal_exit;
#ifdef TUI
- if (checkrain_option_enabled(host_flags, host_option_tui)) {
+ if (checkrain_options_enabled(host_flags, host_option_tui)) {
ret = tui();
if (ret) goto cleanup;
else goto normal_exit;
@@ -135,7 +133,7 @@ int palera1n(int argc, char *argv[]) {
}
#endif
- if (!checkrain_option_enabled(host_flags, host_option_device_info))
+ if (!checkrain_options_enabled(host_flags, host_option_device_info))
LOG(LOG_INFO, "Waiting for devices");
if (access("/var/run/usbmuxd", F_OK) != 0)
@@ -145,16 +143,16 @@ int palera1n(int argc, char *argv[]) {
pthread_create(&dfuhelper_thread, NULL, dfuhelper, NULL);
pthread_join(dfuhelper_thread, NULL);
set_spin(0);
- if (checkrain_option_enabled(host_flags, host_option_dfuhelper_only) ||
- checkrain_option_enabled(host_flags, host_option_reboot_device) ||
- checkrain_option_enabled(host_flags, host_option_exit_recovery) ||
- checkrain_option_enabled(host_flags, host_option_enter_recovery) ||
- checkrain_option_enabled(host_flags, host_option_device_info) ||
- device_has_booted)
+ if (checkrain_options_enabled(host_flags, host_option_dfuhelper_only |
+ host_option_reboot_device |
+ host_option_exit_recovery |
+ host_option_enter_recovery |
+ host_option_device_info
+ ) || device_has_booted)
goto normal_exit;
if (exec_checkra1n()) goto cleanup;
- if (checkrain_option_enabled(host_flags, host_option_pongo_exit) || checkrain_option_enabled(host_flags, host_option_demote))
+ if (checkrain_options_enabled(host_flags, host_option_pongo_exit | host_option_demote))
goto normal_exit;
set_spin(1);
sleep(2);
diff --git a/src/optparse.c b/src/optparse.c
index acba17d..4e286fc 100644
--- a/src/optparse.c
+++ b/src/optparse.c
@@ -308,7 +308,7 @@ int optparse(int argc, char* argv[]) {
break;
}
}
- if (checkrain_option_enabled(host_flags, host_option_palerain_version)) {
+ if (checkrain_options_enabled(host_flags, host_option_palerain_version)) {
printf(
"palera1n " PALERAIN_VERSION "\n"
BUILD_COMMIT " " BUILD_NUMBER " (" BUILD_BRANCH ")\n\n"
@@ -326,7 +326,7 @@ int optparse(int argc, char* argv[]) {
return 0;
}
- if ((strstr(xargs_cmd, "serial=") != NULL) && !force_use_verbose_boot && checkrain_option_enabled(palerain_flags, palerain_option_setup_rootful)) {
+ if ((strstr(xargs_cmd, "serial=") != NULL) && !force_use_verbose_boot && checkrain_options_enabled(palerain_flags, palerain_option_setup_rootful)) {
kpf_flags &= ~checkrain_option_verbose_boot;
}
@@ -350,17 +350,17 @@ int optparse(int argc, char* argv[]) {
LOG(LOG_VERBOSE4, "overlay override ptr %p -> %p", override_overlay.orig_ptr, **overlay_to_upload);
}
- if (!checkrain_option_enabled(palerain_flags, palerain_option_rootful)) {
- if (checkrain_option_enabled(palerain_flags, palerain_option_setup_rootful) || checkrain_option_enabled(palerain_flags, palerain_option_setup_rootful_forced)) {
+ if (!checkrain_options_enabled(palerain_flags, palerain_option_rootful)) {
+ if (checkrain_options_enabled(palerain_flags, palerain_option_setup_rootful) || checkrain_options_enabled(palerain_flags, palerain_option_setup_rootful_forced)) {
LOG(LOG_FATAL, "Cannot setup rootful when rootless is requested. Use -f to enable rootful mode.");
return -1;
}
}
if (!(
- checkrain_option_enabled(host_flags, host_option_dfuhelper_only) ||
- checkrain_option_enabled(host_flags, host_option_enter_recovery) ||
- checkrain_option_enabled(host_flags, host_option_exit_recovery) ||
- checkrain_option_enabled(host_flags, host_option_reboot_device)))
+ checkrain_options_enabled(host_flags, host_option_dfuhelper_only) ||
+ checkrain_options_enabled(host_flags, host_option_enter_recovery) ||
+ checkrain_options_enabled(host_flags, host_option_exit_recovery) ||
+ checkrain_options_enabled(host_flags, host_option_reboot_device)))
{
#ifdef NO_CHECKRAIN
if (checkra1n_len == 0 && ext_checkra1n == NULL)
@@ -368,7 +368,7 @@ int optparse(int argc, char* argv[]) {
LOG(LOG_FATAL, "checkra1n omitted in build but no override specified");
return -1;
}
- if (!(checkrain_option_enabled(host_flags, host_option_pongo_exit) || checkrain_option_enabled(host_flags, host_option_pongo_exit)))
+ if (!(checkrain_options_enabled(host_flags, host_option_pongo_exit) || checkrain_options_enabled(host_flags, host_option_pongo_exit)))
{
#ifdef NO_KPF
if (checkra1n_kpf_pongo_len == 0)
diff --git a/src/pongo_helper.c b/src/pongo_helper.c
index 727e15d..4ae9269 100644
--- a/src/pongo_helper.c
+++ b/src/pongo_helper.c
@@ -29,15 +29,15 @@ void* pongo_helper(void* ptr) {
return NULL;
}
-void *pongo_usb_callback(void *arg) {
+void *pongo_usb_callback(stuff_t *arg) {
if (get_found_pongo())
return NULL;
set_found_pongo(1);
- if (checkrain_option_enabled(palerain_flags, palerain_option_setup_rootful)) {
+ if (checkrain_options_enabled(palerain_flags, palerain_option_setup_rootful)) {
strncat(xargs_cmd, " wdt=-1", 0x270 - strlen(xargs_cmd) - 1);
}
LOG(LOG_INFO, "Found PongoOS USB Device");
- usb_device_handle_t handle = (((stuff_t *)arg)->handle);
+ usb_device_handle_t handle = arg->handle;
issue_pongo_command(handle, NULL);
issue_pongo_command(handle, "fuse lock");
issue_pongo_command(handle, "sep auto");
@@ -46,7 +46,7 @@ void *pongo_usb_callback(void *arg) {
issue_pongo_command(handle, kpf_flags_cmd);
issue_pongo_command(handle, checkrain_flags_cmd);
issue_pongo_command(handle, palerain_flags_cmd);
- if (checkrain_option_enabled(palerain_flags, palerain_option_rootful))
+ if (checkrain_options_enabled(palerain_flags, palerain_option_rootful))
{
issue_pongo_command(handle, "rootfs");
}
@@ -66,13 +66,13 @@ void *pongo_usb_callback(void *arg) {
issue_pongo_command(handle, "overlay");
}
issue_pongo_command(handle, xargs_cmd);
- if (checkrain_option_enabled(host_flags, host_option_pongo_full)) goto done;
+ if (checkrain_options_enabled(host_flags, host_option_pongo_full)) goto done;
issue_pongo_command(handle, "bootx");
LOG(LOG_INFO, "Booting Kernel...");
- if (checkrain_option_enabled(palerain_flags, palerain_option_setup_partial_root)) {
+ if (checkrain_options_enabled(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, "Once the device boots up to iOS, run again without the -B (Create BindFS) option to jailbreak.");
- } else if (checkrain_option_enabled(palerain_flags, palerain_option_setup_rootful)) {
+ } else if (checkrain_options_enabled(palerain_flags, palerain_option_setup_rootful)) {
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.");
}
@@ -83,7 +83,7 @@ void *pongo_usb_callback(void *arg) {
done:
device_has_booted = true;
#ifdef USE_LIBUSB
- libusb_unref_device(((stuff_t *)arg)->dev);
+ libusb_unref_device(arg->dev);
#endif
set_spin(0);
return NULL;
@@ -163,7 +163,7 @@ int upload_pongo_file(usb_device_handle_t handle, unsigned char *buf, unsigned i
if (verbose < 3 || verbose > 4) {
LOG(LOG_VERBOSE, "Uploaded %llu bytes to PongoOS", (unsigned long long)buf_len);
} else {
- if (checkrain_option_enabled(host_flags, host_option_no_colors))
+ if (checkrain_options_enabled(host_flags, host_option_no_colors))
printf("/send mem:%p:%p\nUploaded %llu bytes]\n", (void*)buf, (void*)(buf + buf_len), (unsigned long long)buf_len);
else
printf("/send mem:%p:%p\n" BCYN "[Uploaded %llu bytes]\n" CRESET, (void*)buf, (void*)(buf + buf_len), (unsigned long long)buf_len);
@@ -176,7 +176,7 @@ int upload_pongo_file(usb_device_handle_t handle, unsigned char *buf, unsigned i
void io_start(stuff_t *stuff)
{
- int r = pthread_create(&stuff->th, NULL, &pongo_usb_callback, stuff);
+ int r = pthread_create(&stuff->th, NULL, (pthread_start_t)pongo_usb_callback, stuff);
if(r != 0)
{
ERR("pthread_create: %s", strerror(r));
From bb9fdde26e9b42e7b8c152d2232e6a8fce949f5c Mon Sep 17 00:00:00 2001
From: Nick Chan
Date: Sat, 22 Apr 2023 22:18:52 +0800
Subject: [PATCH 09/56] Revert "fix harder"
This reverts commit fe565b97add587a8b8b56fa238e14df508d18ca0.
---
.github/workflows/build.yml | 2 --
1 file changed, 2 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 085e3fa..8b07b88 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -258,7 +258,6 @@ jobs:
- name: Build libplist
run: |
cd libplist
- git fetch origin bfc97788f081584ced9cd35d85b69b3fec6b907c
git checkout bfc97788f081584ced9cd35d85b69b3fec6b907c
autoreconf -fiv
./configure ${{ env.CONFIGURE_ARGS }} --without-cython
@@ -682,7 +681,6 @@ jobs:
- name: Build libplist
run: |
cd libplist
- git fetch origin bfc97788f081584ced9cd35d85b69b3fec6b907c
git checkout bfc97788f081584ced9cd35d85b69b3fec6b907c
autoreconf -fiv
./configure ${{ env.CONFIGURE_ARGS }} --without-cython
From 290bcb143e57d4ecccd58dce631e4be8b03b6612 Mon Sep 17 00:00:00 2001
From: Nick Chan
Date: Sat, 22 Apr 2023 22:19:00 +0800
Subject: [PATCH 10/56] Revert "fix: limd-glue FTBFS with latest libplist"
This reverts commit 1422d45a9fd729bde6ed86523cc1c73ad5fab32e.
---
.github/workflows/build.yml | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 8b07b88..a5c1620 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -24,7 +24,7 @@ on:
jobs:
build-docs:
runs-on: ubuntu-latest
- steps:
+ steps:
- name: Checkout
uses: actions/checkout@v3
@@ -258,7 +258,6 @@ jobs:
- name: Build libplist
run: |
cd libplist
- git checkout bfc97788f081584ced9cd35d85b69b3fec6b907c
autoreconf -fiv
./configure ${{ env.CONFIGURE_ARGS }} --without-cython
gmake -j$(sysctl -n hw.ncpu)
@@ -681,7 +680,6 @@ jobs:
- name: Build libplist
run: |
cd libplist
- git checkout bfc97788f081584ced9cd35d85b69b3fec6b907c
autoreconf -fiv
./configure ${{ env.CONFIGURE_ARGS }} --without-cython
make -j$(nproc)
From a3fa59eaa86626497dfc7573a7f5f5504255ef5f Mon Sep 17 00:00:00 2001
From: Nick Chan
Date: Mon, 24 Apr 2023 03:43:25 +0800
Subject: [PATCH 11/56] sneak
---
src/optparse.c | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/src/optparse.c b/src/optparse.c
index 4e286fc..d9692cb 100644
--- a/src/optparse.c
+++ b/src/optparse.c
@@ -19,10 +19,8 @@ checkrain_option_p host_flags_p = &host_flags;
static bool force_use_verbose_boot = false;
static struct option longopts[] = {
-#ifdef ROOTFUL
{"setup-partial-fakefs", no_argument, NULL, 'B'},
{"setup-fakefs", no_argument, NULL, 'c'},
-#endif
{"dfuhelper", no_argument, NULL, 'D'},
{"help", no_argument, NULL, 'h'},
{"pongo-shell", no_argument, NULL, 'p'},
@@ -30,9 +28,7 @@ static struct option longopts[] = {
{"debug-logging", no_argument, NULL, 'v'},
{"verbose-boot", no_argument, NULL, 'V'},
{"boot-args", required_argument, NULL, 'e'},
-#ifdef ROOTFUL
{"fakefs", no_argument, NULL, 'f'},
-#endif
{"rootless", no_argument, NULL, 'l'},
{"jbinit-log-to-file", no_argument, NULL, 'L'},
{"demote", no_argument, NULL, 'd'},
@@ -130,13 +126,10 @@ int optparse(int argc, char* argv[]) {
#ifdef DEV_BUILD
"12"
#endif
-#ifdef ROOTFUL
"fcB"
-#endif
,longopts, NULL)) != -1)
{
switch (opt) {
-#ifdef ROOTFUL
case 'B':
palerain_flags |= palerain_option_setup_partial_root;
palerain_flags |= palerain_option_setup_rootful;
@@ -146,7 +139,6 @@ int optparse(int argc, char* argv[]) {
palerain_flags |= palerain_option_setup_rootful;
kpf_flags |= checkrain_option_verbose_boot;
break;
-#endif
case 'p':
host_flags |= host_option_pongo_exit;
break;
@@ -176,17 +168,13 @@ int optparse(int argc, char* argv[]) {
}
snprintf(xargs_cmd, sizeof(xargs_cmd), "xargs %s", optarg);
break;
-#ifdef ROOTFUL
case 'f':
snprintf(rootfs_cmd, sizeof(rootfs_cmd), "rootfs %s", optarg);
snprintf(dtpatch_cmd, 0x20, "dtpatch %s", optarg);
palerain_flags |= palerain_option_rootful;
break;
-#endif
case 'l':
-#ifdef ROOTFUL
palerain_flags &= ~palerain_option_rootful;
-#endif
break;
case 'L':
palerain_flags |= palerain_option_jbinit_log_to_file;
From 2912dfd8c0bc7c7b70e08eacd322805f60b86851 Mon Sep 17 00:00:00 2001
From: Nick Chan
Date: Tue, 25 Apr 2023 00:11:18 +0800
Subject: [PATCH 12/56] update palera1n.1
---
docs/palera1n.1 | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/docs/palera1n.1 b/docs/palera1n.1
index 777545e..ddbad3c 100644
--- a/docs/palera1n.1
+++ b/docs/palera1n.1
@@ -311,10 +311,7 @@ may crash if the machine it is running on:
.Pp
The exploit may also work less reliably on some hosts, like AMD desktops, or some MediaTek devices.
.Pp
-.Fl B , -setup-fakefs-partial
-does not work on iOS 16.
-.Pp
-The device may randomly crash and reboot due to launchd receiving signal 7 (SIGEMT).
+The device may randomly crash and reboot due to launchd exiting with code 7.
.Sh NOTES
.Nm
injects a dylib into launchd to allow the
From 9c094fc19f9f77d815c7e79f2169d78526ee9d6a Mon Sep 17 00:00:00 2001
From: Nick Chan
Date: Tue, 25 Apr 2023 02:00:00 +0800
Subject: [PATCH 13/56] fix some compiler warnings
---
src/devhelper.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/devhelper.c b/src/devhelper.c
index 913d276..e05075f 100644
--- a/src/devhelper.c
+++ b/src/devhelper.c
@@ -87,16 +87,16 @@ bool cpid_is_arm64(unsigned int cpid) {
int subscribe_cmd(usbmuxd_event_cb_t device_event_cb, irecv_device_event_cb_t irecv_event_cb)
{
int ret;
- if (ret = usbmuxd_events_subscribe(&usbmuxdctx, device_event_cb, NULL)) return ret;
- if (ret = irecv_device_event_subscribe(&irecvctx, irecv_event_cb, NULL)) return ret;
+ if ((ret = usbmuxd_events_subscribe(&usbmuxdctx, device_event_cb, NULL))) return ret;
+ if ((ret = irecv_device_event_subscribe(&irecvctx, irecv_event_cb, NULL))) return ret;
return 0;
}
int unsubscribe_cmd(void)
{
int ret;
- if (ret = usbmuxd_events_unsubscribe(usbmuxdctx)) return ret;
- if (ret = irecv_device_event_unsubscribe(irecvctx)) return ret;
+ if ((ret = usbmuxd_events_unsubscribe(usbmuxdctx))) return ret;
+ if ((ret = irecv_device_event_unsubscribe(irecvctx))) return ret;
irecvctx = NULL;
usbmuxdctx = NULL;
return 0;
From 5ea32377721b5109b9d38d06f23df72c8c14d916 Mon Sep 17 00:00:00 2001
From: Nick Chan
Date: Wed, 26 Apr 2023 14:07:26 +0800
Subject: [PATCH 14/56] update credits
---
src/credits.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/credits.c b/src/credits.c
index 17eed30..16eb606 100644
--- a/src/credits.c
+++ b/src/credits.c
@@ -1,7 +1,7 @@
#include
#ifndef BAKERAIN_DEVELOPE_R
-#define BAKERAIN_DEVELOPE_R "dora2ios"
+#define BAKERAIN_DEVELOPE_R "kok3shidoll"
#endif
#define THE_PLUSH "Ploosh"
@@ -12,8 +12,8 @@
#define B stderr
#define L ,
#define E "# == palera1n-c == \n#\n"
-#define M "# Made by: Nick Chan, " THE_PLUSH ", Mineek, Nebula, llsc12\n#\n"
-#define A "# Thanks to: " BAKERAIN_DEVELOPE_R ", pythonplayer, tihmstar, nikias\n"
+#define M "# Made by: Nick Chan, " THE_PLUSH ", Samara, Nebula, staturnz, " BAKERAIN_DEVELOPE_R " \n#\n"
+#define A "# Thanks to: pythonplayer123, llsc12, Mineek, tihmstar, nikias\n"
#define K "# (libimobiledevice), checkra1n team (Siguza, axi0mx, littlelailo\n"
#define I "# et al.), Procursus Team (Hayden Seay, Cameron Katri, Keto et.al)\n\n"
#define N )
From 24a09bc44dfaf869e10c4cdf98a4573a2bb18be6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E3=81=AD=E3=82=80=E3=81=84?=
<69592455+kok3shidoll@users.noreply.github.com>
Date: Thu, 27 Apr 2023 15:57:30 +0900
Subject: [PATCH 15/56] Update readme: apple silicon macs
---
README.md | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/README.md b/README.md
index b682940..7945e85 100644
--- a/README.md
+++ b/README.md
@@ -41,6 +41,10 @@ If you need an older v2.0.0 beta, please get it [here](https://github.com/palera
- 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 USBHub.
# Need help?
From 388ae6f2964ecede68c7f95cad30c424b874a85a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E3=81=AD=E3=82=80=E3=81=84?=
<69592455+kok3shidoll@users.noreply.github.com>
Date: Thu, 27 Apr 2023 15:57:42 +0900
Subject: [PATCH 16/56] update palera1n.1: PongoOS url
---
docs/palera1n.1 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/palera1n.1 b/docs/palera1n.1
index ddbad3c..a4387f1 100644
--- a/docs/palera1n.1
+++ b/docs/palera1n.1
@@ -143,7 +143,7 @@ Override the kernel patchfinder PongoOS module. The module is required to suppor
root filesystem in paleinfo with
.Em rootfs
command. If in doubt, use
-.Sy https://github.com/guacaplushy/PongoOS
+.Sy https://github.com/palera1n/PongoOS
iOS15 branch or your own fork of it.
.It Fl l , -rootless
Proceed in rootless mode, this is the default when neither
From 627f9b3363b68be024862bc3fd858cca47e10bbc Mon Sep 17 00:00:00 2001
From: Nick Chan
Date: Thu, 27 Apr 2023 23:10:28 +0800
Subject: [PATCH 17/56] reserved kerninfo values
---
include/kerninfo.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/kerninfo.h b/include/kerninfo.h
index b3979dd..d35b006 100644
--- a/include/kerninfo.h
+++ b/include/kerninfo.h
@@ -61,6 +61,10 @@
#define palerain_option_setup_partial_root (1 << 4) /* fakefs creating should be partial */
#define palerain_option_checkrain_is_clone (1 << 5) /* supplied checkra1n is checkra1n clone */
#define palerain_option_rootless_livefs (1 << 6) /* mount root livefs on rootless */
+/* reserved values */
+// #define palerain_option_no_ssv (1 << 7) /* no signed system volume */
+// #define palerain_option_force_fakefs (1 << 8) /* force fakefs, even without SSV */
+// #define palerain_option_rootless (1 << 9) /* rootless jailbreak */
#ifdef DEV_BUILD
#define palerain_option_test1 (1 << 29)
From 1c3613c669135aa79d630d82ffe102b83345f74b Mon Sep 17 00:00:00 2001
From: Tom E
Date: Thu, 27 Apr 2023 16:29:23 -0400
Subject: [PATCH 18/56] Fix the A9 and lower restart bug.
---
src/exec_checkra1n.c | 6 ++-
src/usb_libusb.c | 102 +++++++++++++++++++++----------------------
2 files changed, 55 insertions(+), 53 deletions(-)
diff --git a/src/exec_checkra1n.c b/src/exec_checkra1n.c
index 64962a6..abc3b5d 100644
--- a/src/exec_checkra1n.c
+++ b/src/exec_checkra1n.c
@@ -1,3 +1,7 @@
+#ifdef __gnu_linux__
+#define _GNU_SOURCE
+#endif
+
#include
#include
#include
@@ -158,7 +162,7 @@ checkra1n_exec: {};
return -1;
}
LOG(LOG_VERBOSE2, "%s spawned successfully", checkra1n_path);
- sleep(2);
+
if (ext_checkra1n == NULL) {
unlink(checkra1n_path);
free(checkra1n_path);
diff --git a/src/usb_libusb.c b/src/usb_libusb.c
index 7653878..1e8469e 100644
--- a/src/usb_libusb.c
+++ b/src/usb_libusb.c
@@ -114,12 +114,12 @@ usb_ret_t USBBulkUpload(usb_device_handle_t handle, void *data, int len)
static int FoundDevice(libusb_context *ctx, libusb_device *dev, libusb_hotplug_event event, void *arg)
{
- LOG(LOG_VERBOSE, "PongoOS USB Device connected");
stuff_t *stuff = arg;
if(stuff->handle)
{
return LIBUSB_SUCCESS;
}
+ LOG(LOG_VERBOSE, "PongoOS USB Device connected");
libusb_device_handle *handle;
int r = libusb_open(dev, &handle);
@@ -162,12 +162,12 @@ static int FoundDevice(libusb_context *ctx, libusb_device *dev, libusb_hotplug_e
static int LostDevice(libusb_context *ctx, libusb_device *dev, libusb_hotplug_event event, void *arg)
{
- LOG(LOG_VERBOSE, "PongoOS USB Device disconnected");
stuff_t *stuff = arg;
if(stuff->dev != dev)
{
return LIBUSB_SUCCESS;
}
+ LOG(LOG_VERBOSE, "PongoOS USB Device disconnected");
io_stop(stuff);
libusb_close(stuff->handle);
@@ -198,14 +198,6 @@ int wait_for_pongo(void)
return -1;
}
- r = libusb_hotplug_register_callback(ctx, LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED, 0, PONGO_USB_VENDOR, PONGO_USB_PRODUCT, LIBUSB_HOTPLUG_MATCH_ANY, FoundDevice, &stuff, &hp[0]);
- if(r != LIBUSB_SUCCESS)
- {
- ERR("libusb_hotplug: %s", libusb_error_name(r));
- libusb_exit(ctx);
- return -1;
- }
-
r = libusb_hotplug_register_callback(ctx, LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT, 0, PONGO_USB_VENDOR, PONGO_USB_PRODUCT, LIBUSB_HOTPLUG_MATCH_ANY, LostDevice, &stuff, &hp[1]);
if(r != LIBUSB_SUCCESS)
{
@@ -214,55 +206,61 @@ int wait_for_pongo(void)
return -1;
}
- libusb_device **list;
- ssize_t sz = libusb_get_device_list(ctx, &list);
- if(sz < 0)
- {
- ERR("libusb_get_device_list: %s", libusb_error_name((int)sz));
- libusb_exit(ctx);
- return -1;
- }
-
- for(ssize_t i = 0; i < sz; ++i)
- {
- struct libusb_device_descriptor desc;
- r = libusb_get_device_descriptor(list[i], &desc);
- if(r != LIBUSB_SUCCESS)
- {
- ERR("libusb_get_device_descriptor: %s", libusb_error_name(r));
- // continue anyway
- }
- if(desc.idVendor != PONGO_USB_VENDOR || desc.idProduct != PONGO_USB_PRODUCT)
- {
- libusb_unref_device(list[i]);
- continue;
- }
- r = FoundDevice(ctx, list[i], LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED, &stuff);
- for(ssize_t j = i + 1; j < sz; ++j)
- {
- libusb_unref_device(list[j]);
- }
- if(r != LIBUSB_SUCCESS)
- {
- libusb_free_device_list(list, 0);
- libusb_exit(ctx);
- return -1;
- }
- break;
- }
- libusb_free_device_list(list, 0);
-
- while(get_spin())
- {
+ while (1) {
r = libusb_handle_events(ctx);
if(r != LIBUSB_SUCCESS)
{
ERR("libusb_handle_events: %s", libusb_error_name(r));
break;
}
+
+ libusb_device **list;
+ ssize_t sz = libusb_get_device_list(ctx, &list);
+ bool done = false;
+ if(sz < 0)
+ {
+ ERR("libusb_get_device_list: %s", libusb_error_name((int)sz));
+ libusb_exit(ctx);
+ return -1;
+ }
+
+ for(ssize_t i = 0; i < sz; ++i)
+ {
+ struct libusb_device_descriptor desc;
+ r = libusb_get_device_descriptor(list[i], &desc);
+ if(r != LIBUSB_SUCCESS)
+ {
+ ERR("libusb_get_device_descriptor: %s", libusb_error_name(r));
+ // continue anyway
+ }
+ if(desc.idVendor != PONGO_USB_VENDOR || desc.idProduct != PONGO_USB_PRODUCT)
+ {
+ libusb_unref_device(list[i]);
+ continue;
+ }
+ r = FoundDevice(ctx, list[i], LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED, &stuff);
+ for (ssize_t j = i; j < sz; ++j) {
+ libusb_unref_device(list[j]);
+ }
+
+ if(r != LIBUSB_SUCCESS)
+ {
+ libusb_free_device_list(list, 0);
+ libusb_exit(ctx);
+ return -1;
+ } else {
+ done = true;
+ }
+ break;
+ }
+
+ libusb_free_device_list(list, 0);
+
+ if (done) goto end;
}
- libusb_exit(ctx);
- return 0;
+ end:
+ libusb_exit(ctx);
+ return 0;
}
#endif
From 1abfdf54414c94cecb01a754826d17ef47c17bbe Mon Sep 17 00:00:00 2001
From: Tom E
Date: Thu, 27 Apr 2023 17:34:19 -0400
Subject: [PATCH 19/56] might or might not have accidentally deleted this
---
src/exec_checkra1n.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/exec_checkra1n.c b/src/exec_checkra1n.c
index abc3b5d..60fcf2f 100644
--- a/src/exec_checkra1n.c
+++ b/src/exec_checkra1n.c
@@ -162,7 +162,7 @@ checkra1n_exec: {};
return -1;
}
LOG(LOG_VERBOSE2, "%s spawned successfully", checkra1n_path);
-
+ sleep(2);
if (ext_checkra1n == NULL) {
unlink(checkra1n_path);
free(checkra1n_path);
From f3920b883d49d2dab6a48eb59981b41b5e6880e6 Mon Sep 17 00:00:00 2001
From: Nick Chan
Date: Fri, 28 Apr 2023 11:08:34 +0800
Subject: [PATCH 20/56] remove _GNU_SOURCE
---
src/exec_checkra1n.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/src/exec_checkra1n.c b/src/exec_checkra1n.c
index 60fcf2f..64962a6 100644
--- a/src/exec_checkra1n.c
+++ b/src/exec_checkra1n.c
@@ -1,7 +1,3 @@
-#ifdef __gnu_linux__
-#define _GNU_SOURCE
-#endif
-
#include
#include
#include
From d17af1fbc7efc7d525f1be7fd448fd158cb65251 Mon Sep 17 00:00:00 2001
From: 0x6ff
Date: Sat, 29 Apr 2023 17:48:34 +0100
Subject: [PATCH 21/56] chore: fix inconsistencies inside control files for
.deb creation (#388)
* chore: fix inconsistency
* chore: fix inconsistency 2
---
packaging/control | 2 +-
packaging/control.macosx | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/packaging/control b/packaging/control
index 2a2bd58..0f67cf4 100644
--- a/packaging/control
+++ b/packaging/control
@@ -9,7 +9,7 @@ Section: Utilities
Priority: optional
Homepage: https://palera.in
Description: iOS 15.0-16.4.1 semi-tethered checkm8 jailbreak
- palera1n is an iOS/iPadOS 15.0-15.3.1 semi tethered jailbreak
+ palera1n is an iOS/iPadOS 15.0-16.4.1 semi tethered jailbreak
based on the checkm8 exploit.
.
palera1n is able to jailbreak the device in fakefs-rootful mode,
diff --git a/packaging/control.macosx b/packaging/control.macosx
index 022c8ce..417a8dd 100644
--- a/packaging/control.macosx
+++ b/packaging/control.macosx
@@ -8,7 +8,7 @@ Section: Utilities
Priority: optional
Homepage: https://palera.in
Description: iOS 15.0-16.4.1 semi-tethered checkm8 jailbreak
- palera1n is an iOS/iPadOS 15.0-15.3.1 semi tethered jailbreak
+ palera1n is an iOS/iPadOS 15.0-16.4.1 semi tethered jailbreak
based on the checkm8 exploit.
.
palera1n is able to jailbreak the device in fakefs-rootful mode,
From 9e253f98f419c42365f81fb6055a7ffc4118bce7 Mon Sep 17 00:00:00 2001
From: Nick Chan
Date: Sun, 30 Apr 2023 01:08:33 +0800
Subject: [PATCH 22/56] -D_XOPEN_SOURCE=500
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 8a6df89..2da55e4 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@ SRC = $(shell pwd)
DEP = $(SRC)/dep_root
STRIP = strip
CC ?= cc
-CFLAGS += -I$(DEP)/include -I$(SRC)/include -I$(SRC)
+CFLAGS += -I$(DEP)/include -I$(SRC)/include -I$(SRC) -D_XOPEN_SOURCE=500
CFLAGS += -Wall -Wextra -Wno-unused-parameter -DPALERAIN_VERSION=\"2.0.0\"
CFLAGS += -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
From 5f8b503ae3dd95c8cdf8e7a6289cdea58d63c944 Mon Sep 17 00:00:00 2001
From: Nick Chan
Date: Sun, 30 Apr 2023 01:20:39 +0800
Subject: [PATCH 23/56] skill issue
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 2da55e4..fa951df 100644
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,7 @@ CFLAGS += -I$(DEP)/include -I$(SRC)/include -I$(SRC) -D_XOPEN_SOURCE=500
CFLAGS += -Wall -Wextra -Wno-unused-parameter -DPALERAIN_VERSION=\"2.0.0\"
CFLAGS += -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-glue-1.0.a $(DEP)/lib/libplist-2.0.a -pthread
+LIBS += $(DEP)/lib/libimobiledevice-glue-1.0.a $(DEP)/lib/libplist-2.0.a -pthread -lm
ifeq ($(TARGET_OS),)
TARGET_OS = $(shell uname -s)
endif
From 0a0410d506a5260c3606ebfe8e9dad85189b9c71 Mon Sep 17 00:00:00 2001
From: Nick Chan
Date: Mon, 1 May 2023 01:20:11 +0800
Subject: [PATCH 24/56] -C, --clean-fakefs
---
docs/palera1n.1 | 10 ++++++++++
include/kerninfo.h | 1 +
src/optparse.c | 9 +++++++--
3 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/docs/palera1n.1 b/docs/palera1n.1
index a4387f1..703c6c4 100644
--- a/docs/palera1n.1
+++ b/docs/palera1n.1
@@ -113,6 +113,16 @@ This option currently does not work on iOS 16.
When used with
.Fl f , -fakefs ,
creates the new APFS volume required for rootful. Will fail if one already exists.
+.It Fl C , -clean-fakefs
+This reverts the fakefs to the
+.Em orig-fs
+snapshot that is created when the fakefs
+is first created, then the device will continue to boot jailbroken. This option
+allows resetting the rootful environment without deleting the entire fakefs.
+Note that this option will not work if the fakefs is created in an older version
+of palera1n that does not create the
+.Em orig-fs
+snapshot on the fakefs.
.It Fl d , -demote
Set the effective production fuse to 0, so as to enable hardware debugging features.
.It Fl D , -dfuhelper
diff --git a/include/kerninfo.h b/include/kerninfo.h
index d35b006..60c6f41 100644
--- a/include/kerninfo.h
+++ b/include/kerninfo.h
@@ -65,6 +65,7 @@
// #define palerain_option_no_ssv (1 << 7) /* no signed system volume */
// #define palerain_option_force_fakefs (1 << 8) /* force fakefs, even without SSV */
// #define palerain_option_rootless (1 << 9) /* rootless jailbreak */
+#define palerain_option_clean_fakefs (1 << 10) /* clean fakefs, but does not delete it */
#ifdef DEV_BUILD
#define palerain_option_test1 (1 << 29)
diff --git a/src/optparse.c b/src/optparse.c
index d9692cb..ad13d64 100644
--- a/src/optparse.c
+++ b/src/optparse.c
@@ -21,6 +21,7 @@ static bool force_use_verbose_boot = false;
static struct option longopts[] = {
{"setup-partial-fakefs", no_argument, NULL, 'B'},
{"setup-fakefs", no_argument, NULL, 'c'},
+ {"clean-fakefs", no_argument, NULL, 'c'},
{"dfuhelper", no_argument, NULL, 'D'},
{"help", no_argument, NULL, 'h'},
{"pongo-shell", no_argument, NULL, 'p'},
@@ -64,7 +65,7 @@ static int usage(int e, char* prog_name)
"12"
#endif
#ifdef ROOTFUL
- "cfB"
+ "cCfB"
#endif
#ifdef TUI
"t"
@@ -81,6 +82,7 @@ static int usage(int e, char* prog_name)
#ifdef ROOTFUL
"\t-B, --setup-partial-fakefs\t\tSetup partial fakefs\n"
"\t-c, --setup-fakefs\t\t\tSetup fakefs\n"
+ "\t-C, --clean-fakefs\t\t\tClean fakefs\n"
#endif
"\t-d, --demote\t\t\t\tDemote\n"
"\t-D, --dfuhelper\t\t\t\tExit after entering DFU\n"
@@ -126,7 +128,7 @@ int optparse(int argc, char* argv[]) {
#ifdef DEV_BUILD
"12"
#endif
- "fcB"
+ "fCcB"
,longopts, NULL)) != -1)
{
switch (opt) {
@@ -139,6 +141,9 @@ int optparse(int argc, char* argv[]) {
palerain_flags |= palerain_option_setup_rootful;
kpf_flags |= checkrain_option_verbose_boot;
break;
+ case 'C':
+ palerain_flags |= palerain_option_clean_fakefs;
+ break;
case 'p':
host_flags |= host_option_pongo_exit;
break;
From 1ca25ceca84ffa61ded3723dfd45a53eb61dcdcd Mon Sep 17 00:00:00 2001
From: Nick Chan
Date: Mon, 1 May 2023 01:28:59 +0800
Subject: [PATCH 25/56] clarify about clean fakefs and /var
---
docs/palera1n.1 | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/docs/palera1n.1 b/docs/palera1n.1
index 703c6c4..3f7326a 100644
--- a/docs/palera1n.1
+++ b/docs/palera1n.1
@@ -106,7 +106,7 @@ is not supported when this option is used together with
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
+parts in rarely-written paths. When jailbreaking 16 GB devices, this option must be usedqq
when setting up fakefs for rootful, as they do not have enough storage for full fakefs.
This option currently does not work on iOS 16.
.It Fl c , -setup-fakefs
@@ -122,7 +122,9 @@ allows resetting the rootful environment without deleting the entire fakefs.
Note that this option will not work if the fakefs is created in an older version
of palera1n that does not create the
.Em orig-fs
-snapshot on the fakefs.
+snapshot on the fakefs. This option will also remove some jailbreak files inside
+of /var. The files in /var will not be deleted when a userspace reboot is done
+with this flag set.
.It Fl d , -demote
Set the effective production fuse to 0, so as to enable hardware debugging features.
.It Fl D , -dfuhelper
From f59ef6dceec7c30437811310f6fdfc55713350ff Mon Sep 17 00:00:00 2001
From: Nick Chan
Date: Mon, 1 May 2023 01:31:05 +0800
Subject: [PATCH 26/56] 0xallie [palera1n/palera1n] New comment on commit
1ca25ce usedqq
---
docs/palera1n.1 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/palera1n.1 b/docs/palera1n.1
index 3f7326a..e9e4cbd 100644
--- a/docs/palera1n.1
+++ b/docs/palera1n.1
@@ -106,7 +106,7 @@ is not supported when this option is used together with
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 usedqq
+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 option currently does not work on iOS 16.
.It Fl c , -setup-fakefs
From 8edc991786131aa47d6bde381920158fe225cf01 Mon Sep 17 00:00:00 2001
From: Nebula
Date: Sun, 14 May 2023 20:09:06 -0400
Subject: [PATCH 27/56] ci: add Discord build message
---
.github/workflows/build.yml | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index a5c1620..0c4ce1a 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -353,7 +353,7 @@ jobs:
name: palera1n-${{ matrix.os }}-${{ matrix.arch }}.dSYM
path: palera1n-${{ matrix.os }}-${{ matrix.arch }}.dSYM
retention-days: 1
-
+
darwin-dist:
if: ${{ github.event_name != 'pull_request' }}
runs-on: macos-latest
@@ -783,3 +783,15 @@ jobs:
dryRun: false
localDir: 'ready/'
remoteDir: '/palera1n/artifacts/c-rewrite'
+
+ discord-alert:
+ runs-on: ubuntu-latest
+ if: ${{ always() && contains(join(needs.*.result, ','), 'success') }}
+ needs: [build-docs, build-darwin, darwin-dist, build-Linux]
+ steps:
+ - name: Send Discord build message
+ if: github.ref == 'refs/heads/master'
+ run: |
+ COMMITMESSAGE=`git log --pretty=format:'- \`%h\` %s' -5 --reverse` &&
+ (curl "${{ secrets.DISCORD_WEBHOOK }}" -sS -H "Content-Type:application/json" -X POST -d "{\"content\":null,\"embeds\":[{\"title\":\"Build $BUILD\",\"description\":\"**Branch:** $BRANCH_NAME\\n**Changes:**\\n$COMMITMESSAGE\",\"url\":\"https://github.com/palera1n/palera1n/actions/runs/$GITHUB_RUN_ID\",\"color\":1487872,\"fields\":[{\"name\":\"Artifacts:\",\"value\":\"- [palera1n-ios](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-ios)\n- [palera1n-linux-arm64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-arm64)\n- [palera1n-linux-armel](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-armel)\n- [palera1n-linux-x86](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86)\n- [palera1n-linux-x86_64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86_64)\n- [palera1n-macos-universal](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-macos-universal)\n- [palera1n.1](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n.1.html)\"}],\"footer\":{\"text\":\"https://github.com/palera1n/palera1n\"},\"thumbnail\":{\"url\":\"https://github.com/palera1n.png\"}}],\"username\":\"Github Actions\",\"avatar_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}")
+
\ No newline at end of file
From 67ca5a9d2439fb1621b241122c0fa8847355394c Mon Sep 17 00:00:00 2001
From: Nebula
Date: Sun, 14 May 2023 20:11:12 -0400
Subject: [PATCH 28/56] ci: do not trigger discord alert on PR
---
.github/workflows/build.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 0c4ce1a..93066ea 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -786,7 +786,7 @@ jobs:
discord-alert:
runs-on: ubuntu-latest
- if: ${{ always() && contains(join(needs.*.result, ','), 'success') }}
+ if: ${{ github.event_name != 'pull_request' }}
needs: [build-docs, build-darwin, darwin-dist, build-Linux]
steps:
- name: Send Discord build message
From c35d19980914c6532760a737d1af05d06b852c8f Mon Sep 17 00:00:00 2001
From: Nebula
Date: Sun, 14 May 2023 21:04:38 -0400
Subject: [PATCH 29/56] ci: Discord build message improvements
---
.github/workflows/build.yml | 27 ++++++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 93066ea..3111a0c 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -24,7 +24,7 @@ on:
jobs:
build-docs:
runs-on: ubuntu-latest
- steps:
+ steps:
- name: Checkout
uses: actions/checkout@v3
@@ -461,6 +461,15 @@ jobs:
dpkg-deb -Zzstd -b stage palera1n_iphoneos-arm64.deb
mv palera1n*.deb ready/
rm -rf stage
+
+ - name: Save build tag
+ run: echo "$(git describe --dirty --tags --abbrev=7 | sed 's|-dirty||')" > build-tag.txt
+
+ - name: Upload build tag
+ uses: actions/upload-artifact@v3
+ with:
+ name: build-tag
+ path: build-tag.txt
- name: Upload artifact
if: ${{ github.event_name != 'pull_request' }}
@@ -789,9 +798,21 @@ jobs:
if: ${{ github.event_name != 'pull_request' }}
needs: [build-docs, build-darwin, darwin-dist, build-Linux]
steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+
+ - name: Get branch name
+ uses: nelonoel/branch-name@v1.0.1
+
+ - name: Download build tag
+ uses: actions/download-artifact@v3
+ with:
+ name: build-tag
+
- name: Send Discord build message
if: github.ref == 'refs/heads/master'
run: |
- COMMITMESSAGE=`git log --pretty=format:'- \`%h\` %s' -5 --reverse` &&
- (curl "${{ secrets.DISCORD_WEBHOOK }}" -sS -H "Content-Type:application/json" -X POST -d "{\"content\":null,\"embeds\":[{\"title\":\"Build $BUILD\",\"description\":\"**Branch:** $BRANCH_NAME\\n**Changes:**\\n$COMMITMESSAGE\",\"url\":\"https://github.com/palera1n/palera1n/actions/runs/$GITHUB_RUN_ID\",\"color\":1487872,\"fields\":[{\"name\":\"Artifacts:\",\"value\":\"- [palera1n-ios](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-ios)\n- [palera1n-linux-arm64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-arm64)\n- [palera1n-linux-armel](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-armel)\n- [palera1n-linux-x86](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86)\n- [palera1n-linux-x86_64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86_64)\n- [palera1n-macos-universal](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-macos-universal)\n- [palera1n.1](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n.1.html)\"}],\"footer\":{\"text\":\"https://github.com/palera1n/palera1n\"},\"thumbnail\":{\"url\":\"https://github.com/palera1n.png\"}}],\"username\":\"Github Actions\",\"avatar_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}")
+ echo "${{ github.event.repository.updated_at}}"
+ COMMITMESSAGE=`git log --pretty=format:'- \`%h\` %s' -1 --reverse` &&
+ (curl "${{ secrets.DISCORD_WEBHOOK }}" -sS -H "Content-Type:application/json" -X POST -d "{\"content\":null,\"embeds\":[{\"title\":\"Nightly Build ${BUILD}\",\"url\":\"https://github.com/palera1n/palera1n/actions/runs/${GITHUB_RUN_ID}\",\"color\":1487872,\"fields\":[{\"name\":\"Build tag:\",\"value\":\"- \`$(cat build-tag.txt | sed 's|\n||')\`\"},{\"name\":\"Branch:\",\"value\":\"- \`${BRANCH_NAME}\`\"},{\"name\":\"Changes:\",\"value\":\"$(echo $COMMITMESSAGE | awk '{printf "%s\\n", $0}')\"},{\"name\":\"Artifacts:\",\"value\":\"- [palera1n-ios](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-ios)\n- [palera1n-linux-arm64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-arm64)\n- [palera1n-linux-armel](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-armel)\n- [palera1n-linux-x86](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86)\n- [palera1n-linux-x86_64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86_64)\n- [palera1n-macos-universal](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-macos-universal)\n- [palera1n.1](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n.1.html)\"}],\"footer\":{\"text\":\"palera1n/palera1n\", \"icon_url\": \"https://media.discordapp.net/attachments/1054239098006683688/1107471339176071288/palera1n_ios_copy.png?width=1208&height=1208\"},\"thumbnail\":{\"url\":\"https://github.com/palera1n.png\"}}],\"username\":\"GitHub Actions\",\"avatar_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}")
\ No newline at end of file
From 3c6213774b500043cb2243673de02c9a953e4a7e Mon Sep 17 00:00:00 2001
From: Nebula
Date: Sun, 14 May 2023 21:15:28 -0400
Subject: [PATCH 30/56] ci: hate
---
.github/workflows/build.yml | 1 -
1 file changed, 1 deletion(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 3111a0c..513650f 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -810,7 +810,6 @@ jobs:
name: build-tag
- name: Send Discord build message
- if: github.ref == 'refs/heads/master'
run: |
echo "${{ github.event.repository.updated_at}}"
COMMITMESSAGE=`git log --pretty=format:'- \`%h\` %s' -1 --reverse` &&
From 88185b7a88ff56f7cbe66a00a7e979d8b8a4e917 Mon Sep 17 00:00:00 2001
From: Nebula
Date: Sun, 14 May 2023 21:27:03 -0400
Subject: [PATCH 31/56] ci: add timestamp to discord alert
---
.github/workflows/build.yml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 513650f..8948cdc 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -811,7 +811,6 @@ jobs:
- name: Send Discord build message
run: |
- echo "${{ github.event.repository.updated_at}}"
COMMITMESSAGE=`git log --pretty=format:'- \`%h\` %s' -1 --reverse` &&
- (curl "${{ secrets.DISCORD_WEBHOOK }}" -sS -H "Content-Type:application/json" -X POST -d "{\"content\":null,\"embeds\":[{\"title\":\"Nightly Build ${BUILD}\",\"url\":\"https://github.com/palera1n/palera1n/actions/runs/${GITHUB_RUN_ID}\",\"color\":1487872,\"fields\":[{\"name\":\"Build tag:\",\"value\":\"- \`$(cat build-tag.txt | sed 's|\n||')\`\"},{\"name\":\"Branch:\",\"value\":\"- \`${BRANCH_NAME}\`\"},{\"name\":\"Changes:\",\"value\":\"$(echo $COMMITMESSAGE | awk '{printf "%s\\n", $0}')\"},{\"name\":\"Artifacts:\",\"value\":\"- [palera1n-ios](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-ios)\n- [palera1n-linux-arm64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-arm64)\n- [palera1n-linux-armel](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-armel)\n- [palera1n-linux-x86](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86)\n- [palera1n-linux-x86_64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86_64)\n- [palera1n-macos-universal](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-macos-universal)\n- [palera1n.1](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n.1.html)\"}],\"footer\":{\"text\":\"palera1n/palera1n\", \"icon_url\": \"https://media.discordapp.net/attachments/1054239098006683688/1107471339176071288/palera1n_ios_copy.png?width=1208&height=1208\"},\"thumbnail\":{\"url\":\"https://github.com/palera1n.png\"}}],\"username\":\"GitHub Actions\",\"avatar_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}")
+ (curl "${{ secrets.DISCORD_WEBHOOK }}" -sS -H "Content-Type:application/json" -X POST -d "{\"content\":null,\"embeds\":[{\"title\":\"Nightly Build ${BUILD}\",\"url\":\"https://github.com/palera1n/palera1n/actions/runs/${GITHUB_RUN_ID}\",\"color\":1487872,\"fields\":[{\"name\":\"Build tag:\",\"value\":\"- \`$(cat build-tag.txt | sed 's|\n||')\`\"},{\"name\":\"Branch:\",\"value\":\"- \`${BRANCH_NAME}\`\"},{\"name\":\"Changes:\",\"value\":\"$(echo $COMMITMESSAGE | awk '{printf "%s\\n", $0}')\"},{\"name\":\"Artifacts:\",\"value\":\"- [palera1n-ios](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-ios)\n- [palera1n-linux-arm64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-arm64)\n- [palera1n-linux-armel](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-armel)\n- [palera1n-linux-x86](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86)\n- [palera1n-linux-x86_64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86_64)\n- [palera1n-macos-universal](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-macos-universal)\n- [palera1n.1](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n.1.html)\"}],\"footer\":{\"text\":\"palera1n/palera1n\", \"icon_url\": \"https://media.discordapp.net/attachments/1054239098006683688/1107471339176071288/palera1n_ios_copy.png?width=1208&height=1208\",\"timestamp\":\"$(date +'%Y-%m-%dT%H:%M:%S')\"},\"thumbnail\":{\"url\":\"https://github.com/palera1n.png\"}}],\"username\":\"GitHub Actions\",\"avatar_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}")
\ No newline at end of file
From 963fbb6ed86cd3410970071e918c74e45b657611 Mon Sep 17 00:00:00 2001
From: Nebula
Date: Sun, 14 May 2023 21:29:59 -0400
Subject: [PATCH 32/56] ci: other discord alert changes
---
.github/workflows/build.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 8948cdc..8c0db9c 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -812,5 +812,5 @@ jobs:
- name: Send Discord build message
run: |
COMMITMESSAGE=`git log --pretty=format:'- \`%h\` %s' -1 --reverse` &&
- (curl "${{ secrets.DISCORD_WEBHOOK }}" -sS -H "Content-Type:application/json" -X POST -d "{\"content\":null,\"embeds\":[{\"title\":\"Nightly Build ${BUILD}\",\"url\":\"https://github.com/palera1n/palera1n/actions/runs/${GITHUB_RUN_ID}\",\"color\":1487872,\"fields\":[{\"name\":\"Build tag:\",\"value\":\"- \`$(cat build-tag.txt | sed 's|\n||')\`\"},{\"name\":\"Branch:\",\"value\":\"- \`${BRANCH_NAME}\`\"},{\"name\":\"Changes:\",\"value\":\"$(echo $COMMITMESSAGE | awk '{printf "%s\\n", $0}')\"},{\"name\":\"Artifacts:\",\"value\":\"- [palera1n-ios](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-ios)\n- [palera1n-linux-arm64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-arm64)\n- [palera1n-linux-armel](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-armel)\n- [palera1n-linux-x86](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86)\n- [palera1n-linux-x86_64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86_64)\n- [palera1n-macos-universal](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-macos-universal)\n- [palera1n.1](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n.1.html)\"}],\"footer\":{\"text\":\"palera1n/palera1n\", \"icon_url\": \"https://media.discordapp.net/attachments/1054239098006683688/1107471339176071288/palera1n_ios_copy.png?width=1208&height=1208\",\"timestamp\":\"$(date +'%Y-%m-%dT%H:%M:%S')\"},\"thumbnail\":{\"url\":\"https://github.com/palera1n.png\"}}],\"username\":\"GitHub Actions\",\"avatar_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}")
+ (curl "${{ secrets.DISCORD_WEBHOOK }}" -sS -H "Content-Type:application/json" -X POST -d "{\"content\":null,\"embeds\":[{\"title\":\"Nightly Build ${{ github.run_number }}\",\"url\":\"https://github.com/palera1n/palera1n/actions/runs/${GITHUB_RUN_ID}\",\"color\":1487872,\"fields\":[{\"name\":\"Build tag:\",\"value\":\"- \`$(cat build-tag.txt | sed 's|\n||')\`\"},{\"name\":\"Branch:\",\"value\":\"- \`${BRANCH_NAME}\`\"},{\"name\":\"Changes:\",\"value\":\"$(echo $COMMITMESSAGE | awk '{printf "%s\\n", $0}')\"},{\"name\":\"Artifacts:\",\"value\":\"- [palera1n-ios](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-ios)\n- [palera1n-linux-arm64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-arm64)\n- [palera1n-linux-armel](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-armel)\n- [palera1n-linux-x86](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86)\n- [palera1n-linux-x86_64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86_64)\n- [palera1n-macos-universal](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-macos-universal)\n- [palera1n.1](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n.1.html)\"}],\"footer\":{\"text\":\"palera1n/palera1n\", \"icon_url\": \"https://media.discordapp.net/attachments/1054239098006683688/1107471339176071288/palera1n_ios_copy.png?width=1208&height=1208\",\"timestamp\":\"$(date +'%Y-%m-%dT%H:%M:%S')\"}}],\"username\":\"GitHub Actions\",\"avatar_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}")
\ No newline at end of file
From 194f568363664752236d0390365bb396e2936967 Mon Sep 17 00:00:00 2001
From: flower <97859147+flowerible@users.noreply.github.com>
Date: Sun, 14 May 2023 19:15:47 -0700
Subject: [PATCH 33/56] ci: fix timestamp
---
.github/workflows/build.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 8c0db9c..250002b 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -812,5 +812,5 @@ jobs:
- name: Send Discord build message
run: |
COMMITMESSAGE=`git log --pretty=format:'- \`%h\` %s' -1 --reverse` &&
- (curl "${{ secrets.DISCORD_WEBHOOK }}" -sS -H "Content-Type:application/json" -X POST -d "{\"content\":null,\"embeds\":[{\"title\":\"Nightly Build ${{ github.run_number }}\",\"url\":\"https://github.com/palera1n/palera1n/actions/runs/${GITHUB_RUN_ID}\",\"color\":1487872,\"fields\":[{\"name\":\"Build tag:\",\"value\":\"- \`$(cat build-tag.txt | sed 's|\n||')\`\"},{\"name\":\"Branch:\",\"value\":\"- \`${BRANCH_NAME}\`\"},{\"name\":\"Changes:\",\"value\":\"$(echo $COMMITMESSAGE | awk '{printf "%s\\n", $0}')\"},{\"name\":\"Artifacts:\",\"value\":\"- [palera1n-ios](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-ios)\n- [palera1n-linux-arm64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-arm64)\n- [palera1n-linux-armel](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-armel)\n- [palera1n-linux-x86](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86)\n- [palera1n-linux-x86_64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86_64)\n- [palera1n-macos-universal](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-macos-universal)\n- [palera1n.1](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n.1.html)\"}],\"footer\":{\"text\":\"palera1n/palera1n\", \"icon_url\": \"https://media.discordapp.net/attachments/1054239098006683688/1107471339176071288/palera1n_ios_copy.png?width=1208&height=1208\",\"timestamp\":\"$(date +'%Y-%m-%dT%H:%M:%S')\"}}],\"username\":\"GitHub Actions\",\"avatar_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}")
-
\ No newline at end of file
+ (curl "${{ secrets.DISCORD_WEBHOOK }}" -sS -H "Content-Type:application/json" -X POST -d "{\"content\":null,\"embeds\":[{\"title\":\"Nightly Build ${{ github.run_number }}\",\"url\":\"https://github.com/palera1n/palera1n/actions/runs/${GITHUB_RUN_ID}\",\"color\":1487872,\"fields\":[{\"name\":\"Build tag:\",\"value\":\"- \`$(cat build-tag.txt | sed 's|\n||')\`\"},{\"name\":\"Branch:\",\"value\":\"- \`${BRANCH_NAME}\`\"},{\"name\":\"Changes:\",\"value\":\"$(echo $COMMITMESSAGE | awk '{printf "%s\\n", $0}')\"},{\"name\":\"Artifacts:\",\"value\":\"- [palera1n-ios](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-ios)\n- [palera1n-linux-arm64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-arm64)\n- [palera1n-linux-armel](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-armel)\n- [palera1n-linux-x86](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86)\n- [palera1n-linux-x86_64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86_64)\n- [palera1n-macos-universal](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-macos-universal)\n- [palera1n.1](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n.1.html)\"}],\"footer\":{\"text\":\"palera1n/palera1n\", \"icon_url\": \"https://media.discordapp.net/attachments/1054239098006683688/1107471339176071288/palera1n_ios_copy.png?width=1208&height=1208\",\"timestamp\":\"$(date -u +"%Y-%m-%dT%H:%M:%S.000Z")\"}}],\"username\":\"GitHub Actions\",\"avatar_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}")
+
From e6644c0601a96e04a0396338525448e70cf2a7bd Mon Sep 17 00:00:00 2001
From: flower <97859147+flowerible@users.noreply.github.com>
Date: Sun, 14 May 2023 19:49:57 -0700
Subject: [PATCH 34/56] ci: fix timestamp v2
---
.github/workflows/build.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 250002b..4415113 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -812,5 +812,5 @@ jobs:
- name: Send Discord build message
run: |
COMMITMESSAGE=`git log --pretty=format:'- \`%h\` %s' -1 --reverse` &&
- (curl "${{ secrets.DISCORD_WEBHOOK }}" -sS -H "Content-Type:application/json" -X POST -d "{\"content\":null,\"embeds\":[{\"title\":\"Nightly Build ${{ github.run_number }}\",\"url\":\"https://github.com/palera1n/palera1n/actions/runs/${GITHUB_RUN_ID}\",\"color\":1487872,\"fields\":[{\"name\":\"Build tag:\",\"value\":\"- \`$(cat build-tag.txt | sed 's|\n||')\`\"},{\"name\":\"Branch:\",\"value\":\"- \`${BRANCH_NAME}\`\"},{\"name\":\"Changes:\",\"value\":\"$(echo $COMMITMESSAGE | awk '{printf "%s\\n", $0}')\"},{\"name\":\"Artifacts:\",\"value\":\"- [palera1n-ios](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-ios)\n- [palera1n-linux-arm64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-arm64)\n- [palera1n-linux-armel](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-armel)\n- [palera1n-linux-x86](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86)\n- [palera1n-linux-x86_64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86_64)\n- [palera1n-macos-universal](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-macos-universal)\n- [palera1n.1](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n.1.html)\"}],\"footer\":{\"text\":\"palera1n/palera1n\", \"icon_url\": \"https://media.discordapp.net/attachments/1054239098006683688/1107471339176071288/palera1n_ios_copy.png?width=1208&height=1208\",\"timestamp\":\"$(date -u +"%Y-%m-%dT%H:%M:%S.000Z")\"}}],\"username\":\"GitHub Actions\",\"avatar_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}")
+ (curl "${{ secrets.DISCORD_WEBHOOK }}" -sS -H "Content-Type:application/json" -X POST -d "{\"content\":null,\"embeds\":[{\"title\":\"Nightly Build ${{ github.run_number }}\",\"url\":\"https://github.com/palera1n/palera1n/actions/runs/${GITHUB_RUN_ID}\",\"color\":1487872,\"fields\":[{\"name\":\"Build tag:\",\"value\":\"- \`$(cat build-tag.txt | sed 's|\n||')\`\"},{\"name\":\"Branch:\",\"value\":\"- \`${BRANCH_NAME}\`\"},{\"name\":\"Changes:\",\"value\":\"$(echo $COMMITMESSAGE | awk '{printf "%s\\n", $0}')\"},{\"name\":\"Artifacts:\",\"value\":\"- [palera1n-ios](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-ios)\n- [palera1n-linux-arm64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-arm64)\n- [palera1n-linux-armel](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-armel)\n- [palera1n-linux-x86](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86)\n- [palera1n-linux-x86_64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86_64)\n- [palera1n-macos-universal](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-macos-universal)\n- [palera1n.1](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n.1.html)\"}],\"footer\":{\"text\":\"palera1n/palera1n\", \"icon_url\": \"https://media.discordapp.net/attachments/1054239098006683688/1107471339176071288/palera1n_ios_copy.png?width=1208&height=1208\",\"timestamp\":\"'$(date -u +"%FT%TZ")'\"}}],\"username\":\"GitHub Actions\",\"avatar_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}")
From 58aaf508fc4d2f15643803f7f90c107bdf6a74ea Mon Sep 17 00:00:00 2001
From: flower <97859147+flowerible@users.noreply.github.com>
Date: Sun, 14 May 2023 20:03:55 -0700
Subject: [PATCH 35/56] ci: fix timestamp v3
---
.github/workflows/build.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 4415113..79c1105 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -812,5 +812,5 @@ jobs:
- name: Send Discord build message
run: |
COMMITMESSAGE=`git log --pretty=format:'- \`%h\` %s' -1 --reverse` &&
- (curl "${{ secrets.DISCORD_WEBHOOK }}" -sS -H "Content-Type:application/json" -X POST -d "{\"content\":null,\"embeds\":[{\"title\":\"Nightly Build ${{ github.run_number }}\",\"url\":\"https://github.com/palera1n/palera1n/actions/runs/${GITHUB_RUN_ID}\",\"color\":1487872,\"fields\":[{\"name\":\"Build tag:\",\"value\":\"- \`$(cat build-tag.txt | sed 's|\n||')\`\"},{\"name\":\"Branch:\",\"value\":\"- \`${BRANCH_NAME}\`\"},{\"name\":\"Changes:\",\"value\":\"$(echo $COMMITMESSAGE | awk '{printf "%s\\n", $0}')\"},{\"name\":\"Artifacts:\",\"value\":\"- [palera1n-ios](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-ios)\n- [palera1n-linux-arm64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-arm64)\n- [palera1n-linux-armel](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-armel)\n- [palera1n-linux-x86](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86)\n- [palera1n-linux-x86_64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86_64)\n- [palera1n-macos-universal](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-macos-universal)\n- [palera1n.1](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n.1.html)\"}],\"footer\":{\"text\":\"palera1n/palera1n\", \"icon_url\": \"https://media.discordapp.net/attachments/1054239098006683688/1107471339176071288/palera1n_ios_copy.png?width=1208&height=1208\",\"timestamp\":\"'$(date -u +"%FT%TZ")'\"}}],\"username\":\"GitHub Actions\",\"avatar_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}")
+ (curl "${{ secrets.DISCORD_WEBHOOK }}" -sS -H "Content-Type:application/json" -X POST -d "{\"content\":null,\"embeds\":[{\"title\":\"Nightly Build ${{ github.run_number }}\",\"url\":\"https://github.com/palera1n/palera1n/actions/runs/${GITHUB_RUN_ID}\",\"color\":2829617,\"fields\":[{\"name\":\"Build tag:\",\"value\":\"- \`$(cat build-tag.txt | sed 's|\n||')\`\"},{\"name\":\"Branch:\",\"value\":\"- \`${BRANCH_NAME}\`\"},{\"name\":\"Changes:\",\"value\":\"$(echo $COMMITMESSAGE | awk '{printf "%s\\n", $0}')\"},{\"name\":\"Artifacts:\",\"value\":\"- [palera1n-ios](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-ios)\n- [palera1n-linux-arm64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-arm64)\n- [palera1n-linux-armel](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-armel)\n- [palera1n-linux-x86](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86)\n- [palera1n-linux-x86_64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86_64)\n- [palera1n-macos-universal](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-macos-universal)\n- [palera1n.1](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n.1.html)\"}],\"footer\":{\"text\":\"palera1n/palera1n\", \"icon_url\": \"https://media.discordapp.net/attachments/1054239098006683688/1107471339176071288/palera1n_ios_copy.png?width=1208&height=1208\",\"timestamp\":\"$(date -u +"%FT%TZ")\"}}],\"username\":\"GitHub Actions\",\"avatar_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}")
From 2541330a073f5663ab95b2bd1b10d2bf13b3e597 Mon Sep 17 00:00:00 2001
From: flower <97859147+flowerible@users.noreply.github.com>
Date: Sun, 14 May 2023 20:27:03 -0700
Subject: [PATCH 36/56] ci: change embed design
---
.github/workflows/build.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 79c1105..a401df8 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -812,5 +812,5 @@ jobs:
- name: Send Discord build message
run: |
COMMITMESSAGE=`git log --pretty=format:'- \`%h\` %s' -1 --reverse` &&
- (curl "${{ secrets.DISCORD_WEBHOOK }}" -sS -H "Content-Type:application/json" -X POST -d "{\"content\":null,\"embeds\":[{\"title\":\"Nightly Build ${{ github.run_number }}\",\"url\":\"https://github.com/palera1n/palera1n/actions/runs/${GITHUB_RUN_ID}\",\"color\":2829617,\"fields\":[{\"name\":\"Build tag:\",\"value\":\"- \`$(cat build-tag.txt | sed 's|\n||')\`\"},{\"name\":\"Branch:\",\"value\":\"- \`${BRANCH_NAME}\`\"},{\"name\":\"Changes:\",\"value\":\"$(echo $COMMITMESSAGE | awk '{printf "%s\\n", $0}')\"},{\"name\":\"Artifacts:\",\"value\":\"- [palera1n-ios](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-ios)\n- [palera1n-linux-arm64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-arm64)\n- [palera1n-linux-armel](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-armel)\n- [palera1n-linux-x86](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86)\n- [palera1n-linux-x86_64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86_64)\n- [palera1n-macos-universal](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-macos-universal)\n- [palera1n.1](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n.1.html)\"}],\"footer\":{\"text\":\"palera1n/palera1n\", \"icon_url\": \"https://media.discordapp.net/attachments/1054239098006683688/1107471339176071288/palera1n_ios_copy.png?width=1208&height=1208\",\"timestamp\":\"$(date -u +"%FT%TZ")\"}}],\"username\":\"GitHub Actions\",\"avatar_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}")
+ (curl "${{ secrets.DISCORD_WEBHOOK }}" -sS -H "Content-Type:application/json" -X POST -d "{\"content\":null,\"embeds\":[{\"title\":\"[palera1n:main] Nightly Build ${{ github.run_number }}\",\"url\":\"https://github.com/palera1n/palera1n/actions/runs/${GITHUB_RUN_ID}\",\"color\":2829617,\"fields\":[{\"name\":\"Tag\",\"value\":\"- \`$(cat build-tag.txt | sed 's|\n||')\`\"},{\"name\":\"Changes\",\"value\":\"$(echo $COMMITMESSAGE | awk '{printf "%s\\n", $0}')\"},{\"name\":\"Artifacts\",\"value\":\"- [palera1n-ios](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-ios)\n- [palera1n-linux-arm64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-arm64)\n- [palera1n-linux-armel](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-armel)\n- [palera1n-linux-x86](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86)\n- [palera1n-linux-x86_64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86_64)\n- [palera1n-macos-universal](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-macos-universal)\n- [palera1n.1.html](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n.1.html)\"}],\"footer\":{\"text\":\"https://github.com/palera1n/palera1n\", \"icon_url\": \"https://media.discordapp.net/attachments/1054239098006683688/1107471339176071288/palera1n_ios_copy.png?width=1208&height=1208\",\"timestamp\":\"$(date -u +"%FT%TZ")\"}}],\"username\":\"GitHub Actions\",\"avatar_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}")
From ed48d4fcb494c5ba06d558f123f44839fcc78d46 Mon Sep 17 00:00:00 2001
From: flower <97859147+flowerible@users.noreply.github.com>
Date: Sun, 14 May 2023 20:30:24 -0700
Subject: [PATCH 37/56] ci: change field
---
.github/workflows/build.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index a401df8..9925d5a 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -812,5 +812,5 @@ jobs:
- name: Send Discord build message
run: |
COMMITMESSAGE=`git log --pretty=format:'- \`%h\` %s' -1 --reverse` &&
- (curl "${{ secrets.DISCORD_WEBHOOK }}" -sS -H "Content-Type:application/json" -X POST -d "{\"content\":null,\"embeds\":[{\"title\":\"[palera1n:main] Nightly Build ${{ github.run_number }}\",\"url\":\"https://github.com/palera1n/palera1n/actions/runs/${GITHUB_RUN_ID}\",\"color\":2829617,\"fields\":[{\"name\":\"Tag\",\"value\":\"- \`$(cat build-tag.txt | sed 's|\n||')\`\"},{\"name\":\"Changes\",\"value\":\"$(echo $COMMITMESSAGE | awk '{printf "%s\\n", $0}')\"},{\"name\":\"Artifacts\",\"value\":\"- [palera1n-ios](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-ios)\n- [palera1n-linux-arm64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-arm64)\n- [palera1n-linux-armel](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-armel)\n- [palera1n-linux-x86](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86)\n- [palera1n-linux-x86_64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86_64)\n- [palera1n-macos-universal](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-macos-universal)\n- [palera1n.1.html](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n.1.html)\"}],\"footer\":{\"text\":\"https://github.com/palera1n/palera1n\", \"icon_url\": \"https://media.discordapp.net/attachments/1054239098006683688/1107471339176071288/palera1n_ios_copy.png?width=1208&height=1208\",\"timestamp\":\"$(date -u +"%FT%TZ")\"}}],\"username\":\"GitHub Actions\",\"avatar_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}")
+ (curl "${{ secrets.DISCORD_WEBHOOK }}" -sS -H "Content-Type:application/json" -X POST -d "{\"content\":null,\"embeds\":[{\"title\":\"[palera1n:main] Nightly Build ${{ github.run_number }}\",\"url\":\"https://github.com/palera1n/palera1n/actions/runs/${GITHUB_RUN_ID}\",\"color\":2829617,\"fields\":[{\"name\":\"Build tag\",\"value\":\"- \`$(cat build-tag.txt | sed 's|\n||')\`\"},{\"name\":\"Changes\",\"value\":\"$(echo $COMMITMESSAGE | awk '{printf "%s\\n", $0}')\"},{\"name\":\"Artifacts\",\"value\":\"- [palera1n-ios](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-ios)\n- [palera1n-linux-arm64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-arm64)\n- [palera1n-linux-armel](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-armel)\n- [palera1n-linux-x86](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86)\n- [palera1n-linux-x86_64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86_64)\n- [palera1n-macos-universal](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-macos-universal)\n- [palera1n.1.html](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n.1.html)\"}],\"footer\":{\"text\":\"https://github.com/palera1n/palera1n\", \"icon_url\": \"https://media.discordapp.net/attachments/1054239098006683688/1107471339176071288/palera1n_ios_copy.png?width=1208&height=1208\",\"timestamp\":\"$(date -u +"%FT%TZ")\"}}],\"username\":\"GitHub Actions\",\"avatar_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}")
From c14d93b00875029e11ebfb0aed47a6d598d0c978 Mon Sep 17 00:00:00 2001
From: flower <97859147+flowerible@users.noreply.github.com>
Date: Sun, 14 May 2023 20:44:10 -0700
Subject: [PATCH 38/56] ci: actual branch name
---
.github/workflows/build.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 9925d5a..c9b7637 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -812,5 +812,5 @@ jobs:
- name: Send Discord build message
run: |
COMMITMESSAGE=`git log --pretty=format:'- \`%h\` %s' -1 --reverse` &&
- (curl "${{ secrets.DISCORD_WEBHOOK }}" -sS -H "Content-Type:application/json" -X POST -d "{\"content\":null,\"embeds\":[{\"title\":\"[palera1n:main] Nightly Build ${{ github.run_number }}\",\"url\":\"https://github.com/palera1n/palera1n/actions/runs/${GITHUB_RUN_ID}\",\"color\":2829617,\"fields\":[{\"name\":\"Build tag\",\"value\":\"- \`$(cat build-tag.txt | sed 's|\n||')\`\"},{\"name\":\"Changes\",\"value\":\"$(echo $COMMITMESSAGE | awk '{printf "%s\\n", $0}')\"},{\"name\":\"Artifacts\",\"value\":\"- [palera1n-ios](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-ios)\n- [palera1n-linux-arm64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-arm64)\n- [palera1n-linux-armel](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-armel)\n- [palera1n-linux-x86](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86)\n- [palera1n-linux-x86_64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86_64)\n- [palera1n-macos-universal](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-macos-universal)\n- [palera1n.1.html](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n.1.html)\"}],\"footer\":{\"text\":\"https://github.com/palera1n/palera1n\", \"icon_url\": \"https://media.discordapp.net/attachments/1054239098006683688/1107471339176071288/palera1n_ios_copy.png?width=1208&height=1208\",\"timestamp\":\"$(date -u +"%FT%TZ")\"}}],\"username\":\"GitHub Actions\",\"avatar_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}")
+ (curl "${{ secrets.DISCORD_WEBHOOK }}" -sS -H "Content-Type:application/json" -X POST -d "{\"content\":null,\"embeds\":[{\"title\":\"[palera1n:${BRANCH_NAME}] Nightly Build ${{ github.run_number }}\",\"url\":\"https://github.com/palera1n/palera1n/actions/runs/${GITHUB_RUN_ID}\",\"color\":2829617,\"fields\":[{\"name\":\"Build tag\",\"value\":\"- \`$(cat build-tag.txt | sed 's|\n||')\`\"},{\"name\":\"Changes\",\"value\":\"$(echo $COMMITMESSAGE | awk '{printf "%s\\n", $0}')\"},{\"name\":\"Artifacts\",\"value\":\"- [palera1n-ios](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-ios)\n- [palera1n-linux-arm64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-arm64)\n- [palera1n-linux-armel](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-armel)\n- [palera1n-linux-x86](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86)\n- [palera1n-linux-x86_64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86_64)\n- [palera1n-macos-universal](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-macos-universal)\n- [palera1n.1.html](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n.1.html)\"}],\"footer\":{\"text\":\"https://github.com/palera1n/palera1n\", \"icon_url\": \"https://media.discordapp.net/attachments/1054239098006683688/1107471339176071288/palera1n_ios_copy.png?width=1208&height=1208\",\"timestamp\":\"$(date -u +"%FT%TZ")\"}}],\"username\":\"GitHub Actions\",\"avatar_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}")
From e6033f31ccab75ab7ee36a2ebe13cb29a93a6d92 Mon Sep 17 00:00:00 2001
From: staturnz <118011249+staturnzz@users.noreply.github.com>
Date: Wed, 17 May 2023 08:11:00 -0500
Subject: [PATCH 39/56] chore: update readme links
---
README.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 7945e85..7391c6d 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@
An iOS 15.0-16.4.1 work-in-progress, semi-tethered checkm8 jailbreak
- Usage
+ Usage
•
Contributors
•
@@ -18,11 +18,11 @@
## If you want a jailbreak, you should read the [guide](https://palera.in).
### You can obtain v2.0.0 beta [here](https://github.com/palera1n/palera1n/releases).
-If you need an older v2.0.0 beta, please get it [here](https://github.com/palera1n/palera1n-c/releases/tag/v2.0.0-beta.4).
+If you need an older v2.0.0 beta, please get it [here](https://github.com/palera1n/palera1n/releases/tag/v2.0.0-beta.5).
# Warnings
- This palera1n rewrite has noticeably different arguments compared to the shell version of palera1n.
- - Highly recommended that you take a look at how to use palera1n-c [here](https://cdn.nickchan.lol/palera1n/c-rewrite/releases/v2.0.0-beta.1/palera1n.1.html).
+ - Highly recommended that you take a look at how to use palera1n-c [here](https://cdn.nickchan.lol/palera1n/c-rewrite/releases/v2.0.0-beta.6/palera1n.1.html).
- This does **NOT** support tethered creation or booting. You must use the older [shell version of palera1n](https://github.com/palera1n/palera1n/tree/legacy) (clone with `-b legacy`).
From 3b4340525d37cd2d7cc5149cdc5aa7512f4d5267 Mon Sep 17 00:00:00 2001
From: fenfenS <104295404+fenfenS@users.noreply.github.com>
Date: Thu, 18 May 2023 01:58:02 +0800
Subject: [PATCH 40/56] usb_libusb.c: initialize variable stuff.handle (#392)
initialize stuff.handle, or function FoundDevice would return directly.
---
src/usb_libusb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/usb_libusb.c b/src/usb_libusb.c
index 1e8469e..3685379 100644
--- a/src/usb_libusb.c
+++ b/src/usb_libusb.c
@@ -181,6 +181,7 @@ static int LostDevice(libusb_context *ctx, libusb_device *dev, libusb_hotplug_ev
int wait_for_pongo(void)
{
stuff_t stuff;
+ stuff.handle = NULL;
libusb_hotplug_callback_handle hp[2];
libusb_context* ctx = NULL;
From e33d50860bd92c195cd4894a4a2d6731fe1c34e7 Mon Sep 17 00:00:00 2001
From: staturnz <118011249+staturnzz@users.noreply.github.com>
Date: Wed, 17 May 2023 23:49:23 -0500
Subject: [PATCH 41/56] chore: update ramdisk download url
---
src/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Makefile b/src/Makefile
index 38fed06..25c7ad1 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -140,7 +140,7 @@ checkra1n-kpf-pongo:
curl -LO https://cdn.nickchan.lol/palera1n/artifacts/kpf/checkra1n-kpf-pongo
ramdisk.dmg:
- curl -LO https://cdn.nickchan.lol/palera1n/artifacts/jbinit_rootless/ramdisk.dmg
+ curl -LO https://cdn.nickchan.lol/palera1n/c-rewrite/deps/ramdisk.dmg
binpack.dmg:
curl -LO https://cdn.nickchan.lol/palera1n/c-rewrite/deps/binpack.dmg
From 30d8241e2d8ab49a387e960bf1970bc2ab86643e Mon Sep 17 00:00:00 2001
From: Nick Chan
Date: Sat, 20 May 2023 00:59:04 +0800
Subject: [PATCH 42/56] s/16.4.1/16.5
---
docs/palera1n.1 | 6 +++---
packaging/control | 4 ++--
packaging/control.macosx | 4 ++--
src/optparse.c | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/docs/palera1n.1 b/docs/palera1n.1
index e9e4cbd..91f1998 100644
--- a/docs/palera1n.1
+++ b/docs/palera1n.1
@@ -6,7 +6,7 @@
.Dt palera1n 1
.Sh NAME
.Nm palera1n
-.Nd iOS 15.0-16.4.1 arm64 iOS/iPadOS jailbreaking tool
+.Nd iOS 15.0-16.5 arm64 iOS/iPadOS jailbreaking tool
.Sh SYNOPSIS
.Nm
.Op Fl cCdDEfhIlLnpRsSvV
@@ -20,7 +20,7 @@
.Op Fl -force-revert
.Sh DESCRIPTION
.Nm
-jailbreaks any iOS/iPadOS device with an arm64 (arm64e excluded) on iOS 15.0-16.4.1,
+jailbreaks any iOS/iPadOS device with an arm64 (arm64e excluded) on iOS 15.0-16.5,
utilizing the
.Em checkm8
bootROM exploit.
@@ -52,7 +52,7 @@ In the remainder of this document, the term "iOS" and "iPadOS" will be used inte
as the difference is negligible as far as the jailbreak is concerened.
.Pp
.Sh SUPPORTED DEVICES
-As described above, arm64 iOS 15.0-16.4.1 devices are supported, here is an explicit
+As described above, arm64 iOS 15.0-16.5 devices are supported, here is an explicit
list of supported devicecs:
.Bl -tag -compact
diff --git a/packaging/control b/packaging/control
index 0f67cf4..970a7dc 100644
--- a/packaging/control
+++ b/packaging/control
@@ -8,8 +8,8 @@ Depends: usbmuxd
Section: Utilities
Priority: optional
Homepage: https://palera.in
-Description: iOS 15.0-16.4.1 semi-tethered checkm8 jailbreak
- palera1n is an iOS/iPadOS 15.0-16.4.1 semi tethered jailbreak
+Description: iOS 15.0-16.5 semi-tethered checkm8 jailbreak
+ palera1n is an iOS/iPadOS 15.0-16.5 semi tethered jailbreak
based on the checkm8 exploit.
.
palera1n is able to jailbreak the device in fakefs-rootful mode,
diff --git a/packaging/control.macosx b/packaging/control.macosx
index 417a8dd..6dfdabc 100644
--- a/packaging/control.macosx
+++ b/packaging/control.macosx
@@ -7,8 +7,8 @@ Author: palera1n team
Section: Utilities
Priority: optional
Homepage: https://palera.in
-Description: iOS 15.0-16.4.1 semi-tethered checkm8 jailbreak
- palera1n is an iOS/iPadOS 15.0-16.4.1 semi tethered jailbreak
+Description: iOS 15.0-16.5 semi-tethered checkm8 jailbreak
+ palera1n is an iOS/iPadOS 15.0-16.5 semi tethered jailbreak
based on the checkm8 exploit.
.
palera1n is able to jailbreak the device in fakefs-rootful mode,
diff --git a/src/optparse.c b/src/optparse.c
index ad13d64..e85168c 100644
--- a/src/optparse.c
+++ b/src/optparse.c
@@ -72,7 +72,7 @@ static int usage(int e, char* prog_name)
#endif
"] [-e boot arguments] [-k Pongo image] [-o overlay file] [-r ramdisk file] [-K KPF file] [-i checkra1n file]\n"
"Copyright (C) 2023, palera1n team, All Rights Reserved.\n\n"
- "iOS/iPadOS 15.0-16.4.1 arm64 jailbreaking tool\n\n"
+ "iOS/iPadOS 15.0-16.5 arm64 jailbreaking tool\n\n"
"\t--version\t\t\t\tPrint version\n"
"\t--force-revert\t\t\t\tRemove jailbreak\n"
#ifdef DEV_BUILD
From 8a09d2670a32b0074bd1544b470d83ef608a43b4 Mon Sep 17 00:00:00 2001
From: flower <97859147+flowerible@users.noreply.github.com>
Date: Sun, 21 May 2023 02:37:56 -0700
Subject: [PATCH 43/56] chore: s/16.4.1/16.5
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 7391c6d..0255b22 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
-An iOS 15.0-16.4.1 work-in-progress, semi-tethered checkm8 jailbreak
+An iOS 15.0-16.5 work-in-progress, semi-tethered checkm8 jailbreak
Usage
From a8325474cf97d350c41c3be4a76df00fe6b9d098 Mon Sep 17 00:00:00 2001
From: flower <97859147+flowerible@users.noreply.github.com>
Date: Sun, 21 May 2023 03:03:04 -0700
Subject: [PATCH 44/56] chore: Update README.md
---
README.md | 42 +++++++++++-------------------------------
1 file changed, 11 insertions(+), 31 deletions(-)
diff --git a/README.md b/README.md
index 0255b22..93518ac 100644
--- a/README.md
+++ b/README.md
@@ -2,36 +2,20 @@
-An iOS 15.0-16.5 work-in-progress, semi-tethered checkm8 jailbreak
-
- Usage
- •
- Contributors
- •
- Discord
- •
- Twitter
-
-
+
-## If you want a jailbreak, you should read the [guide](https://palera.in).
-
-### You can obtain v2.0.0 beta [here](https://github.com/palera1n/palera1n/releases).
-If you need an older v2.0.0 beta, please get it [here](https://github.com/palera1n/palera1n/releases/tag/v2.0.0-beta.5).
-
-# Warnings
-- This palera1n rewrite has noticeably different arguments compared to the shell version of palera1n.
- - Highly recommended that you take a look at how to use palera1n-c [here](https://cdn.nickchan.lol/palera1n/c-rewrite/releases/v2.0.0-beta.6/palera1n.1.html).
-
-- This does **NOT** support tethered creation or booting. You must use the older [shell version of palera1n](https://github.com/palera1n/palera1n/tree/legacy) (clone with `-b legacy`).
+## Information
+- Guides to palera1n can be found [here](https://ios.cfw.guide/installing-palera1n).
+- Full documentation can be also found [here](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n.1.html).
+## 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.
- If your device is stuck in recovery, please run futurerestore `--exit-recovery`, or use `irecovery -n`.
- palera1n will never work in VirtualBox, VMware or any virtual machine that doesn't support PCI passthrough.
-# Requirements
+## Requirements
- A checkm8 vulnerable iOS device on iOS 15.x or 16.x (`A8` - `A11`)
- If using rootful, you will need **5-10GB of space** for the fakefs. This means 16GB devices cannot use the full fakefs creation. However, you can change the arguments to `-Bf` to create a fakefs with bind mounts, so it uses a smaller size, at the expense having unwritable parts in rarely-written paths, and then boot it
- On `A11`, **you must disable your passcode while in the jailbroken state** (on iOS 16, you need to **reset your device** before proceeding with palera1n).
@@ -46,7 +30,7 @@ If you need an older v2.0.0 beta, please get it [here](https://github.com/palera
- USB-C port on Apple Silicon Macs may require manual unplugging and replugging of the lightning cable after checkm8 exploit.
- This problem may be solved by connecting via USBHub.
-# Need help?
+## Need help?
Make sure you provide full details on your device, such as:
- iDevice
@@ -54,19 +38,15 @@ Make sure you provide full details on your device, such as:
- Passcode enabled?
- Logs, if panicked then send latest `panic-full` log from your iDevice.
-Using `-V` and `-v` would help with debugging.
+Using `-VvL` would help with debugging.
Join the [Support Discord](https://dsc.gg/palera1n), and create a thread in [#support](https://discord.com/channels/1028398973452570725/1028730487700738130) or ask in [#general](https://discord.com/channels/1028398973452570725/1028398976640229380).
-# Credits
-palera1n-c Contributors and Credits
+## Credits
+Credits
-- [Nick Chan](https://github.com/asdfugil) for the rewrite
-- [Nebula](https://github.com/itsnebulalol) - palera1n owner and manager
-- [Mineek](https://github.com/mineek)
-- [Tom](https://github.com/plooshi) for updated ploosh kpf and universal loader
-- [Lakhan Lothiyi](https://github.com/llsc12) for palera1n loader app
+- [Lakhan Lothiyi](https://github.com/llsc12) for older palera1n loader app
- [checkra1n](https://github.com/checkra1n) for the base of the kpf
- [the Procursus Team](https://github.com/ProcursusTeam) for the amazing [bootstrap](https://github.com/ProcursusTeam/Procursus)
- [Évelyne](https://github.com/evelyneee) for [ElleKit](https://github.com/evelyneee/ellekit), rootless tweak injection
From 7d3bf14ea68fbf37e346838323a720e6f84be672 Mon Sep 17 00:00:00 2001
From: flower <97859147+flowerible@users.noreply.github.com>
Date: Wed, 24 May 2023 14:41:14 -0700
Subject: [PATCH 45/56] chore: Remove changes from embed
---
.github/workflows/build.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index c9b7637..e7cb136 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -812,5 +812,5 @@ jobs:
- name: Send Discord build message
run: |
COMMITMESSAGE=`git log --pretty=format:'- \`%h\` %s' -1 --reverse` &&
- (curl "${{ secrets.DISCORD_WEBHOOK }}" -sS -H "Content-Type:application/json" -X POST -d "{\"content\":null,\"embeds\":[{\"title\":\"[palera1n:${BRANCH_NAME}] Nightly Build ${{ github.run_number }}\",\"url\":\"https://github.com/palera1n/palera1n/actions/runs/${GITHUB_RUN_ID}\",\"color\":2829617,\"fields\":[{\"name\":\"Build tag\",\"value\":\"- \`$(cat build-tag.txt | sed 's|\n||')\`\"},{\"name\":\"Changes\",\"value\":\"$(echo $COMMITMESSAGE | awk '{printf "%s\\n", $0}')\"},{\"name\":\"Artifacts\",\"value\":\"- [palera1n-ios](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-ios)\n- [palera1n-linux-arm64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-arm64)\n- [palera1n-linux-armel](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-armel)\n- [palera1n-linux-x86](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86)\n- [palera1n-linux-x86_64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86_64)\n- [palera1n-macos-universal](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-macos-universal)\n- [palera1n.1.html](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n.1.html)\"}],\"footer\":{\"text\":\"https://github.com/palera1n/palera1n\", \"icon_url\": \"https://media.discordapp.net/attachments/1054239098006683688/1107471339176071288/palera1n_ios_copy.png?width=1208&height=1208\",\"timestamp\":\"$(date -u +"%FT%TZ")\"}}],\"username\":\"GitHub Actions\",\"avatar_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}")
+ (curl "${{ secrets.DISCORD_WEBHOOK }}" -sS -H "Content-Type:application/json" -X POST -d "{\"content\":null,\"embeds\":[{\"title\":\"[palera1n:${BRANCH_NAME}] Nightly Build ${{ github.run_number }}\",\"url\":\"https://github.com/palera1n/palera1n/actions/runs/${GITHUB_RUN_ID}\",\"color\":2829617,\"fields\":[{\"name\":\"Build tag\",\"value\":\"- \`$(cat build-tag.txt | sed 's|\n||')\`\"},{\"name\":\"Artifacts\",\"value\":\"- [palera1n-ios](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-ios)\n- [palera1n-linux-arm64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-arm64)\n- [palera1n-linux-armel](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-armel)\n- [palera1n-linux-x86](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86)\n- [palera1n-linux-x86_64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86_64)\n- [palera1n-macos-universal](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-macos-universal)\n- [palera1n.1.html](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n.1.html)\"}],\"footer\":{\"text\":\"https://github.com/palera1n/palera1n\", \"icon_url\": \"https://media.discordapp.net/attachments/1054239098006683688/1107471339176071288/palera1n_ios_copy.png?width=1208&height=1208\",\"timestamp\":\"$(date -u +"%FT%TZ")\"}}],\"username\":\"GitHub Actions\",\"avatar_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}")
From a5fbf1b18b6de915785d533e2e51bed5a51a19f6 Mon Sep 17 00:00:00 2001
From: Nick Chan
Date: Sat, 27 May 2023 20:56:43 +0800
Subject: [PATCH 46/56] deps: update MbedTLS to 3.4.0
96% tests passed, 5 tests failed out of 113
Total Test time (real) = 84.57 sec
The following tests FAILED:
42 - debug-suite (Failed)
80 - pkcs7-suite (Failed)
109 - ssl-suite (Failed)
112 - x509parse-suite (Failed)
113 - x509write-suite (Failed)
---
.github/workflows/build.yml | 4 +-
.../0001-Allow-empty-x509-cert-issuer.patch | 43 +++++++++----------
2 files changed, 23 insertions(+), 24 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index e7cb136..cd457f9 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -70,7 +70,7 @@ jobs:
minos: 7.0
runs-on: macos-12
env:
- MBEDTLS_VERSION: 3.3.0
+ MBEDTLS_VERSION: 3.4.0
READLINE_VERSION: 8.2
SLANG_VERSION: 2.3.3
NEWT_VERSION: 0.52.23
@@ -494,7 +494,7 @@ jobs:
- aarch64-linux-musl
runs-on: ubuntu-latest
env:
- MBEDTLS_VERSION: 3.3.0
+ MBEDTLS_VERSION: 3.4.0
LIBUSB_VERSION: 1.0.26
READLINE_VERSION: 8.2
SLANG_VERSION: 2.3.3
diff --git a/patches/mbedtls/0001-Allow-empty-x509-cert-issuer.patch b/patches/mbedtls/0001-Allow-empty-x509-cert-issuer.patch
index 6696609..2489d93 100644
--- a/patches/mbedtls/0001-Allow-empty-x509-cert-issuer.patch
+++ b/patches/mbedtls/0001-Allow-empty-x509-cert-issuer.patch
@@ -1,35 +1,34 @@
-From 632cdb6de3f1693fb90d60d81552b723e8dd5e84 Mon Sep 17 00:00:00 2001
+From 2c8190847d4bd07db579bdea954d44fcf506a926 Mon Sep 17 00:00:00 2001
From: Nick Chan
-Date: Wed, 25 Jan 2023 01:53:00 +0800
+Date: Sat, 27 May 2023 20:54:54 +0800
Subject: [PATCH] Allow empty x509 cert issuer
---
- library/x509_crt.c | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
+ library/x509_crt.c | 11 -----------
+ 1 file changed, 11 deletions(-)
diff --git a/library/x509_crt.c b/library/x509_crt.c
-index 0eee97cb6..46702f683 100644
+index cf62532f2..a753b0aec 100644
--- a/library/x509_crt.c
+++ b/library/x509_crt.c
-@@ -1185,14 +1185,14 @@ static int x509_crt_parse_der_core( mbedtls_x509_crt *crt,
- if( ( ret = mbedtls_asn1_get_tag( &p, end, &len,
- MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE ) ) != 0 )
- {
-- mbedtls_x509_crt_free( crt );
-- return( MBEDTLS_ERROR_ADD( MBEDTLS_ERR_X509_INVALID_FORMAT, ret ) );
-+ // mbedtls_x509_crt_free( crt );
-+ // return( MBEDTLS_ERROR_ADD( MBEDTLS_ERR_X509_INVALID_FORMAT, ret ) );
- }
-
- if( ( ret = mbedtls_x509_get_name( &p, p + len, &crt->issuer ) ) != 0 )
- {
-- mbedtls_x509_crt_free( crt );
-- return( ret );
-+ // mbedtls_x509_crt_free( crt );
-+ // return( ret );
- }
+@@ -1059,17 +1059,6 @@ static int x509_crt_parse_der_core(mbedtls_x509_crt *crt,
+ */
+ crt->issuer_raw.p = p;
+- if ((ret = mbedtls_asn1_get_tag(&p, end, &len,
+- MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE)) != 0) {
+- mbedtls_x509_crt_free(crt);
+- return MBEDTLS_ERROR_ADD(MBEDTLS_ERR_X509_INVALID_FORMAT, ret);
+- }
+-
+- if ((ret = mbedtls_x509_get_name(&p, p + len, &crt->issuer)) != 0) {
+- mbedtls_x509_crt_free(crt);
+- return ret;
+- }
+-
crt->issuer_raw.len = p - crt->issuer_raw.p;
+
+ /*
--
2.39.1
From aa0c3a77b37ba534b5de8628b17aa89824990077 Mon Sep 17 00:00:00 2001
From: Nick Chan
Date: Sat, 27 May 2023 23:51:40 +0800
Subject: [PATCH 47/56] deps: patch mbedtls 3.4.0 take 2
---
.../0001-Allow-empty-x509-cert-issuer.patch | 34 +++++++++----------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/patches/mbedtls/0001-Allow-empty-x509-cert-issuer.patch b/patches/mbedtls/0001-Allow-empty-x509-cert-issuer.patch
index 2489d93..4212647 100644
--- a/patches/mbedtls/0001-Allow-empty-x509-cert-issuer.patch
+++ b/patches/mbedtls/0001-Allow-empty-x509-cert-issuer.patch
@@ -1,34 +1,34 @@
-From 2c8190847d4bd07db579bdea954d44fcf506a926 Mon Sep 17 00:00:00 2001
+From a2d012f3ba459f6debe636b576ad9aeab7b3c2aa Mon Sep 17 00:00:00 2001
From: Nick Chan
-Date: Sat, 27 May 2023 20:54:54 +0800
+Date: Sat, 27 May 2023 23:50:23 +0800
Subject: [PATCH] Allow empty x509 cert issuer
---
- library/x509_crt.c | 11 -----------
- 1 file changed, 11 deletions(-)
+ library/x509_crt.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/library/x509_crt.c b/library/x509_crt.c
-index cf62532f2..a753b0aec 100644
+index cf62532f2..ef25b3d77 100644
--- a/library/x509_crt.c
+++ b/library/x509_crt.c
-@@ -1059,17 +1059,6 @@ static int x509_crt_parse_der_core(mbedtls_x509_crt *crt,
- */
- crt->issuer_raw.p = p;
+@@ -1061,13 +1061,13 @@ static int x509_crt_parse_der_core(mbedtls_x509_crt *crt,
-- if ((ret = mbedtls_asn1_get_tag(&p, end, &len,
-- MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE)) != 0) {
+ if ((ret = mbedtls_asn1_get_tag(&p, end, &len,
+ MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE)) != 0) {
- mbedtls_x509_crt_free(crt);
- return MBEDTLS_ERROR_ADD(MBEDTLS_ERR_X509_INVALID_FORMAT, ret);
-- }
--
-- if ((ret = mbedtls_x509_get_name(&p, p + len, &crt->issuer)) != 0) {
++ /*mbedtls_x509_crt_free(crt);
++ return MBEDTLS_ERROR_ADD(MBEDTLS_ERR_X509_INVALID_FORMAT, ret);*/
+ }
+
+ if ((ret = mbedtls_x509_get_name(&p, p + len, &crt->issuer)) != 0) {
- mbedtls_x509_crt_free(crt);
- return ret;
-- }
--
- crt->issuer_raw.len = p - crt->issuer_raw.p;
++ /*mbedtls_x509_crt_free(crt);
++ return ret;*/
+ }
- /*
+ crt->issuer_raw.len = p - crt->issuer_raw.p;
--
2.39.1
From 52ff0b2e6221f38a2cea9142e9dcfaae6277cda1 Mon Sep 17 00:00:00 2001
From: flower <97859147+flowerible@users.noreply.github.com>
Date: Mon, 29 May 2023 09:03:00 -0700
Subject: [PATCH 48/56] feat: different destinations for run_number (#393)
* chore: create separate dirs
* chore: fix up naming
* feat: Update embed to include actor
* fix: fixup embed
* fix: attempt to fix embed v3
---
.github/workflows/build.yml | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index cd457f9..c868944 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -39,6 +39,10 @@ jobs:
mkdir ready
cp docs/*.html docs/mandoc.css docs/palera1n.1 ready
+ - name: Get branch name
+ id: branch-name
+ uses: tj-actions/branch-names@v7
+
- name: Upload artifact
if: ${{ github.event_name != 'pull_request' }}
uses: wangyucode/sftp-upload-action@v1.4.8
@@ -50,7 +54,7 @@ jobs:
forceUpload: true
dryRun: false
localDir: 'ready/'
- remoteDir: '/palera1n/artifacts/c-rewrite'
+ remoteDir: '/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch }}/${{ github.run_number }}'
build-darwin:
strategy:
@@ -325,6 +329,10 @@ jobs:
mkdir -p ready
tar -zcf ready/dep_root-${{ matrix.os }}-${{ matrix.arch }}.tgz dep_root
+ - name: Get branch name
+ id: branch-name
+ uses: tj-actions/branch-names@v7
+
- name: Upload artifact
if: ${{ github.event_name != 'pull_request' }}
uses: wangyucode/sftp-upload-action@v1.4.8
@@ -336,7 +344,7 @@ jobs:
forceUpload: true
dryRun: false
localDir: 'ready/'
- remoteDir: '/palera1n/artifacts/c-rewrite'
+ remoteDir: '/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch }}/${{ github.run_number }}'
- name: Upload ${{ matrix.os }} thin ${{ matrix.arch }} build
if: ${{ github.event_name != 'pull_request' }}
@@ -471,6 +479,10 @@ jobs:
name: build-tag
path: build-tag.txt
+ - name: Get branch name
+ id: branch-name
+ uses: tj-actions/branch-names@v7
+
- name: Upload artifact
if: ${{ github.event_name != 'pull_request' }}
uses: wangyucode/sftp-upload-action@v1.4.8
@@ -482,7 +494,7 @@ jobs:
forceUpload: true
dryRun: false
localDir: 'ready/'
- remoteDir: '/palera1n/artifacts/c-rewrite'
+ remoteDir: '/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch }}/${{ github.run_number }}'
build-Linux:
strategy:
@@ -780,6 +792,10 @@ jobs:
mv palera1n*.deb ready/
rm -rf stage
+ - name: Get branch name
+ id: branch-name
+ uses: tj-actions/branch-names@v7
+
- name: Upload artifact
if: ${{ github.event_name != 'pull_request' }}
uses: wangyucode/sftp-upload-action@v1.4.8
@@ -791,7 +807,7 @@ jobs:
forceUpload: true
dryRun: false
localDir: 'ready/'
- remoteDir: '/palera1n/artifacts/c-rewrite'
+ remoteDir: '/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch }}/${{ github.run_number }}'
discord-alert:
runs-on: ubuntu-latest
@@ -812,5 +828,5 @@ jobs:
- name: Send Discord build message
run: |
COMMITMESSAGE=`git log --pretty=format:'- \`%h\` %s' -1 --reverse` &&
- (curl "${{ secrets.DISCORD_WEBHOOK }}" -sS -H "Content-Type:application/json" -X POST -d "{\"content\":null,\"embeds\":[{\"title\":\"[palera1n:${BRANCH_NAME}] Nightly Build ${{ github.run_number }}\",\"url\":\"https://github.com/palera1n/palera1n/actions/runs/${GITHUB_RUN_ID}\",\"color\":2829617,\"fields\":[{\"name\":\"Build tag\",\"value\":\"- \`$(cat build-tag.txt | sed 's|\n||')\`\"},{\"name\":\"Artifacts\",\"value\":\"- [palera1n-ios](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-ios)\n- [palera1n-linux-arm64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-arm64)\n- [palera1n-linux-armel](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-armel)\n- [palera1n-linux-x86](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86)\n- [palera1n-linux-x86_64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-linux-x86_64)\n- [palera1n-macos-universal](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n-macos-universal)\n- [palera1n.1.html](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/palera1n.1.html)\"}],\"footer\":{\"text\":\"https://github.com/palera1n/palera1n\", \"icon_url\": \"https://media.discordapp.net/attachments/1054239098006683688/1107471339176071288/palera1n_ios_copy.png?width=1208&height=1208\",\"timestamp\":\"$(date -u +"%FT%TZ")\"}}],\"username\":\"GitHub Actions\",\"avatar_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}")
+ (curl "${{ secrets.DISCORD_WEBHOOK }}" -sS -H "Content-Type:application/json" -X POST -d "{\"content\":null,\"embeds\":[{\"title\":\"[palera1n:${BRANCH_NAME}] Nightly Build ${{ github.run_number }}\",\"url\":\"https://github.com/palera1n/palera1n/actions/runs/${GITHUB_RUN_ID}\",\"color\":2829617,\"fields\":[{\"name\":\"Build tag\",\"value\":\"- \`$(cat build-tag.txt | sed 's|\n||')\`\"},{\"name\":\"Destination\",\"value\":\"- https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/${BRANCH_NAME}/${{ github.run_number }}\"},{\"name\":\"Documentation\",\"value\":\"- [palera1n.1.html](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/${BRANCH_NAME}/${{ github.run_number }}/palera1n.1.html)\"},{\"name\":\"Main Artifacts\",\"value\":\"- [palera1n-ios](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/${BRANCH_NAME}/${{ github.run_number }}/palera1n-ios)\n- [palera1n-linux-arm64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/${BRANCH_NAME}/${{ github.run_number }}/palera1n-linux-arm64)\n- [palera1n-linux-armel](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/${BRANCH_NAME}/${{ github.run_number }}/palera1n-linux-armel)\n- [palera1n-linux-x86](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/${BRANCH_NAME}/${{ github.run_number }}/palera1n-linux-x86)\n- [palera1n-linux-x86_64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/${BRANCH_NAME}/${{ github.run_number }}/palera1n-linux-x86_64)\n- [palera1n-macos-universal](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/${BRANCH_NAME}/${{ github.run_number }}/palera1n-macos-universal)\"}],\"footer\":{\"text\":\"${{ github.actor }}\", \"icon_url\": \"https://github.com/${{ github.actor }}.png\",\"timestamp\":\"$(date -u +"%FT%TZ")\"}}],\"username\":\"GitHub Actions\",\"avatar_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}")
From fd80f9e63fdc6051427a71ee253aad32a6994b36 Mon Sep 17 00:00:00 2001
From: flower <97859147+flowerible@users.noreply.github.com>
Date: Mon, 29 May 2023 09:53:58 -0700
Subject: [PATCH 49/56] feat: "latest" symlink
---
.github/workflows/build.yml | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index c868944..61acec3 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -809,7 +809,7 @@ jobs:
localDir: 'ready/'
remoteDir: '/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch }}/${{ github.run_number }}'
- discord-alert:
+ finish-build:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
needs: [build-docs, build-darwin, darwin-dist, build-Linux]
@@ -818,15 +818,26 @@ jobs:
uses: actions/checkout@v3
- name: Get branch name
- uses: nelonoel/branch-name@v1.0.1
+ id: branch-name
+ uses: tj-actions/branch-names@v7
- name: Download build tag
uses: actions/download-artifact@v3
with:
name: build-tag
+ - name: Create symlink
+ run: |
+ "printf '%s' '${{ secrets.NICKCHAN_SFTP_KEY }}' > privkey.pem"
+ dir='/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref-branch }}'
+ (
+ echo "rm $dir/latest"
+ echo "ln -s $dir/${{ github.run_number }} $dir/latest"
+ ) | sftp -i privkey.pem -P ${{ secrets.NICKCHAN_FTP_PORT }} ${{ secrets.NICKCHAN_FTP_HOST }}
+ rm -f privkey.pem
+
- name: Send Discord build message
run: |
COMMITMESSAGE=`git log --pretty=format:'- \`%h\` %s' -1 --reverse` &&
- (curl "${{ secrets.DISCORD_WEBHOOK }}" -sS -H "Content-Type:application/json" -X POST -d "{\"content\":null,\"embeds\":[{\"title\":\"[palera1n:${BRANCH_NAME}] Nightly Build ${{ github.run_number }}\",\"url\":\"https://github.com/palera1n/palera1n/actions/runs/${GITHUB_RUN_ID}\",\"color\":2829617,\"fields\":[{\"name\":\"Build tag\",\"value\":\"- \`$(cat build-tag.txt | sed 's|\n||')\`\"},{\"name\":\"Destination\",\"value\":\"- https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/${BRANCH_NAME}/${{ github.run_number }}\"},{\"name\":\"Documentation\",\"value\":\"- [palera1n.1.html](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/${BRANCH_NAME}/${{ github.run_number }}/palera1n.1.html)\"},{\"name\":\"Main Artifacts\",\"value\":\"- [palera1n-ios](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/${BRANCH_NAME}/${{ github.run_number }}/palera1n-ios)\n- [palera1n-linux-arm64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/${BRANCH_NAME}/${{ github.run_number }}/palera1n-linux-arm64)\n- [palera1n-linux-armel](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/${BRANCH_NAME}/${{ github.run_number }}/palera1n-linux-armel)\n- [palera1n-linux-x86](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/${BRANCH_NAME}/${{ github.run_number }}/palera1n-linux-x86)\n- [palera1n-linux-x86_64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/${BRANCH_NAME}/${{ github.run_number }}/palera1n-linux-x86_64)\n- [palera1n-macos-universal](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/${BRANCH_NAME}/${{ github.run_number }}/palera1n-macos-universal)\"}],\"footer\":{\"text\":\"${{ github.actor }}\", \"icon_url\": \"https://github.com/${{ github.actor }}.png\",\"timestamp\":\"$(date -u +"%FT%TZ")\"}}],\"username\":\"GitHub Actions\",\"avatar_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}")
+ (curl "${{ secrets.DISCORD_WEBHOOK }}" -sS -H "Content-Type:application/json" -X POST -d "{\"content\":null,\"embeds\":[{\"title\":\"[palera1n:${{ steps.branch-name.outputs.ref_branch }}] Nightly Build ${{ github.run_number }}\",\"url\":\"https://github.com/palera1n/palera1n/actions/runs/${GITHUB_RUN_ID}\",\"color\":2829617,\"fields\":[{\"name\":\"Build tag\",\"value\":\"- \`$(cat build-tag.txt | sed 's|\n||')\`\"},{\"name\":\"Destination\",\"value\":\"- https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch }}/${{ github.run_number }}\"},{\"name\":\"Documentation\",\"value\":\"- [palera1n.1.html](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch }}/${{ github.run_number }}/palera1n.1.html)\"},{\"name\":\"Main Artifacts\",\"value\":\"- [palera1n-ios](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch }}/${{ github.run_number }}/palera1n-ios)\n- [palera1n-linux-arm64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch }}/${{ github.run_number }}/palera1n-linux-arm64)\n- [palera1n-linux-armel](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch }}/${{ github.run_number }}/palera1n-linux-armel)\n- [palera1n-linux-x86](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/$${{ steps.branch-name.outputs.ref_branch }}/${{ github.run_number }}/palera1n-linux-x86)\n- [palera1n-linux-x86_64](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch }}/${{ github.run_number }}/palera1n-linux-x86_64)\n- [palera1n-macos-universal](https://cdn.nickchan.lol/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch }}/${{ github.run_number }}/palera1n-macos-universal)\"}],\"footer\":{\"text\":\"${{ github.actor }}\", \"icon_url\": \"https://github.com/${{ github.actor }}.png\",\"timestamp\":\"$(date -u +"%FT%TZ")\"}}],\"username\":\"GitHub Actions\",\"avatar_url\":\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\"}")
From 5b32d61a1ea7ff9e2fec7d9c1f4f180a4fb9cf49 Mon Sep 17 00:00:00 2001
From: flower <97859147+flowerible@users.noreply.github.com>
Date: Mon, 29 May 2023 10:15:30 -0700
Subject: [PATCH 50/56] ci: attempt to fix finish-build symlink
---
.github/workflows/build.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 61acec3..a98b148 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -828,7 +828,7 @@ jobs:
- name: Create symlink
run: |
- "printf '%s' '${{ secrets.NICKCHAN_SFTP_KEY }}' > privkey.pem"
+ printf '%s' '${{ secrets.NICKCHAN_FTP_KEY }}' > privkey.pem
dir='/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref-branch }}'
(
echo "rm $dir/latest"
From 98f7d032eb71f17926ad483765bfb6cc140040fa Mon Sep 17 00:00:00 2001
From: flower <97859147+flowerible@users.noreply.github.com>
Date: Mon, 29 May 2023 10:33:52 -0700
Subject: [PATCH 51/56] ci: attempt to fix finish-build symlink v2
---
.github/workflows/build.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index a98b148..3ea66f9 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -833,7 +833,7 @@ jobs:
(
echo "rm $dir/latest"
echo "ln -s $dir/${{ github.run_number }} $dir/latest"
- ) | sftp -i privkey.pem -P ${{ secrets.NICKCHAN_FTP_PORT }} ${{ secrets.NICKCHAN_FTP_HOST }}
+ ) | sftp -i privkey.pem -P ${{ secrets.NICKCHAN_FTP_PORT }} ${{ secrets.NICKCHAN_FTP_HOST }} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null
rm -f privkey.pem
- name: Send Discord build message
From 5f4ef51da96c882ece14754a4b4d1906e8f58d2b Mon Sep 17 00:00:00 2001
From: flower <97859147+flowerible@users.noreply.github.com>
Date: Mon, 29 May 2023 10:48:41 -0700
Subject: [PATCH 52/56] ci: attempt to fix finish-build symlink v3
---
.github/workflows/build.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 3ea66f9..8c580c2 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -833,7 +833,7 @@ jobs:
(
echo "rm $dir/latest"
echo "ln -s $dir/${{ github.run_number }} $dir/latest"
- ) | sftp -i privkey.pem -P ${{ secrets.NICKCHAN_FTP_PORT }} ${{ secrets.NICKCHAN_FTP_HOST }} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null
+ ) | sftp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i privkey.pem -P ${{ secrets.NICKCHAN_FTP_PORT }} ${{ secrets.NICKCHAN_FTP_HOST }}
rm -f privkey.pem
- name: Send Discord build message
From e1e0304b987b1aee403fd97ae106e910011c0a43 Mon Sep 17 00:00:00 2001
From: flower <97859147+flowerible@users.noreply.github.com>
Date: Mon, 29 May 2023 11:00:41 -0700
Subject: [PATCH 53/56] ci: attempt to fix finish-build symlink v4
---
.github/workflows/build.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 8c580c2..5b746cf 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -829,6 +829,7 @@ jobs:
- name: Create symlink
run: |
printf '%s' '${{ secrets.NICKCHAN_FTP_KEY }}' > privkey.pem
+ chmod 600 privkey.pem
dir='/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref-branch }}'
(
echo "rm $dir/latest"
From 2825ccaf17c70bf8c5779be36fde592fc15a1c7f Mon Sep 17 00:00:00 2001
From: flower <97859147+flowerible@users.noreply.github.com>
Date: Mon, 29 May 2023 11:03:00 -0700
Subject: [PATCH 54/56] ci: attempt to fix finish-build symlink v5
---
.github/workflows/build.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 5b746cf..46a7878 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -834,7 +834,7 @@ jobs:
(
echo "rm $dir/latest"
echo "ln -s $dir/${{ github.run_number }} $dir/latest"
- ) | sftp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i privkey.pem -P ${{ secrets.NICKCHAN_FTP_PORT }} ${{ secrets.NICKCHAN_FTP_HOST }}
+ ) | sftp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i privkey.pem -P ${{ secrets.NICKCHAN_FTP_PORT }} palera1n@${{ secrets.NICKCHAN_FTP_HOST }}
rm -f privkey.pem
- name: Send Discord build message
From a30e2ef32aef908e60ad25ae2e2d506b1c26cfe5 Mon Sep 17 00:00:00 2001
From: flower <97859147+flowerible@users.noreply.github.com>
Date: Mon, 29 May 2023 11:21:39 -0700
Subject: [PATCH 55/56] ci: remove symlink for now
---
.github/workflows/build.yml | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 46a7878..ba8f9f1 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -826,17 +826,6 @@ jobs:
with:
name: build-tag
- - name: Create symlink
- run: |
- printf '%s' '${{ secrets.NICKCHAN_FTP_KEY }}' > privkey.pem
- chmod 600 privkey.pem
- dir='/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref-branch }}'
- (
- echo "rm $dir/latest"
- echo "ln -s $dir/${{ github.run_number }} $dir/latest"
- ) | sftp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i privkey.pem -P ${{ secrets.NICKCHAN_FTP_PORT }} palera1n@${{ secrets.NICKCHAN_FTP_HOST }}
- rm -f privkey.pem
-
- name: Send Discord build message
run: |
COMMITMESSAGE=`git log --pretty=format:'- \`%h\` %s' -1 --reverse` &&
From f80e2a884925dac2acf1f60cf0dae2a7e68b0782 Mon Sep 17 00:00:00 2001
From: flower <97859147+flowerible@users.noreply.github.com>
Date: Sat, 3 Jun 2023 16:06:40 -0700
Subject: [PATCH 56/56] Update build.yml
---
.github/workflows/build.yml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index ba8f9f1..c9f28d5 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -54,7 +54,7 @@ jobs:
forceUpload: true
dryRun: false
localDir: 'ready/'
- remoteDir: '/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch }}/${{ github.run_number }}'
+ remoteDir: "/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch || github.ref_name }}/${{ github.run_number }}"
build-darwin:
strategy:
@@ -344,7 +344,7 @@ jobs:
forceUpload: true
dryRun: false
localDir: 'ready/'
- remoteDir: '/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch }}/${{ github.run_number }}'
+ remoteDir: "/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch || github.ref }}/${{ github.run_number }}"
- name: Upload ${{ matrix.os }} thin ${{ matrix.arch }} build
if: ${{ github.event_name != 'pull_request' }}
@@ -494,7 +494,7 @@ jobs:
forceUpload: true
dryRun: false
localDir: 'ready/'
- remoteDir: '/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch }}/${{ github.run_number }}'
+ remoteDir: "/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch || github.ref }}/${{ github.run_number }}"
build-Linux:
strategy:
@@ -807,7 +807,7 @@ jobs:
forceUpload: true
dryRun: false
localDir: 'ready/'
- remoteDir: '/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch }}/${{ github.run_number }}'
+ remoteDir: "/palera1n/artifacts/c-rewrite/${{ steps.branch-name.outputs.ref_branch || github.ref }}/${{ github.run_number }}"
finish-build:
runs-on: ubuntu-latest