summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Bingner <sam@bingner.com>2020-03-01 21:55:52 -1000
committerSam Bingner <sam@bingner.com>2020-04-08 13:58:02 -1000
commit91448b210bef494122f67b85e0c48295f6ab37e9 (patch)
treeb1328d7957eaa389de00ad2a42223e2168c8f909
parentbbc2f1159a39bac6560e85a3320717bb459d5512 (diff)
Try to fix strange crash due to metadata.cb0
-rw-r--r--MobileCydia.mm7
1 files changed, 7 insertions, 0 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 8028ffd..3365c9b 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -9492,6 +9492,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();