summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin R. Miller <incanus@codesorcery.net>2015-04-25 10:25:47 -0700
committerJustin R. Miller <incanus@codesorcery.net>2015-04-25 10:25:47 -0700
commitad1cc3f1ad62c75409617e22c14e2985c43092b6 (patch)
tree843d2d1283f66557cca82b89f05be17ebd2cf305
parent8aa2e2fef76eb4dfdb6e5b28a815babd27647322 (diff)
downloadqtlocation-mapboxgl-ad1cc3f1ad62c75409617e22c14e2985c43092b6.tar.gz
fix SSL pinning for apps including the framework
Made it clearer when we are referring to the app bundle and when we need to get the framework bundle for resources such as pinned certificates.
-rw-r--r--platform/ios/MGLMapboxEvents.m8
1 files changed, 4 insertions, 4 deletions
diff --git a/platform/ios/MGLMapboxEvents.m b/platform/ios/MGLMapboxEvents.m
index ee1ae82e7c..554956f31d 100644
--- a/platform/ios/MGLMapboxEvents.m
+++ b/platform/ios/MGLMapboxEvents.m
@@ -111,13 +111,13 @@ NSString *const MGLEventGestureRotateStart = @"Rotation";
if (self) {
// Put Settings bundle into memory
- NSString *settingsBundle = [[NSBundle mainBundle] pathForResource:@"Settings" ofType:@"bundle"];
- if(!settingsBundle) {
+ NSString *appSettingsBundle = [[NSBundle mainBundle] pathForResource:@"Settings" ofType:@"bundle"];
+ if(!appSettingsBundle) {
NSLog(@"Could not find Settings.bundle");
} else {
// Dynamic Settings.bundle loading based on:
// http://stackoverflow.com/questions/510216/can-you-make-the-settings-in-settings-bundle-default-even-if-you-dont-open-the
- NSDictionary *settings = [NSDictionary dictionaryWithContentsOfFile:[settingsBundle stringByAppendingPathComponent:@"Root.plist"]];
+ NSDictionary *settings = [NSDictionary dictionaryWithContentsOfFile:[appSettingsBundle stringByAppendingPathComponent:@"Root.plist"]];
NSArray *preferences = [settings objectForKey:@"PreferenceSpecifiers"];
NSMutableDictionary *defaultsToRegister = [[NSMutableDictionary alloc] initWithCapacity:[preferences count]];
for(NSDictionary *prefSpecification in preferences) {
@@ -143,7 +143,7 @@ NSString *const MGLEventGestureRotateStart = @"Rotation";
NSArray *bundles = [NSBundle allFrameworks];
for (int lc = 0; lc < bundles.count; lc++) {
NSBundle *b = [bundles objectAtIndex:lc];
- cerPath = [[NSBundle mainBundle] pathForResource:@"api_mapbox_com-geotrust" ofType:@"der"];
+ cerPath = [[NSBundle bundleForClass:[MGLMapboxEvents class]] pathForResource:@"api_mapbox_com-geotrust" ofType:@"der"];
if (cerPath != nil) {
break;
}