Auki has had a very basic API for 3rd party developers since 1.0.
+[KJUARR doUrThing:<BBBulletin *>] can be used to activate auki with a BBBulletin (the message notification), or nil to present auki in compose mode. After serval developers requested additional, more extensive APIs, I decided to add a few useful APIs in version 1.3 which was released just this week on Cydia. The old API still works like it did in earlier versions, if you only need the basic API it’s totally fine to keep using it.
also takes an array of images, but supports an additional array of recipient address strings (NSSString objects). These addresses can be phone numbers or emails, specifically. It is safe to pass nil or empty arrays as parameters for both arguments. Keep in mind that recipients are only supported in compose mode, hence the first argument, the BBBulletin notification must be nil.
Header file
For the ease of use, below is a header ready to be imported in your projects:
I hope everybody is happy with the new APIs and some developers can take advantage of them.
If there is demand for additional APIs or bug reports, be sure to hit me up on Twitter or per email. Cya!
The iOS status bar is an interesting construct many jailbreak developers try to avoid messing with. After some research I thought I’d share some of my achievements to help other developers.
Items
Status bars contain so-called items, for example the WiFi item or the battery item, each item has a unique identifier. With some research I found out most items and their corresponding identifier:
Item identifier
Name
0
time / clock
1
quite mode / DND
2
Airplane mode
3
signal strength
4
service item (carrier name)
5
data network
7
battery icon + lightning
8
battery percent
9
battery percent, looks same as 8 but isn’t. Maybe the not charging item?
10
bluetooth battery
11
bluetooth
12
TTY
13
alarm
16
location
17
rotation lock
19
AirPlay
20
assistant / Siri
21
VPN
22
call forwarding
23
activity / loading indicator
24
thermal color (?)
What to do with these item identifiers? What about enabling or disabling some items globally?
Let’s enable the Siri status bar item:
12
[[SBStatusBarStateAggregatorsharedInstance]_setItem:20enabled:YES]//Returns a BOOL, YES if the status bar was changed and NO if it was already set
And ta-da, a siri icon in the status bar:
Data distribution
The status bar gets data from the status bar server UIStatusBarServer. The server and the status bar are not directly connected, a status bar state provider is a proxy between the two. A state provider conforms to the UIStatusBarStateProvider protocol, in SpringBoard SBStatusBarStateProvider and its subclasses (SBMainStatusBarStateProvider or SBNotificationCenterStatusBarStateProvider). State providers notify listening status bars about changes and edit the data, shwing or hiding specific items. SBMainStatusBarStateProvider enables and disables the time item dynamically (disabled on the lock screen, enabled otherwise), status bars get data from it by default. Hence to enable or disable the status bar time in (almost) all status bars, call the main state provider:
If you don’t want your status bar to hide the time dynamically, don’t use the main state provider (shown below)!
Styles
The status bar can also have different styles, infulencing the foreground and background color or the status bar height (incomplete list!).
Style
Description
0x12F
Notification center style
0x132
Big lockscreen style
When to use these styles is shown in the next paragraph.
Creating status bars
Creating a status bar isn’t very hard:
123456789
intstatusBarStyle=0x12F;//Normal notification center styleUIInterfaceOrientationorientation=UIApplication.sharedApplication.statusBar.statusBarWindow.orientation;statusBar=[[UIStatusBaralloc]initWithFrame:CGRectMake(0,0,UIApplication.sharedApplication.statusBar.bounds.size.width,[UIStatusBar.classheightForStyle:statusBarStyleorientation:orientation])showForegroundView:YESinProcessStateProvider:[[[objc_getClass("SBStatusBarStateProvider")alloc]init]autorelease]];[statusBarrequestStyle:statusBarStyle];statusBar.autoresizingMask=UIViewAutoresizingFlexibleWidth;[selfaddSubview:statusBar];//After orientation changes[statusBarsetOrientation:UIApplication.sharedApplication.statusBarOrientation];
In this example we provide a custom state provider, the status bar won’t use the main provider and will always show the time item, even on the lock screen. To use the main provider, initialize the status bar with -initWithFrame: instead.
Don’t forget to call -setOrientation: after initialization or if the interface orientation of your interface changed.
I hope this will help some other developers. If you have additions, please let me know about them.
Happy coding!