Question

I'm having a weird issue with a simple app I'm building using Theos.

I'm using latest Springboard headers (dumped/fixed them myself), latest ldid and libsubstrate, and I'm testing on my iPhone 5 (with iOS 7.0.4).

This is the (cutted) Makefile:

include theos/makefiles/common.mk

APPLICATION_NAME = Reboot
Reboot_FILES = main.m RebootApplication.xm
Reboot_FRAMEWORKS = UIKit 

include $(THEOS_MAKE_PATH)/application.mk

And this is the code inside RebootApplication.xm:

-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    [self.window makeKeyAndVisible];

    UIViewController *vc = [[UIViewController alloc] init];
    vc.view.backgroundColor = [UIColor redColor];

    self.window.rootViewController = vc;

    [self.window makeKeyAndVisible];

    id sbappc = [%c(SBApplicationController) sharedInstance];

    NSLog(@"SBApplicationController: %@",sbappc);
    NSLog(@"SBApplicationController: %@",sbappc);
    NSLog(@"SBApplicationController: %@",sbappc);
    NSLog(@"SBApplicationController: %@",sbappc);
    NSLog(@"SBApplicationController: %@",sbappc);

    return YES;
}

My questions are:

1) Why sbappc is always nil?
2) Why I don't see NSLog output in /var/log/syslog? (I see everything but this app logs!).

Thanks

Was it helpful?

Solution

SBApplicationController is a SpringBoard class. As you're running your code inside an app (not SpringBoard) the class doesn't exist.

You probably want to make a tweak.

Create a new Theos project and select the "tweak" template this time.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top