summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Bingner <sam@bingner.com>2020-03-01 21:55:52 -1000
committerSam Bingner <sam@bingner.com>2020-03-01 21:56:37 -1000
commita4cb13fd832b72a99d8d68304fe08815ec9e4098 (patch)
tree54a73052e40f5654c6b41d1a9b7bb3c375741eec
parentbda60a9e96712f97612de46cb1e5023874ed2adf (diff)
Try to fix strange crash due to metadata.cb0v1.1.32%b24
-rw-r--r--MobileCydia.mm7
1 files changed, 7 insertions, 0 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 230b3fe..192029b 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -9443,6 +9443,13 @@ int main(int argc, char *argv[]) {
_trace();
mkdir("/var/mobile/Library/Cydia", 0755);
+ fd = open("/var/mobile/Library/Cydia/metadata.cb0", O_RDWR | O_CREAT | O_EXLOCK, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+ if (fd == -1) {
+ system("/usr/libexec/cydia/cydo /bin/rm -rf /var/mobile/Library/Cydia");
+ mkdir("/var/mobile/Library/Cydia", 0755);
+ } else {
+ close(fd);
+ }
MetaFile_.Open("/var/mobile/Library/Cydia/metadata.cb0");
_trace();