diff options
author | Sam Bingner <sam@bingner.com> | 2021-06-23 17:34:03 -1000 |
---|---|---|
committer | Sam Bingner <sam@bingner.com> | 2021-06-23 17:41:38 -1000 |
commit | 573311e2cea8491a1054940a1580b5f4a20cc8d7 (patch) | |
tree | 8714b8df3401332f1ce686c8b2e710b9cefe9650 | |
parent | 0397a15329d9b44e53e8bd8fab963437a5e5a800 (diff) |
Add xattr to metadata to keep Cydia from being killed on iOS15
-rw-r--r-- | Cytore.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -26,6 +26,7 @@ #include <sys/mman.h> #include <sys/stat.h> +#include <sys/xattr.h> #include <cstdio> #include <cstdlib> @@ -212,6 +213,13 @@ class File { _assert(unlink(path) == 0); goto open; } + // Ensure com.apple.runningboard.can-suspend-locked xattr is present to keep iOS15+ from killing on suspend + uint8_t value = 0; + int xattrSize = fgetxattr(file_, "com.apple.runningboard.can-suspend-locked", &value, sizeof(value), 0, 0); + if (xattrSize == -1 || value == 0) { + value = 1; + fsetxattr(file_, "com.apple.runningboard.can-suspend-locked", &value, sizeof(value), 0, 0); + } } bool Reserve(size_t capacity) { |