1
0
mirror of https://github.com/Burrit0z/kai synced 2025-07-02 06:56:47 +00:00

fix ora1n

This commit is contained in:
Burrit0z
2020-06-05 18:27:05 -04:00
parent a7f6754852
commit bd7c52f3ab
2 changed files with 14 additions and 13 deletions

25
Kai.xm
View File

@ -97,21 +97,22 @@ CSAdjunctListView *list;
%hook BCBatteryDevice %hook BCBatteryDevice
%property (nonatomic, strong) KAIBatteryCell *kaiCell; %property (nonatomic, strong) KAIBatteryCell *kaiCell;
- (id)initWithIdentifier:(id)arg1 vendor:(long long)arg2 productIdentifier:(long long)arg3 parts:(unsigned long long)arg4 matchIdentifier:(id)arg5 { -(void)setCharging:(BOOL)arg1 {
//sends the noti to update battery info
//Posts a notification to self when these keys change [[NSNotificationCenter defaultCenter] postNotificationName:@"KaiInfoChanged" object:nil userInfo:nil];
[self addObserver:self forKeyPath:@"charging" options:NSKeyValueObservingOptionNew context:nil]; %orig;
[self addObserver:self forKeyPath:@"batterySaverModeActive" options:NSKeyValueObservingOptionNew context:nil];
[self addObserver:self forKeyPath:@"percentCharge" options:NSKeyValueObservingOptionNew context:nil];
return %orig;
} }
-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context{ -(void)setBatterySaverModeActive:(BOOL)arg1 {
//sends the noti to update battery info
[[NSNotificationCenter defaultCenter] postNotificationName:@"KaiInfoChanged" object:nil userInfo:nil];
%orig;
}
//sends the noti to update battery info -(void)setPercentCharge:(NSInteger)arg1 {
[[NSNotificationCenter defaultCenter] postNotificationName:@"KaiInfoChanged" object:nil userInfo:nil]; //sends the noti to update battery info
[[NSNotificationCenter defaultCenter] postNotificationName:@"KaiInfoChanged" object:nil userInfo:nil];
%orig;
} }
%new %new

View File

@ -1,6 +1,6 @@
Package: com.burritoz.kai Package: com.burritoz.kai
Name: Kai Name: Kai
Version: 0.9.95 Version: 0.9.96
Architecture: iphoneos-arm Architecture: iphoneos-arm
Description: Device battery indicators on your lock screen! Description: Device battery indicators on your lock screen!
Maintainer: burrit0z Maintainer: burrit0z