summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Bingner <sam@bingner.com>2019-09-03 00:24:32 -1000
committerSam Bingner <sam@bingner.com>2019-09-03 15:08:53 -1000
commita20bc85e797af76299a84c3e1593a18371653173 (patch)
tree648a0d94ef0154a54d91434a2f3b24308a35a3a5
parentc0b2ccc204936cb8f778cb174fbcd40223b1d8b8 (diff)
Try to make cydo work with broken jailbreaksv1.1.32%b19
-rw-r--r--cydo.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/cydo.cpp b/cydo.cpp
index b3cc981..a151d14 100644
--- a/cydo.cpp
+++ b/cydo.cpp
@@ -79,6 +79,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);