diff options
author | Sam Bingner <sam@bingner.com> | 2019-09-03 00:24:32 -1000 |
---|---|---|
committer | Sam Bingner <sam@bingner.com> | 2019-09-05 11:28:38 -1000 |
commit | ae63d81da47a227a0f682b06e4bbd2b3100a23d5 (patch) | |
tree | 84cbaa6faee34fab0f058f5c54feba17ab4912a0 | |
parent | c4ae8fbd8c3c3ec648add0c8fdd619347ec296b1 (diff) |
Try to make cydo work with broken jailbreaks
-rw-r--r-- | cydo.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -80,6 +80,14 @@ int main(int argc, char *argv[]) { auto request(launch_data_new_string(LAUNCH_KEY_GETJOBS)); auto response(launch_msg(request)); launch_data_free(request); + if ((response == NULL || launch_data_get_type(response) != LAUNCH_DATA_DICTIONARY ) && strcmp(argv[0], "/usr/libexec/cydia/cydo.dummy") != 0 ) { + fprintf(stderr, "Warning: couldn't communicate with launchd , maybe we're in an intentionally broken jailbreak? Try to work around it.\n"); + system("cp /usr/libexec/cydia/cydo /usr/libexec/cydia/cydo.dummy"); + chmod("/usr/libexec/cydia/cydo.dummy", 0755); + argv[0] = "/usr/libexec/cydia/cydo.dummy"; + execv(argv[0], argv); + _assert(false); + } _assert(response != NULL); _assert(launch_data_get_type(response) == LAUNCH_DATA_DICTIONARY); |