diff options
author | Sam Bingner <sam@bingner.com> | 2018-10-15 15:00:44 -1000 |
---|---|---|
committer | Sam Bingner <sam@bingner.com> | 2019-05-27 14:27:40 -1000 |
commit | 59aa7ad8769041d89f7c635e887224d40503fa2b (patch) | |
tree | 8a1d2551a97b612f511668ae642e87eebd440f20 | |
parent | 2dc87015cb656153fdf7d492b091424636b32d84 (diff) |
Refuse to load electra repos
-rw-r--r-- | MobileCydia.mm | 2 | ||||
-rw-r--r-- | Sources.mm | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm index 314dffc..44db86d 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -749,7 +749,7 @@ bool isSectionVisible(NSString *section) { static NSString *VerifySource(NSString *href) { static RegEx href_r("(http(s?)://|file:///)[^# ]*"); - if (!href_r(href)) { + if (!href_r(href) || [href rangeOfString:@"electra" options:NSCaseInsensitiveSearch].location != NSNotFound) { [[[[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:Colon_, Error_, UCLocalize("INVALID_URL")] message:UCLocalize("INVALID_URL_EX") @@ -58,6 +58,10 @@ void CydiaWriteSources() { if ([[source objectForKey:@"URI"] hasPrefix:@"http://apt.bingner.com"] || [[source objectForKey:@"URI"] hasPrefix:@"https://apt.bingner.com"]) continue; + // Don't add Electra sources + if ([[source objectForKey:@"URI"] rangeOfString:@"electra" options:NSCaseInsensitiveSearch].location != NSNotFound) + continue; + NSArray *sections([source objectForKey:@"Sections"] ?: [NSArray array]); fprintf(file, "%s %s %s%s%s\n", @@ -73,6 +77,14 @@ void CydiaWriteSources() { } void CydiaAddSource(NSDictionary *source) { + // Ignore it if main source is added again + if ([[source objectForKey:@"URI"] hasPrefix:@"http://apt.bingner.com"] || [[source objectForKey:@"URI"] hasPrefix:@"https://apt.bingner.com"]) + return; + + // Don't add Electra sources + if ([[source objectForKey:@"URI"] rangeOfString:@"electra" options:NSCaseInsensitiveSearch].location != NSNotFound) + return; + [Sources_ setObject:source forKey:[NSString stringWithFormat:@"%@:%@:%@", [source objectForKey:@"Type"], [source objectForKey:@"URI"], [source objectForKey:@"Distribution"]]]; } |