From bd7c52f3ab08e48ff91d9628056f06f7ac2dc058 Mon Sep 17 00:00:00 2001 From: Burrit0z Date: Fri, 5 Jun 2020 18:27:05 -0400 Subject: [PATCH] fix ora1n --- Kai.xm | 25 +++++++++++++------------ Layout/DEBIAN/control | 2 +- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Kai.xm b/Kai.xm index 7cd19f5..66cd133 100755 --- a/Kai.xm +++ b/Kai.xm @@ -97,21 +97,22 @@ CSAdjunctListView *list; %hook BCBatteryDevice %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 { - - //Posts a notification to self when these keys change - [self addObserver:self forKeyPath:@"charging" options:NSKeyValueObservingOptionNew context:nil]; - [self addObserver:self forKeyPath:@"batterySaverModeActive" options:NSKeyValueObservingOptionNew context:nil]; - [self addObserver:self forKeyPath:@"percentCharge" options:NSKeyValueObservingOptionNew context:nil]; - - return %orig; +-(void)setCharging:(BOOL)arg1 { + //sends the noti to update battery info + [[NSNotificationCenter defaultCenter] postNotificationName:@"KaiInfoChanged" object:nil userInfo:nil]; + %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 - [[NSNotificationCenter defaultCenter] postNotificationName:@"KaiInfoChanged" object:nil userInfo:nil]; - +-(void)setPercentCharge:(NSInteger)arg1 { + //sends the noti to update battery info + [[NSNotificationCenter defaultCenter] postNotificationName:@"KaiInfoChanged" object:nil userInfo:nil]; + %orig; } %new diff --git a/Layout/DEBIAN/control b/Layout/DEBIAN/control index 810ba77..b66b57e 100644 --- a/Layout/DEBIAN/control +++ b/Layout/DEBIAN/control @@ -1,6 +1,6 @@ Package: com.burritoz.kai Name: Kai -Version: 0.9.95 +Version: 0.9.96 Architecture: iphoneos-arm Description: Device battery indicators on your lock screen! Maintainer: burrit0z