Compare commits

..
6 Commits
Author SHA1 Message Date
Nick Chan 0926171d35 6
Signed-off-by: Nick Chan <[email protected]>
2024-12-23 12:00:49 +08:00
Nick Chan 030c65622e 5 2024-12-23 11:56:41 +08:00
Nick Chan 092c2949cf 4 2024-12-23 11:51:45 +08:00
Nick Chan e585d1f7c3 3 2024-12-23 11:44:31 +08:00
Nick Chan b951f8d882 fix actions v2 2024-12-23 11:34:47 +08:00
Nick Chan 66f4d290ca possibly fix actions 2024-12-23 11:30:18 +08:00
19 changed files with 101 additions and 94 deletions

No files matched your search

+3
View File
@@ -3,3 +3,6 @@ contact_links:
- name: Mention us on X (formerly known as Twitter) - name: Mention us on X (formerly known as Twitter)
url: https://twitter.com/palera1n url: https://twitter.com/palera1n
about: Mention us about your issue if you're not comfortable with using Github issues. about: Mention us about your issue if you're not comfortable with using Github issues.
- name: Support Server
url: https://dsc.gg/palera1n
about: If you wanna ask support via Discord, thats an available option as well. Though, we recommend you do one of the previous options if possible.
+18 -18
View File
@@ -26,7 +26,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v3
- name: Install dependencies (packages) - name: Install dependencies (packages)
run: | run: |
@@ -41,7 +41,7 @@ jobs:
- name: Get branch name - name: Get branch name
id: branch-name id: branch-name
uses: tj-actions/branch-names@v9 uses: tj-actions/branch-names@v7
- name: Upload artifact - name: Upload artifact
if: ${{ github.event_name != 'pull_request' }} if: ${{ github.event_name != 'pull_request' }}
@@ -84,7 +84,7 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v3
with: with:
fetch-depth: 0 fetch-depth: 0
@@ -332,7 +332,7 @@ jobs:
- name: Get branch name - name: Get branch name
id: branch-name id: branch-name
uses: tj-actions/branch-names@v9 uses: tj-actions/branch-names@v7
- name: Upload artifact - name: Upload artifact
if: ${{ github.event_name != 'pull_request' }} if: ${{ github.event_name != 'pull_request' }}
@@ -349,7 +349,7 @@ jobs:
- name: Upload ${{ matrix.os }} thin ${{ matrix.arch }} build - name: Upload ${{ matrix.os }} thin ${{ matrix.arch }} build
if: ${{ github.event_name != 'pull_request' }} if: ${{ github.event_name != 'pull_request' }}
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3
with: with:
name: palera1n-${{ matrix.os }}-${{ matrix.arch }} name: palera1n-${{ matrix.os }}-${{ matrix.arch }}
path: palera1n-${{ matrix.os }}-${{ matrix.arch }} path: palera1n-${{ matrix.os }}-${{ matrix.arch }}
@@ -357,7 +357,7 @@ jobs:
- name: Upload ${{ matrix.os }} thin ${{ matrix.arch }} build (Development) - name: Upload ${{ matrix.os }} thin ${{ matrix.arch }} build (Development)
if: ${{ github.event_name != 'pull_request' }} if: ${{ github.event_name != 'pull_request' }}
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3
with: with:
name: palera1n-${{ matrix.os }}-${{ matrix.arch }}.development name: palera1n-${{ matrix.os }}-${{ matrix.arch }}.development
path: palera1n-${{ matrix.os }}-${{ matrix.arch }}.development path: palera1n-${{ matrix.os }}-${{ matrix.arch }}.development
@@ -366,7 +366,7 @@ jobs:
- name: Upload ${{ matrix.os }} thin ${{ matrix.arch }} debug symbols - name: Upload ${{ matrix.os }} thin ${{ matrix.arch }} debug symbols
if: ${{ github.event_name != 'pull_request' }} if: ${{ github.event_name != 'pull_request' }}
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3
with: with:
name: palera1n-${{ matrix.os }}-${{ matrix.arch }}.dSYM name: palera1n-${{ matrix.os }}-${{ matrix.arch }}.dSYM
path: palera1n-${{ matrix.os }}-${{ matrix.arch }}.dSYM path: palera1n-${{ matrix.os }}-${{ matrix.arch }}.dSYM
@@ -383,7 +383,7 @@ jobs:
needs: build-darwin needs: build-darwin
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v3
with: with:
fetch-depth: 0 fetch-depth: 0
@@ -395,7 +395,7 @@ jobs:
mirror: 'https://apt.procurs.us/' mirror: 'https://apt.procurs.us/'
- name: Download all Darwin artifacts - name: Download all Darwin artifacts
uses: actions/download-artifact@v4 uses: actions/download-artifact@v3
- name: Prepare artifact - name: Prepare artifact
run: | run: |
@@ -497,14 +497,14 @@ jobs:
run: echo "$(git describe --dirty --tags --abbrev=7 | sed 's|-dirty||')" > build-tag.txt run: echo "$(git describe --dirty --tags --abbrev=7 | sed 's|-dirty||')" > build-tag.txt
- name: Upload build tag - name: Upload build tag
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3
with: with:
name: build-tag name: build-tag
path: build-tag.txt path: build-tag.txt
- name: Get branch name - name: Get branch name
id: branch-name id: branch-name
uses: tj-actions/branch-names@v9 uses: tj-actions/branch-names@v7
- name: Upload artifact - name: Upload artifact
if: ${{ github.event_name != 'pull_request' }} if: ${{ github.event_name != 'pull_request' }}
@@ -542,7 +542,7 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v3
with: with:
fetch-depth: 0 fetch-depth: 0
@@ -554,7 +554,7 @@ jobs:
- name: Download toolchain checksum - name: Download toolchain checksum
run: | run: |
curl -u ${{ secrets.ACTIONS_RESOURCES_LOGIN }} -LO https://static.palera.in/action-resources/musl-cross/SHA512SUMS curl -LO https://musl.cc/SHA512SUMS
echo "TOOLCHAIN_CHECKSUM="$(grep ${{ matrix.triple }}-cross.tgz SHA512SUMS | cut -d' ' -f1) >> $GITHUB_ENV echo "TOOLCHAIN_CHECKSUM="$(grep ${{ matrix.triple }}-cross.tgz SHA512SUMS | cut -d' ' -f1) >> $GITHUB_ENV
- name: Download toolchain (cached) - name: Download toolchain (cached)
@@ -567,7 +567,7 @@ jobs:
- name: Download toolchain - name: Download toolchain
if: steps.toolchain_cache.outputs.cache-hit != 'true' if: steps.toolchain_cache.outputs.cache-hit != 'true'
run: | run: |
curl -u ${{ secrets.ACTIONS_RESOURCES_LOGIN }} -LO https://static.palera.in/action-resources/musl-cross/${{ matrix.triple }}-cross.tgz curl -LO https://musl.cc/${{ matrix.triple }}-cross.tgz
- name: Setup environment - name: Setup environment
run: | run: |
@@ -844,7 +844,7 @@ jobs:
- name: Get branch name - name: Get branch name
id: branch-name id: branch-name
uses: tj-actions/branch-names@v9 uses: tj-actions/branch-names@v7
- name: Upload artifact - name: Upload artifact
if: ${{ github.event_name != 'pull_request' }} if: ${{ github.event_name != 'pull_request' }}
@@ -883,14 +883,14 @@ jobs:
needs: [build-docs, build-darwin, darwin-dist, build-Linux] needs: [build-docs, build-darwin, darwin-dist, build-Linux]
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v3
- name: Get branch name - name: Get branch name
id: branch-name id: branch-name
uses: tj-actions/branch-names@v9 uses: tj-actions/branch-names@v7
- name: Download build tag - name: Download build tag
uses: actions/download-artifact@v4 uses: actions/download-artifact@v3
with: with:
name: build-tag name: build-tag
+2 -2
View File
@@ -6,7 +6,7 @@
.Dt palera1n 1 .Dt palera1n 1
.Sh NAME .Sh NAME
.Nm palera1n .Nm palera1n
.Nd arm64 iOS/iPadOS/tvOS 15.0-26.0, bridgeOS 5.0-10.0 jailbreaking tool .Nd arm64 iOS/iPadOS/tvOS 15.0-18.3, bridgeOS 5.0-9.3 jailbreaking tool
.Sh SYNOPSIS .Sh SYNOPSIS
.Nm .Nm
.Op Fl cCdDEfhIlLnpRsSTvV .Op Fl cCdDEfhIlLnpRsSTvV
@@ -20,7 +20,7 @@
.Op Fl -force-revert .Op Fl -force-revert
.Sh DESCRIPTION .Sh DESCRIPTION
.Nm .Nm
jailbreaks an arm64 (arm64e excluded) iOS/iPadOS/tvOS 15.0-26.0, bridgeOS 5.0-10.0 device, jailbreaks an arm64 (arm64e excluded) iOS/iPadOS/tvOS 15.0-18.2, bridgeOS 5.0-9.2 device,
utilizing the utilizing the
.Em checkm8 .Em checkm8
bootROM exploit. bootROM exploit.
+5 -1
View File
@@ -72,7 +72,7 @@ usb_ret_t USBBulkUpload(usb_device_handle_t handle, void *data, uint32_t len);
#endif #endif
#ifndef PALERAIN_VERSION #ifndef PALERAIN_VERSION
#define PALERAIN_VERSION "2.2.1" #define PALERAIN_VERSION "2.1"
#endif #endif
#if defined(__APPLE__) #if defined(__APPLE__)
@@ -204,9 +204,12 @@ boyermoore_horspool_memmem(const unsigned char* haystack, size_t hlen,
const unsigned char* needle, size_t nlen); const unsigned char* needle, size_t nlen);
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); 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); const char *usb_strerror(usb_ret_t err);
int wait_for_pongo(void); int wait_for_pongo(void);
int upload_pongo_file(usb_device_handle_t, unsigned char*, unsigned int);
int issue_pongo_command(usb_device_handle_t, char*);
int tui(void); int tui(void);
int optparse(int argc, char* argv[]); int optparse(int argc, char* argv[]);
@@ -218,6 +221,7 @@ bool set_found_pongo(bool val);
uint64_t get_ecid_wait_for_dfu(void); uint64_t get_ecid_wait_for_dfu(void);
uint64_t set_ecid_wait_for_dfu(uint64_t ecid); uint64_t set_ecid_wait_for_dfu(uint64_t ecid);
void write_stdout(char *buf, uint32_t len);
void io_start(stuff_t *stuff); void io_start(stuff_t *stuff);
void io_stop(stuff_t *stuff); void io_stop(stuff_t *stuff);
+6
View File
@@ -102,9 +102,12 @@ void tui_draw_rectangle(int x1, int y1, int x2, int y2);
#define TUI_VERSION "Unknown Version" #define TUI_VERSION "Unknown Version"
#endif #endif
extern int tui_state;
extern int tui_x_offset; extern int tui_x_offset;
extern int tui_y_offset; extern int tui_y_offset;
extern bool tui_can_start;
extern int tui_mouse_x; extern int tui_mouse_x;
extern int tui_mouse_y; extern int tui_mouse_y;
@@ -164,6 +167,8 @@ struct tui_connected_device {
extern struct tui_connected_device *tui_connected_devices; extern struct tui_connected_device *tui_connected_devices;
int tui_compare_versions(const char *firstVersion, const char *secondVersion);
void tui_jailbreak(void); void tui_jailbreak(void);
extern bool tui_is_jailbreaking; extern bool tui_is_jailbreaking;
extern int tui_jailbreak_stage; extern int tui_jailbreak_stage;
@@ -174,6 +179,7 @@ void tui_jailbreak_status_changed(void);
extern bool tui_is_restarting; extern bool tui_is_restarting;
void tui_terminate(int sig); void tui_terminate(int sig);
extern bool tui_options_allow_untested;
extern bool tui_options_safe_mode; extern bool tui_options_safe_mode;
extern bool tui_options_verbose_boot; extern bool tui_options_verbose_boot;
extern bool tui_options_force_revert; extern bool tui_options_force_revert;
+6 -6
View File
@@ -40,7 +40,7 @@
int dfuhelper_thr_running = false; int dfuhelper_thr_running = false;
static void step(int time, int time2, char *text, bool (*cond)(uint64_t), uint64_t cond_arg) { void step(int time, int time2, char *text, bool (*cond)(uint64_t), uint64_t cond_arg) {
for (int i = time2; i < time; i++) { for (int i = time2; i < time; i++) {
printf( printf(
(palerain_flags & palerain_option_no_colors) (palerain_flags & palerain_option_no_colors)
@@ -59,7 +59,7 @@ static void step(int time, int time2, char *text, bool (*cond)(uint64_t), uint64
if (time2 == 0) puts(""); if (time2 == 0) puts("");
} }
static int connected_normal_mode(const usbmuxd_device_info_t *usbmuxd_device) { int connected_normal_mode(const usbmuxd_device_info_t *usbmuxd_device) {
devinfo_t dev; devinfo_t dev;
int ret; int ret;
ret = devinfo_cmd(&dev, usbmuxd_device->udid); ret = devinfo_cmd(&dev, usbmuxd_device->udid);
@@ -133,7 +133,7 @@ static bool conditional(uint64_t ecid) {
return get_ecid_wait_for_dfu() != ecid; return get_ecid_wait_for_dfu() != ecid;
} }
static void* connected_recovery_mode(struct irecv_device_info* info) { void* connected_recovery_mode(struct irecv_device_info* info) {
int ret; int ret;
uint64_t ecid; uint64_t ecid;
uint32_t cpid, bdid; uint32_t cpid, bdid;
@@ -223,7 +223,7 @@ static void* connected_recovery_mode(struct irecv_device_info* info) {
return NULL; return NULL;
} }
static void* connected_dfu_mode(struct irecv_device_info* info) { void* connected_dfu_mode(struct irecv_device_info* info) {
if (get_ecid_wait_for_dfu() == info->ecid) { if (get_ecid_wait_for_dfu() == info->ecid) {
set_ecid_wait_for_dfu(0); set_ecid_wait_for_dfu(0);
puts(""); puts("");
@@ -240,7 +240,7 @@ static void* connected_dfu_mode(struct irecv_device_info* info) {
return NULL; return NULL;
} }
static void device_event_cb(const usbmuxd_event_t *event, void* userdata) { void device_event_cb(const usbmuxd_event_t *event, void* userdata) {
if (event->device.conn_type != CONNECTION_TYPE_USB) return; if (event->device.conn_type != CONNECTION_TYPE_USB) return;
switch (event->event) { switch (event->event) {
case UE_DEVICE_ADD: case UE_DEVICE_ADD:
@@ -265,7 +265,7 @@ static void device_event_cb(const usbmuxd_event_t *event, void* userdata) {
} }
} }
static void irecv_device_event_cb(const irecv_device_event_t *event, void* userdata) { void irecv_device_event_cb(const irecv_device_event_t *event, void* userdata) {
pthread_t recovery_thread, dfu_thread; pthread_t recovery_thread, dfu_thread;
int ret; int ret;
+2 -2
View File
@@ -57,7 +57,7 @@ void thr_cleanup(void* ptr) {
*(int*)ptr = 0; *(int*)ptr = 0;
} }
static int build_checks(void) { int build_checks(void) {
#ifndef NO_CHECKRAIN #ifndef NO_CHECKRAIN
#if defined(__APPLE__) #if defined(__APPLE__)
struct mach_header_64* c1_header = (struct mach_header_64*)&checkra1n[0]; struct mach_header_64* c1_header = (struct mach_header_64*)&checkra1n[0];
@@ -96,7 +96,7 @@ int saved_argc;
char** saved_argv; char** saved_argv;
char** saved_envp; char** saved_envp;
static int palera1n(int argc, char *argv[], char *envp[]) { int palera1n(int argc, char *argv[], char *envp[]) {
saved_argc = argc; saved_argc = argc;
saved_argv = argv; saved_argv = argv;
saved_envp = envp; saved_envp = envp;
+1 -1
View File
@@ -77,7 +77,7 @@ static int usage(int e, char* prog_name)
#endif #endif
"] [-e boot arguments] [-k Pongo image] [-o overlay file] [-r ramdisk file] [-K KPF file] [-i checkra1n file]\n" "] [-e boot arguments] [-k Pongo image] [-o overlay file] [-r ramdisk file] [-K KPF file] [-i checkra1n file]\n"
"Copyright (C) 2024, palera1n team, All Rights Reserved.\n\n" "Copyright (C) 2024, palera1n team, All Rights Reserved.\n\n"
"iOS/iPadOS/tvOS 15.0-26.0, bridgeOS 5.0-10.0 arm64 jailbreaking tool\n\n" "iOS/iPadOS/tvOS 15.0-18.1, bridgeOS 5.0-9.1 arm64 jailbreaking tool\n\n"
"\t--version\t\t\t\tPrint version\n" "\t--version\t\t\t\tPrint version\n"
"\t--force-revert\t\t\t\tRemove jailbreak\n" "\t--force-revert\t\t\t\tRemove jailbreak\n"
#ifdef DEV_BUILD #ifdef DEV_BUILD
+1
View File
@@ -14,6 +14,7 @@
#include <sys/mman.h> #include <sys/mman.h>
#include <errno.h> #include <errno.h>
int override_file(override_file_t *finfo, niarelap_file_t** orig, unsigned int *orig_len, char *filename) { int override_file(override_file_t *finfo, niarelap_file_t** orig, unsigned int *orig_len, char *filename) {
int ret = 0; int ret = 0;
int fd = open(filename, O_RDONLY); int fd = open(filename, O_RDONLY);
+4 -8
View File
@@ -21,10 +21,6 @@ int pongo_thr_running = 0;
#define ERR(...) LOG(LOG_VERBOSE, __VA_ARGS__) #define ERR(...) LOG(LOG_VERBOSE, __VA_ARGS__)
static int issue_pongo_command(usb_device_handle_t, char*);
static int upload_pongo_file(usb_device_handle_t, unsigned char*, unsigned int);
static void write_stdout(char *buf, uint32_t len);
void* pongo_helper(void* ptr) { void* pongo_helper(void* ptr) {
pongo_thr_running = 1; pongo_thr_running = 1;
pthread_cleanup_push(thr_cleanup, &pongo_thr_running); pthread_cleanup_push(thr_cleanup, &pongo_thr_running);
@@ -36,7 +32,7 @@ void* pongo_helper(void* ptr) {
return NULL; return NULL;
} }
static void *pongo_usb_callback(stuff_t *arg) { void *pongo_usb_callback(stuff_t *arg) {
if (get_found_pongo()) if (get_found_pongo())
return NULL; return NULL;
set_found_pongo(1); set_found_pongo(1);
@@ -149,7 +145,7 @@ done:
return NULL; return NULL;
} }
static int issue_pongo_command(usb_device_handle_t handle, char *command) int issue_pongo_command(usb_device_handle_t handle, char *command)
{ {
uint32_t outpos = 0; uint32_t outpos = 0;
uint32_t outlen = 0; uint32_t outlen = 0;
@@ -211,7 +207,7 @@ bad:
return ret; return ret;
} }
static int upload_pongo_file(usb_device_handle_t handle, unsigned char *buf, unsigned int buf_len) int upload_pongo_file(usb_device_handle_t handle, unsigned char *buf, unsigned int buf_len)
{ {
int ret = 0; int ret = 0;
ret = USBControlTransfer(handle, 0x21, 1, 0, 0, 4, &buf_len, NULL); ret = USBControlTransfer(handle, 0x21, 1, 0, 0, 4, &buf_len, NULL);
@@ -267,7 +263,7 @@ void io_stop(stuff_t *stuff)
#endif #endif
} }
static void write_stdout(char *buf, uint32_t len) void write_stdout(char *buf, uint32_t len)
{ {
while(len > 0) { while(len > 0) {
if (verbose >= 3) { if (verbose >= 3) {
+9 -9
View File
@@ -3,7 +3,7 @@
#include <palerain.h> #include <palerain.h>
#include <tui.h> #include <tui.h>
static irecv_device_t tui_get_recovery_device(uint64_t ecid) { irecv_device_t tui_get_recovery_device(uint64_t ecid) {
irecv_client_t client = NULL; irecv_client_t client = NULL;
for (int i = 0; i <= 5; i++) { for (int i = 0; i <= 5; i++) {
irecv_error_t err = irecv_open_with_ecid(&client, ecid); irecv_error_t err = irecv_open_with_ecid(&client, ecid);
@@ -28,7 +28,7 @@ static irecv_device_t tui_get_recovery_device(uint64_t ecid) {
struct tui_connected_device *tui_connected_devices = NULL; struct tui_connected_device *tui_connected_devices = NULL;
static void* tui_connected_recovery_mode(struct irecv_device_info* info) { void* tui_connected_recovery_mode(struct irecv_device_info* info) {
//printf("Recovery mode device %" PRIu64 " connected\n", info->ecid); //printf("Recovery mode device %" PRIu64 " connected\n", info->ecid);
tui_last_event = TUI_EVENT_CONNECTED_DEVICES_CHANGED; tui_last_event = TUI_EVENT_CONNECTED_DEVICES_CHANGED;
sem_post(tui_event_semaphore); sem_post(tui_event_semaphore);
@@ -36,7 +36,7 @@ static void* tui_connected_recovery_mode(struct irecv_device_info* info) {
return NULL; return NULL;
} }
static void* tui_disconnected_recovery_mode(struct irecv_device_info* info) { void* tui_disconnected_recovery_mode(struct irecv_device_info* info) {
//printf("Recovery mode device %" PRIu64 " disconnected\n", info->ecid); //printf("Recovery mode device %" PRIu64 " disconnected\n", info->ecid);
tui_last_event = TUI_EVENT_CONNECTED_DEVICES_CHANGED; tui_last_event = TUI_EVENT_CONNECTED_DEVICES_CHANGED;
sem_post(tui_event_semaphore); sem_post(tui_event_semaphore);
@@ -44,7 +44,7 @@ static void* tui_disconnected_recovery_mode(struct irecv_device_info* info) {
return NULL; return NULL;
} }
static void* tui_connected_dfu_mode(struct irecv_device_info* info) { void* tui_connected_dfu_mode(struct irecv_device_info* info) {
//printf("DFU mode device %" PRIu64 " connected\n", info->ecid); //printf("DFU mode device %" PRIu64 " connected\n", info->ecid);
tui_last_event = TUI_EVENT_CONNECTED_DEVICES_CHANGED; tui_last_event = TUI_EVENT_CONNECTED_DEVICES_CHANGED;
sem_post(tui_event_semaphore); sem_post(tui_event_semaphore);
@@ -52,7 +52,7 @@ static void* tui_connected_dfu_mode(struct irecv_device_info* info) {
return NULL; return NULL;
} }
static void* tui_disconnected_dfu_mode(struct irecv_device_info* info) { void* tui_disconnected_dfu_mode(struct irecv_device_info* info) {
//printf("DFU mode device %" PRIu64 " disconnected\n", info->ecid); //printf("DFU mode device %" PRIu64 " disconnected\n", info->ecid);
tui_last_event = TUI_EVENT_CONNECTED_DEVICES_CHANGED; tui_last_event = TUI_EVENT_CONNECTED_DEVICES_CHANGED;
sem_post(tui_event_semaphore); sem_post(tui_event_semaphore);
@@ -60,7 +60,7 @@ static void* tui_disconnected_dfu_mode(struct irecv_device_info* info) {
return NULL; return NULL;
} }
static int tui_connected_normal_mode(const usbmuxd_device_info_t *usbmuxd_device) { int tui_connected_normal_mode(const usbmuxd_device_info_t *usbmuxd_device) {
struct tui_connected_device *tui_dev = malloc(sizeof(struct tui_connected_device)); struct tui_connected_device *tui_dev = malloc(sizeof(struct tui_connected_device));
strcpy(tui_dev->udid, usbmuxd_device->udid); strcpy(tui_dev->udid, usbmuxd_device->udid);
tui_dev->next = tui_connected_devices; tui_dev->next = tui_connected_devices;
@@ -105,7 +105,7 @@ static int tui_connected_normal_mode(const usbmuxd_device_info_t *usbmuxd_device
return 0; return 0;
} }
static void tui_disconnected_normal_mode(const usbmuxd_device_info_t *usbmuxd_device) { void tui_disconnected_normal_mode(const usbmuxd_device_info_t *usbmuxd_device) {
struct tui_connected_device *cur = tui_connected_devices; struct tui_connected_device *cur = tui_connected_devices;
struct tui_connected_device *prev = NULL; struct tui_connected_device *prev = NULL;
while (cur) { while (cur) {
@@ -126,7 +126,7 @@ static void tui_disconnected_normal_mode(const usbmuxd_device_info_t *usbmuxd_de
sem_post(tui_event_semaphore); sem_post(tui_event_semaphore);
} }
static void tui_device_event_cb(const usbmuxd_event_t *event, void* userdata) { void tui_device_event_cb(const usbmuxd_event_t *event, void* userdata) {
if (event->device.conn_type != CONNECTION_TYPE_USB) return; if (event->device.conn_type != CONNECTION_TYPE_USB) return;
switch (event->event) { switch (event->event) {
case UE_DEVICE_ADD: case UE_DEVICE_ADD:
@@ -140,7 +140,7 @@ static void tui_device_event_cb(const usbmuxd_event_t *event, void* userdata) {
} }
} }
static void tui_irecv_device_event_cb(const irecv_device_event_t *event, void* userdata) { void tui_irecv_device_event_cb(const irecv_device_event_t *event, void* userdata) {
pthread_t recovery_thread, dfu_thread; pthread_t recovery_thread, dfu_thread;
int ret; int ret;
+5 -6
View File
@@ -28,14 +28,13 @@ int proc_pidpath(int pid, void * buffer, uint32_t buffersize);
char random_sem_name[sizeof("palera1n.tui_event_semaphore") + 16 + 1]; char random_sem_name[sizeof("palera1n.tui_event_semaphore") + 16 + 1];
#endif #endif
static int tui_state = 0; int tui_state = 0;
int tui_x_offset = 0; int tui_x_offset = 0;
int tui_y_offset = 0; int tui_y_offset = 0;
bool supports_bright_colors = true; bool supports_bright_colors = true;
static struct termios saved_termios; struct termios saved_termios;
int redraw_screen(void) { int redraw_screen(void) {
SETCOLOR(FG_BRIGHT_WHITE, BG_BLACK); SETCOLOR(FG_BRIGHT_WHITE, BG_BLACK);
@@ -84,7 +83,7 @@ int redraw_screen(void) {
return 0; return 0;
} }
static int destroy_window(void) { int destroy_window(void) {
if (!tui_started) return 0; if (!tui_started) return 0;
tui_started = false; tui_started = false;
tcsetattr(STDIN_FILENO, 0, &saved_termios); tcsetattr(STDIN_FILENO, 0, &saved_termios);
@@ -98,7 +97,7 @@ static int destroy_window(void) {
return 0; return 0;
} }
static int init_window(void) { int init_window(void) {
setlocale(LC_ALL, NULL); setlocale(LC_ALL, NULL);
tui_started = true; tui_started = true;
@@ -152,7 +151,7 @@ void tui_terminate(int sig) {
} }
} }
static void resize_handler(int sig) { void resize_handler(int sig) {
redraw_screen(); redraw_screen();
} }
+10 -10
View File
@@ -28,9 +28,9 @@
#include <palerain.h> #include <palerain.h>
#include <tui.h> #include <tui.h>
static int tui_enter_dfu_nav_selection = 1; int tui_enter_dfu_nav_selection = 1;
static bool tui_device_is_entering_dfu = false; bool tui_device_is_entering_dfu = false;
static int tui_enter_dfu_status = 0; int tui_enter_dfu_status = 0;
enum { enum {
DEVICE_TYPE_IPHONE_SE, DEVICE_TYPE_IPHONE_SE,
@@ -41,7 +41,7 @@ enum {
DEVICE_TYPE_IPOD_TOUCH DEVICE_TYPE_IPOD_TOUCH
} device_type; } device_type;
static int tui_product_type_to_device_type(char *product_type) { int tui_product_type_to_device_type(char *product_type) {
if (strcmp(product_type, "iPhone8,1") == 0 || strcmp(product_type, "iPhone8,2") == 0) { if (strcmp(product_type, "iPhone8,1") == 0 || strcmp(product_type, "iPhone8,2") == 0) {
return DEVICE_TYPE_IPHONE_6S; return DEVICE_TYPE_IPHONE_6S;
} }
@@ -68,11 +68,11 @@ static int tui_product_type_to_device_type(char *product_type) {
return DEVICE_TYPE_IPHONE_SE; return DEVICE_TYPE_IPHONE_SE;
} }
static int tui_enter_dfu_device_type = DEVICE_TYPE_IPHONE_SE; int tui_enter_dfu_device_type = DEVICE_TYPE_IPHONE_SE;
static int tui_enter_dfu_loading_progress = 1; int tui_enter_dfu_loading_progress = 1;
static void tui_screen_enter_dfu_nav(void) { void tui_screen_enter_dfu_nav(void) {
MOVETOT(80 - 22, 23); MOVETOT(80 - 22, 23);
printf("%s[ Cancel ]" COLOR(FG_WHITE, BG_BLACK) " %s[ %s ]" COLOR(FG_WHITE, BG_BLACK), printf("%s[ Cancel ]" COLOR(FG_WHITE, BG_BLACK) " %s[ %s ]" COLOR(FG_WHITE, BG_BLACK),
tui_device_is_entering_dfu || tui_enter_dfu_status == 1 ? (supports_bright_colors ? COLOR(FG_BRIGHT_BLACK, BG_BLACK) : COLOR(FG_BLUE, BG_BLACK)) : tui_enter_dfu_nav_selection == 0 ? "\033[30;107m" : ( tui_device_is_entering_dfu || tui_enter_dfu_status == 1 ? (supports_bright_colors ? COLOR(FG_BRIGHT_BLACK, BG_BLACK) : COLOR(FG_BLUE, BG_BLACK)) : tui_enter_dfu_nav_selection == 0 ? "\033[30;107m" : (
@@ -343,9 +343,9 @@ void tui_screen_enter_dfu_redraw(void) {
} }
// TODO: IMPLEMENT REAL ENTER RECOVERY // TODO: IMPLEMENT REAL ENTER RECOVERY
static int dfu_time = 0; int dfu_time = 0;
static tui_screen_t tui_enter_dfu(void) { tui_screen_t tui_enter_dfu(void) {
if (tui_connected_devices && !tui_connected_devices->next) { if (tui_connected_devices && !tui_connected_devices->next) {
if (tui_connected_devices->mode == TUI_DEVICE_MODE_NORMAL) { if (tui_connected_devices->mode == TUI_DEVICE_MODE_NORMAL) {
tui_enter_dfu_status = 0; tui_enter_dfu_status = 0;
@@ -391,7 +391,7 @@ static tui_screen_t tui_enter_dfu(void) {
return JAILBREAK_SCREEN; return JAILBREAK_SCREEN;
} }
static int tui_enter_dfu_nav_mouse_select = -1; int tui_enter_dfu_nav_mouse_select = -1;
tui_screen_t tui_screen_enter_dfu(void) { tui_screen_t tui_screen_enter_dfu(void) {
if (tui_connected_devices && !tui_connected_devices->next) { if (tui_connected_devices && !tui_connected_devices->next) {
+9 -9
View File
@@ -18,7 +18,7 @@ int tui_enter_recovery_nav_selection = 1;
bool tui_device_is_entering_recovery = false; bool tui_device_is_entering_recovery = false;
bool tui_enter_recovery_mode_failed = false; bool tui_enter_recovery_mode_failed = false;
static void tui_screen_enter_recovery_nav(void) { void tui_screen_enter_recovery_nav(void) {
MOVETOT(80 - 22, 23); MOVETOT(80 - 22, 23);
printf("%s[ Back ]" COLOR(FG_WHITE, BG_BLACK) " %s[ Next ]" COLOR(FG_WHITE, BG_BLACK), printf("%s[ Back ]" COLOR(FG_WHITE, BG_BLACK) " %s[ Next ]" COLOR(FG_WHITE, BG_BLACK),
tui_device_is_entering_recovery ? (supports_bright_colors ? COLOR(FG_BRIGHT_BLACK, BG_BLACK) : COLOR(FG_BLUE, BG_BLACK)) : tui_enter_recovery_nav_selection == 0 ? "\033[30;107m" : ( tui_device_is_entering_recovery ? (supports_bright_colors ? COLOR(FG_BRIGHT_BLACK, BG_BLACK) : COLOR(FG_BLUE, BG_BLACK)) : tui_enter_recovery_nav_selection == 0 ? "\033[30;107m" : (
@@ -34,7 +34,7 @@ static void tui_screen_enter_recovery_nav(void) {
); );
} }
static char enter_recovery_loading[9][8] = { char enter_recovery_loading[9][8] = {
"........", "........",
"|.......", "|.......",
".|......", ".|......",
@@ -46,7 +46,7 @@ static char enter_recovery_loading[9][8] = {
".......|" ".......|"
}; };
static char enter_recovery_loading_troll[9][8] = { char enter_recovery_loading_troll[9][8] = {
".......", ".......",
"t......", "t......",
".r.....", ".r.....",
@@ -57,10 +57,10 @@ static char enter_recovery_loading_troll[9][8] = {
"......d", "......d",
}; };
static bool is_troll; bool is_troll;
static int tui_enter_recovery_loading_progress = 0; int tui_enter_recovery_loading_progress = 0;
static void tui_screen_enter_recovery_loading(void) { void tui_screen_enter_recovery_loading(void) {
SETCOLOR(FG_YELLOW, BG_BLACK); SETCOLOR(FG_YELLOW, BG_BLACK);
PRINTATT(3, 8, "Entering recovery mode "); PRINTATT(3, 8, "Entering recovery mode ");
printf("%.8s", is_troll ? enter_recovery_loading_troll[tui_enter_recovery_loading_progress] : enter_recovery_loading[tui_enter_recovery_loading_progress]); printf("%.8s", is_troll ? enter_recovery_loading_troll[tui_enter_recovery_loading_progress] : enter_recovery_loading[tui_enter_recovery_loading_progress]);
@@ -88,9 +88,9 @@ void tui_screen_enter_recovery_redraw(void) {
fflush(stdout); fflush(stdout);
} }
static int recovery_time = 0; int recovery_time = 0;
static tui_screen_t tui_enter_recovery(void) { tui_screen_t tui_enter_recovery(void) {
enter_recovery_cmd(tui_connected_devices->udid); enter_recovery_cmd(tui_connected_devices->udid);
is_troll = false; is_troll = false;
if (rand() % 1000 == 0) { if (rand() % 1000 == 0) {
@@ -128,7 +128,7 @@ static tui_screen_t tui_enter_recovery(void) {
} }
} }
static int tui_enter_recovery_nav_mouse_select = -1; int tui_enter_recovery_nav_mouse_select = -1;
tui_screen_t tui_screen_enter_recovery(void) { tui_screen_t tui_screen_enter_recovery(void) {
tui_device_is_entering_recovery = false; tui_device_is_entering_recovery = false;
+4 -5
View File
@@ -15,7 +15,7 @@
bool tui_is_jailbreaking = false; bool tui_is_jailbreaking = false;
static void tui_screen_jailbreak_nav(void) { void tui_screen_jailbreak_nav(void) {
if (tui_is_jailbreaking) { if (tui_is_jailbreaking) {
if (supports_bright_colors) { if (supports_bright_colors) {
SETCOLOR(FG_BRIGHT_BLACK, BG_BLACK); SETCOLOR(FG_BRIGHT_BLACK, BG_BLACK);
@@ -29,8 +29,7 @@ static void tui_screen_jailbreak_nav(void) {
SETCOLOR(FG_WHITE, BG_BLACK); SETCOLOR(FG_WHITE, BG_BLACK);
} }
static pthread_t tui_jailbreak_thread_id; pthread_t tui_jailbreak_thread_id;
int tui_jailbreak_stage = 0; int tui_jailbreak_stage = 0;
char *tui_jailbreak_status = NULL; char *tui_jailbreak_status = NULL;
@@ -39,7 +38,7 @@ void tui_jailbreak_status_changed(void) {
sem_post(tui_event_semaphore); sem_post(tui_event_semaphore);
} }
static void *tui_jailbreak_thread(void *arg) { void *tui_jailbreak_thread(void *arg) {
tui_jailbreak_stage = 1; tui_jailbreak_stage = 1;
tui_jailbreak_status = "About to execute checkra1n"; tui_jailbreak_status = "About to execute checkra1n";
@@ -122,7 +121,7 @@ void tui_screen_jailbreak_redraw(void) {
tui_screen_jailbreak_nav(); tui_screen_jailbreak_nav();
} }
static int tui_jailbreak_nav_mouse_select = -1; int tui_jailbreak_nav_mouse_select = -1;
tui_screen_t tui_screen_jailbreak(void) { tui_screen_t tui_screen_jailbreak(void) {
redraw_screen(); redraw_screen();
+10 -12
View File
@@ -13,11 +13,9 @@
#include <palerain.h> #include <palerain.h>
#include <tui.h> #include <tui.h>
static int tui_compare_versions(const char *firstVersion, const char *secondVersion); bool showing_ecid = false;
static bool showing_ecid = false; char palera1n_logo[17][16] = {
static char palera1n_logo[17][16] = {
" ++ ", " ++ ",
" #@@# ", " #@@# ",
" +@@@@+ ", " +@@@@+ ",
@@ -36,7 +34,7 @@ static char palera1n_logo[17][16] = {
" :++: " " :++: "
}; };
static char random_quotes[][150] = { char random_quotes[][150] = {
"panic(cpu 1 caller 0xfffffff0232bd958): SEP Panic", "panic(cpu 1 caller 0xfffffff0232bd958): SEP Panic",
"Now with Apple TV support!", "Now with Apple TV support!",
"checkra1n will open source in 2020", "checkra1n will open source in 2020",
@@ -51,10 +49,10 @@ static char random_quotes[][150] = {
#define PALERA1N_URL "https://palera.in" #define PALERA1N_URL "https://palera.in"
static int tui_main_nav_selection = 1; int tui_main_nav_selection = 1;
static bool quick_mode_enabled = false; bool quick_mode_enabled = false;
static bool tui_can_start = false; bool tui_can_start = false;
static int random_quote; int random_quote;
bool easter_egg = false; bool easter_egg = false;
@@ -208,7 +206,7 @@ void tui_screen_main_redraw(void) {
fflush(stdout); fflush(stdout);
} }
static int tui_main_nav_mouse_select = -1; int tui_main_nav_mouse_select = -1;
tui_screen_t tui_screen_main(void) { tui_screen_t tui_screen_main(void) {
random_quote = ((unsigned int)((rand()+rand())/2)) % 8; random_quote = ((unsigned int)((rand()+rand())/2)) % 8;
@@ -331,7 +329,7 @@ tui_screen_t tui_screen_main(void) {
return MAIN_SCREEN; return MAIN_SCREEN;
} }
static int tui_version_extract_component(const char *version, int index) { int tui_version_extract_component(const char *version, int index) {
int component = 0; int component = 0;
int componentIndex = 0; int componentIndex = 0;
for (int i = 0; version[i] != '\0'; i++) { for (int i = 0; version[i] != '\0'; i++) {
@@ -350,7 +348,7 @@ static int tui_version_extract_component(const char *version, int index) {
return component; return component;
} }
static int tui_compare_versions(const char *firstVersion, const char *secondVersion) { int tui_compare_versions(const char *firstVersion, const char *secondVersion) {
if (strcmp(firstVersion, secondVersion) == 0) { if (strcmp(firstVersion, secondVersion) == 0) {
return 0; return 0;
} }
+3 -3
View File
@@ -13,10 +13,10 @@
#include <palerain.h> #include <palerain.h>
#include <tui.h> #include <tui.h>
static int tui_options_nav_selection = 0; int tui_options_nav_selection = 0;
static int tui_options_nav_mouse_select = 0; int tui_options_nav_mouse_select = 0;
static bool tui_options_allow_untested = false; bool tui_options_allow_untested = false;
bool tui_options_safe_mode = false; bool tui_options_safe_mode = false;
bool tui_options_verbose_boot = false; bool tui_options_verbose_boot = false;
bool tui_options_force_revert = false; bool tui_options_force_revert = false;
+1 -1
View File
@@ -208,7 +208,7 @@ static const int pongo_usb_product = PONGO_USB_PRODUCT;
int wait_for_pongo(void) { int wait_for_pongo(void) {
kern_return_t ret; kern_return_t ret;
stuff_t stuff = {0}; stuff_t stuff;
io_iterator_t found, lost; io_iterator_t found, lost;
void* cfdict_keys[3]; void* cfdict_keys[3];
+2 -1
View File
@@ -180,7 +180,8 @@ static int LostDevice(libusb_context *ctx, libusb_device *dev, libusb_hotplug_ev
int wait_for_pongo(void) int wait_for_pongo(void)
{ {
stuff_t stuff = {0}; stuff_t stuff;
stuff.handle = NULL;
libusb_hotplug_callback_handle hp[2]; libusb_hotplug_callback_handle hp[2];
libusb_context* ctx = NULL; libusb_context* ctx = NULL;