|
|
|
|
|
|
|
|
-(void)KaiUpdate; |
|
|
-(void)KaiUpdate; |
|
|
@end |
|
|
@end |
|
|
|
|
|
|
|
|
|
|
|
@interface SBCoverSheetPrimarySlidingViewController |
|
|
|
|
|
-(void)KaiUpdate; |
|
|
|
|
|
@end |
|
|
|
|
|
|
|
|
BOOL setFrame = NO; |
|
|
BOOL setFrame = NO; |
|
|
CSMainPageView *batteryWidget; |
|
|
CSMainPageView *batteryWidget; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
%end*/ |
|
|
%end*/ |
|
|
/* |
|
|
|
|
|
|
|
|
|
|
|
%hook SBCoverSheetPrimarySlidingViewController |
|
|
%hook SBCoverSheetPrimarySlidingViewController |
|
|
|
|
|
|
|
|
-(void)viewWillAppear:(BOOL)arg1 { |
|
|
-(void)viewWillAppear:(BOOL)arg1 { |
|
|
%orig; |
|
|
%orig; |
|
|
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self |
|
|
|
|
|
selector:@selector(KaiUpdate) |
|
|
|
|
|
name:@"KaiInfoChanged" |
|
|
|
|
|
object:nil]; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
%new |
|
|
|
|
|
-(void)KaiUpdate { |
|
|
[batteryWidget.battery updateBattery]; |
|
|
[batteryWidget.battery updateBattery]; |
|
|
[batteryWidget KaiUpdate]; |
|
|
[batteryWidget KaiUpdate]; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
/* |
|
|
/* |
|
|
-(void)viewWillDisappear:(BOOL)arg1 { |
|
|
-(void)viewWillDisappear:(BOOL)arg1 { |
|
|
|
|
|
|
|
|
[batteryWidget.battery updateBattery]; |
|
|
[batteryWidget.battery updateBattery]; |
|
|
[batteryWidget KaiUpdate]; |
|
|
[batteryWidget KaiUpdate]; |
|
|
}*/ |
|
|
}*/ |
|
|
//%end |
|
|
|
|
|
|
|
|
%end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%hook CSMainPageView |
|
|
%hook CSMainPageView |
|
|
|
|
|
|
|
|
batteryWidget = self; |
|
|
batteryWidget = self; |
|
|
} |
|
|
} |
|
|
[self KaiUpdate]; |
|
|
[self KaiUpdate]; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
%new |
|
|
%new |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context{ |
|
|
-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context{ |
|
|
NSLog(@"It works"); |
|
|
NSLog(@"It works"); |
|
|
|
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:@"KaiInfoChanged" object:nil userInfo:nil]; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
%end |
|
|
%end |