mirror of
https://github.com/palera1n/palera1n.git
synced 2026-10-21 09:47:01 +02:00
fix some normal mode queries
This commit is contained in:
1 parent
db7e1e511d
commit
4219552729
3 files changed
+23
-15
No files matched your search
+15
-14
@@ -102,6 +102,7 @@ int unsubscribe_cmd(void)
|
|||||||
|
|
||||||
int devinfo_cmd(devinfo_t *dev, const char *udid)
|
int devinfo_cmd(devinfo_t *dev, const char *udid)
|
||||||
{
|
{
|
||||||
|
int ret;
|
||||||
uint64_t this_ecid = 0;
|
uint64_t this_ecid = 0;
|
||||||
char *productType = NULL;
|
char *productType = NULL;
|
||||||
char *productVersion = NULL;
|
char *productVersion = NULL;
|
||||||
@@ -110,67 +111,67 @@ int devinfo_cmd(devinfo_t *dev, const char *udid)
|
|||||||
char *CPUArchitecture = NULL;
|
char *CPUArchitecture = NULL;
|
||||||
idevice_t device = NULL;
|
idevice_t device = NULL;
|
||||||
lockdownd_client_t lockdown = NULL;
|
lockdownd_client_t lockdown = NULL;
|
||||||
if (idevice_new(&device, udid) != IDEVICE_E_SUCCESS)
|
if ((ret = idevice_new_with_options(&device, udid, IDEVICE_LOOKUP_USBMUX)) != IDEVICE_E_SUCCESS)
|
||||||
{
|
{
|
||||||
LOG(LOG_ERROR, "Error connecting to device.");
|
LOG(LOG_ERROR, "Error connecting to device: %d (%s)", ret, lockdownd_strerror(ret));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (lockdownd_client_new(device, &lockdown, "palera1n") != LOCKDOWN_E_SUCCESS)
|
if ((ret = lockdownd_client_new_with_handshake(device, &lockdown, "palera1n")) != LOCKDOWN_E_SUCCESS)
|
||||||
{
|
{
|
||||||
(void)idevice_free(device);
|
(void)idevice_free(device);
|
||||||
LOG(LOG_ERROR, "Device is not in normal mode.");
|
LOG(LOG_ERROR, "Device is not in normal mode: %d (%s)", ret, lockdownd_strerror(ret));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
plist_t node = NULL;
|
plist_t node = NULL;
|
||||||
if (lockdownd_get_value(lockdown, NULL, "UniqueChipID", &node) != LOCKDOWN_E_SUCCESS)
|
if ((ret = lockdownd_get_value(lockdown, NULL, "UniqueChipID", &node)) != LOCKDOWN_E_SUCCESS)
|
||||||
{
|
{
|
||||||
(void)lockdownd_client_free(lockdown);
|
(void)lockdownd_client_free(lockdown);
|
||||||
(void)idevice_free(device);
|
(void)idevice_free(device);
|
||||||
LOG(LOG_ERROR, "Error getting ECID");
|
LOG(LOG_ERROR, "Error getting ECID: %d (%s)", ret, lockdownd_strerror(ret));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
plist_get_uint_val(node, &this_ecid);
|
plist_get_uint_val(node, &this_ecid);
|
||||||
plist_free(node);
|
plist_free(node);
|
||||||
|
|
||||||
node = NULL;
|
node = NULL;
|
||||||
if (lockdownd_get_value(lockdown, NULL, "ProductType", &node) != LOCKDOWN_E_SUCCESS)
|
if ((ret = lockdownd_get_value(lockdown, NULL, "ProductType", &node)) != LOCKDOWN_E_SUCCESS)
|
||||||
{
|
{
|
||||||
(void)lockdownd_client_free(lockdown);
|
(void)lockdownd_client_free(lockdown);
|
||||||
(void)idevice_free(device);
|
(void)idevice_free(device);
|
||||||
LOG(LOG_ERROR, "Error getting product type");
|
LOG(LOG_ERROR, "Error getting product type: %d (%s)", ret, lockdownd_strerror(ret));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
plist_get_string_val(node, &productType);
|
plist_get_string_val(node, &productType);
|
||||||
plist_free(node);
|
plist_free(node);
|
||||||
|
|
||||||
node = NULL;
|
node = NULL;
|
||||||
if (lockdownd_get_value(lockdown, NULL, "CPUArchitecture", &node) != LOCKDOWN_E_SUCCESS)
|
if ((ret = lockdownd_get_value(lockdown, NULL, "CPUArchitecture", &node)) != LOCKDOWN_E_SUCCESS)
|
||||||
{
|
{
|
||||||
(void)lockdownd_client_free(lockdown);
|
(void)lockdownd_client_free(lockdown);
|
||||||
(void)idevice_free(device);
|
(void)idevice_free(device);
|
||||||
LOG(LOG_ERROR, "Error getting CPU type");
|
LOG(LOG_ERROR, "Error getting CPU type: %d (%s)", ret, lockdownd_strerror(ret));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
plist_get_string_val(node, &CPUArchitecture);
|
plist_get_string_val(node, &CPUArchitecture);
|
||||||
plist_free(node);
|
plist_free(node);
|
||||||
|
|
||||||
node = NULL;
|
node = NULL;
|
||||||
if (lockdownd_get_value(lockdown, NULL, "ProductVersion", &node) != LOCKDOWN_E_SUCCESS)
|
if ((ret = lockdownd_get_value(lockdown, NULL, "ProductVersion", &node)) != LOCKDOWN_E_SUCCESS)
|
||||||
{
|
{
|
||||||
(void)lockdownd_client_free(lockdown);
|
(void)lockdownd_client_free(lockdown);
|
||||||
(void)idevice_free(device);
|
(void)idevice_free(device);
|
||||||
LOG(LOG_ERROR, "Error getting product version");
|
LOG(LOG_ERROR, "Error getting product version: %d (%s)", ret, lockdownd_strerror(ret));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
plist_get_string_val(node, &productVersion);
|
plist_get_string_val(node, &productVersion);
|
||||||
plist_free(node);
|
plist_free(node);
|
||||||
|
|
||||||
node = NULL;
|
node = NULL;
|
||||||
if (lockdownd_get_value(lockdown, NULL, "BuildVersion", &node) != LOCKDOWN_E_SUCCESS)
|
if ((ret = lockdownd_get_value(lockdown, NULL, "BuildVersion", &node)) != LOCKDOWN_E_SUCCESS)
|
||||||
{
|
{
|
||||||
(void)lockdownd_client_free(lockdown);
|
(void)lockdownd_client_free(lockdown);
|
||||||
(void)idevice_free(device);
|
(void)idevice_free(device);
|
||||||
LOG(LOG_ERROR, "Error getting build version");
|
LOG(LOG_ERROR, "Error getting build version: %d (%s)", ret, lockdownd_strerror(ret));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
plist_get_string_val(node, &buildVersion);
|
plist_get_string_val(node, &buildVersion);
|
||||||
|
|||||||
+3
-1
@@ -33,7 +33,9 @@
|
|||||||
#define OVERRIDE_MAGIC 0xd803b376
|
#define OVERRIDE_MAGIC 0xd803b376
|
||||||
|
|
||||||
unsigned int verbose = 0;
|
unsigned int verbose = 0;
|
||||||
char xargs_cmd[0x270] = "xargs ", palerain_flags_cmd[0x30] = "deadbeef";
|
/* we want to write to them so don't use string literals */
|
||||||
|
char xargs_cmd[0x270] = { 'x', 'a', 'r', 'g', 's', '\0' },
|
||||||
|
palerain_flags_cmd[0x30] = { 'd', 'e', 'a', 'd', 'b', 'e', 'e', 'f', '\0' };
|
||||||
extern char** environ;
|
extern char** environ;
|
||||||
|
|
||||||
niarelap_file_t* kpf_to_upload_1 = &checkra1n_kpf_pongo_lzma;
|
niarelap_file_t* kpf_to_upload_1 = &checkra1n_kpf_pongo_lzma;
|
||||||
|
|||||||
@@ -327,6 +327,11 @@ int optparse(int argc, char* argv[]) {
|
|||||||
if ((strstr(xargs_cmd, "serial=") != NULL) && !force_use_verbose_boot && (palerain_flags & palerain_option_setup_rootful)) {
|
if ((strstr(xargs_cmd, "serial=") != NULL) && !force_use_verbose_boot && (palerain_flags & palerain_option_setup_rootful)) {
|
||||||
palerain_flags &= ~palerain_option_verbose_boot;
|
palerain_flags &= ~palerain_option_verbose_boot;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((palerain_flags & (palerain_option_rootless | palerain_option_rootful)) == 0) {
|
||||||
|
LOG(LOG_FATAL, "must specify -l option");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
snprintf(palerain_flags_cmd, 0x30, "palera1n_flags 0x%" PRIx64, palerain_flags);
|
snprintf(palerain_flags_cmd, 0x30, "palera1n_flags 0x%" PRIx64, palerain_flags);
|
||||||
LOG(LOG_VERBOSE3, "palerain_flags: %s", palerain_flags_cmd);
|
LOG(LOG_VERBOSE3, "palerain_flags: %s", palerain_flags_cmd);
|
||||||
|
|||||||
Reference in new issue
Block a user