Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Attempt to use KBAppList on system wide tweak with
- // UIKit as the main filter plist
- #import <UIKit/UIKit.h>
- #import <Foundation/Foundation.h>
- #import <Cephei/HBPreferences.h>
- #import <KBAppList/KBAppList.h>
- static bool kEnabled = YES;
- NSArray *appsID; //bundleID
- NSArray *kSelectedApps;
- //Array with results of unique key
- %hook _UISomething
- -(void)method {
- NSString *frontMostApp = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIdentifier"];
- //Get bundleID of app in use
- if([appsID containsObject: frontMostApp] && kEnabled) {
- Do Something
- }
- else { //Do something diffefent
- }
- }
- %end
- extern NSString *const
- HBPreferencesDidChangeNotification;
- //(Cephei handles tbe postNotification if you name it
- // "yourtweaksbundleid/ReloadPrefs")
- %ctor {
- preferences = [[HBPreferences alloc] initWithIdentifier:@"com.i0stweak3r.modernbarz"];
- [preferences registerBool:&kEnabled default:NO forKey:@"enabled"];
- [preferences registerObject:&kSelectedApps default:@[@"com.apple.UIKit", NULL] forKey:@"selectedApps"];
- appsID = [kSelectedApps valueForKey:@"bundleID"];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement