Browse Source

[update] cordova

x 5 năm trước cách đây
mục cha
commit
719a6ff104
100 tập tin đã thay đổi với 3900 bổ sung715 xóa
  1. 2 2
      cordova/config.xml
  2. 12 0
      cordova/package-lock.json
  3. 7 3
      cordova/package.json
  4. 33 1
      cordova/platforms/android/android.json
  5. 10 4
      cordova/platforms/android/app/src/main/AndroidManifest.xml
  6. 52 322
      cordova/platforms/android/app/src/main/assets/www/cordova_plugins.js
  7. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/css/chunk-67403a84.f5661840.css
  8. 0 1
      cordova/platforms/android/app/src/main/assets/www/h5/css/chunk-7084196a.170f5b2b.css
  9. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/css/chunk-74098e3a.8e1d2dcd.css
  10. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/css/chunk-7baa1aee.ede0da9f.css
  11. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/css/chunk-e68a127e.d9b6e63f.css
  12. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/css/chunk-fef6604e.2610ba8b.css
  13. 0 1
      cordova/platforms/android/app/src/main/assets/www/h5/css/chunk-ff908aee.30674964.css
  14. 0 34
      cordova/platforms/android/app/src/main/assets/www/h5/img/addfont.b0456b6b.svg
  15. BIN
      cordova/platforms/android/app/src/main/assets/www/h5/img/promotionTitle.dcdb5bfc.png
  16. BIN
      cordova/platforms/android/app/src/main/assets/www/h5/img/value.7469f35b.jpg
  17. 0 2
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-074d26c0.b7533a88.js
  18. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-074d26c0.b7533a88.js.map
  19. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-0906bf72.2ddd9536.js
  20. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-0906bf72.2ddd9536.js.map
  21. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-146ed97a.aaabc1f2.js
  22. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-146ed97a.aaabc1f2.js.map
  23. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-21ac2098.367e0ecc.js
  24. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-21ac2098.367e0ecc.js.map
  25. 0 2
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-2d0c09da.7d267ed4.js
  26. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-2d0c09da.7d267ed4.js.map
  27. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-2d0d0177.f2e276bd.js
  28. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-2d0d0177.f2e276bd.js.map
  29. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-2d0f0b4a.0363b701.js
  30. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-2d0f0b4a.0363b701.js.map
  31. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-2d21f45b.0c032228.js
  32. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-2d21f45b.0c032228.js.map
  33. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-3643f29f.5af7a806.js
  34. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-3643f29f.5af7a806.js.map
  35. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-3f565f36.481b2a96.js
  36. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-3f565f36.481b2a96.js.map
  37. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-3f6145c4.1e3263c0.js
  38. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-3f6145c4.1e3263c0.js.map
  39. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-458d753c.bce8891e.js
  40. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-458d753c.bce8891e.js.map
  41. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-493fc81d.d5e08517.js
  42. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-493fc81d.d5e08517.js.map
  43. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-4d3f5c13.f53299e8.js
  44. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-4d3f5c13.f53299e8.js.map
  45. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-67403a84.a7f0dfc3.js
  46. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-67403a84.a7f0dfc3.js.map
  47. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-715c4f57.14c43a84.js
  48. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-715c4f57.14c43a84.js.map
  49. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-75c5e1c2.70f21a5f.js
  50. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-75c5e1c2.70f21a5f.js.map
  51. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-88554248.90328675.js
  52. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-88554248.90328675.js.map
  53. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-91acc388.86ab8419.js
  54. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-91acc388.86ab8419.js.map
  55. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-e68a127e.9fd4d540.js
  56. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-e68a127e.9fd4d540.js.map
  57. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-f776ae9e.8e5d30d4.js
  58. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-f776ae9e.8e5d30d4.js.map
  59. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-fef6604e.12636f63.js
  60. 0 0
      cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-fef6604e.12636f63.js.map
  61. 0 0
      cordova/platforms/android/app/src/main/assets/www/index.html
  62. 1548 0
      cordova/platforms/android/app/src/main/java/org/apache/cordova/inappbrowser/InAppBrowser.java
  63. 57 0
      cordova/platforms/android/app/src/main/java/org/apache/cordova/inappbrowser/InAppBrowserDialog.java
  64. 138 0
      cordova/platforms/android/app/src/main/java/org/apache/cordova/inappbrowser/InAppChromeClient.java
  65. 45 0
      cordova/platforms/android/app/src/main/java/uk/co/whiteoctober/cordova/AppVersion.java
  66. BIN
      cordova/platforms/android/app/src/main/res/drawable-hdpi/ic_action_next_item.png
  67. BIN
      cordova/platforms/android/app/src/main/res/drawable-hdpi/ic_action_previous_item.png
  68. BIN
      cordova/platforms/android/app/src/main/res/drawable-hdpi/ic_action_remove.png
  69. BIN
      cordova/platforms/android/app/src/main/res/drawable-mdpi/ic_action_next_item.png
  70. BIN
      cordova/platforms/android/app/src/main/res/drawable-mdpi/ic_action_previous_item.png
  71. BIN
      cordova/platforms/android/app/src/main/res/drawable-mdpi/ic_action_remove.png
  72. BIN
      cordova/platforms/android/app/src/main/res/drawable-xhdpi/ic_action_next_item.png
  73. BIN
      cordova/platforms/android/app/src/main/res/drawable-xhdpi/ic_action_previous_item.png
  74. BIN
      cordova/platforms/android/app/src/main/res/drawable-xhdpi/ic_action_remove.png
  75. BIN
      cordova/platforms/android/app/src/main/res/drawable-xxhdpi/ic_action_next_item.png
  76. BIN
      cordova/platforms/android/app/src/main/res/drawable-xxhdpi/ic_action_previous_item.png
  77. BIN
      cordova/platforms/android/app/src/main/res/drawable-xxhdpi/ic_action_remove.png
  78. 8 2
      cordova/platforms/android/app/src/main/res/xml/config.xml
  79. 52 322
      cordova/platforms/android/platform_www/cordova_plugins.js
  80. 2 2
      cordova/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/x.xcuserdatad/xcschemes/xcschememanagement.plist
  81. 33 1
      cordova/platforms/ios/ios.json
  82. 19 1
      cordova/platforms/ios/platform_www/cordova_plugins.js
  83. 30 0
      cordova/platforms/ios/美天旺.xcodeproj/project.pbxproj
  84. BIN
      cordova/platforms/ios/美天旺.xcworkspace/xcuserdata/x.xcuserdatad/UserInterfaceState.xcuserstate
  85. 1 3
      cordova/platforms/ios/美天旺/Entitlements-Debug.plist
  86. 1 3
      cordova/platforms/ios/美天旺/Entitlements-Release.plist
  87. 13 0
      cordova/platforms/ios/美天旺/Plugins/cordova-plugin-app-version/AppVersion.h
  88. 47 0
      cordova/platforms/ios/美天旺/Plugins/cordova-plugin-app-version/AppVersion.m
  89. 27 0
      cordova/platforms/ios/美天旺/Plugins/cordova-plugin-inappbrowser/CDVInAppBrowserNavigationController.h
  90. 63 0
      cordova/platforms/ios/美天旺/Plugins/cordova-plugin-inappbrowser/CDVInAppBrowserNavigationController.m
  91. 50 0
      cordova/platforms/ios/美天旺/Plugins/cordova-plugin-inappbrowser/CDVInAppBrowserOptions.h
  92. 90 0
      cordova/platforms/ios/美天旺/Plugins/cordova-plugin-inappbrowser/CDVInAppBrowserOptions.m
  93. 80 0
      cordova/platforms/ios/美天旺/Plugins/cordova-plugin-inappbrowser/CDVWKInAppBrowser.h
  94. 1261 0
      cordova/platforms/ios/美天旺/Plugins/cordova-plugin-inappbrowser/CDVWKInAppBrowser.m
  95. 32 0
      cordova/platforms/ios/美天旺/Plugins/cordova-plugin-inappbrowser/CDVWKInAppBrowserUIDelegate.h
  96. 127 0
      cordova/platforms/ios/美天旺/Plugins/cordova-plugin-inappbrowser/CDVWKInAppBrowserUIDelegate.m
  97. 10 7
      cordova/platforms/ios/美天旺/config.xml
  98. 2 2
      cordova/platforms/ios/美天旺/美天旺-Info.plist
  99. 6 0
      cordova/plugins/android.json
  100. 42 0
      cordova/plugins/cordova-plugin-app-version/CHANGELOG.md

+ 2 - 2
cordova/config.xml

@@ -1,10 +1,10 @@
 <?xml version='1.0' encoding='utf-8'?>
-<widget id="com.shotshock.twong" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
+<widget id="com.shotshock.twong" version="1.0.6" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
     <name>美天旺</name>
     <description>
         美天旺是完璧时空旗下新型垂直电商App,专注于新经济下的购物服务!
     </description>
-    <author email="dev@cordova.apache.org" href="http://cordova.io">
+    <author email="dev@shopshock.shop" href="http://www.shopshock.shop">
         twong Team
     </author>
     <content src="index.html" />

+ 12 - 0
cordova/package-lock.json

@@ -198,6 +198,12 @@
         }
       }
     },
+    "cordova-plugin-app-version": {
+      "version": "0.1.9",
+      "resolved": "https://registry.npm.taobao.org/cordova-plugin-app-version/download/cordova-plugin-app-version-0.1.9.tgz",
+      "integrity": "sha1-nbBgeGMzenEEiTAuX1CpBPFEm9s=",
+      "dev": true
+    },
     "cordova-plugin-customurlscheme": {
       "version": "5.0.2",
       "resolved": "https://registry.npm.taobao.org/cordova-plugin-customurlscheme/download/cordova-plugin-customurlscheme-5.0.2.tgz",
@@ -216,6 +222,12 @@
       "integrity": "sha1-JXOduEHSIQbdzSan3igpOFx/M4I=",
       "dev": true
     },
+    "cordova-plugin-inappbrowser": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npm.taobao.org/cordova-plugin-inappbrowser/download/cordova-plugin-inappbrowser-4.0.0.tgz",
+      "integrity": "sha1-CB4SWz7OBeMN0A5fk5YWCSaDKio=",
+      "dev": true
+    },
     "cordova-plugin-jcore": {
       "version": "1.3.3",
       "resolved": "https://registry.npm.taobao.org/cordova-plugin-jcore/download/cordova-plugin-jcore-1.3.3.tgz",

+ 7 - 3
cordova/package.json

@@ -1,7 +1,7 @@
 {
   "name": "com.shotshock.twong",
-  "displayName": "HelloCordova",
-  "version": "1.0.0",
+  "displayName": "美天旺",
+  "version": "1.6.0",
   "description": "A sample Apache Cordova application that responds to the deviceready event.",
   "main": "index.js",
   "scripts": {
@@ -15,9 +15,11 @@
   "devDependencies": {
     "cordova-android": "^9.0.0",
     "cordova-ios": "^6.1.1",
+    "cordova-plugin-app-version": "^0.1.9",
     "cordova-plugin-customurlscheme": "^5.0.2",
     "cordova-plugin-device": "^2.0.3",
     "cordova-plugin-fullscreen": "^1.3.0",
+    "cordova-plugin-inappbrowser": "^4.0.0",
     "cordova-plugin-jcore": "^1.3.3",
     "cordova-plugin-statusbar": "^2.4.3",
     "cordova-plugin-wechat": "git+https://github.com/xu-li/cordova-plugin-wechat.git#develop",
@@ -42,7 +44,9 @@
         "ANDROID_PATHPREFIX": "/open"
       },
       "cordova-plugin-fullscreen": {},
-      "cordova-plugin-statusbar": {}
+      "cordova-plugin-statusbar": {},
+      "cordova-plugin-inappbrowser": {},
+      "cordova-plugin-app-version": {}
     },
     "platforms": [
       "android",

+ 33 - 1
cordova/platforms/android/android.json

@@ -39,6 +39,14 @@
             {
               "xml": "<feature name=\"StatusBar\"><param name=\"android-package\" value=\"org.apache.cordova.statusbar.StatusBar\" /><param name=\"onload\" value=\"true\" /></feature>",
               "count": 1
+            },
+            {
+              "xml": "<feature name=\"InAppBrowser\"><param name=\"android-package\" value=\"org.apache.cordova.inappbrowser.InAppBrowser\" /></feature>",
+              "count": 1
+            },
+            {
+              "xml": "<feature name=\"AppVersion\"><param name=\"android-package\" value=\"uk.co.whiteoctober.cordova.AppVersion\" /></feature>",
+              "count": 1
             }
           ],
           "/widget": []
@@ -275,6 +283,12 @@
     },
     "cordova-plugin-statusbar": {
       "PACKAGE_NAME": "com.shotshock.twong"
+    },
+    "cordova-plugin-inappbrowser": {
+      "PACKAGE_NAME": "com.shotshock.twong"
+    },
+    "cordova-plugin-app-version": {
+      "PACKAGE_NAME": "com.shotshock.twong"
     }
   },
   "dependent_plugins": {},
@@ -326,6 +340,22 @@
       "clobbers": [
         "window.StatusBar"
       ]
+    },
+    {
+      "id": "cordova-plugin-inappbrowser.inappbrowser",
+      "file": "plugins/cordova-plugin-inappbrowser/www/inappbrowser.js",
+      "pluginId": "cordova-plugin-inappbrowser",
+      "clobbers": [
+        "cordova.InAppBrowser.open"
+      ]
+    },
+    {
+      "id": "cordova-plugin-app-version.AppVersionPlugin",
+      "file": "plugins/cordova-plugin-app-version/www/AppVersionPlugin.js",
+      "pluginId": "cordova-plugin-app-version",
+      "clobbers": [
+        "cordova.getAppVersion"
+      ]
     }
   ],
   "plugin_metadata": {
@@ -336,6 +366,8 @@
     "cordova-plugin-wechat": "3.0.0",
     "cordova-plugin-customurlscheme": "5.0.2",
     "cordova-plugin-fullscreen": "1.3.0",
-    "cordova-plugin-statusbar": "2.4.3"
+    "cordova-plugin-statusbar": "2.4.3",
+    "cordova-plugin-inappbrowser": "4.0.0",
+    "cordova-plugin-app-version": "0.1.9"
   }
 }

+ 10 - 4
cordova/platforms/android/app/src/main/AndroidManifest.xml

@@ -1,8 +1,8 @@
 <?xml version='1.0' encoding='utf-8'?>
-<manifest android:hardwareAccelerated="true" android:versionCode="10000" android:versionName="1.0.0" package="com.shotshock.twong" xmlns:android="http://schemas.android.com/apk/res/android">
+<manifest android:hardwareAccelerated="true" android:versionCode="10006" android:versionName="1.0.6" package="com.shotshock.twong" xmlns:android="http://schemas.android.com/apk/res/android">
     <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
     <uses-permission android:name="android.permission.INTERNET" />
-    <application android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true">
+    <application android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:usesCleartextTraffic="true">
         <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
             <intent-filter android:label="@string/launcher_name">
                 <action android:name="android.intent.action.MAIN" />
@@ -12,13 +12,13 @@
                 <action android:name="android.intent.action.VIEW" />
                 <category android:name="android.intent.category.DEFAULT" />
                 <category android:name="android.intent.category.BROWSABLE" />
-                <data android:scheme="app" />
+                <data android:scheme="twong" />
             </intent-filter>
             <intent-filter>
                 <action android:name="android.intent.action.VIEW" />
                 <category android:name="android.intent.category.DEFAULT" />
                 <category android:name="android.intent.category.BROWSABLE" />
-                <data android:host="twong.com" android:pathPrefix="/open" android:scheme="app" />
+                <data android:host="www.shotshock.shop" android:pathPrefix="/open" android:scheme="twong" />
             </intent-filter>
             <intent-filter>
                 <action android:name="android.intent.action.VIEW" />
@@ -26,6 +26,12 @@
                 <category android:name="android.intent.category.BROWSABLE" />
                 <data android:host=" " android:pathPrefix="/" android:scheme=" " />
             </intent-filter>
+            <intent-filter>
+                <action android:name="android.intent.action.VIEW" />
+                <category android:name="android.intent.category.DEFAULT" />
+                <category android:name="android.intent.category.BROWSABLE" />
+                <data android:scheme="app" />
+            </intent-filter>
         </activity>
         <activity android:exported="false" android:name="cn.jpush.android.ui.PopWinActivity" android:theme="@style/MyDialogStyle" />
         <activity android:configChanges="orientation|keyboardHidden" android:exported="false" android:name="cn.jpush.android.ui.PushActivity" android:theme="@android:style/Theme.NoTitleBar">

+ 52 - 322
cordova/platforms/android/app/src/main/assets/www/cordova_plugins.js

@@ -1,334 +1,68 @@
-cordova.define("cordova/plugin_list", function(require, exports, module) {
+cordova.define('cordova/plugin_list', function(require, exports, module) {
   module.exports = [
     {
-      id: "cordova-plugin-device.device",
-      file: "plugins/cordova-plugin-device/www/device.js",
-      pluginId: "cordova-plugin-device",
-      clobbers: ["device"]
+      "id": "cordova-plugin-device.device",
+      "file": "plugins/cordova-plugin-device/www/device.js",
+      "pluginId": "cordova-plugin-device",
+      "clobbers": [
+        "device"
+      ]
     },
     {
-      id: "jpush-phonegap-plugin.JPushPlugin",
-      file: "plugins/jpush-phonegap-plugin/www/JPushPlugin.js",
-      pluginId: "jpush-phonegap-plugin",
-      clobbers: ["JPush"]
+      "id": "jpush-phonegap-plugin.JPushPlugin",
+      "file": "plugins/jpush-phonegap-plugin/www/JPushPlugin.js",
+      "pluginId": "jpush-phonegap-plugin",
+      "clobbers": [
+        "JPush"
+      ]
     },
     {
-      id: "cordova-plugin-wechat.Wechat",
-      file: "plugins/cordova-plugin-wechat/www/wechat.js",
-      pluginId: "cordova-plugin-wechat",
-      clobbers: ["Wechat"]
+      "id": "cordova-plugin-wechat.Wechat",
+      "file": "plugins/cordova-plugin-wechat/www/wechat.js",
+      "pluginId": "cordova-plugin-wechat",
+      "clobbers": [
+        "Wechat"
+      ]
     },
     {
-      id: "cordova-plugin-customurlscheme.LaunchMyApp",
-      file: "plugins/cordova-plugin-customurlscheme/www/android/LaunchMyApp.js",
-      pluginId: "cordova-plugin-customurlscheme",
-      clobbers: ["window.plugins.launchmyapp"]
+      "id": "cordova-plugin-customurlscheme.LaunchMyApp",
+      "file": "plugins/cordova-plugin-customurlscheme/www/android/LaunchMyApp.js",
+      "pluginId": "cordova-plugin-customurlscheme",
+      "clobbers": [
+        "window.plugins.launchmyapp"
+      ]
     },
     {
-      id: "cordova-plugin-fullscreen.AndroidFullScreen",
-      file: "plugins/cordova-plugin-fullscreen/www/AndroidFullScreen.js",
-      pluginId: "cordova-plugin-fullscreen",
-      clobbers: ["AndroidFullScreen"]
+      "id": "cordova-plugin-fullscreen.AndroidFullScreen",
+      "file": "plugins/cordova-plugin-fullscreen/www/AndroidFullScreen.js",
+      "pluginId": "cordova-plugin-fullscreen",
+      "clobbers": [
+        "AndroidFullScreen"
+      ]
     },
     {
-      id: "cordova-plugin-statusbar.statusbar",
-      file: "plugins/cordova-plugin-statusbar/www/statusbar.js",
-      pluginId: "cordova-plugin-statusbar",
-      clobbers: ["window.StatusBar"]
+      "id": "cordova-plugin-statusbar.statusbar",
+      "file": "plugins/cordova-plugin-statusbar/www/statusbar.js",
+      "pluginId": "cordova-plugin-statusbar",
+      "clobbers": [
+        "window.StatusBar"
+      ]
     },
     {
-      id: "code-push.AcquisitionManager",
-      file: "plugins/code-push/script/acquisition-sdk.js",
-      pluginId: "code-push",
-      merges: ["window"]
+      "id": "cordova-plugin-inappbrowser.inappbrowser",
+      "file": "plugins/cordova-plugin-inappbrowser/www/inappbrowser.js",
+      "pluginId": "cordova-plugin-inappbrowser",
+      "clobbers": [
+        "cordova.InAppBrowser.open"
+      ]
     },
     {
-      id: "cordova-plugin-dialogs.notification",
-      file: "plugins/cordova-plugin-dialogs/www/notification.js",
-      pluginId: "cordova-plugin-dialogs",
-      merges: ["navigator.notification"]
-    },
-    {
-      id: "cordova-plugin-dialogs.notification_android",
-      file: "plugins/cordova-plugin-dialogs/www/android/notification.js",
-      pluginId: "cordova-plugin-dialogs",
-      merges: ["navigator.notification"]
-    },
-    {
-      id: "cordova-plugin-file.DirectoryEntry",
-      file: "plugins/cordova-plugin-file/www/DirectoryEntry.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.DirectoryEntry"]
-    },
-    {
-      id: "cordova-plugin-file.DirectoryReader",
-      file: "plugins/cordova-plugin-file/www/DirectoryReader.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.DirectoryReader"]
-    },
-    {
-      id: "cordova-plugin-file.Entry",
-      file: "plugins/cordova-plugin-file/www/Entry.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.Entry"]
-    },
-    {
-      id: "cordova-plugin-file.File",
-      file: "plugins/cordova-plugin-file/www/File.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.File"]
-    },
-    {
-      id: "cordova-plugin-file.FileEntry",
-      file: "plugins/cordova-plugin-file/www/FileEntry.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.FileEntry"]
-    },
-    {
-      id: "cordova-plugin-file.FileError",
-      file: "plugins/cordova-plugin-file/www/FileError.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.FileError"]
-    },
-    {
-      id: "cordova-plugin-file.FileReader",
-      file: "plugins/cordova-plugin-file/www/FileReader.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.FileReader"]
-    },
-    {
-      id: "cordova-plugin-file.FileSystem",
-      file: "plugins/cordova-plugin-file/www/FileSystem.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.FileSystem"]
-    },
-    {
-      id: "cordova-plugin-file.FileUploadOptions",
-      file: "plugins/cordova-plugin-file/www/FileUploadOptions.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.FileUploadOptions"]
-    },
-    {
-      id: "cordova-plugin-file.FileUploadResult",
-      file: "plugins/cordova-plugin-file/www/FileUploadResult.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.FileUploadResult"]
-    },
-    {
-      id: "cordova-plugin-file.FileWriter",
-      file: "plugins/cordova-plugin-file/www/FileWriter.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.FileWriter"]
-    },
-    {
-      id: "cordova-plugin-file.Flags",
-      file: "plugins/cordova-plugin-file/www/Flags.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.Flags"]
-    },
-    {
-      id: "cordova-plugin-file.LocalFileSystem",
-      file: "plugins/cordova-plugin-file/www/LocalFileSystem.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.LocalFileSystem"],
-      merges: ["window"]
-    },
-    {
-      id: "cordova-plugin-file.Metadata",
-      file: "plugins/cordova-plugin-file/www/Metadata.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.Metadata"]
-    },
-    {
-      id: "cordova-plugin-file.ProgressEvent",
-      file: "plugins/cordova-plugin-file/www/ProgressEvent.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.ProgressEvent"]
-    },
-    {
-      id: "cordova-plugin-file.fileSystems",
-      file: "plugins/cordova-plugin-file/www/fileSystems.js",
-      pluginId: "cordova-plugin-file"
-    },
-    {
-      id: "cordova-plugin-file.requestFileSystem",
-      file: "plugins/cordova-plugin-file/www/requestFileSystem.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.requestFileSystem"]
-    },
-    {
-      id: "cordova-plugin-file.resolveLocalFileSystemURI",
-      file: "plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js",
-      pluginId: "cordova-plugin-file",
-      merges: ["window"]
-    },
-    {
-      id: "cordova-plugin-file.isChrome",
-      file: "plugins/cordova-plugin-file/www/browser/isChrome.js",
-      pluginId: "cordova-plugin-file",
-      runs: true
-    },
-    {
-      id: "cordova-plugin-file.androidFileSystem",
-      file: "plugins/cordova-plugin-file/www/android/FileSystem.js",
-      pluginId: "cordova-plugin-file",
-      merges: ["FileSystem"]
-    },
-    {
-      id: "cordova-plugin-file.fileSystems-roots",
-      file: "plugins/cordova-plugin-file/www/fileSystems-roots.js",
-      pluginId: "cordova-plugin-file",
-      runs: true
-    },
-    {
-      id: "cordova-plugin-file.fileSystemPaths",
-      file: "plugins/cordova-plugin-file/www/fileSystemPaths.js",
-      pluginId: "cordova-plugin-file",
-      merges: ["cordova"],
-      runs: true
-    },
-    {
-      id: "cordova-plugin-advanced-http.cookie-handler",
-      file: "plugins/cordova-plugin-advanced-http/www/cookie-handler.js",
-      pluginId: "cordova-plugin-advanced-http"
-    },
-    {
-      id: "cordova-plugin-advanced-http.dependency-validator",
-      file: "plugins/cordova-plugin-advanced-http/www/dependency-validator.js",
-      pluginId: "cordova-plugin-advanced-http"
-    },
-    {
-      id: "cordova-plugin-advanced-http.error-codes",
-      file: "plugins/cordova-plugin-advanced-http/www/error-codes.js",
-      pluginId: "cordova-plugin-advanced-http"
-    },
-    {
-      id: "cordova-plugin-advanced-http.global-configs",
-      file: "plugins/cordova-plugin-advanced-http/www/global-configs.js",
-      pluginId: "cordova-plugin-advanced-http"
-    },
-    {
-      id: "cordova-plugin-advanced-http.helpers",
-      file: "plugins/cordova-plugin-advanced-http/www/helpers.js",
-      pluginId: "cordova-plugin-advanced-http"
-    },
-    {
-      id: "cordova-plugin-advanced-http.js-util",
-      file: "plugins/cordova-plugin-advanced-http/www/js-util.js",
-      pluginId: "cordova-plugin-advanced-http"
-    },
-    {
-      id: "cordova-plugin-advanced-http.local-storage-store",
-      file: "plugins/cordova-plugin-advanced-http/www/local-storage-store.js",
-      pluginId: "cordova-plugin-advanced-http"
-    },
-    {
-      id: "cordova-plugin-advanced-http.lodash",
-      file: "plugins/cordova-plugin-advanced-http/www/lodash.js",
-      pluginId: "cordova-plugin-advanced-http"
-    },
-    {
-      id: "cordova-plugin-advanced-http.messages",
-      file: "plugins/cordova-plugin-advanced-http/www/messages.js",
-      pluginId: "cordova-plugin-advanced-http"
-    },
-    {
-      id: "cordova-plugin-advanced-http.ponyfills",
-      file: "plugins/cordova-plugin-advanced-http/www/ponyfills.js",
-      pluginId: "cordova-plugin-advanced-http"
-    },
-    {
-      id: "cordova-plugin-advanced-http.public-interface",
-      file: "plugins/cordova-plugin-advanced-http/www/public-interface.js",
-      pluginId: "cordova-plugin-advanced-http"
-    },
-    {
-      id: "cordova-plugin-advanced-http.tough-cookie",
-      file: "plugins/cordova-plugin-advanced-http/www/umd-tough-cookie.js",
-      pluginId: "cordova-plugin-advanced-http"
-    },
-    {
-      id: "cordova-plugin-advanced-http.url-util",
-      file: "plugins/cordova-plugin-advanced-http/www/url-util.js",
-      pluginId: "cordova-plugin-advanced-http"
-    },
-    {
-      id: "cordova-plugin-advanced-http.http",
-      file: "plugins/cordova-plugin-advanced-http/www/advanced-http.js",
-      pluginId: "cordova-plugin-advanced-http",
-      clobbers: ["cordova.plugin.http"]
-    },
-    {
-      id: "cordova-plugin-zip.Zip",
-      file: "plugins/cordova-plugin-zip/zip.js",
-      pluginId: "cordova-plugin-zip",
-      clobbers: ["zip"]
-    },
-    {
-      id: "cordova-plugin-code-push.codePush",
-      file: "plugins/cordova-plugin-code-push/bin/www/codePush.js",
-      pluginId: "cordova-plugin-code-push",
-      clobbers: ["codePush"]
-    },
-    {
-      id: "cordova-plugin-code-push.localPackage",
-      file: "plugins/cordova-plugin-code-push/bin/www/localPackage.js",
-      pluginId: "cordova-plugin-code-push",
-      clobbers: ["LocalPackage"]
-    },
-    {
-      id: "cordova-plugin-code-push.remotePackage",
-      file: "plugins/cordova-plugin-code-push/bin/www/remotePackage.js",
-      pluginId: "cordova-plugin-code-push",
-      clobbers: ["RemotePackage"]
-    },
-    {
-      id: "cordova-plugin-code-push.syncStatus",
-      file: "plugins/cordova-plugin-code-push/bin/www/syncStatus.js",
-      pluginId: "cordova-plugin-code-push",
-      clobbers: ["SyncStatus"]
-    },
-    {
-      id: "cordova-plugin-code-push.installMode",
-      file: "plugins/cordova-plugin-code-push/bin/www/installMode.js",
-      pluginId: "cordova-plugin-code-push",
-      clobbers: ["InstallMode"]
-    },
-    {
-      id: "cordova-plugin-code-push.codePushUtil",
-      file: "plugins/cordova-plugin-code-push/bin/www/codePushUtil.js",
-      pluginId: "cordova-plugin-code-push",
-      runs: true
-    },
-    {
-      id: "cordova-plugin-code-push.fileUtil",
-      file: "plugins/cordova-plugin-code-push/bin/www/fileUtil.js",
-      pluginId: "cordova-plugin-code-push",
-      runs: true
-    },
-    {
-      id: "cordova-plugin-code-push.httpRequester",
-      file: "plugins/cordova-plugin-code-push/bin/www/httpRequester.js",
-      pluginId: "cordova-plugin-code-push",
-      runs: true
-    },
-    {
-      id: "cordova-plugin-code-push.nativeAppInfo",
-      file: "plugins/cordova-plugin-code-push/bin/www/nativeAppInfo.js",
-      pluginId: "cordova-plugin-code-push",
-      runs: true
-    },
-    {
-      id: "cordova-plugin-code-push.package",
-      file: "plugins/cordova-plugin-code-push/bin/www/package.js",
-      pluginId: "cordova-plugin-code-push",
-      runs: true
-    },
-    {
-      id: "cordova-plugin-code-push.sdk",
-      file: "plugins/cordova-plugin-code-push/bin/www/sdk.js",
-      pluginId: "cordova-plugin-code-push",
-      runs: true
+      "id": "cordova-plugin-app-version.AppVersionPlugin",
+      "file": "plugins/cordova-plugin-app-version/www/AppVersionPlugin.js",
+      "pluginId": "cordova-plugin-app-version",
+      "clobbers": [
+        "cordova.getAppVersion"
+      ]
     }
   ];
   module.exports.metadata = {
@@ -340,11 +74,7 @@ cordova.define("cordova/plugin_list", function(require, exports, module) {
     "cordova-plugin-customurlscheme": "5.0.2",
     "cordova-plugin-fullscreen": "1.3.0",
     "cordova-plugin-statusbar": "2.4.3",
-    "code-push": "3.0.1",
-    "cordova-plugin-dialogs": "2.0.2",
-    "cordova-plugin-file": "6.0.2",
-    "cordova-plugin-advanced-http": "3.0.1",
-    "cordova-plugin-zip": "3.1.0",
-    "cordova-plugin-code-push": "1.13.1"
+    "cordova-plugin-inappbrowser": "4.0.0",
+    "cordova-plugin-app-version": "0.1.9"
   };
-});
+});

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/css/chunk-67403a84.f5661840.css


+ 0 - 1
cordova/platforms/android/app/src/main/assets/www/h5/css/chunk-7084196a.170f5b2b.css

@@ -1 +0,0 @@
-.evaluate-con .score .textarea .list .pictrue.uploadBnt[data-v-91b929f0]{border:1px solid #ddd}

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/css/chunk-74098e3a.8e1d2dcd.css


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/css/chunk-7baa1aee.ede0da9f.css


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/css/chunk-e68a127e.d9b6e63f.css


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/css/chunk-fef6604e.2610ba8b.css


+ 0 - 1
cordova/platforms/android/app/src/main/assets/www/h5/css/chunk-ff908aee.30674964.css

@@ -1 +0,0 @@
-.preserve{color:#fff;text-align:center;margin-top:.2rem}.preserve .line{width:1rem;height:.01rem;background-color:#fff}.preserve .tip{margin:0 .3rem}

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 34
cordova/platforms/android/app/src/main/assets/www/h5/img/addfont.b0456b6b.svg


BIN
cordova/platforms/android/app/src/main/assets/www/h5/img/promotionTitle.dcdb5bfc.png


BIN
cordova/platforms/android/app/src/main/assets/www/h5/img/value.7469f35b.jpg


+ 0 - 2
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-074d26c0.b7533a88.js

@@ -1,2 +0,0 @@
-(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-074d26c0"],{2564:function(t,n,e){t.exports=e.p+"h5/img/examine.70b662a8.png"},3717:function(t,n,e){"use strict";e.r(n);var s=function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("div",{staticClass:"cash-audit"},[t._m(0),e("div",{staticClass:"tip"},[t._v("提现申请已提交,等待人工审核")]),e("div",{staticClass:"time"},[t._v(t._s(t.time))]),e("div",{staticClass:"bnt bg-color-red",on:{click:function(n){return t.$router.push({path:"/user/user_promotion"})}}},[t._v("\n    好的\n  ")])])},i=[function(){var t=this,n=t.$createElement,s=t._self._c||n;return s("div",{staticClass:"pictrue"},[s("img",{attrs:{src:e("2564")}})])}],a={name:"CashAudit",components:{},props:{},data:function(){return{time:""}},mounted:function(){var t=new Date;this.time=t.toLocaleString()},methods:{}},c=a,r=e("2877"),o=Object(r["a"])(c,s,i,!1,null,null,null);n["default"]=o.exports}}]);
-//# sourceMappingURL=chunk-074d26c0.b7533a88.js.map

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-074d26c0.b7533a88.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-0906bf72.2ddd9536.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-0906bf72.2ddd9536.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-146ed97a.aaabc1f2.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-146ed97a.aaabc1f2.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-21ac2098.367e0ecc.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-21ac2098.367e0ecc.js.map


+ 0 - 2
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-2d0c09da.7d267ed4.js

@@ -1,2 +0,0 @@
-(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0c09da"],{4316:function(t,i,a){"use strict";a.r(i);var e=function(){var t=this,i=t.$createElement,a=t._self._c||i;return a("div",{staticClass:"payment-status"},[t.orderInfo.paid||"offline"==t.orderInfo.pay_type?a("div",{staticClass:"iconfont icon-duihao2 bg-color-red"}):a("div",{staticClass:"iconfont icon-iconfontguanbi fail"}),!t.isWeixin&&"weixin"==t.orderInfo.pay_type||"offline"==t.orderInfo.pay_type?a("div",{staticClass:"status"},[t._v("\n    订单支付成功\n  ")]):t._e(),t._m(0),a("div",{staticClass:"returnBnt bg-color-red"},[t._v("返回查看订单")]),a("div",{staticClass:"returnBnt cart-color"},[t._v("返回首页")])])},s=[function(){var t=this,i=t.$createElement,a=t._self._c||i;return a("div",{staticClass:"wrapper"},[a("div",{staticClass:"item acea-row row-between-wrapper"},[a("div",[t._v("订单编号")]),a("div",{staticClass:"itemCom"},[t._v("wx3265361456134568")])]),a("div",{staticClass:"item acea-row row-between-wrapper"},[a("div",[t._v("下单时间")]),a("div",{staticClass:"itemCom"},[t._v("2019-01-09 18:05")])]),a("div",{staticClass:"item acea-row row-between-wrapper"},[a("div",[t._v("支付方式")]),a("div",{staticClass:"itemCom"},[t._v("微信支付")])]),a("div",{staticClass:"item acea-row row-between-wrapper"},[a("div",[t._v("支付金额")]),a("div",{staticClass:"itemCom"},[t._v("2222.00")])])])}],r=a("2877"),n={},o=Object(r["a"])(n,e,s,!1,null,null,null);i["default"]=o.exports}}]);
-//# sourceMappingURL=chunk-2d0c09da.7d267ed4.js.map

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-2d0c09da.7d267ed4.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-2d0d0177.f2e276bd.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-2d0d0177.f2e276bd.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-2d0f0b4a.0363b701.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-2d0f0b4a.0363b701.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-2d21f45b.0c032228.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-2d21f45b.0c032228.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-3643f29f.5af7a806.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-3643f29f.5af7a806.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-3f565f36.481b2a96.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-3f565f36.481b2a96.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-3f6145c4.1e3263c0.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-3f6145c4.1e3263c0.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-458d753c.bce8891e.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-458d753c.bce8891e.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-493fc81d.d5e08517.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-493fc81d.d5e08517.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-4d3f5c13.f53299e8.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-4d3f5c13.f53299e8.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-67403a84.a7f0dfc3.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-67403a84.a7f0dfc3.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-715c4f57.14c43a84.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-715c4f57.14c43a84.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-75c5e1c2.70f21a5f.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-75c5e1c2.70f21a5f.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-88554248.90328675.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-88554248.90328675.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-91acc388.86ab8419.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-91acc388.86ab8419.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-e68a127e.9fd4d540.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-e68a127e.9fd4d540.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-f776ae9e.8e5d30d4.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-f776ae9e.8e5d30d4.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-fef6604e.12636f63.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/h5/js/chunk-fef6604e.12636f63.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
cordova/platforms/android/app/src/main/assets/www/index.html


+ 1548 - 0
cordova/platforms/android/app/src/main/java/org/apache/cordova/inappbrowser/InAppBrowser.java

@@ -0,0 +1,1548 @@
+/*
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+*/
+package org.apache.cordova.inappbrowser;
+
+import android.annotation.SuppressLint;
+import android.annotation.TargetApi;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.os.Parcelable;
+import android.provider.Browser;
+import android.content.res.Resources;
+import android.graphics.Bitmap;
+import android.graphics.drawable.Drawable;
+import android.graphics.PorterDuff;
+import android.graphics.PorterDuffColorFilter;
+import android.graphics.Color;
+import android.net.http.SslError;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Bundle;
+import android.text.InputType;
+import android.util.TypedValue;
+import android.view.Gravity;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.Window;
+import android.view.WindowManager;
+import android.view.WindowManager.LayoutParams;
+import android.view.inputmethod.EditorInfo;
+import android.view.inputmethod.InputMethodManager;
+import android.webkit.CookieManager;
+import android.webkit.CookieSyncManager;
+import android.webkit.HttpAuthHandler;
+import android.webkit.JavascriptInterface;
+import android.webkit.SslErrorHandler;
+import android.webkit.ValueCallback;
+import android.webkit.WebChromeClient;
+import android.webkit.WebResourceRequest;
+import android.webkit.WebResourceResponse;
+import android.webkit.WebSettings;
+import android.webkit.WebView;
+import android.webkit.WebViewClient;
+import android.widget.EditText;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import org.apache.cordova.CallbackContext;
+import org.apache.cordova.Config;
+import org.apache.cordova.CordovaArgs;
+import org.apache.cordova.CordovaHttpAuthHandler;
+import org.apache.cordova.CordovaPlugin;
+import org.apache.cordova.CordovaWebView;
+import org.apache.cordova.LOG;
+import org.apache.cordova.PluginManager;
+import org.apache.cordova.PluginResult;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.HashMap;
+import java.util.StringTokenizer;
+
+@SuppressLint("SetJavaScriptEnabled")
+public class InAppBrowser extends CordovaPlugin {
+
+    private static final String NULL = "null";
+    protected static final String LOG_TAG = "InAppBrowser";
+    private static final String SELF = "_self";
+    private static final String SYSTEM = "_system";
+    private static final String EXIT_EVENT = "exit";
+    private static final String LOCATION = "location";
+    private static final String ZOOM = "zoom";
+    private static final String HIDDEN = "hidden";
+    private static final String LOAD_START_EVENT = "loadstart";
+    private static final String LOAD_STOP_EVENT = "loadstop";
+    private static final String LOAD_ERROR_EVENT = "loaderror";
+    private static final String MESSAGE_EVENT = "message";
+    private static final String CLEAR_ALL_CACHE = "clearcache";
+    private static final String CLEAR_SESSION_CACHE = "clearsessioncache";
+    private static final String HARDWARE_BACK_BUTTON = "hardwareback";
+    private static final String MEDIA_PLAYBACK_REQUIRES_USER_ACTION = "mediaPlaybackRequiresUserAction";
+    private static final String SHOULD_PAUSE = "shouldPauseOnSuspend";
+    private static final Boolean DEFAULT_HARDWARE_BACK = true;
+    private static final String USER_WIDE_VIEW_PORT = "useWideViewPort";
+    private static final String TOOLBAR_COLOR = "toolbarcolor";
+    private static final String CLOSE_BUTTON_CAPTION = "closebuttoncaption";
+    private static final String CLOSE_BUTTON_COLOR = "closebuttoncolor";
+    private static final String LEFT_TO_RIGHT = "lefttoright";
+    private static final String HIDE_NAVIGATION = "hidenavigationbuttons";
+    private static final String NAVIGATION_COLOR = "navigationbuttoncolor";
+    private static final String HIDE_URL = "hideurlbar";
+    private static final String FOOTER = "footer";
+    private static final String FOOTER_COLOR = "footercolor";
+    private static final String BEFORELOAD = "beforeload";
+    private static final String FULLSCREEN = "fullscreen";
+
+    private static final List customizableOptions = Arrays.asList(CLOSE_BUTTON_CAPTION, TOOLBAR_COLOR, NAVIGATION_COLOR, CLOSE_BUTTON_COLOR, FOOTER_COLOR);
+
+    private InAppBrowserDialog dialog;
+    private WebView inAppWebView;
+    private EditText edittext;
+    private CallbackContext callbackContext;
+    private boolean showLocationBar = true;
+    private boolean showZoomControls = true;
+    private boolean openWindowHidden = false;
+    private boolean clearAllCache = false;
+    private boolean clearSessionCache = false;
+    private boolean hadwareBackButton = true;
+    private boolean mediaPlaybackRequiresUserGesture = false;
+    private boolean shouldPauseInAppBrowser = false;
+    private boolean useWideViewPort = true;
+    private ValueCallback<Uri> mUploadCallback;
+    private ValueCallback<Uri[]> mUploadCallbackLollipop;
+    private final static int FILECHOOSER_REQUESTCODE = 1;
+    private final static int FILECHOOSER_REQUESTCODE_LOLLIPOP = 2;
+    private String closeButtonCaption = "";
+    private String closeButtonColor = "";
+    private boolean leftToRight = false;
+    private int toolbarColor = android.graphics.Color.LTGRAY;
+    private boolean hideNavigationButtons = false;
+    private String navigationButtonColor = "";
+    private boolean hideUrlBar = false;
+    private boolean showFooter = false;
+    private String footerColor = "";
+    private String beforeload = "";
+    private boolean fullscreen = true;
+    private String[] allowedSchemes;
+    private InAppBrowserClient currentClient;
+
+    /**
+     * Executes the request and returns PluginResult.
+     *
+     * @param action the action to execute.
+     * @param args JSONArry of arguments for the plugin.
+     * @param callbackContext the callbackContext used when calling back into JavaScript.
+     * @return A PluginResult object with a status and message.
+     */
+    public boolean execute(String action, CordovaArgs args, final CallbackContext callbackContext) throws JSONException {
+        if (action.equals("open")) {
+            this.callbackContext = callbackContext;
+            final String url = args.getString(0);
+            String t = args.optString(1);
+            if (t == null || t.equals("") || t.equals(NULL)) {
+                t = SELF;
+            }
+            final String target = t;
+            final HashMap<String, String> features = parseFeature(args.optString(2));
+
+            LOG.d(LOG_TAG, "target = " + target);
+
+            this.cordova.getActivity().runOnUiThread(new Runnable() {
+                @Override
+                public void run() {
+                    String result = "";
+                    // SELF
+                    if (SELF.equals(target)) {
+                        LOG.d(LOG_TAG, "in self");
+                        /* This code exists for compatibility between 3.x and 4.x versions of Cordova.
+                         * Previously the Config class had a static method, isUrlWhitelisted(). That
+                         * responsibility has been moved to the plugins, with an aggregating method in
+                         * PluginManager.
+                         */
+                        Boolean shouldAllowNavigation = null;
+                        if (url.startsWith("javascript:")) {
+                            shouldAllowNavigation = true;
+                        }
+                        if (shouldAllowNavigation == null) {
+                            try {
+                                Method iuw = Config.class.getMethod("isUrlWhiteListed", String.class);
+                                shouldAllowNavigation = (Boolean)iuw.invoke(null, url);
+                            } catch (NoSuchMethodException e) {
+                                LOG.d(LOG_TAG, e.getLocalizedMessage());
+                            } catch (IllegalAccessException e) {
+                                LOG.d(LOG_TAG, e.getLocalizedMessage());
+                            } catch (InvocationTargetException e) {
+                                LOG.d(LOG_TAG, e.getLocalizedMessage());
+                            }
+                        }
+                        if (shouldAllowNavigation == null) {
+                            try {
+                                Method gpm = webView.getClass().getMethod("getPluginManager");
+                                PluginManager pm = (PluginManager)gpm.invoke(webView);
+                                Method san = pm.getClass().getMethod("shouldAllowNavigation", String.class);
+                                shouldAllowNavigation = (Boolean)san.invoke(pm, url);
+                            } catch (NoSuchMethodException e) {
+                                LOG.d(LOG_TAG, e.getLocalizedMessage());
+                            } catch (IllegalAccessException e) {
+                                LOG.d(LOG_TAG, e.getLocalizedMessage());
+                            } catch (InvocationTargetException e) {
+                                LOG.d(LOG_TAG, e.getLocalizedMessage());
+                            }
+                        }
+                        // load in webview
+                        if (Boolean.TRUE.equals(shouldAllowNavigation)) {
+                            LOG.d(LOG_TAG, "loading in webview");
+                            webView.loadUrl(url);
+                        }
+                        //Load the dialer
+                        else if (url.startsWith(WebView.SCHEME_TEL))
+                        {
+                            try {
+                                LOG.d(LOG_TAG, "loading in dialer");
+                                Intent intent = new Intent(Intent.ACTION_DIAL);
+                                intent.setData(Uri.parse(url));
+                                cordova.getActivity().startActivity(intent);
+                            } catch (android.content.ActivityNotFoundException e) {
+                                LOG.e(LOG_TAG, "Error dialing " + url + ": " + e.toString());
+                            }
+                        }
+                        // load in InAppBrowser
+                        else {
+                            LOG.d(LOG_TAG, "loading in InAppBrowser");
+                            result = showWebPage(url, features);
+                        }
+                    }
+                    // SYSTEM
+                    else if (SYSTEM.equals(target)) {
+                        LOG.d(LOG_TAG, "in system");
+                        result = openExternal(url);
+                    }
+                    // BLANK - or anything else
+                    else {
+                        LOG.d(LOG_TAG, "in blank");
+                        result = showWebPage(url, features);
+                    }
+
+                    PluginResult pluginResult = new PluginResult(PluginResult.Status.OK, result);
+                    pluginResult.setKeepCallback(true);
+                    callbackContext.sendPluginResult(pluginResult);
+                }
+            });
+        }
+        else if (action.equals("close")) {
+            closeDialog();
+        }
+        else if (action.equals("loadAfterBeforeload")) {
+            if (beforeload == null) {
+                LOG.e(LOG_TAG, "unexpected loadAfterBeforeload called without feature beforeload=yes");
+            }
+            final String url = args.getString(0);
+            this.cordova.getActivity().runOnUiThread(new Runnable() {
+                @SuppressLint("NewApi")
+                @Override
+                public void run() {
+                    if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.O) {
+                        currentClient.waitForBeforeload = false;
+                        inAppWebView.setWebViewClient(currentClient);
+                    } else {
+                        ((InAppBrowserClient)inAppWebView.getWebViewClient()).waitForBeforeload = false;
+                    }
+                    inAppWebView.loadUrl(url);
+                }
+            });
+        }
+        else if (action.equals("injectScriptCode")) {
+            String jsWrapper = null;
+            if (args.getBoolean(1)) {
+                jsWrapper = String.format("(function(){prompt(JSON.stringify([eval(%%s)]), 'gap-iab://%s')})()", callbackContext.getCallbackId());
+            }
+            injectDeferredObject(args.getString(0), jsWrapper);
+        }
+        else if (action.equals("injectScriptFile")) {
+            String jsWrapper;
+            if (args.getBoolean(1)) {
+                jsWrapper = String.format("(function(d) { var c = d.createElement('script'); c.src = %%s; c.onload = function() { prompt('', 'gap-iab://%s'); }; d.body.appendChild(c); })(document)", callbackContext.getCallbackId());
+            } else {
+                jsWrapper = "(function(d) { var c = d.createElement('script'); c.src = %s; d.body.appendChild(c); })(document)";
+            }
+            injectDeferredObject(args.getString(0), jsWrapper);
+        }
+        else if (action.equals("injectStyleCode")) {
+            String jsWrapper;
+            if (args.getBoolean(1)) {
+                jsWrapper = String.format("(function(d) { var c = d.createElement('style'); c.innerHTML = %%s; d.body.appendChild(c); prompt('', 'gap-iab://%s');})(document)", callbackContext.getCallbackId());
+            } else {
+                jsWrapper = "(function(d) { var c = d.createElement('style'); c.innerHTML = %s; d.body.appendChild(c); })(document)";
+            }
+            injectDeferredObject(args.getString(0), jsWrapper);
+        }
+        else if (action.equals("injectStyleFile")) {
+            String jsWrapper;
+            if (args.getBoolean(1)) {
+                jsWrapper = String.format("(function(d) { var c = d.createElement('link'); c.rel='stylesheet'; c.type='text/css'; c.href = %%s; d.head.appendChild(c); prompt('', 'gap-iab://%s');})(document)", callbackContext.getCallbackId());
+            } else {
+                jsWrapper = "(function(d) { var c = d.createElement('link'); c.rel='stylesheet'; c.type='text/css'; c.href = %s; d.head.appendChild(c); })(document)";
+            }
+            injectDeferredObject(args.getString(0), jsWrapper);
+        }
+        else if (action.equals("show")) {
+            this.cordova.getActivity().runOnUiThread(new Runnable() {
+                @Override
+                public void run() {
+                    if (dialog != null && !cordova.getActivity().isFinishing()) {
+                        dialog.show();
+                    }
+                }
+            });
+            PluginResult pluginResult = new PluginResult(PluginResult.Status.OK);
+            pluginResult.setKeepCallback(true);
+            this.callbackContext.sendPluginResult(pluginResult);
+        }
+        else if (action.equals("hide")) {
+            this.cordova.getActivity().runOnUiThread(new Runnable() {
+                @Override
+                public void run() {
+                    if (dialog != null && !cordova.getActivity().isFinishing()) {
+                        dialog.hide();
+                    }
+                }
+            });
+            PluginResult pluginResult = new PluginResult(PluginResult.Status.OK);
+            pluginResult.setKeepCallback(true);
+            this.callbackContext.sendPluginResult(pluginResult);
+        }
+        else {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * Called when the view navigates.
+     */
+    @Override
+    public void onReset() {
+        closeDialog();
+    }
+
+    /**
+     * Called when the system is about to start resuming a previous activity.
+     */
+    @Override
+    public void onPause(boolean multitasking) {
+        if (shouldPauseInAppBrowser) {
+            inAppWebView.onPause();
+        }
+    }
+
+    /**
+     * Called when the activity will start interacting with the user.
+     */
+    @Override
+    public void onResume(boolean multitasking) {
+        if (shouldPauseInAppBrowser) {
+            inAppWebView.onResume();
+        }
+    }
+
+    /**
+     * Called by AccelBroker when listener is to be shut down.
+     * Stop listener.
+     */
+    public void onDestroy() {
+        closeDialog();
+    }
+
+    /**
+     * Inject an object (script or style) into the InAppBrowser WebView.
+     *
+     * This is a helper method for the inject{Script|Style}{Code|File} API calls, which
+     * provides a consistent method for injecting JavaScript code into the document.
+     *
+     * If a wrapper string is supplied, then the source string will be JSON-encoded (adding
+     * quotes) and wrapped using string formatting. (The wrapper string should have a single
+     * '%s' marker)
+     *
+     * @param source      The source object (filename or script/style text) to inject into
+     *                    the document.
+     * @param jsWrapper   A JavaScript string to wrap the source string in, so that the object
+     *                    is properly injected, or null if the source string is JavaScript text
+     *                    which should be executed directly.
+     */
+    private void injectDeferredObject(String source, String jsWrapper) {
+        if (inAppWebView!=null) {
+            String scriptToInject;
+            if (jsWrapper != null) {
+                org.json.JSONArray jsonEsc = new org.json.JSONArray();
+                jsonEsc.put(source);
+                String jsonRepr = jsonEsc.toString();
+                String jsonSourceString = jsonRepr.substring(1, jsonRepr.length()-1);
+                scriptToInject = String.format(jsWrapper, jsonSourceString);
+            } else {
+                scriptToInject = source;
+            }
+            final String finalScriptToInject = scriptToInject;
+            this.cordova.getActivity().runOnUiThread(new Runnable() {
+                @SuppressLint("NewApi")
+                @Override
+                public void run() {
+                    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
+                        // This action will have the side-effect of blurring the currently focused element
+                        inAppWebView.loadUrl("javascript:" + finalScriptToInject);
+                    } else {
+                        inAppWebView.evaluateJavascript(finalScriptToInject, null);
+                    }
+                }
+            });
+        } else {
+            LOG.d(LOG_TAG, "Can't inject code into the system browser");
+        }
+    }
+
+    /**
+     * Put the list of features into a hash map
+     *
+     * @param optString
+     * @return
+     */
+    private HashMap<String, String> parseFeature(String optString) {
+        if (optString.equals(NULL)) {
+            return null;
+        } else {
+            HashMap<String, String> map = new HashMap<String, String>();
+            StringTokenizer features = new StringTokenizer(optString, ",");
+            StringTokenizer option;
+            while(features.hasMoreElements()) {
+                option = new StringTokenizer(features.nextToken(), "=");
+                if (option.hasMoreElements()) {
+                    String key = option.nextToken();
+                    String value = option.nextToken();
+                    if (!customizableOptions.contains(key)) {
+                        value = value.equals("yes") || value.equals("no") ? value : "yes";
+                    }
+                    map.put(key, value);
+                }
+            }
+            return map;
+        }
+    }
+
+    /**
+     * Display a new browser with the specified URL.
+     *
+     * @param url the url to load.
+     * @return "" if ok, or error message.
+     */
+    public String openExternal(String url) {
+        try {
+            Intent intent = null;
+            intent = new Intent(Intent.ACTION_VIEW);
+            // Omitting the MIME type for file: URLs causes "No Activity found to handle Intent".
+            // Adding the MIME type to http: URLs causes them to not be handled by the downloader.
+            Uri uri = Uri.parse(url);
+            if ("file".equals(uri.getScheme())) {
+                intent.setDataAndType(uri, webView.getResourceApi().getMimeType(uri));
+            } else {
+                intent.setData(uri);
+            }
+            intent.putExtra(Browser.EXTRA_APPLICATION_ID, cordova.getActivity().getPackageName());
+            // CB-10795: Avoid circular loops by preventing it from opening in the current app
+            this.openExternalExcludeCurrentApp(intent);
+            return "";
+            // not catching FileUriExposedException explicitly because buildtools<24 doesn't know about it
+        } catch (java.lang.RuntimeException e) {
+            LOG.d(LOG_TAG, "InAppBrowser: Error loading url "+url+":"+ e.toString());
+            return e.toString();
+        }
+    }
+
+    /**
+     * Opens the intent, providing a chooser that excludes the current app to avoid
+     * circular loops.
+     */
+    private void openExternalExcludeCurrentApp(Intent intent) {
+        String currentPackage = cordova.getActivity().getPackageName();
+        boolean hasCurrentPackage = false;
+
+        PackageManager pm = cordova.getActivity().getPackageManager();
+        List<ResolveInfo> activities = pm.queryIntentActivities(intent, 0);
+        ArrayList<Intent> targetIntents = new ArrayList<Intent>();
+
+        for (ResolveInfo ri : activities) {
+            if (!currentPackage.equals(ri.activityInfo.packageName)) {
+                Intent targetIntent = (Intent)intent.clone();
+                targetIntent.setPackage(ri.activityInfo.packageName);
+                targetIntents.add(targetIntent);
+            }
+            else {
+                hasCurrentPackage = true;
+            }
+        }
+
+        // If the current app package isn't a target for this URL, then use
+        // the normal launch behavior
+        if (hasCurrentPackage == false || targetIntents.size() == 0) {
+            this.cordova.getActivity().startActivity(intent);
+        }
+        // If there's only one possible intent, launch it directly
+        else if (targetIntents.size() == 1) {
+            this.cordova.getActivity().startActivity(targetIntents.get(0));
+        }
+        // Otherwise, show a custom chooser without the current app listed
+        else if (targetIntents.size() > 0) {
+            Intent chooser = Intent.createChooser(targetIntents.remove(targetIntents.size()-1), null);
+            chooser.putExtra(Intent.EXTRA_INITIAL_INTENTS, targetIntents.toArray(new Parcelable[] {}));
+            this.cordova.getActivity().startActivity(chooser);
+        }
+    }
+
+    /**
+     * Closes the dialog
+     */
+    public void closeDialog() {
+        this.cordova.getActivity().runOnUiThread(new Runnable() {
+            @Override
+            public void run() {
+                final WebView childView = inAppWebView;
+                // The JS protects against multiple calls, so this should happen only when
+                // closeDialog() is called by other native code.
+                if (childView == null) {
+                    return;
+                }
+
+                childView.setWebViewClient(new WebViewClient() {
+                    // NB: wait for about:blank before dismissing
+                    public void onPageFinished(WebView view, String url) {
+                        if (dialog != null && !cordova.getActivity().isFinishing()) {
+                            dialog.dismiss();
+                            dialog = null;
+                        }
+                    }
+                });
+                // NB: From SDK 19: "If you call methods on WebView from any thread
+                // other than your app's UI thread, it can cause unexpected results."
+                // http://developer.android.com/guide/webapps/migrating.html#Threads
+                childView.loadUrl("about:blank");
+
+                try {
+                    JSONObject obj = new JSONObject();
+                    obj.put("type", EXIT_EVENT);
+                    sendUpdate(obj, false);
+                } catch (JSONException ex) {
+                    LOG.d(LOG_TAG, "Should never happen");
+                }
+            }
+        });
+    }
+
+    /**
+     * Checks to see if it is possible to go back one page in history, then does so.
+     */
+    public void goBack() {
+        if (this.inAppWebView.canGoBack()) {
+            this.inAppWebView.goBack();
+        }
+    }
+
+    /**
+     * Can the web browser go back?
+     * @return boolean
+     */
+    public boolean canGoBack() {
+        return this.inAppWebView.canGoBack();
+    }
+
+    /**
+     * Has the user set the hardware back button to go back
+     * @return boolean
+     */
+    public boolean hardwareBack() {
+        return hadwareBackButton;
+    }
+
+    /**
+     * Checks to see if it is possible to go forward one page in history, then does so.
+     */
+    private void goForward() {
+        if (this.inAppWebView.canGoForward()) {
+            this.inAppWebView.goForward();
+        }
+    }
+
+    /**
+     * Navigate to the new page
+     *
+     * @param url to load
+     */
+    private void navigate(String url) {
+        InputMethodManager imm = (InputMethodManager)this.cordova.getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
+        imm.hideSoftInputFromWindow(edittext.getWindowToken(), 0);
+
+        if (!url.startsWith("http") && !url.startsWith("file:")) {
+            this.inAppWebView.loadUrl("http://" + url);
+        } else {
+            this.inAppWebView.loadUrl(url);
+        }
+        this.inAppWebView.requestFocus();
+    }
+
+
+    /**
+     * Should we show the location bar?
+     *
+     * @return boolean
+     */
+    private boolean getShowLocationBar() {
+        return this.showLocationBar;
+    }
+
+    private InAppBrowser getInAppBrowser() {
+        return this;
+    }
+
+    /**
+     * Display a new browser with the specified URL.
+     *
+     * @param url the url to load.
+     * @param features jsonObject
+     */
+    public String showWebPage(final String url, HashMap<String, String> features) {
+        // Determine if we should hide the location bar.
+        showLocationBar = true;
+        showZoomControls = true;
+        openWindowHidden = false;
+        mediaPlaybackRequiresUserGesture = false;
+
+        if (features != null) {
+            String show = features.get(LOCATION);
+            if (show != null) {
+                showLocationBar = show.equals("yes") ? true : false;
+            }
+            if(showLocationBar) {
+                String hideNavigation = features.get(HIDE_NAVIGATION);
+                String hideUrl = features.get(HIDE_URL);
+                if(hideNavigation != null) hideNavigationButtons = hideNavigation.equals("yes") ? true : false;
+                if(hideUrl != null) hideUrlBar = hideUrl.equals("yes") ? true : false;
+            }
+            String zoom = features.get(ZOOM);
+            if (zoom != null) {
+                showZoomControls = zoom.equals("yes") ? true : false;
+            }
+            String hidden = features.get(HIDDEN);
+            if (hidden != null) {
+                openWindowHidden = hidden.equals("yes") ? true : false;
+            }
+            String hardwareBack = features.get(HARDWARE_BACK_BUTTON);
+            if (hardwareBack != null) {
+                hadwareBackButton = hardwareBack.equals("yes") ? true : false;
+            } else {
+                hadwareBackButton = DEFAULT_HARDWARE_BACK;
+            }
+            String mediaPlayback = features.get(MEDIA_PLAYBACK_REQUIRES_USER_ACTION);
+            if (mediaPlayback != null) {
+                mediaPlaybackRequiresUserGesture = mediaPlayback.equals("yes") ? true : false;
+            }
+            String cache = features.get(CLEAR_ALL_CACHE);
+            if (cache != null) {
+                clearAllCache = cache.equals("yes") ? true : false;
+            } else {
+                cache = features.get(CLEAR_SESSION_CACHE);
+                if (cache != null) {
+                    clearSessionCache = cache.equals("yes") ? true : false;
+                }
+            }
+            String shouldPause = features.get(SHOULD_PAUSE);
+            if (shouldPause != null) {
+                shouldPauseInAppBrowser = shouldPause.equals("yes") ? true : false;
+            }
+            String wideViewPort = features.get(USER_WIDE_VIEW_PORT);
+            if (wideViewPort != null ) {
+                useWideViewPort = wideViewPort.equals("yes") ? true : false;
+            }
+            String closeButtonCaptionSet = features.get(CLOSE_BUTTON_CAPTION);
+            if (closeButtonCaptionSet != null) {
+                closeButtonCaption = closeButtonCaptionSet;
+            }
+            String closeButtonColorSet = features.get(CLOSE_BUTTON_COLOR);
+            if (closeButtonColorSet != null) {
+                closeButtonColor = closeButtonColorSet;
+            }
+            String leftToRightSet = features.get(LEFT_TO_RIGHT);
+            leftToRight = leftToRightSet != null && leftToRightSet.equals("yes");
+
+            String toolbarColorSet = features.get(TOOLBAR_COLOR);
+            if (toolbarColorSet != null) {
+                toolbarColor = android.graphics.Color.parseColor(toolbarColorSet);
+            }
+            String navigationButtonColorSet = features.get(NAVIGATION_COLOR);
+            if (navigationButtonColorSet != null) {
+                navigationButtonColor = navigationButtonColorSet;
+            }
+            String showFooterSet = features.get(FOOTER);
+            if (showFooterSet != null) {
+                showFooter = showFooterSet.equals("yes") ? true : false;
+            }
+            String footerColorSet = features.get(FOOTER_COLOR);
+            if (footerColorSet != null) {
+                footerColor = footerColorSet;
+            }
+            if (features.get(BEFORELOAD) != null) {
+                beforeload = features.get(BEFORELOAD);
+            }
+            String fullscreenSet = features.get(FULLSCREEN);
+            if (fullscreenSet != null) {
+                fullscreen = fullscreenSet.equals("yes") ? true : false;
+            }
+        }
+
+        final CordovaWebView thatWebView = this.webView;
+
+        // Create dialog in new thread
+        Runnable runnable = new Runnable() {
+            /**
+             * Convert our DIP units to Pixels
+             *
+             * @return int
+             */
+            private int dpToPixels(int dipValue) {
+                int value = (int) TypedValue.applyDimension( TypedValue.COMPLEX_UNIT_DIP,
+                        (float) dipValue,
+                        cordova.getActivity().getResources().getDisplayMetrics()
+                );
+
+                return value;
+            }
+
+            private View createCloseButton(int id) {
+                View _close;
+                Resources activityRes = cordova.getActivity().getResources();
+
+                if (closeButtonCaption != "") {
+                    // Use TextView for text
+                    TextView close = new TextView(cordova.getActivity());
+                    close.setText(closeButtonCaption);
+                    close.setTextSize(20);
+                    if (closeButtonColor != "") close.setTextColor(android.graphics.Color.parseColor(closeButtonColor));
+                    close.setGravity(android.view.Gravity.CENTER_VERTICAL);
+                    close.setPadding(this.dpToPixels(10), 0, this.dpToPixels(10), 0);
+                    _close = close;
+                }
+                else {
+                    ImageButton close = new ImageButton(cordova.getActivity());
+                    int closeResId = activityRes.getIdentifier("ic_action_remove", "drawable", cordova.getActivity().getPackageName());
+                    Drawable closeIcon = activityRes.getDrawable(closeResId);
+                    if (closeButtonColor != "") close.setColorFilter(android.graphics.Color.parseColor(closeButtonColor));
+                    close.setImageDrawable(closeIcon);
+                    close.setScaleType(ImageView.ScaleType.FIT_CENTER);
+                    if (Build.VERSION.SDK_INT >= 16)
+                        close.getAdjustViewBounds();
+
+                    _close = close;
+                }
+
+                RelativeLayout.LayoutParams closeLayoutParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
+                if (leftToRight) closeLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
+                else closeLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
+                _close.setLayoutParams(closeLayoutParams);
+
+                if (Build.VERSION.SDK_INT >= 16)
+                    _close.setBackground(null);
+                else
+                    _close.setBackgroundDrawable(null);
+
+                _close.setContentDescription("Close Button");
+                _close.setId(Integer.valueOf(id));
+                _close.setOnClickListener(new View.OnClickListener() {
+                    public void onClick(View v) {
+                        closeDialog();
+                    }
+                });
+
+                return _close;
+            }
+
+            @SuppressLint("NewApi")
+            public void run() {
+
+                // CB-6702 InAppBrowser hangs when opening more than one instance
+                if (dialog != null) {
+                    dialog.dismiss();
+                };
+
+                // Let's create the main dialog
+                dialog = new InAppBrowserDialog(cordova.getActivity(), android.R.style.Theme_NoTitleBar);
+                dialog.getWindow().getAttributes().windowAnimations = android.R.style.Animation_Dialog;
+                dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
+                if (fullscreen) {
+                    dialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
+                }
+                dialog.setCancelable(true);
+                dialog.setInAppBroswer(getInAppBrowser());
+
+                // Main container layout
+                LinearLayout main = new LinearLayout(cordova.getActivity());
+                main.setOrientation(LinearLayout.VERTICAL);
+
+                // Toolbar layout
+                RelativeLayout toolbar = new RelativeLayout(cordova.getActivity());
+                //Please, no more black!
+                toolbar.setBackgroundColor(toolbarColor);
+                toolbar.setLayoutParams(new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, this.dpToPixels(44)));
+                toolbar.setPadding(this.dpToPixels(2), this.dpToPixels(2), this.dpToPixels(2), this.dpToPixels(2));
+                if (leftToRight) {
+                    toolbar.setHorizontalGravity(Gravity.LEFT);
+                } else {
+                    toolbar.setHorizontalGravity(Gravity.RIGHT);
+                }
+                toolbar.setVerticalGravity(Gravity.TOP);
+
+                // Action Button Container layout
+                RelativeLayout actionButtonContainer = new RelativeLayout(cordova.getActivity());
+                RelativeLayout.LayoutParams actionButtonLayoutParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
+                if (leftToRight) actionButtonLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
+                else actionButtonLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
+                actionButtonContainer.setLayoutParams(actionButtonLayoutParams);
+                actionButtonContainer.setHorizontalGravity(Gravity.LEFT);
+                actionButtonContainer.setVerticalGravity(Gravity.CENTER_VERTICAL);
+                actionButtonContainer.setId(leftToRight ? Integer.valueOf(5) : Integer.valueOf(1));
+
+                // Back button
+                ImageButton back = new ImageButton(cordova.getActivity());
+                RelativeLayout.LayoutParams backLayoutParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
+                backLayoutParams.addRule(RelativeLayout.ALIGN_LEFT);
+                back.setLayoutParams(backLayoutParams);
+                back.setContentDescription("Back Button");
+                back.setId(Integer.valueOf(2));
+                Resources activityRes = cordova.getActivity().getResources();
+                int backResId = activityRes.getIdentifier("ic_action_previous_item", "drawable", cordova.getActivity().getPackageName());
+                Drawable backIcon = activityRes.getDrawable(backResId);
+                if (navigationButtonColor != "") back.setColorFilter(android.graphics.Color.parseColor(navigationButtonColor));
+                if (Build.VERSION.SDK_INT >= 16)
+                    back.setBackground(null);
+                else
+                    back.setBackgroundDrawable(null);
+                back.setImageDrawable(backIcon);
+                back.setScaleType(ImageView.ScaleType.FIT_CENTER);
+                back.setPadding(0, this.dpToPixels(10), 0, this.dpToPixels(10));
+                if (Build.VERSION.SDK_INT >= 16)
+                    back.getAdjustViewBounds();
+
+                back.setOnClickListener(new View.OnClickListener() {
+                    public void onClick(View v) {
+                        goBack();
+                    }
+                });
+
+                // Forward button
+                ImageButton forward = new ImageButton(cordova.getActivity());
+                RelativeLayout.LayoutParams forwardLayoutParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
+                forwardLayoutParams.addRule(RelativeLayout.RIGHT_OF, 2);
+                forward.setLayoutParams(forwardLayoutParams);
+                forward.setContentDescription("Forward Button");
+                forward.setId(Integer.valueOf(3));
+                int fwdResId = activityRes.getIdentifier("ic_action_next_item", "drawable", cordova.getActivity().getPackageName());
+                Drawable fwdIcon = activityRes.getDrawable(fwdResId);
+                if (navigationButtonColor != "") forward.setColorFilter(android.graphics.Color.parseColor(navigationButtonColor));
+                if (Build.VERSION.SDK_INT >= 16)
+                    forward.setBackground(null);
+                else
+                    forward.setBackgroundDrawable(null);
+                forward.setImageDrawable(fwdIcon);
+                forward.setScaleType(ImageView.ScaleType.FIT_CENTER);
+                forward.setPadding(0, this.dpToPixels(10), 0, this.dpToPixels(10));
+                if (Build.VERSION.SDK_INT >= 16)
+                    forward.getAdjustViewBounds();
+
+                forward.setOnClickListener(new View.OnClickListener() {
+                    public void onClick(View v) {
+                        goForward();
+                    }
+                });
+
+                // Edit Text Box
+                edittext = new EditText(cordova.getActivity());
+                RelativeLayout.LayoutParams textLayoutParams = new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
+                textLayoutParams.addRule(RelativeLayout.RIGHT_OF, 1);
+                textLayoutParams.addRule(RelativeLayout.LEFT_OF, 5);
+                edittext.setLayoutParams(textLayoutParams);
+                edittext.setId(Integer.valueOf(4));
+                edittext.setSingleLine(true);
+                edittext.setText(url);
+                edittext.setInputType(InputType.TYPE_TEXT_VARIATION_URI);
+                edittext.setImeOptions(EditorInfo.IME_ACTION_GO);
+                edittext.setInputType(InputType.TYPE_NULL); // Will not except input... Makes the text NON-EDITABLE
+                edittext.setOnKeyListener(new View.OnKeyListener() {
+                    public boolean onKey(View v, int keyCode, KeyEvent event) {
+                        // If the event is a key-down event on the "enter" button
+                        if ((event.getAction() == KeyEvent.ACTION_DOWN) && (keyCode == KeyEvent.KEYCODE_ENTER)) {
+                            navigate(edittext.getText().toString());
+                            return true;
+                        }
+                        return false;
+                    }
+                });
+
+
+                // Header Close/Done button
+                int closeButtonId = leftToRight ? 1 : 5;
+                View close = createCloseButton(closeButtonId);
+                toolbar.addView(close);
+
+                // Footer
+                RelativeLayout footer = new RelativeLayout(cordova.getActivity());
+                int _footerColor;
+                if(footerColor != "") {
+                    _footerColor = Color.parseColor(footerColor);
+                } else {
+                    _footerColor = android.graphics.Color.LTGRAY;
+                }
+                footer.setBackgroundColor(_footerColor);
+                RelativeLayout.LayoutParams footerLayout = new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, this.dpToPixels(44));
+                footerLayout.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, RelativeLayout.TRUE);
+                footer.setLayoutParams(footerLayout);
+                if (closeButtonCaption != "") footer.setPadding(this.dpToPixels(8), this.dpToPixels(8), this.dpToPixels(8), this.dpToPixels(8));
+                footer.setHorizontalGravity(Gravity.LEFT);
+                footer.setVerticalGravity(Gravity.BOTTOM);
+
+                View footerClose = createCloseButton(7);
+                footer.addView(footerClose);
+
+
+                // WebView
+                inAppWebView = new WebView(cordova.getActivity());
+                inAppWebView.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
+                inAppWebView.setId(Integer.valueOf(6));
+                // File Chooser Implemented ChromeClient
+                inAppWebView.setWebChromeClient(new InAppChromeClient(thatWebView) {
+                    // For Android 5.0+
+                    public boolean onShowFileChooser (WebView webView, ValueCallback<Uri[]> filePathCallback, WebChromeClient.FileChooserParams fileChooserParams)
+                    {
+                        LOG.d(LOG_TAG, "File Chooser 5.0+");
+                        // If callback exists, finish it.
+                        if(mUploadCallbackLollipop != null) {
+                            mUploadCallbackLollipop.onReceiveValue(null);
+                        }
+                        mUploadCallbackLollipop = filePathCallback;
+
+                        // Create File Chooser Intent
+                        Intent content = new Intent(Intent.ACTION_GET_CONTENT);
+                        content.addCategory(Intent.CATEGORY_OPENABLE);
+                        content.setType("*/*");
+
+                        // Run cordova startActivityForResult
+                        cordova.startActivityForResult(InAppBrowser.this, Intent.createChooser(content, "Select File"), FILECHOOSER_REQUESTCODE_LOLLIPOP);
+                        return true;
+                    }
+
+                    // For Android 4.1+
+                    public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType, String capture)
+                    {
+                        LOG.d(LOG_TAG, "File Chooser 4.1+");
+                        // Call file chooser for Android 3.0+
+                        openFileChooser(uploadMsg, acceptType);
+                    }
+
+                    // For Android 3.0+
+                    public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType)
+                    {
+                        LOG.d(LOG_TAG, "File Chooser 3.0+");
+                        mUploadCallback = uploadMsg;
+                        Intent content = new Intent(Intent.ACTION_GET_CONTENT);
+                        content.addCategory(Intent.CATEGORY_OPENABLE);
+
+                        // run startActivityForResult
+                        cordova.startActivityForResult(InAppBrowser.this, Intent.createChooser(content, "Select File"), FILECHOOSER_REQUESTCODE);
+                    }
+
+                });
+                currentClient = new InAppBrowserClient(thatWebView, edittext, beforeload);
+                inAppWebView.setWebViewClient(currentClient);
+                WebSettings settings = inAppWebView.getSettings();
+                settings.setJavaScriptEnabled(true);
+                settings.setJavaScriptCanOpenWindowsAutomatically(true);
+                settings.setBuiltInZoomControls(showZoomControls);
+                settings.setPluginState(android.webkit.WebSettings.PluginState.ON);
+
+                // Add postMessage interface
+                class JsObject {
+                    @JavascriptInterface
+                    public void postMessage(String data) {
+                        try {
+                            JSONObject obj = new JSONObject();
+                            obj.put("type", MESSAGE_EVENT);
+                            obj.put("data", new JSONObject(data));
+                            sendUpdate(obj, true);
+                        } catch (JSONException ex) {
+                            LOG.e(LOG_TAG, "data object passed to postMessage has caused a JSON error.");
+                        }
+                    }
+                }
+
+                if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
+                    settings.setMediaPlaybackRequiresUserGesture(mediaPlaybackRequiresUserGesture);
+                    inAppWebView.addJavascriptInterface(new JsObject(), "cordova_iab");
+                }
+
+                String overrideUserAgent = preferences.getString("OverrideUserAgent", null);
+                String appendUserAgent = preferences.getString("AppendUserAgent", null);
+
+                if (overrideUserAgent != null) {
+                    settings.setUserAgentString(overrideUserAgent);
+                }
+                if (appendUserAgent != null) {
+                    settings.setUserAgentString(settings.getUserAgentString() + appendUserAgent);
+                }
+
+                //Toggle whether this is enabled or not!
+                Bundle appSettings = cordova.getActivity().getIntent().getExtras();
+                boolean enableDatabase = appSettings == null ? true : appSettings.getBoolean("InAppBrowserStorageEnabled", true);
+                if (enableDatabase) {
+                    String databasePath = cordova.getActivity().getApplicationContext().getDir("inAppBrowserDB", Context.MODE_PRIVATE).getPath();
+                    settings.setDatabasePath(databasePath);
+                    settings.setDatabaseEnabled(true);
+                }
+                settings.setDomStorageEnabled(true);
+
+                if (clearAllCache) {
+                    CookieManager.getInstance().removeAllCookie();
+                } else if (clearSessionCache) {
+                    CookieManager.getInstance().removeSessionCookie();
+                }
+
+                // Enable Thirdparty Cookies on >=Android 5.0 device
+                if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
+                    CookieManager.getInstance().setAcceptThirdPartyCookies(inAppWebView,true);
+                }
+
+                inAppWebView.loadUrl(url);
+                inAppWebView.setId(Integer.valueOf(6));
+                inAppWebView.getSettings().setLoadWithOverviewMode(true);
+                inAppWebView.getSettings().setUseWideViewPort(useWideViewPort);
+                inAppWebView.requestFocus();
+                inAppWebView.requestFocusFromTouch();
+
+                // Add the back and forward buttons to our action button container layout
+                actionButtonContainer.addView(back);
+                actionButtonContainer.addView(forward);
+
+                // Add the views to our toolbar if they haven't been disabled
+                if (!hideNavigationButtons) toolbar.addView(actionButtonContainer);
+                if (!hideUrlBar) toolbar.addView(edittext);
+
+                // Don't add the toolbar if its been disabled
+                if (getShowLocationBar()) {
+                    // Add our toolbar to our main view/layout
+                    main.addView(toolbar);
+                }
+
+                // Add our webview to our main view/layout
+                RelativeLayout webViewLayout = new RelativeLayout(cordova.getActivity());
+                webViewLayout.addView(inAppWebView);
+                main.addView(webViewLayout);
+
+                // Don't add the footer unless it's been enabled
+                if (showFooter) {
+                    webViewLayout.addView(footer);
+                }
+
+                WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
+                lp.copyFrom(dialog.getWindow().getAttributes());
+                lp.width = WindowManager.LayoutParams.MATCH_PARENT;
+                lp.height = WindowManager.LayoutParams.MATCH_PARENT;
+
+                if (dialog != null) {
+                    dialog.setContentView(main);
+                    dialog.show();
+                    dialog.getWindow().setAttributes(lp);
+                }
+                // the goal of openhidden is to load the url and not display it
+                // Show() needs to be called to cause the URL to be loaded
+                if (openWindowHidden && dialog != null) {
+                    dialog.hide();
+                }
+            }
+        };
+        this.cordova.getActivity().runOnUiThread(runnable);
+        return "";
+    }
+
+    /**
+     * Create a new plugin success result and send it back to JavaScript
+     *
+     * @param obj a JSONObject contain event payload information
+     */
+    private void sendUpdate(JSONObject obj, boolean keepCallback) {
+        sendUpdate(obj, keepCallback, PluginResult.Status.OK);
+    }
+
+    /**
+     * Create a new plugin result and send it back to JavaScript
+     *
+     * @param obj a JSONObject contain event payload information
+     * @param status the status code to return to the JavaScript environment
+     */
+    private void sendUpdate(JSONObject obj, boolean keepCallback, PluginResult.Status status) {
+        if (callbackContext != null) {
+            PluginResult result = new PluginResult(status, obj);
+            result.setKeepCallback(keepCallback);
+            callbackContext.sendPluginResult(result);
+            if (!keepCallback) {
+                callbackContext = null;
+            }
+        }
+    }
+
+    /**
+     * Receive File Data from File Chooser
+     *
+     * @param requestCode the requested code from chromeclient
+     * @param resultCode the result code returned from android system
+     * @param intent the data from android file chooser
+     */
+    public void onActivityResult(int requestCode, int resultCode, Intent intent) {
+        // For Android >= 5.0
+        if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+            LOG.d(LOG_TAG, "onActivityResult (For Android >= 5.0)");
+            // If RequestCode or Callback is Invalid
+            if(requestCode != FILECHOOSER_REQUESTCODE_LOLLIPOP || mUploadCallbackLollipop == null) {
+                super.onActivityResult(requestCode, resultCode, intent);
+                return;
+            }
+            mUploadCallbackLollipop.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, intent));
+            mUploadCallbackLollipop = null;
+        }
+        // For Android < 5.0
+        else {
+            LOG.d(LOG_TAG, "onActivityResult (For Android < 5.0)");
+            // If RequestCode or Callback is Invalid
+            if(requestCode != FILECHOOSER_REQUESTCODE || mUploadCallback == null) {
+                super.onActivityResult(requestCode, resultCode, intent);
+                return;
+            }
+
+            if (null == mUploadCallback) return;
+            Uri result = intent == null || resultCode != cordova.getActivity().RESULT_OK ? null : intent.getData();
+
+            mUploadCallback.onReceiveValue(result);
+            mUploadCallback = null;
+        }
+    }
+
+    /**
+     * The webview client receives notifications about appView
+     */
+    public class InAppBrowserClient extends WebViewClient {
+        EditText edittext;
+        CordovaWebView webView;
+        String beforeload;
+        boolean waitForBeforeload;
+
+        /**
+         * Constructor.
+         *
+         * @param webView
+         * @param mEditText
+         */
+        public InAppBrowserClient(CordovaWebView webView, EditText mEditText, String beforeload) {
+            this.webView = webView;
+            this.edittext = mEditText;
+            this.beforeload = beforeload;
+            this.waitForBeforeload = beforeload != null;
+        }
+
+        /**
+         * Override the URL that should be loaded
+         *
+         * Legacy (deprecated in API 24)
+         * For Android 6 and below.
+         *
+         * @param webView
+         * @param url
+         */
+        @SuppressWarnings("deprecation")
+        @Override
+        public boolean shouldOverrideUrlLoading(WebView webView, String url) {
+            return shouldOverrideUrlLoading(url, null);
+        }
+
+        /**
+         * Override the URL that should be loaded
+         *
+         * New (added in API 24)
+         * For Android 7 and above.
+         *
+         * @param webView
+         * @param request
+         */
+        @TargetApi(Build.VERSION_CODES.N)
+        @Override
+        public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest request) {
+            return shouldOverrideUrlLoading(request.getUrl().toString(), request.getMethod());
+        }
+
+        /**
+         * Override the URL that should be loaded
+         *
+         * This handles a small subset of all the URIs that would be encountered.
+         *
+         * @param url
+         * @param method
+         */
+        public boolean shouldOverrideUrlLoading(String url, String method) {
+            boolean override = false;
+            boolean useBeforeload = false;
+            String errorMessage = null;
+
+            if (beforeload.equals("yes") && method == null) {
+                useBeforeload = true;
+            } else if(beforeload.equals("yes")
+                    //TODO handle POST requests then this condition can be removed:
+                    && !method.equals("POST"))
+            {
+                useBeforeload = true;
+            } else if(beforeload.equals("get") && (method == null || method.equals("GET"))) {
+                useBeforeload = true;
+            } else if(beforeload.equals("post") && (method == null || method.equals("POST"))) {
+                //TODO handle POST requests
+                errorMessage = "beforeload doesn't yet support POST requests";
+            }
+
+            // On first URL change, initiate JS callback. Only after the beforeload event, continue.
+            if (useBeforeload && this.waitForBeforeload) {
+                if(sendBeforeLoad(url, method)) {
+                    return true;
+                }
+            }
+
+            if(errorMessage != null) {
+                try {
+                    LOG.e(LOG_TAG, errorMessage);
+                    JSONObject obj = new JSONObject();
+                    obj.put("type", LOAD_ERROR_EVENT);
+                    obj.put("url", url);
+                    obj.put("code", -1);
+                    obj.put("message", errorMessage);
+                    sendUpdate(obj, true, PluginResult.Status.ERROR);
+                } catch(Exception e) {
+                    LOG.e(LOG_TAG, "Error sending loaderror for " + url + ": " + e.toString());
+                }
+            }
+
+            if (url.startsWith(WebView.SCHEME_TEL)) {
+                try {
+                    Intent intent = new Intent(Intent.ACTION_DIAL);
+                    intent.setData(Uri.parse(url));
+                    cordova.getActivity().startActivity(intent);
+                    override = true;
+                } catch (android.content.ActivityNotFoundException e) {
+                    LOG.e(LOG_TAG, "Error dialing " + url + ": " + e.toString());
+                }
+            } else if (url.startsWith("geo:") || url.startsWith(WebView.SCHEME_MAILTO) || url.startsWith("market:") || url.startsWith("intent:")) {
+                try {
+                    Intent intent = new Intent(Intent.ACTION_VIEW);
+                    intent.setData(Uri.parse(url));
+                    cordova.getActivity().startActivity(intent);
+                    override = true;
+                } catch (android.content.ActivityNotFoundException e) {
+                    LOG.e(LOG_TAG, "Error with " + url + ": " + e.toString());
+                }
+            }
+            // If sms:5551212?body=This is the message
+            else if (url.startsWith("sms:")) {
+                try {
+                    Intent intent = new Intent(Intent.ACTION_VIEW);
+
+                    // Get address
+                    String address = null;
+                    int parmIndex = url.indexOf('?');
+                    if (parmIndex == -1) {
+                        address = url.substring(4);
+                    } else {
+                        address = url.substring(4, parmIndex);
+
+                        // If body, then set sms body
+                        Uri uri = Uri.parse(url);
+                        String query = uri.getQuery();
+                        if (query != null) {
+                            if (query.startsWith("body=")) {
+                                intent.putExtra("sms_body", query.substring(5));
+                            }
+                        }
+                    }
+                    intent.setData(Uri.parse("sms:" + address));
+                    intent.putExtra("address", address);
+                    intent.setType("vnd.android-dir/mms-sms");
+                    cordova.getActivity().startActivity(intent);
+                    override = true;
+                } catch (android.content.ActivityNotFoundException e) {
+                    LOG.e(LOG_TAG, "Error sending sms " + url + ":" + e.toString());
+                }
+            }
+            // Test for whitelisted custom scheme names like mycoolapp:// or twitteroauthresponse:// (Twitter Oauth Response)
+            else if (!url.startsWith("http:") && !url.startsWith("https:") && url.matches("^[A-Za-z0-9+.-]*://.*?$")) {
+                if (allowedSchemes == null) {
+                    String allowed = preferences.getString("AllowedSchemes", null);
+                    if(allowed != null) {
+                        allowedSchemes = allowed.split(",");
+                    }
+                }
+                if (allowedSchemes != null) {
+                    for (String scheme : allowedSchemes) {
+                        if (url.startsWith(scheme)) {
+                            try {
+                                JSONObject obj = new JSONObject();
+                                obj.put("type", "customscheme");
+                                obj.put("url", url);
+                                sendUpdate(obj, true);
+                                override = true;
+                            } catch (JSONException ex) {
+                                LOG.e(LOG_TAG, "Custom Scheme URI passed in has caused a JSON error.");
+                            }
+                        }
+                    }
+                }
+            }
+
+            if (useBeforeload) {
+                this.waitForBeforeload = true;
+            }
+            return override;
+        }
+
+        private boolean sendBeforeLoad(String url, String method) {
+            try {
+                JSONObject obj = new JSONObject();
+                obj.put("type", BEFORELOAD);
+                obj.put("url", url);
+                if(method != null) {
+                    obj.put("method", method);
+                }
+                sendUpdate(obj, true);
+                return true;
+            } catch (JSONException ex) {
+                LOG.e(LOG_TAG, "URI passed in has caused a JSON error.");
+            }
+            return false;
+        }
+
+
+        /**
+         * Legacy (deprecated in API 21)
+         * For Android 4.4 and below.
+         * @param view
+         * @param url
+         * @return
+         */
+        @SuppressWarnings("deprecation")
+        @Override
+        public WebResourceResponse shouldInterceptRequest (final WebView view, String url) {
+            return shouldInterceptRequest(url, super.shouldInterceptRequest(view, url), null);
+        }
+
+        /**
+         * New (added in API 21)
+         * For Android 5.0 and above.
+         *
+         * @param webView
+         * @param request
+         */
+        @TargetApi(Build.VERSION_CODES.LOLLIPOP)
+        @Override
+        public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) {
+            return shouldInterceptRequest(request.getUrl().toString(), super.shouldInterceptRequest(view, request), request.getMethod());
+        }
+
+        public WebResourceResponse shouldInterceptRequest(String url, WebResourceResponse response, String method) {
+            return response;
+        }
+
+        /*
+         * onPageStarted fires the LOAD_START_EVENT
+         *
+         * @param view
+         * @param url
+         * @param favicon
+         */
+        @Override
+        public void onPageStarted(WebView view, String url, Bitmap favicon) {
+            super.onPageStarted(view, url, favicon);
+            String newloc = "";
+            if (url.startsWith("http:") || url.startsWith("https:") || url.startsWith("file:")) {
+                newloc = url;
+            }
+            else
+            {
+                // Assume that everything is HTTP at this point, because if we don't specify,
+                // it really should be.  Complain loudly about this!!!
+                LOG.e(LOG_TAG, "Possible Uncaught/Unknown URI");
+                newloc = "http://" + url;
+            }
+
+            // Update the UI if we haven't already
+            if (!newloc.equals(edittext.getText().toString())) {
+                edittext.setText(newloc);
+            }
+
+            try {
+                JSONObject obj = new JSONObject();
+                obj.put("type", LOAD_START_EVENT);
+                obj.put("url", newloc);
+                sendUpdate(obj, true);
+            } catch (JSONException ex) {
+                LOG.e(LOG_TAG, "URI passed in has caused a JSON error.");
+            }
+        }
+
+        public void onPageFinished(WebView view, String url) {
+            super.onPageFinished(view, url);
+
+            // Set the namespace for postMessage()
+            if (Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
+                injectDeferredObject("window.webkit={messageHandlers:{cordova_iab:cordova_iab}}", null);
+            }
+
+            // CB-10395 InAppBrowser's WebView not storing cookies reliable to local device storage
+            if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
+                CookieManager.getInstance().flush();
+            } else {
+                CookieSyncManager.getInstance().sync();
+            }
+
+            // https://issues.apache.org/jira/browse/CB-11248
+            view.clearFocus();
+            view.requestFocus();
+
+            try {
+                JSONObject obj = new JSONObject();
+                obj.put("type", LOAD_STOP_EVENT);
+                obj.put("url", url);
+
+                sendUpdate(obj, true);
+            } catch (JSONException ex) {
+                LOG.d(LOG_TAG, "Should never happen");
+            }
+        }
+
+        public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
+            super.onReceivedError(view, errorCode, description, failingUrl);
+
+            try {
+                JSONObject obj = new JSONObject();
+                obj.put("type", LOAD_ERROR_EVENT);
+                obj.put("url", failingUrl);
+                obj.put("code", errorCode);
+                obj.put("message", description);
+
+                sendUpdate(obj, true, PluginResult.Status.ERROR);
+            } catch (JSONException ex) {
+                LOG.d(LOG_TAG, "Should never happen");
+            }
+        }
+
+        @Override
+        public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
+            super.onReceivedSslError(view, handler, error);
+            try {
+                JSONObject obj = new JSONObject();
+                obj.put("type", LOAD_ERROR_EVENT);
+                obj.put("url", error.getUrl());
+                obj.put("code", 0);
+                obj.put("sslerror", error.getPrimaryError());
+                String message;
+                switch (error.getPrimaryError()) {
+                case SslError.SSL_DATE_INVALID:
+                    message = "The date of the certificate is invalid";
+                    break;
+                case SslError.SSL_EXPIRED:
+                    message = "The certificate has expired";
+                    break;
+                case SslError.SSL_IDMISMATCH:
+                    message = "Hostname mismatch";
+                    break;
+                default:
+                case SslError.SSL_INVALID:
+                    message = "A generic error occurred";
+                    break;
+                case SslError.SSL_NOTYETVALID:
+                    message = "The certificate is not yet valid";
+                    break;
+                case SslError.SSL_UNTRUSTED:
+                    message = "The certificate authority is not trusted";
+                    break;
+                }
+                obj.put("message", message);
+
+                sendUpdate(obj, true, PluginResult.Status.ERROR);
+            } catch (JSONException ex) {
+                LOG.d(LOG_TAG, "Should never happen");
+            }
+            handler.cancel();
+        }
+
+        /**
+         * On received http auth request.
+         */
+        @Override
+        public void onReceivedHttpAuthRequest(WebView view, HttpAuthHandler handler, String host, String realm) {
+
+            // Check if there is some plugin which can resolve this auth challenge
+            PluginManager pluginManager = null;
+            try {
+                Method gpm = webView.getClass().getMethod("getPluginManager");
+                pluginManager = (PluginManager)gpm.invoke(webView);
+            } catch (NoSuchMethodException e) {
+                LOG.d(LOG_TAG, e.getLocalizedMessage());
+            } catch (IllegalAccessException e) {
+                LOG.d(LOG_TAG, e.getLocalizedMessage());
+            } catch (InvocationTargetException e) {
+                LOG.d(LOG_TAG, e.getLocalizedMessage());
+            }
+
+            if (pluginManager == null) {
+                try {
+                    Field pmf = webView.getClass().getField("pluginManager");
+                    pluginManager = (PluginManager)pmf.get(webView);
+                } catch (NoSuchFieldException e) {
+                    LOG.d(LOG_TAG, e.getLocalizedMessage());
+                } catch (IllegalAccessException e) {
+                    LOG.d(LOG_TAG, e.getLocalizedMessage());
+                }
+            }
+
+            if (pluginManager != null && pluginManager.onReceivedHttpAuthRequest(webView, new CordovaHttpAuthHandler(handler), host, realm)) {
+                return;
+            }
+
+            // By default handle 401 like we'd normally do!
+            super.onReceivedHttpAuthRequest(view, handler, host, realm);
+        }
+    }
+}

+ 57 - 0
cordova/platforms/android/app/src/main/java/org/apache/cordova/inappbrowser/InAppBrowserDialog.java

@@ -0,0 +1,57 @@
+/*
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+*/
+package org.apache.cordova.inappbrowser;
+
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.content.Context;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+/**
+ * Created by Oliver on 22/11/2013.
+ */
+public class InAppBrowserDialog extends Dialog {
+    Context context;
+    InAppBrowser inAppBrowser = null;
+
+    public InAppBrowserDialog(Context context, int theme) {
+        super(context, theme);
+        this.context = context;
+    }
+
+    public void setInAppBroswer(InAppBrowser browser) {
+        this.inAppBrowser = browser;
+    }
+
+    public void onBackPressed () {
+        if (this.inAppBrowser == null) {
+            this.dismiss();
+        } else {
+            // better to go through the in inAppBrowser
+            // because it does a clean up
+            if (this.inAppBrowser.hardwareBack() && this.inAppBrowser.canGoBack()) {
+                this.inAppBrowser.goBack();
+            }  else {
+                this.inAppBrowser.closeDialog();
+            }
+        }
+    }
+}

+ 138 - 0
cordova/platforms/android/app/src/main/java/org/apache/cordova/inappbrowser/InAppChromeClient.java

@@ -0,0 +1,138 @@
+/*
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+*/
+package org.apache.cordova.inappbrowser;
+
+import org.apache.cordova.CordovaWebView;
+import org.apache.cordova.LOG;
+import org.apache.cordova.PluginResult;
+import org.json.JSONArray;
+import org.json.JSONException;
+
+import android.webkit.JsPromptResult;
+import android.webkit.WebChromeClient;
+import android.webkit.WebStorage;
+import android.webkit.WebView;
+import android.webkit.WebViewClient;
+import android.webkit.GeolocationPermissions.Callback;
+
+public class InAppChromeClient extends WebChromeClient {
+
+    private CordovaWebView webView;
+    private String LOG_TAG = "InAppChromeClient";
+    private long MAX_QUOTA = 100 * 1024 * 1024;
+
+    public InAppChromeClient(CordovaWebView webView) {
+        super();
+        this.webView = webView;
+    }
+    /**
+     * Handle database quota exceeded notification.
+     *
+     * @param url
+     * @param databaseIdentifier
+     * @param currentQuota
+     * @param estimatedSize
+     * @param totalUsedQuota
+     * @param quotaUpdater
+     */
+    @Override
+    public void onExceededDatabaseQuota(String url, String databaseIdentifier, long currentQuota, long estimatedSize,
+            long totalUsedQuota, WebStorage.QuotaUpdater quotaUpdater)
+    {
+        LOG.d(LOG_TAG, "onExceededDatabaseQuota estimatedSize: %d  currentQuota: %d  totalUsedQuota: %d", estimatedSize, currentQuota, totalUsedQuota);
+        quotaUpdater.updateQuota(MAX_QUOTA);
+    }
+
+    /**
+     * Instructs the client to show a prompt to ask the user to set the Geolocation permission state for the specified origin.
+     *
+     * @param origin
+     * @param callback
+     */
+    @Override
+    public void onGeolocationPermissionsShowPrompt(String origin, Callback callback) {
+        super.onGeolocationPermissionsShowPrompt(origin, callback);
+        callback.invoke(origin, true, false);
+    }
+
+    /**
+     * Tell the client to display a prompt dialog to the user.
+     * If the client returns true, WebView will assume that the client will
+     * handle the prompt dialog and call the appropriate JsPromptResult method.
+     *
+     * The prompt bridge provided for the InAppBrowser is capable of executing any
+     * oustanding callback belonging to the InAppBrowser plugin. Care has been
+     * taken that other callbacks cannot be triggered, and that no other code
+     * execution is possible.
+     *
+     * To trigger the bridge, the prompt default value should be of the form:
+     *
+     * gap-iab://<callbackId>
+     *
+     * where <callbackId> is the string id of the callback to trigger (something
+     * like "InAppBrowser0123456789")
+     *
+     * If present, the prompt message is expected to be a JSON-encoded value to
+     * pass to the callback. A JSON_EXCEPTION is returned if the JSON is invalid.
+     *
+     * @param view
+     * @param url
+     * @param message
+     * @param defaultValue
+     * @param result
+     */
+    @Override
+    public boolean onJsPrompt(WebView view, String url, String message, String defaultValue, JsPromptResult result) {
+        // See if the prompt string uses the 'gap-iab' protocol. If so, the remainder should be the id of a callback to execute.
+        if (defaultValue != null && defaultValue.startsWith("gap")) {
+            if(defaultValue.startsWith("gap-iab://")) {
+                PluginResult scriptResult;
+                String scriptCallbackId = defaultValue.substring(10);
+                if (scriptCallbackId.matches("^InAppBrowser[0-9]{1,10}$")) {
+                    if(message == null || message.length() == 0) {
+                        scriptResult = new PluginResult(PluginResult.Status.OK, new JSONArray());
+                    } else {
+                        try {
+                            scriptResult = new PluginResult(PluginResult.Status.OK, new JSONArray(message));
+                        } catch(JSONException e) {
+                            scriptResult = new PluginResult(PluginResult.Status.JSON_EXCEPTION, e.getMessage());
+                        }
+                    }
+                    this.webView.sendPluginResult(scriptResult, scriptCallbackId);
+                    result.confirm("");
+                    return true;
+                }
+                else {
+                    // Anything else that doesn't look like InAppBrowser0123456789 should end up here
+                    LOG.w(LOG_TAG, "InAppBrowser callback called with invalid callbackId : "+ scriptCallbackId);
+                    result.cancel();
+                    return true;
+                }
+            }
+            else {
+                // Anything else with a gap: prefix should get this message
+                LOG.w(LOG_TAG, "InAppBrowser does not support Cordova API calls: " + url + " " + defaultValue); 
+                result.cancel();
+                return true;
+            }
+        }
+        return false;
+    }
+
+}

+ 45 - 0
cordova/platforms/android/app/src/main/java/uk/co/whiteoctober/cordova/AppVersion.java

@@ -0,0 +1,45 @@
+package uk.co.whiteoctober.cordova;
+
+import org.apache.cordova.CordovaPlugin;
+import org.apache.cordova.CallbackContext;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageManager.NameNotFoundException;
+import android.content.pm.PackageManager;
+
+public class AppVersion extends CordovaPlugin {
+  @Override
+  public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
+
+    try {
+      if (action.equals("getAppName")) {
+        PackageManager packageManager = this.cordova.getActivity().getPackageManager();
+        ApplicationInfo app = packageManager.getApplicationInfo(this.cordova.getActivity().getPackageName(), 0);
+        callbackContext.success((String)packageManager.getApplicationLabel(app));
+        return true;
+      }
+      if (action.equals("getPackageName")) {
+        callbackContext.success(this.cordova.getActivity().getPackageName());
+        return true;
+      }
+      if (action.equals("getVersionNumber")) {
+        PackageManager packageManager = this.cordova.getActivity().getPackageManager();
+        callbackContext.success(packageManager.getPackageInfo(this.cordova.getActivity().getPackageName(), 0).versionName);
+      return true;
+      }
+      if (action.equals("getVersionCode")) {
+        PackageManager packageManager = this.cordova.getActivity().getPackageManager();
+        callbackContext.success(packageManager.getPackageInfo(this.cordova.getActivity().getPackageName(), 0).versionCode);
+      return true;
+      }
+      return false;
+    } catch (NameNotFoundException e) {
+      callbackContext.success("N/A");
+      return true;
+    }
+  }
+
+}

BIN
cordova/platforms/android/app/src/main/res/drawable-hdpi/ic_action_next_item.png


BIN
cordova/platforms/android/app/src/main/res/drawable-hdpi/ic_action_previous_item.png


BIN
cordova/platforms/android/app/src/main/res/drawable-hdpi/ic_action_remove.png


BIN
cordova/platforms/android/app/src/main/res/drawable-mdpi/ic_action_next_item.png


BIN
cordova/platforms/android/app/src/main/res/drawable-mdpi/ic_action_previous_item.png


BIN
cordova/platforms/android/app/src/main/res/drawable-mdpi/ic_action_remove.png


BIN
cordova/platforms/android/app/src/main/res/drawable-xhdpi/ic_action_next_item.png


BIN
cordova/platforms/android/app/src/main/res/drawable-xhdpi/ic_action_previous_item.png


BIN
cordova/platforms/android/app/src/main/res/drawable-xhdpi/ic_action_remove.png


BIN
cordova/platforms/android/app/src/main/res/drawable-xxhdpi/ic_action_next_item.png


BIN
cordova/platforms/android/app/src/main/res/drawable-xxhdpi/ic_action_previous_item.png


BIN
cordova/platforms/android/app/src/main/res/drawable-xxhdpi/ic_action_remove.png


+ 8 - 2
cordova/platforms/android/app/src/main/res/xml/config.xml

@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='utf-8'?>
-<widget id="com.shotshock.twong" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
+<widget id="com.shotshock.twong" version="1.0.6" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
     <feature name="Whitelist">
         <param name="android-package" value="org.apache.cordova.whitelist.WhitelistPlugin" />
         <param name="onload" value="true" />
@@ -23,11 +23,17 @@
         <param name="android-package" value="org.apache.cordova.statusbar.StatusBar" />
         <param name="onload" value="true" />
     </feature>
+    <feature name="InAppBrowser">
+        <param name="android-package" value="org.apache.cordova.inappbrowser.InAppBrowser" />
+    </feature>
+    <feature name="AppVersion">
+        <param name="android-package" value="uk.co.whiteoctober.cordova.AppVersion" />
+    </feature>
     <name>美天旺</name>
     <description>
         美天旺是完璧时空旗下新型垂直电商App,专注于新经济下的购物服务!
     </description>
-    <author email="dev@cordova.apache.org" href="http://cordova.io">
+    <author email="dev@shopshock.shop" href="http://www.shopshock.shop">
         twong Team
     </author>
     <content src="index.html" />

+ 52 - 322
cordova/platforms/android/platform_www/cordova_plugins.js

@@ -1,334 +1,68 @@
-cordova.define("cordova/plugin_list", function(require, exports, module) {
+cordova.define('cordova/plugin_list', function(require, exports, module) {
   module.exports = [
     {
-      id: "cordova-plugin-device.device",
-      file: "plugins/cordova-plugin-device/www/device.js",
-      pluginId: "cordova-plugin-device",
-      clobbers: ["device"]
+      "id": "cordova-plugin-device.device",
+      "file": "plugins/cordova-plugin-device/www/device.js",
+      "pluginId": "cordova-plugin-device",
+      "clobbers": [
+        "device"
+      ]
     },
     {
-      id: "jpush-phonegap-plugin.JPushPlugin",
-      file: "plugins/jpush-phonegap-plugin/www/JPushPlugin.js",
-      pluginId: "jpush-phonegap-plugin",
-      clobbers: ["JPush"]
+      "id": "jpush-phonegap-plugin.JPushPlugin",
+      "file": "plugins/jpush-phonegap-plugin/www/JPushPlugin.js",
+      "pluginId": "jpush-phonegap-plugin",
+      "clobbers": [
+        "JPush"
+      ]
     },
     {
-      id: "cordova-plugin-wechat.Wechat",
-      file: "plugins/cordova-plugin-wechat/www/wechat.js",
-      pluginId: "cordova-plugin-wechat",
-      clobbers: ["Wechat"]
+      "id": "cordova-plugin-wechat.Wechat",
+      "file": "plugins/cordova-plugin-wechat/www/wechat.js",
+      "pluginId": "cordova-plugin-wechat",
+      "clobbers": [
+        "Wechat"
+      ]
     },
     {
-      id: "cordova-plugin-customurlscheme.LaunchMyApp",
-      file: "plugins/cordova-plugin-customurlscheme/www/android/LaunchMyApp.js",
-      pluginId: "cordova-plugin-customurlscheme",
-      clobbers: ["window.plugins.launchmyapp"]
+      "id": "cordova-plugin-customurlscheme.LaunchMyApp",
+      "file": "plugins/cordova-plugin-customurlscheme/www/android/LaunchMyApp.js",
+      "pluginId": "cordova-plugin-customurlscheme",
+      "clobbers": [
+        "window.plugins.launchmyapp"
+      ]
     },
     {
-      id: "cordova-plugin-fullscreen.AndroidFullScreen",
-      file: "plugins/cordova-plugin-fullscreen/www/AndroidFullScreen.js",
-      pluginId: "cordova-plugin-fullscreen",
-      clobbers: ["AndroidFullScreen"]
+      "id": "cordova-plugin-fullscreen.AndroidFullScreen",
+      "file": "plugins/cordova-plugin-fullscreen/www/AndroidFullScreen.js",
+      "pluginId": "cordova-plugin-fullscreen",
+      "clobbers": [
+        "AndroidFullScreen"
+      ]
     },
     {
-      id: "cordova-plugin-statusbar.statusbar",
-      file: "plugins/cordova-plugin-statusbar/www/statusbar.js",
-      pluginId: "cordova-plugin-statusbar",
-      clobbers: ["window.StatusBar"]
+      "id": "cordova-plugin-statusbar.statusbar",
+      "file": "plugins/cordova-plugin-statusbar/www/statusbar.js",
+      "pluginId": "cordova-plugin-statusbar",
+      "clobbers": [
+        "window.StatusBar"
+      ]
     },
     {
-      id: "code-push.AcquisitionManager",
-      file: "plugins/code-push/script/acquisition-sdk.js",
-      pluginId: "code-push",
-      merges: ["window"]
+      "id": "cordova-plugin-inappbrowser.inappbrowser",
+      "file": "plugins/cordova-plugin-inappbrowser/www/inappbrowser.js",
+      "pluginId": "cordova-plugin-inappbrowser",
+      "clobbers": [
+        "cordova.InAppBrowser.open"
+      ]
     },
     {
-      id: "cordova-plugin-dialogs.notification",
-      file: "plugins/cordova-plugin-dialogs/www/notification.js",
-      pluginId: "cordova-plugin-dialogs",
-      merges: ["navigator.notification"]
-    },
-    {
-      id: "cordova-plugin-dialogs.notification_android",
-      file: "plugins/cordova-plugin-dialogs/www/android/notification.js",
-      pluginId: "cordova-plugin-dialogs",
-      merges: ["navigator.notification"]
-    },
-    {
-      id: "cordova-plugin-file.DirectoryEntry",
-      file: "plugins/cordova-plugin-file/www/DirectoryEntry.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.DirectoryEntry"]
-    },
-    {
-      id: "cordova-plugin-file.DirectoryReader",
-      file: "plugins/cordova-plugin-file/www/DirectoryReader.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.DirectoryReader"]
-    },
-    {
-      id: "cordova-plugin-file.Entry",
-      file: "plugins/cordova-plugin-file/www/Entry.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.Entry"]
-    },
-    {
-      id: "cordova-plugin-file.File",
-      file: "plugins/cordova-plugin-file/www/File.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.File"]
-    },
-    {
-      id: "cordova-plugin-file.FileEntry",
-      file: "plugins/cordova-plugin-file/www/FileEntry.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.FileEntry"]
-    },
-    {
-      id: "cordova-plugin-file.FileError",
-      file: "plugins/cordova-plugin-file/www/FileError.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.FileError"]
-    },
-    {
-      id: "cordova-plugin-file.FileReader",
-      file: "plugins/cordova-plugin-file/www/FileReader.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.FileReader"]
-    },
-    {
-      id: "cordova-plugin-file.FileSystem",
-      file: "plugins/cordova-plugin-file/www/FileSystem.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.FileSystem"]
-    },
-    {
-      id: "cordova-plugin-file.FileUploadOptions",
-      file: "plugins/cordova-plugin-file/www/FileUploadOptions.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.FileUploadOptions"]
-    },
-    {
-      id: "cordova-plugin-file.FileUploadResult",
-      file: "plugins/cordova-plugin-file/www/FileUploadResult.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.FileUploadResult"]
-    },
-    {
-      id: "cordova-plugin-file.FileWriter",
-      file: "plugins/cordova-plugin-file/www/FileWriter.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.FileWriter"]
-    },
-    {
-      id: "cordova-plugin-file.Flags",
-      file: "plugins/cordova-plugin-file/www/Flags.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.Flags"]
-    },
-    {
-      id: "cordova-plugin-file.LocalFileSystem",
-      file: "plugins/cordova-plugin-file/www/LocalFileSystem.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.LocalFileSystem"],
-      merges: ["window"]
-    },
-    {
-      id: "cordova-plugin-file.Metadata",
-      file: "plugins/cordova-plugin-file/www/Metadata.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.Metadata"]
-    },
-    {
-      id: "cordova-plugin-file.ProgressEvent",
-      file: "plugins/cordova-plugin-file/www/ProgressEvent.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.ProgressEvent"]
-    },
-    {
-      id: "cordova-plugin-file.fileSystems",
-      file: "plugins/cordova-plugin-file/www/fileSystems.js",
-      pluginId: "cordova-plugin-file"
-    },
-    {
-      id: "cordova-plugin-file.requestFileSystem",
-      file: "plugins/cordova-plugin-file/www/requestFileSystem.js",
-      pluginId: "cordova-plugin-file",
-      clobbers: ["window.requestFileSystem"]
-    },
-    {
-      id: "cordova-plugin-file.resolveLocalFileSystemURI",
-      file: "plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js",
-      pluginId: "cordova-plugin-file",
-      merges: ["window"]
-    },
-    {
-      id: "cordova-plugin-file.isChrome",
-      file: "plugins/cordova-plugin-file/www/browser/isChrome.js",
-      pluginId: "cordova-plugin-file",
-      runs: true
-    },
-    {
-      id: "cordova-plugin-file.androidFileSystem",
-      file: "plugins/cordova-plugin-file/www/android/FileSystem.js",
-      pluginId: "cordova-plugin-file",
-      merges: ["FileSystem"]
-    },
-    {
-      id: "cordova-plugin-file.fileSystems-roots",
-      file: "plugins/cordova-plugin-file/www/fileSystems-roots.js",
-      pluginId: "cordova-plugin-file",
-      runs: true
-    },
-    {
-      id: "cordova-plugin-file.fileSystemPaths",
-      file: "plugins/cordova-plugin-file/www/fileSystemPaths.js",
-      pluginId: "cordova-plugin-file",
-      merges: ["cordova"],
-      runs: true
-    },
-    {
-      id: "cordova-plugin-advanced-http.cookie-handler",
-      file: "plugins/cordova-plugin-advanced-http/www/cookie-handler.js",
-      pluginId: "cordova-plugin-advanced-http"
-    },
-    {
-      id: "cordova-plugin-advanced-http.dependency-validator",
-      file: "plugins/cordova-plugin-advanced-http/www/dependency-validator.js",
-      pluginId: "cordova-plugin-advanced-http"
-    },
-    {
-      id: "cordova-plugin-advanced-http.error-codes",
-      file: "plugins/cordova-plugin-advanced-http/www/error-codes.js",
-      pluginId: "cordova-plugin-advanced-http"
-    },
-    {
-      id: "cordova-plugin-advanced-http.global-configs",
-      file: "plugins/cordova-plugin-advanced-http/www/global-configs.js",
-      pluginId: "cordova-plugin-advanced-http"
-    },
-    {
-      id: "cordova-plugin-advanced-http.helpers",
-      file: "plugins/cordova-plugin-advanced-http/www/helpers.js",
-      pluginId: "cordova-plugin-advanced-http"
-    },
-    {
-      id: "cordova-plugin-advanced-http.js-util",
-      file: "plugins/cordova-plugin-advanced-http/www/js-util.js",
-      pluginId: "cordova-plugin-advanced-http"
-    },
-    {
-      id: "cordova-plugin-advanced-http.local-storage-store",
-      file: "plugins/cordova-plugin-advanced-http/www/local-storage-store.js",
-      pluginId: "cordova-plugin-advanced-http"
-    },
-    {
-      id: "cordova-plugin-advanced-http.lodash",
-      file: "plugins/cordova-plugin-advanced-http/www/lodash.js",
-      pluginId: "cordova-plugin-advanced-http"
-    },
-    {
-      id: "cordova-plugin-advanced-http.messages",
-      file: "plugins/cordova-plugin-advanced-http/www/messages.js",
-      pluginId: "cordova-plugin-advanced-http"
-    },
-    {
-      id: "cordova-plugin-advanced-http.ponyfills",
-      file: "plugins/cordova-plugin-advanced-http/www/ponyfills.js",
-      pluginId: "cordova-plugin-advanced-http"
-    },
-    {
-      id: "cordova-plugin-advanced-http.public-interface",
-      file: "plugins/cordova-plugin-advanced-http/www/public-interface.js",
-      pluginId: "cordova-plugin-advanced-http"
-    },
-    {
-      id: "cordova-plugin-advanced-http.tough-cookie",
-      file: "plugins/cordova-plugin-advanced-http/www/umd-tough-cookie.js",
-      pluginId: "cordova-plugin-advanced-http"
-    },
-    {
-      id: "cordova-plugin-advanced-http.url-util",
-      file: "plugins/cordova-plugin-advanced-http/www/url-util.js",
-      pluginId: "cordova-plugin-advanced-http"
-    },
-    {
-      id: "cordova-plugin-advanced-http.http",
-      file: "plugins/cordova-plugin-advanced-http/www/advanced-http.js",
-      pluginId: "cordova-plugin-advanced-http",
-      clobbers: ["cordova.plugin.http"]
-    },
-    {
-      id: "cordova-plugin-zip.Zip",
-      file: "plugins/cordova-plugin-zip/zip.js",
-      pluginId: "cordova-plugin-zip",
-      clobbers: ["zip"]
-    },
-    {
-      id: "cordova-plugin-code-push.codePush",
-      file: "plugins/cordova-plugin-code-push/bin/www/codePush.js",
-      pluginId: "cordova-plugin-code-push",
-      clobbers: ["codePush"]
-    },
-    {
-      id: "cordova-plugin-code-push.localPackage",
-      file: "plugins/cordova-plugin-code-push/bin/www/localPackage.js",
-      pluginId: "cordova-plugin-code-push",
-      clobbers: ["LocalPackage"]
-    },
-    {
-      id: "cordova-plugin-code-push.remotePackage",
-      file: "plugins/cordova-plugin-code-push/bin/www/remotePackage.js",
-      pluginId: "cordova-plugin-code-push",
-      clobbers: ["RemotePackage"]
-    },
-    {
-      id: "cordova-plugin-code-push.syncStatus",
-      file: "plugins/cordova-plugin-code-push/bin/www/syncStatus.js",
-      pluginId: "cordova-plugin-code-push",
-      clobbers: ["SyncStatus"]
-    },
-    {
-      id: "cordova-plugin-code-push.installMode",
-      file: "plugins/cordova-plugin-code-push/bin/www/installMode.js",
-      pluginId: "cordova-plugin-code-push",
-      clobbers: ["InstallMode"]
-    },
-    {
-      id: "cordova-plugin-code-push.codePushUtil",
-      file: "plugins/cordova-plugin-code-push/bin/www/codePushUtil.js",
-      pluginId: "cordova-plugin-code-push",
-      runs: true
-    },
-    {
-      id: "cordova-plugin-code-push.fileUtil",
-      file: "plugins/cordova-plugin-code-push/bin/www/fileUtil.js",
-      pluginId: "cordova-plugin-code-push",
-      runs: true
-    },
-    {
-      id: "cordova-plugin-code-push.httpRequester",
-      file: "plugins/cordova-plugin-code-push/bin/www/httpRequester.js",
-      pluginId: "cordova-plugin-code-push",
-      runs: true
-    },
-    {
-      id: "cordova-plugin-code-push.nativeAppInfo",
-      file: "plugins/cordova-plugin-code-push/bin/www/nativeAppInfo.js",
-      pluginId: "cordova-plugin-code-push",
-      runs: true
-    },
-    {
-      id: "cordova-plugin-code-push.package",
-      file: "plugins/cordova-plugin-code-push/bin/www/package.js",
-      pluginId: "cordova-plugin-code-push",
-      runs: true
-    },
-    {
-      id: "cordova-plugin-code-push.sdk",
-      file: "plugins/cordova-plugin-code-push/bin/www/sdk.js",
-      pluginId: "cordova-plugin-code-push",
-      runs: true
+      "id": "cordova-plugin-app-version.AppVersionPlugin",
+      "file": "plugins/cordova-plugin-app-version/www/AppVersionPlugin.js",
+      "pluginId": "cordova-plugin-app-version",
+      "clobbers": [
+        "cordova.getAppVersion"
+      ]
     }
   ];
   module.exports.metadata = {
@@ -340,11 +74,7 @@ cordova.define("cordova/plugin_list", function(require, exports, module) {
     "cordova-plugin-customurlscheme": "5.0.2",
     "cordova-plugin-fullscreen": "1.3.0",
     "cordova-plugin-statusbar": "2.4.3",
-    "code-push": "3.0.1",
-    "cordova-plugin-dialogs": "2.0.2",
-    "cordova-plugin-file": "6.0.2",
-    "cordova-plugin-advanced-http": "3.0.1",
-    "cordova-plugin-zip": "3.1.0",
-    "cordova-plugin-code-push": "1.13.1"
+    "cordova-plugin-inappbrowser": "4.0.0",
+    "cordova-plugin-app-version": "0.1.9"
   };
-});
+});

+ 2 - 2
cordova/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/x.xcuserdatad/xcschemes/xcschememanagement.plist

@@ -7,12 +7,12 @@
 		<key>Cordova.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>1</integer>
+			<integer>2</integer>
 		</dict>
 		<key>CordovaLib.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>2</integer>
+			<integer>1</integer>
 		</dict>
 	</dict>
 </dict>

+ 33 - 1
cordova/platforms/ios/ios.json

@@ -71,6 +71,14 @@
             {
               "xml": "<preference name=\"StatusBarStyle\" value=\"lightcontent\" />",
               "count": 1
+            },
+            {
+              "xml": "<feature name=\"InAppBrowser\"><param name=\"ios-package\" value=\"CDVWKInAppBrowser\" /><param name=\"onload\" value=\"true\" /></feature>",
+              "count": 1
+            },
+            {
+              "xml": "<feature name=\"AppVersion\"><param name=\"ios-package\" value=\"AppVersion\" /></feature>",
+              "count": 1
             }
           ],
           "/widget": []
@@ -137,6 +145,12 @@
     },
     "cordova-plugin-statusbar": {
       "PACKAGE_NAME": "com.shotshock.twong"
+    },
+    "cordova-plugin-inappbrowser": {
+      "PACKAGE_NAME": "com.shotshock.twong"
+    },
+    "cordova-plugin-app-version": {
+      "PACKAGE_NAME": "com.shotshock.twong"
     }
   },
   "dependent_plugins": {},
@@ -188,6 +202,22 @@
       "clobbers": [
         "window.StatusBar"
       ]
+    },
+    {
+      "id": "cordova-plugin-inappbrowser.inappbrowser",
+      "file": "plugins/cordova-plugin-inappbrowser/www/inappbrowser.js",
+      "pluginId": "cordova-plugin-inappbrowser",
+      "clobbers": [
+        "cordova.InAppBrowser.open"
+      ]
+    },
+    {
+      "id": "cordova-plugin-app-version.AppVersionPlugin",
+      "file": "plugins/cordova-plugin-app-version/www/AppVersionPlugin.js",
+      "pluginId": "cordova-plugin-app-version",
+      "clobbers": [
+        "cordova.getAppVersion"
+      ]
     }
   ],
   "plugin_metadata": {
@@ -198,6 +228,8 @@
     "cordova-plugin-whitelist": "1.3.4",
     "jpush-phonegap-plugin": "3.7.6",
     "cordova-plugin-fullscreen": "1.3.0",
-    "cordova-plugin-statusbar": "2.4.3"
+    "cordova-plugin-statusbar": "2.4.3",
+    "cordova-plugin-inappbrowser": "4.0.0",
+    "cordova-plugin-app-version": "0.1.9"
   }
 }

+ 19 - 1
cordova/platforms/ios/platform_www/cordova_plugins.js

@@ -47,6 +47,22 @@ cordova.define('cordova/plugin_list', function(require, exports, module) {
       "clobbers": [
         "window.StatusBar"
       ]
+    },
+    {
+      "id": "cordova-plugin-inappbrowser.inappbrowser",
+      "file": "plugins/cordova-plugin-inappbrowser/www/inappbrowser.js",
+      "pluginId": "cordova-plugin-inappbrowser",
+      "clobbers": [
+        "cordova.InAppBrowser.open"
+      ]
+    },
+    {
+      "id": "cordova-plugin-app-version.AppVersionPlugin",
+      "file": "plugins/cordova-plugin-app-version/www/AppVersionPlugin.js",
+      "pluginId": "cordova-plugin-app-version",
+      "clobbers": [
+        "cordova.getAppVersion"
+      ]
     }
   ];
   module.exports.metadata = {
@@ -57,6 +73,8 @@ cordova.define('cordova/plugin_list', function(require, exports, module) {
     "cordova-plugin-whitelist": "1.3.4",
     "jpush-phonegap-plugin": "3.7.6",
     "cordova-plugin-fullscreen": "1.3.0",
-    "cordova-plugin-statusbar": "2.4.3"
+    "cordova-plugin-statusbar": "2.4.3",
+    "cordova-plugin-inappbrowser": "4.0.0",
+    "cordova-plugin-app-version": "0.1.9"
   };
 });

+ 30 - 0
cordova/platforms/ios/美天旺.xcodeproj/project.pbxproj

@@ -38,6 +38,11 @@
 		E3AA3AE40CB9448FB46EDB8F /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = AD7315985BE04AC2826B9DA8 /* libz.tbd */; };
 		EA6AA10E1AFD4211849F35A4 /* libsqlite3.0.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 6635FB5F08DC4046AE1611BB /* libsqlite3.0.tbd */; };
 		FEB9EE0A34BB4EA9977C8B47 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0CAADBE3351646FBAF9D4CE3 /* CoreFoundation.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
+		5F07DF9034494D6F86FB9A2F /* CDVInAppBrowserOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B7A770BF7304A88BAA712C7 /* CDVInAppBrowserOptions.m */; };
+		BE011F627381465FBA9808F9 /* CDVInAppBrowserNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = A4F8D551733F431C9467CF50 /* CDVInAppBrowserNavigationController.m */; };
+		76AF519C0FED431CBAC4950C /* CDVWKInAppBrowser.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B766F20F1044FCE8CD83901 /* CDVWKInAppBrowser.m */; };
+		F7831C831CEA47C6B24FEFB3 /* CDVWKInAppBrowserUIDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = AAA173FF03CD420AA6B6E317 /* CDVWKInAppBrowserUIDelegate.m */; };
+		DCE8FA8B87564EDF839412A6 /* AppVersion.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E3FC7ADB4F047949DBB8F41 /* AppVersion.m */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
@@ -120,6 +125,16 @@
 		ED33DF2A687741AEAF9F8254 /* Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Bridging-Header.h"; sourceTree = "<group>"; };
 		F4B2976FF2734DD7B85D35C5 /* CDVWechat.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVWechat.h; path = "cordova-plugin-wechat/CDVWechat.h"; sourceTree = "<group>"; };
 		F840E1F0165FE0F500CFE078 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = "美天旺/config.xml"; sourceTree = "<group>"; };
+		6B7A770BF7304A88BAA712C7 /* CDVInAppBrowserOptions.m */ = {isa = PBXFileReference; name = "CDVInAppBrowserOptions.m"; path = "cordova-plugin-inappbrowser/CDVInAppBrowserOptions.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
+		A4F8D551733F431C9467CF50 /* CDVInAppBrowserNavigationController.m */ = {isa = PBXFileReference; name = "CDVInAppBrowserNavigationController.m"; path = "cordova-plugin-inappbrowser/CDVInAppBrowserNavigationController.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
+		2B766F20F1044FCE8CD83901 /* CDVWKInAppBrowser.m */ = {isa = PBXFileReference; name = "CDVWKInAppBrowser.m"; path = "cordova-plugin-inappbrowser/CDVWKInAppBrowser.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
+		AAA173FF03CD420AA6B6E317 /* CDVWKInAppBrowserUIDelegate.m */ = {isa = PBXFileReference; name = "CDVWKInAppBrowserUIDelegate.m"; path = "cordova-plugin-inappbrowser/CDVWKInAppBrowserUIDelegate.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
+		AB8F6BCC053843CBB6B3E537 /* CDVInAppBrowserOptions.h */ = {isa = PBXFileReference; name = "CDVInAppBrowserOptions.h"; path = "cordova-plugin-inappbrowser/CDVInAppBrowserOptions.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
+		ACC9C20C18DF4E8594273680 /* CDVInAppBrowserNavigationController.h */ = {isa = PBXFileReference; name = "CDVInAppBrowserNavigationController.h"; path = "cordova-plugin-inappbrowser/CDVInAppBrowserNavigationController.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
+		916F9573A4C84445B818B3F6 /* CDVWKInAppBrowser.h */ = {isa = PBXFileReference; name = "CDVWKInAppBrowser.h"; path = "cordova-plugin-inappbrowser/CDVWKInAppBrowser.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
+		A5AE479895054E5F88561AB5 /* CDVWKInAppBrowserUIDelegate.h */ = {isa = PBXFileReference; name = "CDVWKInAppBrowserUIDelegate.h"; path = "cordova-plugin-inappbrowser/CDVWKInAppBrowserUIDelegate.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
+		4E3FC7ADB4F047949DBB8F41 /* AppVersion.m */ = {isa = PBXFileReference; name = "AppVersion.m"; path = "cordova-plugin-app-version/AppVersion.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
+		4D77F9DD6D634C5C96F3225C /* AppVersion.h */ = {isa = PBXFileReference; name = "AppVersion.h"; path = "cordova-plugin-app-version/AppVersion.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -276,6 +291,16 @@
 				0A339903732243F8A6F468A8 /* JPUSHService.h */,
 				88032390E7F24525876E7EA5 /* CDVStatusBar.m */,
 				B4BF51C0554344E98E5135C6 /* CDVStatusBar.h */,
+				6B7A770BF7304A88BAA712C7 /* CDVInAppBrowserOptions.m */,
+				A4F8D551733F431C9467CF50 /* CDVInAppBrowserNavigationController.m */,
+				2B766F20F1044FCE8CD83901 /* CDVWKInAppBrowser.m */,
+				AAA173FF03CD420AA6B6E317 /* CDVWKInAppBrowserUIDelegate.m */,
+				AB8F6BCC053843CBB6B3E537 /* CDVInAppBrowserOptions.h */,
+				ACC9C20C18DF4E8594273680 /* CDVInAppBrowserNavigationController.h */,
+				916F9573A4C84445B818B3F6 /* CDVWKInAppBrowser.h */,
+				A5AE479895054E5F88561AB5 /* CDVWKInAppBrowserUIDelegate.h */,
+				4E3FC7ADB4F047949DBB8F41 /* AppVersion.m */,
+				4D77F9DD6D634C5C96F3225C /* AppVersion.h */,
 			);
 			name = Plugins;
 			path = "美天旺/Plugins";
@@ -406,6 +431,11 @@
 				0605FDF6853B470980FFEBA3 /* JPushPlugin.m in Sources */,
 				67496FE971D44BACB7897A0E /* AppDelegate+JPush.m in Sources */,
 				63CCAEFEECE9403B86A9F444 /* CDVStatusBar.m in Sources */,
+				5F07DF9034494D6F86FB9A2F /* CDVInAppBrowserOptions.m in Sources */,
+				BE011F627381465FBA9808F9 /* CDVInAppBrowserNavigationController.m in Sources */,
+				76AF519C0FED431CBAC4950C /* CDVWKInAppBrowser.m in Sources */,
+				F7831C831CEA47C6B24FEFB3 /* CDVWKInAppBrowserUIDelegate.m in Sources */,
+				DCE8FA8B87564EDF839412A6 /* AppVersion.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

BIN
cordova/platforms/ios/美天旺.xcworkspace/xcuserdata/x.xcuserdatad/UserInterfaceState.xcuserstate


+ 1 - 3
cordova/platforms/ios/美天旺/Entitlements-Debug.plist

@@ -4,7 +4,5 @@
 <dict>
 	<key>com.apple.security.application-groups</key>
 	<array/>
-	<key>aps-environment</key>
-	<string>development</string>
 </dict>
-</plist>
+</plist>

+ 1 - 3
cordova/platforms/ios/美天旺/Entitlements-Release.plist

@@ -4,7 +4,5 @@
 <dict>
 	<key>com.apple.security.application-groups</key>
 	<array/>
-	<key>aps-environment</key>
-	<string>production</string>
 </dict>
-</plist>
+</plist>

+ 13 - 0
cordova/platforms/ios/美天旺/Plugins/cordova-plugin-app-version/AppVersion.h

@@ -0,0 +1,13 @@
+#import <Cordova/CDVPlugin.h>
+
+@interface AppVersion : CDVPlugin
+
+- (void)getAppName:(CDVInvokedUrlCommand*)command;
+
+- (void)getPackageName:(CDVInvokedUrlCommand*)command;
+
+- (void)getVersionNumber:(CDVInvokedUrlCommand*)command;
+
+- (void)getVersionCode:(CDVInvokedUrlCommand*)command;
+
+@end

+ 47 - 0
cordova/platforms/ios/美天旺/Plugins/cordova-plugin-app-version/AppVersion.m

@@ -0,0 +1,47 @@
+#import "AppVersion.h"
+#import <Cordova/CDVPluginResult.h>
+
+@implementation AppVersion
+
+- (void)getAppName : (CDVInvokedUrlCommand *)command
+{
+    NSString * callbackId = command.callbackId;
+    NSString * version =[[[NSBundle mainBundle]infoDictionary]objectForKey :@"CFBundleDisplayName"];
+    CDVPluginResult * pluginResult =[CDVPluginResult resultWithStatus : CDVCommandStatus_OK messageAsString : version];
+    [self.commandDelegate sendPluginResult : pluginResult callbackId : callbackId];
+}
+
+- (void)getPackageName:(CDVInvokedUrlCommand*)command
+{
+    NSString* callbackId = command.callbackId;
+    NSString* packageName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"];
+    CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:packageName];
+    [self.commandDelegate sendPluginResult:pluginResult callbackId:callbackId];
+}
+
+- (void)getVersionNumber:(CDVInvokedUrlCommand*)command
+{
+    NSString* callbackId = command.callbackId;
+    NSString* version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
+    if (version == nil) {
+      NSLog(@"CFBundleShortVersionString was nil, attempting CFBundleVersion");
+      version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
+      if (version == nil) {
+        NSLog(@"CFBundleVersion was also nil, giving up");
+        // not calling error callback here to maintain backward compatibility
+      }
+    }
+
+    CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:version];
+    [self.commandDelegate sendPluginResult:pluginResult callbackId:callbackId];
+}
+
+- (void)getVersionCode:(CDVInvokedUrlCommand*)command
+{
+    NSString* callbackId = command.callbackId;
+    NSString* version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
+    CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:version];
+    [self.commandDelegate sendPluginResult:pluginResult callbackId:callbackId];
+}
+
+@end

+ 27 - 0
cordova/platforms/ios/美天旺/Plugins/cordova-plugin-inappbrowser/CDVInAppBrowserNavigationController.h

@@ -0,0 +1,27 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <Cordova/CDVScreenOrientationDelegate.h>
+
+
+@interface CDVInAppBrowserNavigationController : UINavigationController
+
+@property (nonatomic, weak) id <CDVScreenOrientationDelegate> orientationDelegate;
+
+@end

+ 63 - 0
cordova/platforms/ios/美天旺/Plugins/cordova-plugin-inappbrowser/CDVInAppBrowserNavigationController.m

@@ -0,0 +1,63 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import "CDVInAppBrowserNavigationController.h"
+
+@implementation CDVInAppBrowserNavigationController : UINavigationController
+
+- (void) dismissViewControllerAnimated:(BOOL)flag completion:(void (^)(void))completion {
+    if ( self.presentedViewController) {
+        [super dismissViewControllerAnimated:flag completion:completion];
+    }
+}
+
+- (void) viewDidLoad {
+    [super viewDidLoad];
+}
+
+- (CGRect) invertFrameIfNeeded:(CGRect)rect {
+    if (UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation])) {
+        CGFloat temp = rect.size.width;
+        rect.size.width = rect.size.height;
+        rect.size.height = temp;
+    }
+    rect.origin = CGPointZero;
+    return rect;
+}
+
+#pragma mark CDVScreenOrientationDelegate
+
+- (BOOL)shouldAutorotate
+{
+    if ((self.orientationDelegate != nil) && [self.orientationDelegate respondsToSelector:@selector(shouldAutorotate)]) {
+        return [self.orientationDelegate shouldAutorotate];
+    }
+    return YES;
+}
+
+- (UIInterfaceOrientationMask)supportedInterfaceOrientations
+{
+    if ((self.orientationDelegate != nil) && [self.orientationDelegate respondsToSelector:@selector(supportedInterfaceOrientations)]) {
+        return [self.orientationDelegate supportedInterfaceOrientations];
+    }
+
+    return 1 << UIInterfaceOrientationPortrait;
+}
+
+@end

+ 50 - 0
cordova/platforms/ios/美天旺/Plugins/cordova-plugin-inappbrowser/CDVInAppBrowserOptions.h

@@ -0,0 +1,50 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+
+@interface CDVInAppBrowserOptions : NSObject {}
+
+@property (nonatomic, assign) BOOL location;
+@property (nonatomic, assign) BOOL toolbar;
+@property (nonatomic, copy) NSString* closebuttoncaption;
+@property (nonatomic, copy) NSString* closebuttoncolor;
+@property (nonatomic, assign) BOOL lefttoright;
+@property (nonatomic, copy) NSString* toolbarposition;
+@property (nonatomic, copy) NSString* toolbarcolor;
+@property (nonatomic, assign) BOOL toolbartranslucent;
+@property (nonatomic, assign) BOOL hidenavigationbuttons;
+@property (nonatomic, copy) NSString* navigationbuttoncolor;
+@property (nonatomic, assign) BOOL cleardata;
+@property (nonatomic, assign) BOOL clearcache;
+@property (nonatomic, assign) BOOL clearsessioncache;
+@property (nonatomic, assign) BOOL hidespinner;
+
+@property (nonatomic, copy) NSString* presentationstyle;
+@property (nonatomic, copy) NSString* transitionstyle;
+
+@property (nonatomic, assign) BOOL enableviewportscale;
+@property (nonatomic, assign) BOOL mediaplaybackrequiresuseraction;
+@property (nonatomic, assign) BOOL allowinlinemediaplayback;
+@property (nonatomic, assign) BOOL hidden;
+@property (nonatomic, assign) BOOL disallowoverscroll;
+@property (nonatomic, copy) NSString* beforeload;
+
++ (CDVInAppBrowserOptions*)parseOptions:(NSString*)options;
+
+@end

+ 90 - 0
cordova/platforms/ios/美天旺/Plugins/cordova-plugin-inappbrowser/CDVInAppBrowserOptions.m

@@ -0,0 +1,90 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import "CDVInAppBrowserOptions.h"
+
+@implementation CDVInAppBrowserOptions
+
+- (id)init
+{
+    if (self = [super init]) {
+        // default values
+        self.location = YES;
+        self.toolbar = YES;
+        self.closebuttoncaption = nil;
+        self.toolbarposition = @"bottom";
+        self.cleardata = NO;
+        self.clearcache = NO;
+        self.clearsessioncache = NO;
+        self.hidespinner = NO;
+
+        self.enableviewportscale = NO;
+        self.mediaplaybackrequiresuseraction = NO;
+        self.allowinlinemediaplayback = NO;
+        self.hidden = NO;
+        self.disallowoverscroll = NO;
+        self.hidenavigationbuttons = NO;
+        self.closebuttoncolor = nil;
+        self.lefttoright = false;
+        self.toolbarcolor = nil;
+        self.toolbartranslucent = YES;
+        self.beforeload = @"";
+    }
+
+    return self;
+}
+
++ (CDVInAppBrowserOptions*)parseOptions:(NSString*)options
+{
+    CDVInAppBrowserOptions* obj = [[CDVInAppBrowserOptions alloc] init];
+
+    // NOTE: this parsing does not handle quotes within values
+    NSArray* pairs = [options componentsSeparatedByString:@","];
+
+    // parse keys and values, set the properties
+    for (NSString* pair in pairs) {
+        NSArray* keyvalue = [pair componentsSeparatedByString:@"="];
+
+        if ([keyvalue count] == 2) {
+            NSString* key = [[keyvalue objectAtIndex:0] lowercaseString];
+            NSString* value = [keyvalue objectAtIndex:1];
+            NSString* value_lc = [value lowercaseString];
+
+            BOOL isBoolean = [value_lc isEqualToString:@"yes"] || [value_lc isEqualToString:@"no"];
+            NSNumberFormatter* numberFormatter = [[NSNumberFormatter alloc] init];
+            [numberFormatter setAllowsFloats:YES];
+            BOOL isNumber = [numberFormatter numberFromString:value_lc] != nil;
+
+            // set the property according to the key name
+            if ([obj respondsToSelector:NSSelectorFromString(key)]) {
+                if (isNumber) {
+                    [obj setValue:[numberFormatter numberFromString:value_lc] forKey:key];
+                } else if (isBoolean) {
+                    [obj setValue:[NSNumber numberWithBool:[value_lc isEqualToString:@"yes"]] forKey:key];
+                } else {
+                    [obj setValue:value forKey:key];
+                }
+            }
+        }
+    }
+
+    return obj;
+}
+
+@end

+ 80 - 0
cordova/platforms/ios/美天旺/Plugins/cordova-plugin-inappbrowser/CDVWKInAppBrowser.h

@@ -0,0 +1,80 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <Cordova/CDVPlugin.h>
+#import <Cordova/CDVInvokedUrlCommand.h>
+#import <Cordova/CDVScreenOrientationDelegate.h>
+#import "CDVWKInAppBrowserUIDelegate.h"
+#import "CDVInAppBrowserOptions.h"
+#import "CDVInAppBrowserNavigationController.h"
+
+@class CDVWKInAppBrowserViewController;
+
+@interface CDVWKInAppBrowser : CDVPlugin {
+    UIWindow * tmpWindow;
+
+    @private
+    NSString* _beforeload;
+    BOOL _waitForBeforeload;
+}
+
+@property (nonatomic, retain) CDVWKInAppBrowser* instance;
+@property (nonatomic, retain) CDVWKInAppBrowserViewController* inAppBrowserViewController;
+@property (nonatomic, copy) NSString* callbackId;
+@property (nonatomic, copy) NSRegularExpression *callbackIdPattern;
+
++ (id) getInstance;
+- (void)open:(CDVInvokedUrlCommand*)command;
+- (void)close:(CDVInvokedUrlCommand*)command;
+- (void)injectScriptCode:(CDVInvokedUrlCommand*)command;
+- (void)show:(CDVInvokedUrlCommand*)command;
+- (void)hide:(CDVInvokedUrlCommand*)command;
+- (void)loadAfterBeforeload:(CDVInvokedUrlCommand*)command;
+
+@end
+
+@interface CDVWKInAppBrowserViewController : UIViewController <CDVScreenOrientationDelegate,WKNavigationDelegate,WKUIDelegate,WKScriptMessageHandler>{
+    @private
+    CDVInAppBrowserOptions *_browserOptions;
+    NSDictionary *_settings;
+}
+
+@property (nonatomic, strong) IBOutlet WKWebView* webView;
+@property (nonatomic, strong) IBOutlet WKWebViewConfiguration* configuration;
+@property (nonatomic, strong) IBOutlet UIBarButtonItem* closeButton;
+@property (nonatomic, strong) IBOutlet UILabel* addressLabel;
+@property (nonatomic, strong) IBOutlet UIBarButtonItem* backButton;
+@property (nonatomic, strong) IBOutlet UIBarButtonItem* forwardButton;
+@property (nonatomic, strong) IBOutlet UIActivityIndicatorView* spinner;
+@property (nonatomic, strong) IBOutlet UIToolbar* toolbar;
+@property (nonatomic, strong) IBOutlet CDVWKInAppBrowserUIDelegate* webViewUIDelegate;
+
+@property (nonatomic, weak) id <CDVScreenOrientationDelegate> orientationDelegate;
+@property (nonatomic, weak) CDVWKInAppBrowser* navigationDelegate;
+@property (nonatomic) NSURL* currentURL;
+
+- (void)close;
+- (void)navigateTo:(NSURL*)url;
+- (void)showLocationBar:(BOOL)show;
+- (void)showToolBar:(BOOL)show : (NSString *) toolbarPosition;
+- (void)setCloseButtonTitle:(NSString*)title : (NSString*) colorString : (int) buttonIndex;
+
+- (id)initWithBrowserOptions: (CDVInAppBrowserOptions*) browserOptions andSettings:(NSDictionary*) settings;
+
+@end

+ 1261 - 0
cordova/platforms/ios/美天旺/Plugins/cordova-plugin-inappbrowser/CDVWKInAppBrowser.m

@@ -0,0 +1,1261 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+ 
+ http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import "CDVWKInAppBrowser.h"
+
+#if __has_include("CDVWKProcessPoolFactory.h")
+#import "CDVWKProcessPoolFactory.h"
+#endif
+
+#import <Cordova/CDVPluginResult.h>
+
+#define    kInAppBrowserTargetSelf @"_self"
+#define    kInAppBrowserTargetSystem @"_system"
+#define    kInAppBrowserTargetBlank @"_blank"
+
+#define    kInAppBrowserToolbarBarPositionBottom @"bottom"
+#define    kInAppBrowserToolbarBarPositionTop @"top"
+
+#define    IAB_BRIDGE_NAME @"cordova_iab"
+
+#define    TOOLBAR_HEIGHT 44.0
+#define    LOCATIONBAR_HEIGHT 21.0
+#define    FOOTER_HEIGHT ((TOOLBAR_HEIGHT) + (LOCATIONBAR_HEIGHT))
+
+#pragma mark CDVWKInAppBrowser
+
+@interface CDVWKInAppBrowser () {
+    NSInteger _previousStatusBarStyle;
+}
+@end
+
+@implementation CDVWKInAppBrowser
+
+static CDVWKInAppBrowser* instance = nil;
+
++ (id) getInstance{
+    return instance;
+}
+
+- (void)pluginInitialize
+{
+    instance = self;
+    _previousStatusBarStyle = -1;
+    _callbackIdPattern = nil;
+    _beforeload = @"";
+    _waitForBeforeload = NO;
+}
+
+- (void)onReset
+{
+    [self close:nil];
+}
+
+- (void)close:(CDVInvokedUrlCommand*)command
+{
+    if (self.inAppBrowserViewController == nil) {
+        NSLog(@"IAB.close() called but it was already closed.");
+        return;
+    }
+    
+    // Things are cleaned up in browserExit.
+    [self.inAppBrowserViewController close];
+}
+
+- (BOOL) isSystemUrl:(NSURL*)url
+{
+    if ([[url host] isEqualToString:@"itunes.apple.com"]) {
+        return YES;
+    }
+    
+    return NO;
+}
+
+- (void)open:(CDVInvokedUrlCommand*)command
+{
+    CDVPluginResult* pluginResult;
+    
+    NSString* url = [command argumentAtIndex:0];
+    NSString* target = [command argumentAtIndex:1 withDefault:kInAppBrowserTargetSelf];
+    NSString* options = [command argumentAtIndex:2 withDefault:@"" andClass:[NSString class]];
+    
+    self.callbackId = command.callbackId;
+    
+    if (url != nil) {
+        NSURL* baseUrl = [self.webViewEngine URL];
+        NSURL* absoluteUrl = [[NSURL URLWithString:url relativeToURL:baseUrl] absoluteURL];
+        
+        if ([self isSystemUrl:absoluteUrl]) {
+            target = kInAppBrowserTargetSystem;
+        }
+        
+        if ([target isEqualToString:kInAppBrowserTargetSelf]) {
+            [self openInCordovaWebView:absoluteUrl withOptions:options];
+        } else if ([target isEqualToString:kInAppBrowserTargetSystem]) {
+            [self openInSystem:absoluteUrl];
+        } else { // _blank or anything else
+            [self openInInAppBrowser:absoluteUrl withOptions:options];
+        }
+        
+        pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
+    } else {
+        pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"incorrect number of arguments"];
+    }
+    
+    [pluginResult setKeepCallback:[NSNumber numberWithBool:YES]];
+    [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+}
+
+- (void)openInInAppBrowser:(NSURL*)url withOptions:(NSString*)options
+{
+    CDVInAppBrowserOptions* browserOptions = [CDVInAppBrowserOptions parseOptions:options];
+    
+    WKWebsiteDataStore* dataStore = [WKWebsiteDataStore defaultDataStore];
+    if (browserOptions.cleardata) {
+        
+        NSDate* dateFrom = [NSDate dateWithTimeIntervalSince1970:0];
+        [dataStore removeDataOfTypes:[WKWebsiteDataStore allWebsiteDataTypes] modifiedSince:dateFrom completionHandler:^{
+            NSLog(@"Removed all WKWebView data");
+            self.inAppBrowserViewController.webView.configuration.processPool = [[WKProcessPool alloc] init]; // create new process pool to flush all data
+        }];
+    }
+    
+    if (browserOptions.clearcache) {
+        bool isAtLeastiOS11 = false;
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000
+        if (@available(iOS 11.0, *)) {
+            isAtLeastiOS11 = true;
+        }
+#endif
+            
+        if(isAtLeastiOS11){
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000
+            // Deletes all cookies
+            WKHTTPCookieStore* cookieStore = dataStore.httpCookieStore;
+            [cookieStore getAllCookies:^(NSArray* cookies) {
+                NSHTTPCookie* cookie;
+                for(cookie in cookies){
+                    [cookieStore deleteCookie:cookie completionHandler:nil];
+                }
+            }];
+#endif
+        }else{
+            // https://stackoverflow.com/a/31803708/777265
+            // Only deletes domain cookies (not session cookies)
+            [dataStore fetchDataRecordsOfTypes:[WKWebsiteDataStore allWebsiteDataTypes]
+             completionHandler:^(NSArray<WKWebsiteDataRecord *> * __nonnull records) {
+                 for (WKWebsiteDataRecord *record  in records){
+                     NSSet<NSString*>* dataTypes = record.dataTypes;
+                     if([dataTypes containsObject:WKWebsiteDataTypeCookies]){
+                         [[WKWebsiteDataStore defaultDataStore] removeDataOfTypes:record.dataTypes
+                               forDataRecords:@[record]
+                               completionHandler:^{}];
+                     }
+                 }
+             }];
+        }
+    }
+    
+    if (browserOptions.clearsessioncache) {
+        bool isAtLeastiOS11 = false;
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000
+        if (@available(iOS 11.0, *)) {
+            isAtLeastiOS11 = true;
+        }
+#endif
+        if (isAtLeastiOS11) {
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000
+            // Deletes session cookies
+            WKHTTPCookieStore* cookieStore = dataStore.httpCookieStore;
+            [cookieStore getAllCookies:^(NSArray* cookies) {
+                NSHTTPCookie* cookie;
+                for(cookie in cookies){
+                    if(cookie.sessionOnly){
+                        [cookieStore deleteCookie:cookie completionHandler:nil];
+                    }
+                }
+            }];
+#endif
+        }else{
+            NSLog(@"clearsessioncache not available below iOS 11.0");
+        }
+    }
+
+    if (self.inAppBrowserViewController == nil) {
+        self.inAppBrowserViewController = [[CDVWKInAppBrowserViewController alloc] initWithBrowserOptions: browserOptions andSettings:self.commandDelegate.settings];
+        self.inAppBrowserViewController.navigationDelegate = self;
+        
+        if ([self.viewController conformsToProtocol:@protocol(CDVScreenOrientationDelegate)]) {
+            self.inAppBrowserViewController.orientationDelegate = (UIViewController <CDVScreenOrientationDelegate>*)self.viewController;
+        }
+    }
+    
+    [self.inAppBrowserViewController showLocationBar:browserOptions.location];
+    [self.inAppBrowserViewController showToolBar:browserOptions.toolbar :browserOptions.toolbarposition];
+    if (browserOptions.closebuttoncaption != nil || browserOptions.closebuttoncolor != nil) {
+        int closeButtonIndex = browserOptions.lefttoright ? (browserOptions.hidenavigationbuttons ? 1 : 4) : 0;
+        [self.inAppBrowserViewController setCloseButtonTitle:browserOptions.closebuttoncaption :browserOptions.closebuttoncolor :closeButtonIndex];
+    }
+    // Set Presentation Style
+    UIModalPresentationStyle presentationStyle = UIModalPresentationFullScreen; // default
+    if (browserOptions.presentationstyle != nil) {
+        if ([[browserOptions.presentationstyle lowercaseString] isEqualToString:@"pagesheet"]) {
+            presentationStyle = UIModalPresentationPageSheet;
+        } else if ([[browserOptions.presentationstyle lowercaseString] isEqualToString:@"formsheet"]) {
+            presentationStyle = UIModalPresentationFormSheet;
+        }
+    }
+    self.inAppBrowserViewController.modalPresentationStyle = presentationStyle;
+    
+    // Set Transition Style
+    UIModalTransitionStyle transitionStyle = UIModalTransitionStyleCoverVertical; // default
+    if (browserOptions.transitionstyle != nil) {
+        if ([[browserOptions.transitionstyle lowercaseString] isEqualToString:@"fliphorizontal"]) {
+            transitionStyle = UIModalTransitionStyleFlipHorizontal;
+        } else if ([[browserOptions.transitionstyle lowercaseString] isEqualToString:@"crossdissolve"]) {
+            transitionStyle = UIModalTransitionStyleCrossDissolve;
+        }
+    }
+    self.inAppBrowserViewController.modalTransitionStyle = transitionStyle;
+    
+    //prevent webView from bouncing
+    if (browserOptions.disallowoverscroll) {
+        if ([self.inAppBrowserViewController.webView respondsToSelector:@selector(scrollView)]) {
+            ((UIScrollView*)[self.inAppBrowserViewController.webView scrollView]).bounces = NO;
+        } else {
+            for (id subview in self.inAppBrowserViewController.webView.subviews) {
+                if ([[subview class] isSubclassOfClass:[UIScrollView class]]) {
+                    ((UIScrollView*)subview).bounces = NO;
+                }
+            }
+        }
+    }
+    
+    // use of beforeload event
+    if([browserOptions.beforeload isKindOfClass:[NSString class]]){
+        _beforeload = browserOptions.beforeload;
+    }else{
+        _beforeload = @"yes";
+    }
+    _waitForBeforeload = ![_beforeload isEqualToString:@""];
+    
+    [self.inAppBrowserViewController navigateTo:url];
+    if (!browserOptions.hidden) {
+        [self show:nil withNoAnimate:browserOptions.hidden];
+    }
+}
+
+- (void)show:(CDVInvokedUrlCommand*)command{
+    [self show:command withNoAnimate:NO];
+}
+
+- (void)show:(CDVInvokedUrlCommand*)command withNoAnimate:(BOOL)noAnimate
+{
+    BOOL initHidden = NO;
+    if(command == nil && noAnimate == YES){
+        initHidden = YES;
+    }
+    
+    if (self.inAppBrowserViewController == nil) {
+        NSLog(@"Tried to show IAB after it was closed.");
+        return;
+    }
+    if (_previousStatusBarStyle != -1) {
+        NSLog(@"Tried to show IAB while already shown");
+        return;
+    }
+    
+    if(!initHidden){
+        _previousStatusBarStyle = [UIApplication sharedApplication].statusBarStyle;
+    }
+    
+    __block CDVInAppBrowserNavigationController* nav = [[CDVInAppBrowserNavigationController alloc]
+                                                        initWithRootViewController:self.inAppBrowserViewController];
+    nav.orientationDelegate = self.inAppBrowserViewController;
+    nav.navigationBarHidden = YES;
+    nav.modalPresentationStyle = self.inAppBrowserViewController.modalPresentationStyle;
+    
+    __weak CDVWKInAppBrowser* weakSelf = self;
+    
+    // Run later to avoid the "took a long time" log message.
+    dispatch_async(dispatch_get_main_queue(), ^{
+        if (weakSelf.inAppBrowserViewController != nil) {
+            float osVersion = [[[UIDevice currentDevice] systemVersion] floatValue];
+            __strong __typeof(weakSelf) strongSelf = weakSelf;
+            if (!strongSelf->tmpWindow) {
+                CGRect frame = [[UIScreen mainScreen] bounds];
+                if(initHidden && osVersion < 11){
+                   frame.origin.x = -10000;
+                }
+                strongSelf->tmpWindow = [[UIWindow alloc] initWithFrame:frame];
+            }
+            UIViewController *tmpController = [[UIViewController alloc] init];
+
+            [strongSelf->tmpWindow setRootViewController:tmpController];
+            [strongSelf->tmpWindow setWindowLevel:UIWindowLevelNormal];
+
+            if(!initHidden || osVersion < 11){
+                [self->tmpWindow makeKeyAndVisible];
+            }
+            [tmpController presentViewController:nav animated:!noAnimate completion:nil];
+        }
+    });
+}
+
+- (void)hide:(CDVInvokedUrlCommand*)command
+{
+    // Set tmpWindow to hidden to make main webview responsive to touch again
+    // https://stackoverflow.com/questions/4544489/how-to-remove-a-uiwindow
+    self->tmpWindow.hidden = YES;
+    self->tmpWindow = nil;
+
+    if (self.inAppBrowserViewController == nil) {
+        NSLog(@"Tried to hide IAB after it was closed.");
+        return;
+        
+        
+    }
+    if (_previousStatusBarStyle == -1) {
+        NSLog(@"Tried to hide IAB while already hidden");
+        return;
+    }
+    
+    _previousStatusBarStyle = [UIApplication sharedApplication].statusBarStyle;
+    
+    // Run later to avoid the "took a long time" log message.
+    dispatch_async(dispatch_get_main_queue(), ^{
+        if (self.inAppBrowserViewController != nil) {
+            _previousStatusBarStyle = -1;
+            [self.inAppBrowserViewController.presentingViewController dismissViewControllerAnimated:YES completion:nil];
+        }
+    });
+}
+
+- (void)openInCordovaWebView:(NSURL*)url withOptions:(NSString*)options
+{
+    NSURLRequest* request = [NSURLRequest requestWithURL:url];
+    // the webview engine itself will filter for this according to <allow-navigation> policy
+    // in config.xml for cordova-ios-4.0
+    [self.webViewEngine loadRequest:request];
+}
+
+- (void)openInSystem:(NSURL*)url
+{
+    if ([[UIApplication sharedApplication] openURL:url] == NO) {
+        [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]];
+        [[UIApplication sharedApplication] openURL:url];
+    }
+}
+
+- (void)loadAfterBeforeload:(CDVInvokedUrlCommand*)command
+{
+    NSString* urlStr = [command argumentAtIndex:0];
+
+    if ([_beforeload isEqualToString:@""]) {
+        NSLog(@"unexpected loadAfterBeforeload called without feature beforeload=get|post");
+    }
+    if (self.inAppBrowserViewController == nil) {
+        NSLog(@"Tried to invoke loadAfterBeforeload on IAB after it was closed.");
+        return;
+    }
+    if (urlStr == nil) {
+        NSLog(@"loadAfterBeforeload called with nil argument, ignoring.");
+        return;
+    }
+
+    NSURL* url = [NSURL URLWithString:urlStr];
+    //_beforeload = @"";
+    _waitForBeforeload = NO;
+    [self.inAppBrowserViewController navigateTo:url];
+}
+
+// This is a helper method for the inject{Script|Style}{Code|File} API calls, which
+// provides a consistent method for injecting JavaScript code into the document.
+//
+// If a wrapper string is supplied, then the source string will be JSON-encoded (adding
+// quotes) and wrapped using string formatting. (The wrapper string should have a single
+// '%@' marker).
+//
+// If no wrapper is supplied, then the source string is executed directly.
+
+- (void)injectDeferredObject:(NSString*)source withWrapper:(NSString*)jsWrapper
+{
+    // Ensure a message handler bridge is created to communicate with the CDVWKInAppBrowserViewController
+    [self evaluateJavaScript: [NSString stringWithFormat:@"(function(w){if(!w._cdvMessageHandler) {w._cdvMessageHandler = function(id,d){w.webkit.messageHandlers.%@.postMessage({d:d, id:id});}}})(window)", IAB_BRIDGE_NAME]];
+    
+    if (jsWrapper != nil) {
+        NSData* jsonData = [NSJSONSerialization dataWithJSONObject:@[source] options:0 error:nil];
+        NSString* sourceArrayString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
+        if (sourceArrayString) {
+            NSString* sourceString = [sourceArrayString substringWithRange:NSMakeRange(1, [sourceArrayString length] - 2)];
+            NSString* jsToInject = [NSString stringWithFormat:jsWrapper, sourceString];
+            [self evaluateJavaScript:jsToInject];
+        }
+    } else {
+        [self evaluateJavaScript:source];
+    }
+}
+
+
+//Synchronus helper for javascript evaluation
+- (void)evaluateJavaScript:(NSString *)script {
+    __block NSString* _script = script;
+    [self.inAppBrowserViewController.webView evaluateJavaScript:script completionHandler:^(id result, NSError *error) {
+        if (error == nil) {
+            if (result != nil) {
+                NSLog(@"%@", result);
+            }
+        } else {
+            NSLog(@"evaluateJavaScript error : %@ : %@", error.localizedDescription, _script);
+        }
+    }];
+}
+
+- (void)injectScriptCode:(CDVInvokedUrlCommand*)command
+{
+    NSString* jsWrapper = nil;
+    
+    if ((command.callbackId != nil) && ![command.callbackId isEqualToString:@"INVALID"]) {
+        jsWrapper = [NSString stringWithFormat:@"_cdvMessageHandler('%@',JSON.stringify([eval(%%@)]));", command.callbackId];
+    }
+    [self injectDeferredObject:[command argumentAtIndex:0] withWrapper:jsWrapper];
+}
+
+- (void)injectScriptFile:(CDVInvokedUrlCommand*)command
+{
+    NSString* jsWrapper;
+    
+    if ((command.callbackId != nil) && ![command.callbackId isEqualToString:@"INVALID"]) {
+        jsWrapper = [NSString stringWithFormat:@"(function(d) { var c = d.createElement('script'); c.src = %%@; c.onload = function() { _cdvMessageHandler('%@'); }; d.body.appendChild(c); })(document)", command.callbackId];
+    } else {
+        jsWrapper = @"(function(d) { var c = d.createElement('script'); c.src = %@; d.body.appendChild(c); })(document)";
+    }
+    [self injectDeferredObject:[command argumentAtIndex:0] withWrapper:jsWrapper];
+}
+
+- (void)injectStyleCode:(CDVInvokedUrlCommand*)command
+{
+    NSString* jsWrapper;
+    
+    if ((command.callbackId != nil) && ![command.callbackId isEqualToString:@"INVALID"]) {
+        jsWrapper = [NSString stringWithFormat:@"(function(d) { var c = d.createElement('style'); c.innerHTML = %%@; c.onload = function() { _cdvMessageHandler('%@'); }; d.body.appendChild(c); })(document)", command.callbackId];
+    } else {
+        jsWrapper = @"(function(d) { var c = d.createElement('style'); c.innerHTML = %@; d.body.appendChild(c); })(document)";
+    }
+    [self injectDeferredObject:[command argumentAtIndex:0] withWrapper:jsWrapper];
+}
+
+- (void)injectStyleFile:(CDVInvokedUrlCommand*)command
+{
+    NSString* jsWrapper;
+    
+    if ((command.callbackId != nil) && ![command.callbackId isEqualToString:@"INVALID"]) {
+        jsWrapper = [NSString stringWithFormat:@"(function(d) { var c = d.createElement('link'); c.rel='stylesheet'; c.type='text/css'; c.href = %%@; c.onload = function() { _cdvMessageHandler('%@'); }; d.body.appendChild(c); })(document)", command.callbackId];
+    } else {
+        jsWrapper = @"(function(d) { var c = d.createElement('link'); c.rel='stylesheet', c.type='text/css'; c.href = %@; d.body.appendChild(c); })(document)";
+    }
+    [self injectDeferredObject:[command argumentAtIndex:0] withWrapper:jsWrapper];
+}
+
+- (BOOL)isValidCallbackId:(NSString *)callbackId
+{
+    NSError *err = nil;
+    // Initialize on first use
+    if (self.callbackIdPattern == nil) {
+        self.callbackIdPattern = [NSRegularExpression regularExpressionWithPattern:@"^InAppBrowser[0-9]{1,10}$" options:0 error:&err];
+        if (err != nil) {
+            // Couldn't initialize Regex; No is safer than Yes.
+            return NO;
+        }
+    }
+    if ([self.callbackIdPattern firstMatchInString:callbackId options:0 range:NSMakeRange(0, [callbackId length])]) {
+        return YES;
+    }
+    return NO;
+}
+
+/**
+ * The message handler bridge provided for the InAppBrowser is capable of executing any oustanding callback belonging
+ * to the InAppBrowser plugin. Care has been taken that other callbacks cannot be triggered, and that no
+ * other code execution is possible.
+ */
+- (void)webView:(WKWebView *)theWebView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {
+    
+    NSURL* url = navigationAction.request.URL;
+    NSURL* mainDocumentURL = navigationAction.request.mainDocumentURL;
+    BOOL isTopLevelNavigation = [url isEqual:mainDocumentURL];
+    BOOL shouldStart = YES;
+    BOOL useBeforeLoad = NO;
+    NSString* httpMethod = navigationAction.request.HTTPMethod;
+    NSString* errorMessage = nil;
+    
+    if([_beforeload isEqualToString:@"post"]){
+        //TODO handle POST requests by preserving POST data then remove this condition
+        errorMessage = @"beforeload doesn't yet support POST requests";
+    }
+    else if(isTopLevelNavigation && (
+           [_beforeload isEqualToString:@"yes"]
+       || ([_beforeload isEqualToString:@"get"] && [httpMethod isEqualToString:@"GET"])
+    // TODO comment in when POST requests are handled
+    // || ([_beforeload isEqualToString:@"post"] && [httpMethod isEqualToString:@"POST"])
+    )){
+        useBeforeLoad = YES;
+    }
+
+    // When beforeload, on first URL change, initiate JS callback. Only after the beforeload event, continue.
+    if (_waitForBeforeload && useBeforeLoad) {
+        CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
+                                                      messageAsDictionary:@{@"type":@"beforeload", @"url":[url absoluteString]}];
+        [pluginResult setKeepCallback:[NSNumber numberWithBool:YES]];
+        
+        [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
+        decisionHandler(WKNavigationActionPolicyCancel);
+        return;
+    }
+    
+    if(errorMessage != nil){
+        NSLog(errorMessage);
+        CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR
+                                                      messageAsDictionary:@{@"type":@"loaderror", @"url":[url absoluteString], @"code": @"-1", @"message": errorMessage}];
+        [pluginResult setKeepCallback:[NSNumber numberWithBool:YES]];
+        [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
+    }
+    
+    //if is an app store link, let the system handle it, otherwise it fails to load it
+    if ([[ url scheme] isEqualToString:@"itms-appss"] || [[ url scheme] isEqualToString:@"itms-apps"]) {
+        [theWebView stopLoading];
+        [self openInSystem:url];
+        shouldStart = NO;
+    }
+    else if ((self.callbackId != nil) && isTopLevelNavigation) {
+        // Send a loadstart event for each top-level navigation (includes redirects).
+        CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
+                                                      messageAsDictionary:@{@"type":@"loadstart", @"url":[url absoluteString]}];
+        [pluginResult setKeepCallback:[NSNumber numberWithBool:YES]];
+        
+        [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
+    }
+
+    if (useBeforeLoad) {
+        _waitForBeforeload = YES;
+    }
+    
+    if(shouldStart){
+        // Fix GH-417 & GH-424: Handle non-default target attribute
+        // Based on https://stackoverflow.com/a/25713070/777265
+        if (!navigationAction.targetFrame){
+            [theWebView loadRequest:navigationAction.request];
+            decisionHandler(WKNavigationActionPolicyCancel);
+        }else{
+            decisionHandler(WKNavigationActionPolicyAllow);
+        }
+    }else{
+        decisionHandler(WKNavigationActionPolicyCancel);
+    }
+}
+
+#pragma mark WKScriptMessageHandler delegate
+- (void)userContentController:(nonnull WKUserContentController *)userContentController didReceiveScriptMessage:(nonnull WKScriptMessage *)message {
+    
+    CDVPluginResult* pluginResult = nil;
+    
+    if([message.body isKindOfClass:[NSDictionary class]]){
+        NSDictionary* messageContent = (NSDictionary*) message.body;
+        NSString* scriptCallbackId = messageContent[@"id"];
+        
+        if([messageContent objectForKey:@"d"]){
+            NSString* scriptResult = messageContent[@"d"];
+            NSError* __autoreleasing error = nil;
+            NSData* decodedResult = [NSJSONSerialization JSONObjectWithData:[scriptResult dataUsingEncoding:NSUTF8StringEncoding] options:kNilOptions error:&error];
+            if ((error == nil) && [decodedResult isKindOfClass:[NSArray class]]) {
+                pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray:(NSArray*)decodedResult];
+            } else {
+                pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_JSON_EXCEPTION];
+            }
+        } else {
+            pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray:@[]];
+        }
+        [self.commandDelegate sendPluginResult:pluginResult callbackId:scriptCallbackId];
+    }else if(self.callbackId != nil){
+        // Send a message event
+        NSString* messageContent = (NSString*) message.body;
+        NSError* __autoreleasing error = nil;
+        NSData* decodedResult = [NSJSONSerialization JSONObjectWithData:[messageContent dataUsingEncoding:NSUTF8StringEncoding] options:kNilOptions error:&error];
+        if (error == nil) {
+            NSMutableDictionary* dResult = [NSMutableDictionary new];
+            [dResult setValue:@"message" forKey:@"type"];
+            [dResult setObject:decodedResult forKey:@"data"];
+            CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:dResult];
+            [pluginResult setKeepCallback:[NSNumber numberWithBool:YES]];
+            [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
+        }
+    }
+}
+
+- (void)didStartProvisionalNavigation:(WKWebView*)theWebView
+{
+    NSLog(@"didStartProvisionalNavigation");
+//    self.inAppBrowserViewController.currentURL = theWebView.URL;
+}
+
+- (void)didFinishNavigation:(WKWebView*)theWebView
+{
+    if (self.callbackId != nil) {
+        NSString* url = [theWebView.URL absoluteString];
+        if(url == nil){
+            if(self.inAppBrowserViewController.currentURL != nil){
+                url = [self.inAppBrowserViewController.currentURL absoluteString];
+            }else{
+                url = @"";
+            }
+        }
+        CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
+                                                      messageAsDictionary:@{@"type":@"loadstop", @"url":url}];
+        [pluginResult setKeepCallback:[NSNumber numberWithBool:YES]];
+        
+        [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
+    }
+}
+
+- (void)webView:(WKWebView*)theWebView didFailNavigation:(NSError*)error
+{
+    if (self.callbackId != nil) {
+        NSString* url = [theWebView.URL absoluteString];
+        if(url == nil){
+            if(self.inAppBrowserViewController.currentURL != nil){
+                url = [self.inAppBrowserViewController.currentURL absoluteString];
+            }else{
+                url = @"";
+            }
+        }
+        CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR
+                                                      messageAsDictionary:@{@"type":@"loaderror", @"url":url, @"code": [NSNumber numberWithInteger:error.code], @"message": error.localizedDescription}];
+        [pluginResult setKeepCallback:[NSNumber numberWithBool:YES]];
+        
+        [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
+    }
+}
+
+- (void)browserExit
+{
+    if (self.callbackId != nil) {
+        CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
+                                                      messageAsDictionary:@{@"type":@"exit"}];
+        [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
+        self.callbackId = nil;
+    }
+    
+    [self.inAppBrowserViewController.configuration.userContentController removeScriptMessageHandlerForName:IAB_BRIDGE_NAME];
+    self.inAppBrowserViewController.configuration = nil;
+    
+    [self.inAppBrowserViewController.webView stopLoading];
+    [self.inAppBrowserViewController.webView removeFromSuperview];
+    [self.inAppBrowserViewController.webView setUIDelegate:nil];
+    [self.inAppBrowserViewController.webView setNavigationDelegate:nil];
+    self.inAppBrowserViewController.webView = nil;
+    
+    // Set navigationDelegate to nil to ensure no callbacks are received from it.
+    self.inAppBrowserViewController.navigationDelegate = nil;
+    self.inAppBrowserViewController = nil;
+
+    // Set tmpWindow to hidden to make main webview responsive to touch again
+    // Based on https://stackoverflow.com/questions/4544489/how-to-remove-a-uiwindow
+    self->tmpWindow.hidden = YES;
+    self->tmpWindow = nil;
+
+    if (IsAtLeastiOSVersion(@"7.0")) {
+        if (_previousStatusBarStyle != -1) {
+            [[UIApplication sharedApplication] setStatusBarStyle:_previousStatusBarStyle];
+            
+        }
+    }
+    
+    _previousStatusBarStyle = -1; // this value was reset before reapplying it. caused statusbar to stay black on ios7
+}
+
+@end //CDVWKInAppBrowser
+
+#pragma mark CDVWKInAppBrowserViewController
+
+@implementation CDVWKInAppBrowserViewController
+
+@synthesize currentURL;
+
+CGFloat lastReducedStatusBarHeight = 0.0;
+BOOL isExiting = FALSE;
+
+- (id)initWithBrowserOptions: (CDVInAppBrowserOptions*) browserOptions andSettings:(NSDictionary *)settings
+{
+    self = [super init];
+    if (self != nil) {
+        _browserOptions = browserOptions;
+        _settings = settings;
+        self.webViewUIDelegate = [[CDVWKInAppBrowserUIDelegate alloc] initWithTitle:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]];
+        [self.webViewUIDelegate setViewController:self];
+        
+        [self createViews];
+    }
+    
+    return self;
+}
+
+-(void)dealloc {
+    //NSLog(@"dealloc");
+}
+
+- (void)createViews
+{
+    // We create the views in code for primarily for ease of upgrades and not requiring an external .xib to be included
+    
+    CGRect webViewBounds = self.view.bounds;
+    BOOL toolbarIsAtBottom = ![_browserOptions.toolbarposition isEqualToString:kInAppBrowserToolbarBarPositionTop];
+    webViewBounds.size.height -= _browserOptions.location ? FOOTER_HEIGHT : TOOLBAR_HEIGHT;
+    WKUserContentController* userContentController = [[WKUserContentController alloc] init];
+    
+    WKWebViewConfiguration* configuration = [[WKWebViewConfiguration alloc] init];
+    
+    NSString *userAgent = configuration.applicationNameForUserAgent;
+    if (
+        [self settingForKey:@"OverrideUserAgent"] == nil &&
+        [self settingForKey:@"AppendUserAgent"] != nil
+        ) {
+        userAgent = [NSString stringWithFormat:@"%@ %@", userAgent, [self settingForKey:@"AppendUserAgent"]];
+    }
+    configuration.applicationNameForUserAgent = userAgent;
+    configuration.userContentController = userContentController;
+#if __has_include("CDVWKProcessPoolFactory.h")
+    configuration.processPool = [[CDVWKProcessPoolFactory sharedFactory] sharedProcessPool];
+#endif
+    [configuration.userContentController addScriptMessageHandler:self name:IAB_BRIDGE_NAME];
+    
+    //WKWebView options
+    configuration.allowsInlineMediaPlayback = _browserOptions.allowinlinemediaplayback;
+    if (IsAtLeastiOSVersion(@"10.0")) {
+        configuration.ignoresViewportScaleLimits = _browserOptions.enableviewportscale;
+        if(_browserOptions.mediaplaybackrequiresuseraction == YES){
+            configuration.mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeAll;
+        }else{
+            configuration.mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeNone;
+        }
+    }else{ // iOS 9
+        configuration.mediaPlaybackRequiresUserAction = _browserOptions.mediaplaybackrequiresuseraction;
+    }
+    
+    
+
+    self.webView = [[WKWebView alloc] initWithFrame:webViewBounds configuration:configuration];
+    
+    [self.view addSubview:self.webView];
+    [self.view sendSubviewToBack:self.webView];
+    
+    
+    self.webView.navigationDelegate = self;
+    self.webView.UIDelegate = self.webViewUIDelegate;
+    self.webView.backgroundColor = [UIColor whiteColor];
+    if ([self settingForKey:@"OverrideUserAgent"] != nil) {
+        self.webView.customUserAgent = [self settingForKey:@"OverrideUserAgent"];
+    }
+    
+    self.webView.clearsContextBeforeDrawing = YES;
+    self.webView.clipsToBounds = YES;
+    self.webView.contentMode = UIViewContentModeScaleToFill;
+    self.webView.multipleTouchEnabled = YES;
+    self.webView.opaque = YES;
+    self.webView.userInteractionEnabled = YES;
+    self.automaticallyAdjustsScrollViewInsets = YES ;
+    [self.webView setAutoresizingMask:UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth];
+    self.webView.allowsLinkPreview = NO;
+    self.webView.allowsBackForwardNavigationGestures = NO;
+    
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000
+   if (@available(iOS 11.0, *)) {
+       [self.webView.scrollView setContentInsetAdjustmentBehavior:UIScrollViewContentInsetAdjustmentNever];
+   }
+#endif
+    
+    self.spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
+    self.spinner.alpha = 1.000;
+    self.spinner.autoresizesSubviews = YES;
+    self.spinner.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleRightMargin);
+    self.spinner.clearsContextBeforeDrawing = NO;
+    self.spinner.clipsToBounds = NO;
+    self.spinner.contentMode = UIViewContentModeScaleToFill;
+    self.spinner.frame = CGRectMake(CGRectGetMidX(self.webView.frame), CGRectGetMidY(self.webView.frame), 20.0, 20.0);
+    self.spinner.hidden = NO;
+    self.spinner.hidesWhenStopped = YES;
+    self.spinner.multipleTouchEnabled = NO;
+    self.spinner.opaque = NO;
+    self.spinner.userInteractionEnabled = NO;
+    [self.spinner stopAnimating];
+    
+    self.closeButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(close)];
+    self.closeButton.enabled = YES;
+    
+    UIBarButtonItem* flexibleSpaceButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
+    
+    UIBarButtonItem* fixedSpaceButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
+    fixedSpaceButton.width = 20;
+    
+    float toolbarY = toolbarIsAtBottom ? self.view.bounds.size.height - TOOLBAR_HEIGHT : 0.0;
+    CGRect toolbarFrame = CGRectMake(0.0, toolbarY, self.view.bounds.size.width, TOOLBAR_HEIGHT);
+    
+    self.toolbar = [[UIToolbar alloc] initWithFrame:toolbarFrame];
+    self.toolbar.alpha = 1.000;
+    self.toolbar.autoresizesSubviews = YES;
+    self.toolbar.autoresizingMask = toolbarIsAtBottom ? (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin) : UIViewAutoresizingFlexibleWidth;
+    self.toolbar.barStyle = UIBarStyleBlackOpaque;
+    self.toolbar.clearsContextBeforeDrawing = NO;
+    self.toolbar.clipsToBounds = NO;
+    self.toolbar.contentMode = UIViewContentModeScaleToFill;
+    self.toolbar.hidden = NO;
+    self.toolbar.multipleTouchEnabled = NO;
+    self.toolbar.opaque = NO;
+    self.toolbar.userInteractionEnabled = YES;
+    if (_browserOptions.toolbarcolor != nil) { // Set toolbar color if user sets it in options
+      self.toolbar.barTintColor = [self colorFromHexString:_browserOptions.toolbarcolor];
+    }
+    if (!_browserOptions.toolbartranslucent) { // Set toolbar translucent to no if user sets it in options
+      self.toolbar.translucent = NO;
+    }
+    
+    CGFloat labelInset = 5.0;
+    float locationBarY = toolbarIsAtBottom ? self.view.bounds.size.height - FOOTER_HEIGHT : self.view.bounds.size.height - LOCATIONBAR_HEIGHT;
+    
+    self.addressLabel = [[UILabel alloc] initWithFrame:CGRectMake(labelInset, locationBarY, self.view.bounds.size.width - labelInset, LOCATIONBAR_HEIGHT)];
+    self.addressLabel.adjustsFontSizeToFitWidth = NO;
+    self.addressLabel.alpha = 1.000;
+    self.addressLabel.autoresizesSubviews = YES;
+    self.addressLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin;
+    self.addressLabel.backgroundColor = [UIColor clearColor];
+    self.addressLabel.baselineAdjustment = UIBaselineAdjustmentAlignCenters;
+    self.addressLabel.clearsContextBeforeDrawing = YES;
+    self.addressLabel.clipsToBounds = YES;
+    self.addressLabel.contentMode = UIViewContentModeScaleToFill;
+    self.addressLabel.enabled = YES;
+    self.addressLabel.hidden = NO;
+    self.addressLabel.lineBreakMode = NSLineBreakByTruncatingTail;
+    
+    if ([self.addressLabel respondsToSelector:NSSelectorFromString(@"setMinimumScaleFactor:")]) {
+        [self.addressLabel setValue:@(10.0/[UIFont labelFontSize]) forKey:@"minimumScaleFactor"];
+    } else if ([self.addressLabel respondsToSelector:NSSelectorFromString(@"setMinimumFontSize:")]) {
+        [self.addressLabel setValue:@(10.0) forKey:@"minimumFontSize"];
+    }
+    
+    self.addressLabel.multipleTouchEnabled = NO;
+    self.addressLabel.numberOfLines = 1;
+    self.addressLabel.opaque = NO;
+    self.addressLabel.shadowOffset = CGSizeMake(0.0, -1.0);
+    self.addressLabel.text = NSLocalizedString(@"Loading...", nil);
+    self.addressLabel.textAlignment = NSTextAlignmentLeft;
+    self.addressLabel.textColor = [UIColor colorWithWhite:1.000 alpha:1.000];
+    self.addressLabel.userInteractionEnabled = NO;
+    
+    NSString* frontArrowString = NSLocalizedString(@"►", nil); // create arrow from Unicode char
+    self.forwardButton = [[UIBarButtonItem alloc] initWithTitle:frontArrowString style:UIBarButtonItemStylePlain target:self action:@selector(goForward:)];
+    self.forwardButton.enabled = YES;
+    self.forwardButton.imageInsets = UIEdgeInsetsZero;
+    if (_browserOptions.navigationbuttoncolor != nil) { // Set button color if user sets it in options
+      self.forwardButton.tintColor = [self colorFromHexString:_browserOptions.navigationbuttoncolor];
+    }
+
+    NSString* backArrowString = NSLocalizedString(@"◄", nil); // create arrow from Unicode char
+    self.backButton = [[UIBarButtonItem alloc] initWithTitle:backArrowString style:UIBarButtonItemStylePlain target:self action:@selector(goBack:)];
+    self.backButton.enabled = YES;
+    self.backButton.imageInsets = UIEdgeInsetsZero;
+    if (_browserOptions.navigationbuttoncolor != nil) { // Set button color if user sets it in options
+      self.backButton.tintColor = [self colorFromHexString:_browserOptions.navigationbuttoncolor];
+    }
+
+    // Filter out Navigation Buttons if user requests so
+    if (_browserOptions.hidenavigationbuttons) {
+        if (_browserOptions.lefttoright) {
+            [self.toolbar setItems:@[flexibleSpaceButton, self.closeButton]];
+        } else {
+            [self.toolbar setItems:@[self.closeButton, flexibleSpaceButton]];
+        }
+    } else if (_browserOptions.lefttoright) {
+        [self.toolbar setItems:@[self.backButton, fixedSpaceButton, self.forwardButton, flexibleSpaceButton, self.closeButton]];
+    } else {
+        [self.toolbar setItems:@[self.closeButton, flexibleSpaceButton, self.backButton, fixedSpaceButton, self.forwardButton]];
+    }
+    
+    self.view.backgroundColor = [UIColor clearColor];
+    [self.view addSubview:self.toolbar];
+    [self.view addSubview:self.addressLabel];
+    [self.view addSubview:self.spinner];
+}
+
+- (id)settingForKey:(NSString*)key
+{
+    return [_settings objectForKey:[key lowercaseString]];
+}
+
+- (void) setWebViewFrame : (CGRect) frame {
+    NSLog(@"Setting the WebView's frame to %@", NSStringFromCGRect(frame));
+    [self.webView setFrame:frame];
+}
+
+- (void)setCloseButtonTitle:(NSString*)title : (NSString*) colorString : (int) buttonIndex
+{
+    // the advantage of using UIBarButtonSystemItemDone is the system will localize it for you automatically
+    // but, if you want to set this yourself, knock yourself out (we can't set the title for a system Done button, so we have to create a new one)
+    self.closeButton = nil;
+    // Initialize with title if title is set, otherwise the title will be 'Done' localized
+    self.closeButton = title != nil ? [[UIBarButtonItem alloc] initWithTitle:title style:UIBarButtonItemStyleBordered target:self action:@selector(close)] : [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(close)];
+    self.closeButton.enabled = YES;
+    // If color on closebutton is requested then initialize with that that color, otherwise use initialize with default
+    self.closeButton.tintColor = colorString != nil ? [self colorFromHexString:colorString] : [UIColor colorWithRed:60.0 / 255.0 green:136.0 / 255.0 blue:230.0 / 255.0 alpha:1];
+    
+    NSMutableArray* items = [self.toolbar.items mutableCopy];
+    [items replaceObjectAtIndex:buttonIndex withObject:self.closeButton];
+    [self.toolbar setItems:items];
+}
+
+- (void)showLocationBar:(BOOL)show
+{
+    CGRect locationbarFrame = self.addressLabel.frame;
+    
+    BOOL toolbarVisible = !self.toolbar.hidden;
+    
+    // prevent double show/hide
+    if (show == !(self.addressLabel.hidden)) {
+        return;
+    }
+    
+    if (show) {
+        self.addressLabel.hidden = NO;
+        
+        if (toolbarVisible) {
+            // toolBar at the bottom, leave as is
+            // put locationBar on top of the toolBar
+            
+            CGRect webViewBounds = self.view.bounds;
+            webViewBounds.size.height -= FOOTER_HEIGHT;
+            [self setWebViewFrame:webViewBounds];
+            
+            locationbarFrame.origin.y = webViewBounds.size.height;
+            self.addressLabel.frame = locationbarFrame;
+        } else {
+            // no toolBar, so put locationBar at the bottom
+            
+            CGRect webViewBounds = self.view.bounds;
+            webViewBounds.size.height -= LOCATIONBAR_HEIGHT;
+            [self setWebViewFrame:webViewBounds];
+            
+            locationbarFrame.origin.y = webViewBounds.size.height;
+            self.addressLabel.frame = locationbarFrame;
+        }
+    } else {
+        self.addressLabel.hidden = YES;
+        
+        if (toolbarVisible) {
+            // locationBar is on top of toolBar, hide locationBar
+            
+            // webView take up whole height less toolBar height
+            CGRect webViewBounds = self.view.bounds;
+            webViewBounds.size.height -= TOOLBAR_HEIGHT;
+            [self setWebViewFrame:webViewBounds];
+        } else {
+            // no toolBar, expand webView to screen dimensions
+            [self setWebViewFrame:self.view.bounds];
+        }
+    }
+}
+
+- (void)showToolBar:(BOOL)show : (NSString *) toolbarPosition
+{
+    CGRect toolbarFrame = self.toolbar.frame;
+    CGRect locationbarFrame = self.addressLabel.frame;
+    
+    BOOL locationbarVisible = !self.addressLabel.hidden;
+    
+    // prevent double show/hide
+    if (show == !(self.toolbar.hidden)) {
+        return;
+    }
+    
+    if (show) {
+        self.toolbar.hidden = NO;
+        CGRect webViewBounds = self.view.bounds;
+        
+        if (locationbarVisible) {
+            // locationBar at the bottom, move locationBar up
+            // put toolBar at the bottom
+            webViewBounds.size.height -= FOOTER_HEIGHT;
+            locationbarFrame.origin.y = webViewBounds.size.height;
+            self.addressLabel.frame = locationbarFrame;
+            self.toolbar.frame = toolbarFrame;
+        } else {
+            // no locationBar, so put toolBar at the bottom
+            CGRect webViewBounds = self.view.bounds;
+            webViewBounds.size.height -= TOOLBAR_HEIGHT;
+            self.toolbar.frame = toolbarFrame;
+        }
+        
+        if ([toolbarPosition isEqualToString:kInAppBrowserToolbarBarPositionTop]) {
+            toolbarFrame.origin.y = 0;
+            webViewBounds.origin.y += toolbarFrame.size.height;
+            [self setWebViewFrame:webViewBounds];
+        } else {
+            toolbarFrame.origin.y = (webViewBounds.size.height + LOCATIONBAR_HEIGHT);
+        }
+        [self setWebViewFrame:webViewBounds];
+        
+    } else {
+        self.toolbar.hidden = YES;
+        
+        if (locationbarVisible) {
+            // locationBar is on top of toolBar, hide toolBar
+            // put locationBar at the bottom
+            
+            // webView take up whole height less locationBar height
+            CGRect webViewBounds = self.view.bounds;
+            webViewBounds.size.height -= LOCATIONBAR_HEIGHT;
+            [self setWebViewFrame:webViewBounds];
+            
+            // move locationBar down
+            locationbarFrame.origin.y = webViewBounds.size.height;
+            self.addressLabel.frame = locationbarFrame;
+        } else {
+            // no locationBar, expand webView to screen dimensions
+            [self setWebViewFrame:self.view.bounds];
+        }
+    }
+}
+
+- (void)viewDidLoad
+{
+    [super viewDidLoad];
+}
+
+- (void)viewDidDisappear:(BOOL)animated
+{
+    [super viewDidDisappear:animated];
+    if (isExiting && (self.navigationDelegate != nil) && [self.navigationDelegate respondsToSelector:@selector(browserExit)]) {
+        [self.navigationDelegate browserExit];
+        isExiting = FALSE;
+    }
+}
+
+- (UIStatusBarStyle)preferredStatusBarStyle
+{
+    return UIStatusBarStyleDefault;
+}
+
+- (BOOL)prefersStatusBarHidden {
+    return NO;
+}
+
+- (void)close
+{
+    self.currentURL = nil;
+    
+    __weak UIViewController* weakSelf = self;
+    
+    // Run later to avoid the "took a long time" log message.
+    dispatch_async(dispatch_get_main_queue(), ^{
+        isExiting = TRUE;
+        if ([weakSelf respondsToSelector:@selector(presentingViewController)]) {
+            [[weakSelf presentingViewController] dismissViewControllerAnimated:YES completion:nil];
+        } else {
+            [[weakSelf parentViewController] dismissViewControllerAnimated:YES completion:nil];
+        }
+    });
+}
+
+- (void)navigateTo:(NSURL*)url
+{
+    if ([url.scheme isEqualToString:@"file"]) {
+        [self.webView loadFileURL:url allowingReadAccessToURL:url];
+    } else {
+        NSURLRequest* request = [NSURLRequest requestWithURL:url];
+        [self.webView loadRequest:request];
+    }
+}
+
+- (void)goBack:(id)sender
+{
+    [self.webView goBack];
+}
+
+- (void)goForward:(id)sender
+{
+    [self.webView goForward];
+}
+
+- (void)viewWillAppear:(BOOL)animated
+{
+    [self rePositionViews];
+    
+    [super viewWillAppear:animated];
+}
+
+//
+// On iOS 7 the status bar is part of the view's dimensions, therefore it's height has to be taken into account.
+// The height of it could be hardcoded as 20 pixels, but that would assume that the upcoming releases of iOS won't
+// change that value.
+//
+- (float) getStatusBarOffset {
+    return (float) IsAtLeastiOSVersion(@"7.0") ? [[UIApplication sharedApplication] statusBarFrame].size.height : 0.0;
+}
+
+- (void) rePositionViews {
+    CGRect viewBounds = [self.webView bounds];
+    CGFloat statusBarHeight = [self getStatusBarOffset];
+    
+    // orientation portrait or portraitUpsideDown: status bar is on the top and web view is to be aligned to the bottom of the status bar
+    // orientation landscapeLeft or landscapeRight: status bar height is 0 in but lets account for it in case things ever change in the future
+    viewBounds.origin.y = statusBarHeight;
+    
+    // account for web view height portion that may have been reduced by a previous call to this method
+    viewBounds.size.height = viewBounds.size.height - statusBarHeight + lastReducedStatusBarHeight;
+    lastReducedStatusBarHeight = statusBarHeight;
+    
+    if ((_browserOptions.toolbar) && ([_browserOptions.toolbarposition isEqualToString:kInAppBrowserToolbarBarPositionTop])) {
+        // if we have to display the toolbar on top of the web view, we need to account for its height
+        viewBounds.origin.y += TOOLBAR_HEIGHT;
+        self.toolbar.frame = CGRectMake(self.toolbar.frame.origin.x, statusBarHeight, self.toolbar.frame.size.width, self.toolbar.frame.size.height);
+    }
+    
+    self.webView.frame = viewBounds;
+}
+
+// Helper function to convert hex color string to UIColor
+// Assumes input like "#00FF00" (#RRGGBB).
+// Taken from https://stackoverflow.com/questions/1560081/how-can-i-create-a-uicolor-from-a-hex-string
+- (UIColor *)colorFromHexString:(NSString *)hexString {
+    unsigned rgbValue = 0;
+    NSScanner *scanner = [NSScanner scannerWithString:hexString];
+    [scanner setScanLocation:1]; // bypass '#' character
+    [scanner scanHexInt:&rgbValue];
+    return [UIColor colorWithRed:((rgbValue & 0xFF0000) >> 16)/255.0 green:((rgbValue & 0xFF00) >> 8)/255.0 blue:(rgbValue & 0xFF)/255.0 alpha:1.0];
+}
+
+#pragma mark WKNavigationDelegate
+
+- (void)webView:(WKWebView *)theWebView didStartProvisionalNavigation:(WKNavigation *)navigation{
+    
+    // loading url, start spinner, update back/forward
+    
+    self.addressLabel.text = NSLocalizedString(@"Loading...", nil);
+    self.backButton.enabled = theWebView.canGoBack;
+    self.forwardButton.enabled = theWebView.canGoForward;
+    
+    NSLog(_browserOptions.hidespinner ? @"Yes" : @"No");
+    if(!_browserOptions.hidespinner) {
+        [self.spinner startAnimating];
+    }
+    
+    return [self.navigationDelegate didStartProvisionalNavigation:theWebView];
+}
+
+- (void)webView:(WKWebView *)theWebView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler
+{
+    NSURL *url = navigationAction.request.URL;
+    NSURL *mainDocumentURL = navigationAction.request.mainDocumentURL;
+    
+    BOOL isTopLevelNavigation = [url isEqual:mainDocumentURL];
+    
+    if (isTopLevelNavigation) {
+        self.currentURL = url;
+    }
+    
+    [self.navigationDelegate webView:theWebView decidePolicyForNavigationAction:navigationAction decisionHandler:decisionHandler];
+}
+
+- (void)webView:(WKWebView *)theWebView didFinishNavigation:(WKNavigation *)navigation
+{
+    // update url, stop spinner, update back/forward
+    
+    self.addressLabel.text = [self.currentURL absoluteString];
+    self.backButton.enabled = theWebView.canGoBack;
+    self.forwardButton.enabled = theWebView.canGoForward;
+    theWebView.scrollView.contentInset = UIEdgeInsetsZero;
+    
+    [self.spinner stopAnimating];
+    
+    [self.navigationDelegate didFinishNavigation:theWebView];
+}
+    
+- (void)webView:(WKWebView*)theWebView failedNavigation:(NSString*) delegateName withError:(nonnull NSError *)error{
+    // log fail message, stop spinner, update back/forward
+    NSLog(@"webView:%@ - %ld: %@", delegateName, (long)error.code, [error localizedDescription]);
+    
+    self.backButton.enabled = theWebView.canGoBack;
+    self.forwardButton.enabled = theWebView.canGoForward;
+    [self.spinner stopAnimating];
+    
+    self.addressLabel.text = NSLocalizedString(@"Load Error", nil);
+    
+    [self.navigationDelegate webView:theWebView didFailNavigation:error];
+}
+
+- (void)webView:(WKWebView*)theWebView didFailNavigation:(null_unspecified WKNavigation *)navigation withError:(nonnull NSError *)error
+{
+    [self webView:theWebView failedNavigation:@"didFailNavigation" withError:error];
+}
+    
+- (void)webView:(WKWebView*)theWebView didFailProvisionalNavigation:(null_unspecified WKNavigation *)navigation withError:(nonnull NSError *)error
+{
+    [self webView:theWebView failedNavigation:@"didFailProvisionalNavigation" withError:error];
+}
+
+#pragma mark WKScriptMessageHandler delegate
+- (void)userContentController:(nonnull WKUserContentController *)userContentController didReceiveScriptMessage:(nonnull WKScriptMessage *)message {
+    if (![message.name isEqualToString:IAB_BRIDGE_NAME]) {
+        return;
+    }
+    //NSLog(@"Received script message %@", message.body);
+    [self.navigationDelegate userContentController:userContentController didReceiveScriptMessage:message];
+}
+
+#pragma mark CDVScreenOrientationDelegate
+
+- (BOOL)shouldAutorotate
+{
+    if ((self.orientationDelegate != nil) && [self.orientationDelegate respondsToSelector:@selector(shouldAutorotate)]) {
+        return [self.orientationDelegate shouldAutorotate];
+    }
+    return YES;
+}
+
+- (UIInterfaceOrientationMask)supportedInterfaceOrientations
+{
+    if ((self.orientationDelegate != nil) && [self.orientationDelegate respondsToSelector:@selector(supportedInterfaceOrientations)]) {
+        return [self.orientationDelegate supportedInterfaceOrientations];
+    }
+    
+    return 1 << UIInterfaceOrientationPortrait;
+}
+
+- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
+{
+    [coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context)
+    {
+        [self rePositionViews];
+    } completion:^(id<UIViewControllerTransitionCoordinatorContext> context)
+    {
+
+    }];
+
+    [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
+}
+
+
+@end //CDVWKInAppBrowserViewController

+ 32 - 0
cordova/platforms/ios/美天旺/Plugins/cordova-plugin-inappbrowser/CDVWKInAppBrowserUIDelegate.h

@@ -0,0 +1,32 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <WebKit/WebKit.h>
+
+@interface CDVWKInAppBrowserUIDelegate : NSObject <WKUIDelegate>{
+    @private
+    UIViewController* _viewController;
+}
+
+@property (nonatomic, copy) NSString* title;
+
+- (instancetype)initWithTitle:(NSString*)title;
+-(void) setViewController:(UIViewController*) viewController;
+
+@end

+ 127 - 0
cordova/platforms/ios/美天旺/Plugins/cordova-plugin-inappbrowser/CDVWKInAppBrowserUIDelegate.m

@@ -0,0 +1,127 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import "CDVWKInAppBrowserUIDelegate.h"
+
+@implementation CDVWKInAppBrowserUIDelegate
+
+- (instancetype)initWithTitle:(NSString*)title
+{
+    self = [super init];
+    if (self) {
+        self.title = title;
+    }
+
+    return self;
+}
+
+- (void)     webView:(WKWebView*)webView runJavaScriptAlertPanelWithMessage:(NSString*)message
+    initiatedByFrame:(WKFrameInfo*)frame completionHandler:(void (^)(void))completionHandler
+{
+    UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title
+                                                                   message:message
+                                                            preferredStyle:UIAlertControllerStyleAlert];
+
+    UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
+                                                 style:UIAlertActionStyleDefault
+                                               handler:^(UIAlertAction* action)
+        {
+            completionHandler();
+            [alert dismissViewControllerAnimated:YES completion:nil];
+        }];
+
+    [alert addAction:ok];
+
+    [[self getViewController] presentViewController:alert animated:YES completion:nil];
+}
+
+- (void)     webView:(WKWebView*)webView runJavaScriptConfirmPanelWithMessage:(NSString*)message
+    initiatedByFrame:(WKFrameInfo*)frame completionHandler:(void (^)(BOOL result))completionHandler
+{
+    UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title
+                                                                   message:message
+                                                            preferredStyle:UIAlertControllerStyleAlert];
+
+    UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
+                                                 style:UIAlertActionStyleDefault
+                                               handler:^(UIAlertAction* action)
+        {
+            completionHandler(YES);
+            [alert dismissViewControllerAnimated:YES completion:nil];
+        }];
+
+    [alert addAction:ok];
+
+    UIAlertAction* cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel")
+                                                     style:UIAlertActionStyleDefault
+                                                   handler:^(UIAlertAction* action)
+        {
+            completionHandler(NO);
+            [alert dismissViewControllerAnimated:YES completion:nil];
+        }];
+    [alert addAction:cancel];
+
+    [[self getViewController] presentViewController:alert animated:YES completion:nil];
+}
+
+- (void)      webView:(WKWebView*)webView runJavaScriptTextInputPanelWithPrompt:(NSString*)prompt
+          defaultText:(NSString*)defaultText initiatedByFrame:(WKFrameInfo*)frame
+    completionHandler:(void (^)(NSString* result))completionHandler
+{
+    UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title
+                                                                   message:prompt
+                                                            preferredStyle:UIAlertControllerStyleAlert];
+
+    UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
+                                                 style:UIAlertActionStyleDefault
+                                               handler:^(UIAlertAction* action)
+        {
+            completionHandler(((UITextField*)alert.textFields[0]).text);
+            [alert dismissViewControllerAnimated:YES completion:nil];
+        }];
+
+    [alert addAction:ok];
+
+    UIAlertAction* cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel")
+                                                     style:UIAlertActionStyleDefault
+                                                   handler:^(UIAlertAction* action)
+        {
+            completionHandler(nil);
+            [alert dismissViewControllerAnimated:YES completion:nil];
+        }];
+    [alert addAction:cancel];
+
+    [alert addTextFieldWithConfigurationHandler:^(UITextField* textField) {
+        textField.text = defaultText;
+    }];
+
+    [[self getViewController] presentViewController:alert animated:YES completion:nil];
+}
+
+-(UIViewController*) getViewController
+{
+    return _viewController;
+}
+
+-(void) setViewController:(UIViewController*) viewController
+{
+    _viewController = viewController;
+}
+
+@end

+ 10 - 7
cordova/platforms/ios/美天旺/config.xml

@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='utf-8'?>
-<widget id="com.shotshock.twong" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
+<widget id="com.shotshock.twong" version="1.0.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
     <feature name="CDVWebViewEngine">
         <param name="ios-package" value="CDVWebViewEngine" />
     </feature>
@@ -39,6 +39,13 @@
         <param name="ios-package" value="CDVStatusBar" />
         <param name="onload" value="true" />
     </feature>
+    <feature name="InAppBrowser">
+        <param name="ios-package" value="CDVWKInAppBrowser" />
+        <param name="onload" value="true" />
+    </feature>
+    <feature name="AppVersion">
+        <param name="ios-package" value="AppVersion" />
+    </feature>
     <name>美天旺</name>
     <description>
         美天旺是完璧时空旗下新型垂直电商App,专注于新经济下的购物服务!
@@ -54,12 +61,6 @@
     <allow-intent href="sms:*" />
     <allow-intent href="mailto:*" />
     <allow-intent href="geo:*" />
-    <chcp>
-        <native-interface version="1" />
-        <auto-install enabled="true" />
-        <auto-download enabled="true" />
-        <config-file url="https://twongd.shotshock.shop/update/chcp.json" />
-    </chcp>
     <allow-intent href="itms:*" />
     <allow-intent href="itms-apps:*" />
     <icon height="180" src="res/ios/icon-60@3x.png" width="180" />
@@ -96,4 +97,6 @@
     <preference name="StatusBarStyle" value="lightcontent" />
     <preference name="Fullscreen" value="true" />
     <preference name="WebViewBounce" value="false" />
+    <preference name="CodePushDeploymentKey" value="YOUR-ANDROID-DEPLOYMENT-KEY" />
+    <preference name="CodePushPublicKey" value="YOUR-PUBLIC-KEY" />
 </widget>

+ 2 - 2
cordova/platforms/ios/美天旺/美天旺-Info.plist

@@ -17,7 +17,7 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>1.0.0</string>
+	<string>1.0.3</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleURLTypes</key>
@@ -38,7 +38,7 @@
 		</dict>
 	</array>
 	<key>CFBundleVersion</key>
-	<string>1.0.0</string>
+	<string>1.0.3</string>
 	<key>LSApplicationQueriesSchemes</key>
 	<array>
 		<string>weixin</string>

+ 6 - 0
cordova/plugins/android.json

@@ -32,6 +32,12 @@
     },
     "cordova-plugin-statusbar": {
       "PACKAGE_NAME": "com.shotshock.twong"
+    },
+    "cordova-plugin-inappbrowser": {
+      "PACKAGE_NAME": "com.shotshock.twong"
+    },
+    "cordova-plugin-app-version": {
+      "PACKAGE_NAME": "com.shotshock.twong"
     }
   },
   "dependent_plugins": {

+ 42 - 0
cordova/plugins/cordova-plugin-app-version/CHANGELOG.md

@@ -0,0 +1,42 @@
+### 0.1.9
+* Renamed Windows8 platform to Windows 
+
+### 0.1.7
+
+* Add getPackageName feature (thanks to @gprasanth)
+* Add getAppName feature (thanks to @mirko77)
+* Fix for windows 8 (thanks to @deliriousrhino)
+* Fix version number in plugin.xml file
+
+### 0.1.6
+
+* Split into two functions getAppVersion.getVersionNumber() and getAppVersion.getVersionCode() to return build number
+* Fix a deprecation warning in iOS version
+
+### 0.1.5
+
+* iOS: Return version number but log and fall back to build number if it is nil (thanks to [Eddy Verbruggen](https://github.com/EddyVerbruggen))
+
+### 0.1.4
+
+* Return version number, not build number on iOS (thanks to http://www.humancopy.net)
+* Support for Windows phone 8 (thanks to Cristi Badila / Gediminas Šaltenis)
+* Support for AngularJS as well as jQuery (thanks to Matias Singers, [Red Ape Solutions](http://www.redapesolutions.com/))
+
+### 0.1.3
+
+* Fixes to Android for Corova 3 and above (thanks to AxoInsanit)
+
+### 0.1.2
+
+* Updated for Cordova 3 and above (thanks to Russell Keith-Magee [freakboy3742](https://github.com/freakboy3742)
+
+### 0.1.1
+
+* Improved README
+* Bug fix for non-jQuery use
+* Tidy plugin.xml
+
+### 0.1.0
+
+* First release

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác