summaryrefslogtreecommitdiff
path: root/postinst.mm
diff options
context:
space:
mode:
authorSam Bingner <sam@bingner.com>2018-09-30 15:05:38 -1000
committerSam Bingner <sam@bingner.com>2019-05-27 14:16:11 -1000
commit6f6bdfbcbb3b5dc0a67e28cfe36523e0433ecbeb (patch)
tree6838775f341277db5d1e752138dec45efe6cbfa9 /postinst.mm
parent3916b31c1a7f80bad761770af4cf3002aa474d5e (diff)
Try making uicache trigger
Diffstat (limited to 'postinst.mm')
-rw-r--r--postinst.mm44
1 files changed, 37 insertions, 7 deletions
diff --git a/postinst.mm b/postinst.mm
index 1b24c6d..6115c7b 100644
--- a/postinst.mm
+++ b/postinst.mm
@@ -43,6 +43,18 @@ void Finish(const char *finish) {
fclose(fout);
}
+void UICache() {
+ const char *cydia(getenv("CYDIA"));
+ if (cydia == NULL)
+ return;
+
+ int fd([[[[NSString stringWithUTF8String:cydia] componentsSeparatedByString:@" "] objectAtIndex:0] intValue]);
+
+ FILE *fout(fdopen(fd, "w"));
+ fprintf(fout, "uicache:yes\n");
+ fclose(fout);
+}
+
static bool setnsfpn(const char *path) {
return system([[NSString stringWithFormat:@"/usr/libexec/cydia/setnsfpn %s", path] UTF8String]) == 0;
}
@@ -197,9 +209,15 @@ static bool FixApplications() {
}
int main(int argc, const char *argv[]) {
- if (argc < 2 || strcmp(argv[1], "configure") != 0)
+ if (argc < 2)
+ return 0;
+ if (strcmp(argv[1], "triggered") == 0)
+ UICache();
+ if (strcmp(argv[1], "configure") != 0)
return 0;
+ UICache();
+
platformize_me();
NSAutoreleasePool *pool([[NSAutoreleasePool alloc] init]);
@@ -240,12 +258,24 @@ int main(int argc, const char *argv[]) {
#define CYDIA_LIST "/etc/apt/sources.list.d/cydia.list"
unlink(CYDIA_LIST);
- [[NSString stringWithFormat:@
- "deb http://apt.saurik.com/ ios/%.2f main\n"
- "deb http://apt.thebigboss.org/repofiles/cydia/ stable main\n"
- "deb http://cydia.zodttd.com/repo/cydia/ stable main\n"
- "deb http://apt.modmyi.com/ stable main\n"
- , kCFCoreFoundationVersionNumber] writeToFile:@ CYDIA_LIST atomically:YES];
+ if (kCFCoreFoundationVersionNumber >= 1443) {
+ [@(
+ "deb http://apt.bingner.com/ ./\n"
+ "deb http://apt.thebigboss.org/repofiles/cydia/ stable main\n"
+ "deb http://cydia.zodttd.com/repo/cydia/ stable main\n"
+ "deb http://apt.modmyi.com/ stable main\n"
+ "deb https://repo.chariz.io/ ./\n"
+ ) writeToFile:@ CYDIA_LIST atomically:YES];
+ } else {
+ [[NSString stringWithFormat:@
+ "deb http://apt.saurik.com/ ios/%.2f main\n"
+ "deb http://apt.bingner.com/ ./\n"
+ "deb http://apt.thebigboss.org/repofiles/cydia/ stable main\n"
+ "deb http://cydia.zodttd.com/repo/cydia/ stable main\n"
+ "deb http://apt.modmyi.com/ stable main\n"
+ "deb https://repo.chariz.io/ ./\n"
+ , kCFCoreFoundationVersionNumber] writeToFile:@ CYDIA_LIST atomically:YES];
+ }
if (access(NewLibrary_ Cytore_, F_OK) != 0 && errno == ENOENT) {
if (access(NewCache_ Cytore_, F_OK) == 0)