mirror of
https://github.com/palera1n/palera1n.git
synced 2026-10-24 19:19:48 +02:00
ifdefs
This commit is contained in:
1 parent
516e78e1f9
commit
7fd5882c95
4 files changed
+33
-8
No files matched your search
@@ -21,15 +21,16 @@ CFLAGS += -fdata-sections -ffunction-sections
|
|||||||
LDFLAGS += -static -no-pie -Wl,--gc-sections
|
LDFLAGS += -static -no-pie -Wl,--gc-sections
|
||||||
endif
|
endif
|
||||||
LIBS += $(DEP)/lib/libmbedtls.a $(DEP)/lib/libmbedcrypto.a $(DEP)/lib/libmbedx509.a $(DEP)/lib/libreadline.a
|
LIBS += $(DEP)/lib/libmbedtls.a $(DEP)/lib/libmbedcrypto.a $(DEP)/lib/libmbedx509.a $(DEP)/lib/libreadline.a
|
||||||
LIBS += $(DEP)/lib/libusb-1.0.a $(DEP)/lib/libmenutw.a $(DEP)/lib/libncursestw.a
|
LIBS += $(DEP)/lib/libusb-1.0.a
|
||||||
|
|
||||||
ifeq ($(DEV_BUILD),1)
|
ifeq ($(DEV_BUILD),1)
|
||||||
|
LIBS += $(DEP)/lib/libmenutw.a $(DEP)/lib/libncursestw.a
|
||||||
CFLAGS += -O0 -g -DDEV_BUILD -fsanitize=address -fno-omit-frame-pointer -fsanitize-address-use-after-return=runtime
|
CFLAGS += -O0 -g -DDEV_BUILD -fsanitize=address -fno-omit-frame-pointer -fsanitize-address-use-after-return=runtime
|
||||||
else
|
else
|
||||||
CFLAGS += -Os -g
|
CFLAGS += -Os -g
|
||||||
endif
|
endif
|
||||||
|
|
||||||
export SRC DEP CC CFLAGS LDFLAGS LIBS TARGET_OS
|
export SRC DEP CC CFLAGS LDFLAGS LIBS TARGET_OS DEV_BUILD
|
||||||
|
|
||||||
all: palera1n
|
all: palera1n
|
||||||
|
|
||||||
|
|||||||
+5
-3
@@ -3,9 +3,11 @@ all: palera1n
|
|||||||
OBJECTS = main.o dfuhelper.o devhelper.o lockdown_helper.o exec_checkra1n.o
|
OBJECTS = main.o dfuhelper.o devhelper.o lockdown_helper.o exec_checkra1n.o
|
||||||
OBJECTS += pongo_usb.o optparse.o override_file.o pongo_helper.o log.o
|
OBJECTS += pongo_usb.o optparse.o override_file.o pongo_helper.o log.o
|
||||||
OBJECTS += xxd-checkra1n.o xxd-checkra1n-kpf-pongo.o xxd-ramdisk.dmg.o
|
OBJECTS += xxd-checkra1n.o xxd-checkra1n-kpf-pongo.o xxd-ramdisk.dmg.o
|
||||||
OBJECTS += xxd-binpack.dmg.o tui_main.o tui_screen_options.o
|
OBJECTS += xxd-binpack.dmg.o
|
||||||
OBJECTS += tui_screen_enter_recovery.o tui_screen_enter_dfu.o
|
ifeq ($(DEV_BUILD),1)
|
||||||
OBJECTS += tui_screen_jailbreak.o tui_screen_main.o
|
OBJECTS += tui_screen_enter_recovery.o tui_screen_enter_dfu.o tui_main.o
|
||||||
|
OBJECTS += tui_screen_jailbreak.o tui_screen_main.o tui_screen_options.o
|
||||||
|
endif
|
||||||
|
|
||||||
CHECKRA1N_VERSION ?= 0.1337.1
|
CHECKRA1N_VERSION ?= 0.1337.1
|
||||||
LIPO = lipo
|
LIPO = lipo
|
||||||
|
|||||||
@@ -81,7 +81,9 @@ int build_checks() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool dfuhelper_only = false, pongo_exit = false, start_from_pongo = false, palerain_version = false;
|
bool dfuhelper_only = false, pongo_exit = false, start_from_pongo = false, palerain_version = false;
|
||||||
|
#ifdef DEV_BUILD
|
||||||
bool use_tui = false;
|
bool use_tui = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
int palera1n(int argc, char *argv[]) {
|
int palera1n(int argc, char *argv[]) {
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
@@ -91,11 +93,13 @@ int palera1n(int argc, char *argv[]) {
|
|||||||
if (palerain_version) goto normal_exit;
|
if (palerain_version) goto normal_exit;
|
||||||
if (start_from_pongo == true)
|
if (start_from_pongo == true)
|
||||||
goto pongo;
|
goto pongo;
|
||||||
|
#ifdef DEV_BUILD
|
||||||
if (use_tui) {
|
if (use_tui) {
|
||||||
ret = tui();
|
ret = tui();
|
||||||
if (ret) goto cleanup;
|
if (ret) goto cleanup;
|
||||||
else goto normal_exit;
|
else goto normal_exit;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
LOG(LOG_INFO, "Waiting for devices");
|
LOG(LOG_INFO, "Waiting for devices");
|
||||||
do_pongo_sleep = 1;
|
do_pongo_sleep = 1;
|
||||||
pthread_t dfuhelper_thread;
|
pthread_t dfuhelper_thread;
|
||||||
|
|||||||
+21
-3
@@ -35,14 +35,21 @@ static struct option longopts[] = {
|
|||||||
{"override-ramdisk", required_argument, NULL, 'r'},
|
{"override-ramdisk", required_argument, NULL, 'r'},
|
||||||
{"override-kpf", required_argument, NULL, 'K'},
|
{"override-kpf", required_argument, NULL, 'K'},
|
||||||
{"disable-ohio", no_argument, NULL, 'O'},
|
{"disable-ohio", no_argument, NULL, 'O'},
|
||||||
|
#ifdef DEV_BUILD
|
||||||
{"tui", no_argument, NULL, 't'},
|
{"tui", no_argument, NULL, 't'},
|
||||||
|
#endif
|
||||||
{NULL, 0, NULL, 0}
|
{NULL, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
static int usage(int e, char* prog_name)
|
static int usage(int e, char* prog_name)
|
||||||
{
|
{
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Usage: %s [-cCDhpPvVldsOLt] [-e boot arguments] [-f root device] [-k Pongo image] [-o overlay file] [-r ramdisk file] [-K KPF file]\n"
|
#ifdef DEV_BUILD
|
||||||
|
"Usage: %s [-cCDhpPvVldsOLt]"
|
||||||
|
#else
|
||||||
|
"Usage: %s [-cCDhpPvVldsOL]"
|
||||||
|
#endif
|
||||||
|
" [-e boot arguments] [-f root device] [-k Pongo image] [-o overlay file] [-r ramdisk file] [-K KPF file]\n"
|
||||||
"Copyright (C) 2023, palera1n team, All Rights Reserved.\n\n"
|
"Copyright (C) 2023, palera1n team, All Rights Reserved.\n\n"
|
||||||
"iOS/iPadOS 15+ arm64 jailbreaking tool\n\n"
|
"iOS/iPadOS 15+ arm64 jailbreaking tool\n\n"
|
||||||
"\t--version\t\t\t\tPrint version\n"
|
"\t--version\t\t\t\tPrint version\n"
|
||||||
@@ -67,7 +74,10 @@ static int usage(int e, char* prog_name)
|
|||||||
"\t-r, --override-ramdisk <file>\t\tOverride ramdisk\n"
|
"\t-r, --override-ramdisk <file>\t\tOverride ramdisk\n"
|
||||||
"\t-K, --override-kpf <file>\t\tOverride kernel patchfinder\n"
|
"\t-K, --override-kpf <file>\t\tOverride kernel patchfinder\n"
|
||||||
"\t-O, --disable-ohio\t\t\tDisable Ohio\n"
|
"\t-O, --disable-ohio\t\t\tDisable Ohio\n"
|
||||||
"\t-t, --tui\t\t\t\tTerminal user interface\n",
|
#ifdef DEV_BUILD
|
||||||
|
"\t-t, --tui\t\t\t\tTerminal user interface\n"
|
||||||
|
#endif
|
||||||
|
,
|
||||||
prog_name);
|
prog_name);
|
||||||
exit(e);
|
exit(e);
|
||||||
}
|
}
|
||||||
@@ -75,7 +85,13 @@ static int usage(int e, char* prog_name)
|
|||||||
int optparse(int argc, char* argv[]) {
|
int optparse(int argc, char* argv[]) {
|
||||||
int opt;
|
int opt;
|
||||||
int index;
|
int index;
|
||||||
while ((opt = getopt_long(argc, argv, "cCDhpvVldsOLte:f:o:r:K:k:", longopts, NULL)) != -1)
|
while ((opt = getopt_long(argc, argv,
|
||||||
|
#ifdef DEV_BUILD
|
||||||
|
"cCDhpvVldsOLte:f:o:r:K:k:",
|
||||||
|
#else
|
||||||
|
"cCDhpvVldsOLe:f:o:r:K:k:",
|
||||||
|
#endif
|
||||||
|
longopts, NULL)) != -1)
|
||||||
{
|
{
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
case 'c':
|
case 'c':
|
||||||
@@ -166,9 +182,11 @@ int optparse(int argc, char* argv[]) {
|
|||||||
case 'O':
|
case 'O':
|
||||||
ohio = false;
|
ohio = false;
|
||||||
break;
|
break;
|
||||||
|
#ifdef DEV_BUILD
|
||||||
case 't':
|
case 't':
|
||||||
use_tui = true;
|
use_tui = true;
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
case checkrain_option_force_revert:
|
case checkrain_option_force_revert:
|
||||||
checkrain_flags |= checkrain_option_force_revert;
|
checkrain_flags |= checkrain_option_force_revert;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in new issue
Block a user