-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hide the status bar when volume bar is showing
This required the addition of a subtweak to hook into applications, because iOS handles the status bar in a really really weird way. Also added is the ability to receive current orientation from apps, to be used later to init the volume bar. The same IPC system used to do this will be used to make the bar orient correctly in all apps.
- Loading branch information
Showing
8 changed files
with
91 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
include $(THEOS)/makefiles/common.mk | ||
|
||
TWEAK_NAME = VB9AppKit | ||
VB9AppKit_FILES = Tweak.xm | ||
VB9AppKit_LIBRARIES = objcipc | ||
|
||
include $(THEOS_MAKE_PATH)/tweak.mk | ||
|
||
after-install:: | ||
install.exec "killall -9 SpringBoard" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* vb9appkit/Tweak.h | ||
* VolumeBar9 | ||
* | ||
* Created by cgm616 | ||
* Copyright (c) 2016 cgm616. All rights reserved. | ||
*/ | ||
|
||
#import <libobjcipc/objcipc.h> | ||
// #import <UIKit/UIApplication+Private.h> | ||
#import <UIKit/UIKit.h> | ||
#import <UIKit/UIStatusBar.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* vb9appkit/Tweak.xm | ||
* VolumeBar9 | ||
* | ||
* Created by cgm616 | ||
* Copyright (c) 2016 cgm616. All rights reserved. | ||
*/ | ||
|
||
#import "Tweak.h" | ||
|
||
%hook UIApplication | ||
|
||
-(id)init { | ||
[OBJCIPC registerIncomingMessageFromSpringBoardHandlerForMessageName:@"me.cgm616.volumebar9.showing" handler:^NSDictionary *(NSDictionary *message) { | ||
UIStatusBar *statusBar = MSHookIvar<UIStatusBar *>([UIApplication sharedApplication], "_statusBar"); | ||
BOOL status = statusBar.hidden; | ||
statusBar.hidden = YES; | ||
|
||
NSDictionary *return_message = @{ | ||
@"statusBarHidden" : [NSNumber numberWithBool:status], | ||
@"currentOrientation" : [NSNumber numberWithLongLong:[[UIApplication sharedApplication] statusBarOrientation]], | ||
}; | ||
|
||
return return_message; | ||
}]; | ||
|
||
[OBJCIPC registerIncomingMessageFromSpringBoardHandlerForMessageName:@"me.cgm616.volumebar9.hiding" handler:^NSDictionary *(NSDictionary *message) { | ||
BOOL previousStatus = [message[@"statusBarHidden"] boolValue]; | ||
|
||
UIStatusBar *statusBar = MSHookIvar<UIStatusBar *>([UIApplication sharedApplication], "_statusBar"); | ||
statusBar.hidden = previousStatus; | ||
|
||
return nil; | ||
}]; | ||
|
||
return %orig; | ||
} | ||
|
||
%end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ Filter = { Bundles = ( "com.apple.UIKit" ); }; } |