diff --git a/Media/1.png b/Media/1.png index 92a2325..8ab9d14 100644 Binary files a/Media/1.png and b/Media/1.png differ diff --git a/Media/Preferences.png b/Media/Preferences.png index 6b50add..2eb5d37 100644 Binary files a/Media/Preferences.png and b/Media/Preferences.png differ diff --git a/README.md b/README.md index 54947b1..cbd1737 100644 --- a/README.md +++ b/README.md @@ -13,4 +13,4 @@ A tweak for Facebook — written in Objective-C + Logos. ## Screenshots -![Preferences](https://user-images.githubusercontent.com/27970288/78624971-cbe3b180-7882-11ea-9b39-9ed710761b01.png) +![Preferences](https://user-images.githubusercontent.com/27970288/78633998-d1e58c80-789a-11ea-9ebd-601f4d02e056.png) diff --git a/Tweak.x b/Tweak.x index 781eea8..50898a9 100644 --- a/Tweak.x +++ b/Tweak.x @@ -54,7 +54,7 @@ // Constructor %ctor { - NSMutableDictionary *settings = [[NSMutableDictionary alloc] initWithContentsOfFile:@"/var/mobile/Library/Preferences/com.jacobcxdev.fbspnosor.plist"]; + NSDictionary *settings = [NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.jacobcxdev.fbspnosor.plist"]; bool enabled = [settings objectForKey:@"enabled"] ? [[settings objectForKey:@"enabled"] boolValue] : true; if (!enabled) return; %init(); diff --git a/control b/control index 56709bf..0154547 100644 --- a/control +++ b/control @@ -6,4 +6,4 @@ Description: Remove sponsored and suggested posts, videos, etc. from Facebook. Maintainer: JacobCXDev Author: JacobCXDev Section: Tweaks -Version: 1.2.5 \ No newline at end of file +Version: 1.2.6 \ No newline at end of file diff --git a/fbspnosorpreferences/FBPRootListController.m b/fbspnosorpreferences/FBPRootListController.m index 348db64..dfae324 100644 --- a/fbspnosorpreferences/FBPRootListController.m +++ b/fbspnosorpreferences/FBPRootListController.m @@ -11,12 +11,12 @@ - (NSArray *)specifiers { } - (id)readPreferenceValue:(PSSpecifier*)specifier { NSString *path = [NSString stringWithFormat:@"/User/Library/Preferences/%@.plist", specifier.properties[@"defaults"]]; - NSMutableDictionary *plist = [[NSMutableDictionary alloc] initWithContentsOfFile:path]; + NSMutableDictionary *plist = [NSMutableDictionary dictionaryWithContentsOfFile:path]; return (plist[specifier.properties[@"key"]]) ?: specifier.properties[@"default"]; } - (void)setPreferenceValue:(id)value specifier:(PSSpecifier*)specifier { NSString *path = [NSString stringWithFormat:@"/User/Library/Preferences/%@.plist", specifier.properties[@"defaults"]]; - NSMutableDictionary *plist = [[NSMutableDictionary alloc] initWithContentsOfFile:path]; + NSMutableDictionary *plist = [NSMutableDictionary dictionaryWithContentsOfFile:path] ?: [NSMutableDictionary new]; plist[specifier.properties[@"key"]] = value; [plist writeToFile:path atomically:true]; CFStringRef notificationName = (__bridge CFStringRef)specifier.properties[@"PostNotification"];