summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/CordovaLib
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-08-31 23:07:20 +0200
committerJules Laplace <julescarbon@gmail.com>2020-08-31 23:07:20 +0200
commit22721a013bdd10d5eb395ba18453585f5f3f1f7f (patch)
tree5a920e31d6026ed5dc55265e5fd057febccc50e3 /StoneIsland/platforms/ios/CordovaLib
parentd22d51a1ae49680015326857360eb699f31efced (diff)
rebuild the ios platform and the plugins
Diffstat (limited to 'StoneIsland/platforms/ios/CordovaLib')
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Private/CDVJSON_private.m78
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.h2
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.m10
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVHandleOpenURL/CDVHandleOpenURL.h2
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVHandleOpenURL/CDVHandleOpenURL.m2
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.h10
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m58
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVLaunchScreen/CDVLaunchScreen.h (renamed from StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVURLProtocol.h)8
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVLaunchScreen/CDVLaunchScreen.m39
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVLocalStorage/CDVLocalStorage.h50
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVLocalStorage/CDVLocalStorage.m487
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVLogger/CDVLogger.h2
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.h41
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.m399
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewEngine.m202
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.m153
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.h29
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m607
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewProcessPoolFactory.h (renamed from StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewEngine.h)14
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewProcessPoolFactory.m49
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.h (renamed from StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.h)13
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.m163
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDV.h2
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVAppDelegate.m31
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVAvailability.h12
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVCommandDelegate.h4
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVCommandDelegateImpl.m13
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVPlugin.h11
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVPlugin.m3
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVPluginResult.h41
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVPluginResult.m19
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVScreenOrientationDelegate.h5
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVURLProtocol.m113
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVURLSchemeHandler.h (renamed from StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVUserAgentUtil.h)15
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVURLSchemeHandler.m108
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVUserAgentUtil.m124
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVViewController.h23
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVViewController.m239
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVWebViewEngineProtocol.h1
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/Classes/Public/NSDictionary+CordovaPreferences.m33
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj530
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist14
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/VERSION2
-rw-r--r--StoneIsland/platforms/ios/CordovaLib/cordova.js933
44 files changed, 1904 insertions, 2790 deletions
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/CDVJSON_private.m b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/CDVJSON_private.m
index 054d655d..175ed398 100644
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/CDVJSON_private.m
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/CDVJSON_private.m
@@ -24,16 +24,18 @@
- (NSString*)cdv_JSONString
{
- NSError* error = nil;
- NSData* jsonData = [NSJSONSerialization dataWithJSONObject:self
- options:0
- error:&error];
+ @autoreleasepool {
+ NSError* error = nil;
+ NSData* jsonData = [NSJSONSerialization dataWithJSONObject:self
+ options:0
+ error:&error];
- if (error != nil) {
- NSLog(@"NSArray JSONString error: %@", [error localizedDescription]);
- return nil;
- } else {
- return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
+ if (error != nil) {
+ NSLog(@"NSArray JSONString error: %@", [error localizedDescription]);
+ return nil;
+ } else {
+ return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
+ }
}
}
@@ -43,16 +45,18 @@
- (NSString*)cdv_JSONString
{
- NSError* error = nil;
- NSData* jsonData = [NSJSONSerialization dataWithJSONObject:self
- options:NSJSONWritingPrettyPrinted
- error:&error];
+ @autoreleasepool {
+ NSError* error = nil;
+ NSData* jsonData = [NSJSONSerialization dataWithJSONObject:self
+ options:NSJSONWritingPrettyPrinted
+ error:&error];
- if (error != nil) {
- NSLog(@"NSDictionary JSONString error: %@", [error localizedDescription]);
- return nil;
- } else {
- return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
+ if (error != nil) {
+ NSLog(@"NSDictionary JSONString error: %@", [error localizedDescription]);
+ return nil;
+ } else {
+ return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
+ }
}
}
@@ -62,30 +66,34 @@
- (id)cdv_JSONObject
{
- NSError* error = nil;
- id object = [NSJSONSerialization JSONObjectWithData:[self dataUsingEncoding:NSUTF8StringEncoding]
- options:NSJSONReadingMutableContainers
- error:&error];
-
- if (error != nil) {
- NSLog(@"NSString JSONObject error: %@, Malformed Data: %@", [error localizedDescription], self);
- }
+ @autoreleasepool {
+ NSError* error = nil;
+ id object = [NSJSONSerialization JSONObjectWithData:[self dataUsingEncoding:NSUTF8StringEncoding]
+ options:NSJSONReadingMutableContainers
+ error:&error];
+
+ if (error != nil) {
+ NSLog(@"NSString JSONObject error: %@, Malformed Data: %@", [error localizedDescription], self);
+ }
- return object;
+ return object;
+ }
}
- (id)cdv_JSONFragment
{
- NSError* error = nil;
- id object = [NSJSONSerialization JSONObjectWithData:[self dataUsingEncoding:NSUTF8StringEncoding]
- options:NSJSONReadingAllowFragments
- error:&error];
+ @autoreleasepool {
+ NSError* error = nil;
+ id object = [NSJSONSerialization JSONObjectWithData:[self dataUsingEncoding:NSUTF8StringEncoding]
+ options:NSJSONReadingAllowFragments
+ error:&error];
- if (error != nil) {
- NSLog(@"NSString JSONObject error: %@", [error localizedDescription]);
- }
+ if (error != nil) {
+ NSLog(@"NSString JSONObject error: %@", [error localizedDescription]);
+ }
- return object;
+ return object;
+ }
}
@end
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.h b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.h
index 510b6ebf..f39e066a 100644
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.h
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.h
@@ -17,7 +17,7 @@
under the License.
*/
-#import "CDVPlugin.h"
+#import <Cordova/CDVPlugin.h>
@interface CDVGestureHandler : CDVPlugin
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.m b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.m
index 242ac55b..34ed4633 100644
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.m
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.m
@@ -37,13 +37,13 @@
self.lpgr = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPressGestures:)];
self.lpgr.minimumPressDuration = 0.45f;
- self.lpgr.allowableMovement = 100.0f;
+ self.lpgr.allowableMovement = 200.0f;
// 0.45 is ok for 'regular longpress', 0.05-0.08 is required for '3D Touch longpress',
// but since this will also kill onclick handlers (not ontouchend) it's optional.
if ([self.commandDelegate.settings objectForKey:@"suppresses3dtouchgesture"] &&
[[self.commandDelegate.settings objectForKey:@"suppresses3dtouchgesture"] boolValue]) {
- self.lpgr.minimumPressDuration = 0.05f;
+ self.lpgr.minimumPressDuration = 0.15f;
}
NSArray *views = self.webView.subviews;
@@ -64,11 +64,7 @@
- (void)handleLongPressGestures:(UILongPressGestureRecognizer*)sender
{
- if ([sender isEqual:self.lpgr]) {
- if (sender.state == UIGestureRecognizerStateBegan) {
- NSLog(@"Ignoring a longpress in order to suppress the magnifying glass.");
- }
- }
+
}
@end
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVHandleOpenURL/CDVHandleOpenURL.h b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVHandleOpenURL/CDVHandleOpenURL.h
index f9b0bffa..37dab40b 100644
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVHandleOpenURL/CDVHandleOpenURL.h
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVHandleOpenURL/CDVHandleOpenURL.h
@@ -17,7 +17,7 @@
under the License.
*/
-#import "CDVPlugin.h"
+#import <Cordova/CDVPlugin.h>
@interface CDVHandleOpenURL : CDVPlugin
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVHandleOpenURL/CDVHandleOpenURL.m b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVHandleOpenURL/CDVHandleOpenURL.m
index 72199b9c..400cb9de 100644
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVHandleOpenURL/CDVHandleOpenURL.m
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVHandleOpenURL/CDVHandleOpenURL.m
@@ -18,7 +18,7 @@
*/
#import "CDVHandleOpenURL.h"
-#import "CDV.h"
+#import <Cordova/CDV.h>
@implementation CDVHandleOpenURL
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.h b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.h
index ee89e1a8..14c6a66d 100644
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.h
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.h
@@ -17,8 +17,10 @@
under the License.
*/
-#import "CDVPlugin.h"
-#import "CDVWhitelist.h"
+#import <Cordova/CDVPlugin.h>
+#import <Cordova/CDVWhitelist.h>
+
+#define CDVWebViewNavigationType int
typedef NS_ENUM(NSInteger, CDVIntentAndNavigationFilterValue) {
CDVIntentAndNavigationFilterValueIntentAllowed,
@@ -29,6 +31,6 @@ typedef NS_ENUM(NSInteger, CDVIntentAndNavigationFilterValue) {
@interface CDVIntentAndNavigationFilter : CDVPlugin <NSXMLParserDelegate>
+ (CDVIntentAndNavigationFilterValue) filterUrl:(NSURL*)url intentsWhitelist:(CDVWhitelist*)intentsWhitelist navigationsWhitelist:(CDVWhitelist*)navigationsWhitelist;
-+ (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType filterValue:(CDVIntentAndNavigationFilterValue)filterValue;
-+ (BOOL)shouldOpenURLRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType;
++ (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(CDVWebViewNavigationType)navigationType filterValue:(CDVIntentAndNavigationFilterValue)filterValue;
++ (BOOL)shouldOpenURLRequest:(NSURLRequest*)request navigationType:(CDVWebViewNavigationType)navigationType;
@end
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m
index 2b13849f..a098be2b 100644
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m
@@ -46,7 +46,15 @@
- (void)parserDidStartDocument:(NSXMLParser*)parser
{
// file: url <allow-navigations> are added by default
- self.allowNavigations = [[NSMutableArray alloc] initWithArray:@[ @"file://" ]];
+ // navigation to the scheme used by the app is also allowed
+ self.allowNavigations = [[NSMutableArray alloc] initWithArray:@[ @"file://"]];
+
+ // If the custom app scheme is defined, append it to the allow navigation as default
+ NSString* scheme = ((CDVViewController*)self.viewController).appScheme;
+ if (scheme) {
+ [self.allowNavigations addObject: [NSString stringWithFormat:@"%@://", scheme]];
+ }
+
// no intents are added by default
self.allowIntents = [[NSMutableArray alloc] init];
}
@@ -75,10 +83,10 @@
{
// a URL can only allow-intent OR allow-navigation, if both are specified,
// only allow-navigation is allowed
-
+
BOOL allowNavigationsPass = [navigationsWhitelist URLIsAllowed:url logFailure:NO];
BOOL allowIntentPass = [intentsWhitelist URLIsAllowed:url logFailure:NO];
-
+
if (allowNavigationsPass && allowIntentPass) {
return CDVIntentAndNavigationFilterValueNavigationAllowed;
} else if (allowNavigationsPass) {
@@ -86,7 +94,7 @@
} else if (allowIntentPass) {
return CDVIntentAndNavigationFilterValueIntentAllowed;
}
-
+
return CDVIntentAndNavigationFilterValueNoneAllowed;
}
@@ -95,57 +103,47 @@
return [[self class] filterUrl:url intentsWhitelist:self.allowIntentsWhitelist navigationsWhitelist:self.allowNavigationsWhitelist];
}
-+ (BOOL)shouldOpenURLRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
+#define CDVWebViewNavigationTypeLinkClicked 0
+#define CDVWebViewNavigationTypeLinkOther -1
+
++ (BOOL)shouldOpenURLRequest:(NSURLRequest*)request navigationType:(CDVWebViewNavigationType)navigationType
{
- return (UIWebViewNavigationTypeLinkClicked == navigationType ||
- (UIWebViewNavigationTypeOther == navigationType &&
- [[request.mainDocumentURL absoluteString] isEqualToString:[request.URL absoluteString]]
- )
- );
+ return (
+ navigationType == CDVWebViewNavigationTypeLinkClicked ||
+ navigationType == CDVWebViewNavigationTypeLinkOther
+ );
}
-+ (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType filterValue:(CDVIntentAndNavigationFilterValue)filterValue
++ (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(CDVWebViewNavigationType)navigationType filterValue:(CDVIntentAndNavigationFilterValue)filterValue
{
NSString* allowIntents_whitelistRejectionFormatString = @"ERROR External navigation rejected - <allow-intent> not set for url='%@'";
NSString* allowNavigations_whitelistRejectionFormatString = @"ERROR Internal navigation rejected - <allow-navigation> not set for url='%@'";
-
+
NSURL* url = [request URL];
-
+
switch (filterValue) {
case CDVIntentAndNavigationFilterValueNavigationAllowed:
return YES;
case CDVIntentAndNavigationFilterValueIntentAllowed:
- // only allow-intent if it's a UIWebViewNavigationTypeLinkClicked (anchor tag) OR
- // it's a UIWebViewNavigationTypeOther, and it's an internal link
+ // only allow-intent if it's a CDVWebViewNavigationTypeLinkClicked (anchor tag) or CDVWebViewNavigationTypeOther and it's an internal link
if ([[self class] shouldOpenURLRequest:request navigationType:navigationType]){
-#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 100000
- // CB-11895; openURL with a single parameter is deprecated in iOS 10
- // see https://useyourloaf.com/blog/openurl-deprecated-in-ios10
- if ([[UIApplication sharedApplication] respondsToSelector:@selector(openURL:options:completionHandler:)]) {
- [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
- } else {
- [[UIApplication sharedApplication] openURL:url];
- }
-#else
- // fall back if on older SDK
- [[UIApplication sharedApplication] openURL:url];
-#endif
+ [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
}
-
+
// consume the request (i.e. no error) if it wasn't handled above
return NO;
case CDVIntentAndNavigationFilterValueNoneAllowed:
// allow-navigation attempt failed for sure
NSLog(@"%@", [NSString stringWithFormat:allowNavigations_whitelistRejectionFormatString, [url absoluteString]]);
// anchor tag link means it was an allow-intent attempt that failed as well
- if (UIWebViewNavigationTypeLinkClicked == navigationType) {
+ if (CDVWebViewNavigationTypeLinkClicked == navigationType) {
NSLog(@"%@", [NSString stringWithFormat:allowIntents_whitelistRejectionFormatString, [url absoluteString]]);
}
return NO;
}
}
-- (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
+- (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(CDVWebViewNavigationType)navigationType
{
return [[self class] shouldOverrideLoadWithRequest:request navigationType:navigationType filterValue:[self filterUrl:request.URL]];
}
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVURLProtocol.h b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVLaunchScreen/CDVLaunchScreen.h
index 0561e04d..e973e373 100644
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVURLProtocol.h
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVLaunchScreen/CDVLaunchScreen.h
@@ -17,11 +17,11 @@
under the License.
*/
-#import <Foundation/Foundation.h>
-#import "CDVAvailability.h"
+#import <Cordova/CDVPlugin.h>
-@class CDVViewController;
+@interface CDVLaunchScreen : CDVPlugin
-@interface CDVURLProtocol : NSURLProtocol {}
+- (void)show:(CDVInvokedUrlCommand*)command;
+- (void)hide:(CDVInvokedUrlCommand*)command;
@end
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVLaunchScreen/CDVLaunchScreen.m b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVLaunchScreen/CDVLaunchScreen.m
new file mode 100644
index 00000000..9ff062af
--- /dev/null
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVLaunchScreen/CDVLaunchScreen.m
@@ -0,0 +1,39 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import "CDVLaunchScreen.h"
+#import <Cordova/CDVViewController.h>
+
+@implementation CDVLaunchScreen
+
+- (void)show:(CDVInvokedUrlCommand*)command
+{
+ if ([self.viewController isKindOfClass:[CDVViewController class]]) {
+ [(CDVViewController*)self.viewController showLaunchScreen:YES];
+ }
+}
+
+- (void)hide:(CDVInvokedUrlCommand*)command
+{
+ if ([self.viewController isKindOfClass:[CDVViewController class]]) {
+ [(CDVViewController*)self.viewController showLaunchScreen:NO];
+ }
+}
+
+@end
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVLocalStorage/CDVLocalStorage.h b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVLocalStorage/CDVLocalStorage.h
deleted file mode 100644
index dec6ab3b..00000000
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVLocalStorage/CDVLocalStorage.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVPlugin.h"
-
-#define kCDVLocalStorageErrorDomain @"kCDVLocalStorageErrorDomain"
-#define kCDVLocalStorageFileOperationError 1
-
-@interface CDVLocalStorage : CDVPlugin
-
-@property (nonatomic, readonly, strong) NSMutableArray* backupInfo;
-
-- (BOOL)shouldBackup;
-- (BOOL)shouldRestore;
-- (void)backup:(CDVInvokedUrlCommand*)command;
-- (void)restore:(CDVInvokedUrlCommand*)command;
-
-+ (void)__fixupDatabaseLocationsWithBackupType:(NSString*)backupType;
-// Visible for testing.
-+ (BOOL)__verifyAndFixDatabaseLocationsWithAppPlistDict:(NSMutableDictionary*)appPlistDict
- bundlePath:(NSString*)bundlePath
- fileManager:(NSFileManager*)fileManager;
-@end
-
-@interface CDVBackupInfo : NSObject
-
-@property (nonatomic, copy) NSString* original;
-@property (nonatomic, copy) NSString* backup;
-@property (nonatomic, copy) NSString* label;
-
-- (BOOL)shouldBackup;
-- (BOOL)shouldRestore;
-
-@end
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVLocalStorage/CDVLocalStorage.m b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVLocalStorage/CDVLocalStorage.m
deleted file mode 100644
index 252dfaf1..00000000
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVLocalStorage/CDVLocalStorage.m
+++ /dev/null
@@ -1,487 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVLocalStorage.h"
-#import "CDV.h"
-
-@interface CDVLocalStorage ()
-
-@property (nonatomic, readwrite, strong) NSMutableArray* backupInfo; // array of CDVBackupInfo objects
-@property (nonatomic, readwrite, weak) id <UIWebViewDelegate> webviewDelegate;
-
-@end
-
-@implementation CDVLocalStorage
-
-@synthesize backupInfo, webviewDelegate;
-
-- (void)pluginInitialize
-{
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onResignActive)
- name:UIApplicationWillResignActiveNotification object:nil];
- BOOL cloudBackup = [@"cloud" isEqualToString : self.commandDelegate.settings[[@"BackupWebStorage" lowercaseString]]];
-
- self.backupInfo = [[self class] createBackupInfoWithCloudBackup:cloudBackup];
-}
-
-#pragma mark -
-#pragma mark Plugin interface methods
-
-+ (NSMutableArray*)createBackupInfoWithTargetDir:(NSString*)targetDir backupDir:(NSString*)backupDir targetDirNests:(BOOL)targetDirNests backupDirNests:(BOOL)backupDirNests rename:(BOOL)rename
-{
- /*
- This "helper" does so much work and has so many options it would probably be clearer to refactor the whole thing.
- Basically, there are three database locations:
-
- 1. "Normal" dir -- LIB/<nested dires WebKit/LocalStorage etc>/<normal filenames>
- 2. "Caches" dir -- LIB/Caches/<normal filenames>
- 3. "Backup" dir -- DOC/Backups/<renamed filenames>
-
- And between these three, there are various migration paths, most of which only consider 2 of the 3, which is why this helper is based on 2 locations and has a notion of "direction".
- */
- NSMutableArray* backupInfo = [NSMutableArray arrayWithCapacity:3];
-
- NSString* original;
- NSString* backup;
- CDVBackupInfo* backupItem;
-
- // ////////// LOCALSTORAGE
-
- original = [targetDir stringByAppendingPathComponent:targetDirNests ? @"WebKit/LocalStorage/file__0.localstorage":@"file__0.localstorage"];
- backup = [backupDir stringByAppendingPathComponent:(backupDirNests ? @"WebKit/LocalStorage" : @"")];
- backup = [backup stringByAppendingPathComponent:(rename ? @"localstorage.appdata.db" : @"file__0.localstorage")];
-
- backupItem = [[CDVBackupInfo alloc] init];
- backupItem.backup = backup;
- backupItem.original = original;
- backupItem.label = @"localStorage database";
-
- [backupInfo addObject:backupItem];
-
- // ////////// WEBSQL MAIN DB
-
- original = [targetDir stringByAppendingPathComponent:targetDirNests ? @"WebKit/LocalStorage/Databases.db":@"Databases.db"];
- backup = [backupDir stringByAppendingPathComponent:(backupDirNests ? @"WebKit/LocalStorage" : @"")];
- backup = [backup stringByAppendingPathComponent:(rename ? @"websqlmain.appdata.db" : @"Databases.db")];
-
- backupItem = [[CDVBackupInfo alloc] init];
- backupItem.backup = backup;
- backupItem.original = original;
- backupItem.label = @"websql main database";
-
- [backupInfo addObject:backupItem];
-
- // ////////// WEBSQL DATABASES
-
- original = [targetDir stringByAppendingPathComponent:targetDirNests ? @"WebKit/LocalStorage/file__0":@"file__0"];
- backup = [backupDir stringByAppendingPathComponent:(backupDirNests ? @"WebKit/LocalStorage" : @"")];
- backup = [backup stringByAppendingPathComponent:(rename ? @"websqldbs.appdata.db" : @"file__0")];
-
- backupItem = [[CDVBackupInfo alloc] init];
- backupItem.backup = backup;
- backupItem.original = original;
- backupItem.label = @"websql databases";
-
- [backupInfo addObject:backupItem];
-
- return backupInfo;
-}
-
-+ (NSMutableArray*)createBackupInfoWithCloudBackup:(BOOL)cloudBackup
-{
- // create backup info from backup folder to caches folder
- NSString* appLibraryFolder = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) objectAtIndex:0];
- NSString* appDocumentsFolder = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
- NSString* cacheFolder = [appLibraryFolder stringByAppendingPathComponent:@"Caches"];
- NSString* backupsFolder = [appDocumentsFolder stringByAppendingPathComponent:@"Backups"];
-
- // create the backups folder, if needed
- [[NSFileManager defaultManager] createDirectoryAtPath:backupsFolder withIntermediateDirectories:YES attributes:nil error:nil];
-
- [self addSkipBackupAttributeToItemAtURL:[NSURL fileURLWithPath:backupsFolder] skip:!cloudBackup];
-
- return [self createBackupInfoWithTargetDir:cacheFolder backupDir:backupsFolder targetDirNests:NO backupDirNests:NO rename:YES];
-}
-
-+ (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL*)URL skip:(BOOL)skip
-{
- NSError* error = nil;
- BOOL success = [URL setResourceValue:[NSNumber numberWithBool:skip] forKey:NSURLIsExcludedFromBackupKey error:&error];
-
- if (!success) {
- NSLog(@"Error excluding %@ from backup %@", [URL lastPathComponent], error);
- }
- return success;
-}
-
-+ (BOOL)copyFrom:(NSString*)src to:(NSString*)dest error:(NSError* __autoreleasing*)error
-{
- NSFileManager* fileManager = [NSFileManager defaultManager];
-
- if (![fileManager fileExistsAtPath:src]) {
- NSString* errorString = [NSString stringWithFormat:@"%@ file does not exist.", src];
- if (error != NULL) {
- (*error) = [NSError errorWithDomain:kCDVLocalStorageErrorDomain
- code:kCDVLocalStorageFileOperationError
- userInfo:[NSDictionary dictionaryWithObject:errorString
- forKey:NSLocalizedDescriptionKey]];
- }
- return NO;
- }
-
- // generate unique filepath in temp directory
- CFUUIDRef uuidRef = CFUUIDCreate(kCFAllocatorDefault);
- CFStringRef uuidString = CFUUIDCreateString(kCFAllocatorDefault, uuidRef);
- NSString* tempBackup = [[NSTemporaryDirectory() stringByAppendingPathComponent:(__bridge NSString*)uuidString] stringByAppendingPathExtension:@"bak"];
- CFRelease(uuidString);
- CFRelease(uuidRef);
-
- BOOL destExists = [fileManager fileExistsAtPath:dest];
-
- // backup the dest
- if (destExists && ![fileManager copyItemAtPath:dest toPath:tempBackup error:error]) {
- return NO;
- }
-
- // remove the dest
- if (destExists && ![fileManager removeItemAtPath:dest error:error]) {
- return NO;
- }
-
- // create path to dest
- if (!destExists && ![fileManager createDirectoryAtPath:[dest stringByDeletingLastPathComponent] withIntermediateDirectories:YES attributes:nil error:error]) {
- return NO;
- }
-
- // copy src to dest
- if ([fileManager copyItemAtPath:src toPath:dest error:error]) {
- // success - cleanup - delete the backup to the dest
- if ([fileManager fileExistsAtPath:tempBackup]) {
- [fileManager removeItemAtPath:tempBackup error:error];
- }
- return YES;
- } else {
- // failure - we restore the temp backup file to dest
- [fileManager copyItemAtPath:tempBackup toPath:dest error:error];
- // cleanup - delete the backup to the dest
- if ([fileManager fileExistsAtPath:tempBackup]) {
- [fileManager removeItemAtPath:tempBackup error:error];
- }
- return NO;
- }
-}
-
-- (BOOL)shouldBackup
-{
- for (CDVBackupInfo* info in self.backupInfo) {
- if ([info shouldBackup]) {
- return YES;
- }
- }
-
- return NO;
-}
-
-- (BOOL)shouldRestore
-{
- for (CDVBackupInfo* info in self.backupInfo) {
- if ([info shouldRestore]) {
- return YES;
- }
- }
-
- return NO;
-}
-
-/* copy from webkitDbLocation to persistentDbLocation */
-- (void)backup:(CDVInvokedUrlCommand*)command
-{
- NSString* callbackId = command.callbackId;
-
- NSError* __autoreleasing error = nil;
- CDVPluginResult* result = nil;
- NSString* message = nil;
-
- for (CDVBackupInfo* info in self.backupInfo) {
- if ([info shouldBackup]) {
- [[self class] copyFrom:info.original to:info.backup error:&error];
-
- if (callbackId) {
- if (error == nil) {
- message = [NSString stringWithFormat:@"Backed up: %@", info.label];
- NSLog(@"%@", message);
-
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:message];
- [self.commandDelegate sendPluginResult:result callbackId:callbackId];
- } else {
- message = [NSString stringWithFormat:@"Error in CDVLocalStorage (%@) backup: %@", info.label, [error localizedDescription]];
- NSLog(@"%@", message);
-
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:message];
- [self.commandDelegate sendPluginResult:result callbackId:callbackId];
- }
- }
- }
- }
-}
-
-/* copy from persistentDbLocation to webkitDbLocation */
-- (void)restore:(CDVInvokedUrlCommand*)command
-{
- NSError* __autoreleasing error = nil;
- CDVPluginResult* result = nil;
- NSString* message = nil;
-
- for (CDVBackupInfo* info in self.backupInfo) {
- if ([info shouldRestore]) {
- [[self class] copyFrom:info.backup to:info.original error:&error];
-
- if (error == nil) {
- message = [NSString stringWithFormat:@"Restored: %@", info.label];
- NSLog(@"%@", message);
-
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:message];
- [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
- } else {
- message = [NSString stringWithFormat:@"Error in CDVLocalStorage (%@) restore: %@", info.label, [error localizedDescription]];
- NSLog(@"%@", message);
-
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:message];
- [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
- }
- }
- }
-}
-
-+ (void)__fixupDatabaseLocationsWithBackupType:(NSString*)backupType
-{
- [self __verifyAndFixDatabaseLocations];
- [self __restoreLegacyDatabaseLocationsWithBackupType:backupType];
-}
-
-+ (void)__verifyAndFixDatabaseLocations
-{
- NSBundle* mainBundle = [NSBundle mainBundle];
- NSString* bundlePath = [[mainBundle bundlePath] stringByDeletingLastPathComponent];
- NSString* bundleIdentifier = [[mainBundle infoDictionary] objectForKey:@"CFBundleIdentifier"];
- NSString* appPlistPath = [bundlePath stringByAppendingPathComponent:[NSString stringWithFormat:@"Library/Preferences/%@.plist", bundleIdentifier]];
-
- NSMutableDictionary* appPlistDict = [NSMutableDictionary dictionaryWithContentsOfFile:appPlistPath];
- BOOL modified = [[self class] __verifyAndFixDatabaseLocationsWithAppPlistDict:appPlistDict
- bundlePath:bundlePath
- fileManager:[NSFileManager defaultManager]];
-
- if (modified) {
- BOOL ok = [appPlistDict writeToFile:appPlistPath atomically:YES];
- [[NSUserDefaults standardUserDefaults] synchronize];
- NSLog(@"Fix applied for database locations?: %@", ok ? @"YES" : @"NO");
- }
-}
-
-+ (BOOL)__verifyAndFixDatabaseLocationsWithAppPlistDict:(NSMutableDictionary*)appPlistDict
- bundlePath:(NSString*)bundlePath
- fileManager:(NSFileManager*)fileManager
-{
- NSString* libraryCaches = @"Library/Caches";
- NSString* libraryWebKit = @"Library/WebKit";
-
- NSArray* keysToCheck = [NSArray arrayWithObjects:
- @"WebKitLocalStorageDatabasePathPreferenceKey",
- @"WebDatabaseDirectory",
- nil];
-
- BOOL dirty = NO;
-
- for (NSString* key in keysToCheck) {
- NSString* value = [appPlistDict objectForKey:key];
- // verify key exists, and path is in app bundle, if not - fix
- if ((value != nil) && ![value hasPrefix:bundlePath]) {
- // the pathSuffix to use may be wrong - OTA upgrades from < 5.1 to 5.1 do keep the old path Library/WebKit,
- // while Xcode synced ones do change the storage location to Library/Caches
- NSString* newBundlePath = [bundlePath stringByAppendingPathComponent:libraryCaches];
- if (![fileManager fileExistsAtPath:newBundlePath]) {
- newBundlePath = [bundlePath stringByAppendingPathComponent:libraryWebKit];
- }
- [appPlistDict setValue:newBundlePath forKey:key];
- dirty = YES;
- }
- }
-
- return dirty;
-}
-
-+ (void)__restoreLegacyDatabaseLocationsWithBackupType:(NSString*)backupType
-{
- // on iOS 6, if you toggle between cloud/local backup, you must move database locations. Default upgrade from iOS5.1 to iOS6 is like a toggle from local to cloud.
- NSString* appLibraryFolder = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) objectAtIndex:0];
- NSString* appDocumentsFolder = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
-
- NSMutableArray* backupInfo = [NSMutableArray arrayWithCapacity:0];
-
- if ([backupType isEqualToString:@"cloud"]) {
-#ifdef DEBUG
- NSLog(@"\n\nStarted backup to iCloud! Please be careful."
- "\nYour application might be rejected by Apple if you store too much data."
- "\nFor more information please read \"iOS Data Storage Guidelines\" at:"
- "\nhttps://developer.apple.com/icloud/documentation/data-storage/"
- "\nTo disable web storage backup to iCloud, set the BackupWebStorage preference to \"local\" in the Cordova config.xml file\n\n");
-#endif
- // We would like to restore old backups/caches databases to the new destination (nested in lib folder)
- [backupInfo addObjectsFromArray:[self createBackupInfoWithTargetDir:appLibraryFolder backupDir:[appDocumentsFolder stringByAppendingPathComponent:@"Backups"] targetDirNests:YES backupDirNests:NO rename:YES]];
- [backupInfo addObjectsFromArray:[self createBackupInfoWithTargetDir:appLibraryFolder backupDir:[appLibraryFolder stringByAppendingPathComponent:@"Caches"] targetDirNests:YES backupDirNests:NO rename:NO]];
- } else {
- // For ios6 local backups we also want to restore from Backups dir -- but we don't need to do that here, since the plugin will do that itself.
- [backupInfo addObjectsFromArray:[self createBackupInfoWithTargetDir:[appLibraryFolder stringByAppendingPathComponent:@"Caches"] backupDir:appLibraryFolder targetDirNests:NO backupDirNests:YES rename:NO]];
- }
-
- NSFileManager* manager = [NSFileManager defaultManager];
-
- for (CDVBackupInfo* info in backupInfo) {
- if ([manager fileExistsAtPath:info.backup]) {
- if ([info shouldRestore]) {
- NSLog(@"Restoring old webstorage backup. From: '%@' To: '%@'.", info.backup, info.original);
- [self copyFrom:info.backup to:info.original error:nil];
- }
- NSLog(@"Removing old webstorage backup: '%@'.", info.backup);
- [manager removeItemAtPath:info.backup error:nil];
- }
- }
-
- [[NSUserDefaults standardUserDefaults] setBool:[backupType isEqualToString:@"cloud"] forKey:@"WebKitStoreWebDataForBackup"];
-}
-
-#pragma mark -
-#pragma mark Notification handlers
-
-- (void)onResignActive
-{
- UIDevice* device = [UIDevice currentDevice];
- NSNumber* exitsOnSuspend = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UIApplicationExitsOnSuspend"];
-
- BOOL isMultitaskingSupported = [device respondsToSelector:@selector(isMultitaskingSupported)] && [device isMultitaskingSupported];
-
- if (exitsOnSuspend == nil) { // if it's missing, it should be NO (i.e. multi-tasking on by default)
- exitsOnSuspend = [NSNumber numberWithBool:NO];
- }
-
- if (exitsOnSuspend) {
- [self backup:nil];
- } else if (isMultitaskingSupported) {
- __block UIBackgroundTaskIdentifier backgroundTaskID = UIBackgroundTaskInvalid;
-
- backgroundTaskID = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{
- [[UIApplication sharedApplication] endBackgroundTask:backgroundTaskID];
- backgroundTaskID = UIBackgroundTaskInvalid;
- NSLog(@"Background task to backup WebSQL/LocalStorage expired.");
- }];
- CDVLocalStorage __weak* weakSelf = self;
- [self.commandDelegate runInBackground:^{
- [weakSelf backup:nil];
-
- [[UIApplication sharedApplication] endBackgroundTask:backgroundTaskID];
- backgroundTaskID = UIBackgroundTaskInvalid;
- }];
- }
-}
-
-- (void)onAppTerminate
-{
- [self onResignActive];
-}
-
-- (void)onReset
-{
- [self restore:nil];
-}
-
-@end
-
-#pragma mark -
-#pragma mark CDVBackupInfo implementation
-
-@implementation CDVBackupInfo
-
-@synthesize original, backup, label;
-
-- (BOOL)file:(NSString*)aPath isNewerThanFile:(NSString*)bPath
-{
- NSFileManager* fileManager = [NSFileManager defaultManager];
- NSError* __autoreleasing error = nil;
-
- NSDictionary* aPathAttribs = [fileManager attributesOfItemAtPath:aPath error:&error];
- NSDictionary* bPathAttribs = [fileManager attributesOfItemAtPath:bPath error:&error];
-
- NSDate* aPathModDate = [aPathAttribs objectForKey:NSFileModificationDate];
- NSDate* bPathModDate = [bPathAttribs objectForKey:NSFileModificationDate];
-
- if ((nil == aPathModDate) && (nil == bPathModDate)) {
- return NO;
- }
-
- return [aPathModDate compare:bPathModDate] == NSOrderedDescending || bPathModDate == nil;
-}
-
-- (BOOL)item:(NSString*)aPath isNewerThanItem:(NSString*)bPath
-{
- NSFileManager* fileManager = [NSFileManager defaultManager];
-
- BOOL aPathIsDir = NO, bPathIsDir = NO;
- BOOL aPathExists = [fileManager fileExistsAtPath:aPath isDirectory:&aPathIsDir];
-
- [fileManager fileExistsAtPath:bPath isDirectory:&bPathIsDir];
-
- if (!aPathExists) {
- return NO;
- }
-
- if (!(aPathIsDir && bPathIsDir)) { // just a file
- return [self file:aPath isNewerThanFile:bPath];
- }
-
- // essentially we want rsync here, but have to settle for our poor man's implementation
- // we get the files in aPath, and see if it is newer than the file in bPath
- // (it is newer if it doesn't exist in bPath) if we encounter the FIRST file that is newer,
- // we return YES
- NSDirectoryEnumerator* directoryEnumerator = [fileManager enumeratorAtPath:aPath];
- NSString* path;
-
- while ((path = [directoryEnumerator nextObject])) {
- NSString* aPathFile = [aPath stringByAppendingPathComponent:path];
- NSString* bPathFile = [bPath stringByAppendingPathComponent:path];
-
- BOOL isNewer = [self file:aPathFile isNewerThanFile:bPathFile];
- if (isNewer) {
- return YES;
- }
- }
-
- return NO;
-}
-
-- (BOOL)shouldBackup
-{
- return [self item:self.original isNewerThanItem:self.backup];
-}
-
-- (BOOL)shouldRestore
-{
- return [self item:self.backup isNewerThanItem:self.original];
-}
-
-@end
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVLogger/CDVLogger.h b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVLogger/CDVLogger.h
index eeba63ca..7cfb3063 100644
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVLogger/CDVLogger.h
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVLogger/CDVLogger.h
@@ -17,7 +17,7 @@
under the License.
*/
-#import "CDVPlugin.h"
+#import <Cordova/CDVPlugin.h>
@interface CDVLogger : CDVPlugin
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.h b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.h
deleted file mode 100644
index d77f1913..00000000
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <UIKit/UIKit.h>
-#import "CDVAvailability.h"
-
-/**
- * Distinguishes top-level navigations from sub-frame navigations.
- * shouldStartLoadWithRequest is called for every request, but didStartLoad
- * and didFinishLoad is called only for top-level navigations.
- * Relevant bug: CB-2389
- */
-@interface CDVUIWebViewDelegate : NSObject <UIWebViewDelegate>{
- __weak NSObject <UIWebViewDelegate>* _delegate;
- NSInteger _loadCount;
- NSInteger _state;
- NSInteger _curLoadToken;
- NSInteger _loadStartPollCount;
-}
-
-- (id)initWithDelegate:(NSObject <UIWebViewDelegate>*)delegate;
-
-- (BOOL)request:(NSURLRequest*)newRequest isEqualToRequestAfterStrippingFragments:(NSURLRequest*)originalRequest;
-
-@end
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.m b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.m
deleted file mode 100644
index 67691217..00000000
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.m
+++ /dev/null
@@ -1,399 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-//
-// Testing shows:
-//
-// In all cases, webView.request.URL is the previous page's URL (or empty) during the didStartLoad callback.
-// When loading a page with a redirect:
-// 1. shouldStartLoading (requestURL is target page)
-// 2. didStartLoading
-// 3. shouldStartLoading (requestURL is redirect target)
-// 4. didFinishLoad (request.URL is redirect target)
-//
-// Note the lack of a second didStartLoading **
-//
-// When loading a page with iframes:
-// 1. shouldStartLoading (requestURL is main page)
-// 2. didStartLoading
-// 3. shouldStartLoading (requestURL is one of the iframes)
-// 4. didStartLoading
-// 5. didFinishLoad
-// 6. didFinishLoad
-//
-// Note there is no way to distinguish which didFinishLoad maps to which didStartLoad **
-//
-// Loading a page by calling window.history.go(-1):
-// 1. didStartLoading
-// 2. didFinishLoad
-//
-// Note the lack of a shouldStartLoading call **
-// Actually - this is fixed on iOS6. iOS6 has a shouldStart. **
-//
-// Loading a page by calling location.reload()
-// 1. shouldStartLoading
-// 2. didStartLoading
-// 3. didFinishLoad
-//
-// Loading a page with an iframe that fails to load:
-// 1. shouldStart (main page)
-// 2. didStart
-// 3. shouldStart (iframe)
-// 4. didStart
-// 5. didFailWithError
-// 6. didFinish
-//
-// Loading a page with an iframe that fails to load due to an invalid URL:
-// 1. shouldStart (main page)
-// 2. didStart
-// 3. shouldStart (iframe)
-// 5. didFailWithError
-// 6. didFinish
-//
-// This case breaks our logic since there is a missing didStart. To prevent this,
-// we check URLs in shouldStart and return NO if they are invalid.
-//
-// Loading a page with an invalid URL
-// 1. shouldStart (main page)
-// 2. didFailWithError
-//
-// TODO: Record order when page is re-navigated before the first navigation finishes.
-//
-
-#import "CDVUIWebViewDelegate.h"
-
-// #define VerboseLog NSLog
-#define VerboseLog(...) do { \
-} while (0)
-
-typedef enum {
- STATE_IDLE = 0,
- STATE_WAITING_FOR_LOAD_START = 1,
- STATE_WAITING_FOR_LOAD_FINISH = 2,
- STATE_IOS5_POLLING_FOR_LOAD_START = 3,
- STATE_IOS5_POLLING_FOR_LOAD_FINISH = 4,
- STATE_CANCELLED = 5
-} State;
-
-static NSString *stripFragment(NSString* url)
-{
- NSRange r = [url rangeOfString:@"#"];
-
- if (r.location == NSNotFound) {
- return url;
- }
- return [url substringToIndex:r.location];
-}
-
-@implementation CDVUIWebViewDelegate
-
-- (id)initWithDelegate:(NSObject <UIWebViewDelegate>*)delegate
-{
- self = [super init];
- if (self != nil) {
- _delegate = delegate;
- _loadCount = -1;
- _state = STATE_IDLE;
- }
- return self;
-}
-
-- (BOOL)request:(NSURLRequest*)newRequest isEqualToRequestAfterStrippingFragments:(NSURLRequest*)originalRequest
-{
- if (originalRequest.URL && newRequest.URL) {
- NSString* originalRequestUrl = [originalRequest.URL absoluteString];
- NSString* newRequestUrl = [newRequest.URL absoluteString];
-
- NSString* baseOriginalRequestUrl = stripFragment(originalRequestUrl);
- NSString* baseNewRequestUrl = stripFragment(newRequestUrl);
- return [baseOriginalRequestUrl isEqualToString:baseNewRequestUrl];
- }
-
- return NO;
-}
-
-- (BOOL)isPageLoaded:(UIWebView*)webView
-{
- NSString* readyState = [webView stringByEvaluatingJavaScriptFromString:@"document.readyState"];
-
- return [readyState isEqualToString:@"loaded"] || [readyState isEqualToString:@"complete"];
-}
-
-- (BOOL)isJsLoadTokenSet:(UIWebView*)webView
-{
- NSString* loadToken = [webView stringByEvaluatingJavaScriptFromString:@"window.__cordovaLoadToken"];
-
- return [[NSString stringWithFormat:@"%ld", (long)_curLoadToken] isEqualToString:loadToken];
-}
-
-- (void)setLoadToken:(UIWebView*)webView
-{
- _curLoadToken += 1;
- [webView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"window.__cordovaLoadToken=%ld", (long)_curLoadToken]];
-}
-
-- (NSString*)evalForCurrentURL:(UIWebView*)webView
-{
- return [webView stringByEvaluatingJavaScriptFromString:@"location.href"];
-}
-
-- (void)pollForPageLoadStart:(UIWebView*)webView
-{
- if (_state != STATE_IOS5_POLLING_FOR_LOAD_START) {
- return;
- }
- if (![self isJsLoadTokenSet:webView]) {
- VerboseLog(@"Polled for page load start. result = YES!");
- _state = STATE_IOS5_POLLING_FOR_LOAD_FINISH;
- [self setLoadToken:webView];
- if ([_delegate respondsToSelector:@selector(webViewDidStartLoad:)]) {
- [_delegate webViewDidStartLoad:webView];
- }
- [self pollForPageLoadFinish:webView];
- } else {
- VerboseLog(@"Polled for page load start. result = NO");
- // Poll only for 1 second, and then fall back on checking only when delegate methods are called.
- ++_loadStartPollCount;
- if (_loadStartPollCount < (1000 * .05)) {
- [self performSelector:@selector(pollForPageLoadStart:) withObject:webView afterDelay:.05];
- }
- }
-}
-
-- (void)pollForPageLoadFinish:(UIWebView*)webView
-{
- if (_state != STATE_IOS5_POLLING_FOR_LOAD_FINISH) {
- return;
- }
- if ([self isPageLoaded:webView]) {
- VerboseLog(@"Polled for page load finish. result = YES!");
- _state = STATE_IDLE;
- if ([_delegate respondsToSelector:@selector(webViewDidFinishLoad:)]) {
- [_delegate webViewDidFinishLoad:webView];
- }
- } else {
- VerboseLog(@"Polled for page load finish. result = NO");
- [self performSelector:@selector(pollForPageLoadFinish:) withObject:webView afterDelay:.05];
- }
-}
-
-- (BOOL)shouldLoadRequest:(NSURLRequest*)request
-{
- NSString* scheme = [[request URL] scheme];
- NSArray* allowedSchemes = [NSArray arrayWithObjects:@"mailto",@"tel",@"blob",@"sms",@"data", nil];
- if([allowedSchemes containsObject:scheme]) {
- return YES;
- }
- else {
- return [NSURLConnection canHandleRequest:request];
- }
-}
-
-- (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
-{
- BOOL shouldLoad = YES;
-
- if ([_delegate respondsToSelector:@selector(webView:shouldStartLoadWithRequest:navigationType:)]) {
- shouldLoad = [_delegate webView:webView shouldStartLoadWithRequest:request navigationType:navigationType];
- }
-
- VerboseLog(@"webView shouldLoad=%d (before) state=%d loadCount=%d URL=%@", shouldLoad, _state, _loadCount, request.URL);
-
- if (shouldLoad) {
- // When devtools refresh occurs, it blindly uses the same request object. If a history.replaceState() has occured, then
- // mainDocumentURL != URL even though it's a top-level navigation.
- BOOL isDevToolsRefresh = (request == webView.request);
- BOOL isTopLevelNavigation = isDevToolsRefresh || [request.URL isEqual:[request mainDocumentURL]];
- if (isTopLevelNavigation) {
- // Ignore hash changes that don't navigate to a different page.
- // webView.request does actually update when history.replaceState() gets called.
- if ([self request:request isEqualToRequestAfterStrippingFragments:webView.request]) {
- NSString* prevURL = [self evalForCurrentURL:webView];
- if ([prevURL isEqualToString:[request.URL absoluteString]]) {
- VerboseLog(@"Page reload detected.");
- } else {
- VerboseLog(@"Detected hash change shouldLoad");
- return shouldLoad;
- }
- }
-
- switch (_state) {
- case STATE_WAITING_FOR_LOAD_FINISH:
- // Redirect case.
- // We expect loadCount == 1.
- if (_loadCount != 1) {
- NSLog(@"CDVWebViewDelegate: Detected redirect when loadCount=%ld", (long)_loadCount);
- }
- break;
-
- case STATE_IDLE:
- case STATE_IOS5_POLLING_FOR_LOAD_START:
- case STATE_CANCELLED:
- // Page navigation start.
- _loadCount = 0;
- _state = STATE_WAITING_FOR_LOAD_START;
- break;
-
- default:
- {
- NSString* description = [NSString stringWithFormat:@"CDVWebViewDelegate: Navigation started when state=%ld", (long)_state];
- NSLog(@"%@", description);
- _loadCount = 0;
- _state = STATE_WAITING_FOR_LOAD_START;
-
- NSDictionary* errorDictionary = @{NSLocalizedDescriptionKey : description};
- NSError* error = [[NSError alloc] initWithDomain:@"CDVUIWebViewDelegate" code:1 userInfo:errorDictionary];
- [self webView:webView didFailLoadWithError:error];
- }
- }
- } else {
- // Deny invalid URLs so that we don't get the case where we go straight from
- // webViewShouldLoad -> webViewDidFailLoad (messes up _loadCount).
- shouldLoad = shouldLoad && [self shouldLoadRequest:request];
- }
- VerboseLog(@"webView shouldLoad=%d (after) isTopLevelNavigation=%d state=%d loadCount=%d", shouldLoad, isTopLevelNavigation, _state, _loadCount);
- }
- return shouldLoad;
-}
-
-- (void)webViewDidStartLoad:(UIWebView*)webView
-{
- VerboseLog(@"webView didStartLoad (before). state=%d loadCount=%d", _state, _loadCount);
- BOOL fireCallback = NO;
- switch (_state) {
- case STATE_IDLE:
- break;
-
- case STATE_CANCELLED:
- fireCallback = YES;
- _state = STATE_WAITING_FOR_LOAD_FINISH;
- _loadCount += 1;
- break;
-
- case STATE_WAITING_FOR_LOAD_START:
- if (_loadCount != 0) {
- NSLog(@"CDVWebViewDelegate: Unexpected loadCount in didStart. count=%ld", (long)_loadCount);
- }
- fireCallback = YES;
- _state = STATE_WAITING_FOR_LOAD_FINISH;
- _loadCount = 1;
- break;
-
- case STATE_WAITING_FOR_LOAD_FINISH:
- _loadCount += 1;
- break;
-
- case STATE_IOS5_POLLING_FOR_LOAD_START:
- [self pollForPageLoadStart:webView];
- break;
-
- case STATE_IOS5_POLLING_FOR_LOAD_FINISH:
- [self pollForPageLoadFinish:webView];
- break;
-
- default:
- NSLog(@"CDVWebViewDelegate: Unexpected didStart with state=%ld loadCount=%ld", (long)_state, (long)_loadCount);
- }
- VerboseLog(@"webView didStartLoad (after). state=%d loadCount=%d fireCallback=%d", _state, _loadCount, fireCallback);
- if (fireCallback && [_delegate respondsToSelector:@selector(webViewDidStartLoad:)]) {
- [_delegate webViewDidStartLoad:webView];
- }
-}
-
-- (void)webViewDidFinishLoad:(UIWebView*)webView
-{
- VerboseLog(@"webView didFinishLoad (before). state=%d loadCount=%d", _state, _loadCount);
- BOOL fireCallback = NO;
- switch (_state) {
- case STATE_IDLE:
- break;
-
- case STATE_WAITING_FOR_LOAD_START:
- NSLog(@"CDVWebViewDelegate: Unexpected didFinish while waiting for load start.");
- break;
-
- case STATE_WAITING_FOR_LOAD_FINISH:
- if (_loadCount == 1) {
- fireCallback = YES;
- _state = STATE_IDLE;
- }
- _loadCount -= 1;
- break;
-
- case STATE_IOS5_POLLING_FOR_LOAD_START:
- [self pollForPageLoadStart:webView];
- break;
-
- case STATE_IOS5_POLLING_FOR_LOAD_FINISH:
- [self pollForPageLoadFinish:webView];
- break;
- }
- VerboseLog(@"webView didFinishLoad (after). state=%d loadCount=%d fireCallback=%d", _state, _loadCount, fireCallback);
- if (fireCallback && [_delegate respondsToSelector:@selector(webViewDidFinishLoad:)]) {
- [_delegate webViewDidFinishLoad:webView];
- }
-}
-
-- (void)webView:(UIWebView*)webView didFailLoadWithError:(NSError*)error
-{
- VerboseLog(@"webView didFailLoad (before). state=%d loadCount=%d", _state, _loadCount);
- BOOL fireCallback = NO;
-
- switch (_state) {
- case STATE_IDLE:
- break;
-
- case STATE_WAITING_FOR_LOAD_START:
- if ([error code] == NSURLErrorCancelled) {
- _state = STATE_CANCELLED;
- } else {
- _state = STATE_IDLE;
- }
- fireCallback = YES;
- break;
-
- case STATE_WAITING_FOR_LOAD_FINISH:
- if ([error code] != NSURLErrorCancelled) {
- if (_loadCount == 1) {
- _state = STATE_IDLE;
- fireCallback = YES;
- }
- _loadCount = -1;
- } else {
- fireCallback = YES;
- _state = STATE_CANCELLED;
- _loadCount -= 1;
- }
- break;
-
- case STATE_IOS5_POLLING_FOR_LOAD_START:
- [self pollForPageLoadStart:webView];
- break;
-
- case STATE_IOS5_POLLING_FOR_LOAD_FINISH:
- [self pollForPageLoadFinish:webView];
- break;
- }
- VerboseLog(@"webView didFailLoad (after). state=%d loadCount=%d, fireCallback=%d", _state, _loadCount, fireCallback);
- if (fireCallback && [_delegate respondsToSelector:@selector(webView:didFailLoadWithError:)]) {
- [_delegate webView:webView didFailLoadWithError:error];
- }
-}
-
-@end
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewEngine.m b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewEngine.m
deleted file mode 100644
index f571d80a..00000000
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewEngine.m
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVUIWebViewEngine.h"
-#import "CDVUIWebViewDelegate.h"
-#import "CDVUIWebViewNavigationDelegate.h"
-#import "NSDictionary+CordovaPreferences.h"
-
-#import <objc/message.h>
-
-@interface CDVUIWebViewEngine ()
-
-@property (nonatomic, strong, readwrite) UIView* engineWebView;
-@property (nonatomic, strong, readwrite) id <UIWebViewDelegate> uiWebViewDelegate;
-@property (nonatomic, strong, readwrite) CDVUIWebViewNavigationDelegate* navWebViewDelegate;
-
-@end
-
-@implementation CDVUIWebViewEngine
-
-@synthesize engineWebView = _engineWebView;
-
-- (instancetype)initWithFrame:(CGRect)frame
-{
- self = [super init];
- if (self) {
- self.engineWebView = [[UIWebView alloc] initWithFrame:frame];
- NSLog(@"Using UIWebView");
- }
-
- return self;
-}
-
-- (void)pluginInitialize
-{
- // viewController would be available now. we attempt to set all possible delegates to it, by default
-
- UIWebView* uiWebView = (UIWebView*)_engineWebView;
-
- if ([self.viewController conformsToProtocol:@protocol(UIWebViewDelegate)]) {
- self.uiWebViewDelegate = [[CDVUIWebViewDelegate alloc] initWithDelegate:(id <UIWebViewDelegate>)self.viewController];
- uiWebView.delegate = self.uiWebViewDelegate;
- } else {
- self.navWebViewDelegate = [[CDVUIWebViewNavigationDelegate alloc] initWithEnginePlugin:self];
- self.uiWebViewDelegate = [[CDVUIWebViewDelegate alloc] initWithDelegate:self.navWebViewDelegate];
- uiWebView.delegate = self.uiWebViewDelegate;
- }
-
- [self updateSettings:self.commandDelegate.settings];
-}
-
-- (void)evaluateJavaScript:(NSString*)javaScriptString completionHandler:(void (^)(id, NSError*))completionHandler
-{
- NSString* ret = [(UIWebView*)_engineWebView stringByEvaluatingJavaScriptFromString:javaScriptString];
-
- if (completionHandler) {
- completionHandler(ret, nil);
- }
-}
-
-- (id)loadRequest:(NSURLRequest*)request
-{
- [(UIWebView*)_engineWebView loadRequest:request];
- return nil;
-}
-
-- (id)loadHTMLString:(NSString*)string baseURL:(NSURL*)baseURL
-{
- [(UIWebView*)_engineWebView loadHTMLString:string baseURL:baseURL];
- return nil;
-}
-
-- (NSURL*)URL
-{
- return [[(UIWebView*)_engineWebView request] URL];
-}
-
-- (BOOL) canLoadRequest:(NSURLRequest*)request
-{
- return (request != nil);
-}
-
-- (void)updateSettings:(NSDictionary*)settings
-{
- UIWebView* uiWebView = (UIWebView*)_engineWebView;
-
- uiWebView.scalesPageToFit = [settings cordovaBoolSettingForKey:@"EnableViewportScale" defaultValue:NO];
- uiWebView.allowsInlineMediaPlayback = [settings cordovaBoolSettingForKey:@"AllowInlineMediaPlayback" defaultValue:NO];
- uiWebView.mediaPlaybackRequiresUserAction = [settings cordovaBoolSettingForKey:@"MediaPlaybackRequiresUserAction" defaultValue:YES];
- uiWebView.mediaPlaybackAllowsAirPlay = [settings cordovaBoolSettingForKey:@"MediaPlaybackAllowsAirPlay" defaultValue:YES];
- uiWebView.keyboardDisplayRequiresUserAction = [settings cordovaBoolSettingForKey:@"KeyboardDisplayRequiresUserAction" defaultValue:YES];
- uiWebView.suppressesIncrementalRendering = [settings cordovaBoolSettingForKey:@"SuppressesIncrementalRendering" defaultValue:NO];
- uiWebView.gapBetweenPages = [settings cordovaFloatSettingForKey:@"GapBetweenPages" defaultValue:0.0];
- uiWebView.pageLength = [settings cordovaFloatSettingForKey:@"PageLength" defaultValue:0.0];
-
- id prefObj = nil;
-
- // By default, DisallowOverscroll is false (thus bounce is allowed)
- BOOL bounceAllowed = !([settings cordovaBoolSettingForKey:@"DisallowOverscroll" defaultValue:NO]);
-
- // prevent webView from bouncing
- if (!bounceAllowed) {
- if ([uiWebView respondsToSelector:@selector(scrollView)]) {
- ((UIScrollView*)[uiWebView scrollView]).bounces = NO;
- } else {
- for (id subview in self.webView.subviews) {
- if ([[subview class] isSubclassOfClass:[UIScrollView class]]) {
- ((UIScrollView*)subview).bounces = NO;
- }
- }
- }
- }
-
- NSString* decelerationSetting = [settings cordovaSettingForKey:@"UIWebViewDecelerationSpeed"];
- if (![@"fast" isEqualToString:decelerationSetting]) {
- [uiWebView.scrollView setDecelerationRate:UIScrollViewDecelerationRateNormal];
- }
-
- NSInteger paginationBreakingMode = 0; // default - UIWebPaginationBreakingModePage
- prefObj = [settings cordovaSettingForKey:@"PaginationBreakingMode"];
- if (prefObj != nil) {
- NSArray* validValues = @[@"page", @"column"];
- NSString* prefValue = [validValues objectAtIndex:0];
-
- if ([prefObj isKindOfClass:[NSString class]]) {
- prefValue = prefObj;
- }
-
- paginationBreakingMode = [validValues indexOfObject:[prefValue lowercaseString]];
- if (paginationBreakingMode == NSNotFound) {
- paginationBreakingMode = 0;
- }
- }
- uiWebView.paginationBreakingMode = paginationBreakingMode;
-
- NSInteger paginationMode = 0; // default - UIWebPaginationModeUnpaginated
- prefObj = [settings cordovaSettingForKey:@"PaginationMode"];
- if (prefObj != nil) {
- NSArray* validValues = @[@"unpaginated", @"lefttoright", @"toptobottom", @"bottomtotop", @"righttoleft"];
- NSString* prefValue = [validValues objectAtIndex:0];
-
- if ([prefObj isKindOfClass:[NSString class]]) {
- prefValue = prefObj;
- }
-
- paginationMode = [validValues indexOfObject:[prefValue lowercaseString]];
- if (paginationMode == NSNotFound) {
- paginationMode = 0;
- }
- }
- uiWebView.paginationMode = paginationMode;
-}
-
-- (void)updateWithInfo:(NSDictionary*)info
-{
- UIWebView* uiWebView = (UIWebView*)_engineWebView;
-
- id <UIWebViewDelegate> uiWebViewDelegate = [info objectForKey:kCDVWebViewEngineUIWebViewDelegate];
- NSDictionary* settings = [info objectForKey:kCDVWebViewEngineWebViewPreferences];
-
- if (uiWebViewDelegate &&
- [uiWebViewDelegate conformsToProtocol:@protocol(UIWebViewDelegate)]) {
- self.uiWebViewDelegate = [[CDVUIWebViewDelegate alloc] initWithDelegate:(id <UIWebViewDelegate>)self.viewController];
- uiWebView.delegate = self.uiWebViewDelegate;
- }
-
- if (settings && [settings isKindOfClass:[NSDictionary class]]) {
- [self updateSettings:settings];
- }
-}
-
-// This forwards the methods that are in the header that are not implemented here.
-// Both WKWebView and UIWebView implement the below:
-// loadHTMLString:baseURL:
-// loadRequest:
-- (id)forwardingTargetForSelector:(SEL)aSelector
-{
- return _engineWebView;
-}
-
-- (UIView*)webView
-{
- return self.engineWebView;
-}
-
-@end
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.m b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.m
deleted file mode 100644
index bc56fdde..00000000
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.m
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVUIWebViewNavigationDelegate.h"
-#import <Cordova/CDVViewController.h>
-#import <Cordova/CDVCommandDelegateImpl.h>
-#import <Cordova/CDVUserAgentUtil.h>
-#import <objc/message.h>
-
-@implementation CDVUIWebViewNavigationDelegate
-
-- (instancetype)initWithEnginePlugin:(CDVPlugin*)theEnginePlugin
-{
- self = [super init];
- if (self) {
- self.enginePlugin = theEnginePlugin;
- }
-
- return self;
-}
-
-/**
- When web application loads Add stuff to the DOM, mainly the user-defined settings from the Settings.plist file, and
- the device's data such as device ID, platform version, etc.
- */
-- (void)webViewDidStartLoad:(UIWebView*)theWebView
-{
- NSLog(@"Resetting plugins due to page load.");
- CDVViewController* vc = (CDVViewController*)self.enginePlugin.viewController;
-
- [vc.commandQueue resetRequestId];
- [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginResetNotification object:self.enginePlugin.webView]];
-}
-
-/**
- Called when the webview finishes loading. This stops the activity view.
- */
-- (void)webViewDidFinishLoad:(UIWebView*)theWebView
-{
- NSLog(@"Finished load of: %@", theWebView.request.URL);
- CDVViewController* vc = (CDVViewController*)self.enginePlugin.viewController;
-
- // It's safe to release the lock even if this is just a sub-frame that's finished loading.
- [CDVUserAgentUtil releaseLock:vc.userAgentLockToken];
-
- /*
- * Hide the Top Activity THROBBER in the Battery Bar
- */
- [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
-
- [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPageDidLoadNotification object:self.enginePlugin.webView]];
-}
-
-- (void)webView:(UIWebView*)theWebView didFailLoadWithError:(NSError*)error
-{
- CDVViewController* vc = (CDVViewController*)self.enginePlugin.viewController;
-
- [CDVUserAgentUtil releaseLock:vc.userAgentLockToken];
-
- NSString* message = [NSString stringWithFormat:@"Failed to load webpage with error: %@", [error localizedDescription]];
- NSLog(@"%@", message);
-
- NSURL* errorUrl = vc.errorURL;
- if (errorUrl) {
- errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [message stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLPathAllowedCharacterSet]] relativeToURL:errorUrl];
- NSLog(@"%@", [errorUrl absoluteString]);
- if(error.code != NSURLErrorCancelled) {
- [theWebView loadRequest:[NSURLRequest requestWithURL:errorUrl]];
- }
- }
-}
-
-- (BOOL)defaultResourcePolicyForURL:(NSURL*)url
-{
- /*
- * If a URL is being loaded that's a file url, just load it internally
- */
- if ([url isFileURL]) {
- return YES;
- }
-
- return NO;
-}
-
-- (BOOL)webView:(UIWebView*)theWebView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
-{
- NSURL* url = [request URL];
- CDVViewController* vc = (CDVViewController*)self.enginePlugin.viewController;
-
- /*
- * Execute any commands queued with cordova.exec() on the JS side.
- * The part of the URL after gap:// is irrelevant.
- */
- if ([[url scheme] isEqualToString:@"gap"]) {
- [vc.commandQueue fetchCommandsFromJs];
- // The delegate is called asynchronously in this case, so we don't have to use
- // flushCommandQueueWithDelayedJs (setTimeout(0)) as we do with hash changes.
- [vc.commandQueue executePending];
- return NO;
- }
-
- /*
- * Give plugins the chance to handle the url
- */
- BOOL anyPluginsResponded = NO;
- BOOL shouldAllowRequest = NO;
-
- for (NSString* pluginName in vc.pluginObjects) {
- CDVPlugin* plugin = [vc.pluginObjects objectForKey:pluginName];
- SEL selector = NSSelectorFromString(@"shouldOverrideLoadWithRequest:navigationType:");
- if ([plugin respondsToSelector:selector]) {
- anyPluginsResponded = YES;
- shouldAllowRequest = (((BOOL (*)(id, SEL, id, int))objc_msgSend)(plugin, selector, request, navigationType));
- if (!shouldAllowRequest) {
- break;
- }
- }
- }
-
- if (anyPluginsResponded) {
- return shouldAllowRequest;
- }
-
- /*
- * Handle all other types of urls (tel:, sms:), and requests to load a url in the main webview.
- */
- BOOL shouldAllowNavigation = [self defaultResourcePolicyForURL:url];
- if (shouldAllowNavigation) {
- return YES;
- } else {
- [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]];
- }
-
- return NO;
-}
-
-@end
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.h b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.h
new file mode 100644
index 00000000..47e26d1e
--- /dev/null
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.h
@@ -0,0 +1,29 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <WebKit/WebKit.h>
+#import <Cordova/CDV.h>
+
+@interface CDVWebViewEngine : CDVPlugin <CDVWebViewEngineProtocol, WKScriptMessageHandler, WKNavigationDelegate>
+
+@property (nonatomic, strong, readonly) id <WKUIDelegate> uiDelegate;
+
+- (void)allowsBackForwardNavigationGestures:(CDVInvokedUrlCommand*)command;
+
+@end
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m
new file mode 100644
index 00000000..a07bf290
--- /dev/null
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m
@@ -0,0 +1,607 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import "CDVWebViewEngine.h"
+#import "CDVWebViewUIDelegate.h"
+#import "CDVWebViewProcessPoolFactory.h"
+#import <Cordova/NSDictionary+CordovaPreferences.h>
+#import "CDVURLSchemeHandler.h"
+
+#import <objc/message.h>
+
+#define CDV_BRIDGE_NAME @"cordova"
+#define CDV_WKWEBVIEW_FILE_URL_LOAD_SELECTOR @"loadFileURL:allowingReadAccessToURL:"
+
+@interface CDVWebViewWeakScriptMessageHandler : NSObject <WKScriptMessageHandler>
+
+@property (nonatomic, weak, readonly) id<WKScriptMessageHandler>scriptMessageHandler;
+
+- (instancetype)initWithScriptMessageHandler:(id<WKScriptMessageHandler>)scriptMessageHandler;
+
+@end
+
+
+@interface CDVWebViewEngine ()
+
+@property (nonatomic, strong, readwrite) UIView* engineWebView;
+@property (nonatomic, strong, readwrite) id <WKUIDelegate> uiDelegate;
+@property (nonatomic, weak) id <WKScriptMessageHandler> weakScriptMessageHandler;
+@property (nonatomic, strong) CDVURLSchemeHandler * schemeHandler;
+@property (nonatomic, readwrite) NSString *CDV_ASSETS_URL;
+@property (nonatomic, readwrite) Boolean cdvIsFileScheme;
+
+@end
+
+// see forwardingTargetForSelector: selector comment for the reason for this pragma
+#pragma clang diagnostic ignored "-Wprotocol"
+
+@implementation CDVWebViewEngine
+
+@synthesize engineWebView = _engineWebView;
+
+- (instancetype)initWithFrame:(CGRect)frame
+{
+ self = [super init];
+ if (self) {
+ if (NSClassFromString(@"WKWebView") == nil) {
+ return nil;
+ }
+
+ self.engineWebView = [[WKWebView alloc] initWithFrame:frame];
+ }
+
+ return self;
+}
+
+- (WKWebViewConfiguration*) createConfigurationFromSettings:(NSDictionary*)settings
+{
+ WKWebViewConfiguration* configuration = [[WKWebViewConfiguration alloc] init];
+ configuration.processPool = [[CDVWebViewProcessPoolFactory sharedFactory] sharedProcessPool];
+ if (settings == nil) {
+ return configuration;
+ }
+
+ configuration.allowsInlineMediaPlayback = [settings cordovaBoolSettingForKey:@"AllowInlineMediaPlayback" defaultValue:NO];
+
+ // Set the media types that are required for user action for playback
+ WKAudiovisualMediaTypes mediaType = WKAudiovisualMediaTypeAll; // default
+
+ // targetMediaType will always exist, either from user's "config.xml" or default ("defaults.xml").
+ id targetMediaType = [settings cordovaSettingForKey:@"MediaTypesRequiringUserActionForPlayback"];
+ if ([targetMediaType isEqualToString:@"none"]) {
+ mediaType = WKAudiovisualMediaTypeNone;
+ } else if ([targetMediaType isEqualToString:@"audio"]) {
+ mediaType = WKAudiovisualMediaTypeAudio;
+ } else if ([targetMediaType isEqualToString:@"video"]) {
+ mediaType = WKAudiovisualMediaTypeVideo;
+ } else if ([targetMediaType isEqualToString:@"all"]) {
+ mediaType = WKAudiovisualMediaTypeAll;
+ } else {
+ NSLog(@"Invalid \"MediaTypesRequiringUserActionForPlayback\" was detected. Fallback to default value of \"all\" types.");
+ }
+ configuration.mediaTypesRequiringUserActionForPlayback = mediaType;
+
+ configuration.suppressesIncrementalRendering = [settings cordovaBoolSettingForKey:@"SuppressesIncrementalRendering" defaultValue:NO];
+
+ /*
+ * If the old preference key "MediaPlaybackAllowsAirPlay" exists, use it or default to "YES".
+ * Check if the new preference key "AllowsAirPlayForMediaPlayback" exists and overwrite the "MediaPlaybackAllowsAirPlay" value.
+ */
+ BOOL allowsAirPlayForMediaPlayback = [settings cordovaBoolSettingForKey:@"MediaPlaybackAllowsAirPlay" defaultValue:YES];
+ if([settings cordovaSettingForKey:@"AllowsAirPlayForMediaPlayback"] != nil) {
+ allowsAirPlayForMediaPlayback = [settings cordovaBoolSettingForKey:@"AllowsAirPlayForMediaPlayback" defaultValue:YES];
+ }
+ configuration.allowsAirPlayForMediaPlayback = allowsAirPlayForMediaPlayback;
+
+ /*
+ * Sets Custom User Agents
+ * - (Default) "userAgent" is set the the clean user agent.
+ * E.g.
+ * UserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
+ *
+ * - If "OverrideUserAgent" is set, it will overwrite the entire "userAgent" value. The "AppendUserAgent" will be iggnored if set.
+ * Notice: The override logic is handled in the "pluginInitialize" method.
+ * E.g.
+ * OverrideUserAgent = "foobar"
+ * UserAgent = "foobar"
+ *
+ * - If "AppendUserAgent" is set and "OverrideUserAgent" is not set, the user defined "AppendUserAgent" will be appended to the "userAgent"
+ * E.g.
+ * AppendUserAgent = "foobar"
+ * UserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 foobar"
+ */
+ NSString *userAgent = configuration.applicationNameForUserAgent;
+ if (
+ [settings cordovaSettingForKey:@"OverrideUserAgent"] == nil &&
+ [settings cordovaSettingForKey:@"AppendUserAgent"] != nil
+ ) {
+ userAgent = [NSString stringWithFormat:@"%@ %@", userAgent, [settings cordovaSettingForKey:@"AppendUserAgent"]];
+ }
+ configuration.applicationNameForUserAgent = userAgent;
+
+ if (@available(iOS 13.0, *)) {
+ NSString *contentMode = [settings cordovaSettingForKey:@"PreferredContentMode"];
+ if ([contentMode isEqual: @"mobile"]) {
+ configuration.defaultWebpagePreferences.preferredContentMode = WKContentModeMobile;
+ } else if ([contentMode isEqual: @"desktop"]) {
+ configuration.defaultWebpagePreferences.preferredContentMode = WKContentModeDesktop;
+ }
+
+ }
+
+ return configuration;
+}
+
+- (void)pluginInitialize
+{
+ // viewController would be available now. we attempt to set all possible delegates to it, by default
+ CDVViewController* vc = (CDVViewController*)self.viewController;
+ NSDictionary* settings = self.commandDelegate.settings;
+
+ NSString *scheme = [settings cordovaSettingForKey:@"scheme"];
+
+ // If scheme is file or nil, then default to file scheme
+ self.cdvIsFileScheme = [scheme isEqualToString: @"file"] || scheme == nil;
+
+ NSString *hostname = @"";
+ if(!self.cdvIsFileScheme) {
+ if(scheme == nil || [WKWebView handlesURLScheme:scheme]){
+ scheme = @"app";
+ }
+ vc.appScheme = scheme;
+
+ hostname = [settings cordovaSettingForKey:@"hostname"];
+ if(hostname == nil){
+ hostname = @"localhost";
+ }
+
+ self.CDV_ASSETS_URL = [NSString stringWithFormat:@"%@://%@", scheme, hostname];
+ }
+
+ CDVWebViewUIDelegate* uiDelegate = [[CDVWebViewUIDelegate alloc] initWithTitle:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]];
+ uiDelegate.allowNewWindows = [settings cordovaBoolSettingForKey:@"AllowNewWindows" defaultValue:NO];
+ self.uiDelegate = uiDelegate;
+
+ CDVWebViewWeakScriptMessageHandler *weakScriptMessageHandler = [[CDVWebViewWeakScriptMessageHandler alloc] initWithScriptMessageHandler:self];
+
+ WKUserContentController* userContentController = [[WKUserContentController alloc] init];
+ [userContentController addScriptMessageHandler:weakScriptMessageHandler name:CDV_BRIDGE_NAME];
+
+ if(self.CDV_ASSETS_URL) {
+ NSString *scriptCode = [NSString stringWithFormat:@"window.CDV_ASSETS_URL = '%@';", self.CDV_ASSETS_URL];
+ WKUserScript *wkScript = [[WKUserScript alloc] initWithSource:scriptCode injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:YES];
+
+ if (wkScript) {
+ [userContentController addUserScript:wkScript];
+ }
+ }
+
+ WKWebViewConfiguration* configuration = [self createConfigurationFromSettings:settings];
+ configuration.userContentController = userContentController;
+
+ // Do not configure the scheme handler if the scheme is default (file)
+ if(!self.cdvIsFileScheme) {
+ self.schemeHandler = [[CDVURLSchemeHandler alloc] initWithVC:vc];
+ [configuration setURLSchemeHandler:self.schemeHandler forURLScheme:scheme];
+ }
+
+ // re-create WKWebView, since we need to update configuration
+ WKWebView* wkWebView = [[WKWebView alloc] initWithFrame:self.engineWebView.frame configuration:configuration];
+ wkWebView.UIDelegate = self.uiDelegate;
+
+ /*
+ * This is where the "OverrideUserAgent" is handled. This will replace the entire UserAgent
+ * with the user defined custom UserAgent.
+ */
+ if ([settings cordovaSettingForKey:@"OverrideUserAgent"] != nil) {
+ wkWebView.customUserAgent = [settings cordovaSettingForKey:@"OverrideUserAgent"];
+ }
+
+ self.engineWebView = wkWebView;
+
+ if ([self.viewController conformsToProtocol:@protocol(WKUIDelegate)]) {
+ wkWebView.UIDelegate = (id <WKUIDelegate>)self.viewController;
+ }
+
+ if ([self.viewController conformsToProtocol:@protocol(WKNavigationDelegate)]) {
+ wkWebView.navigationDelegate = (id <WKNavigationDelegate>)self.viewController;
+ } else {
+ wkWebView.navigationDelegate = (id <WKNavigationDelegate>)self;
+ }
+
+ if ([self.viewController conformsToProtocol:@protocol(WKScriptMessageHandler)]) {
+ [wkWebView.configuration.userContentController addScriptMessageHandler:(id < WKScriptMessageHandler >)self.viewController name:CDV_BRIDGE_NAME];
+ }
+
+ [self updateSettings:settings];
+
+ // check if content thread has died on resume
+ NSLog(@"%@", @"CDVWebViewEngine will reload WKWebView if required on resume");
+ [[NSNotificationCenter defaultCenter]
+ addObserver:self
+ selector:@selector(onAppWillEnterForeground:)
+ name:UIApplicationWillEnterForegroundNotification object:nil];
+
+ NSLog(@"Using WKWebView");
+
+ [self addURLObserver];
+}
+
+- (void)onReset {
+ [self addURLObserver];
+}
+
+static void * KVOContext = &KVOContext;
+
+- (void)addURLObserver {
+ if(!IsAtLeastiOSVersion(@"9.0")){
+ [self.webView addObserver:self forKeyPath:@"URL" options:0 context:KVOContext];
+ }
+}
+
+- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSString *,id> *)change context:(void *)context
+{
+ if (context == KVOContext) {
+ if (object == [self webView] && [keyPath isEqualToString: @"URL"] && [object valueForKeyPath:keyPath] == nil){
+ NSLog(@"URL is nil. Reloading WKWebView");
+ [(WKWebView*)_engineWebView reload];
+ }
+ } else {
+ [super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
+ }
+}
+
+- (void) onAppWillEnterForeground:(NSNotification*)notification {
+ if ([self shouldReloadWebView]) {
+ NSLog(@"%@", @"CDVWebViewEngine reloading!");
+ [(WKWebView*)_engineWebView reload];
+ }
+}
+
+- (BOOL)shouldReloadWebView
+{
+ WKWebView* wkWebView = (WKWebView*)_engineWebView;
+ return [self shouldReloadWebView:wkWebView.URL title:wkWebView.title];
+}
+
+- (BOOL)shouldReloadWebView:(NSURL*)location title:(NSString*)title
+{
+ BOOL title_is_nil = (title == nil);
+ BOOL location_is_blank = [[location absoluteString] isEqualToString:@"about:blank"];
+
+ BOOL reload = (title_is_nil || location_is_blank);
+
+#ifdef DEBUG
+ NSLog(@"%@", @"CDVWebViewEngine shouldReloadWebView::");
+ NSLog(@"CDVWebViewEngine shouldReloadWebView title: %@", title);
+ NSLog(@"CDVWebViewEngine shouldReloadWebView location: %@", [location absoluteString]);
+ NSLog(@"CDVWebViewEngine shouldReloadWebView reload: %u", reload);
+#endif
+
+ return reload;
+}
+
+
+- (id)loadRequest:(NSURLRequest*)request
+{
+ if ([self canLoadRequest:request]) { // can load, differentiate between file urls and other schemes
+ if(request.URL.fileURL && self.cdvIsFileScheme) {
+ NSURL* readAccessUrl = [request.URL URLByDeletingLastPathComponent];
+ return [(WKWebView*)_engineWebView loadFileURL:request.URL allowingReadAccessToURL:readAccessUrl];
+ } else if (request.URL.fileURL) {
+ NSURL* startURL = [NSURL URLWithString:((CDVViewController *)self.viewController).startPage];
+ NSString* startFilePath = [self.commandDelegate pathForResource:[startURL path]];
+ NSURL *url = [[NSURL URLWithString:self.CDV_ASSETS_URL] URLByAppendingPathComponent:request.URL.path];
+ if ([request.URL.path isEqualToString:startFilePath]) {
+ url = [NSURL URLWithString:[NSString stringWithFormat:@"%@/%@", self.CDV_ASSETS_URL, startURL]];
+ }
+ if(request.URL.query) {
+ url = [NSURL URLWithString:[@"?" stringByAppendingString:request.URL.query] relativeToURL:url];
+ }
+ if(request.URL.fragment) {
+ url = [NSURL URLWithString:[@"#" stringByAppendingString:request.URL.fragment] relativeToURL:url];
+ }
+ request = [NSURLRequest requestWithURL:url];
+ }
+ return [(WKWebView*)_engineWebView loadRequest:request];
+ } else { // can't load, print out error
+ NSString* errorHtml = [NSString stringWithFormat:
+ @"<!doctype html>"
+ @"<title>Error</title>"
+ @"<div style='font-size:2em'>"
+ @" <p>The WebView engine '%@' is unable to load the request: %@</p>"
+ @" <p>Most likely the cause of the error is that the loading of file urls is not supported in iOS %@.</p>"
+ @"</div>",
+ NSStringFromClass([self class]),
+ [request.URL description],
+ [[UIDevice currentDevice] systemVersion]
+ ];
+ return [self loadHTMLString:errorHtml baseURL:nil];
+ }
+}
+
+- (id)loadHTMLString:(NSString*)string baseURL:(NSURL*)baseURL
+{
+ return [(WKWebView*)_engineWebView loadHTMLString:string baseURL:baseURL];
+}
+
+- (NSURL*) URL
+{
+ return [(WKWebView*)_engineWebView URL];
+}
+
+- (BOOL) canLoadRequest:(NSURLRequest*)request
+{
+ // See: https://issues.apache.org/jira/browse/CB-9636
+ SEL wk_sel = NSSelectorFromString(CDV_WKWEBVIEW_FILE_URL_LOAD_SELECTOR);
+
+ // if it's a file URL, check whether WKWebView has the selector (which is in iOS 9 and up only)
+ if (request.URL.fileURL) {
+ return [_engineWebView respondsToSelector:wk_sel];
+ } else {
+ return YES;
+ }
+}
+
+- (void)updateSettings:(NSDictionary*)settings
+{
+ WKWebView* wkWebView = (WKWebView*)_engineWebView;
+
+ wkWebView.configuration.preferences.minimumFontSize = [settings cordovaFloatSettingForKey:@"MinimumFontSize" defaultValue:0.0];
+
+ /*
+ wkWebView.configuration.preferences.javaScriptEnabled = [settings cordovaBoolSettingForKey:@"JavaScriptEnabled" default:YES];
+ wkWebView.configuration.preferences.javaScriptCanOpenWindowsAutomatically = [settings cordovaBoolSettingForKey:@"JavaScriptCanOpenWindowsAutomatically" default:NO];
+ */
+
+ // By default, DisallowOverscroll is false (thus bounce is allowed)
+ BOOL bounceAllowed = !([settings cordovaBoolSettingForKey:@"DisallowOverscroll" defaultValue:NO]);
+
+ // prevent webView from bouncing
+ if (!bounceAllowed) {
+ if ([wkWebView respondsToSelector:@selector(scrollView)]) {
+ ((UIScrollView*)[wkWebView scrollView]).bounces = NO;
+ } else {
+ for (id subview in wkWebView.subviews) {
+ if ([[subview class] isSubclassOfClass:[UIScrollView class]]) {
+ ((UIScrollView*)subview).bounces = NO;
+ }
+ }
+ }
+ }
+
+ NSString* decelerationSetting = [settings cordovaSettingForKey:@"WKWebViewDecelerationSpeed"];
+
+ if (![@"fast" isEqualToString:decelerationSetting]) {
+ [wkWebView.scrollView setDecelerationRate:UIScrollViewDecelerationRateNormal];
+ } else {
+ [wkWebView.scrollView setDecelerationRate:UIScrollViewDecelerationRateFast];
+ }
+
+ wkWebView.allowsBackForwardNavigationGestures = [settings cordovaBoolSettingForKey:@"AllowBackForwardNavigationGestures" defaultValue:NO];
+ wkWebView.allowsLinkPreview = [settings cordovaBoolSettingForKey:@"Allow3DTouchLinkPreview" defaultValue:YES];
+}
+
+- (void)updateWithInfo:(NSDictionary*)info
+{
+ NSDictionary* scriptMessageHandlers = [info objectForKey:kCDVWebViewEngineScriptMessageHandlers];
+ NSDictionary* settings = [info objectForKey:kCDVWebViewEngineWebViewPreferences];
+ id navigationDelegate = [info objectForKey:kCDVWebViewEngineWKNavigationDelegate];
+ id uiDelegate = [info objectForKey:kCDVWebViewEngineWKUIDelegate];
+
+ WKWebView* wkWebView = (WKWebView*)_engineWebView;
+
+ if (scriptMessageHandlers && [scriptMessageHandlers isKindOfClass:[NSDictionary class]]) {
+ NSArray* allKeys = [scriptMessageHandlers allKeys];
+
+ for (NSString* key in allKeys) {
+ id object = [scriptMessageHandlers objectForKey:key];
+ if ([object conformsToProtocol:@protocol(WKScriptMessageHandler)]) {
+ [wkWebView.configuration.userContentController addScriptMessageHandler:object name:key];
+ }
+ }
+ }
+
+ if (navigationDelegate && [navigationDelegate conformsToProtocol:@protocol(WKNavigationDelegate)]) {
+ wkWebView.navigationDelegate = navigationDelegate;
+ }
+
+ if (uiDelegate && [uiDelegate conformsToProtocol:@protocol(WKUIDelegate)]) {
+ wkWebView.UIDelegate = uiDelegate;
+ }
+
+ if (settings && [settings isKindOfClass:[NSDictionary class]]) {
+ [self updateSettings:settings];
+ }
+}
+
+// This forwards the methods that are in the header that are not implemented here.
+// Both WKWebView implement the below:
+// loadHTMLString:baseURL:
+// loadRequest:
+- (id)forwardingTargetForSelector:(SEL)aSelector
+{
+ return _engineWebView;
+}
+
+- (UIView*)webView
+{
+ return self.engineWebView;
+}
+
+#pragma mark WKScriptMessageHandler implementation
+
+- (void)userContentController:(WKUserContentController*)userContentController didReceiveScriptMessage:(WKScriptMessage*)message
+{
+ if (![message.name isEqualToString:CDV_BRIDGE_NAME]) {
+ return;
+ }
+
+ CDVViewController* vc = (CDVViewController*)self.viewController;
+
+ NSArray* jsonEntry = message.body; // NSString:callbackId, NSString:service, NSString:action, NSArray:args
+ CDVInvokedUrlCommand* command = [CDVInvokedUrlCommand commandFromJson:jsonEntry];
+ CDV_EXEC_LOG(@"Exec(%@): Calling %@.%@", command.callbackId, command.className, command.methodName);
+
+ if (![vc.commandQueue execute:command]) {
+#ifdef DEBUG
+ NSError* error = nil;
+ NSString* commandJson = nil;
+ NSData* jsonData = [NSJSONSerialization dataWithJSONObject:jsonEntry
+ options:0
+ error:&error];
+
+ if (error == nil) {
+ commandJson = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
+ }
+
+ static NSUInteger maxLogLength = 1024;
+ NSString* commandString = ([commandJson length] > maxLogLength) ?
+ [NSString stringWithFormat : @"%@[...]", [commandJson substringToIndex:maxLogLength]] :
+ commandJson;
+
+ NSLog(@"FAILED pluginJSON = %@", commandString);
+#endif
+ }
+}
+
+#pragma mark WKNavigationDelegate implementation
+
+- (void)webView:(WKWebView*)webView didStartProvisionalNavigation:(WKNavigation*)navigation
+{
+ [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginResetNotification object:webView]];
+}
+
+- (void)webView:(WKWebView*)webView didFinishNavigation:(WKNavigation*)navigation
+{
+ [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPageDidLoadNotification object:webView]];
+}
+
+- (void)webView:(WKWebView*)theWebView didFailProvisionalNavigation:(WKNavigation*)navigation withError:(NSError*)error
+{
+ [self webView:theWebView didFailNavigation:navigation withError:error];
+}
+
+- (void)webView:(WKWebView*)theWebView didFailNavigation:(WKNavigation*)navigation withError:(NSError*)error
+{
+ CDVViewController* vc = (CDVViewController*)self.viewController;
+
+ NSString* message = [NSString stringWithFormat:@"Failed to load webpage with error: %@", [error localizedDescription]];
+ NSLog(@"%@", message);
+
+ NSURL* errorUrl = vc.errorURL;
+ if (errorUrl) {
+ NSCharacterSet *charSet = [NSCharacterSet URLFragmentAllowedCharacterSet];
+ errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [message stringByAddingPercentEncodingWithAllowedCharacters:charSet]] relativeToURL:errorUrl];
+ NSLog(@"%@", [errorUrl absoluteString]);
+ [theWebView loadRequest:[NSURLRequest requestWithURL:errorUrl]];
+ }
+}
+
+- (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView
+{
+ [webView reload];
+}
+
+- (BOOL)defaultResourcePolicyForURL:(NSURL*)url
+{
+ // all file:// urls are allowed
+ if ([url isFileURL]) {
+ return YES;
+ }
+
+ return NO;
+}
+
+- (void) webView: (WKWebView *) webView decidePolicyForNavigationAction: (WKNavigationAction*) navigationAction decisionHandler: (void (^)(WKNavigationActionPolicy)) decisionHandler
+{
+ NSURL* url = [navigationAction.request URL];
+ CDVViewController* vc = (CDVViewController*)self.viewController;
+
+ /*
+ * Give plugins the chance to handle the url
+ */
+ BOOL anyPluginsResponded = NO;
+ BOOL shouldAllowRequest = NO;
+
+ for (NSString* pluginName in vc.pluginObjects) {
+ CDVPlugin* plugin = [vc.pluginObjects objectForKey:pluginName];
+ SEL selector = NSSelectorFromString(@"shouldOverrideLoadWithRequest:navigationType:");
+ if ([plugin respondsToSelector:selector]) {
+ anyPluginsResponded = YES;
+ // https://issues.apache.org/jira/browse/CB-12497
+ int navType = (int)navigationAction.navigationType;
+ shouldAllowRequest = (((BOOL (*)(id, SEL, id, int))objc_msgSend)(plugin, selector, navigationAction.request, navType));
+ if (!shouldAllowRequest) {
+ break;
+ }
+ }
+ }
+
+ if (anyPluginsResponded) {
+ return decisionHandler(shouldAllowRequest);
+ }
+
+ /*
+ * Handle all other types of urls (tel:, sms:), and requests to load a url in the main webview.
+ */
+ BOOL shouldAllowNavigation = [self defaultResourcePolicyForURL:url];
+ if (shouldAllowNavigation) {
+ return decisionHandler(YES);
+ } else {
+ [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]];
+ }
+
+ return decisionHandler(NO);
+}
+
+#pragma mark - Plugin interface
+
+- (void)allowsBackForwardNavigationGestures:(CDVInvokedUrlCommand*)command;
+{
+ id value = [command argumentAtIndex:0];
+ if (!([value isKindOfClass:[NSNumber class]])) {
+ value = [NSNumber numberWithBool:NO];
+ }
+
+ WKWebView* wkWebView = (WKWebView*)_engineWebView;
+ wkWebView.allowsBackForwardNavigationGestures = [value boolValue];
+}
+
+@end
+
+#pragma mark - CDVWebViewWeakScriptMessageHandler
+
+@implementation CDVWebViewWeakScriptMessageHandler
+
+- (instancetype)initWithScriptMessageHandler:(id<WKScriptMessageHandler>)scriptMessageHandler
+{
+ self = [super init];
+ if (self) {
+ _scriptMessageHandler = scriptMessageHandler;
+ }
+ return self;
+}
+
+- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message
+{
+ [self.scriptMessageHandler userContentController:userContentController didReceiveScriptMessage:message];
+}
+
+@end
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewEngine.h b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewProcessPoolFactory.h
index 6a9ee77e..b1562891 100644
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewEngine.h
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewProcessPoolFactory.h
@@ -6,9 +6,9 @@
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -17,11 +17,11 @@
under the License.
*/
-#import "CDVPlugin.h"
-#import "CDVWebViewEngineProtocol.h"
-
-@interface CDVUIWebViewEngine : CDVPlugin <CDVWebViewEngineProtocol>
+#import <WebKit/WebKit.h>
-@property (nonatomic, strong, readonly) id <UIWebViewDelegate> uiWebViewDelegate;
+@interface CDVWebViewProcessPoolFactory : NSObject
+@property (nonatomic, retain) WKProcessPool* sharedPool;
++(instancetype) sharedFactory;
+-(WKProcessPool*) sharedProcessPool;
@end
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewProcessPoolFactory.m b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewProcessPoolFactory.m
new file mode 100644
index 00000000..577624e0
--- /dev/null
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewProcessPoolFactory.m
@@ -0,0 +1,49 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <Foundation/Foundation.h>
+#import <WebKit/WebKit.h>
+#import "CDVWebViewProcessPoolFactory.h"
+
+static CDVWebViewProcessPoolFactory *factory = nil;
+
+@implementation CDVWebViewProcessPoolFactory
+
++ (instancetype)sharedFactory
+{
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ factory = [[CDVWebViewProcessPoolFactory alloc] init];
+ });
+
+ return factory;
+}
+
+- (instancetype)init
+{
+ if (self = [super init]) {
+ _sharedPool = [[WKProcessPool alloc] init];
+ }
+ return self;
+}
+
+- (WKProcessPool*) sharedProcessPool {
+ return _sharedPool;
+}
+@end
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.h b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.h
index 9138deba..8ae39b67 100644
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.h
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.h
@@ -17,13 +17,16 @@
under the License.
*/
-#import <UIKit/UIKit.h>
-#import "CDVUIWebViewEngine.h"
+#import <WebKit/WebKit.h>
-@interface CDVUIWebViewNavigationDelegate : NSObject <UIWebViewDelegate>
+@interface CDVWebViewUIDelegate : NSObject <WKUIDelegate>
+{
+ NSMutableArray<UIViewController*>* windows;
+}
-@property (nonatomic, weak) CDVPlugin* enginePlugin;
+@property (nonatomic, copy) NSString* title;
+@property (nonatomic, assign) BOOL allowNewWindows;
-- (instancetype)initWithEnginePlugin:(CDVPlugin*)enginePlugin;
+- (instancetype)initWithTitle:(NSString*)title;
@end
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.m b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.m
new file mode 100644
index 00000000..784af8df
--- /dev/null
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.m
@@ -0,0 +1,163 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import "CDVWebViewUIDelegate.h"
+
+@implementation CDVWebViewUIDelegate
+
+- (instancetype)initWithTitle:(NSString*)title
+{
+ self = [super init];
+ if (self) {
+ self.title = title;
+ windows = [[NSMutableArray alloc] init];
+ }
+
+ return self;
+}
+
+- (void) webView:(WKWebView*)webView runJavaScriptAlertPanelWithMessage:(NSString*)message
+ initiatedByFrame:(WKFrameInfo*)frame completionHandler:(void (^)(void))completionHandler
+{
+ UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title
+ message:message
+ preferredStyle:UIAlertControllerStyleAlert];
+
+ UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
+ style:UIAlertActionStyleDefault
+ handler:^(UIAlertAction* action)
+ {
+ completionHandler();
+ [alert dismissViewControllerAnimated:YES completion:nil];
+ }];
+
+ [alert addAction:ok];
+
+ UIViewController* rootController = [UIApplication sharedApplication].delegate.window.rootViewController;
+
+ [rootController presentViewController:alert animated:YES completion:nil];
+}
+
+- (void) webView:(WKWebView*)webView runJavaScriptConfirmPanelWithMessage:(NSString*)message
+ initiatedByFrame:(WKFrameInfo*)frame completionHandler:(void (^)(BOOL result))completionHandler
+{
+ UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title
+ message:message
+ preferredStyle:UIAlertControllerStyleAlert];
+
+ UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
+ style:UIAlertActionStyleDefault
+ handler:^(UIAlertAction* action)
+ {
+ completionHandler(YES);
+ [alert dismissViewControllerAnimated:YES completion:nil];
+ }];
+
+ [alert addAction:ok];
+
+ UIAlertAction* cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel")
+ style:UIAlertActionStyleDefault
+ handler:^(UIAlertAction* action)
+ {
+ completionHandler(NO);
+ [alert dismissViewControllerAnimated:YES completion:nil];
+ }];
+ [alert addAction:cancel];
+
+ UIViewController* rootController = [UIApplication sharedApplication].delegate.window.rootViewController;
+
+ [rootController presentViewController:alert animated:YES completion:nil];
+}
+
+- (void) webView:(WKWebView*)webView runJavaScriptTextInputPanelWithPrompt:(NSString*)prompt
+ defaultText:(NSString*)defaultText initiatedByFrame:(WKFrameInfo*)frame
+ completionHandler:(void (^)(NSString* result))completionHandler
+{
+ UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title
+ message:prompt
+ preferredStyle:UIAlertControllerStyleAlert];
+
+ UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
+ style:UIAlertActionStyleDefault
+ handler:^(UIAlertAction* action)
+ {
+ completionHandler(((UITextField*)alert.textFields[0]).text);
+ [alert dismissViewControllerAnimated:YES completion:nil];
+ }];
+
+ [alert addAction:ok];
+
+ UIAlertAction* cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel")
+ style:UIAlertActionStyleDefault
+ handler:^(UIAlertAction* action)
+ {
+ completionHandler(nil);
+ [alert dismissViewControllerAnimated:YES completion:nil];
+ }];
+ [alert addAction:cancel];
+
+ [alert addTextFieldWithConfigurationHandler:^(UITextField* textField) {
+ textField.text = defaultText;
+ }];
+
+ UIViewController* rootController = [UIApplication sharedApplication].delegate.window.rootViewController;
+
+ [rootController presentViewController:alert animated:YES completion:nil];
+}
+
+- (WKWebView*) webView:(WKWebView*)webView createWebViewWithConfiguration:(WKWebViewConfiguration*)configuration forNavigationAction:(WKNavigationAction*)navigationAction windowFeatures:(WKWindowFeatures*)windowFeatures
+{
+ if (!navigationAction.targetFrame.isMainFrame) {
+ if (self.allowNewWindows) {
+ WKWebView* v = [[WKWebView alloc] initWithFrame:webView.frame configuration:configuration];
+ v.UIDelegate = webView.UIDelegate;
+ v.navigationDelegate = webView.navigationDelegate;
+
+ UIViewController* vc = [[UIViewController alloc] init];
+ vc.modalPresentationStyle = UIModalPresentationOverCurrentContext;
+ vc.view = v;
+
+ [windows addObject:vc];
+
+ UIViewController* rootController = [UIApplication sharedApplication].delegate.window.rootViewController;
+ [rootController presentViewController:vc animated:YES completion:nil];
+ return v;
+ } else {
+ [webView loadRequest:navigationAction.request];
+ }
+ }
+
+ return nil;
+}
+
+- (void)webViewDidClose:(WKWebView*)webView
+{
+ for (UIViewController* vc in windows) {
+ if (vc.view == webView) {
+ [vc dismissViewControllerAnimated:YES completion:nil];
+ [windows removeObject:vc];
+ break;
+ }
+ }
+
+ // We do not allow closing the primary WebView
+}
+
+
+@end
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDV.h b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDV.h
index 96d6efc8..8706ef4a 100644
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDV.h
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDV.h
@@ -24,9 +24,7 @@
#import "CDVPluginResult.h"
#import "CDVViewController.h"
#import "CDVCommandDelegate.h"
-#import "CDVURLProtocol.h"
#import "CDVInvokedUrlCommand.h"
#import "CDVWhitelist.h"
#import "CDVScreenOrientationDelegate.h"
#import "CDVTimer.h"
-#import "CDVUserAgentUtil.h"
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVAppDelegate.m b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVAppDelegate.m
index 5408903e..9188be79 100644
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVAppDelegate.m
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVAppDelegate.m
@@ -25,18 +25,6 @@
- (id)init
{
- /** If you need to do any extra app-specific initialization, you can do it here
- * -jm
- **/
- NSHTTPCookieStorage* cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
-
- [cookieStorage setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways];
-
- int cacheSizeMemory = 8 * 1024 * 1024; // 8MB
- int cacheSizeDisk = 32 * 1024 * 1024; // 32MB
- NSURLCache* sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:cacheSizeMemory diskCapacity:cacheSizeDisk diskPath:@"nsurlcache"];
- [NSURLCache setSharedURLCache:sharedCache];
-
self = [super init];
return self;
}
@@ -73,7 +61,7 @@
// this happens while we are running ( in the background, or from within our own app )
// only valid if 40x-Info.plist specifies a protocol to handle
-- (BOOL)application:(UIApplication*)application openURL:(NSURL*)url sourceApplication:(NSString*)sourceApplication annotation:(id)annotation
+- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options
{
if (!url) {
return NO;
@@ -83,12 +71,12 @@
[openURLData setValue:url forKey:@"url"];
- if (sourceApplication) {
- [openURLData setValue:sourceApplication forKey:@"sourceApplication"];
+ if (options[UIApplicationOpenURLOptionsSourceApplicationKey]) {
+ [openURLData setValue:options[UIApplicationOpenURLOptionsSourceApplicationKey] forKey:@"sourceApplication"];
}
- if (annotation) {
- [openURLData setValue:annotation forKey:@"annotation"];
+ if (options[UIApplicationOpenURLOptionsAnnotationKey]) {
+ [openURLData setValue:options[UIApplicationOpenURLOptionsAnnotationKey] forKey:@"annotation"];
}
// all plugins will get the notification, and their handlers will be called
@@ -98,11 +86,7 @@
return YES;
}
-#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000
-- (NSUInteger)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window
-#else //CB-12098. Defaults to UIInterfaceOrientationMask for iOS 9+
- (UIInterfaceOrientationMask)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window
-#endif
{
// iPhone doesn't support upside down by default, while the iPad does. Override to allow all orientations always, and let the root view controller decide what's allowed (the supported orientations mask gets intersected).
NSUInteger supportedInterfaceOrientations = (1 << UIInterfaceOrientationPortrait) | (1 << UIInterfaceOrientationLandscapeLeft) | (1 << UIInterfaceOrientationLandscapeRight) | (1 << UIInterfaceOrientationPortraitUpsideDown);
@@ -110,9 +94,4 @@
return supportedInterfaceOrientations;
}
-- (void)applicationDidReceiveMemoryWarning:(UIApplication*)application
-{
- [[NSURLCache sharedURLCache] removeAllCachedResponses];
-}
-
@end
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVAvailability.h b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVAvailability.h
index af63494c..3324ed31 100644
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVAvailability.h
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVAvailability.h
@@ -68,6 +68,16 @@
#define __CORDOVA_4_3_1 40301
#define __CORDOVA_4_4_0 40400
#define __CORDOVA_4_5_0 40500
+#define __CORDOVA_4_5_1 40501
+#define __CORDOVA_4_5_2 40502
+#define __CORDOVA_4_5_4 40504
+#define __CORDOVA_5_0_0 50000
+#define __CORDOVA_5_0_1 50001
+#define __CORDOVA_5_1_0 50100
+#define __CORDOVA_5_1_1 50101
+#define __CORDOVA_6_0_0 60000
+#define __CORDOVA_6_1_0 60100
+#define __CORDOVA_6_1_1 60101
/* coho:next-version,insert-before */
#define __CORDOVA_NA 99999 /* not available */
@@ -80,7 +90,7 @@
*/
#ifndef CORDOVA_VERSION_MIN_REQUIRED
/* coho:next-version-min-required,replace-after */
- #define CORDOVA_VERSION_MIN_REQUIRED __CORDOVA_4_5_0
+ #define CORDOVA_VERSION_MIN_REQUIRED __CORDOVA_6_1_1
#endif
/*
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVCommandDelegate.h b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVCommandDelegate.h
index 3d9d90c9..ac82727a 100644
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVCommandDelegate.h
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVCommandDelegate.h
@@ -44,8 +44,6 @@ typedef NSURL* (^ UrlTransformerBlock)(NSURL*);
// in dead-lock. This method must be called from the UI thread.
- (void)evalJs:(NSString*)js scheduledOnRunLoop:(BOOL)scheduledOnRunLoop;
// Runs the given block on a background thread using a shared thread-pool.
-- (void)runInBackground:(void (^)())block;
-// Returns the User-Agent of the associated UIWebView.
-- (NSString*)userAgent;
+- (void)runInBackground:(void (^)(void))block;
@end
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVCommandDelegateImpl.m b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVCommandDelegateImpl.m
index fd8b3e8d..649d30db 100644
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVCommandDelegateImpl.m
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVCommandDelegateImpl.m
@@ -81,8 +81,8 @@
CDV_EXEC_LOG(@"Exec: Retrieved new exec messages by chaining.");
}
- [_commandQueue enqueueCommandBatch:commandsJSON];
- [_commandQueue executePending];
+ [self->_commandQueue enqueueCommandBatch:commandsJSON];
+ [self->_commandQueue executePending];
}
}];
}
@@ -92,7 +92,7 @@
// Cycle the run-loop before executing the JS.
// For _delayResponses -
// This ensures that we don't eval JS during the middle of an existing JS
- // function (possible since UIWebViewDelegate callbacks can be synchronous).
+ // function (possible since WKWebViewDelegate callbacks can be synchronous).
// For !isMainThread -
// It's a hard error to eval on the non-UI thread.
// For !_commandQueue.currentlyExecuting -
@@ -168,16 +168,11 @@
return [_viewController getCommandInstance:pluginName];
}
-- (void)runInBackground:(void (^)())block
+- (void)runInBackground:(void (^)(void))block
{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block);
}
-- (NSString*)userAgent
-{
- return [_viewController userAgent];
-}
-
- (NSDictionary*)settings
{
return _viewController.settings;
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVPlugin.h b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVPlugin.h
index 9a7d7de4..0bdbbabb 100644
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVPlugin.h
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVPlugin.h
@@ -42,17 +42,6 @@ extern NSString* const CDVViewWillLayoutSubviewsNotification;
extern NSString* const CDVViewDidLayoutSubviewsNotification;
extern NSString* const CDVViewWillTransitionToSizeNotification;
-/*
- * The local and remote push notification functionality has been removed from the core in cordova-ios 4.x,
- * but these constants have unfortunately have not been removed, but will be removed in 5.x.
- *
- * To have the same functionality as 3.x, use a third-party plugin or the experimental
- * https://github.com/apache/cordova-plugins/tree/master/notification-rebroadcast
- */
-extern NSString* const CDVLocalNotification CDV_DEPRECATED(4.0, "Functionality removed in 4.0, constant will be removed in 5.0");
-extern NSString* const CDVRemoteNotification CDV_DEPRECATED(4.0, "Functionality removed in 4.0, constant will be removed in 5.0");
-extern NSString* const CDVRemoteNotificationError CDV_DEPRECATED(4.0, "Functionality removed in 4.0, constant will be removed in 5.0");
-
@interface CDVPlugin : NSObject {}
@property (nonatomic, readonly, weak) UIView* webView;
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVPlugin.m b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVPlugin.m
index 79316561..6af03e9c 100644
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVPlugin.m
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVPlugin.m
@@ -44,9 +44,6 @@ NSString* const CDVPageDidLoadNotification = @"CDVPageDidLoadNotification";
NSString* const CDVPluginHandleOpenURLNotification = @"CDVPluginHandleOpenURLNotification";
NSString* const CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification = @"CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification";
NSString* const CDVPluginResetNotification = @"CDVPluginResetNotification";
-NSString* const CDVLocalNotification = @"CDVLocalNotification";
-NSString* const CDVRemoteNotification = @"CDVRemoteNotification";
-NSString* const CDVRemoteNotificationError = @"CDVRemoteNotificationError";
NSString* const CDVViewWillAppearNotification = @"CDVViewWillAppearNotification";
NSString* const CDVViewDidAppearNotification = @"CDVViewDidAppearNotification";
NSString* const CDVViewWillDisappearNotification = @"CDVViewWillDisappearNotification";
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVPluginResult.h b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVPluginResult.h
index 56b8c232..2f62d77b 100644
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVPluginResult.h
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVPluginResult.h
@@ -20,18 +20,35 @@
#import <Foundation/Foundation.h>
#import "CDVAvailability.h"
-typedef enum {
- CDVCommandStatus_NO_RESULT = 0,
- CDVCommandStatus_OK,
- CDVCommandStatus_CLASS_NOT_FOUND_EXCEPTION,
- CDVCommandStatus_ILLEGAL_ACCESS_EXCEPTION,
- CDVCommandStatus_INSTANTIATION_EXCEPTION,
- CDVCommandStatus_MALFORMED_URL_EXCEPTION,
- CDVCommandStatus_IO_EXCEPTION,
- CDVCommandStatus_INVALID_ACTION,
- CDVCommandStatus_JSON_EXCEPTION,
- CDVCommandStatus_ERROR
-} CDVCommandStatus;
+typedef NS_ENUM(NSUInteger, CDVCommandStatus) {
+ CDVCommandStatus_NO_RESULT NS_SWIFT_NAME(noResult) = 0,
+ CDVCommandStatus_OK NS_SWIFT_NAME(ok),
+ CDVCommandStatus_CLASS_NOT_FOUND_EXCEPTION NS_SWIFT_NAME(classNotFoundException),
+ CDVCommandStatus_ILLEGAL_ACCESS_EXCEPTION NS_SWIFT_NAME(illegalAccessException),
+ CDVCommandStatus_INSTANTIATION_EXCEPTION NS_SWIFT_NAME(instantiationException),
+ CDVCommandStatus_MALFORMED_URL_EXCEPTION NS_SWIFT_NAME(malformedUrlException),
+ CDVCommandStatus_IO_EXCEPTION NS_SWIFT_NAME(ioException),
+ CDVCommandStatus_INVALID_ACTION NS_SWIFT_NAME(invalidAction),
+ CDVCommandStatus_JSON_EXCEPTION NS_SWIFT_NAME(jsonException),
+ CDVCommandStatus_ERROR NS_SWIFT_NAME(error)
+};
+
+// This exists to preserve compatibility with early Swift plugins, who are
+// using CDVCommandStatus as ObjC-style constants rather than as Swift enum
+// values.
+// This declares extern'ed constants (implemented in CDVPluginResult.m)
+#define SWIFT_ENUM_COMPAT_HACK(enumVal) extern const CDVCommandStatus SWIFT_##enumVal NS_SWIFT_NAME(enumVal)
+SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_NO_RESULT);
+SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_OK);
+SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_CLASS_NOT_FOUND_EXCEPTION);
+SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_ILLEGAL_ACCESS_EXCEPTION);
+SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_INSTANTIATION_EXCEPTION);
+SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_MALFORMED_URL_EXCEPTION);
+SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_IO_EXCEPTION);
+SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_INVALID_ACTION);
+SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_JSON_EXCEPTION);
+SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_ERROR);
+#undef SWIFT_ENUM_COMPAT_HACK
@interface CDVPluginResult : NSObject {}
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVPluginResult.m b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVPluginResult.m
index 3521e6d7..930aeaba 100644
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVPluginResult.m
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVPluginResult.m
@@ -21,6 +21,23 @@
#import "CDVJSON_private.h"
#import "CDVDebug.h"
+// This exists to preserve compatibility with early Swift plugins, who are
+// using CDVCommandStatus as ObjC-style constants rather than as Swift enum
+// values.
+// These constants alias the enum values back to their previous names.
+#define SWIFT_ENUM_COMPAT_HACK(enumVal) const CDVCommandStatus SWIFT_##enumVal NS_SWIFT_NAME(enumVal) = enumVal
+SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_NO_RESULT);
+SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_OK);
+SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_CLASS_NOT_FOUND_EXCEPTION);
+SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_ILLEGAL_ACCESS_EXCEPTION);
+SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_INSTANTIATION_EXCEPTION);
+SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_MALFORMED_URL_EXCEPTION);
+SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_IO_EXCEPTION);
+SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_INVALID_ACTION);
+SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_JSON_EXCEPTION);
+SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_ERROR);
+#undef SWIFT_ENUM_COMPAT_HACK
+
@interface CDVPluginResult ()
- (CDVPluginResult*)initWithStatus:(CDVCommandStatus)statusOrdinal message:(id)theMessage;
@@ -86,7 +103,7 @@ id messageFromMultipart(NSArray* theMessages)
{
self = [super init];
if (self) {
- status = [NSNumber numberWithInt:statusOrdinal];
+ status = @(statusOrdinal);
message = theMessage;
keepCallback = [NSNumber numberWithBool:NO];
}
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVScreenOrientationDelegate.h b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVScreenOrientationDelegate.h
index 519dd490..49c3c270 100644
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVScreenOrientationDelegate.h
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVScreenOrientationDelegate.h
@@ -21,13 +21,8 @@
@protocol CDVScreenOrientationDelegate <NSObject>
-#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000
-- (NSUInteger)supportedInterfaceOrientations;
-#else
- (UIInterfaceOrientationMask)supportedInterfaceOrientations;
-#endif
-- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation;
- (BOOL)shouldAutorotate;
@end
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVURLProtocol.m b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVURLProtocol.m
deleted file mode 100644
index 7b2c5ce5..00000000
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVURLProtocol.m
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <AssetsLibrary/ALAsset.h>
-#import <AssetsLibrary/ALAssetRepresentation.h>
-#import <AssetsLibrary/ALAssetsLibrary.h>
-#import <MobileCoreServices/MobileCoreServices.h>
-#import "CDVURLProtocol.h"
-#import "CDVCommandQueue.h"
-#import "CDVViewController.h"
-
-// Contains a set of NSNumbers of addresses of controllers. It doesn't store
-// the actual pointer to avoid retaining.
-static NSMutableSet* gRegisteredControllers = nil;
-
-NSString* const kCDVAssetsLibraryPrefixes = @"assets-library://";
-
-@implementation CDVURLProtocol
-
-
-+ (BOOL)canInitWithRequest:(NSURLRequest*)theRequest
-{
- NSURL* theUrl = [theRequest URL];
-
- if ([[theUrl absoluteString] hasPrefix:kCDVAssetsLibraryPrefixes]) {
- return YES;
- }
-
- return NO;
-}
-
-+ (NSURLRequest*)canonicalRequestForRequest:(NSURLRequest*)request
-{
- // NSLog(@"%@ received %@", self, NSStringFromSelector(_cmd));
- return request;
-}
-
-- (void)startLoading
-{
- // NSLog(@"%@ received %@ - start", self, NSStringFromSelector(_cmd));
- NSURL* url = [[self request] URL];
-
- if ([[url absoluteString] hasPrefix:kCDVAssetsLibraryPrefixes]) {
- ALAssetsLibraryAssetForURLResultBlock resultBlock = ^(ALAsset* asset) {
- if (asset) {
- // We have the asset! Get the data and send it along.
- ALAssetRepresentation* assetRepresentation = [asset defaultRepresentation];
- NSString* MIMEType = (__bridge_transfer NSString*)UTTypeCopyPreferredTagWithClass((__bridge CFStringRef)[assetRepresentation UTI], kUTTagClassMIMEType);
- Byte* buffer = (Byte*)malloc((unsigned long)[assetRepresentation size]);
- NSUInteger bufferSize = [assetRepresentation getBytes:buffer fromOffset:0.0 length:(NSUInteger)[assetRepresentation size] error:nil];
- NSData* data = [NSData dataWithBytesNoCopy:buffer length:bufferSize freeWhenDone:YES];
- [self sendResponseWithResponseCode:200 data:data mimeType:MIMEType];
- } else {
- // Retrieving the asset failed for some reason. Send an error.
- [self sendResponseWithResponseCode:404 data:nil mimeType:nil];
- }
- };
- ALAssetsLibraryAccessFailureBlock failureBlock = ^(NSError* error) {
- // Retrieving the asset failed for some reason. Send an error.
- [self sendResponseWithResponseCode:401 data:nil mimeType:nil];
- };
-
- ALAssetsLibrary* assetsLibrary = [[ALAssetsLibrary alloc] init];
- [assetsLibrary assetForURL:url resultBlock:resultBlock failureBlock:failureBlock];
- return;
- }
-
- NSString* body = [NSString stringWithFormat:@"Access not allowed to URL: %@", url];
- [self sendResponseWithResponseCode:401 data:[body dataUsingEncoding:NSASCIIStringEncoding] mimeType:nil];
-}
-
-- (void)stopLoading
-{
- // do any cleanup here
-}
-
-+ (BOOL)requestIsCacheEquivalent:(NSURLRequest*)requestA toRequest:(NSURLRequest*)requestB
-{
- return NO;
-}
-
-- (void)sendResponseWithResponseCode:(NSInteger)statusCode data:(NSData*)data mimeType:(NSString*)mimeType
-{
- if (mimeType == nil) {
- mimeType = @"text/plain";
- }
-
- NSHTTPURLResponse* response = [[NSHTTPURLResponse alloc] initWithURL:[[self request] URL] statusCode:statusCode HTTPVersion:@"HTTP/1.1" headerFields:@{@"Content-Type" : mimeType}];
-
- [[self client] URLProtocol:self didReceiveResponse:response cacheStoragePolicy:NSURLCacheStorageNotAllowed];
- if (data != nil) {
- [[self client] URLProtocol:self didLoadData:data];
- }
- [[self client] URLProtocolDidFinishLoading:self];
-}
-
-@end
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVUserAgentUtil.h b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVURLSchemeHandler.h
index 4de382f0..1cd84d09 100644
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVUserAgentUtil.h
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVURLSchemeHandler.h
@@ -18,10 +18,15 @@
*/
#import <Foundation/Foundation.h>
+#import <WebKit/WebKit.h>
+#import "CDVViewController.h"
+
+
+@interface CDVURLSchemeHandler : NSObject <WKURLSchemeHandler>
+
+@property (nonatomic, strong) CDVViewController* viewController;
+
+- (instancetype)initWithVC:(CDVViewController *)controller;
+
-@interface CDVUserAgentUtil : NSObject
-+ (NSString*)originalUserAgent;
-+ (void)acquireLock:(void (^)(NSInteger lockToken))block;
-+ (void)releaseLock:(NSInteger*)lockToken;
-+ (void)setUserAgent:(NSString*)value lockToken:(NSInteger)lockToken;
@end
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVURLSchemeHandler.m b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVURLSchemeHandler.m
new file mode 100644
index 00000000..6c88ceb6
--- /dev/null
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVURLSchemeHandler.m
@@ -0,0 +1,108 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+
+#import "CDVURLSchemeHandler.h"
+#import <MobileCoreServices/MobileCoreServices.h>
+
+@implementation CDVURLSchemeHandler
+
+
+- (instancetype)initWithVC:(CDVViewController *)controller
+{
+ self = [super init];
+ if (self) {
+ _viewController = controller;
+ }
+ return self;
+}
+
+- (void)webView:(WKWebView *)webView startURLSchemeTask:(id <WKURLSchemeTask>)urlSchemeTask
+{
+ NSString * startPath = [[NSBundle mainBundle] pathForResource:self.viewController.wwwFolderName ofType: nil];
+ NSURL * url = urlSchemeTask.request.URL;
+ NSString * stringToLoad = url.path;
+ NSString * scheme = url.scheme;
+
+ if ([scheme isEqualToString:self.viewController.appScheme]) {
+ if ([stringToLoad hasPrefix:@"/_app_file_"]) {
+ startPath = [stringToLoad stringByReplacingOccurrencesOfString:@"/_app_file_" withString:@""];
+ } else {
+ if ([stringToLoad isEqualToString:@""] || [url.pathExtension isEqualToString:@""]) {
+ startPath = [startPath stringByAppendingPathComponent:self.viewController.startPage];
+ } else {
+ startPath = [startPath stringByAppendingPathComponent:stringToLoad];
+ }
+ }
+ }
+
+ NSError * fileError = nil;
+ NSData * data = nil;
+ if ([self isMediaExtension:url.pathExtension]) {
+ data = [NSData dataWithContentsOfFile:startPath options:NSDataReadingMappedIfSafe error:&fileError];
+ }
+ if (!data || fileError) {
+ data = [[NSData alloc] initWithContentsOfFile:startPath];
+ }
+ NSInteger statusCode = 200;
+ if (!data) {
+ statusCode = 404;
+ }
+ NSURL * localUrl = [NSURL URLWithString:url.absoluteString];
+ NSString * mimeType = [self getMimeType:url.pathExtension];
+ id response = nil;
+ if (data && [self isMediaExtension:url.pathExtension]) {
+ response = [[NSURLResponse alloc] initWithURL:localUrl MIMEType:mimeType expectedContentLength:data.length textEncodingName:nil];
+ } else {
+ NSDictionary * headers = @{ @"Content-Type" : mimeType, @"Cache-Control": @"no-cache"};
+ response = [[NSHTTPURLResponse alloc] initWithURL:localUrl statusCode:statusCode HTTPVersion:nil headerFields:headers];
+ }
+
+ [urlSchemeTask didReceiveResponse:response];
+ [urlSchemeTask didReceiveData:data];
+ [urlSchemeTask didFinish];
+
+}
+
+- (void)webView:(nonnull WKWebView *)webView stopURLSchemeTask:(nonnull id<WKURLSchemeTask>)urlSchemeTask
+{
+
+}
+
+-(NSString *) getMimeType:(NSString *)fileExtension {
+ if (fileExtension && ![fileExtension isEqualToString:@""]) {
+ NSString *UTI = (__bridge_transfer NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)fileExtension, NULL);
+ NSString *contentType = (__bridge_transfer NSString *)UTTypeCopyPreferredTagWithClass((__bridge CFStringRef)UTI, kUTTagClassMIMEType);
+ return contentType ? contentType : @"application/octet-stream";
+ } else {
+ return @"text/html";
+ }
+}
+
+-(BOOL) isMediaExtension:(NSString *) pathExtension {
+ NSArray * mediaExtensions = @[@"m4v", @"mov", @"mp4",
+ @"aac", @"ac3", @"aiff", @"au", @"flac", @"m4a", @"mp3", @"wav"];
+ if ([mediaExtensions containsObject:pathExtension.lowercaseString]) {
+ return YES;
+ }
+ return NO;
+}
+
+
+@end
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVUserAgentUtil.m b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVUserAgentUtil.m
deleted file mode 100644
index b17107e1..00000000
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVUserAgentUtil.m
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVUserAgentUtil.h"
-
-#import <UIKit/UIKit.h>
-
-// #define VerboseLog NSLog
-#define VerboseLog(...) do {} while (0)
-
-static NSString* const kCdvUserAgentKey = @"Cordova-User-Agent";
-static NSString* const kCdvUserAgentVersionKey = @"Cordova-User-Agent-Version";
-
-static NSString* gOriginalUserAgent = nil;
-static NSInteger gNextLockToken = 0;
-static NSInteger gCurrentLockToken = 0;
-static NSMutableArray* gPendingSetUserAgentBlocks = nil;
-
-@implementation CDVUserAgentUtil
-
-+ (NSString*)originalUserAgent
-{
- if (gOriginalUserAgent == nil) {
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppLocaleDidChange:)
- name:NSCurrentLocaleDidChangeNotification object:nil];
-
- NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
- NSString* systemVersion = [[UIDevice currentDevice] systemVersion];
- NSString* localeStr = [[NSLocale currentLocale] localeIdentifier];
- // Record the model since simulator can change it without re-install (CB-5420).
- NSString* model = [UIDevice currentDevice].model;
- // Record the version of the app so that we can bust the cache when it changes (CB-10078)
- NSString* appVersion = [[NSBundle mainBundle] infoDictionary][@"CFBundleVersion"];
- NSString* systemAndLocale = [NSString stringWithFormat:@"%@ %@ %@ %@", appVersion, model, systemVersion, localeStr];
-
- NSString* cordovaUserAgentVersion = [userDefaults stringForKey:kCdvUserAgentVersionKey];
- gOriginalUserAgent = [userDefaults stringForKey:kCdvUserAgentKey];
- BOOL cachedValueIsOld = ![systemAndLocale isEqualToString:cordovaUserAgentVersion];
-
- if ((gOriginalUserAgent == nil) || cachedValueIsOld) {
- UIWebView* sampleWebView = [[UIWebView alloc] initWithFrame:CGRectZero];
- gOriginalUserAgent = [sampleWebView stringByEvaluatingJavaScriptFromString:@"navigator.userAgent"];
-
- [userDefaults setObject:gOriginalUserAgent forKey:kCdvUserAgentKey];
- [userDefaults setObject:systemAndLocale forKey:kCdvUserAgentVersionKey];
-
- [userDefaults synchronize];
- }
- }
- return gOriginalUserAgent;
-}
-
-+ (void)onAppLocaleDidChange:(NSNotification*)notification
-{
- // TODO: We should figure out how to update the user-agent of existing UIWebViews when this happens.
- // Maybe use the PDF bug (noted in setUserAgent:).
- gOriginalUserAgent = nil;
-}
-
-+ (void)acquireLock:(void (^)(NSInteger lockToken))block
-{
- if (gCurrentLockToken == 0) {
- gCurrentLockToken = ++gNextLockToken;
- VerboseLog(@"Gave lock %d", gCurrentLockToken);
- block(gCurrentLockToken);
- } else {
- if (gPendingSetUserAgentBlocks == nil) {
- gPendingSetUserAgentBlocks = [[NSMutableArray alloc] initWithCapacity:4];
- }
- VerboseLog(@"Waiting for lock");
- [gPendingSetUserAgentBlocks addObject:block];
- }
-}
-
-+ (void)releaseLock:(NSInteger*)lockToken
-{
- if (lockToken == nil || *lockToken == 0) {
- return;
- }
- NSAssert(gCurrentLockToken == *lockToken, @"Got token %ld, expected %ld", (long)*lockToken, (long)gCurrentLockToken);
-
- VerboseLog(@"Released lock %d", *lockToken);
- if ([gPendingSetUserAgentBlocks count] > 0) {
- void (^block)() = [gPendingSetUserAgentBlocks objectAtIndex:0];
- [gPendingSetUserAgentBlocks removeObjectAtIndex:0];
- gCurrentLockToken = ++gNextLockToken;
- NSLog(@"Gave lock %ld", (long)gCurrentLockToken);
- block(gCurrentLockToken);
- } else {
- gCurrentLockToken = 0;
- }
- *lockToken = 0;
-}
-
-+ (void)setUserAgent:(NSString*)value lockToken:(NSInteger)lockToken
-{
- NSAssert(gCurrentLockToken == lockToken, @"Got token %ld, expected %ld", (long)lockToken, (long)gCurrentLockToken);
- VerboseLog(@"User-Agent set to: %@", value);
-
- // Setting the UserAgent must occur before a UIWebView is instantiated.
- // It is read per instantiation, so it does not affect previously created views.
- // Except! When a PDF is loaded, all currently active UIWebViews reload their
- // User-Agent from the NSUserDefaults some time after the DidFinishLoad of the PDF bah!
- NSDictionary* dict = [[NSDictionary alloc] initWithObjectsAndKeys:value, @"UserAgent", nil];
- [[NSUserDefaults standardUserDefaults] registerDefaults:dict];
-}
-
-@end
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVViewController.h b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVViewController.h
index 605dbbbf..4b5e423a 100644
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVViewController.h
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVViewController.h
@@ -34,7 +34,6 @@
id <CDVCommandDelegate> _commandDelegate;
@protected
CDVCommandQueue* _commandQueue;
- NSString* _userAgent;
}
@property (nonatomic, readonly, weak) IBOutlet UIView* webView;
@@ -44,6 +43,7 @@
@property (nonatomic, readonly, strong) NSMutableDictionary* settings;
@property (nonatomic, readonly, strong) NSXMLParser* configParser;
+@property (nonatomic, readwrite, copy) NSString* appScheme;
@property (nonatomic, readwrite, copy) NSString* configFile;
@property (nonatomic, readwrite, copy) NSString* wwwFolderName;
@property (nonatomic, readwrite, copy) NSString* startPage;
@@ -52,34 +52,17 @@
@property (nonatomic, readonly, strong) id <CDVCommandDelegate> commandDelegate;
/**
- The complete user agent that Cordova will use when sending web requests.
- */
-@property (nonatomic, readonly) NSString* userAgent;
-
-/**
- The base user agent data that Cordova will use to build its user agent. If this
- property isn't set, Cordova will use the standard web view user agent as its
- base.
- */
-@property (nonatomic, readwrite, copy) NSString* baseUserAgent;
-
-/**
Takes/Gives an array of UIInterfaceOrientation (int) objects
ex. UIInterfaceOrientationPortrait
*/
@property (nonatomic, readwrite, strong) NSArray* supportedOrientations;
-/**
- The address of the lock token used for controlling access to setting the user-agent
- */
-@property (nonatomic, readonly) NSInteger* userAgentLockToken;
-
- (UIView*)newCordovaViewWithFrame:(CGRect)bounds;
- (NSString*)appURLScheme;
- (NSURL*)errorURL;
-- (UIColor*)colorFromColorString:(NSString*)colorString;
+- (UIColor*)colorFromColorString:(NSString*)colorString CDV_DEPRECATED(7.0.0, "Use BackgroundColor in xcassets");
- (NSArray*)parseInterfaceOrientations:(NSArray*)orientations;
- (BOOL)supportsOrientation:(UIInterfaceOrientation)orientation;
@@ -89,4 +72,6 @@
- (void)parseSettingsWithParser:(NSObject <NSXMLParserDelegate>*)delegate;
+- (void)showLaunchScreen:(BOOL)visible;
+
@end
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVViewController.m b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVViewController.m
index d0c05865..0d7eb8b7 100644
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVViewController.m
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVViewController.m
@@ -20,18 +20,14 @@
#import <objc/message.h>
#import "CDV.h"
#import "CDVPlugin+Private.h"
-#import "CDVUIWebViewDelegate.h"
+#import "CDVWebViewUIDelegate.h"
#import "CDVConfigParser.h"
-#import "CDVUserAgentUtil.h"
#import <AVFoundation/AVFoundation.h>
#import "NSDictionary+CordovaPreferences.h"
-#import "CDVLocalStorage.h"
#import "CDVCommandDelegateImpl.h"
#import <Foundation/NSCharacterSet.h>
-@interface CDVViewController () {
- NSInteger _userAgentLockToken;
-}
+@interface CDVViewController () { }
@property (nonatomic, readwrite, strong) NSXMLParser* configParser;
@property (nonatomic, readwrite, strong) NSMutableDictionary* settings;
@@ -39,6 +35,7 @@
@property (nonatomic, readwrite, strong) NSMutableArray* startupPluginNames;
@property (nonatomic, readwrite, strong) NSDictionary* pluginsMap;
@property (nonatomic, readwrite, strong) id <CDVWebViewEngineProtocol> webViewEngine;
+@property (nonatomic, readwrite, strong) UIView* launchView;
@property (readwrite, assign) BOOL initialized;
@@ -51,7 +48,7 @@
@synthesize supportedOrientations;
@synthesize pluginObjects, pluginsMap, startupPluginNames;
@synthesize configParser, settings;
-@synthesize wwwFolderName, startPage, initialized, openURL, baseUserAgent;
+@synthesize wwwFolderName, startPage, initialized, openURL;
@synthesize commandDelegate = _commandDelegate;
@synthesize commandQueue = _commandQueue;
@synthesize webViewEngine = _webViewEngine;
@@ -74,6 +71,9 @@
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppDidEnterBackground:)
name:UIApplicationDidEnterBackgroundNotification object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onWebViewPageDidLoad:)
+ name:CDVPageDidLoadNotification object:nil];
+
// read from UISupportedInterfaceOrientations (or UISupportedInterfaceOrientations~iPad, if its iPad) from -Info.plist
self.supportedOrientations = [self parseInterfaceOrientations:
[[[NSBundle mainBundle] infoDictionary] objectForKey:@"UISupportedInterfaceOrientations"]];
@@ -285,7 +285,11 @@
}
[self.settings setCordovaSetting:backupWebStorageType forKey:@"BackupWebStorage"];
- [CDVLocalStorage __fixupDatabaseLocationsWithBackupType:backupWebStorageType];
+ // // Instantiate the Launch screen /////////
+
+ if (!self.launchView) {
+ [self createLaunchView];
+ }
// // Instantiate the WebView ///////////////
@@ -295,17 +299,6 @@
// /////////////////
- /*
- * Fire up CDVLocalStorage to work-around WebKit storage limitations: on all iOS 5.1+ versions for local-only backups, but only needed on iOS 5.1 for cloud backup.
- With minimum iOS 7/8 supported, only first clause applies.
- */
- if ([backupWebStorageType isEqualToString:@"local"]) {
- NSString* localStorageFeatureName = @"localstorage";
- if ([self.pluginsMap objectForKey:localStorageFeatureName]) { // plugin specified in config
- [self.startupPluginNames addObject:localStorageFeatureName];
- }
- }
-
if ([self.startupPluginNames count] > 0) {
[CDVTimer start:@"TotalPluginStartup"];
@@ -320,41 +313,29 @@
// /////////////////
NSURL* appURL = [self appUrl];
- __weak __typeof__(self) weakSelf = self;
- [CDVUserAgentUtil acquireLock:^(NSInteger lockToken) {
- // Fix the memory leak caused by the strong reference.
- [weakSelf setLockToken:lockToken];
- if (appURL) {
- NSURLRequest* appReq = [NSURLRequest requestWithURL:appURL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:20.0];
- [self.webViewEngine loadRequest:appReq];
- } else {
- NSString* loadErr = [NSString stringWithFormat:@"ERROR: Start Page at '%@/%@' was not found.", self.wwwFolderName, self.startPage];
- NSLog(@"%@", loadErr);
+ if (appURL) {
+ NSURLRequest* appReq = [NSURLRequest requestWithURL:appURL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:20.0];
+ [self.webViewEngine loadRequest:appReq];
+ } else {
+ NSString* loadErr = [NSString stringWithFormat:@"ERROR: Start Page at '%@/%@' was not found.", self.wwwFolderName, self.startPage];
+ NSLog(@"%@", loadErr);
- NSURL* errorUrl = [self errorURL];
- if (errorUrl) {
- errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [loadErr stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLPathAllowedCharacterSet]] relativeToURL:errorUrl];
- NSLog(@"%@", [errorUrl absoluteString]);
- [self.webViewEngine loadRequest:[NSURLRequest requestWithURL:errorUrl]];
- } else {
- NSString* html = [NSString stringWithFormat:@"<html><body> %@ </body></html>", loadErr];
- [self.webViewEngine loadHTMLString:html baseURL:nil];
- }
+ NSURL* errorUrl = [self errorURL];
+ if (errorUrl) {
+ errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [loadErr stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLPathAllowedCharacterSet]] relativeToURL:errorUrl];
+ NSLog(@"%@", [errorUrl absoluteString]);
+ [self.webViewEngine loadRequest:[NSURLRequest requestWithURL:errorUrl]];
+ } else {
+ NSString* html = [NSString stringWithFormat:@"<html><body> %@ </body></html>", loadErr];
+ [self.webViewEngine loadHTMLString:html baseURL:nil];
}
- }];
-
+ }
// /////////////////
-
- NSString* bgColorString = [self.settings cordovaSettingForKey:@"BackgroundColor"];
- UIColor* bgColor = [self colorFromColorString:bgColorString];
- [self.webView setBackgroundColor:bgColor];
-}
-- (void)setLockToken:(NSInteger)lockToken
-{
- _userAgentLockToken = lockToken;
- [CDVUserAgentUtil setUserAgent:self.userAgent lockToken:lockToken];
+ UIColor* bgColor = [UIColor colorNamed:@"BackgroundColor"] ?: UIColor.whiteColor;
+ [self.launchView setBackgroundColor:bgColor];
+ [self.webView setBackgroundColor:bgColor];
}
-(void)viewWillAppear:(BOOL)animated
@@ -405,16 +386,16 @@
if (!colorString) {
return nil;
}
-
+
// Validate format
NSError* error = NULL;
NSRegularExpression* regex = [NSRegularExpression regularExpressionWithPattern:@"^(#[0-9A-F]{3}|(0x|#)([0-9A-F]{2})?[0-9A-F]{6})$" options:NSRegularExpressionCaseInsensitive error:&error];
NSUInteger countMatches = [regex numberOfMatchesInString:colorString options:0 range:NSMakeRange(0, [colorString length])];
-
+
if (!countMatches) {
return nil;
}
-
+
// #FAB to #FFAABB
if ([colorString hasPrefix:@"#"] && [colorString length] == 4) {
NSString* r = [colorString substringWithRange:NSMakeRange(1, 1)];
@@ -422,22 +403,22 @@
NSString* b = [colorString substringWithRange:NSMakeRange(3, 1)];
colorString = [NSString stringWithFormat:@"#%@%@%@%@%@%@", r, r, g, g, b, b];
}
-
+
// #RRGGBB to 0xRRGGBB
colorString = [colorString stringByReplacingOccurrencesOfString:@"#" withString:@"0x"];
-
+
// 0xRRGGBB to 0xAARRGGBB
if ([colorString hasPrefix:@"0x"] && [colorString length] == 8) {
colorString = [@"0xFF" stringByAppendingString:[colorString substringFromIndex:2]];
}
-
+
// 0xAARRGGBB to int
unsigned colorValue = 0;
NSScanner *scanner = [NSScanner scannerWithString:colorString];
if (![scanner scanHexInt:&colorValue]) {
return nil;
}
-
+
// int to UIColor
return [UIColor colorWithRed:((float)((colorValue & 0x00FF0000) >> 16))/255.0
green:((float)((colorValue & 0x0000FF00) >> 8))/255.0
@@ -479,12 +460,7 @@
return YES;
}
-// CB-12098
-#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000
-- (NSUInteger)supportedInterfaceOrientations
-#else
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
-#endif
{
NSUInteger ret = 0;
@@ -506,7 +482,7 @@
- (BOOL)supportsOrientation:(UIInterfaceOrientation)orientation
{
- return [self.supportedOrientations containsObject:[NSNumber numberWithInt:orientation]];
+ return [self.supportedOrientations containsObject:@(orientation)];
}
- (UIView*)newCordovaViewWithFrame:(CGRect)bounds
@@ -515,7 +491,7 @@
NSString* webViewEngineClass = [self.settings cordovaSettingForKey:@"CordovaWebViewEngine"];
if (!defaultWebViewEngineClass) {
- defaultWebViewEngineClass = @"CDVUIWebViewEngine";
+ defaultWebViewEngineClass = @"CDVWebViewEngine";
}
if (!webViewEngineClass) {
webViewEngineClass = defaultWebViewEngineClass;
@@ -524,7 +500,7 @@
// Find webViewEngine
if (NSClassFromString(webViewEngineClass)) {
self.webViewEngine = [[NSClassFromString(webViewEngineClass) alloc] initWithFrame:bounds];
- // if a webView engine returns nil (not supported by the current iOS version) or doesn't conform to the protocol, or can't load the request, we use UIWebView
+ // if a webView engine returns nil (not supported by the current iOS version) or doesn't conform to the protocol, or can't load the request, we use WKWebView
if (!self.webViewEngine || ![self.webViewEngine conformsToProtocol:@protocol(CDVWebViewEngineProtocol)] || ![self.webViewEngine canLoadRequest:[NSURLRequest requestWithURL:self.appUrl]]) {
self.webViewEngine = [[NSClassFromString(defaultWebViewEngineClass) alloc] initWithFrame:bounds];
}
@@ -539,39 +515,34 @@
return self.webViewEngine.engineWebView;
}
-- (NSString*)userAgent
+- (void)createLaunchView
{
- if (_userAgent != nil) {
- return _userAgent;
- }
+ CGRect webViewBounds = self.view.bounds;
+ webViewBounds.origin = self.view.bounds.origin;
- NSString* localBaseUserAgent;
- if (self.baseUserAgent != nil) {
- localBaseUserAgent = self.baseUserAgent;
- } else if ([self.settings cordovaSettingForKey:@"OverrideUserAgent"] != nil) {
- localBaseUserAgent = [self.settings cordovaSettingForKey:@"OverrideUserAgent"];
- } else {
- localBaseUserAgent = [CDVUserAgentUtil originalUserAgent];
- }
- NSString* appendUserAgent = [self.settings cordovaSettingForKey:@"AppendUserAgent"];
- if (appendUserAgent) {
- _userAgent = [NSString stringWithFormat:@"%@ %@", localBaseUserAgent, appendUserAgent];
- } else {
- // Use our address as a unique number to append to the User-Agent.
- _userAgent = localBaseUserAgent;
+ UIView* view = [[UIView alloc] initWithFrame:webViewBounds];
+
+ NSString* launchStoryboardName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UILaunchStoryboardName"];
+ if (launchStoryboardName != nil) {
+ UIStoryboard* storyboard = [UIStoryboard storyboardWithName:launchStoryboardName bundle:[NSBundle mainBundle]];
+ UIViewController* vc = [storyboard instantiateInitialViewController];
+
+ [view addSubview:vc.view];
}
- return _userAgent;
+
+ self.launchView = view;
+ [self.view addSubview:view];
}
- (void)createGapView
{
CGRect webViewBounds = self.view.bounds;
-
webViewBounds.origin = self.view.bounds.origin;
UIView* view = [self newCordovaViewWithFrame:webViewBounds];
-
+ view.hidden = YES;
view.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
+
[self.view addSubview:view];
[self.view sendSubviewToBack:view];
}
@@ -601,16 +572,6 @@
// Release any cached data, images, etc. that aren't in use.
}
-- (void)viewDidUnload
-{
- // Release any retained subviews of the main view.
- // e.g. self.myOutlet = nil;
-
- [CDVUserAgentUtil releaseLock:&_userAgentLockToken];
-
- [super viewDidUnload];
-}
-
#pragma mark CordovaCommands
- (void)registerPlugin:(CDVPlugin*)plugin withClassName:(NSString*)className
@@ -662,6 +623,12 @@
id obj = [self.pluginObjects objectForKey:className];
if (!obj) {
obj = [[NSClassFromString(className)alloc] initWithWebViewEngine:_webViewEngine];
+ if (!obj) {
+ NSString* fullClassName = [NSString stringWithFormat:@"%@.%@",
+ NSBundle.mainBundle.infoDictionary[@"CFBundleExecutable"],
+ className];
+ obj = [[NSClassFromString(fullClassName)alloc] initWithWebViewEngine:_webViewEngine];
+ }
if (obj != nil) {
[self registerPlugin:obj withClassName:className];
@@ -720,12 +687,33 @@
}
}
+- (bool)isUrlEmpty:(NSURL *)url
+{
+ if (!url || (url == (id) [NSNull null])) {
+ return true;
+ }
+ NSString *urlAsString = [url absoluteString];
+ return (urlAsString == (id) [NSNull null] || [urlAsString length]==0 || [urlAsString isEqualToString:@"about:blank"]);
+}
+
+- (bool)checkAndReinitViewUrl
+{
+ NSURL* appURL = [self appUrl];
+ if ([self isUrlEmpty: [self.webViewEngine URL]] && ![self isUrlEmpty: appURL]) {
+ NSURLRequest* appReq = [NSURLRequest requestWithURL:appURL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:20.0];
+ [self.webViewEngine loadRequest:appReq];
+ return true;
+ }
+ return false;
+}
+
/*
This method is called to let your application know that it is about to move from the active to inactive state.
You should use this method to pause ongoing tasks, disable timer, ...
*/
- (void)onAppWillResignActive:(NSNotification*)notification
{
+ [self checkAndReinitViewUrl];
// NSLog(@"%@",@"applicationWillResignActive");
[self.commandDelegate evalJs:@"cordova.fireDocumentEvent('resign');" scheduledOnRunLoop:NO];
}
@@ -737,20 +725,24 @@
*/
- (void)onAppWillEnterForeground:(NSNotification*)notification
{
+ [self checkAndReinitViewUrl];
// NSLog(@"%@",@"applicationWillEnterForeground");
[self.commandDelegate evalJs:@"cordova.fireDocumentEvent('resume');"];
- /** Clipboard fix **/
- UIPasteboard* pasteboard = [UIPasteboard generalPasteboard];
- NSString* string = pasteboard.string;
- if (string) {
- [pasteboard setValue:string forPasteboardType:@"public.text"];
+ if (!IsAtLeastiOSVersion(@"11.0")) {
+ /** Clipboard fix **/
+ UIPasteboard* pasteboard = [UIPasteboard generalPasteboard];
+ NSString* string = pasteboard.string;
+ if (string) {
+ [pasteboard setValue:string forPasteboardType:@"public.text"];
+ }
}
}
// This method is called to let your application know that it moved from the inactive to active state.
- (void)onAppDidBecomeActive:(NSNotification*)notification
{
+ [self checkAndReinitViewUrl];
// NSLog(@"%@",@"applicationDidBecomeActive");
[self.commandDelegate evalJs:@"cordova.fireDocumentEvent('active');"];
}
@@ -761,24 +753,61 @@
*/
- (void)onAppDidEnterBackground:(NSNotification*)notification
{
+ [self checkAndReinitViewUrl];
// NSLog(@"%@",@"applicationDidEnterBackground");
[self.commandDelegate evalJs:@"cordova.fireDocumentEvent('pause', null, true);" scheduledOnRunLoop:NO];
}
+/**
+ Show the webview and fade out the intermediary view
+ This is to prevent the flashing of the mainViewController
+ */
+- (void)onWebViewPageDidLoad:(NSNotification*)notification
+{
+ self.webView.hidden = NO;
+
+ if ([self.settings cordovaBoolSettingForKey:@"AutoHideSplashScreen" defaultValue:YES]) {
+ [self showLaunchScreen:NO];
+ }
+}
+
+/**
+ Method to be called from the plugin JavaScript to show or hide the launch screen.
+ */
+- (void)showLaunchScreen:(BOOL)visible
+{
+ CGFloat splashScreenDelay = [self.settings cordovaFloatSettingForKey:@"SplashScreenDelay" defaultValue:0];
+
+ // AnimateWithDuration takes seconds but cordova documentation specifies milliseconds
+ CGFloat fadeSplashScreenDuration = [self.settings cordovaFloatSettingForKey:@"FadeSplashScreenDuration" defaultValue:250];
+
+ // Setting minimum value for fade to 0.25 seconds
+ fadeSplashScreenDuration = fadeSplashScreenDuration < 250 ? 250 : fadeSplashScreenDuration;
+
+ // Divide by 1000 because config returns milliseconds and NSTimer takes seconds
+ CGFloat delayToFade = (MAX(splashScreenDelay, fadeSplashScreenDuration) - fadeSplashScreenDuration)/1000;
+ CGFloat fadeDuration = fadeSplashScreenDuration/1000;
+
+ [NSTimer scheduledTimerWithTimeInterval:delayToFade repeats:NO block:^(NSTimer * _Nonnull timer) {
+ [UIView animateWithDuration:fadeDuration animations:^{
+ [self.launchView setAlpha:(visible ? 1 : 0)];
+ }];
+ }];
+}
+
// ///////////////////////
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
- [CDVUserAgentUtil releaseLock:&_userAgentLockToken];
[_commandQueue dispose];
[[self.pluginObjects allValues] makeObjectsPerformSelector:@selector(dispose)];
-}
-- (NSInteger*)userAgentLockToken
-{
- return &_userAgentLockToken;
+ [self.webViewEngine loadHTMLString:@"about:blank" baseURL:nil];
+ [self.pluginObjects removeAllObjects];
+ [self.webView removeFromSuperview];
+ self.webViewEngine = nil;
}
@end
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVWebViewEngineProtocol.h b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVWebViewEngineProtocol.h
index 34d07f3d..e6126a4b 100644
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVWebViewEngineProtocol.h
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVWebViewEngineProtocol.h
@@ -20,7 +20,6 @@
#import <UIKit/UIKit.h>
#define kCDVWebViewEngineScriptMessageHandlers @"kCDVWebViewEngineScriptMessageHandlers"
-#define kCDVWebViewEngineUIWebViewDelegate @"kCDVWebViewEngineUIWebViewDelegate"
#define kCDVWebViewEngineWKNavigationDelegate @"kCDVWebViewEngineWKNavigationDelegate"
#define kCDVWebViewEngineWKUIDelegate @"kCDVWebViewEngineWKUIDelegate"
#define kCDVWebViewEngineWebViewPreferences @"kCDVWebViewEngineWebViewPreferences"
diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/NSDictionary+CordovaPreferences.m b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/NSDictionary+CordovaPreferences.m
index dcac40f1..1266ba20 100644
--- a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/NSDictionary+CordovaPreferences.m
+++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/NSDictionary+CordovaPreferences.m
@@ -32,8 +32,37 @@
BOOL value = defaultValue;
id prefObj = [self cordovaSettingForKey:key];
- if (prefObj != nil) {
- value = [(NSNumber*)prefObj boolValue];
+ if (prefObj == nil) {
+ NSLog(@"The preference key \"%@\" is not defined and will default to \"%@\"",
+ key,
+ (defaultValue ? @"TRUE" : @"FALSE"));
+
+ return value;
+ }
+
+ if ([prefObj isKindOfClass:NSString.class]) {
+ prefObj = [prefObj lowercaseString];
+
+ if (
+ // True Case
+ [prefObj isEqualToString:@"true"] ||
+ [prefObj isEqualToString:@"1"] ||
+ // False Case
+ [prefObj isEqualToString:@"false"] ||
+ [prefObj isEqualToString:@"0"]
+ )
+ {
+ value = [prefObj isEqualToString:@"true"] || [prefObj isEqualToString:@"1"];
+ }
+ } else if (
+ [prefObj isKindOfClass:NSNumber.class] &&
+ (
+ [prefObj isEqual: @YES] ||
+ [prefObj isEqual: @NO]
+ )
+ )
+ {
+ value = [prefObj isEqual: @YES];
}
return value;
diff --git a/StoneIsland/platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj b/StoneIsland/platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
index 4a83bc2c..2ae1b42c 100644
--- a/StoneIsland/platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
+++ b/StoneIsland/platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
@@ -3,28 +3,33 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 46;
+ objectVersion = 52;
objects = {
/* Begin PBXBuildFile section */
28BFF9141F355A4E00DDF01A /* CDVLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 28BFF9121F355A4E00DDF01A /* CDVLogger.h */; };
28BFF9151F355A4E00DDF01A /* CDVLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 28BFF9131F355A4E00DDF01A /* CDVLogger.m */; };
- 30193A501AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 30193A4E1AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.m */; };
- 30193A511AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 30193A4F1AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.h */; };
+ 2F4D42BC23F218BA00501999 /* CDVURLSchemeHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 2F4D42BA23F218BA00501999 /* CDVURLSchemeHandler.h */; };
+ 2F4D42BD23F218BA00501999 /* CDVURLSchemeHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F4D42BB23F218BA00501999 /* CDVURLSchemeHandler.m */; };
+ 2FCCEA17247E7366007276A8 /* CDVLaunchScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E714D3423F535B500A321AF /* CDVLaunchScreen.m */; };
+ 2FCCEA18247E7366007276A8 /* CDVLaunchScreen.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E714D3223F535B500A321AF /* CDVLaunchScreen.h */; };
3093E2231B16D6A3003F381A /* CDVIntentAndNavigationFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3093E2211B16D6A3003F381A /* CDVIntentAndNavigationFilter.h */; };
3093E2241B16D6A3003F381A /* CDVIntentAndNavigationFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 3093E2221B16D6A3003F381A /* CDVIntentAndNavigationFilter.m */; };
- 7E7F69B61ABA35D8007546F4 /* CDVLocalStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CFB1AB9028C008C4574 /* CDVLocalStorage.h */; };
- 7E7F69B81ABA368F007546F4 /* CDVUIWebViewEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D001AB9028C008C4574 /* CDVUIWebViewEngine.h */; };
+ 4E23F8FB23E16E96006CD852 /* CDVWebViewProcessPoolFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E23F8F523E16E96006CD852 /* CDVWebViewProcessPoolFactory.m */; };
+ 4E23F8FC23E16E96006CD852 /* CDVWebViewUIDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E23F8F623E16E96006CD852 /* CDVWebViewUIDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 4E23F8FD23E16E96006CD852 /* CDVWebViewUIDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E23F8F723E16E96006CD852 /* CDVWebViewUIDelegate.m */; };
+ 4E23F8FE23E16E96006CD852 /* CDVWebViewEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E23F8F823E16E96006CD852 /* CDVWebViewEngine.m */; };
+ 4E23F8FF23E16E96006CD852 /* CDVWebViewProcessPoolFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E23F8F923E16E96006CD852 /* CDVWebViewProcessPoolFactory.h */; };
+ 4E23F90023E16E96006CD852 /* CDVWebViewEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E23F8FA23E16E96006CD852 /* CDVWebViewEngine.h */; };
+ 4E23F90323E17FFA006CD852 /* CDVWebViewUIDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E23F8F623E16E96006CD852 /* CDVWebViewUIDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 4E714D3623F535B500A321AF /* CDVLaunchScreen.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E714D3223F535B500A321AF /* CDVLaunchScreen.h */; };
+ 4E714D3823F535B500A321AF /* CDVLaunchScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E714D3423F535B500A321AF /* CDVLaunchScreen.m */; };
7E7F69B91ABA3692007546F4 /* CDVHandleOpenURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF81AB9028C008C4574 /* CDVHandleOpenURL.h */; };
7ED95D021AB9028C008C4574 /* CDVDebug.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF21AB9028C008C4574 /* CDVDebug.h */; };
7ED95D031AB9028C008C4574 /* CDVJSON_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF31AB9028C008C4574 /* CDVJSON_private.h */; };
7ED95D041AB9028C008C4574 /* CDVJSON_private.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CF41AB9028C008C4574 /* CDVJSON_private.m */; };
7ED95D051AB9028C008C4574 /* CDVPlugin+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF51AB9028C008C4574 /* CDVPlugin+Private.h */; };
7ED95D071AB9028C008C4574 /* CDVHandleOpenURL.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CF91AB9028C008C4574 /* CDVHandleOpenURL.m */; };
- 7ED95D091AB9028C008C4574 /* CDVLocalStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CFC1AB9028C008C4574 /* CDVLocalStorage.m */; };
- 7ED95D0A1AB9028C008C4574 /* CDVUIWebViewDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CFE1AB9028C008C4574 /* CDVUIWebViewDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 7ED95D0B1AB9028C008C4574 /* CDVUIWebViewDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CFF1AB9028C008C4574 /* CDVUIWebViewDelegate.m */; };
- 7ED95D0D1AB9028C008C4574 /* CDVUIWebViewEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D011AB9028C008C4574 /* CDVUIWebViewEngine.m */; };
7ED95D351AB9029B008C4574 /* CDV.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D0F1AB9029B008C4574 /* CDV.h */; settings = {ATTRIBUTES = (Public, ); }; };
7ED95D361AB9029B008C4574 /* CDVAppDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D101AB9029B008C4574 /* CDVAppDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
7ED95D371AB9029B008C4574 /* CDVAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D111AB9029B008C4574 /* CDVAppDelegate.m */; };
@@ -48,10 +53,6 @@
7ED95D491AB9029B008C4574 /* CDVScreenOrientationDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D231AB9029B008C4574 /* CDVScreenOrientationDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
7ED95D4A1AB9029B008C4574 /* CDVTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D241AB9029B008C4574 /* CDVTimer.h */; settings = {ATTRIBUTES = (Public, ); }; };
7ED95D4B1AB9029B008C4574 /* CDVTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D251AB9029B008C4574 /* CDVTimer.m */; };
- 7ED95D4C1AB9029B008C4574 /* CDVURLProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D261AB9029B008C4574 /* CDVURLProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 7ED95D4D1AB9029B008C4574 /* CDVURLProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D271AB9029B008C4574 /* CDVURLProtocol.m */; };
- 7ED95D4E1AB9029B008C4574 /* CDVUserAgentUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D281AB9029B008C4574 /* CDVUserAgentUtil.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 7ED95D4F1AB9029B008C4574 /* CDVUserAgentUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D291AB9029B008C4574 /* CDVUserAgentUtil.m */; };
7ED95D501AB9029B008C4574 /* CDVViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2A1AB9029B008C4574 /* CDVViewController.h */; settings = {ATTRIBUTES = (Public, ); }; };
7ED95D511AB9029B008C4574 /* CDVViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D2B1AB9029B008C4574 /* CDVViewController.m */; };
7ED95D521AB9029B008C4574 /* CDVWebViewEngineProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2C1AB9029B008C4574 /* CDVWebViewEngineProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -61,10 +62,34 @@
7ED95D581AB9029B008C4574 /* NSDictionary+CordovaPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D321AB9029B008C4574 /* NSDictionary+CordovaPreferences.m */; };
7ED95D591AB9029B008C4574 /* NSMutableArray+QueueAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D331AB9029B008C4574 /* NSMutableArray+QueueAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
7ED95D5A1AB9029B008C4574 /* NSMutableArray+QueueAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D341AB9029B008C4574 /* NSMutableArray+QueueAdditions.m */; };
+ 9052DE712150D040008E83D4 /* CDVAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D111AB9029B008C4574 /* CDVAppDelegate.m */; };
+ 9052DE722150D040008E83D4 /* CDVCommandDelegateImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D161AB9029B008C4574 /* CDVCommandDelegateImpl.m */; };
+ 9052DE732150D040008E83D4 /* CDVCommandQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D181AB9029B008C4574 /* CDVCommandQueue.m */; };
+ 9052DE742150D040008E83D4 /* CDVConfigParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D1A1AB9029B008C4574 /* CDVConfigParser.m */; };
+ 9052DE752150D040008E83D4 /* CDVInvokedUrlCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D1C1AB9029B008C4574 /* CDVInvokedUrlCommand.m */; };
+ 9052DE762150D040008E83D4 /* CDVPlugin+Resources.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D1E1AB9029B008C4574 /* CDVPlugin+Resources.m */; };
+ 9052DE772150D040008E83D4 /* CDVPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D201AB9029B008C4574 /* CDVPlugin.m */; };
+ 9052DE782150D040008E83D4 /* CDVPluginResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D221AB9029B008C4574 /* CDVPluginResult.m */; };
+ 9052DE792150D040008E83D4 /* CDVTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D251AB9029B008C4574 /* CDVTimer.m */; };
+ 9052DE7C2150D040008E83D4 /* CDVViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D2B1AB9029B008C4574 /* CDVViewController.m */; };
+ 9052DE7D2150D040008E83D4 /* CDVWhitelist.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D2E1AB9029B008C4574 /* CDVWhitelist.m */; };
+ 9052DE7E2150D040008E83D4 /* NSDictionary+CordovaPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D321AB9029B008C4574 /* NSDictionary+CordovaPreferences.m */; };
+ 9052DE7F2150D040008E83D4 /* NSMutableArray+QueueAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D341AB9029B008C4574 /* NSMutableArray+QueueAdditions.m */; };
+ 9052DE802150D040008E83D4 /* CDVJSON_private.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CF41AB9028C008C4574 /* CDVJSON_private.m */; };
+ 9052DE812150D040008E83D4 /* CDVLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 28BFF9131F355A4E00DDF01A /* CDVLogger.m */; };
+ 9052DE822150D040008E83D4 /* CDVGestureHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = A3B082D31BB15CEA00D8DC35 /* CDVGestureHandler.m */; };
+ 9052DE832150D040008E83D4 /* CDVIntentAndNavigationFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 3093E2221B16D6A3003F381A /* CDVIntentAndNavigationFilter.m */; };
+ 9052DE842150D040008E83D4 /* CDVHandleOpenURL.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CF91AB9028C008C4574 /* CDVHandleOpenURL.m */; };
+ 9052DE892150D06B008E83D4 /* CDVDebug.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF21AB9028C008C4574 /* CDVDebug.h */; };
+ 9052DE8A2150D06B008E83D4 /* CDVJSON_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF31AB9028C008C4574 /* CDVJSON_private.h */; };
+ 9052DE8B2150D06B008E83D4 /* CDVPlugin+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF51AB9028C008C4574 /* CDVPlugin+Private.h */; };
+ 9052DE8C2150D06B008E83D4 /* CDVLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 28BFF9121F355A4E00DDF01A /* CDVLogger.h */; };
+ 9052DE8D2150D06B008E83D4 /* CDVGestureHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = A3B082D21BB15CEA00D8DC35 /* CDVGestureHandler.h */; };
+ 9052DE8E2150D06B008E83D4 /* CDVIntentAndNavigationFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3093E2211B16D6A3003F381A /* CDVIntentAndNavigationFilter.h */; };
+ 9052DE8F2150D06B008E83D4 /* CDVHandleOpenURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF81AB9028C008C4574 /* CDVHandleOpenURL.h */; };
A3B082D41BB15CEA00D8DC35 /* CDVGestureHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = A3B082D21BB15CEA00D8DC35 /* CDVGestureHandler.h */; };
A3B082D51BB15CEA00D8DC35 /* CDVGestureHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = A3B082D31BB15CEA00D8DC35 /* CDVGestureHandler.m */; };
C0C01EB61E3911D50056E6CB /* Cordova.h in Headers */ = {isa = PBXBuildFile; fileRef = C0C01EB41E3911D50056E6CB /* Cordova.h */; settings = {ATTRIBUTES = (Public, ); }; };
- C0C01EBA1E39120F0056E6CB /* libCordova.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 68A32D7114102E1C006B237C /* libCordova.a */; };
C0C01EBB1E39131A0056E6CB /* CDV.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D0F1AB9029B008C4574 /* CDV.h */; settings = {ATTRIBUTES = (Public, ); }; };
C0C01EBC1E39131A0056E6CB /* CDVAppDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D101AB9029B008C4574 /* CDVAppDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
C0C01EBD1E39131A0056E6CB /* CDVAvailability.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D121AB9029B008C4574 /* CDVAvailability.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -79,34 +104,28 @@
C0C01EC61E39131A0056E6CB /* CDVPluginResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D211AB9029B008C4574 /* CDVPluginResult.h */; settings = {ATTRIBUTES = (Public, ); }; };
C0C01EC71E39131A0056E6CB /* CDVScreenOrientationDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D231AB9029B008C4574 /* CDVScreenOrientationDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
C0C01EC81E39131A0056E6CB /* CDVTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D241AB9029B008C4574 /* CDVTimer.h */; settings = {ATTRIBUTES = (Public, ); }; };
- C0C01EC91E39131A0056E6CB /* CDVURLProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D261AB9029B008C4574 /* CDVURLProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
- C0C01ECA1E39131A0056E6CB /* CDVUserAgentUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D281AB9029B008C4574 /* CDVUserAgentUtil.h */; settings = {ATTRIBUTES = (Public, ); }; };
C0C01ECB1E39131A0056E6CB /* CDVViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2A1AB9029B008C4574 /* CDVViewController.h */; settings = {ATTRIBUTES = (Public, ); }; };
C0C01ECC1E39131A0056E6CB /* CDVWebViewEngineProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2C1AB9029B008C4574 /* CDVWebViewEngineProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
C0C01ECD1E39131A0056E6CB /* CDVWhitelist.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2D1AB9029B008C4574 /* CDVWhitelist.h */; settings = {ATTRIBUTES = (Public, ); }; };
C0C01ECE1E39131A0056E6CB /* NSDictionary+CordovaPreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D311AB9029B008C4574 /* NSDictionary+CordovaPreferences.h */; settings = {ATTRIBUTES = (Public, ); }; };
C0C01ECF1E39131A0056E6CB /* NSMutableArray+QueueAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D331AB9029B008C4574 /* NSMutableArray+QueueAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
- C0C01ED01E3913610056E6CB /* CDVUIWebViewDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CFE1AB9028C008C4574 /* CDVUIWebViewDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
/* End PBXBuildFile section */
-/* Begin PBXContainerItemProxy section */
- C0C01ED11E39137C0056E6CB /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = D2AAC07D0554694100DB518D;
- remoteInfo = CordovaLib;
- };
-/* End PBXContainerItemProxy section */
-
/* Begin PBXFileReference section */
28BFF9121F355A4E00DDF01A /* CDVLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVLogger.h; sourceTree = "<group>"; };
28BFF9131F355A4E00DDF01A /* CDVLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVLogger.m; sourceTree = "<group>"; };
- 30193A4E1AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVUIWebViewNavigationDelegate.m; sourceTree = "<group>"; };
- 30193A4F1AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVUIWebViewNavigationDelegate.h; sourceTree = "<group>"; };
- 30325A0B136B343700982B63 /* VERSION */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VERSION; sourceTree = "<group>"; };
+ 2F4D42BA23F218BA00501999 /* CDVURLSchemeHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDVURLSchemeHandler.h; sourceTree = "<group>"; };
+ 2F4D42BB23F218BA00501999 /* CDVURLSchemeHandler.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CDVURLSchemeHandler.m; sourceTree = "<group>"; };
3093E2211B16D6A3003F381A /* CDVIntentAndNavigationFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVIntentAndNavigationFilter.h; sourceTree = "<group>"; };
3093E2221B16D6A3003F381A /* CDVIntentAndNavigationFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVIntentAndNavigationFilter.m; sourceTree = "<group>"; };
+ 4E23F8F523E16E96006CD852 /* CDVWebViewProcessPoolFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVWebViewProcessPoolFactory.m; sourceTree = "<group>"; };
+ 4E23F8F623E16E96006CD852 /* CDVWebViewUIDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVWebViewUIDelegate.h; sourceTree = "<group>"; };
+ 4E23F8F723E16E96006CD852 /* CDVWebViewUIDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVWebViewUIDelegate.m; sourceTree = "<group>"; };
+ 4E23F8F823E16E96006CD852 /* CDVWebViewEngine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVWebViewEngine.m; sourceTree = "<group>"; };
+ 4E23F8F923E16E96006CD852 /* CDVWebViewProcessPoolFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVWebViewProcessPoolFactory.h; sourceTree = "<group>"; };
+ 4E23F8FA23E16E96006CD852 /* CDVWebViewEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVWebViewEngine.h; sourceTree = "<group>"; };
+ 4E714D3223F535B500A321AF /* CDVLaunchScreen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVLaunchScreen.h; sourceTree = "<group>"; };
+ 4E714D3423F535B500A321AF /* CDVLaunchScreen.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVLaunchScreen.m; sourceTree = "<group>"; };
68A32D7114102E1C006B237C /* libCordova.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCordova.a; sourceTree = BUILT_PRODUCTS_DIR; };
7ED95CF21AB9028C008C4574 /* CDVDebug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVDebug.h; sourceTree = "<group>"; };
7ED95CF31AB9028C008C4574 /* CDVJSON_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVJSON_private.h; sourceTree = "<group>"; };
@@ -114,12 +133,6 @@
7ED95CF51AB9028C008C4574 /* CDVPlugin+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CDVPlugin+Private.h"; sourceTree = "<group>"; };
7ED95CF81AB9028C008C4574 /* CDVHandleOpenURL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVHandleOpenURL.h; sourceTree = "<group>"; };
7ED95CF91AB9028C008C4574 /* CDVHandleOpenURL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVHandleOpenURL.m; sourceTree = "<group>"; };
- 7ED95CFB1AB9028C008C4574 /* CDVLocalStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVLocalStorage.h; sourceTree = "<group>"; };
- 7ED95CFC1AB9028C008C4574 /* CDVLocalStorage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVLocalStorage.m; sourceTree = "<group>"; };
- 7ED95CFE1AB9028C008C4574 /* CDVUIWebViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVUIWebViewDelegate.h; sourceTree = "<group>"; };
- 7ED95CFF1AB9028C008C4574 /* CDVUIWebViewDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVUIWebViewDelegate.m; sourceTree = "<group>"; };
- 7ED95D001AB9028C008C4574 /* CDVUIWebViewEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVUIWebViewEngine.h; sourceTree = "<group>"; };
- 7ED95D011AB9028C008C4574 /* CDVUIWebViewEngine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVUIWebViewEngine.m; sourceTree = "<group>"; };
7ED95D0F1AB9029B008C4574 /* CDV.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDV.h; sourceTree = "<group>"; };
7ED95D101AB9029B008C4574 /* CDVAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVAppDelegate.h; sourceTree = "<group>"; };
7ED95D111AB9029B008C4574 /* CDVAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVAppDelegate.m; sourceTree = "<group>"; };
@@ -143,10 +156,6 @@
7ED95D231AB9029B008C4574 /* CDVScreenOrientationDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVScreenOrientationDelegate.h; sourceTree = "<group>"; };
7ED95D241AB9029B008C4574 /* CDVTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVTimer.h; sourceTree = "<group>"; };
7ED95D251AB9029B008C4574 /* CDVTimer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVTimer.m; sourceTree = "<group>"; };
- 7ED95D261AB9029B008C4574 /* CDVURLProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVURLProtocol.h; sourceTree = "<group>"; };
- 7ED95D271AB9029B008C4574 /* CDVURLProtocol.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVURLProtocol.m; sourceTree = "<group>"; };
- 7ED95D281AB9029B008C4574 /* CDVUserAgentUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVUserAgentUtil.h; sourceTree = "<group>"; };
- 7ED95D291AB9029B008C4574 /* CDVUserAgentUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVUserAgentUtil.m; sourceTree = "<group>"; };
7ED95D2A1AB9029B008C4574 /* CDVViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVViewController.h; sourceTree = "<group>"; };
7ED95D2B1AB9029B008C4574 /* CDVViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVViewController.m; sourceTree = "<group>"; };
7ED95D2C1AB9029B008C4574 /* CDVWebViewEngineProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVWebViewEngineProtocol.h; sourceTree = "<group>"; };
@@ -169,7 +178,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- C0C01EBA1E39120F0056E6CB /* libCordova.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -190,18 +198,16 @@
C0C01EB21E3911D50056E6CB /* Cordova.framework */,
);
name = Products;
- sourceTree = CORDOVALIB;
+ sourceTree = "<group>";
};
- 0867D691FE84028FC02AAC07 /* CordovaLib */ = {
+ 0867D691FE84028FC02AAC07 = {
isa = PBXGroup;
children = (
7ED95D0E1AB9029B008C4574 /* Public */,
7ED95CF11AB9028C008C4574 /* Private */,
C0C01EB31E3911D50056E6CB /* Cordova */,
034768DFFF38A50411DB9C8B /* Products */,
- 30325A0B136B343700982B63 /* VERSION */,
);
- name = CordovaLib;
sourceTree = "<group>";
};
28BFF9111F355A1D00DDF01A /* CDVLogger */ = {
@@ -222,6 +228,28 @@
path = CDVIntentAndNavigationFilter;
sourceTree = "<group>";
};
+ 4E23F8F423E16D30006CD852 /* CDVWebViewEngine */ = {
+ isa = PBXGroup;
+ children = (
+ 4E23F8FA23E16E96006CD852 /* CDVWebViewEngine.h */,
+ 4E23F8F823E16E96006CD852 /* CDVWebViewEngine.m */,
+ 4E23F8F923E16E96006CD852 /* CDVWebViewProcessPoolFactory.h */,
+ 4E23F8F523E16E96006CD852 /* CDVWebViewProcessPoolFactory.m */,
+ 4E23F8F623E16E96006CD852 /* CDVWebViewUIDelegate.h */,
+ 4E23F8F723E16E96006CD852 /* CDVWebViewUIDelegate.m */,
+ );
+ path = CDVWebViewEngine;
+ sourceTree = "<group>";
+ };
+ 4E714D3123F5356700A321AF /* CDVLaunchScreen */ = {
+ isa = PBXGroup;
+ children = (
+ 4E714D3223F535B500A321AF /* CDVLaunchScreen.h */,
+ 4E714D3423F535B500A321AF /* CDVLaunchScreen.m */,
+ );
+ path = CDVLaunchScreen;
+ sourceTree = "<group>";
+ };
7ED95CF11AB9028C008C4574 /* Private */ = {
isa = PBXGroup;
children = (
@@ -239,12 +267,12 @@
7ED95CF61AB9028C008C4574 /* Plugins */ = {
isa = PBXGroup;
children = (
+ 4E714D3123F5356700A321AF /* CDVLaunchScreen */,
+ 4E23F8F423E16D30006CD852 /* CDVWebViewEngine */,
28BFF9111F355A1D00DDF01A /* CDVLogger */,
A3B082D11BB15CEA00D8DC35 /* CDVGestureHandler */,
3093E2201B16D6A3003F381A /* CDVIntentAndNavigationFilter */,
7ED95CF71AB9028C008C4574 /* CDVHandleOpenURL */,
- 7ED95CFA1AB9028C008C4574 /* CDVLocalStorage */,
- 7ED95CFD1AB9028C008C4574 /* CDVUIWebViewEngine */,
);
path = Plugins;
sourceTree = "<group>";
@@ -258,28 +286,6 @@
path = CDVHandleOpenURL;
sourceTree = "<group>";
};
- 7ED95CFA1AB9028C008C4574 /* CDVLocalStorage */ = {
- isa = PBXGroup;
- children = (
- 7ED95CFB1AB9028C008C4574 /* CDVLocalStorage.h */,
- 7ED95CFC1AB9028C008C4574 /* CDVLocalStorage.m */,
- );
- path = CDVLocalStorage;
- sourceTree = "<group>";
- };
- 7ED95CFD1AB9028C008C4574 /* CDVUIWebViewEngine */ = {
- isa = PBXGroup;
- children = (
- 30193A4E1AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.m */,
- 30193A4F1AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.h */,
- 7ED95CFE1AB9028C008C4574 /* CDVUIWebViewDelegate.h */,
- 7ED95CFF1AB9028C008C4574 /* CDVUIWebViewDelegate.m */,
- 7ED95D001AB9028C008C4574 /* CDVUIWebViewEngine.h */,
- 7ED95D011AB9028C008C4574 /* CDVUIWebViewEngine.m */,
- );
- path = CDVUIWebViewEngine;
- sourceTree = "<group>";
- };
7ED95D0E1AB9029B008C4574 /* Public */ = {
isa = PBXGroup;
children = (
@@ -306,10 +312,6 @@
7ED95D231AB9029B008C4574 /* CDVScreenOrientationDelegate.h */,
7ED95D241AB9029B008C4574 /* CDVTimer.h */,
7ED95D251AB9029B008C4574 /* CDVTimer.m */,
- 7ED95D261AB9029B008C4574 /* CDVURLProtocol.h */,
- 7ED95D271AB9029B008C4574 /* CDVURLProtocol.m */,
- 7ED95D281AB9029B008C4574 /* CDVUserAgentUtil.h */,
- 7ED95D291AB9029B008C4574 /* CDVUserAgentUtil.m */,
7ED95D2A1AB9029B008C4574 /* CDVViewController.h */,
7ED95D2B1AB9029B008C4574 /* CDVViewController.m */,
7ED95D2C1AB9029B008C4574 /* CDVWebViewEngineProtocol.h */,
@@ -319,6 +321,8 @@
7ED95D321AB9029B008C4574 /* NSDictionary+CordovaPreferences.m */,
7ED95D331AB9029B008C4574 /* NSMutableArray+QueueAdditions.h */,
7ED95D341AB9029B008C4574 /* NSMutableArray+QueueAdditions.m */,
+ 2F4D42BA23F218BA00501999 /* CDVURLSchemeHandler.h */,
+ 2F4D42BB23F218BA00501999 /* CDVURLSchemeHandler.m */,
);
name = Public;
path = Classes/Public;
@@ -349,29 +353,35 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
- C0C01EC11E39131A0056E6CB /* CDVCommandQueue.h in Headers */,
- C0C01EC51E39131A0056E6CB /* CDVPlugin.h in Headers */,
- C0C01ECF1E39131A0056E6CB /* NSMutableArray+QueueAdditions.h in Headers */,
- C0C01EC21E39131A0056E6CB /* CDVConfigParser.h in Headers */,
- C0C01EC81E39131A0056E6CB /* CDVTimer.h in Headers */,
- C0C01EBB1E39131A0056E6CB /* CDV.h in Headers */,
- C0C01ECE1E39131A0056E6CB /* NSDictionary+CordovaPreferences.h in Headers */,
C0C01EB61E3911D50056E6CB /* Cordova.h in Headers */,
- C0C01EC41E39131A0056E6CB /* CDVPlugin+Resources.h in Headers */,
- C0C01EBE1E39131A0056E6CB /* CDVAvailabilityDeprecated.h in Headers */,
- C0C01EC91E39131A0056E6CB /* CDVURLProtocol.h in Headers */,
- C0C01EBF1E39131A0056E6CB /* CDVCommandDelegate.h in Headers */,
- C0C01ECD1E39131A0056E6CB /* CDVWhitelist.h in Headers */,
- C0C01ED01E3913610056E6CB /* CDVUIWebViewDelegate.h in Headers */,
- C0C01ECA1E39131A0056E6CB /* CDVUserAgentUtil.h in Headers */,
+ C0C01EBB1E39131A0056E6CB /* CDV.h in Headers */,
C0C01EBC1E39131A0056E6CB /* CDVAppDelegate.h in Headers */,
C0C01EBD1E39131A0056E6CB /* CDVAvailability.h in Headers */,
- C0C01ECB1E39131A0056E6CB /* CDVViewController.h in Headers */,
- C0C01ECC1E39131A0056E6CB /* CDVWebViewEngineProtocol.h in Headers */,
+ C0C01EBE1E39131A0056E6CB /* CDVAvailabilityDeprecated.h in Headers */,
+ C0C01EBF1E39131A0056E6CB /* CDVCommandDelegate.h in Headers */,
C0C01EC01E39131A0056E6CB /* CDVCommandDelegateImpl.h in Headers */,
+ C0C01EC11E39131A0056E6CB /* CDVCommandQueue.h in Headers */,
+ C0C01EC21E39131A0056E6CB /* CDVConfigParser.h in Headers */,
C0C01EC31E39131A0056E6CB /* CDVInvokedUrlCommand.h in Headers */,
- C0C01EC71E39131A0056E6CB /* CDVScreenOrientationDelegate.h in Headers */,
+ C0C01EC41E39131A0056E6CB /* CDVPlugin+Resources.h in Headers */,
+ C0C01EC51E39131A0056E6CB /* CDVPlugin.h in Headers */,
C0C01EC61E39131A0056E6CB /* CDVPluginResult.h in Headers */,
+ C0C01EC71E39131A0056E6CB /* CDVScreenOrientationDelegate.h in Headers */,
+ C0C01EC81E39131A0056E6CB /* CDVTimer.h in Headers */,
+ C0C01ECB1E39131A0056E6CB /* CDVViewController.h in Headers */,
+ C0C01ECC1E39131A0056E6CB /* CDVWebViewEngineProtocol.h in Headers */,
+ C0C01ECD1E39131A0056E6CB /* CDVWhitelist.h in Headers */,
+ C0C01ECE1E39131A0056E6CB /* NSDictionary+CordovaPreferences.h in Headers */,
+ 4E23F90323E17FFA006CD852 /* CDVWebViewUIDelegate.h in Headers */,
+ C0C01ECF1E39131A0056E6CB /* NSMutableArray+QueueAdditions.h in Headers */,
+ 9052DE892150D06B008E83D4 /* CDVDebug.h in Headers */,
+ 9052DE8A2150D06B008E83D4 /* CDVJSON_private.h in Headers */,
+ 9052DE8B2150D06B008E83D4 /* CDVPlugin+Private.h in Headers */,
+ 9052DE8C2150D06B008E83D4 /* CDVLogger.h in Headers */,
+ 9052DE8D2150D06B008E83D4 /* CDVGestureHandler.h in Headers */,
+ 9052DE8E2150D06B008E83D4 /* CDVIntentAndNavigationFilter.h in Headers */,
+ 9052DE8F2150D06B008E83D4 /* CDVHandleOpenURL.h in Headers */,
+ 2FCCEA18247E7366007276A8 /* CDVLaunchScreen.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -379,38 +389,37 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
- 7ED95D521AB9029B008C4574 /* CDVWebViewEngineProtocol.h in Headers */,
- 7ED95D491AB9029B008C4574 /* CDVScreenOrientationDelegate.h in Headers */,
7ED95D351AB9029B008C4574 /* CDV.h in Headers */,
- A3B082D41BB15CEA00D8DC35 /* CDVGestureHandler.h in Headers */,
- 7ED95D3B1AB9029B008C4574 /* CDVCommandDelegateImpl.h in Headers */,
- 7ED95D3D1AB9029B008C4574 /* CDVCommandQueue.h in Headers */,
- 7ED95D531AB9029B008C4574 /* CDVWhitelist.h in Headers */,
7ED95D361AB9029B008C4574 /* CDVAppDelegate.h in Headers */,
- 7ED95D431AB9029B008C4574 /* CDVPlugin+Resources.h in Headers */,
7ED95D381AB9029B008C4574 /* CDVAvailability.h in Headers */,
- 7ED95D0A1AB9028C008C4574 /* CDVUIWebViewDelegate.h in Headers */,
- 7ED95D471AB9029B008C4574 /* CDVPluginResult.h in Headers */,
- 7ED95D591AB9029B008C4574 /* NSMutableArray+QueueAdditions.h in Headers */,
+ 7ED95D391AB9029B008C4574 /* CDVAvailabilityDeprecated.h in Headers */,
+ 7ED95D3A1AB9029B008C4574 /* CDVCommandDelegate.h in Headers */,
+ 7ED95D3B1AB9029B008C4574 /* CDVCommandDelegateImpl.h in Headers */,
+ 7ED95D3D1AB9029B008C4574 /* CDVCommandQueue.h in Headers */,
+ 4E23F8FF23E16E96006CD852 /* CDVWebViewProcessPoolFactory.h in Headers */,
+ 7ED95D3F1AB9029B008C4574 /* CDVConfigParser.h in Headers */,
+ 2F4D42BC23F218BA00501999 /* CDVURLSchemeHandler.h in Headers */,
7ED95D411AB9029B008C4574 /* CDVInvokedUrlCommand.h in Headers */,
- 7ED95D571AB9029B008C4574 /* NSDictionary+CordovaPreferences.h in Headers */,
+ 7ED95D431AB9029B008C4574 /* CDVPlugin+Resources.h in Headers */,
7ED95D451AB9029B008C4574 /* CDVPlugin.h in Headers */,
- 7ED95D4C1AB9029B008C4574 /* CDVURLProtocol.h in Headers */,
- 7ED95D3A1AB9029B008C4574 /* CDVCommandDelegate.h in Headers */,
- 7ED95D391AB9029B008C4574 /* CDVAvailabilityDeprecated.h in Headers */,
- 7ED95D4E1AB9029B008C4574 /* CDVUserAgentUtil.h in Headers */,
+ 7ED95D471AB9029B008C4574 /* CDVPluginResult.h in Headers */,
+ 7ED95D491AB9029B008C4574 /* CDVScreenOrientationDelegate.h in Headers */,
+ 4E23F8FC23E16E96006CD852 /* CDVWebViewUIDelegate.h in Headers */,
7ED95D4A1AB9029B008C4574 /* CDVTimer.h in Headers */,
- 7ED95D3F1AB9029B008C4574 /* CDVConfigParser.h in Headers */,
7ED95D501AB9029B008C4574 /* CDVViewController.h in Headers */,
- 7ED95D031AB9028C008C4574 /* CDVJSON_private.h in Headers */,
+ 7ED95D521AB9029B008C4574 /* CDVWebViewEngineProtocol.h in Headers */,
+ 4E23F90023E16E96006CD852 /* CDVWebViewEngine.h in Headers */,
+ 7ED95D531AB9029B008C4574 /* CDVWhitelist.h in Headers */,
+ 7ED95D571AB9029B008C4574 /* NSDictionary+CordovaPreferences.h in Headers */,
+ 7ED95D591AB9029B008C4574 /* NSMutableArray+QueueAdditions.h in Headers */,
7ED95D021AB9028C008C4574 /* CDVDebug.h in Headers */,
+ 7ED95D031AB9028C008C4574 /* CDVJSON_private.h in Headers */,
7ED95D051AB9028C008C4574 /* CDVPlugin+Private.h in Headers */,
- 7E7F69B61ABA35D8007546F4 /* CDVLocalStorage.h in Headers */,
+ 28BFF9141F355A4E00DDF01A /* CDVLogger.h in Headers */,
+ A3B082D41BB15CEA00D8DC35 /* CDVGestureHandler.h in Headers */,
3093E2231B16D6A3003F381A /* CDVIntentAndNavigationFilter.h in Headers */,
- 7E7F69B81ABA368F007546F4 /* CDVUIWebViewEngine.h in Headers */,
7E7F69B91ABA3692007546F4 /* CDVHandleOpenURL.h in Headers */,
- 28BFF9141F355A4E00DDF01A /* CDVLogger.h in Headers */,
- 30193A511AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.h in Headers */,
+ 4E714D3623F535B500A321AF /* CDVLaunchScreen.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -424,12 +433,11 @@
C0C01EAD1E3911D50056E6CB /* Sources */,
C0C01EAE1E3911D50056E6CB /* Frameworks */,
C0C01EAF1E3911D50056E6CB /* Headers */,
- C0C01EB01E3911D50056E6CB /* Resources */,
+ CEDDBB5523948D4C00506451 /* ShellScript */,
);
buildRules = (
);
dependencies = (
- C0C01ED21E39137C0056E6CB /* PBXTargetDependency */,
);
name = Cordova;
productName = Cordova;
@@ -459,26 +467,27 @@
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 1000;
+ LastUpgradeCheck = 1010;
TargetAttributes = {
C0C01EB11E3911D50056E6CB = {
- CreatedOnToolsVersion = 8.2;
+ CreatedOnToolsVersion = 10.1;
+ ProvisioningStyle = Automatic;
+ };
+ D2AAC07D0554694100DB518D = {
+ CreatedOnToolsVersion = 10.1;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "CordovaLib" */;
- compatibilityVersion = "Xcode 3.2";
- developmentRegion = English;
- hasScannedForEncodings = 1;
+ compatibilityVersion = "Xcode 11.0";
+ developmentRegion = en;
+ hasScannedForEncodings = 0;
knownRegions = (
- English,
- Japanese,
- French,
- German,
en,
+ Base,
);
- mainGroup = 0867D691FE84028FC02AAC07 /* CordovaLib */;
+ mainGroup = 0867D691FE84028FC02AAC07;
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
projectDirPath = "";
projectRoot = "";
@@ -489,21 +498,50 @@
};
/* End PBXProject section */
-/* Begin PBXResourcesBuildPhase section */
- C0C01EB01E3911D50056E6CB /* Resources */ = {
- isa = PBXResourcesBuildPhase;
+/* Begin PBXShellScriptBuildPhase section */
+ CEDDBB5523948D4C00506451 /* ShellScript */ = {
+ isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ );
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ );
runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "\"${PROJECT_DIR}/../update_podspec.sh\" -s cordova\n";
};
-/* End PBXResourcesBuildPhase section */
+/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
C0C01EAD1E3911D50056E6CB /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ 9052DE712150D040008E83D4 /* CDVAppDelegate.m in Sources */,
+ 9052DE722150D040008E83D4 /* CDVCommandDelegateImpl.m in Sources */,
+ 9052DE732150D040008E83D4 /* CDVCommandQueue.m in Sources */,
+ 9052DE742150D040008E83D4 /* CDVConfigParser.m in Sources */,
+ 9052DE752150D040008E83D4 /* CDVInvokedUrlCommand.m in Sources */,
+ 9052DE762150D040008E83D4 /* CDVPlugin+Resources.m in Sources */,
+ 9052DE772150D040008E83D4 /* CDVPlugin.m in Sources */,
+ 9052DE782150D040008E83D4 /* CDVPluginResult.m in Sources */,
+ 9052DE792150D040008E83D4 /* CDVTimer.m in Sources */,
+ 9052DE7C2150D040008E83D4 /* CDVViewController.m in Sources */,
+ 9052DE7D2150D040008E83D4 /* CDVWhitelist.m in Sources */,
+ 9052DE7E2150D040008E83D4 /* NSDictionary+CordovaPreferences.m in Sources */,
+ 9052DE7F2150D040008E83D4 /* NSMutableArray+QueueAdditions.m in Sources */,
+ 9052DE802150D040008E83D4 /* CDVJSON_private.m in Sources */,
+ 9052DE812150D040008E83D4 /* CDVLogger.m in Sources */,
+ 9052DE822150D040008E83D4 /* CDVGestureHandler.m in Sources */,
+ 9052DE832150D040008E83D4 /* CDVIntentAndNavigationFilter.m in Sources */,
+ 9052DE842150D040008E83D4 /* CDVHandleOpenURL.m in Sources */,
+ 2FCCEA17247E7366007276A8 /* CDVLaunchScreen.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -511,98 +549,69 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- 7ED95D511AB9029B008C4574 /* CDVViewController.m in Sources */,
- 7ED95D581AB9029B008C4574 /* NSDictionary+CordovaPreferences.m in Sources */,
7ED95D371AB9029B008C4574 /* CDVAppDelegate.m in Sources */,
- 7ED95D0B1AB9028C008C4574 /* CDVUIWebViewDelegate.m in Sources */,
7ED95D3C1AB9029B008C4574 /* CDVCommandDelegateImpl.m in Sources */,
- 7ED95D041AB9028C008C4574 /* CDVJSON_private.m in Sources */,
- 7ED95D541AB9029B008C4574 /* CDVWhitelist.m in Sources */,
+ 7ED95D3E1AB9029B008C4574 /* CDVCommandQueue.m in Sources */,
+ 7ED95D401AB9029B008C4574 /* CDVConfigParser.m in Sources */,
7ED95D421AB9029B008C4574 /* CDVInvokedUrlCommand.m in Sources */,
+ 7ED95D441AB9029B008C4574 /* CDVPlugin+Resources.m in Sources */,
+ 2F4D42BD23F218BA00501999 /* CDVURLSchemeHandler.m in Sources */,
+ 7ED95D461AB9029B008C4574 /* CDVPlugin.m in Sources */,
+ 7ED95D481AB9029B008C4574 /* CDVPluginResult.m in Sources */,
7ED95D4B1AB9029B008C4574 /* CDVTimer.m in Sources */,
- 7ED95D4F1AB9029B008C4574 /* CDVUserAgentUtil.m in Sources */,
- 7ED95D401AB9029B008C4574 /* CDVConfigParser.m in Sources */,
- A3B082D51BB15CEA00D8DC35 /* CDVGestureHandler.m in Sources */,
- 7ED95D071AB9028C008C4574 /* CDVHandleOpenURL.m in Sources */,
- 30193A501AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.m in Sources */,
+ 4E23F8FE23E16E96006CD852 /* CDVWebViewEngine.m in Sources */,
+ 4E23F8FB23E16E96006CD852 /* CDVWebViewProcessPoolFactory.m in Sources */,
+ 7ED95D511AB9029B008C4574 /* CDVViewController.m in Sources */,
+ 7ED95D541AB9029B008C4574 /* CDVWhitelist.m in Sources */,
+ 7ED95D581AB9029B008C4574 /* NSDictionary+CordovaPreferences.m in Sources */,
7ED95D5A1AB9029B008C4574 /* NSMutableArray+QueueAdditions.m in Sources */,
- 7ED95D3E1AB9029B008C4574 /* CDVCommandQueue.m in Sources */,
- 7ED95D481AB9029B008C4574 /* CDVPluginResult.m in Sources */,
- 7ED95D441AB9029B008C4574 /* CDVPlugin+Resources.m in Sources */,
- 7ED95D4D1AB9029B008C4574 /* CDVURLProtocol.m in Sources */,
+ 7ED95D041AB9028C008C4574 /* CDVJSON_private.m in Sources */,
+ 4E23F8FD23E16E96006CD852 /* CDVWebViewUIDelegate.m in Sources */,
28BFF9151F355A4E00DDF01A /* CDVLogger.m in Sources */,
- 7ED95D0D1AB9028C008C4574 /* CDVUIWebViewEngine.m in Sources */,
- 7ED95D461AB9029B008C4574 /* CDVPlugin.m in Sources */,
- 7ED95D091AB9028C008C4574 /* CDVLocalStorage.m in Sources */,
+ A3B082D51BB15CEA00D8DC35 /* CDVGestureHandler.m in Sources */,
3093E2241B16D6A3003F381A /* CDVIntentAndNavigationFilter.m in Sources */,
+ 7ED95D071AB9028C008C4574 /* CDVHandleOpenURL.m in Sources */,
+ 4E714D3823F535B500A321AF /* CDVLaunchScreen.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
-/* Begin PBXTargetDependency section */
- C0C01ED21E39137C0056E6CB /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = D2AAC07D0554694100DB518D /* CordovaLib */;
- targetProxy = C0C01ED11E39137C0056E6CB /* PBXContainerItemProxy */;
- };
-/* End PBXTargetDependency section */
-
/* Begin XCBuildConfiguration section */
1DEB921F08733DC00010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- COPY_PHASE_STRIP = NO;
- DSTROOT = "/tmp/$(PROJECT_NAME).dst";
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_MODEL_TUNING = G5;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = CordovaLib_Prefix.pch;
- GCC_PREPROCESSOR_DEFINITIONS = "";
- GCC_THUMB_SUPPORT = NO;
- GCC_VERSION = "";
- INSTALL_PATH = /usr/local/lib;
- IPHONEOS_DEPLOYMENT_TARGET = 9.0;
- PRODUCT_NAME = Cordova;
PUBLIC_HEADERS_FOLDER_PATH = include/Cordova;
- SKIP_INSTALL = YES;
+ TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
1DEB922008733DC00010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- DSTROOT = "/tmp/$(PROJECT_NAME).dst";
- GCC_MODEL_TUNING = G5;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = CordovaLib_Prefix.pch;
- GCC_PREPROCESSOR_DEFINITIONS = "";
- GCC_THUMB_SUPPORT = NO;
- GCC_VERSION = "";
- INSTALL_PATH = /usr/local/lib;
- IPHONEOS_DEPLOYMENT_TARGET = 9.0;
- PRODUCT_NAME = Cordova;
PUBLIC_HEADERS_FOLDER_PATH = include/Cordova;
- SKIP_INSTALL = YES;
+ TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
1DEB922308733DC00010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
@@ -610,45 +619,63 @@
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
- GCC_C_LANGUAGE_STANDARD = c99;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PREPROCESSOR_DEFINITIONS = "";
- GCC_THUMB_SUPPORT = NO;
- GCC_VERSION = "";
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = CordovaLib_Prefix.pch;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 9.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+ MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
- OTHER_CFLAGS = "-DDEBUG";
- PUBLIC_HEADERS_FOLDER_PATH = include/Cordova;
+ OTHER_LDFLAGS = "-ObjC";
+ PRODUCT_NAME = Cordova;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
- TARGETED_DEVICE_FAMILY = "1,2";
- USER_HEADER_SEARCH_PATHS = "";
};
name = Debug;
};
1DEB922408733DC00010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
@@ -656,77 +683,54 @@
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
- GCC_C_LANGUAGE_STANDARD = c99;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
- GCC_PREPROCESSOR_DEFINITIONS = "";
- GCC_THUMB_SUPPORT = NO;
- GCC_VERSION = "";
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = CordovaLib_Prefix.pch;
+ GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 9.0;
- ONLY_ACTIVE_ARCH = NO;
- PUBLIC_HEADERS_FOLDER_PATH = include/Cordova;
+ IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ MTL_FAST_MATH = YES;
+ OTHER_LDFLAGS = "-ObjC";
+ PRODUCT_NAME = Cordova;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
- TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_PRODUCT = YES;
};
name = Release;
};
C0C01EB71E3911D50056E6CB /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_ANALYZER_NONNULL = YES;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
- CLANG_WARN_INFINITE_RECURSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN_SUSPICIOUS_MOVE = YES;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CODE_SIGN_IDENTITY = "";
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
- COPY_PHASE_STRIP = NO;
- CURRENT_PROJECT_VERSION = 1;
- DEBUG_INFORMATION_FORMAT = dwarf;
DEFINES_MODULE = YES;
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- "$(inherited)",
- );
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
INFOPLIST_FILE = Cordova/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
- IPHONEOS_DEPLOYMENT_TARGET = 9.0;
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
- MTL_ENABLE_DEBUG_INFO = YES;
- OTHER_LDFLAGS = "-all_load";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
PRODUCT_BUNDLE_IDENTIFIER = org.apache.cordova.Cordova;
- PRODUCT_NAME = "$(TARGET_NAME)";
- PUBLIC_HEADERS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Headers";
- SKIP_INSTALL = YES;
+ TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
@@ -735,45 +739,17 @@
C0C01EB81E3911D50056E6CB /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_ANALYZER_NONNULL = YES;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
- CLANG_WARN_INFINITE_RECURSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN_SUSPICIOUS_MOVE = YES;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CODE_SIGN_IDENTITY = "";
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
- COPY_PHASE_STRIP = NO;
- CURRENT_PROJECT_VERSION = 1;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
- ENABLE_NS_ASSERTIONS = NO;
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
INFOPLIST_FILE = Cordova/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
- IPHONEOS_DEPLOYMENT_TARGET = 9.0;
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
- MTL_ENABLE_DEBUG_INFO = NO;
- OTHER_LDFLAGS = "-all_load";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
PRODUCT_BUNDLE_IDENTIFIER = org.apache.cordova.Cordova;
- PRODUCT_NAME = "$(TARGET_NAME)";
- PUBLIC_HEADERS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Headers";
- SKIP_INSTALL = YES;
- VALIDATE_PRODUCT = YES;
+ TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
diff --git a/StoneIsland/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist b/StoneIsland/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist
index 1020c69e..6408f0cb 100644
--- a/StoneIsland/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist
+++ b/StoneIsland/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -4,25 +4,15 @@
<dict>
<key>SchemeUserState</key>
<dict>
- <key>Cordova.xcscheme</key>
- <dict>
- <key>orderHint</key>
- <integer>4</integer>
- </dict>
<key>Cordova.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
- <integer>3</integer>
- </dict>
- <key>CordovaLib.xcscheme</key>
- <dict>
- <key>orderHint</key>
- <integer>3</integer>
+ <integer>26</integer>
</dict>
<key>CordovaLib.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
- <integer>2</integer>
+ <integer>27</integer>
</dict>
</dict>
</dict>
diff --git a/StoneIsland/platforms/ios/CordovaLib/VERSION b/StoneIsland/platforms/ios/CordovaLib/VERSION
index 6cedcff6..f3b5af39 100644
--- a/StoneIsland/platforms/ios/CordovaLib/VERSION
+++ b/StoneIsland/platforms/ios/CordovaLib/VERSION
@@ -1 +1 @@
-4.5.2
+6.1.1
diff --git a/StoneIsland/platforms/ios/CordovaLib/cordova.js b/StoneIsland/platforms/ios/CordovaLib/cordova.js
index a320f5ee..a837c75f 100644
--- a/StoneIsland/platforms/ios/CordovaLib/cordova.js
+++ b/StoneIsland/platforms/ios/CordovaLib/cordova.js
@@ -1,5 +1,5 @@
// Platform: ios
-// ff66178b108b93be36a1aafe341af17381a727a3
+// 538a985db128858c0a0eb4dd40fb9c8e5433fc94
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -8,9 +8,9 @@
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -19,12 +19,8 @@
under the License.
*/
;(function() {
-var PLATFORM_VERSION_BUILD_LABEL = '4.5.2';
+var PLATFORM_VERSION_BUILD_LABEL = '6.1.1';
// file: src/scripts/require.js
-
-/* jshint -W079 */
-/* jshint -W020 */
-
var require;
var define;
@@ -54,10 +50,10 @@ var define;
require = function (id) {
if (!modules[id]) {
- throw 'module ' + id + ' not found';
+ throw new Error('module ' + id + ' not found');
} else if (id in inProgressModules) {
var cycle = requireStack.slice(inProgressModules[id]).join('->') + '->' + id;
- throw 'Cycle in require graph: ' + cycle;
+ throw new Error('Cycle in require graph: ' + cycle);
}
if (modules[id].factory) {
try {
@@ -73,8 +69,8 @@ var define;
};
define = function (id, factory) {
- if (modules[id]) {
- throw 'module ' + id + ' already defined';
+ if (Object.prototype.hasOwnProperty.call(modules, id)) {
+ throw new Error('module ' + id + ' already defined');
}
modules[id] = {
@@ -101,7 +97,7 @@ define("cordova", function(require, exports, module) {
// Workaround for Windows 10 in hosted environment case
// http://www.w3.org/html/wg/drafts/html/master/browsers.html#named-access-on-the-window-object
-if (window.cordova && !(window.cordova instanceof HTMLElement)) { // eslint-disable-line no-undef
+if (window.cordova && !(window.cordova instanceof HTMLElement)) {
throw new Error('cordova already defined');
}
@@ -166,7 +162,7 @@ function createEvent (type, data) {
event.initEvent(type, false, false);
if (data) {
for (var i in data) {
- if (data.hasOwnProperty(i)) {
+ if (Object.prototype.hasOwnProperty.call(data, i)) {
event[i] = data[i];
}
}
@@ -174,7 +170,6 @@ function createEvent (type, data) {
return event;
}
-/* eslint-disable no-undef */
var cordova = {
define: define,
require: require,
@@ -182,8 +177,6 @@ var cordova = {
platformVersion: PLATFORM_VERSION_BUILD_LABEL,
platformId: platform.id,
- /* eslint-enable no-undef */
-
/**
* Methods to add/remove your own addEventListener hijacking on document + window.
*/
@@ -202,15 +195,25 @@ var cordova = {
removeDocumentEventHandler: function (event) {
delete documentEventHandlers[event];
},
+
/**
* Retrieve original event handlers that were replaced by Cordova
*
* @return object
*/
getOriginalHandlers: function () {
- return {'document': {'addEventListener': m_document_addEventListener, 'removeEventListener': m_document_removeEventListener},
- 'window': {'addEventListener': m_window_addEventListener, 'removeEventListener': m_window_removeEventListener}};
+ return {
+ document: {
+ addEventListener: m_document_addEventListener,
+ removeEventListener: m_document_removeEventListener
+ },
+ window: {
+ addEventListener: m_window_addEventListener,
+ removeEventListener: m_window_removeEventListener
+ }
+ };
},
+
/**
* Method to fire event from native code
* bNoDetach is required for events which cause an exception which needs to be caught in native code
@@ -233,6 +236,7 @@ var cordova = {
document.dispatchEvent(evt);
}
},
+
fireWindowEvent: function (type, data) {
var evt = createEvent(type, data);
if (typeof windowEventHandlers[type] !== 'undefined') {
@@ -306,11 +310,11 @@ var cordova = {
}
} catch (err) {
var msg = 'Error in ' + (isSuccess ? 'Success' : 'Error') + ' callbackId: ' + callbackId + ' : ' + err;
- console && console.log && console.log(msg);
- cordova.fireWindowEvent('cordovacallbackerror', { 'message': msg });
+ cordova.fireWindowEvent('cordovacallbackerror', { message: msg, error: err });
throw err;
}
},
+
addConstructor: function (func) {
channel.onCordovaReady.subscribe(function () {
try {
@@ -334,18 +338,47 @@ var utils = require('cordova/utils');
var moduleExports = module.exports;
var typeMap = {
- 'A': 'Array',
- 'D': 'Date',
- 'N': 'Number',
- 'S': 'String',
- 'F': 'Function',
- 'O': 'Object'
+ A: 'Array',
+ D: 'Date',
+ N: 'Number',
+ S: 'String',
+ F: 'Function',
+ O: 'Object'
};
function extractParamName (callee, argIndex) {
- return (/.*?\((.*?)\)/).exec(callee)[1].split(', ')[argIndex];
+ return (/\(\s*([^)]*?)\s*\)/).exec(callee)[1].split(/\s*,\s*/)[argIndex];
}
+/**
+ * Checks the given arguments' types and throws if they are not as expected.
+ *
+ * `spec` is a string where each character stands for the required type of the
+ * argument at the same position. In other words: the character at `spec[i]`
+ * specifies the required type for `args[i]`. The characters in `spec` are the
+ * first letter of the required type's name. The supported types are:
+ *
+ * Array, Date, Number, String, Function, Object
+ *
+ * Lowercase characters specify arguments that must not be `null` or `undefined`
+ * while uppercase characters allow those values to be passed.
+ *
+ * Finally, `*` can be used to allow any type at the corresponding position.
+ *
+ * @example
+ * function foo (arr, opts) {
+ * // require `arr` to be an Array and `opts` an Object, null or undefined
+ * checkArgs('aO', 'my.package.foo', arguments);
+ * // ...
+ * }
+ * @param {String} spec - the type specification for `args` as described above
+ * @param {String} functionName - full name of the callee.
+ * Used in the error message
+ * @param {Array|arguments} args - the arguments to be checked against `spec`
+ * @param {Function} [opt_callee=args.callee] - the recipient of `args`.
+ * Used to extract parameter names for the error message
+ * @throws {TypeError} if args do not satisfy spec
+ */
function checkArgs (spec, functionName, args, opt_callee) {
if (!moduleExports.enableChecks) {
return;
@@ -401,7 +434,7 @@ base64.fromArrayBuffer = function (arrayBuffer) {
};
base64.toArrayBuffer = function (str) {
- var decodedStr = typeof atob !== 'undefined' ? atob(str) : Buffer.from(str, 'base64').toString('binary'); // eslint-disable-line no-undef
+ var decodedStr = atob(str);
var arrayBuffer = new ArrayBuffer(decodedStr.length);
var array = new Uint8Array(arrayBuffer);
for (var i = 0, len = decodedStr.length; i < len; i++) {
@@ -463,14 +496,13 @@ var utils = require('cordova/utils');
function each (objects, func, context) {
for (var prop in objects) {
- if (objects.hasOwnProperty(prop)) {
+ if (Object.prototype.hasOwnProperty.call(objects, prop)) {
func.apply(context, [objects[prop], prop]);
}
}
}
function clobber (obj, key, value) {
- exports.replaceHookForTesting(obj, key);
var needsProperty = false;
try {
obj[key] = value;
@@ -544,7 +576,7 @@ function include (parent, objects, clobber, merge) {
*/
function recursiveMerge (target, src) {
for (var prop in src) {
- if (src.hasOwnProperty(prop)) {
+ if (Object.prototype.hasOwnProperty.call(src, prop)) {
if (target.prototype && target.prototype.constructor === target) {
// If the target object is a constructor override off prototype.
clobber(target.prototype, prop, src[prop]);
@@ -570,7 +602,6 @@ exports.buildIntoAndMerge = function (objects, target) {
};
exports.recursiveMerge = recursiveMerge;
exports.assignOrWrapInDeprecateGetter = assignOrWrapInDeprecateGetter;
-exports.replaceHookForTesting = function () {};
});
@@ -651,14 +682,14 @@ var channel = {
}
if (!len) h();
},
- /* eslint-disable no-return-assign */
+
create: function (type) {
- return channel[type] = new Channel(type, false);
+ return (channel[type] = new Channel(type, false));
},
createSticky: function (type) {
- return channel[type] = new Channel(type, true);
+ return (channel[type] = new Channel(type, true));
},
- /* eslint-enable no-return-assign */
+
/**
* cordova Channels that must fire before "deviceready" is fired.
*/
@@ -779,7 +810,6 @@ Channel.prototype.unsubscribe = function (eventListenerOrFunction) {
* Calls all functions subscribed to this channel.
*/
Channel.prototype.fire = function (e) {
- var fail = false; // eslint-disable-line no-unused-vars
var fireArgs = Array.prototype.slice.call(arguments);
// Apply stickiness.
if (this.state === 1) {
@@ -836,33 +866,27 @@ module.exports = channel;
});
-// file: /Users/spindori/Documents/Cordova/cordova-ios/cordova-js-src/exec.js
+// file: ../cordova-ios/cordova-js-src/exec.js
define("cordova/exec", function(require, exports, module) {
-/*global require, module, atob, document */
-
/**
- * Creates a gap bridge iframe used to notify the native code about queued
+ * Creates the exec bridge used to notify the native code of
* commands.
*/
-var cordova = require('cordova'),
- utils = require('cordova/utils'),
- base64 = require('cordova/base64'),
- execIframe,
- commandQueue = [], // Contains pending JS->Native messages.
- isInContextOfEvalJs = 0,
- failSafeTimerId = 0;
+var cordova = require('cordova');
+var utils = require('cordova/utils');
+var base64 = require('cordova/base64');
-function massageArgsJsToNative(args) {
- if (!args || utils.typeName(args) != 'Array') {
+function massageArgsJsToNative (args) {
+ if (!args || utils.typeName(args) !== 'Array') {
return args;
}
var ret = [];
- args.forEach(function(arg, i) {
- if (utils.typeName(arg) == 'ArrayBuffer') {
+ args.forEach(function (arg, i) {
+ if (utils.typeName(arg) === 'ArrayBuffer') {
ret.push({
- 'CDVType': 'ArrayBuffer',
- 'data': base64.fromArrayBuffer(arg)
+ CDVType: 'ArrayBuffer',
+ data: base64.fromArrayBuffer(arg)
});
} else {
ret.push(arg);
@@ -871,29 +895,29 @@ function massageArgsJsToNative(args) {
return ret;
}
-function massageMessageNativeToJs(message) {
- if (message.CDVType == 'ArrayBuffer') {
- var stringToArrayBuffer = function(str) {
+function massageMessageNativeToJs (message) {
+ if (message.CDVType === 'ArrayBuffer') {
+ var stringToArrayBuffer = function (str) {
var ret = new Uint8Array(str.length);
for (var i = 0; i < str.length; i++) {
ret[i] = str.charCodeAt(i);
}
return ret.buffer;
};
- var base64ToArrayBuffer = function(b64) {
- return stringToArrayBuffer(atob(b64));
+ var base64ToArrayBuffer = function (b64) {
+ return stringToArrayBuffer(atob(b64)); // eslint-disable-line no-undef
};
message = base64ToArrayBuffer(message.data);
}
return message;
}
-function convertMessageToArgsNativeToJs(message) {
+function convertMessageToArgsNativeToJs (message) {
var args = [];
- if (!message || !message.hasOwnProperty('CDVType')) {
+ if (!message || !Object.prototype.hasOwnProperty.call(message, 'CDVType')) {
args.push(message);
- } else if (message.CDVType == 'MultiPart') {
- message.messages.forEach(function(e) {
+ } else if (message.CDVType === 'MultiPart') {
+ message.messages.forEach(function (e) {
args.push(massageMessageNativeToJs(e));
});
} else {
@@ -902,8 +926,7 @@ function convertMessageToArgsNativeToJs(message) {
return args;
}
-function iOSExec() {
-
+var iOSExec = function () {
var successCallback, failCallback, service, action, actionArgs;
var callbackId = null;
if (typeof arguments[0] !== 'string') {
@@ -920,9 +943,8 @@ function iOSExec() {
// an invalid callbackId and passes it even if no callbacks were given.
callbackId = 'INVALID';
} else {
- throw new Error('The old format of this exec call has been removed (deprecated since 2.1). Change to: ' +
- 'cordova.exec(null, null, \'Service\', \'action\', [ arg1, arg2 ]);'
- );
+ throw new Error('The old format of this exec call has been removed (deprecated since 2.1). Change to: ' + // eslint-disable-line
+ 'cordova.exec(null, null, \'Service\', \'action\', [ arg1, arg2 ]);');
}
// If actionArgs is not provided, default to an empty array
@@ -933,149 +955,54 @@ function iOSExec() {
if (successCallback || failCallback) {
callbackId = service + cordova.callbackId++;
cordova.callbacks[callbackId] =
- {success:successCallback, fail:failCallback};
+ { success: successCallback, fail: failCallback };
}
actionArgs = massageArgsJsToNative(actionArgs);
- var command = [callbackId, service, action, actionArgs];
-
- // Stringify and queue the command. We stringify to command now to
- // effectively clone the command arguments in case they are mutated before
- // the command is executed.
- commandQueue.push(JSON.stringify(command));
-
- // If we're in the context of a stringByEvaluatingJavaScriptFromString call,
- // then the queue will be flushed when it returns; no need for a poke.
- // Also, if there is already a command in the queue, then we've already
- // poked the native side, so there is no reason to do so again.
- if (!isInContextOfEvalJs && commandQueue.length == 1) {
- pokeNative();
- }
-}
-
-// CB-10530
-function proxyChanged() {
- var cexec = cordovaExec();
-
- return (execProxy !== cexec && // proxy objects are different
- iOSExec !== cexec // proxy object is not the current iOSExec
- );
-}
-
-// CB-10106
-function handleBridgeChange() {
- if (proxyChanged()) {
- var commandString = commandQueue.shift();
- while(commandString) {
- var command = JSON.parse(commandString);
- var callbackId = command[0];
- var service = command[1];
- var action = command[2];
- var actionArgs = command[3];
- var callbacks = cordova.callbacks[callbackId] || {};
-
- execProxy(callbacks.success, callbacks.fail, service, action, actionArgs);
-
- commandString = commandQueue.shift();
- };
- return true;
- }
-
- return false;
-}
-
-function pokeNative() {
- // CB-5488 - Don't attempt to create iframe before document.body is available.
- if (!document.body) {
- setTimeout(pokeNative);
- return;
- }
-
- // Check if they've removed it from the DOM, and put it back if so.
- if (execIframe && execIframe.contentWindow) {
- execIframe.contentWindow.location = 'gap://ready';
- } else {
- execIframe = document.createElement('iframe');
- execIframe.style.display = 'none';
- execIframe.src = 'gap://ready';
- document.body.appendChild(execIframe);
- }
- // Use a timer to protect against iframe being unloaded during the poke (CB-7735).
- // This makes the bridge ~ 7% slower, but works around the poke getting lost
- // when the iframe is removed from the DOM.
- // An onunload listener could be used in the case where the iframe has just been
- // created, but since unload events fire only once, it doesn't work in the normal
- // case of iframe reuse (where unload will have already fired due to the attempted
- // navigation of the page).
- failSafeTimerId = setTimeout(function() {
- if (commandQueue.length) {
- // CB-10106 - flush the queue on bridge change
- if (!handleBridgeChange()) {
- pokeNative();
- }
- }
- }, 50); // Making this > 0 improves performance (marginally) in the normal case (where it doesn't fire).
-}
-
-iOSExec.nativeFetchMessages = function() {
- // Stop listing for window detatch once native side confirms poke.
- if (failSafeTimerId) {
- clearTimeout(failSafeTimerId);
- failSafeTimerId = 0;
- }
- // Each entry in commandQueue is a JSON string already.
- if (!commandQueue.length) {
- return '';
- }
- var json = '[' + commandQueue.join(',') + ']';
- commandQueue.length = 0;
- return json;
+ // CB-10133 DataClone DOM Exception 25 guard (fast function remover)
+ var command = [callbackId, service, action, JSON.parse(JSON.stringify(actionArgs))];
+ window.webkit.messageHandlers.cordova.postMessage(command);
};
-iOSExec.nativeCallback = function(callbackId, status, message, keepCallback, debug) {
- return iOSExec.nativeEvalAndFetch(function() {
- var success = status === 0 || status === 1;
- var args = convertMessageToArgsNativeToJs(message);
- function nc2() {
- cordova.callbackFromNative(callbackId, success, status, args, keepCallback);
- }
- setTimeout(nc2, 0);
+iOSExec.nativeCallback = function (callbackId, status, message, keepCallback, debug) {
+ var success = status === 0 || status === 1;
+ var args = convertMessageToArgsNativeToJs(message);
+ Promise.resolve().then(function () {
+ cordova.callbackFromNative(callbackId, success, status, args, keepCallback); // eslint-disable-line
});
};
-iOSExec.nativeEvalAndFetch = function(func) {
- // This shouldn't be nested, but better to be safe.
- isInContextOfEvalJs++;
+// for backwards compatibility
+iOSExec.nativeEvalAndFetch = function (func) {
try {
func();
- return iOSExec.nativeFetchMessages();
- } finally {
- isInContextOfEvalJs--;
+ } catch (e) {
+ console.log(e);
}
};
// Proxy the exec for bridge changes. See CB-10106
-function cordovaExec() {
+function cordovaExec () {
var cexec = require('cordova/exec');
var cexec_valid = (typeof cexec.nativeFetchMessages === 'function') && (typeof cexec.nativeEvalAndFetch === 'function') && (typeof cexec.nativeCallback === 'function');
- return (cexec_valid && execProxy !== cexec)? cexec : iOSExec;
+ return (cexec_valid && execProxy !== cexec) ? cexec : iOSExec;
}
-function execProxy() {
+function execProxy () {
cordovaExec().apply(null, arguments);
-};
+}
-execProxy.nativeFetchMessages = function() {
+execProxy.nativeFetchMessages = function () {
return cordovaExec().nativeFetchMessages.apply(null, arguments);
};
-execProxy.nativeEvalAndFetch = function() {
+execProxy.nativeEvalAndFetch = function () {
return cordovaExec().nativeEvalAndFetch.apply(null, arguments);
};
-execProxy.nativeCallback = function() {
+execProxy.nativeCallback = function () {
return cordovaExec().nativeCallback.apply(null, arguments);
};
@@ -1121,7 +1048,6 @@ var cordova = require('cordova');
var modulemapper = require('cordova/modulemapper');
var platform = require('cordova/platform');
var pluginloader = require('cordova/pluginloader');
-var utils = require('cordova/utils');
var platformInitChannelsArray = [channel.onNativeReady, channel.onPluginsReady];
@@ -1141,34 +1067,6 @@ window.setTimeout(function () {
}
}, 5000);
-// Replace navigator before any modules are required(), to ensure it happens as soon as possible.
-// We replace it so that properties that can't be clobbered can instead be overridden.
-function replaceNavigator (origNavigator) {
- var CordovaNavigator = function () {};
- CordovaNavigator.prototype = origNavigator;
- var newNavigator = new CordovaNavigator();
- // This work-around really only applies to new APIs that are newer than Function.bind.
- // Without it, APIs such as getGamepads() break.
- if (CordovaNavigator.bind) {
- for (var key in origNavigator) {
- if (typeof origNavigator[key] === 'function') {
- newNavigator[key] = origNavigator[key].bind(origNavigator);
- } else {
- (function (k) {
- utils.defineGetterSetter(newNavigator, key, function () {
- return origNavigator[k];
- });
- })(key);
- }
- }
- }
- return newNavigator;
-}
-
-if (window.navigator) {
- window.navigator = replaceNavigator(window.navigator);
-}
-
if (!window.console) {
window.console = {
log: function () {}
@@ -1234,131 +1132,6 @@ channel.join(function () {
channel.join(function () {
require('cordova').fireDocumentEvent('deviceready');
}, channel.deviceReadyChannelsArray);
-
-}, platformInitChannelsArray);
-
-});
-
-// file: src/common/init_b.js
-define("cordova/init_b", function(require, exports, module) {
-
-var channel = require('cordova/channel');
-var cordova = require('cordova');
-var modulemapper = require('cordova/modulemapper');
-var platform = require('cordova/platform');
-var pluginloader = require('cordova/pluginloader');
-var utils = require('cordova/utils');
-
-var platformInitChannelsArray = [channel.onDOMContentLoaded, channel.onNativeReady, channel.onPluginsReady];
-
-// setting exec
-cordova.exec = require('cordova/exec');
-
-function logUnfiredChannels (arr) {
- for (var i = 0; i < arr.length; ++i) {
- if (arr[i].state !== 2) {
- console.log('Channel not fired: ' + arr[i].type);
- }
- }
-}
-
-window.setTimeout(function () {
- if (channel.onDeviceReady.state !== 2) {
- console.log('deviceready has not fired after 5 seconds.');
- logUnfiredChannels(platformInitChannelsArray);
- logUnfiredChannels(channel.deviceReadyChannelsArray);
- }
-}, 5000);
-
-// Replace navigator before any modules are required(), to ensure it happens as soon as possible.
-// We replace it so that properties that can't be clobbered can instead be overridden.
-function replaceNavigator (origNavigator) {
- var CordovaNavigator = function () {};
- CordovaNavigator.prototype = origNavigator;
- var newNavigator = new CordovaNavigator();
- // This work-around really only applies to new APIs that are newer than Function.bind.
- // Without it, APIs such as getGamepads() break.
- if (CordovaNavigator.bind) {
- for (var key in origNavigator) {
- if (typeof origNavigator[key] === 'function') {
- newNavigator[key] = origNavigator[key].bind(origNavigator);
- } else {
- (function (k) {
- utils.defineGetterSetter(newNavigator, key, function () {
- return origNavigator[k];
- });
- })(key);
- }
- }
- }
- return newNavigator;
-}
-if (window.navigator) {
- window.navigator = replaceNavigator(window.navigator);
-}
-
-if (!window.console) {
- window.console = {
- log: function () {}
- };
-}
-if (!window.console.warn) {
- window.console.warn = function (msg) {
- this.log('warn: ' + msg);
- };
-}
-
-// Register pause, resume and deviceready channels as events on document.
-channel.onPause = cordova.addDocumentEventHandler('pause');
-channel.onResume = cordova.addDocumentEventHandler('resume');
-channel.onActivated = cordova.addDocumentEventHandler('activated');
-channel.onDeviceReady = cordova.addStickyDocumentEventHandler('deviceready');
-
-// Listen for DOMContentLoaded and notify our channel subscribers.
-if (document.readyState === 'complete' || document.readyState === 'interactive') {
- channel.onDOMContentLoaded.fire();
-} else {
- document.addEventListener('DOMContentLoaded', function () {
- channel.onDOMContentLoaded.fire();
- }, false);
-}
-
-// _nativeReady is global variable that the native side can set
-// to signify that the native code is ready. It is a global since
-// it may be called before any cordova JS is ready.
-if (window._nativeReady) {
- channel.onNativeReady.fire();
-}
-
-// Call the platform-specific initialization.
-platform.bootstrap && platform.bootstrap();
-
-// Wrap in a setTimeout to support the use-case of having plugin JS appended to cordova.js.
-// The delay allows the attached modules to be defined before the plugin loader looks for them.
-setTimeout(function () {
- pluginloader.load(function () {
- channel.onPluginsReady.fire();
- });
-}, 0);
-
-/**
- * Create all cordova objects once native side is ready.
- */
-channel.join(function () {
- modulemapper.mapModules(window);
-
- platform.initialize && platform.initialize();
-
- // Fire event to notify that all objects are created
- channel.onCordovaReady.fire();
-
- // Fire onDeviceReady event once page has fully loaded, all
- // constructors have run and cordova info has been received from native
- // side.
- channel.join(function () {
- require('cordova').fireDocumentEvent('deviceready');
- }, channel.deviceReadyChannelsArray);
-
}, platformInitChannelsArray);
});
@@ -1367,7 +1140,7 @@ channel.join(function () {
define("cordova/modulemapper", function(require, exports, module) {
var builder = require('cordova/builder');
-var moduleMap = define.moduleMap; // eslint-disable-line no-undef
+var moduleMap = define.moduleMap;
var symbolList;
var deprecationMap;
@@ -1407,12 +1180,9 @@ function prepareNamespace (symbolPath, context) {
if (!symbolPath) {
return context;
}
- var parts = symbolPath.split('.');
- var cur = context;
- for (var i = 0, part; part = parts[i]; ++i) { // eslint-disable-line no-cond-assign
- cur = cur[part] = cur[part] || {};
- }
- return cur;
+ return symbolPath.split('.').reduce(function (cur, part) {
+ return (cur[part] = cur[part] || {});
+ }, context);
}
exports.mapModules = function (context) {
@@ -1463,103 +1233,7 @@ exports.reset();
});
-// file: src/common/modulemapper_b.js
-define("cordova/modulemapper_b", function(require, exports, module) {
-
-var builder = require('cordova/builder');
-var symbolList = [];
-var deprecationMap;
-
-exports.reset = function () {
- symbolList = [];
- deprecationMap = {};
-};
-
-function addEntry (strategy, moduleName, symbolPath, opt_deprecationMessage) {
- symbolList.push(strategy, moduleName, symbolPath);
- if (opt_deprecationMessage) {
- deprecationMap[symbolPath] = opt_deprecationMessage;
- }
-}
-
-// Note: Android 2.3 does have Function.bind().
-exports.clobbers = function (moduleName, symbolPath, opt_deprecationMessage) {
- addEntry('c', moduleName, symbolPath, opt_deprecationMessage);
-};
-
-exports.merges = function (moduleName, symbolPath, opt_deprecationMessage) {
- addEntry('m', moduleName, symbolPath, opt_deprecationMessage);
-};
-
-exports.defaults = function (moduleName, symbolPath, opt_deprecationMessage) {
- addEntry('d', moduleName, symbolPath, opt_deprecationMessage);
-};
-
-exports.runs = function (moduleName) {
- addEntry('r', moduleName, null);
-};
-
-function prepareNamespace (symbolPath, context) {
- if (!symbolPath) {
- return context;
- }
- var parts = symbolPath.split('.');
- var cur = context;
- for (var i = 0, part; part = parts[i]; ++i) { // eslint-disable-line no-cond-assign
- cur = cur[part] = cur[part] || {};
- }
- return cur;
-}
-
-exports.mapModules = function (context) {
- var origSymbols = {};
- context.CDV_origSymbols = origSymbols;
- for (var i = 0, len = symbolList.length; i < len; i += 3) {
- var strategy = symbolList[i];
- var moduleName = symbolList[i + 1];
- var module = require(moduleName);
- // <runs/>
- if (strategy === 'r') {
- continue;
- }
- var symbolPath = symbolList[i + 2];
- var lastDot = symbolPath.lastIndexOf('.');
- var namespace = symbolPath.substr(0, lastDot);
- var lastName = symbolPath.substr(lastDot + 1);
-
- var deprecationMsg = symbolPath in deprecationMap ? 'Access made to deprecated symbol: ' + symbolPath + '. ' + deprecationMsg : null;
- var parentObj = prepareNamespace(namespace, context);
- var target = parentObj[lastName];
-
- if (strategy === 'm' && target) {
- builder.recursiveMerge(target, module);
- } else if ((strategy === 'd' && !target) || (strategy !== 'd')) {
- if (!(symbolPath in origSymbols)) {
- origSymbols[symbolPath] = target;
- }
- builder.assignOrWrapInDeprecateGetter(parentObj, lastName, module, deprecationMsg);
- }
- }
-};
-
-exports.getOriginalSymbol = function (context, symbolPath) {
- var origSymbols = context.CDV_origSymbols;
- if (origSymbols && (symbolPath in origSymbols)) {
- return origSymbols[symbolPath];
- }
- var parts = symbolPath.split('.');
- var obj = context;
- for (var i = 0; i < parts.length; ++i) {
- obj = obj && obj[parts[i]];
- }
- return obj;
-};
-
-exports.reset();
-
-});
-
-// file: /Users/spindori/Documents/Cordova/cordova-ios/cordova-js-src/platform.js
+// file: ../cordova-ios/cordova-js-src/platform.js
define("cordova/platform", function(require, exports, module) {
module.exports = {
@@ -1569,187 +1243,213 @@ module.exports = {
// see the file under plugin/ios/console.js
require('cordova/modulemapper').clobbers('cordova/plugin/ios/console', 'window.console');
+ // Attach the wkwebkit utility to window.WkWebView
+ // see the file under plugin/ios/wkwebkit.js
+ require('cordova/modulemapper').clobbers('cordova/plugin/ios/wkwebkit', 'window.WkWebView');
+
+ // Attach the splashscreen utility to window.navigator.splashscreen
+ // see the file under plugin/ios/launchscreen.js
+ require('cordova/modulemapper').clobbers('cordova/plugin/ios/launchscreen', 'navigator.splashscreen');
+
require('cordova/channel').onNativeReady.fire();
}
};
});
-// file: /Users/spindori/Documents/Cordova/cordova-ios/cordova-js-src/plugin/ios/console.js
+// file: ../cordova-ios/cordova-js-src/plugin/ios/console.js
define("cordova/plugin/ios/console", function(require, exports, module) {
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
var logger = require('cordova/plugin/ios/logger');
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
// object that we're exporting
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
var console = module.exports;
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
// copy of the original console object
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
var WinConsole = window.console;
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
// whether to use the logger
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
var UseLogger = false;
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
// Timers
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
var Timers = {};
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
// used for unimplemented methods
-//------------------------------------------------------------------------------
-function noop() {}
+// ------------------------------------------------------------------------------
+function noop () {}
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
// used for unimplemented methods
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
console.useLogger = function (value) {
if (arguments.length) UseLogger = !!value;
if (UseLogger) {
if (logger.useConsole()) {
- throw new Error("console and logger are too intertwingly");
+ throw new Error('console and logger are too intertwingly');
}
}
return UseLogger;
};
-//------------------------------------------------------------------------------
-console.log = function() {
+// ------------------------------------------------------------------------------
+console.log = function () {
if (logger.useConsole()) return;
logger.log.apply(logger, [].slice.call(arguments));
};
-//------------------------------------------------------------------------------
-console.error = function() {
+// ------------------------------------------------------------------------------
+console.error = function () {
if (logger.useConsole()) return;
logger.error.apply(logger, [].slice.call(arguments));
};
-//------------------------------------------------------------------------------
-console.warn = function() {
+// ------------------------------------------------------------------------------
+console.warn = function () {
if (logger.useConsole()) return;
logger.warn.apply(logger, [].slice.call(arguments));
};
-//------------------------------------------------------------------------------
-console.info = function() {
+// ------------------------------------------------------------------------------
+console.info = function () {
if (logger.useConsole()) return;
logger.info.apply(logger, [].slice.call(arguments));
};
-//------------------------------------------------------------------------------
-console.debug = function() {
+// ------------------------------------------------------------------------------
+console.debug = function () {
if (logger.useConsole()) return;
logger.debug.apply(logger, [].slice.call(arguments));
};
-//------------------------------------------------------------------------------
-console.assert = function(expression) {
+// ------------------------------------------------------------------------------
+console.assert = function (expression) {
if (expression) return;
var message = logger.format.apply(logger.format, [].slice.call(arguments, 1));
- console.log("ASSERT: " + message);
+ console.log('ASSERT: ' + message);
};
-//------------------------------------------------------------------------------
-console.clear = function() {};
+// ------------------------------------------------------------------------------
+console.clear = function () {};
-//------------------------------------------------------------------------------
-console.dir = function(object) {
- console.log("%o", object);
+// ------------------------------------------------------------------------------
+console.dir = function (object) {
+ console.log('%o', object);
};
-//------------------------------------------------------------------------------
-console.dirxml = function(node) {
+// ------------------------------------------------------------------------------
+console.dirxml = function (node) {
console.log(node.innerHTML);
};
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
console.trace = noop;
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
console.group = console.log;
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
console.groupCollapsed = console.log;
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
console.groupEnd = noop;
-//------------------------------------------------------------------------------
-console.time = function(name) {
+// ------------------------------------------------------------------------------
+console.time = function (name) {
Timers[name] = new Date().valueOf();
};
-//------------------------------------------------------------------------------
-console.timeEnd = function(name) {
+// ------------------------------------------------------------------------------
+console.timeEnd = function (name) {
var timeStart = Timers[name];
if (!timeStart) {
- console.warn("unknown timer: " + name);
+ console.warn('unknown timer: ' + name);
return;
}
var timeElapsed = new Date().valueOf() - timeStart;
- console.log(name + ": " + timeElapsed + "ms");
+ console.log(name + ': ' + timeElapsed + 'ms');
};
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
console.timeStamp = noop;
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
console.profile = noop;
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
console.profileEnd = noop;
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
console.count = noop;
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
console.exception = console.log;
-//------------------------------------------------------------------------------
-console.table = function(data, columns) {
- console.log("%o", data);
+// ------------------------------------------------------------------------------
+console.table = function (data, columns) {
+ console.log('%o', data);
};
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
// return a new function that calls both functions passed as args
-//------------------------------------------------------------------------------
-function wrappedOrigCall(orgFunc, newFunc) {
- return function() {
+// ------------------------------------------------------------------------------
+function wrappedOrigCall (orgFunc, newFunc) {
+ return function () {
var args = [].slice.call(arguments);
try { orgFunc.apply(WinConsole, args); } catch (e) {}
- try { newFunc.apply(console, args); } catch (e) {}
+ try { newFunc.apply(console, args); } catch (e) {}
};
}
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
// For every function that exists in the original console object, that
// also exists in the new console object, wrap the new console method
// with one that calls both
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
for (var key in console) {
- if (typeof WinConsole[key] == "function") {
+ if (typeof WinConsole[key] === 'function') {
console[key] = wrappedOrigCall(WinConsole[key], console[key]);
}
}
});
-// file: /Users/spindori/Documents/Cordova/cordova-ios/cordova-js-src/plugin/ios/logger.js
+// file: ../cordova-ios/cordova-js-src/plugin/ios/launchscreen.js
+define("cordova/plugin/ios/launchscreen", function(require, exports, module) {
+
+var exec = require('cordova/exec');
+
+var launchscreen = {
+ show: function () {
+ exec(null, null, 'LaunchScreen', 'show', []);
+ },
+ hide: function () {
+ exec(null, null, 'LaunchScreen', 'hide', []);
+ }
+};
+
+module.exports = launchscreen;
+
+});
+
+// file: ../cordova-ios/cordova-js-src/plugin/ios/logger.js
define("cordova/plugin/ios/logger", function(require, exports, module) {
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
// The logger module exports the following properties/functions:
//
// LOG - constant for the level LOG
@@ -1768,16 +1468,16 @@ define("cordova/plugin/ios/logger", function(require, exports, module) {
// debug(message,...) - logs a message at level DEBUG
// logLevel(level,message,...) - logs a message specified level
//
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
var logger = exports;
-var exec = require('cordova/exec');
+var exec = require('cordova/exec');
-var UseConsole = false;
-var UseLogger = true;
-var Queued = [];
-var DeviceReady = false;
+var UseConsole = false;
+var UseLogger = true;
+var Queued = [];
+var DeviceReady = false;
var CurrentLevel;
var originalConsole = console;
@@ -1787,11 +1487,11 @@ var originalConsole = console;
*/
var Levels = [
- "LOG",
- "ERROR",
- "WARN",
- "INFO",
- "DEBUG"
+ 'LOG',
+ 'ERROR',
+ 'WARN',
+ 'INFO',
+ 'DEBUG'
];
/*
@@ -1800,10 +1500,10 @@ var Levels = [
*/
var LevelsMap = {};
-for (var i=0; i<Levels.length; i++) {
+for (var i = 0; i < Levels.length; i++) {
var level = Levels[i];
LevelsMap[level] = i;
- logger[level] = level;
+ logger[level] = level;
}
CurrentLevel = LevelsMap.WARN;
@@ -1830,7 +1530,7 @@ CurrentLevel = LevelsMap.WARN;
logger.level = function (value) {
if (arguments.length) {
if (LevelsMap[value] === null) {
- throw new Error("invalid logging level: " + value);
+ throw new Error('invalid logging level: ' + value);
}
CurrentLevel = LevelsMap[value];
}
@@ -1848,17 +1548,17 @@ logger.useConsole = function (value) {
if (arguments.length) UseConsole = !!value;
if (UseConsole) {
- if (typeof console == "undefined") {
- throw new Error("global console object is not defined");
+ if (typeof console === 'undefined') {
+ throw new Error('global console object is not defined');
}
- if (typeof console.log != "function") {
- throw new Error("global console object does not have a log function");
+ if (typeof console.log !== 'function') {
+ throw new Error('global console object does not have a log function');
}
- if (typeof console.useLogger == "function") {
+ if (typeof console.useLogger === 'function') {
if (console.useLogger()) {
- throw new Error("console and logger are too intertwingly");
+ throw new Error('console and logger are too intertwingly');
}
}
}
@@ -1884,7 +1584,7 @@ logger.useLogger = function (value) {
* Parameters passed after message are used applied to
* the message with utils.format()
*/
-logger.log = function(message) { logWithArgs("LOG", arguments); };
+logger.log = function (message) { logWithArgs('LOG', arguments); };
/**
* Logs a message at the ERROR level.
@@ -1892,7 +1592,7 @@ logger.log = function(message) { logWithArgs("LOG", arguments); };
* Parameters passed after message are used applied to
* the message with utils.format()
*/
-logger.error = function(message) { logWithArgs("ERROR", arguments); };
+logger.error = function (message) { logWithArgs('ERROR', arguments); };
/**
* Logs a message at the WARN level.
@@ -1900,7 +1600,7 @@ logger.error = function(message) { logWithArgs("ERROR", arguments); };
* Parameters passed after message are used applied to
* the message with utils.format()
*/
-logger.warn = function(message) { logWithArgs("WARN", arguments); };
+logger.warn = function (message) { logWithArgs('WARN', arguments); };
/**
* Logs a message at the INFO level.
@@ -1908,7 +1608,7 @@ logger.warn = function(message) { logWithArgs("WARN", arguments); };
* Parameters passed after message are used applied to
* the message with utils.format()
*/
-logger.info = function(message) { logWithArgs("INFO", arguments); };
+logger.info = function (message) { logWithArgs('INFO', arguments); };
/**
* Logs a message at the DEBUG level.
@@ -1916,17 +1616,17 @@ logger.info = function(message) { logWithArgs("INFO", arguments); };
* Parameters passed after message are used applied to
* the message with utils.format()
*/
-logger.debug = function(message) { logWithArgs("DEBUG", arguments); };
+logger.debug = function (message) { logWithArgs('DEBUG', arguments); };
// log at the specified level with args
-function logWithArgs(level, args) {
+function logWithArgs (level, args) {
args = [level].concat([].slice.call(args));
logger.logLevel.apply(logger, args);
}
// return the correct formatString for an object
-function formatStringForMessage(message) {
- return (typeof message === "string") ? "" : "%o";
+function formatStringForMessage (message) {
+ return (typeof message === 'string') ? '' : '%o';
}
/**
@@ -1935,18 +1635,18 @@ function formatStringForMessage(message) {
* Parameters passed after message are used applied to
* the message with utils.format()
*/
-logger.logLevel = function(level /* , ... */) {
+logger.logLevel = function (level /* , ... */) {
// format the message with the parameters
var formatArgs = [].slice.call(arguments, 1);
var fmtString = formatStringForMessage(formatArgs[0]);
- if (fmtString.length > 0){
+ if (fmtString.length > 0) {
formatArgs.unshift(fmtString); // add formatString
}
- var message = logger.format.apply(logger.format, formatArgs);
+ var message = logger.format.apply(logger.format, formatArgs);
if (LevelsMap[level] === null) {
- throw new Error("invalid logging level: " + level);
+ throw new Error('invalid logging level: ' + level);
}
if (LevelsMap[level] > CurrentLevel) return;
@@ -1959,28 +1659,27 @@ logger.logLevel = function(level /* , ... */) {
// Log using the native logger if that is enabled
if (UseLogger) {
- exec(null, null, "Console", "logLevel", [level, message]);
+ exec(null, null, 'Console', 'logLevel', [level, message]);
}
// Log using the console if that is enabled
if (UseConsole) {
// make sure console is not using logger
if (console.useLogger()) {
- throw new Error("console and logger are too intertwingly");
+ throw new Error('console and logger are too intertwingly');
}
// log to the console
switch (level) {
- case logger.LOG: originalConsole.log(message); break;
- case logger.ERROR: originalConsole.log("ERROR: " + message); break;
- case logger.WARN: originalConsole.log("WARN: " + message); break;
- case logger.INFO: originalConsole.log("INFO: " + message); break;
- case logger.DEBUG: originalConsole.log("DEBUG: " + message); break;
+ case logger.LOG: originalConsole.log(message); break;
+ case logger.ERROR: originalConsole.log('ERROR: ' + message); break;
+ case logger.WARN: originalConsole.log('WARN: ' + message); break;
+ case logger.INFO: originalConsole.log('INFO: ' + message); break;
+ case logger.DEBUG: originalConsole.log('DEBUG: ' + message); break;
}
}
};
-
/**
* Formats a string and arguments following it ala console.log()
*
@@ -1989,12 +1688,11 @@ logger.logLevel = function(level /* , ... */) {
* for rationale, see FireBug's Console API:
* http://getfirebug.com/wiki/index.php/Console_API
*/
-logger.format = function(formatString, args) {
- return __format(arguments[0], [].slice.call(arguments,1)).join(' ');
+logger.format = function (formatString, args) {
+ return __format(arguments[0], [].slice.call(arguments, 1)).join(' ');
};
-
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
/**
* Formats a string and arguments following it ala vsprintf()
*
@@ -2009,26 +1707,25 @@ logger.format = function(formatString, args) {
* Returns an array containing the formatted string and any remaining
* arguments.
*/
-function __format(formatString, args) {
- if (formatString === null || formatString === undefined) return [""];
- if (arguments.length == 1) return [formatString.toString()];
+function __format (formatString, args) {
+ if (formatString === null || formatString === undefined) return [''];
+ if (arguments.length === 1) return [formatString.toString()];
- if (typeof formatString != "string")
- formatString = formatString.toString();
+ if (typeof formatString !== 'string') { formatString = formatString.toString(); }
var pattern = /(.*?)%(.)(.*)/;
- var rest = formatString;
- var result = [];
+ var rest = formatString;
+ var result = [];
while (args.length) {
var match = pattern.exec(rest);
if (!match) break;
- var arg = args.shift();
+ var arg = args.shift();
rest = match[3];
result.push(match[1]);
- if (match[2] == '%') {
+ if (match[2] === '%') {
result.push('%');
args.unshift(arg);
continue;
@@ -2044,17 +1741,15 @@ function __format(formatString, args) {
return remainingArgs;
}
-function __formatted(object, formatChar) {
-
+function __formatted (object, formatChar) {
try {
- switch(formatChar) {
- case 'j':
- case 'o': return JSON.stringify(object);
- case 'c': return '';
+ switch (formatChar) {
+ case 'j':
+ case 'o': return JSON.stringify(object);
+ case 'c': return '';
}
- }
- catch (e) {
- return "error JSON.stringify()ing argument: " + e;
+ } catch (e) {
+ return 'error JSON.stringify()ing argument: ' + e;
}
if ((object === null) || (object === undefined)) {
@@ -2064,15 +1759,14 @@ function __formatted(object, formatChar) {
return object.toString();
}
-
-//------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
// when deviceready fires, log queued messages
-logger.__onDeviceReady = function() {
+logger.__onDeviceReady = function () {
if (DeviceReady) return;
DeviceReady = true;
- for (var i=0; i<Queued.length; i++) {
+ for (var i = 0; i < Queued.length; i++) {
var messageArgs = Queued[i];
logger.logLevel(messageArgs[0], messageArgs[1]);
}
@@ -2081,7 +1775,34 @@ logger.__onDeviceReady = function() {
};
// add a deviceready event to log queued messages
-document.addEventListener("deviceready", logger.__onDeviceReady, false);
+document.addEventListener('deviceready', logger.__onDeviceReady, false);
+
+});
+
+// file: ../cordova-ios/cordova-js-src/plugin/ios/wkwebkit.js
+define("cordova/plugin/ios/wkwebkit", function(require, exports, module) {
+
+var exec = require('cordova/exec');
+
+var WkWebKit = {
+ allowsBackForwardNavigationGestures: function (allow) {
+ exec(null, null, 'CDVWebViewEngine', 'allowsBackForwardNavigationGestures', [allow]);
+ },
+ convertFilePath: function (path) {
+ if (!path || !window.CDV_ASSETS_URL) {
+ return path;
+ }
+ if (path.startsWith('/')) {
+ return window.CDV_ASSETS_URL + '/_app_file_' + path;
+ }
+ if (path.startsWith('file://')) {
+ return window.CDV_ASSETS_URL + path.replace('file://', '/_app_file_');
+ }
+ return path;
+ }
+};
+
+module.exports = WkWebKit;
});
@@ -2104,11 +1825,11 @@ exports.injectScript = function (url, onload, onerror) {
function injectIfNecessary (id, url, onload, onerror) {
onerror = onerror || onload;
- if (id in define.moduleMap) { // eslint-disable-line no-undef
+ if (id in define.moduleMap) {
onload();
} else {
exports.injectScript(url, function () {
- if (id in define.moduleMap) { // eslint-disable-line no-undef
+ if (id in define.moduleMap) {
onload();
} else {
onerror();
@@ -2119,7 +1840,7 @@ function injectIfNecessary (id, url, onload, onerror) {
function onScriptLoadingComplete (moduleList, finishPluginLoading) {
// Loop through all the plugins and then through their clobbers and merges.
- for (var i = 0, module; module = moduleList[i]; i++) { // eslint-disable-line no-cond-assign
+ for (var i = 0, module; (module = moduleList[i]); i++) {
if (module.clobbers && module.clobbers.length) {
for (var j = 0; j < module.clobbers.length; j++) {
modulemapper.clobbers(module.id, module.clobbers[j]);
@@ -2195,53 +1916,6 @@ exports.load = function (callback) {
});
-// file: src/common/pluginloader_b.js
-define("cordova/pluginloader_b", function(require, exports, module) {
-
-var modulemapper = require('cordova/modulemapper');
-
-// Handler for the cordova_plugins.js content.
-// See plugman's plugin_loader.js for the details of this object.
-function handlePluginsObject (moduleList) {
- // if moduleList is not defined or empty, we've nothing to do
- if (!moduleList || !moduleList.length) {
- return;
- }
-
- // Loop through all the modules and then through their clobbers and merges.
- for (var i = 0, module; module = moduleList[i]; i++) { // eslint-disable-line no-cond-assign
- if (module.clobbers && module.clobbers.length) {
- for (var j = 0; j < module.clobbers.length; j++) {
- modulemapper.clobbers(module.id, module.clobbers[j]);
- }
- }
-
- if (module.merges && module.merges.length) {
- for (var k = 0; k < module.merges.length; k++) {
- modulemapper.merges(module.id, module.merges[k]);
- }
- }
-
- // Finally, if runs is truthy we want to simply require() the module.
- if (module.runs) {
- modulemapper.runs(module.id);
- }
- }
-}
-
-// Loads all plugins' js-modules. Plugin loading is syncronous in browserified bundle
-// but the method accepts callback to be compatible with non-browserify flow.
-// onDeviceReady is blocked on onPluginsReady. onPluginsReady is fired when there are
-// no plugins to load, or they are all done.
-exports.load = function (callback) {
- var moduleList = require('cordova/plugin_list');
- handlePluginsObject(moduleList);
-
- callback();
-};
-
-});
-
// file: src/common/urlutil.js
define("cordova/urlutil", function(require, exports, module) {
@@ -2349,10 +2023,11 @@ utils.clone = function (obj) {
retVal = {};
for (i in obj) {
- // https://issues.apache.org/jira/browse/CB-11522 'unknown' type may be returned in
- // custom protocol activation case on Windows Phone 8.1 causing "No such interface supported" exception
- // on cloning.
- if ((!(i in retVal) || retVal[i] !== obj[i]) && typeof obj[i] !== 'undefined' && typeof obj[i] !== 'unknown') { // eslint-disable-line valid-typeof
+ // 'unknown' type may be returned in custom protocol activation case on
+ // Windows Phone 8.1 causing "No such interface supported" exception on
+ // cloning (https://issues.apache.org/jira/browse/CB-11522)
+ // eslint-disable-next-line valid-typeof
+ if ((!(i in retVal) || retVal[i] !== obj[i]) && typeof obj[i] !== 'undefined' && typeof obj[i] !== 'unknown') {
retVal[i] = utils.clone(obj[i]);
}
}
@@ -2402,7 +2077,6 @@ utils.extend = (function () {
var F = function () {};
// extend Child from Parent
return function (Child, Parent) {
-
F.prototype = Parent.prototype;
Child.prototype = new F();
Child.__super__ = Parent.prototype;
@@ -2425,7 +2099,6 @@ utils.alert = function (msg) {
window.cordova = require('cordova');
// file: src/scripts/bootstrap.js
-
require('cordova/init');
-})(); \ No newline at end of file
+})();