Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobcxdev committed Apr 7, 2020
2 parents bbfe45e + f7b0591 commit c2c5f3f
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 5 deletions.
Binary file modified Media/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Media/Preferences.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion Tweak.x
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion control
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ Description: Remove sponsored and suggested posts, videos, etc. from Facebook.
Maintainer: JacobCXDev <[email protected]>
Author: JacobCXDev <[email protected]>
Section: Tweaks
Version: 1.2.5
Version: 1.2.6
4 changes: 2 additions & 2 deletions fbspnosorpreferences/FBPRootListController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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"];
Expand Down

0 comments on commit c2c5f3f

Please sign in to comment.