Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
fixed the respring for rootless
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandra authored and Alexandra committed Apr 28, 2023
1 parent 94d2be4 commit cd282b8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
18 changes: 12 additions & 6 deletions Preferences/Controllers/BatteryBuddyRootListController.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ - (void)setPreferenceValue:(id)value specifier:(PSSpecifier *)specifier {

if ([[specifier propertyForKey:@"key"] isEqualToString:kPreferenceKeyEnabled] ||
[[specifier propertyForKey:@"key"] isEqualToString:kPreferenceKeyShowInStatusBar] ||
[[specifier propertyForKey:@"key"] isEqualToString:kPreferenceKeyShowOnLockScreen]) {
[self promptToRespring];
[[specifier propertyForKey:@"key"] isEqualToString:kPreferenceKeyShowOnLockScreen]
) {
[self promptToRespring];
}
}

Expand All @@ -35,10 +36,15 @@ - (void)promptToRespring {
}

- (void)respring {
NSTask* task = [[NSTask alloc] init];
[task setLaunchPath:@"/usr/bin/killall"];
[task setArguments:[NSArray arrayWithObjects:@"backboardd", nil]];
[task launch];
NSArray* launchPaths = @[@"/usr/bin/killall", @"/var/jb/usr/bin/killall"];
for (NSString* launchPath in launchPaths) {
if ([[NSFileManager defaultManager] fileExistsAtPath:launchPath]) {
NSTask* task = [[NSTask alloc] init];
[task setLaunchPath:launchPath];
[task setArguments:@[@"backboardd"]];
[task launch];
}
}
}

- (void)resetPrompt {
Expand Down
2 changes: 1 addition & 1 deletion control
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: dev.traurige.batterybuddy
Name: BatteryBuddy
Depends: firmware (>= 13.0), mobilesubstrate, preferenceloader
Conflicts: love.litten.batterybuddy
Version: 1.3.2
Version: 1.3.3
Architecture: iphoneos-arm
Description: Battery indicator, but cute
Maintainer: Traurige <[email protected]>
Expand Down

0 comments on commit cd282b8

Please sign in to comment.