ios8locationcllocationmanagertheosspringboard

Using CLLocationManager in SpringBoard, but got the error with:depending on legacy on-demand authorization, which is not supported for new apps


I'm using the CLLocationManager in SpringBoard or imagent but when I alloc the CLLocationManager, I got the error with:depending on legacy on-demand authorization, which is not supported for new apps. even in locationd process, I got the same situation...

%hook SpringBoard
-(void)applicationDidFinishLaunching: (id)application {
    CLLocationManager *locationMgr = [[CLLocationManager alloc] init];
    %orig;
}
%end

The question is how can I get the location information in such process? Or if I can change entitlement for the app?


Solution

  • It's all due to iOS 8 changes. On previous iOS versions at least locationd had com.apple.locationd.preauthorized entitlement which gives access to location without user permission. Now even locationd doesn't have it. Same with SpringBoard and imagent. Of course, being locationd it can access location through it's own APIs - locationd is the location daemon that handles everything from authorization to filtering and processing raw location data from various sources.

    You can change their Info.plist but it will not do much - those apps will still not be authorized. With SpringBoard you will have to display default alert to allow it to access location. With locationd and imagent you probably can't do anything - they're daemons. Daemons doesn't have UI so they can't display any alerts to request permission. To solve this system daemons use entitlements to access something without user permission (like personal info).

    Now, how you can solve it apart from requesting permission from user for SpringBoard: