Browse Source

cambios en eventos colab y home

Christian Matos 4 years ago
parent
commit
9dc52d00cf
100 changed files with 2150 additions and 3347 deletions
  1. 1
    1
      config.xml
  2. 1
    1
      node_modules/.bin/uuid
  3. 0
    10
      node_modules/cordova-ios/.eslintignore
  4. 0
    10
      node_modules/cordova-ios/.eslintrc.yml
  5. 0
    94
      node_modules/cordova-ios/.gitattributes
  6. 0
    42
      node_modules/cordova-ios/.github/ISSUE_TEMPLATE.md
  7. 0
    50
      node_modules/cordova-ios/.github/ISSUE_TEMPLATE/BUG_REPORT.md
  8. 0
    29
      node_modules/cordova-ios/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
  9. 0
    27
      node_modules/cordova-ios/.github/ISSUE_TEMPLATE/SUPPORT_QUESTION.md
  10. 0
    35
      node_modules/cordova-ios/.github/PULL_REQUEST_TEMPLATE.md
  11. 0
    12
      node_modules/cordova-ios/.ratignore
  12. 0
    37
      node_modules/cordova-ios/.travis.yml
  13. 4
    4
      node_modules/cordova-ios/CONTRIBUTING.md
  14. 0
    4
      node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.h
  15. 15
    14
      node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m
  16. 27
    0
      node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLaunchScreen/CDVLaunchScreen.h
  17. 39
    0
      node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLaunchScreen/CDVLaunchScreen.m
  18. 0
    50
      node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLocalStorage/CDVLocalStorage.h
  19. 0
    493
      node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLocalStorage/CDVLocalStorage.m
  20. 0
    45
      node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.h
  21. 0
    408
      node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.m
  22. 0
    29
      node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewEngine.h
  23. 0
    206
      node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewEngine.m
  24. 0
    33
      node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.h
  25. 0
    157
      node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.m
  26. 29
    0
      node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.h
  27. 607
    0
      node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m
  28. 27
    0
      node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewProcessPoolFactory.h
  29. 49
    0
      node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewProcessPoolFactory.m
  30. 32
    0
      node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.h
  31. 163
    0
      node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.m
  32. 0
    2
      node_modules/cordova-ios/CordovaLib/Classes/Public/CDV.h
  33. 0
    21
      node_modules/cordova-ios/CordovaLib/Classes/Public/CDVAppDelegate.m
  34. 4
    1
      node_modules/cordova-ios/CordovaLib/Classes/Public/CDVAvailability.h
  35. 0
    2
      node_modules/cordova-ios/CordovaLib/Classes/Public/CDVCommandDelegate.h
  36. 1
    6
      node_modules/cordova-ios/CordovaLib/Classes/Public/CDVCommandDelegateImpl.m
  37. 1
    1
      node_modules/cordova-ios/CordovaLib/Classes/Public/CDVPluginResult.m
  38. 0
    5
      node_modules/cordova-ios/CordovaLib/Classes/Public/CDVScreenOrientationDelegate.h
  39. 0
    27
      node_modules/cordova-ios/CordovaLib/Classes/Public/CDVURLProtocol.h
  40. 0
    113
      node_modules/cordova-ios/CordovaLib/Classes/Public/CDVURLProtocol.m
  41. 32
    0
      node_modules/cordova-ios/CordovaLib/Classes/Public/CDVURLSchemeHandler.h
  42. 108
    0
      node_modules/cordova-ios/CordovaLib/Classes/Public/CDVURLSchemeHandler.m
  43. 0
    27
      node_modules/cordova-ios/CordovaLib/Classes/Public/CDVUserAgentUtil.h
  44. 0
    162
      node_modules/cordova-ios/CordovaLib/Classes/Public/CDVUserAgentUtil.m
  45. 4
    19
      node_modules/cordova-ios/CordovaLib/Classes/Public/CDVViewController.h
  46. 86
    83
      node_modules/cordova-ios/CordovaLib/Classes/Public/CDVViewController.m
  47. 0
    1
      node_modules/cordova-ios/CordovaLib/Classes/Public/CDVWebViewEngineProtocol.h
  48. 31
    2
      node_modules/cordova-ios/CordovaLib/Classes/Public/NSDictionary+CordovaPreferences.m
  49. 1
    2
      node_modules/cordova-ios/CordovaLib/Cordova/Cordova.h
  50. 99
    101
      node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
  51. 1
    5
      node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj/xcshareddata/xcschemes/Cordova.xcscheme
  52. 1
    1
      node_modules/cordova-ios/CordovaLib/VERSION
  53. 86
    170
      node_modules/cordova-ios/CordovaLib/cordova.js
  54. 0
    30
      node_modules/cordova-ios/LICENSE
  55. 30
    27
      node_modules/cordova-ios/README.md
  56. 81
    0
      node_modules/cordova-ios/RELEASENOTES.md
  57. 0
    18
      node_modules/cordova-ios/appveyor.yml
  58. 1
    1
      node_modules/cordova-ios/bin/apple_ios_version
  59. 0
    0
      node_modules/cordova-ios/bin/apple_ios_version.bat
  60. 1
    1
      node_modules/cordova-ios/bin/apple_osx_version
  61. 0
    0
      node_modules/cordova-ios/bin/apple_osx_version.bat
  62. 9
    6
      node_modules/cordova-ios/bin/apple_xcode_version
  63. 0
    0
      node_modules/cordova-ios/bin/apple_xcode_version.bat
  64. 1
    1
      node_modules/cordova-ios/bin/check_reqs
  65. 0
    0
      node_modules/cordova-ios/bin/check_reqs.bat
  66. 8
    7
      node_modules/cordova-ios/bin/cordova_plist_to_config_xml
  67. 6
    6
      node_modules/cordova-ios/bin/create
  68. 0
    0
      node_modules/cordova-ios/bin/create.bat
  69. 117
    134
      node_modules/cordova-ios/bin/lib/create.js
  70. 66
    0
      node_modules/cordova-ios/bin/lib/utils.js
  71. 12
    7
      node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/CDVLaunchScreen.storyboard
  72. 0
    36
      node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Classes/MainViewController.m
  73. 15
    0
      node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Images.xcassets/BackgroundColor.colorset/Contents.json
  74. 0
    176
      node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Images.xcassets/LaunchImage.launchimage/Contents.json
  75. BIN
      node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Images.xcassets/LaunchImage.launchimage/Default-2436h.png
  76. BIN
      node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Images.xcassets/LaunchImage.launchimage/Default-568h@2x~iphone.png
  77. BIN
      node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Images.xcassets/LaunchImage.launchimage/Default-667h.png
  78. BIN
      node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Images.xcassets/LaunchImage.launchimage/Default-736h.png
  79. BIN
      node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Images.xcassets/LaunchImage.launchimage/Default-Landscape-2436h.png
  80. BIN
      node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h.png
  81. BIN
      node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Images.xcassets/LaunchImage.launchimage/Default-Landscape@2x~ipad.png
  82. BIN
      node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Images.xcassets/LaunchImage.launchimage/Default-Landscape~ipad.png
  83. BIN
      node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x~ipad.png
  84. BIN
      node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Images.xcassets/LaunchImage.launchimage/Default-Portrait~ipad.png
  85. BIN
      node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Images.xcassets/LaunchImage.launchimage/Default@2x~iphone.png
  86. BIN
      node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Images.xcassets/LaunchImage.launchimage/Default~iphone.png
  87. 6
    6
      node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Images.xcassets/LaunchStoryboard.imageset/Contents.json
  88. 2
    0
      node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/__PROJECT_NAME__-Info.plist
  89. 7
    1
      node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/config.xml
  90. 21
    17
      node_modules/cordova-ios/bin/templates/project/__TEMP__.xcodeproj/project.pbxproj
  91. 1
    1
      node_modules/cordova-ios/bin/templates/project/www/index.html
  92. 180
    197
      node_modules/cordova-ios/bin/templates/scripts/cordova/Api.js
  93. 27
    24
      node_modules/cordova-ios/bin/templates/scripts/cordova/build
  94. 0
    0
      node_modules/cordova-ios/bin/templates/scripts/cordova/build.bat
  95. 12
    9
      node_modules/cordova-ios/bin/templates/scripts/cordova/clean
  96. 0
    0
      node_modules/cordova-ios/bin/templates/scripts/cordova/clean.bat
  97. 7
    1
      node_modules/cordova-ios/bin/templates/scripts/cordova/defaults.xml
  98. 17
    19
      node_modules/cordova-ios/bin/templates/scripts/cordova/lib/BridgingHeader.js
  99. 74
    80
      node_modules/cordova-ios/bin/templates/scripts/cordova/lib/Podfile.js
  100. 0
    0
      node_modules/cordova-ios/bin/templates/scripts/cordova/lib/PodsJson.js

+ 1
- 1
config.xml View File

1
 <?xml version='1.0' encoding='utf-8'?>
1
 <?xml version='1.0' encoding='utf-8'?>
2
 <widget id="io.cordova.hellocordova" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
2
 <widget id="io.cordova.hellocordova" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
3
-    <name>HelloCordova</name>
3
+    <name>ArtesaníasICP</name>
4
     <description>
4
     <description>
5
         A sample Apache Cordova application that responds to the deviceready event.
5
         A sample Apache Cordova application that responds to the deviceready event.
6
     </description>
6
     </description>

+ 1
- 1
node_modules/.bin/uuid View File

1
-../uuid/bin/uuid
1
+../uuid/dist/bin/uuid

+ 0
- 10
node_modules/cordova-ios/.eslintignore View File

1
-bin/node_modules/*
2
-bin/templates/project/*
3
-tests/spec/unit/fixtures/*
4
-CordovaLib/cordova.js
5
-
6
-# Non-JS binaries
7
-bin/test
8
-bin/cordova_plist_to_config_xml
9
-bin/templates/scripts/cordova/log
10
-bin/templates/scripts/cordova/lib/start-emulator

+ 0
- 10
node_modules/cordova-ios/.eslintrc.yml View File

1
-root: true
2
-extends: semistandard
3
-rules:
4
-  indent:
5
-    - error
6
-    - 4
7
-  camelcase: off
8
-  padded-blocks: off
9
-  operator-linebreak: off
10
-  no-throw-literal: off

+ 0
- 94
node_modules/cordova-ios/.gitattributes View File

1
-* text eol=lf
2
-
3
-# source code
4
-*.php text
5
-*.css text
6
-*.sass text
7
-*.scss text
8
-*.less text
9
-*.styl text
10
-*.js text
11
-*.coffee text
12
-*.json text
13
-*.htm text
14
-*.html text
15
-*.xml text
16
-*.svg text
17
-*.txt text
18
-*.ini text
19
-*.inc text
20
-*.pl text
21
-*.rb text
22
-*.py text
23
-*.scm text
24
-*.sql text
25
-*.sh text
26
-*.bat text
27
-
28
-# templates
29
-*.ejs text
30
-*.hbt text
31
-*.jade text
32
-*.haml text
33
-*.hbs text
34
-*.dot text
35
-*.tmpl text
36
-*.phtml text
37
-
38
-# server config
39
-.htaccess text
40
-
41
-# git config
42
-.gitattributes text
43
-.gitignore text
44
-.gitconfig text
45
-
46
-# code analysis config
47
-.jshintrc text
48
-.jscsrc text
49
-.jshintignore text
50
-.csslintrc text
51
-
52
-# misc config
53
-*.yaml text
54
-*.yml text
55
-.editorconfig text
56
-
57
-# build config
58
-*.npmignore text
59
-*.bowerrc text
60
-
61
-# Heroku
62
-Procfile text
63
-.slugignore text
64
-
65
-# Documentation
66
-*.md text
67
-LICENSE text
68
-AUTHORS text
69
-
70
-
71
-#
72
-## These files are binary and should be left untouched
73
-#
74
-
75
-# (binary is a macro for -text -diff)
76
-*.png binary
77
-*.jpg binary
78
-*.jpeg binary
79
-*.gif binary
80
-*.ico binary
81
-*.mov binary
82
-*.mp4 binary
83
-*.mp3 binary
84
-*.flv binary
85
-*.fla binary
86
-*.swf binary
87
-*.gz binary
88
-*.zip binary
89
-*.7z binary
90
-*.ttf binary
91
-*.eot binary
92
-*.woff binary
93
-*.pyc binary
94
-*.pdf binary

+ 0
- 42
node_modules/cordova-ios/.github/ISSUE_TEMPLATE.md View File

1
-<!--
2
-Please have a look at the issue templates you get when you click "New issue" in the GitHub UI.
3
-We very much prefer issues created by using one of these templates.
4
--->
5
-
6
-### Issue Type
7
-<!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
8
-
9
-- [ ] Bug Report
10
-- [ ] Feature Request
11
-- [ ] Support Question
12
-
13
-## Description
14
-
15
-## Information
16
-<!-- Include all relevant information that might help understand and reproduce the problem -->
17
-
18
-### Command or Code
19
-<!-- What command or code is needed to reproduce the problem? -->
20
-
21
-### Environment, Platform, Device
22
-<!-- In what environment, on what platform or on which device are you experiencing the issue? -->
23
-
24
-
25
-
26
-### Version information
27
-<!-- 
28
-What are relevant versions you are using?
29
-For example:
30
-Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins 
31
-Other Frameworks: Ionic Framework and CLI version
32
-Operating System, Android Studio, Xcode etc.
33
--->
34
-
35
-
36
-
37
-## Checklist
38
-<!-- Please check the boxes by putting an `x` in the `[ ]` like so: `[x]` -->
39
-
40
-- [ ] I searched for already existing GitHub issues about this
41
-- [ ] I updated all Cordova tooling to their most recent version
42
-- [ ] I included all the necessary information above

+ 0
- 50
node_modules/cordova-ios/.github/ISSUE_TEMPLATE/BUG_REPORT.md View File

1
----
2
-name: 🐛 Bug Report
3
-about: If something isn't working as expected.
4
-
5
----
6
-
7
-# Bug Report
8
-
9
-## Problem
10
-
11
-### What is expected to happen?
12
-
13
-
14
-
15
-### What does actually happen?
16
-
17
-
18
-
19
-## Information
20
-<!-- Include all relevant information that might help understand and reproduce the problem -->
21
-
22
-
23
-
24
-### Command or Code
25
-<!-- What command or code is needed to reproduce the problem? -->
26
-
27
-
28
-
29
-### Environment, Platform, Device
30
-<!-- In what environment, on what platform or on which device are you experiencing the issue? -->
31
-
32
-
33
-
34
-### Version information
35
-<!-- 
36
-What are relevant versions you are using?
37
-For example:
38
-Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins 
39
-Other Frameworks: Ionic Framework and CLI version
40
-Operating System, Android Studio, Xcode etc.
41
--->
42
-
43
-
44
-
45
-## Checklist
46
-<!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
47
-
48
-- [ ] I searched for existing GitHub issues
49
-- [ ] I updated all Cordova tooling to most recent version
50
-- [ ] I included all the necessary information above

+ 0
- 29
node_modules/cordova-ios/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md View File

1
----
2
-name: 🚀 Feature Request
3
-about: A suggestion for a new functionality
4
-
5
----
6
-
7
-# Feature Request
8
-
9
-## Motivation Behind Feature
10
-<!-- Why should this feature be implemented? What problem does it solve? -->
11
-
12
-
13
-
14
-## Feature Description
15
-<!-- 
16
-Describe your feature request in detail
17
-Please provide any code examples or screenshots of what this feature would look like
18
-Are there any drawbacks? Will this break anything for existing users? 
19
--->
20
-
21
-
22
-
23
-## Alternatives or Workarounds
24
-<!-- 
25
-Describe alternatives or workarounds you are currently using 
26
-Are there ways to do this with existing functionality?
27
--->
28
-
29
-

+ 0
- 27
node_modules/cordova-ios/.github/ISSUE_TEMPLATE/SUPPORT_QUESTION.md View File

1
----
2
-name: 💬 Support Question
3
-about: If you have a question, please check out our Slack or StackOverflow!
4
-
5
----
6
-
7
-<!------------^ Click "Preview" for a nicer view! -->
8
-
9
-Apache Cordova uses GitHub Issues as a feature request and bug tracker _only_.
10
-For usage and support questions, please check out the resources below. Thanks!
11
-
12
----
13
-
14
-You can get answers to your usage and support questions about **Apache Cordova** on:
15
-
16
-* Slack Community Chat: https://cordova.slack.com (you can sign-up at http://slack.cordova.io/)
17
-* StackOverflow: https://stackoverflow.com/questions/tagged/cordova using the tag `cordova`
18
-
19
----
20
-
21
-If you are using a tool that uses Cordova internally, like e.g. Ionic, check their support channels:
22
-
23
-* **Ionic Framework**
24
-  * [Ionic Community Forum](https://forum.ionicframework.com/)
25
-  * [Ionic Worldwide Slack](https://ionicworldwide.herokuapp.com/)
26
-* **PhoneGap**
27
-  * [PhoneGap Developer Community](https://forums.adobe.com/community/phonegap)

+ 0
- 35
node_modules/cordova-ios/.github/PULL_REQUEST_TEMPLATE.md View File

1
-<!--
2
-Please make sure the checklist boxes are all checked before submitting the PR. The checklist is intended as a quick reference, for complete details please see our Contributor Guidelines:
3
-
4
-http://cordova.apache.org/contribute/contribute_guidelines.html
5
-
6
-Thanks!
7
--->
8
-
9
-### Platforms affected
10
-
11
-
12
-
13
-### Motivation and Context
14
-<!-- Why is this change required? What problem does it solve? -->
15
-<!-- If it fixes an open issue, please link to the issue here. -->
16
-
17
-
18
-
19
-### Description
20
-<!-- Describe your changes in detail -->
21
-
22
-
23
-
24
-### Testing
25
-<!-- Please describe in detail how you tested your changes. -->
26
-
27
-
28
-
29
-### Checklist
30
-
31
-- [ ] I've run the tests to see all new and existing tests pass
32
-- [ ] I added automated test coverage as appropriate for this change
33
-- [ ] Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`)
34
-- [ ] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
35
-- [ ] I've updated the documentation if necessary

+ 0
- 12
node_modules/cordova-ios/.ratignore View File

1
-# yes, not .gitignore
2
-gitignore
3
-
4
-# licenses for both below are in the cordova-ios LICENSE file
5
-NSData+Base64.h
6
-NSData+Base64.m
7
-
8
-Contents.json
9
-jasmine.json
10
-fixtures
11
-appveyor.yml
12
-i386

+ 0
- 37
node_modules/cordova-ios/.travis.yml View File

1
-language: objective-c
2
-sudo: false
3
-
4
-matrix:
5
-  include:
6
-    # Run one test with Xcode 9.x, the rest with 10.x
7
-    - osx_image: xcode9.4
8
-      env: TRAVIS_NODE_VERSION=10
9
-    - osx_image: xcode10.3
10
-      env: TRAVIS_NODE_VERSION=6
11
-    - osx_image: xcode10.3
12
-      env: TRAVIS_NODE_VERSION=8
13
-    - osx_image: xcode10.3
14
-      env: TRAVIS_NODE_VERSION=10
15
-    - osx_image: xcode10.3
16
-      env: TRAVIS_NODE_VERSION=12
17
-
18
-before_install:
19
-  - nvm install $TRAVIS_NODE_VERSION
20
-
21
-install:
22
-  - npm install
23
-  - npm install ios-deploy
24
-  - npm install -g codecov
25
-
26
-script:
27
-  - node --version
28
-  - npm --version
29
-  - npm run eslint
30
-  - npm run unit-tests
31
-  - npm run test:component
32
-  - npm run e2e-tests
33
-  - npm run objc-tests
34
-  - npm run cover
35
-
36
-after_script:
37
-  - codecov

+ 4
- 4
node_modules/cordova-ios/CONTRIBUTING.md View File

25
 
25
 
26
 There are multiple ways to contribute: report bugs, improve the docs, and
26
 There are multiple ways to contribute: report bugs, improve the docs, and
27
 contribute code.
27
 contribute code.
28
-
29
-For instructions on this, start with the 
28
+  
29
+For instructions on this, start with the
30
 [contribution overview](http://cordova.apache.org/contribute/).
30
 [contribution overview](http://cordova.apache.org/contribute/).
31
 
31
 
32
 The details are explained there, but the important items are:
32
 The details are explained there, but the important items are:
33
- - Sign and submit an Apache ICLA (Contributor License Agreement).
34
- - Have a Jira issue open that corresponds to your contribution.
33
+ - Check for Github issues that corresponds to your contribution and link or create them if necessary.
35
  - Run the tests so your patch doesn't break existing functionality.
34
  - Run the tests so your patch doesn't break existing functionality.
36
 
35
 
37
 We look forward to your contributions!
36
 We look forward to your contributions!
37
+

+ 0
- 4
node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.h View File

20
 #import <Cordova/CDVPlugin.h>
20
 #import <Cordova/CDVPlugin.h>
21
 #import <Cordova/CDVWhitelist.h>
21
 #import <Cordova/CDVWhitelist.h>
22
 
22
 
23
-#if WK_WEB_VIEW_ONLY
24
 #define CDVWebViewNavigationType int
23
 #define CDVWebViewNavigationType int
25
-#else
26
-#define CDVWebViewNavigationType UIWebViewNavigationType
27
-#endif
28
 
24
 
29
 typedef NS_ENUM(NSInteger, CDVIntentAndNavigationFilterValue) {
25
 typedef NS_ENUM(NSInteger, CDVIntentAndNavigationFilterValue) {
30
     CDVIntentAndNavigationFilterValueIntentAllowed,
26
     CDVIntentAndNavigationFilterValueIntentAllowed,

+ 15
- 14
node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m View File

46
 - (void)parserDidStartDocument:(NSXMLParser*)parser
46
 - (void)parserDidStartDocument:(NSXMLParser*)parser
47
 {
47
 {
48
     // file: url <allow-navigations> are added by default
48
     // file: url <allow-navigations> are added by default
49
-    self.allowNavigations = [[NSMutableArray alloc] initWithArray:@[ @"file://" ]];
49
+    // navigation to the scheme used by the app is also allowed
50
+    self.allowNavigations = [[NSMutableArray alloc] initWithArray:@[ @"file://"]];
51
+
52
+    // If the custom app scheme is defined, append it to the allow navigation as default
53
+    NSString* scheme = ((CDVViewController*)self.viewController).appScheme;
54
+    if (scheme) {
55
+        [self.allowNavigations addObject: [NSString stringWithFormat:@"%@://", scheme]];
56
+    }
57
+
50
     // no intents are added by default
58
     // no intents are added by default
51
     self.allowIntents = [[NSMutableArray alloc] init];
59
     self.allowIntents = [[NSMutableArray alloc] init];
52
 }
60
 }
95
     return [[self class] filterUrl:url intentsWhitelist:self.allowIntentsWhitelist navigationsWhitelist:self.allowNavigationsWhitelist];
103
     return [[self class] filterUrl:url intentsWhitelist:self.allowIntentsWhitelist navigationsWhitelist:self.allowNavigationsWhitelist];
96
 }
104
 }
97
 
105
 
98
-#if WK_WEB_VIEW_ONLY
99
 #define CDVWebViewNavigationTypeLinkClicked 0
106
 #define CDVWebViewNavigationTypeLinkClicked 0
100
-#define CDVWebViewNavigationTypeOther 5
101
-#else
102
-#define CDVWebViewNavigationTypeLinkClicked UIWebViewNavigationTypeLinkClicked
103
-#define CDVWebViewNavigationTypeOther UIWebViewNavigationTypeOther
104
-#endif
107
+#define CDVWebViewNavigationTypeLinkOther -1
105
 
108
 
106
 + (BOOL)shouldOpenURLRequest:(NSURLRequest*)request navigationType:(CDVWebViewNavigationType)navigationType
109
 + (BOOL)shouldOpenURLRequest:(NSURLRequest*)request navigationType:(CDVWebViewNavigationType)navigationType
107
 {
110
 {
108
-    return (CDVWebViewNavigationTypeLinkClicked == navigationType ||
109
-        (CDVWebViewNavigationTypeOther == navigationType &&
110
-         [[request.mainDocumentURL absoluteString] isEqualToString:[request.URL absoluteString]]
111
-         )
112
-        );
111
+    return (
112
+        navigationType == CDVWebViewNavigationTypeLinkClicked ||
113
+        navigationType == CDVWebViewNavigationTypeLinkOther
114
+    );
113
 }
115
 }
114
 
116
 
115
 + (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(CDVWebViewNavigationType)navigationType filterValue:(CDVIntentAndNavigationFilterValue)filterValue
117
 + (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(CDVWebViewNavigationType)navigationType filterValue:(CDVIntentAndNavigationFilterValue)filterValue
123
         case CDVIntentAndNavigationFilterValueNavigationAllowed:
125
         case CDVIntentAndNavigationFilterValueNavigationAllowed:
124
             return YES;
126
             return YES;
125
         case CDVIntentAndNavigationFilterValueIntentAllowed:
127
         case CDVIntentAndNavigationFilterValueIntentAllowed:
126
-            // only allow-intent if it's a UIWebViewNavigationTypeLinkClicked (anchor tag) OR
127
-            // it's a UIWebViewNavigationTypeOther, and it's an internal link
128
+            // only allow-intent if it's a CDVWebViewNavigationTypeLinkClicked (anchor tag) or CDVWebViewNavigationTypeOther and it's an internal link
128
             if ([[self class] shouldOpenURLRequest:request navigationType:navigationType]){
129
             if ([[self class] shouldOpenURLRequest:request navigationType:navigationType]){
129
                 [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
130
                 [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
130
             }
131
             }

+ 27
- 0
node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLaunchScreen/CDVLaunchScreen.h View File

1
+/*
2
+ Licensed to the Apache Software Foundation (ASF) under one
3
+ or more contributor license agreements.  See the NOTICE file
4
+ distributed with this work for additional information
5
+ regarding copyright ownership.  The ASF licenses this file
6
+ to you under the Apache License, Version 2.0 (the
7
+ "License"); you may not use this file except in compliance
8
+ with the License.  You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing,
13
+ software distributed under the License is distributed on an
14
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ KIND, either express or implied.  See the License for the
16
+ specific language governing permissions and limitations
17
+ under the License.
18
+ */
19
+
20
+#import <Cordova/CDVPlugin.h>
21
+
22
+@interface CDVLaunchScreen : CDVPlugin
23
+
24
+- (void)show:(CDVInvokedUrlCommand*)command;
25
+- (void)hide:(CDVInvokedUrlCommand*)command;
26
+
27
+@end

+ 39
- 0
node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLaunchScreen/CDVLaunchScreen.m View File

1
+/*
2
+ Licensed to the Apache Software Foundation (ASF) under one
3
+ or more contributor license agreements.  See the NOTICE file
4
+ distributed with this work for additional information
5
+ regarding copyright ownership.  The ASF licenses this file
6
+ to you under the Apache License, Version 2.0 (the
7
+ "License"); you may not use this file except in compliance
8
+ with the License.  You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing,
13
+ software distributed under the License is distributed on an
14
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ KIND, either express or implied.  See the License for the
16
+ specific language governing permissions and limitations
17
+ under the License.
18
+ */
19
+
20
+#import "CDVLaunchScreen.h"
21
+#import <Cordova/CDVViewController.h>
22
+
23
+@implementation CDVLaunchScreen
24
+
25
+- (void)show:(CDVInvokedUrlCommand*)command
26
+{
27
+    if ([self.viewController isKindOfClass:[CDVViewController class]]) {
28
+        [(CDVViewController*)self.viewController showLaunchScreen:YES];
29
+    }
30
+}
31
+
32
+- (void)hide:(CDVInvokedUrlCommand*)command
33
+{
34
+    if ([self.viewController isKindOfClass:[CDVViewController class]]) {
35
+        [(CDVViewController*)self.viewController showLaunchScreen:NO];
36
+    }
37
+}
38
+
39
+@end

+ 0
- 50
node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLocalStorage/CDVLocalStorage.h View File

1
-/*
2
- Licensed to the Apache Software Foundation (ASF) under one
3
- or more contributor license agreements.  See the NOTICE file
4
- distributed with this work for additional information
5
- regarding copyright ownership.  The ASF licenses this file
6
- to you under the Apache License, Version 2.0 (the
7
- "License"); you may not use this file except in compliance
8
- with the License.  You may obtain a copy of the License at
9
-
10
- http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- Unless required by applicable law or agreed to in writing,
13
- software distributed under the License is distributed on an
14
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- KIND, either express or implied.  See the License for the
16
- specific language governing permissions and limitations
17
- under the License.
18
- */
19
-
20
-#import <Cordova/CDVPlugin.h>
21
-
22
-#define kCDVLocalStorageErrorDomain @"kCDVLocalStorageErrorDomain"
23
-#define kCDVLocalStorageFileOperationError 1
24
-
25
-@interface CDVLocalStorage : CDVPlugin
26
-
27
-@property (nonatomic, readonly, strong) NSMutableArray* backupInfo;
28
-
29
-- (BOOL)shouldBackup;
30
-- (BOOL)shouldRestore;
31
-- (void)backup:(CDVInvokedUrlCommand*)command;
32
-- (void)restore:(CDVInvokedUrlCommand*)command;
33
-
34
-+ (void)__fixupDatabaseLocationsWithBackupType:(NSString*)backupType;
35
-// Visible for testing.
36
-+ (BOOL)__verifyAndFixDatabaseLocationsWithAppPlistDict:(NSMutableDictionary*)appPlistDict
37
-                                             bundlePath:(NSString*)bundlePath
38
-                                            fileManager:(NSFileManager*)fileManager;
39
-@end
40
-
41
-@interface CDVBackupInfo : NSObject
42
-
43
-@property (nonatomic, copy) NSString* original;
44
-@property (nonatomic, copy) NSString* backup;
45
-@property (nonatomic, copy) NSString* label;
46
-
47
-- (BOOL)shouldBackup;
48
-- (BOOL)shouldRestore;
49
-
50
-@end

+ 0
- 493
node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLocalStorage/CDVLocalStorage.m View File

1
-/*
2
- Licensed to the Apache Software Foundation (ASF) under one
3
- or more contributor license agreements.  See the NOTICE file
4
- distributed with this work for additional information
5
- regarding copyright ownership.  The ASF licenses this file
6
- to you under the Apache License, Version 2.0 (the
7
- "License"); you may not use this file except in compliance
8
- with the License.  You may obtain a copy of the License at
9
-
10
- http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- Unless required by applicable law or agreed to in writing,
13
- software distributed under the License is distributed on an
14
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- KIND, either express or implied.  See the License for the
16
- specific language governing permissions and limitations
17
- under the License.
18
- */
19
-
20
-#import "CDVLocalStorage.h"
21
-#import <Cordova/CDV.h>
22
-
23
-@interface CDVLocalStorage ()
24
-
25
-@property (nonatomic, readwrite, strong) NSMutableArray* backupInfo;  // array of CDVBackupInfo objects
26
-#if !WK_WEB_VIEW_ONLY
27
-@property (nonatomic, readwrite, weak) id <UIWebViewDelegate> webviewDelegate;
28
-#endif
29
-
30
-@end
31
-
32
-@implementation CDVLocalStorage
33
-
34
-#if WK_WEB_VIEW_ONLY
35
-@synthesize backupInfo;
36
-#else
37
-@synthesize backupInfo, webviewDelegate;
38
-#endif
39
-
40
-- (void)pluginInitialize
41
-{
42
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onResignActive)
43
-                                                 name:UIApplicationWillResignActiveNotification object:nil];
44
-    BOOL cloudBackup = [@"cloud" isEqualToString : self.commandDelegate.settings[[@"BackupWebStorage" lowercaseString]]];
45
-
46
-    self.backupInfo = [[self class] createBackupInfoWithCloudBackup:cloudBackup];
47
-}
48
-
49
-#pragma mark -
50
-#pragma mark Plugin interface methods
51
-
52
-+ (NSMutableArray*)createBackupInfoWithTargetDir:(NSString*)targetDir backupDir:(NSString*)backupDir targetDirNests:(BOOL)targetDirNests backupDirNests:(BOOL)backupDirNests rename:(BOOL)rename
53
-{
54
-    /*
55
-     This "helper" does so much work and has so many options it would probably be clearer to refactor the whole thing.
56
-     Basically, there are three database locations:
57
-
58
-     1. "Normal" dir -- LIB/<nested dires WebKit/LocalStorage etc>/<normal filenames>
59
-     2. "Caches" dir -- LIB/Caches/<normal filenames>
60
-     3. "Backup" dir -- DOC/Backups/<renamed filenames>
61
-
62
-     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".
63
-     */
64
-    NSMutableArray* backupInfo = [NSMutableArray arrayWithCapacity:3];
65
-
66
-    NSString* original;
67
-    NSString* backup;
68
-    CDVBackupInfo* backupItem;
69
-
70
-    // ////////// LOCALSTORAGE
71
-
72
-    original = [targetDir stringByAppendingPathComponent:targetDirNests ? @"WebKit/LocalStorage/file__0.localstorage":@"file__0.localstorage"];
73
-    backup = [backupDir stringByAppendingPathComponent:(backupDirNests ? @"WebKit/LocalStorage" : @"")];
74
-    backup = [backup stringByAppendingPathComponent:(rename ? @"localstorage.appdata.db" : @"file__0.localstorage")];
75
-
76
-    backupItem = [[CDVBackupInfo alloc] init];
77
-    backupItem.backup = backup;
78
-    backupItem.original = original;
79
-    backupItem.label = @"localStorage database";
80
-
81
-    [backupInfo addObject:backupItem];
82
-
83
-    // ////////// WEBSQL MAIN DB
84
-
85
-    original = [targetDir stringByAppendingPathComponent:targetDirNests ? @"WebKit/LocalStorage/Databases.db":@"Databases.db"];
86
-    backup = [backupDir stringByAppendingPathComponent:(backupDirNests ? @"WebKit/LocalStorage" : @"")];
87
-    backup = [backup stringByAppendingPathComponent:(rename ? @"websqlmain.appdata.db" : @"Databases.db")];
88
-
89
-    backupItem = [[CDVBackupInfo alloc] init];
90
-    backupItem.backup = backup;
91
-    backupItem.original = original;
92
-    backupItem.label = @"websql main database";
93
-
94
-    [backupInfo addObject:backupItem];
95
-
96
-    // ////////// WEBSQL DATABASES
97
-
98
-    original = [targetDir stringByAppendingPathComponent:targetDirNests ? @"WebKit/LocalStorage/file__0":@"file__0"];
99
-    backup = [backupDir stringByAppendingPathComponent:(backupDirNests ? @"WebKit/LocalStorage" : @"")];
100
-    backup = [backup stringByAppendingPathComponent:(rename ? @"websqldbs.appdata.db" : @"file__0")];
101
-
102
-    backupItem = [[CDVBackupInfo alloc] init];
103
-    backupItem.backup = backup;
104
-    backupItem.original = original;
105
-    backupItem.label = @"websql databases";
106
-
107
-    [backupInfo addObject:backupItem];
108
-
109
-    return backupInfo;
110
-}
111
-
112
-+ (NSMutableArray*)createBackupInfoWithCloudBackup:(BOOL)cloudBackup
113
-{
114
-    // create backup info from backup folder to caches folder
115
-    NSString* appLibraryFolder = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) objectAtIndex:0];
116
-    NSString* appDocumentsFolder = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
117
-    NSString* cacheFolder = [appLibraryFolder stringByAppendingPathComponent:@"Caches"];
118
-    NSString* backupsFolder = [appDocumentsFolder stringByAppendingPathComponent:@"Backups"];
119
-
120
-    // create the backups folder, if needed
121
-    [[NSFileManager defaultManager] createDirectoryAtPath:backupsFolder withIntermediateDirectories:YES attributes:nil error:nil];
122
-
123
-    [self addSkipBackupAttributeToItemAtURL:[NSURL fileURLWithPath:backupsFolder] skip:!cloudBackup];
124
-
125
-    return [self createBackupInfoWithTargetDir:cacheFolder backupDir:backupsFolder targetDirNests:NO backupDirNests:NO rename:YES];
126
-}
127
-
128
-+ (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL*)URL skip:(BOOL)skip
129
-{
130
-    NSError* error = nil;
131
-    BOOL success = [URL setResourceValue:[NSNumber numberWithBool:skip] forKey:NSURLIsExcludedFromBackupKey error:&error];
132
-
133
-    if (!success) {
134
-        NSLog(@"Error excluding %@ from backup %@", [URL lastPathComponent], error);
135
-    }
136
-    return success;
137
-}
138
-
139
-+ (BOOL)copyFrom:(NSString*)src to:(NSString*)dest error:(NSError* __autoreleasing*)error
140
-{
141
-    NSFileManager* fileManager = [NSFileManager defaultManager];
142
-
143
-    if (![fileManager fileExistsAtPath:src]) {
144
-        NSString* errorString = [NSString stringWithFormat:@"%@ file does not exist.", src];
145
-        if (error != NULL) {
146
-            (*error) = [NSError errorWithDomain:kCDVLocalStorageErrorDomain
147
-                                           code:kCDVLocalStorageFileOperationError
148
-                                       userInfo:[NSDictionary dictionaryWithObject:errorString
149
-                                                                            forKey:NSLocalizedDescriptionKey]];
150
-        }
151
-        return NO;
152
-    }
153
-
154
-    // generate unique filepath in temp directory
155
-    CFUUIDRef uuidRef = CFUUIDCreate(kCFAllocatorDefault);
156
-    CFStringRef uuidString = CFUUIDCreateString(kCFAllocatorDefault, uuidRef);
157
-    NSString* tempBackup = [[NSTemporaryDirectory() stringByAppendingPathComponent:(__bridge NSString*)uuidString] stringByAppendingPathExtension:@"bak"];
158
-    CFRelease(uuidString);
159
-    CFRelease(uuidRef);
160
-
161
-    BOOL destExists = [fileManager fileExistsAtPath:dest];
162
-
163
-    // backup the dest
164
-    if (destExists && ![fileManager copyItemAtPath:dest toPath:tempBackup error:error]) {
165
-        return NO;
166
-    }
167
-
168
-    // remove the dest
169
-    if (destExists && ![fileManager removeItemAtPath:dest error:error]) {
170
-        return NO;
171
-    }
172
-
173
-    // create path to dest
174
-    if (!destExists && ![fileManager createDirectoryAtPath:[dest stringByDeletingLastPathComponent] withIntermediateDirectories:YES attributes:nil error:error]) {
175
-        return NO;
176
-    }
177
-
178
-    // copy src to dest
179
-    if ([fileManager copyItemAtPath:src toPath:dest error:error]) {
180
-        // success - cleanup - delete the backup to the dest
181
-        if ([fileManager fileExistsAtPath:tempBackup]) {
182
-            [fileManager removeItemAtPath:tempBackup error:error];
183
-        }
184
-        return YES;
185
-    } else {
186
-        // failure - we restore the temp backup file to dest
187
-        [fileManager copyItemAtPath:tempBackup toPath:dest error:error];
188
-        // cleanup - delete the backup to the dest
189
-        if ([fileManager fileExistsAtPath:tempBackup]) {
190
-            [fileManager removeItemAtPath:tempBackup error:error];
191
-        }
192
-        return NO;
193
-    }
194
-}
195
-
196
-- (BOOL)shouldBackup
197
-{
198
-    for (CDVBackupInfo* info in self.backupInfo) {
199
-        if ([info shouldBackup]) {
200
-            return YES;
201
-        }
202
-    }
203
-
204
-    return NO;
205
-}
206
-
207
-- (BOOL)shouldRestore
208
-{
209
-    for (CDVBackupInfo* info in self.backupInfo) {
210
-        if ([info shouldRestore]) {
211
-            return YES;
212
-        }
213
-    }
214
-
215
-    return NO;
216
-}
217
-
218
-/* copy from webkitDbLocation to persistentDbLocation */
219
-- (void)backup:(CDVInvokedUrlCommand*)command
220
-{
221
-    NSString* callbackId = command.callbackId;
222
-
223
-    NSError* __autoreleasing error = nil;
224
-    CDVPluginResult* result = nil;
225
-    NSString* message = nil;
226
-
227
-    for (CDVBackupInfo* info in self.backupInfo) {
228
-        if ([info shouldBackup]) {
229
-            [[self class] copyFrom:info.original to:info.backup error:&error];
230
-
231
-            if (callbackId) {
232
-                if (error == nil) {
233
-                    message = [NSString stringWithFormat:@"Backed up: %@", info.label];
234
-                    NSLog(@"%@", message);
235
-
236
-                    result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:message];
237
-                    [self.commandDelegate sendPluginResult:result callbackId:callbackId];
238
-                } else {
239
-                    message = [NSString stringWithFormat:@"Error in CDVLocalStorage (%@) backup: %@", info.label, [error localizedDescription]];
240
-                    NSLog(@"%@", message);
241
-
242
-                    result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:message];
243
-                    [self.commandDelegate sendPluginResult:result callbackId:callbackId];
244
-                }
245
-            }
246
-        }
247
-    }
248
-}
249
-
250
-/* copy from persistentDbLocation to webkitDbLocation */
251
-- (void)restore:(CDVInvokedUrlCommand*)command
252
-{
253
-    NSError* __autoreleasing error = nil;
254
-    CDVPluginResult* result = nil;
255
-    NSString* message = nil;
256
-
257
-    for (CDVBackupInfo* info in self.backupInfo) {
258
-        if ([info shouldRestore]) {
259
-            [[self class] copyFrom:info.backup to:info.original error:&error];
260
-
261
-            if (error == nil) {
262
-                message = [NSString stringWithFormat:@"Restored: %@", info.label];
263
-                NSLog(@"%@", message);
264
-
265
-                result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:message];
266
-                [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
267
-            } else {
268
-                message = [NSString stringWithFormat:@"Error in CDVLocalStorage (%@) restore: %@", info.label, [error localizedDescription]];
269
-                NSLog(@"%@", message);
270
-
271
-                result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:message];
272
-                [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
273
-            }
274
-        }
275
-    }
276
-}
277
-
278
-+ (void)__fixupDatabaseLocationsWithBackupType:(NSString*)backupType
279
-{
280
-    [self __verifyAndFixDatabaseLocations];
281
-    [self __restoreLegacyDatabaseLocationsWithBackupType:backupType];
282
-}
283
-
284
-+ (void)__verifyAndFixDatabaseLocations
285
-{
286
-    NSBundle* mainBundle = [NSBundle mainBundle];
287
-    NSString* bundlePath = [[mainBundle bundlePath] stringByDeletingLastPathComponent];
288
-    NSString* bundleIdentifier = [[mainBundle infoDictionary] objectForKey:@"CFBundleIdentifier"];
289
-    NSString* appPlistPath = [bundlePath stringByAppendingPathComponent:[NSString stringWithFormat:@"Library/Preferences/%@.plist", bundleIdentifier]];
290
-
291
-    NSMutableDictionary* appPlistDict = [NSMutableDictionary dictionaryWithContentsOfFile:appPlistPath];
292
-    BOOL modified = [[self class] __verifyAndFixDatabaseLocationsWithAppPlistDict:appPlistDict
293
-                                                                       bundlePath:bundlePath
294
-                                                                      fileManager:[NSFileManager defaultManager]];
295
-
296
-    if (modified) {
297
-        BOOL ok = [appPlistDict writeToFile:appPlistPath atomically:YES];
298
-        [[NSUserDefaults standardUserDefaults] synchronize];
299
-        NSLog(@"Fix applied for database locations?: %@", ok ? @"YES" : @"NO");
300
-    }
301
-}
302
-
303
-+ (BOOL)__verifyAndFixDatabaseLocationsWithAppPlistDict:(NSMutableDictionary*)appPlistDict
304
-                                             bundlePath:(NSString*)bundlePath
305
-                                            fileManager:(NSFileManager*)fileManager
306
-{
307
-    NSString* libraryCaches = @"Library/Caches";
308
-    NSString* libraryWebKit = @"Library/WebKit";
309
-
310
-    NSArray* keysToCheck = [NSArray arrayWithObjects:
311
-        @"WebKitLocalStorageDatabasePathPreferenceKey",
312
-        @"WebDatabaseDirectory",
313
-        nil];
314
-
315
-    BOOL dirty = NO;
316
-
317
-    for (NSString* key in keysToCheck) {
318
-        NSString* value = [appPlistDict objectForKey:key];
319
-        // verify key exists, and path is in app bundle, if not - fix
320
-        if ((value != nil) && ![value hasPrefix:bundlePath]) {
321
-            // the pathSuffix to use may be wrong - OTA upgrades from < 5.1 to 5.1 do keep the old path Library/WebKit,
322
-            // while Xcode synced ones do change the storage location to Library/Caches
323
-            NSString* newBundlePath = [bundlePath stringByAppendingPathComponent:libraryCaches];
324
-            if (![fileManager fileExistsAtPath:newBundlePath]) {
325
-                newBundlePath = [bundlePath stringByAppendingPathComponent:libraryWebKit];
326
-            }
327
-            [appPlistDict setValue:newBundlePath forKey:key];
328
-            dirty = YES;
329
-        }
330
-    }
331
-
332
-    return dirty;
333
-}
334
-
335
-+ (void)__restoreLegacyDatabaseLocationsWithBackupType:(NSString*)backupType
336
-{
337
-    // 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.
338
-    NSString* appLibraryFolder = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) objectAtIndex:0];
339
-    NSString* appDocumentsFolder = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
340
-
341
-    NSMutableArray* backupInfo = [NSMutableArray arrayWithCapacity:0];
342
-
343
-    if ([backupType isEqualToString:@"cloud"]) {
344
-#ifdef DEBUG
345
-            NSLog(@"\n\nStarted backup to iCloud! Please be careful."
346
-                "\nYour application might be rejected by Apple if you store too much data."
347
-                "\nFor more information please read \"iOS Data Storage Guidelines\" at:"
348
-                "\nhttps://developer.apple.com/icloud/documentation/data-storage/"
349
-                "\nTo disable web storage backup to iCloud, set the BackupWebStorage preference to \"local\" in the Cordova config.xml file\n\n");
350
-#endif
351
-        // We would like to restore old backups/caches databases to the new destination (nested in lib folder)
352
-        [backupInfo addObjectsFromArray:[self createBackupInfoWithTargetDir:appLibraryFolder backupDir:[appDocumentsFolder stringByAppendingPathComponent:@"Backups"] targetDirNests:YES backupDirNests:NO rename:YES]];
353
-        [backupInfo addObjectsFromArray:[self createBackupInfoWithTargetDir:appLibraryFolder backupDir:[appLibraryFolder stringByAppendingPathComponent:@"Caches"] targetDirNests:YES backupDirNests:NO rename:NO]];
354
-    } else {
355
-        // 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.
356
-        [backupInfo addObjectsFromArray:[self createBackupInfoWithTargetDir:[appLibraryFolder stringByAppendingPathComponent:@"Caches"] backupDir:appLibraryFolder targetDirNests:NO backupDirNests:YES rename:NO]];
357
-    }
358
-
359
-    NSFileManager* manager = [NSFileManager defaultManager];
360
-
361
-    for (CDVBackupInfo* info in backupInfo) {
362
-        if ([manager fileExistsAtPath:info.backup]) {
363
-            if ([info shouldRestore]) {
364
-                NSLog(@"Restoring old webstorage backup. From: '%@' To: '%@'.", info.backup, info.original);
365
-                [self copyFrom:info.backup to:info.original error:nil];
366
-            }
367
-            NSLog(@"Removing old webstorage backup: '%@'.", info.backup);
368
-            [manager removeItemAtPath:info.backup error:nil];
369
-        }
370
-    }
371
-
372
-    [[NSUserDefaults standardUserDefaults] setBool:[backupType isEqualToString:@"cloud"] forKey:@"WebKitStoreWebDataForBackup"];
373
-}
374
-
375
-#pragma mark -
376
-#pragma mark Notification handlers
377
-
378
-- (void)onResignActive
379
-{
380
-    UIDevice* device = [UIDevice currentDevice];
381
-    NSNumber* exitsOnSuspend = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UIApplicationExitsOnSuspend"];
382
-
383
-    BOOL isMultitaskingSupported = [device respondsToSelector:@selector(isMultitaskingSupported)] && [device isMultitaskingSupported];
384
-
385
-    if (exitsOnSuspend == nil) { // if it's missing, it should be NO (i.e. multi-tasking on by default)
386
-        exitsOnSuspend = [NSNumber numberWithBool:NO];
387
-    }
388
-
389
-    if (exitsOnSuspend) {
390
-        [self backup:nil];
391
-    } else if (isMultitaskingSupported) {
392
-        __block UIBackgroundTaskIdentifier backgroundTaskID = UIBackgroundTaskInvalid;
393
-
394
-        backgroundTaskID = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{
395
-                [[UIApplication sharedApplication] endBackgroundTask:backgroundTaskID];
396
-                backgroundTaskID = UIBackgroundTaskInvalid;
397
-                NSLog(@"Background task to backup WebSQL/LocalStorage expired.");
398
-            }];
399
-        CDVLocalStorage __weak* weakSelf = self;
400
-        [self.commandDelegate runInBackground:^{
401
-            [weakSelf backup:nil];
402
-
403
-            [[UIApplication sharedApplication] endBackgroundTask:backgroundTaskID];
404
-            backgroundTaskID = UIBackgroundTaskInvalid;
405
-        }];
406
-    }
407
-}
408
-
409
-- (void)onAppTerminate
410
-{
411
-    [self onResignActive];
412
-}
413
-
414
-- (void)onReset
415
-{
416
-    [self restore:nil];
417
-}
418
-
419
-@end
420
-
421
-#pragma mark -
422
-#pragma mark CDVBackupInfo implementation
423
-
424
-@implementation CDVBackupInfo
425
-
426
-@synthesize original, backup, label;
427
-
428
-- (BOOL)file:(NSString*)aPath isNewerThanFile:(NSString*)bPath
429
-{
430
-    NSFileManager* fileManager = [NSFileManager defaultManager];
431
-    NSError* __autoreleasing error = nil;
432
-
433
-    NSDictionary* aPathAttribs = [fileManager attributesOfItemAtPath:aPath error:&error];
434
-    NSDictionary* bPathAttribs = [fileManager attributesOfItemAtPath:bPath error:&error];
435
-
436
-    NSDate* aPathModDate = [aPathAttribs objectForKey:NSFileModificationDate];
437
-    NSDate* bPathModDate = [bPathAttribs objectForKey:NSFileModificationDate];
438
-
439
-    if ((nil == aPathModDate) && (nil == bPathModDate)) {
440
-        return NO;
441
-    }
442
-
443
-    return [aPathModDate compare:bPathModDate] == NSOrderedDescending || bPathModDate == nil;
444
-}
445
-
446
-- (BOOL)item:(NSString*)aPath isNewerThanItem:(NSString*)bPath
447
-{
448
-    NSFileManager* fileManager = [NSFileManager defaultManager];
449
-
450
-    BOOL aPathIsDir = NO, bPathIsDir = NO;
451
-    BOOL aPathExists = [fileManager fileExistsAtPath:aPath isDirectory:&aPathIsDir];
452
-
453
-    [fileManager fileExistsAtPath:bPath isDirectory:&bPathIsDir];
454
-
455
-    if (!aPathExists) {
456
-        return NO;
457
-    }
458
-
459
-    if (!(aPathIsDir && bPathIsDir)) { // just a file
460
-        return [self file:aPath isNewerThanFile:bPath];
461
-    }
462
-
463
-    // essentially we want rsync here, but have to settle for our poor man's implementation
464
-    // we get the files in aPath, and see if it is newer than the file in bPath
465
-    // (it is newer if it doesn't exist in bPath) if we encounter the FIRST file that is newer,
466
-    // we return YES
467
-    NSDirectoryEnumerator* directoryEnumerator = [fileManager enumeratorAtPath:aPath];
468
-    NSString* path;
469
-
470
-    while ((path = [directoryEnumerator nextObject])) {
471
-        NSString* aPathFile = [aPath stringByAppendingPathComponent:path];
472
-        NSString* bPathFile = [bPath stringByAppendingPathComponent:path];
473
-
474
-        BOOL isNewer = [self file:aPathFile isNewerThanFile:bPathFile];
475
-        if (isNewer) {
476
-            return YES;
477
-        }
478
-    }
479
-
480
-    return NO;
481
-}
482
-
483
-- (BOOL)shouldBackup
484
-{
485
-    return [self item:self.original isNewerThanItem:self.backup];
486
-}
487
-
488
-- (BOOL)shouldRestore
489
-{
490
-    return [self item:self.backup isNewerThanItem:self.original];
491
-}
492
-
493
-@end

+ 0
- 45
node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.h View File

1
-/*
2
- Licensed to the Apache Software Foundation (ASF) under one
3
- or more contributor license agreements.  See the NOTICE file
4
- distributed with this work for additional information
5
- regarding copyright ownership.  The ASF licenses this file
6
- to you under the Apache License, Version 2.0 (the
7
- "License"); you may not use this file except in compliance
8
- with the License.  You may obtain a copy of the License at
9
-
10
- http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- Unless required by applicable law or agreed to in writing,
13
- software distributed under the License is distributed on an
14
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- KIND, either express or implied.  See the License for the
16
- specific language governing permissions and limitations
17
- under the License.
18
- */
19
-
20
-#if !WK_WEB_VIEW_ONLY
21
-
22
-#import <UIKit/UIKit.h>
23
-#import <Cordova/CDVAvailability.h>
24
-
25
-/**
26
- * Distinguishes top-level navigations from sub-frame navigations.
27
- * shouldStartLoadWithRequest is called for every request, but didStartLoad
28
- * and didFinishLoad is called only for top-level navigations.
29
- * Relevant bug: CB-2389
30
- */
31
-@interface CDVUIWebViewDelegate : NSObject <UIWebViewDelegate>{
32
-    __weak NSObject <UIWebViewDelegate>* _delegate;
33
-    NSInteger _loadCount;
34
-    NSInteger _state;
35
-    NSInteger _curLoadToken;
36
-    NSInteger _loadStartPollCount;
37
-}
38
-
39
-- (id)initWithDelegate:(NSObject <UIWebViewDelegate>*)delegate;
40
-
41
-- (BOOL)request:(NSURLRequest*)newRequest isEqualToRequestAfterStrippingFragments:(NSURLRequest*)originalRequest;
42
-
43
-@end
44
-
45
-#endif

+ 0
- 408
node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.m View File

1
-/*
2
- Licensed to the Apache Software Foundation (ASF) under one
3
- or more contributor license agreements.  See the NOTICE file
4
- distributed with this work for additional information
5
- regarding copyright ownership.  The ASF licenses this file
6
- to you under the Apache License, Version 2.0 (the
7
- "License"); you may not use this file except in compliance
8
- with the License.  You may obtain a copy of the License at
9
-
10
- http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- Unless required by applicable law or agreed to in writing,
13
- software distributed under the License is distributed on an
14
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- KIND, either express or implied.  See the License for the
16
- specific language governing permissions and limitations
17
- under the License.
18
- */
19
-
20
-//
21
-// Testing shows:
22
-//
23
-// In all cases, webView.request.URL is the previous page's URL (or empty) during the didStartLoad callback.
24
-// When loading a page with a redirect:
25
-// 1. shouldStartLoading (requestURL is target page)
26
-// 2. didStartLoading
27
-// 3. shouldStartLoading (requestURL is redirect target)
28
-// 4. didFinishLoad (request.URL is redirect target)
29
-//
30
-// Note the lack of a second didStartLoading **
31
-//
32
-// When loading a page with iframes:
33
-// 1. shouldStartLoading (requestURL is main page)
34
-// 2. didStartLoading
35
-// 3. shouldStartLoading (requestURL is one of the iframes)
36
-// 4. didStartLoading
37
-// 5. didFinishLoad
38
-// 6. didFinishLoad
39
-//
40
-// Note there is no way to distinguish which didFinishLoad maps to which didStartLoad **
41
-//
42
-// Loading a page by calling window.history.go(-1):
43
-// 1. didStartLoading
44
-// 2. didFinishLoad
45
-//
46
-// Note the lack of a shouldStartLoading call **
47
-// Actually - this is fixed on iOS6. iOS6 has a shouldStart. **
48
-//
49
-// Loading a page by calling location.reload()
50
-// 1. shouldStartLoading
51
-// 2. didStartLoading
52
-// 3. didFinishLoad
53
-//
54
-// Loading a page with an iframe that fails to load:
55
-// 1. shouldStart (main page)
56
-// 2. didStart
57
-// 3. shouldStart (iframe)
58
-// 4. didStart
59
-// 5. didFailWithError
60
-// 6. didFinish
61
-//
62
-// Loading a page with an iframe that fails to load due to an invalid URL:
63
-// 1. shouldStart (main page)
64
-// 2. didStart
65
-// 3. shouldStart (iframe)
66
-// 5. didFailWithError
67
-// 6. didFinish
68
-//
69
-// This case breaks our logic since there is a missing didStart. To prevent this,
70
-// we check URLs in shouldStart and return NO if they are invalid.
71
-//
72
-// Loading a page with an invalid URL
73
-// 1. shouldStart (main page)
74
-// 2. didFailWithError
75
-//
76
-// TODO: Record order when page is re-navigated before the first navigation finishes.
77
-//
78
-
79
-#if !WK_WEB_VIEW_ONLY
80
-
81
-#import "CDVUIWebViewDelegate.h"
82
-
83
-// #define VerboseLog NSLog
84
-#define VerboseLog(...) do { \
85
-} while (0)
86
-
87
-typedef enum {
88
-    STATE_IDLE = 0,
89
-    STATE_WAITING_FOR_LOAD_START = 1,
90
-    STATE_WAITING_FOR_LOAD_FINISH = 2,
91
-    STATE_IOS5_POLLING_FOR_LOAD_START = 3,
92
-    STATE_IOS5_POLLING_FOR_LOAD_FINISH = 4,
93
-    STATE_CANCELLED = 5
94
-} State;
95
-
96
-static NSString *stripFragment(NSString* url)
97
-{
98
-    NSRange r = [url rangeOfString:@"#"];
99
-
100
-    if (r.location == NSNotFound) {
101
-        return url;
102
-    }
103
-    return [url substringToIndex:r.location];
104
-}
105
-
106
-@implementation CDVUIWebViewDelegate
107
-
108
-- (id)initWithDelegate:(NSObject <UIWebViewDelegate>*)delegate
109
-{
110
-    self = [super init];
111
-    if (self != nil) {
112
-        _delegate = delegate;
113
-        _loadCount = -1;
114
-        _state = STATE_IDLE;
115
-    }
116
-    return self;
117
-}
118
-
119
-- (BOOL)request:(NSURLRequest*)newRequest isEqualToRequestAfterStrippingFragments:(NSURLRequest*)originalRequest
120
-{
121
-    if (originalRequest.URL && newRequest.URL) {
122
-        NSString* originalRequestUrl = [originalRequest.URL absoluteString];
123
-        NSString* newRequestUrl = [newRequest.URL absoluteString];
124
-
125
-        NSString* baseOriginalRequestUrl = stripFragment(originalRequestUrl);
126
-        NSString* baseNewRequestUrl = stripFragment(newRequestUrl);
127
-        return [baseOriginalRequestUrl isEqualToString:baseNewRequestUrl];
128
-    }
129
-
130
-    return NO;
131
-}
132
-
133
-- (BOOL)isPageLoaded:(UIWebView*)webView
134
-{
135
-    NSString* readyState = [webView stringByEvaluatingJavaScriptFromString:@"document.readyState"];
136
-
137
-    return [readyState isEqualToString:@"loaded"] || [readyState isEqualToString:@"complete"];
138
-}
139
-
140
-- (BOOL)isJsLoadTokenSet:(UIWebView*)webView
141
-{
142
-    NSString* loadToken = [webView stringByEvaluatingJavaScriptFromString:@"window.__cordovaLoadToken"];
143
-
144
-    return [[NSString stringWithFormat:@"%ld", (long)_curLoadToken] isEqualToString:loadToken];
145
-}
146
-
147
-- (void)setLoadToken:(UIWebView*)webView
148
-{
149
-    _curLoadToken += 1;
150
-    [webView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"window.__cordovaLoadToken=%ld", (long)_curLoadToken]];
151
-}
152
-
153
-- (NSString*)evalForCurrentURL:(UIWebView*)webView
154
-{
155
-    return [webView stringByEvaluatingJavaScriptFromString:@"location.href"];
156
-}
157
-
158
-- (void)pollForPageLoadStart:(UIWebView*)webView
159
-{
160
-    if (_state != STATE_IOS5_POLLING_FOR_LOAD_START) {
161
-        return;
162
-    }
163
-    if (![self isJsLoadTokenSet:webView]) {
164
-        VerboseLog(@"Polled for page load start. result = YES!");
165
-        _state = STATE_IOS5_POLLING_FOR_LOAD_FINISH;
166
-        [self setLoadToken:webView];
167
-        if ([_delegate respondsToSelector:@selector(webViewDidStartLoad:)]) {
168
-            [_delegate webViewDidStartLoad:webView];
169
-        }
170
-        [self pollForPageLoadFinish:webView];
171
-    } else {
172
-        VerboseLog(@"Polled for page load start. result = NO");
173
-        // Poll only for 1 second, and then fall back on checking only when delegate methods are called.
174
-        ++_loadStartPollCount;
175
-        if (_loadStartPollCount < (1000 * .05)) {
176
-            [self performSelector:@selector(pollForPageLoadStart:) withObject:webView afterDelay:.05];
177
-        }
178
-    }
179
-}
180
-
181
-- (void)pollForPageLoadFinish:(UIWebView*)webView
182
-{
183
-    if (_state != STATE_IOS5_POLLING_FOR_LOAD_FINISH) {
184
-        return;
185
-    }
186
-    if ([self isPageLoaded:webView]) {
187
-        VerboseLog(@"Polled for page load finish. result = YES!");
188
-        _state = STATE_IDLE;
189
-        if ([_delegate respondsToSelector:@selector(webViewDidFinishLoad:)]) {
190
-            [_delegate webViewDidFinishLoad:webView];
191
-        }
192
-    } else {
193
-        VerboseLog(@"Polled for page load finish. result = NO");
194
-        [self performSelector:@selector(pollForPageLoadFinish:) withObject:webView afterDelay:.05];
195
-    }
196
-}
197
-
198
-- (BOOL)shouldLoadRequest:(NSURLRequest*)request
199
-{
200
-    NSString* scheme = [[request URL] scheme];
201
-    NSArray* allowedSchemes = [NSArray arrayWithObjects:@"mailto",@"tel",@"blob",@"sms",@"data", nil];
202
-    if([allowedSchemes containsObject:scheme]) {
203
-        return YES;
204
-    }
205
-    else {
206
-        return [NSURLConnection canHandleRequest:request];
207
-    }
208
-}
209
-
210
-- (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
211
-{
212
-    BOOL shouldLoad = YES;
213
-
214
-    if ([_delegate respondsToSelector:@selector(webView:shouldStartLoadWithRequest:navigationType:)]) {
215
-        shouldLoad = [_delegate webView:webView shouldStartLoadWithRequest:request navigationType:navigationType];
216
-    }
217
-
218
-    VerboseLog(@"webView shouldLoad=%d (before) state=%d loadCount=%d URL=%@", shouldLoad, _state, _loadCount, request.URL);
219
-
220
-    if (shouldLoad) {
221
-        // When devtools refresh occurs, it blindly uses the same request object. If a history.replaceState() has occured, then
222
-        // mainDocumentURL != URL even though it's a top-level navigation.
223
-        BOOL isDevToolsRefresh = (request == webView.request);
224
-        BOOL isTopLevelNavigation = isDevToolsRefresh || [request.URL isEqual:[request mainDocumentURL]];
225
-        if (isTopLevelNavigation) {
226
-            // Ignore hash changes that don't navigate to a different page.
227
-            // webView.request does actually update when history.replaceState() gets called.
228
-            if ([self request:request isEqualToRequestAfterStrippingFragments:webView.request]) {
229
-                NSString* prevURL = [self evalForCurrentURL:webView];
230
-                if ([prevURL isEqualToString:[request.URL absoluteString]]) {
231
-                    VerboseLog(@"Page reload detected.");
232
-                } else {
233
-                    VerboseLog(@"Detected hash change shouldLoad");
234
-                    return shouldLoad;
235
-                }
236
-            }
237
-
238
-            switch (_state) {
239
-                case STATE_WAITING_FOR_LOAD_FINISH:
240
-                    // Redirect case.
241
-                    // We expect loadCount == 1.
242
-                    if (_loadCount != 1) {
243
-                        NSLog(@"CDVWebViewDelegate: Detected redirect when loadCount=%ld", (long)_loadCount);
244
-                    }
245
-                    break;
246
-
247
-                case STATE_IDLE:
248
-                case STATE_IOS5_POLLING_FOR_LOAD_START:
249
-                case STATE_CANCELLED:
250
-                    // Page navigation start.
251
-                    _loadCount = 0;
252
-                    _state = STATE_WAITING_FOR_LOAD_START;
253
-                    break;
254
-
255
-                default:
256
-                    {
257
-                        NSString* description = [NSString stringWithFormat:@"CDVWebViewDelegate: Navigation started when state=%ld", (long)_state];
258
-                        NSLog(@"%@", description);
259
-                        _loadCount = 0;
260
-                        _state = STATE_WAITING_FOR_LOAD_START;
261
-
262
-                        NSDictionary* errorDictionary = @{NSLocalizedDescriptionKey : description};
263
-                        NSError* error = [[NSError alloc] initWithDomain:@"CDVUIWebViewDelegate" code:1 userInfo:errorDictionary];
264
-                        [self webView:webView didFailLoadWithError:error];
265
-                    }
266
-            }
267
-        } else {
268
-            // Deny invalid URLs so that we don't get the case where we go straight from
269
-            // webViewShouldLoad -> webViewDidFailLoad (messes up _loadCount).
270
-            shouldLoad = shouldLoad && [self shouldLoadRequest:request];
271
-        }
272
-        VerboseLog(@"webView shouldLoad=%d (after) isTopLevelNavigation=%d state=%d loadCount=%d", shouldLoad, isTopLevelNavigation, _state, _loadCount);
273
-    }
274
-    return shouldLoad;
275
-}
276
-
277
-- (void)webViewDidStartLoad:(UIWebView*)webView
278
-{
279
-    VerboseLog(@"webView didStartLoad (before). state=%d loadCount=%d", _state, _loadCount);
280
-    BOOL fireCallback = NO;
281
-    switch (_state) {
282
-        case STATE_IDLE:
283
-            break;
284
-
285
-        case STATE_CANCELLED:
286
-            fireCallback = YES;
287
-            _state = STATE_WAITING_FOR_LOAD_FINISH;
288
-            _loadCount += 1;
289
-            break;
290
-
291
-        case STATE_WAITING_FOR_LOAD_START:
292
-            if (_loadCount != 0) {
293
-                NSLog(@"CDVWebViewDelegate: Unexpected loadCount in didStart. count=%ld", (long)_loadCount);
294
-            }
295
-            fireCallback = YES;
296
-            _state = STATE_WAITING_FOR_LOAD_FINISH;
297
-            _loadCount = 1;
298
-            break;
299
-
300
-        case STATE_WAITING_FOR_LOAD_FINISH:
301
-            _loadCount += 1;
302
-            break;
303
-
304
-        case STATE_IOS5_POLLING_FOR_LOAD_START:
305
-            [self pollForPageLoadStart:webView];
306
-            break;
307
-
308
-        case STATE_IOS5_POLLING_FOR_LOAD_FINISH:
309
-            [self pollForPageLoadFinish:webView];
310
-            break;
311
-
312
-        default:
313
-            NSLog(@"CDVWebViewDelegate: Unexpected didStart with state=%ld loadCount=%ld", (long)_state, (long)_loadCount);
314
-    }
315
-    VerboseLog(@"webView didStartLoad (after). state=%d loadCount=%d fireCallback=%d", _state, _loadCount, fireCallback);
316
-    if (fireCallback && [_delegate respondsToSelector:@selector(webViewDidStartLoad:)]) {
317
-        [_delegate webViewDidStartLoad:webView];
318
-    }
319
-}
320
-
321
-- (void)webViewDidFinishLoad:(UIWebView*)webView
322
-{
323
-    VerboseLog(@"webView didFinishLoad (before). state=%d loadCount=%d", _state, _loadCount);
324
-    BOOL fireCallback = NO;
325
-    switch (_state) {
326
-        case STATE_IDLE:
327
-            break;
328
-
329
-        case STATE_WAITING_FOR_LOAD_START:
330
-            NSLog(@"CDVWebViewDelegate: Unexpected didFinish while waiting for load start.");
331
-            break;
332
-
333
-        case STATE_WAITING_FOR_LOAD_FINISH:
334
-            // fix call loadRequest multiple times just callback webViewDidFinishLoad once time in iOS 12
335
-            if (@available(iOS 12.0, *)) {
336
-                fireCallback = YES;
337
-            } else {
338
-                if (_loadCount == 1) {
339
-                    fireCallback = YES;
340
-                    _state = STATE_IDLE;
341
-                }
342
-            }
343
-            _loadCount -= 1;
344
-            break;
345
-
346
-        case STATE_IOS5_POLLING_FOR_LOAD_START:
347
-            [self pollForPageLoadStart:webView];
348
-            break;
349
-
350
-        case STATE_IOS5_POLLING_FOR_LOAD_FINISH:
351
-            [self pollForPageLoadFinish:webView];
352
-            break;
353
-    }
354
-    VerboseLog(@"webView didFinishLoad (after). state=%d loadCount=%d fireCallback=%d", _state, _loadCount, fireCallback);
355
-    if (fireCallback && [_delegate respondsToSelector:@selector(webViewDidFinishLoad:)]) {
356
-        [_delegate webViewDidFinishLoad:webView];
357
-    }
358
-}
359
-
360
-- (void)webView:(UIWebView*)webView didFailLoadWithError:(NSError*)error
361
-{
362
-    VerboseLog(@"webView didFailLoad (before). state=%d loadCount=%d", _state, _loadCount);
363
-    BOOL fireCallback = NO;
364
-
365
-    switch (_state) {
366
-        case STATE_IDLE:
367
-            break;
368
-
369
-        case STATE_WAITING_FOR_LOAD_START:
370
-            if ([error code] == NSURLErrorCancelled) {
371
-                _state = STATE_CANCELLED;
372
-            } else {
373
-                _state = STATE_IDLE;
374
-            }
375
-            fireCallback = YES;
376
-            break;
377
-
378
-        case STATE_WAITING_FOR_LOAD_FINISH:
379
-            if ([error code] != NSURLErrorCancelled) {
380
-                if (_loadCount == 1) {
381
-                    _state = STATE_IDLE;
382
-                    fireCallback = YES;
383
-                }
384
-                _loadCount = -1;
385
-            } else {
386
-                fireCallback = YES;
387
-                _state = STATE_CANCELLED;
388
-                _loadCount -= 1;
389
-            }
390
-            break;
391
-
392
-        case STATE_IOS5_POLLING_FOR_LOAD_START:
393
-            [self pollForPageLoadStart:webView];
394
-            break;
395
-
396
-        case STATE_IOS5_POLLING_FOR_LOAD_FINISH:
397
-            [self pollForPageLoadFinish:webView];
398
-            break;
399
-    }
400
-    VerboseLog(@"webView didFailLoad (after). state=%d loadCount=%d, fireCallback=%d", _state, _loadCount, fireCallback);
401
-    if (fireCallback && [_delegate respondsToSelector:@selector(webView:didFailLoadWithError:)]) {
402
-        [_delegate webView:webView didFailLoadWithError:error];
403
-    }
404
-}
405
-
406
-@end
407
-
408
-#endif

+ 0
- 29
node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewEngine.h View File

1
-/*
2
- Licensed to the Apache Software Foundation (ASF) under one
3
- or more contributor license agreements.  See the NOTICE file
4
- distributed with this work for additional information
5
- regarding copyright ownership.  The ASF licenses this file
6
- to you under the Apache License, Version 2.0 (the
7
- "License"); you may not use this file except in compliance
8
- with the License.  You may obtain a copy of the License at
9
-
10
- http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- Unless required by applicable law or agreed to in writing,
13
- software distributed under the License is distributed on an
14
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- KIND, either express or implied.  See the License for the
16
- specific language governing permissions and limitations
17
- under the License.
18
- */
19
-
20
-#import <Cordova/CDVPlugin.h>
21
-#import <Cordova/CDVWebViewEngineProtocol.h>
22
-
23
-@interface CDVUIWebViewEngine : CDVPlugin <CDVWebViewEngineProtocol>
24
-
25
-#if !WK_WEB_VIEW_ONLY
26
-@property (nonatomic, strong, readonly) id <UIWebViewDelegate> uiWebViewDelegate;
27
-#endif
28
-
29
-@end

+ 0
- 206
node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewEngine.m View File

1
-/*
2
- Licensed to the Apache Software Foundation (ASF) under one
3
- or more contributor license agreements.  See the NOTICE file
4
- distributed with this work for additional information
5
- regarding copyright ownership.  The ASF licenses this file
6
- to you under the Apache License, Version 2.0 (the
7
- "License"); you may not use this file except in compliance
8
- with the License.  You may obtain a copy of the License at
9
-
10
- http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- Unless required by applicable law or agreed to in writing,
13
- software distributed under the License is distributed on an
14
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- KIND, either express or implied.  See the License for the
16
- specific language governing permissions and limitations
17
- under the License.
18
- */
19
-
20
-#if !WK_WEB_VIEW_ONLY
21
-
22
-#import "CDVUIWebViewEngine.h"
23
-#import "CDVUIWebViewDelegate.h"
24
-#import "CDVUIWebViewNavigationDelegate.h"
25
-#import "NSDictionary+CordovaPreferences.h"
26
-
27
-#import <objc/message.h>
28
-
29
-@interface CDVUIWebViewEngine ()
30
-
31
-@property (nonatomic, strong, readwrite) UIView* engineWebView;
32
-@property (nonatomic, strong, readwrite) id <UIWebViewDelegate> uiWebViewDelegate;
33
-@property (nonatomic, strong, readwrite) CDVUIWebViewNavigationDelegate* navWebViewDelegate;
34
-
35
-@end
36
-
37
-@implementation CDVUIWebViewEngine
38
-
39
-@synthesize engineWebView = _engineWebView;
40
-
41
-- (instancetype)initWithFrame:(CGRect)frame
42
-{
43
-    self = [super init];
44
-    if (self) {
45
-        self.engineWebView = [[UIWebView alloc] initWithFrame:frame];
46
-        NSLog(@"Using UIWebView");
47
-    }
48
-
49
-    return self;
50
-}
51
-
52
-- (void)pluginInitialize
53
-{
54
-    // viewController would be available now. we attempt to set all possible delegates to it, by default
55
-
56
-    UIWebView* uiWebView = (UIWebView*)_engineWebView;
57
-
58
-    if ([self.viewController conformsToProtocol:@protocol(UIWebViewDelegate)]) {
59
-        self.uiWebViewDelegate = [[CDVUIWebViewDelegate alloc] initWithDelegate:(id <UIWebViewDelegate>)self.viewController];
60
-        uiWebView.delegate = self.uiWebViewDelegate;
61
-    } else {
62
-        self.navWebViewDelegate = [[CDVUIWebViewNavigationDelegate alloc] initWithEnginePlugin:self];
63
-        self.uiWebViewDelegate = [[CDVUIWebViewDelegate alloc] initWithDelegate:self.navWebViewDelegate];
64
-        uiWebView.delegate = self.uiWebViewDelegate;
65
-    }
66
-
67
-    [self updateSettings:self.commandDelegate.settings];
68
-}
69
-
70
-- (void)evaluateJavaScript:(NSString*)javaScriptString completionHandler:(void (^)(id, NSError*))completionHandler
71
-{
72
-    NSString* ret = [(UIWebView*)_engineWebView stringByEvaluatingJavaScriptFromString:javaScriptString];
73
-
74
-    if (completionHandler) {
75
-        completionHandler(ret, nil);
76
-    }
77
-}
78
-
79
-- (id)loadRequest:(NSURLRequest*)request
80
-{
81
-    [(UIWebView*)_engineWebView loadRequest:request];
82
-    return nil;
83
-}
84
-
85
-- (id)loadHTMLString:(NSString*)string baseURL:(NSURL*)baseURL
86
-{
87
-    [(UIWebView*)_engineWebView loadHTMLString:string baseURL:baseURL];
88
-    return nil;
89
-}
90
-
91
-- (NSURL*)URL
92
-{
93
-    return [[(UIWebView*)_engineWebView request] URL];
94
-}
95
-
96
-- (BOOL) canLoadRequest:(NSURLRequest*)request
97
-{
98
-    return (request != nil);
99
-}
100
-
101
-- (void)updateSettings:(NSDictionary*)settings
102
-{
103
-    UIWebView* uiWebView = (UIWebView*)_engineWebView;
104
-
105
-    uiWebView.scalesPageToFit = [settings cordovaBoolSettingForKey:@"EnableViewportScale" defaultValue:NO];
106
-    uiWebView.allowsInlineMediaPlayback = [settings cordovaBoolSettingForKey:@"AllowInlineMediaPlayback" defaultValue:NO];
107
-    uiWebView.mediaPlaybackRequiresUserAction = [settings cordovaBoolSettingForKey:@"MediaPlaybackRequiresUserAction" defaultValue:YES];
108
-    uiWebView.mediaPlaybackAllowsAirPlay = [settings cordovaBoolSettingForKey:@"MediaPlaybackAllowsAirPlay" defaultValue:YES];
109
-    uiWebView.keyboardDisplayRequiresUserAction = [settings cordovaBoolSettingForKey:@"KeyboardDisplayRequiresUserAction" defaultValue:YES];
110
-    uiWebView.suppressesIncrementalRendering = [settings cordovaBoolSettingForKey:@"SuppressesIncrementalRendering" defaultValue:NO];
111
-    uiWebView.gapBetweenPages = [settings cordovaFloatSettingForKey:@"GapBetweenPages" defaultValue:0.0];
112
-    uiWebView.pageLength = [settings cordovaFloatSettingForKey:@"PageLength" defaultValue:0.0];
113
-
114
-    id prefObj = nil;
115
-
116
-    // By default, DisallowOverscroll is false (thus bounce is allowed)
117
-    BOOL bounceAllowed = !([settings cordovaBoolSettingForKey:@"DisallowOverscroll" defaultValue:NO]);
118
-
119
-    // prevent webView from bouncing
120
-    if (!bounceAllowed) {
121
-        if ([uiWebView respondsToSelector:@selector(scrollView)]) {
122
-            ((UIScrollView*)[uiWebView scrollView]).bounces = NO;
123
-        } else {
124
-            for (id subview in self.webView.subviews) {
125
-                if ([[subview class] isSubclassOfClass:[UIScrollView class]]) {
126
-                    ((UIScrollView*)subview).bounces = NO;
127
-                }
128
-            }
129
-        }
130
-    }
131
-
132
-    NSString* decelerationSetting = [settings cordovaSettingForKey:@"UIWebViewDecelerationSpeed"];
133
-    if (![@"fast" isEqualToString:decelerationSetting]) {
134
-        [uiWebView.scrollView setDecelerationRate:UIScrollViewDecelerationRateNormal];
135
-    }
136
-
137
-    NSInteger paginationBreakingMode = 0; // default - UIWebPaginationBreakingModePage
138
-    prefObj = [settings cordovaSettingForKey:@"PaginationBreakingMode"];
139
-    if (prefObj != nil) {
140
-        NSArray* validValues = @[@"page", @"column"];
141
-        NSString* prefValue = [validValues objectAtIndex:0];
142
-
143
-        if ([prefObj isKindOfClass:[NSString class]]) {
144
-            prefValue = prefObj;
145
-        }
146
-
147
-        paginationBreakingMode = [validValues indexOfObject:[prefValue lowercaseString]];
148
-        if (paginationBreakingMode == NSNotFound) {
149
-            paginationBreakingMode = 0;
150
-        }
151
-    }
152
-    uiWebView.paginationBreakingMode = paginationBreakingMode;
153
-
154
-    NSInteger paginationMode = 0; // default - UIWebPaginationModeUnpaginated
155
-    prefObj = [settings cordovaSettingForKey:@"PaginationMode"];
156
-    if (prefObj != nil) {
157
-        NSArray* validValues = @[@"unpaginated", @"lefttoright", @"toptobottom", @"bottomtotop", @"righttoleft"];
158
-        NSString* prefValue = [validValues objectAtIndex:0];
159
-
160
-        if ([prefObj isKindOfClass:[NSString class]]) {
161
-            prefValue = prefObj;
162
-        }
163
-
164
-        paginationMode = [validValues indexOfObject:[prefValue lowercaseString]];
165
-        if (paginationMode == NSNotFound) {
166
-            paginationMode = 0;
167
-        }
168
-    }
169
-    uiWebView.paginationMode = paginationMode;
170
-}
171
-
172
-- (void)updateWithInfo:(NSDictionary*)info
173
-{
174
-    UIWebView* uiWebView = (UIWebView*)_engineWebView;
175
-
176
-    id <UIWebViewDelegate> uiWebViewDelegate = [info objectForKey:kCDVWebViewEngineUIWebViewDelegate];
177
-    NSDictionary* settings = [info objectForKey:kCDVWebViewEngineWebViewPreferences];
178
-
179
-    if (uiWebViewDelegate &&
180
-        [uiWebViewDelegate conformsToProtocol:@protocol(UIWebViewDelegate)]) {
181
-        self.uiWebViewDelegate = [[CDVUIWebViewDelegate alloc] initWithDelegate:(id <UIWebViewDelegate>)uiWebViewDelegate];
182
-        uiWebView.delegate = self.uiWebViewDelegate;
183
-    }
184
-
185
-    if (settings && [settings isKindOfClass:[NSDictionary class]]) {
186
-        [self updateSettings:settings];
187
-    }
188
-}
189
-
190
-// This forwards the methods that are in the header that are not implemented here.
191
-// Both WKWebView and UIWebView implement the below:
192
-//     loadHTMLString:baseURL:
193
-//     loadRequest:
194
-- (id)forwardingTargetForSelector:(SEL)aSelector
195
-{
196
-    return _engineWebView;
197
-}
198
-
199
-- (UIView*)webView
200
-{
201
-    return self.engineWebView;
202
-}
203
-
204
-@end
205
-
206
-#endif

+ 0
- 33
node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.h View File

1
-/*
2
- Licensed to the Apache Software Foundation (ASF) under one
3
- or more contributor license agreements.  See the NOTICE file
4
- distributed with this work for additional information
5
- regarding copyright ownership.  The ASF licenses this file
6
- to you under the Apache License, Version 2.0 (the
7
- "License"); you may not use this file except in compliance
8
- with the License.  You may obtain a copy of the License at
9
-
10
- http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- Unless required by applicable law or agreed to in writing,
13
- software distributed under the License is distributed on an
14
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- KIND, either express or implied.  See the License for the
16
- specific language governing permissions and limitations
17
- under the License.
18
- */
19
-
20
-#if !WK_WEB_VIEW_ONLY
21
-
22
-#import <UIKit/UIKit.h>
23
-#import "CDVUIWebViewEngine.h"
24
-
25
-@interface CDVUIWebViewNavigationDelegate : NSObject <UIWebViewDelegate>
26
-
27
-@property (nonatomic, weak) CDVPlugin* enginePlugin;
28
-
29
-- (instancetype)initWithEnginePlugin:(CDVPlugin*)enginePlugin;
30
-
31
-@end
32
-
33
-#endif

+ 0
- 157
node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.m View File

1
-/*
2
- Licensed to the Apache Software Foundation (ASF) under one
3
- or more contributor license agreements.  See the NOTICE file
4
- distributed with this work for additional information
5
- regarding copyright ownership.  The ASF licenses this file
6
- to you under the Apache License, Version 2.0 (the
7
- "License"); you may not use this file except in compliance
8
- with the License.  You may obtain a copy of the License at
9
-
10
- http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- Unless required by applicable law or agreed to in writing,
13
- software distributed under the License is distributed on an
14
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- KIND, either express or implied.  See the License for the
16
- specific language governing permissions and limitations
17
- under the License.
18
- */
19
-
20
-#if !WK_WEB_VIEW_ONLY
21
-
22
-#import "CDVUIWebViewNavigationDelegate.h"
23
-#import <Cordova/CDVViewController.h>
24
-#import <Cordova/CDVCommandDelegateImpl.h>
25
-#import <Cordova/CDVUserAgentUtil.h>
26
-#import <objc/message.h>
27
-
28
-@implementation CDVUIWebViewNavigationDelegate
29
-
30
-- (instancetype)initWithEnginePlugin:(CDVPlugin*)theEnginePlugin
31
-{
32
-    self = [super init];
33
-    if (self) {
34
-        self.enginePlugin = theEnginePlugin;
35
-    }
36
-
37
-    return self;
38
-}
39
-
40
-/**
41
- When web application loads Add stuff to the DOM, mainly the user-defined settings from the Settings.plist file, and
42
- the device's data such as device ID, platform version, etc.
43
- */
44
-- (void)webViewDidStartLoad:(UIWebView*)theWebView
45
-{
46
-    NSLog(@"Resetting plugins due to page load.");
47
-    CDVViewController* vc = (CDVViewController*)self.enginePlugin.viewController;
48
-
49
-    [vc.commandQueue resetRequestId];
50
-    [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginResetNotification object:self.enginePlugin.webView]];
51
-}
52
-
53
-/**
54
- Called when the webview finishes loading.  This stops the activity view.
55
- */
56
-- (void)webViewDidFinishLoad:(UIWebView*)theWebView
57
-{
58
-    NSLog(@"Finished load of: %@", theWebView.request.URL);
59
-    CDVViewController* vc = (CDVViewController*)self.enginePlugin.viewController;
60
-
61
-    // It's safe to release the lock even if this is just a sub-frame that's finished loading.
62
-    [CDVUserAgentUtil releaseLock:vc.userAgentLockToken];
63
-
64
-    /*
65
-     * Hide the Top Activity THROBBER in the Battery Bar
66
-     */
67
-    [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
68
-
69
-    [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPageDidLoadNotification object:self.enginePlugin.webView]];
70
-}
71
-
72
-- (void)webView:(UIWebView*)theWebView didFailLoadWithError:(NSError*)error
73
-{
74
-    CDVViewController* vc = (CDVViewController*)self.enginePlugin.viewController;
75
-
76
-    [CDVUserAgentUtil releaseLock:vc.userAgentLockToken];
77
-
78
-    NSString* message = [NSString stringWithFormat:@"Failed to load webpage with error: %@", [error localizedDescription]];
79
-    NSLog(@"%@", message);
80
-
81
-    NSURL* errorUrl = vc.errorURL;
82
-    if (errorUrl) {
83
-        errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [message stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLPathAllowedCharacterSet]] relativeToURL:errorUrl];
84
-        NSLog(@"%@", [errorUrl absoluteString]);
85
-        if(error.code != NSURLErrorCancelled) {
86
-            [theWebView loadRequest:[NSURLRequest requestWithURL:errorUrl]];
87
-        }
88
-    }
89
-}
90
-
91
-- (BOOL)defaultResourcePolicyForURL:(NSURL*)url
92
-{
93
-    /*
94
-     * If a URL is being loaded that's a file url, just load it internally
95
-     */
96
-    if ([url isFileURL]) {
97
-        return YES;
98
-    }
99
-
100
-    return NO;
101
-}
102
-
103
-- (BOOL)webView:(UIWebView*)theWebView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
104
-{
105
-    NSURL* url = [request URL];
106
-    CDVViewController* vc = (CDVViewController*)self.enginePlugin.viewController;
107
-
108
-    /*
109
-     * Execute any commands queued with cordova.exec() on the JS side.
110
-     * The part of the URL after gap:// is irrelevant.
111
-     */
112
-    if ([[url scheme] isEqualToString:@"gap"]) {
113
-        [vc.commandQueue fetchCommandsFromJs];
114
-        // The delegate is called asynchronously in this case, so we don't have to use
115
-        // flushCommandQueueWithDelayedJs (setTimeout(0)) as we do with hash changes.
116
-        [vc.commandQueue executePending];
117
-        return NO;
118
-    }
119
-
120
-    /*
121
-     * Give plugins the chance to handle the url
122
-     */
123
-    BOOL anyPluginsResponded = NO;
124
-    BOOL shouldAllowRequest = NO;
125
-
126
-    for (NSString* pluginName in vc.pluginObjects) {
127
-        CDVPlugin* plugin = [vc.pluginObjects objectForKey:pluginName];
128
-        SEL selector = NSSelectorFromString(@"shouldOverrideLoadWithRequest:navigationType:");
129
-        if ([plugin respondsToSelector:selector]) {
130
-            anyPluginsResponded = YES;
131
-            shouldAllowRequest = (((BOOL (*)(id, SEL, id, int))objc_msgSend)(plugin, selector, request, navigationType));
132
-            if (!shouldAllowRequest) {
133
-                break;
134
-            }
135
-        }
136
-    }
137
-
138
-    if (anyPluginsResponded) {
139
-        return shouldAllowRequest;
140
-    }
141
-
142
-    /*
143
-     * Handle all other types of urls (tel:, sms:), and requests to load a url in the main webview.
144
-     */
145
-    BOOL shouldAllowNavigation = [self defaultResourcePolicyForURL:url];
146
-    if (shouldAllowNavigation) {
147
-        return YES;
148
-    } else {
149
-        [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]];
150
-    }
151
-
152
-    return NO;
153
-}
154
-
155
-@end
156
-
157
-#endif

+ 29
- 0
node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.h View File

1
+/*
2
+ Licensed to the Apache Software Foundation (ASF) under one
3
+ or more contributor license agreements.  See the NOTICE file
4
+ distributed with this work for additional information
5
+ regarding copyright ownership.  The ASF licenses this file
6
+ to you under the Apache License, Version 2.0 (the
7
+ "License"); you may not use this file except in compliance
8
+ with the License.  You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing,
13
+ software distributed under the License is distributed on an
14
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ KIND, either express or implied.  See the License for the
16
+ specific language governing permissions and limitations
17
+ under the License.
18
+ */
19
+
20
+#import <WebKit/WebKit.h>
21
+#import <Cordova/CDV.h>
22
+
23
+@interface CDVWebViewEngine : CDVPlugin <CDVWebViewEngineProtocol, WKScriptMessageHandler, WKNavigationDelegate>
24
+
25
+@property (nonatomic, strong, readonly) id <WKUIDelegate> uiDelegate;
26
+
27
+- (void)allowsBackForwardNavigationGestures:(CDVInvokedUrlCommand*)command;
28
+
29
+@end

+ 607
- 0
node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m View File

1
+/*
2
+ Licensed to the Apache Software Foundation (ASF) under one
3
+ or more contributor license agreements.  See the NOTICE file
4
+ distributed with this work for additional information
5
+ regarding copyright ownership.  The ASF licenses this file
6
+ to you under the Apache License, Version 2.0 (the
7
+ "License"); you may not use this file except in compliance
8
+ with the License.  You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing,
13
+ software distributed under the License is distributed on an
14
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ KIND, either express or implied.  See the License for the
16
+ specific language governing permissions and limitations
17
+ under the License.
18
+ */
19
+
20
+#import "CDVWebViewEngine.h"
21
+#import "CDVWebViewUIDelegate.h"
22
+#import "CDVWebViewProcessPoolFactory.h"
23
+#import <Cordova/NSDictionary+CordovaPreferences.h>
24
+#import "CDVURLSchemeHandler.h"
25
+
26
+#import <objc/message.h>
27
+
28
+#define CDV_BRIDGE_NAME @"cordova"
29
+#define CDV_WKWEBVIEW_FILE_URL_LOAD_SELECTOR @"loadFileURL:allowingReadAccessToURL:"
30
+
31
+@interface CDVWebViewWeakScriptMessageHandler : NSObject <WKScriptMessageHandler>
32
+
33
+@property (nonatomic, weak, readonly) id<WKScriptMessageHandler>scriptMessageHandler;
34
+
35
+- (instancetype)initWithScriptMessageHandler:(id<WKScriptMessageHandler>)scriptMessageHandler;
36
+
37
+@end
38
+
39
+
40
+@interface CDVWebViewEngine ()
41
+
42
+@property (nonatomic, strong, readwrite) UIView* engineWebView;
43
+@property (nonatomic, strong, readwrite) id <WKUIDelegate> uiDelegate;
44
+@property (nonatomic, weak) id <WKScriptMessageHandler> weakScriptMessageHandler;
45
+@property (nonatomic, strong) CDVURLSchemeHandler * schemeHandler;
46
+@property (nonatomic, readwrite) NSString *CDV_ASSETS_URL;
47
+@property (nonatomic, readwrite) Boolean cdvIsFileScheme;
48
+
49
+@end
50
+
51
+// see forwardingTargetForSelector: selector comment for the reason for this pragma
52
+#pragma clang diagnostic ignored "-Wprotocol"
53
+
54
+@implementation CDVWebViewEngine
55
+
56
+@synthesize engineWebView = _engineWebView;
57
+
58
+- (instancetype)initWithFrame:(CGRect)frame
59
+{
60
+    self = [super init];
61
+    if (self) {
62
+        if (NSClassFromString(@"WKWebView") == nil) {
63
+            return nil;
64
+        }
65
+
66
+        self.engineWebView = [[WKWebView alloc] initWithFrame:frame];
67
+    }
68
+
69
+    return self;
70
+}
71
+
72
+- (WKWebViewConfiguration*) createConfigurationFromSettings:(NSDictionary*)settings
73
+{
74
+    WKWebViewConfiguration* configuration = [[WKWebViewConfiguration alloc] init];
75
+    configuration.processPool = [[CDVWebViewProcessPoolFactory sharedFactory] sharedProcessPool];
76
+    if (settings == nil) {
77
+        return configuration;
78
+    }
79
+
80
+    configuration.allowsInlineMediaPlayback = [settings cordovaBoolSettingForKey:@"AllowInlineMediaPlayback" defaultValue:NO];
81
+
82
+    // Set the media types that are required for user action for playback
83
+    WKAudiovisualMediaTypes mediaType = WKAudiovisualMediaTypeAll; // default
84
+
85
+    // targetMediaType will always exist, either from user's "config.xml" or default ("defaults.xml").
86
+    id targetMediaType = [settings cordovaSettingForKey:@"MediaTypesRequiringUserActionForPlayback"];
87
+    if ([targetMediaType isEqualToString:@"none"]) {
88
+        mediaType = WKAudiovisualMediaTypeNone;
89
+    } else if ([targetMediaType isEqualToString:@"audio"]) {
90
+        mediaType = WKAudiovisualMediaTypeAudio;
91
+    } else if ([targetMediaType isEqualToString:@"video"]) {
92
+        mediaType = WKAudiovisualMediaTypeVideo;
93
+    } else if ([targetMediaType isEqualToString:@"all"]) {
94
+        mediaType = WKAudiovisualMediaTypeAll;
95
+    } else {
96
+        NSLog(@"Invalid \"MediaTypesRequiringUserActionForPlayback\" was detected. Fallback to default value of \"all\" types.");
97
+    }
98
+    configuration.mediaTypesRequiringUserActionForPlayback = mediaType;
99
+
100
+    configuration.suppressesIncrementalRendering = [settings cordovaBoolSettingForKey:@"SuppressesIncrementalRendering" defaultValue:NO];
101
+
102
+    /*
103
+     * If the old preference key "MediaPlaybackAllowsAirPlay" exists, use it or default to "YES".
104
+     * Check if the new preference key "AllowsAirPlayForMediaPlayback" exists and overwrite the "MediaPlaybackAllowsAirPlay" value.
105
+     */
106
+    BOOL allowsAirPlayForMediaPlayback = [settings cordovaBoolSettingForKey:@"MediaPlaybackAllowsAirPlay" defaultValue:YES];
107
+    if([settings cordovaSettingForKey:@"AllowsAirPlayForMediaPlayback"] != nil) {
108
+        allowsAirPlayForMediaPlayback = [settings cordovaBoolSettingForKey:@"AllowsAirPlayForMediaPlayback" defaultValue:YES];
109
+    }
110
+    configuration.allowsAirPlayForMediaPlayback = allowsAirPlayForMediaPlayback;
111
+
112
+    /*
113
+     * Sets Custom User Agents
114
+     * - (Default) "userAgent" is set the the clean user agent.
115
+     *   E.g.
116
+     *     UserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
117
+     *
118
+     * - If "OverrideUserAgent" is set, it will overwrite the entire "userAgent" value. The "AppendUserAgent" will be iggnored if set.
119
+     *   Notice: The override logic is handled in the "pluginInitialize" method.
120
+     *   E.g.
121
+     *     OverrideUserAgent = "foobar"
122
+     *     UserAgent = "foobar"
123
+     *
124
+     * - If "AppendUserAgent" is set and "OverrideUserAgent" is not set, the user defined "AppendUserAgent" will be appended to the "userAgent"
125
+     *   E.g.
126
+     *     AppendUserAgent = "foobar"
127
+     *     UserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 foobar"
128
+     */
129
+    NSString *userAgent = configuration.applicationNameForUserAgent;
130
+    if (
131
+        [settings cordovaSettingForKey:@"OverrideUserAgent"] == nil &&
132
+        [settings cordovaSettingForKey:@"AppendUserAgent"] != nil
133
+        ) {
134
+        userAgent = [NSString stringWithFormat:@"%@ %@", userAgent, [settings cordovaSettingForKey:@"AppendUserAgent"]];
135
+    }
136
+    configuration.applicationNameForUserAgent = userAgent;
137
+
138
+    if (@available(iOS 13.0, *)) {
139
+        NSString *contentMode = [settings cordovaSettingForKey:@"PreferredContentMode"];
140
+        if ([contentMode isEqual: @"mobile"]) {
141
+            configuration.defaultWebpagePreferences.preferredContentMode = WKContentModeMobile;
142
+        } else if ([contentMode isEqual: @"desktop"]) {
143
+            configuration.defaultWebpagePreferences.preferredContentMode = WKContentModeDesktop;
144
+        }
145
+        
146
+    }
147
+
148
+    return configuration;
149
+}
150
+
151
+- (void)pluginInitialize
152
+{
153
+    // viewController would be available now. we attempt to set all possible delegates to it, by default
154
+    CDVViewController* vc = (CDVViewController*)self.viewController;
155
+    NSDictionary* settings = self.commandDelegate.settings;
156
+
157
+    NSString *scheme = [settings cordovaSettingForKey:@"scheme"];
158
+
159
+    // If scheme is file or nil, then default to file scheme
160
+    self.cdvIsFileScheme = [scheme isEqualToString: @"file"] || scheme == nil;
161
+
162
+    NSString *hostname = @"";
163
+    if(!self.cdvIsFileScheme) {
164
+        if(scheme == nil || [WKWebView handlesURLScheme:scheme]){
165
+            scheme = @"app";
166
+        }
167
+        vc.appScheme = scheme;
168
+
169
+        hostname = [settings cordovaSettingForKey:@"hostname"];
170
+        if(hostname == nil){
171
+            hostname = @"localhost";
172
+        }
173
+
174
+        self.CDV_ASSETS_URL = [NSString stringWithFormat:@"%@://%@", scheme, hostname];
175
+    }
176
+
177
+    CDVWebViewUIDelegate* uiDelegate = [[CDVWebViewUIDelegate alloc] initWithTitle:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]];
178
+    uiDelegate.allowNewWindows = [settings cordovaBoolSettingForKey:@"AllowNewWindows" defaultValue:NO];
179
+    self.uiDelegate = uiDelegate;
180
+
181
+    CDVWebViewWeakScriptMessageHandler *weakScriptMessageHandler = [[CDVWebViewWeakScriptMessageHandler alloc] initWithScriptMessageHandler:self];
182
+
183
+    WKUserContentController* userContentController = [[WKUserContentController alloc] init];
184
+    [userContentController addScriptMessageHandler:weakScriptMessageHandler name:CDV_BRIDGE_NAME];
185
+
186
+    if(self.CDV_ASSETS_URL) {
187
+        NSString *scriptCode = [NSString stringWithFormat:@"window.CDV_ASSETS_URL = '%@';", self.CDV_ASSETS_URL];
188
+        WKUserScript *wkScript = [[WKUserScript alloc] initWithSource:scriptCode injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:YES];
189
+
190
+        if (wkScript) {
191
+            [userContentController addUserScript:wkScript];
192
+        }
193
+    }
194
+
195
+    WKWebViewConfiguration* configuration = [self createConfigurationFromSettings:settings];
196
+    configuration.userContentController = userContentController;
197
+
198
+    // Do not configure the scheme handler if the scheme is default (file)
199
+    if(!self.cdvIsFileScheme) {
200
+        self.schemeHandler = [[CDVURLSchemeHandler alloc] initWithVC:vc];
201
+        [configuration setURLSchemeHandler:self.schemeHandler forURLScheme:scheme];
202
+    }
203
+
204
+    // re-create WKWebView, since we need to update configuration
205
+    WKWebView* wkWebView = [[WKWebView alloc] initWithFrame:self.engineWebView.frame configuration:configuration];
206
+    wkWebView.UIDelegate = self.uiDelegate;
207
+
208
+    /*
209
+     * This is where the "OverrideUserAgent" is handled. This will replace the entire UserAgent
210
+     * with the user defined custom UserAgent.
211
+     */
212
+    if ([settings cordovaSettingForKey:@"OverrideUserAgent"] != nil) {
213
+        wkWebView.customUserAgent = [settings cordovaSettingForKey:@"OverrideUserAgent"];
214
+    }
215
+
216
+    self.engineWebView = wkWebView;
217
+
218
+    if ([self.viewController conformsToProtocol:@protocol(WKUIDelegate)]) {
219
+        wkWebView.UIDelegate = (id <WKUIDelegate>)self.viewController;
220
+    }
221
+
222
+    if ([self.viewController conformsToProtocol:@protocol(WKNavigationDelegate)]) {
223
+        wkWebView.navigationDelegate = (id <WKNavigationDelegate>)self.viewController;
224
+    } else {
225
+        wkWebView.navigationDelegate = (id <WKNavigationDelegate>)self;
226
+    }
227
+
228
+    if ([self.viewController conformsToProtocol:@protocol(WKScriptMessageHandler)]) {
229
+        [wkWebView.configuration.userContentController addScriptMessageHandler:(id < WKScriptMessageHandler >)self.viewController name:CDV_BRIDGE_NAME];
230
+    }
231
+
232
+    [self updateSettings:settings];
233
+
234
+    // check if content thread has died on resume
235
+    NSLog(@"%@", @"CDVWebViewEngine will reload WKWebView if required on resume");
236
+    [[NSNotificationCenter defaultCenter]
237
+        addObserver:self
238
+           selector:@selector(onAppWillEnterForeground:)
239
+               name:UIApplicationWillEnterForegroundNotification object:nil];
240
+
241
+    NSLog(@"Using WKWebView");
242
+
243
+    [self addURLObserver];
244
+}
245
+
246
+- (void)onReset {
247
+    [self addURLObserver];
248
+}
249
+
250
+static void * KVOContext = &KVOContext;
251
+
252
+- (void)addURLObserver {
253
+    if(!IsAtLeastiOSVersion(@"9.0")){
254
+        [self.webView addObserver:self forKeyPath:@"URL" options:0 context:KVOContext];
255
+    }
256
+}
257
+
258
+- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSString *,id> *)change context:(void *)context
259
+{
260
+    if (context == KVOContext) {
261
+        if (object == [self webView] && [keyPath isEqualToString: @"URL"] && [object valueForKeyPath:keyPath] == nil){
262
+            NSLog(@"URL is nil. Reloading WKWebView");
263
+            [(WKWebView*)_engineWebView reload];
264
+        }
265
+    } else {
266
+        [super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
267
+    }
268
+}
269
+
270
+- (void) onAppWillEnterForeground:(NSNotification*)notification {
271
+    if ([self shouldReloadWebView]) {
272
+        NSLog(@"%@", @"CDVWebViewEngine reloading!");
273
+        [(WKWebView*)_engineWebView reload];
274
+    }
275
+}
276
+
277
+- (BOOL)shouldReloadWebView
278
+{
279
+    WKWebView* wkWebView = (WKWebView*)_engineWebView;
280
+    return [self shouldReloadWebView:wkWebView.URL title:wkWebView.title];
281
+}
282
+
283
+- (BOOL)shouldReloadWebView:(NSURL*)location title:(NSString*)title
284
+{
285
+    BOOL title_is_nil = (title == nil);
286
+    BOOL location_is_blank = [[location absoluteString] isEqualToString:@"about:blank"];
287
+
288
+    BOOL reload = (title_is_nil || location_is_blank);
289
+
290
+#ifdef DEBUG
291
+    NSLog(@"%@", @"CDVWebViewEngine shouldReloadWebView::");
292
+    NSLog(@"CDVWebViewEngine shouldReloadWebView title: %@", title);
293
+    NSLog(@"CDVWebViewEngine shouldReloadWebView location: %@", [location absoluteString]);
294
+    NSLog(@"CDVWebViewEngine shouldReloadWebView reload: %u", reload);
295
+#endif
296
+
297
+    return reload;
298
+}
299
+
300
+
301
+- (id)loadRequest:(NSURLRequest*)request
302
+{
303
+    if ([self canLoadRequest:request]) { // can load, differentiate between file urls and other schemes
304
+        if(request.URL.fileURL && self.cdvIsFileScheme) {
305
+            NSURL* readAccessUrl = [request.URL URLByDeletingLastPathComponent];
306
+            return [(WKWebView*)_engineWebView loadFileURL:request.URL allowingReadAccessToURL:readAccessUrl];
307
+        } else if (request.URL.fileURL) {
308
+            NSURL* startURL = [NSURL URLWithString:((CDVViewController *)self.viewController).startPage];
309
+            NSString* startFilePath = [self.commandDelegate pathForResource:[startURL path]];
310
+            NSURL *url = [[NSURL URLWithString:self.CDV_ASSETS_URL] URLByAppendingPathComponent:request.URL.path];
311
+            if ([request.URL.path isEqualToString:startFilePath]) {
312
+                url = [NSURL URLWithString:[NSString stringWithFormat:@"%@/%@", self.CDV_ASSETS_URL, startURL]];
313
+            }
314
+            if(request.URL.query) {
315
+                url = [NSURL URLWithString:[@"?" stringByAppendingString:request.URL.query] relativeToURL:url];
316
+            }
317
+            if(request.URL.fragment) {
318
+                url = [NSURL URLWithString:[@"#" stringByAppendingString:request.URL.fragment] relativeToURL:url];
319
+            }
320
+            request = [NSURLRequest requestWithURL:url];
321
+        }
322
+        return [(WKWebView*)_engineWebView loadRequest:request];
323
+    } else { // can't load, print out error
324
+        NSString* errorHtml = [NSString stringWithFormat:
325
+                               @"<!doctype html>"
326
+                               @"<title>Error</title>"
327
+                               @"<div style='font-size:2em'>"
328
+                               @"   <p>The WebView engine '%@' is unable to load the request: %@</p>"
329
+                               @"   <p>Most likely the cause of the error is that the loading of file urls is not supported in iOS %@.</p>"
330
+                               @"</div>",
331
+                               NSStringFromClass([self class]),
332
+                               [request.URL description],
333
+                               [[UIDevice currentDevice] systemVersion]
334
+                               ];
335
+        return [self loadHTMLString:errorHtml baseURL:nil];
336
+    }
337
+}
338
+
339
+- (id)loadHTMLString:(NSString*)string baseURL:(NSURL*)baseURL
340
+{
341
+    return [(WKWebView*)_engineWebView loadHTMLString:string baseURL:baseURL];
342
+}
343
+
344
+- (NSURL*) URL
345
+{
346
+    return [(WKWebView*)_engineWebView URL];
347
+}
348
+
349
+- (BOOL) canLoadRequest:(NSURLRequest*)request
350
+{
351
+    // See: https://issues.apache.org/jira/browse/CB-9636
352
+    SEL wk_sel = NSSelectorFromString(CDV_WKWEBVIEW_FILE_URL_LOAD_SELECTOR);
353
+
354
+    // if it's a file URL, check whether WKWebView has the selector (which is in iOS 9 and up only)
355
+    if (request.URL.fileURL) {
356
+        return [_engineWebView respondsToSelector:wk_sel];
357
+    } else {
358
+        return YES;
359
+    }
360
+}
361
+
362
+- (void)updateSettings:(NSDictionary*)settings
363
+{
364
+    WKWebView* wkWebView = (WKWebView*)_engineWebView;
365
+
366
+    wkWebView.configuration.preferences.minimumFontSize = [settings cordovaFloatSettingForKey:@"MinimumFontSize" defaultValue:0.0];
367
+
368
+    /*
369
+     wkWebView.configuration.preferences.javaScriptEnabled = [settings cordovaBoolSettingForKey:@"JavaScriptEnabled" default:YES];
370
+     wkWebView.configuration.preferences.javaScriptCanOpenWindowsAutomatically = [settings cordovaBoolSettingForKey:@"JavaScriptCanOpenWindowsAutomatically" default:NO];
371
+     */
372
+
373
+    // By default, DisallowOverscroll is false (thus bounce is allowed)
374
+    BOOL bounceAllowed = !([settings cordovaBoolSettingForKey:@"DisallowOverscroll" defaultValue:NO]);
375
+
376
+    // prevent webView from bouncing
377
+    if (!bounceAllowed) {
378
+        if ([wkWebView respondsToSelector:@selector(scrollView)]) {
379
+            ((UIScrollView*)[wkWebView scrollView]).bounces = NO;
380
+        } else {
381
+            for (id subview in wkWebView.subviews) {
382
+                if ([[subview class] isSubclassOfClass:[UIScrollView class]]) {
383
+                    ((UIScrollView*)subview).bounces = NO;
384
+                }
385
+            }
386
+        }
387
+    }
388
+
389
+    NSString* decelerationSetting = [settings cordovaSettingForKey:@"WKWebViewDecelerationSpeed"];
390
+
391
+    if (![@"fast" isEqualToString:decelerationSetting]) {
392
+        [wkWebView.scrollView setDecelerationRate:UIScrollViewDecelerationRateNormal];
393
+    } else {
394
+        [wkWebView.scrollView setDecelerationRate:UIScrollViewDecelerationRateFast];
395
+    }
396
+
397
+    wkWebView.allowsBackForwardNavigationGestures = [settings cordovaBoolSettingForKey:@"AllowBackForwardNavigationGestures" defaultValue:NO];
398
+    wkWebView.allowsLinkPreview = [settings cordovaBoolSettingForKey:@"Allow3DTouchLinkPreview" defaultValue:YES];
399
+}
400
+
401
+- (void)updateWithInfo:(NSDictionary*)info
402
+{
403
+    NSDictionary* scriptMessageHandlers = [info objectForKey:kCDVWebViewEngineScriptMessageHandlers];
404
+    NSDictionary* settings = [info objectForKey:kCDVWebViewEngineWebViewPreferences];
405
+    id navigationDelegate = [info objectForKey:kCDVWebViewEngineWKNavigationDelegate];
406
+    id uiDelegate = [info objectForKey:kCDVWebViewEngineWKUIDelegate];
407
+
408
+    WKWebView* wkWebView = (WKWebView*)_engineWebView;
409
+
410
+    if (scriptMessageHandlers && [scriptMessageHandlers isKindOfClass:[NSDictionary class]]) {
411
+        NSArray* allKeys = [scriptMessageHandlers allKeys];
412
+
413
+        for (NSString* key in allKeys) {
414
+            id object = [scriptMessageHandlers objectForKey:key];
415
+            if ([object conformsToProtocol:@protocol(WKScriptMessageHandler)]) {
416
+                [wkWebView.configuration.userContentController addScriptMessageHandler:object name:key];
417
+            }
418
+        }
419
+    }
420
+
421
+    if (navigationDelegate && [navigationDelegate conformsToProtocol:@protocol(WKNavigationDelegate)]) {
422
+        wkWebView.navigationDelegate = navigationDelegate;
423
+    }
424
+
425
+    if (uiDelegate && [uiDelegate conformsToProtocol:@protocol(WKUIDelegate)]) {
426
+        wkWebView.UIDelegate = uiDelegate;
427
+    }
428
+
429
+    if (settings && [settings isKindOfClass:[NSDictionary class]]) {
430
+        [self updateSettings:settings];
431
+    }
432
+}
433
+
434
+// This forwards the methods that are in the header that are not implemented here.
435
+// Both WKWebView implement the below:
436
+//     loadHTMLString:baseURL:
437
+//     loadRequest:
438
+- (id)forwardingTargetForSelector:(SEL)aSelector
439
+{
440
+    return _engineWebView;
441
+}
442
+
443
+- (UIView*)webView
444
+{
445
+    return self.engineWebView;
446
+}
447
+
448
+#pragma mark WKScriptMessageHandler implementation
449
+
450
+- (void)userContentController:(WKUserContentController*)userContentController didReceiveScriptMessage:(WKScriptMessage*)message
451
+{
452
+    if (![message.name isEqualToString:CDV_BRIDGE_NAME]) {
453
+        return;
454
+    }
455
+
456
+    CDVViewController* vc = (CDVViewController*)self.viewController;
457
+
458
+    NSArray* jsonEntry = message.body; // NSString:callbackId, NSString:service, NSString:action, NSArray:args
459
+    CDVInvokedUrlCommand* command = [CDVInvokedUrlCommand commandFromJson:jsonEntry];
460
+    CDV_EXEC_LOG(@"Exec(%@): Calling %@.%@", command.callbackId, command.className, command.methodName);
461
+
462
+    if (![vc.commandQueue execute:command]) {
463
+#ifdef DEBUG
464
+        NSError* error = nil;
465
+        NSString* commandJson = nil;
466
+        NSData* jsonData = [NSJSONSerialization dataWithJSONObject:jsonEntry
467
+                                                           options:0
468
+                                                             error:&error];
469
+
470
+        if (error == nil) {
471
+            commandJson = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
472
+        }
473
+
474
+            static NSUInteger maxLogLength = 1024;
475
+            NSString* commandString = ([commandJson length] > maxLogLength) ?
476
+                [NSString stringWithFormat : @"%@[...]", [commandJson substringToIndex:maxLogLength]] :
477
+                commandJson;
478
+
479
+            NSLog(@"FAILED pluginJSON = %@", commandString);
480
+#endif
481
+    }
482
+}
483
+
484
+#pragma mark WKNavigationDelegate implementation
485
+
486
+- (void)webView:(WKWebView*)webView didStartProvisionalNavigation:(WKNavigation*)navigation
487
+{
488
+    [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginResetNotification object:webView]];
489
+}
490
+
491
+- (void)webView:(WKWebView*)webView didFinishNavigation:(WKNavigation*)navigation
492
+{
493
+    [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPageDidLoadNotification object:webView]];
494
+}
495
+
496
+- (void)webView:(WKWebView*)theWebView didFailProvisionalNavigation:(WKNavigation*)navigation withError:(NSError*)error
497
+{
498
+    [self webView:theWebView didFailNavigation:navigation withError:error];
499
+}
500
+
501
+- (void)webView:(WKWebView*)theWebView didFailNavigation:(WKNavigation*)navigation withError:(NSError*)error
502
+{
503
+    CDVViewController* vc = (CDVViewController*)self.viewController;
504
+
505
+    NSString* message = [NSString stringWithFormat:@"Failed to load webpage with error: %@", [error localizedDescription]];
506
+    NSLog(@"%@", message);
507
+
508
+    NSURL* errorUrl = vc.errorURL;
509
+    if (errorUrl) {
510
+        NSCharacterSet *charSet = [NSCharacterSet URLFragmentAllowedCharacterSet];
511
+        errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [message stringByAddingPercentEncodingWithAllowedCharacters:charSet]] relativeToURL:errorUrl];
512
+        NSLog(@"%@", [errorUrl absoluteString]);
513
+        [theWebView loadRequest:[NSURLRequest requestWithURL:errorUrl]];
514
+    }
515
+}
516
+
517
+- (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView
518
+{
519
+    [webView reload];
520
+}
521
+
522
+- (BOOL)defaultResourcePolicyForURL:(NSURL*)url
523
+{
524
+    // all file:// urls are allowed
525
+    if ([url isFileURL]) {
526
+        return YES;
527
+    }
528
+
529
+    return NO;
530
+}
531
+
532
+- (void) webView: (WKWebView *) webView decidePolicyForNavigationAction: (WKNavigationAction*) navigationAction decisionHandler: (void (^)(WKNavigationActionPolicy)) decisionHandler
533
+{
534
+    NSURL* url = [navigationAction.request URL];
535
+    CDVViewController* vc = (CDVViewController*)self.viewController;
536
+
537
+    /*
538
+     * Give plugins the chance to handle the url
539
+     */
540
+    BOOL anyPluginsResponded = NO;
541
+    BOOL shouldAllowRequest = NO;
542
+
543
+    for (NSString* pluginName in vc.pluginObjects) {
544
+        CDVPlugin* plugin = [vc.pluginObjects objectForKey:pluginName];
545
+        SEL selector = NSSelectorFromString(@"shouldOverrideLoadWithRequest:navigationType:");
546
+        if ([plugin respondsToSelector:selector]) {
547
+            anyPluginsResponded = YES;
548
+            // https://issues.apache.org/jira/browse/CB-12497
549
+            int navType = (int)navigationAction.navigationType;
550
+            shouldAllowRequest = (((BOOL (*)(id, SEL, id, int))objc_msgSend)(plugin, selector, navigationAction.request, navType));
551
+            if (!shouldAllowRequest) {
552
+                break;
553
+            }
554
+        }
555
+    }
556
+
557
+    if (anyPluginsResponded) {
558
+        return decisionHandler(shouldAllowRequest);
559
+    }
560
+
561
+    /*
562
+     * Handle all other types of urls (tel:, sms:), and requests to load a url in the main webview.
563
+     */
564
+    BOOL shouldAllowNavigation = [self defaultResourcePolicyForURL:url];
565
+    if (shouldAllowNavigation) {
566
+        return decisionHandler(YES);
567
+    } else {
568
+        [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]];
569
+    }
570
+
571
+    return decisionHandler(NO);
572
+}
573
+
574
+#pragma mark - Plugin interface
575
+
576
+- (void)allowsBackForwardNavigationGestures:(CDVInvokedUrlCommand*)command;
577
+{
578
+    id value = [command argumentAtIndex:0];
579
+    if (!([value isKindOfClass:[NSNumber class]])) {
580
+        value = [NSNumber numberWithBool:NO];
581
+    }
582
+
583
+    WKWebView* wkWebView = (WKWebView*)_engineWebView;
584
+    wkWebView.allowsBackForwardNavigationGestures = [value boolValue];
585
+}
586
+
587
+@end
588
+
589
+#pragma mark - CDVWebViewWeakScriptMessageHandler
590
+
591
+@implementation CDVWebViewWeakScriptMessageHandler
592
+
593
+- (instancetype)initWithScriptMessageHandler:(id<WKScriptMessageHandler>)scriptMessageHandler
594
+{
595
+    self = [super init];
596
+    if (self) {
597
+        _scriptMessageHandler = scriptMessageHandler;
598
+    }
599
+    return self;
600
+}
601
+
602
+- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message
603
+{
604
+    [self.scriptMessageHandler userContentController:userContentController didReceiveScriptMessage:message];
605
+}
606
+
607
+@end

+ 27
- 0
node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewProcessPoolFactory.h View File

1
+/*
2
+ Licensed to the Apache Software Foundation (ASF) under one
3
+ or more contributor license agreements.  See the NOTICE file
4
+ distributed with this work for additional information
5
+ regarding copyright ownership.  The ASF licenses this file
6
+ to you under the Apache License, Version 2.0 (the
7
+ "License"); you may not use this file except in compliance
8
+ with the License.  You may obtain a copy of the License at
9
+ 
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+ 
12
+ Unless required by applicable law or agreed to in writing,
13
+ software distributed under the License is distributed on an
14
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ KIND, either express or implied.  See the License for the
16
+ specific language governing permissions and limitations
17
+ under the License.
18
+ */
19
+
20
+#import <WebKit/WebKit.h>
21
+
22
+@interface CDVWebViewProcessPoolFactory : NSObject
23
+@property (nonatomic, retain) WKProcessPool* sharedPool;
24
+
25
++(instancetype) sharedFactory;
26
+-(WKProcessPool*) sharedProcessPool;
27
+@end

+ 49
- 0
node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewProcessPoolFactory.m View File

1
+/*
2
+ Licensed to the Apache Software Foundation (ASF) under one
3
+ or more contributor license agreements.  See the NOTICE file
4
+ distributed with this work for additional information
5
+ regarding copyright ownership.  The ASF licenses this file
6
+ to you under the Apache License, Version 2.0 (the
7
+ "License"); you may not use this file except in compliance
8
+ with the License.  You may obtain a copy of the License at
9
+ 
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+ 
12
+ Unless required by applicable law or agreed to in writing,
13
+ software distributed under the License is distributed on an
14
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ KIND, either express or implied.  See the License for the
16
+ specific language governing permissions and limitations
17
+ under the License.
18
+ */
19
+
20
+#import <Foundation/Foundation.h>
21
+#import <WebKit/WebKit.h>
22
+#import "CDVWebViewProcessPoolFactory.h"
23
+
24
+static CDVWebViewProcessPoolFactory *factory = nil;
25
+
26
+@implementation CDVWebViewProcessPoolFactory
27
+
28
++ (instancetype)sharedFactory
29
+{
30
+    static dispatch_once_t onceToken;
31
+    dispatch_once(&onceToken, ^{
32
+        factory = [[CDVWebViewProcessPoolFactory alloc] init];
33
+    });
34
+    
35
+    return factory;
36
+}
37
+
38
+- (instancetype)init
39
+{
40
+    if (self = [super init]) {
41
+        _sharedPool = [[WKProcessPool alloc] init];
42
+    }
43
+    return self;
44
+}
45
+
46
+- (WKProcessPool*) sharedProcessPool {
47
+    return _sharedPool;
48
+}
49
+@end

+ 32
- 0
node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.h View File

1
+/*
2
+ Licensed to the Apache Software Foundation (ASF) under one
3
+ or more contributor license agreements.  See the NOTICE file
4
+ distributed with this work for additional information
5
+ regarding copyright ownership.  The ASF licenses this file
6
+ to you under the Apache License, Version 2.0 (the
7
+ "License"); you may not use this file except in compliance
8
+ with the License.  You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing,
13
+ software distributed under the License is distributed on an
14
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ KIND, either express or implied.  See the License for the
16
+ specific language governing permissions and limitations
17
+ under the License.
18
+ */
19
+
20
+#import <WebKit/WebKit.h>
21
+
22
+@interface CDVWebViewUIDelegate : NSObject <WKUIDelegate>
23
+{
24
+    NSMutableArray<UIViewController*>* windows;
25
+}
26
+
27
+@property (nonatomic, copy) NSString* title;
28
+@property (nonatomic, assign) BOOL allowNewWindows;
29
+
30
+- (instancetype)initWithTitle:(NSString*)title;
31
+
32
+@end

+ 163
- 0
node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.m View File

1
+/*
2
+ Licensed to the Apache Software Foundation (ASF) under one
3
+ or more contributor license agreements.  See the NOTICE file
4
+ distributed with this work for additional information
5
+ regarding copyright ownership.  The ASF licenses this file
6
+ to you under the Apache License, Version 2.0 (the
7
+ "License"); you may not use this file except in compliance
8
+ with the License.  You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing,
13
+ software distributed under the License is distributed on an
14
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ KIND, either express or implied.  See the License for the
16
+ specific language governing permissions and limitations
17
+ under the License.
18
+ */
19
+
20
+#import "CDVWebViewUIDelegate.h"
21
+
22
+@implementation CDVWebViewUIDelegate
23
+
24
+- (instancetype)initWithTitle:(NSString*)title
25
+{
26
+    self = [super init];
27
+    if (self) {
28
+        self.title = title;
29
+        windows = [[NSMutableArray alloc] init];
30
+    }
31
+
32
+    return self;
33
+}
34
+
35
+- (void)     webView:(WKWebView*)webView runJavaScriptAlertPanelWithMessage:(NSString*)message
36
+    initiatedByFrame:(WKFrameInfo*)frame completionHandler:(void (^)(void))completionHandler
37
+{
38
+    UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title
39
+                                                                   message:message
40
+                                                            preferredStyle:UIAlertControllerStyleAlert];
41
+
42
+    UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
43
+                                                 style:UIAlertActionStyleDefault
44
+                                               handler:^(UIAlertAction* action)
45
+        {
46
+            completionHandler();
47
+            [alert dismissViewControllerAnimated:YES completion:nil];
48
+        }];
49
+
50
+    [alert addAction:ok];
51
+
52
+    UIViewController* rootController = [UIApplication sharedApplication].delegate.window.rootViewController;
53
+
54
+    [rootController presentViewController:alert animated:YES completion:nil];
55
+}
56
+
57
+- (void)     webView:(WKWebView*)webView runJavaScriptConfirmPanelWithMessage:(NSString*)message
58
+    initiatedByFrame:(WKFrameInfo*)frame completionHandler:(void (^)(BOOL result))completionHandler
59
+{
60
+    UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title
61
+                                                                   message:message
62
+                                                            preferredStyle:UIAlertControllerStyleAlert];
63
+
64
+    UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
65
+                                                 style:UIAlertActionStyleDefault
66
+                                               handler:^(UIAlertAction* action)
67
+        {
68
+            completionHandler(YES);
69
+            [alert dismissViewControllerAnimated:YES completion:nil];
70
+        }];
71
+
72
+    [alert addAction:ok];
73
+
74
+    UIAlertAction* cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel")
75
+                                                     style:UIAlertActionStyleDefault
76
+                                                   handler:^(UIAlertAction* action)
77
+        {
78
+            completionHandler(NO);
79
+            [alert dismissViewControllerAnimated:YES completion:nil];
80
+        }];
81
+    [alert addAction:cancel];
82
+
83
+    UIViewController* rootController = [UIApplication sharedApplication].delegate.window.rootViewController;
84
+
85
+    [rootController presentViewController:alert animated:YES completion:nil];
86
+}
87
+
88
+- (void)      webView:(WKWebView*)webView runJavaScriptTextInputPanelWithPrompt:(NSString*)prompt
89
+          defaultText:(NSString*)defaultText initiatedByFrame:(WKFrameInfo*)frame
90
+    completionHandler:(void (^)(NSString* result))completionHandler
91
+{
92
+    UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title
93
+                                                                   message:prompt
94
+                                                            preferredStyle:UIAlertControllerStyleAlert];
95
+
96
+    UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
97
+                                                 style:UIAlertActionStyleDefault
98
+                                               handler:^(UIAlertAction* action)
99
+        {
100
+            completionHandler(((UITextField*)alert.textFields[0]).text);
101
+            [alert dismissViewControllerAnimated:YES completion:nil];
102
+        }];
103
+
104
+    [alert addAction:ok];
105
+
106
+    UIAlertAction* cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel")
107
+                                                     style:UIAlertActionStyleDefault
108
+                                                   handler:^(UIAlertAction* action)
109
+        {
110
+            completionHandler(nil);
111
+            [alert dismissViewControllerAnimated:YES completion:nil];
112
+        }];
113
+    [alert addAction:cancel];
114
+
115
+    [alert addTextFieldWithConfigurationHandler:^(UITextField* textField) {
116
+        textField.text = defaultText;
117
+    }];
118
+
119
+    UIViewController* rootController = [UIApplication sharedApplication].delegate.window.rootViewController;
120
+
121
+    [rootController presentViewController:alert animated:YES completion:nil];
122
+}
123
+
124
+- (WKWebView*) webView:(WKWebView*)webView createWebViewWithConfiguration:(WKWebViewConfiguration*)configuration forNavigationAction:(WKNavigationAction*)navigationAction windowFeatures:(WKWindowFeatures*)windowFeatures
125
+{
126
+    if (!navigationAction.targetFrame.isMainFrame) {
127
+        if (self.allowNewWindows) {
128
+            WKWebView* v = [[WKWebView alloc] initWithFrame:webView.frame configuration:configuration];
129
+            v.UIDelegate = webView.UIDelegate;
130
+            v.navigationDelegate = webView.navigationDelegate;
131
+
132
+            UIViewController* vc = [[UIViewController alloc] init];
133
+            vc.modalPresentationStyle = UIModalPresentationOverCurrentContext;
134
+            vc.view = v;
135
+
136
+            [windows addObject:vc];
137
+
138
+            UIViewController* rootController = [UIApplication sharedApplication].delegate.window.rootViewController;
139
+            [rootController presentViewController:vc animated:YES completion:nil];
140
+            return v;
141
+        } else {
142
+            [webView loadRequest:navigationAction.request];
143
+        }
144
+    }
145
+
146
+    return nil;
147
+}
148
+
149
+- (void)webViewDidClose:(WKWebView*)webView
150
+{
151
+    for (UIViewController* vc in windows) {
152
+        if (vc.view == webView) {
153
+            [vc dismissViewControllerAnimated:YES completion:nil];
154
+            [windows removeObject:vc];
155
+            break;
156
+        }
157
+    }
158
+
159
+    // We do not allow closing the primary WebView
160
+}
161
+
162
+
163
+@end

+ 0
- 2
node_modules/cordova-ios/CordovaLib/Classes/Public/CDV.h View File

24
 #import "CDVPluginResult.h"
24
 #import "CDVPluginResult.h"
25
 #import "CDVViewController.h"
25
 #import "CDVViewController.h"
26
 #import "CDVCommandDelegate.h"
26
 #import "CDVCommandDelegate.h"
27
-#import "CDVURLProtocol.h"
28
 #import "CDVInvokedUrlCommand.h"
27
 #import "CDVInvokedUrlCommand.h"
29
 #import "CDVWhitelist.h"
28
 #import "CDVWhitelist.h"
30
 #import "CDVScreenOrientationDelegate.h"
29
 #import "CDVScreenOrientationDelegate.h"
31
 #import "CDVTimer.h"
30
 #import "CDVTimer.h"
32
-#import "CDVUserAgentUtil.h"

+ 0
- 21
node_modules/cordova-ios/CordovaLib/Classes/Public/CDVAppDelegate.m View File

25
 
25
 
26
 - (id)init
26
 - (id)init
27
 {
27
 {
28
-    /** If you need to do any extra app-specific initialization, you can do it here
29
-     *  -jm
30
-     **/
31
-    NSHTTPCookieStorage* cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
32
-
33
-    [cookieStorage setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways];
34
-
35
-    int cacheSizeMemory = 8 * 1024 * 1024; // 8MB
36
-    int cacheSizeDisk = 32 * 1024 * 1024; // 32MB
37
-    NSURLCache* sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:cacheSizeMemory diskCapacity:cacheSizeDisk diskPath:@"nsurlcache"];
38
-    [NSURLCache setSharedURLCache:sharedCache];
39
-
40
     self = [super init];
28
     self = [super init];
41
     return self;
29
     return self;
42
 }
30
 }
98
     return YES;
86
     return YES;
99
 }
87
 }
100
 
88
 
101
-#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000  
102
-- (NSUInteger)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window
103
-#else //CB-12098.  Defaults to UIInterfaceOrientationMask for iOS 9+
104
 - (UIInterfaceOrientationMask)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window
89
 - (UIInterfaceOrientationMask)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window
105
-#endif
106
 {
90
 {
107
     // 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).
91
     // 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).
108
     NSUInteger supportedInterfaceOrientations = (1 << UIInterfaceOrientationPortrait) | (1 << UIInterfaceOrientationLandscapeLeft) | (1 << UIInterfaceOrientationLandscapeRight) | (1 << UIInterfaceOrientationPortraitUpsideDown);
92
     NSUInteger supportedInterfaceOrientations = (1 << UIInterfaceOrientationPortrait) | (1 << UIInterfaceOrientationLandscapeLeft) | (1 << UIInterfaceOrientationLandscapeRight) | (1 << UIInterfaceOrientationPortraitUpsideDown);
110
     return supportedInterfaceOrientations;
94
     return supportedInterfaceOrientations;
111
 }
95
 }
112
 
96
 
113
-- (void)applicationDidReceiveMemoryWarning:(UIApplication*)application
114
-{
115
-    [[NSURLCache sharedURLCache] removeAllCachedResponses];
116
-}
117
-
118
 @end
97
 @end

+ 4
- 1
node_modules/cordova-ios/CordovaLib/Classes/Public/CDVAvailability.h View File

75
 #define __CORDOVA_5_0_1 50001
75
 #define __CORDOVA_5_0_1 50001
76
 #define __CORDOVA_5_1_0 50100
76
 #define __CORDOVA_5_1_0 50100
77
 #define __CORDOVA_5_1_1 50101
77
 #define __CORDOVA_5_1_1 50101
78
+#define __CORDOVA_6_0_0 60000
79
+#define __CORDOVA_6_1_0 60100
80
+#define __CORDOVA_6_1_1 60101
78
 /* coho:next-version,insert-before */
81
 /* coho:next-version,insert-before */
79
 #define __CORDOVA_NA 99999      /* not available */
82
 #define __CORDOVA_NA 99999      /* not available */
80
 
83
 
87
  */
90
  */
88
 #ifndef CORDOVA_VERSION_MIN_REQUIRED
91
 #ifndef CORDOVA_VERSION_MIN_REQUIRED
89
     /* coho:next-version-min-required,replace-after */
92
     /* coho:next-version-min-required,replace-after */
90
-    #define CORDOVA_VERSION_MIN_REQUIRED __CORDOVA_5_1_1
93
+    #define CORDOVA_VERSION_MIN_REQUIRED __CORDOVA_6_1_1
91
 #endif
94
 #endif
92
 
95
 
93
 /*
96
 /*

+ 0
- 2
node_modules/cordova-ios/CordovaLib/Classes/Public/CDVCommandDelegate.h View File

45
 - (void)evalJs:(NSString*)js scheduledOnRunLoop:(BOOL)scheduledOnRunLoop;
45
 - (void)evalJs:(NSString*)js scheduledOnRunLoop:(BOOL)scheduledOnRunLoop;
46
 // Runs the given block on a background thread using a shared thread-pool.
46
 // Runs the given block on a background thread using a shared thread-pool.
47
 - (void)runInBackground:(void (^)(void))block;
47
 - (void)runInBackground:(void (^)(void))block;
48
-// Returns the User-Agent of the associated UIWebView.
49
-- (NSString*)userAgent;
50
 
48
 
51
 @end
49
 @end

+ 1
- 6
node_modules/cordova-ios/CordovaLib/Classes/Public/CDVCommandDelegateImpl.m View File

92
     // Cycle the run-loop before executing the JS.
92
     // Cycle the run-loop before executing the JS.
93
     // For _delayResponses -
93
     // For _delayResponses -
94
     //    This ensures that we don't eval JS during the middle of an existing JS
94
     //    This ensures that we don't eval JS during the middle of an existing JS
95
-    //    function (possible since UIWebViewDelegate callbacks can be synchronous).
95
+    //    function (possible since WKWebViewDelegate callbacks can be synchronous).
96
     // For !isMainThread -
96
     // For !isMainThread -
97
     //    It's a hard error to eval on the non-UI thread.
97
     //    It's a hard error to eval on the non-UI thread.
98
     // For !_commandQueue.currentlyExecuting -
98
     // For !_commandQueue.currentlyExecuting -
173
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block);
173
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block);
174
 }
174
 }
175
 
175
 
176
-- (NSString*)userAgent
177
-{
178
-    return [_viewController userAgent];
179
-}
180
-
181
 - (NSDictionary*)settings
176
 - (NSDictionary*)settings
182
 {
177
 {
183
     return _viewController.settings;
178
     return _viewController.settings;

+ 1
- 1
node_modules/cordova-ios/CordovaLib/Classes/Public/CDVPluginResult.m View File

103
 {
103
 {
104
     self = [super init];
104
     self = [super init];
105
     if (self) {
105
     if (self) {
106
-        status = [NSNumber numberWithInt:statusOrdinal];
106
+        status = @(statusOrdinal);
107
         message = theMessage;
107
         message = theMessage;
108
         keepCallback = [NSNumber numberWithBool:NO];
108
         keepCallback = [NSNumber numberWithBool:NO];
109
     }
109
     }

+ 0
- 5
node_modules/cordova-ios/CordovaLib/Classes/Public/CDVScreenOrientationDelegate.h View File

21
 
21
 
22
 @protocol CDVScreenOrientationDelegate <NSObject>
22
 @protocol CDVScreenOrientationDelegate <NSObject>
23
 
23
 
24
-#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000  
25
-- (NSUInteger)supportedInterfaceOrientations;  
26
-#else  
27
 - (UIInterfaceOrientationMask)supportedInterfaceOrientations;
24
 - (UIInterfaceOrientationMask)supportedInterfaceOrientations;
28
-#endif
29
 
25
 
30
-- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation;
31
 - (BOOL)shouldAutorotate;
26
 - (BOOL)shouldAutorotate;
32
 
27
 
33
 @end
28
 @end

+ 0
- 27
node_modules/cordova-ios/CordovaLib/Classes/Public/CDVURLProtocol.h View File

1
-/*
2
- Licensed to the Apache Software Foundation (ASF) under one
3
- or more contributor license agreements.  See the NOTICE file
4
- distributed with this work for additional information
5
- regarding copyright ownership.  The ASF licenses this file
6
- to you under the Apache License, Version 2.0 (the
7
- "License"); you may not use this file except in compliance
8
- with the License.  You may obtain a copy of the License at
9
-
10
- http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- Unless required by applicable law or agreed to in writing,
13
- software distributed under the License is distributed on an
14
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- KIND, either express or implied.  See the License for the
16
- specific language governing permissions and limitations
17
- under the License.
18
- */
19
-
20
-#import <Foundation/Foundation.h>
21
-#import "CDVAvailability.h"
22
-
23
-@class CDVViewController;
24
-
25
-@interface CDVURLProtocol : NSURLProtocol {}
26
-
27
-@end

+ 0
- 113
node_modules/cordova-ios/CordovaLib/Classes/Public/CDVURLProtocol.m View File

1
-/*
2
- Licensed to the Apache Software Foundation (ASF) under one
3
- or more contributor license agreements.  See the NOTICE file
4
- distributed with this work for additional information
5
- regarding copyright ownership.  The ASF licenses this file
6
- to you under the Apache License, Version 2.0 (the
7
- "License"); you may not use this file except in compliance
8
- with the License.  You may obtain a copy of the License at
9
-
10
- http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- Unless required by applicable law or agreed to in writing,
13
- software distributed under the License is distributed on an
14
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- KIND, either express or implied.  See the License for the
16
- specific language governing permissions and limitations
17
- under the License.
18
- */
19
-
20
-#import <AssetsLibrary/ALAsset.h>
21
-#import <AssetsLibrary/ALAssetRepresentation.h>
22
-#import <AssetsLibrary/ALAssetsLibrary.h>
23
-#import <MobileCoreServices/MobileCoreServices.h>
24
-#import "CDVURLProtocol.h"
25
-#import "CDVCommandQueue.h"
26
-#import "CDVViewController.h"
27
-
28
-// Contains a set of NSNumbers of addresses of controllers. It doesn't store
29
-// the actual pointer to avoid retaining.
30
-static NSMutableSet* gRegisteredControllers = nil;
31
-
32
-NSString* const kCDVAssetsLibraryPrefixes = @"assets-library://";
33
-
34
-@implementation CDVURLProtocol
35
-
36
-
37
-+ (BOOL)canInitWithRequest:(NSURLRequest*)theRequest
38
-{
39
-    NSURL* theUrl = [theRequest URL];
40
-
41
-    if ([[theUrl absoluteString] hasPrefix:kCDVAssetsLibraryPrefixes]) {
42
-        return YES;
43
-    }
44
-
45
-    return NO;
46
-}
47
-
48
-+ (NSURLRequest*)canonicalRequestForRequest:(NSURLRequest*)request
49
-{
50
-    // NSLog(@"%@ received %@", self, NSStringFromSelector(_cmd));
51
-    return request;
52
-}
53
-
54
-- (void)startLoading
55
-{
56
-    // NSLog(@"%@ received %@ - start", self, NSStringFromSelector(_cmd));
57
-    NSURL* url = [[self request] URL];
58
-
59
-    if ([[url absoluteString] hasPrefix:kCDVAssetsLibraryPrefixes]) {
60
-        ALAssetsLibraryAssetForURLResultBlock resultBlock = ^(ALAsset* asset) {
61
-            if (asset) {
62
-                // We have the asset!  Get the data and send it along.
63
-                ALAssetRepresentation* assetRepresentation = [asset defaultRepresentation];
64
-                NSString* MIMEType = (__bridge_transfer NSString*)UTTypeCopyPreferredTagWithClass((__bridge CFStringRef)[assetRepresentation UTI], kUTTagClassMIMEType);
65
-                Byte* buffer = (Byte*)malloc((unsigned long)[assetRepresentation size]);
66
-                NSUInteger bufferSize = [assetRepresentation getBytes:buffer fromOffset:0.0 length:(NSUInteger)[assetRepresentation size] error:nil];
67
-                NSData* data = [NSData dataWithBytesNoCopy:buffer length:bufferSize freeWhenDone:YES];
68
-                [self sendResponseWithResponseCode:200 data:data mimeType:MIMEType];
69
-            } else {
70
-                // Retrieving the asset failed for some reason.  Send an error.
71
-                [self sendResponseWithResponseCode:404 data:nil mimeType:nil];
72
-            }
73
-        };
74
-        ALAssetsLibraryAccessFailureBlock failureBlock = ^(NSError* error) {
75
-            // Retrieving the asset failed for some reason.  Send an error.
76
-            [self sendResponseWithResponseCode:401 data:nil mimeType:nil];
77
-        };
78
-
79
-        ALAssetsLibrary* assetsLibrary = [[ALAssetsLibrary alloc] init];
80
-        [assetsLibrary assetForURL:url resultBlock:resultBlock failureBlock:failureBlock];
81
-        return;
82
-    }
83
-
84
-    NSString* body = [NSString stringWithFormat:@"Access not allowed to URL: %@", url];
85
-    [self sendResponseWithResponseCode:401 data:[body dataUsingEncoding:NSASCIIStringEncoding] mimeType:nil];
86
-}
87
-
88
-- (void)stopLoading
89
-{
90
-    // do any cleanup here
91
-}
92
-
93
-+ (BOOL)requestIsCacheEquivalent:(NSURLRequest*)requestA toRequest:(NSURLRequest*)requestB
94
-{
95
-    return NO;
96
-}
97
-
98
-- (void)sendResponseWithResponseCode:(NSInteger)statusCode data:(NSData*)data mimeType:(NSString*)mimeType
99
-{
100
-    if (mimeType == nil) {
101
-        mimeType = @"text/plain";
102
-    }
103
-
104
-    NSHTTPURLResponse* response = [[NSHTTPURLResponse alloc] initWithURL:[[self request] URL] statusCode:statusCode HTTPVersion:@"HTTP/1.1" headerFields:@{@"Content-Type" : mimeType}];
105
-
106
-    [[self client] URLProtocol:self didReceiveResponse:response cacheStoragePolicy:NSURLCacheStorageNotAllowed];
107
-    if (data != nil) {
108
-        [[self client] URLProtocol:self didLoadData:data];
109
-    }
110
-    [[self client] URLProtocolDidFinishLoading:self];
111
-}
112
-
113
-@end

+ 32
- 0
node_modules/cordova-ios/CordovaLib/Classes/Public/CDVURLSchemeHandler.h View File

1
+/*
2
+ Licensed to the Apache Software Foundation (ASF) under one
3
+ or more contributor license agreements.  See the NOTICE file
4
+ distributed with this work for additional information
5
+ regarding copyright ownership.  The ASF licenses this file
6
+ to you under the Apache License, Version 2.0 (the
7
+ "License"); you may not use this file except in compliance
8
+ with the License.  You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing,
13
+ software distributed under the License is distributed on an
14
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ KIND, either express or implied.  See the License for the
16
+ specific language governing permissions and limitations
17
+ under the License.
18
+ */
19
+
20
+#import <Foundation/Foundation.h>
21
+#import <WebKit/WebKit.h>
22
+#import "CDVViewController.h"
23
+
24
+
25
+@interface CDVURLSchemeHandler : NSObject <WKURLSchemeHandler>
26
+
27
+@property (nonatomic, strong) CDVViewController* viewController;
28
+
29
+- (instancetype)initWithVC:(CDVViewController *)controller;
30
+
31
+
32
+@end

+ 108
- 0
node_modules/cordova-ios/CordovaLib/Classes/Public/CDVURLSchemeHandler.m View File

1
+/*
2
+ Licensed to the Apache Software Foundation (ASF) under one
3
+ or more contributor license agreements.  See the NOTICE file
4
+ distributed with this work for additional information
5
+ regarding copyright ownership.  The ASF licenses this file
6
+ to you under the Apache License, Version 2.0 (the
7
+ "License"); you may not use this file except in compliance
8
+ with the License.  You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing,
13
+ software distributed under the License is distributed on an
14
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ KIND, either express or implied.  See the License for the
16
+ specific language governing permissions and limitations
17
+ under the License.
18
+ */
19
+
20
+
21
+#import "CDVURLSchemeHandler.h"
22
+#import <MobileCoreServices/MobileCoreServices.h>
23
+
24
+@implementation CDVURLSchemeHandler
25
+
26
+
27
+- (instancetype)initWithVC:(CDVViewController *)controller
28
+{
29
+    self = [super init];
30
+    if (self) {
31
+        _viewController = controller;
32
+    }
33
+    return self;
34
+}
35
+
36
+- (void)webView:(WKWebView *)webView startURLSchemeTask:(id <WKURLSchemeTask>)urlSchemeTask
37
+{
38
+    NSString * startPath = [[NSBundle mainBundle] pathForResource:self.viewController.wwwFolderName ofType: nil];
39
+    NSURL * url = urlSchemeTask.request.URL;
40
+    NSString * stringToLoad = url.path;
41
+    NSString * scheme = url.scheme;
42
+
43
+    if ([scheme isEqualToString:self.viewController.appScheme]) {
44
+        if ([stringToLoad hasPrefix:@"/_app_file_"]) {
45
+            startPath = [stringToLoad stringByReplacingOccurrencesOfString:@"/_app_file_" withString:@""];
46
+        } else {
47
+            if ([stringToLoad isEqualToString:@""] || [url.pathExtension isEqualToString:@""]) {
48
+                startPath = [startPath stringByAppendingPathComponent:self.viewController.startPage];
49
+            } else {
50
+                startPath = [startPath stringByAppendingPathComponent:stringToLoad];
51
+            }
52
+        }
53
+    }
54
+
55
+    NSError * fileError = nil;
56
+    NSData * data = nil;
57
+    if ([self isMediaExtension:url.pathExtension]) {
58
+        data = [NSData dataWithContentsOfFile:startPath options:NSDataReadingMappedIfSafe error:&fileError];
59
+    }
60
+    if (!data || fileError) {
61
+        data =  [[NSData alloc] initWithContentsOfFile:startPath];
62
+    }
63
+    NSInteger statusCode = 200;
64
+    if (!data) {
65
+        statusCode = 404;
66
+    }
67
+    NSURL * localUrl = [NSURL URLWithString:url.absoluteString];
68
+    NSString * mimeType = [self getMimeType:url.pathExtension];
69
+    id response = nil;
70
+    if (data && [self isMediaExtension:url.pathExtension]) {
71
+        response = [[NSURLResponse alloc] initWithURL:localUrl MIMEType:mimeType expectedContentLength:data.length textEncodingName:nil];
72
+    } else {
73
+        NSDictionary * headers = @{ @"Content-Type" : mimeType, @"Cache-Control": @"no-cache"};
74
+        response = [[NSHTTPURLResponse alloc] initWithURL:localUrl statusCode:statusCode HTTPVersion:nil headerFields:headers];
75
+    }
76
+
77
+    [urlSchemeTask didReceiveResponse:response];
78
+    [urlSchemeTask didReceiveData:data];
79
+    [urlSchemeTask didFinish];
80
+
81
+}
82
+
83
+- (void)webView:(nonnull WKWebView *)webView stopURLSchemeTask:(nonnull id<WKURLSchemeTask>)urlSchemeTask
84
+{
85
+
86
+}
87
+
88
+-(NSString *) getMimeType:(NSString *)fileExtension {
89
+    if (fileExtension && ![fileExtension isEqualToString:@""]) {
90
+        NSString *UTI = (__bridge_transfer NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)fileExtension, NULL);
91
+        NSString *contentType = (__bridge_transfer NSString *)UTTypeCopyPreferredTagWithClass((__bridge CFStringRef)UTI, kUTTagClassMIMEType);
92
+        return contentType ? contentType : @"application/octet-stream";
93
+    } else {
94
+        return @"text/html";
95
+    }
96
+}
97
+
98
+-(BOOL) isMediaExtension:(NSString *) pathExtension {
99
+    NSArray * mediaExtensions = @[@"m4v", @"mov", @"mp4",
100
+                           @"aac", @"ac3", @"aiff", @"au", @"flac", @"m4a", @"mp3", @"wav"];
101
+    if ([mediaExtensions containsObject:pathExtension.lowercaseString]) {
102
+        return YES;
103
+    }
104
+    return NO;
105
+}
106
+
107
+
108
+@end

+ 0
- 27
node_modules/cordova-ios/CordovaLib/Classes/Public/CDVUserAgentUtil.h View File

1
-/*
2
- Licensed to the Apache Software Foundation (ASF) under one
3
- or more contributor license agreements.  See the NOTICE file
4
- distributed with this work for additional information
5
- regarding copyright ownership.  The ASF licenses this file
6
- to you under the Apache License, Version 2.0 (the
7
- "License"); you may not use this file except in compliance
8
- with the License.  You may obtain a copy of the License at
9
-
10
- http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- Unless required by applicable law or agreed to in writing,
13
- software distributed under the License is distributed on an
14
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- KIND, either express or implied.  See the License for the
16
- specific language governing permissions and limitations
17
- under the License.
18
- */
19
-
20
-#import <Foundation/Foundation.h>
21
-
22
-@interface CDVUserAgentUtil : NSObject
23
-+ (NSString*)originalUserAgent;
24
-+ (void)acquireLock:(void (^)(NSInteger lockToken))block;
25
-+ (void)releaseLock:(NSInteger*)lockToken;
26
-+ (void)setUserAgent:(NSString*)value lockToken:(NSInteger)lockToken;
27
-@end

+ 0
- 162
node_modules/cordova-ios/CordovaLib/Classes/Public/CDVUserAgentUtil.m View File

1
-/*
2
- Licensed to the Apache Software Foundation (ASF) under one
3
- or more contributor license agreements.  See the NOTICE file
4
- distributed with this work for additional information
5
- regarding copyright ownership.  The ASF licenses this file
6
- to you under the Apache License, Version 2.0 (the
7
- "License"); you may not use this file except in compliance
8
- with the License.  You may obtain a copy of the License at
9
-
10
- http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- Unless required by applicable law or agreed to in writing,
13
- software distributed under the License is distributed on an
14
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- KIND, either express or implied.  See the License for the
16
- specific language governing permissions and limitations
17
- under the License.
18
- */
19
-
20
-#import "CDVUserAgentUtil.h"
21
-
22
-#import <UIKit/UIKit.h>
23
-
24
-// #define VerboseLog NSLog
25
-#define VerboseLog(...) do {} while (0)
26
-
27
-static NSString* const kCdvUserAgentKey = @"Cordova-User-Agent";
28
-static NSString* const kCdvUserAgentVersionKey = @"Cordova-User-Agent-Version";
29
-
30
-static NSString* gOriginalUserAgent = nil;
31
-static NSInteger gNextLockToken = 0;
32
-static NSInteger gCurrentLockToken = 0;
33
-static NSMutableArray* gPendingSetUserAgentBlocks = nil;
34
-
35
-#if WK_WEB_VIEW_ONLY
36
-#import <WebKit/WebKit.h>
37
-
38
-@interface WKWebView(SynchronousEvaluateJavaScript)
39
-- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script;
40
-@end
41
-
42
-@implementation WKWebView(SynchronousEvaluateJavaScript)
43
-
44
-- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script
45
-{
46
-    __block NSString *resultString = nil;
47
-    __block BOOL finished = NO;
48
-
49
-    [self evaluateJavaScript:script completionHandler:^(id result, NSError *error) {
50
-        if (error == nil) {
51
-            if (result != nil) {
52
-                resultString = [NSString stringWithFormat:@"%@", result];
53
-            }
54
-        } else {
55
-            NSLog(@"evaluateJavaScript error : %@", error.localizedDescription);
56
-        }
57
-        finished = YES;
58
-    }];
59
-
60
-    while (!finished) {
61
-        [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
62
-    }
63
-
64
-    return resultString;
65
-}
66
-@end
67
-#endif
68
-
69
-@implementation CDVUserAgentUtil
70
-
71
-+ (NSString*)originalUserAgent
72
-{
73
-    if (gOriginalUserAgent == nil) {
74
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppLocaleDidChange:)
75
-                                                     name:NSCurrentLocaleDidChangeNotification object:nil];
76
-
77
-        NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
78
-        NSString* systemVersion = [[UIDevice currentDevice] systemVersion];
79
-        NSString* localeStr = [[NSLocale currentLocale] localeIdentifier];
80
-        // Record the model since simulator can change it without re-install (CB-5420).
81
-        NSString* model = [UIDevice currentDevice].model;
82
-        // Record the version of the app so that we can bust the cache when it changes (CB-10078)
83
-        NSString* appVersion = [[NSBundle mainBundle] infoDictionary][@"CFBundleVersion"];
84
-        NSString* systemAndLocale = [NSString stringWithFormat:@"%@ %@ %@ %@", appVersion, model, systemVersion, localeStr];
85
-
86
-        NSString* cordovaUserAgentVersion = [userDefaults stringForKey:kCdvUserAgentVersionKey];
87
-        gOriginalUserAgent = [userDefaults stringForKey:kCdvUserAgentKey];
88
-        BOOL cachedValueIsOld = ![systemAndLocale isEqualToString:cordovaUserAgentVersion];
89
-
90
-        if ((gOriginalUserAgent == nil) || cachedValueIsOld) {
91
- #if WK_WEB_VIEW_ONLY
92
-            WKWebView* sampleWebView = [[WKWebView alloc] initWithFrame:CGRectZero];
93
- #else
94
-            UIWebView* sampleWebView = [[UIWebView alloc] initWithFrame:CGRectZero];
95
-#endif
96
-            gOriginalUserAgent = [sampleWebView stringByEvaluatingJavaScriptFromString:@"navigator.userAgent"];
97
-
98
-            [userDefaults setObject:gOriginalUserAgent forKey:kCdvUserAgentKey];
99
-            [userDefaults setObject:systemAndLocale forKey:kCdvUserAgentVersionKey];
100
-
101
-            [userDefaults synchronize];
102
-        }
103
-    }
104
-    return gOriginalUserAgent;
105
-}
106
-
107
-+ (void)onAppLocaleDidChange:(NSNotification*)notification
108
-{
109
-    // TODO: We should figure out how to update the user-agent of existing UIWebViews when this happens.
110
-    // Maybe use the PDF bug (noted in setUserAgent:).
111
-    gOriginalUserAgent = nil;
112
-}
113
-
114
-+ (void)acquireLock:(void (^)(NSInteger lockToken))block
115
-{
116
-    if (gCurrentLockToken == 0) {
117
-        gCurrentLockToken = ++gNextLockToken;
118
-        VerboseLog(@"Gave lock %d", gCurrentLockToken);
119
-        block(gCurrentLockToken);
120
-    } else {
121
-        if (gPendingSetUserAgentBlocks == nil) {
122
-            gPendingSetUserAgentBlocks = [[NSMutableArray alloc] initWithCapacity:4];
123
-        }
124
-        VerboseLog(@"Waiting for lock");
125
-        [gPendingSetUserAgentBlocks addObject:block];
126
-    }
127
-}
128
-
129
-+ (void)releaseLock:(NSInteger*)lockToken
130
-{
131
-    if (lockToken == nil || *lockToken == 0) {
132
-        return;
133
-    }
134
-    NSAssert(gCurrentLockToken == *lockToken, @"Got token %ld, expected %ld", (long)*lockToken, (long)gCurrentLockToken);
135
-
136
-    VerboseLog(@"Released lock %d", *lockToken);
137
-    if ([gPendingSetUserAgentBlocks count] > 0) {
138
-        void (^block)(NSInteger lockToken) = [gPendingSetUserAgentBlocks objectAtIndex:0];
139
-        [gPendingSetUserAgentBlocks removeObjectAtIndex:0];
140
-        gCurrentLockToken = ++gNextLockToken;
141
-        NSLog(@"Gave lock %ld", (long)gCurrentLockToken);
142
-        block(gCurrentLockToken);
143
-    } else {
144
-        gCurrentLockToken = 0;
145
-    }
146
-    *lockToken = 0;
147
-}
148
-
149
-+ (void)setUserAgent:(NSString*)value lockToken:(NSInteger)lockToken
150
-{
151
-    NSAssert(gCurrentLockToken == lockToken, @"Got token %ld, expected %ld", (long)lockToken, (long)gCurrentLockToken);
152
-    VerboseLog(@"User-Agent set to: %@", value);
153
-
154
-    // Setting the UserAgent must occur before a UIWebView is instantiated.
155
-    // It is read per instantiation, so it does not affect previously created views.
156
-    // Except! When a PDF is loaded, all currently active UIWebViews reload their
157
-    // User-Agent from the NSUserDefaults some time after the DidFinishLoad of the PDF bah!
158
-    NSDictionary* dict = [[NSDictionary alloc] initWithObjectsAndKeys:value, @"UserAgent", nil];
159
-    [[NSUserDefaults standardUserDefaults] registerDefaults:dict];
160
-}
161
-
162
-@end

+ 4
- 19
node_modules/cordova-ios/CordovaLib/Classes/Public/CDVViewController.h View File

34
     id <CDVCommandDelegate> _commandDelegate;
34
     id <CDVCommandDelegate> _commandDelegate;
35
     @protected
35
     @protected
36
     CDVCommandQueue* _commandQueue;
36
     CDVCommandQueue* _commandQueue;
37
-    NSString* _userAgent;
38
 }
37
 }
39
 
38
 
40
 @property (nonatomic, readonly, weak) IBOutlet UIView* webView;
39
 @property (nonatomic, readonly, weak) IBOutlet UIView* webView;
44
 @property (nonatomic, readonly, strong) NSMutableDictionary* settings;
43
 @property (nonatomic, readonly, strong) NSMutableDictionary* settings;
45
 @property (nonatomic, readonly, strong) NSXMLParser* configParser;
44
 @property (nonatomic, readonly, strong) NSXMLParser* configParser;
46
 
45
 
46
+@property (nonatomic, readwrite, copy) NSString* appScheme;
47
 @property (nonatomic, readwrite, copy) NSString* configFile;
47
 @property (nonatomic, readwrite, copy) NSString* configFile;
48
 @property (nonatomic, readwrite, copy) NSString* wwwFolderName;
48
 @property (nonatomic, readwrite, copy) NSString* wwwFolderName;
49
 @property (nonatomic, readwrite, copy) NSString* startPage;
49
 @property (nonatomic, readwrite, copy) NSString* startPage;
52
 @property (nonatomic, readonly, strong) id <CDVCommandDelegate> commandDelegate;
52
 @property (nonatomic, readonly, strong) id <CDVCommandDelegate> commandDelegate;
53
 
53
 
54
 /**
54
 /**
55
- The complete user agent that Cordova will use when sending web requests.
56
- */
57
-@property (nonatomic, readonly) NSString* userAgent;
58
-
59
-/**
60
- The base user agent data that Cordova will use to build its user agent.  If this
61
- property isn't set, Cordova will use the standard web view user agent as its
62
- base.
63
- */
64
-@property (nonatomic, readwrite, copy) NSString* baseUserAgent;
65
-
66
-/**
67
 	Takes/Gives an array of UIInterfaceOrientation (int) objects
55
 	Takes/Gives an array of UIInterfaceOrientation (int) objects
68
 	ex. UIInterfaceOrientationPortrait
56
 	ex. UIInterfaceOrientationPortrait
69
 */
57
 */
70
 @property (nonatomic, readwrite, strong) NSArray* supportedOrientations;
58
 @property (nonatomic, readwrite, strong) NSArray* supportedOrientations;
71
 
59
 
72
-/**
73
- The address of the lock token used for controlling access to setting the user-agent
74
- */
75
-@property (nonatomic, readonly) NSInteger* userAgentLockToken;
76
-
77
 - (UIView*)newCordovaViewWithFrame:(CGRect)bounds;
60
 - (UIView*)newCordovaViewWithFrame:(CGRect)bounds;
78
 
61
 
79
 - (NSString*)appURLScheme;
62
 - (NSString*)appURLScheme;
80
 - (NSURL*)errorURL;
63
 - (NSURL*)errorURL;
81
 
64
 
82
-- (UIColor*)colorFromColorString:(NSString*)colorString;
65
+- (UIColor*)colorFromColorString:(NSString*)colorString CDV_DEPRECATED(7.0.0, "Use BackgroundColor in xcassets");
83
 - (NSArray*)parseInterfaceOrientations:(NSArray*)orientations;
66
 - (NSArray*)parseInterfaceOrientations:(NSArray*)orientations;
84
 - (BOOL)supportsOrientation:(UIInterfaceOrientation)orientation;
67
 - (BOOL)supportsOrientation:(UIInterfaceOrientation)orientation;
85
 
68
 
89
 
72
 
90
 - (void)parseSettingsWithParser:(NSObject <NSXMLParserDelegate>*)delegate;
73
 - (void)parseSettingsWithParser:(NSObject <NSXMLParserDelegate>*)delegate;
91
 
74
 
75
+- (void)showLaunchScreen:(BOOL)visible;
76
+
92
 @end
77
 @end

+ 86
- 83
node_modules/cordova-ios/CordovaLib/Classes/Public/CDVViewController.m View File

20
 #import <objc/message.h>
20
 #import <objc/message.h>
21
 #import "CDV.h"
21
 #import "CDV.h"
22
 #import "CDVPlugin+Private.h"
22
 #import "CDVPlugin+Private.h"
23
+#import "CDVWebViewUIDelegate.h"
23
 #import "CDVConfigParser.h"
24
 #import "CDVConfigParser.h"
24
-#import "CDVUserAgentUtil.h"
25
 #import <AVFoundation/AVFoundation.h>
25
 #import <AVFoundation/AVFoundation.h>
26
 #import "NSDictionary+CordovaPreferences.h"
26
 #import "NSDictionary+CordovaPreferences.h"
27
-#import "CDVLocalStorage.h"
28
 #import "CDVCommandDelegateImpl.h"
27
 #import "CDVCommandDelegateImpl.h"
29
 #import <Foundation/NSCharacterSet.h>
28
 #import <Foundation/NSCharacterSet.h>
30
 
29
 
31
-@interface CDVViewController () {
32
-    NSInteger _userAgentLockToken;
33
-}
30
+@interface CDVViewController () { }
34
 
31
 
35
 @property (nonatomic, readwrite, strong) NSXMLParser* configParser;
32
 @property (nonatomic, readwrite, strong) NSXMLParser* configParser;
36
 @property (nonatomic, readwrite, strong) NSMutableDictionary* settings;
33
 @property (nonatomic, readwrite, strong) NSMutableDictionary* settings;
38
 @property (nonatomic, readwrite, strong) NSMutableArray* startupPluginNames;
35
 @property (nonatomic, readwrite, strong) NSMutableArray* startupPluginNames;
39
 @property (nonatomic, readwrite, strong) NSDictionary* pluginsMap;
36
 @property (nonatomic, readwrite, strong) NSDictionary* pluginsMap;
40
 @property (nonatomic, readwrite, strong) id <CDVWebViewEngineProtocol> webViewEngine;
37
 @property (nonatomic, readwrite, strong) id <CDVWebViewEngineProtocol> webViewEngine;
38
+@property (nonatomic, readwrite, strong) UIView* launchView;
41
 
39
 
42
 @property (readwrite, assign) BOOL initialized;
40
 @property (readwrite, assign) BOOL initialized;
43
 
41
 
50
 @synthesize supportedOrientations;
48
 @synthesize supportedOrientations;
51
 @synthesize pluginObjects, pluginsMap, startupPluginNames;
49
 @synthesize pluginObjects, pluginsMap, startupPluginNames;
52
 @synthesize configParser, settings;
50
 @synthesize configParser, settings;
53
-@synthesize wwwFolderName, startPage, initialized, openURL, baseUserAgent;
51
+@synthesize wwwFolderName, startPage, initialized, openURL;
54
 @synthesize commandDelegate = _commandDelegate;
52
 @synthesize commandDelegate = _commandDelegate;
55
 @synthesize commandQueue = _commandQueue;
53
 @synthesize commandQueue = _commandQueue;
56
 @synthesize webViewEngine = _webViewEngine;
54
 @synthesize webViewEngine = _webViewEngine;
73
         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppDidEnterBackground:)
71
         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppDidEnterBackground:)
74
                                                      name:UIApplicationDidEnterBackgroundNotification object:nil];
72
                                                      name:UIApplicationDidEnterBackgroundNotification object:nil];
75
 
73
 
74
+        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onWebViewPageDidLoad:)
75
+                                                     name:CDVPageDidLoadNotification object:nil];
76
+
76
         // read from UISupportedInterfaceOrientations (or UISupportedInterfaceOrientations~iPad, if its iPad) from -Info.plist
77
         // read from UISupportedInterfaceOrientations (or UISupportedInterfaceOrientations~iPad, if its iPad) from -Info.plist
77
         self.supportedOrientations = [self parseInterfaceOrientations:
78
         self.supportedOrientations = [self parseInterfaceOrientations:
78
             [[[NSBundle mainBundle] infoDictionary] objectForKey:@"UISupportedInterfaceOrientations"]];
79
             [[[NSBundle mainBundle] infoDictionary] objectForKey:@"UISupportedInterfaceOrientations"]];
284
     }
285
     }
285
     [self.settings setCordovaSetting:backupWebStorageType forKey:@"BackupWebStorage"];
286
     [self.settings setCordovaSetting:backupWebStorageType forKey:@"BackupWebStorage"];
286
 
287
 
287
-    [CDVLocalStorage __fixupDatabaseLocationsWithBackupType:backupWebStorageType];
288
+    // // Instantiate the Launch screen /////////
289
+
290
+    if (!self.launchView) {
291
+        [self createLaunchView];
292
+    }
288
 
293
 
289
     // // Instantiate the WebView ///////////////
294
     // // Instantiate the WebView ///////////////
290
 
295
 
294
 
299
 
295
     // /////////////////
300
     // /////////////////
296
 
301
 
297
-    /*
298
-     * 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.
299
-        With minimum iOS 7/8 supported, only first clause applies.
300
-     */
301
-    if ([backupWebStorageType isEqualToString:@"local"]) {
302
-        NSString* localStorageFeatureName = @"localstorage";
303
-        if ([self.pluginsMap objectForKey:localStorageFeatureName]) { // plugin specified in config
304
-            [self.startupPluginNames addObject:localStorageFeatureName];
305
-        }
306
-    }
307
-
308
     if ([self.startupPluginNames count] > 0) {
302
     if ([self.startupPluginNames count] > 0) {
309
         [CDVTimer start:@"TotalPluginStartup"];
303
         [CDVTimer start:@"TotalPluginStartup"];
310
 
304
 
319
 
313
 
320
     // /////////////////
314
     // /////////////////
321
     NSURL* appURL = [self appUrl];
315
     NSURL* appURL = [self appUrl];
322
-    __weak __typeof__(self) weakSelf = self;
323
-
324
-    [CDVUserAgentUtil acquireLock:^(NSInteger lockToken) {
325
-        // Fix the memory leak caused by the strong reference.
326
-        [weakSelf setLockToken:lockToken];
327
-        if (appURL) {
328
-            NSURLRequest* appReq = [NSURLRequest requestWithURL:appURL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:20.0];
329
-            [self.webViewEngine loadRequest:appReq];
316
+
317
+    if (appURL) {
318
+        NSURLRequest* appReq = [NSURLRequest requestWithURL:appURL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:20.0];
319
+        [self.webViewEngine loadRequest:appReq];
320
+    } else {
321
+        NSString* loadErr = [NSString stringWithFormat:@"ERROR: Start Page at '%@/%@' was not found.", self.wwwFolderName, self.startPage];
322
+        NSLog(@"%@", loadErr);
323
+
324
+        NSURL* errorUrl = [self errorURL];
325
+        if (errorUrl) {
326
+            errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [loadErr stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLPathAllowedCharacterSet]] relativeToURL:errorUrl];
327
+            NSLog(@"%@", [errorUrl absoluteString]);
328
+            [self.webViewEngine loadRequest:[NSURLRequest requestWithURL:errorUrl]];
330
         } else {
329
         } else {
331
-            NSString* loadErr = [NSString stringWithFormat:@"ERROR: Start Page at '%@/%@' was not found.", self.wwwFolderName, self.startPage];
332
-            NSLog(@"%@", loadErr);
333
-
334
-            NSURL* errorUrl = [self errorURL];
335
-            if (errorUrl) {
336
-                errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [loadErr stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLPathAllowedCharacterSet]] relativeToURL:errorUrl];
337
-                NSLog(@"%@", [errorUrl absoluteString]);
338
-                [self.webViewEngine loadRequest:[NSURLRequest requestWithURL:errorUrl]];
339
-            } else {
340
-                NSString* html = [NSString stringWithFormat:@"<html><body> %@ </body></html>", loadErr];
341
-                [self.webViewEngine loadHTMLString:html baseURL:nil];
342
-            }
330
+            NSString* html = [NSString stringWithFormat:@"<html><body> %@ </body></html>", loadErr];
331
+            [self.webViewEngine loadHTMLString:html baseURL:nil];
343
         }
332
         }
344
-    }];
345
-
333
+    }
346
     // /////////////////
334
     // /////////////////
347
 
335
 
348
-    NSString* bgColorString = [self.settings cordovaSettingForKey:@"BackgroundColor"];
349
-    UIColor* bgColor = [self colorFromColorString:bgColorString];
336
+    UIColor* bgColor = [UIColor colorNamed:@"BackgroundColor"] ?: UIColor.whiteColor;
337
+    [self.launchView setBackgroundColor:bgColor];
350
     [self.webView setBackgroundColor:bgColor];
338
     [self.webView setBackgroundColor:bgColor];
351
 }
339
 }
352
 
340
 
353
-- (void)setLockToken:(NSInteger)lockToken
354
-{
355
-	_userAgentLockToken = lockToken;
356
-	[CDVUserAgentUtil setUserAgent:self.userAgent lockToken:lockToken];
357
-}
358
-
359
 -(void)viewWillAppear:(BOOL)animated
341
 -(void)viewWillAppear:(BOOL)animated
360
 {
342
 {
361
     [super viewWillAppear:animated];
343
     [super viewWillAppear:animated];
478
     return YES;
460
     return YES;
479
 }
461
 }
480
 
462
 
481
-// CB-12098
482
-#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000
483
-- (NSUInteger)supportedInterfaceOrientations
484
-#else
485
 - (UIInterfaceOrientationMask)supportedInterfaceOrientations
463
 - (UIInterfaceOrientationMask)supportedInterfaceOrientations
486
-#endif
487
 {
464
 {
488
     NSUInteger ret = 0;
465
     NSUInteger ret = 0;
489
 
466
 
505
 
482
 
506
 - (BOOL)supportsOrientation:(UIInterfaceOrientation)orientation
483
 - (BOOL)supportsOrientation:(UIInterfaceOrientation)orientation
507
 {
484
 {
508
-    return [self.supportedOrientations containsObject:[NSNumber numberWithInt:orientation]];
485
+    return [self.supportedOrientations containsObject:@(orientation)];
509
 }
486
 }
510
 
487
 
511
 - (UIView*)newCordovaViewWithFrame:(CGRect)bounds
488
 - (UIView*)newCordovaViewWithFrame:(CGRect)bounds
514
     NSString* webViewEngineClass = [self.settings cordovaSettingForKey:@"CordovaWebViewEngine"];
491
     NSString* webViewEngineClass = [self.settings cordovaSettingForKey:@"CordovaWebViewEngine"];
515
 
492
 
516
     if (!defaultWebViewEngineClass) {
493
     if (!defaultWebViewEngineClass) {
517
-        defaultWebViewEngineClass = @"CDVUIWebViewEngine";
494
+        defaultWebViewEngineClass = @"CDVWebViewEngine";
518
     }
495
     }
519
     if (!webViewEngineClass) {
496
     if (!webViewEngineClass) {
520
         webViewEngineClass = defaultWebViewEngineClass;
497
         webViewEngineClass = defaultWebViewEngineClass;
523
     // Find webViewEngine
500
     // Find webViewEngine
524
     if (NSClassFromString(webViewEngineClass)) {
501
     if (NSClassFromString(webViewEngineClass)) {
525
         self.webViewEngine = [[NSClassFromString(webViewEngineClass) alloc] initWithFrame:bounds];
502
         self.webViewEngine = [[NSClassFromString(webViewEngineClass) alloc] initWithFrame:bounds];
526
-        // 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
503
+        // 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
527
         if (!self.webViewEngine || ![self.webViewEngine conformsToProtocol:@protocol(CDVWebViewEngineProtocol)] || ![self.webViewEngine canLoadRequest:[NSURLRequest requestWithURL:self.appUrl]]) {
504
         if (!self.webViewEngine || ![self.webViewEngine conformsToProtocol:@protocol(CDVWebViewEngineProtocol)] || ![self.webViewEngine canLoadRequest:[NSURLRequest requestWithURL:self.appUrl]]) {
528
             self.webViewEngine = [[NSClassFromString(defaultWebViewEngineClass) alloc] initWithFrame:bounds];
505
             self.webViewEngine = [[NSClassFromString(defaultWebViewEngineClass) alloc] initWithFrame:bounds];
529
         }
506
         }
538
     return self.webViewEngine.engineWebView;
515
     return self.webViewEngine.engineWebView;
539
 }
516
 }
540
 
517
 
541
-- (NSString*)userAgent
518
+- (void)createLaunchView
542
 {
519
 {
543
-    if (_userAgent != nil) {
544
-        return _userAgent;
545
-    }
520
+    CGRect webViewBounds = self.view.bounds;
521
+    webViewBounds.origin = self.view.bounds.origin;
546
 
522
 
547
-    NSString* localBaseUserAgent;
548
-    if (self.baseUserAgent != nil) {
549
-        localBaseUserAgent = self.baseUserAgent;
550
-    } else if ([self.settings cordovaSettingForKey:@"OverrideUserAgent"] != nil) {
551
-        localBaseUserAgent = [self.settings cordovaSettingForKey:@"OverrideUserAgent"];
552
-    } else {
553
-        localBaseUserAgent = [CDVUserAgentUtil originalUserAgent];
554
-    }
555
-    NSString* appendUserAgent = [self.settings cordovaSettingForKey:@"AppendUserAgent"];
556
-    if (appendUserAgent) {
557
-        _userAgent = [NSString stringWithFormat:@"%@ %@", localBaseUserAgent, appendUserAgent];
558
-    } else {
559
-        // Use our address as a unique number to append to the User-Agent.
560
-        _userAgent = localBaseUserAgent;
523
+    UIView* view = [[UIView alloc] initWithFrame:webViewBounds];
524
+
525
+    NSString* launchStoryboardName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UILaunchStoryboardName"];
526
+    if (launchStoryboardName != nil) {
527
+        UIStoryboard* storyboard = [UIStoryboard storyboardWithName:launchStoryboardName bundle:[NSBundle mainBundle]];
528
+        UIViewController* vc = [storyboard instantiateInitialViewController];
529
+
530
+        [view addSubview:vc.view];
561
     }
531
     }
562
-    return _userAgent;
532
+
533
+    self.launchView = view;
534
+    [self.view addSubview:view];
563
 }
535
 }
564
 
536
 
565
 - (void)createGapView
537
 - (void)createGapView
566
 {
538
 {
567
     CGRect webViewBounds = self.view.bounds;
539
     CGRect webViewBounds = self.view.bounds;
568
-
569
     webViewBounds.origin = self.view.bounds.origin;
540
     webViewBounds.origin = self.view.bounds.origin;
570
 
541
 
571
     UIView* view = [self newCordovaViewWithFrame:webViewBounds];
542
     UIView* view = [self newCordovaViewWithFrame:webViewBounds];
572
-
543
+    view.hidden = YES;
573
     view.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
544
     view.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
545
+
574
     [self.view addSubview:view];
546
     [self.view addSubview:view];
575
     [self.view sendSubviewToBack:view];
547
     [self.view sendSubviewToBack:view];
576
 }
548
 }
786
     [self.commandDelegate evalJs:@"cordova.fireDocumentEvent('pause', null, true);" scheduledOnRunLoop:NO];
758
     [self.commandDelegate evalJs:@"cordova.fireDocumentEvent('pause', null, true);" scheduledOnRunLoop:NO];
787
 }
759
 }
788
 
760
 
761
+/**
762
+ Show the webview and fade out the intermediary view
763
+ This is to prevent the flashing of the mainViewController
764
+ */
765
+- (void)onWebViewPageDidLoad:(NSNotification*)notification
766
+{
767
+    self.webView.hidden = NO;
768
+
769
+    if ([self.settings cordovaBoolSettingForKey:@"AutoHideSplashScreen" defaultValue:YES]) {
770
+       [self showLaunchScreen:NO];
771
+    }
772
+}
773
+
774
+/**
775
+ Method to be called from the plugin JavaScript to show or hide the launch screen.
776
+ */
777
+- (void)showLaunchScreen:(BOOL)visible
778
+{
779
+    CGFloat splashScreenDelay = [self.settings cordovaFloatSettingForKey:@"SplashScreenDelay" defaultValue:0];
780
+
781
+    // AnimateWithDuration takes seconds but cordova documentation specifies milliseconds
782
+    CGFloat fadeSplashScreenDuration = [self.settings cordovaFloatSettingForKey:@"FadeSplashScreenDuration" defaultValue:250];
783
+
784
+    // Setting minimum value for fade to 0.25 seconds
785
+    fadeSplashScreenDuration = fadeSplashScreenDuration < 250 ? 250 : fadeSplashScreenDuration;
786
+
787
+    // Divide by 1000 because config returns milliseconds and NSTimer takes seconds
788
+    CGFloat delayToFade = (MAX(splashScreenDelay, fadeSplashScreenDuration) - fadeSplashScreenDuration)/1000;
789
+    CGFloat fadeDuration = fadeSplashScreenDuration/1000;
790
+
791
+    [NSTimer scheduledTimerWithTimeInterval:delayToFade repeats:NO block:^(NSTimer * _Nonnull timer) {
792
+        [UIView animateWithDuration:fadeDuration animations:^{
793
+            [self.launchView setAlpha:(visible ? 1 : 0)];
794
+        }];
795
+    }];
796
+}
797
+
789
 // ///////////////////////
798
 // ///////////////////////
790
 
799
 
791
 - (void)dealloc
800
 - (void)dealloc
792
 {
801
 {
793
     [[NSNotificationCenter defaultCenter] removeObserver:self];
802
     [[NSNotificationCenter defaultCenter] removeObserver:self];
794
 
803
 
795
-    [CDVUserAgentUtil releaseLock:&_userAgentLockToken];
796
     [_commandQueue dispose];
804
     [_commandQueue dispose];
797
     [[self.pluginObjects allValues] makeObjectsPerformSelector:@selector(dispose)];
805
     [[self.pluginObjects allValues] makeObjectsPerformSelector:@selector(dispose)];
798
 
806
 
802
     self.webViewEngine = nil;
810
     self.webViewEngine = nil;
803
 }
811
 }
804
 
812
 
805
-- (NSInteger*)userAgentLockToken
806
-{
807
-    return &_userAgentLockToken;
808
-}
809
-
810
 @end
813
 @end

+ 0
- 1
node_modules/cordova-ios/CordovaLib/Classes/Public/CDVWebViewEngineProtocol.h View File

20
 #import <UIKit/UIKit.h>
20
 #import <UIKit/UIKit.h>
21
 
21
 
22
 #define kCDVWebViewEngineScriptMessageHandlers @"kCDVWebViewEngineScriptMessageHandlers"
22
 #define kCDVWebViewEngineScriptMessageHandlers @"kCDVWebViewEngineScriptMessageHandlers"
23
-#define kCDVWebViewEngineUIWebViewDelegate @"kCDVWebViewEngineUIWebViewDelegate"
24
 #define kCDVWebViewEngineWKNavigationDelegate @"kCDVWebViewEngineWKNavigationDelegate"
23
 #define kCDVWebViewEngineWKNavigationDelegate @"kCDVWebViewEngineWKNavigationDelegate"
25
 #define kCDVWebViewEngineWKUIDelegate @"kCDVWebViewEngineWKUIDelegate"
24
 #define kCDVWebViewEngineWKUIDelegate @"kCDVWebViewEngineWKUIDelegate"
26
 #define kCDVWebViewEngineWebViewPreferences @"kCDVWebViewEngineWebViewPreferences"
25
 #define kCDVWebViewEngineWebViewPreferences @"kCDVWebViewEngineWebViewPreferences"

+ 31
- 2
node_modules/cordova-ios/CordovaLib/Classes/Public/NSDictionary+CordovaPreferences.m View File

32
     BOOL value = defaultValue;
32
     BOOL value = defaultValue;
33
     id prefObj = [self cordovaSettingForKey:key];
33
     id prefObj = [self cordovaSettingForKey:key];
34
 
34
 
35
-    if (prefObj != nil) {
36
-        value = [(NSNumber*)prefObj boolValue];
35
+    if (prefObj == nil) {
36
+        NSLog(@"The preference key \"%@\" is not defined and will default to \"%@\"",
37
+              key,
38
+              (defaultValue ? @"TRUE" : @"FALSE"));
39
+
40
+        return value;
41
+    }
42
+
43
+    if ([prefObj isKindOfClass:NSString.class]) {
44
+        prefObj = [prefObj lowercaseString];
45
+
46
+        if (
47
+            // True Case
48
+            [prefObj isEqualToString:@"true"] ||
49
+            [prefObj isEqualToString:@"1"] ||
50
+            // False Case
51
+            [prefObj isEqualToString:@"false"] ||
52
+            [prefObj isEqualToString:@"0"]
53
+            )
54
+        {
55
+            value = [prefObj isEqualToString:@"true"] || [prefObj isEqualToString:@"1"];
56
+        }
57
+    } else if (
58
+               [prefObj isKindOfClass:NSNumber.class] &&
59
+               (
60
+                [prefObj isEqual: @YES] ||
61
+                [prefObj isEqual: @NO]
62
+                )
63
+               )
64
+    {
65
+        value = [prefObj isEqual: @YES];
37
     }
66
     }
38
 
67
 
39
     return value;
68
     return value;

+ 1
- 2
node_modules/cordova-ios/CordovaLib/Cordova/Cordova.h View File

38
 #import <Cordova/CDVCommandDelegate.h>
38
 #import <Cordova/CDVCommandDelegate.h>
39
 #import <Cordova/CDVCommandQueue.h>
39
 #import <Cordova/CDVCommandQueue.h>
40
 #import <Cordova/CDVConfigParser.h>
40
 #import <Cordova/CDVConfigParser.h>
41
-#import <Cordova/CDVURLProtocol.h>
42
 #import <Cordova/CDVInvokedUrlCommand.h>
41
 #import <Cordova/CDVInvokedUrlCommand.h>
43
 #import <Cordova/CDVPlugin+Resources.h>
42
 #import <Cordova/CDVPlugin+Resources.h>
44
 #import <Cordova/CDVWebViewEngineProtocol.h>
43
 #import <Cordova/CDVWebViewEngineProtocol.h>
45
 #import <Cordova/NSDictionary+CordovaPreferences.h>
44
 #import <Cordova/NSDictionary+CordovaPreferences.h>
46
 #import <Cordova/NSMutableArray+QueueAdditions.h>
45
 #import <Cordova/NSMutableArray+QueueAdditions.h>
46
+#import <Cordova/CDVWebViewUIDelegate.h>
47
 #import <Cordova/CDVWhitelist.h>
47
 #import <Cordova/CDVWhitelist.h>
48
 #import <Cordova/CDVScreenOrientationDelegate.h>
48
 #import <Cordova/CDVScreenOrientationDelegate.h>
49
 #import <Cordova/CDVTimer.h>
49
 #import <Cordova/CDVTimer.h>
50
-#import <Cordova/CDVUserAgentUtil.h>

+ 99
- 101
node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj View File

3
 	archiveVersion = 1;
3
 	archiveVersion = 1;
4
 	classes = {
4
 	classes = {
5
 	};
5
 	};
6
-	objectVersion = 48;
6
+	objectVersion = 52;
7
 	objects = {
7
 	objects = {
8
 
8
 
9
 /* Begin PBXBuildFile section */
9
 /* Begin PBXBuildFile section */
10
 		28BFF9141F355A4E00DDF01A /* CDVLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 28BFF9121F355A4E00DDF01A /* CDVLogger.h */; };
10
 		28BFF9141F355A4E00DDF01A /* CDVLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 28BFF9121F355A4E00DDF01A /* CDVLogger.h */; };
11
 		28BFF9151F355A4E00DDF01A /* CDVLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 28BFF9131F355A4E00DDF01A /* CDVLogger.m */; };
11
 		28BFF9151F355A4E00DDF01A /* CDVLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 28BFF9131F355A4E00DDF01A /* CDVLogger.m */; };
12
-		30193A501AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 30193A4E1AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.m */; };
13
-		30193A511AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 30193A4F1AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.h */; };
12
+		2F4D42BC23F218BA00501999 /* CDVURLSchemeHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 2F4D42BA23F218BA00501999 /* CDVURLSchemeHandler.h */; };
13
+		2F4D42BD23F218BA00501999 /* CDVURLSchemeHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F4D42BB23F218BA00501999 /* CDVURLSchemeHandler.m */; };
14
+		2FCCEA17247E7366007276A8 /* CDVLaunchScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E714D3423F535B500A321AF /* CDVLaunchScreen.m */; };
15
+		2FCCEA18247E7366007276A8 /* CDVLaunchScreen.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E714D3223F535B500A321AF /* CDVLaunchScreen.h */; };
14
 		3093E2231B16D6A3003F381A /* CDVIntentAndNavigationFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3093E2211B16D6A3003F381A /* CDVIntentAndNavigationFilter.h */; };
16
 		3093E2231B16D6A3003F381A /* CDVIntentAndNavigationFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3093E2211B16D6A3003F381A /* CDVIntentAndNavigationFilter.h */; };
15
 		3093E2241B16D6A3003F381A /* CDVIntentAndNavigationFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 3093E2221B16D6A3003F381A /* CDVIntentAndNavigationFilter.m */; };
17
 		3093E2241B16D6A3003F381A /* CDVIntentAndNavigationFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 3093E2221B16D6A3003F381A /* CDVIntentAndNavigationFilter.m */; };
16
-		7E7F69B61ABA35D8007546F4 /* CDVLocalStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CFB1AB9028C008C4574 /* CDVLocalStorage.h */; };
17
-		7E7F69B81ABA368F007546F4 /* CDVUIWebViewEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D001AB9028C008C4574 /* CDVUIWebViewEngine.h */; };
18
+		4E23F8FB23E16E96006CD852 /* CDVWebViewProcessPoolFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E23F8F523E16E96006CD852 /* CDVWebViewProcessPoolFactory.m */; };
19
+		4E23F8FC23E16E96006CD852 /* CDVWebViewUIDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E23F8F623E16E96006CD852 /* CDVWebViewUIDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
20
+		4E23F8FD23E16E96006CD852 /* CDVWebViewUIDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E23F8F723E16E96006CD852 /* CDVWebViewUIDelegate.m */; };
21
+		4E23F8FE23E16E96006CD852 /* CDVWebViewEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E23F8F823E16E96006CD852 /* CDVWebViewEngine.m */; };
22
+		4E23F8FF23E16E96006CD852 /* CDVWebViewProcessPoolFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E23F8F923E16E96006CD852 /* CDVWebViewProcessPoolFactory.h */; };
23
+		4E23F90023E16E96006CD852 /* CDVWebViewEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E23F8FA23E16E96006CD852 /* CDVWebViewEngine.h */; };
24
+		4E23F90323E17FFA006CD852 /* CDVWebViewUIDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E23F8F623E16E96006CD852 /* CDVWebViewUIDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
25
+		4E714D3623F535B500A321AF /* CDVLaunchScreen.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E714D3223F535B500A321AF /* CDVLaunchScreen.h */; };
26
+		4E714D3823F535B500A321AF /* CDVLaunchScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E714D3423F535B500A321AF /* CDVLaunchScreen.m */; };
18
 		7E7F69B91ABA3692007546F4 /* CDVHandleOpenURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF81AB9028C008C4574 /* CDVHandleOpenURL.h */; };
27
 		7E7F69B91ABA3692007546F4 /* CDVHandleOpenURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF81AB9028C008C4574 /* CDVHandleOpenURL.h */; };
19
 		7ED95D021AB9028C008C4574 /* CDVDebug.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF21AB9028C008C4574 /* CDVDebug.h */; };
28
 		7ED95D021AB9028C008C4574 /* CDVDebug.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF21AB9028C008C4574 /* CDVDebug.h */; };
20
 		7ED95D031AB9028C008C4574 /* CDVJSON_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF31AB9028C008C4574 /* CDVJSON_private.h */; };
29
 		7ED95D031AB9028C008C4574 /* CDVJSON_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF31AB9028C008C4574 /* CDVJSON_private.h */; };
21
 		7ED95D041AB9028C008C4574 /* CDVJSON_private.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CF41AB9028C008C4574 /* CDVJSON_private.m */; };
30
 		7ED95D041AB9028C008C4574 /* CDVJSON_private.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CF41AB9028C008C4574 /* CDVJSON_private.m */; };
22
 		7ED95D051AB9028C008C4574 /* CDVPlugin+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF51AB9028C008C4574 /* CDVPlugin+Private.h */; };
31
 		7ED95D051AB9028C008C4574 /* CDVPlugin+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF51AB9028C008C4574 /* CDVPlugin+Private.h */; };
23
 		7ED95D071AB9028C008C4574 /* CDVHandleOpenURL.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CF91AB9028C008C4574 /* CDVHandleOpenURL.m */; };
32
 		7ED95D071AB9028C008C4574 /* CDVHandleOpenURL.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CF91AB9028C008C4574 /* CDVHandleOpenURL.m */; };
24
-		7ED95D091AB9028C008C4574 /* CDVLocalStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CFC1AB9028C008C4574 /* CDVLocalStorage.m */; };
25
-		7ED95D0A1AB9028C008C4574 /* CDVUIWebViewDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CFE1AB9028C008C4574 /* CDVUIWebViewDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
26
-		7ED95D0B1AB9028C008C4574 /* CDVUIWebViewDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CFF1AB9028C008C4574 /* CDVUIWebViewDelegate.m */; };
27
-		7ED95D0D1AB9028C008C4574 /* CDVUIWebViewEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D011AB9028C008C4574 /* CDVUIWebViewEngine.m */; };
28
 		7ED95D351AB9029B008C4574 /* CDV.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D0F1AB9029B008C4574 /* CDV.h */; settings = {ATTRIBUTES = (Public, ); }; };
33
 		7ED95D351AB9029B008C4574 /* CDV.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D0F1AB9029B008C4574 /* CDV.h */; settings = {ATTRIBUTES = (Public, ); }; };
29
 		7ED95D361AB9029B008C4574 /* CDVAppDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D101AB9029B008C4574 /* CDVAppDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
34
 		7ED95D361AB9029B008C4574 /* CDVAppDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D101AB9029B008C4574 /* CDVAppDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
30
 		7ED95D371AB9029B008C4574 /* CDVAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D111AB9029B008C4574 /* CDVAppDelegate.m */; };
35
 		7ED95D371AB9029B008C4574 /* CDVAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D111AB9029B008C4574 /* CDVAppDelegate.m */; };
48
 		7ED95D491AB9029B008C4574 /* CDVScreenOrientationDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D231AB9029B008C4574 /* CDVScreenOrientationDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
53
 		7ED95D491AB9029B008C4574 /* CDVScreenOrientationDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D231AB9029B008C4574 /* CDVScreenOrientationDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
49
 		7ED95D4A1AB9029B008C4574 /* CDVTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D241AB9029B008C4574 /* CDVTimer.h */; settings = {ATTRIBUTES = (Public, ); }; };
54
 		7ED95D4A1AB9029B008C4574 /* CDVTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D241AB9029B008C4574 /* CDVTimer.h */; settings = {ATTRIBUTES = (Public, ); }; };
50
 		7ED95D4B1AB9029B008C4574 /* CDVTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D251AB9029B008C4574 /* CDVTimer.m */; };
55
 		7ED95D4B1AB9029B008C4574 /* CDVTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D251AB9029B008C4574 /* CDVTimer.m */; };
51
-		7ED95D4C1AB9029B008C4574 /* CDVURLProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D261AB9029B008C4574 /* CDVURLProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
52
-		7ED95D4D1AB9029B008C4574 /* CDVURLProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D271AB9029B008C4574 /* CDVURLProtocol.m */; };
53
-		7ED95D4E1AB9029B008C4574 /* CDVUserAgentUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D281AB9029B008C4574 /* CDVUserAgentUtil.h */; settings = {ATTRIBUTES = (Public, ); }; };
54
-		7ED95D4F1AB9029B008C4574 /* CDVUserAgentUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D291AB9029B008C4574 /* CDVUserAgentUtil.m */; };
55
 		7ED95D501AB9029B008C4574 /* CDVViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2A1AB9029B008C4574 /* CDVViewController.h */; settings = {ATTRIBUTES = (Public, ); }; };
56
 		7ED95D501AB9029B008C4574 /* CDVViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2A1AB9029B008C4574 /* CDVViewController.h */; settings = {ATTRIBUTES = (Public, ); }; };
56
 		7ED95D511AB9029B008C4574 /* CDVViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D2B1AB9029B008C4574 /* CDVViewController.m */; };
57
 		7ED95D511AB9029B008C4574 /* CDVViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D2B1AB9029B008C4574 /* CDVViewController.m */; };
57
 		7ED95D521AB9029B008C4574 /* CDVWebViewEngineProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2C1AB9029B008C4574 /* CDVWebViewEngineProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
58
 		7ED95D521AB9029B008C4574 /* CDVWebViewEngineProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2C1AB9029B008C4574 /* CDVWebViewEngineProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
70
 		9052DE772150D040008E83D4 /* CDVPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D201AB9029B008C4574 /* CDVPlugin.m */; };
71
 		9052DE772150D040008E83D4 /* CDVPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D201AB9029B008C4574 /* CDVPlugin.m */; };
71
 		9052DE782150D040008E83D4 /* CDVPluginResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D221AB9029B008C4574 /* CDVPluginResult.m */; };
72
 		9052DE782150D040008E83D4 /* CDVPluginResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D221AB9029B008C4574 /* CDVPluginResult.m */; };
72
 		9052DE792150D040008E83D4 /* CDVTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D251AB9029B008C4574 /* CDVTimer.m */; };
73
 		9052DE792150D040008E83D4 /* CDVTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D251AB9029B008C4574 /* CDVTimer.m */; };
73
-		9052DE7A2150D040008E83D4 /* CDVURLProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D271AB9029B008C4574 /* CDVURLProtocol.m */; };
74
-		9052DE7B2150D040008E83D4 /* CDVUserAgentUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D291AB9029B008C4574 /* CDVUserAgentUtil.m */; };
75
 		9052DE7C2150D040008E83D4 /* CDVViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D2B1AB9029B008C4574 /* CDVViewController.m */; };
74
 		9052DE7C2150D040008E83D4 /* CDVViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D2B1AB9029B008C4574 /* CDVViewController.m */; };
76
 		9052DE7D2150D040008E83D4 /* CDVWhitelist.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D2E1AB9029B008C4574 /* CDVWhitelist.m */; };
75
 		9052DE7D2150D040008E83D4 /* CDVWhitelist.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D2E1AB9029B008C4574 /* CDVWhitelist.m */; };
77
 		9052DE7E2150D040008E83D4 /* NSDictionary+CordovaPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D321AB9029B008C4574 /* NSDictionary+CordovaPreferences.m */; };
76
 		9052DE7E2150D040008E83D4 /* NSDictionary+CordovaPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D321AB9029B008C4574 /* NSDictionary+CordovaPreferences.m */; };
81
 		9052DE822150D040008E83D4 /* CDVGestureHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = A3B082D31BB15CEA00D8DC35 /* CDVGestureHandler.m */; };
80
 		9052DE822150D040008E83D4 /* CDVGestureHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = A3B082D31BB15CEA00D8DC35 /* CDVGestureHandler.m */; };
82
 		9052DE832150D040008E83D4 /* CDVIntentAndNavigationFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 3093E2221B16D6A3003F381A /* CDVIntentAndNavigationFilter.m */; };
81
 		9052DE832150D040008E83D4 /* CDVIntentAndNavigationFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 3093E2221B16D6A3003F381A /* CDVIntentAndNavigationFilter.m */; };
83
 		9052DE842150D040008E83D4 /* CDVHandleOpenURL.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CF91AB9028C008C4574 /* CDVHandleOpenURL.m */; };
82
 		9052DE842150D040008E83D4 /* CDVHandleOpenURL.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CF91AB9028C008C4574 /* CDVHandleOpenURL.m */; };
84
-		9052DE852150D040008E83D4 /* CDVLocalStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CFC1AB9028C008C4574 /* CDVLocalStorage.m */; };
85
-		9052DE862150D040008E83D4 /* CDVUIWebViewNavigationDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 30193A4E1AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.m */; };
86
-		9052DE872150D040008E83D4 /* CDVUIWebViewDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CFF1AB9028C008C4574 /* CDVUIWebViewDelegate.m */; };
87
-		9052DE882150D040008E83D4 /* CDVUIWebViewEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D011AB9028C008C4574 /* CDVUIWebViewEngine.m */; };
88
 		9052DE892150D06B008E83D4 /* CDVDebug.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF21AB9028C008C4574 /* CDVDebug.h */; };
83
 		9052DE892150D06B008E83D4 /* CDVDebug.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF21AB9028C008C4574 /* CDVDebug.h */; };
89
 		9052DE8A2150D06B008E83D4 /* CDVJSON_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF31AB9028C008C4574 /* CDVJSON_private.h */; };
84
 		9052DE8A2150D06B008E83D4 /* CDVJSON_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF31AB9028C008C4574 /* CDVJSON_private.h */; };
90
 		9052DE8B2150D06B008E83D4 /* CDVPlugin+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF51AB9028C008C4574 /* CDVPlugin+Private.h */; };
85
 		9052DE8B2150D06B008E83D4 /* CDVPlugin+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF51AB9028C008C4574 /* CDVPlugin+Private.h */; };
92
 		9052DE8D2150D06B008E83D4 /* CDVGestureHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = A3B082D21BB15CEA00D8DC35 /* CDVGestureHandler.h */; };
87
 		9052DE8D2150D06B008E83D4 /* CDVGestureHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = A3B082D21BB15CEA00D8DC35 /* CDVGestureHandler.h */; };
93
 		9052DE8E2150D06B008E83D4 /* CDVIntentAndNavigationFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3093E2211B16D6A3003F381A /* CDVIntentAndNavigationFilter.h */; };
88
 		9052DE8E2150D06B008E83D4 /* CDVIntentAndNavigationFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3093E2211B16D6A3003F381A /* CDVIntentAndNavigationFilter.h */; };
94
 		9052DE8F2150D06B008E83D4 /* CDVHandleOpenURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF81AB9028C008C4574 /* CDVHandleOpenURL.h */; };
89
 		9052DE8F2150D06B008E83D4 /* CDVHandleOpenURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF81AB9028C008C4574 /* CDVHandleOpenURL.h */; };
95
-		9052DE902150D06B008E83D4 /* CDVLocalStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CFB1AB9028C008C4574 /* CDVLocalStorage.h */; };
96
-		9052DE912150D06B008E83D4 /* CDVUIWebViewNavigationDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 30193A4F1AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.h */; };
97
-		9052DE922150D06B008E83D4 /* CDVUIWebViewEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D001AB9028C008C4574 /* CDVUIWebViewEngine.h */; };
98
 		A3B082D41BB15CEA00D8DC35 /* CDVGestureHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = A3B082D21BB15CEA00D8DC35 /* CDVGestureHandler.h */; };
90
 		A3B082D41BB15CEA00D8DC35 /* CDVGestureHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = A3B082D21BB15CEA00D8DC35 /* CDVGestureHandler.h */; };
99
 		A3B082D51BB15CEA00D8DC35 /* CDVGestureHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = A3B082D31BB15CEA00D8DC35 /* CDVGestureHandler.m */; };
91
 		A3B082D51BB15CEA00D8DC35 /* CDVGestureHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = A3B082D31BB15CEA00D8DC35 /* CDVGestureHandler.m */; };
100
 		C0C01EB61E3911D50056E6CB /* Cordova.h in Headers */ = {isa = PBXBuildFile; fileRef = C0C01EB41E3911D50056E6CB /* Cordova.h */; settings = {ATTRIBUTES = (Public, ); }; };
92
 		C0C01EB61E3911D50056E6CB /* Cordova.h in Headers */ = {isa = PBXBuildFile; fileRef = C0C01EB41E3911D50056E6CB /* Cordova.h */; settings = {ATTRIBUTES = (Public, ); }; };
112
 		C0C01EC61E39131A0056E6CB /* CDVPluginResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D211AB9029B008C4574 /* CDVPluginResult.h */; settings = {ATTRIBUTES = (Public, ); }; };
104
 		C0C01EC61E39131A0056E6CB /* CDVPluginResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D211AB9029B008C4574 /* CDVPluginResult.h */; settings = {ATTRIBUTES = (Public, ); }; };
113
 		C0C01EC71E39131A0056E6CB /* CDVScreenOrientationDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D231AB9029B008C4574 /* CDVScreenOrientationDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
105
 		C0C01EC71E39131A0056E6CB /* CDVScreenOrientationDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D231AB9029B008C4574 /* CDVScreenOrientationDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
114
 		C0C01EC81E39131A0056E6CB /* CDVTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D241AB9029B008C4574 /* CDVTimer.h */; settings = {ATTRIBUTES = (Public, ); }; };
106
 		C0C01EC81E39131A0056E6CB /* CDVTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D241AB9029B008C4574 /* CDVTimer.h */; settings = {ATTRIBUTES = (Public, ); }; };
115
-		C0C01EC91E39131A0056E6CB /* CDVURLProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D261AB9029B008C4574 /* CDVURLProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
116
-		C0C01ECA1E39131A0056E6CB /* CDVUserAgentUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D281AB9029B008C4574 /* CDVUserAgentUtil.h */; settings = {ATTRIBUTES = (Public, ); }; };
117
 		C0C01ECB1E39131A0056E6CB /* CDVViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2A1AB9029B008C4574 /* CDVViewController.h */; settings = {ATTRIBUTES = (Public, ); }; };
107
 		C0C01ECB1E39131A0056E6CB /* CDVViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2A1AB9029B008C4574 /* CDVViewController.h */; settings = {ATTRIBUTES = (Public, ); }; };
118
 		C0C01ECC1E39131A0056E6CB /* CDVWebViewEngineProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2C1AB9029B008C4574 /* CDVWebViewEngineProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
108
 		C0C01ECC1E39131A0056E6CB /* CDVWebViewEngineProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2C1AB9029B008C4574 /* CDVWebViewEngineProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
119
 		C0C01ECD1E39131A0056E6CB /* CDVWhitelist.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2D1AB9029B008C4574 /* CDVWhitelist.h */; settings = {ATTRIBUTES = (Public, ); }; };
109
 		C0C01ECD1E39131A0056E6CB /* CDVWhitelist.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2D1AB9029B008C4574 /* CDVWhitelist.h */; settings = {ATTRIBUTES = (Public, ); }; };
120
 		C0C01ECE1E39131A0056E6CB /* NSDictionary+CordovaPreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D311AB9029B008C4574 /* NSDictionary+CordovaPreferences.h */; settings = {ATTRIBUTES = (Public, ); }; };
110
 		C0C01ECE1E39131A0056E6CB /* NSDictionary+CordovaPreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D311AB9029B008C4574 /* NSDictionary+CordovaPreferences.h */; settings = {ATTRIBUTES = (Public, ); }; };
121
 		C0C01ECF1E39131A0056E6CB /* NSMutableArray+QueueAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D331AB9029B008C4574 /* NSMutableArray+QueueAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
111
 		C0C01ECF1E39131A0056E6CB /* NSMutableArray+QueueAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D331AB9029B008C4574 /* NSMutableArray+QueueAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
122
-		C0C01ED01E3913610056E6CB /* CDVUIWebViewDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CFE1AB9028C008C4574 /* CDVUIWebViewDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
123
 /* End PBXBuildFile section */
112
 /* End PBXBuildFile section */
124
 
113
 
125
 /* Begin PBXFileReference section */
114
 /* Begin PBXFileReference section */
126
 		28BFF9121F355A4E00DDF01A /* CDVLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVLogger.h; sourceTree = "<group>"; };
115
 		28BFF9121F355A4E00DDF01A /* CDVLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVLogger.h; sourceTree = "<group>"; };
127
 		28BFF9131F355A4E00DDF01A /* CDVLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVLogger.m; sourceTree = "<group>"; };
116
 		28BFF9131F355A4E00DDF01A /* CDVLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVLogger.m; sourceTree = "<group>"; };
128
-		30193A4E1AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVUIWebViewNavigationDelegate.m; sourceTree = "<group>"; };
129
-		30193A4F1AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVUIWebViewNavigationDelegate.h; sourceTree = "<group>"; };
117
+		2F4D42BA23F218BA00501999 /* CDVURLSchemeHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDVURLSchemeHandler.h; sourceTree = "<group>"; };
118
+		2F4D42BB23F218BA00501999 /* CDVURLSchemeHandler.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CDVURLSchemeHandler.m; sourceTree = "<group>"; };
130
 		3093E2211B16D6A3003F381A /* CDVIntentAndNavigationFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVIntentAndNavigationFilter.h; sourceTree = "<group>"; };
119
 		3093E2211B16D6A3003F381A /* CDVIntentAndNavigationFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVIntentAndNavigationFilter.h; sourceTree = "<group>"; };
131
 		3093E2221B16D6A3003F381A /* CDVIntentAndNavigationFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVIntentAndNavigationFilter.m; sourceTree = "<group>"; };
120
 		3093E2221B16D6A3003F381A /* CDVIntentAndNavigationFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVIntentAndNavigationFilter.m; sourceTree = "<group>"; };
121
+		4E23F8F523E16E96006CD852 /* CDVWebViewProcessPoolFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVWebViewProcessPoolFactory.m; sourceTree = "<group>"; };
122
+		4E23F8F623E16E96006CD852 /* CDVWebViewUIDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVWebViewUIDelegate.h; sourceTree = "<group>"; };
123
+		4E23F8F723E16E96006CD852 /* CDVWebViewUIDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVWebViewUIDelegate.m; sourceTree = "<group>"; };
124
+		4E23F8F823E16E96006CD852 /* CDVWebViewEngine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVWebViewEngine.m; sourceTree = "<group>"; };
125
+		4E23F8F923E16E96006CD852 /* CDVWebViewProcessPoolFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVWebViewProcessPoolFactory.h; sourceTree = "<group>"; };
126
+		4E23F8FA23E16E96006CD852 /* CDVWebViewEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVWebViewEngine.h; sourceTree = "<group>"; };
127
+		4E714D3223F535B500A321AF /* CDVLaunchScreen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVLaunchScreen.h; sourceTree = "<group>"; };
128
+		4E714D3423F535B500A321AF /* CDVLaunchScreen.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVLaunchScreen.m; sourceTree = "<group>"; };
132
 		68A32D7114102E1C006B237C /* libCordova.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCordova.a; sourceTree = BUILT_PRODUCTS_DIR; };
129
 		68A32D7114102E1C006B237C /* libCordova.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCordova.a; sourceTree = BUILT_PRODUCTS_DIR; };
133
 		7ED95CF21AB9028C008C4574 /* CDVDebug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVDebug.h; sourceTree = "<group>"; };
130
 		7ED95CF21AB9028C008C4574 /* CDVDebug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVDebug.h; sourceTree = "<group>"; };
134
 		7ED95CF31AB9028C008C4574 /* CDVJSON_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVJSON_private.h; sourceTree = "<group>"; };
131
 		7ED95CF31AB9028C008C4574 /* CDVJSON_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVJSON_private.h; sourceTree = "<group>"; };
136
 		7ED95CF51AB9028C008C4574 /* CDVPlugin+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CDVPlugin+Private.h"; sourceTree = "<group>"; };
133
 		7ED95CF51AB9028C008C4574 /* CDVPlugin+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CDVPlugin+Private.h"; sourceTree = "<group>"; };
137
 		7ED95CF81AB9028C008C4574 /* CDVHandleOpenURL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVHandleOpenURL.h; sourceTree = "<group>"; };
134
 		7ED95CF81AB9028C008C4574 /* CDVHandleOpenURL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVHandleOpenURL.h; sourceTree = "<group>"; };
138
 		7ED95CF91AB9028C008C4574 /* CDVHandleOpenURL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVHandleOpenURL.m; sourceTree = "<group>"; };
135
 		7ED95CF91AB9028C008C4574 /* CDVHandleOpenURL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVHandleOpenURL.m; sourceTree = "<group>"; };
139
-		7ED95CFB1AB9028C008C4574 /* CDVLocalStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVLocalStorage.h; sourceTree = "<group>"; };
140
-		7ED95CFC1AB9028C008C4574 /* CDVLocalStorage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVLocalStorage.m; sourceTree = "<group>"; };
141
-		7ED95CFE1AB9028C008C4574 /* CDVUIWebViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVUIWebViewDelegate.h; sourceTree = "<group>"; };
142
-		7ED95CFF1AB9028C008C4574 /* CDVUIWebViewDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVUIWebViewDelegate.m; sourceTree = "<group>"; };
143
-		7ED95D001AB9028C008C4574 /* CDVUIWebViewEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVUIWebViewEngine.h; sourceTree = "<group>"; };
144
-		7ED95D011AB9028C008C4574 /* CDVUIWebViewEngine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVUIWebViewEngine.m; sourceTree = "<group>"; };
145
 		7ED95D0F1AB9029B008C4574 /* CDV.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDV.h; sourceTree = "<group>"; };
136
 		7ED95D0F1AB9029B008C4574 /* CDV.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDV.h; sourceTree = "<group>"; };
146
 		7ED95D101AB9029B008C4574 /* CDVAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVAppDelegate.h; sourceTree = "<group>"; };
137
 		7ED95D101AB9029B008C4574 /* CDVAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVAppDelegate.h; sourceTree = "<group>"; };
147
 		7ED95D111AB9029B008C4574 /* CDVAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVAppDelegate.m; sourceTree = "<group>"; };
138
 		7ED95D111AB9029B008C4574 /* CDVAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVAppDelegate.m; sourceTree = "<group>"; };
165
 		7ED95D231AB9029B008C4574 /* CDVScreenOrientationDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVScreenOrientationDelegate.h; sourceTree = "<group>"; };
156
 		7ED95D231AB9029B008C4574 /* CDVScreenOrientationDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVScreenOrientationDelegate.h; sourceTree = "<group>"; };
166
 		7ED95D241AB9029B008C4574 /* CDVTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVTimer.h; sourceTree = "<group>"; };
157
 		7ED95D241AB9029B008C4574 /* CDVTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVTimer.h; sourceTree = "<group>"; };
167
 		7ED95D251AB9029B008C4574 /* CDVTimer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVTimer.m; sourceTree = "<group>"; };
158
 		7ED95D251AB9029B008C4574 /* CDVTimer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVTimer.m; sourceTree = "<group>"; };
168
-		7ED95D261AB9029B008C4574 /* CDVURLProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVURLProtocol.h; sourceTree = "<group>"; };
169
-		7ED95D271AB9029B008C4574 /* CDVURLProtocol.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVURLProtocol.m; sourceTree = "<group>"; };
170
-		7ED95D281AB9029B008C4574 /* CDVUserAgentUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVUserAgentUtil.h; sourceTree = "<group>"; };
171
-		7ED95D291AB9029B008C4574 /* CDVUserAgentUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVUserAgentUtil.m; sourceTree = "<group>"; };
172
 		7ED95D2A1AB9029B008C4574 /* CDVViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVViewController.h; sourceTree = "<group>"; };
159
 		7ED95D2A1AB9029B008C4574 /* CDVViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVViewController.h; sourceTree = "<group>"; };
173
 		7ED95D2B1AB9029B008C4574 /* CDVViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVViewController.m; sourceTree = "<group>"; };
160
 		7ED95D2B1AB9029B008C4574 /* CDVViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVViewController.m; sourceTree = "<group>"; };
174
 		7ED95D2C1AB9029B008C4574 /* CDVWebViewEngineProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVWebViewEngineProtocol.h; sourceTree = "<group>"; };
161
 		7ED95D2C1AB9029B008C4574 /* CDVWebViewEngineProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVWebViewEngineProtocol.h; sourceTree = "<group>"; };
241
 			path = CDVIntentAndNavigationFilter;
228
 			path = CDVIntentAndNavigationFilter;
242
 			sourceTree = "<group>";
229
 			sourceTree = "<group>";
243
 		};
230
 		};
231
+		4E23F8F423E16D30006CD852 /* CDVWebViewEngine */ = {
232
+			isa = PBXGroup;
233
+			children = (
234
+				4E23F8FA23E16E96006CD852 /* CDVWebViewEngine.h */,
235
+				4E23F8F823E16E96006CD852 /* CDVWebViewEngine.m */,
236
+				4E23F8F923E16E96006CD852 /* CDVWebViewProcessPoolFactory.h */,
237
+				4E23F8F523E16E96006CD852 /* CDVWebViewProcessPoolFactory.m */,
238
+				4E23F8F623E16E96006CD852 /* CDVWebViewUIDelegate.h */,
239
+				4E23F8F723E16E96006CD852 /* CDVWebViewUIDelegate.m */,
240
+			);
241
+			path = CDVWebViewEngine;
242
+			sourceTree = "<group>";
243
+		};
244
+		4E714D3123F5356700A321AF /* CDVLaunchScreen */ = {
245
+			isa = PBXGroup;
246
+			children = (
247
+				4E714D3223F535B500A321AF /* CDVLaunchScreen.h */,
248
+				4E714D3423F535B500A321AF /* CDVLaunchScreen.m */,
249
+			);
250
+			path = CDVLaunchScreen;
251
+			sourceTree = "<group>";
252
+		};
244
 		7ED95CF11AB9028C008C4574 /* Private */ = {
253
 		7ED95CF11AB9028C008C4574 /* Private */ = {
245
 			isa = PBXGroup;
254
 			isa = PBXGroup;
246
 			children = (
255
 			children = (
258
 		7ED95CF61AB9028C008C4574 /* Plugins */ = {
267
 		7ED95CF61AB9028C008C4574 /* Plugins */ = {
259
 			isa = PBXGroup;
268
 			isa = PBXGroup;
260
 			children = (
269
 			children = (
270
+				4E714D3123F5356700A321AF /* CDVLaunchScreen */,
271
+				4E23F8F423E16D30006CD852 /* CDVWebViewEngine */,
261
 				28BFF9111F355A1D00DDF01A /* CDVLogger */,
272
 				28BFF9111F355A1D00DDF01A /* CDVLogger */,
262
 				A3B082D11BB15CEA00D8DC35 /* CDVGestureHandler */,
273
 				A3B082D11BB15CEA00D8DC35 /* CDVGestureHandler */,
263
 				3093E2201B16D6A3003F381A /* CDVIntentAndNavigationFilter */,
274
 				3093E2201B16D6A3003F381A /* CDVIntentAndNavigationFilter */,
264
 				7ED95CF71AB9028C008C4574 /* CDVHandleOpenURL */,
275
 				7ED95CF71AB9028C008C4574 /* CDVHandleOpenURL */,
265
-				7ED95CFA1AB9028C008C4574 /* CDVLocalStorage */,
266
-				7ED95CFD1AB9028C008C4574 /* CDVUIWebViewEngine */,
267
 			);
276
 			);
268
 			path = Plugins;
277
 			path = Plugins;
269
 			sourceTree = "<group>";
278
 			sourceTree = "<group>";
277
 			path = CDVHandleOpenURL;
286
 			path = CDVHandleOpenURL;
278
 			sourceTree = "<group>";
287
 			sourceTree = "<group>";
279
 		};
288
 		};
280
-		7ED95CFA1AB9028C008C4574 /* CDVLocalStorage */ = {
281
-			isa = PBXGroup;
282
-			children = (
283
-				7ED95CFB1AB9028C008C4574 /* CDVLocalStorage.h */,
284
-				7ED95CFC1AB9028C008C4574 /* CDVLocalStorage.m */,
285
-			);
286
-			path = CDVLocalStorage;
287
-			sourceTree = "<group>";
288
-		};
289
-		7ED95CFD1AB9028C008C4574 /* CDVUIWebViewEngine */ = {
290
-			isa = PBXGroup;
291
-			children = (
292
-				30193A4F1AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.h */,
293
-				30193A4E1AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.m */,
294
-				7ED95CFE1AB9028C008C4574 /* CDVUIWebViewDelegate.h */,
295
-				7ED95CFF1AB9028C008C4574 /* CDVUIWebViewDelegate.m */,
296
-				7ED95D001AB9028C008C4574 /* CDVUIWebViewEngine.h */,
297
-				7ED95D011AB9028C008C4574 /* CDVUIWebViewEngine.m */,
298
-			);
299
-			path = CDVUIWebViewEngine;
300
-			sourceTree = "<group>";
301
-		};
302
 		7ED95D0E1AB9029B008C4574 /* Public */ = {
289
 		7ED95D0E1AB9029B008C4574 /* Public */ = {
303
 			isa = PBXGroup;
290
 			isa = PBXGroup;
304
 			children = (
291
 			children = (
325
 				7ED95D231AB9029B008C4574 /* CDVScreenOrientationDelegate.h */,
312
 				7ED95D231AB9029B008C4574 /* CDVScreenOrientationDelegate.h */,
326
 				7ED95D241AB9029B008C4574 /* CDVTimer.h */,
313
 				7ED95D241AB9029B008C4574 /* CDVTimer.h */,
327
 				7ED95D251AB9029B008C4574 /* CDVTimer.m */,
314
 				7ED95D251AB9029B008C4574 /* CDVTimer.m */,
328
-				7ED95D261AB9029B008C4574 /* CDVURLProtocol.h */,
329
-				7ED95D271AB9029B008C4574 /* CDVURLProtocol.m */,
330
-				7ED95D281AB9029B008C4574 /* CDVUserAgentUtil.h */,
331
-				7ED95D291AB9029B008C4574 /* CDVUserAgentUtil.m */,
332
 				7ED95D2A1AB9029B008C4574 /* CDVViewController.h */,
315
 				7ED95D2A1AB9029B008C4574 /* CDVViewController.h */,
333
 				7ED95D2B1AB9029B008C4574 /* CDVViewController.m */,
316
 				7ED95D2B1AB9029B008C4574 /* CDVViewController.m */,
334
 				7ED95D2C1AB9029B008C4574 /* CDVWebViewEngineProtocol.h */,
317
 				7ED95D2C1AB9029B008C4574 /* CDVWebViewEngineProtocol.h */,
338
 				7ED95D321AB9029B008C4574 /* NSDictionary+CordovaPreferences.m */,
321
 				7ED95D321AB9029B008C4574 /* NSDictionary+CordovaPreferences.m */,
339
 				7ED95D331AB9029B008C4574 /* NSMutableArray+QueueAdditions.h */,
322
 				7ED95D331AB9029B008C4574 /* NSMutableArray+QueueAdditions.h */,
340
 				7ED95D341AB9029B008C4574 /* NSMutableArray+QueueAdditions.m */,
323
 				7ED95D341AB9029B008C4574 /* NSMutableArray+QueueAdditions.m */,
324
+				2F4D42BA23F218BA00501999 /* CDVURLSchemeHandler.h */,
325
+				2F4D42BB23F218BA00501999 /* CDVURLSchemeHandler.m */,
341
 			);
326
 			);
342
 			name = Public;
327
 			name = Public;
343
 			path = Classes/Public;
328
 			path = Classes/Public;
383
 				C0C01EC61E39131A0056E6CB /* CDVPluginResult.h in Headers */,
368
 				C0C01EC61E39131A0056E6CB /* CDVPluginResult.h in Headers */,
384
 				C0C01EC71E39131A0056E6CB /* CDVScreenOrientationDelegate.h in Headers */,
369
 				C0C01EC71E39131A0056E6CB /* CDVScreenOrientationDelegate.h in Headers */,
385
 				C0C01EC81E39131A0056E6CB /* CDVTimer.h in Headers */,
370
 				C0C01EC81E39131A0056E6CB /* CDVTimer.h in Headers */,
386
-				C0C01EC91E39131A0056E6CB /* CDVURLProtocol.h in Headers */,
387
-				C0C01ECA1E39131A0056E6CB /* CDVUserAgentUtil.h in Headers */,
388
 				C0C01ECB1E39131A0056E6CB /* CDVViewController.h in Headers */,
371
 				C0C01ECB1E39131A0056E6CB /* CDVViewController.h in Headers */,
389
 				C0C01ECC1E39131A0056E6CB /* CDVWebViewEngineProtocol.h in Headers */,
372
 				C0C01ECC1E39131A0056E6CB /* CDVWebViewEngineProtocol.h in Headers */,
390
 				C0C01ECD1E39131A0056E6CB /* CDVWhitelist.h in Headers */,
373
 				C0C01ECD1E39131A0056E6CB /* CDVWhitelist.h in Headers */,
391
 				C0C01ECE1E39131A0056E6CB /* NSDictionary+CordovaPreferences.h in Headers */,
374
 				C0C01ECE1E39131A0056E6CB /* NSDictionary+CordovaPreferences.h in Headers */,
375
+				4E23F90323E17FFA006CD852 /* CDVWebViewUIDelegate.h in Headers */,
392
 				C0C01ECF1E39131A0056E6CB /* NSMutableArray+QueueAdditions.h in Headers */,
376
 				C0C01ECF1E39131A0056E6CB /* NSMutableArray+QueueAdditions.h in Headers */,
393
 				9052DE892150D06B008E83D4 /* CDVDebug.h in Headers */,
377
 				9052DE892150D06B008E83D4 /* CDVDebug.h in Headers */,
394
 				9052DE8A2150D06B008E83D4 /* CDVJSON_private.h in Headers */,
378
 				9052DE8A2150D06B008E83D4 /* CDVJSON_private.h in Headers */,
397
 				9052DE8D2150D06B008E83D4 /* CDVGestureHandler.h in Headers */,
381
 				9052DE8D2150D06B008E83D4 /* CDVGestureHandler.h in Headers */,
398
 				9052DE8E2150D06B008E83D4 /* CDVIntentAndNavigationFilter.h in Headers */,
382
 				9052DE8E2150D06B008E83D4 /* CDVIntentAndNavigationFilter.h in Headers */,
399
 				9052DE8F2150D06B008E83D4 /* CDVHandleOpenURL.h in Headers */,
383
 				9052DE8F2150D06B008E83D4 /* CDVHandleOpenURL.h in Headers */,
400
-				9052DE902150D06B008E83D4 /* CDVLocalStorage.h in Headers */,
401
-				9052DE912150D06B008E83D4 /* CDVUIWebViewNavigationDelegate.h in Headers */,
402
-				C0C01ED01E3913610056E6CB /* CDVUIWebViewDelegate.h in Headers */,
403
-				9052DE922150D06B008E83D4 /* CDVUIWebViewEngine.h in Headers */,
384
+				2FCCEA18247E7366007276A8 /* CDVLaunchScreen.h in Headers */,
404
 			);
385
 			);
405
 			runOnlyForDeploymentPostprocessing = 0;
386
 			runOnlyForDeploymentPostprocessing = 0;
406
 		};
387
 		};
415
 				7ED95D3A1AB9029B008C4574 /* CDVCommandDelegate.h in Headers */,
396
 				7ED95D3A1AB9029B008C4574 /* CDVCommandDelegate.h in Headers */,
416
 				7ED95D3B1AB9029B008C4574 /* CDVCommandDelegateImpl.h in Headers */,
397
 				7ED95D3B1AB9029B008C4574 /* CDVCommandDelegateImpl.h in Headers */,
417
 				7ED95D3D1AB9029B008C4574 /* CDVCommandQueue.h in Headers */,
398
 				7ED95D3D1AB9029B008C4574 /* CDVCommandQueue.h in Headers */,
399
+				4E23F8FF23E16E96006CD852 /* CDVWebViewProcessPoolFactory.h in Headers */,
418
 				7ED95D3F1AB9029B008C4574 /* CDVConfigParser.h in Headers */,
400
 				7ED95D3F1AB9029B008C4574 /* CDVConfigParser.h in Headers */,
401
+				2F4D42BC23F218BA00501999 /* CDVURLSchemeHandler.h in Headers */,
419
 				7ED95D411AB9029B008C4574 /* CDVInvokedUrlCommand.h in Headers */,
402
 				7ED95D411AB9029B008C4574 /* CDVInvokedUrlCommand.h in Headers */,
420
 				7ED95D431AB9029B008C4574 /* CDVPlugin+Resources.h in Headers */,
403
 				7ED95D431AB9029B008C4574 /* CDVPlugin+Resources.h in Headers */,
421
 				7ED95D451AB9029B008C4574 /* CDVPlugin.h in Headers */,
404
 				7ED95D451AB9029B008C4574 /* CDVPlugin.h in Headers */,
422
 				7ED95D471AB9029B008C4574 /* CDVPluginResult.h in Headers */,
405
 				7ED95D471AB9029B008C4574 /* CDVPluginResult.h in Headers */,
423
 				7ED95D491AB9029B008C4574 /* CDVScreenOrientationDelegate.h in Headers */,
406
 				7ED95D491AB9029B008C4574 /* CDVScreenOrientationDelegate.h in Headers */,
407
+				4E23F8FC23E16E96006CD852 /* CDVWebViewUIDelegate.h in Headers */,
424
 				7ED95D4A1AB9029B008C4574 /* CDVTimer.h in Headers */,
408
 				7ED95D4A1AB9029B008C4574 /* CDVTimer.h in Headers */,
425
-				7ED95D4C1AB9029B008C4574 /* CDVURLProtocol.h in Headers */,
426
-				7ED95D4E1AB9029B008C4574 /* CDVUserAgentUtil.h in Headers */,
427
 				7ED95D501AB9029B008C4574 /* CDVViewController.h in Headers */,
409
 				7ED95D501AB9029B008C4574 /* CDVViewController.h in Headers */,
428
 				7ED95D521AB9029B008C4574 /* CDVWebViewEngineProtocol.h in Headers */,
410
 				7ED95D521AB9029B008C4574 /* CDVWebViewEngineProtocol.h in Headers */,
411
+				4E23F90023E16E96006CD852 /* CDVWebViewEngine.h in Headers */,
429
 				7ED95D531AB9029B008C4574 /* CDVWhitelist.h in Headers */,
412
 				7ED95D531AB9029B008C4574 /* CDVWhitelist.h in Headers */,
430
 				7ED95D571AB9029B008C4574 /* NSDictionary+CordovaPreferences.h in Headers */,
413
 				7ED95D571AB9029B008C4574 /* NSDictionary+CordovaPreferences.h in Headers */,
431
 				7ED95D591AB9029B008C4574 /* NSMutableArray+QueueAdditions.h in Headers */,
414
 				7ED95D591AB9029B008C4574 /* NSMutableArray+QueueAdditions.h in Headers */,
436
 				A3B082D41BB15CEA00D8DC35 /* CDVGestureHandler.h in Headers */,
419
 				A3B082D41BB15CEA00D8DC35 /* CDVGestureHandler.h in Headers */,
437
 				3093E2231B16D6A3003F381A /* CDVIntentAndNavigationFilter.h in Headers */,
420
 				3093E2231B16D6A3003F381A /* CDVIntentAndNavigationFilter.h in Headers */,
438
 				7E7F69B91ABA3692007546F4 /* CDVHandleOpenURL.h in Headers */,
421
 				7E7F69B91ABA3692007546F4 /* CDVHandleOpenURL.h in Headers */,
439
-				7E7F69B61ABA35D8007546F4 /* CDVLocalStorage.h in Headers */,
440
-				30193A511AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.h in Headers */,
441
-				7ED95D0A1AB9028C008C4574 /* CDVUIWebViewDelegate.h in Headers */,
442
-				7E7F69B81ABA368F007546F4 /* CDVUIWebViewEngine.h in Headers */,
422
+				4E714D3623F535B500A321AF /* CDVLaunchScreen.h in Headers */,
443
 			);
423
 			);
444
 			runOnlyForDeploymentPostprocessing = 0;
424
 			runOnlyForDeploymentPostprocessing = 0;
445
 		};
425
 		};
453
 				C0C01EAD1E3911D50056E6CB /* Sources */,
433
 				C0C01EAD1E3911D50056E6CB /* Sources */,
454
 				C0C01EAE1E3911D50056E6CB /* Frameworks */,
434
 				C0C01EAE1E3911D50056E6CB /* Frameworks */,
455
 				C0C01EAF1E3911D50056E6CB /* Headers */,
435
 				C0C01EAF1E3911D50056E6CB /* Headers */,
436
+				CEDDBB5523948D4C00506451 /* ShellScript */,
456
 			);
437
 			);
457
 			buildRules = (
438
 			buildRules = (
458
 			);
439
 			);
499
 				};
480
 				};
500
 			};
481
 			};
501
 			buildConfigurationList = 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "CordovaLib" */;
482
 			buildConfigurationList = 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "CordovaLib" */;
502
-			compatibilityVersion = "Xcode 8.0";
483
+			compatibilityVersion = "Xcode 11.0";
503
 			developmentRegion = en;
484
 			developmentRegion = en;
504
 			hasScannedForEncodings = 0;
485
 			hasScannedForEncodings = 0;
505
 			knownRegions = (
486
 			knownRegions = (
506
 				en,
487
 				en,
488
+				Base,
507
 			);
489
 			);
508
 			mainGroup = 0867D691FE84028FC02AAC07;
490
 			mainGroup = 0867D691FE84028FC02AAC07;
509
 			productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
491
 			productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
516
 		};
498
 		};
517
 /* End PBXProject section */
499
 /* End PBXProject section */
518
 
500
 
501
+/* Begin PBXShellScriptBuildPhase section */
502
+		CEDDBB5523948D4C00506451 /* ShellScript */ = {
503
+			isa = PBXShellScriptBuildPhase;
504
+			buildActionMask = 2147483647;
505
+			files = (
506
+			);
507
+			inputFileListPaths = (
508
+			);
509
+			inputPaths = (
510
+			);
511
+			outputFileListPaths = (
512
+			);
513
+			outputPaths = (
514
+			);
515
+			runOnlyForDeploymentPostprocessing = 0;
516
+			shellPath = /bin/sh;
517
+			shellScript = "\"${PROJECT_DIR}/../update_podspec.sh\" -s cordova\n";
518
+		};
519
+/* End PBXShellScriptBuildPhase section */
520
+
519
 /* Begin PBXSourcesBuildPhase section */
521
 /* Begin PBXSourcesBuildPhase section */
520
 		C0C01EAD1E3911D50056E6CB /* Sources */ = {
522
 		C0C01EAD1E3911D50056E6CB /* Sources */ = {
521
 			isa = PBXSourcesBuildPhase;
523
 			isa = PBXSourcesBuildPhase;
530
 				9052DE772150D040008E83D4 /* CDVPlugin.m in Sources */,
532
 				9052DE772150D040008E83D4 /* CDVPlugin.m in Sources */,
531
 				9052DE782150D040008E83D4 /* CDVPluginResult.m in Sources */,
533
 				9052DE782150D040008E83D4 /* CDVPluginResult.m in Sources */,
532
 				9052DE792150D040008E83D4 /* CDVTimer.m in Sources */,
534
 				9052DE792150D040008E83D4 /* CDVTimer.m in Sources */,
533
-				9052DE7A2150D040008E83D4 /* CDVURLProtocol.m in Sources */,
534
-				9052DE7B2150D040008E83D4 /* CDVUserAgentUtil.m in Sources */,
535
 				9052DE7C2150D040008E83D4 /* CDVViewController.m in Sources */,
535
 				9052DE7C2150D040008E83D4 /* CDVViewController.m in Sources */,
536
 				9052DE7D2150D040008E83D4 /* CDVWhitelist.m in Sources */,
536
 				9052DE7D2150D040008E83D4 /* CDVWhitelist.m in Sources */,
537
 				9052DE7E2150D040008E83D4 /* NSDictionary+CordovaPreferences.m in Sources */,
537
 				9052DE7E2150D040008E83D4 /* NSDictionary+CordovaPreferences.m in Sources */,
541
 				9052DE822150D040008E83D4 /* CDVGestureHandler.m in Sources */,
541
 				9052DE822150D040008E83D4 /* CDVGestureHandler.m in Sources */,
542
 				9052DE832150D040008E83D4 /* CDVIntentAndNavigationFilter.m in Sources */,
542
 				9052DE832150D040008E83D4 /* CDVIntentAndNavigationFilter.m in Sources */,
543
 				9052DE842150D040008E83D4 /* CDVHandleOpenURL.m in Sources */,
543
 				9052DE842150D040008E83D4 /* CDVHandleOpenURL.m in Sources */,
544
-				9052DE852150D040008E83D4 /* CDVLocalStorage.m in Sources */,
545
-				9052DE862150D040008E83D4 /* CDVUIWebViewNavigationDelegate.m in Sources */,
546
-				9052DE872150D040008E83D4 /* CDVUIWebViewDelegate.m in Sources */,
547
-				9052DE882150D040008E83D4 /* CDVUIWebViewEngine.m in Sources */,
544
+				2FCCEA17247E7366007276A8 /* CDVLaunchScreen.m in Sources */,
548
 			);
545
 			);
549
 			runOnlyForDeploymentPostprocessing = 0;
546
 			runOnlyForDeploymentPostprocessing = 0;
550
 		};
547
 		};
558
 				7ED95D401AB9029B008C4574 /* CDVConfigParser.m in Sources */,
555
 				7ED95D401AB9029B008C4574 /* CDVConfigParser.m in Sources */,
559
 				7ED95D421AB9029B008C4574 /* CDVInvokedUrlCommand.m in Sources */,
556
 				7ED95D421AB9029B008C4574 /* CDVInvokedUrlCommand.m in Sources */,
560
 				7ED95D441AB9029B008C4574 /* CDVPlugin+Resources.m in Sources */,
557
 				7ED95D441AB9029B008C4574 /* CDVPlugin+Resources.m in Sources */,
558
+				2F4D42BD23F218BA00501999 /* CDVURLSchemeHandler.m in Sources */,
561
 				7ED95D461AB9029B008C4574 /* CDVPlugin.m in Sources */,
559
 				7ED95D461AB9029B008C4574 /* CDVPlugin.m in Sources */,
562
 				7ED95D481AB9029B008C4574 /* CDVPluginResult.m in Sources */,
560
 				7ED95D481AB9029B008C4574 /* CDVPluginResult.m in Sources */,
563
 				7ED95D4B1AB9029B008C4574 /* CDVTimer.m in Sources */,
561
 				7ED95D4B1AB9029B008C4574 /* CDVTimer.m in Sources */,
564
-				7ED95D4D1AB9029B008C4574 /* CDVURLProtocol.m in Sources */,
565
-				7ED95D4F1AB9029B008C4574 /* CDVUserAgentUtil.m in Sources */,
562
+				4E23F8FE23E16E96006CD852 /* CDVWebViewEngine.m in Sources */,
563
+				4E23F8FB23E16E96006CD852 /* CDVWebViewProcessPoolFactory.m in Sources */,
566
 				7ED95D511AB9029B008C4574 /* CDVViewController.m in Sources */,
564
 				7ED95D511AB9029B008C4574 /* CDVViewController.m in Sources */,
567
 				7ED95D541AB9029B008C4574 /* CDVWhitelist.m in Sources */,
565
 				7ED95D541AB9029B008C4574 /* CDVWhitelist.m in Sources */,
568
 				7ED95D581AB9029B008C4574 /* NSDictionary+CordovaPreferences.m in Sources */,
566
 				7ED95D581AB9029B008C4574 /* NSDictionary+CordovaPreferences.m in Sources */,
569
 				7ED95D5A1AB9029B008C4574 /* NSMutableArray+QueueAdditions.m in Sources */,
567
 				7ED95D5A1AB9029B008C4574 /* NSMutableArray+QueueAdditions.m in Sources */,
570
 				7ED95D041AB9028C008C4574 /* CDVJSON_private.m in Sources */,
568
 				7ED95D041AB9028C008C4574 /* CDVJSON_private.m in Sources */,
569
+				4E23F8FD23E16E96006CD852 /* CDVWebViewUIDelegate.m in Sources */,
571
 				28BFF9151F355A4E00DDF01A /* CDVLogger.m in Sources */,
570
 				28BFF9151F355A4E00DDF01A /* CDVLogger.m in Sources */,
572
 				A3B082D51BB15CEA00D8DC35 /* CDVGestureHandler.m in Sources */,
571
 				A3B082D51BB15CEA00D8DC35 /* CDVGestureHandler.m in Sources */,
573
 				3093E2241B16D6A3003F381A /* CDVIntentAndNavigationFilter.m in Sources */,
572
 				3093E2241B16D6A3003F381A /* CDVIntentAndNavigationFilter.m in Sources */,
574
 				7ED95D071AB9028C008C4574 /* CDVHandleOpenURL.m in Sources */,
573
 				7ED95D071AB9028C008C4574 /* CDVHandleOpenURL.m in Sources */,
575
-				7ED95D091AB9028C008C4574 /* CDVLocalStorage.m in Sources */,
576
-				30193A501AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.m in Sources */,
577
-				7ED95D0B1AB9028C008C4574 /* CDVUIWebViewDelegate.m in Sources */,
578
-				7ED95D0D1AB9028C008C4574 /* CDVUIWebViewEngine.m in Sources */,
574
+				4E714D3823F535B500A321AF /* CDVLaunchScreen.m in Sources */,
579
 			);
575
 			);
580
 			runOnlyForDeploymentPostprocessing = 0;
576
 			runOnlyForDeploymentPostprocessing = 0;
581
 		};
577
 		};
643
 				GCC_PREFIX_HEADER = CordovaLib_Prefix.pch;
639
 				GCC_PREFIX_HEADER = CordovaLib_Prefix.pch;
644
 				GCC_PREPROCESSOR_DEFINITIONS = (
640
 				GCC_PREPROCESSOR_DEFINITIONS = (
645
 					"DEBUG=1",
641
 					"DEBUG=1",
646
-					"WK_WEB_VIEW_ONLY=$(WK_WEB_VIEW_ONLY)",
647
 					"$(inherited)",
642
 					"$(inherited)",
648
 				);
643
 				);
649
 				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
644
 				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
652
 				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
647
 				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
653
 				GCC_WARN_UNUSED_FUNCTION = YES;
648
 				GCC_WARN_UNUSED_FUNCTION = YES;
654
 				GCC_WARN_UNUSED_VARIABLE = YES;
649
 				GCC_WARN_UNUSED_VARIABLE = YES;
655
-				IPHONEOS_DEPLOYMENT_TARGET = 10.0;
650
+				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
656
 				MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
651
 				MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
657
 				MTL_FAST_MATH = YES;
652
 				MTL_FAST_MATH = YES;
658
 				ONLY_ACTIVE_ARCH = YES;
653
 				ONLY_ACTIVE_ARCH = YES;
660
 				PRODUCT_NAME = Cordova;
655
 				PRODUCT_NAME = Cordova;
661
 				SDKROOT = iphoneos;
656
 				SDKROOT = iphoneos;
662
 				SKIP_INSTALL = YES;
657
 				SKIP_INSTALL = YES;
663
-				WK_WEB_VIEW_ONLY = 0;
664
 			};
658
 			};
665
 			name = Debug;
659
 			name = Debug;
666
 		};
660
 		};
705
 				GCC_NO_COMMON_BLOCKS = YES;
699
 				GCC_NO_COMMON_BLOCKS = YES;
706
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
700
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
707
 				GCC_PREFIX_HEADER = CordovaLib_Prefix.pch;
701
 				GCC_PREFIX_HEADER = CordovaLib_Prefix.pch;
708
-				GCC_PREPROCESSOR_DEFINITIONS = (
709
-					"WK_WEB_VIEW_ONLY=$(WK_WEB_VIEW_ONLY)",
710
-					"$(inherited)",
711
-				);
702
+				GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
712
 				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
703
 				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
713
 				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
704
 				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
714
 				GCC_WARN_UNDECLARED_SELECTOR = YES;
705
 				GCC_WARN_UNDECLARED_SELECTOR = YES;
715
 				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
706
 				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
716
 				GCC_WARN_UNUSED_FUNCTION = YES;
707
 				GCC_WARN_UNUSED_FUNCTION = YES;
717
 				GCC_WARN_UNUSED_VARIABLE = YES;
708
 				GCC_WARN_UNUSED_VARIABLE = YES;
718
-				IPHONEOS_DEPLOYMENT_TARGET = 10.0;
709
+				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
719
 				MTL_ENABLE_DEBUG_INFO = NO;
710
 				MTL_ENABLE_DEBUG_INFO = NO;
720
 				MTL_FAST_MATH = YES;
711
 				MTL_FAST_MATH = YES;
721
 				OTHER_LDFLAGS = "-ObjC";
712
 				OTHER_LDFLAGS = "-ObjC";
723
 				SDKROOT = iphoneos;
714
 				SDKROOT = iphoneos;
724
 				SKIP_INSTALL = YES;
715
 				SKIP_INSTALL = YES;
725
 				VALIDATE_PRODUCT = YES;
716
 				VALIDATE_PRODUCT = YES;
726
-				WK_WEB_VIEW_ONLY = 0;
727
 			};
717
 			};
728
 			name = Release;
718
 			name = Release;
729
 		};
719
 		};
734
 				DYLIB_INSTALL_NAME_BASE = "@rpath";
724
 				DYLIB_INSTALL_NAME_BASE = "@rpath";
735
 				INFOPLIST_FILE = Cordova/Info.plist;
725
 				INFOPLIST_FILE = Cordova/Info.plist;
736
 				INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
726
 				INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
737
-				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
727
+				LD_RUNPATH_SEARCH_PATHS = (
728
+					"$(inherited)",
729
+					"@executable_path/Frameworks",
730
+					"@loader_path/Frameworks",
731
+				);
738
 				PRODUCT_BUNDLE_IDENTIFIER = org.apache.cordova.Cordova;
732
 				PRODUCT_BUNDLE_IDENTIFIER = org.apache.cordova.Cordova;
739
 				TARGETED_DEVICE_FAMILY = "1,2";
733
 				TARGETED_DEVICE_FAMILY = "1,2";
740
 				VERSIONING_SYSTEM = "apple-generic";
734
 				VERSIONING_SYSTEM = "apple-generic";
749
 				DYLIB_INSTALL_NAME_BASE = "@rpath";
743
 				DYLIB_INSTALL_NAME_BASE = "@rpath";
750
 				INFOPLIST_FILE = Cordova/Info.plist;
744
 				INFOPLIST_FILE = Cordova/Info.plist;
751
 				INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
745
 				INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
752
-				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
746
+				LD_RUNPATH_SEARCH_PATHS = (
747
+					"$(inherited)",
748
+					"@executable_path/Frameworks",
749
+					"@loader_path/Frameworks",
750
+				);
753
 				PRODUCT_BUNDLE_IDENTIFIER = org.apache.cordova.Cordova;
751
 				PRODUCT_BUNDLE_IDENTIFIER = org.apache.cordova.Cordova;
754
 				TARGETED_DEVICE_FAMILY = "1,2";
752
 				TARGETED_DEVICE_FAMILY = "1,2";
755
 				VERSIONING_SYSTEM = "apple-generic";
753
 				VERSIONING_SYSTEM = "apple-generic";

+ 1
- 5
node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj/xcshareddata/xcschemes/Cordova.xcscheme View File

1
 <?xml version="1.0" encoding="UTF-8"?>
1
 <?xml version="1.0" encoding="UTF-8"?>
2
 <Scheme
2
 <Scheme
3
-   LastUpgradeVersion = "1010"
3
+   LastUpgradeVersion = "1130"
4
    version = "1.3">
4
    version = "1.3">
5
    <BuildAction
5
    <BuildAction
6
       parallelizeBuildables = "YES"
6
       parallelizeBuildables = "YES"
29
       shouldUseLaunchSchemeArgsEnv = "YES">
29
       shouldUseLaunchSchemeArgsEnv = "YES">
30
       <Testables>
30
       <Testables>
31
       </Testables>
31
       </Testables>
32
-      <AdditionalOptions>
33
-      </AdditionalOptions>
34
    </TestAction>
32
    </TestAction>
35
    <LaunchAction
33
    <LaunchAction
36
       buildConfiguration = "Debug"
34
       buildConfiguration = "Debug"
51
             ReferencedContainer = "container:CordovaLib.xcodeproj">
49
             ReferencedContainer = "container:CordovaLib.xcodeproj">
52
          </BuildableReference>
50
          </BuildableReference>
53
       </MacroExpansion>
51
       </MacroExpansion>
54
-      <AdditionalOptions>
55
-      </AdditionalOptions>
56
    </LaunchAction>
52
    </LaunchAction>
57
    <ProfileAction
53
    <ProfileAction
58
       buildConfiguration = "Release"
54
       buildConfiguration = "Release"

+ 1
- 1
node_modules/cordova-ios/CordovaLib/VERSION View File

1
-5.1.1
1
+6.1.1

+ 86
- 170
node_modules/cordova-ios/CordovaLib/cordova.js View File

1
 // Platform: ios
1
 // Platform: ios
2
-// 9c79667cd175f51fd2edf2dc91ac8be98b89076a
2
+// 538a985db128858c0a0eb4dd40fb9c8e5433fc94
3
 /*
3
 /*
4
  Licensed to the Apache Software Foundation (ASF) under one
4
  Licensed to the Apache Software Foundation (ASF) under one
5
  or more contributor license agreements.  See the NOTICE file
5
  or more contributor license agreements.  See the NOTICE file
19
  under the License.
19
  under the License.
20
 */
20
 */
21
 ;(function() {
21
 ;(function() {
22
-var PLATFORM_VERSION_BUILD_LABEL = '5.1.1';
22
+var PLATFORM_VERSION_BUILD_LABEL = '6.1.1';
23
 // file: src/scripts/require.js
23
 // file: src/scripts/require.js
24
 var require;
24
 var require;
25
 var define;
25
 var define;
50
 
50
 
51
     require = function (id) {
51
     require = function (id) {
52
         if (!modules[id]) {
52
         if (!modules[id]) {
53
-            throw 'module ' + id + ' not found';
53
+            throw new Error('module ' + id + ' not found');
54
         } else if (id in inProgressModules) {
54
         } else if (id in inProgressModules) {
55
             var cycle = requireStack.slice(inProgressModules[id]).join('->') + '->' + id;
55
             var cycle = requireStack.slice(inProgressModules[id]).join('->') + '->' + id;
56
-            throw 'Cycle in require graph: ' + cycle;
56
+            throw new Error('Cycle in require graph: ' + cycle);
57
         }
57
         }
58
         if (modules[id].factory) {
58
         if (modules[id].factory) {
59
             try {
59
             try {
70
 
70
 
71
     define = function (id, factory) {
71
     define = function (id, factory) {
72
         if (Object.prototype.hasOwnProperty.call(modules, id)) {
72
         if (Object.prototype.hasOwnProperty.call(modules, id)) {
73
-            throw 'module ' + id + ' already defined';
73
+            throw new Error('module ' + id + ' already defined');
74
         }
74
         }
75
 
75
 
76
         modules[id] = {
76
         modules[id] = {
162
     event.initEvent(type, false, false);
162
     event.initEvent(type, false, false);
163
     if (data) {
163
     if (data) {
164
         for (var i in data) {
164
         for (var i in data) {
165
-            if (data.hasOwnProperty(i)) {
165
+            if (Object.prototype.hasOwnProperty.call(data, i)) {
166
                 event[i] = data[i];
166
                 event[i] = data[i];
167
             }
167
             }
168
         }
168
         }
310
             }
310
             }
311
         } catch (err) {
311
         } catch (err) {
312
             var msg = 'Error in ' + (isSuccess ? 'Success' : 'Error') + ' callbackId: ' + callbackId + ' : ' + err;
312
             var msg = 'Error in ' + (isSuccess ? 'Success' : 'Error') + ' callbackId: ' + callbackId + ' : ' + err;
313
-            console && console.log && console.log(msg);
314
-            console && console.log && err.stack && console.log(err.stack);
315
-            cordova.fireWindowEvent('cordovacallbackerror', { 'message': msg });
313
+            cordova.fireWindowEvent('cordovacallbackerror', { message: msg, error: err });
316
             throw err;
314
             throw err;
317
         }
315
         }
318
     },
316
     },
340
 var moduleExports = module.exports;
338
 var moduleExports = module.exports;
341
 
339
 
342
 var typeMap = {
340
 var typeMap = {
343
-    'A': 'Array',
344
-    'D': 'Date',
345
-    'N': 'Number',
346
-    'S': 'String',
347
-    'F': 'Function',
348
-    'O': 'Object'
341
+    A: 'Array',
342
+    D: 'Date',
343
+    N: 'Number',
344
+    S: 'String',
345
+    F: 'Function',
346
+    O: 'Object'
349
 };
347
 };
350
 
348
 
351
 function extractParamName (callee, argIndex) {
349
 function extractParamName (callee, argIndex) {
498
 
496
 
499
 function each (objects, func, context) {
497
 function each (objects, func, context) {
500
     for (var prop in objects) {
498
     for (var prop in objects) {
501
-        if (objects.hasOwnProperty(prop)) {
499
+        if (Object.prototype.hasOwnProperty.call(objects, prop)) {
502
             func.apply(context, [objects[prop], prop]);
500
             func.apply(context, [objects[prop], prop]);
503
         }
501
         }
504
     }
502
     }
578
  */
576
  */
579
 function recursiveMerge (target, src) {
577
 function recursiveMerge (target, src) {
580
     for (var prop in src) {
578
     for (var prop in src) {
581
-        if (src.hasOwnProperty(prop)) {
579
+        if (Object.prototype.hasOwnProperty.call(src, prop)) {
582
             if (target.prototype && target.prototype.constructor === target) {
580
             if (target.prototype && target.prototype.constructor === target) {
583
                 // If the target object is a constructor override off prototype.
581
                 // If the target object is a constructor override off prototype.
584
                 clobber(target.prototype, prop, src[prop]);
582
                 clobber(target.prototype, prop, src[prop]);
871
 // file: ../cordova-ios/cordova-js-src/exec.js
869
 // file: ../cordova-ios/cordova-js-src/exec.js
872
 define("cordova/exec", function(require, exports, module) {
870
 define("cordova/exec", function(require, exports, module) {
873
 
871
 
874
-/* global require, module, atob, document */
875
-
876
 /**
872
 /**
877
- * Creates a gap bridge iframe used to notify the native code about queued
873
+ * Creates the exec bridge used to notify the native code of
878
  * commands.
874
  * commands.
879
  */
875
  */
880
 var cordova = require('cordova');
876
 var cordova = require('cordova');
881
 var utils = require('cordova/utils');
877
 var utils = require('cordova/utils');
882
 var base64 = require('cordova/base64');
878
 var base64 = require('cordova/base64');
883
-var execIframe;
884
-var commandQueue = []; // Contains pending JS->Native messages.
885
-var isInContextOfEvalJs = 0;
886
-var failSafeTimerId = 0;
887
 
879
 
888
 function massageArgsJsToNative (args) {
880
 function massageArgsJsToNative (args) {
889
     if (!args || utils.typeName(args) !== 'Array') {
881
     if (!args || utils.typeName(args) !== 'Array') {
893
     args.forEach(function (arg, i) {
885
     args.forEach(function (arg, i) {
894
         if (utils.typeName(arg) === 'ArrayBuffer') {
886
         if (utils.typeName(arg) === 'ArrayBuffer') {
895
             ret.push({
887
             ret.push({
896
-                'CDVType': 'ArrayBuffer',
897
-                'data': base64.fromArrayBuffer(arg)
888
+                CDVType: 'ArrayBuffer',
889
+                data: base64.fromArrayBuffer(arg)
898
             });
890
             });
899
         } else {
891
         } else {
900
             ret.push(arg);
892
             ret.push(arg);
913
             return ret.buffer;
905
             return ret.buffer;
914
         };
906
         };
915
         var base64ToArrayBuffer = function (b64) {
907
         var base64ToArrayBuffer = function (b64) {
916
-            return stringToArrayBuffer(atob(b64));
908
+            return stringToArrayBuffer(atob(b64)); // eslint-disable-line no-undef
917
         };
909
         };
918
         message = base64ToArrayBuffer(message.data);
910
         message = base64ToArrayBuffer(message.data);
919
     }
911
     }
922
 
914
 
923
 function convertMessageToArgsNativeToJs (message) {
915
 function convertMessageToArgsNativeToJs (message) {
924
     var args = [];
916
     var args = [];
925
-    if (!message || !message.hasOwnProperty('CDVType')) {
917
+    if (!message || !Object.prototype.hasOwnProperty.call(message, 'CDVType')) {
926
         args.push(message);
918
         args.push(message);
927
     } else if (message.CDVType === 'MultiPart') {
919
     } else if (message.CDVType === 'MultiPart') {
928
         message.messages.forEach(function (e) {
920
         message.messages.forEach(function (e) {
934
     return args;
926
     return args;
935
 }
927
 }
936
 
928
 
937
-function iOSExec () {
938
-
929
+var iOSExec = function () {
939
     var successCallback, failCallback, service, action, actionArgs;
930
     var successCallback, failCallback, service, action, actionArgs;
940
     var callbackId = null;
931
     var callbackId = null;
941
     if (typeof arguments[0] !== 'string') {
932
     if (typeof arguments[0] !== 'string') {
952
         // an invalid callbackId and passes it even if no callbacks were given.
943
         // an invalid callbackId and passes it even if no callbacks were given.
953
         callbackId = 'INVALID';
944
         callbackId = 'INVALID';
954
     } else {
945
     } else {
955
-        throw new Error('The old format of this exec call has been removed (deprecated since 2.1). Change to: ' +
956
-            'cordova.exec(null, null, \'Service\', \'action\', [ arg1, arg2 ]);'
957
-        );
946
+   	    throw new Error('The old format of this exec call has been removed (deprecated since 2.1). Change to: ' + // eslint-disable-line
947
+            'cordova.exec(null, null, \'Service\', \'action\', [ arg1, arg2 ]);');
958
     }
948
     }
959
 
949
 
960
     // If actionArgs is not provided, default to an empty array
950
     // If actionArgs is not provided, default to an empty array
970
 
960
 
971
     actionArgs = massageArgsJsToNative(actionArgs);
961
     actionArgs = massageArgsJsToNative(actionArgs);
972
 
962
 
973
-    var command = [callbackId, service, action, actionArgs];
974
-
975
-    // Stringify and queue the command. We stringify to command now to
976
-    // effectively clone the command arguments in case they are mutated before
977
-    // the command is executed.
978
-    commandQueue.push(JSON.stringify(command));
979
-
980
-    // If we're in the context of a stringByEvaluatingJavaScriptFromString call,
981
-    // then the queue will be flushed when it returns; no need for a poke.
982
-    // Also, if there is already a command in the queue, then we've already
983
-    // poked the native side, so there is no reason to do so again.
984
-    if (!isInContextOfEvalJs && commandQueue.length === 1) {
985
-        pokeNative();
986
-    }
987
-}
988
-
989
-// CB-10530
990
-function proxyChanged () {
991
-    var cexec = cordovaExec();
992
-
993
-    return (execProxy !== cexec && // proxy objects are different
994
-            iOSExec !== cexec // proxy object is not the current iOSExec
995
-    );
996
-}
997
-
998
-// CB-10106
999
-function handleBridgeChange () {
1000
-    if (proxyChanged()) {
1001
-        var commandString = commandQueue.shift();
1002
-        while (commandString) {
1003
-            var command = JSON.parse(commandString);
1004
-            var callbackId = command[0];
1005
-            var service = command[1];
1006
-            var action = command[2];
1007
-            var actionArgs = command[3];
1008
-            var callbacks = cordova.callbacks[callbackId] || {};
1009
-
1010
-            execProxy(callbacks.success, callbacks.fail, service, action, actionArgs);
1011
-
1012
-            commandString = commandQueue.shift();
1013
-        }
1014
-        return true;
1015
-    }
1016
-
1017
-    return false;
1018
-}
1019
-
1020
-function pokeNative () {
1021
-    // CB-5488 - Don't attempt to create iframe before document.body is available.
1022
-    if (!document.body) {
1023
-        setTimeout(pokeNative);
1024
-        return;
1025
-    }
1026
-
1027
-    // Check if they've removed it from the DOM, and put it back if so.
1028
-    if (execIframe && execIframe.contentWindow) {
1029
-        execIframe.contentWindow.location = 'gap://ready';
1030
-    } else {
1031
-        execIframe = document.createElement('iframe');
1032
-        execIframe.style.display = 'none';
1033
-        execIframe.src = 'gap://ready';
1034
-        document.body.appendChild(execIframe);
1035
-    }
1036
-    // Use a timer to protect against iframe being unloaded during the poke (CB-7735).
1037
-    // This makes the bridge ~ 7% slower, but works around the poke getting lost
1038
-    // when the iframe is removed from the DOM.
1039
-    // An onunload listener could be used in the case where the iframe has just been
1040
-    // created, but since unload events fire only once, it doesn't work in the normal
1041
-    // case of iframe reuse (where unload will have already fired due to the attempted
1042
-    // navigation of the page).
1043
-    failSafeTimerId = setTimeout(function () {
1044
-        if (commandQueue.length) {
1045
-            // CB-10106 - flush the queue on bridge change
1046
-            if (!handleBridgeChange()) {
1047
-                pokeNative();
1048
-            }
1049
-        }
1050
-    }, 50); // Making this > 0 improves performance (marginally) in the normal case (where it doesn't fire).
1051
-}
1052
-
1053
-iOSExec.nativeFetchMessages = function () {
1054
-    // Stop listing for window detatch once native side confirms poke.
1055
-    if (failSafeTimerId) {
1056
-        clearTimeout(failSafeTimerId);
1057
-        failSafeTimerId = 0;
1058
-    }
1059
-    // Each entry in commandQueue is a JSON string already.
1060
-    if (!commandQueue.length) {
1061
-        return '';
1062
-    }
1063
-    var json = '[' + commandQueue.join(',') + ']';
1064
-    commandQueue.length = 0;
1065
-    return json;
963
+    // CB-10133 DataClone DOM Exception 25 guard (fast function remover)
964
+    var command = [callbackId, service, action, JSON.parse(JSON.stringify(actionArgs))];
965
+    window.webkit.messageHandlers.cordova.postMessage(command);
1066
 };
966
 };
1067
 
967
 
1068
 iOSExec.nativeCallback = function (callbackId, status, message, keepCallback, debug) {
968
 iOSExec.nativeCallback = function (callbackId, status, message, keepCallback, debug) {
1069
-    return iOSExec.nativeEvalAndFetch(function () {
1070
-        var success = status === 0 || status === 1;
1071
-        var args = convertMessageToArgsNativeToJs(message);
1072
-        function nc2 () {
1073
-            cordova.callbackFromNative(callbackId, success, status, args, keepCallback);
1074
-        }
1075
-        setTimeout(nc2, 0);
969
+    var success = status === 0 || status === 1;
970
+    var args = convertMessageToArgsNativeToJs(message);
971
+    Promise.resolve().then(function () {
972
+        cordova.callbackFromNative(callbackId, success, status, args, keepCallback); // eslint-disable-line
1076
     });
973
     });
1077
 };
974
 };
1078
 
975
 
976
+// for backwards compatibility
1079
 iOSExec.nativeEvalAndFetch = function (func) {
977
 iOSExec.nativeEvalAndFetch = function (func) {
1080
-    // This shouldn't be nested, but better to be safe.
1081
-    isInContextOfEvalJs++;
1082
     try {
978
     try {
1083
         func();
979
         func();
1084
-        return iOSExec.nativeFetchMessages();
1085
-    } finally {
1086
-        isInContextOfEvalJs--;
980
+    } catch (e) {
981
+        console.log(e);
1087
     }
982
     }
1088
 };
983
 };
1089
 
984
 
1153
 var modulemapper = require('cordova/modulemapper');
1048
 var modulemapper = require('cordova/modulemapper');
1154
 var platform = require('cordova/platform');
1049
 var platform = require('cordova/platform');
1155
 var pluginloader = require('cordova/pluginloader');
1050
 var pluginloader = require('cordova/pluginloader');
1156
-var utils = require('cordova/utils');
1157
 
1051
 
1158
 var platformInitChannelsArray = [channel.onNativeReady, channel.onPluginsReady];
1052
 var platformInitChannelsArray = [channel.onNativeReady, channel.onPluginsReady];
1159
 
1053
 
1173
     }
1067
     }
1174
 }, 5000);
1068
 }, 5000);
1175
 
1069
 
1176
-// Replace navigator before any modules are required(), to ensure it happens as soon as possible.
1177
-// We replace it so that properties that can't be clobbered can instead be overridden.
1178
-function replaceNavigator (origNavigator) {
1179
-    var CordovaNavigator = function () {};
1180
-    CordovaNavigator.prototype = origNavigator;
1181
-    var newNavigator = new CordovaNavigator();
1182
-    // This work-around really only applies to new APIs that are newer than Function.bind.
1183
-    // Without it, APIs such as getGamepads() break.
1184
-    if (CordovaNavigator.bind) {
1185
-        for (var key in origNavigator) {
1186
-            if (typeof origNavigator[key] === 'function') {
1187
-                newNavigator[key] = origNavigator[key].bind(origNavigator);
1188
-            } else {
1189
-                (function (k) {
1190
-                    utils.defineGetterSetter(newNavigator, key, function () {
1191
-                        return origNavigator[k];
1192
-                    });
1193
-                })(key);
1194
-            }
1195
-        }
1196
-    }
1197
-    return newNavigator;
1198
-}
1199
-
1200
-if (window.navigator) {
1201
-    window.navigator = replaceNavigator(window.navigator);
1202
-}
1203
-
1204
 if (!window.console) {
1070
 if (!window.console) {
1205
     window.console = {
1071
     window.console = {
1206
         log: function () {}
1072
         log: function () {}
1266
     channel.join(function () {
1132
     channel.join(function () {
1267
         require('cordova').fireDocumentEvent('deviceready');
1133
         require('cordova').fireDocumentEvent('deviceready');
1268
     }, channel.deviceReadyChannelsArray);
1134
     }, channel.deviceReadyChannelsArray);
1269
-
1270
 }, platformInitChannelsArray);
1135
 }, platformInitChannelsArray);
1271
 
1136
 
1272
 });
1137
 });
1378
         // see the file under plugin/ios/console.js
1243
         // see the file under plugin/ios/console.js
1379
         require('cordova/modulemapper').clobbers('cordova/plugin/ios/console', 'window.console');
1244
         require('cordova/modulemapper').clobbers('cordova/plugin/ios/console', 'window.console');
1380
 
1245
 
1246
+        // Attach the wkwebkit utility to window.WkWebView
1247
+        // see the file under plugin/ios/wkwebkit.js
1248
+        require('cordova/modulemapper').clobbers('cordova/plugin/ios/wkwebkit', 'window.WkWebView');
1249
+
1250
+        // Attach the splashscreen utility to window.navigator.splashscreen
1251
+        // see the file under plugin/ios/launchscreen.js
1252
+        require('cordova/modulemapper').clobbers('cordova/plugin/ios/launchscreen', 'navigator.splashscreen');
1253
+
1381
         require('cordova/channel').onNativeReady.fire();
1254
         require('cordova/channel').onNativeReady.fire();
1382
     }
1255
     }
1383
 };
1256
 };
1555
 
1428
 
1556
 });
1429
 });
1557
 
1430
 
1431
+// file: ../cordova-ios/cordova-js-src/plugin/ios/launchscreen.js
1432
+define("cordova/plugin/ios/launchscreen", function(require, exports, module) {
1433
+
1434
+var exec = require('cordova/exec');
1435
+
1436
+var launchscreen = {
1437
+    show: function () {
1438
+        exec(null, null, 'LaunchScreen', 'show', []);
1439
+    },
1440
+    hide: function () {
1441
+        exec(null, null, 'LaunchScreen', 'hide', []);
1442
+    }
1443
+};
1444
+
1445
+module.exports = launchscreen;
1446
+
1447
+});
1448
+
1558
 // file: ../cordova-ios/cordova-js-src/plugin/ios/logger.js
1449
 // file: ../cordova-ios/cordova-js-src/plugin/ios/logger.js
1559
 define("cordova/plugin/ios/logger", function(require, exports, module) {
1450
 define("cordova/plugin/ios/logger", function(require, exports, module) {
1560
 
1451
 
1851
 }
1742
 }
1852
 
1743
 
1853
 function __formatted (object, formatChar) {
1744
 function __formatted (object, formatChar) {
1854
-
1855
     try {
1745
     try {
1856
         switch (formatChar) {
1746
         switch (formatChar) {
1857
         case 'j':
1747
         case 'j':
1889
 
1779
 
1890
 });
1780
 });
1891
 
1781
 
1782
+// file: ../cordova-ios/cordova-js-src/plugin/ios/wkwebkit.js
1783
+define("cordova/plugin/ios/wkwebkit", function(require, exports, module) {
1784
+
1785
+var exec = require('cordova/exec');
1786
+
1787
+var WkWebKit = {
1788
+    allowsBackForwardNavigationGestures: function (allow) {
1789
+        exec(null, null, 'CDVWebViewEngine', 'allowsBackForwardNavigationGestures', [allow]);
1790
+    },
1791
+    convertFilePath: function (path) {
1792
+        if (!path || !window.CDV_ASSETS_URL) {
1793
+            return path;
1794
+        }
1795
+        if (path.startsWith('/')) {
1796
+            return window.CDV_ASSETS_URL + '/_app_file_' + path;
1797
+        }
1798
+        if (path.startsWith('file://')) {
1799
+            return window.CDV_ASSETS_URL + path.replace('file://', '/_app_file_');
1800
+        }
1801
+        return path;
1802
+    }
1803
+};
1804
+
1805
+module.exports = WkWebKit;
1806
+
1807
+});
1808
+
1892
 // file: src/common/pluginloader.js
1809
 // file: src/common/pluginloader.js
1893
 define("cordova/pluginloader", function(require, exports, module) {
1810
 define("cordova/pluginloader", function(require, exports, module) {
1894
 
1811
 
2160
     var F = function () {};
2077
     var F = function () {};
2161
     // extend Child from Parent
2078
     // extend Child from Parent
2162
     return function (Child, Parent) {
2079
     return function (Child, Parent) {
2163
-
2164
         F.prototype = Parent.prototype;
2080
         F.prototype = Parent.prototype;
2165
         Child.prototype = new F();
2081
         Child.prototype = new F();
2166
         Child.__super__ = Parent.prototype;
2082
         Child.__super__ = Parent.prototype;

+ 0
- 30
node_modules/cordova-ios/LICENSE View File

224
 //     misrepresented as being the original software.
224
 //     misrepresented as being the original software.
225
 //  3. This notice may not be removed or altered from any source
225
 //  3. This notice may not be removed or altered from any source
226
 //     distribution.
226
 //     distribution.
227
-
228
-================================================================================
229
-bin/node_modules/shelljs:
230
-================================================================================
231
-Copyright (c) 2012, Artur Adib <aadib@mozilla.com>
232
-All rights reserved.
233
-
234
-You may use this project under the terms of the New BSD license as follows:
235
-
236
-Redistribution and use in source and binary forms, with or without
237
-modification, are permitted provided that the following conditions are met:
238
-    * Redistributions of source code must retain the above copyright
239
-      notice, this list of conditions and the following disclaimer.
240
-    * Redistributions in binary form must reproduce the above copyright
241
-      notice, this list of conditions and the following disclaimer in the
242
-      documentation and/or other materials provided with the distribution.
243
-    * Neither the name of Artur Adib nor the
244
-      names of the contributors may be used to endorse or promote products
245
-      derived from this software without specific prior written permission.
246
-
247
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
248
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
249
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
250
-ARE DISCLAIMED. IN NO EVENT SHALL ARTUR ADIB BE LIABLE FOR ANY
251
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
252
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
253
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
254
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
255
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
256
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ 30
- 27
node_modules/cordova-ios/README.md View File

7
 # to you under the Apache License, Version 2.0 (the
7
 # to you under the Apache License, Version 2.0 (the
8
 # "License"); you may not use this file except in compliance
8
 # "License"); you may not use this file except in compliance
9
 # with the License.  You may obtain a copy of the License at
9
 # with the License.  You may obtain a copy of the License at
10
-#
10
+# 
11
 # http://www.apache.org/licenses/LICENSE-2.0
11
 # http://www.apache.org/licenses/LICENSE-2.0
12
-#
12
+# 
13
 # Unless required by applicable law or agreed to in writing,
13
 # Unless required by applicable law or agreed to in writing,
14
 # software distributed under the License is distributed on an
14
 # software distributed under the License is distributed on an
15
 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19
 #
19
 #
20
 -->
20
 -->
21
 
21
 
22
-[![Build status](https://ci.appveyor.com/api/projects/status/github/apache/cordova-ios?branch=master)](https://ci.appveyor.com/project/Humbedooh/cordova-ios)
23
-[![Build Status](https://travis-ci.org/apache/cordova-ios.svg?branch=master)](https://travis-ci.org/apache/cordova-ios)
22
+# Cordova iOS
23
+
24
+[![NPM](https://nodei.co/npm/cordova-ios.png)](https://nodei.co/npm/cordova-ios/)
25
+
26
+[![Node CI](https://github.com/apache/cordova-ios/workflows/Node%20CI/badge.svg?branch=master)](https://github.com/apache/cordova-ios/actions?query=branch%3Amaster)
24
 [![codecov.io](https://codecov.io/github/apache/cordova-ios/coverage.svg?branch=master)](https://codecov.io/github/apache/cordova-ios?branch=master)
27
 [![codecov.io](https://codecov.io/github/apache/cordova-ios/coverage.svg?branch=master)](https://codecov.io/github/apache/cordova-ios?branch=master)
25
 
28
 
26
-Cordova iOS
27
-=============================================================
28
 Cordova iOS is an iOS application library that allows for Cordova-based projects to be built for the iOS Platform. Cordova based applications are, at the core, applications written with web technology: HTML, CSS and JavaScript.
29
 Cordova iOS is an iOS application library that allows for Cordova-based projects to be built for the iOS Platform. Cordova based applications are, at the core, applications written with web technology: HTML, CSS and JavaScript.
29
 
30
 
30
-<a href="http://cordova.apache.org">Apache Cordova</a> is a project of <a href="http://apache.org">The Apache Software Foundation (ASF)</a>.
31
+[Apache Cordova](https://cordova.apache.org/) is a project of [The Apache Software Foundation (ASF)](https://apache.org/).
31
 
32
 
32
-Requires:
33
+## Requirements
33
 
34
 
34
-* Xcode 9.x (deprecated), 10, or greater. Download it at [http://developer.apple.com/downloads](http://developer.apple.com/downloads) or the [Mac App Store](http://itunes.apple.com/us/app/xcode/id497799835?mt=12).
35
-* [node.js](https://nodejs.org)
35
+* Xcode 11.x or greater. Download it at the [Apple Developer - Downloads](https://developer.apple.com/downloads) or the [Mac App Store](https://apps.apple.com/us/app/xcode/id497799835?mt=12).
36
+* [Node.js](https://nodejs.org)
36
 
37
 
37
-Create a Cordova project
38
--------------------------------------------------------------
38
+## Create a Cordova project
39
 
39
 
40
-Follow the instructions in the [**Command-Line Usage** section](http://cordova.apache.org/docs/en/edge/guide_cli_index.md.html#The%20Command-line%20Interface) of [http://docs.cordova.io](http://docs.cordova.io)
40
+Follow the instructions in the [**Command-Line Usage** section](https://cordova.apache.org/docs/en/edge/guide_cli_index.md.html#The%20Command-line%20Interface) of [Apache Cordova Docs](https://cordova.apache.org/docs/en/latest/)
41
 
41
 
42
 To use a **shared CordovaLib**, for example in development, link the appropriate cordova-ios platform folder path:
42
 To use a **shared CordovaLib**, for example in development, link the appropriate cordova-ios platform folder path:
43
 
43
 
44
-    cordova platform add --link /path/to/cordova-ios
44
+```bash
45
+cordova platform add --link /path/to/cordova-ios
46
+```
47
+
48
+## Updating a Cordova project
45
 
49
 
46
-Updating a Cordova project
47
--------------------------------------------------------------
50
+When you install a new `cordova-cli` version that comes with a new iOS platform version, from within your project:
48
 
51
 
49
-When you install a new cordova-cli version that comes with a new iOS platform version, from within your project:
52
+```bash
53
+cordova platform rm ios
54
+cordova platform add ios
55
+```
50
 
56
 
51
-    cordova platform rm ios
52
-    cordova platform add ios
57
+## How to Test Repo Development
53
 
58
 
54
-Tests
55
---------------------------------------------------------------------
59
+```bash
60
+npm install
61
+npm test
62
+```
56
 
63
 
57
-1. Run `npm install`
58
-2. Run `npm test`
64
+## Futher reading
59
 
65
 
60
-Futher reading
61
------
62
-* [http://cordova.apache.org/](http://cordova.apache.org/)
63
-* [http://wiki.apache.org/cordova/](http://wiki.apache.org/cordova/)
66
+* [https://cordova.apache.org/](https://cordova.apache.org/)

+ 81
- 0
node_modules/cordova-ios/RELEASENOTES.md View File

22
 
22
 
23
 Cordova is a static library that enables developers to include the Cordova API in their iOS application projects easily, and also create new Cordova-based iOS application projects through the command-line.
23
 Cordova is a static library that enables developers to include the Cordova API in their iOS application projects easily, and also create new Cordova-based iOS application projects through the command-line.
24
 
24
 
25
+### 6.1.1 (Aug 28, 2020)
26
+* [GH-976](https://github.com/apache/cordova-ios/pull/976) Update npm dependencies to pull in `cordova-common@4.0.2`
27
+    * This should resolve several issues affecting Info.plist files, including [#764](https://github.com/apache/cordova-ios/issues/764) and [#775](https://github.com/apache/cordova-ios/issues/775)
28
+* [GH-973](https://github.com/apache/cordova-ios/pull/973) Append `startURL` to the initial url loaded
29
+* [GH-912](https://github.com/apache/cordova-ios/issues/912) fix deployment to device ([#936](https://github.com/apache/cordova-ios/pull/936))
30
+* [GH-932](https://github.com/apache/cordova-ios/pull/932) add node 14 to CI workflow
31
+
32
+### 6.1.0 (Jun 21, 2020)
33
+* [GH-910](https://github.com/apache/cordova-ios/pull/910) Set `$PROJECT_NAME` properly when installing plugins
34
+* [GH-885](https://github.com/apache/cordova-ios/pull/885) Don't silently ignore creation of new windows
35
+* [GH-889](https://github.com/apache/cordova-ios/issues/899) Revert "(ios) Don't pre-fill orientation" ([#901](https://github.com/apache/cordova-ios/pull/901))
36
+* [GH-902](https://github.com/apache/cordova-ios/pull/902) chore: fix eslint failure
37
+* [GH-808](https://github.com/apache/cordova-ios/pull/808) Dark mode splashscreen storyboard images
38
+* [GH-886](https://github.com/apache/cordova-ios/pull/886) Add PreferredContentMode preference
39
+* [GH-890](https://github.com/apache/cordova-ios/issues/890) Fix SplashScreen issues & refactor BackgroundColor ([#896](https://github.com/apache/cordova-ios/pull/896))
40
+* [GH-888](https://github.com/apache/cordova-ios/pull/888) fix: author and tag podspec errors
41
+* [GH-882](https://github.com/apache/cordova-ios/pull/882) fix: Properly get version from `package.json`
42
+
43
+### 6.0.0 (May 28, 2020)
44
+
45
+* [GH-875](https://github.com/apache/cordova-ios/pull/875) fix: remove `q` leftover
46
+* chore(`audit-license-headers`): add & correct license
47
+* [GH-874](https://github.com/apache/cordova-ios/pull/874) chore: cleanup & prep for 6.0.0 release
48
+* [GH-873](https://github.com/apache/cordova-ios/pull/873) chore: remove unassigned splash image
49
+* [GH-872](https://github.com/apache/cordova-ios/pull/872) chore: remove migrate `English.lproj` deprecated warning
50
+* [GH-871](https://github.com/apache/cordova-ios/pull/871) chore: enable base internalization for `CordovaLib`
51
+* [GH-866](https://github.com/apache/cordova-ios/pull/866) refactor: default to file scheme
52
+* [GH-852](https://github.com/apache/cordova-ios/pull/852) ci: use github actions
53
+* [GH-869](https://github.com/apache/cordova-ios/pull/869) refactor: bump eslint w/ lint fix & rebuilt package-lock
54
+* [GH-860](https://github.com/apache/cordova-ios/pull/860) breaking: drop `q` dependency
55
+* [GH-859](https://github.com/apache/cordova-ios/pull/859) refactor: use `superspawn`
56
+* [GH-851](https://github.com/apache/cordova-ios/pull/851) breaking: replace `shelljs` with `fs-extra`
57
+* [GH-862](https://github.com/apache/cordova-ios/pull/862) revert: `ios-sim` `^9.0.0` to `^8.0.2`
58
+* [GH-863](https://github.com/apache/cordova-ios/pull/863) chore (npm): add ignore list
59
+* [GH-861](https://github.com/apache/cordova-ios/pull/861) chore: add `package-lock.json`
60
+* [GH-790](https://github.com/apache/cordova-ios/pull/790) breaking feature: Integrate & replace SplashScreens w/ Launch Storyboard (CB-13143)
61
+* [GH-769](https://github.com/apache/cordova-ios/pull/769) breaking: add python 3 compatibility to `bin/cordova_plist_to_config_xml`
62
+* [GH-847](https://github.com/apache/cordova-ios/pull/847) breaking: add & use `fs-extra` w/ fixes
63
+* [GH-853](https://github.com/apache/cordova-ios/pull/853) breaking: bump `xcode` w/ fix
64
+* [GH-850](https://github.com/apache/cordova-ios/pull/850) breaking: fix file's `chmod`
65
+* [GH-849](https://github.com/apache/cordova-ios/pull/849) breaking(`pod`): remove unused API & bump minimum version requirements to `1.8.0`
66
+* [GH-848](https://github.com/apache/cordova-ios/pull/848) breaking: bump `cordova-common@4.0.1`
67
+* [GH-846](https://github.com/apache/cordova-ios/pull/846) breaking(npm): bump dependencies
68
+* [GH-845](https://github.com/apache/cordova-ios/pull/845) breaking(npm): bump dev dependencies
69
+* [GH-825](https://github.com/apache/cordova-ios/pull/825) Fix type warnings and simplify code with auto boxing.
70
+* [GH-615](https://github.com/apache/cordova-ios/pull/615) (ios) Don't pre-fill `orientation`
71
+* [GH-820](https://github.com/apache/cordova-ios/pull/820) Only set `bundleid` to main app target
72
+* Update CONTRIBUTING.md
73
+* [GH-822](https://github.com/apache/cordova-ios/pull/822) chore: remove deprecated `orientation` methods
74
+* [GH-810](https://github.com/apache/cordova-ios/pull/810) Remove dead link to wiki from `README`
75
+* [GH-543](https://github.com/apache/cordova-ios/pull/543) feat: Add `Podspec` for Cordova library
76
+* [GH-801](https://github.com/apache/cordova-ios/pull/801) breaking (`UserAgent`): Drop `CDVUserAgentUtil` and Implement for WKWebView
77
+* [GH-803](https://github.com/apache/cordova-ios/pull/803) feature: add `CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED`
78
+* [GH-802](https://github.com/apache/cordova-ios/pull/802) refactor: applied various xcode recommended update
79
+* [GH-800](https://github.com/apache/cordova-ios/pull/800) tests: change comment values for `MediaTypesRequiringUserActionForPlayback`
80
+* [GH-781](https://github.com/apache/cordova-ios/pull/781) breaking: Use `WKURLSchemeHandler` for serving app content
81
+* [GH-797](https://github.com/apache/cordova-ios/pull/797) breaking: remove MediaPlaybackRequiresUserAction and update `MediaTypesRequiringUserActionForPlayback` to proper variable types
82
+* [GH-798](https://github.com/apache/cordova-ios/pull/798) refactor (`cordovaBoolSettingForKey`): improve boolean checks and native logging
83
+* [GH-785](https://github.com/apache/cordova-ios/pull/785) refactor: deprecate `mediaPlaybackAllowsAirPlay`
84
+* [GH-794](https://github.com/apache/cordova-ios/pull/794) style: remove extra space from Objective-C test modules
85
+* [GH-784](https://github.com/apache/cordova-ios/pull/784) chore: deprecate `mediaPlaybackRequiresUserAction`
86
+* [GH-783](https://github.com/apache/cordova-ios/pull/783) breaking (`CDVURLProtocol`): delete
87
+* [GH-789](https://github.com/apache/cordova-ios/pull/789) chore: fix deprecated `stringByAddingPercentEscapesUsingEncoding` usage
88
+* [GH-788](https://github.com/apache/cordova-ios/pull/788) chore: remove deprecated method `viewDidUnload`
89
+* [GH-780](https://github.com/apache/cordova-ios/pull/780) breaking: upgrade xcode compatible to 11.0
90
+* [GH-787](https://github.com/apache/cordova-ios/pull/787) fix (`CDVWebViewEngine`): JavaScript to Native Call Not Working
91
+* [GH-786](https://github.com/apache/cordova-ios/pull/786) test: run on Xcode 11 only
92
+* [GH-782](https://github.com/apache/cordova-ios/pull/782) fix (`node`): require failure with `shebang` interpreter
93
+* [GH-779](https://github.com/apache/cordova-ios/pull/779) breaking: bump `deployment-target` to `11.0`
94
+* [GH-773](https://github.com/apache/cordova-ios/pull/773) refactor: drop `uiwebview` & add `wkwebview`
95
+* [GH-751](https://github.com/apache/cordova-ios/pull/751) refactor: use template strings
96
+* [GH-749](https://github.com/apache/cordova-ios/pull/749) refactor: transform split out variables
97
+* [GH-750](https://github.com/apache/cordova-ios/pull/750) refactor: transform object shorthand
98
+* [GH-748](https://github.com/apache/cordova-ios/pull/748) refactor: do not alias this to self
99
+* [GH-747](https://github.com/apache/cordova-ios/pull/747) refactor: use arrow functions
100
+* [GH-754](https://github.com/apache/cordova-ios/pull/754) fix: replace variables in `Podfile`
101
+* [GH-746](https://github.com/apache/cordova-ios/pull/746) refactor: transform `var` to `let`/`const`
102
+* [GH-744](https://github.com/apache/cordova-ios/pull/744) chore: updated `eslint` with applied fix
103
+* [GH-743](https://github.com/apache/cordova-ios/pull/743) chore: bump `node` requirement (>=10)
104
+* [GH-731](https://github.com/apache/cordova-ios/pull/731) CB-14135(ios): escape all single quotes from name in `Podfile`
105
+
25
 ### 5.1.1 (Nov 28, 2019)
106
 ### 5.1.1 (Nov 28, 2019)
26
 * [GH-726](https://github.com/apache/cordova-ios/pull/726) fix: make prepare wait for add to finish
107
 * [GH-726](https://github.com/apache/cordova-ios/pull/726) fix: make prepare wait for add to finish
27
 * [GH-728](https://github.com/apache/cordova-ios/pull/728) chore: delete some useless characters
108
 * [GH-728](https://github.com/apache/cordova-ios/pull/728) chore: delete some useless characters

+ 0
- 18
node_modules/cordova-ios/appveyor.yml View File

1
-environment:
2
-  matrix:
3
-  - nodejs_version: 6
4
-  - nodejs_version: 8
5
-  - nodejs_version: 10
6
-  - nodejs_version: 12
7
-
8
-install:
9
-  - ps: Install-Product node $env:nodejs_version
10
-  - npm install
11
-
12
-build: off
13
-
14
-test_script:
15
-  - node --version
16
-  - npm --version
17
-  - npm run unit-tests
18
-  - npm run eslint

+ 1
- 1
node_modules/cordova-ios/bin/apple_ios_version View File

21
 
21
 
22
 var versions = require('./templates/scripts/cordova/lib/versions.js');
22
 var versions = require('./templates/scripts/cordova/lib/versions.js');
23
 
23
 
24
-versions.get_apple_ios_version().done(null, function (err) {
24
+versions.get_apple_ios_version().catch(err => {
25
     console.log(err);
25
     console.log(err);
26
     process.exit(2);
26
     process.exit(2);
27
 });
27
 });

+ 0
- 0
node_modules/cordova-ios/bin/apple_ios_version.bat View File


+ 1
- 1
node_modules/cordova-ios/bin/apple_osx_version View File

21
 
21
 
22
 var versions = require('./templates/scripts/cordova/lib/versions.js');
22
 var versions = require('./templates/scripts/cordova/lib/versions.js');
23
 
23
 
24
-versions.get_apple_osx_version().done(null, function (err) {
24
+versions.get_apple_osx_version().catch(err => {
25
     console.log(err);
25
     console.log(err);
26
     process.exit(2);
26
     process.exit(2);
27
 });
27
 });

+ 0
- 0
node_modules/cordova-ios/bin/apple_osx_version.bat View File


+ 9
- 6
node_modules/cordova-ios/bin/apple_xcode_version View File

21
 
21
 
22
 var versions = require('./templates/scripts/cordova/lib/versions.js');
22
 var versions = require('./templates/scripts/cordova/lib/versions.js');
23
 
23
 
24
-versions.get_apple_xcode_version().done(function (version) {
25
-    console.log(version);
26
-}, function (err) {
27
-    console.error(err);
28
-    process.exit(2);
29
-});
24
+versions.get_apple_xcode_version().then(
25
+    version => {
26
+        console.log(version);
27
+    },
28
+    err => {
29
+        console.error(err);
30
+        process.exit(2);
31
+    }
32
+);

+ 0
- 0
node_modules/cordova-ios/bin/apple_xcode_version.bat View File


+ 1
- 1
node_modules/cordova-ios/bin/check_reqs View File

25
 if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) > -1) {
25
 if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) > -1) {
26
     console.log('Usage: check_reqs or node check_reqs');
26
     console.log('Usage: check_reqs or node check_reqs');
27
 } else {
27
 } else {
28
-    check_reqs.run().done(null, function (err) {
28
+    check_reqs.run().catch(err => {
29
         console.error('Failed to check requirements due to ' + err);
29
         console.error('Failed to check requirements due to ' + err);
30
         process.exit(2);
30
         process.exit(2);
31
     });
31
     });

+ 0
- 0
node_modules/cordova-ios/bin/check_reqs.bat View File


+ 8
- 7
node_modules/cordova-ios/bin/cordova_plist_to_config_xml View File

23
 Usage:
23
 Usage:
24
   plist2xml.py path/to/project
24
   plist2xml.py path/to/project
25
 """
25
 """
26
+from __future__ import print_function
26
 
27
 
27
-import StringIO
28
 import fileinput
28
 import fileinput
29
-import plistlib
29
+import io
30
 import os
30
 import os
31
+import plistlib
31
 import re
32
 import re
32
 import sys
33
 import sys
33
 from xml.dom import minidom
34
 from xml.dom import minidom
88
     root.append(ElementTree.Element('access', attrib={'origin':value}))
89
     root.append(ElementTree.Element('access', attrib={'origin':value}))
89
 
90
 
90
   tree = ElementTree.ElementTree(root)
91
   tree = ElementTree.ElementTree(root)
91
-  s = StringIO.StringIO()
92
-  tree.write(s, encoding='UTF-8')
93
-  mini_dom = minidom.parseString(s.getvalue())
94
-  with open(dst_path, 'w') as out:
92
+  with io.BytesIO() as s:
93
+    tree.write(s, encoding='UTF-8')
94
+    mini_dom = minidom.parseString(s.getvalue())
95
+  with open(dst_path, 'wb') as out:
95
     out.write(mini_dom.toprettyxml(encoding='UTF-8'))
96
     out.write(mini_dom.toprettyxml(encoding='UTF-8'))
96
 
97
 
97
 
98
 
101
     if 'Cordova.plist' in line:
102
     if 'Cordova.plist' in line:
102
       line = line.replace('Cordova.plist', 'config.xml')
103
       line = line.replace('Cordova.plist', 'config.xml')
103
       line = line.replace('lastKnownFileType = text.plist.xml', 'lastKnownFileType = text.xml')
104
       line = line.replace('lastKnownFileType = text.plist.xml', 'lastKnownFileType = text.xml')
104
-    print line,
105
+    print(line, end=' ')
105
   file_handle.close()
106
   file_handle.close()
106
 
107
 
107
 
108
 

+ 6
- 6
node_modules/cordova-ios/bin/create View File

34
 var Api = require('./templates/scripts/cordova/Api');
34
 var Api = require('./templates/scripts/cordova/Api');
35
 
35
 
36
 var argv = require('nopt')({
36
 var argv = require('nopt')({
37
-    'help': Boolean,
38
-    'cli': Boolean,
39
-    'shared': Boolean, // alias for --link
40
-    'link': Boolean
41
-}, { 'd': '--verbose' });
37
+    help: Boolean,
38
+    cli: Boolean,
39
+    shared: Boolean, // alias for --link
40
+    link: Boolean
41
+}, { d: '--verbose' });
42
 
42
 
43
 var projectPath = argv.argv.remain[0];
43
 var projectPath = argv.argv.remain[0];
44
 
44
 
68
 
68
 
69
 require('./templates/scripts/cordova/loggingHelper').adjustLoggerLevel(argv);
69
 require('./templates/scripts/cordova/loggingHelper').adjustLoggerLevel(argv);
70
 
70
 
71
-Api.createPlatform(projectPath, config, options).done();
71
+Api.createPlatform(projectPath, config, options);

+ 0
- 0
node_modules/cordova-ios/bin/create.bat View File


+ 117
- 134
node_modules/cordova-ios/bin/lib/create.js View File

1
-#!/usr/bin/env node
2
-
3
 /*
1
 /*
4
     Licensed to the Apache Software Foundation (ASF) under one
2
     Licensed to the Apache Software Foundation (ASF) under one
5
     or more contributor license agreements. See the NOTICE file
3
     or more contributor license agreements. See the NOTICE file
19
     under the License.
17
     under the License.
20
 */
18
 */
21
 
19
 
22
-var shell = require('shelljs');
23
-var Q = require('q');
24
-var path = require('path');
25
-var fs = require('fs');
26
-var xcode = require('xcode');
27
-var xmlescape = require('xml-escape');
28
-var ROOT = path.join(__dirname, '..', '..');
29
-var events = require('cordova-common').events;
20
+const path = require('path');
21
+const fs = require('fs-extra');
22
+const xmlescape = require('xml-escape');
23
+const ROOT = path.join(__dirname, '..', '..');
24
+const { CordovaError, events } = require('cordova-common');
25
+const utils = require('./utils');
30
 
26
 
31
 function updateSubprojectHelp () {
27
 function updateSubprojectHelp () {
32
     console.log('Updates the subproject path of the CordovaLib entry to point to this script\'s version of Cordova.');
28
     console.log('Updates the subproject path of the CordovaLib entry to point to this script\'s version of Cordova.');
34
 }
30
 }
35
 
31
 
36
 function copyJsAndCordovaLib (projectPath, projectName, use_shared, config) {
32
 function copyJsAndCordovaLib (projectPath, projectName, use_shared, config) {
37
-    shell.cp('-f', path.join(ROOT, 'CordovaLib', 'cordova.js'), path.join(projectPath, 'www'));
38
-    shell.cp('-rf', path.join(ROOT, 'cordova-js-src'), path.join(projectPath, 'platform_www'));
39
-    shell.cp('-f', path.join(ROOT, 'CordovaLib', 'cordova.js'), path.join(projectPath, 'platform_www'));
33
+    fs.copySync(path.join(ROOT, 'CordovaLib', 'cordova.js'), path.join(projectPath, 'www/cordova.js'));
34
+    fs.copySync(path.join(ROOT, 'cordova-js-src'), path.join(projectPath, 'platform_www/cordova-js-src'));
35
+    fs.copySync(path.join(ROOT, 'CordovaLib', 'cordova.js'), path.join(projectPath, 'platform_www/cordova.js'));
36
+
37
+    /*
38
+     * Check if "CordovaLib" already exists with "fs.lstatSync" and remove it.
39
+     * Wrapped with try/catch because lstatSync will throw an error if "CordovaLib"
40
+     * is missing.
41
+     */
40
     try {
42
     try {
41
         const stats = fs.lstatSync(path.join(projectPath, 'CordovaLib'));
43
         const stats = fs.lstatSync(path.join(projectPath, 'CordovaLib'));
42
         if (stats.isSymbolicLink()) {
44
         if (stats.isSymbolicLink()) {
43
             fs.unlinkSync(path.join(projectPath, 'CordovaLib'));
45
             fs.unlinkSync(path.join(projectPath, 'CordovaLib'));
44
         } else {
46
         } else {
45
-            shell.rm('-rf', path.join(projectPath, 'CordovaLib'));
47
+            fs.removeSync(path.join(projectPath, 'CordovaLib'));
46
         }
48
         }
47
     } catch (e) { }
49
     } catch (e) { }
48
     if (use_shared) {
50
     if (use_shared) {
49
-        update_cordova_subproject([path.join(projectPath, projectName + '.xcodeproj', 'project.pbxproj'), config]);
51
+        update_cordova_subproject([path.join(projectPath, `${projectName}.xcodeproj`, 'project.pbxproj'), config]);
50
         // Symlink not used in project file, but is currently required for plugman because
52
         // Symlink not used in project file, but is currently required for plugman because
51
         // it reads the VERSION file from it (instead of using the cordova/version script
53
         // it reads the VERSION file from it (instead of using the cordova/version script
52
         // like it should).
54
         // like it should).
53
         fs.symlinkSync(path.join(ROOT, 'CordovaLib'), path.join(projectPath, 'CordovaLib'));
55
         fs.symlinkSync(path.join(ROOT, 'CordovaLib'), path.join(projectPath, 'CordovaLib'));
54
     } else {
56
     } else {
55
-        var r = path.join(projectPath, projectName);
56
-        shell.mkdir('-p', path.join(projectPath, 'CordovaLib', 'CordovaLib.xcodeproj'));
57
-        shell.cp('-f', path.join(r, '.gitignore'), projectPath);
58
-        shell.cp('-rf', path.join(ROOT, 'CordovaLib', 'Classes'), path.join(projectPath, 'CordovaLib'));
59
-        shell.cp('-f', path.join(ROOT, 'CordovaLib', 'VERSION'), path.join(projectPath, 'CordovaLib'));
60
-        shell.cp('-f', path.join(ROOT, 'CordovaLib', 'cordova.js'), path.join(projectPath, 'CordovaLib'));
61
-        shell.cp('-f', path.join(ROOT, 'CordovaLib', 'CordovaLib_Prefix.pch'), path.join(projectPath, 'CordovaLib'));
62
-        shell.cp('-f', path.join(ROOT, 'CordovaLib', 'CordovaLib.xcodeproj', 'project.pbxproj'), path.join(projectPath, 'CordovaLib', 'CordovaLib.xcodeproj'));
63
-        update_cordova_subproject([path.join(r + '.xcodeproj', 'project.pbxproj'), path.join(projectPath, 'CordovaLib', 'CordovaLib.xcodeproj', 'project.pbxproj'), config]);
57
+        const r = path.join(projectPath, projectName);
58
+        fs.ensureDirSync(path.join(projectPath, 'CordovaLib', 'CordovaLib.xcodeproj'));
59
+        fs.copySync(path.join(r, '.gitignore'), path.join(projectPath, '.gitignore'));
60
+        fs.copySync(path.join(ROOT, 'CordovaLib', 'Classes'), path.join(projectPath, 'CordovaLib/Classes'));
61
+        fs.copySync(path.join(ROOT, 'CordovaLib', 'VERSION'), path.join(projectPath, 'CordovaLib/VERSION'));
62
+        fs.copySync(path.join(ROOT, 'CordovaLib', 'cordova.js'), path.join(projectPath, 'CordovaLib/cordova.js'));
63
+        fs.copySync(path.join(ROOT, 'CordovaLib', 'CordovaLib_Prefix.pch'), path.join(projectPath, 'CordovaLib/CordovaLib_Prefix.pch'));
64
+        fs.copySync(path.join(ROOT, 'CordovaLib', 'CordovaLib.xcodeproj', 'project.pbxproj'), path.join(projectPath, 'CordovaLib', 'CordovaLib.xcodeproj', 'project.pbxproj'));
65
+        update_cordova_subproject([path.join(`${r}.xcodeproj`, 'project.pbxproj'), path.join(projectPath, 'CordovaLib', 'CordovaLib.xcodeproj', 'project.pbxproj'), config]);
64
     }
66
     }
65
 }
67
 }
66
 
68
 
67
 function copyScripts (projectPath, projectName) {
69
 function copyScripts (projectPath, projectName) {
68
-    var srcScriptsDir = path.join(ROOT, 'bin', 'templates', 'scripts', 'cordova');
69
-    var destScriptsDir = path.join(projectPath, 'cordova');
70
+    const srcScriptsDir = path.join(ROOT, 'bin', 'templates', 'scripts', 'cordova');
71
+    const destScriptsDir = path.join(projectPath, 'cordova');
70
 
72
 
71
     // Delete old scripts directory.
73
     // Delete old scripts directory.
72
-    shell.rm('-rf', destScriptsDir);
74
+    fs.removeSync(destScriptsDir);
73
 
75
 
74
     // Copy in the new ones.
76
     // Copy in the new ones.
75
-    var binDir = path.join(ROOT, 'bin');
76
-    shell.cp('-r', srcScriptsDir, projectPath);
77
+    const binDir = path.join(ROOT, 'bin');
78
+    fs.copySync(srcScriptsDir, destScriptsDir);
77
 
79
 
78
-    let nodeModulesDir = path.join(ROOT, 'node_modules');
79
-    if (fs.existsSync(nodeModulesDir)) shell.cp('-r', nodeModulesDir, destScriptsDir);
80
+    const nodeModulesDir = path.join(ROOT, 'node_modules');
81
+    if (fs.existsSync(nodeModulesDir)) fs.copySync(nodeModulesDir, path.join(destScriptsDir, 'node_modules'));
80
 
82
 
81
     // Copy the check_reqs script
83
     // Copy the check_reqs script
82
-    shell.cp(path.join(binDir, 'check_reqs*'), destScriptsDir);
84
+    fs.copySync(path.join(binDir, 'check_reqs'), path.join(destScriptsDir, 'check_reqs'));
85
+    fs.copySync(path.join(binDir, 'check_reqs.bat'), path.join(destScriptsDir, 'check_reqs.bat'));
83
 
86
 
84
     // Copy the version scripts
87
     // Copy the version scripts
85
-    shell.cp(path.join(binDir, 'apple_ios_version'), destScriptsDir);
86
-    shell.cp(path.join(binDir, 'apple_osx_version'), destScriptsDir);
87
-    shell.cp(path.join(binDir, 'apple_xcode_version'), destScriptsDir);
88
+    fs.copySync(path.join(binDir, 'apple_ios_version'), path.join(destScriptsDir, 'apple_ios_version'));
89
+    fs.copySync(path.join(binDir, 'apple_osx_version'), path.join(destScriptsDir, 'apple_osx_version'));
90
+    fs.copySync(path.join(binDir, 'apple_xcode_version'), path.join(destScriptsDir, 'apple_xcode_version'));
88
 
91
 
89
     // TODO: the two files being edited on-the-fly here are shared between
92
     // TODO: the two files being edited on-the-fly here are shared between
90
     // platform and project-level commands. the below `sed` is updating the
93
     // platform and project-level commands. the below `sed` is updating the
91
     // `require` path for the two libraries. if there's a better way to share
94
     // `require` path for the two libraries. if there's a better way to share
92
     // modules across both the repo and generated projects, we should make sure
95
     // modules across both the repo and generated projects, we should make sure
93
     // to remove/update this.
96
     // to remove/update this.
94
-    var path_regex = /templates\/scripts\/cordova\//;
95
-    shell.sed('-i', path_regex, '', path.join(destScriptsDir, 'check_reqs'));
96
-    shell.sed('-i', path_regex, '', path.join(destScriptsDir, 'apple_ios_version'));
97
-    shell.sed('-i', path_regex, '', path.join(destScriptsDir, 'apple_osx_version'));
98
-    shell.sed('-i', path_regex, '', path.join(destScriptsDir, 'apple_xcode_version'));
97
+    const path_regex = /templates\/scripts\/cordova\//;
98
+    utils.replaceFileContents(path.join(destScriptsDir, 'check_reqs'), path_regex, '');
99
+    utils.replaceFileContents(path.join(destScriptsDir, 'apple_ios_version'), path_regex, '');
100
+    utils.replaceFileContents(path.join(destScriptsDir, 'apple_osx_version'), path_regex, '');
101
+    utils.replaceFileContents(path.join(destScriptsDir, 'apple_xcode_version'), path_regex, '');
99
 
102
 
100
     // CB-11792 do a token replace for __PROJECT_NAME__ in .xcconfig
103
     // CB-11792 do a token replace for __PROJECT_NAME__ in .xcconfig
101
-    var project_name_esc = projectName.replace(/&/g, '\\&');
102
-    shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(destScriptsDir, 'build-debug.xcconfig'));
103
-    shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(destScriptsDir, 'build-release.xcconfig'));
104
-
105
-    // Make sure they are executable (sometimes zipping them can remove executable bit)
106
-    shell.find(destScriptsDir).forEach(function (entry) {
107
-        shell.chmod(755, entry);
108
-    });
104
+    const project_name_esc = projectName.replace(/&/g, '\\&');
105
+    utils.replaceFileContents(path.join(destScriptsDir, 'build-debug.xcconfig'), /__PROJECT_NAME__/g, project_name_esc);
106
+    utils.replaceFileContents(path.join(destScriptsDir, 'build-release.xcconfig'), /__PROJECT_NAME__/g, project_name_esc);
109
 }
107
 }
110
 
108
 
111
 /*
109
 /*
117
  * @parm  {BOOL}   use_cli              true if cli project
115
  * @parm  {BOOL}   use_cli              true if cli project
118
  */
116
  */
119
 function copyTemplateFiles (project_path, project_name, project_template_dir, package_name) {
117
 function copyTemplateFiles (project_path, project_name, project_template_dir, package_name) {
120
-    var r = path.join(project_path, project_name);
118
+    const r = path.join(project_path, project_name);
121
 
119
 
122
-    shell.rm('-rf', path.join(r + '.xcodeproj'));
123
-    shell.cp('-rf', path.join(project_template_dir, '__TEMP__.xcodeproj'), project_path);
124
-    shell.mv('-f', path.join(project_path, '__TEMP__.xcodeproj'), path.join(r + '.xcodeproj'));
120
+    fs.removeSync(path.join(`${r}.xcodeproj`));
121
+    fs.copySync(path.join(project_template_dir, '__TEMP__.xcodeproj'), path.join(`${project_path}/__TEMP__.xcodeproj`));
122
+    fs.moveSync(path.join(project_path, '__TEMP__.xcodeproj'), path.join(`${r}.xcodeproj`));
125
 
123
 
126
-    shell.rm('-rf', path.join(project_path, project_name + '.xcworkspace'));
127
-    shell.cp('-rf', path.join(project_template_dir, '__TEMP__.xcworkspace'), project_path);
128
-    shell.mv('-f', path.join(project_path, '__TEMP__.xcworkspace'), path.join(r + '.xcworkspace'));
129
-    shell.mv('-f', path.join(r + '.xcworkspace', 'xcshareddata', 'xcschemes', '__PROJECT_NAME__.xcscheme'), path.join(r + '.xcworkspace', 'xcshareddata', 'xcschemes', project_name + '.xcscheme'));
124
+    fs.removeSync(path.join(project_path, `${project_name}.xcworkspace`));
125
+    fs.copySync(path.join(project_template_dir, '__TEMP__.xcworkspace'), path.join(`${project_path}/__TEMP__.xcworkspace`));
126
+    fs.moveSync(path.join(project_path, '__TEMP__.xcworkspace'), path.join(`${r}.xcworkspace`));
127
+    fs.moveSync(path.join(`${r}.xcworkspace`, 'xcshareddata', 'xcschemes', '__PROJECT_NAME__.xcscheme'), path.join(`${r}.xcworkspace`, 'xcshareddata', 'xcschemes', `${project_name}.xcscheme`));
130
 
128
 
131
-    shell.rm('-rf', r);
132
-    shell.cp('-rf', path.join(project_template_dir, '__PROJECT_NAME__'), project_path);
133
-    shell.mv('-f', path.join(project_path, '__PROJECT_NAME__'), r);
129
+    fs.removeSync(r);
130
+    fs.copySync(path.join(project_template_dir, '__PROJECT_NAME__'), path.join(`${project_path}/__PROJECT_NAME__`));
131
+    fs.moveSync(path.join(project_path, '__PROJECT_NAME__'), r);
134
 
132
 
135
-    shell.mv('-f', path.join(r, '__PROJECT_NAME__-Info.plist'), path.join(r, project_name + '-Info.plist'));
136
-    shell.mv('-f', path.join(r, '__PROJECT_NAME__-Prefix.pch'), path.join(r, project_name + '-Prefix.pch'));
137
-    shell.mv('-f', path.join(r, 'gitignore'), path.join(r, '.gitignore'));
133
+    fs.moveSync(path.join(r, '__PROJECT_NAME__-Info.plist'), path.join(r, `${project_name}-Info.plist`));
134
+    fs.moveSync(path.join(r, '__PROJECT_NAME__-Prefix.pch'), path.join(r, `${project_name}-Prefix.pch`));
135
+    fs.moveSync(path.join(r, 'gitignore'), path.join(r, '.gitignore'));
138
 
136
 
139
     /* replace __PROJECT_NAME__ and __PROJECT_ID__ with ACTIVITY and ID strings, respectively, in:
137
     /* replace __PROJECT_NAME__ and __PROJECT_ID__ with ACTIVITY and ID strings, respectively, in:
140
      *
138
      *
149
      */
147
      */
150
 
148
 
151
     // https://issues.apache.org/jira/browse/CB-12402 - Encode XML characters properly
149
     // https://issues.apache.org/jira/browse/CB-12402 - Encode XML characters properly
152
-    var project_name_xml_esc = xmlescape(project_name);
153
-    shell.sed('-i', /__PROJECT_NAME__/g, project_name_xml_esc, path.join(r + '.xcworkspace', 'contents.xcworkspacedata'));
154
-    shell.sed('-i', /__PROJECT_NAME__/g, project_name_xml_esc, path.join(r + '.xcworkspace', 'xcshareddata', 'xcschemes', project_name + '.xcscheme'));
155
-
156
-    var project_name_esc = project_name.replace(/&/g, '\\&');
157
-    shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(r + '.xcodeproj', 'project.pbxproj'));
158
-    shell.sed('-i', /__PROJECT_ID__/g, package_name, path.join(r + '.xcodeproj', 'project.pbxproj'));
159
-    shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(r, 'Classes', 'AppDelegate.h'));
160
-    shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(r, 'Classes', 'AppDelegate.m'));
161
-    shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(r, 'Classes', 'MainViewController.h'));
162
-    shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(r, 'Classes', 'MainViewController.m'));
163
-    shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(r, 'main.m'));
164
-    shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(r, project_name + '-Info.plist'));
165
-    shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(r, project_name + '-Prefix.pch'));
150
+    const project_name_xml_esc = xmlescape(project_name);
151
+    utils.replaceFileContents(path.join(`${r}.xcworkspace`, 'contents.xcworkspacedata'), /__PROJECT_NAME__/g, project_name_xml_esc);
152
+    utils.replaceFileContents(path.join(`${r}.xcworkspace`, 'xcshareddata', 'xcschemes', `${project_name}.xcscheme`), /__PROJECT_NAME__/g, project_name_xml_esc);
153
+
154
+    const project_name_esc = project_name.replace(/&/g, '\\&');
155
+    utils.replaceFileContents(path.join(`${r}.xcodeproj`, 'project.pbxproj'), /__PROJECT_NAME__/g, project_name_esc);
156
+    utils.replaceFileContents(path.join(`${r}.xcodeproj`, 'project.pbxproj'), /__PROJECT_ID__/g, package_name);
157
+    utils.replaceFileContents(path.join(r, 'Classes', 'AppDelegate.h'), /__PROJECT_NAME__/g, project_name_esc);
158
+    utils.replaceFileContents(path.join(r, 'Classes', 'AppDelegate.m'), /__PROJECT_NAME__/g, project_name_esc);
159
+    utils.replaceFileContents(path.join(r, 'Classes', 'MainViewController.h'), /__PROJECT_NAME__/g, project_name_esc);
160
+    utils.replaceFileContents(path.join(r, 'Classes', 'MainViewController.m'), /__PROJECT_NAME__/g, project_name_esc);
161
+    utils.replaceFileContents(path.join(r, 'main.m'), /__PROJECT_NAME__/g, project_name_esc);
162
+    utils.replaceFileContents(path.join(r, `${project_name}-Info.plist`), /__PROJECT_NAME__/g, project_name_esc);
163
+    utils.replaceFileContents(path.join(r, `${project_name}-Prefix.pch`), /__PROJECT_NAME__/g, project_name_esc);
166
 }
164
 }
167
 
165
 
168
 function AbsParentPath (_path) {
166
 function AbsParentPath (_path) {
170
 }
168
 }
171
 
169
 
172
 function AbsProjectPath (relative_path) {
170
 function AbsProjectPath (relative_path) {
173
-    var absolute_path = path.resolve(relative_path);
171
+    let absolute_path = path.resolve(relative_path);
174
     if (/.pbxproj$/.test(absolute_path)) {
172
     if (/.pbxproj$/.test(absolute_path)) {
175
         absolute_path = AbsParentPath(absolute_path);
173
         absolute_path = AbsParentPath(absolute_path);
176
     } else if (!(/.xcodeproj$/.test(absolute_path))) {
174
     } else if (!(/.xcodeproj$/.test(absolute_path))) {
177
-        throw new Error('The following is not a valid path to an Xcode project: ' + absolute_path);
175
+        throw new Error(`The following is not a valid path to an Xcode project: ${absolute_path}`);
178
     }
176
     }
179
     return absolute_path;
177
     return absolute_path;
180
 }
178
 }
195
  * - <project_template_dir>: Path to a project template (override)
193
  * - <project_template_dir>: Path to a project template (override)
196
  *
194
  *
197
  */
195
  */
198
-exports.createProject = function (project_path, package_name, project_name, opts, config) {
196
+exports.createProject = (project_path, package_name, project_name, opts, config) => {
199
     package_name = package_name || 'my.cordova.project';
197
     package_name = package_name || 'my.cordova.project';
200
     project_name = project_name || 'CordovaExample';
198
     project_name = project_name || 'CordovaExample';
201
-    var use_shared = !!opts.link;
202
-    var bin_dir = path.join(ROOT, 'bin');
203
-    var project_parent = path.dirname(project_path);
204
-    var project_template_dir = opts.customTemplate || path.join(bin_dir, 'templates', 'project');
199
+    const use_shared = !!opts.link;
200
+    const bin_dir = path.join(ROOT, 'bin');
201
+    const project_parent = path.dirname(project_path);
202
+    const project_template_dir = opts.customTemplate || path.join(bin_dir, 'templates', 'project');
205
 
203
 
206
     // check that project path doesn't exist
204
     // check that project path doesn't exist
207
     if (fs.existsSync(project_path)) {
205
     if (fs.existsSync(project_path)) {
208
-        return Q.reject('Project already exists');
206
+        return Promise.reject(new CordovaError('Project already exists'));
209
     }
207
     }
210
 
208
 
211
     // check that parent directory does exist so cp -r will not fail
209
     // check that parent directory does exist so cp -r will not fail
212
     if (!fs.existsSync(project_parent)) {
210
     if (!fs.existsSync(project_parent)) {
213
-        return Q.reject('Parent directory "' + project_parent + '" of given project path does not exist');
211
+        return Promise.reject(new CordovaError(`Parent directory "${project_parent}" of given project path does not exist`));
214
     }
212
     }
215
 
213
 
216
     events.emit('log', 'Creating Cordova project for the iOS platform:');
214
     events.emit('log', 'Creating Cordova project for the iOS platform:');
217
-    events.emit('log', '\tPath: ' + path.relative(process.cwd(), project_path));
218
-    events.emit('log', '\tPackage: ' + package_name);
219
-    events.emit('log', '\tName: ' + project_name);
215
+    events.emit('log', `\tPath: ${path.relative(process.cwd(), project_path)}`);
216
+    events.emit('log', `\tPackage: ${package_name}`);
217
+    events.emit('log', `\tName: ${project_name}`);
220
 
218
 
221
-    events.emit('verbose', 'Copying iOS template project to ' + project_path);
219
+    events.emit('verbose', `Copying iOS template project to ${project_path}`);
222
 
220
 
223
     // create the project directory and copy over files
221
     // create the project directory and copy over files
224
-    shell.mkdir(project_path);
225
-    shell.cp('-rf', path.join(project_template_dir, 'www'), project_path);
222
+    fs.ensureDirSync(project_path);
223
+    fs.copySync(path.join(project_template_dir, 'www'), path.join(project_path, 'www'));
226
 
224
 
227
     // Copy project template files
225
     // Copy project template files
228
     copyTemplateFiles(project_path, project_name, project_template_dir, package_name);
226
     copyTemplateFiles(project_path, project_name, project_template_dir, package_name);
229
 
227
 
230
     // Copy xcconfig files
228
     // Copy xcconfig files
231
-    shell.cp('-rf', path.join(project_template_dir, '*.xcconfig'), project_path);
229
+    fs.copySync(path.join(project_template_dir, 'pods-debug.xcconfig'), path.join(project_path, 'pods-debug.xcconfig'));
230
+    fs.copySync(path.join(project_template_dir, 'pods-release.xcconfig'), path.join(project_path, 'pods-release.xcconfig'));
232
 
231
 
233
     // CordovaLib stuff
232
     // CordovaLib stuff
234
     copyJsAndCordovaLib(project_path, project_name, use_shared, config);
233
     copyJsAndCordovaLib(project_path, project_name, use_shared, config);
235
     copyScripts(project_path, project_name);
234
     copyScripts(project_path, project_name);
236
 
235
 
237
     events.emit('log', generateDoneMessage('create', use_shared));
236
     events.emit('log', generateDoneMessage('create', use_shared));
238
-    return Q.resolve();
237
+    return Promise.resolve();
239
 };
238
 };
240
 
239
 
241
-exports.updateProject = function (projectPath, opts) {
242
-    var errorString =
240
+exports.updateProject = (projectPath, opts) => {
241
+    const errorString =
243
     'An in-place platform update is not supported. \n' +
242
     'An in-place platform update is not supported. \n' +
244
     'The `platforms` folder is always treated as a build artifact.\n' +
243
     'The `platforms` folder is always treated as a build artifact.\n' +
245
     'To update your platform, you have to remove, then add your ios platform again.\n' +
244
     'To update your platform, you have to remove, then add your ios platform again.\n' +
246
     'Make sure you save your plugins beforehand using `cordova plugin save`, and save a copy of the platform first if you had manual changes in it.\n' +
245
     'Make sure you save your plugins beforehand using `cordova plugin save`, and save a copy of the platform first if you had manual changes in it.\n' +
247
     '\tcordova plugin save\n' +
246
     '\tcordova plugin save\n' +
248
     '\tcordova platform rm ios\n' +
247
     '\tcordova platform rm ios\n' +
249
-    '\tcordova platform add ios\n'
250
-    ;
248
+    '\tcordova platform add ios\n';
251
 
249
 
252
-    return Q.reject(errorString);
250
+    return Promise.reject(new CordovaError(errorString));
253
 };
251
 };
254
 
252
 
255
 function generateDoneMessage (type, link) {
253
 function generateDoneMessage (type, link) {
256
-    var pkg = require('../../package');
257
-    var msg = 'iOS project ' + (type === 'update' ? 'updated ' : 'created ') + 'with ' + pkg.name + '@' + pkg.version;
254
+    const pkg = require('../../package');
255
+    let msg = `iOS project ${type === 'update' ? 'updated' : 'created'} with ${pkg.name}@${pkg.version}`;
258
     if (link) {
256
     if (link) {
259
         msg += ' and has a linked CordovaLib';
257
         msg += ' and has a linked CordovaLib';
260
     }
258
     }
267
         throw new Error('Usage error for update_cordova_subproject');
265
         throw new Error('Usage error for update_cordova_subproject');
268
     }
266
     }
269
 
267
 
270
-    var projectPath = AbsProjectPath(argv[0]);
271
-    var cordovaLibXcodePath;
272
-    var projectConfig;
268
+    const projectPath = AbsProjectPath(argv[0]);
269
+    let cordovaLibXcodePath;
273
     if (argv.length < 3) {
270
     if (argv.length < 3) {
274
         cordovaLibXcodePath = path.join(ROOT, 'CordovaLib', 'CordovaLib.xcodeproj');
271
         cordovaLibXcodePath = path.join(ROOT, 'CordovaLib', 'CordovaLib.xcodeproj');
275
-        projectConfig = argv[1];
276
     } else {
272
     } else {
277
         cordovaLibXcodePath = AbsProjectPath(argv[1]);
273
         cordovaLibXcodePath = AbsProjectPath(argv[1]);
278
-        projectConfig = argv[2];
279
     }
274
     }
280
 
275
 
281
-    var parentProjectPath = AbsParentPath(projectPath);
282
-    var subprojectPath = relpath(cordovaLibXcodePath, parentProjectPath);
283
-    var REGEX = /(.+PBXFileReference.+wrapper.pb-project.+)(path = .+?;)(.*)(sourceTree.+;)(.+)/;
284
-    var newLine;
285
-    var lines = shell.grep('CordovaLib.xcodeproj', path.join(projectPath, 'project.pbxproj'));
286
-    var found = false;
287
-
288
-    subprojectPath = subprojectPath.replace(/\\/g, '/');
289
-    lines = lines.split('\n');
290
-    for (var i = 0; i < lines.length; ++i) {
291
-        if (lines[i].match(REGEX)) {
292
-            found = true;
293
-            newLine = lines[i].replace(/path = .+?;/, 'path = ' + subprojectPath + ';');
294
-            newLine = newLine.replace(/sourceTree.+?;/, 'sourceTree = \"<group>\";'); /* eslint no-useless-escape : 0 */
295
-            if (!newLine.match('name')) {
296
-                newLine = newLine.replace('path = ', 'name = CordovaLib.xcodeproj; path = ');
297
-            }
298
-            shell.sed('-i', lines[i], newLine, path.join(projectPath, 'project.pbxproj'));
299
-        }
300
-    }
276
+    const parentProjectPath = AbsParentPath(projectPath);
277
+    const subprojectPath = relpath(cordovaLibXcodePath, parentProjectPath);
278
+    const projectPbxprojPath = path.join(projectPath, 'project.pbxproj');
279
+    const line = utils.grep(
280
+        projectPbxprojPath,
281
+        /(.+CordovaLib.xcodeproj.+PBXFileReference.+wrapper.pb-project.+)(path = .+?;)(.*)(sourceTree.+;)(.+)/
282
+    );
301
 
283
 
302
-    if (!found) {
303
-        throw new Error('Entry not found in project file for sub-project: ' + subprojectPath);
284
+    if (!line) {
285
+        throw new Error(`Entry not found in project file for sub-project: ${subprojectPath}`);
304
     }
286
     }
305
 
287
 
306
-    var wkWebViewOnly = projectConfig.getPreference('WKWebViewOnly') === 'true';
307
-    if (wkWebViewOnly) {
308
-        var pbxPath = path.join(cordovaLibXcodePath, 'project.pbxproj');
309
-        var xcodeproj = xcode.project(pbxPath);
310
-        xcodeproj.parseSync();
311
-        xcodeproj.updateBuildProperty('WK_WEB_VIEW_ONLY', '1');
312
-        fs.writeFileSync(pbxPath, xcodeproj.writeSync());
288
+    let newLine = line
289
+        .replace(/path = .+?;/, `path = ${subprojectPath};`)
290
+        .replace(/sourceTree.+?;/, 'sourceTree = \"<group>\";'); /* eslint no-useless-escape : 0 */
291
+
292
+    if (!newLine.match('name')) {
293
+        newLine = newLine.replace('path = ', 'name = CordovaLib.xcodeproj; path = ');
313
     }
294
     }
295
+
296
+    utils.replaceFileContents(projectPbxprojPath, line, newLine);
314
 }
297
 }
315
 
298
 
316
 exports.updateSubprojectHelp = updateSubprojectHelp;
299
 exports.updateSubprojectHelp = updateSubprojectHelp;

+ 66
- 0
node_modules/cordova-ios/bin/lib/utils.js View File

1
+/*
2
+    Licensed to the Apache Software Foundation (ASF) under one
3
+    or more contributor license agreements. See the NOTICE file
4
+    distributed with this work for additional information
5
+    regarding copyright ownership. The ASF licenses this file
6
+    to you under the Apache License, Version 2.0 (the
7
+    "License"); you may not use this file except in compliance
8
+    with the License. You may obtain a copy of the License at
9
+
10
+        http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+    Unless required by applicable law or agreed to in writing,
13
+    software distributed under the License is distributed on an
14
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+    KIND, either express or implied. See the License for the
16
+    specific language governing permissions and limitations
17
+    under the License.
18
+*/
19
+
20
+/*
21
+    Provides a set of utility methods, which can also be spied on during unit tests.
22
+*/
23
+
24
+// TODO: Perhaps this should live in cordova-common?
25
+
26
+const fs = require('fs-extra');
27
+const { events } = require('cordova-common');
28
+
29
+/**
30
+ * Reads, searches, and replaces the found occurences with replacementString and then writes the file back out.
31
+ * A backup is not made.
32
+ *
33
+ * @param {string} file A file path to a readable & writable file
34
+ * @param {RegExp} searchRegex The search regex
35
+ * @param {string} replacementString The string to replace the found occurences
36
+ * @returns {void}
37
+ */
38
+exports.replaceFileContents = function (file, searchRegex, replacementString) {
39
+    let contents;
40
+    try {
41
+        contents = fs.readFileSync(file).toString();
42
+    } catch (ex) {
43
+        events.emit('verbose', `Trying to read file: ${file}`);
44
+        throw ex;
45
+    }
46
+    contents = contents.replace(searchRegex, replacementString);
47
+    fs.writeFileSync(file, contents);
48
+};
49
+
50
+/**
51
+ * Reads a file and scans for regex. Returns the line of the first occurence or null if no occurences are found.
52
+ *
53
+ * @param {string} file A file path
54
+ * @param {RegExp} regex A search regex
55
+ * @returns string|null
56
+ */
57
+exports.grep = function (file, regex) {
58
+    const contents = fs.readFileSync(file).toString().replace(/\\r/g, '').split('\n');
59
+    for (let i = 0; i < contents.length; i++) {
60
+        const line = contents[i];
61
+        if (regex.test(line)) {
62
+            return line;
63
+        }
64
+    }
65
+    return null;
66
+};

+ 12
- 7
node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/CDVLaunchScreen.storyboard View File

1
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
1
+<?xml version="1.0" encoding="UTF-8"?>
2
 <!--
2
 <!--
3
  Licensed to the Apache Software Foundation (ASF) under one
3
  Licensed to the Apache Software Foundation (ASF) under one
4
  or more contributor license agreements.  See the NOTICE file
4
  or more contributor license agreements.  See the NOTICE file
17
  specific language governing permissions and limitations
17
  specific language governing permissions and limitations
18
  under the License.
18
  under the License.
19
 -->
19
 -->
20
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15G1004" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
20
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
21
+    <device id="retina6_1" orientation="portrait" appearance="light"/>
21
     <dependencies>
22
     <dependencies>
22
         <deployment identifier="iOS"/>
23
         <deployment identifier="iOS"/>
23
-        <development version="6100" identifier="xcode"/>
24
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
24
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/>
25
+        <capability name="Named colors" minToolsVersion="9.0"/>
26
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
25
     </dependencies>
27
     </dependencies>
26
     <scenes>
28
     <scenes>
27
         <!--View Controller-->
29
         <!--View Controller-->
33
                         <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
35
                         <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
34
                     </layoutGuides>
36
                     </layoutGuides>
35
                     <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
37
                     <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
36
-                        <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
38
+                        <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
37
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
39
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
38
                         <subviews>
40
                         <subviews>
39
                             <imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="LaunchStoryboard" translatesAutoresizingMaskIntoConstraints="NO" id="2ns-9I-Qjs">
41
                             <imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="LaunchStoryboard" translatesAutoresizingMaskIntoConstraints="NO" id="2ns-9I-Qjs">
40
-                                <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
42
+                                <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
41
                             </imageView>
43
                             </imageView>
42
                         </subviews>
44
                         </subviews>
43
-                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
45
+                        <color key="backgroundColor" name="BackgroundColor"/>
44
                         <constraints>
46
                         <constraints>
45
                             <constraint firstAttribute="trailing" secondItem="2ns-9I-Qjs" secondAttribute="trailing" id="FZL-3Z-NFz"/>
47
                             <constraint firstAttribute="trailing" secondItem="2ns-9I-Qjs" secondAttribute="trailing" id="FZL-3Z-NFz"/>
46
                             <constraint firstItem="2ns-9I-Qjs" firstAttribute="bottom" secondItem="Ze5-6b-2t3" secondAttribute="bottom" id="L9l-pw-wXj"/>
48
                             <constraint firstItem="2ns-9I-Qjs" firstAttribute="bottom" secondItem="Ze5-6b-2t3" secondAttribute="bottom" id="L9l-pw-wXj"/>
56
     </scenes>
58
     </scenes>
57
     <resources>
59
     <resources>
58
         <image name="LaunchStoryboard" width="1366" height="1366"/>
60
         <image name="LaunchStoryboard" width="1366" height="1366"/>
61
+        <namedColor name="BackgroundColor">
62
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
63
+        </namedColor>
59
     </resources>
64
     </resources>
60
 </document>
65
 </document>

+ 0
- 36
node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Classes/MainViewController.m View File

77
     // Do any additional setup after loading the view from its nib.
77
     // Do any additional setup after loading the view from its nib.
78
 }
78
 }
79
 
79
 
80
-- (void)viewDidUnload
81
-{
82
-    [super viewDidUnload];
83
-    // Release any retained subviews of the main view.
84
-    // e.g. self.myOutlet = nil;
85
-}
86
-
87
-/* Comment out the block below to over-ride */
88
-
89
-/*
90
-- (UIWebView*) newCordovaViewWithFrame:(CGRect)bounds
91
-{
92
-    return[super newCordovaViewWithFrame:bounds];
93
-}
94
-
95
-// CB-12098
96
-#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000  
97
-- (NSUInteger)supportedInterfaceOrientations
98
-#else  
99
-- (UIInterfaceOrientationMask)supportedInterfaceOrientations
100
-#endif
101
-{
102
-    return [super supportedInterfaceOrientations];
103
-}
104
-
105
-- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
106
-{
107
-    return [super shouldAutorotateToInterfaceOrientation:interfaceOrientation];
108
-}
109
-
110
-- (BOOL)shouldAutorotate 
111
-{
112
-    return [super shouldAutorotate];
113
-}
114
-*/
115
-
116
 @end
80
 @end
117
 
81
 
118
 @implementation MainCommandDelegate
82
 @implementation MainCommandDelegate

+ 15
- 0
node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Images.xcassets/BackgroundColor.colorset/Contents.json View File

1
+{
2
+  "colors" : [
3
+    {
4
+      "color" : {
5
+        "platform" : "ios",
6
+        "reference" : "systemBackgroundColor"
7
+      },
8
+      "idiom" : "universal"
9
+    }
10
+  ],
11
+  "info" : {
12
+    "author" : "xcode",
13
+    "version" : 1
14
+  }
15
+}

+ 0
- 176
node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Images.xcassets/LaunchImage.launchimage/Contents.json View File

1
-{
2
-  "images" : [
3
-    {
4
-      "extent": "full-screen",
5
-      "idiom": "iphone",
6
-      "subtype": "2436h",
7
-      "filename": "Default-2436h.png",
8
-      "minimum-system-version": "11.0",
9
-      "orientation": "portrait",
10
-      "scale": "3x"
11
-    },
12
-    {
13
-      "extent": "full-screen",
14
-      "idiom": "iphone",
15
-      "subtype": "2436h",
16
-      "filename": "Default-Landscape-2436h.png",
17
-      "minimum-system-version": "11.0",
18
-      "orientation": "landscape",
19
-      "scale": "3x"
20
-    },
21
-    {
22
-      "extent" : "full-screen",
23
-      "idiom" : "iphone",
24
-      "subtype" : "736h",
25
-      "filename" : "Default-736h.png",
26
-      "minimum-system-version" : "8.0",
27
-      "orientation" : "portrait",
28
-      "scale" : "3x"
29
-    },
30
-    {
31
-      "extent" : "full-screen",
32
-      "idiom" : "iphone",
33
-      "subtype" : "736h",
34
-      "filename" : "Default-Landscape-736h.png",
35
-      "minimum-system-version" : "8.0",
36
-      "orientation" : "landscape",
37
-      "scale" : "3x"
38
-    },
39
-    {
40
-      "extent" : "full-screen",
41
-      "idiom" : "iphone",
42
-      "subtype" : "667h",
43
-      "filename" : "Default-667h.png",
44
-      "minimum-system-version" : "8.0",
45
-      "orientation" : "portrait",
46
-      "scale" : "2x"
47
-    },
48
-    {
49
-      "orientation" : "portrait",
50
-      "idiom" : "iphone",
51
-      "filename" : "Default@2x~iphone.png",
52
-      "extent" : "full-screen",
53
-      "minimum-system-version" : "7.0",
54
-      "scale" : "2x"
55
-    },
56
-    {
57
-      "extent" : "full-screen",
58
-      "idiom" : "iphone",
59
-      "subtype" : "retina4",
60
-      "filename" : "Default-568h@2x~iphone.png",
61
-      "minimum-system-version" : "7.0",
62
-      "orientation" : "portrait",
63
-      "scale" : "2x"
64
-    },
65
-    {
66
-      "orientation" : "portrait",
67
-      "idiom" : "ipad",
68
-      "filename" : "Default-Portrait~ipad.png",
69
-      "extent" : "full-screen",
70
-      "minimum-system-version" : "7.0",
71
-      "scale" : "1x"
72
-    },
73
-    {
74
-      "orientation" : "landscape",
75
-      "idiom" : "ipad",
76
-      "filename" : "Default-Landscape~ipad.png",
77
-      "extent" : "full-screen",
78
-      "minimum-system-version" : "7.0",
79
-      "scale" : "1x"
80
-    },
81
-    {
82
-      "orientation" : "portrait",
83
-      "idiom" : "ipad",
84
-      "filename" : "Default-Portrait@2x~ipad.png",
85
-      "extent" : "full-screen",
86
-      "minimum-system-version" : "7.0",
87
-      "scale" : "2x"
88
-    },
89
-    {
90
-      "orientation" : "landscape",
91
-      "idiom" : "ipad",
92
-      "filename" : "Default-Landscape@2x~ipad.png",
93
-      "extent" : "full-screen",
94
-      "minimum-system-version" : "7.0",
95
-      "scale" : "2x"
96
-    },
97
-    {
98
-      "orientation" : "portrait",
99
-      "idiom" : "iphone",
100
-      "filename" : "Default~iphone.png",
101
-      "extent" : "full-screen",
102
-      "scale" : "1x"
103
-    },
104
-    {
105
-      "orientation" : "portrait",
106
-      "idiom" : "iphone",
107
-      "filename" : "Default@2x~iphone.png",
108
-      "extent" : "full-screen",
109
-      "scale" : "2x"
110
-    },
111
-    {
112
-      "orientation" : "portrait",
113
-      "idiom" : "iphone",
114
-      "filename" : "Default-568h@2x~iphone.png",
115
-      "extent" : "full-screen",
116
-      "subtype" : "retina4",
117
-      "scale" : "2x"
118
-    },
119
-    {
120
-      "orientation" : "portrait",
121
-      "idiom" : "ipad",
122
-      "extent" : "to-status-bar",
123
-      "scale" : "1x"
124
-    },
125
-    {
126
-      "orientation" : "portrait",
127
-      "idiom" : "ipad",
128
-      "filename" : "Default-Portrait~ipad.png",
129
-      "extent" : "full-screen",
130
-      "scale" : "1x"
131
-    },
132
-    {
133
-      "orientation" : "landscape",
134
-      "idiom" : "ipad",
135
-      "extent" : "to-status-bar",
136
-      "scale" : "1x"
137
-    },
138
-    {
139
-      "orientation" : "landscape",
140
-      "idiom" : "ipad",
141
-      "filename": "Default-Landscape~ipad.png",
142
-      "extent" : "full-screen",
143
-      "scale" : "1x"
144
-    },
145
-    {
146
-      "orientation" : "portrait",
147
-      "idiom" : "ipad",
148
-      "extent" : "to-status-bar",
149
-      "scale" : "2x"
150
-    },
151
-    {
152
-      "orientation" : "portrait",
153
-      "idiom" : "ipad",
154
-      "filename" : "Default-Portrait@2x~ipad.png",
155
-      "extent" : "full-screen",
156
-      "scale" : "2x"
157
-    },
158
-    {
159
-      "orientation" : "landscape",
160
-      "idiom" : "ipad",
161
-      "extent" : "to-status-bar",
162
-      "scale" : "2x"
163
-    },
164
-    {
165
-      "orientation" : "landscape",
166
-      "idiom" : "ipad",
167
-      "filename": "Default-Landscape@2x~ipad.png",
168
-      "extent" : "full-screen",
169
-      "scale" : "2x"
170
-    }
171
-  ],
172
-  "info" : {
173
-    "version" : 1,
174
-    "author" : "xcode"
175
-  }
176
-}

BIN
node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Images.xcassets/LaunchImage.launchimage/Default-2436h.png View File


BIN
node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Images.xcassets/LaunchImage.launchimage/Default-568h@2x~iphone.png View File


BIN
node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Images.xcassets/LaunchImage.launchimage/Default-667h.png View File


BIN
node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Images.xcassets/LaunchImage.launchimage/Default-736h.png View File


BIN
node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Images.xcassets/LaunchImage.launchimage/Default-Landscape-2436h.png View File


BIN
node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h.png View File


BIN
node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Images.xcassets/LaunchImage.launchimage/Default-Landscape@2x~ipad.png View File


BIN
node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Images.xcassets/LaunchImage.launchimage/Default-Landscape~ipad.png View File


BIN
node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x~ipad.png View File


BIN
node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Images.xcassets/LaunchImage.launchimage/Default-Portrait~ipad.png View File


BIN
node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Images.xcassets/LaunchImage.launchimage/Default@2x~iphone.png View File


BIN
node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Images.xcassets/LaunchImage.launchimage/Default~iphone.png View File


+ 6
- 6
node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/Images.xcassets/LaunchStoryboard.imageset/Contents.json View File

24
     },
24
     },
25
     {
25
     {
26
       "idiom" : "universal",
26
       "idiom" : "universal",
27
-      "height-class" : "compact",
28
-      "scale" : "3x"
27
+      "scale" : "3x",
28
+      "height-class" : "compact"
29
     },
29
     },
30
     {
30
     {
31
       "idiom" : "universal",
31
       "idiom" : "universal",
34
     },
34
     },
35
     {
35
     {
36
       "idiom" : "universal",
36
       "idiom" : "universal",
37
-      "width-class" : "compact",
38
-      "scale" : "2x"
37
+      "scale" : "2x",
38
+      "width-class" : "compact"
39
     },
39
     },
40
     {
40
     {
41
       "idiom" : "universal",
41
       "idiom" : "universal",
42
-      "width-class" : "compact",
43
-      "scale" : "3x"
42
+      "scale" : "3x",
43
+      "width-class" : "compact"
44
     },
44
     },
45
     {
45
     {
46
       "idiom" : "universal",
46
       "idiom" : "universal",

+ 2
- 0
node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/__PROJECT_NAME__-Info.plist View File

28
 	<string></string>
28
 	<string></string>
29
 	<key>NSMainNibFile~ipad</key>
29
 	<key>NSMainNibFile~ipad</key>
30
 	<string></string>
30
 	<string></string>
31
+	<key>UILaunchStoryboardName</key>
32
+	<string>CDVLaunchScreen</string>
31
 	<key>UIRequiresFullScreen</key>
33
 	<key>UIRequiresFullScreen</key>
32
 	<true/>
34
 	<true/>
33
 	<key>UISupportedInterfaceOrientations</key>
35
 	<key>UISupportedInterfaceOrientations</key>

+ 7
- 1
node_modules/cordova-ios/bin/templates/project/__PROJECT_NAME__/config.xml View File

53
     <preference name="DisallowOverscroll" value="false" />
53
     <preference name="DisallowOverscroll" value="false" />
54
     <preference name="EnableViewportScale" value="false" />
54
     <preference name="EnableViewportScale" value="false" />
55
     <preference name="KeyboardDisplayRequiresUserAction" value="true" />
55
     <preference name="KeyboardDisplayRequiresUserAction" value="true" />
56
-    <preference name="MediaPlaybackRequiresUserAction" value="false" />
56
+    <preference name="MediaTypesRequiringUserActionForPlayback" value="false" />
57
     <preference name="SuppressesIncrementalRendering" value="false" />
57
     <preference name="SuppressesIncrementalRendering" value="false" />
58
     <preference name="SuppressesLongPressGesture" value="false" />
58
     <preference name="SuppressesLongPressGesture" value="false" />
59
     <preference name="Suppresses3DTouchGesture" value="false" />
59
     <preference name="Suppresses3DTouchGesture" value="false" />
62
     <preference name="PaginationBreakingMode" value="page" /> <!-- page, column -->
62
     <preference name="PaginationBreakingMode" value="page" /> <!-- page, column -->
63
     <preference name="PaginationMode" value="unpaginated" /> <!-- unpaginated, leftToRight, topToBottom, bottomToTop, rightToLeft -->
63
     <preference name="PaginationMode" value="unpaginated" /> <!-- unpaginated, leftToRight, topToBottom, bottomToTop, rightToLeft -->
64
 
64
 
65
+    <feature name="CDVWebViewEngine">
66
+        <param name="ios-package" value="CDVWebViewEngine" />
67
+    </feature>
68
+    <feature name="LaunchScreen">
69
+        <param name="ios-package" value="CDVLaunchScreen"/>
70
+    </feature>
65
     <feature name="LocalStorage">
71
     <feature name="LocalStorage">
66
         <param name="ios-package" value="CDVLocalStorage"/>
72
         <param name="ios-package" value="CDVLocalStorage"/>
67
     </feature>
73
     </feature>

+ 21
- 17
node_modules/cordova-ios/bin/templates/project/__TEMP__.xcodeproj/project.pbxproj View File

3
 	archiveVersion = 1;
3
 	archiveVersion = 1;
4
 	classes = {
4
 	classes = {
5
 	};
5
 	};
6
-	objectVersion = 46;
6
+	objectVersion = 52;
7
 	objects = {
7
 	objects = {
8
 
8
 
9
 /* Begin PBXBuildFile section */
9
 /* Begin PBXBuildFile section */
19
 /* Begin PBXContainerItemProxy section */
19
 /* Begin PBXContainerItemProxy section */
20
 		301BF534109A57CC0062928A /* PBXContainerItemProxy */ = {
20
 		301BF534109A57CC0062928A /* PBXContainerItemProxy */ = {
21
 			isa = PBXContainerItemProxy;
21
 			isa = PBXContainerItemProxy;
22
-			containerPortal = 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */;
22
+			containerPortal = 301BF52D109A57CC0062928A /* CordovaLib/CordovaLib.xcodeproj */;
23
 			proxyType = 2;
23
 			proxyType = 2;
24
 			remoteGlobalIDString = D2AAC07E0554694100DB518D;
24
 			remoteGlobalIDString = D2AAC07E0554694100DB518D;
25
 			remoteInfo = CordovaLib;
25
 			remoteInfo = CordovaLib;
26
 		};
26
 		};
27
 		301BF550109A68C00062928A /* PBXContainerItemProxy */ = {
27
 		301BF550109A68C00062928A /* PBXContainerItemProxy */ = {
28
 			isa = PBXContainerItemProxy;
28
 			isa = PBXContainerItemProxy;
29
-			containerPortal = 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */;
29
+			containerPortal = 301BF52D109A57CC0062928A /* CordovaLib/CordovaLib.xcodeproj */;
30
 			proxyType = 1;
30
 			proxyType = 1;
31
 			remoteGlobalIDString = D2AAC07D0554694100DB518D;
31
 			remoteGlobalIDString = D2AAC07D0554694100DB518D;
32
 			remoteInfo = CordovaLib;
32
 			remoteInfo = CordovaLib;
33
 		};
33
 		};
34
 		907D8123214C687600058A10 /* PBXContainerItemProxy */ = {
34
 		907D8123214C687600058A10 /* PBXContainerItemProxy */ = {
35
 			isa = PBXContainerItemProxy;
35
 			isa = PBXContainerItemProxy;
36
-			containerPortal = 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */;
36
+			containerPortal = 301BF52D109A57CC0062928A /* CordovaLib/CordovaLib.xcodeproj */;
37
 			proxyType = 2;
37
 			proxyType = 2;
38
 			remoteGlobalIDString = C0C01EB21E3911D50056E6CB;
38
 			remoteGlobalIDString = C0C01EB21E3911D50056E6CB;
39
 			remoteInfo = Cordova;
39
 			remoteInfo = Cordova;
46
 		1D3623250D0F684500981E51 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
46
 		1D3623250D0F684500981E51 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
47
 		1D6058910D05DD3D006BFB54 /* __PROJECT_NAME__.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "__PROJECT_NAME__.app"; sourceTree = BUILT_PRODUCTS_DIR; };
47
 		1D6058910D05DD3D006BFB54 /* __PROJECT_NAME__.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "__PROJECT_NAME__.app"; sourceTree = BUILT_PRODUCTS_DIR; };
48
 		29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
48
 		29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
49
-		301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = CordovaLib/CordovaLib.xcodeproj; sourceTree = "<group>"; };
49
+		301BF52D109A57CC0062928A /* CordovaLib/CordovaLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = CordovaLib/CordovaLib.xcodeproj; sourceTree = "<group>"; };
50
 		301BF56E109A69640062928A /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; path = www; sourceTree = SOURCE_ROOT; };
50
 		301BF56E109A69640062928A /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; path = www; sourceTree = SOURCE_ROOT; };
51
 		302D95EE14D2391D003F00A1 /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = "<group>"; };
51
 		302D95EE14D2391D003F00A1 /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = "<group>"; };
52
 		302D95EF14D2391D003F00A1 /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = "<group>"; };
52
 		302D95EF14D2391D003F00A1 /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = "<group>"; };
59
 		8D1107310486CEB800E47090 /* __PROJECT_NAME__-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "__PROJECT_NAME__-Info.plist"; path = "__PROJECT_NAME__/__PROJECT_NAME__-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = SOURCE_ROOT; };
59
 		8D1107310486CEB800E47090 /* __PROJECT_NAME__-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "__PROJECT_NAME__-Info.plist"; path = "__PROJECT_NAME__/__PROJECT_NAME__-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = SOURCE_ROOT; };
60
 		EB87FDF31871DA8E0020F90C /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; name = www; path = ../../www; sourceTree = "<group>"; };
60
 		EB87FDF31871DA8E0020F90C /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; name = www; path = ../../www; sourceTree = "<group>"; };
61
 		EB87FDF41871DAF40020F90C /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = ../../config.xml; sourceTree = "<group>"; };
61
 		EB87FDF41871DAF40020F90C /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = ../../config.xml; sourceTree = "<group>"; };
62
-		ED33DF2A687741AEAF9F8254 /* Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "Bridging-Header.h"; path = "Bridging-Header.h"; sourceTree = "<group>"; };
62
+		ED33DF2A687741AEAF9F8254 /* Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Bridging-Header.h"; sourceTree = "<group>"; };
63
 		F840E1F0165FE0F500CFE078 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = "__PROJECT_NAME__/config.xml"; sourceTree = "<group>"; };
63
 		F840E1F0165FE0F500CFE078 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = "__PROJECT_NAME__/config.xml"; sourceTree = "<group>"; };
64
 /* End PBXFileReference section */
64
 /* End PBXFileReference section */
65
 
65
 
102
 				EB87FDF41871DAF40020F90C /* config.xml */,
102
 				EB87FDF41871DAF40020F90C /* config.xml */,
103
 				EB87FDF31871DA8E0020F90C /* www */,
103
 				EB87FDF31871DA8E0020F90C /* www */,
104
 				EB87FDF11871DA420020F90C /* Staging */,
104
 				EB87FDF11871DA420020F90C /* Staging */,
105
-				301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */,
105
+				301BF52D109A57CC0062928A /* CordovaLib/CordovaLib.xcodeproj */,
106
 				080E96DDFE201D6D7F000001 /* Classes */,
106
 				080E96DDFE201D6D7F000001 /* Classes */,
107
 				307C750510C5A3420062BCA9 /* Plugins */,
107
 				307C750510C5A3420062BCA9 /* Plugins */,
108
 				29B97315FDCFA39411CA2CEA /* Other Sources */,
108
 				29B97315FDCFA39411CA2CEA /* Other Sources */,
207
 		29B97313FDCFA39411CA2CEA /* Project object */ = {
207
 		29B97313FDCFA39411CA2CEA /* Project object */ = {
208
 			isa = PBXProject;
208
 			isa = PBXProject;
209
 			attributes = {
209
 			attributes = {
210
-				LastUpgradeCheck = 0510;
210
+				LastUpgradeCheck = 1130;
211
 				TargetAttributes = {
211
 				TargetAttributes = {
212
 					1D6058900D05DD3D006BFB54 = {
212
 					1D6058900D05DD3D006BFB54 = {
213
 						ProvisioningStyle = Automatic;
213
 						ProvisioningStyle = Automatic;
215
 				};
215
 				};
216
 			};
216
 			};
217
 			buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "__PROJECT_NAME__" */;
217
 			buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "__PROJECT_NAME__" */;
218
-			compatibilityVersion = "Xcode 3.2";
219
-			developmentRegion = English;
218
+			compatibilityVersion = "Xcode 11.0";
219
+			developmentRegion = en;
220
 			hasScannedForEncodings = 1;
220
 			hasScannedForEncodings = 1;
221
+			knownRegions = (
222
+				en,
223
+				Base,
224
+			);
221
 			mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
225
 			mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
222
 			projectDirPath = "";
226
 			projectDirPath = "";
223
 			projectReferences = (
227
 			projectReferences = (
224
 				{
228
 				{
225
 					ProductGroup = 301BF52E109A57CC0062928A /* Products */;
229
 					ProductGroup = 301BF52E109A57CC0062928A /* Products */;
226
-					ProjectRef = 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */;
230
+					ProjectRef = 301BF52D109A57CC0062928A /* CordovaLib/CordovaLib.xcodeproj */;
227
 				},
231
 				},
228
 			);
232
 			);
229
 			projectRoot = "";
233
 			projectRoot = "";
309
 			buildSettings = {
313
 			buildSettings = {
310
 				ALWAYS_SEARCH_USER_PATHS = NO;
314
 				ALWAYS_SEARCH_USER_PATHS = NO;
311
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
315
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
312
-				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
313
 				CLANG_ENABLE_MODULES = YES;
316
 				CLANG_ENABLE_MODULES = YES;
314
 				CLANG_ENABLE_OBJC_ARC = YES;
317
 				CLANG_ENABLE_OBJC_ARC = YES;
315
 				COPY_PHASE_STRIP = NO;
318
 				COPY_PHASE_STRIP = NO;
320
 				GCC_THUMB_SUPPORT = NO;
323
 				GCC_THUMB_SUPPORT = NO;
321
 				GCC_VERSION = "";
324
 				GCC_VERSION = "";
322
 				INFOPLIST_FILE = "__PROJECT_NAME__/__PROJECT_NAME__-Info.plist";
325
 				INFOPLIST_FILE = "__PROJECT_NAME__/__PROJECT_NAME__-Info.plist";
323
-				IPHONEOS_DEPLOYMENT_TARGET = 10.0;
326
+				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
324
 				LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
327
 				LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
325
 				PRODUCT_BUNDLE_IDENTIFIER = "__PROJECT_ID__";
328
 				PRODUCT_BUNDLE_IDENTIFIER = "__PROJECT_ID__";
326
 				PRODUCT_NAME = "$(TARGET_NAME)";
329
 				PRODUCT_NAME = "$(TARGET_NAME)";
334
 			buildSettings = {
337
 			buildSettings = {
335
 				ALWAYS_SEARCH_USER_PATHS = NO;
338
 				ALWAYS_SEARCH_USER_PATHS = NO;
336
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
339
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
337
-				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
338
 				CLANG_ENABLE_MODULES = YES;
340
 				CLANG_ENABLE_MODULES = YES;
339
 				CLANG_ENABLE_OBJC_ARC = YES;
341
 				CLANG_ENABLE_OBJC_ARC = YES;
340
 				COPY_PHASE_STRIP = YES;
342
 				COPY_PHASE_STRIP = YES;
343
 				GCC_THUMB_SUPPORT = NO;
345
 				GCC_THUMB_SUPPORT = NO;
344
 				GCC_VERSION = "";
346
 				GCC_VERSION = "";
345
 				INFOPLIST_FILE = "__PROJECT_NAME__/__PROJECT_NAME__-Info.plist";
347
 				INFOPLIST_FILE = "__PROJECT_NAME__/__PROJECT_NAME__-Info.plist";
346
-				IPHONEOS_DEPLOYMENT_TARGET = 10.0;
348
+				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
347
 				LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
349
 				LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
348
 				PRODUCT_BUNDLE_IDENTIFIER = "__PROJECT_ID__";
350
 				PRODUCT_BUNDLE_IDENTIFIER = "__PROJECT_ID__";
349
 				PRODUCT_NAME = "$(TARGET_NAME)";
351
 				PRODUCT_NAME = "$(TARGET_NAME)";
355
 			isa = XCBuildConfiguration;
357
 			isa = XCBuildConfiguration;
356
 			baseConfigurationReference = 3047A5111AB8059700498E2A /* build.xcconfig */;
358
 			baseConfigurationReference = 3047A5111AB8059700498E2A /* build.xcconfig */;
357
 			buildSettings = {
359
 			buildSettings = {
360
+				CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
358
 				CLANG_ENABLE_MODULES = YES;
361
 				CLANG_ENABLE_MODULES = YES;
359
 				CLANG_ENABLE_OBJC_ARC = YES;
362
 				CLANG_ENABLE_OBJC_ARC = YES;
360
 				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
363
 				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
389
 				ONLY_ACTIVE_ARCH = YES;
392
 				ONLY_ACTIVE_ARCH = YES;
390
 				SDKROOT = iphoneos;
393
 				SDKROOT = iphoneos;
391
 				SKIP_INSTALL = NO;
394
 				SKIP_INSTALL = NO;
392
-				WK_WEB_VIEW_ONLY = 0;
395
+				WK_WEB_VIEW_ONLY = 1;
393
 			};
396
 			};
394
 			name = Debug;
397
 			name = Debug;
395
 		};
398
 		};
397
 			isa = XCBuildConfiguration;
400
 			isa = XCBuildConfiguration;
398
 			baseConfigurationReference = 3047A5111AB8059700498E2A /* build.xcconfig */;
401
 			baseConfigurationReference = 3047A5111AB8059700498E2A /* build.xcconfig */;
399
 			buildSettings = {
402
 			buildSettings = {
403
+				CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
400
 				CLANG_ENABLE_MODULES = YES;
404
 				CLANG_ENABLE_MODULES = YES;
401
 				CLANG_ENABLE_OBJC_ARC = YES;
405
 				CLANG_ENABLE_OBJC_ARC = YES;
402
 				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
406
 				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
429
 				GCC_WARN_UNUSED_VARIABLE = YES;
433
 				GCC_WARN_UNUSED_VARIABLE = YES;
430
 				SDKROOT = iphoneos;
434
 				SDKROOT = iphoneos;
431
 				SKIP_INSTALL = NO;
435
 				SKIP_INSTALL = NO;
432
-				WK_WEB_VIEW_ONLY = 0;
436
+				WK_WEB_VIEW_ONLY = 1;
433
 			};
437
 			};
434
 			name = Release;
438
 			name = Release;
435
 		};
439
 		};

+ 1
- 1
node_modules/cordova-ios/bin/templates/project/www/index.html View File

23
         Customize this policy to fit your own app's needs. For more guidance, see:
23
         Customize this policy to fit your own app's needs. For more guidance, see:
24
             https://github.com/apache/cordova-plugin-whitelist/blob/master/README.md#content-security-policy
24
             https://github.com/apache/cordova-plugin-whitelist/blob/master/README.md#content-security-policy
25
         Some notes:
25
         Some notes:
26
-            * gap: is required only on iOS (when using UIWebView) and is needed for JS->native communication
26
+            * gap: is required only on iOS (when using WkWebView) and is needed for JS->native communication
27
             * https://ssl.gstatic.com is required only on Android and is needed for TalkBack to function properly
27
             * https://ssl.gstatic.com is required only on Android and is needed for TalkBack to function properly
28
             * Disables use of inline scripts in order to mitigate risk of XSS vulnerabilities. To change this:
28
             * Disables use of inline scripts in order to mitigate risk of XSS vulnerabilities. To change this:
29
                 * Enable inline JS: add 'unsafe-inline' to default-src
29
                 * Enable inline JS: add 'unsafe-inline' to default-src

+ 180
- 197
node_modules/cordova-ios/bin/templates/scripts/cordova/Api.js View File

19
 
19
 
20
 /* jslint node: true */
20
 /* jslint node: true */
21
 
21
 
22
-var fs = require('fs');
23
-var path = require('path');
24
-var unorm = require('unorm');
25
-var projectFile = require('./lib/projectFile');
26
-var check_reqs = require('./lib/check_reqs');
27
-var CordovaError = require('cordova-common').CordovaError;
28
-var CordovaLogger = require('cordova-common').CordovaLogger;
29
-var events = require('cordova-common').events;
30
-var PluginManager = require('cordova-common').PluginManager;
31
-var Q = require('q');
32
-var util = require('util');
33
-var xcode = require('xcode');
34
-var ConfigParser = require('cordova-common').ConfigParser;
22
+/**
23
+ * @todo update coho to update this line.
24
+ * @todo use `package.json` instead but first
25
+ *  figure out how this fit in with the platform-centered workflow structure.
26
+ *  This workflow would not have the `package.json` file.
27
+ */
28
+// Coho updates this line
29
+const VERSION = '6.1.1';
30
+
31
+const fs = require('fs-extra');
32
+const path = require('path');
33
+const unorm = require('unorm');
34
+const projectFile = require('./lib/projectFile');
35
+const check_reqs = require('./lib/check_reqs');
36
+const CordovaError = require('cordova-common').CordovaError;
37
+const CordovaLogger = require('cordova-common').CordovaLogger;
38
+const events = require('cordova-common').events;
39
+const PluginManager = require('cordova-common').PluginManager;
40
+const util = require('util');
41
+const xcode = require('xcode');
42
+const ConfigParser = require('cordova-common').ConfigParser;
35
 
43
 
36
 function setupEvents (externalEventEmitter) {
44
 function setupEvents (externalEventEmitter) {
37
     if (externalEventEmitter) {
45
     if (externalEventEmitter) {
44
     }
52
     }
45
 }
53
 }
46
 
54
 
55
+function getVariableSpec (spec, options) {
56
+    return spec.includes('$') ? options.cli_variables[spec.replace('$', '')] : spec;
57
+}
58
+
47
 /**
59
 /**
48
  * Creates a new PlatformApi instance.
60
  * Creates a new PlatformApi instance.
49
  *
61
  *
62
 
74
 
63
     setupEvents(events);
75
     setupEvents(events);
64
 
76
 
65
-    var xcodeProjDir;
66
-    var xcodeCordovaProj;
77
+    let xcodeProjDir;
78
+    let xcodeCordovaProj;
67
 
79
 
68
     try {
80
     try {
69
-
70
-        var xcodeProjDir_array = fs.readdirSync(this.root).filter(function (e) { return e.match(/\.xcodeproj$/i); });
81
+        const xcodeProjDir_array = fs.readdirSync(this.root).filter(e => e.match(/\.xcodeproj$/i));
71
         if (xcodeProjDir_array.length > 1) {
82
         if (xcodeProjDir_array.length > 1) {
72
-            for (var x = 0; x < xcodeProjDir_array.length; x++) {
83
+            for (let x = 0; x < xcodeProjDir_array.length; x++) {
73
                 if (xcodeProjDir_array[x].substring(0, 2) === '._') {
84
                 if (xcodeProjDir_array[x].substring(0, 2) === '._') {
74
                     xcodeProjDir_array.splice(x, 1);
85
                     xcodeProjDir_array.splice(x, 1);
75
                 }
86
                 }
78
         xcodeProjDir = xcodeProjDir_array[0];
89
         xcodeProjDir = xcodeProjDir_array[0];
79
 
90
 
80
         if (!xcodeProjDir) {
91
         if (!xcodeProjDir) {
81
-            throw new CordovaError('The provided path "' + this.root + '" is not a Cordova iOS project.');
92
+            throw new CordovaError(`The provided path "${this.root}" is not a Cordova iOS project.`);
82
         }
93
         }
83
 
94
 
84
-        var cordovaProjName = xcodeProjDir.substring(xcodeProjDir.lastIndexOf(path.sep) + 1, xcodeProjDir.indexOf('.xcodeproj'));
95
+        const cordovaProjName = xcodeProjDir.substring(xcodeProjDir.lastIndexOf(path.sep) + 1, xcodeProjDir.indexOf('.xcodeproj'));
85
         xcodeCordovaProj = path.join(this.root, cordovaProjName);
96
         xcodeCordovaProj = path.join(this.root, cordovaProjName);
86
     } catch (e) {
97
     } catch (e) {
87
-        throw new CordovaError('The provided path "' + this.root + '" is not a Cordova iOS project.');
98
+        throw new CordovaError(`The provided path "${this.root}" is not a Cordova iOS project.`);
88
     }
99
     }
89
 
100
 
90
     this.locations = {
101
     this.locations = {
95
         defaultConfigXml: path.join(this.root, 'cordova/defaults.xml'),
106
         defaultConfigXml: path.join(this.root, 'cordova/defaults.xml'),
96
         pbxproj: path.join(this.root, xcodeProjDir, 'project.pbxproj'),
107
         pbxproj: path.join(this.root, xcodeProjDir, 'project.pbxproj'),
97
         xcodeProjDir: path.join(this.root, xcodeProjDir),
108
         xcodeProjDir: path.join(this.root, xcodeProjDir),
98
-        xcodeCordovaProj: xcodeCordovaProj
109
+        xcodeCordovaProj
99
     };
110
     };
100
 }
111
 }
101
 
112
 
117
  * @return {Promise<PlatformApi>} Promise either fulfilled with PlatformApi
128
  * @return {Promise<PlatformApi>} Promise either fulfilled with PlatformApi
118
  *   instance or rejected with CordovaError.
129
  *   instance or rejected with CordovaError.
119
  */
130
  */
120
-Api.createPlatform = function (destination, config, options, events) {
131
+Api.createPlatform = (destination, config, options, events) => {
121
     setupEvents(events);
132
     setupEvents(events);
122
 
133
 
123
     // CB-6992 it is necessary to normalize characters
134
     // CB-6992 it is necessary to normalize characters
124
     // because node and shell scripts handles unicode symbols differently
135
     // because node and shell scripts handles unicode symbols differently
125
     // We need to normalize the name to NFD form since iOS uses NFD unicode form
136
     // We need to normalize the name to NFD form since iOS uses NFD unicode form
126
-    var name = unorm.nfd(config.name());
127
-    var result;
137
+    const name = unorm.nfd(config.name());
138
+    let result;
128
     try {
139
     try {
129
         result = require('../../../lib/create')
140
         result = require('../../../lib/create')
130
             .createProject(destination, config.getAttribute('ios-CFBundleIdentifier') || config.packageName(), name, options, config)
141
             .createProject(destination, config.getAttribute('ios-CFBundleIdentifier') || config.packageName(), name, options, config)
131
-            .then(function () {
142
+            .then(() => {
132
                 // after platform is created we return Api instance based on new Api.js location
143
                 // after platform is created we return Api instance based on new Api.js location
133
                 // This is required to correctly resolve paths in the future api calls
144
                 // This is required to correctly resolve paths in the future api calls
134
-                var PlatformApi = require(path.resolve(destination, 'cordova/Api'));
145
+                const PlatformApi = require(path.resolve(destination, 'cordova/Api'));
135
                 return new PlatformApi('ios', destination, events);
146
                 return new PlatformApi('ios', destination, events);
136
             });
147
             });
137
     } catch (e) {
148
     } catch (e) {
157
  * @return {Promise<PlatformApi>} Promise either fulfilled with PlatformApi
168
  * @return {Promise<PlatformApi>} Promise either fulfilled with PlatformApi
158
  *   instance or rejected with CordovaError.
169
  *   instance or rejected with CordovaError.
159
  */
170
  */
160
-Api.updatePlatform = function (destination, options, events) {
171
+Api.updatePlatform = (destination, options, events) => {
161
     setupEvents(events);
172
     setupEvents(events);
162
 
173
 
163
-    var result;
174
+    let result;
164
     try {
175
     try {
165
         result = require('../../../lib/create')
176
         result = require('../../../lib/create')
166
             .updateProject(destination, options)
177
             .updateProject(destination, options)
167
-            .then(function () {
168
-                var PlatformApi = require(path.resolve(destination, 'cordova/Api'));
178
+            .then(() => {
179
+                const PlatformApi = require(path.resolve(destination, 'cordova/Api'));
169
                 return new PlatformApi('ios', destination, events);
180
                 return new PlatformApi('ios', destination, events);
170
             });
181
             });
171
     } catch (e) {
182
     } catch (e) {
182
  *   platform's file structure and other properties of platform.
193
  *   platform's file structure and other properties of platform.
183
  */
194
  */
184
 Api.prototype.getPlatformInfo = function () {
195
 Api.prototype.getPlatformInfo = function () {
185
-    var result = {};
196
+    const result = {};
186
     result.locations = this.locations;
197
     result.locations = this.locations;
187
     result.root = this.root;
198
     result.root = this.root;
188
     result.name = this.platform;
199
     result.name = this.platform;
189
-    result.version = require('./version');
200
+    result.version = Api.version();
190
     result.projectConfig = new ConfigParser(this.locations.configXml);
201
     result.projectConfig = new ConfigParser(this.locations.configXml);
191
 
202
 
192
     return result;
203
     return result;
230
  *   CordovaError instance.
241
  *   CordovaError instance.
231
  */
242
  */
232
 Api.prototype.addPlugin = function (plugin, installOptions) {
243
 Api.prototype.addPlugin = function (plugin, installOptions) {
233
-
234
-    var xcodeproj = projectFile.parse(this.locations);
235
-    var self = this;
244
+    const xcodeproj = projectFile.parse(this.locations);
236
 
245
 
237
     installOptions = installOptions || {};
246
     installOptions = installOptions || {};
238
     installOptions.variables = installOptions.variables || {};
247
     installOptions.variables = installOptions.variables || {};
241
         installOptions.variables.PACKAGE_NAME = xcodeproj.getPackageName();
250
         installOptions.variables.PACKAGE_NAME = xcodeproj.getPackageName();
242
     }
251
     }
243
 
252
 
244
-    return PluginManager.get(self.platform, self.locations, xcodeproj)
253
+    return PluginManager.get(this.platform, this.locations, xcodeproj)
245
         .addPlugin(plugin, installOptions)
254
         .addPlugin(plugin, installOptions)
246
-        .then(function () {
255
+        .then(() => {
247
             if (plugin != null) {
256
             if (plugin != null) {
248
-                var headerTags = plugin.getHeaderFiles(self.platform);
249
-                var bridgingHeaders = headerTags.filter(function (obj) {
250
-                    return (obj.type === 'BridgingHeader');
251
-                });
257
+                const headerTags = plugin.getHeaderFiles(this.platform);
258
+                const bridgingHeaders = headerTags.filter(obj => obj.type === 'BridgingHeader');
252
                 if (bridgingHeaders.length > 0) {
259
                 if (bridgingHeaders.length > 0) {
253
-                    var project_dir = self.locations.root;
254
-                    var project_name = self.locations.xcodeCordovaProj.split('/').pop();
255
-                    var BridgingHeader = require('./lib/BridgingHeader').BridgingHeader;
256
-                    var bridgingHeaderFile = new BridgingHeader(path.join(project_dir, project_name, 'Bridging-Header.h'));
260
+                    const project_dir = this.locations.root;
261
+                    const project_name = this.locations.xcodeCordovaProj.split('/').pop();
262
+                    const BridgingHeader = require('./lib/BridgingHeader').BridgingHeader;
263
+                    const bridgingHeaderFile = new BridgingHeader(path.join(project_dir, project_name, 'Bridging-Header.h'));
257
                     events.emit('verbose', 'Adding Bridging-Headers since the plugin contained <header-file> with type="BridgingHeader"');
264
                     events.emit('verbose', 'Adding Bridging-Headers since the plugin contained <header-file> with type="BridgingHeader"');
258
-                    bridgingHeaders.forEach(function (obj) {
259
-                        var bridgingHeaderPath = path.basename(obj.src);
265
+                    bridgingHeaders.forEach(obj => {
266
+                        const bridgingHeaderPath = path.basename(obj.src);
260
                         bridgingHeaderFile.addHeader(plugin.id, bridgingHeaderPath);
267
                         bridgingHeaderFile.addHeader(plugin.id, bridgingHeaderPath);
261
                     });
268
                     });
262
                     bridgingHeaderFile.write();
269
                     bridgingHeaderFile.write();
263
                 }
270
                 }
264
             }
271
             }
265
         })
272
         })
266
-        .then(function () {
273
+        .then(() => {
267
             if (plugin != null) {
274
             if (plugin != null) {
268
-                var podSpecs = plugin.getPodSpecs ? plugin.getPodSpecs(self.platform) : [];
269
-                var frameworkTags = plugin.getFrameworks(self.platform);
270
-                var frameworkPods = frameworkTags.filter(function (obj) {
271
-                    return (obj.type === 'podspec');
272
-                });
273
-                return self.addPodSpecs(plugin, podSpecs, frameworkPods);
275
+                const podSpecs = plugin.getPodSpecs ? plugin.getPodSpecs(this.platform) : [];
276
+                const frameworkTags = plugin.getFrameworks(this.platform);
277
+                const frameworkPods = frameworkTags.filter(obj => obj.type === 'podspec');
278
+                return this.addPodSpecs(plugin, podSpecs, frameworkPods, installOptions);
274
             }
279
             }
275
         })
280
         })
276
-        // CB-11022 return non-falsy value to indicate
277
-        // that there is no need to run prepare after
278
-        .thenResolve(true);
281
+        // CB-11022 Return truthy value to prevent running prepare after
282
+        .then(() => true);
279
 };
283
 };
280
 
284
 
281
 /**
285
 /**
292
  *   CordovaError instance.
296
  *   CordovaError instance.
293
  */
297
  */
294
 Api.prototype.removePlugin = function (plugin, uninstallOptions) {
298
 Api.prototype.removePlugin = function (plugin, uninstallOptions) {
295
-    var xcodeproj = projectFile.parse(this.locations);
296
-    var self = this;
299
+    const xcodeproj = projectFile.parse(this.locations);
297
 
300
 
298
-    return PluginManager.get(self.platform, self.locations, xcodeproj)
301
+    return PluginManager.get(this.platform, this.locations, xcodeproj)
299
         .removePlugin(plugin, uninstallOptions)
302
         .removePlugin(plugin, uninstallOptions)
300
-        .then(function () {
303
+        .then(() => {
301
             if (plugin != null) {
304
             if (plugin != null) {
302
-                var headerTags = plugin.getHeaderFiles(self.platform);
303
-                var bridgingHeaders = headerTags.filter(function (obj) {
304
-                    return (obj.type === 'BridgingHeader');
305
-                });
305
+                const headerTags = plugin.getHeaderFiles(this.platform);
306
+                const bridgingHeaders = headerTags.filter(obj => obj.type === 'BridgingHeader');
306
                 if (bridgingHeaders.length > 0) {
307
                 if (bridgingHeaders.length > 0) {
307
-                    var project_dir = self.locations.root;
308
-                    var project_name = self.locations.xcodeCordovaProj.split('/').pop();
309
-                    var BridgingHeader = require('./lib/BridgingHeader').BridgingHeader;
310
-                    var bridgingHeaderFile = new BridgingHeader(path.join(project_dir, project_name, 'Bridging-Header.h'));
308
+                    const project_dir = this.locations.root;
309
+                    const project_name = this.locations.xcodeCordovaProj.split('/').pop();
310
+                    const BridgingHeader = require('./lib/BridgingHeader').BridgingHeader;
311
+                    const bridgingHeaderFile = new BridgingHeader(path.join(project_dir, project_name, 'Bridging-Header.h'));
311
                     events.emit('verbose', 'Removing Bridging-Headers since the plugin contained <header-file> with type="BridgingHeader"');
312
                     events.emit('verbose', 'Removing Bridging-Headers since the plugin contained <header-file> with type="BridgingHeader"');
312
-                    bridgingHeaders.forEach(function (obj) {
313
-                        var bridgingHeaderPath = path.basename(obj.src);
313
+                    bridgingHeaders.forEach(obj => {
314
+                        const bridgingHeaderPath = path.basename(obj.src);
314
                         bridgingHeaderFile.removeHeader(plugin.id, bridgingHeaderPath);
315
                         bridgingHeaderFile.removeHeader(plugin.id, bridgingHeaderPath);
315
                     });
316
                     });
316
                     bridgingHeaderFile.write();
317
                     bridgingHeaderFile.write();
317
                 }
318
                 }
318
             }
319
             }
319
         })
320
         })
320
-        .then(function () {
321
+        .then(() => {
321
             if (plugin != null) {
322
             if (plugin != null) {
322
-                var podSpecs = plugin.getPodSpecs ? plugin.getPodSpecs(self.platform) : [];
323
-                var frameworkTags = plugin.getFrameworks(self.platform);
324
-                var frameworkPods = frameworkTags.filter(function (obj) {
325
-                    return (obj.type === 'podspec');
326
-                });
327
-                return self.removePodSpecs(plugin, podSpecs, frameworkPods);
323
+                const podSpecs = plugin.getPodSpecs ? plugin.getPodSpecs(this.platform) : [];
324
+                const frameworkTags = plugin.getFrameworks(this.platform);
325
+                const frameworkPods = frameworkTags.filter(obj => obj.type === 'podspec');
326
+                return this.removePodSpecs(plugin, podSpecs, frameworkPods, uninstallOptions);
328
             }
327
             }
329
         })
328
         })
330
-        // CB-11022 return non-falsy value to indicate
331
-        // that there is no need to run prepare after
332
-        .thenResolve(true);
329
+        // CB-11022 Return truthy value to prevent running prepare after
330
+        .then(() => true);
333
 };
331
 };
334
 
332
 
335
 /**
333
 /**
337
  *
335
  *
338
  * @param  {PluginInfo}  plugin  A PluginInfo instance that represents plugin
336
  * @param  {PluginInfo}  plugin  A PluginInfo instance that represents plugin
339
  *   that will be installed.
337
  *   that will be installed.
340
- * @param  {Object}  podSpecs: the return value of plugin.getPodSpecs(self.platform)
338
+ * @param  {Object}  podSpecs: the return value of plugin.getPodSpecs(this.platform)
341
  * @param  {Object}  frameworkPods: framework tags object with type === 'podspec'
339
  * @param  {Object}  frameworkPods: framework tags object with type === 'podspec'
342
  * @return  {Promise}  Return a promise
340
  * @return  {Promise}  Return a promise
343
  */
341
  */
344
 
342
 
345
-Api.prototype.addPodSpecs = function (plugin, podSpecs, frameworkPods) {
346
-    var self = this;
347
-
348
-    var project_dir = self.locations.root;
349
-    var project_name = self.locations.xcodeCordovaProj.split('/').pop();
350
-    var minDeploymentTarget = self.getPlatformInfo().projectConfig.getPreference('deployment-target', 'ios');
343
+Api.prototype.addPodSpecs = function (plugin, podSpecs, frameworkPods, installOptions) {
344
+    const project_dir = this.locations.root;
345
+    const project_name = this.locations.xcodeCordovaProj.split('/').pop();
346
+    const minDeploymentTarget = this.getPlatformInfo().projectConfig.getPreference('deployment-target', 'ios');
351
 
347
 
352
-    var Podfile = require('./lib/Podfile').Podfile;
353
-    var PodsJson = require('./lib/PodsJson').PodsJson;
354
-    var podsjsonFile = new PodsJson(path.join(project_dir, PodsJson.FILENAME));
355
-    var podfileFile = new Podfile(path.join(project_dir, Podfile.FILENAME), project_name, minDeploymentTarget);
348
+    const Podfile = require('./lib/Podfile').Podfile;
349
+    const PodsJson = require('./lib/PodsJson').PodsJson;
350
+    const podsjsonFile = new PodsJson(path.join(project_dir, PodsJson.FILENAME));
351
+    const podfileFile = new Podfile(path.join(project_dir, Podfile.FILENAME), project_name, minDeploymentTarget);
356
 
352
 
357
     if (podSpecs.length) {
353
     if (podSpecs.length) {
358
         events.emit('verbose', 'Adding pods since the plugin contained <podspecs>');
354
         events.emit('verbose', 'Adding pods since the plugin contained <podspecs>');
359
-        podSpecs.forEach(function (obj) {
355
+        podSpecs.forEach(obj => {
360
             // declarations
356
             // declarations
361
-            Object.keys(obj.declarations).forEach(function (key) {
357
+            Object.keys(obj.declarations).forEach(key => {
362
                 if (obj.declarations[key] === 'true') {
358
                 if (obj.declarations[key] === 'true') {
363
-                    var declaration = Podfile.proofDeclaration(key);
364
-                    var podJson = {
365
-                        declaration: declaration
359
+                    const declaration = Podfile.proofDeclaration(key);
360
+                    const podJson = {
361
+                        declaration
366
                     };
362
                     };
367
-                    var val = podsjsonFile.getDeclaration(declaration);
363
+                    const val = podsjsonFile.getDeclaration(declaration);
368
                     if (val) {
364
                     if (val) {
369
                         podsjsonFile.incrementDeclaration(declaration);
365
                         podsjsonFile.incrementDeclaration(declaration);
370
                     } else {
366
                     } else {
375
                 }
371
                 }
376
             });
372
             });
377
             // sources
373
             // sources
378
-            Object.keys(obj.sources).forEach(function (key) {
379
-                var podJson = {
374
+            Object.keys(obj.sources).forEach(key => {
375
+                const podJson = {
380
                     source: obj.sources[key].source
376
                     source: obj.sources[key].source
381
                 };
377
                 };
382
-                var val = podsjsonFile.getSource(key);
378
+                const val = podsjsonFile.getSource(key);
383
                 if (val) {
379
                 if (val) {
384
                     podsjsonFile.incrementSource(key);
380
                     podsjsonFile.incrementSource(key);
385
                 } else {
381
                 } else {
389
                 }
385
                 }
390
             });
386
             });
391
             // libraries
387
             // libraries
392
-            Object.keys(obj.libraries).forEach(function (key) {
393
-                var podJson = Object.assign({}, obj.libraries[key]);
394
-                var val = podsjsonFile.getLibrary(key);
388
+            Object.keys(obj.libraries).forEach(key => {
389
+                const podJson = Object.assign({}, obj.libraries[key]);
390
+                if (podJson.spec) {
391
+                    podJson.spec = getVariableSpec(podJson.spec, installOptions);
392
+                }
393
+                const val = podsjsonFile.getLibrary(key);
395
                 if (val) {
394
                 if (val) {
396
-                    events.emit('warn', plugin.id + ' depends on ' + podJson.name + ', which may conflict with another plugin. ' + podJson.name + '@' + val.spec + ' is already installed and was not overwritten.');
395
+                    events.emit('warn', `${plugin.id} depends on ${podJson.name}, which may conflict with another plugin. ${podJson.name}@${val.spec} is already installed and was not overwritten.`);
397
                     podsjsonFile.incrementLibrary(key);
396
                     podsjsonFile.incrementLibrary(key);
398
                 } else {
397
                 } else {
399
                     podJson.count = 1;
398
                     podJson.count = 1;
401
                     podfileFile.addSpec(podJson.name, podJson);
400
                     podfileFile.addSpec(podJson.name, podJson);
402
                 }
401
                 }
403
             });
402
             });
404
-
405
         });
403
         });
406
     }
404
     }
407
 
405
 
408
     if (frameworkPods.length) {
406
     if (frameworkPods.length) {
409
         events.emit('warn', '"framework" tag with type "podspec" is deprecated and will be removed. Please use the "podspec" tag.');
407
         events.emit('warn', '"framework" tag with type "podspec" is deprecated and will be removed. Please use the "podspec" tag.');
410
         events.emit('verbose', 'Adding pods since the plugin contained <framework>(s) with type="podspec"');
408
         events.emit('verbose', 'Adding pods since the plugin contained <framework>(s) with type="podspec"');
411
-        frameworkPods.forEach(function (obj) {
412
-            var podJson = {
409
+        frameworkPods.forEach(obj => {
410
+            const spec = getVariableSpec(obj.spec, installOptions);
411
+            const podJson = {
413
                 name: obj.src,
412
                 name: obj.src,
414
                 type: obj.type,
413
                 type: obj.type,
415
-                spec: obj.spec
414
+                spec
416
             };
415
             };
417
 
416
 
418
-            var val = podsjsonFile.getLibrary(podJson.name);
417
+            const val = podsjsonFile.getLibrary(podJson.name);
419
             if (val) { // found
418
             if (val) { // found
420
                 if (podJson.spec !== val.spec) { // exists, different spec, print warning
419
                 if (podJson.spec !== val.spec) { // exists, different spec, print warning
421
-                    events.emit('warn', plugin.id + ' depends on ' + podJson.name + '@' + podJson.spec + ', which conflicts with another plugin. ' + podJson.name + '@' + val.spec + ' is already installed and was not overwritten.');
420
+                    events.emit('warn', `${plugin.id} depends on ${podJson.name}@${podJson.spec}, which conflicts with another plugin. ${podJson.name}@${val.spec} is already installed and was not overwritten.`);
422
                 }
421
                 }
423
                 // increment count, but don't add in Podfile because it already exists
422
                 // increment count, but don't add in Podfile because it already exists
424
                 podsjsonFile.incrementLibrary(podJson.name);
423
                 podsjsonFile.incrementLibrary(podJson.name);
439
         if (podfileFile.isDirty()) {
438
         if (podfileFile.isDirty()) {
440
             podfileFile.write();
439
             podfileFile.write();
441
             events.emit('verbose', 'Running `pod install` (to install plugins)');
440
             events.emit('verbose', 'Running `pod install` (to install plugins)');
442
-            projectFile.purgeProjectFileCache(self.locations.root);
441
+            projectFile.purgeProjectFileCache(this.locations.root);
443
 
442
 
444
             return podfileFile.install(check_reqs.check_cocoapods)
443
             return podfileFile.install(check_reqs.check_cocoapods)
445
-                .then(function () {
446
-                    return self.setSwiftVersionForCocoaPodsLibraries(podsjsonFile);
447
-                });
444
+                .then(() => this.setSwiftVersionForCocoaPodsLibraries(podsjsonFile));
448
         } else {
445
         } else {
449
             events.emit('verbose', 'Podfile unchanged, skipping `pod install`');
446
             events.emit('verbose', 'Podfile unchanged, skipping `pod install`');
450
         }
447
         }
451
     }
448
     }
452
-    return Q.when();
449
+    return Promise.resolve();
453
 };
450
 };
454
 
451
 
455
 /**
452
 /**
457
  *
454
  *
458
  * @param  {PluginInfo}  plugin  A PluginInfo instance that represents plugin
455
  * @param  {PluginInfo}  plugin  A PluginInfo instance that represents plugin
459
  *   that will be installed.
456
  *   that will be installed.
460
- * @param  {Object}  podSpecs: the return value of plugin.getPodSpecs(self.platform)
457
+ * @param  {Object}  podSpecs: the return value of plugin.getPodSpecs(this.platform)
461
  * @param  {Object}  frameworkPods: framework tags object with type === 'podspec'
458
  * @param  {Object}  frameworkPods: framework tags object with type === 'podspec'
462
  * @return  {Promise}  Return a promise
459
  * @return  {Promise}  Return a promise
463
  */
460
  */
464
 
461
 
465
-Api.prototype.removePodSpecs = function (plugin, podSpecs, frameworkPods) {
466
-    var self = this;
467
-
468
-    var project_dir = self.locations.root;
469
-    var project_name = self.locations.xcodeCordovaProj.split('/').pop();
462
+Api.prototype.removePodSpecs = function (plugin, podSpecs, frameworkPods, uninstallOptions) {
463
+    const project_dir = this.locations.root;
464
+    const project_name = this.locations.xcodeCordovaProj.split('/').pop();
470
 
465
 
471
-    var Podfile = require('./lib/Podfile').Podfile;
472
-    var PodsJson = require('./lib/PodsJson').PodsJson;
473
-    var podsjsonFile = new PodsJson(path.join(project_dir, PodsJson.FILENAME));
474
-    var podfileFile = new Podfile(path.join(project_dir, Podfile.FILENAME), project_name);
466
+    const Podfile = require('./lib/Podfile').Podfile;
467
+    const PodsJson = require('./lib/PodsJson').PodsJson;
468
+    const podsjsonFile = new PodsJson(path.join(project_dir, PodsJson.FILENAME));
469
+    const podfileFile = new Podfile(path.join(project_dir, Podfile.FILENAME), project_name);
475
 
470
 
476
     if (podSpecs.length) {
471
     if (podSpecs.length) {
477
         events.emit('verbose', 'Adding pods since the plugin contained <podspecs>');
472
         events.emit('verbose', 'Adding pods since the plugin contained <podspecs>');
478
-        podSpecs.forEach(function (obj) {
473
+        podSpecs.forEach(obj => {
479
             // declarations
474
             // declarations
480
-            Object.keys(obj.declarations).forEach(function (key) {
475
+            Object.keys(obj.declarations).forEach(key => {
481
                 if (obj.declarations[key] === 'true') {
476
                 if (obj.declarations[key] === 'true') {
482
-                    var declaration = Podfile.proofDeclaration(key);
483
-                    var podJson = {
484
-                        declaration: declaration
477
+                    const declaration = Podfile.proofDeclaration(key);
478
+                    const podJson = {
479
+                        declaration
485
                     };
480
                     };
486
-                    var val = podsjsonFile.getDeclaration(declaration);
481
+                    const val = podsjsonFile.getDeclaration(declaration);
487
                     if (val) {
482
                     if (val) {
488
                         podsjsonFile.decrementDeclaration(declaration);
483
                         podsjsonFile.decrementDeclaration(declaration);
489
                     } else {
484
                     } else {
490
-                        var message = util.format('plugin \"%s\" declaration \"%s\" does not seem to be in pods.json, nothing to remove. Will attempt to remove from Podfile.', plugin.id, podJson.declaration); /* eslint no-useless-escape : 0 */
485
+                        const message = util.format('plugin \"%s\" declaration \"%s\" does not seem to be in pods.json, nothing to remove. Will attempt to remove from Podfile.', plugin.id, podJson.declaration); /* eslint no-useless-escape : 0 */
491
                         events.emit('verbose', message);
486
                         events.emit('verbose', message);
492
                     }
487
                     }
493
                     if (!val || val.count === 0) {
488
                     if (!val || val.count === 0) {
496
                 }
491
                 }
497
             });
492
             });
498
             // sources
493
             // sources
499
-            Object.keys(obj.sources).forEach(function (key) {
500
-                var podJson = {
494
+            Object.keys(obj.sources).forEach(key => {
495
+                const podJson = {
501
                     source: obj.sources[key].source
496
                     source: obj.sources[key].source
502
                 };
497
                 };
503
-                var val = podsjsonFile.getSource(key);
498
+                const val = podsjsonFile.getSource(key);
504
                 if (val) {
499
                 if (val) {
505
                     podsjsonFile.decrementSource(key);
500
                     podsjsonFile.decrementSource(key);
506
                 } else {
501
                 } else {
507
-                    var message = util.format('plugin \"%s\" source \"%s\" does not seem to be in pods.json, nothing to remove. Will attempt to remove from Podfile.', plugin.id, podJson.source); /* eslint no-useless-escape : 0 */
502
+                    const message = util.format('plugin \"%s\" source \"%s\" does not seem to be in pods.json, nothing to remove. Will attempt to remove from Podfile.', plugin.id, podJson.source); /* eslint no-useless-escape : 0 */
508
                     events.emit('verbose', message);
503
                     events.emit('verbose', message);
509
                 }
504
                 }
510
                 if (!val || val.count === 0) {
505
                 if (!val || val.count === 0) {
512
                 }
507
                 }
513
             });
508
             });
514
             // libraries
509
             // libraries
515
-            Object.keys(obj.libraries).forEach(function (key) {
516
-                var podJson = Object.assign({}, obj.libraries[key]);
517
-                var val = podsjsonFile.getLibrary(key);
510
+            Object.keys(obj.libraries).forEach(key => {
511
+                const podJson = Object.assign({}, obj.libraries[key]);
512
+                if (podJson.spec) {
513
+                    podJson.spec = getVariableSpec(podJson.spec, uninstallOptions);
514
+                }
515
+                const val = podsjsonFile.getLibrary(key);
518
                 if (val) {
516
                 if (val) {
519
                     podsjsonFile.decrementLibrary(key);
517
                     podsjsonFile.decrementLibrary(key);
520
                 } else {
518
                 } else {
521
-                    var message = util.format('plugin \"%s\" podspec \"%s\" does not seem to be in pods.json, nothing to remove. Will attempt to remove from Podfile.', plugin.id, podJson.name); /* eslint no-useless-escape : 0 */
519
+                    const message = util.format('plugin \"%s\" podspec \"%s\" does not seem to be in pods.json, nothing to remove. Will attempt to remove from Podfile.', plugin.id, podJson.name); /* eslint no-useless-escape : 0 */
522
                     events.emit('verbose', message);
520
                     events.emit('verbose', message);
523
                 }
521
                 }
524
                 if (!val || val.count === 0) {
522
                 if (!val || val.count === 0) {
525
                     podfileFile.removeSpec(podJson.name);
523
                     podfileFile.removeSpec(podJson.name);
526
                 }
524
                 }
527
             });
525
             });
528
-
529
         });
526
         });
530
     }
527
     }
531
 
528
 
532
     if (frameworkPods.length) {
529
     if (frameworkPods.length) {
533
         events.emit('warn', '"framework" tag with type "podspec" is deprecated and will be removed. Please use the "podspec" tag.');
530
         events.emit('warn', '"framework" tag with type "podspec" is deprecated and will be removed. Please use the "podspec" tag.');
534
         events.emit('verbose', 'Adding pods since the plugin contained <framework>(s) with type=\"podspec\"'); /* eslint no-useless-escape : 0 */
531
         events.emit('verbose', 'Adding pods since the plugin contained <framework>(s) with type=\"podspec\"'); /* eslint no-useless-escape : 0 */
535
-        frameworkPods.forEach(function (obj) {
536
-            var podJson = {
532
+        frameworkPods.forEach(obj => {
533
+            const spec = getVariableSpec(obj.spec, uninstallOptions);
534
+            const podJson = {
537
                 name: obj.src,
535
                 name: obj.src,
538
                 type: obj.type,
536
                 type: obj.type,
539
-                spec: obj.spec
537
+                spec
540
             };
538
             };
541
 
539
 
542
-            var val = podsjsonFile.getLibrary(podJson.name);
540
+            const val = podsjsonFile.getLibrary(podJson.name);
543
             if (val) { // found, decrement count
541
             if (val) { // found, decrement count
544
                 podsjsonFile.decrementLibrary(podJson.name);
542
                 podsjsonFile.decrementLibrary(podJson.name);
545
             } else { // not found (perhaps a sync error)
543
             } else { // not found (perhaps a sync error)
546
-                var message = util.format('plugin \"%s\" podspec \"%s\" does not seem to be in pods.json, nothing to remove. Will attempt to remove from Podfile.', plugin.id, podJson.name); /* eslint no-useless-escape : 0 */
544
+                const message = util.format('plugin \"%s\" podspec \"%s\" does not seem to be in pods.json, nothing to remove. Will attempt to remove from Podfile.', plugin.id, podJson.name); /* eslint no-useless-escape : 0 */
547
                 events.emit('verbose', message);
545
                 events.emit('verbose', message);
548
             }
546
             }
549
 
547
 
561
             events.emit('verbose', 'Running `pod install` (to uninstall pods)');
559
             events.emit('verbose', 'Running `pod install` (to uninstall pods)');
562
 
560
 
563
             return podfileFile.install(check_reqs.check_cocoapods)
561
             return podfileFile.install(check_reqs.check_cocoapods)
564
-                .then(function () {
565
-                    return self.setSwiftVersionForCocoaPodsLibraries(podsjsonFile);
566
-                });
562
+                .then(() => this.setSwiftVersionForCocoaPodsLibraries(podsjsonFile));
567
         } else {
563
         } else {
568
             events.emit('verbose', 'Podfile unchanged, skipping `pod install`');
564
             events.emit('verbose', 'Podfile unchanged, skipping `pod install`');
569
         }
565
         }
570
     }
566
     }
571
-    return Q.when();
567
+    return Promise.resolve();
572
 };
568
 };
573
 
569
 
574
 /**
570
 /**
578
  */
574
  */
579
 
575
 
580
 Api.prototype.setSwiftVersionForCocoaPodsLibraries = function (podsjsonFile) {
576
 Api.prototype.setSwiftVersionForCocoaPodsLibraries = function (podsjsonFile) {
581
-    var self = this;
582
-    var __dirty = false;
583
-    return check_reqs.check_cocoapods().then(function (toolOptions) {
577
+    let __dirty = false;
578
+    return check_reqs.check_cocoapods().then(toolOptions => {
584
         if (toolOptions.ignore) {
579
         if (toolOptions.ignore) {
585
             events.emit('verbose', '=== skip Swift Version Settings For Cocoapods Libraries');
580
             events.emit('verbose', '=== skip Swift Version Settings For Cocoapods Libraries');
586
         } else {
581
         } else {
587
-            var podPbxPath = path.join(self.root, 'Pods', 'Pods.xcodeproj', 'project.pbxproj');
588
-            var podXcodeproj = xcode.project(podPbxPath);
582
+            const podPbxPath = path.join(this.root, 'Pods', 'Pods.xcodeproj', 'project.pbxproj');
583
+            const podXcodeproj = xcode.project(podPbxPath);
589
             podXcodeproj.parseSync();
584
             podXcodeproj.parseSync();
590
-            var podTargets = podXcodeproj.pbxNativeTargetSection();
591
-            var podConfigurationList = podXcodeproj.pbxXCConfigurationList();
592
-            var podConfigs = podXcodeproj.pbxXCBuildConfigurationSection();
593
-
594
-            var libraries = podsjsonFile.getLibraries();
595
-            Object.keys(libraries).forEach(function (key) {
596
-                var podJson = libraries[key];
597
-                var name = podJson.name;
598
-                var swiftVersion = podJson['swift-version'];
585
+            const podTargets = podXcodeproj.pbxNativeTargetSection();
586
+            const podConfigurationList = podXcodeproj.pbxXCConfigurationList();
587
+            const podConfigs = podXcodeproj.pbxXCBuildConfigurationSection();
588
+
589
+            const libraries = podsjsonFile.getLibraries();
590
+            Object.keys(libraries).forEach(key => {
591
+                const podJson = libraries[key];
592
+                const name = podJson.name;
593
+                const swiftVersion = podJson['swift-version'];
599
                 if (swiftVersion) {
594
                 if (swiftVersion) {
600
                     __dirty = true;
595
                     __dirty = true;
601
-                    Object.keys(podTargets).filter(function (targetKey) {
602
-                        return podTargets[targetKey].productName === name;
603
-                    }).map(function (targetKey) {
604
-                        return podTargets[targetKey].buildConfigurationList;
605
-                    }).map(function (buildConfigurationListId) {
606
-                        return podConfigurationList[buildConfigurationListId];
607
-                    }).map(function (buildConfigurationList) {
608
-                        return buildConfigurationList.buildConfigurations;
609
-                    }).reduce(function (acc, buildConfigurations) {
610
-                        return acc.concat(buildConfigurations);
611
-                    }, []).map(function (buildConfiguration) {
612
-                        return buildConfiguration.value;
613
-                    }).forEach(function (buildId) {
614
-                        __dirty = true;
615
-                        podConfigs[buildId].buildSettings['SWIFT_VERSION'] = swiftVersion;
616
-                    });
596
+                    Object.keys(podTargets)
597
+                        .filter(targetKey => podTargets[targetKey].productName === name)
598
+                        .map(targetKey => podTargets[targetKey].buildConfigurationList)
599
+                        .map(buildConfigurationListId => podConfigurationList[buildConfigurationListId])
600
+                        .map(buildConfigurationList => buildConfigurationList.buildConfigurations)
601
+                        .reduce((acc, buildConfigurations) => acc.concat(buildConfigurations), [])
602
+                        .map(buildConfiguration => buildConfiguration.value)
603
+                        .forEach(buildId => {
604
+                            __dirty = true;
605
+                            podConfigs[buildId].buildSettings.SWIFT_VERSION = swiftVersion;
606
+                        });
617
                 }
607
                 }
618
             });
608
             });
619
             if (__dirty) {
609
             if (__dirty) {
656
  *   CordovaError instance.
646
  *   CordovaError instance.
657
  */
647
  */
658
 Api.prototype.build = function (buildOptions) {
648
 Api.prototype.build = function (buildOptions) {
659
-    var self = this;
660
     return check_reqs.run()
649
     return check_reqs.run()
661
-        .then(function () {
662
-            return require('./lib/build').run.call(self, buildOptions);
663
-        });
650
+        .then(() => require('./lib/build').run.call(this, buildOptions));
664
 };
651
 };
665
 
652
 
666
 /**
653
 /**
676
  *   successfully, or rejected with CordovaError.
663
  *   successfully, or rejected with CordovaError.
677
  */
664
  */
678
 Api.prototype.run = function (runOptions) {
665
 Api.prototype.run = function (runOptions) {
679
-    var self = this;
680
     return check_reqs.run()
666
     return check_reqs.run()
681
-        .then(function () {
682
-            return require('./lib/run').run.call(self, runOptions);
683
-        });
667
+        .then(() => require('./lib/run').run.call(this, runOptions));
684
 };
668
 };
685
 
669
 
686
 /**
670
 /**
690
  *   CordovaError.
674
  *   CordovaError.
691
  */
675
  */
692
 Api.prototype.clean = function (cleanOptions) {
676
 Api.prototype.clean = function (cleanOptions) {
693
-    var self = this;
694
     return check_reqs.run()
677
     return check_reqs.run()
695
-        .then(function () {
696
-            return require('./lib/clean').run.call(self, cleanOptions);
697
-        })
698
-        .then(function () {
699
-            return require('./lib/prepare').clean.call(self, cleanOptions);
700
-        });
678
+        .then(() => require('./lib/clean').run.call(this, cleanOptions))
679
+        .then(() => require('./lib/prepare').clean.call(this, cleanOptions));
701
 };
680
 };
702
 
681
 
703
 /**
682
 /**
712
     return check_reqs.check_all();
691
     return check_reqs.check_all();
713
 };
692
 };
714
 
693
 
694
+Api.version = function () {
695
+    return VERSION;
696
+};
697
+
715
 module.exports = Api;
698
 module.exports = Api;

+ 27
- 24
node_modules/cordova-ios/bin/templates/scripts/cordova/build View File

31
 
31
 
32
 // Parse arguments
32
 // Parse arguments
33
 var buildOpts = nopt({
33
 var buildOpts = nopt({
34
-    'verbose': Boolean,
35
-    'silent': Boolean,
36
-    'archs': String,
37
-    'debug': Boolean,
38
-    'release': Boolean,
39
-    'device': Boolean,
40
-    'emulator': Boolean,
41
-    'codeSignIdentity': String,
42
-    'codeSignResourceRules': String,
43
-    'provisioningProfile': String,
44
-    'automaticProvisioning': Boolean,
45
-    'developmentTeam': String,
46
-    'packageType': String,
47
-    'buildConfig': String,
48
-    'buildFlag': [String, Array],
49
-    'noSign': Boolean
50
-}, { '-r': '--release', 'd': '--verbose' }, args);
34
+    verbose: Boolean,
35
+    silent: Boolean,
36
+    archs: String,
37
+    debug: Boolean,
38
+    release: Boolean,
39
+    device: Boolean,
40
+    emulator: Boolean,
41
+    codeSignIdentity: String,
42
+    codeSignResourceRules: String,
43
+    provisioningProfile: String,
44
+    automaticProvisioning: Boolean,
45
+    developmentTeam: String,
46
+    packageType: String,
47
+    buildConfig: String,
48
+    buildFlag: [String, Array],
49
+    noSign: Boolean
50
+}, { '-r': '--release', d: '--verbose' }, args);
51
 
51
 
52
 // Make buildOptions compatible with PlatformApi build method spec
52
 // Make buildOptions compatible with PlatformApi build method spec
53
 buildOpts.argv = buildOpts.argv.remain;
53
 buildOpts.argv = buildOpts.argv.remain;
54
 
54
 
55
 require('./loggingHelper').adjustLoggerLevel(buildOpts);
55
 require('./loggingHelper').adjustLoggerLevel(buildOpts);
56
 
56
 
57
-new Api().build(buildOpts).done(function () {
58
-    console.log('** BUILD SUCCEEDED **');
59
-}, function (err) {
60
-    var errorMessage = (err && err.stack) ? err.stack : err;
61
-    console.error(errorMessage);
62
-    process.exit(2);
63
-});
57
+new Api().build(buildOpts).then(
58
+    () => {
59
+        console.log('** BUILD SUCCEEDED **');
60
+    },
61
+    err => {
62
+        var errorMessage = (err && err.stack) ? err.stack : err;
63
+        console.error(errorMessage);
64
+        process.exit(2);
65
+    }
66
+);

+ 0
- 0
node_modules/cordova-ios/bin/templates/scripts/cordova/build.bat View File


+ 12
- 9
node_modules/cordova-ios/bin/templates/scripts/cordova/clean View File

29
 
29
 
30
 // Do some basic argument parsing
30
 // Do some basic argument parsing
31
 var opts = nopt({
31
 var opts = nopt({
32
-    'verbose': Boolean,
33
-    'silent': Boolean
34
-}, { 'd': '--verbose' });
32
+    verbose: Boolean,
33
+    silent: Boolean
34
+}, { d: '--verbose' });
35
 
35
 
36
 // Make buildOptions compatible with PlatformApi clean method spec
36
 // Make buildOptions compatible with PlatformApi clean method spec
37
 opts.argv = opts.argv.original;
37
 opts.argv = opts.argv.original;
41
 
41
 
42
 require('./loggingHelper').adjustLoggerLevel(opts);
42
 require('./loggingHelper').adjustLoggerLevel(opts);
43
 
43
 
44
-new Api().clean(opts).done(function () {
45
-    console.log('** CLEAN SUCCEEDED **');
46
-}, function (err) {
47
-    console.error(err);
48
-    process.exit(2);
49
-});
44
+new Api().clean(opts).then(
45
+    () => {
46
+        console.log('** CLEAN SUCCEEDED **');
47
+    },
48
+    err => {
49
+        console.error(err);
50
+        process.exit(2);
51
+    }
52
+);

+ 0
- 0
node_modules/cordova-ios/bin/templates/scripts/cordova/clean.bat View File


+ 7
- 1
node_modules/cordova-ios/bin/templates/scripts/cordova/defaults.xml View File

27
     <preference name="DisallowOverscroll" value="false" />
27
     <preference name="DisallowOverscroll" value="false" />
28
     <preference name="EnableViewportScale" value="false" />
28
     <preference name="EnableViewportScale" value="false" />
29
     <preference name="KeyboardDisplayRequiresUserAction" value="true" />
29
     <preference name="KeyboardDisplayRequiresUserAction" value="true" />
30
-    <preference name="MediaPlaybackRequiresUserAction" value="false" />
30
+    <preference name="MediaTypesRequiringUserActionForPlayback" value="none" />
31
     <preference name="SuppressesIncrementalRendering" value="false" />
31
     <preference name="SuppressesIncrementalRendering" value="false" />
32
     <preference name="SuppressesLongPressGesture" value="false" />
32
     <preference name="SuppressesLongPressGesture" value="false" />
33
     <preference name="Suppresses3DTouchGesture" value="false" />
33
     <preference name="Suppresses3DTouchGesture" value="false" />
36
     <preference name="PaginationBreakingMode" value="page" /> <!-- page, column -->
36
     <preference name="PaginationBreakingMode" value="page" /> <!-- page, column -->
37
     <preference name="PaginationMode" value="unpaginated" /> <!-- unpaginated, leftToRight, topToBottom, bottomToTop, rightToLeft -->
37
     <preference name="PaginationMode" value="unpaginated" /> <!-- unpaginated, leftToRight, topToBottom, bottomToTop, rightToLeft -->
38
 
38
 
39
+    <feature name="CDVWebViewEngine">
40
+        <param name="ios-package" value="CDVWebViewEngine" />
41
+    </feature>
42
+    <feature name="LaunchScreen">
43
+        <param name="ios-package" value="CDVLaunchScreen"/>
44
+    </feature>
39
     <feature name="LocalStorage">
45
     <feature name="LocalStorage">
40
         <param name="ios-package" value="CDVLocalStorage"/>
46
         <param name="ios-package" value="CDVLocalStorage"/>
41
     </feature>
47
     </feature>

+ 17
- 19
node_modules/cordova-ios/bin/templates/scripts/cordova/lib/BridgingHeader.js View File

18
 */
18
 */
19
 'use strict';
19
 'use strict';
20
 
20
 
21
-var fs = require('fs');
22
-var CordovaError = require('cordova-common').CordovaError;
21
+const fs = require('fs-extra');
22
+const CordovaError = require('cordova-common').CordovaError;
23
 
23
 
24
 function BridgingHeader (bridgingHeaderPath) {
24
 function BridgingHeader (bridgingHeaderPath) {
25
     this.path = bridgingHeaderPath;
25
     this.path = bridgingHeaderPath;
31
 }
31
 }
32
 
32
 
33
 BridgingHeader.prototype.addHeader = function (plugin_id, header_path) {
33
 BridgingHeader.prototype.addHeader = function (plugin_id, header_path) {
34
-    this.bridgingHeaders.push({ type: 'code', code: '#import "' + header_path + '"\n' });
34
+    this.bridgingHeaders.push({ type: 'code', code: `#import "${header_path}"\n` });
35
 };
35
 };
36
 
36
 
37
 BridgingHeader.prototype.removeHeader = function (plugin_id, header_path) {
37
 BridgingHeader.prototype.removeHeader = function (plugin_id, header_path) {
40
             return true;
40
             return true;
41
         }
41
         }
42
         if (line.type === 'code') {
42
         if (line.type === 'code') {
43
-            var re = new RegExp('#import\\s+"' + preg_quote(header_path) + '"(\\s*|\\s.+)(\\n|$)');
43
+            const re = new RegExp(`#import\\s+"${preg_quote(header_path)}"(\\s*|\\s.+)(\\n|$)`);
44
             if (re.test(line.code)) {
44
             if (re.test(line.code)) {
45
                 this.found = true;
45
                 this.found = true;
46
                 return false;
46
                 return false;
51
 };
51
 };
52
 
52
 
53
 BridgingHeader.prototype.write = function () {
53
 BridgingHeader.prototype.write = function () {
54
-    var text = this.__stringifyForBridgingHeader(this.bridgingHeaders);
54
+    const text = this.__stringifyForBridgingHeader(this.bridgingHeaders);
55
     fs.writeFileSync(this.path, text, 'utf8');
55
     fs.writeFileSync(this.path, text, 'utf8');
56
 };
56
 };
57
 
57
 
58
 BridgingHeader.prototype.__stringifyForBridgingHeader = function (bridgingHeaders) {
58
 BridgingHeader.prototype.__stringifyForBridgingHeader = function (bridgingHeaders) {
59
-    return bridgingHeaders.map(function (obj) {
60
-        return obj.code;
61
-    }).join('');
59
+    return bridgingHeaders.map(obj => obj.code).join('');
62
 };
60
 };
63
 
61
 
64
 BridgingHeader.prototype.__parseForBridgingHeader = function (text) {
62
 BridgingHeader.prototype.__parseForBridgingHeader = function (text) {
65
-    var i = 0;
66
-    var list = [];
67
-    var type = 'code';
68
-    var start = 0;
63
+    let i = 0;
64
+    const list = [];
65
+    let type = 'code';
66
+    let start = 0;
69
     while (i < text.length) {
67
     while (i < text.length) {
70
         switch (type) {
68
         switch (type) {
71
         case 'comment':
69
         case 'comment':
72
             if (i + 1 < text.length && text[i] === '*' && text[i + 1] === '/') {
70
             if (i + 1 < text.length && text[i] === '*' && text[i + 1] === '/') {
73
                 i += 2;
71
                 i += 2;
74
-                list.push({ type: type, code: text.slice(start, i) });
72
+                list.push({ type, code: text.slice(start, i) });
75
                 type = 'code';
73
                 type = 'code';
76
                 start = i;
74
                 start = i;
77
             } else {
75
             } else {
81
         case 'line-comment':
79
         case 'line-comment':
82
             if (i < text.length && text[i] === '\n') {
80
             if (i < text.length && text[i] === '\n') {
83
                 i += 1;
81
                 i += 1;
84
-                list.push({ type: type, code: text.slice(start, i) });
82
+                list.push({ type, code: text.slice(start, i) });
85
                 type = 'code';
83
                 type = 'code';
86
                 start = i;
84
                 start = i;
87
             } else {
85
             } else {
92
         default:
90
         default:
93
             if (i + 1 < text.length && text[i] === '/' && text[i + 1] === '*') { // comment
91
             if (i + 1 < text.length && text[i] === '/' && text[i + 1] === '*') { // comment
94
                 if (start < i) {
92
                 if (start < i) {
95
-                    list.push({ type: type, code: text.slice(start, i) });
93
+                    list.push({ type, code: text.slice(start, i) });
96
                 }
94
                 }
97
                 type = 'comment';
95
                 type = 'comment';
98
                 start = i;
96
                 start = i;
99
             } else if (i + 1 < text.length && text[i] === '/' && text[i + 1] === '/') { // line comment
97
             } else if (i + 1 < text.length && text[i] === '/' && text[i + 1] === '/') { // line comment
100
                 if (start < i) {
98
                 if (start < i) {
101
-                    list.push({ type: type, code: text.slice(start, i) });
99
+                    list.push({ type, code: text.slice(start, i) });
102
                 }
100
                 }
103
                 type = 'line-comment';
101
                 type = 'line-comment';
104
                 start = i;
102
                 start = i;
105
             } else if (i < text.length && text[i] === '\n') {
103
             } else if (i < text.length && text[i] === '\n') {
106
                 i += 1;
104
                 i += 1;
107
-                list.push({ type: type, code: text.slice(start, i) });
105
+                list.push({ type, code: text.slice(start, i) });
108
                 start = i;
106
                 start = i;
109
             } else {
107
             } else {
110
                 i += 1;
108
                 i += 1;
113
         }
111
         }
114
     }
112
     }
115
     if (start < i) {
113
     if (start < i) {
116
-        list.push({ type: type, code: text.slice(start, i) });
114
+        list.push({ type, code: text.slice(start, i) });
117
     }
115
     }
118
     return list;
116
     return list;
119
 };
117
 };
120
 
118
 
121
 function preg_quote (str, delimiter) {
119
 function preg_quote (str, delimiter) {
122
-    return (str + '').replace(new RegExp('[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\' + (delimiter || '') + '-]', 'g'), '\\$&');
120
+    return (`${str}`).replace(new RegExp(`[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\${delimiter || ''}-]`, 'g'), '\\$&');
123
 }
121
 }
124
 
122
 
125
 module.exports.BridgingHeader = BridgingHeader;
123
 module.exports.BridgingHeader = BridgingHeader;

+ 74
- 80
node_modules/cordova-ios/bin/templates/scripts/cordova/lib/Podfile.js View File

18
 */
18
 */
19
 'use strict';
19
 'use strict';
20
 
20
 
21
-var fs = require('fs');
22
-var path = require('path');
23
-var util = require('util');
24
-var events = require('cordova-common').events;
25
-var Q = require('q');
26
-var superspawn = require('cordova-common').superspawn;
27
-var CordovaError = require('cordova-common').CordovaError;
21
+const fs = require('fs-extra');
22
+const path = require('path');
23
+const util = require('util');
24
+const {
25
+    CordovaError,
26
+    events,
27
+    superspawn: { spawn }
28
+} = require('cordova-common');
28
 
29
 
29
 Podfile.FILENAME = 'Podfile';
30
 Podfile.FILENAME = 'Podfile';
30
 Podfile.declarationRegexpMap = {
31
 Podfile.declarationRegexpMap = {
39
 
40
 
40
     this.path = podFilePath;
41
     this.path = podFilePath;
41
     this.projectName = projectName;
42
     this.projectName = projectName;
42
-    this.minDeploymentTarget = minDeploymentTarget || '10.0';
43
+    this.minDeploymentTarget = minDeploymentTarget || '11.0';
43
     this.contents = null;
44
     this.contents = null;
44
     this.sources = null;
45
     this.sources = null;
45
     this.declarations = null;
46
     this.declarations = null;
47
     this.__dirty = false;
48
     this.__dirty = false;
48
 
49
 
49
     // check whether it is named Podfile
50
     // check whether it is named Podfile
50
-    var filename = this.path.split(path.sep).pop();
51
+    const filename = this.path.split(path.sep).pop();
51
     if (filename !== Podfile.FILENAME) {
52
     if (filename !== Podfile.FILENAME) {
52
         throw new CordovaError(util.format('Podfile: The file at %s is not `%s`.', this.path, Podfile.FILENAME));
53
         throw new CordovaError(util.format('Podfile: The file at %s is not `%s`.', this.path, Podfile.FILENAME));
53
     }
54
     }
64
     } else {
65
     } else {
65
         events.emit('verbose', 'Podfile found in platforms/ios');
66
         events.emit('verbose', 'Podfile found in platforms/ios');
66
         // parse for pods
67
         // parse for pods
67
-        var fileText = fs.readFileSync(this.path, 'utf8');
68
+        const fileText = fs.readFileSync(this.path, 'utf8');
68
         this.declarations = this.__parseForDeclarations(fileText);
69
         this.declarations = this.__parseForDeclarations(fileText);
69
         this.sources = this.__parseForSources(fileText);
70
         this.sources = this.__parseForSources(fileText);
70
         this.pods = this.__parseForPods(fileText);
71
         this.pods = this.__parseForPods(fileText);
73
 
74
 
74
 Podfile.prototype.__parseForDeclarations = function (text) {
75
 Podfile.prototype.__parseForDeclarations = function (text) {
75
     // split by \n
76
     // split by \n
76
-    var arr = text.split('\n');
77
+    const arr = text.split('\n');
77
 
78
 
78
-    // getting lines between "platform :ios, '10.0'"" and "target 'HelloCordova'" do
79
-    var declarationsPreRE = new RegExp('platform :ios,\\s+\'[^\']+\'');
80
-    var declarationsPostRE = new RegExp('target\\s+\'[^\']+\'\\s+do');
81
-    var declarationRE = new RegExp('^\\s*[^#]');
79
+    // getting lines between "platform :ios, '11.0'"" and "target 'HelloCordova'" do
80
+    const declarationsPreRE = new RegExp('platform :ios,\\s+\'[^\']+\'');
81
+    const declarationsPostRE = new RegExp('target\\s+\'[^\']+\'\\s+do');
82
+    const declarationRE = new RegExp('^\\s*[^#]');
82
 
83
 
83
-    return arr.reduce(function (acc, line) {
84
+    return arr.reduce((acc, line) => {
84
         switch (acc.state) {
85
         switch (acc.state) {
85
         case 0:
86
         case 0:
86
             if (declarationsPreRE.exec(line)) {
87
             if (declarationsPreRE.exec(line)) {
101
         return acc;
102
         return acc;
102
     }, { state: 0, lines: [] })
103
     }, { state: 0, lines: [] })
103
         .lines
104
         .lines
104
-        .filter(function (line) {
105
-            return declarationRE.exec(line);
106
-        })
107
-        .reduce(function (obj, line) {
105
+        .filter(line => declarationRE.exec(line))
106
+        .reduce((obj, line) => {
108
             obj[line] = line;
107
             obj[line] = line;
109
             return obj;
108
             return obj;
110
         }, {});
109
         }, {});
112
 
111
 
113
 Podfile.prototype.__parseForSources = function (text) {
112
 Podfile.prototype.__parseForSources = function (text) {
114
     // split by \n
113
     // split by \n
115
-    var arr = text.split('\n');
114
+    const arr = text.split('\n');
116
 
115
 
117
-    var sourceRE = new RegExp('source \'(.*)\'');
118
-    return arr.filter(function (line) {
119
-        var m = sourceRE.exec(line);
116
+    const sourceRE = new RegExp('source \'(.*)\'');
117
+    return arr.filter(line => {
118
+        const m = sourceRE.exec(line);
120
 
119
 
121
         return (m !== null);
120
         return (m !== null);
122
     })
121
     })
123
-        .reduce(function (obj, line) {
124
-            var m = sourceRE.exec(line);
122
+        .reduce((obj, line) => {
123
+            const m = sourceRE.exec(line);
125
             if (m !== null) {
124
             if (m !== null) {
126
-                var source = m[1];
125
+                const source = m[1];
127
                 obj[source] = source;
126
                 obj[source] = source;
128
             }
127
             }
129
             return obj;
128
             return obj;
132
 
131
 
133
 Podfile.prototype.__parseForPods = function (text) {
132
 Podfile.prototype.__parseForPods = function (text) {
134
     // split by \n
133
     // split by \n
135
-    var arr = text.split('\n');
134
+    const arr = text.split('\n');
136
 
135
 
137
     // aim is to match (space insignificant around the comma, comma optional):
136
     // aim is to match (space insignificant around the comma, comma optional):
138
     //     pod 'Foobar', '1.2'
137
     //     pod 'Foobar', '1.2'
139
     //     pod 'Foobar', 'abc 123 1.2'
138
     //     pod 'Foobar', 'abc 123 1.2'
140
     //     pod 'PonyDebugger', :configurations => ['Debug', 'Beta']
139
     //     pod 'PonyDebugger', :configurations => ['Debug', 'Beta']
141
     // var podRE = new RegExp('pod \'([^\']*)\'\\s*,?\\s*(.*)');
140
     // var podRE = new RegExp('pod \'([^\']*)\'\\s*,?\\s*(.*)');
142
-    var podRE = new RegExp('pod \'([^\']*)\'\\s*(?:,\\s*\'([^\']*)\'\\s*)?,?\\s*(.*)');
141
+    const podRE = new RegExp('pod \'([^\']*)\'\\s*(?:,\\s*\'([^\']*)\'\\s*)?,?\\s*(.*)');
143
 
142
 
144
     // only grab lines that don't have the pod spec'
143
     // only grab lines that don't have the pod spec'
145
-    return arr.filter(function (line) {
146
-        var m = podRE.exec(line);
144
+    return arr.filter(line => {
145
+        const m = podRE.exec(line);
147
 
146
 
148
         return (m !== null);
147
         return (m !== null);
149
     })
148
     })
150
-        .reduce(function (obj, line) {
151
-            var m = podRE.exec(line);
149
+        .reduce((obj, line) => {
150
+            const m = podRE.exec(line);
152
 
151
 
153
             if (m !== null) {
152
             if (m !== null) {
154
-                var podspec = {
153
+                const podspec = {
155
                     name: m[1]
154
                     name: m[1]
156
                 };
155
                 };
157
                 if (m[2]) {
156
                 if (m[2]) {
168
 };
167
 };
169
 
168
 
170
 Podfile.prototype.escapeSingleQuotes = function (string) {
169
 Podfile.prototype.escapeSingleQuotes = function (string) {
171
-    return string.replace('\'', '\\\'');
170
+    return string.replace(/'/g, '\\\'');
172
 };
171
 };
173
 
172
 
174
 Podfile.prototype.getTemplate = function () {
173
 Podfile.prototype.getTemplate = function () {
175
     // Escaping possible ' in the project name
174
     // Escaping possible ' in the project name
176
-    var projectName = this.escapeSingleQuotes(this.projectName);
175
+    const projectName = this.escapeSingleQuotes(this.projectName);
177
     return util.format(
176
     return util.format(
178
         '# DO NOT MODIFY -- auto-generated by Apache Cordova\n' +
177
         '# DO NOT MODIFY -- auto-generated by Apache Cordova\n' +
179
             '%s\n' +
178
             '%s\n' +
197
 
196
 
198
     if (typeof spec === 'string') {
197
     if (typeof spec === 'string') {
199
         if (spec.startsWith(':')) {
198
         if (spec.startsWith(':')) {
200
-            spec = { name: name, options: spec };
199
+            spec = { name, options: spec };
201
         } else {
200
         } else {
202
-            spec = { name: name, spec: spec };
201
+            spec = { name, spec };
203
         }
202
         }
204
     }
203
     }
205
 
204
 
262
     events.emit('verbose', util.format('Removed source line for `%s`', declaration));
261
     events.emit('verbose', util.format('Removed source line for `%s`', declaration));
263
 };
262
 };
264
 
263
 
265
-Podfile.proofDeclaration = function (declaration) {
266
-    var list = Object.keys(Podfile.declarationRegexpMap).filter(function (key) {
267
-        var regexp = new RegExp(Podfile.declarationRegexpMap[key]);
264
+Podfile.proofDeclaration = declaration => {
265
+    const list = Object.keys(Podfile.declarationRegexpMap).filter(key => {
266
+        const regexp = new RegExp(Podfile.declarationRegexpMap[key]);
268
         return regexp.test(declaration);
267
         return regexp.test(declaration);
269
     });
268
     });
270
     if (list.length > 0) {
269
     if (list.length > 0) {
290
 };
289
 };
291
 
290
 
292
 Podfile.prototype.write = function () {
291
 Podfile.prototype.write = function () {
293
-    var text = this.getTemplate();
294
-    var self = this;
292
+    let text = this.getTemplate();
295
 
293
 
296
-    var podsString =
297
-    Object.keys(this.pods).map(function (key) {
298
-        var name = key;
299
-        var json = self.pods[key];
294
+    const podsString =
295
+    Object.keys(this.pods).map(key => {
296
+        const name = key;
297
+        const json = this.pods[key];
300
 
298
 
301
         if (typeof json === 'string') { // compatibility for using framework tag.
299
         if (typeof json === 'string') { // compatibility for using framework tag.
302
-            var spec = json;
300
+            const spec = json;
303
             if (spec.length) {
301
             if (spec.length) {
304
                 if (spec.indexOf(':') === 0) {
302
                 if (spec.indexOf(':') === 0) {
305
                     // don't quote it, it's a specification (starts with ':')
303
                     // don't quote it, it's a specification (starts with ':')
312
                 return util.format('\tpod \'%s\'', name);
310
                 return util.format('\tpod \'%s\'', name);
313
             }
311
             }
314
         } else {
312
         } else {
315
-            var list = ['\'' + name + '\''];
313
+            const list = [`'${name}'`];
316
             if ('spec' in json && json.spec.length) {
314
             if ('spec' in json && json.spec.length) {
317
-                list.push('\'' + json.spec + '\'');
315
+                list.push(`'${json.spec}'`);
318
             }
316
             }
319
 
317
 
320
-            var options = ['tag', 'branch', 'commit', 'git', 'podspec'].filter(function (tag) {
321
-                return tag in json;
322
-            }).map(function (tag) {
323
-                return ':' + tag + ' => \'' + json[tag] + '\'';
324
-            });
318
+            let options = ['tag', 'branch', 'commit', 'git', 'podspec']
319
+                .filter(tag => tag in json)
320
+                .map(tag => `:${tag} => '${json[tag]}'`);
321
+
325
             if ('configurations' in json) {
322
             if ('configurations' in json) {
326
-                options.push(':configurations => [' + json['configurations'].split(',').map(function (conf) { return '\'' + conf.trim() + '\''; }).join(',') + ']');
323
+                options.push(`:configurations => [${json.configurations.split(',').map(conf => `'${conf.trim()}'`).join(',')}]`);
327
             }
324
             }
328
             if ('options' in json) {
325
             if ('options' in json) {
329
                 options = [json.options];
326
                 options = [json.options];
335
         }
332
         }
336
     }).join('\n');
333
     }).join('\n');
337
 
334
 
338
-    var sourcesString =
339
-    Object.keys(this.sources).map(function (key) {
340
-        var source = self.sources[key];
335
+    const sourcesString =
336
+    Object.keys(this.sources).map(key => {
337
+        const source = this.sources[key];
341
         return util.format('source \'%s\'', source);
338
         return util.format('source \'%s\'', source);
342
     }).join('\n');
339
     }).join('\n');
343
 
340
 
344
-    var declarationString =
345
-    Object.keys(this.declarations).map(function (key) {
346
-        var declaration = self.declarations[key];
341
+    const declarationString =
342
+    Object.keys(this.declarations).map(key => {
343
+        const declaration = this.declarations[key];
347
         return declaration;
344
         return declaration;
348
     }).join('\n');
345
     }).join('\n');
349
 
346
 
365
     toolOptions = toolOptions || {};
362
     toolOptions = toolOptions || {};
366
 
363
 
367
     // Template tokens in order: project name, project name, debug | release
364
     // Template tokens in order: project name, project name, debug | release
368
-    var template =
365
+    const template =
369
     '// DO NOT MODIFY -- auto-generated by Apache Cordova\n' +
366
     '// DO NOT MODIFY -- auto-generated by Apache Cordova\n' +
370
     '#include "Pods/Target Support Files/Pods-%s/Pods-%s.%s.xcconfig"';
367
     '#include "Pods/Target Support Files/Pods-%s/Pods-%s.%s.xcconfig"';
371
 
368
 
372
-    var debugContents = util.format(template, this.projectName, this.projectName, 'debug');
373
-    var releaseContents = util.format(template, this.projectName, this.projectName, 'release');
369
+    const debugContents = util.format(template, this.projectName, this.projectName, 'debug');
370
+    const releaseContents = util.format(template, this.projectName, this.projectName, 'release');
374
 
371
 
375
-    var debugConfigPath = path.join(this.path, '..', 'pods-debug.xcconfig');
376
-    var releaseConfigPath = path.join(this.path, '..', 'pods-release.xcconfig');
372
+    const debugConfigPath = path.join(this.path, '..', 'pods-debug.xcconfig');
373
+    const releaseConfigPath = path.join(this.path, '..', 'pods-release.xcconfig');
377
 
374
 
378
     fs.writeFileSync(debugConfigPath, debugContents, 'utf8');
375
     fs.writeFileSync(debugConfigPath, debugContents, 'utf8');
379
     fs.writeFileSync(releaseConfigPath, releaseContents, 'utf8');
376
     fs.writeFileSync(releaseConfigPath, releaseContents, 'utf8');
380
 
377
 
381
-    return Q.resolve(toolOptions);
378
+    return Promise.resolve(toolOptions);
382
 };
379
 };
383
 
380
 
384
 Podfile.prototype.install = function (requirementsCheckerFunction) {
381
 Podfile.prototype.install = function (requirementsCheckerFunction) {
385
-    var opts = {};
382
+    const opts = {};
386
     opts.cwd = path.join(this.path, '..'); // parent path of this Podfile
383
     opts.cwd = path.join(this.path, '..'); // parent path of this Podfile
387
     opts.stdio = 'pipe';
384
     opts.stdio = 'pipe';
388
     opts.printCommand = true;
385
     opts.printCommand = true;
389
-    var first = true;
390
-    var self = this;
386
+    let first = true;
391
 
387
 
392
     if (!requirementsCheckerFunction) {
388
     if (!requirementsCheckerFunction) {
393
-        requirementsCheckerFunction = Q();
389
+        requirementsCheckerFunction = Promise.resolve();
394
     }
390
     }
395
 
391
 
396
     return requirementsCheckerFunction()
392
     return requirementsCheckerFunction()
397
-        .then(function (toolOptions) {
398
-            return self.before_install(toolOptions);
399
-        })
400
-        .then(function (toolOptions) {
393
+        .then(toolOptions => this.before_install(toolOptions))
394
+        .then(toolOptions => {
401
             if (toolOptions.ignore) {
395
             if (toolOptions.ignore) {
402
                 events.emit('verbose', '==== pod install start ====\n');
396
                 events.emit('verbose', '==== pod install start ====\n');
403
                 events.emit('verbose', toolOptions.ignoreMessage);
397
                 events.emit('verbose', toolOptions.ignoreMessage);
404
-                return Q.resolve();
398
+                return Promise.resolve();
405
             } else {
399
             } else {
406
-                return superspawn.spawn('pod', ['install', '--verbose'], opts)
407
-                    .progress(function (stdio) {
400
+                return spawn('pod', ['install', '--verbose'], opts)
401
+                    .progress(stdio => {
408
                         if (stdio.stderr) { console.error(stdio.stderr); }
402
                         if (stdio.stderr) { console.error(stdio.stderr); }
409
                         if (stdio.stdout) {
403
                         if (stdio.stdout) {
410
                             if (first) {
404
                             if (first) {
416
                     });
410
                     });
417
             }
411
             }
418
         })
412
         })
419
-        .then(function () { // done
413
+        .then(() => { // done
420
             events.emit('verbose', '==== pod install end ====\n');
414
             events.emit('verbose', '==== pod install end ====\n');
421
         });
415
         });
422
 };
416
 };

+ 0
- 0
node_modules/cordova-ios/bin/templates/scripts/cordova/lib/PodsJson.js View File


Some files were not shown because too many files changed in this diff