<?xml version='1.0' encoding='utf-8'?>
-<widget id="com.supwisdom.dlapp" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
+<widget id="com.dalicitycard.app" version="1.0.4" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name short="大理市民卡">dlapp</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
<preference name="DisallowOverscroll" value="true" />
<preference name="UIWebViewBounce" value="false" />
<preference name="BackupWebStorage" value="local" />
+ <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<edit-config file="*-Info.plist" mode="merge" target="NSCameraUsageDescription">
<string>APP需要使用您的相机权限,没有该权限将无法完成扫一扫功能</string>
</edit-config>
+ <edit-config file="*-Info.plist" mode="merge" target="NSPhotoLibraryUsageDescription">
+ <string>APP需要使用您的相册权限,没有该权限将无法完成扫一扫功能</string>
+ </edit-config>
+
+ <feature name="CDVWKWebViewEngine">
+ <param name="ios-package" value="CDVWKWebViewEngine" />
+ </feature>
+
<plugin name="cordova-plugin-fingerprint-aio" spec="~1.7.0">
<variable name="FACEID_USAGE_DESCRIPTION" value="认证中..." />
</plugin>
<plugin name="cordova-plugin-inappbrowser" spec="~3.0.0" />
<plugin name="cordova-plugin-device" spec="~2.0.2" />
<plugin name="cordova-plugin-themeablebrowser" spec="~0.2.17" />
+ <plugin name="jpush-phonegap-plugin" spec="~3.7.2">
+ <variable name="APP_KEY" value="d644d997f2cab0551ff704a3" />
+ <variable name="CHANNEL" value="developer-default" />
+ </plugin>
</widget>
{
"name": "com.supwisdom.dlapp",
- "version": "1.0.0",
+ "version": "1.0.3",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"resolved": "https://registry.npmjs.org/cordova-plugin-advanced-http/-/cordova-plugin-advanced-http-2.1.1.tgz",
"integrity": "sha512-C8NQ5+PsUOqDCEzlhhTP9pIHizK/O9rVcdNU3+psfU/4mg5heiEVj/E3AS2TSjMo2wef1xw8yempSKETzuRGig=="
},
+ "cordova-plugin-app-version": {
+ "version": "0.1.9",
+ "resolved": "https://registry.npmjs.org/cordova-plugin-app-version/-/cordova-plugin-app-version-0.1.9.tgz",
+ "integrity": "sha1-nbBgeGMzenEEiTAuX1CpBPFEm9s="
+ },
"cordova-plugin-camera": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/cordova-plugin-camera/-/cordova-plugin-camera-4.0.3.tgz",
"integrity": "sha1-tehezbv+Wu3tQKG/TuI3LmfZb7Q=",
"dev": true
},
+ "cordova-plugin-wkwebview-engine": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/cordova-plugin-wkwebview-engine/-/cordova-plugin-wkwebview-engine-1.2.1.tgz",
+ "integrity": "sha512-usp6pu+tJ1y0btVAXOjE5+tMjbvTY6hsiLfHJPMdyzkgHvxoNSePZ/NavTGj4CBJJlUjnMsN3TUq25+SeTZCow=="
+ },
"cordova-serve": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/cordova-serve/-/cordova-serve-3.0.0.tgz",
{
"name": "com.supwisdom.dlapp",
"displayName": "大理市民卡",
- "version": "1.0.0",
+ "version": "1.0.3",
"description": "A sample Apache Cordova application that responds to the deviceready event.",
"main": "index.js",
"scripts": {
"cordova-browser": "^6.0.0",
"cordova-ios": "^5.0.1",
"cordova-plugin-advanced-http": "^2.1.1",
+ "cordova-plugin-app-version": "^0.1.9",
"cordova-plugin-camera": "^4.0.3",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-disable-ios11-statusbar": "^1.0.0",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-themeablebrowser": "^0.2.18",
"cordova-plugin-touch-id": "^3.4.0",
+ "cordova-plugin-wkwebview-engine": "^1.2.1",
"jpush-phonegap-plugin": "^3.7.2"
},
"cordova": {
"cordova-plugin-device": {},
"cordova-plugin-themeablebrowser": {},
"jpush-phonegap-plugin": {
- "APP_KEY": "bd22b85f247a6e2ca307d3c5",
+ "APP_KEY": "d644d997f2cab0551ff704a3",
"CHANNEL": "developer-default"
- }
+ },
+ "cordova-plugin-app-version": {},
+ "cordova-plugin-wkwebview-engine": {}
},
"platforms": [
"android",
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.apache.cordova" android:versionName="1.0" android:versionCode="1">
- <uses-sdk android:minSdkVersion="19" />
</manifest>
<task>generateDebugSources</task>
</afterSyncTasks>
<option name="ALLOW_USER_CONFIGURATION" value="false" />
+ <option name="RES_FOLDERS_RELATIVE_PATH" value="" />
<option name="PROJECT_TYPE" value="1" />
</configuration>
</facet>
{
"xml": "<feature name=\"JPushPlugin\"><param name=\"android-package\" value=\"cn.jiguang.cordova.push.JPushPlugin\" /></feature>",
"count": 1
+ },
+ {
+ "xml": "<feature name=\"AppVersion\"><param name=\"android-package\" value=\"uk.co.whiteoctober.cordova.AppVersion\" /></feature>",
+ "count": 1
}
]
}
"count": 1
},
{
- "xml": "<meta-data android:name=\"JPUSH_APPKEY\" android:value=\"your_jpush_appkey\" />",
+ "xml": "<meta-data android:name=\"JPUSH_APPKEY\" android:value=\"d644d997f2cab0551ff704a3\" />",
"count": 1
}
]
"mode": "merge",
"id": "config.xml"
}
+ ],
+ "NSPhotoLibraryUsageDescription": [
+ {
+ "xml": "<string>APP需要使用您的相册权限,没有该权限将无法完成扫一扫功能</string>",
+ "count": 1,
+ "mode": "merge",
+ "id": "config.xml"
+ }
]
}
}
"PACKAGE_NAME": "com.supwisdom.dlapp"
},
"jpush-phonegap-plugin": {
- "APP_KEY": "your_jpush_appkey",
+ "APP_KEY": "d644d997f2cab0551ff704a3",
"CHANNEL": "developer-default",
"PACKAGE_NAME": "com.supwisdom.dlapp"
+ },
+ "cordova-plugin-app-version": {
+ "PACKAGE_NAME": "com.supwisdom.dlapp"
+ },
+ "cordova-plugin-wkwebview-engine": {
+ "PACKAGE_NAME": "com.dalicitycard.app"
}
},
"dependent_plugins": {},
"clobbers": [
"JPush"
]
+ },
+ {
+ "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": {
"cordova-plugin-device": "2.0.2",
"cordova-plugin-themeablebrowser": "0.2.17",
"cordova-plugin-jcore": "1.3.0",
- "jpush-phonegap-plugin": "3.7.2"
+ "jpush-phonegap-plugin": "3.7.2",
+ "cordova-plugin-app-version": "0.1.9",
+ "cordova-plugin-wkwebview-engine": "1.2.1"
}
}
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
+ <option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
</configuration>
</facet>
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
+ <excludeFolder url="file://$MODULE_DIR$/build/.DS_Store" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/annotation_processor_list" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/apk_list" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
+ <excludeFolder url="file://$MODULE_DIR$/build/reports" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 24 Platform" jdkType="Android SDK" />
<orderEntry type="library" name="Gradle: com.android.support:support-annotations:24.1.1@jar" level="project" />
<orderEntry type="library" name="Gradle: com.squareup.okio:okio:1.14.0@jar" level="project" />
<orderEntry type="library" name="Gradle: com.google.zxing:core:3.2.1@jar" level="project" />
+ <orderEntry type="library" name="Gradle: __local_aars__:/Users/shuwei/works2/cordova/dlapp/platforms/android/app/libs/jcore-android-2.1.2.jar:unspecified@jar" level="project" />
+ <orderEntry type="library" name="Gradle: __local_aars__:/Users/shuwei/works2/cordova/dlapp/platforms/android/app/libs/jpush-android-3.3.4.jar:unspecified@jar" level="project" />
<orderEntry type="library" name="Gradle: com.journeyapps:zxing-android-embedded-3.3.0" level="project" />
<orderEntry type="library" name="Gradle: com.squareup.okhttp3:okhttp-urlconnection:3.10.0@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:appcompat-v7-23.1.0" level="project" />
android {
defaultConfig {
- versionCode cdvVersionCode ?: new BigInteger("" + privateHelpers.extractIntFromManifest("versionCode"))
applicationId privateHelpers.extractStringFromManifest("package")
-
if (cdvMinSdkVersion != null) {
minSdkVersion cdvMinSdkVersion
}
+ minSdkVersion 19
+ ndk {
+ abiFilters "armeabi"
+ }
}
-
lintOptions {
- abortOnError false;
+ abortOnError false;
}
-
compileSdkVersion 24
buildToolsVersion '28.0.3'
-
// This code exists for Crosswalk and other Native APIs.
// By default, we multiply the existing version code in the
// Android Manifest by 10 and add a number for each architecture.
// If you are not using Crosswalk or SQLite, you can
// ignore this chunk of code, and your version codes will be respected.
- if (Boolean.valueOf(cdvBuildMultipleApks)) {
- flavorDimensions "default"
-
- productFlavors {
- armeabi {
- versionCode defaultConfig.versionCode*10 + 1
- ndk {
- abiFilters = ["armeabi"]
- }
- }
- armv7 {
- versionCode defaultConfig.versionCode*10 + 2
- ndk {
- abiFilters = ["armeabi-v7a"]
- }
- }
- arm64 {
- versionCode defaultConfig.versionCode*10 + 3
- ndk {
- abiFilters = ["arm64-v8a"]
- }
- }
- x86 {
- versionCode defaultConfig.versionCode*10 + 4
- ndk {
- abiFilters = ["x86"]
- }
- }
- x86_64 {
- versionCode defaultConfig.versionCode*10 + 5
- ndk {
- abiFilters = ["x86_64"]
- }
- }
- }
- } else if (Boolean.valueOf(cdvVersionCodeForceAbiDigit)) {
- // This provides compatibility to the default logic for versionCode before cordova-android 5.2.0
- defaultConfig {
- versionCode defaultConfig.versionCode*10
- }
- }
-
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
-
if (cdvReleaseSigningPropertiesFile) {
signingConfigs {
release {
// These must be set or Gradle will complain (even if they are overridden).
keyAlias = ""
- keyPassword = "__unset" // And these must be set to non-empty in order to have the signing step added to the task graph.
+ keyPassword = "__unset"
+ // And these must be set to non-empty in order to have the signing step added to the task graph.
storeFile = null
storePassword = "__unset"
}
}
addSigningProps(cdvReleaseSigningPropertiesFile, signingConfigs.release)
}
-
if (cdvDebugSigningPropertiesFile) {
addSigningProps(cdvDebugSigningPropertiesFile, signingConfigs.debug)
}
+ productFlavors {
+ }
}
/*
dependencies {
implementation fileTree(include: '*.jar', dir: 'libs')
// SUB-PROJECT DEPENDENCIES START
- implementation(project(path: ":CordovaLib"))
- implementation "com.squareup.okhttp3:okhttp-urlconnection:3.10.0"
- implementation "com.android.support:support-v4:24.1.1+"
+ implementation project(path: ':CordovaLib')
+ implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.10.0'
+ implementation 'com.android.support:support-v4:24.1.1+'
// SUB-PROJECT DEPENDENCIES END
}
--- /dev/null
+[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":10004,"versionName":"1.0.4","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
\ No newline at end of file
<?xml version='1.0' encoding='utf-8'?>
-<manifest android:hardwareAccelerated="true" android:versionCode="10000" android:versionName="1.0.0" package="com.supwisdom.dlapp" xmlns:android="http://schemas.android.com/apk/res/android">
+<manifest android:hardwareAccelerated="true" android:versionCode="10004" android:versionName="1.0.4" package="com.dalicitycard.app" 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" />
<application android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/launcher_name" android:supportsRtl="true">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:screenOrientation="portrait" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
</intent-filter>
</receiver>
<meta-data android:name="JPUSH_CHANNEL" android:value="developer-default" />
- <meta-data android:name="JPUSH_APPKEY" android:value="your_jpush_appkey" />
+ <meta-data android:name="JPUSH_APPKEY" android:value="d644d997f2cab0551ff704a3" />
</application>
- <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="28" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" android:required="false" />
<uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
- <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<body>
<header class="aui-bar aui-bar-nav" style="padding-top:25px;">
- <a class="aui-pull-left" href="javascript:window.history.go(-1)">
+ <a class="aui-pull-left" href="javascript:app.toBack();">
<span class="aui-iconfont aui-icon-left"></span>
</a>
<div class="aui-title">账单详情</div>
"clobbers": [
"JPush"
]
+ },
+ {
+ "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 = {
"cordova-plugin-device": "2.0.2",
"cordova-plugin-themeablebrowser": "0.2.17",
"cordova-plugin-jcore": "1.3.0",
- "jpush-phonegap-plugin": "3.7.2"
+ "jpush-phonegap-plugin": "3.7.2",
+ "cordova-plugin-app-version": "0.1.9",
+ "cordova-plugin-wkwebview-engine": "1.2.1"
};
});
\ No newline at end of file
this.loadBill()
},
toBack: function (){
- window.history.back();
+ //window.history.back();
+ window.history.go(-1)
},
loadBill: function() {
var refno = window.localStorage.getItem("currentrefno");
console.log(ret)
if (ok) {
if(ret.code==200){
- var exp = window.localStorage.getItem("tokenexpire");
- var t = parseInt(exp);
- //token 小于10分钟了,需要刷新
- console.log((ret.now-t))
- if(ret.now-t>1000*60*10){
- window.location = "login.html";
- }else{
- window.location = "main.html";
+ if(!isEmpty(ret.token)){
+ window.localStorage.setItem("token",ret.token);
}
+ window.location = "main.html";
}else{
window.location = "login.html";
}
$.showLoading("登录中");
var param={
"username":phone,
- "password":pwd
+ "password":pwd,
+ "platform":device.platform
}
Login(param,function(ok,ret){
console.log(ret)
window.localStorage.setItem("phone",phone);
window.localStorage.setItem("phoneX",ret.phone);
window.localStorage.setItem("token",ret.token);
+ window.localStorage.setItem("uid",ret.uid);
window.localStorage.setItem("tenantid",ret.tenantid);
window.localStorage.setItem("tokenexpire",ret.expire);
window.localStorage.setItem("tokentime",ret.now);
initialize: function() {
this.initTab();
document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);
+ document.addEventListener('jpush.receiveRegistrationId', function(event) {
+ console.log(event.registrationId)
+ }, false)
+ document.addEventListener("jpush.openNotification", function (event) {
+ var refno
+ console.log("openNotify:"+event);
+ if(device.platform == "Android") {
+ refno = event.extras.refno
+ } else {
+ refno = event.refno
+ window.JPush.setApplicationIconBadgeNumber(0);
+ }
+ app.openBill(refno);
+ console.log("openNotify:"+refno);
+ }, false)
+ },
+ openBill:function(billno){
+ window.localStorage.setItem("currentrefno",billno);
+ window.location='billdetail.html';
+ },
+ initJpush: function() {
+ if(device.platform == "Android") {
+ } else {
+ window.JPush.setApplicationIconBadgeNumber(0);
+ }
+ window.JPush.init();
+ window.JPush.setDebugMode(true);
+ window.JPush.isPushStopped(function(result) {
+ if (result == 0) {
+ //window.JPush.resumePush();
+ } else {
+ window.JPush.resumePush();
+ }
+ });
+ window.JPush.getUserNotificationSettings(function(result) {
+ if(result == 0) {
+ } else if(result > 0) {
+ }
+ });
+ var uid = window.localStorage.getItem("uid");
+
},
onDeviceReady: function() {
var uid = window.localStorage.getItem("token");
- console.log(CURRENT_INDEX);
+ this.initJpush();
$('#scanBtn').click(function() {
//window.location = "scan.html";
app.checkBefore(function() {
})
});
$('#secBtn').click(function() {
- app.checkBefore(function() {
+ window.location = "security.html";
+ /*app.checkBefore(function() {
app.checkOther(function() {
window.location = "security.html";
})
- })
+ })*/
});
$('#usersec').click(function() {
app.checkBefore(function() {
});
this.initData();
},
- initTab:function(){
+ initTab: function() {
$("#maincontent").css("top", $("#maintop").height())
var tab = new auiTab({
element: document.getElementById("footer"),
}, function(ret) {
- window.localStorage.setItem("tabindex",ret.index);
-
+ window.localStorage.setItem("tabindex", ret.index);
+
changeTab(ret.index);
});
- var tabindex = window.localStorage.getItem("tabindex");
- if(!tabindex||tabindex==0){
+ var tabindex = window.localStorage.getItem("tabindex");
+ if (!tabindex || tabindex == 0) {
tabindex = 1
}
changeTab(tabindex);
tab.setActive(tabindex)
- function changeTab(index){
+
+ function changeTab(index) {
if (index == 1) {
$("#main1").show();
$("#main2").hide();
}
V1Bills(param, function(ok, ret) {
if (ok) {
- console.log(ret)
+ //console.log(ret)
if (ret.code == 200) {
+ app.checkVersion(ret.version,ret.minversion,ret.versionmsg);
$("#maingt").text(ret.t + "!")
$("#user-amount").text(ret.amount)
$("#user-point").text(ret.point)
}
})
},
-
+ checkVersion:function(ver,minver,msg){
+ cordova.getAppVersion.getVersionNumber(function (version) {
+ //alert(version);
+ if(version<minver){
+ //TODO 强制升级
+ alert("当前版本过低,为了不影响您的使用,请先升级");
+ }else if(ver>version){
+ alert("有新的版本");
+ }
+ });
+ },
initBillView: function(page) {
var html = '';
for (var i = 0; i < page.data.length; i++) {
}
}
};
-app.initialize();
\ No newline at end of file
+app.initialize();
$.hideLoading();
console.log(ret)
if(ret.code==200){
-
window.localStorage.setItem("phone",phone);
window.localStorage.setItem("uid",ret.uid);
window.localStorage.setItem("code",ret.randcode);
$.alert('扫描出错,请稍后再试:' + JSON.stringify(err), '提示');
} else {
// The scan completed, display the contents of the QR code:
+ QRScanner.destroy();
//$.alert(text, '提示');
showRet(text);
- QRScanner.destroy();
}
}
//开始扫描,需要将页面的背景设置成透明
});
},
goPage: function() {
- QRScanner.destroy();
window.location = "main.html"
}
};
app.initialize();
var inAppBrowserRef;
-function showRet(url) {
+function showRet(url){
+ if(isEmpty(url)){
+ return;
+ }
+ var userid = window.localStorage.getItem("userid");
+ if (url.indexOf("yy.dlsmk.cn")>=0) {
+ if(url.indexOf("?")>0){
+ url=url+'&userid='+userid;
+ }else{
+ url=url+'?userid='+userid;
+ }
+ }
+ var ref = cordova.InAppBrowser.open(url, '_blank',"location=yes,beforeload=yes");
+ ref.addEventListener('loadstart', function(params){
+ if (params.url.indexOf("yy.dlsmk.cn")>=0) {
+ if (params.url.indexOf("userid")<0) {
+ if(params.url.indexOf("?")>0){
+ params.url=params.url+'&userid='+userid;
+ }else{
+ params.url=params.url+'?userid='+userid;
+ }
+ ref.hide();
+ var neRef = cordova.InAppBrowser.open(params.url, '_blank',"location=yes,beforeload=yes");
+ neRef.addEventListener('exit', function(e){
+ ref.close();
+ window.location = "main.html"
+ });
+ }
+ }
+ });
+ //ref.show();
+}
+
+function showRet1(url) {
if(isEmpty(url)){
return;
}
var userid = window.localStorage.getItem("userid");
if(url.indexOf("?")>0){
- url=url+'&uid='+userid;
+ url=url+'&userid='+userid;
}else{
- url=url+'?uid='+userid;
+ url=url+'?userid='+userid;
}
+ console.log(url)
inAppBrowserRef = cordova.ThemeableBrowser.open(url, '_blank', {
statusbar: {
color: '#03a9f4ff'
showPageTitle: true
},
backButton: {
- image: 'back.png',
- imagePressed: 'back.png',
+ wwwImage: 'img/back.png',
+ wwwImagePressed: 'img/back.png',
align: 'left',
event: 'backPressed'
},
closeButton: {
- image: 'close.png',
- imagePressed: 'close.png',
+ wwwImage: 'img/close.png',
+ wwwImagePressed: 'img/close.png',
align: 'left',
event: 'closePressed'
},
console.error(e.message);
}).addEventListener(cordova.ThemeableBrowser.EVT_WRN, function(e) {
console.log(e.message);
+ }).addEventListener('loadstart', function(params,e){
+ console.log("11111111"+JSON.stringify(params));
+ if (params.url.indexOf("yy.dlsmk.cn")>=0) {
+ if (params.url.indexOf("userid")<0) {
+ if(params.url.indexOf("?")>0){
+ params.url=params.url+'&userid='+userid;
+ }else{
+ params.url=params.url+'?userid='+userid;
+ }
+ inAppBrowserRef.close();
+ inAppBrowserRef = null;
+ openUrl(params.url);
+ }
+ }
});
- inAppBrowserRef.addEventListener('loadstart', loadStartCallBack);
- inAppBrowserRef.addEventListener('beforeload', beforeloadCallBack);
+ //inAppBrowserRef.addEventListener('loadstart', loadStartCallBack);
+ //inAppBrowserRef.addEventListener('beforeload', beforeloadCallBack);
}
-function loadStartCallBack(params,callback) {
- console.log("1",params.url);
-}
-function beforeloadCallBack(params,callback) {
- console.log("2",params.url);
+
+function openUrl(url){
+ inAppBrowserRef = cordova.ThemeableBrowser.open(url, '_blank', {
+ statusbar: {
+ color: '#03a9f4ff'
+ },
+ toolbar: {
+ height: 44,
+ color: '#03a9f4ff'
+ },
+ title: {
+ color: '#ffffffff',
+ showPageTitle: true
+ },
+ backButton: {
+ wwwImage: 'img/back.png',
+ wwwImagePressed: 'img/back.png',
+ align: 'left',
+ event: 'backPressed'
+ },
+ closeButton: {
+ wwwImage: 'img/close.png',
+ wwwImagePressed: 'img/close.png',
+ align: 'left',
+ event: 'closePressed'
+ },
+ backButtonCanClose: true
+ }).addEventListener('backPressed', function(e) {
+ }).addEventListener('closePressed', function(e) {
+ inAppBrowserRef.close();
+ window.location = "main.html"
+ }).addEventListener(cordova.ThemeableBrowser.EVT_ERR, function(e) {
+ console.error(e.message);
+ }).addEventListener(cordova.ThemeableBrowser.EVT_WRN, function(e) {
+ console.log(e.message);
+ }).addEventListener('loadstart', function(params,e){
+ console.log("333333"+JSON.stringify(params));
+ });
}
-var dev = true;
-var SERVER = "http://ykt.supwisdom.com:10010/payapi/mobileapi";
+var dev = false;
+var SERVER = "https://yy.dlsmk.cn/payapi/mobileapi";
var GLOBAL_TODAY="";
var GLOBAL_YESTERDAY="";
var CURRENT_INDEX=1;
if (dev) {
- SERVER = "http://172.28.43.3:8099/payapi/mobileapi";
+ SERVER = "http://172.28.201.70:10010/payapi/mobileapi";
}
+
function V1Qrcode(callback) {
ajaxPost("/v1/qrcode", {}, callback)
}
</head>
<body>
<header class="aui-bar aui-bar-nav" style="padding-top:25px;">
- <a class="aui-pull-left" href="javascript:window.history.back()">
+ <a class="aui-pull-left" href="login.html">
<span class="aui-iconfont aui-icon-left"></span>
</a>
<div class="aui-title">注册</div>
</div>
</li>
</ul>
- <div style="padding: 20px;margin-top: 40px;">
+ <div style="padding: 20px;margin-top: 40px;">
<a href="javascript:app.logout();" class="weui-btn weui-btn_warn">退出登录</a>
</div>
</section>
import android.net.Uri;
import com.google.zxing.BarcodeFormat;
-import com.google.zxing.ResultPoint;
-import com.journeyapps.barcodescanner.BarcodeCallback;
-import com.journeyapps.barcodescanner.BarcodeResult;
import com.journeyapps.barcodescanner.BarcodeView;
-import com.journeyapps.barcodescanner.DefaultDecoderFactory;
import com.journeyapps.barcodescanner.camera.CameraSettings;
+import com.visionsmarts.VSBarcodeReader;
+import com.visionsmarts.pic2shop.view.ScannerLiveView;
+
import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.PluginResult;
@SuppressWarnings("deprecation")
-public class QRScanner extends CordovaPlugin implements BarcodeCallback {
-
+public class QRScanner extends CordovaPlugin {
+ private ScannerLiveView scannerLiveView;
private CallbackContext callbackContext;
private boolean cameraClosing;
private static Boolean flashAvailable;
private boolean oneTime = true;
private boolean keepDenied = false;
private boolean appPausedWithActivePreview = false;
-
+ private ScannerLiveView.Listener listener = new ScannerLiveView.Listener() {
+ @Override
+ public void onCodeScanned(String str, String data) {
+ if (nextScanCallback == null) {
+ return;
+ }
+
+ if(data != null) {
+ scanning = false;
+ nextScanCallback.success(data);
+ nextScanCallback = null;
+ }
+ else {
+ scan(nextScanCallback);
+ }
+ }
+
+ @Override
+ public void onCameraIssue() {
+
+ }
+ };
+
+ public void onCodeScanned(String type, String data) {
+ //PluginResult result = new PluginResult(PluginResult.Status.OK, data);
+ //callbackContext.sendPluginResult(result);
+ if (this.nextScanCallback == null) {
+ return;
+ }
+
+ if(data != null) {
+ scanning = false;
+ this.nextScanCallback.success(data);
+ this.nextScanCallback = null;
+ }
+ else {
+ scan(this.nextScanCallback);
+ }
+ }
+ public void onCameraIssue() {
+
+ }
+
static class QRScannerError {
private static final int UNEXPECTED_ERROR = 0,
CAMERA_ACCESS_DENIED = 1,
else
lightOn = false;
}
+ if(scannerLiveView!=null){
+ scannerLiveView.setTorch(toggleLight);
+ if (toggleLight)
+ lightOn = true;
+ else
+ lightOn = false;
+ }
getStatus(callbackContext);
}
});
@Override
public void run() {
// Create our Preview view and set it as the content of our activity.
- mBarcodeView = new BarcodeView(cordova.getActivity());
+ //mBarcodeView = new BarcodeView(cordova.getActivity());
+ scannerLiveView = new ScannerLiveView(cordova.getActivity(),listener);
+ VSBarcodeReader.VSinit();
+ VSBarcodeReader.setBlurryAcceptanceThresholdWithAF(0.0d);
//Configure the decoder
ArrayList<BarcodeFormat> formatList = new ArrayList<BarcodeFormat>();
formatList.add(BarcodeFormat.QR_CODE);
- mBarcodeView.setDecoderFactory(new DefaultDecoderFactory(formatList, null, null));
+ //mBarcodeView.setDecoderFactory(new DefaultDecoderFactory(formatList, null, null));
//Configure the camera (front/back)
CameraSettings settings = new CameraSettings();
settings.setRequestedCameraId(getCurrentCameraId());
- mBarcodeView.setCameraSettings(settings);
+ //mBarcodeView.setCameraSettings(settings);
FrameLayout.LayoutParams cameraPreviewParams = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT);
- ((ViewGroup) webView.getView().getParent()).addView(mBarcodeView, cameraPreviewParams);
-
+ //((ViewGroup) webView.getView().getParent()).addView(mBarcodeView, cameraPreviewParams);
+ ((ViewGroup) webView.getView().getParent()).addView(scannerLiveView, cameraPreviewParams);
cameraPreviewing = true;
webView.getView().bringToFront();
- mBarcodeView.resume();
+ //mBarcodeView.resume();
+ //scannerLiveView.onResume();
}
});
prepared = true;
}
- @Override
+ /*@Override
public void barcodeResult(BarcodeResult barcodeResult) {
if (this.nextScanCallback == null) {
return;
@Override
public void possibleResultPoints(List<ResultPoint> list) {
- }
+ }*/
// ---- BEGIN EXTERNAL API ----
private void prepare(final CallbackContext callbackContext) {
}
shouldScanAgain = false;
this.nextScanCallback = callbackContext;
- final BarcodeCallback b = this;
+ /*final BarcodeCallback b = this;
this.cordova.getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
mBarcodeView.decodeSingle(b);
}
}
- });
+ });*/
+
+ if(scannerLiveView!=null){
+ scannerLiveView.onResume();
+ }
}
}
@Override
public void run() {
webView.getView().setBackgroundColor(Color.argb(1, 0, 0, 0));
+ if(scannerLiveView!=null){
+ scannerLiveView.startCamera();
+ }
showing = true;
getStatus(callbackContext);
}
this.cordova.getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
+ if(mBarcodeView!=null) {
((ViewGroup) mBarcodeView.getParent()).removeView(mBarcodeView);
cameraPreviewing = false;
+ }
}
});
}
}
closeCamera();
currentCameraId = 0;
+ if(scannerLiveView!=null){
+ scannerLiveView.onPause();
+ }
getStatus(callbackContext);
}
}
under the License.
*/
-package com.supwisdom.dlapp;
+package com.dalicitycard.app;
import android.os.Bundle;
import org.apache.cordova.*;
--- /dev/null
+package com.visionsmarts;
+
+public class VSBarcodeReader {
+ public static final int BARCODE_TYPE_CODABAR = 64;
+ public static final int BARCODE_TYPE_CODE128 = 32;
+ public static final int BARCODE_TYPE_CODE39 = 16;
+ public static final int BARCODE_TYPE_CODE93 = 128;
+ public static final int BARCODE_TYPE_EAN_13_UPC_A = 1;
+ public static final int BARCODE_TYPE_EAN_8 = 2;
+ public static final String BARCODE_TYPE_ID_CODABAR = "CODABAR";
+ public static final String BARCODE_TYPE_ID_CODE128 = "CODE128";
+ public static final String BARCODE_TYPE_ID_CODE39 = "CODE39";
+ public static final String BARCODE_TYPE_ID_CODE93 = "CODE93";
+ public static final String BARCODE_TYPE_ID_EAN_13_UPC_A = "EAN13";
+ public static final String BARCODE_TYPE_ID_EAN_8 = "EAN8";
+ public static final String BARCODE_TYPE_ID_ITF = "ITF";
+ public static final String BARCODE_TYPE_ID_STD2OF5 = "STD2OF5";
+ public static final String BARCODE_TYPE_ID_UPC_E = "UPCE";
+ public static final int BARCODE_TYPE_INVALID = -1;
+ public static final int BARCODE_TYPE_ITF = 8;
+ public static final String BARCODE_TYPE_NAME_CODABAR = "Codabar";
+ public static final String BARCODE_TYPE_NAME_CODE128 = "Code 128";
+ public static final String BARCODE_TYPE_NAME_CODE39 = "Code 39";
+ public static final String BARCODE_TYPE_NAME_CODE93 = "Code 93";
+ public static final String BARCODE_TYPE_NAME_EAN_13_UPC_A = "EAN-13/UPC-A";
+ public static final String BARCODE_TYPE_NAME_EAN_8 = "EAN-8";
+ public static final String BARCODE_TYPE_NAME_ITF = "ITF";
+ public static final String BARCODE_TYPE_NAME_STD2OF5 = "STD 2 of 5";
+ public static final String BARCODE_TYPE_NAME_UPC_E = "UPC-E";
+ public static final int BARCODE_TYPE_STD2OF5 = 256;
+ public static final int BARCODE_TYPE_UPC_E = 4;
+
+ public static class DecoderValues {
+ public int evaluationDays;
+ public int left;
+ public Point lineEnd;
+ public Point lineStart;
+ public int right;
+ public int type;
+
+ public DecoderValues() {
+ this.lineStart = new Point();
+ this.lineEnd = new Point();
+ }
+ }
+
+ public static class Point {
+ public int x;
+ public int y;
+ }
+
+ public static native int VSinit();
+
+ public static native String decodeNextImage(byte[] bArr, int i, int i2, DecoderValues decoderValues);
+
+ public static native String decodeNextImageOmnidirectional(byte[] bArr, int i, int i2, int i3, DecoderValues decoderValues);
+
+ public static native int reset();
+
+ public static native int setBlurryAcceptanceThresholdWithAF(double d);
+
+ static {
+ System.loadLibrary("VSBarcodeReader");
+ }
+
+ public static String format(String barcode, int type) {
+ Object[] objArr;
+ switch (type) {
+ case BARCODE_TYPE_EAN_13_UPC_A /*1*/:
+ if (barcode.substring(0, BARCODE_TYPE_EAN_13_UPC_A).equals("0")) {
+ objArr = new Object[BARCODE_TYPE_UPC_E];
+ objArr[0] = barcode.substring(BARCODE_TYPE_EAN_13_UPC_A, BARCODE_TYPE_EAN_8);
+ objArr[BARCODE_TYPE_EAN_13_UPC_A] = barcode.substring(BARCODE_TYPE_EAN_8, 7);
+ objArr[BARCODE_TYPE_EAN_8] = barcode.substring(7, 12);
+ objArr[3] = barcode.substring(12, 13);
+ return String.format("%s-%s-%s-%s", objArr);
+ }
+ return String.format("%s-%s-%s", new Object[]{barcode.substring(0, BARCODE_TYPE_EAN_13_UPC_A), barcode.substring(BARCODE_TYPE_EAN_13_UPC_A, 7), barcode.substring(7, 13)});
+ case BARCODE_TYPE_EAN_8 /*2*/:
+ objArr = new Object[BARCODE_TYPE_EAN_8];
+ objArr[0] = barcode.substring(0, BARCODE_TYPE_UPC_E);
+ objArr[BARCODE_TYPE_EAN_13_UPC_A] = barcode.substring(BARCODE_TYPE_UPC_E, BARCODE_TYPE_ITF);
+ return String.format("%s-%s", objArr);
+ case BARCODE_TYPE_UPC_E /*4*/:
+ return String.format("%s-%s-%s", new Object[]{barcode.substring(0, BARCODE_TYPE_EAN_13_UPC_A), barcode.substring(BARCODE_TYPE_EAN_13_UPC_A, 7), barcode.substring(7, BARCODE_TYPE_ITF)});
+ default:
+ return barcode;
+ }
+ }
+}
--- /dev/null
+package com.visionsmarts;
+
+import java.nio.ByteBuffer;
+import java.nio.charset.CharacterCodingException;
+import java.nio.charset.Charset;
+
+public class VSReaderQR {
+ public static final int MODE_ALPHANUMERIC = 2;
+ public static final int MODE_BYTE = 4;
+ public static final int MODE_KANJI = 8;
+ public static final int MODE_NUMERIC = 1;
+ public static final String QR_CODE_TYPE_ID = "QR";
+
+ public static class DecoderValues {
+ public Point corner1;
+ public Point corner2;
+ public Point corner3;
+ public Point corner4;
+ public int evaluationDays;
+ public int mode;
+
+ public DecoderValues() {
+ this.corner1 = new Point();
+ this.corner2 = new Point();
+ this.corner3 = new Point();
+ this.corner4 = new Point();
+ }
+ }
+
+ private static class ECIMarker {
+ public int eci;
+ public int position;
+
+ private ECIMarker() {
+ }
+ }
+
+ public static class Point {
+ public int x;
+ public int y;
+ }
+
+ public static native byte[] decodeImage(byte[] bArr, int i, int i2, DecoderValues decoderValues);
+
+ static {
+ System.loadLibrary("VSReaderQR");
+ }
+
+ public static String format(byte[] data, int mode) {
+ Charset charset = Charset.forName("UTF-8");
+ if ((mode & MODE_KANJI) == MODE_KANJI) {
+ charset = Charset.forName("Shift_JIS");
+ }
+ int position = 0;
+ if (data.length > 3 && data[0] == 93 && data[MODE_NUMERIC] == 81) {
+ if (data[MODE_ALPHANUMERIC] == 51 || data[MODE_ALPHANUMERIC] == 52) {
+ position = 0 + 3;
+ }
+ if ((data[MODE_ALPHANUMERIC] == 53 || data[MODE_ALPHANUMERIC] == 54) && data.length > 5) {
+ position += 5;
+ }
+ }
+ StringBuilder result = new StringBuilder(data.length);
+ do {
+ ECIMarker nextMarker = findFirstECIMarker(data, position);
+ String next = decodeData(ByteBuffer.wrap(data, position, Math.min(nextMarker.position, data.length) - position), charset);
+ if (next != null) {
+ result.append(next);
+ }
+ if (nextMarker.position != data.length) {
+ position = nextMarker.position + 7;
+ charset = getCharsetForECI(nextMarker.eci);
+ if (charset == null) {
+ charset = getCharsetForECI(0);
+ }
+ }
+ if (nextMarker.position == data.length) {
+ break;
+ }
+ } while (position < data.length);
+ return result.toString();
+ }
+
+ private static ECIMarker findFirstECIMarker(byte[] data, int fromPosition) {
+ ECIMarker eciMarker = new ECIMarker();
+ eciMarker.position = data.length;
+ int position = fromPosition;
+ while (position < data.length - 6) {
+ if (data[position] == 92 && Character.isDigit(data[position + MODE_NUMERIC]) && Character.isDigit(data[position + MODE_ALPHANUMERIC]) && Character.isDigit(data[position + 3]) && Character.isDigit(data[position + MODE_BYTE]) && Character.isDigit(data[position + 5]) && Character.isDigit(data[position + 6])) {
+ eciMarker.position = position;
+ eciMarker.eci = ((((((data[position + MODE_NUMERIC] - 48) * 100000) + ((data[position + MODE_ALPHANUMERIC] - 48) * 10000)) + ((data[position + 3] - 48) * 1000)) + ((data[position + MODE_BYTE] - 48) * 100)) + ((data[position + 5] - 48) * 10)) + (data[position + 6] - 48);
+ break;
+ }
+ position += MODE_NUMERIC;
+ }
+ return eciMarker;
+ }
+
+ private static Charset getCharsetForECI(int eci) {
+ switch (eci) {
+
+ case MODE_NUMERIC /*1*/:
+ return Charset.forName("ISO-8859-1");
+ case MODE_ALPHANUMERIC /*2*/:
+ return Charset.forName("ISO-8859-1");
+ case MODE_BYTE /*4*/:
+ return Charset.forName("ISO-8859-2");
+ case 5:
+ return Charset.forName("ISO-8859-3");
+ case 6:
+ return Charset.forName("ISO-8859-4");
+ case 7:
+ return Charset.forName("ISO-8859-5");
+ case MODE_KANJI /*8*/:
+ return Charset.forName("ISO-8859-6");
+ case 9:
+ return Charset.forName("ISO-8859-7");
+ case 10:
+ return Charset.forName("ISO-8859-8");
+ case 11:
+ return Charset.forName("ISO-8859-9");
+ case 12:
+ return Charset.forName("ISO-8859-10");
+ case 13:
+ return Charset.forName("ISO-8859-11");
+ case 15:
+ return Charset.forName("ISO-8859-13");
+ case VSBarcodeReader.BARCODE_TYPE_CODE39 /*16*/:
+ return Charset.forName("ISO-8859-14");
+ case 17:
+ return Charset.forName("ISO-8859-15");
+ case 18:
+ return Charset.forName("ISO-8859-16");
+ case 20:
+ return Charset.forName("Shift_JIS");
+ case 21:
+ return Charset.forName("windows-1250");
+ case 22:
+ return Charset.forName("windows-1251");
+ case 23:
+ return Charset.forName("windows-1252");
+ case 24:
+ return Charset.forName("windows-1256");
+ case 25:
+ return Charset.forName("UTF-16BE");
+ case 26:
+ return Charset.forName("UTF-8");
+ case 27:
+ return Charset.forName("EUC-JP");
+ case 28:
+ return Charset.forName("Big5");
+ case 29:
+ return Charset.forName("x-EUC-CN");
+ case 30:
+ return Charset.forName("EUC-KR");
+ case 899:
+ return Charset.forName("UTF-8");
+ default:
+ return null;
+ }
+ }
+
+ public static String decodeData(ByteBuffer data, Charset charset) {
+ try {
+ return charset.newDecoder().decode(data).toString();
+ } catch (CharacterCodingException e) {
+ data.rewind();
+ try {
+ return Charset.forName("Shift_JIS").newDecoder().decode(data).toString();
+ } catch (CharacterCodingException e2) {
+ data.rewind();
+ try {
+ return Charset.forName("UTF-8").newDecoder().decode(data).toString();
+ } catch (CharacterCodingException e3) {
+ data.rewind();
+ try {
+ return Charset.forName("ISO-8859-1").newDecoder().decode(data).toString();
+ } catch (CharacterCodingException e4) {
+ data.rewind();
+ try {
+ return Charset.forName("US-ASCII").newDecoder().decode(data).toString();
+ } catch (CharacterCodingException e5) {
+ return null;
+ }
+ }
+ }
+ }
+ }
+ }
+}
--- /dev/null
+package com.visionsmarts.pic2shop.view;
+
+import com.visionsmarts.VSReaderQR;
+
+import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
+
+public class BarQrCodeUtil {
+ public static String qrToString(byte[] qrData) {
+ ByteBuffer qrBuffer;
+ if (qrData[qrData.length - 1] == 0) {
+ qrBuffer = ByteBuffer.wrap(qrData, 0, qrData.length - 1);
+ } else {
+ qrBuffer = ByteBuffer.wrap(qrData);
+ }
+ return VSReaderQR.decodeData(qrBuffer, Charset.forName("UTF-8"));
+ }
+
+ public static final int DECODE = 100;
+ public static final int QUIT = 101;
+ public static final int NOTFOUND = 102;
+
+ public static final int BARCODE = 103;
+ public static final int QRCODE = 104;
+
+ public static final int AUTO_FOCUS = 105;
+}
--- /dev/null
+package com.visionsmarts.pic2shop.view;
+
+import android.app.Activity;
+import android.content.Context;
+import android.graphics.ImageFormat;
+import android.graphics.Point;
+import android.hardware.Camera;
+import android.hardware.Camera.AutoFocusCallback;
+import android.hardware.Camera.Parameters;
+import android.hardware.Camera.PreviewCallback;
+import android.hardware.Camera.Size;
+import android.os.Handler;
+import android.os.Looper;
+import android.os.Message;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.Display;
+import android.view.SurfaceHolder;
+import android.view.SurfaceHolder.Callback;
+import android.view.SurfaceView;
+import android.view.WindowManager;
+
+import com.google.zxing.client.android.camera.CameraConfigurationUtils;
+import com.visionsmarts.VSBarcodeReader;
+import com.visionsmarts.VSBarcodeReader.DecoderValues;
+import com.visionsmarts.VSReaderQR;
+
+import java.io.IOException;
+import java.util.regex.Pattern;
+
+public class ScannerLiveView extends SurfaceView implements Callback {
+ private Point screen;
+ private static final int BARCODE_TYPES_MASK = 7;
+ private static final Pattern COMMA_PATTERN;
+ private static final int DESIRED_ZOOM_X10 = 27;
+ private static final String TAG;
+ private AutoFocusCallback mAutoFocusCallback;
+ private volatile byte[] mCallbackBuffer;
+ private volatile Camera mCamera;
+ private DecodingThread mDecodingThread;
+ volatile boolean mFoundBarcodeOrQRCode;
+ volatile byte[] mFrameData;
+ volatile boolean mFrameDataIsAutoFocusInProgress;
+ volatile boolean mHasCameraAutoFocus;
+ volatile boolean mIsAutoFocusInProgress;
+ volatile boolean mIsPreviewStarted;
+ Listener mListener;
+ private PreviewCallback mPreviewCallback;
+ private int mPreviewFrameSize;
+ volatile Size mPreviewSize;
+ final ScannerHandler mScannerHandler;
+ private volatile int mCameraDisplayOrientation;
+
+ public interface Listener {
+ void onCodeScanned(String str, String str2);
+ void onCameraIssue();
+ }
+
+ /* renamed from: com.visionsmarts.pic2shop.view.ScannerLiveView.1 */
+ class ScanAutoFocusCallback implements AutoFocusCallback {
+ ScanAutoFocusCallback() {
+ }
+
+ public void onAutoFocus(boolean success, Camera camera) {
+ ScannerLiveView.this.mIsAutoFocusInProgress = false;
+ }
+ }
+
+ /* renamed from: com.visionsmarts.pic2shop.view.ScannerLiveView.2 */
+ class ScanPreviewCallback implements PreviewCallback {
+ ScanPreviewCallback() {
+ }
+
+ public synchronized void onPreviewFrame(byte[] frameData, Camera camera) {
+ if (!(!ScannerLiveView.this.mIsPreviewStarted || ScannerLiveView.this.mDecodingThread == null || ScannerLiveView.this.mFoundBarcodeOrQRCode)) {
+ boolean shouldSendDecodeRequest = ScannerLiveView.this.mFrameData == null;
+ ScannerLiveView.this.mFrameData = frameData;
+ ScannerLiveView.this.mFrameDataIsAutoFocusInProgress = ScannerLiveView.this.mIsAutoFocusInProgress;
+ if (shouldSendDecodeRequest) {
+ ScannerLiveView.this.mDecodingThread.getHandler().obtainMessage(BarQrCodeUtil.DECODE).sendToTarget();
+ }
+ }
+ }
+ }
+
+ private class DecodingThread extends Thread {
+ DecoderValues mBarcodeDecoderValues;
+ private Handler mHandler;
+ private int mNumberConsecutiveFailedDecodingSinceFocusEnded;
+ private byte[] mPreviewLine;
+ VSReaderQR.DecoderValues mQRDecoderValues;
+
+ /* renamed from: com.visionsmarts.pic2shop.view.ScannerLiveView.DecodingThread.1 */
+ class DecodeMessageHandler extends Handler {
+ DecodeMessageHandler() {
+ }
+
+ public void handleMessage(Message message) {
+ switch (message.what) {
+ case BarQrCodeUtil.DECODE:
+ if (ScannerLiveView.this.mIsPreviewStarted && !ScannerLiveView.this.mFoundBarcodeOrQRCode) {
+ DecodingThread.this.decode();
+ }
+ break;
+ case BarQrCodeUtil.QUIT:
+ Looper.myLooper().quit();
+ break;
+ default:
+ }
+ }
+ }
+
+ public DecodingThread() {
+ this.mNumberConsecutiveFailedDecodingSinceFocusEnded = 0;
+ this.mBarcodeDecoderValues = new DecoderValues();
+ this.mQRDecoderValues = new VSReaderQR.DecoderValues();
+ setPriority(10);
+ initialize();
+ }
+
+ synchronized Handler getHandler() {
+ if (this.mHandler == null) {
+ try {
+ ScannerLiveView.this.mDecodingThread.wait(1000);
+ } catch (InterruptedException e) {
+ }
+ }
+ return this.mHandler;
+ }
+
+ public void initialize() {
+ if (ScannerLiveView.this.mPreviewSize != null && (this.mPreviewLine == null || this.mPreviewLine.length != ScannerLiveView.this.mPreviewSize.height)) {
+ this.mPreviewLine = new byte[ScannerLiveView.this.mPreviewSize.height];
+ }
+ this.mNumberConsecutiveFailedDecodingSinceFocusEnded = 0;
+ ScannerLiveView.this.mFoundBarcodeOrQRCode = false;
+ VSBarcodeReader.reset();
+ }
+
+ public void run() {
+ Looper.prepare();
+ synchronized (this) {
+ this.mHandler = new DecodeMessageHandler();
+ notify();
+ }
+ Looper.loop();
+ }
+
+ private void decode() {
+ byte[] previewLine = this.mPreviewLine;
+ int width = ScannerLiveView.this.mPreviewSize.width;
+ int height = ScannerLiveView.this.mPreviewSize.height;
+ synchronized (ScannerLiveView.this.mPreviewCallback) {
+ if (ScannerLiveView.this.mFrameData == null) {
+ return;
+ }
+ byte[] frameData = ScannerLiveView.this.mFrameData;
+ boolean wasAutoFocusInProgress = ScannerLiveView.this.mFrameDataIsAutoFocusInProgress;
+ int offset = Math.round((float) (screen.y / 2));
+ Log.e(TAG,"offset="+offset);
+ try {
+ for (int i = previewLine.length - 1; i >= 0; i--) {
+ previewLine[i] = frameData[offset];
+ offset += width;
+ }
+ } catch (ArrayIndexOutOfBoundsException e) {
+ }
+ if (ScannerLiveView.this.mFrameData != null) {
+ String barcode = VSBarcodeReader.decodeNextImage(previewLine, ScannerLiveView.this.mHasCameraAutoFocus ? 1 : 0, ScannerLiveView.BARCODE_TYPES_MASK, this.mBarcodeDecoderValues);
+ if (ScannerLiveView.this.mFrameData != null) {
+ if (barcode.length() > 0) {
+ ScannerLiveView.this.mFoundBarcodeOrQRCode = true;
+ ScannerLiveView.this.mScannerHandler.obtainMessage(BarQrCodeUtil.BARCODE, barcode).sendToTarget();
+ } else {
+ try {
+ byte[] qrData = VSReaderQR.decodeImage(frameData, width, height, this.mQRDecoderValues);
+ if (qrData.length > 0) {
+ ScannerLiveView.this.mFoundBarcodeOrQRCode = true;
+ ScannerLiveView.this.mScannerHandler.obtainMessage(BarQrCodeUtil.QRCODE, qrData).sendToTarget();
+ } else if (wasAutoFocusInProgress) {
+ this.mNumberConsecutiveFailedDecodingSinceFocusEnded = 0;
+ } else {
+ this.mNumberConsecutiveFailedDecodingSinceFocusEnded++;
+ if (ScannerLiveView.this.mHasCameraAutoFocus && !ScannerLiveView.this.mIsAutoFocusInProgress && this.mNumberConsecutiveFailedDecodingSinceFocusEnded >= 4) {
+ ScannerLiveView.this.mScannerHandler.obtainMessage(BarQrCodeUtil.AUTO_FOCUS).sendToTarget();
+ }
+ }
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ }
+ synchronized (ScannerLiveView.this.mPreviewCallback) {
+ ScannerLiveView.this.mFrameData = null;
+ if (!(ScannerLiveView.this.mFoundBarcodeOrQRCode || ScannerLiveView.this.mCallbackBuffer == null)) {
+ ScannerLiveView.this.mCamera.addCallbackBuffer(ScannerLiveView.this.mCallbackBuffer);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private class ScannerHandler extends Handler {
+ private ScannerHandler() {
+ }
+
+ public void handleMessage(Message message) {
+ switch (message.what) {
+ case BarQrCodeUtil.AUTO_FOCUS:
+ ScannerLiveView.this.requestAutoFocus();
+ break;
+ case BarQrCodeUtil.BARCODE:
+ if (ScannerLiveView.this.mIsPreviewStarted) {
+ ScannerLiveView.this.stopCamera();
+ ScannerLiveView.this.mListener.onCodeScanned("BAR", (String)message.obj);
+ }
+ break;
+ case BarQrCodeUtil.QRCODE:
+ if (ScannerLiveView.this.mIsPreviewStarted) {
+ ScannerLiveView.this.stopCamera();
+ ScannerLiveView.this.mListener.onCodeScanned("QR", BarQrCodeUtil.qrToString((byte[])message.obj));
+ }
+ break;
+ default:
+ }
+ }
+ }
+
+ public ScannerLiveView(Context context,Listener mListener) {
+ super(context);
+ this.mPreviewFrameSize = 0;
+ this.mScannerHandler = new ScannerHandler();
+ this.mIsPreviewStarted = false;
+ this.mIsAutoFocusInProgress = false;
+ this.mFrameData = null;
+ this.mFrameDataIsAutoFocusInProgress = false;
+ this.mFoundBarcodeOrQRCode = false;
+ this.mListener = mListener;
+ initialize(context);
+ }
+
+ public ScannerLiveView(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ this.mPreviewFrameSize = 0;
+ this.mScannerHandler = new ScannerHandler();
+ this.mIsPreviewStarted = false;
+ this.mIsAutoFocusInProgress = false;
+ this.mFrameData = null;
+ this.mFrameDataIsAutoFocusInProgress = false;
+ this.mFoundBarcodeOrQRCode = false;
+
+ initialize(context);
+ }
+
+ public ScannerLiveView(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ this.mPreviewFrameSize = 0;
+ this.mScannerHandler = new ScannerHandler();
+ this.mIsPreviewStarted = false;
+ this.mIsAutoFocusInProgress = false;
+ this.mFrameData = null;
+ this.mFrameDataIsAutoFocusInProgress = false;
+ this.mFoundBarcodeOrQRCode = false;
+ initialize(context);
+ }
+
+ private void initialize(Context context) {
+ //this.mListener = (Listener) context;
+ SurfaceHolder holder = getHolder();
+ holder.addCallback(this);
+ holder.setType(3);
+ holder.setKeepScreenOn(true);
+ this.mAutoFocusCallback = new ScanAutoFocusCallback();
+ this.mPreviewCallback = new ScanPreviewCallback();
+ Display display = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
+ screen = new Point();
+ display.getSize(screen);
+ }
+
+
+ public void surfaceCreated(SurfaceHolder holder) {
+ if (holder == null) {
+ throw new IllegalStateException("No SurfaceHolder provided");
+ } else if (this.mCamera == null) {
+ try {
+ this.mCamera = null;
+ try {
+ Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
+ int cameraCount = Camera.getNumberOfCameras();
+ for (int camIdx = 0; camIdx < cameraCount; camIdx++) {
+ Camera.getCameraInfo(camIdx, cameraInfo);
+ if (cameraInfo.facing == 0) {
+ this.mCamera = Camera.open(camIdx);
+ //this.mCamera.setDisplayOrientation(90);
+ setCameraDisplayOrientation(camIdx);
+ break;
+ }
+ }
+ } catch (LinkageError e) {
+ }
+ if (this.mCamera == null) {
+ try {
+ this.mCamera = Camera.open(0);
+ //this.mCamera.setDisplayOrientation(90);
+ setCameraDisplayOrientation(0);
+ } catch (LinkageError e2) {
+ }
+ }
+ if (this.mCamera == null) {
+ this.mCamera = Camera.open();
+ }
+ this.mCamera.setPreviewDisplay(holder);
+ this.mIsPreviewStarted = false;
+ } catch (IOException e3) {
+ this.mListener.onCameraIssue();
+ } catch (RuntimeException e4) {
+ this.mListener.onCameraIssue();
+ }
+ }
+ }
+
+ public void setCameraDisplayOrientation(int cameraId) {
+ Camera.CameraInfo info = new Camera.CameraInfo();
+ Camera.getCameraInfo(cameraId, info);
+ int degrees = 0;
+ switch (((Activity) getContext()).getWindowManager().getDefaultDisplay().getRotation()) {
+ case 0:
+ degrees = 0;
+ break;
+ case 1:
+ degrees = 90;
+ break;
+ case 2:
+ degrees = 180;
+ break;
+ case 3:
+ degrees = 270;
+ break;
+ }
+ if (info.facing == 1) {
+ this.mCameraDisplayOrientation = (info.orientation + degrees) % 360;
+ this.mCameraDisplayOrientation = (360 - this.mCameraDisplayOrientation) % 360;
+ } else {
+ this.mCameraDisplayOrientation = ((info.orientation - degrees) + 360) % 360;
+ }
+ this.mCamera.setDisplayOrientation(this.mCameraDisplayOrientation);
+ }
+
+ public void surfaceDestroyed(SurfaceHolder holder) {
+ if (this.mCamera != null) {
+ stopCamera();
+ this.mPreviewFrameSize = 0;
+ }
+ }
+
+ public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
+ if (this.mCamera != null) {
+ stopCamera();
+ setCameraParameters(screen.y,screen.x);
+ if (isShown()) {
+ startCamera();
+ }
+ }
+ }
+
+ public void onPause() {
+ stopCamera();
+ if (this.mCamera != null) {
+ this.mCamera.release();
+ this.mCamera = null;
+ }
+ if(this.mDecodingThread!=null) {
+ Message.obtain(this.mDecodingThread.getHandler(), BarQrCodeUtil.QUIT).sendToTarget();
+ try {
+ this.mDecodingThread.join();
+ } catch (InterruptedException e) {
+ }
+ }
+ if(this.mScannerHandler!=null) {
+ this.mScannerHandler.removeMessages(BarQrCodeUtil.AUTO_FOCUS);
+ this.mScannerHandler.removeMessages(BarQrCodeUtil.BARCODE);
+ this.mScannerHandler.removeMessages(BarQrCodeUtil.QRCODE);
+ }
+ this.mDecodingThread = null;
+ }
+
+ public void setTorch(boolean on) {
+ if (this.mCamera != null) {
+ boolean isOn = isTorchOn();
+ if (on != isOn) {
+
+ Camera.Parameters parameters = this.mCamera.getParameters();
+ CameraConfigurationUtils.setTorch(parameters, on);
+ this.mCamera.setParameters(parameters);
+ }
+ }
+ }
+
+ public boolean isTorchOn() {
+ Camera.Parameters parameters = this.mCamera.getParameters();
+ if (parameters != null) {
+ String flashMode = parameters.getFlashMode();
+ return flashMode != null &&
+ (Camera.Parameters.FLASH_MODE_ON.equals(flashMode) ||
+ Camera.Parameters.FLASH_MODE_TORCH.equals(flashMode));
+ } else {
+ return false;
+ }
+ }
+
+ public void onResume() {
+ /*this.mScannerOverlay = (ScannerOverlay) ((Activity) getContext()).findViewById(R.id.scanner_overlay);
+ this.mScannerOverlay.setBarcodeLocation(-1, -1);*/
+ this.mDecodingThread = new DecodingThread();
+ this.mDecodingThread.start();
+ startCamera();
+ }
+
+ public void startCamera() {
+ if (this.mCamera != null && !this.mIsPreviewStarted) {
+ this.mIsAutoFocusInProgress = false;
+ this.mFrameData = null;
+ if (this.mDecodingThread != null) {
+ this.mDecodingThread.initialize();
+ }
+ if (this.mPreviewFrameSize > 0) {
+ try {
+ this.mCallbackBuffer = new byte[this.mPreviewFrameSize];
+ } catch (OutOfMemoryError e) {
+ this.mCallbackBuffer = null;
+ }
+ }
+ if (this.mCallbackBuffer != null) {
+ this.mCamera.setPreviewCallbackWithBuffer(this.mPreviewCallback);
+ this.mCamera.addCallbackBuffer(this.mCallbackBuffer);
+ } else {
+ this.mCamera.setPreviewCallback(this.mPreviewCallback);
+ }
+ try {
+ this.mCamera.startPreview();
+ this.mIsPreviewStarted = true;
+ requestAutoFocus();
+ } catch (RuntimeException e2) {
+ this.mCamera.setPreviewCallback(null);
+ this.mCallbackBuffer = null;
+ this.mListener.onCameraIssue();
+ }
+ }
+ }
+
+ public void stopCamera() {
+ /*if (this.mCamera != null && this.mIsPreviewStarted) {
+ this.mCamera.setPreviewCallback(null);
+ this.mCamera.stopPreview();
+ this.mIsPreviewStarted = false;
+ if (this.mDecodingThread.getHandler() != null) {
+ this.mDecodingThread.getHandler().removeMessages(R.id.decode);
+ }
+ this.mScannerHandler.removeMessages(R.id.auto_focus);
+ this.mScannerHandler.removeMessages(R.id.msg_barcode_found);
+ }*/
+
+ if (this.mCamera != null && this.mIsPreviewStarted) {
+ synchronized (this.mPreviewCallback) {
+ this.mCamera.setPreviewCallback(null);
+ this.mCamera.stopPreview();
+ this.mIsPreviewStarted = false;
+ this.mCamera.cancelAutoFocus();
+ this.mFrameData = null;
+ this.mCallbackBuffer = null;
+ }
+ if (!(this.mDecodingThread == null || this.mDecodingThread.getHandler() == null)) {
+ this.mDecodingThread.getHandler().removeMessages(BarQrCodeUtil.DECODE);
+ }
+ this.mScannerHandler.removeMessages(BarQrCodeUtil.AUTO_FOCUS);
+ this.mScannerHandler.removeMessages(BarQrCodeUtil.BARCODE);
+ this.mScannerHandler.removeMessages(BarQrCodeUtil.QRCODE);
+ }
+
+ }
+
+ void requestAutoFocus() {
+ if (this.mCamera != null && this.mHasCameraAutoFocus && this.mIsPreviewStarted && !this.mIsAutoFocusInProgress) {
+ try {
+ this.mCamera.autoFocus(this.mAutoFocusCallback);
+ this.mIsAutoFocusInProgress = true;
+ } catch (RuntimeException e) {
+ Log.e(TAG, "Camera auto-focus failed: " + e.getLocalizedMessage());
+ }
+ }
+ }
+
+
+ private void setCameraParameters(int screenWidth, int screenHeight) {
+ Parameters parameters = this.mCamera.getParameters();
+ Log.e(TAG,"screenWidth="+screenWidth+",screenHeight="+screenHeight);
+ setPreviewSize(screenWidth, screenHeight, parameters);
+ setZoom(parameters);
+ String focusModeValues = parameters.get("focus-mode-values");
+ if (focusModeValues != null && focusModeValues.contains("macro")) {
+ parameters.set("focus-mode", "macro");
+ this.mHasCameraAutoFocus = true;
+ } else if (focusModeValues == null || !focusModeValues.contains("auto")) {
+ this.mHasCameraAutoFocus = false;
+ } else {
+ parameters.set("focus-mode", "auto");
+ this.mHasCameraAutoFocus = true;
+ }
+ try {
+ this.mCamera.setParameters(parameters);
+ } catch (RuntimeException e) {
+ this.mListener.onCameraIssue();
+ }
+ parameters = this.mCamera.getParameters();
+ this.mPreviewSize = parameters.getPreviewSize();
+ this.mPreviewFrameSize = ((this.mPreviewSize.width * this.mPreviewSize.height) * ImageFormat.getBitsPerPixel(parameters.getPreviewFormat())) / 8;
+ }
+
+ private void setPreviewSize(int screenWidth, int screenHeight, Parameters parameters) {
+ String previewSizeValuesString = parameters.get("preview-size-values");
+ if (previewSizeValuesString == null) {
+ previewSizeValuesString = parameters.get("preview-size-value");
+ }
+ Point bestPreviewSize = null;
+ if (previewSizeValuesString != null) {
+ bestPreviewSize = findBestPreviewSize(previewSizeValuesString, screenWidth, screenHeight);
+ }
+ if (bestPreviewSize != null) {
+ parameters.setPreviewSize(bestPreviewSize.x, bestPreviewSize.y);
+ } else {
+ parameters.setPreviewSize((screenWidth >> 4) << 4, (screenHeight >> 1) << 1);
+ }
+ }
+
+ private static Point findBestPreviewSize(CharSequence previewSizeValuesString, int screenWidth, int screenHeight) {
+ int bestPreviewWidth = 0;
+ int bestPreviewHeight = 0;
+ int minDifference = Integer.MAX_VALUE;
+ for (String previewSizeValueString : COMMA_PATTERN.split(previewSizeValuesString)) {
+ String previewSizeValueString2 = previewSizeValueString.trim();
+ int separatorPosition = previewSizeValueString2.indexOf(120);
+ if (separatorPosition >= 0) {
+ try {
+ int previewSizeValueWidth = Integer.parseInt(previewSizeValueString2.substring(0, separatorPosition));
+ int previewSizeValueHeight = Integer.parseInt(previewSizeValueString2.substring(separatorPosition + 1));
+ int difference = Math.abs(previewSizeValueWidth - screenWidth) + Math.abs(previewSizeValueHeight - screenHeight);
+ if (difference == 0) {
+ bestPreviewWidth = previewSizeValueWidth;
+ bestPreviewHeight = previewSizeValueHeight;
+ break;
+ } else if (difference < minDifference) {
+ bestPreviewWidth = previewSizeValueWidth;
+ bestPreviewHeight = previewSizeValueHeight;
+ minDifference = difference;
+ }
+ } catch (NumberFormatException e) {
+ }
+ }
+ }
+ if (bestPreviewWidth <= 0 || bestPreviewHeight <= 0) {
+ return null;
+ }
+ Log.e(TAG,"bestPreviewWidth="+bestPreviewWidth+",bestPreviewHeight="+bestPreviewHeight);
+ return new Point(bestPreviewWidth, bestPreviewHeight);
+ }
+
+ private void setZoom(Parameters parameters) {
+ String zoomSupportedString = parameters.get("zoom-supported");
+ if (zoomSupportedString == null || Boolean.parseBoolean(zoomSupportedString)) {
+ int maxZoomX10;
+ int desiredZoomX10 = DESIRED_ZOOM_X10;
+ String maxZoomString = parameters.get("max-zoom");
+ if (maxZoomString != null) {
+ try {
+ maxZoomX10 = (int) (10.0d * Double.parseDouble(maxZoomString));
+ if (DESIRED_ZOOM_X10 > maxZoomX10) {
+ desiredZoomX10 = maxZoomX10;
+ }
+ } catch (NumberFormatException e) {
+ }
+ }
+ String takingPictureZoomMaxString = parameters.get("taking-picture-zoom-max");
+ if (takingPictureZoomMaxString != null) {
+ try {
+ maxZoomX10 = Integer.parseInt(takingPictureZoomMaxString);
+ if (desiredZoomX10 > maxZoomX10) {
+ desiredZoomX10 = maxZoomX10;
+ }
+ } catch (NumberFormatException e2) {
+ }
+ }
+ String motZoomValuesString = parameters.get("mot-zoom-values");
+ if (motZoomValuesString != null) {
+ desiredZoomX10 = findBestMotZoomX10(motZoomValuesString, desiredZoomX10);
+ }
+ String motZoomStepString = parameters.get("mot-zoom-step");
+ if (motZoomStepString != null) {
+ try {
+ int motZoomStepX10 = (int) (10.0d * Double.parseDouble(motZoomStepString.trim()));
+ if (motZoomStepX10 > 1) {
+ desiredZoomX10 -= desiredZoomX10 % motZoomStepX10;
+ }
+ } catch (NumberFormatException e3) {
+ }
+ }
+ if (!(maxZoomString == null && motZoomValuesString == null)) {
+ parameters.set("zoom", String.valueOf(((double) desiredZoomX10) / 10.0d));
+ }
+ if (takingPictureZoomMaxString != null) {
+ parameters.set("taking-picture-zoom", desiredZoomX10);
+ }
+ }
+ }
+
+ private static int findBestMotZoomX10(CharSequence motZoomValuesString, int desiredZoomX10) {
+ int bestMotZoomX10 = 0;
+ String[] split = COMMA_PATTERN.split(motZoomValuesString);
+ int length = split.length;
+ int i = 0;
+ while (i < length) {
+ try {
+ int motZoomValueX10 = (int) (10.0d * Double.parseDouble(split[i].trim()));
+ if (Math.abs(desiredZoomX10 - motZoomValueX10) < Math.abs(desiredZoomX10 - bestMotZoomX10)) {
+ bestMotZoomX10 = motZoomValueX10;
+ }
+ i++;
+ } catch (NumberFormatException e) {
+ return desiredZoomX10;
+ }
+ }
+ return bestMotZoomX10;
+ }
+ /*private void setCameraParameters(int screenWidth, int screenHeight) {
+ Parameters parameters = this.mCamera.getParameters();
+ setPreviewSize(screenWidth, screenHeight, parameters);
+ parameters.set("flash-mode", "off");
+ parameters.set("flash-value", 2);
+ setZoom(parameters);
+ int apiLevel = Integer.parseInt(VERSION.SDK);
+ if (apiLevel <= 3) {
+ this.mHasCameraAutoFocus = true;
+ } else if (apiLevel >= 5) {
+ String focusModeValues = parameters.get("focus-mode-values");
+ if (focusModeValues != null && focusModeValues.contains("macro")) {
+ parameters.set("focus-mode", "macro");
+ this.mHasCameraAutoFocus = true;
+ } else if (focusModeValues == null || !focusModeValues.contains("auto")) {
+ this.mHasCameraAutoFocus = false;
+ } else {
+ parameters.set("focus-mode", "auto");
+ this.mHasCameraAutoFocus = true;
+ }
+ } else {
+ String model = Build.MODEL.toLowerCase();
+ if (model.contains("devour") || model.contains("tattoo")) {
+ this.mHasCameraAutoFocus = false;
+ } else {
+ this.mHasCameraAutoFocus = true;
+ }
+ }
+ this.mCamera.setParameters(parameters);
+ this.mPreviewSize = parameters.getPreviewSize();
+ }
+
+ private void setPreviewSize(int screenWidth, int screenHeight, Parameters parameters) {
+ String previewSizeValuesString = parameters.get("preview-size-values");
+ if (previewSizeValuesString == null) {
+ previewSizeValuesString = parameters.get("preview-size-value");
+ }
+ Point bestPreviewSize = null;
+ if (previewSizeValuesString != null) {
+ bestPreviewSize = findBestPreviewSize(previewSizeValuesString, screenWidth, screenHeight);
+ }
+ if (bestPreviewSize != null) {
+ parameters.setPreviewSize(bestPreviewSize.x, bestPreviewSize.y);
+ } else {
+ parameters.setPreviewSize((screenWidth >> 3) << 3, (screenHeight >> 3) << 3);
+ }
+ }
+
+ private static Point findBestPreviewSize(CharSequence previewSizeValuesString, int screenWidth, int screenHeight) {
+ int bestPreviewWidth = 0;
+ int bestPreviewHeight = 0;
+ int minDifference = Integer.MAX_VALUE;
+ for (String previewSizeValueString : COMMA_PATTERN.split(previewSizeValuesString)) {
+ String previewSizeValueString2 = previewSizeValueString.trim();
+ int separatorPosition = previewSizeValueString2.indexOf(120);
+ if (separatorPosition >= 0) {
+ try {
+ int previewSizeValueWidth = Integer.parseInt(previewSizeValueString2.substring(0, separatorPosition));
+ int previewSizeValueHeight = Integer.parseInt(previewSizeValueString2.substring(separatorPosition + 1));
+ int difference = Math.abs(previewSizeValueWidth - screenWidth) + Math.abs(previewSizeValueHeight - screenHeight);
+ if (difference == 0) {
+ bestPreviewWidth = previewSizeValueWidth;
+ bestPreviewHeight = previewSizeValueHeight;
+ break;
+ } else if (difference < minDifference) {
+ bestPreviewWidth = previewSizeValueWidth;
+ bestPreviewHeight = previewSizeValueHeight;
+ minDifference = difference;
+ }
+ } catch (NumberFormatException e) {
+ }
+ }
+ }
+ if (bestPreviewWidth <= 0 || bestPreviewHeight <= 0) {
+ return null;
+ }
+ return new Point(bestPreviewWidth, bestPreviewHeight);
+ }
+
+ private void setZoom(Parameters parameters) {
+ String zoomSupportedString = parameters.get("zoom-supported");
+ if (zoomSupportedString == null || Boolean.parseBoolean(zoomSupportedString)) {
+ int maxZoomX10;
+ int desiredZoomX10 = DESIRED_ZOOM_X10;
+ String maxZoomString = parameters.get("max-zoom");
+ if (maxZoomString != null) {
+ try {
+ maxZoomX10 = (int) (10.0d * Double.parseDouble(maxZoomString));
+ if (DESIRED_ZOOM_X10 > maxZoomX10) {
+ desiredZoomX10 = maxZoomX10;
+ }
+ } catch (NumberFormatException e) {
+ }
+ }
+ String takingPictureZoomMaxString = parameters.get("taking-picture-zoom-max");
+ if (takingPictureZoomMaxString != null) {
+ try {
+ maxZoomX10 = Integer.parseInt(takingPictureZoomMaxString);
+ if (desiredZoomX10 > maxZoomX10) {
+ desiredZoomX10 = maxZoomX10;
+ }
+ } catch (NumberFormatException e2) {
+ }
+ }
+ String motZoomValuesString = parameters.get("mot-zoom-values");
+ if (motZoomValuesString != null) {
+ desiredZoomX10 = findBestMotZoomX10(motZoomValuesString, desiredZoomX10);
+ }
+ String motZoomStepString = parameters.get("mot-zoom-step");
+ if (motZoomStepString != null) {
+ try {
+ int motZoomStepX10 = (int) (10.0d * Double.parseDouble(motZoomStepString.trim()));
+ if (motZoomStepX10 > 1) {
+ desiredZoomX10 -= desiredZoomX10 % motZoomStepX10;
+ }
+ } catch (NumberFormatException e3) {
+ }
+ }
+ if (!(maxZoomString == null && motZoomValuesString == null)) {
+ parameters.set("zoom", String.valueOf(((double) desiredZoomX10) / 10.0d));
+ }
+ if (takingPictureZoomMaxString != null) {
+ parameters.set("taking-picture-zoom", desiredZoomX10);
+ }
+ }
+ }
+
+ private static int findBestMotZoomX10(CharSequence motZoomValuesString, int desiredZoomX10) {
+ int bestMotZoomX10 = 0;
+ String[] split = COMMA_PATTERN.split(motZoomValuesString);
+ int length = split.length;
+ int i = 0;
+ while (i < length) {
+ try {
+ int motZoomValueX10 = (int) (10.0d * Double.parseDouble(split[i].trim()));
+ if (Math.abs(desiredZoomX10 - motZoomValueX10) < Math.abs(desiredZoomX10 - bestMotZoomX10)) {
+ bestMotZoomX10 = motZoomValueX10;
+ }
+ i++;
+ } catch (NumberFormatException e) {
+ return desiredZoomX10;
+ }
+ }
+ return bestMotZoomX10;
+ }*/
+
+ static {
+ TAG = ScannerLiveView.class.getSimpleName();
+ COMMA_PATTERN = Pattern.compile(",");
+ }
+}
--- /dev/null
+package com.visionsmarts.pic2shop.view;
+
+import android.annotation.TargetApi;
+import android.app.Activity;
+import android.content.Context;
+import android.graphics.ImageFormat;
+import android.graphics.Point;
+import android.hardware.Camera;
+import android.hardware.Camera.AutoFocusCallback;
+import android.hardware.Camera.CameraInfo;
+import android.hardware.Camera.Parameters;
+import android.hardware.Camera.PreviewCallback;
+import android.hardware.Camera.Size;
+import android.os.Handler;
+import android.os.Looper;
+import android.os.Message;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.SurfaceHolder;
+import android.view.SurfaceHolder.Callback;
+import android.view.SurfaceView;
+
+import com.visionsmarts.VSBarcodeReader;
+import com.visionsmarts.VSBarcodeReader.DecoderValues;
+import com.visionsmarts.VSReaderQR;
+
+import java.io.IOException;
+import java.util.regex.Pattern;
+
+public class ScannerLiveViewLiner extends SurfaceView implements Callback {
+ private static final int BARCODE_TYPES_MASK = 7;
+ private static final Pattern COMMA_PATTERN;
+ private static final int DESIRED_ZOOM_X10 = 27;
+ private static final String TAG;
+ private AutoFocusCallback mAutoFocusCallback;
+ private volatile byte[] mCallbackBuffer;
+ private volatile Camera mCamera;
+ private volatile int mCameraDisplayOrientation;
+ private DecodingThread mDecodingThread;
+ volatile boolean mFoundBarcodeOrQRCode;
+ volatile byte[] mFrameData;
+ volatile boolean mFrameDataIsAutoFocusInProgress;
+ volatile boolean mHasCameraAutoFocus;
+ volatile boolean mIsAutoFocusInProgress;
+ volatile boolean mIsPreviewStarted;
+ Listener mListener;
+ private PreviewCallback mPreviewCallback;
+ private int mPreviewFrameSize;
+ volatile Size mPreviewSize;
+ final ScannerHandler mScannerHandler;
+ ScannerOverlay mScannerOverlay;
+
+ /* renamed from: com.visionsmarts.pic2shop.view.ScannerLiveViewLiner.1 */
+ class C01731 implements AutoFocusCallback {
+ C01731() {
+ }
+
+ public void onAutoFocus(boolean success, Camera camera) {
+ ScannerLiveViewLiner.this.mIsAutoFocusInProgress = false;
+ }
+ }
+
+ /* renamed from: com.visionsmarts.pic2shop.view.ScannerLiveViewLiner.2 */
+ class C01742 implements PreviewCallback {
+ C01742() {
+ }
+
+ public synchronized void onPreviewFrame(byte[] frameData, Camera camera) {
+ if (!(!ScannerLiveViewLiner.this.mIsPreviewStarted || ScannerLiveViewLiner.this.mDecodingThread == null || ScannerLiveViewLiner.this.mFoundBarcodeOrQRCode)) {
+ boolean shouldSendDecodeRequest = ScannerLiveViewLiner.this.mFrameData == null;
+ ScannerLiveViewLiner.this.mFrameData = frameData;
+ ScannerLiveViewLiner.this.mFrameDataIsAutoFocusInProgress = ScannerLiveViewLiner.this.mIsAutoFocusInProgress;
+ if (shouldSendDecodeRequest) {
+ ScannerLiveViewLiner.this.mDecodingThread.getHandler().obtainMessage(BarQrCodeUtil.DECODE).sendToTarget();
+ }
+ }
+ }
+ }
+
+ private class DecodingThread extends Thread {
+ DecoderValues mBarcodeDecoderValues;
+ private Handler mHandler;
+ private int mNumberConsecutiveFailedDecodingSinceFocusEnded;
+ private byte[] mPreviewLine;
+ VSReaderQR.DecoderValues mQRDecoderValues;
+
+ /* renamed from: com.visionsmarts.pic2shop.view.ScannerLiveViewLiner.DecodingThread.1 */
+ class C01751 extends Handler {
+ C01751() {
+ }
+
+ public void handleMessage(Message message) {
+ switch (message.what) {
+ case BarQrCodeUtil.DECODE:
+ if (ScannerLiveViewLiner.this.mIsPreviewStarted && !ScannerLiveViewLiner.this.mFoundBarcodeOrQRCode) {
+ DecodingThread.this.decode();
+ }
+ break;
+ case BarQrCodeUtil.QUIT:
+ Looper.myLooper().quit();
+ break;
+ default:
+ }
+ }
+ }
+
+ public DecodingThread() {
+ this.mNumberConsecutiveFailedDecodingSinceFocusEnded = 0;
+ this.mBarcodeDecoderValues = new DecoderValues();
+ this.mQRDecoderValues = new VSReaderQR.DecoderValues();
+ setPriority(10);
+ initialize();
+ }
+
+ synchronized Handler getHandler() {
+ if (this.mHandler == null) {
+ try {
+ ScannerLiveViewLiner.this.mDecodingThread.wait(1000);
+ } catch (InterruptedException e) {
+ }
+ }
+ return this.mHandler;
+ }
+
+ public void initialize() {
+ if (ScannerLiveViewLiner.this.mPreviewSize != null && (this.mPreviewLine == null || this.mPreviewLine.length != ScannerLiveViewLiner.this.mPreviewSize.height)) {
+ this.mPreviewLine = new byte[ScannerLiveViewLiner.this.mPreviewSize.height];
+ }
+ this.mNumberConsecutiveFailedDecodingSinceFocusEnded = 0;
+ ScannerLiveViewLiner.this.mFoundBarcodeOrQRCode = false;
+ VSBarcodeReader.reset();
+ }
+
+ public void run() {
+ Looper.prepare();
+ synchronized (this) {
+ this.mHandler = new C01751();
+ notify();
+ }
+ Looper.loop();
+ }
+
+ @TargetApi(8)
+ private void decode() {
+ byte[] previewLine = this.mPreviewLine;
+ int width = ScannerLiveViewLiner.this.mPreviewSize.width;
+ int height = ScannerLiveViewLiner.this.mPreviewSize.height;
+ synchronized (ScannerLiveViewLiner.this.mPreviewCallback) {
+ if (ScannerLiveViewLiner.this.mFrameData == null) {
+ return;
+ }
+ byte[] frameData = ScannerLiveViewLiner.this.mFrameData;
+ boolean wasAutoFocusInProgress = ScannerLiveViewLiner.this.mFrameDataIsAutoFocusInProgress;
+ int offset = Math.round(ScannerLiveViewLiner.this.mScannerOverlay.getNormalizedLaserLinePosition() * ((float) width));
+ Log.e(TAG,"offset="+offset);
+ int i = previewLine.length - 1;
+ while (i >= 0) {
+ try {
+ previewLine[i] = frameData[offset];
+ offset += width;
+ i--;
+ } catch (ArrayIndexOutOfBoundsException e) {
+ throw new ArrayIndexOutOfBoundsException(e.getMessage() + "; width=" + width + "; height=" + height + "; previewLine.length=" + previewLine.length + "; initOffset=" + Math.round(ScannerLiveViewLiner.this.mScannerOverlay.getNormalizedLaserLinePosition() * ((float) width)));
+ }
+ }
+ if (ScannerLiveViewLiner.this.mFrameData != null) {
+ String barcode = VSBarcodeReader.decodeNextImage(previewLine, ScannerLiveViewLiner.this.mHasCameraAutoFocus ? 1 : 0, ScannerLiveViewLiner.BARCODE_TYPES_MASK, this.mBarcodeDecoderValues);
+ if (ScannerLiveViewLiner.this.mFrameData != null) {
+ if (this.mBarcodeDecoderValues.left >= 0) {
+ int left = this.mBarcodeDecoderValues.left;
+ int right = this.mBarcodeDecoderValues.right;
+ float lineLength = (float) previewLine.length;
+ if (ScannerLiveViewLiner.this.mCameraDisplayOrientation == 180) {
+ ScannerLiveViewLiner.this.mScannerOverlay.setNormalizedBarcodeLocation(((float) (height - right)) / lineLength, ((float) (height - left)) / lineLength);
+ } else {
+ ScannerLiveViewLiner.this.mScannerOverlay.setNormalizedBarcodeLocation(((float) left) / lineLength, ((float) right) / lineLength);
+ }
+ } else {
+ ScannerLiveViewLiner.this.mScannerOverlay.setNoBarcodeLocation();
+ }
+ if (barcode.length() > 0) {
+ ScannerLiveViewLiner.this.mFoundBarcodeOrQRCode = true;
+ ScannerLiveViewLiner.this.mScannerHandler.obtainMessage(BarQrCodeUtil.BARCODE, barcode).sendToTarget();
+ } else {
+ byte[] qrData = VSReaderQR.decodeImage(frameData, width, height, this.mQRDecoderValues);
+ if (qrData.length > 0) {
+ ScannerLiveViewLiner.this.mFoundBarcodeOrQRCode = true;
+ ScannerLiveViewLiner.this.mScannerHandler.obtainMessage(BarQrCodeUtil.QRCODE, qrData).sendToTarget();
+ } else if (wasAutoFocusInProgress) {
+ this.mNumberConsecutiveFailedDecodingSinceFocusEnded = 0;
+ } else {
+ this.mNumberConsecutiveFailedDecodingSinceFocusEnded++;
+ if (ScannerLiveViewLiner.this.mHasCameraAutoFocus && !ScannerLiveViewLiner.this.mIsAutoFocusInProgress && this.mNumberConsecutiveFailedDecodingSinceFocusEnded >= 4) {
+ ScannerLiveViewLiner.this.mScannerHandler.obtainMessage(BarQrCodeUtil.AUTO_FOCUS).sendToTarget();
+ }
+ }
+ }
+ synchronized (ScannerLiveViewLiner.this.mPreviewCallback) {
+ ScannerLiveViewLiner.this.mFrameData = null;
+ if (!(ScannerLiveViewLiner.this.mFoundBarcodeOrQRCode || ScannerLiveViewLiner.this.mCallbackBuffer == null)) {
+ ScannerLiveViewLiner.this.mCamera.addCallbackBuffer(ScannerLiveViewLiner.this.mCallbackBuffer);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public interface Listener {
+ void onCameraIssue();
+
+ void onCodeScanned(String str, String str2);
+ }
+
+ private class ScannerHandler extends Handler {
+ private ScannerHandler() {
+ }
+
+ public void handleMessage(Message message) {
+ switch (message.what) {
+ case BarQrCodeUtil.AUTO_FOCUS:
+ ScannerLiveViewLiner.this.requestAutoFocus();
+ break;
+ case BarQrCodeUtil.BARCODE:
+ if (ScannerLiveViewLiner.this.mIsPreviewStarted) {
+ ScannerLiveViewLiner.this.stopCamera();
+ ScannerLiveViewLiner.this.mListener.onCodeScanned("BAR", (String)message.obj);
+ }
+ break;
+ case BarQrCodeUtil.QRCODE:
+ if (ScannerLiveViewLiner.this.mIsPreviewStarted) {
+ ScannerLiveViewLiner.this.stopCamera();
+ ScannerLiveViewLiner.this.mListener.onCodeScanned("QR", BarQrCodeUtil.qrToString((byte[])message.obj));
+ }
+ break;
+ default:
+ }
+ }
+ }
+
+ public ScannerLiveViewLiner(Context context) {
+ super(context);
+ this.mPreviewFrameSize = 0;
+ this.mScannerHandler = new ScannerHandler();
+ this.mIsPreviewStarted = false;
+ this.mIsAutoFocusInProgress = false;
+ this.mFrameData = null;
+ this.mFrameDataIsAutoFocusInProgress = false;
+ this.mFoundBarcodeOrQRCode = false;
+ initialize(context);
+ }
+
+ public ScannerLiveViewLiner(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ this.mPreviewFrameSize = 0;
+ this.mScannerHandler = new ScannerHandler();
+ this.mIsPreviewStarted = false;
+ this.mIsAutoFocusInProgress = false;
+ this.mFrameData = null;
+ this.mFrameDataIsAutoFocusInProgress = false;
+ this.mFoundBarcodeOrQRCode = false;
+ initialize(context);
+ }
+
+ public ScannerLiveViewLiner(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ this.mPreviewFrameSize = 0;
+ this.mScannerHandler = new ScannerHandler();
+ this.mIsPreviewStarted = false;
+ this.mIsAutoFocusInProgress = false;
+ this.mFrameData = null;
+ this.mFrameDataIsAutoFocusInProgress = false;
+ this.mFoundBarcodeOrQRCode = false;
+ initialize(context);
+ }
+
+ private void initialize(Context context) {
+ this.mListener = (Listener) context;
+ SurfaceHolder holder = getHolder();
+ holder.addCallback(this);
+ holder.setType(3);
+ holder.setKeepScreenOn(true);
+ this.mAutoFocusCallback = new C01731();
+ this.mPreviewCallback = new C01742();
+ }
+
+ @TargetApi(9)
+ public void surfaceCreated(SurfaceHolder holder) {
+ if (holder == null) {
+ throw new IllegalStateException("No SurfaceHolder provided");
+ } else if (this.mCamera == null) {
+ try {
+ this.mCamera = null;
+ try {
+ CameraInfo cameraInfo = new CameraInfo();
+ int cameraCount = Camera.getNumberOfCameras();
+ for (int camIdx = 0; camIdx < cameraCount; camIdx++) {
+ Camera.getCameraInfo(camIdx, cameraInfo);
+ if (cameraInfo.facing == 0) {
+ this.mCamera = Camera.open(camIdx);
+ setCameraDisplayOrientation(camIdx);
+ break;
+ }
+ }
+ } catch (LinkageError e) {
+ }
+ if (this.mCamera == null) {
+ try {
+ this.mCamera = Camera.open(0);
+ setCameraDisplayOrientation(0);
+ } catch (LinkageError e2) {
+ }
+ }
+ if (this.mCamera == null) {
+ this.mCamera = Camera.open();
+ }
+ this.mCamera.setPreviewDisplay(holder);
+ this.mIsPreviewStarted = false;
+ } catch (IOException e3) {
+ this.mListener.onCameraIssue();
+ } catch (RuntimeException e4) {
+ this.mListener.onCameraIssue();
+ }
+ }
+ }
+
+ public void surfaceDestroyed(SurfaceHolder holder) {
+ if (this.mCamera != null) {
+ stopCamera();
+ this.mPreviewFrameSize = 0;
+ }
+ }
+
+ public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
+ if (this.mCamera != null) {
+ stopCamera();
+ setCameraParameters(width, height);
+ if (isShown()) {
+ startCamera();
+ }
+ }
+ }
+
+ public void onPause() {
+ stopCamera();
+ if (this.mCamera != null) {
+ this.mCamera.release();
+ this.mCamera = null;
+ }
+ Message.obtain(this.mDecodingThread.getHandler(), BarQrCodeUtil.QUIT).sendToTarget();
+ try {
+ this.mDecodingThread.join();
+ } catch (InterruptedException e) {
+ }
+ this.mScannerHandler.removeMessages(BarQrCodeUtil.AUTO_FOCUS);
+ this.mScannerHandler.removeMessages(BarQrCodeUtil.BARCODE);
+ this.mScannerHandler.removeMessages(BarQrCodeUtil.QRCODE);
+ this.mDecodingThread = null;
+ }
+
+ @TargetApi(8)
+ public void startCamera() {
+ if (this.mCamera != null && !this.mIsPreviewStarted) {
+ this.mIsAutoFocusInProgress = false;
+ this.mFrameData = null;
+ if (this.mDecodingThread != null) {
+ this.mDecodingThread.initialize();
+ }
+ if (this.mScannerOverlay != null) {
+ this.mScannerOverlay.setNoBarcodeLocation();
+ }
+ if (this.mPreviewFrameSize > 0) {
+ try {
+ this.mCallbackBuffer = new byte[this.mPreviewFrameSize];
+ } catch (OutOfMemoryError e) {
+ this.mCallbackBuffer = null;
+ }
+ }
+ if (this.mCallbackBuffer != null) {
+ this.mCamera.setPreviewCallbackWithBuffer(this.mPreviewCallback);
+ this.mCamera.addCallbackBuffer(this.mCallbackBuffer);
+ } else {
+ this.mCamera.setPreviewCallback(this.mPreviewCallback);
+ }
+ try {
+ this.mCamera.startPreview();
+ this.mIsPreviewStarted = true;
+ requestAutoFocus();
+ } catch (RuntimeException e2) {
+ this.mCamera.setPreviewCallback(null);
+ this.mCallbackBuffer = null;
+ this.mListener.onCameraIssue();
+ }
+ }
+ }
+
+ public void stopCamera() {
+ if (this.mCamera != null && this.mIsPreviewStarted) {
+ synchronized (this.mPreviewCallback) {
+ this.mCamera.setPreviewCallback(null);
+ this.mCamera.stopPreview();
+ this.mIsPreviewStarted = false;
+ this.mCamera.cancelAutoFocus();
+ this.mFrameData = null;
+ this.mCallbackBuffer = null;
+ }
+ if (!(this.mDecodingThread == null || this.mDecodingThread.getHandler() == null)) {
+ this.mDecodingThread.getHandler().removeMessages(BarQrCodeUtil.DECODE);
+ }
+ this.mScannerHandler.removeMessages(BarQrCodeUtil.AUTO_FOCUS);
+ this.mScannerHandler.removeMessages(BarQrCodeUtil.BARCODE);
+ this.mScannerHandler.removeMessages(BarQrCodeUtil.QRCODE);
+ }
+ }
+
+ void requestAutoFocus() {
+ if (this.mCamera != null && this.mHasCameraAutoFocus && this.mIsPreviewStarted && !this.mIsAutoFocusInProgress) {
+ try {
+ this.mCamera.autoFocus(this.mAutoFocusCallback);
+ this.mIsAutoFocusInProgress = true;
+ } catch (RuntimeException e) {
+ Log.e(TAG, "Camera auto-focus failed: " + e.getLocalizedMessage());
+ }
+ }
+ }
+
+ @TargetApi(9)
+ public void setCameraDisplayOrientation(int cameraId) {
+ CameraInfo info = new CameraInfo();
+ Camera.getCameraInfo(cameraId, info);
+ int degrees = 0;
+ switch (((Activity) getContext()).getWindowManager().getDefaultDisplay().getRotation()) {
+ case 0 /*0*/:
+ degrees = 0;
+ break;
+ case 1 /*1*/:
+ degrees = 90;
+ break;
+ case 2 /*2*/:
+ degrees = 180;
+ break;
+ case 3 /*3*/:
+ degrees = 270;
+ break;
+ }
+ if (info.facing == 1) {
+ this.mCameraDisplayOrientation = (info.orientation + degrees) % 360;
+ this.mCameraDisplayOrientation = (360 - this.mCameraDisplayOrientation) % 360;
+ } else {
+ this.mCameraDisplayOrientation = ((info.orientation - degrees) + 360) % 360;
+ }
+ this.mCamera.setDisplayOrientation(this.mCameraDisplayOrientation);
+ }
+
+ @TargetApi(8)
+ private void setCameraParameters(int screenWidth, int screenHeight) {
+ Log.e(TAG,"screenWidth="+screenWidth+",screenHeight="+screenHeight);
+ Parameters parameters = this.mCamera.getParameters();
+ setPreviewSize(screenWidth, screenHeight, parameters);
+ setZoom(parameters);
+ String focusModeValues = parameters.get("focus-mode-values");
+ if (focusModeValues != null && focusModeValues.contains("macro")) {
+ parameters.set("focus-mode", "macro");
+ this.mHasCameraAutoFocus = true;
+ } else if (focusModeValues == null || !focusModeValues.contains("auto")) {
+ this.mHasCameraAutoFocus = false;
+ } else {
+ parameters.set("focus-mode", "auto");
+ this.mHasCameraAutoFocus = true;
+ }
+ try {
+ this.mCamera.setParameters(parameters);
+ } catch (RuntimeException e) {
+ this.mListener.onCameraIssue();
+ }
+ parameters = this.mCamera.getParameters();
+ this.mPreviewSize = parameters.getPreviewSize();
+ this.mPreviewFrameSize = ((this.mPreviewSize.width * this.mPreviewSize.height) * ImageFormat.getBitsPerPixel(parameters.getPreviewFormat())) / 8;
+ }
+
+ private void setPreviewSize(int screenWidth, int screenHeight, Parameters parameters) {
+ String previewSizeValuesString = parameters.get("preview-size-values");
+ if (previewSizeValuesString == null) {
+ previewSizeValuesString = parameters.get("preview-size-value");
+ }
+ Point bestPreviewSize = null;
+ if (previewSizeValuesString != null) {
+ bestPreviewSize = findBestPreviewSize(previewSizeValuesString, screenWidth, screenHeight);
+ }
+ if (bestPreviewSize != null) {
+ parameters.setPreviewSize(bestPreviewSize.x, bestPreviewSize.y);
+ } else {
+ parameters.setPreviewSize((screenWidth >> 4) << 4, (screenHeight >> 1) << 1);
+ }
+ }
+
+ private static Point findBestPreviewSize(CharSequence previewSizeValuesString, int screenWidth, int screenHeight) {
+ int bestPreviewWidth = 0;
+ int bestPreviewHeight = 0;
+ int minDifference = Integer.MAX_VALUE;
+ for (String previewSizeValueString : COMMA_PATTERN.split(previewSizeValuesString)) {
+ String previewSizeValueString2 = previewSizeValueString.trim();
+ int separatorPosition = previewSizeValueString2.indexOf(120);
+ if (separatorPosition >= 0) {
+ try {
+ int previewSizeValueWidth = Integer.parseInt(previewSizeValueString2.substring(0, separatorPosition));
+ int previewSizeValueHeight = Integer.parseInt(previewSizeValueString2.substring(separatorPosition + 1));
+ int difference = Math.abs(previewSizeValueWidth - screenWidth) + Math.abs(previewSizeValueHeight - screenHeight);
+ if (difference == 0) {
+ bestPreviewWidth = previewSizeValueWidth;
+ bestPreviewHeight = previewSizeValueHeight;
+ break;
+ } else if (difference < minDifference) {
+ bestPreviewWidth = previewSizeValueWidth;
+ bestPreviewHeight = previewSizeValueHeight;
+ minDifference = difference;
+ }
+ } catch (NumberFormatException e) {
+ }
+ }
+ }
+ if (bestPreviewWidth <= 0 || bestPreviewHeight <= 0) {
+ return null;
+ }
+ Log.e(TAG,"bestPreviewWidth="+bestPreviewWidth+",bestPreviewHeight="+bestPreviewHeight);
+ return new Point(bestPreviewWidth, bestPreviewHeight);
+ }
+
+ private void setZoom(Parameters parameters) {
+ String zoomSupportedString = parameters.get("zoom-supported");
+ if (zoomSupportedString == null || Boolean.parseBoolean(zoomSupportedString)) {
+ int maxZoomX10;
+ int desiredZoomX10 = DESIRED_ZOOM_X10;
+ String maxZoomString = parameters.get("max-zoom");
+ if (maxZoomString != null) {
+ try {
+ maxZoomX10 = (int) (10.0d * Double.parseDouble(maxZoomString));
+ if (DESIRED_ZOOM_X10 > maxZoomX10) {
+ desiredZoomX10 = maxZoomX10;
+ }
+ } catch (NumberFormatException e) {
+ }
+ }
+ String takingPictureZoomMaxString = parameters.get("taking-picture-zoom-max");
+ if (takingPictureZoomMaxString != null) {
+ try {
+ maxZoomX10 = Integer.parseInt(takingPictureZoomMaxString);
+ if (desiredZoomX10 > maxZoomX10) {
+ desiredZoomX10 = maxZoomX10;
+ }
+ } catch (NumberFormatException e2) {
+ }
+ }
+ String motZoomValuesString = parameters.get("mot-zoom-values");
+ if (motZoomValuesString != null) {
+ desiredZoomX10 = findBestMotZoomX10(motZoomValuesString, desiredZoomX10);
+ }
+ String motZoomStepString = parameters.get("mot-zoom-step");
+ if (motZoomStepString != null) {
+ try {
+ int motZoomStepX10 = (int) (10.0d * Double.parseDouble(motZoomStepString.trim()));
+ if (motZoomStepX10 > 1) {
+ desiredZoomX10 -= desiredZoomX10 % motZoomStepX10;
+ }
+ } catch (NumberFormatException e3) {
+ }
+ }
+ if (!(maxZoomString == null && motZoomValuesString == null)) {
+ parameters.set("zoom", String.valueOf(((double) desiredZoomX10) / 10.0d));
+ }
+ if (takingPictureZoomMaxString != null) {
+ parameters.set("taking-picture-zoom", desiredZoomX10);
+ }
+ }
+ }
+
+ private static int findBestMotZoomX10(CharSequence motZoomValuesString, int desiredZoomX10) {
+ int bestMotZoomX10 = 0;
+ String[] split = COMMA_PATTERN.split(motZoomValuesString);
+ int length = split.length;
+ int i = 0;
+ while (i < length) {
+ try {
+ int motZoomValueX10 = (int) (10.0d * Double.parseDouble(split[i].trim()));
+ if (Math.abs(desiredZoomX10 - motZoomValueX10) < Math.abs(desiredZoomX10 - bestMotZoomX10)) {
+ bestMotZoomX10 = motZoomValueX10;
+ }
+ i++;
+ } catch (NumberFormatException e) {
+ return desiredZoomX10;
+ }
+ }
+ return bestMotZoomX10;
+ }
+
+ static {
+ TAG = ScannerLiveViewLiner.class.getSimpleName();
+ COMMA_PATTERN = Pattern.compile(",");
+ }
+}
--- /dev/null
+package com.visionsmarts.pic2shop.view;
+
+import android.content.Context;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Paint;
+import android.graphics.Paint.Align;
+import android.graphics.Paint.Style;
+import android.graphics.Point;
+import android.graphics.Rect;
+import android.graphics.Typeface;
+import android.text.Layout.Alignment;
+import android.text.StaticLayout;
+import android.text.TextPaint;
+import android.util.AttributeSet;
+import android.view.Display;
+import android.view.View;
+import android.view.WindowManager;
+
+public class ScannerOverlay extends View {
+ private static final float LASER_LINE_WIDTH_160_DPI = 7.0f;
+ private static final float TEXT_FONT_SIZE = 20.0f;
+ private Paint mBarcodeLinePaint;
+ private Rect mBarcodeLineRect;
+ private Rect mCanvasClipRect;
+ private Paint mLaserLinePaint;
+ private int mLaserLinePosition;
+ private Rect mLaserLineRect;
+ private float mScreenDensity;
+ private Point mScreenResolution;
+ private Paint mTextBackgroundPaint;
+ private StaticLayout mTextLayout;
+
+ public ScannerOverlay(Context context) {
+ super(context);
+ this.mCanvasClipRect = new Rect();
+ this.mLaserLineRect = new Rect();
+ this.mBarcodeLineRect = new Rect(-1, -1, -1, -1);
+ initialize(context);
+ }
+
+ public ScannerOverlay(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ this.mCanvasClipRect = new Rect();
+ this.mLaserLineRect = new Rect();
+ this.mBarcodeLineRect = new Rect(-1, -1, -1, -1);
+ initialize(context);
+ }
+
+ public ScannerOverlay(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ this.mCanvasClipRect = new Rect();
+ this.mLaserLineRect = new Rect();
+ this.mBarcodeLineRect = new Rect(-1, -1, -1, -1);
+ initialize(context);
+ }
+
+ private void initialize(Context context) {
+ this.mTextBackgroundPaint = new Paint();
+ this.mTextBackgroundPaint.setStyle(Style.FILL);
+ this.mTextBackgroundPaint.setColor(Color.GREEN);
+ this.mTextBackgroundPaint.setAlpha(204);
+ TextPaint textPaint = new TextPaint();
+ textPaint.setStyle(Style.FILL);
+ textPaint.setStrokeWidth(1.0f);
+ textPaint.setColor(-1);
+ textPaint.setAlpha(204);
+ textPaint.setAntiAlias(true);
+ textPaint.setTypeface(Typeface.DEFAULT_BOLD);
+ textPaint.setTextSize(TEXT_FONT_SIZE * context.getResources().getDisplayMetrics().scaledDensity);
+ textPaint.setTextAlign(Align.CENTER);
+ this.mTextLayout = new StaticLayout("将二维码/条形码放入框内, 即可自动扫描", textPaint, context.getResources().getDisplayMetrics().heightPixels, Alignment.ALIGN_NORMAL, 1.0f, 0.0f, true);
+ this.mLaserLinePaint = new Paint();
+ this.mLaserLinePaint.setStyle(Style.FILL);
+ this.mLaserLinePaint.setColor(-65536);
+ this.mLaserLinePaint.setAlpha(255);
+ this.mBarcodeLinePaint = new Paint();
+ this.mBarcodeLinePaint.setStyle(Style.FILL);
+ this.mBarcodeLinePaint.setColor(-16711936);
+ this.mBarcodeLinePaint.setAlpha(255);
+ Display display = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
+ this.mScreenResolution = new Point(display.getWidth(), display.getHeight());
+ this.mScreenDensity = getContext().getResources().getDisplayMetrics().density;
+ this.mLaserLinePosition = Math.round((float) (this.mScreenResolution.x / 2));
+ }
+
+ protected void onDraw(Canvas canvas) {
+ float center = ((float) canvas.getHeight()) / 2.0f;
+ canvas.rotate(-90.0f, center, center);
+ if (canvas.getClipBounds(this.mCanvasClipRect)) {
+ if (this.mCanvasClipRect.height() == canvas.getWidth()) {
+ canvas.drawRect(0.0f, (float) (this.mCanvasClipRect.bottom - this.mTextLayout.getHeight()), (float) this.mCanvasClipRect.right, (float) this.mCanvasClipRect.bottom, this.mTextBackgroundPaint);
+ canvas.save();
+ canvas.translate(this.mCanvasClipRect.exactCenterX(), (float) (this.mCanvasClipRect.bottom - this.mTextLayout.getHeight()));
+ this.mTextLayout.draw(canvas);
+ canvas.restore();
+ int lineWidth = Math.round(LASER_LINE_WIDTH_160_DPI * this.mScreenDensity);
+ this.mLaserLineRect.set(this.mCanvasClipRect.width() / 8, this.mLaserLinePosition - (lineWidth / 2), (this.mCanvasClipRect.width() * 7) / 8, this.mLaserLinePosition + ((lineWidth - 1) / 2));
+ this.mBarcodeLineRect.top = this.mLaserLineRect.top;
+ this.mBarcodeLineRect.bottom = this.mLaserLineRect.bottom;
+ }
+ canvas.drawRect(this.mLaserLineRect, this.mLaserLinePaint);
+ if (this.mBarcodeLineRect.left >= 0 && this.mBarcodeLineRect.right >= 0) {
+ canvas.drawRect(this.mBarcodeLineRect, this.mBarcodeLinePaint);
+ }
+ }
+ }
+
+ public float getNormalizedLaserLinePosition() {
+ return ((float) this.mLaserLinePosition) / ((float) this.mScreenResolution.x);
+ }
+
+ public void setNormalizedBarcodeLocation(float left, float right) {
+ this.mBarcodeLineRect.left = Math.round(((float) this.mScreenResolution.y) * left);
+ this.mBarcodeLineRect.right = Math.round(((float) this.mScreenResolution.y) * right);
+ postInvalidate(this.mLaserLineRect.top, 0, this.mLaserLineRect.bottom, this.mScreenResolution.y - 1);
+ }
+
+ public void setNoBarcodeLocation() {
+ this.mBarcodeLineRect.left = -1;
+ this.mBarcodeLineRect.right = -1;
+ postInvalidate(this.mLaserLineRect.top, 0, this.mLaserLineRect.bottom, this.mScreenResolution.y - 1);
+ }
+}
--- /dev/null
+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;
+ }
+ }
+
+}
<?xml version='1.0' encoding='utf-8'?>
-<widget id="com.supwisdom.dlapp" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
+<widget id="com.dalicitycard.app" version="1.0.4" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<feature name="Fingerprint">
<param name="android-package" value="de.niklasmerz.cordova.fingerprint.Fingerprint" />
</feature>
<feature name="JPushPlugin">
<param name="android-package" value="cn.jiguang.cordova.push.JPushPlugin" />
</feature>
+ <feature name="AppVersion">
+ <param name="android-package" value="uk.co.whiteoctober.cordova.AppVersion" />
+ </feature>
<name short="大理市民卡">dlapp</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
<edit-config file="*-Info.plist" mode="merge" target="NSCameraUsageDescription">
<string>APP需要使用您的相机权限,没有该权限将无法完成扫一扫功能</string>
</edit-config>
+ <edit-config file="*-Info.plist" mode="merge" target="NSPhotoLibraryUsageDescription">
+ <string>APP需要使用您的相册权限,没有该权限将无法完成扫一扫功能</string>
+ </edit-config>
<allow-intent href="market:*" />
<preference name="loglevel" value="DEBUG" />
<preference name="AutoHideSplashScreen" value="true" />
<preference name="DisallowOverscroll" value="true" />
<preference name="UIWebViewBounce" value="false" />
<preference name="BackupWebStorage" value="local" />
+ <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
</widget>
}
dependencies {
- compile 'com.journeyapps:zxing-android-embedded:3.3.0'
- compile 'com.android.support:appcompat-v7:23.1.0'
+ implementation 'com.journeyapps:zxing-android-embedded:3.3.0'
+ implementation 'com.android.support:appcompat-v7:23.1.0'
}
android {
"clobbers": [
"JPush"
]
+ },
+ {
+ "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 = {
"cordova-plugin-device": "2.0.2",
"cordova-plugin-themeablebrowser": "0.2.17",
"cordova-plugin-jcore": "1.3.0",
- "jpush-phonegap-plugin": "3.7.2"
+ "jpush-phonegap-plugin": "3.7.2",
+ "cordova-plugin-app-version": "0.1.9",
+ "cordova-plugin-wkwebview-engine": "1.2.1"
};
});
\ No newline at end of file
--- /dev/null
+cordova.define("cordova-plugin-app-version.AppVersionPlugin", function(require, exports, module) {
+/*jslint indent: 2 */
+/*global window, jQuery, angular, cordova */
+"use strict";
+
+// Returns a jQuery or AngularJS deferred object, or pass a success and fail callbacks if you don't want to use jQuery or AngularJS
+var getPromisedCordovaExec = function (command, success, fail) {
+ var toReturn, deferred, injector, $q;
+ if (success === undefined) {
+ if (window.jQuery) {
+ deferred = jQuery.Deferred();
+ success = deferred.resolve;
+ fail = deferred.reject;
+ toReturn = deferred;
+ } else if (window.angular) {
+ injector = angular.injector(["ng"]);
+ $q = injector.get("$q");
+ deferred = $q.defer();
+ success = deferred.resolve;
+ fail = deferred.reject;
+ toReturn = deferred.promise;
+ } else if (window.when && window.when.promise) {
+ deferred = when.defer();
+ success = deferred.resolve;
+ fail = deferred.reject;
+ toReturn = deferred.promise;
+ } else if (window.Promise) {
+ toReturn = new Promise(function(c, e) {
+ success = c;
+ fail = e;
+ });
+ } else if (window.WinJS && window.WinJS.Promise) {
+ toReturn = new WinJS.Promise(function(c, e) {
+ success = c;
+ fail = e;
+ });
+ } else {
+ return console.error('AppVersion either needs a success callback, or jQuery/AngularJS/Promise/WinJS.Promise defined for using promises');
+ }
+ }
+ // 5th param is NOT optional. must be at least empty array
+ cordova.exec(success, fail, "AppVersion", command, []);
+ return toReturn;
+};
+
+var getAppVersion = function (success, fail) {
+ return getPromisedCordovaExec('getVersionNumber', success, fail);
+};
+
+getAppVersion.getAppName = function (success, fail) {
+ return getPromisedCordovaExec('getAppName', success, fail);
+};
+
+getAppVersion.getPackageName = function (success, fail) {
+ return getPromisedCordovaExec('getPackageName', success, fail);
+};
+
+getAppVersion.getVersionNumber = function (success, fail) {
+ return getPromisedCordovaExec('getVersionNumber', success, fail);
+};
+
+getAppVersion.getVersionCode = function (success, fail) {
+ return getPromisedCordovaExec('getVersionCode', success, fail);
+};
+
+module.exports = getAppVersion;
+
+});
"mode": "merge",
"id": "config.xml"
}
+ ],
+ "NSPhotoLibraryUsageDescription": [
+ {
+ "xml": "<string>APP需要使用您的相册权限,没有该权限将无法完成扫一扫功能</string>",
+ "count": 1,
+ "mode": "merge",
+ "id": "config.xml"
+ }
]
}
}
"PACKAGE_NAME": "com.supwisdom.dlapp"
},
"jpush-phonegap-plugin": {
- "APP_KEY": "your_jpush_appkey",
+ "APP_KEY": "bd22b85f247a6e2ca307d3c5",
"CHANNEL": "developer-default",
"PACKAGE_NAME": "com.supwisdom.dlapp"
+ },
+ "cordova-plugin-app-version": {
+ "PACKAGE_NAME": "com.supwisdom.dlapp"
+ },
+ "cordova-plugin-wkwebview-engine": {
+ "PACKAGE_NAME": "com.supwisdom.dlapp"
}
},
"dependent_plugins": {},
"clobbers": [
"JPush"
]
+ },
+ {
+ "file": "plugins/cordova-plugin-app-version/www/AppVersionPlugin.js",
+ "id": "cordova-plugin-app-version.AppVersionPlugin",
+ "pluginId": "cordova-plugin-app-version",
+ "clobbers": [
+ "cordova.getAppVersion"
+ ]
}
],
"plugin_metadata": {
"cordova-plugin-device": "2.0.2",
"cordova-plugin-themeablebrowser": "0.2.17",
"cordova-plugin-jcore": "1.3.0",
- "jpush-phonegap-plugin": "3.7.2"
+ "jpush-phonegap-plugin": "3.7.2",
+ "cordova-plugin-app-version": "0.1.9",
+ "cordova-plugin-wkwebview-engine": "1.2.1"
}
}
<?xml version='1.0' encoding='utf-8'?>
-<widget id="com.supwisdom.dlapp" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
+<widget id="com.dalicitycard.app" version="1.0.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name short="大理市民卡">dlapp</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
<edit-config file="*-Info.plist" mode="merge" target="NSCameraUsageDescription">
<string>APP需要使用您的相机权限,没有该权限将无法完成扫一扫功能</string>
</edit-config>
+ <edit-config file="*-Info.plist" mode="merge" target="NSPhotoLibraryUsageDescription">
+ <string>APP需要使用您的相册权限,没有该权限将无法完成扫一扫功能</string>
+ </edit-config>
<preference name="AutoHideSplashScreen" value="true" />
<preference name="SplashScreenDelay" value="0" />
<preference name="SplashShowOnlyFirstTime" value="true" />
"clobbers": [
"JPush"
]
+ },
+ {
+ "file": "plugins/cordova-plugin-app-version/www/AppVersionPlugin.js",
+ "id": "cordova-plugin-app-version.AppVersionPlugin",
+ "pluginId": "cordova-plugin-app-version",
+ "clobbers": [
+ "cordova.getAppVersion"
+ ]
}
];
module.exports.metadata =
"cordova-plugin-device": "2.0.2",
"cordova-plugin-themeablebrowser": "0.2.17",
"cordova-plugin-jcore": "1.3.0",
- "jpush-phonegap-plugin": "3.7.2"
+ "jpush-phonegap-plugin": "3.7.2",
+ "cordova-plugin-app-version": "0.1.9",
+ "cordova-plugin-wkwebview-engine": "1.2.1"
}
// BOTTOM OF METADATA
});
\ No newline at end of file
--- /dev/null
+cordova.define("cordova-plugin-app-version.AppVersionPlugin", function(require, exports, module) { /*jslint indent: 2 */
+/*global window, jQuery, angular, cordova */
+"use strict";
+
+// Returns a jQuery or AngularJS deferred object, or pass a success and fail callbacks if you don't want to use jQuery or AngularJS
+var getPromisedCordovaExec = function (command, success, fail) {
+ var toReturn, deferred, injector, $q;
+ if (success === undefined) {
+ if (window.jQuery) {
+ deferred = jQuery.Deferred();
+ success = deferred.resolve;
+ fail = deferred.reject;
+ toReturn = deferred;
+ } else if (window.angular) {
+ injector = angular.injector(["ng"]);
+ $q = injector.get("$q");
+ deferred = $q.defer();
+ success = deferred.resolve;
+ fail = deferred.reject;
+ toReturn = deferred.promise;
+ } else if (window.when && window.when.promise) {
+ deferred = when.defer();
+ success = deferred.resolve;
+ fail = deferred.reject;
+ toReturn = deferred.promise;
+ } else if (window.Promise) {
+ toReturn = new Promise(function(c, e) {
+ success = c;
+ fail = e;
+ });
+ } else if (window.WinJS && window.WinJS.Promise) {
+ toReturn = new WinJS.Promise(function(c, e) {
+ success = c;
+ fail = e;
+ });
+ } else {
+ return console.error('AppVersion either needs a success callback, or jQuery/AngularJS/Promise/WinJS.Promise defined for using promises');
+ }
+ }
+ // 5th param is NOT optional. must be at least empty array
+ cordova.exec(success, fail, "AppVersion", command, []);
+ return toReturn;
+};
+
+var getAppVersion = function (success, fail) {
+ return getPromisedCordovaExec('getVersionNumber', success, fail);
+};
+
+getAppVersion.getAppName = function (success, fail) {
+ return getPromisedCordovaExec('getAppName', success, fail);
+};
+
+getAppVersion.getPackageName = function (success, fail) {
+ return getPromisedCordovaExec('getPackageName', success, fail);
+};
+
+getAppVersion.getVersionNumber = function (success, fail) {
+ return getPromisedCordovaExec('getVersionNumber', success, fail);
+};
+
+getAppVersion.getVersionCode = function (success, fail) {
+ return getPromisedCordovaExec('getVersionCode', success, fail);
+};
+
+module.exports = getAppVersion;
+
+});
<key>ApplicationPath</key>
<string>Applications/dlapp.app</string>
<key>CFBundleIdentifier</key>
- <string>com.supwisdom.dlapp</string>
+ <string>com.dalicitycard.app</string>
<key>CFBundleShortVersionString</key>
- <string>1.0.0</string>
+ <string>1.0.4</string>
<key>CFBundleVersion</key>
- <string>1.0.0</string>
+ <string>1.0.4</string>
<key>SigningIdentity</key>
- <string>iPhone Developer: wang sheng (5Z23CVC58F)</string>
+ <string>iPhone Developer: chuan xu (8FWH8QKULT)</string>
<key>Team</key>
- <string>74UNETA6B2</string>
+ <string>58ZC23SH57</string>
</dict>
<key>ArchiveVersion</key>
<integer>2</integer>
<key>CreationDate</key>
- <date>2019-07-12T05:53:30Z</date>
+ <date>2019-09-25T06:49:04Z</date>
<key>Name</key>
<string>dlapp</string>
<key>SchemeName</key>
<dict>
<key>AppIcon20x20@2x.png</key>
<data>
- DjEAtviupMghxdL+fkyb3vVUBOI=
+ 4s3iHwVtc4D5rEDx0dsVP3Ccp+M=
</data>
<key>AppIcon20x20@2x~ipad.png</key>
<data>
- DjEAtviupMghxdL+fkyb3vVUBOI=
+ 4s3iHwVtc4D5rEDx0dsVP3Ccp+M=
</data>
<key>AppIcon20x20@3x.png</key>
<data>
- BfVRyLrHGHJm+0WuwuOPqz2aCas=
+ inNMZ0LYnXYtiXOTodGWImyL6MU=
</data>
<key>AppIcon20x20~ipad.png</key>
<data>
- H6rZilBJB9YKOyY97leKlTxy6XM=
+ QgEmJmozGUfF6Gxc90W4zVT/ZEk=
</data>
<key>AppIcon29x29.png</key>
<data>
- otncBRMMKVzMW+iwsSzrGJYek6w=
+ HHDfUCqu1hpJ1qn2R16w+JzH8/k=
</data>
<key>AppIcon29x29@2x.png</key>
<data>
- Ro2/nf0nqrSy4vCWu94qHBsgntU=
+ dpGzXh2r7rpz2qmVWfS/drJRxFk=
</data>
<key>AppIcon29x29@2x~ipad.png</key>
<data>
- Ro2/nf0nqrSy4vCWu94qHBsgntU=
+ dpGzXh2r7rpz2qmVWfS/drJRxFk=
</data>
<key>AppIcon29x29@3x.png</key>
<data>
- QDnu1K3zTpRFbUpH1pc06nQXP/4=
+ gcxHkRSzkCsIG42uKL9uYXOrdJE=
</data>
<key>AppIcon29x29~ipad.png</key>
<data>
- otncBRMMKVzMW+iwsSzrGJYek6w=
+ HHDfUCqu1hpJ1qn2R16w+JzH8/k=
</data>
<key>AppIcon40x40@2x.png</key>
<data>
- bqhTfe/UUsLmwqwKtmYfpBNyHHE=
+ BcBek5g6jsOqa0ibWCnC1JTgL+c=
</data>
<key>AppIcon40x40@2x~ipad.png</key>
<data>
- bqhTfe/UUsLmwqwKtmYfpBNyHHE=
+ BcBek5g6jsOqa0ibWCnC1JTgL+c=
</data>
<key>AppIcon40x40@3x.png</key>
<data>
- 7bf8dqKMlGV9BeNvI9Z4FC+62EU=
+ +0oGxBUPkB+c6Z7XyUmtZpCo2lU=
</data>
<key>AppIcon40x40~ipad.png</key>
<data>
- DjEAtviupMghxdL+fkyb3vVUBOI=
- </data>
- <key>AppIcon50x50@2x~ipad.png</key>
- <data>
- 04wFY+JbiDwIxpPmec88nEldiCY=
- </data>
- <key>AppIcon50x50~ipad.png</key>
- <data>
- +ULYPtkyH7TWwGxGEFNW6M8jLYE=
- </data>
- <key>AppIcon57x57.png</key>
- <data>
- PbF/1dvCpOLYNWV+g1MRQWl4WnE=
- </data>
- <key>AppIcon57x57@2x.png</key>
- <data>
- V0sslzjLj1HAL3zLlk8dvEctXT0=
+ 4s3iHwVtc4D5rEDx0dsVP3Ccp+M=
</data>
<key>AppIcon60x60@2x.png</key>
<data>
- 7bf8dqKMlGV9BeNvI9Z4FC+62EU=
+ +0oGxBUPkB+c6Z7XyUmtZpCo2lU=
</data>
<key>AppIcon60x60@3x.png</key>
<data>
- u4hDZJNq/M9gB/k7ZWPGCQh1dlY=
- </data>
- <key>AppIcon72x72@2x~ipad.png</key>
- <data>
- 6XXlAQJ+2YZtK4XZVDeAXCGQAjs=
- </data>
- <key>AppIcon72x72~ipad.png</key>
- <data>
- qt7V3ayH99MYvDNK/r88oIVhpxI=
+ 2N92m9WnIZ8k7WASphMkppCl7HA=
</data>
<key>AppIcon76x76@2x~ipad.png</key>
<data>
- dPM76DtwjHUolue6BdDUn6RQXnQ=
+ iMfY34hWth/mR2xKqlWonHWYrDQ=
</data>
<key>AppIcon76x76~ipad.png</key>
<data>
- mVA2cm+ufolVC0dfMnpXBt7NFYw=
+ z6rQV98PVDRhQUXa/DwAbinm0SA=
</data>
<key>AppIcon83.5x83.5@2x~ipad.png</key>
<data>
- F3/BziTbXcn/vpTHvub/+Txde8U=
+ oJtSiDfNgPpCB0QhhFClnkrbXcQ=
</data>
<key>Assets.car</key>
<data>
- r9rUGcVj88K1Zc51XtyyT15hnfk=
+ KKAirXh8K/ModwnSXLShV5/etr0=
</data>
<key>Frameworks/libswiftAVFoundation.dylib</key>
<data>
- ukqktZJa/8A+eCPL/P22HQgAC1k=
+ uDfYCHXGi4LJJ7PehI1sKbZqVf4=
</data>
<key>Frameworks/libswiftCore.dylib</key>
<data>
- GREBcl8kDXtAsOe5ywfZW3xto9k=
+ hnZxV4PUHdqbt8IOBCPhBpfSwUE=
</data>
<key>Frameworks/libswiftCoreAudio.dylib</key>
<data>
- hT5I0SMVXfebWk6J/t2JG8P9cLw=
+ /mmLx8jrVORtoTACElCyWqzqYfA=
</data>
<key>Frameworks/libswiftCoreFoundation.dylib</key>
<data>
- LDYTh6fyuPjxuyAKIBufA7E4nDw=
+ v7BE4evcLJt3iFrwd9m33m5rFI8=
</data>
<key>Frameworks/libswiftCoreGraphics.dylib</key>
<data>
- ZD7SY7zfzZOkv/ex3o4soLRgyKU=
+ qxYPH4/wxggOGD73Xj6EkCR0xkY=
</data>
<key>Frameworks/libswiftCoreImage.dylib</key>
<data>
- pDi7kJiFWg8POUcZ02wMhGdzpEU=
+ vlRBCfDqtrrwzkBLtGs2HbO4YbI=
</data>
<key>Frameworks/libswiftCoreMedia.dylib</key>
<data>
- rs4o8hPdZsIaykGs8h6jw9/bEac=
+ CyOREkCX0hnTg5JHbY6kdrfAERI=
</data>
<key>Frameworks/libswiftDarwin.dylib</key>
<data>
- nqFz221Io6AgWQK2mjBZH53FOBQ=
+ nd3vDcLn6YQQrhlqobWhMV/sLAE=
</data>
<key>Frameworks/libswiftDispatch.dylib</key>
<data>
- 5SUy+afr0k0FIaWpa01vu9OoYsk=
+ Xlup3R5V6sXScSmXMkAysKJWVXk=
</data>
<key>Frameworks/libswiftFoundation.dylib</key>
<data>
- 4KLJXVVgDMFE0WIsT9hLmcA7DNo=
+ 6FQCjaFEt9vOMPGkD3Bi4b9USw0=
</data>
<key>Frameworks/libswiftMetal.dylib</key>
<data>
- sLaCL5cSVZgN2tzYV0APfk1uaRM=
+ JJGt6xWjffN+5mM0q0dDOmJ8dDE=
</data>
<key>Frameworks/libswiftObjectiveC.dylib</key>
<data>
- aKLtw+VhPxXGVOKvhsUQPeGTNW0=
+ OIdIVW04vwXmE+cHkwyzMTkbvnU=
</data>
<key>Frameworks/libswiftQuartzCore.dylib</key>
<data>
- DAih33A0MVtJw87+AJ1vZeye528=
+ cshqKXNDw3S4IFGWYenc+0CqhCk=
</data>
<key>Frameworks/libswiftSwiftOnoneSupport.dylib</key>
<data>
- yXFysLEA844zanH61b0YqEDGMks=
+ T9TevUnkeG5ZEUxj0Pdl4fF0vUE=
</data>
<key>Frameworks/libswiftUIKit.dylib</key>
<data>
- 0IIDJ+kZElM4TpEU9I1GwOCQUvQ=
+ TrQW8qKOdy8IEbHkKhWe3R+o2ZM=
</data>
<key>Frameworks/libswiftos.dylib</key>
<data>
- v5ybt8/g6uVCJbKKlrL6rvz9cMM=
+ TQ11eqpSTjqthNmaPsfIeasSdUk=
</data>
<key>Frameworks/libswiftsimd.dylib</key>
<data>
- A8vh5DhJOdsNjcnMpf8HZmtFLt0=
+ 3yFMAEujHZwmMLxWNEPsqtRI7l8=
</data>
<key>Info.plist</key>
<data>
- xCcMK6i5qsOv40GndCWSWjMi70w=
+ ptakydEySnuUqGLwmDSThlf9kP8=
+ </data>
+ <key>JPushConfig.plist</key>
+ <data>
+ qV/PQh+d737riAnpOVOo2BJPYKw=
</data>
<key>LaunchImage-1100-Landscape-2436h@3x.png</key>
<data>
</data>
<key>MainViewController.nib</key>
<data>
- c8qwsmtNPeDXR5piUQXUJZV4NkU=
+ Hbj+jg8kHggfQilLv2funLLiKdE=
</data>
<key>PkgInfo</key>
<data>
</data>
<key>config.xml</key>
<data>
- O33IIDUH183cwlV6v9zaOFqmJ1o=
+ IgESgLidVuYaBKc1zJzsW9K32uo=
</data>
<key>embedded.mobileprovision</key>
<data>
- WNm5zuPz65rrY9t5qIL1iJgFcQ8=
+ OuWZMIad+tog0ZMleeOfjgsQuoo=
</data>
<key>www/bill.html</key>
<data>
</data>
<key>www/billdetail.html</key>
<data>
- cqHtFm0XLXtu3pFFlRV0wqo3bLo=
+ x+c/i1RxokvMGRSy2owEyEKzgmg=
</data>
<key>www/bindcard.html</key>
<data>
</data>
<key>www/cordova_plugins.js</key>
<data>
- 5yQtgIC/T2E5OFopQG2kN+WdYrI=
+ mjZMhcaV9rGT+gEJycqyUiJiwp8=
</data>
<key>www/css/aui-iconfont.ttf</key>
<data>
</data>
<key>www/js/billdetail.js</key>
<data>
- ICgW8NAQBBEJmmNYuELt2HMjRtk=
+ sxiH889o1dm1Uaqbq7ReLFK47h0=
</data>
<key>www/js/bindcard.js</key>
<data>
</data>
<key>www/js/index.js</key>
<data>
- asyakUNRxlJpE4P7WMiyTJTY97Y=
+ B5X6EPmPRDoyX3Z9Eq1q8rmGSGQ=
</data>
<key>www/js/lib/aui-actionsheet.js</key>
<data>
</data>
<key>www/js/login.js</key>
<data>
- GnaACCIZ8j2xg8PJGAWxS4CymgM=
+ ldWa4XoqiR3SZsamE16ZBUrQDT4=
</data>
<key>www/js/main.js</key>
<data>
- I2Jj7RTovo4kH11m8CRuakKi3nk=
+ QSdOeA6BefLzgiGbSEou4rGjHqo=
</data>
<key>www/js/mobile.js</key>
<data>
</data>
<key>www/js/qrcode.js</key>
<data>
- nUamfLQSBc/NAzOMJP5WwXnZGxI=
+ Cx6iRRJAH08QlPBBT//jwM7LZP4=
</data>
<key>www/js/register.js</key>
<data>
- aPLw5ln4ElwhbTzbdXZpyILJBiY=
+ kEIN8Lt6KbeSEYmiYk47uhchWg8=
</data>
<key>www/js/scan.js</key>
<data>
- xRDtmYCYmFtZu+H1/SjTBlennsM=
+ Cea6nn8OF3hogSuEpiL+IkVdO0I=
</data>
<key>www/js/security.js</key>
<data>
- s52wwGEv5fJuX8ngkR5GGqdAXMg=
+ B2Cv1FDNaUjne/EkpPvlr5Cve88=
</data>
<key>www/js/server.js</key>
<data>
- 6JlWzinRBn6MsREucfIEiCvn5oA=
+ jp9NlgHW1O72GXbxGb4cmcCVw+w=
</data>
<key>www/js/signxy.js</key>
<data>
<data>
09a/If3TGPR46gxmzbSwdbcSvBc=
</data>
+ <key>www/plugins/cordova-plugin-app-version/www/AppVersionPlugin.js</key>
+ <data>
+ V7Ywjbu2Kj4wesp8mWW2lF5aDpE=
+ </data>
<key>www/plugins/cordova-plugin-camera/www/Camera.js</key>
<data>
/Tl12sGFo/UZbPqnupaaV0Hg0vU=
<data>
oGafU2UdHnS6q3vnNz3WB2an0TY=
</data>
+ <key>www/plugins/cordova-plugin-wkwebview-engine/src/www/ios/ios-wkwebview-exec.js</key>
+ <data>
+ Jf+80xptQsEGhUiGLgqUT/RQinI=
+ </data>
+ <key>www/plugins/cordova-plugin-wkwebview-engine/src/www/ios/ios-wkwebview.js</key>
+ <data>
+ uSpOoBJtw3huMClDN2UUZQOjz/Y=
+ </data>
+ <key>www/plugins/jpush-phonegap-plugin/www/JPushPlugin.js</key>
+ <data>
+ WbD83XEtIdDDWazehjb7DykZYCE=
+ </data>
<key>www/pwdset.html</key>
<data>
V3rync0T0/WyYm1RxOmrQ0VHwls=
</data>
<key>www/qrcode.html</key>
<data>
- /T8vAhNAeCOJv1Hw6L4detL0zZE=
+ FK8oc1oB59vB31qmvZp+SzcB9/U=
</data>
<key>www/register.html</key>
<data>
- q/NP40bBQOZfbeq+nId2UNahWqk=
+ j0E17LezraXxL2i9s0tnnWrl9vw=
</data>
<key>www/scan.html</key>
<data>
</data>
<key>www/security.html</key>
<data>
- LQqkVW0wcKOsVTN4GeoIHaLFmHA=
+ 3isNUT+DEogiz2Le39n8VyG+mRQ=
</data>
<key>www/signxy.html</key>
<data>
<dict>
<key>hash</key>
<data>
- DjEAtviupMghxdL+fkyb3vVUBOI=
+ 4s3iHwVtc4D5rEDx0dsVP3Ccp+M=
</data>
<key>hash2</key>
<data>
- 8gs3eoIb4H9cpuPaDkErBai6L4FZOZfyttI/pYM3Hw4=
+ /jx2HIiBG+oNpd+0usVeIZxAvkA27ZpiSAex3riWFHQ=
</data>
</dict>
<key>AppIcon20x20@2x~ipad.png</key>
<dict>
<key>hash</key>
<data>
- DjEAtviupMghxdL+fkyb3vVUBOI=
+ 4s3iHwVtc4D5rEDx0dsVP3Ccp+M=
</data>
<key>hash2</key>
<data>
- 8gs3eoIb4H9cpuPaDkErBai6L4FZOZfyttI/pYM3Hw4=
+ /jx2HIiBG+oNpd+0usVeIZxAvkA27ZpiSAex3riWFHQ=
</data>
</dict>
<key>AppIcon20x20@3x.png</key>
<dict>
<key>hash</key>
<data>
- BfVRyLrHGHJm+0WuwuOPqz2aCas=
+ inNMZ0LYnXYtiXOTodGWImyL6MU=
</data>
<key>hash2</key>
<data>
- wB8DRUnh3AMIUfOsoN2UakYsGsGtVsCMKPqymkIfzys=
+ BR1eZknKOY1H7MAyXZld2yKSOCayLZBdlj5QRFNTSws=
</data>
</dict>
<key>AppIcon20x20~ipad.png</key>
<dict>
<key>hash</key>
<data>
- H6rZilBJB9YKOyY97leKlTxy6XM=
+ QgEmJmozGUfF6Gxc90W4zVT/ZEk=
</data>
<key>hash2</key>
<data>
- sDvITbxB8+WSbGLw2hi9wNucw935HeGWu6F47RDuyDo=
+ Ck2d8ewvZ1cjSx6Vo6hRiwiKcwV7Khb61Rslp5EBorE=
</data>
</dict>
<key>AppIcon29x29.png</key>
<dict>
<key>hash</key>
<data>
- otncBRMMKVzMW+iwsSzrGJYek6w=
+ HHDfUCqu1hpJ1qn2R16w+JzH8/k=
</data>
<key>hash2</key>
<data>
- j3+Oyaoj9BUqxemeJFSZ5I6ZMXcDWGER+zX0zKI5qXk=
+ lFwBNCRgbv9HY1G5bOKNhPiyURhYafyWeI84Xcl8ljg=
</data>
</dict>
<key>AppIcon29x29@2x.png</key>
<dict>
<key>hash</key>
<data>
- Ro2/nf0nqrSy4vCWu94qHBsgntU=
+ dpGzXh2r7rpz2qmVWfS/drJRxFk=
</data>
<key>hash2</key>
<data>
- bGGPXkSeFsyh7eAmq5YgeHYkFDjIsqsr4Yt3dpj09N0=
+ nqN/EqFaooiXfy5K9WhOXvone1cRRvxgsXw4DnLmVlA=
</data>
</dict>
<key>AppIcon29x29@2x~ipad.png</key>
<dict>
<key>hash</key>
<data>
- Ro2/nf0nqrSy4vCWu94qHBsgntU=
+ dpGzXh2r7rpz2qmVWfS/drJRxFk=
</data>
<key>hash2</key>
<data>
- bGGPXkSeFsyh7eAmq5YgeHYkFDjIsqsr4Yt3dpj09N0=
+ nqN/EqFaooiXfy5K9WhOXvone1cRRvxgsXw4DnLmVlA=
</data>
</dict>
<key>AppIcon29x29@3x.png</key>
<dict>
<key>hash</key>
<data>
- QDnu1K3zTpRFbUpH1pc06nQXP/4=
+ gcxHkRSzkCsIG42uKL9uYXOrdJE=
</data>
<key>hash2</key>
<data>
- 2TxWQw5j1QBbjE38vdn2xOMy4knvqkZ/nNLUWNt0sCI=
+ 4VwirX+1pgq35pmm0UyXcG2+NXkxl6DvDAFQ9dvqiLs=
</data>
</dict>
<key>AppIcon29x29~ipad.png</key>
<dict>
<key>hash</key>
<data>
- otncBRMMKVzMW+iwsSzrGJYek6w=
+ HHDfUCqu1hpJ1qn2R16w+JzH8/k=
</data>
<key>hash2</key>
<data>
- j3+Oyaoj9BUqxemeJFSZ5I6ZMXcDWGER+zX0zKI5qXk=
+ lFwBNCRgbv9HY1G5bOKNhPiyURhYafyWeI84Xcl8ljg=
</data>
</dict>
<key>AppIcon40x40@2x.png</key>
<dict>
<key>hash</key>
<data>
- bqhTfe/UUsLmwqwKtmYfpBNyHHE=
+ BcBek5g6jsOqa0ibWCnC1JTgL+c=
</data>
<key>hash2</key>
<data>
- tFvg6swsA5hwLRDfRCDi7CMI0P+ViFf6IgRScxSlb/0=
+ 9WHfcGm0K8HueWfC1UjexYAfaBhvFKeDZfsEyFCEtx4=
</data>
</dict>
<key>AppIcon40x40@2x~ipad.png</key>
<dict>
<key>hash</key>
<data>
- bqhTfe/UUsLmwqwKtmYfpBNyHHE=
+ BcBek5g6jsOqa0ibWCnC1JTgL+c=
</data>
<key>hash2</key>
<data>
- tFvg6swsA5hwLRDfRCDi7CMI0P+ViFf6IgRScxSlb/0=
+ 9WHfcGm0K8HueWfC1UjexYAfaBhvFKeDZfsEyFCEtx4=
</data>
</dict>
<key>AppIcon40x40@3x.png</key>
<dict>
<key>hash</key>
<data>
- 7bf8dqKMlGV9BeNvI9Z4FC+62EU=
+ +0oGxBUPkB+c6Z7XyUmtZpCo2lU=
</data>
<key>hash2</key>
<data>
- 5V8UjSCgkmKRVOYu+FRB0+yhTL1NtlVCTmBhpUNWgC0=
+ F6dGIPQp/X9Huj5SI1FnfRlgqZsfJ8plPgS5DLXmyHc=
</data>
</dict>
<key>AppIcon40x40~ipad.png</key>
<dict>
<key>hash</key>
<data>
- DjEAtviupMghxdL+fkyb3vVUBOI=
+ 4s3iHwVtc4D5rEDx0dsVP3Ccp+M=
</data>
<key>hash2</key>
<data>
- 8gs3eoIb4H9cpuPaDkErBai6L4FZOZfyttI/pYM3Hw4=
- </data>
- </dict>
- <key>AppIcon50x50@2x~ipad.png</key>
- <dict>
- <key>hash</key>
- <data>
- 04wFY+JbiDwIxpPmec88nEldiCY=
- </data>
- <key>hash2</key>
- <data>
- Fgd22lgmtvaG3tzLwnbu57xZPQfGb7kA8fw+v4xYq7M=
- </data>
- </dict>
- <key>AppIcon50x50~ipad.png</key>
- <dict>
- <key>hash</key>
- <data>
- +ULYPtkyH7TWwGxGEFNW6M8jLYE=
- </data>
- <key>hash2</key>
- <data>
- EZireyXQZ2BAg+xIagkCS36vnwTAT9Gj4klrLYnBaK0=
- </data>
- </dict>
- <key>AppIcon57x57.png</key>
- <dict>
- <key>hash</key>
- <data>
- PbF/1dvCpOLYNWV+g1MRQWl4WnE=
- </data>
- <key>hash2</key>
- <data>
- iSorb6M7XrIIMpCBr6awOme1bCqhFhETsVuGfC9jVjo=
- </data>
- </dict>
- <key>AppIcon57x57@2x.png</key>
- <dict>
- <key>hash</key>
- <data>
- V0sslzjLj1HAL3zLlk8dvEctXT0=
- </data>
- <key>hash2</key>
- <data>
- 3GoBd/2HILd1AINYIZ2VN5SyJll0gGaeOlrrU1Ca78A=
+ /jx2HIiBG+oNpd+0usVeIZxAvkA27ZpiSAex3riWFHQ=
</data>
</dict>
<key>AppIcon60x60@2x.png</key>
<dict>
<key>hash</key>
<data>
- 7bf8dqKMlGV9BeNvI9Z4FC+62EU=
+ +0oGxBUPkB+c6Z7XyUmtZpCo2lU=
</data>
<key>hash2</key>
<data>
- 5V8UjSCgkmKRVOYu+FRB0+yhTL1NtlVCTmBhpUNWgC0=
+ F6dGIPQp/X9Huj5SI1FnfRlgqZsfJ8plPgS5DLXmyHc=
</data>
</dict>
<key>AppIcon60x60@3x.png</key>
<dict>
<key>hash</key>
<data>
- u4hDZJNq/M9gB/k7ZWPGCQh1dlY=
- </data>
- <key>hash2</key>
- <data>
- r8K3AZPdn6icGj4YUVtCtXHNle4pibhlywI7n8aG/Io=
- </data>
- </dict>
- <key>AppIcon72x72@2x~ipad.png</key>
- <dict>
- <key>hash</key>
- <data>
- 6XXlAQJ+2YZtK4XZVDeAXCGQAjs=
- </data>
- <key>hash2</key>
- <data>
- 5WyvqaFUnD6nIdPHQmezpma8HivvHieK/L954As389E=
- </data>
- </dict>
- <key>AppIcon72x72~ipad.png</key>
- <dict>
- <key>hash</key>
- <data>
- qt7V3ayH99MYvDNK/r88oIVhpxI=
+ 2N92m9WnIZ8k7WASphMkppCl7HA=
</data>
<key>hash2</key>
<data>
- /1yzmm2Ovvhnj5fOlzXwken4Gpd7Uskb1KN4X1Eh5wI=
+ dQmhVBOE7LllJ1jQuS6MlUwqAY9rw3N83U9OpTvQmUI=
</data>
</dict>
<key>AppIcon76x76@2x~ipad.png</key>
<dict>
<key>hash</key>
<data>
- dPM76DtwjHUolue6BdDUn6RQXnQ=
+ iMfY34hWth/mR2xKqlWonHWYrDQ=
</data>
<key>hash2</key>
<data>
- J9GAry/RDwypFKcWaJ/7THn0XDTXf1vkmuaPFHrNAuQ=
+ zDK30NWfjipDfaQp5rJ1roBf5sk1HCHP1AHfE8Koa3c=
</data>
</dict>
<key>AppIcon76x76~ipad.png</key>
<dict>
<key>hash</key>
<data>
- mVA2cm+ufolVC0dfMnpXBt7NFYw=
+ z6rQV98PVDRhQUXa/DwAbinm0SA=
</data>
<key>hash2</key>
<data>
- nE7QwQcdQpQt4n1d27B67A4367MV7J8kEhrSETTNr3g=
+ SEIGmphMB4mPWfJUCc/8/OEHXuPaOTnpwx7fqG/I01U=
</data>
</dict>
<key>AppIcon83.5x83.5@2x~ipad.png</key>
<dict>
<key>hash</key>
<data>
- F3/BziTbXcn/vpTHvub/+Txde8U=
+ oJtSiDfNgPpCB0QhhFClnkrbXcQ=
</data>
<key>hash2</key>
<data>
- +mzLV5S6RSIPr6LMndIfUYIEt1cTLOqITJ2VIkQ6SdM=
+ p9CZ5DH6P6Cwm2CIRfkZRVd5VcVYXRhHPP0Zdeujh7o=
</data>
</dict>
<key>Assets.car</key>
<dict>
<key>hash</key>
<data>
- r9rUGcVj88K1Zc51XtyyT15hnfk=
+ KKAirXh8K/ModwnSXLShV5/etr0=
</data>
<key>hash2</key>
<data>
- ZgQ1nWHWv23ukJB2SDcb1etq4KuOI3kJmGMZHGsiVvw=
+ nReIXWpgV9Kb7kvFFviDa0ldEsVlJYZnX3sW+zEIOoE=
</data>
</dict>
<key>Frameworks/libswiftAVFoundation.dylib</key>
<dict>
<key>hash</key>
<data>
- ukqktZJa/8A+eCPL/P22HQgAC1k=
+ uDfYCHXGi4LJJ7PehI1sKbZqVf4=
</data>
<key>hash2</key>
<data>
- M4OlrFfFLzLudxsH7utEaY6yys55xfptVE8j4xlWL+M=
+ uBXupAH/nHa8Xn0vQL18OKMoz5nwtyOQyRrDYywnT2Y=
</data>
</dict>
<key>Frameworks/libswiftCore.dylib</key>
<dict>
<key>hash</key>
<data>
- GREBcl8kDXtAsOe5ywfZW3xto9k=
+ hnZxV4PUHdqbt8IOBCPhBpfSwUE=
</data>
<key>hash2</key>
<data>
- NmIKl3IuKEnfk6TQDfg/hxldLif8PPCSgyk/b7+XSI4=
+ p6+Hu5nJHIAgwObOZvX2YVFv9uZmIAdxaXpuKk99HsQ=
</data>
</dict>
<key>Frameworks/libswiftCoreAudio.dylib</key>
<dict>
<key>hash</key>
<data>
- hT5I0SMVXfebWk6J/t2JG8P9cLw=
+ /mmLx8jrVORtoTACElCyWqzqYfA=
</data>
<key>hash2</key>
<data>
- 7GhBnOiJ5bhxhV91S0ekBpUrvRIZ0L5ApDWhlnDQ8uI=
+ p9sdnJpMpkRQ+jg6wuB9bs/n5/l0uNQQlya0Vspe5Y4=
</data>
</dict>
<key>Frameworks/libswiftCoreFoundation.dylib</key>
<dict>
<key>hash</key>
<data>
- LDYTh6fyuPjxuyAKIBufA7E4nDw=
+ v7BE4evcLJt3iFrwd9m33m5rFI8=
</data>
<key>hash2</key>
<data>
- uovqNi2JxzxSDIoNaNMtcS7y/IyXBqf6098wTkXhsb0=
+ A8VfO5EJH/1XaYYpedcjFu0C8tPp6sULSQkH6c9Snk8=
</data>
</dict>
<key>Frameworks/libswiftCoreGraphics.dylib</key>
<dict>
<key>hash</key>
<data>
- ZD7SY7zfzZOkv/ex3o4soLRgyKU=
+ qxYPH4/wxggOGD73Xj6EkCR0xkY=
</data>
<key>hash2</key>
<data>
- tcHnlq2aVlHKRNtP9ohq6XGGo25HoGgsJPHifGTZ1Ac=
+ MATi1ECxIR33VrEed+K9v0VXz+qfWvzXZoZhaCeiA8c=
</data>
</dict>
<key>Frameworks/libswiftCoreImage.dylib</key>
<dict>
<key>hash</key>
<data>
- pDi7kJiFWg8POUcZ02wMhGdzpEU=
+ vlRBCfDqtrrwzkBLtGs2HbO4YbI=
</data>
<key>hash2</key>
<data>
- WDLdEDB3zi2tGexRfz08LjEVT3j8og+6wyTPQHTQHT8=
+ K47oJc8r9dJYRsWzi+BIhDtLTFCZihsGFBh+/mHQuVk=
</data>
</dict>
<key>Frameworks/libswiftCoreMedia.dylib</key>
<dict>
<key>hash</key>
<data>
- rs4o8hPdZsIaykGs8h6jw9/bEac=
+ CyOREkCX0hnTg5JHbY6kdrfAERI=
</data>
<key>hash2</key>
<data>
- AEdy6S/GUVhBVUHOrRHE5g3OrW4pUnI0thDZOQOZxZQ=
+ /fidqVROE0ZTPK+z2Ivl0fr9LvkZtMM+k/HfToN/S1A=
</data>
</dict>
<key>Frameworks/libswiftDarwin.dylib</key>
<dict>
<key>hash</key>
<data>
- nqFz221Io6AgWQK2mjBZH53FOBQ=
+ nd3vDcLn6YQQrhlqobWhMV/sLAE=
</data>
<key>hash2</key>
<data>
- BUgrEq27PObBjaOoTj+G+u+hFuEq7M3vlkY/s8O5a7o=
+ +jx6Y88pLiTayhNHrKV+cvGDubsban8mTTSKAFyxXtc=
</data>
</dict>
<key>Frameworks/libswiftDispatch.dylib</key>
<dict>
<key>hash</key>
<data>
- 5SUy+afr0k0FIaWpa01vu9OoYsk=
+ Xlup3R5V6sXScSmXMkAysKJWVXk=
</data>
<key>hash2</key>
<data>
- wHUgmYozNY3bfu4CpL6djba9He3bckof8G1ofo8nMic=
+ kf3F5hCOQjxwhh0bnjLpfQ0at4IYiQXRnFA0GHgdKTM=
</data>
</dict>
<key>Frameworks/libswiftFoundation.dylib</key>
<dict>
<key>hash</key>
<data>
- 4KLJXVVgDMFE0WIsT9hLmcA7DNo=
+ 6FQCjaFEt9vOMPGkD3Bi4b9USw0=
</data>
<key>hash2</key>
<data>
- f6J5y+1XugEsZTcUTZq8FYg9jrT7NEWnFgapee7nFb4=
+ buTkqHRqLULyfmgfMfODWvRvz4dt1Cg/1Hrv5ndbJjk=
</data>
</dict>
<key>Frameworks/libswiftMetal.dylib</key>
<dict>
<key>hash</key>
<data>
- sLaCL5cSVZgN2tzYV0APfk1uaRM=
+ JJGt6xWjffN+5mM0q0dDOmJ8dDE=
</data>
<key>hash2</key>
<data>
- p14LLUwjoLf9mz5K4GdxzVpoa8o+wZhnbmxF5t5KJv8=
+ Q/eqOi5Bts/4DzykQhKDZEEmvs0P0XeelFxTIwKhuRY=
</data>
</dict>
<key>Frameworks/libswiftObjectiveC.dylib</key>
<dict>
<key>hash</key>
<data>
- aKLtw+VhPxXGVOKvhsUQPeGTNW0=
+ OIdIVW04vwXmE+cHkwyzMTkbvnU=
</data>
<key>hash2</key>
<data>
- nxEgKw/jGB/7OCCJAne8SPV33Gps2WecjqmARUKTxvE=
+ 09Rh2HZy1FxjpKjOdWogDCPxC77vqjKOmnxFWTYTTbg=
</data>
</dict>
<key>Frameworks/libswiftQuartzCore.dylib</key>
<dict>
<key>hash</key>
<data>
- DAih33A0MVtJw87+AJ1vZeye528=
+ cshqKXNDw3S4IFGWYenc+0CqhCk=
</data>
<key>hash2</key>
<data>
- yPy4rgLRB2rXdHq4yEvupkl8k+pqFtHmGvfKRoNRP/8=
+ d6iUBJvHmPEduWaf3mresVZuJx5f0uDmj/Q6yKRf9xE=
</data>
</dict>
<key>Frameworks/libswiftSwiftOnoneSupport.dylib</key>
<dict>
<key>hash</key>
<data>
- yXFysLEA844zanH61b0YqEDGMks=
+ T9TevUnkeG5ZEUxj0Pdl4fF0vUE=
</data>
<key>hash2</key>
<data>
- Jn3taRNXsbgzubW9PHTU2xXZEq91hp8c72H3vME9OwA=
+ ZGaqmTrf9sdGpU6nQ3WEQmC/NopTbMZ9hbX1MW6WXXY=
</data>
</dict>
<key>Frameworks/libswiftUIKit.dylib</key>
<dict>
<key>hash</key>
<data>
- 0IIDJ+kZElM4TpEU9I1GwOCQUvQ=
+ TrQW8qKOdy8IEbHkKhWe3R+o2ZM=
</data>
<key>hash2</key>
<data>
- KywBZaL/xBgq9w4HH7GynFaqSaYzCjIu9ct2h9atUEw=
+ f5qWx1UwiW+tVgxmWY2uRxr0eTEkWMqis3s5hJnUAIM=
</data>
</dict>
<key>Frameworks/libswiftos.dylib</key>
<dict>
<key>hash</key>
<data>
- v5ybt8/g6uVCJbKKlrL6rvz9cMM=
+ TQ11eqpSTjqthNmaPsfIeasSdUk=
</data>
<key>hash2</key>
<data>
- YAzhxDFbrJV7k5BjI+ZmIH1y0PzRtAoD2+/FzBkZU6o=
+ Ql7Bw3we9SVQ5fEOtjrVgHsY5hhGuGNKvi3jPv8/ZLI=
</data>
</dict>
<key>Frameworks/libswiftsimd.dylib</key>
<dict>
<key>hash</key>
<data>
- A8vh5DhJOdsNjcnMpf8HZmtFLt0=
+ 3yFMAEujHZwmMLxWNEPsqtRI7l8=
+ </data>
+ <key>hash2</key>
+ <data>
+ QBy+8Rh3zSljUjUo1mnDhNzyp0XPtzHOidN4SwhRDkI=
+ </data>
+ </dict>
+ <key>JPushConfig.plist</key>
+ <dict>
+ <key>hash</key>
+ <data>
+ qV/PQh+d737riAnpOVOo2BJPYKw=
</data>
<key>hash2</key>
<data>
- f+qELgXajnOIxDkqFZypP1/0Ei8s3RRcdrhbCdli9QU=
+ EZrU0KO5QFZ5fTHAAt0PId1Li/EE+hZexiOezt6CDmw=
</data>
</dict>
<key>LaunchImage-1100-Landscape-2436h@3x.png</key>
<dict>
<key>hash</key>
<data>
- c8qwsmtNPeDXR5piUQXUJZV4NkU=
+ Hbj+jg8kHggfQilLv2funLLiKdE=
</data>
<key>hash2</key>
<data>
- sbviKnlZlk3hGOQDhZ1GgEWVTsKa9Ga1SqqNRShbVGw=
+ AQvB0y4SawJMCUT1q06CQjD/NgLijaua3CvtGzExEUo=
</data>
</dict>
<key>config.xml</key>
<dict>
<key>hash</key>
<data>
- O33IIDUH183cwlV6v9zaOFqmJ1o=
+ IgESgLidVuYaBKc1zJzsW9K32uo=
</data>
<key>hash2</key>
<data>
- ExbxvWR+hO0yJrjtxpQRzs4QKpPR2lD4ssUd6lHa2DU=
+ SbLdTrUoZlolkwamhFCqAvtbQUU/oaBoDoDAZGW4rCI=
</data>
</dict>
<key>embedded.mobileprovision</key>
<dict>
<key>hash</key>
<data>
- WNm5zuPz65rrY9t5qIL1iJgFcQ8=
+ OuWZMIad+tog0ZMleeOfjgsQuoo=
</data>
<key>hash2</key>
<data>
- 8dIWw9eXozB2DtbVPRHN3hu7yhjI74L3184XxOY586k=
+ I2c1ltNORy7u1b/+E+Kpg2ZJa3OfvEte5B1AHhc7eTo=
</data>
</dict>
<key>www/bill.html</key>
<dict>
<key>hash</key>
<data>
- cqHtFm0XLXtu3pFFlRV0wqo3bLo=
+ x+c/i1RxokvMGRSy2owEyEKzgmg=
</data>
<key>hash2</key>
<data>
- eBgSw3AJ1XGN6ICOgI4lpS0w5l9Rt4WghqVHpJoWORY=
+ TN8DM8733V4VhlGaP+O7pprJgjL3F67OTMwD7xV84KI=
</data>
</dict>
<key>www/bindcard.html</key>
<dict>
<key>hash</key>
<data>
- 5yQtgIC/T2E5OFopQG2kN+WdYrI=
+ mjZMhcaV9rGT+gEJycqyUiJiwp8=
</data>
<key>hash2</key>
<data>
- x1upHfUuBcJ6Tke/ngdf2mnxo6x26sRTpS6VlyHRa0U=
+ NAGln7mA1gWlhX8EULmd8KjWEz3VwOZVBK1TutRZiQ4=
</data>
</dict>
<key>www/css/aui-iconfont.ttf</key>
<dict>
<key>hash</key>
<data>
- ICgW8NAQBBEJmmNYuELt2HMjRtk=
+ sxiH889o1dm1Uaqbq7ReLFK47h0=
</data>
<key>hash2</key>
<data>
- PNjIMH7Xh1rt0BEaJDkghE6nzhKQ1LeXA9vvohMWl0E=
+ paloTqVUqu4fEFrGgM/JR2+QJ1THc8JIxLDdeboE8d4=
</data>
</dict>
<key>www/js/bindcard.js</key>
<dict>
<key>hash</key>
<data>
- asyakUNRxlJpE4P7WMiyTJTY97Y=
+ B5X6EPmPRDoyX3Z9Eq1q8rmGSGQ=
</data>
<key>hash2</key>
<data>
- /E23wKzs+L6w6sRklGOiQqSAtMN20zBHMCvJDzaTtA4=
+ VmLo1aaDK/43gHQNmMq4GPwLubbtbB/4RSLKpMauduU=
</data>
</dict>
<key>www/js/lib/aui-actionsheet.js</key>
<dict>
<key>hash</key>
<data>
- GnaACCIZ8j2xg8PJGAWxS4CymgM=
+ ldWa4XoqiR3SZsamE16ZBUrQDT4=
</data>
<key>hash2</key>
<data>
- w2bwoTKwQ/CsM9LtLjMEPahT2ZOL7o02CiG2oiurI/Q=
+ cvJ4ODIeH3tt0OLA57ehOIuVVGcGPrkXTit5x33MLsE=
</data>
</dict>
<key>www/js/main.js</key>
<dict>
<key>hash</key>
<data>
- I2Jj7RTovo4kH11m8CRuakKi3nk=
+ QSdOeA6BefLzgiGbSEou4rGjHqo=
</data>
<key>hash2</key>
<data>
- +3DiCEwGQX3VJAAfi0B9bkRsfSwDHXtcmO6S/jaoZFs=
+ 1nAaMqlGuQgqChazP2EJpnb7aP34936TRvAuddhZZFw=
</data>
</dict>
<key>www/js/mobile.js</key>
<dict>
<key>hash</key>
<data>
- nUamfLQSBc/NAzOMJP5WwXnZGxI=
+ Cx6iRRJAH08QlPBBT//jwM7LZP4=
</data>
<key>hash2</key>
<data>
- bonfkrWCjMv5LWiAp1sfmRvU0wFfN0bYRwBLbFijF/k=
+ y5y66ieXeEONknB6UKddmxUSVsTEKM0JD/kEZBuBQ+I=
</data>
</dict>
<key>www/js/register.js</key>
<dict>
<key>hash</key>
<data>
- aPLw5ln4ElwhbTzbdXZpyILJBiY=
+ kEIN8Lt6KbeSEYmiYk47uhchWg8=
</data>
<key>hash2</key>
<data>
- iyaJXQRZwYysUd//j42epM6Y+Bqkm8S+ZOuGUwhfFn8=
+ SWhxKePIt9pzPkMUPoRj0WTaXD4Z7GYBGqdsoqvRyuo=
</data>
</dict>
<key>www/js/scan.js</key>
<dict>
<key>hash</key>
<data>
- xRDtmYCYmFtZu+H1/SjTBlennsM=
+ Cea6nn8OF3hogSuEpiL+IkVdO0I=
</data>
<key>hash2</key>
<data>
- s2KUAXjrg/ljg8IoSBtI3V2xcRU57DBSC4OGz/NYnBg=
+ boEwP89p0NKOJH9RNkGe9B9GsagQ2Ug8esVLc2s5oP8=
</data>
</dict>
<key>www/js/security.js</key>
<dict>
<key>hash</key>
<data>
- s52wwGEv5fJuX8ngkR5GGqdAXMg=
+ B2Cv1FDNaUjne/EkpPvlr5Cve88=
</data>
<key>hash2</key>
<data>
- sasPlhOHyLhEjRoUQpmieOq/IW8v9yLbzXcckfySGjg=
+ OGZtj/+XWJJTY2txmB7Gvzwn4YOehMFaeYM7ju+IPwI=
</data>
</dict>
<key>www/js/server.js</key>
<dict>
<key>hash</key>
<data>
- 6JlWzinRBn6MsREucfIEiCvn5oA=
+ jp9NlgHW1O72GXbxGb4cmcCVw+w=
</data>
<key>hash2</key>
<data>
- 9BIwn+Du4nx0VxOUv39nWFXNeN9k5+QoZyWWWetbBIA=
+ xkxp3hfX0I2FABTvDz6d8u4ZnwK6XUy2IrW6YX4VK14=
</data>
</dict>
<key>www/js/signxy.js</key>
PwOMlqlVzVgIZXZ1SbMCjBbNhPUtIEmbS1IuHC4X+FE=
</data>
</dict>
+ <key>www/plugins/cordova-plugin-app-version/www/AppVersionPlugin.js</key>
+ <dict>
+ <key>hash</key>
+ <data>
+ V7Ywjbu2Kj4wesp8mWW2lF5aDpE=
+ </data>
+ <key>hash2</key>
+ <data>
+ hULEK/sXXYA5Q+DEGduyGZlT2gUtMhRcybSoo9TWM+0=
+ </data>
+ </dict>
<key>www/plugins/cordova-plugin-camera/www/Camera.js</key>
<dict>
<key>hash</key>
pw9ge6okwHZeP0dHYYlBTFuDJUkZQDPAKRM006KG8ek=
</data>
</dict>
+ <key>www/plugins/cordova-plugin-wkwebview-engine/src/www/ios/ios-wkwebview-exec.js</key>
+ <dict>
+ <key>hash</key>
+ <data>
+ Jf+80xptQsEGhUiGLgqUT/RQinI=
+ </data>
+ <key>hash2</key>
+ <data>
+ 30rJ9tZXBbfE/VcYCAuJHI8E7YpVPHFcxXVT9nbhkUo=
+ </data>
+ </dict>
+ <key>www/plugins/cordova-plugin-wkwebview-engine/src/www/ios/ios-wkwebview.js</key>
+ <dict>
+ <key>hash</key>
+ <data>
+ uSpOoBJtw3huMClDN2UUZQOjz/Y=
+ </data>
+ <key>hash2</key>
+ <data>
+ snCU5zVffeqnWk/2NWikUz5/ywm8VWiiKUujPDpj0Yw=
+ </data>
+ </dict>
+ <key>www/plugins/jpush-phonegap-plugin/www/JPushPlugin.js</key>
+ <dict>
+ <key>hash</key>
+ <data>
+ WbD83XEtIdDDWazehjb7DykZYCE=
+ </data>
+ <key>hash2</key>
+ <data>
+ 8tb7CZsUzCwsaMSrBEosFu+/pgVWFbZptbW/ilTlAPs=
+ </data>
+ </dict>
<key>www/pwdset.html</key>
<dict>
<key>hash</key>
<dict>
<key>hash</key>
<data>
- /T8vAhNAeCOJv1Hw6L4detL0zZE=
+ FK8oc1oB59vB31qmvZp+SzcB9/U=
</data>
<key>hash2</key>
<data>
- owfyBn4pS5DnYeA3edJ/WmjW1ANLhwT8SdO2fRM3yqQ=
+ hKaZe4Brj53BLM4b10F58QehbRHB4aCSmOpVeXW/8sM=
</data>
</dict>
<key>www/register.html</key>
<dict>
<key>hash</key>
<data>
- q/NP40bBQOZfbeq+nId2UNahWqk=
+ j0E17LezraXxL2i9s0tnnWrl9vw=
</data>
<key>hash2</key>
<data>
- WsYPx/6kDCp5gr/e4lMTJvGzW/VDXMwvnHlWa3MjS5w=
+ Iu5z6Xp9qSJxhhkhGheMQI9Ns2tMH0hhOpULa3eMjek=
</data>
</dict>
<key>www/scan.html</key>
<dict>
<key>hash</key>
<data>
- LQqkVW0wcKOsVTN4GeoIHaLFmHA=
+ 3isNUT+DEogiz2Le39n8VyG+mRQ=
</data>
<key>hash2</key>
<data>
- xzEaRg38D+hgjxJoKsj3oFwfrqsYIm4s4H7MDEAsXNY=
+ S9+OZm7tir1iQxoRsBfSKv1+p+2avVkKfHLJtDZJZAs=
</data>
</dict>
<key>www/signxy.html</key>
<?xml version='1.0' encoding='utf-8'?>
-<widget id="com.supwisdom.dlapp" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
+<widget id="com.dalicitycard.app" version="1.0.4" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<feature name="LocalStorage">
<param name="ios-package" value="CDVLocalStorage" />
</feature>
<feature name="ThemeableBrowser">
<param name="ios-package" value="CDVThemeableBrowser" />
</feature>
+ <feature name="JPushPlugin">
+ <param name="ios-package" value="JPushPlugin" />
+ </feature>
+ <feature name="AppVersion">
+ <param name="ios-package" value="AppVersion" />
+ </feature>
+ <feature name="CDVWKWebViewEngine">
+ <param name="ios-package" value="CDVWKWebViewEngine" />
+ </feature>
<name short="大理市民卡">dlapp</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
<edit-config file="*-Info.plist" mode="merge" target="NSCameraUsageDescription">
<string>APP需要使用您的相机权限,没有该权限将无法完成扫一扫功能</string>
</edit-config>
+ <edit-config file="*-Info.plist" mode="merge" target="NSPhotoLibraryUsageDescription">
+ <string>APP需要使用您的相册权限,没有该权限将无法完成扫一扫功能</string>
+ </edit-config>
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
<preference name="AllowInlineMediaPlayback" value="false" />
<preference name="Orientation" value="portrait" />
<preference name="UseSwiftLanguageVersion" value="4.0" />
<preference name="UIWebViewBounce" value="false" />
+ <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
</widget>
<body>
<header class="aui-bar aui-bar-nav" style="padding-top:25px;">
- <a class="aui-pull-left" href="javascript:window.history.go(-1)">
+ <a class="aui-pull-left" href="javascript:app.toBack();">
<span class="aui-iconfont aui-icon-left"></span>
</a>
<div class="aui-title">账单详情</div>
"clobbers": [
"cordova.ThemeableBrowser"
]
+ },
+ {
+ "id": "jpush-phonegap-plugin.JPushPlugin",
+ "file": "plugins/jpush-phonegap-plugin/www/JPushPlugin.js",
+ "pluginId": "jpush-phonegap-plugin",
+ "clobbers": [
+ "JPush"
+ ]
+ },
+ {
+ "id": "cordova-plugin-app-version.AppVersionPlugin",
+ "file": "plugins/cordova-plugin-app-version/www/AppVersionPlugin.js",
+ "pluginId": "cordova-plugin-app-version",
+ "clobbers": [
+ "cordova.getAppVersion"
+ ]
+ },
+ {
+ "id": "cordova-plugin-wkwebview-engine.ios-wkwebview-exec",
+ "file": "plugins/cordova-plugin-wkwebview-engine/src/www/ios/ios-wkwebview-exec.js",
+ "pluginId": "cordova-plugin-wkwebview-engine",
+ "clobbers": [
+ "cordova.exec"
+ ]
+ },
+ {
+ "id": "cordova-plugin-wkwebview-engine.ios-wkwebview",
+ "file": "plugins/cordova-plugin-wkwebview-engine/src/www/ios/ios-wkwebview.js",
+ "pluginId": "cordova-plugin-wkwebview-engine",
+ "clobbers": [
+ "window.WkWebView"
+ ]
}
];
module.exports.metadata = {
"cordova-plugin-camera": "4.0.3",
"cordova-plugin-inappbrowser": "3.0.0",
"cordova-plugin-device": "2.0.2",
- "cordova-plugin-themeablebrowser": "0.2.17"
+ "cordova-plugin-themeablebrowser": "0.2.17",
+ "cordova-plugin-jcore": "1.3.0",
+ "jpush-phonegap-plugin": "3.7.2",
+ "cordova-plugin-app-version": "0.1.9",
+ "cordova-plugin-wkwebview-engine": "1.2.1"
};
});
\ No newline at end of file
this.loadBill()
},
toBack: function (){
- window.history.back();
+ //window.history.back();
+ window.history.go(-1)
},
loadBill: function() {
var refno = window.localStorage.getItem("currentrefno");
console.log(ret)
if (ok) {
if(ret.code==200){
- var exp = window.localStorage.getItem("tokenexpire");
- var t = parseInt(exp);
- //token 小于10分钟了,需要刷新
- console.log((ret.now-t))
- if(ret.now-t>1000*60*10){
- window.location = "login.html";
- }else{
- window.location = "main.html";
+ if(!isEmpty(ret.token)){
+ window.localStorage.setItem("token",ret.token);
}
+ window.location = "main.html";
}else{
window.location = "login.html";
}
$.showLoading("登录中");
var param={
"username":phone,
- "password":pwd
+ "password":pwd,
+ "platform":device.platform
}
Login(param,function(ok,ret){
console.log(ret)
window.localStorage.setItem("phone",phone);
window.localStorage.setItem("phoneX",ret.phone);
window.localStorage.setItem("token",ret.token);
+ window.localStorage.setItem("uid",ret.uid);
window.localStorage.setItem("tenantid",ret.tenantid);
window.localStorage.setItem("tokenexpire",ret.expire);
window.localStorage.setItem("tokentime",ret.now);
initialize: function() {
this.initTab();
document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);
+ document.addEventListener('jpush.receiveRegistrationId', function(event) {
+ console.log(event.registrationId)
+ }, false)
+ document.addEventListener("jpush.openNotification", function (event) {
+ var refno
+ console.log("openNotify:"+event);
+ if(device.platform == "Android") {
+ refno = event.extras.refno
+ } else {
+ refno = event.refno
+ window.JPush.setApplicationIconBadgeNumber(0);
+ }
+ app.openBill(refno);
+ console.log("openNotify:"+refno);
+ }, false)
+ },
+ openBill:function(billno){
+ window.localStorage.setItem("currentrefno",billno);
+ window.location='billdetail.html';
+ },
+ initJpush: function() {
+ if(device.platform == "Android") {
+ } else {
+ window.JPush.setApplicationIconBadgeNumber(0);
+ }
+ window.JPush.init();
+ window.JPush.setDebugMode(true);
+ window.JPush.isPushStopped(function(result) {
+ if (result == 0) {
+ //window.JPush.resumePush();
+ } else {
+ window.JPush.resumePush();
+ }
+ });
+ window.JPush.getUserNotificationSettings(function(result) {
+ if(result == 0) {
+ } else if(result > 0) {
+ }
+ });
+ var uid = window.localStorage.getItem("uid");
+ window.JPush.setAlias({ sequence: 1, alias: uid },
+ (result) => {
+ var sequence = result.sequence
+ var alias = result.alias
+ //alert(JSON.stringify(result))
+ }, (error) => {
+ var sequence = error.sequence
+ var errorCode = error.code
+ //alert(JSON.stringify(error))
+ })
},
onDeviceReady: function() {
var uid = window.localStorage.getItem("token");
- console.log(CURRENT_INDEX);
+ this.initJpush();
$('#scanBtn').click(function() {
//window.location = "scan.html";
app.checkBefore(function() {
})
});
$('#secBtn').click(function() {
- app.checkBefore(function() {
+ window.location = "security.html";
+ /*app.checkBefore(function() {
app.checkOther(function() {
window.location = "security.html";
})
- })
+ })*/
});
$('#usersec').click(function() {
app.checkBefore(function() {
});
this.initData();
},
- initTab:function(){
+ initTab: function() {
$("#maincontent").css("top", $("#maintop").height())
var tab = new auiTab({
element: document.getElementById("footer"),
}, function(ret) {
- window.localStorage.setItem("tabindex",ret.index);
-
+ window.localStorage.setItem("tabindex", ret.index);
+
changeTab(ret.index);
});
- var tabindex = window.localStorage.getItem("tabindex");
- if(!tabindex||tabindex==0){
+ var tabindex = window.localStorage.getItem("tabindex");
+ if (!tabindex || tabindex == 0) {
tabindex = 1
}
changeTab(tabindex);
tab.setActive(tabindex)
- function changeTab(index){
+
+ function changeTab(index) {
if (index == 1) {
$("#main1").show();
$("#main2").hide();
}
V1Bills(param, function(ok, ret) {
if (ok) {
- console.log(ret)
+ //console.log(ret)
if (ret.code == 200) {
+ app.checkVersion(ret.version,ret.minversion,ret.versionmsg);
$("#maingt").text(ret.t + "!")
$("#user-amount").text(ret.amount)
$("#user-point").text(ret.point)
}
})
},
-
+ checkVersion:function(ver,minver,msg){
+ cordova.getAppVersion.getVersionNumber(function (version) {
+ //alert(version);
+ if(version<minver){
+ //TODO 强制升级
+ alert("当前版本过低,为了不影响您的使用,请先升级");
+ }else if(ver>version){
+ alert("有新的版本");
+ }
+ });
+ },
initBillView: function(page) {
var html = '';
for (var i = 0; i < page.data.length; i++) {
}
}
};
-app.initialize();
\ No newline at end of file
+app.initialize();
onDeviceReady: function() {
var uid = window.localStorage.getItem("token");
- var qrcode = new QRCode(document.getElementById("qrcode"), {
- text: uid,
- width: 150,
- height: 150,
- colorDark : "#000000",
- colorLight : "#ffffff",
- correctLevel : QRCode.CorrectLevel.L
- });
+ this.loadQrcode();
+ setInterval(function () {
+ window.location.reload();
+ },100000);
},
- toBillDetail :function(refno){
-
+ loadQrcode: function() {
+ $.showLoading("加载中");
+ V1Qrcode(function(ok, ret) {
+ if (ok) {
+ console.log(ret)
+ if (ret.code == 200) {
+ $.hideLoading();
+ var qrcode = new QRCode(document.getElementById("qrcode"), {
+ text: ret.qrcode,
+ width: 150,
+ height: 150,
+ colorDark: "#000000",
+ colorLight: "#ffffff",
+ correctLevel: QRCode.CorrectLevel.L
+ });
+ } else {
+ $.hideLoading();
+ $.alert("请求失败,请稍后再试", "错误");
+ }
+ } else {
+ $.hideLoading();
+ $.alert("请求失败了:" + ret.status + "请稍后再试", "错误");
+ }
+ })
+ },
+ refresh:function(){
+ V1Qrcode(function(ok, ret) {
+ if (ok) {
+ if (ret.code == 200) {
+ $.hideLoading();
+ var qrcode = new QRCode(document.getElementById("qrcode"), {
+ text: ret.qrcode,
+ width: 150,
+ height: 150,
+ colorDark: "#000000",
+ colorLight: "#ffffff",
+ correctLevel: QRCode.CorrectLevel.L
+ });
+ } else {
+ $.hideLoading();
+ $.alert("请求失败,请稍后再试", "错误");
+ }
+ } else {
+ $.hideLoading();
+ $.alert("请求失败了:" + ret.status + "请稍后再试", "错误");
+ }
+ })
}
};
app.initialize();
\ No newline at end of file
$.hideLoading();
console.log(ret)
if(ret.code==200){
-
window.localStorage.setItem("phone",phone);
window.localStorage.setItem("uid",ret.uid);
window.localStorage.setItem("code",ret.randcode);
}
var userid = window.localStorage.getItem("userid");
if(url.indexOf("?")>0){
- url=url+'&uid='+userid;
+ url=url+'&userid='+userid;
}else{
- url=url+'?uid='+userid;
+ url=url+'?userid='+userid;
}
inAppBrowserRef = cordova.ThemeableBrowser.open(url, '_blank', {
statusbar: {
initialize: function() {
document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);
},
-
onDeviceReady: function() {
- var uid = window.localStorage.getItem("uid");
- var phone = window.localStorage.getItem("phoneX");
-
},
editPwd: function() {
window.location = "editpwd.html";
logout:function(){
window.localStorage.removeItem("token");
window.location = "login.html";
+ },
+ loginByTouchId: function() {
+ Fingerprint.isAvailable(function(result){
+ alert("Fingerprint available");
+ }, function(message){
+ alert(message);
+ });
}
};
app.initialize();
-var dev = true;
-var SERVER = "";
+var dev = false;
+var SERVER = "https://yy.dlsmk.cn/payapi/mobileapi";
var GLOBAL_TODAY="";
var GLOBAL_YESTERDAY="";
var CURRENT_INDEX=1;
if (dev) {
- SERVER = "http://172.28.43.3:8099/payapi/mobileapi";
+ SERVER = "http://172.28.201.70:10010/payapi/mobileapi";
+}
+
+function V1Qrcode(callback) {
+ ajaxPost("/v1/qrcode", {}, callback)
}
function V1Idtypes(callback) {
ajaxPost("/v1/idtypes", {}, callback)
--- /dev/null
+cordova.define("cordova-plugin-app-version.AppVersionPlugin", function(require, exports, module) {
+/*jslint indent: 2 */
+/*global window, jQuery, angular, cordova */
+"use strict";
+
+// Returns a jQuery or AngularJS deferred object, or pass a success and fail callbacks if you don't want to use jQuery or AngularJS
+var getPromisedCordovaExec = function (command, success, fail) {
+ var toReturn, deferred, injector, $q;
+ if (success === undefined) {
+ if (window.jQuery) {
+ deferred = jQuery.Deferred();
+ success = deferred.resolve;
+ fail = deferred.reject;
+ toReturn = deferred;
+ } else if (window.angular) {
+ injector = angular.injector(["ng"]);
+ $q = injector.get("$q");
+ deferred = $q.defer();
+ success = deferred.resolve;
+ fail = deferred.reject;
+ toReturn = deferred.promise;
+ } else if (window.when && window.when.promise) {
+ deferred = when.defer();
+ success = deferred.resolve;
+ fail = deferred.reject;
+ toReturn = deferred.promise;
+ } else if (window.Promise) {
+ toReturn = new Promise(function(c, e) {
+ success = c;
+ fail = e;
+ });
+ } else if (window.WinJS && window.WinJS.Promise) {
+ toReturn = new WinJS.Promise(function(c, e) {
+ success = c;
+ fail = e;
+ });
+ } else {
+ return console.error('AppVersion either needs a success callback, or jQuery/AngularJS/Promise/WinJS.Promise defined for using promises');
+ }
+ }
+ // 5th param is NOT optional. must be at least empty array
+ cordova.exec(success, fail, "AppVersion", command, []);
+ return toReturn;
+};
+
+var getAppVersion = function (success, fail) {
+ return getPromisedCordovaExec('getVersionNumber', success, fail);
+};
+
+getAppVersion.getAppName = function (success, fail) {
+ return getPromisedCordovaExec('getAppName', success, fail);
+};
+
+getAppVersion.getPackageName = function (success, fail) {
+ return getPromisedCordovaExec('getPackageName', success, fail);
+};
+
+getAppVersion.getVersionNumber = function (success, fail) {
+ return getPromisedCordovaExec('getVersionNumber', success, fail);
+};
+
+getAppVersion.getVersionCode = function (success, fail) {
+ return getPromisedCordovaExec('getVersionCode', success, fail);
+};
+
+module.exports = getAppVersion;
+
+});
--- /dev/null
+cordova.define("cordova-plugin-wkwebview-engine.ios-wkwebview-exec", function(require, exports, module) {
+/*
+ *
+ * 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.
+ *
+*/
+
+/**
+ * Creates the exec bridge used to notify the native code of
+ * commands.
+ */
+var cordova = require('cordova');
+var utils = require('cordova/utils');
+var base64 = require('cordova/base64');
+
+function massageArgsJsToNative (args) {
+ if (!args || utils.typeName(args) !== 'Array') {
+ return args;
+ }
+ var ret = [];
+ args.forEach(function (arg, i) {
+ if (utils.typeName(arg) === 'ArrayBuffer') {
+ ret.push({
+ 'CDVType': 'ArrayBuffer',
+ 'data': base64.fromArrayBuffer(arg)
+ });
+ } else {
+ ret.push(arg);
+ }
+ });
+ return ret;
+}
+
+function massageMessageNativeToJs (message) {
+ if (message.CDVType === 'ArrayBuffer') {
+ var stringToArrayBuffer = function (str) {
+ var ret = new Uint8Array(str.length);
+ for (var i = 0; i < str.length; i++) {
+ ret[i] = str.charCodeAt(i);
+ }
+ return ret.buffer;
+ };
+ var base64ToArrayBuffer = function (b64) {
+ return stringToArrayBuffer(atob(b64)); // eslint-disable-line no-undef
+ };
+ message = base64ToArrayBuffer(message.data);
+ }
+ return message;
+}
+
+function convertMessageToArgsNativeToJs (message) {
+ var args = [];
+ if (!message || !message.hasOwnProperty('CDVType')) {
+ args.push(message);
+ } else if (message.CDVType === 'MultiPart') {
+ message.messages.forEach(function (e) {
+ args.push(massageMessageNativeToJs(e));
+ });
+ } else {
+ args.push(massageMessageNativeToJs(message));
+ }
+ return args;
+}
+
+var iOSExec = function () {
+ // detect change in bridge, if there is a change, we forward to new bridge
+
+ // if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.cordova && window.webkit.messageHandlers.cordova.postMessage) {
+ // bridgeMode = jsToNativeModes.WK_WEBVIEW_BINDING;
+ // }
+
+ var successCallback, failCallback, service, action, actionArgs;
+ var callbackId = null;
+ if (typeof arguments[0] !== 'string') {
+ // FORMAT ONE
+ successCallback = arguments[0];
+ failCallback = arguments[1];
+ service = arguments[2];
+ action = arguments[3];
+ actionArgs = arguments[4];
+
+ // Since we need to maintain backwards compatibility, we have to pass
+ // an invalid callbackId even if no callback was provided since plugins
+ // will be expecting it. The Cordova.exec() implementation allocates
+ // an invalid callbackId and passes it even if no callbacks were given.
+ callbackId = 'INVALID';
+ } else {
+ throw new Error('The old format of this exec call has been removed (deprecated since 2.1). Change to: ' + // eslint-disable-line
+ 'cordova.exec(null, null, \'Service\', \'action\', [ arg1, arg2 ]);');
+ }
+
+ // If actionArgs is not provided, default to an empty array
+ actionArgs = actionArgs || [];
+
+ // Register the callbacks and add the callbackId to the positional
+ // arguments if given.
+ if (successCallback || failCallback) {
+ callbackId = service + cordova.callbackId++;
+ cordova.callbacks[callbackId] =
+ {success: successCallback, fail: failCallback};
+ }
+
+ actionArgs = massageArgsJsToNative(actionArgs);
+
+ // CB-10133 DataClone DOM Exception 25 guard (fast function remover)
+ var command = [callbackId, service, action, JSON.parse(JSON.stringify(actionArgs))];
+ window.webkit.messageHandlers.cordova.postMessage(command);
+};
+
+iOSExec.nativeCallback = function (callbackId, status, message, keepCallback, debug) {
+ var success = status === 0 || status === 1;
+ var args = convertMessageToArgsNativeToJs(message);
+ Promise.resolve().then(function () {
+ cordova.callbackFromNative(callbackId, success, status, args, keepCallback); // eslint-disable-line
+ });
+};
+
+// for backwards compatibility
+iOSExec.nativeEvalAndFetch = function (func) {
+ try {
+ func();
+ } catch (e) {
+ console.log(e);
+ }
+};
+
+// Proxy the exec for bridge changes. See CB-10106
+
+function cordovaExec () {
+ var cexec = require('cordova/exec');
+ var cexec_valid = (typeof cexec.nativeFetchMessages === 'function') && (typeof cexec.nativeEvalAndFetch === 'function') && (typeof cexec.nativeCallback === 'function');
+ return (cexec_valid && execProxy !== cexec) ? cexec : iOSExec;
+}
+
+function execProxy () {
+ cordovaExec().apply(null, arguments);
+}
+
+execProxy.nativeFetchMessages = function () {
+ return cordovaExec().nativeFetchMessages.apply(null, arguments);
+};
+
+execProxy.nativeEvalAndFetch = function () {
+ return cordovaExec().nativeEvalAndFetch.apply(null, arguments);
+};
+
+execProxy.nativeCallback = function () {
+ return cordovaExec().nativeCallback.apply(null, arguments);
+};
+
+module.exports = execProxy;
+
+if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.cordova && window.webkit.messageHandlers.cordova.postMessage) {
+ // unregister the old bridge
+ cordova.define.remove('cordova/exec');
+ // redefine bridge to our new bridge
+ cordova.define('cordova/exec', function (require, exports, module) {
+ module.exports = execProxy;
+ });
+}
+
+});
--- /dev/null
+cordova.define("cordova-plugin-wkwebview-engine.ios-wkwebview", function(require, exports, module) {
+/*
+ *
+ * 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.
+ *
+*/
+
+var exec = require('cordova/exec');
+
+var WkWebKit = {
+ allowsBackForwardNavigationGestures: function (allow) {
+ exec(null, null, 'CDVWKWebViewEngine', 'allowsBackForwardNavigationGestures', [allow]);
+ }
+};
+
+module.exports = WkWebKit;
+
+});
--- /dev/null
+cordova.define("jpush-phonegap-plugin.JPushPlugin", function(require, exports, module) {
+var JPushPlugin = function() {};
+
+// private plugin function
+
+JPushPlugin.prototype.receiveMessage = {};
+JPushPlugin.prototype.openNotification = {};
+JPushPlugin.prototype.receiveNotification = {};
+
+JPushPlugin.prototype.isPlatformIOS = function() {
+ return (
+ device.platform === "iPhone" ||
+ device.platform === "iPad" ||
+ device.platform === "iPod touch" ||
+ device.platform === "iOS"
+ );
+};
+
+JPushPlugin.prototype.errorCallback = function(msg) {
+ console.log("JPush Callback Error: " + msg);
+};
+
+JPushPlugin.prototype.callNative = function(
+ name,
+ args,
+ successCallback,
+ errorCallback
+) {
+ if (errorCallback) {
+ cordova.exec(successCallback, errorCallback, "JPushPlugin", name, args);
+ } else {
+ cordova.exec(
+ successCallback,
+ this.errorCallback,
+ "JPushPlugin",
+ name,
+ args
+ );
+ }
+};
+
+// Common methods
+JPushPlugin.prototype.init = function() {
+ if (this.isPlatformIOS()) {
+ this.callNative("initial", [], null);
+ } else {
+ this.callNative("init", [], null);
+ }
+};
+
+JPushPlugin.prototype.setDebugMode = function(mode) {
+ if (device.platform === "Android") {
+ this.callNative("setDebugMode", [mode], null);
+ } else {
+ if (mode === true) {
+ this.setDebugModeFromIos();
+ } else {
+ this.setLogOFF();
+ }
+ }
+};
+
+JPushPlugin.prototype.getRegistrationID = function(successCallback) {
+ this.callNative("getRegistrationID", [], successCallback);
+};
+
+JPushPlugin.prototype.stopPush = function() {
+ this.callNative("stopPush", [], null);
+};
+
+JPushPlugin.prototype.resumePush = function() {
+ this.callNative("resumePush", [], null);
+};
+
+JPushPlugin.prototype.isPushStopped = function(successCallback) {
+ this.callNative("isPushStopped", [], successCallback);
+};
+
+JPushPlugin.prototype.clearLocalNotifications = function() {
+ if (device.platform === "Android") {
+ this.callNative("clearLocalNotifications", [], null);
+ } else {
+ this.clearAllLocalNotifications();
+ }
+};
+
+/**
+ * 设置标签。
+ * 注意:该接口是覆盖逻辑,而不是增量逻辑。即新的调用会覆盖之前的设置。
+ *
+ * @param params = { 'sequence': number, 'tags': ['tag1', 'tag2'] }
+ */
+JPushPlugin.prototype.setTags = function(
+ params,
+ successCallback,
+ errorCallback
+) {
+ this.callNative("setTags", [params], successCallback, errorCallback);
+};
+
+/**
+ * 新增标签。
+ *
+ * @param params = { 'sequence': number, 'tags': ['tag1', 'tag2'] }
+ */
+JPushPlugin.prototype.addTags = function(
+ params,
+ successCallback,
+ errorCallback
+) {
+ this.callNative("addTags", [params], successCallback, errorCallback);
+};
+
+/**
+ * 删除指定标签。
+ *
+ * @param params = { 'sequence': number, 'tags': ['tag1', 'tag2'] }
+ */
+JPushPlugin.prototype.deleteTags = function(
+ params,
+ successCallback,
+ errorCallback
+) {
+ this.callNative("deleteTags", [params], successCallback, errorCallback);
+};
+
+/**
+ * 清除所有标签。
+ *
+ * @param params = { 'sequence': number }
+ */
+JPushPlugin.prototype.cleanTags = function(
+ params,
+ successCallback,
+ errorCallback
+) {
+ this.callNative("cleanTags", [params], successCallback, errorCallback);
+};
+
+/**
+ * 查询所有标签。
+ *
+ * @param params = { 'sequence': number }
+ */
+JPushPlugin.prototype.getAllTags = function(
+ params,
+ successCallback,
+ errorCallback
+) {
+ this.callNative("getAllTags", [params], successCallback, errorCallback);
+};
+
+/**
+ * 查询指定标签与当前用户的绑定状态。
+ *
+ * @param params = { 'sequence': number, 'tag': string }
+ */
+JPushPlugin.prototype.checkTagBindState = function(
+ params,
+ successCallback,
+ errorCallback
+) {
+ this.callNative(
+ "checkTagBindState",
+ [params],
+ successCallback,
+ errorCallback
+ );
+};
+
+/**
+ * 设置别名。
+ * 注意:该接口是覆盖逻辑,而不是增量逻辑。即新的调用会覆盖之前的设置。
+ *
+ * @param params = { 'sequence': number, 'alias': string }
+ */
+JPushPlugin.prototype.setAlias = function(
+ params,
+ successCallback,
+ errorCallback
+) {
+ this.callNative("setAlias", [params], successCallback, errorCallback);
+};
+
+/**
+ * 删除别名。
+ *
+ * @param params = { 'sequence': number }
+ */
+JPushPlugin.prototype.deleteAlias = function(
+ params,
+ successCallback,
+ errorCallback
+) {
+ this.callNative("deleteAlias", [params], successCallback, errorCallback);
+};
+
+/**
+ * 查询当前绑定的别名。
+ *
+ * @param params = { 'sequence': number }
+ */
+JPushPlugin.prototype.getAlias = function(
+ params,
+ successCallback,
+ errorCallback
+) {
+ this.callNative("getAlias", [params], successCallback, errorCallback);
+};
+
+// 判断系统设置中是否对本应用启用通知。
+// iOS: 返回值如果大于 0,代表通知开启;0: 通知关闭。
+// UIRemoteNotificationTypeNone = 0,
+// UIRemoteNotificationTypeBadge = 1 << 0,
+// UIRemoteNotificationTypeSound = 1 << 1,
+// UIRemoteNotificationTypeAlert = 1 << 2,
+// UIRemoteNotificationTypeNewsstandContentAvailability = 1 << 3,
+// Android: 返回值 1 代表通知启用;0: 通知关闭。
+JPushPlugin.prototype.getUserNotificationSettings = function(successCallback) {
+ if (this.isPlatformIOS()) {
+ this.callNative("getUserNotificationSettings", [], successCallback);
+ } else if (device.platform === "Android") {
+ this.callNative("areNotificationEnabled", [], successCallback);
+ }
+};
+
+// iOS methods
+
+JPushPlugin.prototype.startJPushSDK = function() {
+ this.callNative("startJPushSDK", [], null);
+};
+
+JPushPlugin.prototype.setBadge = function(value) {
+ if (this.isPlatformIOS()) {
+ this.callNative("setBadge", [value], null);
+ }
+};
+
+JPushPlugin.prototype.resetBadge = function() {
+ if (this.isPlatformIOS()) {
+ this.callNative("resetBadge", [], null);
+ }
+};
+
+JPushPlugin.prototype.setDebugModeFromIos = function() {
+ if (this.isPlatformIOS()) {
+ this.callNative("setDebugModeFromIos", [], null);
+ }
+};
+
+JPushPlugin.prototype.setLogOFF = function() {
+ if (this.isPlatformIOS()) {
+ this.callNative("setLogOFF", [], null);
+ }
+};
+
+JPushPlugin.prototype.setCrashLogON = function() {
+ if (this.isPlatformIOS()) {
+ this.callNative("crashLogON", [], null);
+ }
+};
+
+JPushPlugin.prototype.addLocalNotificationForIOS = function(
+ delayTime,
+ content,
+ badge,
+ notificationID,
+ extras
+) {
+ if (this.isPlatformIOS()) {
+ this.callNative(
+ "setLocalNotification",
+ [delayTime, content, badge, notificationID, extras],
+ null
+ );
+ }
+};
+
+JPushPlugin.prototype.deleteLocalNotificationWithIdentifierKeyInIOS = function(
+ identifierKey
+) {
+ if (this.isPlatformIOS()) {
+ this.callNative(
+ "deleteLocalNotificationWithIdentifierKey",
+ [identifierKey],
+ null
+ );
+ }
+};
+
+JPushPlugin.prototype.clearAllLocalNotifications = function() {
+ if (this.isPlatformIOS()) {
+ this.callNative("clearAllLocalNotifications", [], null);
+ }
+};
+
+JPushPlugin.prototype.setLocation = function(latitude, longitude) {
+ if (this.isPlatformIOS()) {
+ this.callNative("setLocation", [latitude, longitude], null);
+ }
+};
+
+JPushPlugin.prototype.startLogPageView = function(pageName) {
+ if (this.isPlatformIOS()) {
+ this.callNative("startLogPageView", [pageName], null);
+ }
+};
+
+JPushPlugin.prototype.stopLogPageView = function(pageName) {
+ if (this.isPlatformIOS()) {
+ this.callNative("stopLogPageView", [pageName], null);
+ }
+};
+
+JPushPlugin.prototype.beginLogPageView = function(pageName, duration) {
+ if (this.isPlatformIOS()) {
+ this.callNative("beginLogPageView", [pageName, duration], null);
+ }
+};
+
+JPushPlugin.prototype.setApplicationIconBadgeNumber = function(badge) {
+ if (this.isPlatformIOS()) {
+ this.callNative("setApplicationIconBadgeNumber", [badge], null);
+ }
+};
+
+JPushPlugin.prototype.getApplicationIconBadgeNumber = function(callback) {
+ if (this.isPlatformIOS()) {
+ this.callNative("getApplicationIconBadgeNumber", [], callback);
+ }
+};
+
+JPushPlugin.prototype.addDismissActions = function(actions, categoryId) {
+ this.callNative("addDismissActions", [actions, categoryId]);
+};
+
+JPushPlugin.prototype.addNotificationActions = function(actions, categoryId) {
+ this.callNative("addNotificationActions", [actions, categoryId]);
+};
+
+// Android methods
+JPushPlugin.prototype.getConnectionState = function(successCallback) {
+ if (device.platform === "Android") {
+ this.callNative("getConnectionState", [], successCallback);
+ }
+};
+
+JPushPlugin.prototype.setBasicPushNotificationBuilder = function() {
+ if (device.platform === "Android") {
+ this.callNative("setBasicPushNotificationBuilder", [], null);
+ }
+};
+
+JPushPlugin.prototype.setCustomPushNotificationBuilder = function() {
+ if (device.platform === "Android") {
+ this.callNative("setCustomPushNotificationBuilder", [], null);
+ }
+};
+
+JPushPlugin.prototype.receiveRegistrationIdInAndroidCallback = function(data) {
+ if (device.platform === "Android") {
+ data = JSON.stringify(data);
+ var event = JSON.parse(data);
+ cordova.fireDocumentEvent("jpush.receiveRegistrationId", event);
+ }
+};
+
+JPushPlugin.prototype.receiveMessageInAndroidCallback = function(data) {
+ data = JSON.stringify(data);
+ this.receiveMessage = JSON.parse(data);
+ cordova.fireDocumentEvent("jpush.receiveMessage", this.receiveMessage);
+};
+
+JPushPlugin.prototype.openNotificationInAndroidCallback = function(data) {
+ data = JSON.stringify(data);
+ this.openNotification = JSON.parse(data);
+ cordova.fireDocumentEvent("jpush.openNotification", this.openNotification);
+};
+
+JPushPlugin.prototype.receiveNotificationInAndroidCallback = function(data) {
+ data = JSON.stringify(data);
+ this.receiveNotification = JSON.parse(data);
+ cordova.fireDocumentEvent(
+ "jpush.receiveNotification",
+ this.receiveNotification
+ );
+};
+
+JPushPlugin.prototype.clearAllNotification = function() {
+ if (device.platform === "Android") {
+ this.callNative("clearAllNotification", [], null);
+ }
+};
+
+JPushPlugin.prototype.clearNotificationById = function(id) {
+ if (device.platform === "Android") {
+ this.callNative("clearNotificationById", [id], null);
+ }
+};
+
+JPushPlugin.prototype.setLatestNotificationNum = function(num) {
+ if (device.platform === "Android") {
+ this.callNative("setLatestNotificationNum", [num], null);
+ }
+};
+
+JPushPlugin.prototype.addLocalNotification = function(
+ builderId,
+ content,
+ title,
+ notificationID,
+ broadcastTime,
+ extras
+) {
+ if (device.platform === "Android") {
+ this.callNative(
+ "addLocalNotification",
+ [builderId, content, title, notificationID, broadcastTime, extras],
+ null
+ );
+ }
+};
+
+JPushPlugin.prototype.removeLocalNotification = function(notificationID) {
+ if (device.platform === "Android") {
+ this.callNative("removeLocalNotification", [notificationID], null);
+ }
+};
+
+JPushPlugin.prototype.reportNotificationOpened = function(msgID) {
+ if (device.platform === "Android") {
+ this.callNative("reportNotificationOpened", [msgID], null);
+ }
+};
+
+/**
+ * 用于在 Android 6.0 及以上系统,申请一些权限
+ * 具体可看:http://docs.jpush.io/client/android_api/#android-60
+ */
+JPushPlugin.prototype.requestPermission = function() {
+ if (device.platform === "Android") {
+ this.callNative("requestPermission", [], null);
+ }
+};
+
+JPushPlugin.prototype.setSilenceTime = function(
+ startHour,
+ startMinute,
+ endHour,
+ endMinute
+) {
+ if (device.platform === "Android") {
+ this.callNative(
+ "setSilenceTime",
+ [startHour, startMinute, endHour, endMinute],
+ null
+ );
+ }
+};
+
+JPushPlugin.prototype.setPushTime = function(weekdays, startHour, endHour) {
+ if (device.platform === "Android") {
+ this.callNative("setPushTime", [weekdays, startHour, endHour], null);
+ }
+};
+
+JPushPlugin.prototype.setGeofenceInterval = function(interval) {
+ if (device.platform === "Android") {
+ this.callNative("setGeofenceInterval", [interval], null);
+ }
+};
+
+JPushPlugin.prototype.setMaxGeofenceNumber = function(maxNumber) {
+ if (device.platform === "Android") {
+ this.callNative("setMaxGeofenceNumber", [maxNumber], null);
+ }
+};
+
+if (!window.plugins) {
+ window.plugins = {};
+}
+
+if (!window.plugins.jPushPlugin) {
+ window.plugins.jPushPlugin = new JPushPlugin();
+}
+
+module.exports = new JPushPlugin();
+
+});
<div style="display: flex;flex-direction: row;justify-content: center;align-items: center;margin-top: 50px;">
<div style="background: #fff;text-align: center;" id="qrcode"></div>
</div>
- <p style="text-align: center;margin-top:20px;color:#999">请将二维码对准扫描设备</p>
- <div style="padding: 30px;">
- <div class="aui-btn aui-btn-block aui-btn-info" tapmode onclick="app.refresh()">手动刷新二维码</div>
- </div>
+ <p style="text-align: center;margin-top:40px;color:#999">请将二维码对准扫描设备</p>
+ <!--<div style="padding: 30px;">
+ <div class="aui-btn aui-btn-block aui-btn-info" tapmode onclick="window.location.reload();">刷新二维码</div>
+ </div>-->
</body>
</html>
<script type="text/javascript" src="cordova.js"></script>
</head>
<body>
<header class="aui-bar aui-bar-nav" style="padding-top:25px;">
- <a class="aui-pull-left" href="javascript:window.history.back()">
+ <a class="aui-pull-left" href="login.html">
<span class="aui-iconfont aui-icon-left"></span>
</a>
<div class="aui-title">注册</div>
<div class="aui-list-item-right"></div>
</div>
</li>
+ <!--<li class="aui-list-item" onclick="app.loginByTouchId()">
+ <div class="aui-list-item-label-icon">
+ <i class="aui-iconfont aui-icon-lock aui-text-info"></i>
+ </div>
+ <div class="aui-list-item-inner ">
+ <div class="aui-list-item-title">指纹\人脸登录</div>
+ <div class="aui-list-item-right"><input type="checkbox" id="login" class="aui-switch" ></div>
+ </div>
+ </li>-->
<li class="aui-list-item" onclick="app.toPayPwd()">
<div class="aui-list-item-label-icon">
<i class="aui-iconfont aui-icon-pencil aui-text-danger"></i>
</div>
</li>
</ul>
- <div style="padding: 20px;margin-top: 40px;">
+ <div style="padding: 20px;margin-top: 40px;">
<a href="javascript:app.logout();" class="weui-btn weui-btn_warn">退出登录</a>
</div>
</section>
objects = {
/* Begin PBXBuildFile section */
0207DA581B56EA530066E2B4 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0207DA571B56EA530066E2B4 /* Images.xcassets */; };
+ 04347BD0ABAC4EE0B4CDDDB6 /* jcore-ios-2.1.1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 444DBF371D8346D7BC7EE35D /* jcore-ios-2.1.1.a */; };
0FBFC45D12B44FF79785B959 /* UIImage+CropScaleOrientation.m in Sources */ = {isa = PBXBuildFile; fileRef = 281DF600F6B747808087E4FC /* UIImage+CropScaleOrientation.m */; };
1D3623260D0F684500981E51 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* AppDelegate.m */; };
1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
302D95F114D2391D003F00A1 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 302D95EF14D2391D003F00A1 /* MainViewController.m */; };
302D95F214D2391D003F00A1 /* MainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 302D95F014D2391D003F00A1 /* MainViewController.xib */; };
3772C27945674D8D9D6BA455 /* AFURLRequestSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BF1AE7251084FD2876E0BF5 /* AFURLRequestSerialization.m */; };
+ 3BE6767AAFDC4926A08E6690 /* JPushConfig.plist in Resources */ = {isa = PBXBuildFile; fileRef = E9D260B7FB6C49A3AE6CD0DB /* JPushConfig.plist */; };
+ 3C00FC06B74E49CFBABD0CFF /* libresolv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = CBD6EA74C612474DA862E146 /* libresolv.tbd */; settings = {ATTRIBUTES = (Weak, ); }; };
+ 3EBABAA2209349F6AF91DF03 /* JPushPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = CD3E9CB7CBA54989AB62BA7F /* JPushPlugin.m */; };
+ 432FFA418F2F4247BE9C8472 /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B1F790D5B00B4F178F835DE1 /* CoreTelephony.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
4F83621E48F143429B20FB3A /* CDVThemeableBrowser.m in Sources */ = {isa = PBXBuildFile; fileRef = 28B91F31B6FD410AAF87BBDC /* CDVThemeableBrowser.m */; };
5E2BDB8CFE4E41F39241956C /* CordovaHttpPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 07B9D06BD3024E0FBFF74967 /* CordovaHttpPlugin.m */; };
5F67F2BDBB534EF4A4F1F319 /* BinaryResponseSerializer.m in Sources */ = {isa = PBXBuildFile; fileRef = E9F753C8AE424EAE851FA1FD /* BinaryResponseSerializer.m */; };
6561A2871EB1420892CDE701 /* AFHTTPSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 04B5E1A8BB504B8FB8CE9627 /* AFHTTPSessionManager.m */; };
6F6B3ADF72094BF58EF5C4AC /* CDVJpegHeaderWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = 1836D178C8A74923B944A79E /* CDVJpegHeaderWriter.m */; };
6FB343627AC8409CB2AA79B7 /* CDVInAppBrowser.m in Sources */ = {isa = PBXBuildFile; fileRef = 607F51FCFC7C4062A93BD011 /* CDVInAppBrowser.m */; };
+ 7352A67D82B2499FBFFF8A2A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B080F410C164D6582A23E36 /* Foundation.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
74A56CC7F6724870ABD136F2 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 11A34CB026314A2AA98A0044 /* AVFoundation.framework */; };
74C07CC128F9457AB281916E /* TextRequestSerializer.m in Sources */ = {isa = PBXBuildFile; fileRef = DBDBB5C64D17465C9452AF28 /* TextRequestSerializer.m */; };
+ 77CDF61132F44B81B0064744 /* UserNotifications.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 59D1F618C1ED464283B7B2E6 /* UserNotifications.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
78A785FAE16943908BA7B6DB /* CDVFile.m in Sources */ = {isa = PBXBuildFile; fileRef = DD3651F245114E52ABEB9060 /* CDVFile.m */; };
7D8430D010A848FBBA5FB7ED /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5192EB17EA164DFD80D433E4 /* ImageIO.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
+ 7EC1B4999B2E48C098BA1BBB /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C44E29C3B190445C98BBAB84 /* CoreFoundation.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
+ 8A202CA89E434389BBA0AD60 /* AppVersion.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AAC7231E47A434EAF06A5B0 /* AppVersion.m */; };
8ABB6F36D85243238622D4F8 /* LocalAuthentication.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F3A85B8119074F699E1A15CD /* LocalAuthentication.framework */; };
8E2516CFE16944B8B9702955 /* AFSecurityPolicy.m in Sources */ = {isa = PBXBuildFile; fileRef = BA6C5B1A6A6A488790CA41EB /* AFSecurityPolicy.m */; };
90E2E49D3A2449AB8D4D82D0 /* TextResponseSerializer.m in Sources */ = {isa = PBXBuildFile; fileRef = 57E66D7A151D45828ED66B7F /* TextResponseSerializer.m */; };
9224D3CE70AE4072BBEB170D /* CDVLocalFilesystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 8A8DD2DDC8694A97A56F9FA7 /* CDVLocalFilesystem.m */; };
94868B10923A4508B06A4310 /* CDVAssetLibraryFilesystem.m in Sources */ = {isa = PBXBuildFile; fileRef = A719A69FD70D4CC9B8104FF6 /* CDVAssetLibraryFilesystem.m */; };
+ A15A414BEE7A48538C758317 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D5F2FFCAD8E4A4392B781A3 /* UIKit.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
A42AE846FF7B482FB889AAEB /* QRScanner.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8478FFD487C4004A1CEFCA8 /* QRScanner.swift */; };
A50EB04ADB24A5CBB680802F /* libPods-dlapp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D992375F52889311A88544EF /* libPods-dlapp.a */; };
+ A54A9FED843144C887EA4286 /* AppDelegate+JPush.m in Sources */ = {isa = PBXBuildFile; fileRef = 91E044FC8377488C886C818B /* AppDelegate+JPush.m */; };
B69FF513D1EE4772AFF6050B /* Fingerprint.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2099240B64744E08C91C285 /* Fingerprint.swift */; };
B8EFB66D03A44372A240B05B /* CDVCamera.m in Sources */ = {isa = PBXBuildFile; fileRef = 80B448E71F8941268B78692C /* CDVCamera.m */; };
BC39BA77AF0D4F94BC27666A /* CDVDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = A50DE9801E5E4302A78D569C /* CDVDevice.m */; };
BC998F935D174204820F4015 /* AFURLSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 22AE2683802B4CB1BAF69ABF /* AFURLSessionManager.m */; };
+ BFA0CF013EEC44F9B2C6FA6E /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0162975BB3964038A51EDED4 /* CFNetwork.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
+ C04B4EC2FAAD4D328ABA0C95 /* jpush-ios-3.2.1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CCDEFB0C0632436FA86F0F31 /* jpush-ios-3.2.1.a */; };
C61263FC7FE642E9B25A81E5 /* DisableStatusbar.m in Sources */ = {isa = PBXBuildFile; fileRef = 61106E22F1D348DDBDC4DC0B /* DisableStatusbar.m */; };
CAE5A91F948A472F9D872EC8 /* CDVStatusBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ABBE12B040548F8909BFC7B /* CDVStatusBar.m */; };
+ CDD6F217CA274CF18EC146D3 /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 048B6FC037E1479790969D83 /* AdSupport.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
D2F2072984AE43BCBD0A430D /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D1F25845F964D87B880BFA9 /* CoreLocation.framework */; };
+ D3E822CFC71546E191C10DA7 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 22DF35565BBA44B1980FFAF5 /* libz.tbd */; settings = {ATTRIBUTES = (Weak, ); }; };
D404D18DD0114DA787E0BB43 /* SDNetworkActivityIndicator.m in Sources */ = {isa = PBXBuildFile; fileRef = 148A2122F3E242E4AF09A28D /* SDNetworkActivityIndicator.m */; };
D834895F80744E0F96D59047 /* TouchID.m in Sources */ = {isa = PBXBuildFile; fileRef = B3CE13EED96B44C0B06B1B2C /* TouchID.m */; };
F46AE1B50D8B4A81B05D4100 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A673D8D8920E4086A9152FC4 /* Security.framework */; };
F939AD8D22BB769B006B371B /* libsqlite3.0.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = F939AD8C22BB769B006B371B /* libsqlite3.0.tbd */; };
FDE92C386167415E8040F8AB /* AFURLResponseSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = FDEE8379D7A34C55A616F700 /* AFURLResponseSerialization.m */; };
- 04347BD0ABAC4EE0B4CDDDB6 /* jcore-ios-2.1.1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 444DBF371D8346D7BC7EE35D /* jcore-ios-2.1.1.a */; };
- 3EBABAA2209349F6AF91DF03 /* JPushPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = CD3E9CB7CBA54989AB62BA7F /* JPushPlugin.m */; };
- A54A9FED843144C887EA4286 /* AppDelegate+JPush.m in Sources */ = {isa = PBXBuildFile; fileRef = 91E044FC8377488C886C818B /* AppDelegate+JPush.m */; };
- C04B4EC2FAAD4D328ABA0C95 /* jpush-ios-3.2.1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CCDEFB0C0632436FA86F0F31 /* jpush-ios-3.2.1.a */; };
- 3BE6767AAFDC4926A08E6690 /* JPushConfig.plist in Resources */ = {isa = PBXBuildFile; fileRef = E9D260B7FB6C49A3AE6CD0DB /* JPushConfig.plist */; };
- BFA0CF013EEC44F9B2C6FA6E /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0162975BB3964038A51EDED4 /* CFNetwork.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
- 7EC1B4999B2E48C098BA1BBB /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C44E29C3B190445C98BBAB84 /* CoreFoundation.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
- 432FFA418F2F4247BE9C8472 /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B1F790D5B00B4F178F835DE1 /* CoreTelephony.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
- 7352A67D82B2499FBFFF8A2A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B080F410C164D6582A23E36 /* Foundation.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
- A15A414BEE7A48538C758317 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D5F2FFCAD8E4A4392B781A3 /* UIKit.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
- D3E822CFC71546E191C10DA7 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 22DF35565BBA44B1980FFAF5 /* libz.tbd */; settings = {ATTRIBUTES = (Weak, ); }; };
- CDD6F217CA274CF18EC146D3 /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 048B6FC037E1479790969D83 /* AdSupport.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
- 77CDF61132F44B81B0064744 /* UserNotifications.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 59D1F618C1ED464283B7B2E6 /* UserNotifications.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
- 3C00FC06B74E49CFBABD0CFF /* libresolv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = CBD6EA74C612474DA862E146 /* libresolv.tbd */; settings = {ATTRIBUTES = (Weak, ); }; };
+ 562D29FCB1FB4F86B95BB2BC /* CDVWKWebViewEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = 59FDAA2CEE4540A3913846E4 /* CDVWKWebViewEngine.m */; };
+ F68EA21E51A3463A8FE2EE92 /* CDVWKWebViewUIDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B73EA28E46846FF84E6AF02 /* CDVWKWebViewUIDelegate.m */; };
+ 1F969D21D7EF4CF1A547A1DF /* CDVWKProcessPoolFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 473FEFEEBB2C4F5EAF594EBD /* CDVWKProcessPoolFactory.m */; };
+ 8C09122A89C14C5FB0C28636 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FE0B455916A4481681D59FE0 /* WebKit.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
301BF534109A57CC0062928A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
- containerPortal = 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */;
+ containerPortal = 301BF52D109A57CC0062928A /* CordovaLib/CordovaLib.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = D2AAC07E0554694100DB518D;
remoteInfo = CordovaLib;
};
301BF550109A68C00062928A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
- containerPortal = 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */;
+ containerPortal = 301BF52D109A57CC0062928A /* CordovaLib/CordovaLib.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = D2AAC07D0554694100DB518D;
remoteInfo = CordovaLib;
};
907D8123214C687600058A10 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
- containerPortal = 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */;
+ containerPortal = 301BF52D109A57CC0062928A /* CordovaLib/CordovaLib.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = C0C01EB21E3911D50056E6CB;
remoteInfo = Cordova;
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
+ 0162975BB3964038A51EDED4 /* CFNetwork.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
0207DA571B56EA530066E2B4 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = dlapp/Images.xcassets; sourceTree = SOURCE_ROOT; };
+ 048B6FC037E1479790969D83 /* AdSupport.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; };
04B5E1A8BB504B8FB8CE9627 /* AFHTTPSessionManager.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = AFHTTPSessionManager.m; path = "cordova-plugin-advanced-http/AFHTTPSessionManager.m"; sourceTree = "<group>"; };
07B9D06BD3024E0FBFF74967 /* CordovaHttpPlugin.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CordovaHttpPlugin.m; path = "cordova-plugin-advanced-http/CordovaHttpPlugin.m"; sourceTree = "<group>"; };
08B9BD113EDF4024B1F6D5CE /* AFURLRequestSerialization.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = AFURLRequestSerialization.h; path = "cordova-plugin-advanced-http/AFURLRequestSerialization.h"; sourceTree = "<group>"; };
09B4181C53154D9D8E1A2C4B /* AFHTTPSessionManager.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = AFHTTPSessionManager.h; path = "cordova-plugin-advanced-http/AFHTTPSessionManager.h"; sourceTree = "<group>"; };
+ 0EFE153A83734473AE4D0E4C /* AppDelegate+JPush.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = "AppDelegate+JPush.h"; path = "jpush-phonegap-plugin/AppDelegate+JPush.h"; sourceTree = "<group>"; };
11A34CB026314A2AA98A0044 /* AVFoundation.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
130AB7839C2A4FFF9F13C3DE /* CDVCamera.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVCamera.h; path = "cordova-plugin-camera/CDVCamera.h"; sourceTree = "<group>"; };
148A2122F3E242E4AF09A28D /* SDNetworkActivityIndicator.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = SDNetworkActivityIndicator.m; path = "cordova-plugin-advanced-http/SDNetworkActivityIndicator.m"; sourceTree = "<group>"; };
15879A58684B40158EC7A2CA /* CDVJpegHeaderWriter.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVJpegHeaderWriter.h; path = "cordova-plugin-camera/CDVJpegHeaderWriter.h"; sourceTree = "<group>"; };
17FD8EDA2EC0424192F6CA79 /* AFSecurityPolicy.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = AFSecurityPolicy.h; path = "cordova-plugin-advanced-http/AFSecurityPolicy.h"; sourceTree = "<group>"; };
1836D178C8A74923B944A79E /* CDVJpegHeaderWriter.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVJpegHeaderWriter.m; path = "cordova-plugin-camera/CDVJpegHeaderWriter.m"; sourceTree = "<group>"; };
+ 1AAC7231E47A434EAF06A5B0 /* AppVersion.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = AppVersion.m; path = "cordova-plugin-app-version/AppVersion.m"; sourceTree = "<group>"; };
1ABBE12B040548F8909BFC7B /* CDVStatusBar.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVStatusBar.m; path = "cordova-plugin-statusbar/CDVStatusBar.m"; sourceTree = "<group>"; };
1D1F25845F964D87B880BFA9 /* CoreLocation.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
1D3623240D0F684500981E51 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
1D3623250D0F684500981E51 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
1D6058910D05DD3D006BFB54 /* dlapp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = dlapp.app; sourceTree = BUILT_PRODUCTS_DIR; };
22AE2683802B4CB1BAF69ABF /* AFURLSessionManager.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = AFURLSessionManager.m; path = "cordova-plugin-advanced-http/AFURLSessionManager.m"; sourceTree = "<group>"; };
+ 22DF35565BBA44B1980FFAF5 /* libz.tbd */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
2625E3AABA8145E6901F06D3 /* SystemConfiguration.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
265BE52D975B49ACA2F7B3FE /* CDVDevice.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVDevice.h; path = "cordova-plugin-device/CDVDevice.h"; sourceTree = "<group>"; };
281DF600F6B747808087E4FC /* UIImage+CropScaleOrientation.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = "UIImage+CropScaleOrientation.m"; path = "cordova-plugin-camera/UIImage+CropScaleOrientation.m"; sourceTree = "<group>"; };
28B91F31B6FD410AAF87BBDC /* CDVThemeableBrowser.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVThemeableBrowser.m; path = "cordova-plugin-themeablebrowser/CDVThemeableBrowser.m"; sourceTree = "<group>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
2F977C7D2E4448098AA27AE8 /* CDVAssetLibraryFilesystem.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVAssetLibraryFilesystem.h; path = "cordova-plugin-file/CDVAssetLibraryFilesystem.h"; sourceTree = "<group>"; };
- 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = CordovaLib/CordovaLib.xcodeproj; sourceTree = "<group>"; };
+ 301BF52D109A57CC0062928A /* CordovaLib/CordovaLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = CordovaLib/CordovaLib.xcodeproj; sourceTree = "<group>"; };
301BF56E109A69640062928A /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; path = www; sourceTree = SOURCE_ROOT; };
302D95EE14D2391D003F00A1 /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = "<group>"; };
302D95EF14D2391D003F00A1 /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = "<group>"; };
3047A50F1AB8059700498E2A /* build-debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "build-debug.xcconfig"; path = "cordova/build-debug.xcconfig"; sourceTree = SOURCE_ROOT; };
3047A5101AB8059700498E2A /* build-release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "build-release.xcconfig"; path = "cordova/build-release.xcconfig"; sourceTree = SOURCE_ROOT; };
3047A5111AB8059700498E2A /* build.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = build.xcconfig; path = cordova/build.xcconfig; sourceTree = SOURCE_ROOT; };
+ 3291AEB63DCC45B58959915F /* JPushPlugin.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = JPushPlugin.h; path = "jpush-phonegap-plugin/JPushPlugin.h"; sourceTree = "<group>"; };
32CA4F630368D1EE00C91783 /* dlapp-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "dlapp-Prefix.pch"; sourceTree = "<group>"; };
+ 331EEE6AB06B4F35BFBC8120 /* AppVersion.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = AppVersion.h; path = "cordova-plugin-app-version/AppVersion.h"; sourceTree = "<group>"; };
3BE5364CD5E74AFDAB853364 /* AFURLResponseSerialization.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = AFURLResponseSerialization.h; path = "cordova-plugin-advanced-http/AFURLResponseSerialization.h"; sourceTree = "<group>"; };
3D1EDC804D3646E7BE4A92BF /* AFNetworking.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = AFNetworking.h; path = "cordova-plugin-advanced-http/AFNetworking.h"; sourceTree = "<group>"; };
3FD6ED94AE9243B29217547A /* CDVLocalFilesystem.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVLocalFilesystem.h; path = "cordova-plugin-file/CDVLocalFilesystem.h"; sourceTree = "<group>"; };
41DFF309018A479EA8F43611 /* CDVInAppBrowser.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVInAppBrowser.h; path = "cordova-plugin-inappbrowser/CDVInAppBrowser.h"; sourceTree = "<group>"; };
+ 444DBF371D8346D7BC7EE35D /* jcore-ios-2.1.1.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; name = "jcore-ios-2.1.1.a"; path = "dlapp/Plugins/cordova-plugin-jcore/jcore-ios-2.1.1.a"; sourceTree = "<group>"; };
4BF1AE7251084FD2876E0BF5 /* AFURLRequestSerialization.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = AFURLRequestSerialization.m; path = "cordova-plugin-advanced-http/AFURLRequestSerialization.m"; sourceTree = "<group>"; };
5192EB17EA164DFD80D433E4 /* ImageIO.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = System/Library/Frameworks/ImageIO.framework; sourceTree = SDKROOT; };
57E66D7A151D45828ED66B7F /* TextResponseSerializer.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = TextResponseSerializer.m; path = "cordova-plugin-advanced-http/TextResponseSerializer.m"; sourceTree = "<group>"; };
+ 59D1F618C1ED464283B7B2E6 /* UserNotifications.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = UserNotifications.framework; path = System/Library/Frameworks/UserNotifications.framework; sourceTree = SDKROOT; };
607F51FCFC7C4062A93BD011 /* CDVInAppBrowser.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVInAppBrowser.m; path = "cordova-plugin-inappbrowser/CDVInAppBrowser.m"; sourceTree = "<group>"; };
61106E22F1D348DDBDC4DC0B /* DisableStatusbar.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = DisableStatusbar.m; path = "cordova-plugin-disable-ios11-statusbar/DisableStatusbar.m"; sourceTree = "<group>"; };
62C24B1E8F294AC587C6D051 /* UIImage+CropScaleOrientation.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = "UIImage+CropScaleOrientation.h"; path = "cordova-plugin-camera/UIImage+CropScaleOrientation.h"; sourceTree = "<group>"; };
683645F69456461BB8712924 /* AFNetworkReachabilityManager.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = AFNetworkReachabilityManager.h; path = "cordova-plugin-advanced-http/AFNetworkReachabilityManager.h"; sourceTree = "<group>"; };
+ 6D5F2FFCAD8E4A4392B781A3 /* UIKit.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
6DC53FCFEEFD4EC89C2073E0 /* TextRequestSerializer.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = TextRequestSerializer.h; path = "cordova-plugin-advanced-http/TextRequestSerializer.h"; sourceTree = "<group>"; };
6FEED8E986814AC1AC60FC28 /* AFNetworkReachabilityManager.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = AFNetworkReachabilityManager.m; path = "cordova-plugin-advanced-http/AFNetworkReachabilityManager.m"; sourceTree = "<group>"; };
7601E9450D7240078C98ED9D /* CordovaHttpPlugin.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CordovaHttpPlugin.h; path = "cordova-plugin-advanced-http/CordovaHttpPlugin.h"; sourceTree = "<group>"; };
8BFF0D502E2241F0A89DF67F /* CDVStatusBar.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVStatusBar.h; path = "cordova-plugin-statusbar/CDVStatusBar.h"; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* dlapp-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "dlapp-Info.plist"; path = "dlapp/dlapp-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = SOURCE_ROOT; };
901AB970F8AB4CEF82C6DC1B /* BinaryResponseSerializer.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = BinaryResponseSerializer.h; path = "cordova-plugin-advanced-http/BinaryResponseSerializer.h"; sourceTree = "<group>"; };
+ 91E044FC8377488C886C818B /* AppDelegate+JPush.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = "AppDelegate+JPush.m"; path = "jpush-phonegap-plugin/AppDelegate+JPush.m"; sourceTree = "<group>"; };
+ 9B080F410C164D6582A23E36 /* Foundation.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ A32F7333BFEB461B9C84F6E5 /* JPUSHService.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = JPUSHService.h; path = "jpush-phonegap-plugin/JPUSHService.h"; sourceTree = "<group>"; };
A50DE9801E5E4302A78D569C /* CDVDevice.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVDevice.m; path = "cordova-plugin-device/CDVDevice.m"; sourceTree = "<group>"; };
A673D8D8920E4086A9152FC4 /* Security.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
A719A69FD70D4CC9B8104FF6 /* CDVAssetLibraryFilesystem.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVAssetLibraryFilesystem.m; path = "cordova-plugin-file/CDVAssetLibraryFilesystem.m"; sourceTree = "<group>"; };
B19E413F59714C6285552E82 /* TouchID.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = TouchID.h; path = "cordova-plugin-touch-id/TouchID.h"; sourceTree = "<group>"; };
+ B1F790D5B00B4F178F835DE1 /* CoreTelephony.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; };
B3CE13EED96B44C0B06B1B2C /* TouchID.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = TouchID.m; path = "cordova-plugin-touch-id/TouchID.m"; sourceTree = "<group>"; };
B3F9D30FB27A4B26A445BA84 /* CDVExif.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVExif.h; path = "cordova-plugin-camera/CDVExif.h"; sourceTree = "<group>"; };
BA6C5B1A6A6A488790CA41EB /* AFSecurityPolicy.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = AFSecurityPolicy.m; path = "cordova-plugin-advanced-http/AFSecurityPolicy.m"; sourceTree = "<group>"; };
C2099240B64744E08C91C285 /* Fingerprint.swift */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.swift; name = Fingerprint.swift; path = "cordova-plugin-fingerprint-aio/Fingerprint.swift"; sourceTree = "<group>"; };
+ C44E29C3B190445C98BBAB84 /* CoreFoundation.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
C8478FFD487C4004A1CEFCA8 /* QRScanner.swift */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.swift; name = QRScanner.swift; path = "cordova-plugin-qrscanner/QRScanner.swift"; sourceTree = "<group>"; };
+ CBD6EA74C612474DA862E146 /* libresolv.tbd */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libresolv.tbd; path = usr/lib/libresolv.tbd; sourceTree = SDKROOT; };
+ CCDEFB0C0632436FA86F0F31 /* jpush-ios-3.2.1.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; name = "jpush-ios-3.2.1.a"; path = "dlapp/Plugins/jpush-phonegap-plugin/jpush-ios-3.2.1.a"; sourceTree = "<group>"; };
+ CD3E9CB7CBA54989AB62BA7F /* JPushPlugin.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = JPushPlugin.m; path = "jpush-phonegap-plugin/JPushPlugin.m"; sourceTree = "<group>"; };
D4DBE4512BAD4694B7EB5217 /* SDNetworkActivityIndicator.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = SDNetworkActivityIndicator.h; path = "cordova-plugin-advanced-http/SDNetworkActivityIndicator.h"; sourceTree = "<group>"; };
D992375F52889311A88544EF /* libPods-dlapp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-dlapp.a"; sourceTree = BUILT_PRODUCTS_DIR; };
DBDBB5C64D17465C9452AF28 /* TextRequestSerializer.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = TextRequestSerializer.m; path = "cordova-plugin-advanced-http/TextRequestSerializer.m"; sourceTree = "<group>"; };
DD3651F245114E52ABEB9060 /* CDVFile.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVFile.m; path = "cordova-plugin-file/CDVFile.m"; sourceTree = "<group>"; };
DE50527E757F47D08F4E076C /* CDVFile.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVFile.h; path = "cordova-plugin-file/CDVFile.h"; sourceTree = "<group>"; };
+ E9D260B7FB6C49A3AE6CD0DB /* JPushConfig.plist */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = text.plist.xml; path = JPushConfig.plist; sourceTree = "<group>"; };
E9F753C8AE424EAE851FA1FD /* BinaryResponseSerializer.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = BinaryResponseSerializer.m; path = "cordova-plugin-advanced-http/BinaryResponseSerializer.m"; sourceTree = "<group>"; };
EB87FDF31871DA8E0020F90C /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; name = www; path = ../../www; sourceTree = "<group>"; };
EB87FDF41871DAF40020F90C /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = ../../config.xml; sourceTree = "<group>"; };
F3A85B8119074F699E1A15CD /* LocalAuthentication.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = LocalAuthentication.framework; path = System/Library/Frameworks/LocalAuthentication.framework; sourceTree = SDKROOT; };
F840E1F0165FE0F500CFE078 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = dlapp/config.xml; sourceTree = "<group>"; };
F939AD8C22BB769B006B371B /* libsqlite3.0.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.0.tbd; path = usr/lib/libsqlite3.0.tbd; sourceTree = SDKROOT; };
+ FC8EA7F3637547AD8BC62127 /* JPushDefine.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = JPushDefine.h; path = "jpush-phonegap-plugin/JPushDefine.h"; sourceTree = "<group>"; };
FCC7E279D80D4FB9BCF2530A /* Bridging-Header.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = "Bridging-Header.h"; path = "cordova-plugin-fingerprint-aio/Bridging-Header.h"; sourceTree = "<group>"; };
FDEE8379D7A34C55A616F700 /* AFURLResponseSerialization.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = AFURLResponseSerialization.m; path = "cordova-plugin-advanced-http/AFURLResponseSerialization.m"; sourceTree = "<group>"; };
- 444DBF371D8346D7BC7EE35D /* jcore-ios-2.1.1.a */ = {isa = PBXFileReference; name = "jcore-ios-2.1.1.a"; path = "dlapp/Plugins/cordova-plugin-jcore/jcore-ios-2.1.1.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
- CD3E9CB7CBA54989AB62BA7F /* JPushPlugin.m */ = {isa = PBXFileReference; name = "JPushPlugin.m"; path = "jpush-phonegap-plugin/JPushPlugin.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
- 91E044FC8377488C886C818B /* AppDelegate+JPush.m */ = {isa = PBXFileReference; name = "AppDelegate+JPush.m"; path = "jpush-phonegap-plugin/AppDelegate+JPush.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
- CCDEFB0C0632436FA86F0F31 /* jpush-ios-3.2.1.a */ = {isa = PBXFileReference; name = "jpush-ios-3.2.1.a"; path = "dlapp/Plugins/jpush-phonegap-plugin/jpush-ios-3.2.1.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
- FC8EA7F3637547AD8BC62127 /* JPushDefine.h */ = {isa = PBXFileReference; name = "JPushDefine.h"; path = "jpush-phonegap-plugin/JPushDefine.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
- 3291AEB63DCC45B58959915F /* JPushPlugin.h */ = {isa = PBXFileReference; name = "JPushPlugin.h"; path = "jpush-phonegap-plugin/JPushPlugin.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
- 0EFE153A83734473AE4D0E4C /* AppDelegate+JPush.h */ = {isa = PBXFileReference; name = "AppDelegate+JPush.h"; path = "jpush-phonegap-plugin/AppDelegate+JPush.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
- A32F7333BFEB461B9C84F6E5 /* JPUSHService.h */ = {isa = PBXFileReference; name = "JPUSHService.h"; path = "jpush-phonegap-plugin/JPUSHService.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
- E9D260B7FB6C49A3AE6CD0DB /* JPushConfig.plist */ = {isa = PBXFileReference; name = "JPushConfig.plist"; path = "JPushConfig.plist"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = text.plist.xml; explicitFileType = undefined; includeInIndex = 0; };
- 0162975BB3964038A51EDED4 /* CFNetwork.framework */ = {isa = PBXFileReference; name = "CFNetwork.framework"; path = "System/Library/Frameworks/CFNetwork.framework"; sourceTree = SDKROOT; fileEncoding = undefined; lastKnownFileType = wrapper.framework; explicitFileType = undefined; includeInIndex = 0; };
- C44E29C3B190445C98BBAB84 /* CoreFoundation.framework */ = {isa = PBXFileReference; name = "CoreFoundation.framework"; path = "System/Library/Frameworks/CoreFoundation.framework"; sourceTree = SDKROOT; fileEncoding = undefined; lastKnownFileType = wrapper.framework; explicitFileType = undefined; includeInIndex = 0; };
- B1F790D5B00B4F178F835DE1 /* CoreTelephony.framework */ = {isa = PBXFileReference; name = "CoreTelephony.framework"; path = "System/Library/Frameworks/CoreTelephony.framework"; sourceTree = SDKROOT; fileEncoding = undefined; lastKnownFileType = wrapper.framework; explicitFileType = undefined; includeInIndex = 0; };
- 9B080F410C164D6582A23E36 /* Foundation.framework */ = {isa = PBXFileReference; name = "Foundation.framework"; path = "System/Library/Frameworks/Foundation.framework"; sourceTree = SDKROOT; fileEncoding = undefined; lastKnownFileType = wrapper.framework; explicitFileType = undefined; includeInIndex = 0; };
- 6D5F2FFCAD8E4A4392B781A3 /* UIKit.framework */ = {isa = PBXFileReference; name = "UIKit.framework"; path = "System/Library/Frameworks/UIKit.framework"; sourceTree = SDKROOT; fileEncoding = undefined; lastKnownFileType = wrapper.framework; explicitFileType = undefined; includeInIndex = 0; };
- 22DF35565BBA44B1980FFAF5 /* libz.tbd */ = {isa = PBXFileReference; name = "libz.tbd"; path = "usr/lib/libz.tbd"; sourceTree = SDKROOT; fileEncoding = undefined; lastKnownFileType = sourcecode.text-based-dylib-definition; explicitFileType = undefined; includeInIndex = 0; };
- 048B6FC037E1479790969D83 /* AdSupport.framework */ = {isa = PBXFileReference; name = "AdSupport.framework"; path = "System/Library/Frameworks/AdSupport.framework"; sourceTree = SDKROOT; fileEncoding = undefined; lastKnownFileType = wrapper.framework; explicitFileType = undefined; includeInIndex = 0; };
- 59D1F618C1ED464283B7B2E6 /* UserNotifications.framework */ = {isa = PBXFileReference; name = "UserNotifications.framework"; path = "System/Library/Frameworks/UserNotifications.framework"; sourceTree = SDKROOT; fileEncoding = undefined; lastKnownFileType = wrapper.framework; explicitFileType = undefined; includeInIndex = 0; };
- CBD6EA74C612474DA862E146 /* libresolv.tbd */ = {isa = PBXFileReference; name = "libresolv.tbd"; path = "usr/lib/libresolv.tbd"; sourceTree = SDKROOT; fileEncoding = undefined; lastKnownFileType = sourcecode.text-based-dylib-definition; explicitFileType = undefined; includeInIndex = 0; };
+ 59FDAA2CEE4540A3913846E4 /* CDVWKWebViewEngine.m */ = {isa = PBXFileReference; name = "CDVWKWebViewEngine.m"; path = "cordova-plugin-wkwebview-engine/CDVWKWebViewEngine.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
+ 3B73EA28E46846FF84E6AF02 /* CDVWKWebViewUIDelegate.m */ = {isa = PBXFileReference; name = "CDVWKWebViewUIDelegate.m"; path = "cordova-plugin-wkwebview-engine/CDVWKWebViewUIDelegate.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
+ 473FEFEEBB2C4F5EAF594EBD /* CDVWKProcessPoolFactory.m */ = {isa = PBXFileReference; name = "CDVWKProcessPoolFactory.m"; path = "cordova-plugin-wkwebview-engine/CDVWKProcessPoolFactory.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
+ 648BD3182CD64A77AD2D447B /* CDVWKWebViewEngine.h */ = {isa = PBXFileReference; name = "CDVWKWebViewEngine.h"; path = "cordova-plugin-wkwebview-engine/CDVWKWebViewEngine.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
+ 1E5CB6025B2E4D14ABFDB037 /* CDVWKWebViewUIDelegate.h */ = {isa = PBXFileReference; name = "CDVWKWebViewUIDelegate.h"; path = "cordova-plugin-wkwebview-engine/CDVWKWebViewUIDelegate.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
+ 7DC7711D3C76485B9E422E3A /* CDVWKProcessPoolFactory.h */ = {isa = PBXFileReference; name = "CDVWKProcessPoolFactory.h"; path = "cordova-plugin-wkwebview-engine/CDVWKProcessPoolFactory.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
+ FE0B455916A4481681D59FE0 /* WebKit.framework */ = {isa = PBXFileReference; name = "WebKit.framework"; path = "System/Library/Frameworks/WebKit.framework"; sourceTree = SDKROOT; fileEncoding = undefined; lastKnownFileType = wrapper.framework; explicitFileType = undefined; includeInIndex = 0; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
CDD6F217CA274CF18EC146D3 /* AdSupport.framework in Frameworks */,
77CDF61132F44B81B0064744 /* UserNotifications.framework in Frameworks */,
3C00FC06B74E49CFBABD0CFF /* libresolv.tbd in Frameworks */,
+ 8C09122A89C14C5FB0C28636 /* WebKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
name = Products;
sourceTree = "<group>";
};
- 29B97314FDCFA39411CA2CEA = {
+ 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
isa = PBXGroup;
children = (
EB87FDF41871DAF40020F90C /* config.xml */,
EB87FDF31871DA8E0020F90C /* www */,
EB87FDF11871DA420020F90C /* Staging */,
- 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */,
+ 301BF52D109A57CC0062928A /* CordovaLib/CordovaLib.xcodeproj */,
080E96DDFE201D6D7F000001 /* Classes */,
307C750510C5A3420062BCA9 /* Plugins */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
048B6FC037E1479790969D83 /* AdSupport.framework */,
59D1F618C1ED464283B7B2E6 /* UserNotifications.framework */,
CBD6EA74C612474DA862E146 /* libresolv.tbd */,
+ FE0B455916A4481681D59FE0 /* WebKit.framework */,
);
name = Frameworks;
sourceTree = "<group>";
3291AEB63DCC45B58959915F /* JPushPlugin.h */,
0EFE153A83734473AE4D0E4C /* AppDelegate+JPush.h */,
A32F7333BFEB461B9C84F6E5 /* JPUSHService.h */,
+ 1AAC7231E47A434EAF06A5B0 /* AppVersion.m */,
+ 331EEE6AB06B4F35BFBC8120 /* AppVersion.h */,
+ 59FDAA2CEE4540A3913846E4 /* CDVWKWebViewEngine.m */,
+ 3B73EA28E46846FF84E6AF02 /* CDVWKWebViewUIDelegate.m */,
+ 473FEFEEBB2C4F5EAF594EBD /* CDVWKProcessPoolFactory.m */,
+ 648BD3182CD64A77AD2D447B /* CDVWKWebViewEngine.h */,
+ 1E5CB6025B2E4D14ABFDB037 /* CDVWKWebViewUIDelegate.h */,
+ 7DC7711D3C76485B9E422E3A /* CDVWKProcessPoolFactory.h */,
);
name = Plugins;
path = dlapp/Plugins;
LastUpgradeCheck = 510;
TargetAttributes = {
1D6058900D05DD3D006BFB54 = {
- DevelopmentTeam = 74UNETA6B2;
+ DevelopmentTeam = 58ZC23SH57;
ProvisioningStyle = Automatic;
+ SystemCapabilities = {
+ com.apple.Push = {
+ enabled = 1;
+ };
+ };
};
};
};
English,
en,
);
- mainGroup = 29B97314FDCFA39411CA2CEA;
+ mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
productRefGroup = 19C28FACFE9D520D11CA2CBB /* Products */;
projectDirPath = "";
projectReferences = (
{
ProductGroup = 301BF52E109A57CC0062928A /* Products */;
- ProjectRef = 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */;
+ ProjectRef = 301BF52D109A57CC0062928A /* CordovaLib/CordovaLib.xcodeproj */;
},
);
projectRoot = "";
4F83621E48F143429B20FB3A /* CDVThemeableBrowser.m in Sources */,
3EBABAA2209349F6AF91DF03 /* JPushPlugin.m in Sources */,
A54A9FED843144C887EA4286 /* AppDelegate+JPush.m in Sources */,
+ 8A202CA89E434389BBA0AD60 /* AppVersion.m in Sources */,
+ 562D29FCB1FB4F86B95BB2BC /* CDVWKWebViewEngine.m in Sources */,
+ F68EA21E51A3463A8FE2EE92 /* CDVWKWebViewUIDelegate.m in Sources */,
+ 1F969D21D7EF4CF1A547A1DF /* CDVWKProcessPoolFactory.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
- DEVELOPMENT_TEAM = 74UNETA6B2;
+ DEVELOPMENT_TEAM = 58ZC23SH57;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
INFOPLIST_FILE = "dlapp/dlapp-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
- PRODUCT_BUNDLE_IDENTIFIER = com.supwisdom.dlapp;
- PRODUCT_NAME = "$(TARGET_NAME)";
- SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h";
- SWIFT_OPTIMIZATION_LEVEL = "-Onone";
- SWIFT_VERSION = 4.0;
- TARGETED_DEVICE_FAMILY = 1;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)/Plugins/cordova-plugin-jcore\"",
"\"$(SRCROOT)/$(TARGET_NAME)/Plugins/jpush-phonegap-plugin\"",
);
+ PRODUCT_BUNDLE_IDENTIFIER = com.dalicitycard.app;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h";
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_VERSION = 4.0;
+ TARGETED_DEVICE_FAMILY = 1;
};
name = Debug;
};
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = YES;
- DEVELOPMENT_TEAM = 74UNETA6B2;
+ DEVELOPMENT_TEAM = 58ZC23SH57;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "dlapp/dlapp-Prefix.pch";
GCC_THUMB_SUPPORT = NO;
INFOPLIST_FILE = "dlapp/dlapp-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
- PRODUCT_BUNDLE_IDENTIFIER = com.supwisdom.dlapp;
- PRODUCT_NAME = "$(TARGET_NAME)";
- SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h";
- SWIFT_VERSION = 4.0;
- TARGETED_DEVICE_FAMILY = 1;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)/Plugins/cordova-plugin-jcore\"",
"\"$(SRCROOT)/$(TARGET_NAME)/Plugins/jpush-phonegap-plugin\"",
);
+ PRODUCT_BUNDLE_IDENTIFIER = com.dalicitycard.app;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h";
+ SWIFT_VERSION = 4.0;
+ TARGETED_DEVICE_FAMILY = 1;
};
name = Release;
};
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
- PRODUCT_BUNDLE_IDENTIFIER = com.supwisdom.dlapp;
+ PRODUCT_BUNDLE_IDENTIFIER = com.dalicitycard.app;
SDKROOT = iphoneos;
SKIP_INSTALL = NO;
SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h";
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- PRODUCT_BUNDLE_IDENTIFIER = com.supwisdom.dlapp;
+ PRODUCT_BUNDLE_IDENTIFIER = com.dalicitycard.app;
SDKROOT = iphoneos;
SKIP_INSTALL = NO;
SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h";
{
- "images" : [
- {
- "size" : "20x20",
- "idiom" : "iphone",
- "filename" : "icon-20@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "20x20",
- "idiom" : "iphone",
- "filename" : "icon-20@3x.png",
- "scale" : "3x"
- },
- {
- "size" : "29x29",
- "idiom" : "iphone",
- "filename" : "icon-29.png",
- "scale" : "1x"
- },
- {
- "size" : "29x29",
- "idiom" : "iphone",
- "filename" : "icon-29@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "29x29",
- "idiom" : "iphone",
- "filename" : "icon-29@3x.png",
- "scale" : "3x"
- },
- {
- "size" : "40x40",
- "idiom" : "iphone",
- "filename" : "icon-40@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "40x40",
- "idiom" : "iphone",
- "filename" : "icon-60@2x.png",
- "scale" : "3x"
- },
- {
- "size" : "57x57",
- "idiom" : "iphone",
- "filename" : "icon.png",
- "scale" : "1x"
- },
- {
- "size" : "57x57",
- "idiom" : "iphone",
- "filename" : "icon@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "60x60",
- "idiom" : "iphone",
- "filename" : "icon-60@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "60x60",
- "idiom" : "iphone",
- "filename" : "icon-60@3x.png",
- "scale" : "3x"
- },
- {
- "size" : "20x20",
- "idiom" : "ipad",
- "filename" : "icon-20.png",
- "scale" : "1x"
- },
- {
- "size" : "20x20",
- "idiom" : "ipad",
- "filename" : "icon-20@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "29x29",
- "idiom" : "ipad",
- "filename" : "icon-29.png",
- "scale" : "1x"
- },
- {
- "size" : "29x29",
- "idiom" : "ipad",
- "filename" : "icon-29@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "40x40",
- "idiom" : "ipad",
- "filename" : "icon-40.png",
- "scale" : "1x"
- },
- {
- "size" : "40x40",
- "idiom" : "ipad",
- "filename" : "icon-40@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "50x50",
- "idiom" : "ipad",
- "filename" : "icon-50.png",
- "scale" : "1x"
- },
- {
- "size" : "50x50",
- "idiom" : "ipad",
- "filename" : "icon-50@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "72x72",
- "idiom" : "ipad",
- "filename" : "icon-72.png",
- "scale" : "1x"
- },
- {
- "size" : "72x72",
- "idiom" : "ipad",
- "filename" : "icon-72@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "76x76",
- "idiom" : "ipad",
- "filename" : "icon-76.png",
- "scale" : "1x"
- },
- {
- "size" : "76x76",
- "idiom" : "ipad",
- "filename" : "icon-76@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "83.5x83.5",
- "idiom" : "ipad",
- "filename" : "icon-83.5@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "1024x1024",
- "idiom" : "ios-marketing",
- "filename" : "icon-1024.png",
- "scale" : "1x"
- },
- {
- "size" : "24x24",
- "idiom" : "watch",
- "filename" : "icon-24@2x.png",
- "scale" : "2x",
- "role" : "notificationCenter",
- "subtype" : "38mm"
- },
- {
- "size" : "27.5x27.5",
- "idiom" : "watch",
- "filename" : "icon-27.5@2x.png",
- "scale" : "2x",
- "role" : "notificationCenter",
- "subtype" : "42mm"
- },
- {
- "size" : "29x29",
- "idiom" : "watch",
- "filename" : "icon-29@2x.png",
- "role" : "companionSettings",
- "scale" : "2x"
- },
- {
- "size" : "29x29",
- "idiom" : "watch",
- "filename" : "icon-29@3x.png",
- "role" : "companionSettings",
- "scale" : "3x"
- },
- {
- "size" : "40x40",
- "idiom" : "watch",
- "filename" : "icon-40@2x.png",
- "scale" : "2x",
- "role" : "appLauncher",
- "subtype" : "38mm"
- },
- {
- "size" : "44x44",
- "idiom" : "watch",
- "filename" : "icon-44@2x.png",
- "scale" : "2x",
- "role" : "appLauncher",
- "subtype" : "40mm"
- },
- {
- "size" : "50x50",
- "idiom" : "watch",
- "filename" : "icon-50@2x.png",
- "scale" : "2x",
- "role" : "appLauncher",
- "subtype" : "44mm"
- },
- {
- "size" : "86x86",
- "idiom" : "watch",
- "filename" : "icon-86@2x.png",
- "scale" : "2x",
- "role" : "quickLook",
- "subtype" : "38mm"
- },
- {
- "size" : "98x98",
- "idiom" : "watch",
- "filename" : "icon-98@2x.png",
- "scale" : "2x",
- "role" : "quickLook",
- "subtype" : "42mm"
- },
- {
- "size" : "108x108",
- "idiom" : "watch",
- "scale" : "2x",
- "role" : "quickLook",
- "subtype" : "44mm"
- },
- {
- "size" : "1024x1024",
- "idiom" : "watch-marketing",
- "filename" : "icon-1024.png",
- "scale" : "1x"
+ "images":[
+ {
+ "idiom":"iphone",
+ "size":"20x20",
+ "scale":"2x",
+ "filename":"Icon-App-20x20@2x.png"
+ },
+ {
+ "idiom":"iphone",
+ "size":"20x20",
+ "scale":"3x",
+ "filename":"Icon-App-20x20@3x.png"
+ },
+ {
+ "idiom":"iphone",
+ "size":"29x29",
+ "scale":"1x",
+ "filename":"Icon-App-29x29@1x.png"
+ },
+ {
+ "idiom":"iphone",
+ "size":"29x29",
+ "scale":"2x",
+ "filename":"Icon-App-29x29@2x.png"
+ },
+ {
+ "idiom":"iphone",
+ "size":"29x29",
+ "scale":"3x",
+ "filename":"Icon-App-29x29@3x.png"
+ },
+ {
+ "idiom":"iphone",
+ "size":"40x40",
+ "scale":"2x",
+ "filename":"Icon-App-40x40@2x.png"
+ },
+ {
+ "idiom":"iphone",
+ "size":"40x40",
+ "scale":"3x",
+ "filename":"Icon-App-40x40@3x.png"
+ },
+ {
+ "idiom":"iphone",
+ "size":"60x60",
+ "scale":"2x",
+ "filename":"Icon-App-60x60@2x.png"
+ },
+ {
+ "idiom":"iphone",
+ "size":"60x60",
+ "scale":"3x",
+ "filename":"Icon-App-60x60@3x.png"
+ },
+ {
+ "idiom":"iphone",
+ "size":"76x76",
+ "scale":"2x",
+ "filename":"Icon-App-76x76@2x.png"
+ },
+ {
+ "idiom":"ipad",
+ "size":"20x20",
+ "scale":"1x",
+ "filename":"Icon-App-20x20@1x.png"
+ },
+ {
+ "idiom":"ipad",
+ "size":"20x20",
+ "scale":"2x",
+ "filename":"Icon-App-20x20@2x.png"
+ },
+ {
+ "idiom":"ipad",
+ "size":"29x29",
+ "scale":"1x",
+ "filename":"Icon-App-29x29@1x.png"
+ },
+ {
+ "idiom":"ipad",
+ "size":"29x29",
+ "scale":"2x",
+ "filename":"Icon-App-29x29@2x.png"
+ },
+ {
+ "idiom":"ipad",
+ "size":"40x40",
+ "scale":"1x",
+ "filename":"Icon-App-40x40@1x.png"
+ },
+ {
+ "idiom":"ipad",
+ "size":"40x40",
+ "scale":"2x",
+ "filename":"Icon-App-40x40@2x.png"
+ },
+ {
+ "idiom":"ipad",
+ "size":"76x76",
+ "scale":"1x",
+ "filename":"Icon-App-76x76@1x.png"
+ },
+ {
+ "idiom":"ipad",
+ "size":"76x76",
+ "scale":"2x",
+ "filename":"Icon-App-76x76@2x.png"
+ },
+ {
+ "idiom":"ipad",
+ "size":"83.5x83.5",
+ "scale":"2x",
+ "filename":"Icon-App-83.5x83.5@2x.png"
+ },
+ {
+ "size" : "1024x1024",
+ "idiom" : "ios-marketing",
+ "scale" : "1x",
+ "filename" : "ItunesArtwork@2x.png"
+ }
+ ],
+ "info":{
+ "version":1,
+ "author":"makeappicon"
}
- ],
- "info" : {
- "version" : 1,
- "author" : "xcode"
- }
-}
\ No newline at end of file
+}
--- /dev/null
+#import <Cordova/CDVPlugin.h>
+
+@interface AppVersion : CDVPlugin
+
+- (void)getAppName:(CDVInvokedUrlCommand*)command;
+
+- (void)getPackageName:(CDVInvokedUrlCommand*)command;
+
+- (void)getVersionNumber:(CDVInvokedUrlCommand*)command;
+
+- (void)getVersionCode:(CDVInvokedUrlCommand*)command;
+
+@end
--- /dev/null
+#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
--- /dev/null
+/*
+ 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 CDVWKProcessPoolFactory : NSObject
+@property (nonatomic, retain) WKProcessPool* sharedPool;
+
++(instancetype) sharedFactory;
+-(WKProcessPool*) sharedProcessPool;
+@end
--- /dev/null
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <Foundation/Foundation.h>
+#import <WebKit/WebKit.h>
+#import "CDVWKProcessPoolFactory.h"
+
+static CDVWKProcessPoolFactory *factory = nil;
+
+@implementation CDVWKProcessPoolFactory
+
++ (instancetype)sharedFactory
+{
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ factory = [[CDVWKProcessPoolFactory alloc] init];
+ });
+
+ return factory;
+}
+
+- (instancetype)init
+{
+ if (self = [super init]) {
+ _sharedPool = [[WKProcessPool alloc] init];
+ }
+ return self;
+}
+
+- (WKProcessPool*) sharedProcessPool {
+ return _sharedPool;
+}
+@end
--- /dev/null
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <WebKit/WebKit.h>
+#import <Cordova/CDV.h>
+
+@interface CDVWKWebViewEngine : CDVPlugin <CDVWebViewEngineProtocol, WKScriptMessageHandler, WKNavigationDelegate>
+
+@property (nonatomic, strong, readonly) id <WKUIDelegate> uiDelegate;
+
+- (void)allowsBackForwardNavigationGestures:(CDVInvokedUrlCommand*)command;
+
+@end
--- /dev/null
+/*
+ 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 "CDVWKWebViewEngine.h"
+#import "CDVWKWebViewUIDelegate.h"
+#import "CDVWKProcessPoolFactory.h"
+#import <Cordova/NSDictionary+CordovaPreferences.h>
+
+#import <objc/message.h>
+
+#define CDV_BRIDGE_NAME @"cordova"
+#define CDV_WKWEBVIEW_FILE_URL_LOAD_SELECTOR @"loadFileURL:allowingReadAccessToURL:"
+
+@interface CDVWKWeakScriptMessageHandler : NSObject <WKScriptMessageHandler>
+
+@property (nonatomic, weak, readonly) id<WKScriptMessageHandler>scriptMessageHandler;
+
+- (instancetype)initWithScriptMessageHandler:(id<WKScriptMessageHandler>)scriptMessageHandler;
+
+@end
+
+
+@interface CDVWKWebViewEngine ()
+
+@property (nonatomic, strong, readwrite) UIView* engineWebView;
+@property (nonatomic, strong, readwrite) id <WKUIDelegate> uiDelegate;
+@property (nonatomic, weak) id <WKScriptMessageHandler> weakScriptMessageHandler;
+
+@end
+
+// see forwardingTargetForSelector: selector comment for the reason for this pragma
+#pragma clang diagnostic ignored "-Wprotocol"
+
+@implementation CDVWKWebViewEngine
+
+@synthesize engineWebView = _engineWebView;
+
+- (instancetype)initWithFrame:(CGRect)frame
+{
+ self = [super init];
+ if (self) {
+ if (NSClassFromString(@"WKWebView") == nil) {
+ return nil;
+ }
+
+ self.engineWebView = [[WKWebView alloc] initWithFrame:frame];
+ }
+
+ return self;
+}
+
+- (WKWebViewConfiguration*) createConfigurationFromSettings:(NSDictionary*)settings
+{
+ WKWebViewConfiguration* configuration = [[WKWebViewConfiguration alloc] init];
+ configuration.processPool = [[CDVWKProcessPoolFactory sharedFactory] sharedProcessPool];
+ if (settings == nil) {
+ return configuration;
+ }
+
+ configuration.allowsInlineMediaPlayback = [settings cordovaBoolSettingForKey:@"AllowInlineMediaPlayback" defaultValue:NO];
+ configuration.mediaPlaybackRequiresUserAction = [settings cordovaBoolSettingForKey:@"MediaPlaybackRequiresUserAction" defaultValue:YES];
+ configuration.suppressesIncrementalRendering = [settings cordovaBoolSettingForKey:@"SuppressesIncrementalRendering" defaultValue:NO];
+ configuration.mediaPlaybackAllowsAirPlay = [settings cordovaBoolSettingForKey:@"MediaPlaybackAllowsAirPlay" defaultValue:YES];
+ return configuration;
+}
+
+- (void)pluginInitialize
+{
+ // viewController would be available now. we attempt to set all possible delegates to it, by default
+ NSDictionary* settings = self.commandDelegate.settings;
+
+ self.uiDelegate = [[CDVWKWebViewUIDelegate alloc] initWithTitle:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]];
+
+ CDVWKWeakScriptMessageHandler *weakScriptMessageHandler = [[CDVWKWeakScriptMessageHandler alloc] initWithScriptMessageHandler:self];
+
+ WKUserContentController* userContentController = [[WKUserContentController alloc] init];
+ [userContentController addScriptMessageHandler:weakScriptMessageHandler name:CDV_BRIDGE_NAME];
+
+ WKWebViewConfiguration* configuration = [self createConfigurationFromSettings:settings];
+ configuration.userContentController = userContentController;
+
+ // re-create WKWebView, since we need to update configuration
+ WKWebView* wkWebView = [[WKWebView alloc] initWithFrame:self.engineWebView.frame configuration:configuration];
+ wkWebView.UIDelegate = self.uiDelegate;
+ self.engineWebView = wkWebView;
+
+ if (IsAtLeastiOSVersion(@"9.0") && [self.viewController isKindOfClass:[CDVViewController class]]) {
+ wkWebView.customUserAgent = ((CDVViewController*) self.viewController).userAgent;
+ }
+
+ if ([self.viewController conformsToProtocol:@protocol(WKUIDelegate)]) {
+ wkWebView.UIDelegate = (id <WKUIDelegate>)self.viewController;
+ }
+
+ if ([self.viewController conformsToProtocol:@protocol(WKNavigationDelegate)]) {
+ wkWebView.navigationDelegate = (id <WKNavigationDelegate>)self.viewController;
+ } else {
+ wkWebView.navigationDelegate = (id <WKNavigationDelegate>)self;
+ }
+
+ if ([self.viewController conformsToProtocol:@protocol(WKScriptMessageHandler)]) {
+ [wkWebView.configuration.userContentController addScriptMessageHandler:(id < WKScriptMessageHandler >)self.viewController name:CDV_BRIDGE_NAME];
+ }
+
+ [self updateSettings:settings];
+
+ // check if content thread has died on resume
+ NSLog(@"%@", @"CDVWKWebViewEngine will reload WKWebView if required on resume");
+ [[NSNotificationCenter defaultCenter]
+ addObserver:self
+ selector:@selector(onAppWillEnterForeground:)
+ name:UIApplicationWillEnterForegroundNotification object:nil];
+
+ NSLog(@"Using WKWebView");
+
+ [self addURLObserver];
+}
+
+- (void)onReset {
+ [self addURLObserver];
+}
+
+static void * KVOContext = &KVOContext;
+
+- (void)addURLObserver {
+ if(!IsAtLeastiOSVersion(@"9.0")){
+ [self.webView addObserver:self forKeyPath:@"URL" options:0 context:KVOContext];
+ }
+}
+
+- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSString *,id> *)change context:(void *)context
+{
+ if (context == KVOContext) {
+ if (object == [self webView] && [keyPath isEqualToString: @"URL"] && [object valueForKeyPath:keyPath] == nil){
+ NSLog(@"URL is nil. Reloading WKWebView");
+ [(WKWebView*)_engineWebView reload];
+ }
+ } else {
+ [super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
+ }
+}
+
+- (void) onAppWillEnterForeground:(NSNotification*)notification {
+ if ([self shouldReloadWebView]) {
+ NSLog(@"%@", @"CDVWKWebViewEngine reloading!");
+ [(WKWebView*)_engineWebView reload];
+ }
+}
+
+- (BOOL)shouldReloadWebView
+{
+ WKWebView* wkWebView = (WKWebView*)_engineWebView;
+ return [self shouldReloadWebView:wkWebView.URL title:wkWebView.title];
+}
+
+- (BOOL)shouldReloadWebView:(NSURL*)location title:(NSString*)title
+{
+ BOOL title_is_nil = (title == nil);
+ BOOL location_is_blank = [[location absoluteString] isEqualToString:@"about:blank"];
+
+ BOOL reload = (title_is_nil || location_is_blank);
+
+#ifdef DEBUG
+ NSLog(@"%@", @"CDVWKWebViewEngine shouldReloadWebView::");
+ NSLog(@"CDVWKWebViewEngine shouldReloadWebView title: %@", title);
+ NSLog(@"CDVWKWebViewEngine shouldReloadWebView location: %@", [location absoluteString]);
+ NSLog(@"CDVWKWebViewEngine shouldReloadWebView reload: %u", reload);
+#endif
+
+ return reload;
+}
+
+
+- (id)loadRequest:(NSURLRequest*)request
+{
+ if ([self canLoadRequest:request]) { // can load, differentiate between file urls and other schemes
+ if (request.URL.fileURL) {
+ SEL wk_sel = NSSelectorFromString(CDV_WKWEBVIEW_FILE_URL_LOAD_SELECTOR);
+ NSURL* readAccessUrl = [request.URL URLByDeletingLastPathComponent];
+ return ((id (*)(id, SEL, id, id))objc_msgSend)(_engineWebView, wk_sel, request.URL, readAccessUrl);
+ } else {
+ return [(WKWebView*)_engineWebView loadRequest:request];
+ }
+ } else { // can't load, print out error
+ NSString* errorHtml = [NSString stringWithFormat:
+ @"<!doctype html>"
+ @"<title>Error</title>"
+ @"<div style='font-size:2em'>"
+ @" <p>The WebView engine '%@' is unable to load the request: %@</p>"
+ @" <p>Most likely the cause of the error is that the loading of file urls is not supported in iOS %@.</p>"
+ @"</div>",
+ NSStringFromClass([self class]),
+ [request.URL description],
+ [[UIDevice currentDevice] systemVersion]
+ ];
+ return [self loadHTMLString:errorHtml baseURL:nil];
+ }
+}
+
+- (id)loadHTMLString:(NSString*)string baseURL:(NSURL*)baseURL
+{
+ return [(WKWebView*)_engineWebView loadHTMLString:string baseURL:baseURL];
+}
+
+- (NSURL*) URL
+{
+ return [(WKWebView*)_engineWebView URL];
+}
+
+- (BOOL) canLoadRequest:(NSURLRequest*)request
+{
+ // See: https://issues.apache.org/jira/browse/CB-9636
+ SEL wk_sel = NSSelectorFromString(CDV_WKWEBVIEW_FILE_URL_LOAD_SELECTOR);
+
+ // if it's a file URL, check whether WKWebView has the selector (which is in iOS 9 and up only)
+ if (request.URL.fileURL) {
+ return [_engineWebView respondsToSelector:wk_sel];
+ } else {
+ return YES;
+ }
+}
+
+- (void)updateSettings:(NSDictionary*)settings
+{
+ WKWebView* wkWebView = (WKWebView*)_engineWebView;
+
+ wkWebView.configuration.preferences.minimumFontSize = [settings cordovaFloatSettingForKey:@"MinimumFontSize" defaultValue:0.0];
+
+ /*
+ wkWebView.configuration.preferences.javaScriptEnabled = [settings cordovaBoolSettingForKey:@"JavaScriptEnabled" default:YES];
+ wkWebView.configuration.preferences.javaScriptCanOpenWindowsAutomatically = [settings cordovaBoolSettingForKey:@"JavaScriptCanOpenWindowsAutomatically" default:NO];
+ */
+
+ // By default, DisallowOverscroll is false (thus bounce is allowed)
+ BOOL bounceAllowed = !([settings cordovaBoolSettingForKey:@"DisallowOverscroll" defaultValue:NO]);
+
+ // prevent webView from bouncing
+ if (!bounceAllowed) {
+ if ([wkWebView respondsToSelector:@selector(scrollView)]) {
+ ((UIScrollView*)[wkWebView scrollView]).bounces = NO;
+ } else {
+ for (id subview in wkWebView.subviews) {
+ if ([[subview class] isSubclassOfClass:[UIScrollView class]]) {
+ ((UIScrollView*)subview).bounces = NO;
+ }
+ }
+ }
+ }
+
+ NSString* decelerationSetting = [settings cordovaSettingForKey:@"WKWebViewDecelerationSpeed"];
+ if (!decelerationSetting) {
+ // Fallback to the UIWebView-named preference
+ decelerationSetting = [settings cordovaSettingForKey:@"UIWebViewDecelerationSpeed"];
+ }
+
+ if (![@"fast" isEqualToString:decelerationSetting]) {
+ [wkWebView.scrollView setDecelerationRate:UIScrollViewDecelerationRateNormal];
+ } else {
+ [wkWebView.scrollView setDecelerationRate:UIScrollViewDecelerationRateFast];
+ }
+
+ wkWebView.allowsBackForwardNavigationGestures = [settings cordovaBoolSettingForKey:@"AllowBackForwardNavigationGestures" defaultValue:NO];
+ wkWebView.allowsLinkPreview = [settings cordovaBoolSettingForKey:@"Allow3DTouchLinkPreview" defaultValue:YES];
+}
+
+- (void)updateWithInfo:(NSDictionary*)info
+{
+ NSDictionary* scriptMessageHandlers = [info objectForKey:kCDVWebViewEngineScriptMessageHandlers];
+ NSDictionary* settings = [info objectForKey:kCDVWebViewEngineWebViewPreferences];
+ id navigationDelegate = [info objectForKey:kCDVWebViewEngineWKNavigationDelegate];
+ id uiDelegate = [info objectForKey:kCDVWebViewEngineWKUIDelegate];
+
+ WKWebView* wkWebView = (WKWebView*)_engineWebView;
+
+ if (scriptMessageHandlers && [scriptMessageHandlers isKindOfClass:[NSDictionary class]]) {
+ NSArray* allKeys = [scriptMessageHandlers allKeys];
+
+ for (NSString* key in allKeys) {
+ id object = [scriptMessageHandlers objectForKey:key];
+ if ([object conformsToProtocol:@protocol(WKScriptMessageHandler)]) {
+ [wkWebView.configuration.userContentController addScriptMessageHandler:object name:key];
+ }
+ }
+ }
+
+ if (navigationDelegate && [navigationDelegate conformsToProtocol:@protocol(WKNavigationDelegate)]) {
+ wkWebView.navigationDelegate = navigationDelegate;
+ }
+
+ if (uiDelegate && [uiDelegate conformsToProtocol:@protocol(WKUIDelegate)]) {
+ wkWebView.UIDelegate = uiDelegate;
+ }
+
+ if (settings && [settings isKindOfClass:[NSDictionary class]]) {
+ [self updateSettings:settings];
+ }
+}
+
+// This forwards the methods that are in the header that are not implemented here.
+// Both WKWebView and UIWebView implement the below:
+// loadHTMLString:baseURL:
+// loadRequest:
+- (id)forwardingTargetForSelector:(SEL)aSelector
+{
+ return _engineWebView;
+}
+
+- (UIView*)webView
+{
+ return self.engineWebView;
+}
+
+#pragma mark WKScriptMessageHandler implementation
+
+- (void)userContentController:(WKUserContentController*)userContentController didReceiveScriptMessage:(WKScriptMessage*)message
+{
+ if (![message.name isEqualToString:CDV_BRIDGE_NAME]) {
+ return;
+ }
+
+ CDVViewController* vc = (CDVViewController*)self.viewController;
+
+ NSArray* jsonEntry = message.body; // NSString:callbackId, NSString:service, NSString:action, NSArray:args
+ CDVInvokedUrlCommand* command = [CDVInvokedUrlCommand commandFromJson:jsonEntry];
+ CDV_EXEC_LOG(@"Exec(%@): Calling %@.%@", command.callbackId, command.className, command.methodName);
+
+ if (![vc.commandQueue execute:command]) {
+#ifdef DEBUG
+ NSError* error = nil;
+ NSString* commandJson = nil;
+ NSData* jsonData = [NSJSONSerialization dataWithJSONObject:jsonEntry
+ options:0
+ error:&error];
+
+ if (error == nil) {
+ commandJson = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
+ }
+
+ static NSUInteger maxLogLength = 1024;
+ NSString* commandString = ([commandJson length] > maxLogLength) ?
+ [NSString stringWithFormat : @"%@[...]", [commandJson substringToIndex:maxLogLength]] :
+ commandJson;
+
+ NSLog(@"FAILED pluginJSON = %@", commandString);
+#endif
+ }
+}
+
+#pragma mark WKNavigationDelegate implementation
+
+- (void)webView:(WKWebView*)webView didStartProvisionalNavigation:(WKNavigation*)navigation
+{
+ [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginResetNotification object:webView]];
+}
+
+- (void)webView:(WKWebView*)webView didFinishNavigation:(WKNavigation*)navigation
+{
+ CDVViewController* vc = (CDVViewController*)self.viewController;
+ [CDVUserAgentUtil releaseLock:vc.userAgentLockToken];
+
+ [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPageDidLoadNotification object:webView]];
+}
+
+- (void)webView:(WKWebView*)theWebView didFailProvisionalNavigation:(WKNavigation*)navigation withError:(NSError*)error
+{
+ [self webView:theWebView didFailNavigation:navigation withError:error];
+}
+
+- (void)webView:(WKWebView*)theWebView didFailNavigation:(WKNavigation*)navigation withError:(NSError*)error
+{
+ CDVViewController* vc = (CDVViewController*)self.viewController;
+ [CDVUserAgentUtil releaseLock:vc.userAgentLockToken];
+
+ NSString* message = [NSString stringWithFormat:@"Failed to load webpage with error: %@", [error localizedDescription]];
+ NSLog(@"%@", message);
+
+ NSURL* errorUrl = vc.errorURL;
+ if (errorUrl) {
+ errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [message stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]] relativeToURL:errorUrl];
+ NSLog(@"%@", [errorUrl absoluteString]);
+ [theWebView loadRequest:[NSURLRequest requestWithURL:errorUrl]];
+ }
+}
+
+- (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView
+{
+ [webView reload];
+}
+
+- (BOOL)defaultResourcePolicyForURL:(NSURL*)url
+{
+ // all file:// urls are allowed
+ if ([url isFileURL]) {
+ return YES;
+ }
+
+ return NO;
+}
+
+- (void) webView: (WKWebView *) webView decidePolicyForNavigationAction: (WKNavigationAction*) navigationAction decisionHandler: (void (^)(WKNavigationActionPolicy)) decisionHandler
+{
+ NSURL* url = [navigationAction.request URL];
+ CDVViewController* vc = (CDVViewController*)self.viewController;
+
+ /*
+ * Give plugins the chance to handle the url
+ */
+ BOOL anyPluginsResponded = NO;
+ BOOL shouldAllowRequest = NO;
+
+ for (NSString* pluginName in vc.pluginObjects) {
+ CDVPlugin* plugin = [vc.pluginObjects objectForKey:pluginName];
+ SEL selector = NSSelectorFromString(@"shouldOverrideLoadWithRequest:navigationType:");
+ if ([plugin respondsToSelector:selector]) {
+ anyPluginsResponded = YES;
+ // https://issues.apache.org/jira/browse/CB-12497
+ int navType = (int)navigationAction.navigationType;
+ if (WKNavigationTypeOther == navigationAction.navigationType) {
+ navType = (int)UIWebViewNavigationTypeOther;
+ }
+ shouldAllowRequest = (((BOOL (*)(id, SEL, id, int))objc_msgSend)(plugin, selector, navigationAction.request, navType));
+ if (!shouldAllowRequest) {
+ break;
+ }
+ }
+ }
+
+ if (anyPluginsResponded) {
+ return decisionHandler(shouldAllowRequest);
+ }
+
+ /*
+ * Handle all other types of urls (tel:, sms:), and requests to load a url in the main webview.
+ */
+ BOOL shouldAllowNavigation = [self defaultResourcePolicyForURL:url];
+ if (shouldAllowNavigation) {
+ return decisionHandler(YES);
+ } else {
+ [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]];
+ }
+
+ return decisionHandler(NO);
+}
+
+#pragma mark - Plugin interface
+
+- (void)allowsBackForwardNavigationGestures:(CDVInvokedUrlCommand*)command;
+{
+ id value = [command argumentAtIndex:0];
+ if (!([value isKindOfClass:[NSNumber class]])) {
+ value = [NSNumber numberWithBool:NO];
+ }
+
+ WKWebView* wkWebView = (WKWebView*)_engineWebView;
+ wkWebView.allowsBackForwardNavigationGestures = [value boolValue];
+}
+
+@end
+
+#pragma mark - CDVWKWeakScriptMessageHandler
+
+@implementation CDVWKWeakScriptMessageHandler
+
+- (instancetype)initWithScriptMessageHandler:(id<WKScriptMessageHandler>)scriptMessageHandler
+{
+ self = [super init];
+ if (self) {
+ _scriptMessageHandler = scriptMessageHandler;
+ }
+ return self;
+}
+
+- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message
+{
+ [self.scriptMessageHandler userContentController:userContentController didReceiveScriptMessage:message];
+}
+
+@end
--- /dev/null
+/*
+ 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 CDVWKWebViewUIDelegate : NSObject <WKUIDelegate>
+
+@property (nonatomic, copy) NSString* title;
+
+- (instancetype)initWithTitle:(NSString*)title;
+
+@end
--- /dev/null
+/*
+ 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 "CDVWKWebViewUIDelegate.h"
+
+@implementation CDVWKWebViewUIDelegate
+
+- (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];
+
+ UIViewController* rootController = [UIApplication sharedApplication].delegate.window.rootViewController;
+
+ [rootController presentViewController:alert animated:YES completion:nil];
+}
+
+- (void) webView:(WKWebView*)webView runJavaScriptConfirmPanelWithMessage:(NSString*)message
+ initiatedByFrame:(WKFrameInfo*)frame completionHandler:(void (^)(BOOL result))completionHandler
+{
+ UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title
+ message:message
+ preferredStyle:UIAlertControllerStyleAlert];
+
+ UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
+ style:UIAlertActionStyleDefault
+ handler:^(UIAlertAction* action)
+ {
+ completionHandler(YES);
+ [alert dismissViewControllerAnimated:YES completion:nil];
+ }];
+
+ [alert addAction:ok];
+
+ UIAlertAction* cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel")
+ style:UIAlertActionStyleDefault
+ handler:^(UIAlertAction* action)
+ {
+ completionHandler(NO);
+ [alert dismissViewControllerAnimated:YES completion:nil];
+ }];
+ [alert addAction:cancel];
+
+ UIViewController* rootController = [UIApplication sharedApplication].delegate.window.rootViewController;
+
+ [rootController presentViewController:alert animated:YES completion:nil];
+}
+
+- (void) webView:(WKWebView*)webView runJavaScriptTextInputPanelWithPrompt:(NSString*)prompt
+ defaultText:(NSString*)defaultText initiatedByFrame:(WKFrameInfo*)frame
+ completionHandler:(void (^)(NSString* result))completionHandler
+{
+ UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title
+ message:prompt
+ preferredStyle:UIAlertControllerStyleAlert];
+
+ UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
+ style:UIAlertActionStyleDefault
+ handler:^(UIAlertAction* action)
+ {
+ completionHandler(((UITextField*)alert.textFields[0]).text);
+ [alert dismissViewControllerAnimated:YES completion:nil];
+ }];
+
+ [alert addAction:ok];
+
+ UIAlertAction* cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel")
+ style:UIAlertActionStyleDefault
+ handler:^(UIAlertAction* action)
+ {
+ completionHandler(nil);
+ [alert dismissViewControllerAnimated:YES completion:nil];
+ }];
+ [alert addAction:cancel];
+
+ [alert addTextFieldWithConfigurationHandler:^(UITextField* textField) {
+ textField.text = defaultText;
+ }];
+
+ UIViewController* rootController = [UIApplication sharedApplication].delegate.window.rootViewController;
+
+ [rootController presentViewController:alert animated:YES completion:nil];
+}
+
+@end
<plist version="1.0">
<dict>
<key>Appkey</key>
- <string>your_jpush_appkey</string>
+ <string>d644d997f2cab0551ff704a3</string>
<key>Channel</key>
<string>channel name</string>
<key>IsProduction</key>
<?xml version='1.0' encoding='utf-8'?>
-<widget id="com.supwisdom.dlapp" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
+<widget id="com.dalicitycard.app" version="1.0.4" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<feature name="LocalStorage">
<param name="ios-package" value="CDVLocalStorage" />
</feature>
<feature name="JPushPlugin">
<param name="ios-package" value="JPushPlugin" />
</feature>
+ <feature name="AppVersion">
+ <param name="ios-package" value="AppVersion" />
+ </feature>
+ <feature name="CDVWKWebViewEngine">
+ <param name="ios-package" value="CDVWKWebViewEngine" />
+ </feature>
<name short="大理市民卡">dlapp</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
<edit-config file="*-Info.plist" mode="merge" target="NSCameraUsageDescription">
<string>APP需要使用您的相机权限,没有该权限将无法完成扫一扫功能</string>
</edit-config>
+ <edit-config file="*-Info.plist" mode="merge" target="NSPhotoLibraryUsageDescription">
+ <string>APP需要使用您的相册权限,没有该权限将无法完成扫一扫功能</string>
+ </edit-config>
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
<preference name="AllowInlineMediaPlayback" value="false" />
<preference name="Orientation" value="portrait" />
<preference name="UseSwiftLanguageVersion" value="4.0" />
<preference name="UIWebViewBounce" value="false" />
+ <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
</widget>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>1.0.0</string>
+ <string>1.0.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>1.0.0</string>
+ <string>1.0.4</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<string/>
<key>NSMainNibFile~ipad</key>
<string/>
+ <key>UIBackgroundModes</key>
+ <array>
+ <string>remote-notification</string>
+ </array>
<key>UIInterfaceOrientation</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
- <key>UIBackgroundModes</key>
- <array>
- <string>remote-notification</string>
- </array>
+ <key>NSPhotoLibraryUsageDescription</key>
+ <string>APP需要使用您的相册权限,没有该权限将无法完成扫一扫功能</string>
</dict>
</plist>
\ No newline at end of file
"libz.tbd": 1,
"AdSupport.framework": 1,
"UserNotifications.framework": 1,
- "libresolv.tbd": 1
+ "libresolv.tbd": 1,
+ "WebKit.framework": 1
}
\ No newline at end of file
{
"xml": "<feature name=\"JPushPlugin\"><param name=\"ios-package\" value=\"JPushPlugin\" /></feature>",
"count": 1
+ },
+ {
+ "xml": "<feature name=\"AppVersion\"><param name=\"ios-package\" value=\"AppVersion\" /></feature>",
+ "count": 1
+ },
+ {
+ "xml": "<feature name=\"CDVWKWebViewEngine\"><param name=\"ios-package\" value=\"CDVWKWebViewEngine\" /></feature>",
+ "count": 1
+ },
+ {
+ "xml": "<preference name=\"CordovaWebViewEngine\" value=\"CDVWKWebViewEngine\" />",
+ "count": 1
}
]
}
"xml": "<array><string>remote-notification</string></array>",
"count": 1
}
+ ],
+ "NSPhotoLibraryUsageDescription": [
+ {
+ "xml": "<string>APP需要使用您的相册权限,没有该权限将无法完成扫一扫功能</string>",
+ "count": 1,
+ "mode": "merge",
+ "id": "config.xml"
+ }
]
}
},
"parents": {
"Appkey": [
{
- "xml": "<string>your_jpush_appkey</string>",
+ "xml": "<string>d644d997f2cab0551ff704a3</string>",
"count": 1
}
]
"PACKAGE_NAME": "$(PRODUCT_BUNDLE_IDENTIFIER)"
},
"jpush-phonegap-plugin": {
- "APP_KEY": "your_jpush_appkey",
+ "APP_KEY": "d644d997f2cab0551ff704a3",
"CHANNEL": "developer-default",
"PACKAGE_NAME": "$(PRODUCT_BUNDLE_IDENTIFIER)"
+ },
+ "cordova-plugin-app-version": {
+ "PACKAGE_NAME": "$(PRODUCT_BUNDLE_IDENTIFIER)"
+ },
+ "cordova-plugin-wkwebview-engine": {
+ "PACKAGE_NAME": "$(PRODUCT_BUNDLE_IDENTIFIER)"
}
},
"dependent_plugins": {},
"clobbers": [
"JPush"
]
+ },
+ {
+ "id": "cordova-plugin-app-version.AppVersionPlugin",
+ "file": "plugins/cordova-plugin-app-version/www/AppVersionPlugin.js",
+ "pluginId": "cordova-plugin-app-version",
+ "clobbers": [
+ "cordova.getAppVersion"
+ ]
+ },
+ {
+ "id": "cordova-plugin-wkwebview-engine.ios-wkwebview-exec",
+ "file": "plugins/cordova-plugin-wkwebview-engine/src/www/ios/ios-wkwebview-exec.js",
+ "pluginId": "cordova-plugin-wkwebview-engine",
+ "clobbers": [
+ "cordova.exec"
+ ]
+ },
+ {
+ "id": "cordova-plugin-wkwebview-engine.ios-wkwebview",
+ "file": "plugins/cordova-plugin-wkwebview-engine/src/www/ios/ios-wkwebview.js",
+ "pluginId": "cordova-plugin-wkwebview-engine",
+ "clobbers": [
+ "window.WkWebView"
+ ]
}
],
"plugin_metadata": {
"cordova-plugin-device": "2.0.2",
"cordova-plugin-themeablebrowser": "0.2.17",
"cordova-plugin-jcore": "1.3.0",
- "jpush-phonegap-plugin": "3.7.2"
+ "jpush-phonegap-plugin": "3.7.2",
+ "cordova-plugin-app-version": "0.1.9",
+ "cordova-plugin-wkwebview-engine": "1.2.1"
}
}
"clobbers": [
"JPush"
]
+ },
+ {
+ "id": "cordova-plugin-app-version.AppVersionPlugin",
+ "file": "plugins/cordova-plugin-app-version/www/AppVersionPlugin.js",
+ "pluginId": "cordova-plugin-app-version",
+ "clobbers": [
+ "cordova.getAppVersion"
+ ]
+ },
+ {
+ "id": "cordova-plugin-wkwebview-engine.ios-wkwebview-exec",
+ "file": "plugins/cordova-plugin-wkwebview-engine/src/www/ios/ios-wkwebview-exec.js",
+ "pluginId": "cordova-plugin-wkwebview-engine",
+ "clobbers": [
+ "cordova.exec"
+ ]
+ },
+ {
+ "id": "cordova-plugin-wkwebview-engine.ios-wkwebview",
+ "file": "plugins/cordova-plugin-wkwebview-engine/src/www/ios/ios-wkwebview.js",
+ "pluginId": "cordova-plugin-wkwebview-engine",
+ "clobbers": [
+ "window.WkWebView"
+ ]
}
];
module.exports.metadata = {
"cordova-plugin-device": "2.0.2",
"cordova-plugin-themeablebrowser": "0.2.17",
"cordova-plugin-jcore": "1.3.0",
- "jpush-phonegap-plugin": "3.7.2"
+ "jpush-phonegap-plugin": "3.7.2",
+ "cordova-plugin-app-version": "0.1.9",
+ "cordova-plugin-wkwebview-engine": "1.2.1"
};
});
\ No newline at end of file
--- /dev/null
+cordova.define("cordova-plugin-app-version.AppVersionPlugin", function(require, exports, module) {
+/*jslint indent: 2 */
+/*global window, jQuery, angular, cordova */
+"use strict";
+
+// Returns a jQuery or AngularJS deferred object, or pass a success and fail callbacks if you don't want to use jQuery or AngularJS
+var getPromisedCordovaExec = function (command, success, fail) {
+ var toReturn, deferred, injector, $q;
+ if (success === undefined) {
+ if (window.jQuery) {
+ deferred = jQuery.Deferred();
+ success = deferred.resolve;
+ fail = deferred.reject;
+ toReturn = deferred;
+ } else if (window.angular) {
+ injector = angular.injector(["ng"]);
+ $q = injector.get("$q");
+ deferred = $q.defer();
+ success = deferred.resolve;
+ fail = deferred.reject;
+ toReturn = deferred.promise;
+ } else if (window.when && window.when.promise) {
+ deferred = when.defer();
+ success = deferred.resolve;
+ fail = deferred.reject;
+ toReturn = deferred.promise;
+ } else if (window.Promise) {
+ toReturn = new Promise(function(c, e) {
+ success = c;
+ fail = e;
+ });
+ } else if (window.WinJS && window.WinJS.Promise) {
+ toReturn = new WinJS.Promise(function(c, e) {
+ success = c;
+ fail = e;
+ });
+ } else {
+ return console.error('AppVersion either needs a success callback, or jQuery/AngularJS/Promise/WinJS.Promise defined for using promises');
+ }
+ }
+ // 5th param is NOT optional. must be at least empty array
+ cordova.exec(success, fail, "AppVersion", command, []);
+ return toReturn;
+};
+
+var getAppVersion = function (success, fail) {
+ return getPromisedCordovaExec('getVersionNumber', success, fail);
+};
+
+getAppVersion.getAppName = function (success, fail) {
+ return getPromisedCordovaExec('getAppName', success, fail);
+};
+
+getAppVersion.getPackageName = function (success, fail) {
+ return getPromisedCordovaExec('getPackageName', success, fail);
+};
+
+getAppVersion.getVersionNumber = function (success, fail) {
+ return getPromisedCordovaExec('getVersionNumber', success, fail);
+};
+
+getAppVersion.getVersionCode = function (success, fail) {
+ return getPromisedCordovaExec('getVersionCode', success, fail);
+};
+
+module.exports = getAppVersion;
+
+});
--- /dev/null
+cordova.define("cordova-plugin-wkwebview-engine.ios-wkwebview-exec", function(require, exports, module) {
+/*
+ *
+ * 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.
+ *
+*/
+
+/**
+ * Creates the exec bridge used to notify the native code of
+ * commands.
+ */
+var cordova = require('cordova');
+var utils = require('cordova/utils');
+var base64 = require('cordova/base64');
+
+function massageArgsJsToNative (args) {
+ if (!args || utils.typeName(args) !== 'Array') {
+ return args;
+ }
+ var ret = [];
+ args.forEach(function (arg, i) {
+ if (utils.typeName(arg) === 'ArrayBuffer') {
+ ret.push({
+ 'CDVType': 'ArrayBuffer',
+ 'data': base64.fromArrayBuffer(arg)
+ });
+ } else {
+ ret.push(arg);
+ }
+ });
+ return ret;
+}
+
+function massageMessageNativeToJs (message) {
+ if (message.CDVType === 'ArrayBuffer') {
+ var stringToArrayBuffer = function (str) {
+ var ret = new Uint8Array(str.length);
+ for (var i = 0; i < str.length; i++) {
+ ret[i] = str.charCodeAt(i);
+ }
+ return ret.buffer;
+ };
+ var base64ToArrayBuffer = function (b64) {
+ return stringToArrayBuffer(atob(b64)); // eslint-disable-line no-undef
+ };
+ message = base64ToArrayBuffer(message.data);
+ }
+ return message;
+}
+
+function convertMessageToArgsNativeToJs (message) {
+ var args = [];
+ if (!message || !message.hasOwnProperty('CDVType')) {
+ args.push(message);
+ } else if (message.CDVType === 'MultiPart') {
+ message.messages.forEach(function (e) {
+ args.push(massageMessageNativeToJs(e));
+ });
+ } else {
+ args.push(massageMessageNativeToJs(message));
+ }
+ return args;
+}
+
+var iOSExec = function () {
+ // detect change in bridge, if there is a change, we forward to new bridge
+
+ // if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.cordova && window.webkit.messageHandlers.cordova.postMessage) {
+ // bridgeMode = jsToNativeModes.WK_WEBVIEW_BINDING;
+ // }
+
+ var successCallback, failCallback, service, action, actionArgs;
+ var callbackId = null;
+ if (typeof arguments[0] !== 'string') {
+ // FORMAT ONE
+ successCallback = arguments[0];
+ failCallback = arguments[1];
+ service = arguments[2];
+ action = arguments[3];
+ actionArgs = arguments[4];
+
+ // Since we need to maintain backwards compatibility, we have to pass
+ // an invalid callbackId even if no callback was provided since plugins
+ // will be expecting it. The Cordova.exec() implementation allocates
+ // an invalid callbackId and passes it even if no callbacks were given.
+ callbackId = 'INVALID';
+ } else {
+ throw new Error('The old format of this exec call has been removed (deprecated since 2.1). Change to: ' + // eslint-disable-line
+ 'cordova.exec(null, null, \'Service\', \'action\', [ arg1, arg2 ]);');
+ }
+
+ // If actionArgs is not provided, default to an empty array
+ actionArgs = actionArgs || [];
+
+ // Register the callbacks and add the callbackId to the positional
+ // arguments if given.
+ if (successCallback || failCallback) {
+ callbackId = service + cordova.callbackId++;
+ cordova.callbacks[callbackId] =
+ {success: successCallback, fail: failCallback};
+ }
+
+ actionArgs = massageArgsJsToNative(actionArgs);
+
+ // CB-10133 DataClone DOM Exception 25 guard (fast function remover)
+ var command = [callbackId, service, action, JSON.parse(JSON.stringify(actionArgs))];
+ window.webkit.messageHandlers.cordova.postMessage(command);
+};
+
+iOSExec.nativeCallback = function (callbackId, status, message, keepCallback, debug) {
+ var success = status === 0 || status === 1;
+ var args = convertMessageToArgsNativeToJs(message);
+ Promise.resolve().then(function () {
+ cordova.callbackFromNative(callbackId, success, status, args, keepCallback); // eslint-disable-line
+ });
+};
+
+// for backwards compatibility
+iOSExec.nativeEvalAndFetch = function (func) {
+ try {
+ func();
+ } catch (e) {
+ console.log(e);
+ }
+};
+
+// Proxy the exec for bridge changes. See CB-10106
+
+function cordovaExec () {
+ var cexec = require('cordova/exec');
+ var cexec_valid = (typeof cexec.nativeFetchMessages === 'function') && (typeof cexec.nativeEvalAndFetch === 'function') && (typeof cexec.nativeCallback === 'function');
+ return (cexec_valid && execProxy !== cexec) ? cexec : iOSExec;
+}
+
+function execProxy () {
+ cordovaExec().apply(null, arguments);
+}
+
+execProxy.nativeFetchMessages = function () {
+ return cordovaExec().nativeFetchMessages.apply(null, arguments);
+};
+
+execProxy.nativeEvalAndFetch = function () {
+ return cordovaExec().nativeEvalAndFetch.apply(null, arguments);
+};
+
+execProxy.nativeCallback = function () {
+ return cordovaExec().nativeCallback.apply(null, arguments);
+};
+
+module.exports = execProxy;
+
+if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.cordova && window.webkit.messageHandlers.cordova.postMessage) {
+ // unregister the old bridge
+ cordova.define.remove('cordova/exec');
+ // redefine bridge to our new bridge
+ cordova.define('cordova/exec', function (require, exports, module) {
+ module.exports = execProxy;
+ });
+}
+
+});
--- /dev/null
+cordova.define("cordova-plugin-wkwebview-engine.ios-wkwebview", function(require, exports, module) {
+/*
+ *
+ * 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.
+ *
+*/
+
+var exec = require('cordova/exec');
+
+var WkWebKit = {
+ allowsBackForwardNavigationGestures: function (allow) {
+ exec(null, null, 'CDVWKWebViewEngine', 'allowsBackForwardNavigationGestures', [allow]);
+ }
+};
+
+module.exports = WkWebKit;
+
+});
"PACKAGE_NAME": "com.supwisdom.dlapp"
},
"jpush-phonegap-plugin": {
- "APP_KEY": "your_jpush_appkey",
+ "APP_KEY": "d644d997f2cab0551ff704a3",
"CHANNEL": "developer-default",
"PACKAGE_NAME": "com.supwisdom.dlapp"
+ },
+ "cordova-plugin-app-version": {
+ "PACKAGE_NAME": "com.supwisdom.dlapp"
+ },
+ "cordova-plugin-wkwebview-engine": {
+ "PACKAGE_NAME": "com.dalicitycard.app"
}
},
"dependent_plugins": {
"APP_KEY": "your_jpush_appkey",
"CHANNEL": "developer-default",
"PACKAGE_NAME": "com.supwisdom.dlapp"
+ },
+ "cordova-plugin-app-version": {
+ "PACKAGE_NAME": "com.supwisdom.dlapp"
+ },
+ "cordova-plugin-wkwebview-engine": {
+ "PACKAGE_NAME": "com.supwisdom.dlapp"
}
},
"dependent_plugins": {
--- /dev/null
+Copyright (c) 2013 White October
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--- /dev/null
+{
+ "_from": "cordova-plugin-app-version",
+ "_id": "cordova-plugin-app-version@0.1.9",
+ "_inBundle": false,
+ "_integrity": "sha1-nbBgeGMzenEEiTAuX1CpBPFEm9s=",
+ "_location": "/cordova-plugin-app-version",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "tag",
+ "registry": true,
+ "raw": "cordova-plugin-app-version",
+ "name": "cordova-plugin-app-version",
+ "escapedName": "cordova-plugin-app-version",
+ "rawSpec": "",
+ "saveSpec": null,
+ "fetchSpec": "latest"
+ },
+ "_requiredBy": [
+ "#USER",
+ "/"
+ ],
+ "_resolved": "https://registry.npmjs.org/cordova-plugin-app-version/-/cordova-plugin-app-version-0.1.9.tgz",
+ "_shasum": "9db0607863337a710489302e5f50a904f1449bdb",
+ "_spec": "cordova-plugin-app-version",
+ "_where": "/Users/shuwei/works2/cordova/dlapp",
+ "author": {
+ "name": "whiteoctober"
+ },
+ "bugs": {
+ "url": "https://github.com/whiteoctober/cordova-plugin-app-version/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "Cordova plugin to return the version number of the current app",
+ "homepage": "https://github.com/whiteoctober/cordova-plugin-app-version#readme",
+ "keywords": [
+ "cordova",
+ "ecosystem:cordova",
+ "app",
+ "version",
+ "appversion",
+ "plugin"
+ ],
+ "license": "MIT",
+ "name": "cordova-plugin-app-version",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/whiteoctober/cordova-plugin-app-version.git"
+ },
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "version": "0.1.9"
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ id="cordova-plugin-app-version"
+ version="0.1.9">
+
+ <name>AppVersion</name>
+ <description>
+ This plugin will return the version of your App that you have set in
+ packaging it. I.e. it will always match the version in the app store.
+ </description>
+ <license>MIT</license>
+
+ <engines>
+ <!--
+ Cordova 2.8.0 is all I have tested on - it should work fine with earlier versions.
+ Please modify the below line, test, and submit a PR if it works for you.
+ -->
+ <engine name="cordova" version=">=3.0.0" />
+ </engines>
+
+ <js-module src="www/AppVersionPlugin.js">
+ <clobbers target="cordova.getAppVersion" />
+ </js-module>
+
+ <!-- android -->
+ <platform name="android">
+ <config-file target="res/xml/config.xml" parent="/*">
+ <feature name="AppVersion">
+ <param name="android-package" value="uk.co.whiteoctober.cordova.AppVersion"/>
+ </feature>
+ </config-file>
+ <source-file src="src/android/AppVersion.java" target-dir="src/uk/co/whiteoctober/cordova" />
+ </platform>
+
+ <!-- blackberry10 -->
+ <platform name="blackberry10">
+ <dependency id="cordova-plugin-bb-app" />
+
+ <config-file target="www/config.xml" parent="/widget">
+ <feature name="AppVersion" value="AppVersion" />
+ </config-file>
+ <js-module src="www/blackberry10/AppVersionProxy.js" name="AppVersionProxy.js" >
+ <runs />
+ </js-module>
+ </platform>
+
+ <!-- ios -->
+ <platform name="ios">
+ <plugins-plist key="AppVersion" string="AppVersion" />
+
+ <config-file target="config.xml" parent="/*">
+ <feature name="AppVersion">
+ <param name="ios-package" value="AppVersion" />
+ </feature>
+ </config-file>
+
+ <header-file src="src/ios/AppVersion.h" />
+ <source-file src="src/ios/AppVersion.m" />
+ </platform>
+
+ <!-- windows8 -->
+ <platform name="windows">
+ <js-module src="src/windows/AppVersionProxy.js" name="AppVersionProxy">
+ <merges target=""/>
+ </js-module>
+ </platform>
+
+ <!-- wp8 -->
+ <platform name="wp8">
+ <config-file target="config.xml" parent="/*">
+ <feature name="AppVersion">
+ <param name="wp-package" value="AppVersion"/>
+ </feature>
+ </config-file>
+
+ <source-file src="src/wp8/AppVersion.cs" />
+ </platform>
+</plugin>
--- /dev/null
+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;
+ }
+ }
+
+}
--- /dev/null
+#import <Cordova/CDVPlugin.h>
+
+@interface AppVersion : CDVPlugin
+
+- (void)getAppName:(CDVInvokedUrlCommand*)command;
+
+- (void)getPackageName:(CDVInvokedUrlCommand*)command;
+
+- (void)getVersionNumber:(CDVInvokedUrlCommand*)command;
+
+- (void)getVersionCode:(CDVInvokedUrlCommand*)command;
+
+@end
--- /dev/null
+#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
--- /dev/null
+AppVersionProxy = {
+ getVersionNumber: function (successCallback, failCallback, args) {
+ var version = Windows.ApplicationModel.Package.current.id.version;
+ successCallback([version.major, version.minor, version.build, version.revision].join('.'));
+ },
+ getAppName: function (successCallback, failCallback, args) {
+ if(Windows.ApplicationModel.Package.current && Windows.ApplicationModel.Package.current.displayName){
+ var name = Windows.ApplicationModel.Package.current.displayName;
+ successCallback(name);
+ } else {
+ Windows.ApplicationModel.Package.current.installedLocation.getFileAsync("AppxManifest.xml").then(function (file) {
+ Windows.Data.Xml.Dom.XmlDocument.loadFromFileAsync(file).then(function (xdoc) {
+ var displayName = xdoc.getElementsByTagName("DisplayName");
+ if (displayName && displayName.length === 1) {
+ var name = displayName[0].innerText;
+ successCallback(name);
+ } else {
+ (failCallback || function(){})({ code: -1, message: "ERR_DISPLAY_NAME_NOT_FOUND" });
+ }
+ }, (failCallback || function(){}));
+ }, (failCallback || function(){}));
+ }
+ },
+ getPackageName: function (successCallback, failCallback, args) {
+ var name = Windows.ApplicationModel.Package.current.id.name;
+ successCallback(name);
+ },
+ getVersionCode: function (successCallback, failCallback, args) {
+ var build = Windows.ApplicationModel.Package.current.id.version.build;
+ successCallback(build);
+ }
+};
+cordova.commandProxy.add("AppVersion", AppVersionProxy);
--- /dev/null
+using System;
+using System.Reflection;
+using System.Xml.Linq;
+using Windows.ApplicationModel;
+using WPCordovaClassLib.Cordova;
+using WPCordovaClassLib.Cordova.Commands;
+
+namespace Cordova.Extension.Commands
+{
+ public class AppVersion : BaseCommand
+ {
+ public void getVersionNumber(string empty)
+ {
+ string version;
+ if (Environment.OSVersion.Version.Major <= 8)
+ {
+ // Package.Current.Id is NOT working in Windows Phone 8
+ // Workaround based on http://stackoverflow.com/questions/14371275/how-can-i-get-my-windows-store-apps-title-and-version-info
+ version = XDocument.Load("WMAppManifest.xml").Root.Element("App").Attribute("Version").Value;
+ }
+ else
+ {
+ version = Package.Current.Id.Version.ToString();
+ }
+
+ this.DispatchCommandResult(new PluginResult(PluginResult.Status.OK, version));
+ }
+
+ public void getAppName(string empty)
+ {
+ string name;
+ if (Environment.OSVersion.Version.Major <= 8)
+ {
+ //Windows.ApplicationModel.Package.Current.Id is NOT working in Windows Phone 8
+ //Workaround based on http://stackoverflow.com/questions/14371275/how-can-i-get-my-windows-store-apps-title-and-version-info
+ name = XDocument.Load("WMAppManifest.xml").Root.Element("App").Attribute("Title").Value;
+ }
+ else
+ {
+ name = Package.Current.Id.Name;
+ }
+
+ this.DispatchCommandResult(new PluginResult(PluginResult.Status.OK, name));
+ }
+
+ public void getPackageName(string empty)
+ {
+ string package = Assembly.GetExecutingAssembly().GetName().Name;
+
+ this.DispatchCommandResult(new PluginResult(PluginResult.Status.OK, package));
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+/*jslint indent: 2 */
+/*global window, jQuery, angular, cordova */
+"use strict";
+
+// Returns a jQuery or AngularJS deferred object, or pass a success and fail callbacks if you don't want to use jQuery or AngularJS
+var getPromisedCordovaExec = function (command, success, fail) {
+ var toReturn, deferred, injector, $q;
+ if (success === undefined) {
+ if (window.jQuery) {
+ deferred = jQuery.Deferred();
+ success = deferred.resolve;
+ fail = deferred.reject;
+ toReturn = deferred;
+ } else if (window.angular) {
+ injector = angular.injector(["ng"]);
+ $q = injector.get("$q");
+ deferred = $q.defer();
+ success = deferred.resolve;
+ fail = deferred.reject;
+ toReturn = deferred.promise;
+ } else if (window.when && window.when.promise) {
+ deferred = when.defer();
+ success = deferred.resolve;
+ fail = deferred.reject;
+ toReturn = deferred.promise;
+ } else if (window.Promise) {
+ toReturn = new Promise(function(c, e) {
+ success = c;
+ fail = e;
+ });
+ } else if (window.WinJS && window.WinJS.Promise) {
+ toReturn = new WinJS.Promise(function(c, e) {
+ success = c;
+ fail = e;
+ });
+ } else {
+ return console.error('AppVersion either needs a success callback, or jQuery/AngularJS/Promise/WinJS.Promise defined for using promises');
+ }
+ }
+ // 5th param is NOT optional. must be at least empty array
+ cordova.exec(success, fail, "AppVersion", command, []);
+ return toReturn;
+};
+
+var getAppVersion = function (success, fail) {
+ return getPromisedCordovaExec('getVersionNumber', success, fail);
+};
+
+getAppVersion.getAppName = function (success, fail) {
+ return getPromisedCordovaExec('getAppName', success, fail);
+};
+
+getAppVersion.getPackageName = function (success, fail) {
+ return getPromisedCordovaExec('getPackageName', success, fail);
+};
+
+getAppVersion.getVersionNumber = function (success, fail) {
+ return getPromisedCordovaExec('getVersionNumber', success, fail);
+};
+
+getAppVersion.getVersionCode = function (success, fail) {
+ return getPromisedCordovaExec('getVersionCode', success, fail);
+};
+
+module.exports = getAppVersion;
--- /dev/null
+module.exports = {\r
+ getVersionNumber: function( success, fail ) {\r
+ if( !blackberry || !blackberry.app || !blackberry.app.version ) {\r
+ if( fail ) {\r
+ return fail();\r
+ } else {\r
+ return "";\r
+ }\r
+ }\r
+\r
+ if( success ) {\r
+ return success( blackberry.app.version );\r
+ }\r
+ return blackberry.app.version;\r
+ }\r
+};\r
+\r
+require("cordova/exec/proxy").add("AppVersion", module.exports);\r
--- /dev/null
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
\ No newline at end of file
--- /dev/null
+Apache Cordova
+Copyright 2015 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
--- /dev/null
+{
+ "_from": "cordova-plugin-wkwebview-engine",
+ "_id": "cordova-plugin-wkwebview-engine@1.2.1",
+ "_inBundle": false,
+ "_integrity": "sha512-usp6pu+tJ1y0btVAXOjE5+tMjbvTY6hsiLfHJPMdyzkgHvxoNSePZ/NavTGj4CBJJlUjnMsN3TUq25+SeTZCow==",
+ "_location": "/cordova-plugin-wkwebview-engine",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "tag",
+ "registry": true,
+ "raw": "cordova-plugin-wkwebview-engine",
+ "name": "cordova-plugin-wkwebview-engine",
+ "escapedName": "cordova-plugin-wkwebview-engine",
+ "rawSpec": "",
+ "saveSpec": null,
+ "fetchSpec": "latest"
+ },
+ "_requiredBy": [
+ "#USER",
+ "/"
+ ],
+ "_resolved": "https://registry.npmjs.org/cordova-plugin-wkwebview-engine/-/cordova-plugin-wkwebview-engine-1.2.1.tgz",
+ "_shasum": "f8972282969355d2d2f3458b23f604210e45eaf3",
+ "_spec": "cordova-plugin-wkwebview-engine",
+ "_where": "/Users/shuwei/works2/cordova/dlapp",
+ "author": {
+ "name": "Apache Software Foundation"
+ },
+ "bugs": {
+ "url": "https://github.com/apache/cordova-plugin-wkwebview-engine/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "The official Apache Cordova WKWebView Engine Plugin",
+ "devDependencies": {
+ "eslint": "^3.19.0",
+ "eslint-config-semistandard": "^11.0.0",
+ "eslint-config-standard": "^10.2.1",
+ "eslint-plugin-import": "^2.3.0",
+ "eslint-plugin-node": "^5.0.0",
+ "eslint-plugin-promise": "^3.5.0",
+ "eslint-plugin-standard": "^3.0.1"
+ },
+ "engines": {
+ "cordovaDependencies": {
+ "2.0.0": {
+ "cordova": ">100"
+ }
+ }
+ },
+ "homepage": "https://github.com/apache/cordova-plugin-wkwebview-engine#readme",
+ "keywords": [
+ "cordova",
+ "wkwebview",
+ "cordova-ios",
+ "ecosystem:cordova"
+ ],
+ "license": "Apache-2.0",
+ "main": "index.js",
+ "name": "cordova-plugin-wkwebview-engine",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/apache/cordova-plugin-wkwebview-engine.git"
+ },
+ "scripts": {
+ "eslint": "eslint src",
+ "objc-tests": "cd tests/ios && npm test",
+ "preobjc-tests": "cd tests/ios && npm install",
+ "test": "npm run eslint && npm run objc-tests"
+ },
+ "version": "1.2.1"
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ 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.
+-->
+
+<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ id="cordova-plugin-wkwebview-engine"
+ version="1.2.1">
+ <name>Cordova WKWebView Engine</name>
+ <description>Cordova WKWebView Engine Plugin</description>
+ <license>Apache 2.0</license>
+ <keywords>cordova,wkwebview,webview</keywords>
+ <repo>https://github.com/apache/cordova-plugin-wkwebview-engine</repo>
+
+ <engines>
+ <engine name="cordova-ios" version=">=4.0.0-dev" />
+ <engine name="apple-ios" version=">=9.0" />
+ </engines>
+
+ <!-- ios -->
+ <platform name="ios">
+ <js-module src="src/www/ios/ios-wkwebview-exec.js" name="ios-wkwebview-exec">
+ <clobbers target="cordova.exec" />
+ </js-module>
+
+ <js-module src="src/www/ios/ios-wkwebview.js" name="ios-wkwebview">
+ <clobbers target="window.WkWebView" />
+ </js-module>
+
+ <config-file target="config.xml" parent="/*">
+ <feature name="CDVWKWebViewEngine">
+ <param name="ios-package" value="CDVWKWebViewEngine" />
+ </feature>
+ <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
+ </config-file>
+
+ <framework src="WebKit.framework" weak="true" />
+
+ <header-file src="src/ios/CDVWKWebViewEngine.h" />
+ <source-file src="src/ios/CDVWKWebViewEngine.m" />
+ <header-file src="src/ios/CDVWKWebViewUIDelegate.h" />
+ <source-file src="src/ios/CDVWKWebViewUIDelegate.m" />
+ <header-file src="src/ios/CDVWKProcessPoolFactory.h" />
+ <source-file src="src/ios/CDVWKProcessPoolFactory.m" />
+ </platform>
+</plugin>
--- /dev/null
+/*
+ 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 CDVWKProcessPoolFactory : NSObject
+@property (nonatomic, retain) WKProcessPool* sharedPool;
+
++(instancetype) sharedFactory;
+-(WKProcessPool*) sharedProcessPool;
+@end
--- /dev/null
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <Foundation/Foundation.h>
+#import <WebKit/WebKit.h>
+#import "CDVWKProcessPoolFactory.h"
+
+static CDVWKProcessPoolFactory *factory = nil;
+
+@implementation CDVWKProcessPoolFactory
+
++ (instancetype)sharedFactory
+{
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ factory = [[CDVWKProcessPoolFactory alloc] init];
+ });
+
+ return factory;
+}
+
+- (instancetype)init
+{
+ if (self = [super init]) {
+ _sharedPool = [[WKProcessPool alloc] init];
+ }
+ return self;
+}
+
+- (WKProcessPool*) sharedProcessPool {
+ return _sharedPool;
+}
+@end
--- /dev/null
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <WebKit/WebKit.h>
+#import <Cordova/CDV.h>
+
+@interface CDVWKWebViewEngine : CDVPlugin <CDVWebViewEngineProtocol, WKScriptMessageHandler, WKNavigationDelegate>
+
+@property (nonatomic, strong, readonly) id <WKUIDelegate> uiDelegate;
+
+- (void)allowsBackForwardNavigationGestures:(CDVInvokedUrlCommand*)command;
+
+@end
--- /dev/null
+/*
+ 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 "CDVWKWebViewEngine.h"
+#import "CDVWKWebViewUIDelegate.h"
+#import "CDVWKProcessPoolFactory.h"
+#import <Cordova/NSDictionary+CordovaPreferences.h>
+
+#import <objc/message.h>
+
+#define CDV_BRIDGE_NAME @"cordova"
+#define CDV_WKWEBVIEW_FILE_URL_LOAD_SELECTOR @"loadFileURL:allowingReadAccessToURL:"
+
+@interface CDVWKWeakScriptMessageHandler : NSObject <WKScriptMessageHandler>
+
+@property (nonatomic, weak, readonly) id<WKScriptMessageHandler>scriptMessageHandler;
+
+- (instancetype)initWithScriptMessageHandler:(id<WKScriptMessageHandler>)scriptMessageHandler;
+
+@end
+
+
+@interface CDVWKWebViewEngine ()
+
+@property (nonatomic, strong, readwrite) UIView* engineWebView;
+@property (nonatomic, strong, readwrite) id <WKUIDelegate> uiDelegate;
+@property (nonatomic, weak) id <WKScriptMessageHandler> weakScriptMessageHandler;
+
+@end
+
+// see forwardingTargetForSelector: selector comment for the reason for this pragma
+#pragma clang diagnostic ignored "-Wprotocol"
+
+@implementation CDVWKWebViewEngine
+
+@synthesize engineWebView = _engineWebView;
+
+- (instancetype)initWithFrame:(CGRect)frame
+{
+ self = [super init];
+ if (self) {
+ if (NSClassFromString(@"WKWebView") == nil) {
+ return nil;
+ }
+
+ self.engineWebView = [[WKWebView alloc] initWithFrame:frame];
+ }
+
+ return self;
+}
+
+- (WKWebViewConfiguration*) createConfigurationFromSettings:(NSDictionary*)settings
+{
+ WKWebViewConfiguration* configuration = [[WKWebViewConfiguration alloc] init];
+ configuration.processPool = [[CDVWKProcessPoolFactory sharedFactory] sharedProcessPool];
+ if (settings == nil) {
+ return configuration;
+ }
+
+ configuration.allowsInlineMediaPlayback = [settings cordovaBoolSettingForKey:@"AllowInlineMediaPlayback" defaultValue:NO];
+ configuration.mediaPlaybackRequiresUserAction = [settings cordovaBoolSettingForKey:@"MediaPlaybackRequiresUserAction" defaultValue:YES];
+ configuration.suppressesIncrementalRendering = [settings cordovaBoolSettingForKey:@"SuppressesIncrementalRendering" defaultValue:NO];
+ configuration.mediaPlaybackAllowsAirPlay = [settings cordovaBoolSettingForKey:@"MediaPlaybackAllowsAirPlay" defaultValue:YES];
+ return configuration;
+}
+
+- (void)pluginInitialize
+{
+ // viewController would be available now. we attempt to set all possible delegates to it, by default
+ NSDictionary* settings = self.commandDelegate.settings;
+
+ self.uiDelegate = [[CDVWKWebViewUIDelegate alloc] initWithTitle:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]];
+
+ CDVWKWeakScriptMessageHandler *weakScriptMessageHandler = [[CDVWKWeakScriptMessageHandler alloc] initWithScriptMessageHandler:self];
+
+ WKUserContentController* userContentController = [[WKUserContentController alloc] init];
+ [userContentController addScriptMessageHandler:weakScriptMessageHandler name:CDV_BRIDGE_NAME];
+
+ WKWebViewConfiguration* configuration = [self createConfigurationFromSettings:settings];
+ configuration.userContentController = userContentController;
+
+ // re-create WKWebView, since we need to update configuration
+ WKWebView* wkWebView = [[WKWebView alloc] initWithFrame:self.engineWebView.frame configuration:configuration];
+ wkWebView.UIDelegate = self.uiDelegate;
+ self.engineWebView = wkWebView;
+
+ if (IsAtLeastiOSVersion(@"9.0") && [self.viewController isKindOfClass:[CDVViewController class]]) {
+ wkWebView.customUserAgent = ((CDVViewController*) self.viewController).userAgent;
+ }
+
+ if ([self.viewController conformsToProtocol:@protocol(WKUIDelegate)]) {
+ wkWebView.UIDelegate = (id <WKUIDelegate>)self.viewController;
+ }
+
+ if ([self.viewController conformsToProtocol:@protocol(WKNavigationDelegate)]) {
+ wkWebView.navigationDelegate = (id <WKNavigationDelegate>)self.viewController;
+ } else {
+ wkWebView.navigationDelegate = (id <WKNavigationDelegate>)self;
+ }
+
+ if ([self.viewController conformsToProtocol:@protocol(WKScriptMessageHandler)]) {
+ [wkWebView.configuration.userContentController addScriptMessageHandler:(id < WKScriptMessageHandler >)self.viewController name:CDV_BRIDGE_NAME];
+ }
+
+ [self updateSettings:settings];
+
+ // check if content thread has died on resume
+ NSLog(@"%@", @"CDVWKWebViewEngine will reload WKWebView if required on resume");
+ [[NSNotificationCenter defaultCenter]
+ addObserver:self
+ selector:@selector(onAppWillEnterForeground:)
+ name:UIApplicationWillEnterForegroundNotification object:nil];
+
+ NSLog(@"Using WKWebView");
+
+ [self addURLObserver];
+}
+
+- (void)onReset {
+ [self addURLObserver];
+}
+
+static void * KVOContext = &KVOContext;
+
+- (void)addURLObserver {
+ if(!IsAtLeastiOSVersion(@"9.0")){
+ [self.webView addObserver:self forKeyPath:@"URL" options:0 context:KVOContext];
+ }
+}
+
+- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSString *,id> *)change context:(void *)context
+{
+ if (context == KVOContext) {
+ if (object == [self webView] && [keyPath isEqualToString: @"URL"] && [object valueForKeyPath:keyPath] == nil){
+ NSLog(@"URL is nil. Reloading WKWebView");
+ [(WKWebView*)_engineWebView reload];
+ }
+ } else {
+ [super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
+ }
+}
+
+- (void) onAppWillEnterForeground:(NSNotification*)notification {
+ if ([self shouldReloadWebView]) {
+ NSLog(@"%@", @"CDVWKWebViewEngine reloading!");
+ [(WKWebView*)_engineWebView reload];
+ }
+}
+
+- (BOOL)shouldReloadWebView
+{
+ WKWebView* wkWebView = (WKWebView*)_engineWebView;
+ return [self shouldReloadWebView:wkWebView.URL title:wkWebView.title];
+}
+
+- (BOOL)shouldReloadWebView:(NSURL*)location title:(NSString*)title
+{
+ BOOL title_is_nil = (title == nil);
+ BOOL location_is_blank = [[location absoluteString] isEqualToString:@"about:blank"];
+
+ BOOL reload = (title_is_nil || location_is_blank);
+
+#ifdef DEBUG
+ NSLog(@"%@", @"CDVWKWebViewEngine shouldReloadWebView::");
+ NSLog(@"CDVWKWebViewEngine shouldReloadWebView title: %@", title);
+ NSLog(@"CDVWKWebViewEngine shouldReloadWebView location: %@", [location absoluteString]);
+ NSLog(@"CDVWKWebViewEngine shouldReloadWebView reload: %u", reload);
+#endif
+
+ return reload;
+}
+
+
+- (id)loadRequest:(NSURLRequest*)request
+{
+ if ([self canLoadRequest:request]) { // can load, differentiate between file urls and other schemes
+ if (request.URL.fileURL) {
+ SEL wk_sel = NSSelectorFromString(CDV_WKWEBVIEW_FILE_URL_LOAD_SELECTOR);
+ NSURL* readAccessUrl = [request.URL URLByDeletingLastPathComponent];
+ return ((id (*)(id, SEL, id, id))objc_msgSend)(_engineWebView, wk_sel, request.URL, readAccessUrl);
+ } else {
+ return [(WKWebView*)_engineWebView loadRequest:request];
+ }
+ } else { // can't load, print out error
+ NSString* errorHtml = [NSString stringWithFormat:
+ @"<!doctype html>"
+ @"<title>Error</title>"
+ @"<div style='font-size:2em'>"
+ @" <p>The WebView engine '%@' is unable to load the request: %@</p>"
+ @" <p>Most likely the cause of the error is that the loading of file urls is not supported in iOS %@.</p>"
+ @"</div>",
+ NSStringFromClass([self class]),
+ [request.URL description],
+ [[UIDevice currentDevice] systemVersion]
+ ];
+ return [self loadHTMLString:errorHtml baseURL:nil];
+ }
+}
+
+- (id)loadHTMLString:(NSString*)string baseURL:(NSURL*)baseURL
+{
+ return [(WKWebView*)_engineWebView loadHTMLString:string baseURL:baseURL];
+}
+
+- (NSURL*) URL
+{
+ return [(WKWebView*)_engineWebView URL];
+}
+
+- (BOOL) canLoadRequest:(NSURLRequest*)request
+{
+ // See: https://issues.apache.org/jira/browse/CB-9636
+ SEL wk_sel = NSSelectorFromString(CDV_WKWEBVIEW_FILE_URL_LOAD_SELECTOR);
+
+ // if it's a file URL, check whether WKWebView has the selector (which is in iOS 9 and up only)
+ if (request.URL.fileURL) {
+ return [_engineWebView respondsToSelector:wk_sel];
+ } else {
+ return YES;
+ }
+}
+
+- (void)updateSettings:(NSDictionary*)settings
+{
+ WKWebView* wkWebView = (WKWebView*)_engineWebView;
+
+ wkWebView.configuration.preferences.minimumFontSize = [settings cordovaFloatSettingForKey:@"MinimumFontSize" defaultValue:0.0];
+
+ /*
+ wkWebView.configuration.preferences.javaScriptEnabled = [settings cordovaBoolSettingForKey:@"JavaScriptEnabled" default:YES];
+ wkWebView.configuration.preferences.javaScriptCanOpenWindowsAutomatically = [settings cordovaBoolSettingForKey:@"JavaScriptCanOpenWindowsAutomatically" default:NO];
+ */
+
+ // By default, DisallowOverscroll is false (thus bounce is allowed)
+ BOOL bounceAllowed = !([settings cordovaBoolSettingForKey:@"DisallowOverscroll" defaultValue:NO]);
+
+ // prevent webView from bouncing
+ if (!bounceAllowed) {
+ if ([wkWebView respondsToSelector:@selector(scrollView)]) {
+ ((UIScrollView*)[wkWebView scrollView]).bounces = NO;
+ } else {
+ for (id subview in wkWebView.subviews) {
+ if ([[subview class] isSubclassOfClass:[UIScrollView class]]) {
+ ((UIScrollView*)subview).bounces = NO;
+ }
+ }
+ }
+ }
+
+ NSString* decelerationSetting = [settings cordovaSettingForKey:@"WKWebViewDecelerationSpeed"];
+ if (!decelerationSetting) {
+ // Fallback to the UIWebView-named preference
+ decelerationSetting = [settings cordovaSettingForKey:@"UIWebViewDecelerationSpeed"];
+ }
+
+ if (![@"fast" isEqualToString:decelerationSetting]) {
+ [wkWebView.scrollView setDecelerationRate:UIScrollViewDecelerationRateNormal];
+ } else {
+ [wkWebView.scrollView setDecelerationRate:UIScrollViewDecelerationRateFast];
+ }
+
+ wkWebView.allowsBackForwardNavigationGestures = [settings cordovaBoolSettingForKey:@"AllowBackForwardNavigationGestures" defaultValue:NO];
+ wkWebView.allowsLinkPreview = [settings cordovaBoolSettingForKey:@"Allow3DTouchLinkPreview" defaultValue:YES];
+}
+
+- (void)updateWithInfo:(NSDictionary*)info
+{
+ NSDictionary* scriptMessageHandlers = [info objectForKey:kCDVWebViewEngineScriptMessageHandlers];
+ NSDictionary* settings = [info objectForKey:kCDVWebViewEngineWebViewPreferences];
+ id navigationDelegate = [info objectForKey:kCDVWebViewEngineWKNavigationDelegate];
+ id uiDelegate = [info objectForKey:kCDVWebViewEngineWKUIDelegate];
+
+ WKWebView* wkWebView = (WKWebView*)_engineWebView;
+
+ if (scriptMessageHandlers && [scriptMessageHandlers isKindOfClass:[NSDictionary class]]) {
+ NSArray* allKeys = [scriptMessageHandlers allKeys];
+
+ for (NSString* key in allKeys) {
+ id object = [scriptMessageHandlers objectForKey:key];
+ if ([object conformsToProtocol:@protocol(WKScriptMessageHandler)]) {
+ [wkWebView.configuration.userContentController addScriptMessageHandler:object name:key];
+ }
+ }
+ }
+
+ if (navigationDelegate && [navigationDelegate conformsToProtocol:@protocol(WKNavigationDelegate)]) {
+ wkWebView.navigationDelegate = navigationDelegate;
+ }
+
+ if (uiDelegate && [uiDelegate conformsToProtocol:@protocol(WKUIDelegate)]) {
+ wkWebView.UIDelegate = uiDelegate;
+ }
+
+ if (settings && [settings isKindOfClass:[NSDictionary class]]) {
+ [self updateSettings:settings];
+ }
+}
+
+// This forwards the methods that are in the header that are not implemented here.
+// Both WKWebView and UIWebView implement the below:
+// loadHTMLString:baseURL:
+// loadRequest:
+- (id)forwardingTargetForSelector:(SEL)aSelector
+{
+ return _engineWebView;
+}
+
+- (UIView*)webView
+{
+ return self.engineWebView;
+}
+
+#pragma mark WKScriptMessageHandler implementation
+
+- (void)userContentController:(WKUserContentController*)userContentController didReceiveScriptMessage:(WKScriptMessage*)message
+{
+ if (![message.name isEqualToString:CDV_BRIDGE_NAME]) {
+ return;
+ }
+
+ CDVViewController* vc = (CDVViewController*)self.viewController;
+
+ NSArray* jsonEntry = message.body; // NSString:callbackId, NSString:service, NSString:action, NSArray:args
+ CDVInvokedUrlCommand* command = [CDVInvokedUrlCommand commandFromJson:jsonEntry];
+ CDV_EXEC_LOG(@"Exec(%@): Calling %@.%@", command.callbackId, command.className, command.methodName);
+
+ if (![vc.commandQueue execute:command]) {
+#ifdef DEBUG
+ NSError* error = nil;
+ NSString* commandJson = nil;
+ NSData* jsonData = [NSJSONSerialization dataWithJSONObject:jsonEntry
+ options:0
+ error:&error];
+
+ if (error == nil) {
+ commandJson = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
+ }
+
+ static NSUInteger maxLogLength = 1024;
+ NSString* commandString = ([commandJson length] > maxLogLength) ?
+ [NSString stringWithFormat : @"%@[...]", [commandJson substringToIndex:maxLogLength]] :
+ commandJson;
+
+ NSLog(@"FAILED pluginJSON = %@", commandString);
+#endif
+ }
+}
+
+#pragma mark WKNavigationDelegate implementation
+
+- (void)webView:(WKWebView*)webView didStartProvisionalNavigation:(WKNavigation*)navigation
+{
+ [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginResetNotification object:webView]];
+}
+
+- (void)webView:(WKWebView*)webView didFinishNavigation:(WKNavigation*)navigation
+{
+ CDVViewController* vc = (CDVViewController*)self.viewController;
+ [CDVUserAgentUtil releaseLock:vc.userAgentLockToken];
+
+ [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPageDidLoadNotification object:webView]];
+}
+
+- (void)webView:(WKWebView*)theWebView didFailProvisionalNavigation:(WKNavigation*)navigation withError:(NSError*)error
+{
+ [self webView:theWebView didFailNavigation:navigation withError:error];
+}
+
+- (void)webView:(WKWebView*)theWebView didFailNavigation:(WKNavigation*)navigation withError:(NSError*)error
+{
+ CDVViewController* vc = (CDVViewController*)self.viewController;
+ [CDVUserAgentUtil releaseLock:vc.userAgentLockToken];
+
+ NSString* message = [NSString stringWithFormat:@"Failed to load webpage with error: %@", [error localizedDescription]];
+ NSLog(@"%@", message);
+
+ NSURL* errorUrl = vc.errorURL;
+ if (errorUrl) {
+ errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [message stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]] relativeToURL:errorUrl];
+ NSLog(@"%@", [errorUrl absoluteString]);
+ [theWebView loadRequest:[NSURLRequest requestWithURL:errorUrl]];
+ }
+}
+
+- (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView
+{
+ [webView reload];
+}
+
+- (BOOL)defaultResourcePolicyForURL:(NSURL*)url
+{
+ // all file:// urls are allowed
+ if ([url isFileURL]) {
+ return YES;
+ }
+
+ return NO;
+}
+
+- (void) webView: (WKWebView *) webView decidePolicyForNavigationAction: (WKNavigationAction*) navigationAction decisionHandler: (void (^)(WKNavigationActionPolicy)) decisionHandler
+{
+ NSURL* url = [navigationAction.request URL];
+ CDVViewController* vc = (CDVViewController*)self.viewController;
+
+ /*
+ * Give plugins the chance to handle the url
+ */
+ BOOL anyPluginsResponded = NO;
+ BOOL shouldAllowRequest = NO;
+
+ for (NSString* pluginName in vc.pluginObjects) {
+ CDVPlugin* plugin = [vc.pluginObjects objectForKey:pluginName];
+ SEL selector = NSSelectorFromString(@"shouldOverrideLoadWithRequest:navigationType:");
+ if ([plugin respondsToSelector:selector]) {
+ anyPluginsResponded = YES;
+ // https://issues.apache.org/jira/browse/CB-12497
+ int navType = (int)navigationAction.navigationType;
+ if (WKNavigationTypeOther == navigationAction.navigationType) {
+ navType = (int)UIWebViewNavigationTypeOther;
+ }
+ shouldAllowRequest = (((BOOL (*)(id, SEL, id, int))objc_msgSend)(plugin, selector, navigationAction.request, navType));
+ if (!shouldAllowRequest) {
+ break;
+ }
+ }
+ }
+
+ if (anyPluginsResponded) {
+ return decisionHandler(shouldAllowRequest);
+ }
+
+ /*
+ * Handle all other types of urls (tel:, sms:), and requests to load a url in the main webview.
+ */
+ BOOL shouldAllowNavigation = [self defaultResourcePolicyForURL:url];
+ if (shouldAllowNavigation) {
+ return decisionHandler(YES);
+ } else {
+ [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]];
+ }
+
+ return decisionHandler(NO);
+}
+
+#pragma mark - Plugin interface
+
+- (void)allowsBackForwardNavigationGestures:(CDVInvokedUrlCommand*)command;
+{
+ id value = [command argumentAtIndex:0];
+ if (!([value isKindOfClass:[NSNumber class]])) {
+ value = [NSNumber numberWithBool:NO];
+ }
+
+ WKWebView* wkWebView = (WKWebView*)_engineWebView;
+ wkWebView.allowsBackForwardNavigationGestures = [value boolValue];
+}
+
+@end
+
+#pragma mark - CDVWKWeakScriptMessageHandler
+
+@implementation CDVWKWeakScriptMessageHandler
+
+- (instancetype)initWithScriptMessageHandler:(id<WKScriptMessageHandler>)scriptMessageHandler
+{
+ self = [super init];
+ if (self) {
+ _scriptMessageHandler = scriptMessageHandler;
+ }
+ return self;
+}
+
+- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message
+{
+ [self.scriptMessageHandler userContentController:userContentController didReceiveScriptMessage:message];
+}
+
+@end
--- /dev/null
+/*
+ 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 CDVWKWebViewUIDelegate : NSObject <WKUIDelegate>
+
+@property (nonatomic, copy) NSString* title;
+
+- (instancetype)initWithTitle:(NSString*)title;
+
+@end
--- /dev/null
+/*
+ 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 "CDVWKWebViewUIDelegate.h"
+
+@implementation CDVWKWebViewUIDelegate
+
+- (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];
+
+ UIViewController* rootController = [UIApplication sharedApplication].delegate.window.rootViewController;
+
+ [rootController presentViewController:alert animated:YES completion:nil];
+}
+
+- (void) webView:(WKWebView*)webView runJavaScriptConfirmPanelWithMessage:(NSString*)message
+ initiatedByFrame:(WKFrameInfo*)frame completionHandler:(void (^)(BOOL result))completionHandler
+{
+ UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title
+ message:message
+ preferredStyle:UIAlertControllerStyleAlert];
+
+ UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
+ style:UIAlertActionStyleDefault
+ handler:^(UIAlertAction* action)
+ {
+ completionHandler(YES);
+ [alert dismissViewControllerAnimated:YES completion:nil];
+ }];
+
+ [alert addAction:ok];
+
+ UIAlertAction* cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel")
+ style:UIAlertActionStyleDefault
+ handler:^(UIAlertAction* action)
+ {
+ completionHandler(NO);
+ [alert dismissViewControllerAnimated:YES completion:nil];
+ }];
+ [alert addAction:cancel];
+
+ UIViewController* rootController = [UIApplication sharedApplication].delegate.window.rootViewController;
+
+ [rootController presentViewController:alert animated:YES completion:nil];
+}
+
+- (void) webView:(WKWebView*)webView runJavaScriptTextInputPanelWithPrompt:(NSString*)prompt
+ defaultText:(NSString*)defaultText initiatedByFrame:(WKFrameInfo*)frame
+ completionHandler:(void (^)(NSString* result))completionHandler
+{
+ UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title
+ message:prompt
+ preferredStyle:UIAlertControllerStyleAlert];
+
+ UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
+ style:UIAlertActionStyleDefault
+ handler:^(UIAlertAction* action)
+ {
+ completionHandler(((UITextField*)alert.textFields[0]).text);
+ [alert dismissViewControllerAnimated:YES completion:nil];
+ }];
+
+ [alert addAction:ok];
+
+ UIAlertAction* cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel")
+ style:UIAlertActionStyleDefault
+ handler:^(UIAlertAction* action)
+ {
+ completionHandler(nil);
+ [alert dismissViewControllerAnimated:YES completion:nil];
+ }];
+ [alert addAction:cancel];
+
+ [alert addTextFieldWithConfigurationHandler:^(UITextField* textField) {
+ textField.text = defaultText;
+ }];
+
+ UIViewController* rootController = [UIApplication sharedApplication].delegate.window.rootViewController;
+
+ [rootController presentViewController:alert animated:YES completion:nil];
+}
+
+@end
--- /dev/null
+/*
+ *
+ * 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.
+ *
+*/
+
+/**
+ * Creates the exec bridge used to notify the native code of
+ * commands.
+ */
+var cordova = require('cordova');
+var utils = require('cordova/utils');
+var base64 = require('cordova/base64');
+
+function massageArgsJsToNative (args) {
+ if (!args || utils.typeName(args) !== 'Array') {
+ return args;
+ }
+ var ret = [];
+ args.forEach(function (arg, i) {
+ if (utils.typeName(arg) === 'ArrayBuffer') {
+ ret.push({
+ 'CDVType': 'ArrayBuffer',
+ 'data': base64.fromArrayBuffer(arg)
+ });
+ } else {
+ ret.push(arg);
+ }
+ });
+ return ret;
+}
+
+function massageMessageNativeToJs (message) {
+ if (message.CDVType === 'ArrayBuffer') {
+ var stringToArrayBuffer = function (str) {
+ var ret = new Uint8Array(str.length);
+ for (var i = 0; i < str.length; i++) {
+ ret[i] = str.charCodeAt(i);
+ }
+ return ret.buffer;
+ };
+ var base64ToArrayBuffer = function (b64) {
+ return stringToArrayBuffer(atob(b64)); // eslint-disable-line no-undef
+ };
+ message = base64ToArrayBuffer(message.data);
+ }
+ return message;
+}
+
+function convertMessageToArgsNativeToJs (message) {
+ var args = [];
+ if (!message || !message.hasOwnProperty('CDVType')) {
+ args.push(message);
+ } else if (message.CDVType === 'MultiPart') {
+ message.messages.forEach(function (e) {
+ args.push(massageMessageNativeToJs(e));
+ });
+ } else {
+ args.push(massageMessageNativeToJs(message));
+ }
+ return args;
+}
+
+var iOSExec = function () {
+ // detect change in bridge, if there is a change, we forward to new bridge
+
+ // if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.cordova && window.webkit.messageHandlers.cordova.postMessage) {
+ // bridgeMode = jsToNativeModes.WK_WEBVIEW_BINDING;
+ // }
+
+ var successCallback, failCallback, service, action, actionArgs;
+ var callbackId = null;
+ if (typeof arguments[0] !== 'string') {
+ // FORMAT ONE
+ successCallback = arguments[0];
+ failCallback = arguments[1];
+ service = arguments[2];
+ action = arguments[3];
+ actionArgs = arguments[4];
+
+ // Since we need to maintain backwards compatibility, we have to pass
+ // an invalid callbackId even if no callback was provided since plugins
+ // will be expecting it. The Cordova.exec() implementation allocates
+ // an invalid callbackId and passes it even if no callbacks were given.
+ callbackId = 'INVALID';
+ } else {
+ throw new Error('The old format of this exec call has been removed (deprecated since 2.1). Change to: ' + // eslint-disable-line
+ 'cordova.exec(null, null, \'Service\', \'action\', [ arg1, arg2 ]);');
+ }
+
+ // If actionArgs is not provided, default to an empty array
+ actionArgs = actionArgs || [];
+
+ // Register the callbacks and add the callbackId to the positional
+ // arguments if given.
+ if (successCallback || failCallback) {
+ callbackId = service + cordova.callbackId++;
+ cordova.callbacks[callbackId] =
+ {success: successCallback, fail: failCallback};
+ }
+
+ actionArgs = massageArgsJsToNative(actionArgs);
+
+ // CB-10133 DataClone DOM Exception 25 guard (fast function remover)
+ var command = [callbackId, service, action, JSON.parse(JSON.stringify(actionArgs))];
+ window.webkit.messageHandlers.cordova.postMessage(command);
+};
+
+iOSExec.nativeCallback = function (callbackId, status, message, keepCallback, debug) {
+ var success = status === 0 || status === 1;
+ var args = convertMessageToArgsNativeToJs(message);
+ Promise.resolve().then(function () {
+ cordova.callbackFromNative(callbackId, success, status, args, keepCallback); // eslint-disable-line
+ });
+};
+
+// for backwards compatibility
+iOSExec.nativeEvalAndFetch = function (func) {
+ try {
+ func();
+ } catch (e) {
+ console.log(e);
+ }
+};
+
+// Proxy the exec for bridge changes. See CB-10106
+
+function cordovaExec () {
+ var cexec = require('cordova/exec');
+ var cexec_valid = (typeof cexec.nativeFetchMessages === 'function') && (typeof cexec.nativeEvalAndFetch === 'function') && (typeof cexec.nativeCallback === 'function');
+ return (cexec_valid && execProxy !== cexec) ? cexec : iOSExec;
+}
+
+function execProxy () {
+ cordovaExec().apply(null, arguments);
+}
+
+execProxy.nativeFetchMessages = function () {
+ return cordovaExec().nativeFetchMessages.apply(null, arguments);
+};
+
+execProxy.nativeEvalAndFetch = function () {
+ return cordovaExec().nativeEvalAndFetch.apply(null, arguments);
+};
+
+execProxy.nativeCallback = function () {
+ return cordovaExec().nativeCallback.apply(null, arguments);
+};
+
+module.exports = execProxy;
+
+if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.cordova && window.webkit.messageHandlers.cordova.postMessage) {
+ // unregister the old bridge
+ cordova.define.remove('cordova/exec');
+ // redefine bridge to our new bridge
+ cordova.define('cordova/exec', function (require, exports, module) {
+ module.exports = execProxy;
+ });
+}
--- /dev/null
+/*
+ *
+ * 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.
+ *
+*/
+
+var exec = require('cordova/exec');
+
+var WkWebKit = {
+ allowsBackForwardNavigationGestures: function (allow) {
+ exec(null, null, 'CDVWKWebViewEngine', 'allowsBackForwardNavigationGestures', [allow]);
+ }
+};
+
+module.exports = WkWebKit;
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+ version = "1.0">
+ <FileRef
+ location = "container:CDVWKWebViewEngineTest/CDVWKWebViewEngineTest.xcodeproj">
+ </FileRef>
+</Workspace>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>IDESourceControlProjectFavoriteDictionaryKey</key>
+ <false/>
+ <key>IDESourceControlProjectIdentifier</key>
+ <string>6BE9AD73-1B9F-4362-98D7-DC631BEC6185</string>
+ <key>IDESourceControlProjectName</key>
+ <string>CDVWKWebViewEngineTest</string>
+ <key>IDESourceControlProjectOriginsDictionary</key>
+ <dict>
+ <key>BEF5A5D0FF64801E558286389440357A9233D7DB</key>
+ <string>https://git-wip-us.apache.org/repos/asf/cordova-plugin-wkwebview-engine.git</string>
+ </dict>
+ <key>IDESourceControlProjectPath</key>
+ <string>tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineTest.xcodeproj</string>
+ <key>IDESourceControlProjectRelativeInstallPathDictionary</key>
+ <dict>
+ <key>BEF5A5D0FF64801E558286389440357A9233D7DB</key>
+ <string>../../../../..</string>
+ </dict>
+ <key>IDESourceControlProjectURL</key>
+ <string>https://git-wip-us.apache.org/repos/asf/cordova-plugin-wkwebview-engine.git</string>
+ <key>IDESourceControlProjectVersion</key>
+ <integer>111</integer>
+ <key>IDESourceControlProjectWCCIdentifier</key>
+ <string>BEF5A5D0FF64801E558286389440357A9233D7DB</string>
+ <key>IDESourceControlProjectWCConfigurations</key>
+ <array>
+ <dict>
+ <key>IDESourceControlRepositoryExtensionIdentifierKey</key>
+ <string>public.vcs.git</string>
+ <key>IDESourceControlWCCIdentifierKey</key>
+ <string>BEF5A5D0FF64801E558286389440357A9233D7DB</string>
+ <key>IDESourceControlWCCName</key>
+ <string>cordova-plugin-wkwebview-engine</string>
+ </dict>
+ </array>
+</dict>
+</plist>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0830"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "D2AAC07D0554694100DB518D"
+ BuildableName = "libCordova.a"
+ BlueprintName = "CordovaLib"
+ ReferencedContainer = "container:node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES">
+ <Testables>
+ </Testables>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </TestAction>
+ <LaunchAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
+ allowLocationSimulation = "YES">
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "D2AAC07D0554694100DB518D"
+ BuildableName = "libCordova.a"
+ BlueprintName = "CordovaLib"
+ ReferencedContainer = "container:node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ buildConfiguration = "Release"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ debugDocumentVersioning = "YES">
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "D2AAC07D0554694100DB518D"
+ BuildableName = "libCordova.a"
+ BlueprintName = "CordovaLib"
+ ReferencedContainer = "container:node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
--- /dev/null
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <UIKit/UIKit.h>
+#import <XCTest/XCTest.h>
+#import "CDVWKWebViewEngine.h"
+#import "CDVWKProcessPoolFactory.h"
+#import <Cordova/NSDictionary+CordovaPreferences.h>
+#import <Cordova/CDVAvailability.h>
+
+@interface CDVWKWebViewEngineTest : XCTestCase
+
+@property (nonatomic, strong) CDVWKWebViewEngine* plugin;
+@property (nonatomic, strong) CDVViewController* viewController;
+
+@end
+
+@interface CDVWKWebViewEngine ()
+
+// TODO: expose private interface, if needed
+- (BOOL)shouldReloadWebView;
+- (BOOL)shouldReloadWebView:(NSURL*)location title:(NSString*)title;
+
+@end
+
+@interface CDVViewController ()
+
+// expose property as readwrite, for test purposes
+@property (nonatomic, readwrite, strong) NSMutableDictionary* settings;
+
+@end
+
+@implementation CDVWKWebViewEngineTest
+
+- (void)setUp {
+ [super setUp];
+ // Put setup code here. This method is called before the invocation of each test method in the class.
+
+ // NOTE: no app settings are set, so it will rely on default WKWebViewConfiguration settings
+ self.plugin = [[CDVWKWebViewEngine alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
+ self.viewController = [[CDVViewController alloc] init];
+ [self.viewController registerPlugin:self.plugin withClassName:NSStringFromClass([self.plugin class])];
+
+ XCTAssert([self.plugin conformsToProtocol:@protocol(CDVWebViewEngineProtocol)], @"Plugin does not conform to CDVWebViewEngineProtocol");
+}
+
+- (void)tearDown {
+ // Put teardown code here. This method is called after the invocation of each test method in the class.
+ [super tearDown];
+}
+
+- (void) testCanLoadRequest {
+ NSURLRequest* fileUrlRequest = [NSURLRequest requestWithURL:[NSURL fileURLWithPath:@"path/to/file.html"]];
+ NSURLRequest* httpUrlRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://apache.org"]];
+ NSURLRequest* miscUrlRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:@"foo://bar"]];
+ id<CDVWebViewEngineProtocol> webViewEngineProtocol = self.plugin;
+
+ SEL wk_sel = NSSelectorFromString(@"loadFileURL:allowingReadAccessToURL:");
+ if ([self.plugin.engineWebView respondsToSelector:wk_sel]) {
+ XCTAssertTrue([webViewEngineProtocol canLoadRequest:fileUrlRequest]);
+ } else {
+ XCTAssertFalse([webViewEngineProtocol canLoadRequest:fileUrlRequest]);
+ }
+
+ XCTAssertTrue([webViewEngineProtocol canLoadRequest:httpUrlRequest]);
+ XCTAssertTrue([webViewEngineProtocol canLoadRequest:miscUrlRequest]);
+}
+
+- (void) testUpdateInfo {
+ // Add -ObjC to Other Linker Flags to test project, to load Categories
+ // Update objc test template generator as well
+
+ id<CDVWebViewEngineProtocol> webViewEngineProtocol = self.plugin;
+ WKWebView* wkWebView = (WKWebView*)self.plugin.engineWebView;
+
+ // iOS >=10 defaults to NO, < 10 defaults to YES.
+ BOOL mediaPlaybackRequiresUserActionDefault = IsAtLeastiOSVersion(@"10.0")? NO : YES;
+
+ NSDictionary* preferences = @{
+ [@"MinimumFontSize" lowercaseString] : @1.1, // default is 0.0
+ [@"AllowInlineMediaPlayback" lowercaseString] : @YES, // default is NO
+ [@"MediaPlaybackRequiresUserAction" lowercaseString] : @(!mediaPlaybackRequiresUserActionDefault), // default is NO on iOS >= 10, YES for < 10
+ [@"SuppressesIncrementalRendering" lowercaseString] : @YES, // default is NO
+ [@"MediaPlaybackAllowsAirPlay" lowercaseString] : @NO, // default is YES
+ [@"DisallowOverscroll" lowercaseString] : @YES, // so bounces is to be NO. defaults to NO
+ [@"WKWebViewDecelerationSpeed" lowercaseString] : @"fast" // default is 'normal'
+ };
+ NSDictionary* info = @{
+ kCDVWebViewEngineWebViewPreferences : preferences
+ };
+ [webViewEngineProtocol updateWithInfo:info];
+
+ // the only preference we can set, we **can** change this during runtime
+ XCTAssertEqualWithAccuracy(wkWebView.configuration.preferences.minimumFontSize, 1.1, 0.0001);
+
+ // the WKWebViewConfiguration properties, we **cannot** change outside of initialization
+ if (IsAtLeastiOSVersion(@"10.0")) {
+ XCTAssertFalse(wkWebView.configuration.mediaPlaybackRequiresUserAction);
+ } else {
+ XCTAssertTrue(wkWebView.configuration.mediaPlaybackRequiresUserAction);
+ }
+ XCTAssertFalse(wkWebView.configuration.allowsInlineMediaPlayback);
+ XCTAssertFalse(wkWebView.configuration.suppressesIncrementalRendering);
+ XCTAssertTrue(wkWebView.configuration.mediaPlaybackAllowsAirPlay);
+
+ // in the test above, DisallowOverscroll is YES, so no bounce
+ if ([wkWebView respondsToSelector:@selector(scrollView)]) {
+ XCTAssertFalse(((UIScrollView*)[wkWebView scrollView]).bounces);
+ } else {
+ for (id subview in wkWebView.subviews) {
+ if ([[subview class] isSubclassOfClass:[UIScrollView class]]) {
+ XCTAssertFalse(((UIScrollView*)subview).bounces = NO);
+ }
+ }
+ }
+
+ XCTAssertTrue(wkWebView.scrollView.decelerationRate == UIScrollViewDecelerationRateFast);
+}
+
+- (void) testConfigurationFromSettings {
+ // we need to re-set the plugin from the "setup" to take in the app settings we need
+ self.plugin = [[CDVWKWebViewEngine alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
+ self.viewController = [[CDVViewController alloc] init];
+
+ // generate the app settings
+ // iOS >=10 defaults to NO, < 10 defaults to YES.
+ BOOL mediaPlaybackRequiresUserActionDefault = IsAtLeastiOSVersion(@"10.0")? NO : YES;
+
+ NSDictionary* settings = @{
+ [@"MinimumFontSize" lowercaseString] : @1.1, // default is 0.0
+ [@"AllowInlineMediaPlayback" lowercaseString] : @YES, // default is NO
+ [@"MediaPlaybackRequiresUserAction" lowercaseString] : @(!mediaPlaybackRequiresUserActionDefault), // default is NO on iOS >= 10, YES for < 10
+ [@"SuppressesIncrementalRendering" lowercaseString] : @YES, // default is NO
+ [@"MediaPlaybackAllowsAirPlay" lowercaseString] : @NO, // default is YES
+ [@"DisallowOverscroll" lowercaseString] : @YES, // so bounces is to be NO. defaults to NO
+ [@"WKWebViewDecelerationSpeed" lowercaseString] : @"fast" // default is 'normal'
+ };
+ // this can be set because of the Category at the top of the file
+ self.viewController.settings = [settings mutableCopy];
+
+ // app settings are read after you register the plugin
+ [self.viewController registerPlugin:self.plugin withClassName:NSStringFromClass([self.plugin class])];
+ XCTAssert([self.plugin conformsToProtocol:@protocol(CDVWebViewEngineProtocol)], @"Plugin does not conform to CDVWebViewEngineProtocol");
+
+ // after registering (thus plugin initialization), we can grab the webview configuration
+ WKWebView* wkWebView = (WKWebView*)self.plugin.engineWebView;
+
+ // the only preference we can set, we **can** change this during runtime
+ XCTAssertEqualWithAccuracy(wkWebView.configuration.preferences.minimumFontSize, 1.1, 0.0001);
+
+ // the WKWebViewConfiguration properties, we **cannot** change outside of initialization
+ if (IsAtLeastiOSVersion(@"10.0")) {
+ XCTAssertTrue(wkWebView.configuration.mediaPlaybackRequiresUserAction);
+ } else {
+ XCTAssertFalse(wkWebView.configuration.mediaPlaybackRequiresUserAction);
+ }
+ XCTAssertTrue(wkWebView.configuration.allowsInlineMediaPlayback);
+ XCTAssertTrue(wkWebView.configuration.suppressesIncrementalRendering);
+ // The test case below is in a separate test "testConfigurationWithMediaPlaybackAllowsAirPlay" (Apple bug)
+ // XCTAssertFalse(wkWebView.configuration.mediaPlaybackAllowsAirPlay);
+
+ // in the test above, DisallowOverscroll is YES, so no bounce
+ if ([wkWebView respondsToSelector:@selector(scrollView)]) {
+ XCTAssertFalse(((UIScrollView*)[wkWebView scrollView]).bounces);
+ } else {
+ for (id subview in wkWebView.subviews) {
+ if ([[subview class] isSubclassOfClass:[UIScrollView class]]) {
+ XCTAssertFalse(((UIScrollView*)subview).bounces = NO);
+ }
+ }
+ }
+
+ XCTAssertTrue(wkWebView.scrollView.decelerationRate == UIScrollViewDecelerationRateFast);
+}
+
+- (void) testShouldReloadWebView {
+ WKWebView* wkWebView = (WKWebView*)self.plugin.engineWebView;
+
+ NSURL* about_blank = [NSURL URLWithString:@"about:blank"];
+ NSURL* real_site = [NSURL URLWithString:@"https://cordova.apache.org"];
+ NSString* empty_title_document = @"<html><head><title></title></head></html>";
+
+ // about:blank should reload
+ [wkWebView loadRequest:[NSURLRequest requestWithURL:about_blank]];
+ XCTAssertTrue([self.plugin shouldReloadWebView]);
+
+ // a network location should *not* reload
+ [wkWebView loadRequest:[NSURLRequest requestWithURL:real_site]];
+ XCTAssertFalse([self.plugin shouldReloadWebView]);
+
+ // document with empty title should *not* reload
+ // baseURL:nil results in about:blank, so we use a dummy here
+ [wkWebView loadHTMLString:empty_title_document baseURL:[NSURL URLWithString:@"about:"]];
+ XCTAssertFalse([self.plugin shouldReloadWebView]);
+
+ // Anecdotal assertion that when the WKWebView process has died,
+ // the title is nil, should always reload
+ XCTAssertTrue([self.plugin shouldReloadWebView:about_blank title:nil]);
+ XCTAssertTrue([self.plugin shouldReloadWebView:real_site title:nil]);
+
+ // about:blank should always reload
+ XCTAssertTrue([self.plugin shouldReloadWebView:about_blank title:@"some title"]);
+
+ // non about:blank with a non-nil title should **not** reload
+ XCTAssertFalse([self.plugin shouldReloadWebView:real_site title:@""]);
+}
+
+- (void) testConfigurationWithMediaPlaybackAllowsAirPlay {
+ WKWebViewConfiguration* configuration = [WKWebViewConfiguration new];
+ configuration.allowsAirPlayForMediaPlayback = NO;
+
+ WKWebView* wkWebView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, 100, 100) configuration:configuration];
+
+ XCTAssertFalse(configuration.allowsAirPlayForMediaPlayback);
+ // Uh-oh, bug in WKWebView below. Tested on iOS 9, iOS 10 beta 3
+ XCTAssertFalse(wkWebView.configuration.allowsAirPlayForMediaPlayback);
+}
+
+- (void) testWKProcessPoolFactory {
+ WKProcessPool* shared = [[CDVWKProcessPoolFactory sharedFactory] sharedProcessPool];
+ XCTAssertTrue(shared != nil);
+}
+
+@end
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>$(EXECUTABLE_NAME)</string>
+ <key>CFBundleIdentifier</key>
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>$(PRODUCT_NAME)</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+</dict>
+</plist>
--- /dev/null
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 7E9F51AB19DA10AE00DA31AC /* CDVWKWebViewEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E9F51A919DA10AE00DA31AC /* CDVWKWebViewEngine.m */; };
+ 7E9F51B119DA114400DA31AC /* CDVWKWebViewEngineTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E9F51B019DA114400DA31AC /* CDVWKWebViewEngineTest.m */; };
+ 7E9F51B319DA116500DA31AC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E9F51B219DA116500DA31AC /* Foundation.framework */; };
+ 7E9F51B519DA127E00DA31AC /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E9F51B419DA127E00DA31AC /* UIKit.framework */; };
+ 7E9F51B919DA1B1600DA31AC /* libCDVWKWebViewEngineLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E9F519519DA102000DA31AC /* libCDVWKWebViewEngineLib.a */; };
+ 7E9F51BA19DA1B2000DA31AC /* libCordova.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E9F519019DA0F8300DA31AC /* libCordova.a */; };
+ 7EACDCE71D234E2A00494C9E /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7EACDCE61D234E2A00494C9E /* WebKit.framework */; };
+ 7EACDCEB1D234FB300494C9E /* CDVWKWebViewUIDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7EACDCEA1D234FB300494C9E /* CDVWKWebViewUIDelegate.m */; };
+ A9CC1CED1E0D42F50083E165 /* CDVWKProcessPoolFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = A9CC1CEC1E0D42F50083E165 /* CDVWKProcessPoolFactory.m */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ 3050280F1E2973F700CF9F12 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */;
+ proxyType = 1;
+ remoteGlobalIDString = D2AAC07D0554694100DB518D;
+ remoteInfo = CordovaLib;
+ };
+ 7E9F518F19DA0F8300DA31AC /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = 68A32D7114102E1C006B237C;
+ remoteInfo = CordovaLib;
+ };
+ 7E9F51AC19DA10DE00DA31AC /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 7E9F517219DA09CE00DA31AC /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 7E9F519419DA102000DA31AC;
+ remoteInfo = CDVWKWebViewEngineLib;
+ };
+ 7E9F51AE19DA10E100DA31AC /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */;
+ proxyType = 1;
+ remoteGlobalIDString = D2AAC07D0554694100DB518D;
+ remoteInfo = CordovaLib;
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 7E9F519319DA102000DA31AC /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "include/$(PRODUCT_NAME)";
+ dstSubfolderSpec = 16;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CordovaLib.xcodeproj; path = "../node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj"; sourceTree = "<group>"; };
+ 7E9F519519DA102000DA31AC /* libCDVWKWebViewEngineLib.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCDVWKWebViewEngineLib.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ 7E9F519F19DA102000DA31AC /* CDVWKWebViewEngineLibTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CDVWKWebViewEngineLibTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+ 7E9F51A219DA102000DA31AC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ 7E9F51A919DA10AE00DA31AC /* CDVWKWebViewEngine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVWKWebViewEngine.m; path = ../../../src/ios/CDVWKWebViewEngine.m; sourceTree = SOURCE_ROOT; };
+ 7E9F51AA19DA10AE00DA31AC /* CDVWKWebViewEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVWKWebViewEngine.h; path = ../../../src/ios/CDVWKWebViewEngine.h; sourceTree = SOURCE_ROOT; };
+ 7E9F51B019DA114400DA31AC /* CDVWKWebViewEngineTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVWKWebViewEngineTest.m; sourceTree = "<group>"; };
+ 7E9F51B219DA116500DA31AC /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; };
+ 7E9F51B419DA127E00DA31AC /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };
+ 7EACDCE61D234E2A00494C9E /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/Frameworks/WebKit.framework; sourceTree = DEVELOPER_DIR; };
+ 7EACDCE91D234FB300494C9E /* CDVWKWebViewUIDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVWKWebViewUIDelegate.h; path = ../../../src/ios/CDVWKWebViewUIDelegate.h; sourceTree = SOURCE_ROOT; };
+ 7EACDCEA1D234FB300494C9E /* CDVWKWebViewUIDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVWKWebViewUIDelegate.m; path = ../../../src/ios/CDVWKWebViewUIDelegate.m; sourceTree = SOURCE_ROOT; };
+ A9CC1CEB1E0D42F50083E165 /* CDVWKProcessPoolFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVWKProcessPoolFactory.h; path = ../../../src/ios/CDVWKProcessPoolFactory.h; sourceTree = SOURCE_ROOT; };
+ A9CC1CEC1E0D42F50083E165 /* CDVWKProcessPoolFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVWKProcessPoolFactory.m; path = ../../../src/ios/CDVWKProcessPoolFactory.m; sourceTree = SOURCE_ROOT; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 7E9F519219DA102000DA31AC /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 7EACDCE71D234E2A00494C9E /* WebKit.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 7E9F519C19DA102000DA31AC /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 7E9F51BA19DA1B2000DA31AC /* libCordova.a in Frameworks */,
+ 7E9F51B919DA1B1600DA31AC /* libCDVWKWebViewEngineLib.a in Frameworks */,
+ 7E9F51B519DA127E00DA31AC /* UIKit.framework in Frameworks */,
+ 7E9F51B319DA116500DA31AC /* Foundation.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 7E9F517119DA09CE00DA31AC = {
+ isa = PBXGroup;
+ children = (
+ 7EACDCE61D234E2A00494C9E /* WebKit.framework */,
+ 7E9F51B419DA127E00DA31AC /* UIKit.framework */,
+ 7E9F51B219DA116500DA31AC /* Foundation.framework */,
+ 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */,
+ 7E9F519619DA102000DA31AC /* CDVWKWebViewEngineLib */,
+ 7E9F51A019DA102000DA31AC /* CDVWKWebViewEngineLibTests */,
+ 7E9F517D19DA0A0A00DA31AC /* Products */,
+ );
+ sourceTree = "<group>";
+ };
+ 7E9F517D19DA0A0A00DA31AC /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 7E9F519519DA102000DA31AC /* libCDVWKWebViewEngineLib.a */,
+ 7E9F519F19DA102000DA31AC /* CDVWKWebViewEngineLibTests.xctest */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 7E9F518C19DA0F8300DA31AC /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 7E9F519019DA0F8300DA31AC /* libCordova.a */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 7E9F519619DA102000DA31AC /* CDVWKWebViewEngineLib */ = {
+ isa = PBXGroup;
+ children = (
+ A9CC1CEB1E0D42F50083E165 /* CDVWKProcessPoolFactory.h */,
+ A9CC1CEC1E0D42F50083E165 /* CDVWKProcessPoolFactory.m */,
+ 7EACDCE91D234FB300494C9E /* CDVWKWebViewUIDelegate.h */,
+ 7EACDCEA1D234FB300494C9E /* CDVWKWebViewUIDelegate.m */,
+ 7E9F51A919DA10AE00DA31AC /* CDVWKWebViewEngine.m */,
+ 7E9F51AA19DA10AE00DA31AC /* CDVWKWebViewEngine.h */,
+ );
+ path = CDVWKWebViewEngineLib;
+ sourceTree = SOURCE_ROOT;
+ };
+ 7E9F51A019DA102000DA31AC /* CDVWKWebViewEngineLibTests */ = {
+ isa = PBXGroup;
+ children = (
+ 7E9F51A119DA102000DA31AC /* Supporting Files */,
+ 7E9F51B019DA114400DA31AC /* CDVWKWebViewEngineTest.m */,
+ );
+ path = CDVWKWebViewEngineLibTests;
+ sourceTree = "<group>";
+ };
+ 7E9F51A119DA102000DA31AC /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ 7E9F51A219DA102000DA31AC /* Info.plist */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 7E9F519419DA102000DA31AC /* CDVWKWebViewEngineLib */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 7E9F51A319DA102000DA31AC /* Build configuration list for PBXNativeTarget "CDVWKWebViewEngineLib" */;
+ buildPhases = (
+ 7E9F519119DA102000DA31AC /* Sources */,
+ 7E9F519219DA102000DA31AC /* Frameworks */,
+ 7E9F519319DA102000DA31AC /* CopyFiles */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 305028101E2973F700CF9F12 /* PBXTargetDependency */,
+ );
+ name = CDVWKWebViewEngineLib;
+ productName = CDVWKWebViewEngineLib;
+ productReference = 7E9F519519DA102000DA31AC /* libCDVWKWebViewEngineLib.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+ 7E9F519E19DA102000DA31AC /* CDVWKWebViewEngineLibTests */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 7E9F51A619DA102000DA31AC /* Build configuration list for PBXNativeTarget "CDVWKWebViewEngineLibTests" */;
+ buildPhases = (
+ 7E9F519B19DA102000DA31AC /* Sources */,
+ 7E9F519C19DA102000DA31AC /* Frameworks */,
+ 7E9F519D19DA102000DA31AC /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 7E9F51AF19DA10E100DA31AC /* PBXTargetDependency */,
+ 7E9F51AD19DA10DE00DA31AC /* PBXTargetDependency */,
+ );
+ name = CDVWKWebViewEngineLibTests;
+ productName = CDVWKWebViewEngineLibTests;
+ productReference = 7E9F519F19DA102000DA31AC /* CDVWKWebViewEngineLibTests.xctest */;
+ productType = "com.apple.product-type.bundle.unit-test";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 7E9F517219DA09CE00DA31AC /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0830;
+ TargetAttributes = {
+ 7E9F519419DA102000DA31AC = {
+ CreatedOnToolsVersion = 6.0;
+ };
+ 7E9F519E19DA102000DA31AC = {
+ CreatedOnToolsVersion = 6.0;
+ };
+ };
+ };
+ buildConfigurationList = 7E9F517519DA09CE00DA31AC /* Build configuration list for PBXProject "CDVWKWebViewEngineTest" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = 7E9F517119DA09CE00DA31AC;
+ productRefGroup = 7E9F517D19DA0A0A00DA31AC /* Products */;
+ projectDirPath = "";
+ projectReferences = (
+ {
+ ProductGroup = 7E9F518C19DA0F8300DA31AC /* Products */;
+ ProjectRef = 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */;
+ },
+ );
+ projectRoot = "";
+ targets = (
+ 7E9F519419DA102000DA31AC /* CDVWKWebViewEngineLib */,
+ 7E9F519E19DA102000DA31AC /* CDVWKWebViewEngineLibTests */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXReferenceProxy section */
+ 7E9F519019DA0F8300DA31AC /* libCordova.a */ = {
+ isa = PBXReferenceProxy;
+ fileType = archive.ar;
+ path = libCordova.a;
+ remoteRef = 7E9F518F19DA0F8300DA31AC /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+/* End PBXReferenceProxy section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 7E9F519D19DA102000DA31AC /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 7E9F519119DA102000DA31AC /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ A9CC1CED1E0D42F50083E165 /* CDVWKProcessPoolFactory.m in Sources */,
+ 7EACDCEB1D234FB300494C9E /* CDVWKWebViewUIDelegate.m in Sources */,
+ 7E9F51AB19DA10AE00DA31AC /* CDVWKWebViewEngine.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 7E9F519B19DA102000DA31AC /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 7E9F51B119DA114400DA31AC /* CDVWKWebViewEngineTest.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ 305028101E2973F700CF9F12 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ name = CordovaLib;
+ targetProxy = 3050280F1E2973F700CF9F12 /* PBXContainerItemProxy */;
+ };
+ 7E9F51AD19DA10DE00DA31AC /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 7E9F519419DA102000DA31AC /* CDVWKWebViewEngineLib */;
+ targetProxy = 7E9F51AC19DA10DE00DA31AC /* PBXContainerItemProxy */;
+ };
+ 7E9F51AF19DA10E100DA31AC /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ name = CordovaLib;
+ targetProxy = 7E9F51AE19DA10E100DA31AC /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin XCBuildConfiguration section */
+ 7E9F517619DA09CE00DA31AC /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ OTHER_LDFLAGS = "-ObjC";
+ };
+ name = Debug;
+ };
+ 7E9F517719DA09CE00DA31AC /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ OTHER_LDFLAGS = "-ObjC";
+ };
+ name = Release;
+ };
+ 7E9F51A419DA102000DA31AC /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = "$(inherited)";
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ OTHER_LDFLAGS = "-ObjC";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = iphoneos;
+ SKIP_INSTALL = YES;
+ };
+ name = Debug;
+ };
+ 7E9F51A519DA102000DA31AC /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = YES;
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = "$(inherited)";
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ OTHER_LDFLAGS = "-ObjC";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = iphoneos;
+ SKIP_INSTALL = YES;
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ 7E9F51A719DA102000DA31AC /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(SDKROOT)/Developer/Library/Frameworks",
+ "$(inherited)",
+ );
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ INFOPLIST_FILE = CDVWKWebViewEngineLibTests/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ MTL_ENABLE_DEBUG_INFO = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ PRODUCT_BUNDLE_IDENTIFIER = "org.apache.cordova.$(PRODUCT_NAME:rfc1034identifier)";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = iphoneos;
+ };
+ name = Debug;
+ };
+ 7E9F51A819DA102000DA31AC /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = YES;
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(SDKROOT)/Developer/Library/Frameworks",
+ "$(inherited)",
+ );
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ INFOPLIST_FILE = CDVWKWebViewEngineLibTests/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ MTL_ENABLE_DEBUG_INFO = NO;
+ PRODUCT_BUNDLE_IDENTIFIER = "org.apache.cordova.$(PRODUCT_NAME:rfc1034identifier)";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = iphoneos;
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 7E9F517519DA09CE00DA31AC /* Build configuration list for PBXProject "CDVWKWebViewEngineTest" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 7E9F517619DA09CE00DA31AC /* Debug */,
+ 7E9F517719DA09CE00DA31AC /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 7E9F51A319DA102000DA31AC /* Build configuration list for PBXNativeTarget "CDVWKWebViewEngineLib" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 7E9F51A419DA102000DA31AC /* Debug */,
+ 7E9F51A519DA102000DA31AC /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 7E9F51A619DA102000DA31AC /* Build configuration list for PBXNativeTarget "CDVWKWebViewEngineLibTests" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 7E9F51A719DA102000DA31AC /* Debug */,
+ 7E9F51A819DA102000DA31AC /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 7E9F517219DA09CE00DA31AC /* Project object */;
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+ version = "1.0">
+ <FileRef
+ location = "self:CDVWKWebViewEngineTest.xcodeproj">
+ </FileRef>
+</Workspace>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>IDESourceControlProjectFavoriteDictionaryKey</key>
+ <false/>
+ <key>IDESourceControlProjectIdentifier</key>
+ <string>6BE9AD73-1B9F-4362-98D7-DC631BEC6185</string>
+ <key>IDESourceControlProjectName</key>
+ <string>CDVWKWebViewEngineTest</string>
+ <key>IDESourceControlProjectOriginsDictionary</key>
+ <dict>
+ <key>BEF5A5D0FF64801E558286389440357A9233D7DB</key>
+ <string>https://git-wip-us.apache.org/repos/asf/cordova-plugin-wkwebview-engine.git</string>
+ </dict>
+ <key>IDESourceControlProjectPath</key>
+ <string>tests/ios/CDVWKWebViewEngineTest/CDVWKWebViewEngineTest.xcodeproj</string>
+ <key>IDESourceControlProjectRelativeInstallPathDictionary</key>
+ <dict>
+ <key>BEF5A5D0FF64801E558286389440357A9233D7DB</key>
+ <string>../../../../..</string>
+ </dict>
+ <key>IDESourceControlProjectURL</key>
+ <string>https://git-wip-us.apache.org/repos/asf/cordova-plugin-wkwebview-engine.git</string>
+ <key>IDESourceControlProjectVersion</key>
+ <integer>111</integer>
+ <key>IDESourceControlProjectWCCIdentifier</key>
+ <string>BEF5A5D0FF64801E558286389440357A9233D7DB</string>
+ <key>IDESourceControlProjectWCConfigurations</key>
+ <array>
+ <dict>
+ <key>IDESourceControlRepositoryExtensionIdentifierKey</key>
+ <string>public.vcs.git</string>
+ <key>IDESourceControlWCCIdentifierKey</key>
+ <string>BEF5A5D0FF64801E558286389440357A9233D7DB</string>
+ <key>IDESourceControlWCCName</key>
+ <string>cordova-plugin-wkwebview-engine</string>
+ </dict>
+ </array>
+</dict>
+</plist>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0830"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "7E9F519419DA102000DA31AC"
+ BuildableName = "libCDVWKWebViewEngineLib.a"
+ BlueprintName = "CDVWKWebViewEngineLib"
+ ReferencedContainer = "container:CDVWKWebViewEngineTest.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES">
+ <Testables>
+ </Testables>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </TestAction>
+ <LaunchAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
+ allowLocationSimulation = "YES">
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "7E9F519419DA102000DA31AC"
+ BuildableName = "libCDVWKWebViewEngineLib.a"
+ BlueprintName = "CDVWKWebViewEngineLib"
+ ReferencedContainer = "container:CDVWKWebViewEngineTest.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ buildConfiguration = "Release"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ debugDocumentVersioning = "YES">
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "7E9F519419DA102000DA31AC"
+ BuildableName = "libCDVWKWebViewEngineLib.a"
+ BlueprintName = "CDVWKWebViewEngineLib"
+ ReferencedContainer = "container:CDVWKWebViewEngineTest.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0830"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "NO"
+ buildForArchiving = "NO"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "7E9F519E19DA102000DA31AC"
+ BuildableName = "CDVWKWebViewEngineLibTests.xctest"
+ BlueprintName = "CDVWKWebViewEngineLibTests"
+ ReferencedContainer = "container:CDVWKWebViewEngineTest.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES">
+ <Testables>
+ <TestableReference
+ skipped = "NO">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "7E9F519E19DA102000DA31AC"
+ BuildableName = "CDVWKWebViewEngineLibTests.xctest"
+ BlueprintName = "CDVWKWebViewEngineLibTests"
+ ReferencedContainer = "container:CDVWKWebViewEngineTest.xcodeproj">
+ </BuildableReference>
+ <SkippedTests>
+ <Test
+ Identifier = "CDVWKWebViewEngineTest/testConfigurationWithMediaPlaybackAllowsAirPlay">
+ </Test>
+ </SkippedTests>
+ </TestableReference>
+ </Testables>
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "7E9F519E19DA102000DA31AC"
+ BuildableName = "CDVWKWebViewEngineLibTests.xctest"
+ BlueprintName = "CDVWKWebViewEngineLibTests"
+ ReferencedContainer = "container:CDVWKWebViewEngineTest.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </TestAction>
+ <LaunchAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
+ allowLocationSimulation = "YES">
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "7E9F519E19DA102000DA31AC"
+ BuildableName = "CDVWKWebViewEngineLibTests.xctest"
+ BlueprintName = "CDVWKWebViewEngineLibTests"
+ ReferencedContainer = "container:CDVWKWebViewEngineTest.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ buildConfiguration = "Release"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ debugDocumentVersioning = "YES">
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "7E9F519E19DA102000DA31AC"
+ BuildableName = "CDVWKWebViewEngineLibTests.xctest"
+ BlueprintName = "CDVWKWebViewEngineLibTests"
+ ReferencedContainer = "container:CDVWKWebViewEngineTest.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
--- /dev/null
+{
+ "name": "cordova-plugin-wkwebview-engine-test-ios",
+ "version": "1.0.0",
+ "description": "iOS Unit Tests for cordova-plugin-wkwebview-engine Plugin",
+ "author": "Apache Software Foundation",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "cordova-ios": "*"
+ },
+ "scripts": {
+ "test": "xcodebuild test -workspace CDVWKWebViewEngineTest.xcworkspace -scheme CDVWKWebViewEngineLibTests -destination 'platform=iOS Simulator,name=iPhone 5' -xcconfig test.xcconfig"
+ }
+}
--- /dev/null
+//
+// 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.
+//
+
+HEADER_SEARCH_PATHS = $(TARGET_BUILD_DIR)/include
--- /dev/null
+{
+ "name": "cordova-plugin-wkwebview-engine-tests",
+ "version": "1.2.1",
+ "description": "",
+ "cordova": {
+ "id": "cordova-plugin-wkwebview-engine-tests",
+ "platforms": []
+ },
+ "keywords": [
+ "ecosystem:cordova"
+ ],
+ "author": "Apache Software Foundation",
+ "license": "Apache-2.0"
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+
+<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
+ id="cordova-plugin-wkwebview-engine-tests"
+ version="1.2.1">
+ <name>cordova-plugin-wkwebview-engine Tests</name>
+ <license>Apache 2.0</license>
+
+ <js-module src="tests.js" name="tests">
+ </js-module>
+</plugin>
--- /dev/null
+/*
+ *
+ * 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.
+ *
+*/
+
+/* jshint jasmine: true */
+
+exports.defineAutoTests = function () {
+ describe('cordova-plugin-wkwebview-engine (cordova)', function () {
+ it("cordova-plugin-wkwebview-engine.spec.1 should exist", function () {
+ //expect(window).toBeDefined();
+ });
+ });
+};
+
+exports.defineManualTests = function (contentEl, createActionButton) {
+
+ contentEl.innerHTML = 'Your HTML instructions here';
+
+ createActionButton('Do something 1', function () {
+ // do something 1;
+ }, 'do-something-1');
+
+ createActionButton('Do something 2', function () {
+ // do something 2;
+ }, 'do-something-2');
+
+};
},
"is_top_level": true,
"variables": {
- "APP_KEY": "your_jpush_appkey",
+ "APP_KEY": "d644d997f2cab0551ff704a3",
"CHANNEL": "developer-default"
}
},
},
"is_top_level": false,
"variables": {}
+ },
+ "cordova-plugin-app-version": {
+ "source": {
+ "type": "registry",
+ "id": "cordova-plugin-app-version"
+ },
+ "is_top_level": true,
+ "variables": {}
+ },
+ "cordova-plugin-wkwebview-engine": {
+ "source": {
+ "type": "registry",
+ "id": "cordova-plugin-wkwebview-engine"
+ },
+ "is_top_level": true,
+ "variables": {}
}
}
\ No newline at end of file
"PACKAGE_NAME": "$(PRODUCT_BUNDLE_IDENTIFIER)"
},
"jpush-phonegap-plugin": {
- "APP_KEY": "your_jpush_appkey",
+ "APP_KEY": "d644d997f2cab0551ff704a3",
"CHANNEL": "developer-default",
"PACKAGE_NAME": "$(PRODUCT_BUNDLE_IDENTIFIER)"
+ },
+ "cordova-plugin-app-version": {
+ "PACKAGE_NAME": "$(PRODUCT_BUNDLE_IDENTIFIER)"
+ },
+ "cordova-plugin-wkwebview-engine": {
+ "PACKAGE_NAME": "$(PRODUCT_BUNDLE_IDENTIFIER)"
}
},
"dependent_plugins": {
<body>
<header class="aui-bar aui-bar-nav" style="padding-top:25px;">
- <a class="aui-pull-left" href="javascript:window.history.go(-1)">
+ <a class="aui-pull-left" href="javascript:app.toBack();">
<span class="aui-iconfont aui-icon-left"></span>
</a>
<div class="aui-title">账单详情</div>
this.loadBill()
},
toBack: function (){
- window.history.back();
+ //window.history.back();
+ window.history.go(-1)
},
loadBill: function() {
var refno = window.localStorage.getItem("currentrefno");
// Application Constructor
initialize: function() {
document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);
- document.addEventListener('jpush.receiveRegistrationId', function (event) {
- console.log(event.registrationId)
- }, false)
},
onDeviceReady: function() {
console.log(ret)
if (ok) {
if(ret.code==200){
- var exp = window.localStorage.getItem("tokenexpire");
- var t = parseInt(exp);
- //token 小于10分钟了,需要刷新
- console.log((ret.now-t))
- if(ret.now-t>1000*60*10){
- window.location = "login.html";
- }else{
- window.location = "main.html";
+ if(!isEmpty(ret.token)){
+ window.localStorage.setItem("token",ret.token);
}
+ window.location = "main.html";
}else{
window.location = "login.html";
}
$.showLoading("登录中");
var param={
"username":phone,
- "password":pwd
+ "password":pwd,
+ "platform":device.platform
}
Login(param,function(ok,ret){
console.log(ret)
window.localStorage.setItem("phone",phone);
window.localStorage.setItem("phoneX",ret.phone);
window.localStorage.setItem("token",ret.token);
+ window.localStorage.setItem("uid",ret.uid);
window.localStorage.setItem("tenantid",ret.tenantid);
window.localStorage.setItem("tokenexpire",ret.expire);
window.localStorage.setItem("tokentime",ret.now);
initialize: function() {
this.initTab();
document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);
+ document.addEventListener('jpush.receiveRegistrationId', function(event) {
+ console.log(event.registrationId)
+ }, false)
+ document.addEventListener("jpush.openNotification", function (event) {
+ var refno
+ console.log("openNotify:"+event);
+ if(device.platform == "Android") {
+ refno = event.extras.refno
+ } else {
+ refno = event.refno
+ window.JPush.setApplicationIconBadgeNumber(0);
+ }
+ app.openBill(refno);
+ console.log("openNotify:"+refno);
+ }, false)
+ },
+ openBill:function(billno){
+ window.localStorage.setItem("currentrefno",billno);
+ window.location='billdetail.html';
+ },
+ initJpush: function() {
+ if(device.platform == "Android") {
+ } else {
+ window.JPush.setApplicationIconBadgeNumber(0);
+ }
+ window.JPush.init();
+ window.JPush.setDebugMode(true);
+ window.JPush.isPushStopped(function(result) {
+ if (result == 0) {
+ //window.JPush.resumePush();
+ } else {
+ window.JPush.resumePush();
+ }
+ });
+ window.JPush.getUserNotificationSettings(function(result) {
+ if(result == 0) {
+ } else if(result > 0) {
+ }
+ });
+ var uid = window.localStorage.getItem("uid");
+ window.JPush.setAlias({ sequence: 1, alias: uid },
+ (result) => {
+ var sequence = result.sequence
+ var alias = result.alias
+ //alert(JSON.stringify(result))
+ }, (error) => {
+ var sequence = error.sequence
+ var errorCode = error.code
+ //alert(JSON.stringify(error))
+ })
},
onDeviceReady: function() {
var uid = window.localStorage.getItem("token");
- console.log(CURRENT_INDEX);
+ this.initJpush();
$('#scanBtn').click(function() {
//window.location = "scan.html";
app.checkBefore(function() {
})
});
$('#secBtn').click(function() {
- app.checkBefore(function() {
+ window.location = "security.html";
+ /*app.checkBefore(function() {
app.checkOther(function() {
window.location = "security.html";
})
- })
+ })*/
});
$('#usersec').click(function() {
app.checkBefore(function() {
});
this.initData();
},
- initTab:function(){
+ initTab: function() {
$("#maincontent").css("top", $("#maintop").height())
var tab = new auiTab({
element: document.getElementById("footer"),
}, function(ret) {
- window.localStorage.setItem("tabindex",ret.index);
-
+ window.localStorage.setItem("tabindex", ret.index);
+
changeTab(ret.index);
});
- var tabindex = window.localStorage.getItem("tabindex");
- if(!tabindex||tabindex==0){
+ var tabindex = window.localStorage.getItem("tabindex");
+ if (!tabindex || tabindex == 0) {
tabindex = 1
}
changeTab(tabindex);
tab.setActive(tabindex)
- function changeTab(index){
+
+ function changeTab(index) {
if (index == 1) {
$("#main1").show();
$("#main2").hide();
}
V1Bills(param, function(ok, ret) {
if (ok) {
- console.log(ret)
+ //console.log(ret)
if (ret.code == 200) {
+ app.checkVersion(ret.version,ret.minversion,ret.versionmsg);
$("#maingt").text(ret.t + "!")
$("#user-amount").text(ret.amount)
$("#user-point").text(ret.point)
}
})
},
-
+ checkVersion:function(ver,minver,msg){
+ cordova.getAppVersion.getVersionNumber(function (version) {
+ //alert(version);
+ if(version<minver){
+ //TODO 强制升级
+ alert("当前版本过低,为了不影响您的使用,请先升级");
+ }else if(ver>version){
+ alert("有新的版本");
+ }
+ });
+ },
initBillView: function(page) {
var html = '';
for (var i = 0; i < page.data.length; i++) {
}
}
};
-app.initialize();
\ No newline at end of file
+app.initialize();
$.hideLoading();
console.log(ret)
if(ret.code==200){
-
window.localStorage.setItem("phone",phone);
window.localStorage.setItem("uid",ret.uid);
window.localStorage.setItem("code",ret.randcode);
$.alert('扫描出错,请稍后再试:' + JSON.stringify(err), '提示');
} else {
// The scan completed, display the contents of the QR code:
- //$.alert(text, '提示');
- showRet(text);
QRScanner.destroy();
+ $.alert(text, '提示');
+ showRet(text);
}
}
//开始扫描,需要将页面的背景设置成透明
}
var userid = window.localStorage.getItem("userid");
if(url.indexOf("?")>0){
- url=url+'&uid='+userid;
+ url=url+'&userid='+userid;
}else{
- url=url+'?uid='+userid;
+ url=url+'?userid='+userid;
}
+ console.log(url)
inAppBrowserRef = cordova.ThemeableBrowser.open(url, '_blank', {
statusbar: {
color: '#03a9f4ff'
-var dev = true;
-var SERVER = "http://ykt.supwisdom.com:10010/payapi/mobileapi";
+var dev = false;
+var SERVER = "https://yy.dlsmk.cn/payapi/mobileapi";
var GLOBAL_TODAY="";
var GLOBAL_YESTERDAY="";
var CURRENT_INDEX=1;
if (dev) {
- SERVER = "http://172.28.43.3:8099/payapi/mobileapi";
+ SERVER = "http://172.28.201.70:10010/payapi/mobileapi";
}
+
function V1Qrcode(callback) {
ajaxPost("/v1/qrcode", {}, callback)
}
</head>
<body>
<header class="aui-bar aui-bar-nav" style="padding-top:25px;">
- <a class="aui-pull-left" href="javascript:window.history.back()">
+ <a class="aui-pull-left" href="login.html">
<span class="aui-iconfont aui-icon-left"></span>
</a>
<div class="aui-title">注册</div>
</div>
</li>
</ul>
- <div style="padding: 20px;margin-top: 40px;">
+ <div style="padding: 20px;margin-top: 40px;">
<a href="javascript:app.logout();" class="weui-btn weui-btn_warn">退出登录</a>
</div>
</section>