From 573311e2cea8491a1054940a1580b5f4a20cc8d7 Mon Sep 17 00:00:00 2001 From: Sam Bingner Date: Wed, 23 Jun 2021 17:34:03 -1000 Subject: Add xattr to metadata to keep Cydia from being killed on iOS15 --- Cytore.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Cytore.hpp b/Cytore.hpp index fb17aaa..a682a9c 100644 --- a/Cytore.hpp +++ b/Cytore.hpp @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -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) { -- cgit v1.2.3