Milk Tea
Milk Tea

Reputation: 141

Undefined Symbols for Armv7 (SBApplicationController.h)

Yes, yes I know this question has been asked A THOUSAND times! Let me explain my situation I am making a jailbreak tweak and I need to use the method [SBApplicationCenter sharedInstance]. So I #import<SpringBoard/SBApplicationController.h>. The weird thing is that it does import! To check this I did Class SBApplicationController = objc.getClass("SBApplicationController"), this returned a few warnings, one of those warnings was something along the lines of, "SBApplicationController already defined, redefined in a different way". Furthermore when I click "SBApplicationController" and do "Jump to definition" it takes me to "SBApplicationController.h". Before anyone suggest that I "link it to my binary", I can't this is NOT a framework, this is the dumped header files. (And I have tried linking just the SBApplicationCenter.h, that didn't work obviously). Any help would be great. Here's my code:

#import <SpringBoard/SBApplication.h>
#import <SpringBoard/SBApplicationController.h>


SBApplication* app = [[SBApplicationController sharedInstance] applicationWithDisplayIdentifier:@"com.yourcompany.appname"];
NSString *notificationIdentifier = app.bundleIdentifier;

Upvotes: 2

Views: 812

Answers (2)

user3225651
user3225651

Reputation: 1

I know this is an old question, but if you are using logos there is a better fix for this answer. You can use

SBApplicationController *apc = [%c(SBApplicationController) sharedInstanceIfExists];

Upvotes: 0

Milk Tea
Milk Tea

Reputation: 141

Ok I fixed it and just used:

Class $SBApplicationController = (objc_getClass("SBApplicationController"));

Upvotes: 1

Related Questions