Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static float redAlpha;
- static float greenAlpha;
- static float blueAlpha;
- BOOL DateTimeLeftJustify;
- BOOL StatusBarColour;
- BOOL IconsDown;
- BOOL IconLabelColour;
- //Respring function, needed to perform a proper respring.
- @interface FBSystemService : NSObject
- +(id)sharedInstance;
- -(void)exitAndRelaunch:(bool)arg1;
- @end
- static void RespringDevice() {
- [[%c(FBSystemService) sharedInstance] exitAndRelaunch:YES];
- }
- //End respring
- %hook SBFLockScreenDateView
- -(void)setAlignmentPercent:(double)arg1 {
- if(DateTimeLeftJustify) {
- arg1 = -1;
- }
- %orig(arg1);
- }
- %end
- %hook SBRootFolderView
- -(void)setStatusBarHeight:(double)arg1 {
- if(IconsDown) {
- arg1 = 38;
- }
- %orig(arg1);
- }
- %end
- %hook SBMutableIconLabelImageParameters
- -(void)setTextColor:(id)arg1 {
- if(IconLabelColour) {
- arg1 = [UIColor colorWithRed:(232/255.f) green:(213/255.f) blue:(17/255.f) alpha:1.0];
- }
- %orig(arg1);
- }
- %end
- //%hook UIStatusBarForegroundStyleAttributes
- // -(UIColor *)tintColor {
- // if(StatusBarColour) {
- // return [UIColor colorWithRed:(232/255.f) green:(213/255.f) blue:(17/255.f) alpha:1.0];
- // }
- // return %orig;
- // }
- //%end
- %hook UIStatusBarForegroundStyleAttributes
- -(id) initWithHeight:(double)arg1 legibilityStyle:(long long)arg2 tintColor:(id)arg3 hasBusyBackground:(bool)arg4 idiom:(long long)arg5 {
- if(StatusBarColour) { arg3 = [UIColor colorWithRed:(redAlpha) green:(greenAlpha) blue:(blueAlpha) alpha:1.0];
- }
- return %orig;
- }
- %end
- static void loadPrefs() {
- NSString *preferencesPath = @"/User/Library/Preferences/com.nicksb.lstextify.plist";
- NSMutableDictionary *preferences = [[NSMutableDictionary alloc] initWithContentsOfFile:preferencesPath];
- if(!preferences) {
- preferences = [[NSMutableDictionary alloc] init];
- DateTimeLeftJustify = YES;
- StatusBarColour = YES;
- IconsDown = YES;
- IconLabelColour = YES;
- redAlpha = 0.91;
- greenAlpha = 0.84;
- blueAlpha = 0.07;
- } else {
- DateTimeLeftJustify = [[preferences objectForKey:@"isEnabled"] boolValue];
- StatusBarColour = [[preferences objectForKey:@"isEnabled2"] boolValue];
- IconsDown = [[preferences objectForKey:@"isEnabled3"] boolValue];
- IconLabelColour = [[preferences objectForKey:@"isEnabled4"] boolValue];
- redAlpha = [[preferences objectForKey:@"redAlpha"] doubleValue];
- greenAlpha = [[preferences objectForKey:@"greenAlpha"] doubleValue];
- blueAlpha = [[preferences objectForKey:@"blueAlpha"] doubleValue];
- }
- [preferences release];
- }
- //Change this to your postNotification from your settings.
- static NSString *nsNotificationString = @"com.nicksb.lstextify/preferences.changed";
- static void notificationCallback(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) {
- loadPrefs();
- }
- %ctor {
- NSAutoreleasePool *pool = [NSAutoreleasePool new];
- loadPrefs();
- notificationCallback(NULL, NULL, NULL, NULL, NULL);
- CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, notificationCallback, (CFStringRef)nsNotificationString, NULL, CFNotificationSuspensionBehaviorCoalesce);
- [pool release];
- //Respring
- CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback)RespringDevice, CFSTR("com.nicksb.lstextify/respring"), NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement