diff --git a/.gitignore b/.gitignore index af5bb5d..4243372 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,7 @@ resources/signing \.idea/ chabok-starter-cordova/platforms/ + +chabok-starter-cordova/node_modules/ + +chabok-starter-cordova/plugins/ diff --git a/ChabokPush/HISTORY.md b/ChabokPush/HISTORY.md new file mode 100644 index 0000000..0e44387 --- /dev/null +++ b/ChabokPush/HISTORY.md @@ -0,0 +1,13 @@ +## v1.1.0 +- Update Chabok iOS SDK ([v2.1.0](https://github.com/chabok-io/chabok-client-ios/releases/tag/v2.1.0)) +- Update Chabok android SDK ([v3.1.2](https://github.com/chabok-io/chabok-client-android/releases/tag/v3.1.2)) +- Now SDK install automatically: +``` bash +//SANDBOX +cordova plugin add com.chabokpush.cordova --variable CHABOK_ENVIRONMENT=SANDBOX + +//OR PRODUCTION +cordova plugin add com.chabokpush.cordova --variable CHABOK_ENVIRONMENT=PRODUCTION +``` +- Get notification actions by `setOnNotificationOpenedCallback`. +- Fix get connection status event. diff --git a/ChabokPush/hooks/after_prepare.js b/ChabokPush/hooks/after_prepare.js new file mode 100644 index 0000000..0930e7e --- /dev/null +++ b/ChabokPush/hooks/after_prepare.js @@ -0,0 +1,61 @@ +#!/usr/bin/env node + +const fs = require("fs"); +const path = require("path"); +const utilities = require("./utilities"); + +const IOS_DIR = 'platforms/ios'; +const ANDROID_DIR = 'platforms/android'; + +const config = fs.readFileSync('config.xml').toString(); +const name = utilities.getValue(config, 'name'); + +const PLATFORM = { + IOS: { + dest: [ + IOS_DIR + '/' + name + '/Chabok.sandbox.plist', + 'plugins/com.chabokpush.cordova/src/ios/Chabok.sandbox.plist', + + IOS_DIR + '/' + name + '/Chabok.production.plist', + 'plugins/com.chabokpush.cordova/src/ios/Chabok.production.plist', + ], + src: [ + 'Chabok.sandbox.plist', + + 'Chabok.production.plist', + ] + }, + ANDROID: { + dest: [ + ANDROID_DIR + '/app/google-services.json', + + ANDROID_DIR + '/app/Chabok.sandbox.json', + + ANDROID_DIR + '/app/Chabok.production.json' + ], + src: [ + 'google-services.json', + + 'Chabok.sandbox.json', + + 'Chabok.production.json', + ], + } +}; + +module.exports = function(cordovaContext) { + console.log('(ℹ️) Get Chabok environment variable from config file or user set by adding plugin. \n' + + '(🧪) example: Cordova plugin add com.chabokpush.cordova --variable CHABOK_ENVIRONMENT=PRODUCTION'); + + // Copy key files to their platform specific folders + if (utilities.directoryExists(IOS_DIR)) { + console.log('(📱) Preparing Chabok files on iOS'); + + utilities.copyKey(PLATFORM.IOS, 'iOS'); + } + if (utilities.directoryExists(ANDROID_DIR)) { + console.log('(📱) Preparing Chabok and Firebase files on Android'); + + utilities.copyKey(PLATFORM.ANDROID, 'Android'); + } +}; diff --git a/ChabokPush/hooks/androidAfterInstallAddPluginGradle.js b/ChabokPush/hooks/androidAfterInstallAddPluginGradle.js new file mode 100644 index 0000000..c9f49bf --- /dev/null +++ b/ChabokPush/hooks/androidAfterInstallAddPluginGradle.js @@ -0,0 +1,120 @@ +#!/usr/bin/env node + +const fs = require('fs'); +const path = require('path'); +const utilities = require("./utilities"); + +const FILE_NAME = 'build.gradle'; +const mavenRepo = 'maven {\n' + + ' url "https://plugins.gradle.org/m2/"\n' + + ' }'; + +function addChabokLib(context){ + console.log('(LAST) -----> Start to insert Chabok plugin into the ' + FILE_NAME + ' file.'); + + let chabokAndFirebaseGradle = 'classpath "io.chabok.plugin:chabok-services:1.0.0"\n' + + ' classpath \'com.google.gms:google-services:4.3.2\''; + + let platformRoot = path.join(context.opts.projectRoot, 'platforms/android'); + + let buildGradleFIle = path.join(platformRoot, FILE_NAME); + + if (fs.existsSync(buildGradleFIle)) { + console.log('The ' + FILE_NAME + ' file is exist and start to read the file.'); + + fs.readFile(buildGradleFIle, 'utf8', function (err, data) { + if (err) { + throw new Error('Unable to find ' + FILE_NAME + ': ' + err); + } + + if (!data.includes(mavenRepo)) { + data = data.replace('jcenter()', + 'jcenter()\n ' + mavenRepo); + + console.log('Add maven plugin into the Android '+FILE_NAME+'. \n\n' + data); + + fs.writeFile(buildGradleFIle, data, 'utf8', function (err) { + if (err) { + throw new Error('Unable to write ' + FILE_NAME + ': ' + err); + } else { + console.info('Add maven plugin in '+FILE_NAME+' file successfully.'); + } + }) + } else { + console.warn('maven plugin already added.'); + } + + if (!data.includes(chabokAndFirebaseGradle)) { + let result = data.replace('classpath \'com.android.tools.build:gradle', + chabokAndFirebaseGradle + '\n classpath \'com.android.tools.build:gradle'); + + console.log('Add Chabok plugin into the Android '+FILE_NAME+'. \n\n' + result); + + fs.writeFile(buildGradleFIle, result, 'utf8', function (err) { + if (err) { + throw new Error('Unable to write ' + FILE_NAME + ': ' + err); + } else { + console.info('Add Chabok plugin in '+FILE_NAME+' file successfully.'); + } + }) + } else { + console.warn('Chabok plugin already added.'); + } + }); + } else { + console.warn('Could not find '+FILE_NAME+' file.'); + } +} + +function removeChabokLib(context){ + console.log('-----> Start to remove Chabok plugin into the ' + FILE_NAME + ' file.'); + + let chabokAndFirebaseGradle = 'classpath \'com.google.gms:google-services:4.3.2\'\n' + + ' classpath \'com.android.tools.build:gradle:3.5.1\''; + + let platformRoot = path.join(context.opts.projectRoot, 'platforms/android'); + + let buildGradleFIle = path.join(platformRoot, FILE_NAME); + + if (fs.existsSync(buildGradleFIle)) { + console.log('The ' + FILE_NAME + ' file is exist and start to read the file.'); + + fs.readFile(buildGradleFIle, 'utf8', function (err, data) { + if (err) { + throw new Error('Unable to find ' + FILE_NAME + ': ' + err); + } + + if (data.includes(mavenRepo)) { + let result = data.replace('jcenter()' + mavenRepo, + 'jcenter()' + ); + + result = result.replace( + 'classpath "io.chabok.plugin:chabok-services:1.0.0" \n\n' + chabokAndFirebaseGradle, + 'classpath \'com.android.tools.build:gradle:3.5.1\''); + + console.log('Removed Chabok plugin from the Android '+FILE_NAME+'. \n\n' + result); + + fs.writeFile(buildGradleFIle, result, 'utf8', function (err) { + if (err) { + throw new Error('Unable to write ' + FILE_NAME + ': ' + err); + } else { + console.info('Removed Chabok plugin in '+FILE_NAME+' file successfully.'); + } + }) + } else { + console.warn('Chabok plugin already removed.'); + } + }); + } else { + console.warn('Could not find '+FILE_NAME+' file.'); + } +} + +module.exports = function(context) { + if (context.hook === 'before_plugin_uninstall'){ + removeChabokLib(context); + } else { + addChabokLib(context); + } +}; diff --git a/ChabokPush/hooks/androidBeforeInstallAndroidManifest.js b/ChabokPush/hooks/androidBeforeInstallAndroidManifest.js new file mode 100644 index 0000000..1825d8f --- /dev/null +++ b/ChabokPush/hooks/androidBeforeInstallAndroidManifest.js @@ -0,0 +1,89 @@ +#!/usr/bin/env node + +let fs = require('fs'); +let path = require('path'); + +let APP_CLASS = 'com.chabokpush.cordova.MyAppClass'; +let FILE_NAME = 'AndroidManifest.xml' + +function replaceClassName(currentCode, withClass, context){ + console.log('-----> Start to insert Chabok application class into the' + FILE_NAME + 'file.'); + + let platformRoot = path.join(context.opts.projectRoot, 'platforms/android/app/src/main'); + let manifestFile = path.join(platformRoot, FILE_NAME); + + if (fs.existsSync(manifestFile)) { + console.log('The ' + FILE_NAME + ' file is exist and start to read the file.'); + + fs.readFile(manifestFile, 'utf8', function (err, data) { + if (err) { + throw new Error('Unable to find ' + FILE_NAME + ': ' + err); + } + + if (data.indexOf(APP_CLASS) === -1) { + if (!data.includes(APP_CLASS)) { + let result = data.replace(currentCode, withClass); + + fs.writeFile(manifestFile, result, 'utf8', function (err) { + if (err) { + throw new Error('Unable to write ' + FILE_NAME + ': ' + err); + } else { + console.info('Add Chabok application class name into the AndroidManifest.xml file successfully.'); + } + }) + } else { + console.warn( 'Chabok application class name already added to ' + FILE_NAME); + } + } else { + console.warn( 'data contain (' + APP_CLASS + ') file and ignore to add class name to manifest.'); + } + }); + } else { + console.warn('Could not find AndroidManifest.xml file.'); + } +} + +function insertChabokApplicationClass(context){ + replaceClassName(/ Start to remove Chabok application class into the' + FILE_NAME + ' file.'); + + let platformRoot = path.join(context.opts.projectRoot, 'platforms/android/app/src/main'); + let manifestFile = path.join(platformRoot, FILE_NAME); + + if (fs.existsSync(manifestFile)) { + console.log('The ' + FILE_NAME + ' file is exist and start to read the file.'); + + fs.readFile(manifestFile, 'utf8', function (err, data) { + if (err) { + throw new Error('Unable to find ' + FILE_NAME + ': ' + err); + } + + if (data.indexOf(APP_CLASS)) { + let result = data.replace('android:name="' + APP_CLASS + '"', ''); + + fs.writeFile(manifestFile, result, 'utf8', function (err) { + if (err) { + throw new Error('Unable to write ' + FILE_NAME + ': ' + err); + } else { + console.info('Removed Chabok application class name into the AndroidManifest.xml file successfully.'); + } + }) + } else { + console.warn( 'data contain (' + APP_CLASS + ') file and ignore to remove class name to manifest.'); + } + }); + } else { + console.warn('Could not find AndroidManifest.xml file.'); + } +} + +module.exports = function(context) { + if (context.hook === 'before_plugin_uninstall'){ + removeChabokApplicationClass(context); + } else { + insertChabokApplicationClass(context); + } +}; diff --git a/ChabokPush/hooks/androidBeforeInstallMyApplication.js b/ChabokPush/hooks/androidBeforeInstallMyApplication.js new file mode 100644 index 0000000..cae8983 --- /dev/null +++ b/ChabokPush/hooks/androidBeforeInstallMyApplication.js @@ -0,0 +1,56 @@ +#!/usr/bin/env node + +const fs = require('fs'); +const path = require('path'); +const utilities = require("./utilities"); + +let ChabokImport = 'import com.adpdigital.push.AdpPushClient;\n' + + 'import com.adpdigital.push.config.Environment;'; + +let FILE_NAME = 'MyAppClass.java' + +module.exports = function(context) { + let chkEnv = utilities.readChabokEnvFromProcess(context.cmdLine); + let ChabokConfigEnv = 'AdpPushClient.configureEnvironment(Environment.'+chkEnv.toUpperCase()+');'; + + console.log('-----> Start to insert Chabok application class into the ' + FILE_NAME + 'file.'); + + let platformRoot = path.join(context.opts.projectRoot, 'platforms/android/app/src/main/java/com/chabokpush/cordova'); + + let applicationClass = path.join(platformRoot, FILE_NAME); + + if (fs.existsSync(applicationClass)) { + console.log('The ' + FILE_NAME + ' file is exist and start to read the file.'); + + fs.readFile(applicationClass, 'utf8', function (err, data) { + if (err) { + throw new Error('Unable to find ' + FILE_NAME + ': ' + err); + } + + if (data.indexOf(FILE_NAME) === -1) { + if (!data.includes(ChabokImport)) { + let result = data.replace('import android.app.Application;', 'import android.app.Application; \n' + ChabokImport); + + result = result.replace('super.onCreate();', 'super.onCreate();' + + ' \n \n ' + ChabokConfigEnv); + + console.log('Add Chabok configureEnvironment method into the Android Application class. \n\n' + result); + + fs.writeFile(applicationClass, result, 'utf8', function (err) { + if (err) { + throw new Error('Unable to write ' + FILE_NAME + ': ' + err); + } else { + console.info('Add Chabok class import in application class successfully.'); + } + }) + } else { + console.warn( 'Chabok import into application class already added.'); + } + } else { + console.warn( 'data contain ' + FILE_NAME + ' file and ignore to add ' + FILE_NAME + ' name.'); + } + }); + } else { + console.warn('Could not find '+FILE_NAME+' file.'); + } +}; diff --git a/ChabokPush/hooks/iosAfterInstallAppDelegate.js b/ChabokPush/hooks/iosAfterInstallAppDelegate.js new file mode 100644 index 0000000..697ae3b --- /dev/null +++ b/ChabokPush/hooks/iosAfterInstallAppDelegate.js @@ -0,0 +1,112 @@ +#!/usr/bin/env node + +const fs = require('fs'); +const path = require('path'); +const utilities = require("./utilities"); + +const FILE_NAME = 'AppDelegate.m'; +const config = fs.readFileSync('config.xml').toString(); +const name = utilities.getValue(config, 'name'); +const ChabokImport = '#import '; + +function addChabokLib(context){ + console.log('-----> Start to insert Chabok application class into the ' + FILE_NAME + 'file.'); + + let chkEnv = utilities.readChabokEnvFromProcess(context.cmdLine); + let ChabokConfigEnv = '[PushClientManager.defaultManager configureEnvironment:' + + chkEnv.charAt(0).toUpperCase() + chkEnv.substring(1) + '];'; + + + let platformRoot = path.join(context.opts.projectRoot, 'platforms/ios/'+name+'/Classes'); + console.log('platformRoot = ' + platformRoot); + + let applicationClass = path.join(platformRoot, FILE_NAME); + + if (fs.existsSync(applicationClass)) { + console.log('The ' + FILE_NAME + ' file is exist and start to read the file.'); + + fs.readFile(applicationClass, 'utf8', function (err, data) { + if (err) { + throw new Error('Unable to find ' + FILE_NAME + ': ' + err); + } + + if (!data.includes(ChabokImport)) { + let result = data.replace('#import "AppDelegate.h"', '#import "AppDelegate.h" \n' + ChabokImport); + + result = result.replace('self.viewController = [[MainViewController alloc] init];', + ChabokConfigEnv + '\n\n self.viewController = [[MainViewController alloc] init];'); + + console.log('Add Chabok configureEnvironment method into the iOS AppDelegate class. \n\n' + result); + + fs.writeFile(applicationClass, result, 'utf8', function (err) { + if (err) { + throw new Error('Unable to write ' + FILE_NAME + ': ' + err); + } else { + console.info('Add Chabok class in AppDelegate file successfully.'); + } + }) + } else { + console.warn('Chabok import into application class already added.'); + } + }); + } else { + console.warn('Could not find '+FILE_NAME+' file.'); + } +} + +function removeChabokLib(context){ + console.log('-----> Start to remove Chabok application class into the ' + FILE_NAME + ' file.'); + + let platformRoot = path.join(context.opts.projectRoot, 'platforms/ios/'+name+'/Classes'); + console.log('platformRoot = ' + platformRoot); + + let applicationClass = path.join(platformRoot, FILE_NAME); + + if (fs.existsSync(applicationClass)) { + console.log('The ' + FILE_NAME + ' file is exist and start to read the file.'); + + fs.readFile(applicationClass, 'utf8', function (err, data) { + if (err) { + throw new Error('Unable to find ' + FILE_NAME + ': ' + err); + } + + let chkEnv = '' + if (data.indexOf('configureEnvironment:Sandbox')){ + chkEnv = 'Sandbox' + } else { + chkEnv = 'Production' + } + + let ChabokConfigEnv = '[PushClientManager.defaultManager configureEnvironment:' + + chkEnv + '];'; + + if (data.includes(ChabokImport)) { + let result = data.replace('#import "AppDelegate.h" \n' + ChabokImport, '#import "AppDelegate.h"'); + + result = result.replace(ChabokConfigEnv + '\n\n self.viewController = [[MainViewController alloc] init];', 'self.viewController = [[MainViewController alloc] init];'); + + console.log('Remove Chabok configureEnvironment method from the iOS AppDelegate class. \n\n' + result); + + fs.writeFile(applicationClass, result, 'utf8', function (err) { + if (err) { + throw new Error('Unable to write ' + FILE_NAME + ': ' + err); + } else { + console.info('Remove Chabok class in AppDelegate file successfully.'); + } + }) + } else { + console.warn('Chabok import into application class already removed.'); + } + }); + } else { + console.warn('Could not find '+FILE_NAME+' file.'); + } +} + +module.exports = function(context) { + if (context.hook === 'before_plugin_uninstall'){ + removeChabokLib(context); + } else { + addChabokLib(context); + } +}; diff --git a/ChabokPush/hooks/nativeCodeUtil.js b/ChabokPush/hooks/nativeCodeUtil.js new file mode 100644 index 0000000..4069bfd --- /dev/null +++ b/ChabokPush/hooks/nativeCodeUtil.js @@ -0,0 +1,85 @@ +#!/usr/bin/env node + +const fs = require('fs'); +const path = require('path'); +const utilities = require("./utilities"); + +function setFileName(filename){ + this.fileName = filename; +} + +function setImportCode(importCode){ + this.importCode = importCode; +} + +function setFunctionCallCode(functionCall) { + this.functionCall = functionCall; +} + +function setDirectoryPath(directoryPath){ + this.directionPath = directoryPath; +} + +function getChabokEnvironment(context){ + return utilities.readChabokEnvFromProcess(context.cmdLine); +} + +function getRelativePath(context){ + return path.join(context.opts.projectRoot, this.directionPath); +} + +function getFileFullPath(){ + return path.join(getRelativePath(), this.fileName); +} + +function isFileExists(file){ + return fs.existsSync(applicationClass) +} + + +module.exports = function(context) { + let chkEnv = utilities.readChabokEnvFromProcess(context.cmdLine); + let ChabokConfigEnv = 'AdpPushClient.configureEnvironment(Environment.'+chkEnv.toUpperCase()+');'; + + console.log('-----> Start to insert Chabok application class into the ' + FILE_NAME + 'file.'); + + let platformRoot = path.join(context.opts.projectRoot, 'platforms/android/app/src/main/java/com/chabokpush/cordova'); + console.log('platformRoot = ' + platformRoot); + + let applicationClass = path.join(platformRoot, FILE_NAME); + + if (fs.existsSync(applicationClass)) { + console.log('The ' + FILE_NAME + ' file is exist and start to read the file.'); + + fs.readFile(applicationClass, 'utf8', function (err, data) { + if (err) { + throw new Error('Unable to find ' + FILE_NAME + ': ' + err); + } + + if (data.indexOf(FILE_NAME) === -1) { + if (!data.includes(ChabokImport)) { + let result = data.replace('import android.app.Application;', 'import android.app.Application; \n' + ChabokImport); + + result = result.replace('super.onCreate();', 'super.onCreate();' + + ' \n \n ' + ChabokConfigEnv); + + console.log('Add Chabok configureEnvironment method into the Android Application class. \n\n' + result); + + fs.writeFile(applicationClass, result, 'utf8', function (err) { + if (err) { + throw new Error('Unable to write ' + FILE_NAME + ': ' + err); + } else { + console.info('Add Chabok class import in application class successfully.'); + } + }) + } else { + console.warn( 'Chabok import into application class already added.'); + } + } else { + console.warn( 'data contain ' + FILE_NAME + ' file and ignore to add ' + FILE_NAME + ' name.'); + } + }); + } else { + console.warn('Could not find '+FILE_NAME+' file.'); + } +}; diff --git a/ChabokPush/hooks/removePluginAndroid.js b/ChabokPush/hooks/removePluginAndroid.js new file mode 100644 index 0000000..aced362 --- /dev/null +++ b/ChabokPush/hooks/removePluginAndroid.js @@ -0,0 +1,82 @@ +#!/usr/bin/env node + +const fs = require("fs"); +const path = require("path"); +const utilities = require("./utilities"); + +const IOS_DIR = 'platforms/ios'; +const ANDROID_DIR = 'platforms/android'; + +const config = fs.readFileSync('config.xml').toString(); +const name = utilities.getValue(config, 'name'); + +const PLATFORM = { + IOS: { + dest: [ + IOS_DIR + '/' + name + '/Chabok.sandbox.plist', + 'plugins/com.chabokpush.cordova/src/ios/Chabok.sandbox.plist', + + IOS_DIR + '/' + name + '/Chabok.production.plist', + 'plugins/com.chabokpush.cordova/src/ios/Chabok.production.plist', + ], + src: [ + 'Chabok.sandbox.plist', + IOS_DIR + '/www/Chabok.sandbox.plist', + 'www/Chabok.sandbox.plist', + + 'Chabok.production.plist', + IOS_DIR + '/www/Chabok.production.plist', + 'www/Chabok.production.plist' + ] + }, + ANDROID: { + dest: [ + ANDROID_DIR + '/google-services.json', + ANDROID_DIR + '/app/google-services.json', + + ANDROID_DIR + '/Chabok.sandbox.json', + ANDROID_DIR + '/app/Chabok.sandbox.json', + + ANDROID_DIR + '/Chabok.production.json', + ANDROID_DIR + '/app/Chabok.production.json' + ], + src: [ + 'google-services.json', + ANDROID_DIR + '/assets/www/google-services.json', + 'www/google-services.json', + ANDROID_DIR + '/app/src/main/google-services.json', + + 'Chabok.sandbox.json', + ANDROID_DIR + '/assets/www/Chabok.sandbox.json', + 'www/Chabok.sandbox.json', + ANDROID_DIR + '/app/src/main/Chabok.sandbox.json', + + 'Chabok.production.json', + ANDROID_DIR + '/assets/www/Chabok.production.json', + 'www/Chabok.production.json', + ANDROID_DIR + '/app/src/main/Chabok.production.json' + ], + } +}; + + +module.exports = function(context) { + console.log('(🏁) Start removing iOS config files'); + PLATFORM.IOS.dest.forEach(path => { + utilities.removeFile(path); + }) + console.log('(🔚) Finish removing iOS config files.'); + + console.log('(🏁) Start removing Android config files'); + PLATFORM.ANDROID.dest.forEach(path => { + utilities.removeFile(path); + }) + console.log('(🔚) Finish removing Android config files.'); + + let FILE_NAME = 'MyAppClass.java'; + let platformAndroidRoot = path.join(context.opts.projectRoot, + 'platforms/android/app/src/main/java/com/chabokpush/cordova'); + let applicationClass = path.join(platformAndroidRoot, FILE_NAME); + utilities.removeFile(applicationClass); + +} diff --git a/ChabokPush/hooks/utilities.js b/ChabokPush/hooks/utilities.js new file mode 100644 index 0000000..117c678 --- /dev/null +++ b/ChabokPush/hooks/utilities.js @@ -0,0 +1,135 @@ +/** + * Utilities and shared functionality for the build hooks. + */ +var fs = require('fs'); +var path = require("path"); + +fs.ensureDirSync = function (dir) { + if (!fs.existsSync(dir)) { + dir.split(path.sep).reduce(function (currentPath, folder) { + currentPath += folder + path.sep; + if (!fs.existsSync(currentPath)) { + fs.mkdirSync(currentPath); + } + return currentPath; + }, ''); + } +}; + +module.exports = { + /** + * Used to get the name of the application as defined in the config.xml. + * + * @param {object} context - The Cordova context. + * @returns {string} The value of the name element in config.xml. + */ + getAppName: function (context) { + var ConfigParser = context.requireCordovaModule("cordova-lib").configparser; + var config = new ConfigParser("config.xml"); + return config.name(); + }, + + /** + * The ID of the plugin; this should match the ID in plugin.xml. + */ + getPluginId: function () { + return "cordova-plugin-firebase"; + }, + + copyKey: function (platform, type) { + if (!platform.src || typeof platform.src !== "object"){ + console.warn('Source is undefined or not Array... ' + typeof platform.src); + return; + } + for (let i = 0; i < platform.src.length; i++) { + const file = platform.src[i]; + + if (!this.fileExists(file) && path.basename(file).includes('Chabok.') && type === 'iOS') { + console.log('(⛔️) Could not find ' + path.basename(file) + + ' in root of project. Create fake config file with INVALID-FILE value'); + fs.writeFileSync(file, 'INVALID-FILE'); + } + + if (this.fileExists(file)) { + try { + const contents = fs.readFileSync(file).toString(); + + try { + console.log('(📡) Copy ' + file + ':'); + platform.dest.forEach(function (destinationPath) { + if (path.basename(destinationPath) === path.basename(file)) { + const folder = destinationPath.substring(0, destinationPath.lastIndexOf('/')); + fs.ensureDirSync(folder); + fs.writeFileSync(destinationPath, contents); + console.log('(✅) ' + destinationPath) + } + }); + } catch (e) { + // skip + } + } catch (err) { + console.log('=======>>>>>>>>> ' + err); + } + } else { + console.log('(🟡) ' + file + '(Exists)') + } + } + console.log('Copy all ' + type + ' files successfully'); + }, + + getValue: function (config, name) { + let value = config.match(new RegExp('<' + name + '(.*?)>(.*?)', 'i')); + if (value && value[2]) { + return value[2] + } else { + return null + } + }, + + fileExists: function (path) { + try { + return fs.statSync(path).isFile(); + } catch (e) { + return false; + } + }, + + directoryExists: function (path) { + try { + return fs.statSync(path).isDirectory(); + } catch (e) { + return false; + } + }, + + removeFile: function (path){ + if (this.fileExists(path)) { + try { + fs.unlinkSync(path); + console.log('(🟢) ' + path + '(Removed)'); + } catch (err) { + console.log('(🔴) ' + path + '(Removed: ' + err + ')'); + } + } else { + console.log('(🟡) ' + path + '(Not exists)'); + } + }, + + readChabokEnvFromProcess: function (variables = 'sandbox') { + let variablesStr = variables + if (typeof variables !== "string") { + variablesStr = JSON.stringify(variables); + } + + let envVarName = 'CHABOK_ENVIRONMENT'; + let envIndex = variablesStr.indexOf(envVarName) + if (envIndex === -1) { + return 'sandbox' + } + + let startIndex = envIndex + envVarName.length + 1 + let env = variablesStr.substring(startIndex, startIndex + 3) + + return env.toLowerCase() === 'san' ? 'sandbox' : 'production'; + } +}; diff --git a/ChabokPush/package.json b/ChabokPush/package.json index 3404b5d..ecd3edf 100644 --- a/ChabokPush/package.json +++ b/ChabokPush/package.json @@ -1,6 +1,6 @@ { "name": "com.chabokpush.cordova", - "version": "1.0.0", + "version": "1.1.0", "description": "ChabokPush Realtime messaging", "cordova": { "id": "com.chabokpush.cordova", @@ -15,5 +15,13 @@ "cordova-ios" ], "author": "Chabok Realtime Solutions", - "license": "ISC" + "license": "ISC", + "repository": { + "type": "git", + "url": "git+https://github.com/chabok-io/chabok-starter-cordova.git" + }, + "bugs": { + "url": "https://github.com/chabok-io/chabok-starter-cordova/issues" + }, + "homepage": "https://github.com/chabok-io/chabok-starter-cordova#readme" } diff --git a/ChabokPush/plugin.xml b/ChabokPush/plugin.xml index 1e4132a..8d71aa8 100644 --- a/ChabokPush/plugin.xml +++ b/ChabokPush/plugin.xml @@ -1,6 +1,6 @@ ChabokPush @@ -8,14 +8,30 @@ src="www/ChabokPush.js"> + + + + + + + + + + + + + + + + + - + + @@ -25,11 +41,12 @@ + + target-dir="src/com/chabokpush/cordova"/> + target-dir="src/com/chabokpush/cordova" /> + + + + + + + + + + + @@ -53,8 +81,28 @@ + + + + development + + + production + + + + + + + + + + + + + remote-notification @@ -71,8 +119,8 @@ - + - \ No newline at end of file + diff --git a/ChabokPush/src/android/ChabokPush.java b/ChabokPush/src/android/ChabokPush.java index cbf8b57..a4af62c 100644 --- a/ChabokPush/src/android/ChabokPush.java +++ b/ChabokPush/src/android/ChabokPush.java @@ -2,12 +2,18 @@ import android.content.Context; import android.net.Uri; +import android.os.Bundle; import android.util.Log; +import androidx.core.app.NotificationCompat; + import com.adpdigital.push.AdpPushClient; import com.adpdigital.push.AppState; import com.adpdigital.push.Callback; +import com.adpdigital.push.ChabokNotification; +import com.adpdigital.push.ChabokNotificationAction; import com.adpdigital.push.ConnectionStatus; +import com.adpdigital.push.NotificationHandler; import com.adpdigital.push.config.Environment; import com.adpdigital.push.LogLevel; import com.adpdigital.push.PushMessage; @@ -29,19 +35,42 @@ * This class echoes a string called from JavaScript. */ public class ChabokPush extends CordovaPlugin { - private static final String TAG = "CHK"; + + private String lastConnectionStatues; + private JSONObject lastChabokMessage; private CallbackContext onMessageCallbackContext; private CallbackContext onRegisterCallbackContext; + private CallbackContext onNotificationOpenedContext; private CallbackContext onConnectionStatusCallbackContext; + private boolean setNotificationOpenedHandler = false; + + public static ChabokNotification coldStartChabokNotification; + public static ChabokNotificationAction coldStartChabokNotificationAction; + private String lastMessageId; + @Override protected void pluginInitialize() { final Context context = this.cordova.getActivity().getApplicationContext(); + final ChabokPush that = this; this.cordova.getThreadPool().execute(new Runnable() { public void run() { Log.d(TAG, "Starting Chabok plugin"); AdpPushClient.setApplicationContext(context); + AdpPushClient.get().addListener(that); + + AdpPushClient.get().addNotificationHandler(new NotificationHandler(){ + @Override + public boolean notificationOpened(ChabokNotification message, ChabokNotificationAction notificationAction) { + coldStartChabokNotification = message; + coldStartChabokNotificationAction = notificationAction; + + handleNotificationOpened(); + + return super.notificationOpened(message, notificationAction); + } + }); } }); } @@ -102,9 +131,27 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo return true; } else if (action.equals("setOnMessageCallback")){ this.setOnMessageCallbackContext(callbackContext); + + if (callbackContext != null && this.lastChabokMessage != null){ + successCallback(callbackContext, this.lastChabokMessage); + } return true; } else if (action.equals("setOnConnectionStatusCallback")){ this.setOnConnectionStatusCallbackContext(callbackContext); + + if (callbackContext != null && this.lastConnectionStatues != null){ + successCallback(callbackContext, this.lastConnectionStatues); + } + return true; + } else if (action.equals("setOnNotificationOpenedCallback")){ + this.setOnNotificationOpenedContext(callbackContext); + + coldStartChabokNotification = AdpPushClient.get().getLastNotificationData(); + coldStartChabokNotificationAction = AdpPushClient.get().getLastNotificationAction(); + + if (callbackContext != null && coldStartChabokNotification != null){ + handleNotificationOpened(); + } return true; } return false; @@ -281,6 +328,93 @@ public void setOnConnectionStatusCallbackContext(CallbackContext callbackContext this.onConnectionStatusCallbackContext = callbackContext; } + private void setOnNotificationOpenedContext(CallbackContext callbackContext) { + this.onNotificationOpenedContext = callbackContext; + } + + private void handleNotificationOpened() { + if (coldStartChabokNotificationAction != null && + coldStartChabokNotification != null && + (lastMessageId == null || !lastMessageId.contentEquals(coldStartChabokNotification.getId()))) { + lastMessageId = coldStartChabokNotification.getId(); + + notificationOpenedEvent(coldStartChabokNotification, coldStartChabokNotificationAction); + + coldStartChabokNotification = null; + coldStartChabokNotificationAction = null; + } + } + + private void notificationOpenedEvent(ChabokNotification message, ChabokNotificationAction notificationAction) { + final CallbackContext callbackContext = this.onNotificationOpenedContext; + + final JSONObject response = new JSONObject(); + + try { + if (notificationAction.actionID != null) { + response.put("actionId", notificationAction.actionID); + } + if (notificationAction.actionUrl != null) { + response.put("actionUrl", notificationAction.actionUrl); + } + + if (notificationAction.type == ChabokNotificationAction.ActionType.Opened) { + response.put("actionType", "opened"); + } else if (notificationAction.type == ChabokNotificationAction.ActionType.Dismissed) { + response.put("actionType", "dismissed"); + } else if (notificationAction.type == ChabokNotificationAction.ActionType.ActionTaken) { + response.put("actionType", "action_taken"); + } + + JSONObject msgMap = new JSONObject(); + + if (message.getTitle() != null) { + msgMap.put("title", message.getTitle()); + } + if (message.getId() != null) { + msgMap.put("id", message.getId()); + } + + if (message.getText() != null) { + msgMap.put("body", message.getText()); + } + if (message.getTrackId() != null) { + msgMap.put("trackId", message.getTrackId()); + } + if (message.getTopicName() != null) { + msgMap.put("channel", message.getTopicName()); + } + + if (message.getSound() != null) { + msgMap.put("sound", message.getSound()); + } + + try { + Bundle data = message.getExtras(); + if (data != null) { + msgMap.put("data", data); + } + } catch (JSONException e) { + e.printStackTrace(); + } + + response.put("message", msgMap); + + if (coldStartChabokNotification == null) { + coldStartChabokNotification = message; + } + if (coldStartChabokNotificationAction == null) { + coldStartChabokNotificationAction = notificationAction; + } + + if (response != null && callbackContext != null) { + successCallback(callbackContext, response); + } + } catch (JSONException e) { + e.printStackTrace(); + } + } + public void onEvent(AppState state){ android.util.Log.d(TAG, "=================== onEvent: state = " + state + ", this.onRegisterCallbackContext = " + this.onRegisterCallbackContext); if (state == AppState.REGISTERED){ @@ -330,6 +464,8 @@ public void onEvent(final ConnectionStatus status) { connectionStatus = "DISCONNECTED"; } + this.lastConnectionStatues = connectionStatus; + if (connectionStatus != null && this.onConnectionStatusCallbackContext != null){ successCallback(this.onConnectionStatusCallbackContext, connectionStatus); } @@ -368,6 +504,8 @@ public void run() { e.printStackTrace(); } + lastChabokMessage = message ; + if (message != null && callbackContext != null) { successCallback(callbackContext, message); } diff --git a/ChabokPush/src/android/MyAppClass.java b/ChabokPush/src/android/MyAppClass.java index d5df4a4..0a3006c 100644 --- a/ChabokPush/src/android/MyAppClass.java +++ b/ChabokPush/src/android/MyAppClass.java @@ -7,4 +7,4 @@ public class MyAppClass extends Application { public void onCreate() { super.onCreate(); } -} \ No newline at end of file +} diff --git a/ChabokPush/src/android/build.gradle b/ChabokPush/src/android/build.gradle index 550fa94..239e5ae 100644 --- a/ChabokPush/src/android/build.gradle +++ b/ChabokPush/src/android/build.gradle @@ -4,10 +4,6 @@ repositories { } } -dependencies { - implementation(name:'chabok-lib-3.1.0', ext:'aar') -} - android { packagingOptions { exclude 'META-INF/NOTICE' @@ -18,4 +14,4 @@ android { cdvPluginPostBuildExtras.add({ apply plugin: 'com.google.gms.google-services' apply plugin: 'io.chabok.plugin.chabok-services' -}) \ No newline at end of file +}) diff --git a/ChabokPush/src/android/libs/chabok-lib-3.1.0.aar b/ChabokPush/src/android/libs/chabok-lib-3.1.0.aar deleted file mode 100644 index de5774c..0000000 Binary files a/ChabokPush/src/android/libs/chabok-lib-3.1.0.aar and /dev/null differ diff --git a/ChabokPush/src/ios/ChabokPush.m b/ChabokPush/src/ios/ChabokPush.m index 986226b..3aa3e80 100644 --- a/ChabokPush/src/ios/ChabokPush.m +++ b/ChabokPush/src/ios/ChabokPush.m @@ -18,6 +18,10 @@ void failureCallback(NSString* callbackId, NSDictionary* data) { [pluginCommandDelegate sendPluginResult:commandResult callbackId:callbackId]; } +@interface PushClientManager(PushManager) +-(NSString *) getMessageIdFromPayload:(NSDictionary *)payload; +@end + @interface ChabokPush : CDVPlugin { NSString * _onMessageCallback; NSString * _onRegisterCallback; @@ -26,12 +30,12 @@ @interface ChabokPush : CDVPlugin { // Member variables go here. @property (nonatomic, retain) NSString *appId; -//@property (class) NSDictionary *coldStartNotificationResult; +@property (class) NSDictionary* coldStartNotificationResult; @property (nonatomic, retain) NSString *onMessageCallback; @property (nonatomic, retain) NSString *onRegisterCallback; @property (nonatomic, retain) NSString *onConnectionStatusCallback; -//@property (nonatomic, retain) NSString *notificationOpenedCallback; +@property (nonatomic, retain) NSString *onNotificationOpenedCallback; -(void) configureEnvironment:(CDVInvokedUrlCommand *)command; -(void) login:(CDVInvokedUrlCommand *)command; @@ -52,40 +56,46 @@ -(void) setDefaultTracker:(CDVInvokedUrlCommand *) command; @implementation ChabokPush +@synthesize onMessageCallback = _onMessageCallback; @synthesize onRegisterCallback = _onRegisterCallback; +@synthesize onConnectionStatusCallback = _onConnectionStatusCallback; +@synthesize onNotificationOpenedCallback = _onNotificationOpenedCallback; -//@dynamic coldStartNotificationResult; -//static NSDictionary *_coldStartNotificationResult; +@dynamic coldStartNotificationResult; +static NSDictionary* _coldStartNotificationResult; +NSString* _lastNotificationId; +PushClientMessage* _lastChabokMessage; -(void)pluginInitialize { NSLog(@"Starting Chabok plugin"); + [PushClientManager.defaultManager addDelegate:self]; } -(void)configureEnvironment:(CDVInvokedUrlCommand*)command { - BOOL devMode = [command.arguments objectAtIndex:0]; + BOOL devMode = [[command.arguments objectAtIndex:0] boolValue]; NSInteger chabokEnv = devMode ? 0 : 1; [PushClientManager.defaultManager addDelegate:self]; [PushClientManager.defaultManager setLogLevel:ChabokLogLevelVerbose]; - + BOOL state = [PushClientManager.defaultManager configureEnvironment:chabokEnv]; - + CDVPluginResult* pluginResult = nil; if (state) { NSString *msg = @"Initilized sucessfully"; - - NSLog(msg); + + pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:msg]; } else { NSString *msg = @"Could not init chabok parameters"; - - NSLog(msg); + + NSLog(@"%@", msg); pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:msg]; } if (!command.callbackId) { return; } - + [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; } @@ -93,45 +103,45 @@ -(void)configureEnvironment:(CDVInvokedUrlCommand*)command { -(void)login:(CDVInvokedUrlCommand*)command { CDVPluginResult* pluginResult = nil; - + NSString *userId = [command.arguments objectAtIndex:0]; if (!userId || [userId isEqual:[NSNull null]]){ NSString *msg = @"Could not register userId to chabok"; - - NSLog(msg); + + NSLog(@"%@", msg); pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:msg]; return; } - - BOOL state = [PushClientManager.defaultManager login:userId + + [PushClientManager.defaultManager login:userId handler:^(BOOL isRegistered, NSError *error) { CDVPluginResult* pluginResult = nil; NSLog(@"isRegistered : %d userId : %@ error : %@",isRegistered, userId, error); - + if (error) { if (command.callbackId) { NSDictionary *jsonDic = @{@"registered": @(NO), @"error": error }; NSString *json = [self dictionaryToJson:jsonDic]; - + pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:json]; - + [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; } - + if (_onRegisterCallback){ successCallback(_onRegisterCallback, @(false)); } } else { - + if (command.callbackId) { NSDictionary *jsonDic = @{@"registered": @(YES)}; NSString *json = [self dictionaryToJson:jsonDic]; - + pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:json]; - + [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; } if (_onRegisterCallback){ @@ -154,29 +164,30 @@ -(void) getInstallationId:(CDVInvokedUrlCommand*) command { NSString *installationId = [PushClientManager.defaultManager getInstallationId]; if (!installationId) { NSString *msg = @"The installationId is null, You didn't register yet!"; - - NSLog(msg); + + NSLog(@"%@", msg); pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:msg]; } else { pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:installationId]; } - + [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; } -(void) getUserId:(CDVInvokedUrlCommand*) command { + NSLog(@"getUserId = %@", command.callbackId); CDVPluginResult* pluginResult = nil; NSString *userId = [PushClientManager.defaultManager userId]; if (!userId) { NSString *msg = @"The userId is null, You didn't register yet!"; - - NSLog(msg); + + NSLog(@"%@", msg); pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:msg]; } else { pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:userId]; } - + [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; } @@ -186,15 +197,15 @@ -(void) addTag:(CDVInvokedUrlCommand *) command { CDVPluginResult* pluginResult = nil; NSString *tagName = [command.arguments objectAtIndex:0]; - + //TODO: This should handle in android sdk if (![PushClientManager.defaultManager getInstallationId]) { if (!command.callbackId) { return; } - + CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"UserId not registered yet."]; - + [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; return; } @@ -206,9 +217,9 @@ -(void) addTag:(CDVInvokedUrlCommand *) command { } NSDictionary *jsonDic = @{@"count": @(count)}; NSString *json = [self dictionaryToJson:jsonDic]; - + CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:json]; - + [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; } failure:^(NSError *error) { if (!command.callbackId) { @@ -223,28 +234,28 @@ -(void) addTag:(CDVInvokedUrlCommand *) command { -(void) removeTag:(CDVInvokedUrlCommand *) command { CDVPluginResult* pluginResult = nil; - + NSString *tagName = [command.arguments objectAtIndex:0]; - + [PushClientManager.defaultManager removeTag:tagName success:^(NSInteger count) { if (!command.callbackId) { return; } - + NSDictionary *jsonDic = @{@"count": @(count)}; NSString *json = [self dictionaryToJson:jsonDic]; - + CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:json]; - + [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; } failure:^(NSError *error) { if (!command.callbackId) { return; } - + CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:error.localizedDescription]; - + [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; }]; } @@ -255,31 +266,31 @@ -(void) publish:(CDVInvokedUrlCommand *) command{ CDVPluginResult* pluginResult = nil; NSDictionary *message = [command.arguments objectAtIndex:0]; - + NSDictionary *data = [message valueForKey:@"data"]; NSString *userId = [message valueForKey:@"userId"]; NSString *content = [message valueForKey:@"content"]; NSString *channel = [message valueForKey:@"channel"]; - + PushClientMessage *chabokMessage; if (data) { chabokMessage = [[PushClientMessage alloc] initWithMessage:content withData:data toUserId:userId channel:channel]; } else { chabokMessage = [[PushClientMessage alloc] initWithMessage:content toUserId:userId channel:channel]; } - + BOOL publishState = [PushClientManager.defaultManager publish:chabokMessage]; - + if (publishState) { pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; } else { pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR]; } - + if (!command.callbackId) { return; } - + [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; } @@ -290,7 +301,7 @@ -(void) resetBadge:(CDVInvokedUrlCommand *) command { #pragma mark - track -(void) track:(CDVInvokedUrlCommand *) command { - + //TODO: This should handle in SDK if (![PushClientManager.defaultManager getInstallationId] || PushClientManager.defaultManager.connectionState != PushClientServerConnectedState) { NSLog(@"chabokpush ----------- Not connected, Queue the operation"); @@ -303,7 +314,7 @@ -(void) track:(CDVInvokedUrlCommand *) command { NSLog(@"chabokpush ----------- Track event called"); NSString *trackName = [command.arguments objectAtIndex:0]; NSDictionary *trackData = [command.arguments objectAtIndex:1]; - + [PushClientManager.defaultManager track:trackName data:trackData]; } @@ -324,9 +335,9 @@ -(void) setUserAttributes:(CDVInvokedUrlCommand *) command { -(void) getUserAttributes:(CDVInvokedUrlCommand *) command { CDVPluginResult* pluginResult = nil; NSDictionary *userInfo = PushClientManager.defaultManager.userAttributes; - + NSString *json = [self dictionaryToJson:userInfo]; - + pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:json]; if (!command.callbackId) { return; @@ -342,7 +353,7 @@ -(void) appWillOpenUrl:(CDVInvokedUrlCommand *) command { // if(!link){ // return; // } - + // NSURL *url = [[NSURL alloc] initWithString:link]; // [PushClientManager.defaultManager appWillOpenUrl:url]; } @@ -355,23 +366,146 @@ -(void) appWillOpenUrl:(CDVInvokedUrlCommand *) command { #pragma mark - callback -(void) setOnMessageCallback:(CDVInvokedUrlCommand *) command{ - self.onMessageCallback = command.callbackId; + if ([command isKindOfClass:[NSString class]]) { + _onMessageCallback = command; + } else { + _onMessageCallback = command.callbackId; + } + + if (_onMessageCallback && _lastChabokMessage) { + [self pushClientManagerDidReceivedMessage:_lastChabokMessage]; + } } -(void) setOnRegisterCallback:(CDVInvokedUrlCommand *) command{ - _onRegisterCallback = command.callbackId; + if ([command isKindOfClass:[NSString class]]) { + _onRegisterCallback = command; + } else { + _onRegisterCallback = command.callbackId; + } } -(void) setOnConnectionStatusCallback:(CDVInvokedUrlCommand *) command { - self.onConnectionStatusCallback = command.callbackId; + if ([command isKindOfClass:[NSString class]]) { + _onConnectionStatusCallback = command; + } else { + _onConnectionStatusCallback = command.callbackId; + } + [self sendConnectionStatus]; } -//-(void) setNotificationOpenedHandler:(CDVInvokedUrlCommand *) command{ -// self.notificationOpened = command.callbackId; -//} +-(void) setOnNotificationOpenedCallback:(CDVInvokedUrlCommand *) command{ + if ([command isKindOfClass:[NSString class]]) { + _onNotificationOpenedCallback = command; + } else { + _onNotificationOpenedCallback = command.callbackId; + } -#pragma mark - delegate method --(void) pushClientManagerDidChangedServerConnectionState { + NSDictionary *lastNotification = [PushClientManager.defaultManager lastNotificationAction]; + if (lastNotification) { + NSString *actionId = lastNotification[@"actionId"]; + if (!actionId) { + actionId = [lastNotification[@"actionType"] lowercaseString]; + if ([actionId containsString:@"opened"]) { + if (@available(iOS 10.0, *)) { + actionId = UNNotificationDefaultActionIdentifier; + } + } else { + if (@available(iOS 10.0, *)) { + actionId = UNNotificationDismissActionIdentifier; + } + } + } + // prepare last notification + [ChabokPush notificationOpened:[PushClientManager.defaultManager lastNotificationData] + actionId:actionId]; + + // send notification event + [self handleNotificationOpened]; + } +} + +-(void) handleNotificationOpened { + NSDictionary *payload = (NSDictionary *)[_coldStartNotificationResult valueForKey:@"message"]; + if (payload) { + NSString *messageId = [PushClientManager.defaultManager getMessageIdFromPayload:payload]; + if (_coldStartNotificationResult && messageId && (!_lastNotificationId || ![_lastNotificationId isEqualToString:messageId])) { + _lastNotificationId = messageId; + + if (_onNotificationOpenedCallback) { + CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:payload]; + [result setKeepCallbackAsBool:YES]; + [self.commandDelegate sendPluginResult:result callbackId:_onNotificationOpenedCallback]; + } + _coldStartNotificationResult = nil; + } + } +} + ++(NSDictionary *) notificationOpened:(NSDictionary *) payload actionId:(NSString *) actionId { + NSString *actionType; + NSString *actionUrl; + NSString *actionIdStr = actionId; + NSArray *actions = [payload valueForKey:@"actions"]; + NSString *clickUrl = [payload valueForKey:@"clickUrl"]; + + if (@available(iOS 10.0, *)) { + if ([actionId containsString:UNNotificationDismissActionIdentifier]) { + actionType = @"dismissed"; + actionIdStr = nil; + } else if ([actionId containsString:UNNotificationDefaultActionIdentifier]) { + actionType = @"opened"; + actionIdStr = nil; + } + } else { + actionType = @"action_taken"; + actionIdStr = actionId; + + if (actionIdStr || !actions) { + actionUrl = [ChabokPush getActionUrlFrom:actionIdStr actions:actions]; + } + } + + NSMutableDictionary *notificationData = [NSMutableDictionary new]; + + if (actionType) { + [notificationData setObject:actionType forKey:@"actionType"]; + } + + if (actionIdStr) { + [notificationData setObject:actionIdStr forKey:@"actionId"]; + } + + if (actionUrl) { + [notificationData setObject:actionUrl forKey:@"actionUrl"]; + } else if (clickUrl) { + [notificationData setObject:clickUrl forKey:@"actionUrl"]; + } + + if (!payload) { + _coldStartNotificationResult = nil; + return notificationData; + } + + [notificationData setObject:payload forKey:@"message"]; + + _coldStartNotificationResult = notificationData; + + return notificationData; +} + ++(NSString *) getActionUrlFrom:(NSString *)actionId actions:(NSArray *)actions { + NSString *actionUrl; + for (NSDictionary *action in actions) { + NSString *acId = [action valueForKey:@"id"]; + if ([acId containsString:actionId]) { + actionUrl = [action valueForKey:@"url"]; + } + } + return actionUrl; +} + +-(void) sendConnectionStatus { NSString *connectionState = @""; if (PushClientManager.defaultManager.connectionState == PushClientServerConnectedState) { connectionState = @"CONNECTED"; @@ -386,28 +520,49 @@ -(void) pushClientManagerDidChangedServerConnectionState { } else { connectionState = @"NOT_INITIALIZED"; } - - if (self.onConnectionStatusCallback) { - successCallback(self.onConnectionStatusCallback, connectionState); + + if (_onConnectionStatusCallback) { + NSLog(@"_onConnectionStatusCallback = %@. connectionState = %@",_onConnectionStatusCallback, connectionState); + CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:connectionState]; + [result setKeepCallbackAsBool:YES]; + [self.commandDelegate sendPluginResult:result callbackId:_onConnectionStatusCallback]; } } + +#pragma mark - delegate method +-(void) userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler API_AVAILABLE(ios(10.0)) API_AVAILABLE(ios(10.0)) { + [ChabokPush notificationOpened:response.notification.request.content.userInfo actionId:response.actionIdentifier]; + + [self handleNotificationOpened]; + +} + +-(void) pushClientManagerDidChangedServerConnectionState { + [self sendConnectionStatus]; +} + -(void) pushClientManagerDidReceivedMessage:(PushClientMessage *)message{ NSMutableDictionary *messageDict = [NSMutableDictionary.alloc initWithDictionary:[message toDict]]; [messageDict setObject:message.channel forKey:@"channel"]; - - if (self.onMessageCallback) { - successCallback(self.onMessageCallback, messageDict); + + if (_onMessageCallback) { + CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:messageDict]; + [result setKeepCallbackAsBool:YES]; + [self.commandDelegate sendPluginResult:result callbackId:_onMessageCallback]; + } else { + _lastChabokMessage = message; } } // called when PushClientManager Register User Successfully - (void)pushClientManagerDidRegisterUser:(BOOL)registration{ NSLog(@"------------ %@ %@ cid = %@",@(__PRETTY_FUNCTION__),@(registration), _onRegisterCallback); - + if (_onRegisterCallback) { NSDictionary *successDic = @{@"regisered":@(registration)}; CDVPluginResult* commandResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:successDic]; + commandResult.keepCallback = @1; [self.commandDelegate sendPluginResult:commandResult callbackId:_onRegisterCallback]; } } @@ -415,7 +570,7 @@ - (void)pushClientManagerDidRegisterUser:(BOOL)registration{ // called when PushClientManager Register User failed - (void)pushClientManagerDidFailRegisterUser:(NSError *)error{ NSLog(@"------------ %@ %@ cid = %@",@(__PRETTY_FUNCTION__),error, _onRegisterCallback); - + if (_onRegisterCallback) { NSDictionary *errorDic = @{@"error":error.localizedDescription}; CDVPluginResult* commandResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:errorDic]; @@ -430,12 +585,12 @@ -(NSString *) dictionaryToJson:(NSDictionary *) dic{ NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dic options:NSJSONWritingPrettyPrinted error:&error]; - + if (!jsonData) { NSLog(@"Got an error: %@", error); return nil; } - + return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; } diff --git a/ChabokPush/www/ChabokPush.js b/ChabokPush/www/ChabokPush.js index 131b071..870aece 100644 --- a/ChabokPush/www/ChabokPush.js +++ b/ChabokPush/www/ChabokPush.js @@ -89,13 +89,17 @@ ChabokPush.prototype.setOnConnectionStatusCallback = function (onConnection) { exec(onConnection, function () {}, bridgeName, 'setOnConnectionStatusCallback', []); }; +ChabokPush.prototype.setOnNotificationOpenedCallback = function (notificationOpen) { + exec(notificationOpen, function () {}, bridgeName, 'setOnNotificationOpenedCallback', []); +}; + //------------------------------------------------------------------- if(!window.plugins) window.plugins = {}; -if (!window.plugins.OneSignal) +if (!window.plugins.ChabokPush) window.plugins.ChabokPush = new ChabokPush(); if (typeof module != 'undefined' && module.exports) diff --git a/chabok-starter-cordova/Chabok.sandbox.json b/chabok-starter-cordova/Chabok.sandbox.json new file mode 100644 index 0000000..004df2f --- /dev/null +++ b/chabok-starter-cordova/Chabok.sandbox.json @@ -0,0 +1,8 @@ +{ + "appId": "chabok-starter/839879285435", + "apiKey": "70df4ae2e1fd03518ce3e3b21ee7ca7943577749", + "username": "chabok-starter", + "password": "chabok-starter", + "realtime": true, + "pushNotification": true +} \ No newline at end of file diff --git a/chabok-starter-cordova/Chabok.sandbox.plist b/chabok-starter-cordova/Chabok.sandbox.plist new file mode 100644 index 0000000..512deed --- /dev/null +++ b/chabok-starter-cordova/Chabok.sandbox.plist @@ -0,0 +1,18 @@ + + + + + appId + chabok-starter + apiKey + 70df4ae2e1fd03518ce3e3b21ee7ca7943577749 + username + chabok-starter + password + chabok-starter + realtime + + pushNotification + + + diff --git a/chabok-starter-cordova/google-services.json b/chabok-starter-cordova/google-services.json new file mode 100644 index 0000000..5fca2d2 --- /dev/null +++ b/chabok-starter-cordova/google-services.json @@ -0,0 +1,83 @@ +{ + "project_info": { + "project_number": "827550617186", + "firebase_url": "https://chabok-30b0a.firebaseio.com", + "project_id": "chabok-30b0a", + "storage_bucket": "chabok-30b0a.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:827550617186:android:d63510ce09b87640b98b3b", + "android_client_info": { + "package_name": "com.adpdigital.chabok.starter" + } + }, + "oauth_client": [ + { + "client_id": "827550617186-0rprpcfsk2s6vjf0p3ug7tbl2g841p2f.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyDtZkDV-oqQ1ca7owGMIdWhGZ7hU9l4V8M" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "827550617186-0rprpcfsk2s6vjf0p3ug7tbl2g841p2f.apps.googleusercontent.com", + "client_type": 3 + }, + { + "client_id": "827550617186-2pavpli398554eojje6q4j2g49ilp7rq.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "com.adpdigital.Chabok" + } + } + ] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:827550617186:android:d585240355e30c93b98b3b", + "android_client_info": { + "package_name": "com.example.chaboktest" + } + }, + "oauth_client": [ + { + "client_id": "827550617186-0rprpcfsk2s6vjf0p3ug7tbl2g841p2f.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyDtZkDV-oqQ1ca7owGMIdWhGZ7hU9l4V8M" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "827550617186-0rprpcfsk2s6vjf0p3ug7tbl2g841p2f.apps.googleusercontent.com", + "client_type": 3 + }, + { + "client_id": "827550617186-2pavpli398554eojje6q4j2g49ilp7rq.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "com.adpdigital.Chabok" + } + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/.bin/create b/chabok-starter-cordova/node_modules/.bin/create deleted file mode 120000 index 077b8f8..0000000 --- a/chabok-starter-cordova/node_modules/.bin/create +++ /dev/null @@ -1 +0,0 @@ -../cordova-android/bin/create \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/.bin/ios-sim b/chabok-starter-cordova/node_modules/.bin/ios-sim deleted file mode 120000 index c435a8c..0000000 --- a/chabok-starter-cordova/node_modules/.bin/ios-sim +++ /dev/null @@ -1 +0,0 @@ -../ios-sim/bin/ios-sim \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/.bin/nopt b/chabok-starter-cordova/node_modules/.bin/nopt deleted file mode 120000 index 6b6566e..0000000 --- a/chabok-starter-cordova/node_modules/.bin/nopt +++ /dev/null @@ -1 +0,0 @@ -../nopt/bin/nopt.js \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/.bin/semver b/chabok-starter-cordova/node_modules/.bin/semver deleted file mode 120000 index 317eb29..0000000 --- a/chabok-starter-cordova/node_modules/.bin/semver +++ /dev/null @@ -1 +0,0 @@ -../semver/bin/semver \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/.bin/shjs b/chabok-starter-cordova/node_modules/.bin/shjs deleted file mode 120000 index a044997..0000000 --- a/chabok-starter-cordova/node_modules/.bin/shjs +++ /dev/null @@ -1 +0,0 @@ -../shelljs/bin/shjs \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/.bin/tape b/chabok-starter-cordova/node_modules/.bin/tape deleted file mode 120000 index dc4bc23..0000000 --- a/chabok-starter-cordova/node_modules/.bin/tape +++ /dev/null @@ -1 +0,0 @@ -../tape/bin/tape \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/.bin/uuid b/chabok-starter-cordova/node_modules/.bin/uuid deleted file mode 120000 index b3e45bc..0000000 --- a/chabok-starter-cordova/node_modules/.bin/uuid +++ /dev/null @@ -1 +0,0 @@ -../uuid/bin/uuid \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/.bin/which b/chabok-starter-cordova/node_modules/.bin/which deleted file mode 120000 index f62471c..0000000 --- a/chabok-starter-cordova/node_modules/.bin/which +++ /dev/null @@ -1 +0,0 @@ -../which/bin/which \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/abbrev/LICENSE b/chabok-starter-cordova/node_modules/abbrev/LICENSE deleted file mode 100644 index 9bcfa9d..0000000 --- a/chabok-starter-cordova/node_modules/abbrev/LICENSE +++ /dev/null @@ -1,46 +0,0 @@ -This software is dual-licensed under the ISC and MIT licenses. -You may use this software under EITHER of the following licenses. - ----------- - -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ----------- - -Copyright Isaac Z. Schlueter and Contributors -All rights reserved. - -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. diff --git a/chabok-starter-cordova/node_modules/abbrev/README.md b/chabok-starter-cordova/node_modules/abbrev/README.md deleted file mode 100644 index 99746fe..0000000 --- a/chabok-starter-cordova/node_modules/abbrev/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# abbrev-js - -Just like [ruby's Abbrev](http://apidock.com/ruby/Abbrev). - -Usage: - - var abbrev = require("abbrev"); - abbrev("foo", "fool", "folding", "flop"); - - // returns: - { fl: 'flop' - , flo: 'flop' - , flop: 'flop' - , fol: 'folding' - , fold: 'folding' - , foldi: 'folding' - , foldin: 'folding' - , folding: 'folding' - , foo: 'foo' - , fool: 'fool' - } - -This is handy for command-line scripts, or other cases where you want to be able to accept shorthands. diff --git a/chabok-starter-cordova/node_modules/abbrev/abbrev.js b/chabok-starter-cordova/node_modules/abbrev/abbrev.js deleted file mode 100644 index 7b1dc5d..0000000 --- a/chabok-starter-cordova/node_modules/abbrev/abbrev.js +++ /dev/null @@ -1,61 +0,0 @@ -module.exports = exports = abbrev.abbrev = abbrev - -abbrev.monkeyPatch = monkeyPatch - -function monkeyPatch () { - Object.defineProperty(Array.prototype, 'abbrev', { - value: function () { return abbrev(this) }, - enumerable: false, configurable: true, writable: true - }) - - Object.defineProperty(Object.prototype, 'abbrev', { - value: function () { return abbrev(Object.keys(this)) }, - enumerable: false, configurable: true, writable: true - }) -} - -function abbrev (list) { - if (arguments.length !== 1 || !Array.isArray(list)) { - list = Array.prototype.slice.call(arguments, 0) - } - for (var i = 0, l = list.length, args = [] ; i < l ; i ++) { - args[i] = typeof list[i] === "string" ? list[i] : String(list[i]) - } - - // sort them lexicographically, so that they're next to their nearest kin - args = args.sort(lexSort) - - // walk through each, seeing how much it has in common with the next and previous - var abbrevs = {} - , prev = "" - for (var i = 0, l = args.length ; i < l ; i ++) { - var current = args[i] - , next = args[i + 1] || "" - , nextMatches = true - , prevMatches = true - if (current === next) continue - for (var j = 0, cl = current.length ; j < cl ; j ++) { - var curChar = current.charAt(j) - nextMatches = nextMatches && curChar === next.charAt(j) - prevMatches = prevMatches && curChar === prev.charAt(j) - if (!nextMatches && !prevMatches) { - j ++ - break - } - } - prev = current - if (j === cl) { - abbrevs[current] = current - continue - } - for (var a = current.substr(0, j) ; j <= cl ; j ++) { - abbrevs[a] = current - a += current.charAt(j) - } - } - return abbrevs -} - -function lexSort (a, b) { - return a === b ? 0 : a > b ? 1 : -1 -} diff --git a/chabok-starter-cordova/node_modules/abbrev/package.json b/chabok-starter-cordova/node_modules/abbrev/package.json deleted file mode 100644 index 7556c96..0000000 --- a/chabok-starter-cordova/node_modules/abbrev/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "_from": "abbrev@1", - "_id": "abbrev@1.1.1", - "_inBundle": false, - "_integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "_location": "/abbrev", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "abbrev@1", - "name": "abbrev", - "escapedName": "abbrev", - "rawSpec": "1", - "saveSpec": null, - "fetchSpec": "1" - }, - "_requiredBy": [ - "/nopt" - ], - "_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "_shasum": "f8f2c887ad10bf67f634f005b6987fed3179aac8", - "_spec": "abbrev@1", - "_where": "/Users/farbod/Documents/Github/chabok/chabok-starter-cordova/chabok-starter-cordova/node_modules/nopt", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me" - }, - "bugs": { - "url": "https://github.com/isaacs/abbrev-js/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Like ruby's abbrev module, but in js", - "devDependencies": { - "tap": "^10.1" - }, - "files": [ - "abbrev.js" - ], - "homepage": "https://github.com/isaacs/abbrev-js#readme", - "license": "ISC", - "main": "abbrev.js", - "name": "abbrev", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/isaacs/abbrev-js.git" - }, - "scripts": { - "postpublish": "git push origin --all; git push origin --tags", - "postversion": "npm publish", - "preversion": "npm test", - "test": "tap test.js --100" - }, - "version": "1.1.1" -} diff --git a/chabok-starter-cordova/node_modules/android-versions/.jshintignore b/chabok-starter-cordova/node_modules/android-versions/.jshintignore deleted file mode 100644 index 2e98972..0000000 --- a/chabok-starter-cordova/node_modules/android-versions/.jshintignore +++ /dev/null @@ -1,8 +0,0 @@ -.git/ -node_modules/ -coverage/ -build/ -assets/ -dist/ -docs/ -tests/ \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/android-versions/.jshintrc b/chabok-starter-cordova/node_modules/android-versions/.jshintrc deleted file mode 100644 index 427d629..0000000 --- a/chabok-starter-cordova/node_modules/android-versions/.jshintrc +++ /dev/null @@ -1,29 +0,0 @@ -{ - "esversion": 6, - "indent": 2, - "forin": true, - "noarg": true, - "bitwise": true, - "nonew": true, - "strict": true, - - "browser": true, - "devel": true, - "node": false, - "jquery": false, - "esnext": false, - "moz": false, - "es3": false, - - "asi": true, - - "eqnull": true, - "debug": true, - "boss": true, - "evil": true, - "loopfunc": true, - "laxbreak": true, - - "unused": true, - "undef": true -} \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/android-versions/.travis.yml b/chabok-starter-cordova/node_modules/android-versions/.travis.yml deleted file mode 100644 index 4c19fbe..0000000 --- a/chabok-starter-cordova/node_modules/android-versions/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - "6.1.0" \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/android-versions/README.md b/chabok-starter-cordova/node_modules/android-versions/README.md deleted file mode 100644 index 79d63bc..0000000 --- a/chabok-starter-cordova/node_modules/android-versions/README.md +++ /dev/null @@ -1,87 +0,0 @@ -Android Versions -================ - -A node module to get Android versions by API level, NDK level, semantic version, or version name. - -Versions are referenced from [source.android.com/source/build-numbers.html](https://source.android.com/source/build-numbers.html#platform-code-names-versions-api-levels-and-ndk-releases). The version for "Current Development Build" (`"CUR_DEVELOPMENT"`) is not included in the list of `VERSIONS`. - -[![NPM version][npm-image]][npm-url] -[![build status][travis-image]][travis-url] - -[npm-image]: https://img.shields.io/npm/v/android-versions.svg?style=flat-square -[npm-url]: https://npmjs.org/package/android-versions -[travis-image]: https://img.shields.io/travis/dvoiss/android-versions.svg?style=flat-square -[travis-url]: https://travis-ci.org/dvoiss/android-versions - -## Install - -```bash -# NPM -npm install android-versions --save -# YARN -yarn add android-versions -``` - -## Usage - -View the tests for more advanced usage. - -```javascript -const android = require('android-versions') -``` - -#### Get by API level: -```javascript -console.log(android.get(23)) - -=> { api: 23, ndk: 8, semver: "6.0", name: "Marshmallow", versionCode: "M" } -``` - -#### Get by version: - -```javascript -console.log(android.get("2.3.3")) - -=> { api: 10, ndk: 5, semver: "2.3.3", name: "Gingerbread", versionCode: "GINGERBREAD_MR1" } -``` - -#### Get all by predicate: - -``` -android.getAll((version) => { - return version.ndk > 5 && version.api < 15 -}).map((version) => version.versionCode) - -=> [ "HONEYCOMB_MR1", "HONEYCOMB_MR2", "ICE_CREAM_SANDWICH" ] -``` - -#### Access a specific version with all info: - -``` -android.LOLLIPOP - -=> { api: 21, ndk: 8, semver: "5.0", name: "Lollipop", versionCode: "LOLLIPOP" } -``` - -#### Access the complete reference of Android versions with all info: - -```javascript -android.VERSIONS - -=> { - BASE: { api: 1, ndk: 0, semver: "1.0", name: "(no code name)", versionCode: "BASE" }, - ... - N: { api: 24, ndk: 8, semver: "7.0", name: "Nougat", versionCode: "N" } - ... -} -``` - -## Test - -```bash -npm run test -``` - -## License - -MIT \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/android-versions/index.js b/chabok-starter-cordova/node_modules/android-versions/index.js deleted file mode 100644 index 8755820..0000000 --- a/chabok-starter-cordova/node_modules/android-versions/index.js +++ /dev/null @@ -1,162 +0,0 @@ -/** - * Copyright (c) 2016, David Voiss - * - * Permission to use, copy, modify, and/or distribute this software for any purpose - * with or without fee is hereby granted, provided that the above copyright notice - * and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS - * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - * THIS SOFTWARE. -*/ - -/* jshint node: true */ -"use strict"; - -/** - * A module to get Android versions by API level, NDK level, semantic version, or version name. - * - * Versions are referenced from here: - * {@link https://source.android.com/source/build-numbers.html#platform-code-names-versions-api-levels-and-ndk-releases} - * {@link https://github.com/android/platform_frameworks_base/blob/master/core/java/android/os/Build.java} - * - * The version for "Current Development Build" ("CUR_DEVELOPMENT") is not included. - * - * @module android-versions - */ - -var VERSIONS = { - BASE: { api: 1, ndk: 0, semver: "1.0", name: "(no code name)", }, - BASE_1_1: { api: 2, ndk: 0, semver: "1.1", name: "(no code name)", }, - CUPCAKE: { api: 3, ndk: 1, semver: "1.5", name: "Cupcake", }, - DONUT: { api: 4, ndk: 2, semver: "1.6", name: "Donut", }, - ECLAIR: { api: 5, ndk: 2, semver: "2.0", name: "Eclair", }, - ECLAIR_0_1: { api: 6, ndk: 2, semver: "2.0.1", name: "Eclair", }, - ECLAIR_MR1: { api: 7, ndk: 3, semver: "2.1", name: "Eclair", }, - FROYO: { api: 8, ndk: 4, semver: "2.2.x", name: "Froyo", }, - GINGERBREAD: { api: 9, ndk: 5, semver: "2.3.0 - 2.3.2", name: "Gingerbread", }, - GINGERBREAD_MR1: { api: 10, ndk: 5, semver: "2.3.3 - 2.3.7", name: "Gingerbread", }, - HONEYCOMB: { api: 11, ndk: 5, semver: "3.0", name: "Honeycomb", }, - HONEYCOMB_MR1: { api: 12, ndk: 6, semver: "3.1", name: "Honeycomb", }, - HONEYCOMB_MR2: { api: 13, ndk: 6, semver: "3.2.x", name: "Honeycomb", }, - ICE_CREAM_SANDWICH: { api: 14, ndk: 7, semver: "4.0.1 - 4.0.2", name: "Ice Cream Sandwich", }, - ICE_CREAM_SANDWICH_MR1: { api: 15, ndk: 8, semver: "4.0.3 - 4.0.4", name: "Ice Cream Sandwich", }, - JELLY_BEAN: { api: 16, ndk: 8, semver: "4.1.x", name: "Jellybean", }, - JELLY_BEAN_MR1: { api: 17, ndk: 8, semver: "4.2.x", name: "Jellybean", }, - JELLY_BEAN_MR2: { api: 18, ndk: 8, semver: "4.3.x", name: "Jellybean", }, - KITKAT: { api: 19, ndk: 8, semver: "4.4.0 - 4.4.4", name: "KitKat", }, - KITKAT_WATCH: { api: 20, ndk: 8, semver: "4.4", name: "KitKat Watch", }, - LOLLIPOP: { api: 21, ndk: 8, semver: "5.0", name: "Lollipop", }, - LOLLIPOP_MR1: { api: 22, ndk: 8, semver: "5.1", name: "Lollipop", }, - M: { api: 23, ndk: 8, semver: "6.0", name: "Marshmallow", }, - N: { api: 24, ndk: 8, semver: "7.0", name: "Nougat", }, - N_MR1: { api: 25, ndk: 8, semver: "7.1", name: "Nougat", }, - O: { api: 26, ndk: 8, semver: "8.0.0", name: "Oreo", }, - O_MR1: { api: 27, ndk: 8, semver: "8.1.0", name: "Oreo", }, - P: { api: 28, ndk: 8, semver: "9", name: "Pie", }, - Q: { api: 29, ndk: 8, semver: "10", name: "Android10", } -} - -// Add a key to each version of Android for the "versionCode". -// This is the same key we use in the VERSIONS map above. -Object.keys(VERSIONS).forEach(function(version) { - VERSIONS[version].versionCode = version -}) - -var semver = require('semver'); - -// semver format requires .. but we allow just . format. -// Coerce . to ..0 -function formatSemver(semver) { - if (semver.match(/^\d+.\d+$/)) { - return semver + '.0' - } else { - return semver - } -} - -// The default predicate compares against API level, semver, name, or code. -function getFromDefaultPredicate(arg) { - // Coerce arg to string for comparisons below. - arg = arg.toString() - - return getFromPredicate(function(version) { - // Check API level before all else. - if (arg === version.api.toString()) { - return true - } - - var argSemver = formatSemver(arg) - var versionSemver = formatSemver(version.semver) - - if (semver.valid(argSemver) && semver.satisfies(argSemver, versionSemver)) { - return true - } - - // Compare version name and code. - return arg === version.name || arg === version.versionCode - }) -} - -// The function to allow passing a predicate. -function getFromPredicate(predicate) { - if (predicate === null) { - return null - } - - return Object.keys(VERSIONS).filter(function(version) { - return predicate(VERSIONS[version]) - }).map(function(key) { return VERSIONS[key] }) -} - -/** - * The Android version codes available as keys for easier look-up. - */ -Object.keys(VERSIONS).forEach(function(name) { - exports[name] = VERSIONS[name] -}) - -/** - * The complete reference of Android versions for easier look-up. - */ -exports.VERSIONS = VERSIONS - -/** - * Retrieve a single Android version. - * - * @param {object | Function} arg - The value or predicate to use to retrieve values. - * - * @return {object} An object representing the version found or null if none found. - */ -exports.get = function(arg) { - var result = exports.getAll(arg) - - if (result === null || result.length === 0) { - return null - } - - return result[0] -} - -/** - * Retrieve all Android versions that meet the criteria of the argument. - * - * @param {object | Function} arg - The value or predicate to use to retrieve values. - * - * @return {object} An object representing the version found or null if none found. - */ -exports.getAll = function(arg) { - if (arg === null) { - return null - } - - if (typeof arg === "function") { - return getFromPredicate(arg) - } else { - return getFromDefaultPredicate(arg) - } -} \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/android-versions/package.json b/chabok-starter-cordova/node_modules/android-versions/package.json deleted file mode 100644 index 7e0e68b..0000000 --- a/chabok-starter-cordova/node_modules/android-versions/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "_from": "android-versions@^1.4.0", - "_id": "android-versions@1.5.0", - "_inBundle": false, - "_integrity": "sha512-/GWUAqa2OJNlDF5VGSe3SR1QMHEPXxx54Ur56r0qQC0H9FlBr7kyBF2SgVEhzFCPbrW4UcYgVuWrq/2Ty3QvXg==", - "_location": "/android-versions", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "android-versions@^1.4.0", - "name": "android-versions", - "escapedName": "android-versions", - "rawSpec": "^1.4.0", - "saveSpec": null, - "fetchSpec": "^1.4.0" - }, - "_requiredBy": [ - "/cordova-android" - ], - "_resolved": "https://registry.npmjs.org/android-versions/-/android-versions-1.5.0.tgz", - "_shasum": "7790bc74e0812aafd69fb1ad0cb4db4474a525d6", - "_spec": "android-versions@^1.4.0", - "_where": "/Users/farbod/Documents/Github/chabok/chabok-starter-cordova/chabok-starter-cordova/node_modules/cordova-android", - "author": { - "name": "dvoiss" - }, - "bugs": { - "url": "https://github.com/dvoiss/android-versions/issues" - }, - "bundleDependencies": false, - "dependencies": { - "semver": "^5.4.1" - }, - "deprecated": false, - "description": "Get the name, API level, version level, NDK level, or version code from any version of Android.", - "devDependencies": { - "jshint": "^2.9.6", - "tape": "^4.6.0" - }, - "homepage": "https://github.com/dvoiss/android-versions#readme", - "keywords": [ - "android", - "version", - "versions", - "ndk", - "nougat", - "marshmallow", - "api", - "level" - ], - "license": "MIT", - "main": "index.js", - "name": "android-versions", - "pre-commit": [ - "jshint" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/dvoiss/android-versions.git" - }, - "scripts": { - "jshint": "jshint .", - "test": "tape tests/**/*.js" - }, - "version": "1.5.0" -} diff --git a/chabok-starter-cordova/node_modules/android-versions/tests/index.test.js b/chabok-starter-cordova/node_modules/android-versions/tests/index.test.js deleted file mode 100644 index 237f06a..0000000 --- a/chabok-starter-cordova/node_modules/android-versions/tests/index.test.js +++ /dev/null @@ -1,119 +0,0 @@ -"use strict"; - -const test = require('tape') -const android = require('..') - -test('get specific version by API level', (t) => { - t.plan(1) - t.equal(android.get(24).name, "Nougat") -}) - -test('getAll versions by API level', (t) => { - t.plan(1) - t.equal(android.getAll(24)[0].name, "Nougat") -}) - -test('get specific version by predicate', (t) => { - t.plan(2) - - let actual = android.get((version) => { - return version.name.indexOf("on") !== -1 - }) - t.equal(actual.name, "Donut") - - actual = android.get((version) => { - return version.ndk > 5 && version.api < 15 - }) - t.equal(actual.versionCode, "HONEYCOMB_MR1") -}) - -test('getAll versions by predicate', (t) => { - t.plan(3) - - let actual = android.getAll((version) => { - return version.name.indexOf("on") !== -1 - }).map((version) => version.name) - t.deepEqual(actual, ["Donut", "Honeycomb", "Honeycomb", "Honeycomb"]) - - actual = android.getAll((version) => { - return version.ndk > 5 && version.api < 15 - }).map((version) => version.versionCode) - t.deepEqual(actual, ["HONEYCOMB_MR1", "HONEYCOMB_MR2", "ICE_CREAM_SANDWICH"]) - - actual = android.getAll((version) => { - return version.api > 22 - }).map((version) => version.versionCode) - t.deepEqual(actual, ["M", "N", "N_MR1", "O", "O_MR1", "P", "Q"]) -}) - -test('get version by semantic version', (t) => { - t.plan(4) - t.equal(android.get("6.0").versionCode, android.M.versionCode) - t.equal(android.get("6.0.0").versionCode, android.M.versionCode) - t.equal(android.get("2.3").versionCode, android.GINGERBREAD.versionCode) - t.equal(android.get("2.3.3").versionCode, android.GINGERBREAD_MR1.versionCode) -}) - -test('support major version only', (t) => { - t.plan(2) - t.equal(android.get("9.0").versionCode, android.P.versionCode) - t.equal(android.get("9.0.0").versionCode, android.P.versionCode) -}) - -test('support version ranges', (t) => { - t.plan(7) - let tests = [ "4.4", "4.4.0", "4.4.1", "4.4.2", "4.4.3", "4.4.4" ] - tests.forEach((versionCode) => { - t.equal(android.get(versionCode).versionCode, android.KITKAT.versionCode) - }) - t.equal(android.get("4.4.5"), null) -}) - -test('support x-ranges', (t) => { - t.plan(12) - let tests = [ - "4.1", "4.1.0", "4.1.1", "4.1.2", "4.1.3", "4.1.4", - "4.1.5", "4.1.6", "4.1.7", "4.1.8", "4.1.9", "4.1.10" - ] - tests.forEach((versionCode) => { - t.equal(android.get(versionCode).versionCode, android.JELLY_BEAN.versionCode) - }) -}) - -test('access version codes object', (t) => { - t.plan(1) - t.ok(android.VERSIONS) -}) - -test('access specific versions directly', (t) => { - t.plan(29) - t.ok(android.BASE) - t.ok(android.BASE_1_1) - t.ok(android.CUPCAKE) - t.ok(android.DONUT) - t.ok(android.ECLAIR) - t.ok(android.ECLAIR_0_1) - t.ok(android.ECLAIR_MR1) - t.ok(android.FROYO) - t.ok(android.GINGERBREAD) - t.ok(android.GINGERBREAD_MR1) - t.ok(android.HONEYCOMB) - t.ok(android.HONEYCOMB_MR1) - t.ok(android.HONEYCOMB_MR2) - t.ok(android.ICE_CREAM_SANDWICH) - t.ok(android.ICE_CREAM_SANDWICH_MR1) - t.ok(android.JELLY_BEAN) - t.ok(android.JELLY_BEAN_MR1) - t.ok(android.JELLY_BEAN_MR2) - t.ok(android.KITKAT) - t.ok(android.KITKAT_WATCH) - t.ok(android.LOLLIPOP) - t.ok(android.LOLLIPOP_MR1) - t.ok(android.M) - t.ok(android.N) - t.ok(android.N_MR1) - t.ok(android.O) - t.ok(android.O_MR1) - t.ok(android.P) - t.ok(android.Q) -}) diff --git a/chabok-starter-cordova/node_modules/ansi/.jshintrc b/chabok-starter-cordova/node_modules/ansi/.jshintrc deleted file mode 100644 index 248c542..0000000 --- a/chabok-starter-cordova/node_modules/ansi/.jshintrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "laxcomma": true, - "asi": true -} diff --git a/chabok-starter-cordova/node_modules/ansi/.npmignore b/chabok-starter-cordova/node_modules/ansi/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/chabok-starter-cordova/node_modules/ansi/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/chabok-starter-cordova/node_modules/ansi/History.md b/chabok-starter-cordova/node_modules/ansi/History.md deleted file mode 100644 index aea8aaf..0000000 --- a/chabok-starter-cordova/node_modules/ansi/History.md +++ /dev/null @@ -1,23 +0,0 @@ - -0.3.1 / 2016-01-14 -================== - - * add MIT LICENSE file (#23, @kasicka) - * preserve chaining after redundant style-method calls (#19, @drewblaisdell) - * package: add "license" field (#16, @BenjaminTsai) - -0.3.0 / 2014-05-09 -================== - - * package: remove "test" script and "devDependencies" - * package: remove "engines" section - * pacakge: remove "bin" section - * package: beautify - * examples: remove `starwars` example (#15) - * Documented goto, horizontalAbsolute, and eraseLine methods in README.md (#12, @Jammerwoch) - * add `.jshintrc` file - -< 0.3.0 -======= - - * Prehistoric diff --git a/chabok-starter-cordova/node_modules/ansi/LICENSE b/chabok-starter-cordova/node_modules/ansi/LICENSE deleted file mode 100644 index 2ea4dc5..0000000 --- a/chabok-starter-cordova/node_modules/ansi/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -(The MIT License) - -Copyright (c) 2012 Nathan Rajlich - -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. diff --git a/chabok-starter-cordova/node_modules/ansi/README.md b/chabok-starter-cordova/node_modules/ansi/README.md deleted file mode 100644 index 6ce1940..0000000 --- a/chabok-starter-cordova/node_modules/ansi/README.md +++ /dev/null @@ -1,98 +0,0 @@ -ansi.js -========= -### Advanced ANSI formatting tool for Node.js - -`ansi.js` is a module for Node.js that provides an easy-to-use API for -writing ANSI escape codes to `Stream` instances. ANSI escape codes are used to do -fancy things in a terminal window, like render text in colors, delete characters, -lines, the entire window, or hide and show the cursor, and lots more! - -#### Features: - - * 256 color support for the terminal! - * Make a beep sound from your terminal! - * Works with *any* writable `Stream` instance. - * Allows you to move the cursor anywhere on the terminal window. - * Allows you to delete existing contents from the terminal window. - * Allows you to hide and show the cursor. - * Converts CSS color codes and RGB values into ANSI escape codes. - * Low-level; you are in control of when escape codes are used, it's not abstracted. - - -Installation ------------- - -Install with `npm`: - -``` bash -$ npm install ansi -``` - - -Example -------- - -``` js -var ansi = require('ansi') - , cursor = ansi(process.stdout) - -// You can chain your calls forever: -cursor - .red() // Set font color to red - .bg.grey() // Set background color to grey - .write('Hello World!') // Write 'Hello World!' to stdout - .bg.reset() // Reset the bgcolor before writing the trailing \n, - // to avoid Terminal glitches - .write('\n') // And a final \n to wrap things up - -// Rendering modes are persistent: -cursor.hex('#660000').bold().underline() - -// You can use the regular logging functions, text will be green: -console.log('This is blood red, bold text') - -// To reset just the foreground color: -cursor.fg.reset() - -console.log('This will still be bold') - -// to go to a location (x,y) on the console -// note: 1-indexed, not 0-indexed: -cursor.goto(10, 5).write('Five down, ten over') - -// to clear the current line: -cursor.horizontalAbsolute(0).eraseLine().write('Starting again') - -// to go to a different column on the current line: -cursor.horizontalAbsolute(5).write('column five') - -// Clean up after yourself! -cursor.reset() -``` - - -License -------- - -(The MIT License) - -Copyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net> - -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. diff --git a/chabok-starter-cordova/node_modules/ansi/examples/beep/index.js b/chabok-starter-cordova/node_modules/ansi/examples/beep/index.js deleted file mode 100755 index c1ec929..0000000 --- a/chabok-starter-cordova/node_modules/ansi/examples/beep/index.js +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env node - -/** - * Invokes the terminal "beep" sound once per second on every exact second. - */ - -process.title = 'beep' - -var cursor = require('../../')(process.stdout) - -function beep () { - cursor.beep() - setTimeout(beep, 1000 - (new Date()).getMilliseconds()) -} - -setTimeout(beep, 1000 - (new Date()).getMilliseconds()) diff --git a/chabok-starter-cordova/node_modules/ansi/examples/clear/index.js b/chabok-starter-cordova/node_modules/ansi/examples/clear/index.js deleted file mode 100755 index 6ac21ff..0000000 --- a/chabok-starter-cordova/node_modules/ansi/examples/clear/index.js +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env node - -/** - * Like GNU ncurses "clear" command. - * https://github.com/mscdex/node-ncurses/blob/master/deps/ncurses/progs/clear.c - */ - -process.title = 'clear' - -function lf () { return '\n' } - -require('../../')(process.stdout) - .write(Array.apply(null, Array(process.stdout.getWindowSize()[1])).map(lf).join('')) - .eraseData(2) - .goto(1, 1) diff --git a/chabok-starter-cordova/node_modules/ansi/examples/cursorPosition.js b/chabok-starter-cordova/node_modules/ansi/examples/cursorPosition.js deleted file mode 100755 index 50f9644..0000000 --- a/chabok-starter-cordova/node_modules/ansi/examples/cursorPosition.js +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env node - -var tty = require('tty') -var cursor = require('../')(process.stdout) - -// listen for the queryPosition report on stdin -process.stdin.resume() -raw(true) - -process.stdin.once('data', function (b) { - var match = /\[(\d+)\;(\d+)R$/.exec(b.toString()) - if (match) { - var xy = match.slice(1, 3).reverse().map(Number) - console.error(xy) - } - - // cleanup and close stdin - raw(false) - process.stdin.pause() -}) - - -// send the query position request code to stdout -cursor.queryPosition() - -function raw (mode) { - if (process.stdin.setRawMode) { - process.stdin.setRawMode(mode) - } else { - tty.setRawMode(mode) - } -} diff --git a/chabok-starter-cordova/node_modules/ansi/examples/progress/index.js b/chabok-starter-cordova/node_modules/ansi/examples/progress/index.js deleted file mode 100644 index d28dbda..0000000 --- a/chabok-starter-cordova/node_modules/ansi/examples/progress/index.js +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env node - -var assert = require('assert') - , ansi = require('../../') - -function Progress (stream, width) { - this.cursor = ansi(stream) - this.delta = this.cursor.newlines - this.width = width | 0 || 10 - this.open = '[' - this.close = ']' - this.complete = '█' - this.incomplete = '_' - - // initial render - this.progress = 0 -} - -Object.defineProperty(Progress.prototype, 'progress', { - get: get - , set: set - , configurable: true - , enumerable: true -}) - -function get () { - return this._progress -} - -function set (v) { - this._progress = Math.max(0, Math.min(v, 100)) - - var w = this.width - this.complete.length - this.incomplete.length - , n = w * (this._progress / 100) | 0 - , i = w - n - , com = c(this.complete, n) - , inc = c(this.incomplete, i) - , delta = this.cursor.newlines - this.delta - - assert.equal(com.length + inc.length, w) - - if (delta > 0) { - this.cursor.up(delta) - this.delta = this.cursor.newlines - } - - this.cursor - .horizontalAbsolute(0) - .eraseLine(2) - .fg.white() - .write(this.open) - .fg.grey() - .bold() - .write(com) - .resetBold() - .write(inc) - .fg.white() - .write(this.close) - .fg.reset() - .write('\n') -} - -function c (char, length) { - return Array.apply(null, Array(length)).map(function () { - return char - }).join('') -} - - - - -// Usage -var width = parseInt(process.argv[2], 10) || process.stdout.getWindowSize()[0] / 2 - , p = new Progress(process.stdout, width) - -;(function tick () { - p.progress += Math.random() * 5 - p.cursor - .eraseLine(2) - .write('Progress: ') - .bold().write(p.progress.toFixed(2)) - .write('%') - .resetBold() - .write('\n') - if (p.progress < 100) - setTimeout(tick, 100) -})() diff --git a/chabok-starter-cordova/node_modules/ansi/lib/ansi.js b/chabok-starter-cordova/node_modules/ansi/lib/ansi.js deleted file mode 100644 index b1714e3..0000000 --- a/chabok-starter-cordova/node_modules/ansi/lib/ansi.js +++ /dev/null @@ -1,405 +0,0 @@ - -/** - * References: - * - * - http://en.wikipedia.org/wiki/ANSI_escape_code - * - http://www.termsys.demon.co.uk/vtansi.htm - * - */ - -/** - * Module dependencies. - */ - -var emitNewlineEvents = require('./newlines') - , prefix = '\x1b[' // For all escape codes - , suffix = 'm' // Only for color codes - -/** - * The ANSI escape sequences. - */ - -var codes = { - up: 'A' - , down: 'B' - , forward: 'C' - , back: 'D' - , nextLine: 'E' - , previousLine: 'F' - , horizontalAbsolute: 'G' - , eraseData: 'J' - , eraseLine: 'K' - , scrollUp: 'S' - , scrollDown: 'T' - , savePosition: 's' - , restorePosition: 'u' - , queryPosition: '6n' - , hide: '?25l' - , show: '?25h' -} - -/** - * Rendering ANSI codes. - */ - -var styles = { - bold: 1 - , italic: 3 - , underline: 4 - , inverse: 7 -} - -/** - * The negating ANSI code for the rendering modes. - */ - -var reset = { - bold: 22 - , italic: 23 - , underline: 24 - , inverse: 27 -} - -/** - * The standard, styleable ANSI colors. - */ - -var colors = { - white: 37 - , black: 30 - , blue: 34 - , cyan: 36 - , green: 32 - , magenta: 35 - , red: 31 - , yellow: 33 - , grey: 90 - , brightBlack: 90 - , brightRed: 91 - , brightGreen: 92 - , brightYellow: 93 - , brightBlue: 94 - , brightMagenta: 95 - , brightCyan: 96 - , brightWhite: 97 -} - - -/** - * Creates a Cursor instance based off the given `writable stream` instance. - */ - -function ansi (stream, options) { - if (stream._ansicursor) { - return stream._ansicursor - } else { - return stream._ansicursor = new Cursor(stream, options) - } -} -module.exports = exports = ansi - -/** - * The `Cursor` class. - */ - -function Cursor (stream, options) { - if (!(this instanceof Cursor)) { - return new Cursor(stream, options) - } - if (typeof stream != 'object' || typeof stream.write != 'function') { - throw new Error('a valid Stream instance must be passed in') - } - - // the stream to use - this.stream = stream - - // when 'enabled' is false then all the functions are no-ops except for write() - this.enabled = options && options.enabled - if (typeof this.enabled === 'undefined') { - this.enabled = stream.isTTY - } - this.enabled = !!this.enabled - - // then `buffering` is true, then `write()` calls are buffered in - // memory until `flush()` is invoked - this.buffering = !!(options && options.buffering) - this._buffer = [] - - // controls the foreground and background colors - this.fg = this.foreground = new Colorer(this, 0) - this.bg = this.background = new Colorer(this, 10) - - // defaults - this.Bold = false - this.Italic = false - this.Underline = false - this.Inverse = false - - // keep track of the number of "newlines" that get encountered - this.newlines = 0 - emitNewlineEvents(stream) - stream.on('newline', function () { - this.newlines++ - }.bind(this)) -} -exports.Cursor = Cursor - -/** - * Helper function that calls `write()` on the underlying Stream. - * Returns `this` instead of the write() return value to keep - * the chaining going. - */ - -Cursor.prototype.write = function (data) { - if (this.buffering) { - this._buffer.push(arguments) - } else { - this.stream.write.apply(this.stream, arguments) - } - return this -} - -/** - * Buffer `write()` calls into memory. - * - * @api public - */ - -Cursor.prototype.buffer = function () { - this.buffering = true - return this -} - -/** - * Write out the in-memory buffer. - * - * @api public - */ - -Cursor.prototype.flush = function () { - this.buffering = false - var str = this._buffer.map(function (args) { - if (args.length != 1) throw new Error('unexpected args length! ' + args.length); - return args[0]; - }).join(''); - this._buffer.splice(0); // empty - this.write(str); - return this -} - - -/** - * The `Colorer` class manages both the background and foreground colors. - */ - -function Colorer (cursor, base) { - this.current = null - this.cursor = cursor - this.base = base -} -exports.Colorer = Colorer - -/** - * Write an ANSI color code, ensuring that the same code doesn't get rewritten. - */ - -Colorer.prototype._setColorCode = function setColorCode (code) { - var c = String(code) - if (this.current === c) return - this.cursor.enabled && this.cursor.write(prefix + c + suffix) - this.current = c - return this -} - - -/** - * Set up the positional ANSI codes. - */ - -Object.keys(codes).forEach(function (name) { - var code = String(codes[name]) - Cursor.prototype[name] = function () { - var c = code - if (arguments.length > 0) { - c = toArray(arguments).map(Math.round).join(';') + code - } - this.enabled && this.write(prefix + c) - return this - } -}) - -/** - * Set up the functions for the rendering ANSI codes. - */ - -Object.keys(styles).forEach(function (style) { - var name = style[0].toUpperCase() + style.substring(1) - , c = styles[style] - , r = reset[style] - - Cursor.prototype[style] = function () { - if (this[name]) return this - this.enabled && this.write(prefix + c + suffix) - this[name] = true - return this - } - - Cursor.prototype['reset' + name] = function () { - if (!this[name]) return this - this.enabled && this.write(prefix + r + suffix) - this[name] = false - return this - } -}) - -/** - * Setup the functions for the standard colors. - */ - -Object.keys(colors).forEach(function (color) { - var code = colors[color] - - Colorer.prototype[color] = function () { - this._setColorCode(this.base + code) - return this.cursor - } - - Cursor.prototype[color] = function () { - return this.foreground[color]() - } -}) - -/** - * Makes a beep sound! - */ - -Cursor.prototype.beep = function () { - this.enabled && this.write('\x07') - return this -} - -/** - * Moves cursor to specific position - */ - -Cursor.prototype.goto = function (x, y) { - x = x | 0 - y = y | 0 - this.enabled && this.write(prefix + y + ';' + x + 'H') - return this -} - -/** - * Resets the color. - */ - -Colorer.prototype.reset = function () { - this._setColorCode(this.base + 39) - return this.cursor -} - -/** - * Resets all ANSI formatting on the stream. - */ - -Cursor.prototype.reset = function () { - this.enabled && this.write(prefix + '0' + suffix) - this.Bold = false - this.Italic = false - this.Underline = false - this.Inverse = false - this.foreground.current = null - this.background.current = null - return this -} - -/** - * Sets the foreground color with the given RGB values. - * The closest match out of the 216 colors is picked. - */ - -Colorer.prototype.rgb = function (r, g, b) { - var base = this.base + 38 - , code = rgb(r, g, b) - this._setColorCode(base + ';5;' + code) - return this.cursor -} - -/** - * Same as `cursor.fg.rgb(r, g, b)`. - */ - -Cursor.prototype.rgb = function (r, g, b) { - return this.foreground.rgb(r, g, b) -} - -/** - * Accepts CSS color codes for use with ANSI escape codes. - * For example: `#FF000` would be bright red. - */ - -Colorer.prototype.hex = function (color) { - return this.rgb.apply(this, hex(color)) -} - -/** - * Same as `cursor.fg.hex(color)`. - */ - -Cursor.prototype.hex = function (color) { - return this.foreground.hex(color) -} - - -// UTIL FUNCTIONS // - -/** - * Translates a 255 RGB value to a 0-5 ANSI RGV value, - * then returns the single ANSI color code to use. - */ - -function rgb (r, g, b) { - var red = r / 255 * 5 - , green = g / 255 * 5 - , blue = b / 255 * 5 - return rgb5(red, green, blue) -} - -/** - * Turns rgb 0-5 values into a single ANSI color code to use. - */ - -function rgb5 (r, g, b) { - var red = Math.round(r) - , green = Math.round(g) - , blue = Math.round(b) - return 16 + (red*36) + (green*6) + blue -} - -/** - * Accepts a hex CSS color code string (# is optional) and - * translates it into an Array of 3 RGB 0-255 values, which - * can then be used with rgb(). - */ - -function hex (color) { - var c = color[0] === '#' ? color.substring(1) : color - , r = c.substring(0, 2) - , g = c.substring(2, 4) - , b = c.substring(4, 6) - return [parseInt(r, 16), parseInt(g, 16), parseInt(b, 16)] -} - -/** - * Turns an array-like object into a real array. - */ - -function toArray (a) { - var i = 0 - , l = a.length - , rtn = [] - for (; i 0) { - var len = data.length - , i = 0 - // now try to calculate any deltas - if (typeof data == 'string') { - for (; i Turn anything into an array - - -## Install - -```sh -$ npm install --save array-ify -``` - - -## Usage - -```js -var arrayify = require('array-ify'); - -arrayify('unicorn'); -//=> ['unicorn'] - -arrayify(['unicorn']); -//=> ['unicorn'] - -arrayify(null); -//=> [null] - -arrayify(undefined); -//=> [undefined] -``` - - -## Related - -- [arrify](https://github.com/sindresorhus/arrify) - Convert a value to an array - -The difference that is this module does **NOT** turn `null` or `undefined` to an empty array. - - -## License - -MIT © [Steve Mao](https://github.com/stevemao) - - -[npm-image]: https://badge.fury.io/js/array-ify.svg -[npm-url]: https://npmjs.org/package/array-ify -[travis-image]: https://travis-ci.org/stevemao/array-ify.svg?branch=master -[travis-url]: https://travis-ci.org/stevemao/array-ify -[daviddm-image]: https://david-dm.org/stevemao/array-ify.svg?theme=shields.io -[daviddm-url]: https://david-dm.org/stevemao/array-ify -[coveralls-image]: https://coveralls.io/repos/stevemao/array-ify/badge.svg -[coveralls-url]: https://coveralls.io/r/stevemao/array-ify diff --git a/chabok-starter-cordova/node_modules/array-ify/index.js b/chabok-starter-cordova/node_modules/array-ify/index.js deleted file mode 100644 index 5d223a2..0000000 --- a/chabok-starter-cordova/node_modules/array-ify/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -module.exports = function(val) { - return Array.isArray(val) ? val : [val]; -}; diff --git a/chabok-starter-cordova/node_modules/array-ify/package.json b/chabok-starter-cordova/node_modules/array-ify/package.json deleted file mode 100644 index a49fab1..0000000 --- a/chabok-starter-cordova/node_modules/array-ify/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "_from": "array-ify@^1.0.0", - "_id": "array-ify@1.0.0", - "_inBundle": false, - "_integrity": "sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4=", - "_location": "/array-ify", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "array-ify@^1.0.0", - "name": "array-ify", - "escapedName": "array-ify", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/compare-func" - ], - "_resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", - "_shasum": "9e528762b4a9066ad163a6962a364418e9626ece", - "_spec": "array-ify@^1.0.0", - "_where": "/Users/farbod/Documents/Github/chabok/chabok-starter-cordova/chabok-starter-cordova/node_modules/compare-func", - "author": { - "name": "Steve Mao", - "email": "maochenyan@gmail.com", - "url": "https://github.com/stevemao" - }, - "bugs": { - "url": "https://github.com/stevemao/array-ify/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Turn anything into an array", - "devDependencies": { - "coveralls": "^2.11.2", - "istanbul": "^0.3.8", - "jscs": "^1.11.3", - "jshint": "^2.6.3", - "mocha": "*" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/stevemao/array-ify", - "keywords": [ - "array-ify", - "array", - "arr", - "arrify", - "arrayify", - "convert", - "value" - ], - "license": "MIT", - "name": "array-ify", - "repository": { - "type": "git", - "url": "git+https://github.com/stevemao/array-ify.git" - }, - "scripts": { - "coverage": "istanbul cover _mocha -- -R spec && rm -rf ./coverage", - "lint": "jshint *.js --exclude node_modules && jscs *.js", - "test": "npm run-script lint && mocha" - }, - "version": "1.0.0" -} diff --git a/chabok-starter-cordova/node_modules/balanced-match/.npmignore b/chabok-starter-cordova/node_modules/balanced-match/.npmignore deleted file mode 100644 index ae5d8c3..0000000 --- a/chabok-starter-cordova/node_modules/balanced-match/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -test -.gitignore -.travis.yml -Makefile -example.js diff --git a/chabok-starter-cordova/node_modules/balanced-match/LICENSE.md b/chabok-starter-cordova/node_modules/balanced-match/LICENSE.md deleted file mode 100644 index 2cdc8e4..0000000 --- a/chabok-starter-cordova/node_modules/balanced-match/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -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. diff --git a/chabok-starter-cordova/node_modules/balanced-match/README.md b/chabok-starter-cordova/node_modules/balanced-match/README.md deleted file mode 100644 index 08e918c..0000000 --- a/chabok-starter-cordova/node_modules/balanced-match/README.md +++ /dev/null @@ -1,91 +0,0 @@ -# balanced-match - -Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well! - -[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) -[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) - -[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) - -## Example - -Get the first matching pair of braces: - -```js -var balanced = require('balanced-match'); - -console.log(balanced('{', '}', 'pre{in{nested}}post')); -console.log(balanced('{', '}', 'pre{first}between{second}post')); -console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')); -``` - -The matches are: - -```bash -$ node example.js -{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } -{ start: 3, - end: 9, - pre: 'pre', - body: 'first', - post: 'between{second}post' } -{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } -``` - -## API - -### var m = balanced(a, b, str) - -For the first non-nested matching pair of `a` and `b` in `str`, return an -object with those keys: - -* **start** the index of the first match of `a` -* **end** the index of the matching `b` -* **pre** the preamble, `a` and `b` not included -* **body** the match, `a` and `b` not included -* **post** the postscript, `a` and `b` not included - -If there's no match, `undefined` will be returned. - -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. - -### var r = balanced.range(a, b, str) - -For the first non-nested matching pair of `a` and `b` in `str`, return an -array with indexes: `[ , ]`. - -If there's no match, `undefined` will be returned. - -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install balanced-match -``` - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -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. diff --git a/chabok-starter-cordova/node_modules/balanced-match/index.js b/chabok-starter-cordova/node_modules/balanced-match/index.js deleted file mode 100644 index 1685a76..0000000 --- a/chabok-starter-cordova/node_modules/balanced-match/index.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; -module.exports = balanced; -function balanced(a, b, str) { - if (a instanceof RegExp) a = maybeMatch(a, str); - if (b instanceof RegExp) b = maybeMatch(b, str); - - var r = range(a, b, str); - - return r && { - start: r[0], - end: r[1], - pre: str.slice(0, r[0]), - body: str.slice(r[0] + a.length, r[1]), - post: str.slice(r[1] + b.length) - }; -} - -function maybeMatch(reg, str) { - var m = str.match(reg); - return m ? m[0] : null; -} - -balanced.range = range; -function range(a, b, str) { - var begs, beg, left, right, result; - var ai = str.indexOf(a); - var bi = str.indexOf(b, ai + 1); - var i = ai; - - if (ai >= 0 && bi > 0) { - begs = []; - left = str.length; - - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str.indexOf(a, i + 1); - } else if (begs.length == 1) { - result = [ begs.pop(), bi ]; - } else { - beg = begs.pop(); - if (beg < left) { - left = beg; - right = bi; - } - - bi = str.indexOf(b, i + 1); - } - - i = ai < bi && ai >= 0 ? ai : bi; - } - - if (begs.length) { - result = [ left, right ]; - } - } - - return result; -} diff --git a/chabok-starter-cordova/node_modules/balanced-match/package.json b/chabok-starter-cordova/node_modules/balanced-match/package.json deleted file mode 100644 index ad67b2c..0000000 --- a/chabok-starter-cordova/node_modules/balanced-match/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "_from": "balanced-match@^1.0.0", - "_id": "balanced-match@1.0.0", - "_inBundle": false, - "_integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "_location": "/balanced-match", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "balanced-match@^1.0.0", - "name": "balanced-match", - "escapedName": "balanced-match", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/brace-expansion" - ], - "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "_shasum": "89b4d199ab2bee49de164ea02b89ce462d71b767", - "_spec": "balanced-match@^1.0.0", - "_where": "/Users/farbod/Documents/Github/chabok/chabok-starter-cordova/chabok-starter-cordova/node_modules/brace-expansion", - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "bugs": { - "url": "https://github.com/juliangruber/balanced-match/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Match balanced character pairs, like \"{\" and \"}\"", - "devDependencies": { - "matcha": "^0.7.0", - "tape": "^4.6.0" - }, - "homepage": "https://github.com/juliangruber/balanced-match", - "keywords": [ - "match", - "regexp", - "test", - "balanced", - "parse" - ], - "license": "MIT", - "main": "index.js", - "name": "balanced-match", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/balanced-match.git" - }, - "scripts": { - "bench": "make bench", - "test": "make test" - }, - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "version": "1.0.0" -} diff --git a/chabok-starter-cordova/node_modules/base64-js/LICENSE b/chabok-starter-cordova/node_modules/base64-js/LICENSE deleted file mode 100644 index 6d52b8a..0000000 --- a/chabok-starter-cordova/node_modules/base64-js/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Jameson Little - -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. diff --git a/chabok-starter-cordova/node_modules/base64-js/README.md b/chabok-starter-cordova/node_modules/base64-js/README.md deleted file mode 100644 index 0395c33..0000000 --- a/chabok-starter-cordova/node_modules/base64-js/README.md +++ /dev/null @@ -1,32 +0,0 @@ -base64-js -========= - -`base64-js` does basic base64 encoding/decoding in pure JS. - -[![build status](https://secure.travis-ci.org/beatgammit/base64-js.png)](http://travis-ci.org/beatgammit/base64-js) - -Many browsers already have base64 encoding/decoding functionality, but it is for text data, not all-purpose binary data. - -Sometimes encoding/decoding binary data in the browser is useful, and that is what this module does. - -## install - -With [npm](https://npmjs.org) do: - -`npm install base64-js` and `var base64js = require('base64-js')` - -For use in web browsers do: - -`` - -## methods - -`base64js` has three exposed functions, `byteLength`, `toByteArray` and `fromByteArray`, which both take a single argument. - -* `byteLength` - Takes a base64 string and returns length of byte array -* `toByteArray` - Takes a base64 string and returns a byte array -* `fromByteArray` - Takes a byte array and returns a base64 string - -## license - -MIT diff --git a/chabok-starter-cordova/node_modules/base64-js/base64js.min.js b/chabok-starter-cordova/node_modules/base64-js/base64js.min.js deleted file mode 100644 index b0279c0..0000000 --- a/chabok-starter-cordova/node_modules/base64-js/base64js.min.js +++ /dev/null @@ -1 +0,0 @@ -(function(r){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=r()}else if(typeof define==="function"&&define.amd){define([],r)}else{var e;if(typeof window!=="undefined"){e=window}else if(typeof global!=="undefined"){e=global}else if(typeof self!=="undefined"){e=self}else{e=this}e.base64js=r()}})(function(){var r,e,n;return function(){function d(a,f,i){function u(n,r){if(!f[n]){if(!a[n]){var e="function"==typeof require&&require;if(!r&&e)return e(n,!0);if(v)return v(n,!0);var t=new Error("Cannot find module '"+n+"'");throw t.code="MODULE_NOT_FOUND",t}var o=f[n]={exports:{}};a[n][0].call(o.exports,function(r){var e=a[n][1][r];return u(e||r)},o,o.exports,d,a,f,i)}return f[n].exports}for(var v="function"==typeof require&&require,r=0;r0){throw new Error("Invalid string. Length must be a multiple of 4")}var n=r.indexOf("=");if(n===-1)n=e;var t=n===e?0:4-n%4;return[n,t]}function f(r){var e=c(r);var n=e[0];var t=e[1];return(n+t)*3/4-t}function h(r,e,n){return(e+n)*3/4-n}function i(r){var e;var n=c(r);var t=n[0];var o=n[1];var a=new d(h(r,t,o));var f=0;var i=o>0?t-4:t;var u;for(u=0;u>16&255;a[f++]=e>>8&255;a[f++]=e&255}if(o===2){e=v[r.charCodeAt(u)]<<2|v[r.charCodeAt(u+1)]>>4;a[f++]=e&255}if(o===1){e=v[r.charCodeAt(u)]<<10|v[r.charCodeAt(u+1)]<<4|v[r.charCodeAt(u+2)]>>2;a[f++]=e>>8&255;a[f++]=e&255}return a}function s(r){return u[r>>18&63]+u[r>>12&63]+u[r>>6&63]+u[r&63]}function l(r,e,n){var t;var o=[];for(var a=e;ai?i:f+a))}if(t===1){e=r[n-1];o.push(u[e>>2]+u[e<<4&63]+"==")}else if(t===2){e=(r[n-2]<<8)+r[n-1];o.push(u[e>>10]+u[e>>4&63]+u[e<<2&63]+"=")}return o.join("")}},{}]},{},[])("/")}); diff --git a/chabok-starter-cordova/node_modules/base64-js/index.js b/chabok-starter-cordova/node_modules/base64-js/index.js deleted file mode 100644 index f087f5b..0000000 --- a/chabok-starter-cordova/node_modules/base64-js/index.js +++ /dev/null @@ -1,152 +0,0 @@ -'use strict' - -exports.byteLength = byteLength -exports.toByteArray = toByteArray -exports.fromByteArray = fromByteArray - -var lookup = [] -var revLookup = [] -var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array - -var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' -for (var i = 0, len = code.length; i < len; ++i) { - lookup[i] = code[i] - revLookup[code.charCodeAt(i)] = i -} - -// Support decoding URL-safe base64 strings, as Node.js does. -// See: https://en.wikipedia.org/wiki/Base64#URL_applications -revLookup['-'.charCodeAt(0)] = 62 -revLookup['_'.charCodeAt(0)] = 63 - -function getLens (b64) { - var len = b64.length - - if (len % 4 > 0) { - throw new Error('Invalid string. Length must be a multiple of 4') - } - - // Trim off extra bytes after placeholder bytes are found - // See: https://github.com/beatgammit/base64-js/issues/42 - var validLen = b64.indexOf('=') - if (validLen === -1) validLen = len - - var placeHoldersLen = validLen === len - ? 0 - : 4 - (validLen % 4) - - return [validLen, placeHoldersLen] -} - -// base64 is 4/3 + up to two characters of the original data -function byteLength (b64) { - var lens = getLens(b64) - var validLen = lens[0] - var placeHoldersLen = lens[1] - return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen -} - -function _byteLength (b64, validLen, placeHoldersLen) { - return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen -} - -function toByteArray (b64) { - var tmp - var lens = getLens(b64) - var validLen = lens[0] - var placeHoldersLen = lens[1] - - var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) - - var curByte = 0 - - // if there are placeholders, only get up to the last complete 4 chars - var len = placeHoldersLen > 0 - ? validLen - 4 - : validLen - - var i - for (i = 0; i < len; i += 4) { - tmp = - (revLookup[b64.charCodeAt(i)] << 18) | - (revLookup[b64.charCodeAt(i + 1)] << 12) | - (revLookup[b64.charCodeAt(i + 2)] << 6) | - revLookup[b64.charCodeAt(i + 3)] - arr[curByte++] = (tmp >> 16) & 0xFF - arr[curByte++] = (tmp >> 8) & 0xFF - arr[curByte++] = tmp & 0xFF - } - - if (placeHoldersLen === 2) { - tmp = - (revLookup[b64.charCodeAt(i)] << 2) | - (revLookup[b64.charCodeAt(i + 1)] >> 4) - arr[curByte++] = tmp & 0xFF - } - - if (placeHoldersLen === 1) { - tmp = - (revLookup[b64.charCodeAt(i)] << 10) | - (revLookup[b64.charCodeAt(i + 1)] << 4) | - (revLookup[b64.charCodeAt(i + 2)] >> 2) - arr[curByte++] = (tmp >> 8) & 0xFF - arr[curByte++] = tmp & 0xFF - } - - return arr -} - -function tripletToBase64 (num) { - return lookup[num >> 18 & 0x3F] + - lookup[num >> 12 & 0x3F] + - lookup[num >> 6 & 0x3F] + - lookup[num & 0x3F] -} - -function encodeChunk (uint8, start, end) { - var tmp - var output = [] - for (var i = start; i < end; i += 3) { - tmp = - ((uint8[i] << 16) & 0xFF0000) + - ((uint8[i + 1] << 8) & 0xFF00) + - (uint8[i + 2] & 0xFF) - output.push(tripletToBase64(tmp)) - } - return output.join('') -} - -function fromByteArray (uint8) { - var tmp - var len = uint8.length - var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes - var parts = [] - var maxChunkLength = 16383 // must be multiple of 3 - - // go through the array every three bytes, we'll deal with trailing stuff later - for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { - parts.push(encodeChunk( - uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength) - )) - } - - // pad the end with zeros, but make sure to not forget the extra bytes - if (extraBytes === 1) { - tmp = uint8[len - 1] - parts.push( - lookup[tmp >> 2] + - lookup[(tmp << 4) & 0x3F] + - '==' - ) - } else if (extraBytes === 2) { - tmp = (uint8[len - 2] << 8) + uint8[len - 1] - parts.push( - lookup[tmp >> 10] + - lookup[(tmp >> 4) & 0x3F] + - lookup[(tmp << 2) & 0x3F] + - '=' - ) - } - - return parts.join('') -} diff --git a/chabok-starter-cordova/node_modules/base64-js/package.json b/chabok-starter-cordova/node_modules/base64-js/package.json deleted file mode 100644 index 748f24c..0000000 --- a/chabok-starter-cordova/node_modules/base64-js/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "_from": "base64-js@^1.2.3", - "_id": "base64-js@1.3.1", - "_inBundle": false, - "_integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==", - "_location": "/base64-js", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "base64-js@^1.2.3", - "name": "base64-js", - "escapedName": "base64-js", - "rawSpec": "^1.2.3", - "saveSpec": null, - "fetchSpec": "^1.2.3" - }, - "_requiredBy": [ - "/plist" - ], - "_resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", - "_shasum": "58ece8cb75dd07e71ed08c736abc5fac4dbf8df1", - "_spec": "base64-js@^1.2.3", - "_where": "/Users/farbod/Documents/Github/chabok/chabok-starter-cordova/chabok-starter-cordova/node_modules/plist", - "author": { - "name": "T. Jameson Little", - "email": "t.jameson.little@gmail.com" - }, - "bugs": { - "url": "https://github.com/beatgammit/base64-js/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Base64 encoding/decoding in pure JS", - "devDependencies": { - "benchmark": "^2.1.4", - "browserify": "^16.3.0", - "standard": "*", - "tape": "4.x", - "uglify-js": "^3.6.0" - }, - "homepage": "https://github.com/beatgammit/base64-js", - "keywords": [ - "base64" - ], - "license": "MIT", - "main": "index.js", - "name": "base64-js", - "repository": { - "type": "git", - "url": "git://github.com/beatgammit/base64-js.git" - }, - "scripts": { - "build": "browserify -s base64js -r ./ | uglifyjs -m > base64js.min.js", - "lint": "standard", - "test": "npm run lint && npm run unit", - "unit": "tape test/*.js" - }, - "version": "1.3.1" -} diff --git a/chabok-starter-cordova/node_modules/big-integer/BigInteger.d.ts b/chabok-starter-cordova/node_modules/big-integer/BigInteger.d.ts deleted file mode 100644 index 354218e..0000000 --- a/chabok-starter-cordova/node_modules/big-integer/BigInteger.d.ts +++ /dev/null @@ -1,2393 +0,0 @@ -/** - * Type definitions for BigInteger.js - * Definitions by: Tommy Frazier - */ -export = bigInt; -export as namespace bigInt; - -declare var bigInt: bigInt.BigIntegerStatic; - -declare namespace bigInt { - type BigNumber = number | bigint | string | BigInteger; - - interface BigIntegerStatic { - /** - * Equivalent to bigInt(0). - */ - (): BigInteger; - - /** - * Parse a Javascript number into a bigInt. - */ - (number: number): BigInteger; - - /** - * Parse a Javascript native bigint into a bigInt. - */ - (number: bigint): BigInteger; - - /** - * Parse a string into a bigInt. - * Default base is 10. - * Default alphabet is "0123456789abcdefghijklmnopqrstuvwxyz". - * caseSensitive defaults to false. - */ - (string: string, base?: BigNumber, alphabet?: string, caseSensitive?: boolean): BigInteger; - - /** - * no-op. - */ - (bigInt: BigInteger): BigInteger; - - /** - * Constructs a bigInt from an array of digits in specified base. - * The optional isNegative flag will make the number negative. - */ - fromArray: (digits: BigNumber[], base?: BigNumber, isNegative?: boolean) => BigInteger; - - /** - * Finds the greatest common denominator of a and b. - */ - gcd: (a: BigNumber, b: BigNumber) => BigInteger; - - - /** - * Returns true if x is a BigInteger, false otherwise. - */ - isInstance: (x: any) => x is BigInteger; - - /** - * Finds the least common multiple of a and b. - */ - lcm: (a: BigNumber, b: BigNumber) => BigInteger; - - /** - * Returns the largest of a and b. - */ - max: (a: BigNumber, b: BigNumber) => BigInteger; - - /** - * Returns the smallest of a and b. - */ - min: (a: BigNumber, b: BigNumber) => BigInteger; - - /** - * Equivalent to bigInt(-1). - */ - minusOne: BigInteger; - - /** - * Equivalent to bigInt(1). - */ - one: BigInteger; - - /** - * Returns a random number between min and max. - */ - randBetween: (min: BigNumber, max: BigNumber, rng?: () => number) => BigInteger; - - /** - * Equivalent to bigInt(0). - */ - zero: BigInteger; - } - - interface BigInteger { - /** - * Returns the absolute value of a bigInt. - */ - abs(): BigInteger; - - /** - * Performs addition. - */ - add(number: BigNumber): BigInteger; - - /** - * Performs the bitwise AND operation. - */ - and(number: BigNumber): BigInteger; - - /** - * Returns the number of digits required to represent a bigInt in binary. - */ - bitLength(): BigInteger; - - /** - * Performs a comparison between two numbers. If the numbers are equal, it returns 0. - * If the first number is greater, it returns 1. If the first number is lesser, it returns -1. - */ - compare(number: BigNumber): number; - - /** - * Performs a comparison between the absolute value of two numbers. - */ - compareAbs(number: BigNumber): number; - - /** - * Alias for the compare method. - */ - compareTo(number: BigNumber): number; - - /** - * Performs integer division, disregarding the remainder. - */ - divide(number: BigNumber): BigInteger; - - /** - * Performs division and returns an object with two properties: quotient and remainder. - * The sign of the remainder will match the sign of the dividend. - */ - divmod(number: BigNumber): { quotient: BigInteger, remainder: BigInteger }; - - /** - * Alias for the equals method. - */ - eq(number: BigNumber): boolean; - - /** - * Checks if two numbers are equal. - */ - equals(number: BigNumber): boolean; - - /** - * Alias for the greaterOrEquals method. - */ - geq(number: BigNumber): boolean; - - /** - * Checks if the first number is greater than the second. - */ - greater(number: BigNumber): boolean; - - /** - * Checks if the first number is greater than or equal to the second. - */ - greaterOrEquals(number: BigNumber): boolean; - - /** - * Alias for the greater method. - */ - gt(number: BigNumber): boolean; - - /** - * Returns true if the first number is divisible by the second number, false otherwise. - */ - isDivisibleBy(number: BigNumber): boolean; - - /** - * Returns true if the number is even, false otherwise. - */ - isEven(): boolean; - - /** - * Returns true if the number is negative, false otherwise. - * Returns false for 0 and true for -0. - */ - isNegative(): boolean; - - /** - * Returns true if the number is odd, false otherwise. - */ - isOdd(): boolean; - - /** - * Return true if the number is positive, false otherwise. - * Returns true for 0 and false for -0. - */ - isPositive(): boolean; - - /** - * Returns true if the number is prime, false otherwise. - */ - isPrime(): boolean; - - /** - * Returns true if the number is very likely to be prime, false otherwise. - */ - isProbablePrime(iterations?: number, rng?: () => number): boolean; - - /** - * Returns true if the number is 1 or -1, false otherwise. - */ - isUnit(): boolean; - - /** - * Return true if the number is 0 or -0, false otherwise. - */ - isZero(): boolean; - - /** - * Alias for the lesserOrEquals method. - */ - leq(number: BigNumber): boolean; - - /** - * Checks if the first number is lesser than the second. - */ - lesser(number: BigNumber): boolean; - - /** - * Checks if the first number is less than or equal to the second. - */ - lesserOrEquals(number: BigNumber): boolean; - - /** - * Alias for the lesser method. - */ - lt(number: BigNumber): boolean; - - /** - * Alias for the subtract method. - */ - minus(number: BigNumber): BigInteger; - - /** - * Performs division and returns the remainder, disregarding the quotient. - * The sign of the remainder will match the sign of the dividend. - */ - mod(number: BigNumber): BigInteger; - - /** - * Finds the multiplicative inverse of the number modulo mod. - */ - modInv(number: BigNumber): BigInteger; - - /** - * Takes the number to the power exp modulo mod. - */ - modPow(exp: BigNumber, mod: BigNumber): BigInteger; - - /** - * Performs multiplication. - */ - multiply(number: BigNumber): BigInteger; - - /** - * Reverses the sign of the number. - */ - negate(): BigInteger; - - /** - * Alias for the notEquals method. - */ - neq(number: BigNumber): boolean; - - /** - * Adds one to the number. - */ - next(): BigInteger; - - /** - * Performs the bitwise NOT operation. - */ - not(): BigInteger; - - /** - * Checks if two numbers are not equal. - */ - notEquals(number: BigNumber): boolean; - - /** - * Performs the bitwise OR operation. - */ - or(number: BigNumber): BigInteger; - - /** - * Alias for the divide method. - */ - over(number: BigNumber): BigInteger; - - /** - * Alias for the add method. - */ - plus(number: BigNumber): BigInteger; - - /** - * Performs exponentiation. If the exponent is less than 0, pow returns 0. - * bigInt.zero.pow(0) returns 1. - */ - pow(number: BigNumber): BigInteger; - - /** - * Subtracts one from the number. - */ - prev(): BigInteger; - - /** - * Alias for the mod method. - */ - remainder(number: BigNumber): BigInteger; - - /** - * Shifts the number left by n places in its binary representation. - * If a negative number is provided, it will shift right. - * - * Throws an error if number is outside of the range [-9007199254740992, 9007199254740992]. - */ - shiftLeft(number: BigNumber): BigInteger; - - /** - * Shifts the number right by n places in its binary representation. - * If a negative number is provided, it will shift left. - * - * Throws an error if number is outside of the range [-9007199254740992, 9007199254740992]. - */ - shiftRight(number: BigNumber): BigInteger; - - /** - * Squares the number. - */ - square(): BigInteger; - - /** - * Performs subtraction. - */ - subtract(number: BigNumber): BigInteger; - - /** - * Alias for the multiply method. - */ - times(number: BigNumber): BigInteger; - - /** - * - * Converts a bigInt to an object representing it as an array of integers module the given radix. - */ - toArray(radix: number): BaseArray; - - /** - * Converts a bigInt into a native Javascript number. Loses precision for numbers outside the range. - */ - toJSNumber(): number; - - /** - * Converts a bigInt to a string. - */ - toString(radix?: number, alphabet?: string): string; - - /** - * Converts a bigInt to a string. This method is called behind the scenes in JSON.stringify. - */ - toJSON(): string; - - /** - * Converts a bigInt to a native Javascript number. This override allows you to use native - * arithmetic operators without explicit conversion. - */ - valueOf(): number; - - /** - * Performs the bitwise XOR operation. - */ - xor(number: BigNumber): BigInteger; - } - - // Array constant accessors - interface BigIntegerStatic { - '-999': BigInteger; - '-998': BigInteger; - '-997': BigInteger; - '-996': BigInteger; - '-995': BigInteger; - '-994': BigInteger; - '-993': BigInteger; - '-992': BigInteger; - '-991': BigInteger; - '-990': BigInteger; - '-989': BigInteger; - '-988': BigInteger; - '-987': BigInteger; - '-986': BigInteger; - '-985': BigInteger; - '-984': BigInteger; - '-983': BigInteger; - '-982': BigInteger; - '-981': BigInteger; - '-980': BigInteger; - '-979': BigInteger; - '-978': BigInteger; - '-977': BigInteger; - '-976': BigInteger; - '-975': BigInteger; - '-974': BigInteger; - '-973': BigInteger; - '-972': BigInteger; - '-971': BigInteger; - '-970': BigInteger; - '-969': BigInteger; - '-968': BigInteger; - '-967': BigInteger; - '-966': BigInteger; - '-965': BigInteger; - '-964': BigInteger; - '-963': BigInteger; - '-962': BigInteger; - '-961': BigInteger; - '-960': BigInteger; - '-959': BigInteger; - '-958': BigInteger; - '-957': BigInteger; - '-956': BigInteger; - '-955': BigInteger; - '-954': BigInteger; - '-953': BigInteger; - '-952': BigInteger; - '-951': BigInteger; - '-950': BigInteger; - '-949': BigInteger; - '-948': BigInteger; - '-947': BigInteger; - '-946': BigInteger; - '-945': BigInteger; - '-944': BigInteger; - '-943': BigInteger; - '-942': BigInteger; - '-941': BigInteger; - '-940': BigInteger; - '-939': BigInteger; - '-938': BigInteger; - '-937': BigInteger; - '-936': BigInteger; - '-935': BigInteger; - '-934': BigInteger; - '-933': BigInteger; - '-932': BigInteger; - '-931': BigInteger; - '-930': BigInteger; - '-929': BigInteger; - '-928': BigInteger; - '-927': BigInteger; - '-926': BigInteger; - '-925': BigInteger; - '-924': BigInteger; - '-923': BigInteger; - '-922': BigInteger; - '-921': BigInteger; - '-920': BigInteger; - '-919': BigInteger; - '-918': BigInteger; - '-917': BigInteger; - '-916': BigInteger; - '-915': BigInteger; - '-914': BigInteger; - '-913': BigInteger; - '-912': BigInteger; - '-911': BigInteger; - '-910': BigInteger; - '-909': BigInteger; - '-908': BigInteger; - '-907': BigInteger; - '-906': BigInteger; - '-905': BigInteger; - '-904': BigInteger; - '-903': BigInteger; - '-902': BigInteger; - '-901': BigInteger; - '-900': BigInteger; - '-899': BigInteger; - '-898': BigInteger; - '-897': BigInteger; - '-896': BigInteger; - '-895': BigInteger; - '-894': BigInteger; - '-893': BigInteger; - '-892': BigInteger; - '-891': BigInteger; - '-890': BigInteger; - '-889': BigInteger; - '-888': BigInteger; - '-887': BigInteger; - '-886': BigInteger; - '-885': BigInteger; - '-884': BigInteger; - '-883': BigInteger; - '-882': BigInteger; - '-881': BigInteger; - '-880': BigInteger; - '-879': BigInteger; - '-878': BigInteger; - '-877': BigInteger; - '-876': BigInteger; - '-875': BigInteger; - '-874': BigInteger; - '-873': BigInteger; - '-872': BigInteger; - '-871': BigInteger; - '-870': BigInteger; - '-869': BigInteger; - '-868': BigInteger; - '-867': BigInteger; - '-866': BigInteger; - '-865': BigInteger; - '-864': BigInteger; - '-863': BigInteger; - '-862': BigInteger; - '-861': BigInteger; - '-860': BigInteger; - '-859': BigInteger; - '-858': BigInteger; - '-857': BigInteger; - '-856': BigInteger; - '-855': BigInteger; - '-854': BigInteger; - '-853': BigInteger; - '-852': BigInteger; - '-851': BigInteger; - '-850': BigInteger; - '-849': BigInteger; - '-848': BigInteger; - '-847': BigInteger; - '-846': BigInteger; - '-845': BigInteger; - '-844': BigInteger; - '-843': BigInteger; - '-842': BigInteger; - '-841': BigInteger; - '-840': BigInteger; - '-839': BigInteger; - '-838': BigInteger; - '-837': BigInteger; - '-836': BigInteger; - '-835': BigInteger; - '-834': BigInteger; - '-833': BigInteger; - '-832': BigInteger; - '-831': BigInteger; - '-830': BigInteger; - '-829': BigInteger; - '-828': BigInteger; - '-827': BigInteger; - '-826': BigInteger; - '-825': BigInteger; - '-824': BigInteger; - '-823': BigInteger; - '-822': BigInteger; - '-821': BigInteger; - '-820': BigInteger; - '-819': BigInteger; - '-818': BigInteger; - '-817': BigInteger; - '-816': BigInteger; - '-815': BigInteger; - '-814': BigInteger; - '-813': BigInteger; - '-812': BigInteger; - '-811': BigInteger; - '-810': BigInteger; - '-809': BigInteger; - '-808': BigInteger; - '-807': BigInteger; - '-806': BigInteger; - '-805': BigInteger; - '-804': BigInteger; - '-803': BigInteger; - '-802': BigInteger; - '-801': BigInteger; - '-800': BigInteger; - '-799': BigInteger; - '-798': BigInteger; - '-797': BigInteger; - '-796': BigInteger; - '-795': BigInteger; - '-794': BigInteger; - '-793': BigInteger; - '-792': BigInteger; - '-791': BigInteger; - '-790': BigInteger; - '-789': BigInteger; - '-788': BigInteger; - '-787': BigInteger; - '-786': BigInteger; - '-785': BigInteger; - '-784': BigInteger; - '-783': BigInteger; - '-782': BigInteger; - '-781': BigInteger; - '-780': BigInteger; - '-779': BigInteger; - '-778': BigInteger; - '-777': BigInteger; - '-776': BigInteger; - '-775': BigInteger; - '-774': BigInteger; - '-773': BigInteger; - '-772': BigInteger; - '-771': BigInteger; - '-770': BigInteger; - '-769': BigInteger; - '-768': BigInteger; - '-767': BigInteger; - '-766': BigInteger; - '-765': BigInteger; - '-764': BigInteger; - '-763': BigInteger; - '-762': BigInteger; - '-761': BigInteger; - '-760': BigInteger; - '-759': BigInteger; - '-758': BigInteger; - '-757': BigInteger; - '-756': BigInteger; - '-755': BigInteger; - '-754': BigInteger; - '-753': BigInteger; - '-752': BigInteger; - '-751': BigInteger; - '-750': BigInteger; - '-749': BigInteger; - '-748': BigInteger; - '-747': BigInteger; - '-746': BigInteger; - '-745': BigInteger; - '-744': BigInteger; - '-743': BigInteger; - '-742': BigInteger; - '-741': BigInteger; - '-740': BigInteger; - '-739': BigInteger; - '-738': BigInteger; - '-737': BigInteger; - '-736': BigInteger; - '-735': BigInteger; - '-734': BigInteger; - '-733': BigInteger; - '-732': BigInteger; - '-731': BigInteger; - '-730': BigInteger; - '-729': BigInteger; - '-728': BigInteger; - '-727': BigInteger; - '-726': BigInteger; - '-725': BigInteger; - '-724': BigInteger; - '-723': BigInteger; - '-722': BigInteger; - '-721': BigInteger; - '-720': BigInteger; - '-719': BigInteger; - '-718': BigInteger; - '-717': BigInteger; - '-716': BigInteger; - '-715': BigInteger; - '-714': BigInteger; - '-713': BigInteger; - '-712': BigInteger; - '-711': BigInteger; - '-710': BigInteger; - '-709': BigInteger; - '-708': BigInteger; - '-707': BigInteger; - '-706': BigInteger; - '-705': BigInteger; - '-704': BigInteger; - '-703': BigInteger; - '-702': BigInteger; - '-701': BigInteger; - '-700': BigInteger; - '-699': BigInteger; - '-698': BigInteger; - '-697': BigInteger; - '-696': BigInteger; - '-695': BigInteger; - '-694': BigInteger; - '-693': BigInteger; - '-692': BigInteger; - '-691': BigInteger; - '-690': BigInteger; - '-689': BigInteger; - '-688': BigInteger; - '-687': BigInteger; - '-686': BigInteger; - '-685': BigInteger; - '-684': BigInteger; - '-683': BigInteger; - '-682': BigInteger; - '-681': BigInteger; - '-680': BigInteger; - '-679': BigInteger; - '-678': BigInteger; - '-677': BigInteger; - '-676': BigInteger; - '-675': BigInteger; - '-674': BigInteger; - '-673': BigInteger; - '-672': BigInteger; - '-671': BigInteger; - '-670': BigInteger; - '-669': BigInteger; - '-668': BigInteger; - '-667': BigInteger; - '-666': BigInteger; - '-665': BigInteger; - '-664': BigInteger; - '-663': BigInteger; - '-662': BigInteger; - '-661': BigInteger; - '-660': BigInteger; - '-659': BigInteger; - '-658': BigInteger; - '-657': BigInteger; - '-656': BigInteger; - '-655': BigInteger; - '-654': BigInteger; - '-653': BigInteger; - '-652': BigInteger; - '-651': BigInteger; - '-650': BigInteger; - '-649': BigInteger; - '-648': BigInteger; - '-647': BigInteger; - '-646': BigInteger; - '-645': BigInteger; - '-644': BigInteger; - '-643': BigInteger; - '-642': BigInteger; - '-641': BigInteger; - '-640': BigInteger; - '-639': BigInteger; - '-638': BigInteger; - '-637': BigInteger; - '-636': BigInteger; - '-635': BigInteger; - '-634': BigInteger; - '-633': BigInteger; - '-632': BigInteger; - '-631': BigInteger; - '-630': BigInteger; - '-629': BigInteger; - '-628': BigInteger; - '-627': BigInteger; - '-626': BigInteger; - '-625': BigInteger; - '-624': BigInteger; - '-623': BigInteger; - '-622': BigInteger; - '-621': BigInteger; - '-620': BigInteger; - '-619': BigInteger; - '-618': BigInteger; - '-617': BigInteger; - '-616': BigInteger; - '-615': BigInteger; - '-614': BigInteger; - '-613': BigInteger; - '-612': BigInteger; - '-611': BigInteger; - '-610': BigInteger; - '-609': BigInteger; - '-608': BigInteger; - '-607': BigInteger; - '-606': BigInteger; - '-605': BigInteger; - '-604': BigInteger; - '-603': BigInteger; - '-602': BigInteger; - '-601': BigInteger; - '-600': BigInteger; - '-599': BigInteger; - '-598': BigInteger; - '-597': BigInteger; - '-596': BigInteger; - '-595': BigInteger; - '-594': BigInteger; - '-593': BigInteger; - '-592': BigInteger; - '-591': BigInteger; - '-590': BigInteger; - '-589': BigInteger; - '-588': BigInteger; - '-587': BigInteger; - '-586': BigInteger; - '-585': BigInteger; - '-584': BigInteger; - '-583': BigInteger; - '-582': BigInteger; - '-581': BigInteger; - '-580': BigInteger; - '-579': BigInteger; - '-578': BigInteger; - '-577': BigInteger; - '-576': BigInteger; - '-575': BigInteger; - '-574': BigInteger; - '-573': BigInteger; - '-572': BigInteger; - '-571': BigInteger; - '-570': BigInteger; - '-569': BigInteger; - '-568': BigInteger; - '-567': BigInteger; - '-566': BigInteger; - '-565': BigInteger; - '-564': BigInteger; - '-563': BigInteger; - '-562': BigInteger; - '-561': BigInteger; - '-560': BigInteger; - '-559': BigInteger; - '-558': BigInteger; - '-557': BigInteger; - '-556': BigInteger; - '-555': BigInteger; - '-554': BigInteger; - '-553': BigInteger; - '-552': BigInteger; - '-551': BigInteger; - '-550': BigInteger; - '-549': BigInteger; - '-548': BigInteger; - '-547': BigInteger; - '-546': BigInteger; - '-545': BigInteger; - '-544': BigInteger; - '-543': BigInteger; - '-542': BigInteger; - '-541': BigInteger; - '-540': BigInteger; - '-539': BigInteger; - '-538': BigInteger; - '-537': BigInteger; - '-536': BigInteger; - '-535': BigInteger; - '-534': BigInteger; - '-533': BigInteger; - '-532': BigInteger; - '-531': BigInteger; - '-530': BigInteger; - '-529': BigInteger; - '-528': BigInteger; - '-527': BigInteger; - '-526': BigInteger; - '-525': BigInteger; - '-524': BigInteger; - '-523': BigInteger; - '-522': BigInteger; - '-521': BigInteger; - '-520': BigInteger; - '-519': BigInteger; - '-518': BigInteger; - '-517': BigInteger; - '-516': BigInteger; - '-515': BigInteger; - '-514': BigInteger; - '-513': BigInteger; - '-512': BigInteger; - '-511': BigInteger; - '-510': BigInteger; - '-509': BigInteger; - '-508': BigInteger; - '-507': BigInteger; - '-506': BigInteger; - '-505': BigInteger; - '-504': BigInteger; - '-503': BigInteger; - '-502': BigInteger; - '-501': BigInteger; - '-500': BigInteger; - '-499': BigInteger; - '-498': BigInteger; - '-497': BigInteger; - '-496': BigInteger; - '-495': BigInteger; - '-494': BigInteger; - '-493': BigInteger; - '-492': BigInteger; - '-491': BigInteger; - '-490': BigInteger; - '-489': BigInteger; - '-488': BigInteger; - '-487': BigInteger; - '-486': BigInteger; - '-485': BigInteger; - '-484': BigInteger; - '-483': BigInteger; - '-482': BigInteger; - '-481': BigInteger; - '-480': BigInteger; - '-479': BigInteger; - '-478': BigInteger; - '-477': BigInteger; - '-476': BigInteger; - '-475': BigInteger; - '-474': BigInteger; - '-473': BigInteger; - '-472': BigInteger; - '-471': BigInteger; - '-470': BigInteger; - '-469': BigInteger; - '-468': BigInteger; - '-467': BigInteger; - '-466': BigInteger; - '-465': BigInteger; - '-464': BigInteger; - '-463': BigInteger; - '-462': BigInteger; - '-461': BigInteger; - '-460': BigInteger; - '-459': BigInteger; - '-458': BigInteger; - '-457': BigInteger; - '-456': BigInteger; - '-455': BigInteger; - '-454': BigInteger; - '-453': BigInteger; - '-452': BigInteger; - '-451': BigInteger; - '-450': BigInteger; - '-449': BigInteger; - '-448': BigInteger; - '-447': BigInteger; - '-446': BigInteger; - '-445': BigInteger; - '-444': BigInteger; - '-443': BigInteger; - '-442': BigInteger; - '-441': BigInteger; - '-440': BigInteger; - '-439': BigInteger; - '-438': BigInteger; - '-437': BigInteger; - '-436': BigInteger; - '-435': BigInteger; - '-434': BigInteger; - '-433': BigInteger; - '-432': BigInteger; - '-431': BigInteger; - '-430': BigInteger; - '-429': BigInteger; - '-428': BigInteger; - '-427': BigInteger; - '-426': BigInteger; - '-425': BigInteger; - '-424': BigInteger; - '-423': BigInteger; - '-422': BigInteger; - '-421': BigInteger; - '-420': BigInteger; - '-419': BigInteger; - '-418': BigInteger; - '-417': BigInteger; - '-416': BigInteger; - '-415': BigInteger; - '-414': BigInteger; - '-413': BigInteger; - '-412': BigInteger; - '-411': BigInteger; - '-410': BigInteger; - '-409': BigInteger; - '-408': BigInteger; - '-407': BigInteger; - '-406': BigInteger; - '-405': BigInteger; - '-404': BigInteger; - '-403': BigInteger; - '-402': BigInteger; - '-401': BigInteger; - '-400': BigInteger; - '-399': BigInteger; - '-398': BigInteger; - '-397': BigInteger; - '-396': BigInteger; - '-395': BigInteger; - '-394': BigInteger; - '-393': BigInteger; - '-392': BigInteger; - '-391': BigInteger; - '-390': BigInteger; - '-389': BigInteger; - '-388': BigInteger; - '-387': BigInteger; - '-386': BigInteger; - '-385': BigInteger; - '-384': BigInteger; - '-383': BigInteger; - '-382': BigInteger; - '-381': BigInteger; - '-380': BigInteger; - '-379': BigInteger; - '-378': BigInteger; - '-377': BigInteger; - '-376': BigInteger; - '-375': BigInteger; - '-374': BigInteger; - '-373': BigInteger; - '-372': BigInteger; - '-371': BigInteger; - '-370': BigInteger; - '-369': BigInteger; - '-368': BigInteger; - '-367': BigInteger; - '-366': BigInteger; - '-365': BigInteger; - '-364': BigInteger; - '-363': BigInteger; - '-362': BigInteger; - '-361': BigInteger; - '-360': BigInteger; - '-359': BigInteger; - '-358': BigInteger; - '-357': BigInteger; - '-356': BigInteger; - '-355': BigInteger; - '-354': BigInteger; - '-353': BigInteger; - '-352': BigInteger; - '-351': BigInteger; - '-350': BigInteger; - '-349': BigInteger; - '-348': BigInteger; - '-347': BigInteger; - '-346': BigInteger; - '-345': BigInteger; - '-344': BigInteger; - '-343': BigInteger; - '-342': BigInteger; - '-341': BigInteger; - '-340': BigInteger; - '-339': BigInteger; - '-338': BigInteger; - '-337': BigInteger; - '-336': BigInteger; - '-335': BigInteger; - '-334': BigInteger; - '-333': BigInteger; - '-332': BigInteger; - '-331': BigInteger; - '-330': BigInteger; - '-329': BigInteger; - '-328': BigInteger; - '-327': BigInteger; - '-326': BigInteger; - '-325': BigInteger; - '-324': BigInteger; - '-323': BigInteger; - '-322': BigInteger; - '-321': BigInteger; - '-320': BigInteger; - '-319': BigInteger; - '-318': BigInteger; - '-317': BigInteger; - '-316': BigInteger; - '-315': BigInteger; - '-314': BigInteger; - '-313': BigInteger; - '-312': BigInteger; - '-311': BigInteger; - '-310': BigInteger; - '-309': BigInteger; - '-308': BigInteger; - '-307': BigInteger; - '-306': BigInteger; - '-305': BigInteger; - '-304': BigInteger; - '-303': BigInteger; - '-302': BigInteger; - '-301': BigInteger; - '-300': BigInteger; - '-299': BigInteger; - '-298': BigInteger; - '-297': BigInteger; - '-296': BigInteger; - '-295': BigInteger; - '-294': BigInteger; - '-293': BigInteger; - '-292': BigInteger; - '-291': BigInteger; - '-290': BigInteger; - '-289': BigInteger; - '-288': BigInteger; - '-287': BigInteger; - '-286': BigInteger; - '-285': BigInteger; - '-284': BigInteger; - '-283': BigInteger; - '-282': BigInteger; - '-281': BigInteger; - '-280': BigInteger; - '-279': BigInteger; - '-278': BigInteger; - '-277': BigInteger; - '-276': BigInteger; - '-275': BigInteger; - '-274': BigInteger; - '-273': BigInteger; - '-272': BigInteger; - '-271': BigInteger; - '-270': BigInteger; - '-269': BigInteger; - '-268': BigInteger; - '-267': BigInteger; - '-266': BigInteger; - '-265': BigInteger; - '-264': BigInteger; - '-263': BigInteger; - '-262': BigInteger; - '-261': BigInteger; - '-260': BigInteger; - '-259': BigInteger; - '-258': BigInteger; - '-257': BigInteger; - '-256': BigInteger; - '-255': BigInteger; - '-254': BigInteger; - '-253': BigInteger; - '-252': BigInteger; - '-251': BigInteger; - '-250': BigInteger; - '-249': BigInteger; - '-248': BigInteger; - '-247': BigInteger; - '-246': BigInteger; - '-245': BigInteger; - '-244': BigInteger; - '-243': BigInteger; - '-242': BigInteger; - '-241': BigInteger; - '-240': BigInteger; - '-239': BigInteger; - '-238': BigInteger; - '-237': BigInteger; - '-236': BigInteger; - '-235': BigInteger; - '-234': BigInteger; - '-233': BigInteger; - '-232': BigInteger; - '-231': BigInteger; - '-230': BigInteger; - '-229': BigInteger; - '-228': BigInteger; - '-227': BigInteger; - '-226': BigInteger; - '-225': BigInteger; - '-224': BigInteger; - '-223': BigInteger; - '-222': BigInteger; - '-221': BigInteger; - '-220': BigInteger; - '-219': BigInteger; - '-218': BigInteger; - '-217': BigInteger; - '-216': BigInteger; - '-215': BigInteger; - '-214': BigInteger; - '-213': BigInteger; - '-212': BigInteger; - '-211': BigInteger; - '-210': BigInteger; - '-209': BigInteger; - '-208': BigInteger; - '-207': BigInteger; - '-206': BigInteger; - '-205': BigInteger; - '-204': BigInteger; - '-203': BigInteger; - '-202': BigInteger; - '-201': BigInteger; - '-200': BigInteger; - '-199': BigInteger; - '-198': BigInteger; - '-197': BigInteger; - '-196': BigInteger; - '-195': BigInteger; - '-194': BigInteger; - '-193': BigInteger; - '-192': BigInteger; - '-191': BigInteger; - '-190': BigInteger; - '-189': BigInteger; - '-188': BigInteger; - '-187': BigInteger; - '-186': BigInteger; - '-185': BigInteger; - '-184': BigInteger; - '-183': BigInteger; - '-182': BigInteger; - '-181': BigInteger; - '-180': BigInteger; - '-179': BigInteger; - '-178': BigInteger; - '-177': BigInteger; - '-176': BigInteger; - '-175': BigInteger; - '-174': BigInteger; - '-173': BigInteger; - '-172': BigInteger; - '-171': BigInteger; - '-170': BigInteger; - '-169': BigInteger; - '-168': BigInteger; - '-167': BigInteger; - '-166': BigInteger; - '-165': BigInteger; - '-164': BigInteger; - '-163': BigInteger; - '-162': BigInteger; - '-161': BigInteger; - '-160': BigInteger; - '-159': BigInteger; - '-158': BigInteger; - '-157': BigInteger; - '-156': BigInteger; - '-155': BigInteger; - '-154': BigInteger; - '-153': BigInteger; - '-152': BigInteger; - '-151': BigInteger; - '-150': BigInteger; - '-149': BigInteger; - '-148': BigInteger; - '-147': BigInteger; - '-146': BigInteger; - '-145': BigInteger; - '-144': BigInteger; - '-143': BigInteger; - '-142': BigInteger; - '-141': BigInteger; - '-140': BigInteger; - '-139': BigInteger; - '-138': BigInteger; - '-137': BigInteger; - '-136': BigInteger; - '-135': BigInteger; - '-134': BigInteger; - '-133': BigInteger; - '-132': BigInteger; - '-131': BigInteger; - '-130': BigInteger; - '-129': BigInteger; - '-128': BigInteger; - '-127': BigInteger; - '-126': BigInteger; - '-125': BigInteger; - '-124': BigInteger; - '-123': BigInteger; - '-122': BigInteger; - '-121': BigInteger; - '-120': BigInteger; - '-119': BigInteger; - '-118': BigInteger; - '-117': BigInteger; - '-116': BigInteger; - '-115': BigInteger; - '-114': BigInteger; - '-113': BigInteger; - '-112': BigInteger; - '-111': BigInteger; - '-110': BigInteger; - '-109': BigInteger; - '-108': BigInteger; - '-107': BigInteger; - '-106': BigInteger; - '-105': BigInteger; - '-104': BigInteger; - '-103': BigInteger; - '-102': BigInteger; - '-101': BigInteger; - '-100': BigInteger; - '-99': BigInteger; - '-98': BigInteger; - '-97': BigInteger; - '-96': BigInteger; - '-95': BigInteger; - '-94': BigInteger; - '-93': BigInteger; - '-92': BigInteger; - '-91': BigInteger; - '-90': BigInteger; - '-89': BigInteger; - '-88': BigInteger; - '-87': BigInteger; - '-86': BigInteger; - '-85': BigInteger; - '-84': BigInteger; - '-83': BigInteger; - '-82': BigInteger; - '-81': BigInteger; - '-80': BigInteger; - '-79': BigInteger; - '-78': BigInteger; - '-77': BigInteger; - '-76': BigInteger; - '-75': BigInteger; - '-74': BigInteger; - '-73': BigInteger; - '-72': BigInteger; - '-71': BigInteger; - '-70': BigInteger; - '-69': BigInteger; - '-68': BigInteger; - '-67': BigInteger; - '-66': BigInteger; - '-65': BigInteger; - '-64': BigInteger; - '-63': BigInteger; - '-62': BigInteger; - '-61': BigInteger; - '-60': BigInteger; - '-59': BigInteger; - '-58': BigInteger; - '-57': BigInteger; - '-56': BigInteger; - '-55': BigInteger; - '-54': BigInteger; - '-53': BigInteger; - '-52': BigInteger; - '-51': BigInteger; - '-50': BigInteger; - '-49': BigInteger; - '-48': BigInteger; - '-47': BigInteger; - '-46': BigInteger; - '-45': BigInteger; - '-44': BigInteger; - '-43': BigInteger; - '-42': BigInteger; - '-41': BigInteger; - '-40': BigInteger; - '-39': BigInteger; - '-38': BigInteger; - '-37': BigInteger; - '-36': BigInteger; - '-35': BigInteger; - '-34': BigInteger; - '-33': BigInteger; - '-32': BigInteger; - '-31': BigInteger; - '-30': BigInteger; - '-29': BigInteger; - '-28': BigInteger; - '-27': BigInteger; - '-26': BigInteger; - '-25': BigInteger; - '-24': BigInteger; - '-23': BigInteger; - '-22': BigInteger; - '-21': BigInteger; - '-20': BigInteger; - '-19': BigInteger; - '-18': BigInteger; - '-17': BigInteger; - '-16': BigInteger; - '-15': BigInteger; - '-14': BigInteger; - '-13': BigInteger; - '-12': BigInteger; - '-11': BigInteger; - '-10': BigInteger; - '-9': BigInteger; - '-8': BigInteger; - '-7': BigInteger; - '-6': BigInteger; - '-5': BigInteger; - '-4': BigInteger; - '-3': BigInteger; - '-2': BigInteger; - '-1': BigInteger; - '0': BigInteger; - '1': BigInteger; - '2': BigInteger; - '3': BigInteger; - '4': BigInteger; - '5': BigInteger; - '6': BigInteger; - '7': BigInteger; - '8': BigInteger; - '9': BigInteger; - '10': BigInteger; - '11': BigInteger; - '12': BigInteger; - '13': BigInteger; - '14': BigInteger; - '15': BigInteger; - '16': BigInteger; - '17': BigInteger; - '18': BigInteger; - '19': BigInteger; - '20': BigInteger; - '21': BigInteger; - '22': BigInteger; - '23': BigInteger; - '24': BigInteger; - '25': BigInteger; - '26': BigInteger; - '27': BigInteger; - '28': BigInteger; - '29': BigInteger; - '30': BigInteger; - '31': BigInteger; - '32': BigInteger; - '33': BigInteger; - '34': BigInteger; - '35': BigInteger; - '36': BigInteger; - '37': BigInteger; - '38': BigInteger; - '39': BigInteger; - '40': BigInteger; - '41': BigInteger; - '42': BigInteger; - '43': BigInteger; - '44': BigInteger; - '45': BigInteger; - '46': BigInteger; - '47': BigInteger; - '48': BigInteger; - '49': BigInteger; - '50': BigInteger; - '51': BigInteger; - '52': BigInteger; - '53': BigInteger; - '54': BigInteger; - '55': BigInteger; - '56': BigInteger; - '57': BigInteger; - '58': BigInteger; - '59': BigInteger; - '60': BigInteger; - '61': BigInteger; - '62': BigInteger; - '63': BigInteger; - '64': BigInteger; - '65': BigInteger; - '66': BigInteger; - '67': BigInteger; - '68': BigInteger; - '69': BigInteger; - '70': BigInteger; - '71': BigInteger; - '72': BigInteger; - '73': BigInteger; - '74': BigInteger; - '75': BigInteger; - '76': BigInteger; - '77': BigInteger; - '78': BigInteger; - '79': BigInteger; - '80': BigInteger; - '81': BigInteger; - '82': BigInteger; - '83': BigInteger; - '84': BigInteger; - '85': BigInteger; - '86': BigInteger; - '87': BigInteger; - '88': BigInteger; - '89': BigInteger; - '90': BigInteger; - '91': BigInteger; - '92': BigInteger; - '93': BigInteger; - '94': BigInteger; - '95': BigInteger; - '96': BigInteger; - '97': BigInteger; - '98': BigInteger; - '99': BigInteger; - '100': BigInteger; - '101': BigInteger; - '102': BigInteger; - '103': BigInteger; - '104': BigInteger; - '105': BigInteger; - '106': BigInteger; - '107': BigInteger; - '108': BigInteger; - '109': BigInteger; - '110': BigInteger; - '111': BigInteger; - '112': BigInteger; - '113': BigInteger; - '114': BigInteger; - '115': BigInteger; - '116': BigInteger; - '117': BigInteger; - '118': BigInteger; - '119': BigInteger; - '120': BigInteger; - '121': BigInteger; - '122': BigInteger; - '123': BigInteger; - '124': BigInteger; - '125': BigInteger; - '126': BigInteger; - '127': BigInteger; - '128': BigInteger; - '129': BigInteger; - '130': BigInteger; - '131': BigInteger; - '132': BigInteger; - '133': BigInteger; - '134': BigInteger; - '135': BigInteger; - '136': BigInteger; - '137': BigInteger; - '138': BigInteger; - '139': BigInteger; - '140': BigInteger; - '141': BigInteger; - '142': BigInteger; - '143': BigInteger; - '144': BigInteger; - '145': BigInteger; - '146': BigInteger; - '147': BigInteger; - '148': BigInteger; - '149': BigInteger; - '150': BigInteger; - '151': BigInteger; - '152': BigInteger; - '153': BigInteger; - '154': BigInteger; - '155': BigInteger; - '156': BigInteger; - '157': BigInteger; - '158': BigInteger; - '159': BigInteger; - '160': BigInteger; - '161': BigInteger; - '162': BigInteger; - '163': BigInteger; - '164': BigInteger; - '165': BigInteger; - '166': BigInteger; - '167': BigInteger; - '168': BigInteger; - '169': BigInteger; - '170': BigInteger; - '171': BigInteger; - '172': BigInteger; - '173': BigInteger; - '174': BigInteger; - '175': BigInteger; - '176': BigInteger; - '177': BigInteger; - '178': BigInteger; - '179': BigInteger; - '180': BigInteger; - '181': BigInteger; - '182': BigInteger; - '183': BigInteger; - '184': BigInteger; - '185': BigInteger; - '186': BigInteger; - '187': BigInteger; - '188': BigInteger; - '189': BigInteger; - '190': BigInteger; - '191': BigInteger; - '192': BigInteger; - '193': BigInteger; - '194': BigInteger; - '195': BigInteger; - '196': BigInteger; - '197': BigInteger; - '198': BigInteger; - '199': BigInteger; - '200': BigInteger; - '201': BigInteger; - '202': BigInteger; - '203': BigInteger; - '204': BigInteger; - '205': BigInteger; - '206': BigInteger; - '207': BigInteger; - '208': BigInteger; - '209': BigInteger; - '210': BigInteger; - '211': BigInteger; - '212': BigInteger; - '213': BigInteger; - '214': BigInteger; - '215': BigInteger; - '216': BigInteger; - '217': BigInteger; - '218': BigInteger; - '219': BigInteger; - '220': BigInteger; - '221': BigInteger; - '222': BigInteger; - '223': BigInteger; - '224': BigInteger; - '225': BigInteger; - '226': BigInteger; - '227': BigInteger; - '228': BigInteger; - '229': BigInteger; - '230': BigInteger; - '231': BigInteger; - '232': BigInteger; - '233': BigInteger; - '234': BigInteger; - '235': BigInteger; - '236': BigInteger; - '237': BigInteger; - '238': BigInteger; - '239': BigInteger; - '240': BigInteger; - '241': BigInteger; - '242': BigInteger; - '243': BigInteger; - '244': BigInteger; - '245': BigInteger; - '246': BigInteger; - '247': BigInteger; - '248': BigInteger; - '249': BigInteger; - '250': BigInteger; - '251': BigInteger; - '252': BigInteger; - '253': BigInteger; - '254': BigInteger; - '255': BigInteger; - '256': BigInteger; - '257': BigInteger; - '258': BigInteger; - '259': BigInteger; - '260': BigInteger; - '261': BigInteger; - '262': BigInteger; - '263': BigInteger; - '264': BigInteger; - '265': BigInteger; - '266': BigInteger; - '267': BigInteger; - '268': BigInteger; - '269': BigInteger; - '270': BigInteger; - '271': BigInteger; - '272': BigInteger; - '273': BigInteger; - '274': BigInteger; - '275': BigInteger; - '276': BigInteger; - '277': BigInteger; - '278': BigInteger; - '279': BigInteger; - '280': BigInteger; - '281': BigInteger; - '282': BigInteger; - '283': BigInteger; - '284': BigInteger; - '285': BigInteger; - '286': BigInteger; - '287': BigInteger; - '288': BigInteger; - '289': BigInteger; - '290': BigInteger; - '291': BigInteger; - '292': BigInteger; - '293': BigInteger; - '294': BigInteger; - '295': BigInteger; - '296': BigInteger; - '297': BigInteger; - '298': BigInteger; - '299': BigInteger; - '300': BigInteger; - '301': BigInteger; - '302': BigInteger; - '303': BigInteger; - '304': BigInteger; - '305': BigInteger; - '306': BigInteger; - '307': BigInteger; - '308': BigInteger; - '309': BigInteger; - '310': BigInteger; - '311': BigInteger; - '312': BigInteger; - '313': BigInteger; - '314': BigInteger; - '315': BigInteger; - '316': BigInteger; - '317': BigInteger; - '318': BigInteger; - '319': BigInteger; - '320': BigInteger; - '321': BigInteger; - '322': BigInteger; - '323': BigInteger; - '324': BigInteger; - '325': BigInteger; - '326': BigInteger; - '327': BigInteger; - '328': BigInteger; - '329': BigInteger; - '330': BigInteger; - '331': BigInteger; - '332': BigInteger; - '333': BigInteger; - '334': BigInteger; - '335': BigInteger; - '336': BigInteger; - '337': BigInteger; - '338': BigInteger; - '339': BigInteger; - '340': BigInteger; - '341': BigInteger; - '342': BigInteger; - '343': BigInteger; - '344': BigInteger; - '345': BigInteger; - '346': BigInteger; - '347': BigInteger; - '348': BigInteger; - '349': BigInteger; - '350': BigInteger; - '351': BigInteger; - '352': BigInteger; - '353': BigInteger; - '354': BigInteger; - '355': BigInteger; - '356': BigInteger; - '357': BigInteger; - '358': BigInteger; - '359': BigInteger; - '360': BigInteger; - '361': BigInteger; - '362': BigInteger; - '363': BigInteger; - '364': BigInteger; - '365': BigInteger; - '366': BigInteger; - '367': BigInteger; - '368': BigInteger; - '369': BigInteger; - '370': BigInteger; - '371': BigInteger; - '372': BigInteger; - '373': BigInteger; - '374': BigInteger; - '375': BigInteger; - '376': BigInteger; - '377': BigInteger; - '378': BigInteger; - '379': BigInteger; - '380': BigInteger; - '381': BigInteger; - '382': BigInteger; - '383': BigInteger; - '384': BigInteger; - '385': BigInteger; - '386': BigInteger; - '387': BigInteger; - '388': BigInteger; - '389': BigInteger; - '390': BigInteger; - '391': BigInteger; - '392': BigInteger; - '393': BigInteger; - '394': BigInteger; - '395': BigInteger; - '396': BigInteger; - '397': BigInteger; - '398': BigInteger; - '399': BigInteger; - '400': BigInteger; - '401': BigInteger; - '402': BigInteger; - '403': BigInteger; - '404': BigInteger; - '405': BigInteger; - '406': BigInteger; - '407': BigInteger; - '408': BigInteger; - '409': BigInteger; - '410': BigInteger; - '411': BigInteger; - '412': BigInteger; - '413': BigInteger; - '414': BigInteger; - '415': BigInteger; - '416': BigInteger; - '417': BigInteger; - '418': BigInteger; - '419': BigInteger; - '420': BigInteger; - '421': BigInteger; - '422': BigInteger; - '423': BigInteger; - '424': BigInteger; - '425': BigInteger; - '426': BigInteger; - '427': BigInteger; - '428': BigInteger; - '429': BigInteger; - '430': BigInteger; - '431': BigInteger; - '432': BigInteger; - '433': BigInteger; - '434': BigInteger; - '435': BigInteger; - '436': BigInteger; - '437': BigInteger; - '438': BigInteger; - '439': BigInteger; - '440': BigInteger; - '441': BigInteger; - '442': BigInteger; - '443': BigInteger; - '444': BigInteger; - '445': BigInteger; - '446': BigInteger; - '447': BigInteger; - '448': BigInteger; - '449': BigInteger; - '450': BigInteger; - '451': BigInteger; - '452': BigInteger; - '453': BigInteger; - '454': BigInteger; - '455': BigInteger; - '456': BigInteger; - '457': BigInteger; - '458': BigInteger; - '459': BigInteger; - '460': BigInteger; - '461': BigInteger; - '462': BigInteger; - '463': BigInteger; - '464': BigInteger; - '465': BigInteger; - '466': BigInteger; - '467': BigInteger; - '468': BigInteger; - '469': BigInteger; - '470': BigInteger; - '471': BigInteger; - '472': BigInteger; - '473': BigInteger; - '474': BigInteger; - '475': BigInteger; - '476': BigInteger; - '477': BigInteger; - '478': BigInteger; - '479': BigInteger; - '480': BigInteger; - '481': BigInteger; - '482': BigInteger; - '483': BigInteger; - '484': BigInteger; - '485': BigInteger; - '486': BigInteger; - '487': BigInteger; - '488': BigInteger; - '489': BigInteger; - '490': BigInteger; - '491': BigInteger; - '492': BigInteger; - '493': BigInteger; - '494': BigInteger; - '495': BigInteger; - '496': BigInteger; - '497': BigInteger; - '498': BigInteger; - '499': BigInteger; - '500': BigInteger; - '501': BigInteger; - '502': BigInteger; - '503': BigInteger; - '504': BigInteger; - '505': BigInteger; - '506': BigInteger; - '507': BigInteger; - '508': BigInteger; - '509': BigInteger; - '510': BigInteger; - '511': BigInteger; - '512': BigInteger; - '513': BigInteger; - '514': BigInteger; - '515': BigInteger; - '516': BigInteger; - '517': BigInteger; - '518': BigInteger; - '519': BigInteger; - '520': BigInteger; - '521': BigInteger; - '522': BigInteger; - '523': BigInteger; - '524': BigInteger; - '525': BigInteger; - '526': BigInteger; - '527': BigInteger; - '528': BigInteger; - '529': BigInteger; - '530': BigInteger; - '531': BigInteger; - '532': BigInteger; - '533': BigInteger; - '534': BigInteger; - '535': BigInteger; - '536': BigInteger; - '537': BigInteger; - '538': BigInteger; - '539': BigInteger; - '540': BigInteger; - '541': BigInteger; - '542': BigInteger; - '543': BigInteger; - '544': BigInteger; - '545': BigInteger; - '546': BigInteger; - '547': BigInteger; - '548': BigInteger; - '549': BigInteger; - '550': BigInteger; - '551': BigInteger; - '552': BigInteger; - '553': BigInteger; - '554': BigInteger; - '555': BigInteger; - '556': BigInteger; - '557': BigInteger; - '558': BigInteger; - '559': BigInteger; - '560': BigInteger; - '561': BigInteger; - '562': BigInteger; - '563': BigInteger; - '564': BigInteger; - '565': BigInteger; - '566': BigInteger; - '567': BigInteger; - '568': BigInteger; - '569': BigInteger; - '570': BigInteger; - '571': BigInteger; - '572': BigInteger; - '573': BigInteger; - '574': BigInteger; - '575': BigInteger; - '576': BigInteger; - '577': BigInteger; - '578': BigInteger; - '579': BigInteger; - '580': BigInteger; - '581': BigInteger; - '582': BigInteger; - '583': BigInteger; - '584': BigInteger; - '585': BigInteger; - '586': BigInteger; - '587': BigInteger; - '588': BigInteger; - '589': BigInteger; - '590': BigInteger; - '591': BigInteger; - '592': BigInteger; - '593': BigInteger; - '594': BigInteger; - '595': BigInteger; - '596': BigInteger; - '597': BigInteger; - '598': BigInteger; - '599': BigInteger; - '600': BigInteger; - '601': BigInteger; - '602': BigInteger; - '603': BigInteger; - '604': BigInteger; - '605': BigInteger; - '606': BigInteger; - '607': BigInteger; - '608': BigInteger; - '609': BigInteger; - '610': BigInteger; - '611': BigInteger; - '612': BigInteger; - '613': BigInteger; - '614': BigInteger; - '615': BigInteger; - '616': BigInteger; - '617': BigInteger; - '618': BigInteger; - '619': BigInteger; - '620': BigInteger; - '621': BigInteger; - '622': BigInteger; - '623': BigInteger; - '624': BigInteger; - '625': BigInteger; - '626': BigInteger; - '627': BigInteger; - '628': BigInteger; - '629': BigInteger; - '630': BigInteger; - '631': BigInteger; - '632': BigInteger; - '633': BigInteger; - '634': BigInteger; - '635': BigInteger; - '636': BigInteger; - '637': BigInteger; - '638': BigInteger; - '639': BigInteger; - '640': BigInteger; - '641': BigInteger; - '642': BigInteger; - '643': BigInteger; - '644': BigInteger; - '645': BigInteger; - '646': BigInteger; - '647': BigInteger; - '648': BigInteger; - '649': BigInteger; - '650': BigInteger; - '651': BigInteger; - '652': BigInteger; - '653': BigInteger; - '654': BigInteger; - '655': BigInteger; - '656': BigInteger; - '657': BigInteger; - '658': BigInteger; - '659': BigInteger; - '660': BigInteger; - '661': BigInteger; - '662': BigInteger; - '663': BigInteger; - '664': BigInteger; - '665': BigInteger; - '666': BigInteger; - '667': BigInteger; - '668': BigInteger; - '669': BigInteger; - '670': BigInteger; - '671': BigInteger; - '672': BigInteger; - '673': BigInteger; - '674': BigInteger; - '675': BigInteger; - '676': BigInteger; - '677': BigInteger; - '678': BigInteger; - '679': BigInteger; - '680': BigInteger; - '681': BigInteger; - '682': BigInteger; - '683': BigInteger; - '684': BigInteger; - '685': BigInteger; - '686': BigInteger; - '687': BigInteger; - '688': BigInteger; - '689': BigInteger; - '690': BigInteger; - '691': BigInteger; - '692': BigInteger; - '693': BigInteger; - '694': BigInteger; - '695': BigInteger; - '696': BigInteger; - '697': BigInteger; - '698': BigInteger; - '699': BigInteger; - '700': BigInteger; - '701': BigInteger; - '702': BigInteger; - '703': BigInteger; - '704': BigInteger; - '705': BigInteger; - '706': BigInteger; - '707': BigInteger; - '708': BigInteger; - '709': BigInteger; - '710': BigInteger; - '711': BigInteger; - '712': BigInteger; - '713': BigInteger; - '714': BigInteger; - '715': BigInteger; - '716': BigInteger; - '717': BigInteger; - '718': BigInteger; - '719': BigInteger; - '720': BigInteger; - '721': BigInteger; - '722': BigInteger; - '723': BigInteger; - '724': BigInteger; - '725': BigInteger; - '726': BigInteger; - '727': BigInteger; - '728': BigInteger; - '729': BigInteger; - '730': BigInteger; - '731': BigInteger; - '732': BigInteger; - '733': BigInteger; - '734': BigInteger; - '735': BigInteger; - '736': BigInteger; - '737': BigInteger; - '738': BigInteger; - '739': BigInteger; - '740': BigInteger; - '741': BigInteger; - '742': BigInteger; - '743': BigInteger; - '744': BigInteger; - '745': BigInteger; - '746': BigInteger; - '747': BigInteger; - '748': BigInteger; - '749': BigInteger; - '750': BigInteger; - '751': BigInteger; - '752': BigInteger; - '753': BigInteger; - '754': BigInteger; - '755': BigInteger; - '756': BigInteger; - '757': BigInteger; - '758': BigInteger; - '759': BigInteger; - '760': BigInteger; - '761': BigInteger; - '762': BigInteger; - '763': BigInteger; - '764': BigInteger; - '765': BigInteger; - '766': BigInteger; - '767': BigInteger; - '768': BigInteger; - '769': BigInteger; - '770': BigInteger; - '771': BigInteger; - '772': BigInteger; - '773': BigInteger; - '774': BigInteger; - '775': BigInteger; - '776': BigInteger; - '777': BigInteger; - '778': BigInteger; - '779': BigInteger; - '780': BigInteger; - '781': BigInteger; - '782': BigInteger; - '783': BigInteger; - '784': BigInteger; - '785': BigInteger; - '786': BigInteger; - '787': BigInteger; - '788': BigInteger; - '789': BigInteger; - '790': BigInteger; - '791': BigInteger; - '792': BigInteger; - '793': BigInteger; - '794': BigInteger; - '795': BigInteger; - '796': BigInteger; - '797': BigInteger; - '798': BigInteger; - '799': BigInteger; - '800': BigInteger; - '801': BigInteger; - '802': BigInteger; - '803': BigInteger; - '804': BigInteger; - '805': BigInteger; - '806': BigInteger; - '807': BigInteger; - '808': BigInteger; - '809': BigInteger; - '810': BigInteger; - '811': BigInteger; - '812': BigInteger; - '813': BigInteger; - '814': BigInteger; - '815': BigInteger; - '816': BigInteger; - '817': BigInteger; - '818': BigInteger; - '819': BigInteger; - '820': BigInteger; - '821': BigInteger; - '822': BigInteger; - '823': BigInteger; - '824': BigInteger; - '825': BigInteger; - '826': BigInteger; - '827': BigInteger; - '828': BigInteger; - '829': BigInteger; - '830': BigInteger; - '831': BigInteger; - '832': BigInteger; - '833': BigInteger; - '834': BigInteger; - '835': BigInteger; - '836': BigInteger; - '837': BigInteger; - '838': BigInteger; - '839': BigInteger; - '840': BigInteger; - '841': BigInteger; - '842': BigInteger; - '843': BigInteger; - '844': BigInteger; - '845': BigInteger; - '846': BigInteger; - '847': BigInteger; - '848': BigInteger; - '849': BigInteger; - '850': BigInteger; - '851': BigInteger; - '852': BigInteger; - '853': BigInteger; - '854': BigInteger; - '855': BigInteger; - '856': BigInteger; - '857': BigInteger; - '858': BigInteger; - '859': BigInteger; - '860': BigInteger; - '861': BigInteger; - '862': BigInteger; - '863': BigInteger; - '864': BigInteger; - '865': BigInteger; - '866': BigInteger; - '867': BigInteger; - '868': BigInteger; - '869': BigInteger; - '870': BigInteger; - '871': BigInteger; - '872': BigInteger; - '873': BigInteger; - '874': BigInteger; - '875': BigInteger; - '876': BigInteger; - '877': BigInteger; - '878': BigInteger; - '879': BigInteger; - '880': BigInteger; - '881': BigInteger; - '882': BigInteger; - '883': BigInteger; - '884': BigInteger; - '885': BigInteger; - '886': BigInteger; - '887': BigInteger; - '888': BigInteger; - '889': BigInteger; - '890': BigInteger; - '891': BigInteger; - '892': BigInteger; - '893': BigInteger; - '894': BigInteger; - '895': BigInteger; - '896': BigInteger; - '897': BigInteger; - '898': BigInteger; - '899': BigInteger; - '900': BigInteger; - '901': BigInteger; - '902': BigInteger; - '903': BigInteger; - '904': BigInteger; - '905': BigInteger; - '906': BigInteger; - '907': BigInteger; - '908': BigInteger; - '909': BigInteger; - '910': BigInteger; - '911': BigInteger; - '912': BigInteger; - '913': BigInteger; - '914': BigInteger; - '915': BigInteger; - '916': BigInteger; - '917': BigInteger; - '918': BigInteger; - '919': BigInteger; - '920': BigInteger; - '921': BigInteger; - '922': BigInteger; - '923': BigInteger; - '924': BigInteger; - '925': BigInteger; - '926': BigInteger; - '927': BigInteger; - '928': BigInteger; - '929': BigInteger; - '930': BigInteger; - '931': BigInteger; - '932': BigInteger; - '933': BigInteger; - '934': BigInteger; - '935': BigInteger; - '936': BigInteger; - '937': BigInteger; - '938': BigInteger; - '939': BigInteger; - '940': BigInteger; - '941': BigInteger; - '942': BigInteger; - '943': BigInteger; - '944': BigInteger; - '945': BigInteger; - '946': BigInteger; - '947': BigInteger; - '948': BigInteger; - '949': BigInteger; - '950': BigInteger; - '951': BigInteger; - '952': BigInteger; - '953': BigInteger; - '954': BigInteger; - '955': BigInteger; - '956': BigInteger; - '957': BigInteger; - '958': BigInteger; - '959': BigInteger; - '960': BigInteger; - '961': BigInteger; - '962': BigInteger; - '963': BigInteger; - '964': BigInteger; - '965': BigInteger; - '966': BigInteger; - '967': BigInteger; - '968': BigInteger; - '969': BigInteger; - '970': BigInteger; - '971': BigInteger; - '972': BigInteger; - '973': BigInteger; - '974': BigInteger; - '975': BigInteger; - '976': BigInteger; - '977': BigInteger; - '978': BigInteger; - '979': BigInteger; - '980': BigInteger; - '981': BigInteger; - '982': BigInteger; - '983': BigInteger; - '984': BigInteger; - '985': BigInteger; - '986': BigInteger; - '987': BigInteger; - '988': BigInteger; - '989': BigInteger; - '990': BigInteger; - '991': BigInteger; - '992': BigInteger; - '993': BigInteger; - '994': BigInteger; - '995': BigInteger; - '996': BigInteger; - '997': BigInteger; - '998': BigInteger; - '999': BigInteger; - } - - interface BaseArray { - value: number[], - isNegative: boolean - } -} diff --git a/chabok-starter-cordova/node_modules/big-integer/BigInteger.js b/chabok-starter-cordova/node_modules/big-integer/BigInteger.js deleted file mode 100644 index 4271f40..0000000 --- a/chabok-starter-cordova/node_modules/big-integer/BigInteger.js +++ /dev/null @@ -1,1453 +0,0 @@ -var bigInt = (function (undefined) { - "use strict"; - - var BASE = 1e7, - LOG_BASE = 7, - MAX_INT = 9007199254740992, - MAX_INT_ARR = smallToArray(MAX_INT), - DEFAULT_ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz"; - - var supportsNativeBigInt = typeof BigInt === "function"; - - function Integer(v, radix, alphabet, caseSensitive) { - if (typeof v === "undefined") return Integer[0]; - if (typeof radix !== "undefined") return +radix === 10 && !alphabet ? parseValue(v) : parseBase(v, radix, alphabet, caseSensitive); - return parseValue(v); - } - - function BigInteger(value, sign) { - this.value = value; - this.sign = sign; - this.isSmall = false; - } - BigInteger.prototype = Object.create(Integer.prototype); - - function SmallInteger(value) { - this.value = value; - this.sign = value < 0; - this.isSmall = true; - } - SmallInteger.prototype = Object.create(Integer.prototype); - - function NativeBigInt(value) { - this.value = value; - } - NativeBigInt.prototype = Object.create(Integer.prototype); - - function isPrecise(n) { - return -MAX_INT < n && n < MAX_INT; - } - - function smallToArray(n) { // For performance reasons doesn't reference BASE, need to change this function if BASE changes - if (n < 1e7) - return [n]; - if (n < 1e14) - return [n % 1e7, Math.floor(n / 1e7)]; - return [n % 1e7, Math.floor(n / 1e7) % 1e7, Math.floor(n / 1e14)]; - } - - function arrayToSmall(arr) { // If BASE changes this function may need to change - trim(arr); - var length = arr.length; - if (length < 4 && compareAbs(arr, MAX_INT_ARR) < 0) { - switch (length) { - case 0: return 0; - case 1: return arr[0]; - case 2: return arr[0] + arr[1] * BASE; - default: return arr[0] + (arr[1] + arr[2] * BASE) * BASE; - } - } - return arr; - } - - function trim(v) { - var i = v.length; - while (v[--i] === 0); - v.length = i + 1; - } - - function createArray(length) { // function shamelessly stolen from Yaffle's library https://github.com/Yaffle/BigInteger - var x = new Array(length); - var i = -1; - while (++i < length) { - x[i] = 0; - } - return x; - } - - function truncate(n) { - if (n > 0) return Math.floor(n); - return Math.ceil(n); - } - - function add(a, b) { // assumes a and b are arrays with a.length >= b.length - var l_a = a.length, - l_b = b.length, - r = new Array(l_a), - carry = 0, - base = BASE, - sum, i; - for (i = 0; i < l_b; i++) { - sum = a[i] + b[i] + carry; - carry = sum >= base ? 1 : 0; - r[i] = sum - carry * base; - } - while (i < l_a) { - sum = a[i] + carry; - carry = sum === base ? 1 : 0; - r[i++] = sum - carry * base; - } - if (carry > 0) r.push(carry); - return r; - } - - function addAny(a, b) { - if (a.length >= b.length) return add(a, b); - return add(b, a); - } - - function addSmall(a, carry) { // assumes a is array, carry is number with 0 <= carry < MAX_INT - var l = a.length, - r = new Array(l), - base = BASE, - sum, i; - for (i = 0; i < l; i++) { - sum = a[i] - base + carry; - carry = Math.floor(sum / base); - r[i] = sum - carry * base; - carry += 1; - } - while (carry > 0) { - r[i++] = carry % base; - carry = Math.floor(carry / base); - } - return r; - } - - BigInteger.prototype.add = function (v) { - var n = parseValue(v); - if (this.sign !== n.sign) { - return this.subtract(n.negate()); - } - var a = this.value, b = n.value; - if (n.isSmall) { - return new BigInteger(addSmall(a, Math.abs(b)), this.sign); - } - return new BigInteger(addAny(a, b), this.sign); - }; - BigInteger.prototype.plus = BigInteger.prototype.add; - - SmallInteger.prototype.add = function (v) { - var n = parseValue(v); - var a = this.value; - if (a < 0 !== n.sign) { - return this.subtract(n.negate()); - } - var b = n.value; - if (n.isSmall) { - if (isPrecise(a + b)) return new SmallInteger(a + b); - b = smallToArray(Math.abs(b)); - } - return new BigInteger(addSmall(b, Math.abs(a)), a < 0); - }; - SmallInteger.prototype.plus = SmallInteger.prototype.add; - - NativeBigInt.prototype.add = function (v) { - return new NativeBigInt(this.value + parseValue(v).value); - } - NativeBigInt.prototype.plus = NativeBigInt.prototype.add; - - function subtract(a, b) { // assumes a and b are arrays with a >= b - var a_l = a.length, - b_l = b.length, - r = new Array(a_l), - borrow = 0, - base = BASE, - i, difference; - for (i = 0; i < b_l; i++) { - difference = a[i] - borrow - b[i]; - if (difference < 0) { - difference += base; - borrow = 1; - } else borrow = 0; - r[i] = difference; - } - for (i = b_l; i < a_l; i++) { - difference = a[i] - borrow; - if (difference < 0) difference += base; - else { - r[i++] = difference; - break; - } - r[i] = difference; - } - for (; i < a_l; i++) { - r[i] = a[i]; - } - trim(r); - return r; - } - - function subtractAny(a, b, sign) { - var value; - if (compareAbs(a, b) >= 0) { - value = subtract(a, b); - } else { - value = subtract(b, a); - sign = !sign; - } - value = arrayToSmall(value); - if (typeof value === "number") { - if (sign) value = -value; - return new SmallInteger(value); - } - return new BigInteger(value, sign); - } - - function subtractSmall(a, b, sign) { // assumes a is array, b is number with 0 <= b < MAX_INT - var l = a.length, - r = new Array(l), - carry = -b, - base = BASE, - i, difference; - for (i = 0; i < l; i++) { - difference = a[i] + carry; - carry = Math.floor(difference / base); - difference %= base; - r[i] = difference < 0 ? difference + base : difference; - } - r = arrayToSmall(r); - if (typeof r === "number") { - if (sign) r = -r; - return new SmallInteger(r); - } return new BigInteger(r, sign); - } - - BigInteger.prototype.subtract = function (v) { - var n = parseValue(v); - if (this.sign !== n.sign) { - return this.add(n.negate()); - } - var a = this.value, b = n.value; - if (n.isSmall) - return subtractSmall(a, Math.abs(b), this.sign); - return subtractAny(a, b, this.sign); - }; - BigInteger.prototype.minus = BigInteger.prototype.subtract; - - SmallInteger.prototype.subtract = function (v) { - var n = parseValue(v); - var a = this.value; - if (a < 0 !== n.sign) { - return this.add(n.negate()); - } - var b = n.value; - if (n.isSmall) { - return new SmallInteger(a - b); - } - return subtractSmall(b, Math.abs(a), a >= 0); - }; - SmallInteger.prototype.minus = SmallInteger.prototype.subtract; - - NativeBigInt.prototype.subtract = function (v) { - return new NativeBigInt(this.value - parseValue(v).value); - } - NativeBigInt.prototype.minus = NativeBigInt.prototype.subtract; - - BigInteger.prototype.negate = function () { - return new BigInteger(this.value, !this.sign); - }; - SmallInteger.prototype.negate = function () { - var sign = this.sign; - var small = new SmallInteger(-this.value); - small.sign = !sign; - return small; - }; - NativeBigInt.prototype.negate = function () { - return new NativeBigInt(-this.value); - } - - BigInteger.prototype.abs = function () { - return new BigInteger(this.value, false); - }; - SmallInteger.prototype.abs = function () { - return new SmallInteger(Math.abs(this.value)); - }; - NativeBigInt.prototype.abs = function () { - return new NativeBigInt(this.value >= 0 ? this.value : -this.value); - } - - - function multiplyLong(a, b) { - var a_l = a.length, - b_l = b.length, - l = a_l + b_l, - r = createArray(l), - base = BASE, - product, carry, i, a_i, b_j; - for (i = 0; i < a_l; ++i) { - a_i = a[i]; - for (var j = 0; j < b_l; ++j) { - b_j = b[j]; - product = a_i * b_j + r[i + j]; - carry = Math.floor(product / base); - r[i + j] = product - carry * base; - r[i + j + 1] += carry; - } - } - trim(r); - return r; - } - - function multiplySmall(a, b) { // assumes a is array, b is number with |b| < BASE - var l = a.length, - r = new Array(l), - base = BASE, - carry = 0, - product, i; - for (i = 0; i < l; i++) { - product = a[i] * b + carry; - carry = Math.floor(product / base); - r[i] = product - carry * base; - } - while (carry > 0) { - r[i++] = carry % base; - carry = Math.floor(carry / base); - } - return r; - } - - function shiftLeft(x, n) { - var r = []; - while (n-- > 0) r.push(0); - return r.concat(x); - } - - function multiplyKaratsuba(x, y) { - var n = Math.max(x.length, y.length); - - if (n <= 30) return multiplyLong(x, y); - n = Math.ceil(n / 2); - - var b = x.slice(n), - a = x.slice(0, n), - d = y.slice(n), - c = y.slice(0, n); - - var ac = multiplyKaratsuba(a, c), - bd = multiplyKaratsuba(b, d), - abcd = multiplyKaratsuba(addAny(a, b), addAny(c, d)); - - var product = addAny(addAny(ac, shiftLeft(subtract(subtract(abcd, ac), bd), n)), shiftLeft(bd, 2 * n)); - trim(product); - return product; - } - - // The following function is derived from a surface fit of a graph plotting the performance difference - // between long multiplication and karatsuba multiplication versus the lengths of the two arrays. - function useKaratsuba(l1, l2) { - return -0.012 * l1 - 0.012 * l2 + 0.000015 * l1 * l2 > 0; - } - - BigInteger.prototype.multiply = function (v) { - var n = parseValue(v), - a = this.value, b = n.value, - sign = this.sign !== n.sign, - abs; - if (n.isSmall) { - if (b === 0) return Integer[0]; - if (b === 1) return this; - if (b === -1) return this.negate(); - abs = Math.abs(b); - if (abs < BASE) { - return new BigInteger(multiplySmall(a, abs), sign); - } - b = smallToArray(abs); - } - if (useKaratsuba(a.length, b.length)) // Karatsuba is only faster for certain array sizes - return new BigInteger(multiplyKaratsuba(a, b), sign); - return new BigInteger(multiplyLong(a, b), sign); - }; - - BigInteger.prototype.times = BigInteger.prototype.multiply; - - function multiplySmallAndArray(a, b, sign) { // a >= 0 - if (a < BASE) { - return new BigInteger(multiplySmall(b, a), sign); - } - return new BigInteger(multiplyLong(b, smallToArray(a)), sign); - } - SmallInteger.prototype._multiplyBySmall = function (a) { - if (isPrecise(a.value * this.value)) { - return new SmallInteger(a.value * this.value); - } - return multiplySmallAndArray(Math.abs(a.value), smallToArray(Math.abs(this.value)), this.sign !== a.sign); - }; - BigInteger.prototype._multiplyBySmall = function (a) { - if (a.value === 0) return Integer[0]; - if (a.value === 1) return this; - if (a.value === -1) return this.negate(); - return multiplySmallAndArray(Math.abs(a.value), this.value, this.sign !== a.sign); - }; - SmallInteger.prototype.multiply = function (v) { - return parseValue(v)._multiplyBySmall(this); - }; - SmallInteger.prototype.times = SmallInteger.prototype.multiply; - - NativeBigInt.prototype.multiply = function (v) { - return new NativeBigInt(this.value * parseValue(v).value); - } - NativeBigInt.prototype.times = NativeBigInt.prototype.multiply; - - function square(a) { - //console.assert(2 * BASE * BASE < MAX_INT); - var l = a.length, - r = createArray(l + l), - base = BASE, - product, carry, i, a_i, a_j; - for (i = 0; i < l; i++) { - a_i = a[i]; - carry = 0 - a_i * a_i; - for (var j = i; j < l; j++) { - a_j = a[j]; - product = 2 * (a_i * a_j) + r[i + j] + carry; - carry = Math.floor(product / base); - r[i + j] = product - carry * base; - } - r[i + l] = carry; - } - trim(r); - return r; - } - - BigInteger.prototype.square = function () { - return new BigInteger(square(this.value), false); - }; - - SmallInteger.prototype.square = function () { - var value = this.value * this.value; - if (isPrecise(value)) return new SmallInteger(value); - return new BigInteger(square(smallToArray(Math.abs(this.value))), false); - }; - - NativeBigInt.prototype.square = function (v) { - return new NativeBigInt(this.value * this.value); - } - - function divMod1(a, b) { // Left over from previous version. Performs faster than divMod2 on smaller input sizes. - var a_l = a.length, - b_l = b.length, - base = BASE, - result = createArray(b.length), - divisorMostSignificantDigit = b[b_l - 1], - // normalization - lambda = Math.ceil(base / (2 * divisorMostSignificantDigit)), - remainder = multiplySmall(a, lambda), - divisor = multiplySmall(b, lambda), - quotientDigit, shift, carry, borrow, i, l, q; - if (remainder.length <= a_l) remainder.push(0); - divisor.push(0); - divisorMostSignificantDigit = divisor[b_l - 1]; - for (shift = a_l - b_l; shift >= 0; shift--) { - quotientDigit = base - 1; - if (remainder[shift + b_l] !== divisorMostSignificantDigit) { - quotientDigit = Math.floor((remainder[shift + b_l] * base + remainder[shift + b_l - 1]) / divisorMostSignificantDigit); - } - // quotientDigit <= base - 1 - carry = 0; - borrow = 0; - l = divisor.length; - for (i = 0; i < l; i++) { - carry += quotientDigit * divisor[i]; - q = Math.floor(carry / base); - borrow += remainder[shift + i] - (carry - q * base); - carry = q; - if (borrow < 0) { - remainder[shift + i] = borrow + base; - borrow = -1; - } else { - remainder[shift + i] = borrow; - borrow = 0; - } - } - while (borrow !== 0) { - quotientDigit -= 1; - carry = 0; - for (i = 0; i < l; i++) { - carry += remainder[shift + i] - base + divisor[i]; - if (carry < 0) { - remainder[shift + i] = carry + base; - carry = 0; - } else { - remainder[shift + i] = carry; - carry = 1; - } - } - borrow += carry; - } - result[shift] = quotientDigit; - } - // denormalization - remainder = divModSmall(remainder, lambda)[0]; - return [arrayToSmall(result), arrayToSmall(remainder)]; - } - - function divMod2(a, b) { // Implementation idea shamelessly stolen from Silent Matt's library http://silentmatt.com/biginteger/ - // Performs faster than divMod1 on larger input sizes. - var a_l = a.length, - b_l = b.length, - result = [], - part = [], - base = BASE, - guess, xlen, highx, highy, check; - while (a_l) { - part.unshift(a[--a_l]); - trim(part); - if (compareAbs(part, b) < 0) { - result.push(0); - continue; - } - xlen = part.length; - highx = part[xlen - 1] * base + part[xlen - 2]; - highy = b[b_l - 1] * base + b[b_l - 2]; - if (xlen > b_l) { - highx = (highx + 1) * base; - } - guess = Math.ceil(highx / highy); - do { - check = multiplySmall(b, guess); - if (compareAbs(check, part) <= 0) break; - guess--; - } while (guess); - result.push(guess); - part = subtract(part, check); - } - result.reverse(); - return [arrayToSmall(result), arrayToSmall(part)]; - } - - function divModSmall(value, lambda) { - var length = value.length, - quotient = createArray(length), - base = BASE, - i, q, remainder, divisor; - remainder = 0; - for (i = length - 1; i >= 0; --i) { - divisor = remainder * base + value[i]; - q = truncate(divisor / lambda); - remainder = divisor - q * lambda; - quotient[i] = q | 0; - } - return [quotient, remainder | 0]; - } - - function divModAny(self, v) { - var value, n = parseValue(v); - if (supportsNativeBigInt) { - return [new NativeBigInt(self.value / n.value), new NativeBigInt(self.value % n.value)]; - } - var a = self.value, b = n.value; - var quotient; - if (b === 0) throw new Error("Cannot divide by zero"); - if (self.isSmall) { - if (n.isSmall) { - return [new SmallInteger(truncate(a / b)), new SmallInteger(a % b)]; - } - return [Integer[0], self]; - } - if (n.isSmall) { - if (b === 1) return [self, Integer[0]]; - if (b == -1) return [self.negate(), Integer[0]]; - var abs = Math.abs(b); - if (abs < BASE) { - value = divModSmall(a, abs); - quotient = arrayToSmall(value[0]); - var remainder = value[1]; - if (self.sign) remainder = -remainder; - if (typeof quotient === "number") { - if (self.sign !== n.sign) quotient = -quotient; - return [new SmallInteger(quotient), new SmallInteger(remainder)]; - } - return [new BigInteger(quotient, self.sign !== n.sign), new SmallInteger(remainder)]; - } - b = smallToArray(abs); - } - var comparison = compareAbs(a, b); - if (comparison === -1) return [Integer[0], self]; - if (comparison === 0) return [Integer[self.sign === n.sign ? 1 : -1], Integer[0]]; - - // divMod1 is faster on smaller input sizes - if (a.length + b.length <= 200) - value = divMod1(a, b); - else value = divMod2(a, b); - - quotient = value[0]; - var qSign = self.sign !== n.sign, - mod = value[1], - mSign = self.sign; - if (typeof quotient === "number") { - if (qSign) quotient = -quotient; - quotient = new SmallInteger(quotient); - } else quotient = new BigInteger(quotient, qSign); - if (typeof mod === "number") { - if (mSign) mod = -mod; - mod = new SmallInteger(mod); - } else mod = new BigInteger(mod, mSign); - return [quotient, mod]; - } - - BigInteger.prototype.divmod = function (v) { - var result = divModAny(this, v); - return { - quotient: result[0], - remainder: result[1] - }; - }; - NativeBigInt.prototype.divmod = SmallInteger.prototype.divmod = BigInteger.prototype.divmod; - - - BigInteger.prototype.divide = function (v) { - return divModAny(this, v)[0]; - }; - NativeBigInt.prototype.over = NativeBigInt.prototype.divide = function (v) { - return new NativeBigInt(this.value / parseValue(v).value); - }; - SmallInteger.prototype.over = SmallInteger.prototype.divide = BigInteger.prototype.over = BigInteger.prototype.divide; - - BigInteger.prototype.mod = function (v) { - return divModAny(this, v)[1]; - }; - NativeBigInt.prototype.mod = NativeBigInt.prototype.remainder = function (v) { - return new NativeBigInt(this.value % parseValue(v).value); - }; - SmallInteger.prototype.remainder = SmallInteger.prototype.mod = BigInteger.prototype.remainder = BigInteger.prototype.mod; - - BigInteger.prototype.pow = function (v) { - var n = parseValue(v), - a = this.value, - b = n.value, - value, x, y; - if (b === 0) return Integer[1]; - if (a === 0) return Integer[0]; - if (a === 1) return Integer[1]; - if (a === -1) return n.isEven() ? Integer[1] : Integer[-1]; - if (n.sign) { - return Integer[0]; - } - if (!n.isSmall) throw new Error("The exponent " + n.toString() + " is too large."); - if (this.isSmall) { - if (isPrecise(value = Math.pow(a, b))) - return new SmallInteger(truncate(value)); - } - x = this; - y = Integer[1]; - while (true) { - if (b & 1 === 1) { - y = y.times(x); - --b; - } - if (b === 0) break; - b /= 2; - x = x.square(); - } - return y; - }; - SmallInteger.prototype.pow = BigInteger.prototype.pow; - - NativeBigInt.prototype.pow = function (v) { - var n = parseValue(v); - var a = this.value, b = n.value; - var _0 = BigInt(0), _1 = BigInt(1), _2 = BigInt(2); - if (b === _0) return Integer[1]; - if (a === _0) return Integer[0]; - if (a === _1) return Integer[1]; - if (a === BigInt(-1)) return n.isEven() ? Integer[1] : Integer[-1]; - if (n.isNegative()) return new NativeBigInt(_0); - var x = this; - var y = Integer[1]; - while (true) { - if ((b & _1) === _1) { - y = y.times(x); - --b; - } - if (b === _0) break; - b /= _2; - x = x.square(); - } - return y; - } - - BigInteger.prototype.modPow = function (exp, mod) { - exp = parseValue(exp); - mod = parseValue(mod); - if (mod.isZero()) throw new Error("Cannot take modPow with modulus 0"); - var r = Integer[1], - base = this.mod(mod); - if (exp.isNegative()) { - exp = exp.multiply(Integer[-1]); - base = base.modInv(mod); - } - while (exp.isPositive()) { - if (base.isZero()) return Integer[0]; - if (exp.isOdd()) r = r.multiply(base).mod(mod); - exp = exp.divide(2); - base = base.square().mod(mod); - } - return r; - }; - NativeBigInt.prototype.modPow = SmallInteger.prototype.modPow = BigInteger.prototype.modPow; - - function compareAbs(a, b) { - if (a.length !== b.length) { - return a.length > b.length ? 1 : -1; - } - for (var i = a.length - 1; i >= 0; i--) { - if (a[i] !== b[i]) return a[i] > b[i] ? 1 : -1; - } - return 0; - } - - BigInteger.prototype.compareAbs = function (v) { - var n = parseValue(v), - a = this.value, - b = n.value; - if (n.isSmall) return 1; - return compareAbs(a, b); - }; - SmallInteger.prototype.compareAbs = function (v) { - var n = parseValue(v), - a = Math.abs(this.value), - b = n.value; - if (n.isSmall) { - b = Math.abs(b); - return a === b ? 0 : a > b ? 1 : -1; - } - return -1; - }; - NativeBigInt.prototype.compareAbs = function (v) { - var a = this.value; - var b = parseValue(v).value; - a = a >= 0 ? a : -a; - b = b >= 0 ? b : -b; - return a === b ? 0 : a > b ? 1 : -1; - } - - BigInteger.prototype.compare = function (v) { - // See discussion about comparison with Infinity: - // https://github.com/peterolson/BigInteger.js/issues/61 - if (v === Infinity) { - return -1; - } - if (v === -Infinity) { - return 1; - } - - var n = parseValue(v), - a = this.value, - b = n.value; - if (this.sign !== n.sign) { - return n.sign ? 1 : -1; - } - if (n.isSmall) { - return this.sign ? -1 : 1; - } - return compareAbs(a, b) * (this.sign ? -1 : 1); - }; - BigInteger.prototype.compareTo = BigInteger.prototype.compare; - - SmallInteger.prototype.compare = function (v) { - if (v === Infinity) { - return -1; - } - if (v === -Infinity) { - return 1; - } - - var n = parseValue(v), - a = this.value, - b = n.value; - if (n.isSmall) { - return a == b ? 0 : a > b ? 1 : -1; - } - if (a < 0 !== n.sign) { - return a < 0 ? -1 : 1; - } - return a < 0 ? 1 : -1; - }; - SmallInteger.prototype.compareTo = SmallInteger.prototype.compare; - - NativeBigInt.prototype.compare = function (v) { - if (v === Infinity) { - return -1; - } - if (v === -Infinity) { - return 1; - } - var a = this.value; - var b = parseValue(v).value; - return a === b ? 0 : a > b ? 1 : -1; - } - NativeBigInt.prototype.compareTo = NativeBigInt.prototype.compare; - - BigInteger.prototype.equals = function (v) { - return this.compare(v) === 0; - }; - NativeBigInt.prototype.eq = NativeBigInt.prototype.equals = SmallInteger.prototype.eq = SmallInteger.prototype.equals = BigInteger.prototype.eq = BigInteger.prototype.equals; - - BigInteger.prototype.notEquals = function (v) { - return this.compare(v) !== 0; - }; - NativeBigInt.prototype.neq = NativeBigInt.prototype.notEquals = SmallInteger.prototype.neq = SmallInteger.prototype.notEquals = BigInteger.prototype.neq = BigInteger.prototype.notEquals; - - BigInteger.prototype.greater = function (v) { - return this.compare(v) > 0; - }; - NativeBigInt.prototype.gt = NativeBigInt.prototype.greater = SmallInteger.prototype.gt = SmallInteger.prototype.greater = BigInteger.prototype.gt = BigInteger.prototype.greater; - - BigInteger.prototype.lesser = function (v) { - return this.compare(v) < 0; - }; - NativeBigInt.prototype.lt = NativeBigInt.prototype.lesser = SmallInteger.prototype.lt = SmallInteger.prototype.lesser = BigInteger.prototype.lt = BigInteger.prototype.lesser; - - BigInteger.prototype.greaterOrEquals = function (v) { - return this.compare(v) >= 0; - }; - NativeBigInt.prototype.geq = NativeBigInt.prototype.greaterOrEquals = SmallInteger.prototype.geq = SmallInteger.prototype.greaterOrEquals = BigInteger.prototype.geq = BigInteger.prototype.greaterOrEquals; - - BigInteger.prototype.lesserOrEquals = function (v) { - return this.compare(v) <= 0; - }; - NativeBigInt.prototype.leq = NativeBigInt.prototype.lesserOrEquals = SmallInteger.prototype.leq = SmallInteger.prototype.lesserOrEquals = BigInteger.prototype.leq = BigInteger.prototype.lesserOrEquals; - - BigInteger.prototype.isEven = function () { - return (this.value[0] & 1) === 0; - }; - SmallInteger.prototype.isEven = function () { - return (this.value & 1) === 0; - }; - NativeBigInt.prototype.isEven = function () { - return (this.value & BigInt(1)) === BigInt(0); - } - - BigInteger.prototype.isOdd = function () { - return (this.value[0] & 1) === 1; - }; - SmallInteger.prototype.isOdd = function () { - return (this.value & 1) === 1; - }; - NativeBigInt.prototype.isOdd = function () { - return (this.value & BigInt(1)) === BigInt(1); - } - - BigInteger.prototype.isPositive = function () { - return !this.sign; - }; - SmallInteger.prototype.isPositive = function () { - return this.value > 0; - }; - NativeBigInt.prototype.isPositive = SmallInteger.prototype.isPositive; - - BigInteger.prototype.isNegative = function () { - return this.sign; - }; - SmallInteger.prototype.isNegative = function () { - return this.value < 0; - }; - NativeBigInt.prototype.isNegative = SmallInteger.prototype.isNegative; - - BigInteger.prototype.isUnit = function () { - return false; - }; - SmallInteger.prototype.isUnit = function () { - return Math.abs(this.value) === 1; - }; - NativeBigInt.prototype.isUnit = function () { - return this.abs().value === BigInt(1); - } - - BigInteger.prototype.isZero = function () { - return false; - }; - SmallInteger.prototype.isZero = function () { - return this.value === 0; - }; - NativeBigInt.prototype.isZero = function () { - return this.value === BigInt(0); - } - - BigInteger.prototype.isDivisibleBy = function (v) { - var n = parseValue(v); - if (n.isZero()) return false; - if (n.isUnit()) return true; - if (n.compareAbs(2) === 0) return this.isEven(); - return this.mod(n).isZero(); - }; - NativeBigInt.prototype.isDivisibleBy = SmallInteger.prototype.isDivisibleBy = BigInteger.prototype.isDivisibleBy; - - function isBasicPrime(v) { - var n = v.abs(); - if (n.isUnit()) return false; - if (n.equals(2) || n.equals(3) || n.equals(5)) return true; - if (n.isEven() || n.isDivisibleBy(3) || n.isDivisibleBy(5)) return false; - if (n.lesser(49)) return true; - // we don't know if it's prime: let the other functions figure it out - } - - function millerRabinTest(n, a) { - var nPrev = n.prev(), - b = nPrev, - r = 0, - d, t, i, x; - while (b.isEven()) b = b.divide(2), r++; - next: for (i = 0; i < a.length; i++) { - if (n.lesser(a[i])) continue; - x = bigInt(a[i]).modPow(b, n); - if (x.isUnit() || x.equals(nPrev)) continue; - for (d = r - 1; d != 0; d--) { - x = x.square().mod(n); - if (x.isUnit()) return false; - if (x.equals(nPrev)) continue next; - } - return false; - } - return true; - } - - // Set "strict" to true to force GRH-supported lower bound of 2*log(N)^2 - BigInteger.prototype.isPrime = function (strict) { - var isPrime = isBasicPrime(this); - if (isPrime !== undefined) return isPrime; - var n = this.abs(); - var bits = n.bitLength(); - if (bits <= 64) - return millerRabinTest(n, [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]); - var logN = Math.log(2) * bits.toJSNumber(); - var t = Math.ceil((strict === true) ? (2 * Math.pow(logN, 2)) : logN); - for (var a = [], i = 0; i < t; i++) { - a.push(bigInt(i + 2)); - } - return millerRabinTest(n, a); - }; - NativeBigInt.prototype.isPrime = SmallInteger.prototype.isPrime = BigInteger.prototype.isPrime; - - BigInteger.prototype.isProbablePrime = function (iterations, rng) { - var isPrime = isBasicPrime(this); - if (isPrime !== undefined) return isPrime; - var n = this.abs(); - var t = iterations === undefined ? 5 : iterations; - for (var a = [], i = 0; i < t; i++) { - a.push(bigInt.randBetween(2, n.minus(2), rng)); - } - return millerRabinTest(n, a); - }; - NativeBigInt.prototype.isProbablePrime = SmallInteger.prototype.isProbablePrime = BigInteger.prototype.isProbablePrime; - - BigInteger.prototype.modInv = function (n) { - var t = bigInt.zero, newT = bigInt.one, r = parseValue(n), newR = this.abs(), q, lastT, lastR; - while (!newR.isZero()) { - q = r.divide(newR); - lastT = t; - lastR = r; - t = newT; - r = newR; - newT = lastT.subtract(q.multiply(newT)); - newR = lastR.subtract(q.multiply(newR)); - } - if (!r.isUnit()) throw new Error(this.toString() + " and " + n.toString() + " are not co-prime"); - if (t.compare(0) === -1) { - t = t.add(n); - } - if (this.isNegative()) { - return t.negate(); - } - return t; - }; - - NativeBigInt.prototype.modInv = SmallInteger.prototype.modInv = BigInteger.prototype.modInv; - - BigInteger.prototype.next = function () { - var value = this.value; - if (this.sign) { - return subtractSmall(value, 1, this.sign); - } - return new BigInteger(addSmall(value, 1), this.sign); - }; - SmallInteger.prototype.next = function () { - var value = this.value; - if (value + 1 < MAX_INT) return new SmallInteger(value + 1); - return new BigInteger(MAX_INT_ARR, false); - }; - NativeBigInt.prototype.next = function () { - return new NativeBigInt(this.value + BigInt(1)); - } - - BigInteger.prototype.prev = function () { - var value = this.value; - if (this.sign) { - return new BigInteger(addSmall(value, 1), true); - } - return subtractSmall(value, 1, this.sign); - }; - SmallInteger.prototype.prev = function () { - var value = this.value; - if (value - 1 > -MAX_INT) return new SmallInteger(value - 1); - return new BigInteger(MAX_INT_ARR, true); - }; - NativeBigInt.prototype.prev = function () { - return new NativeBigInt(this.value - BigInt(1)); - } - - var powersOfTwo = [1]; - while (2 * powersOfTwo[powersOfTwo.length - 1] <= BASE) powersOfTwo.push(2 * powersOfTwo[powersOfTwo.length - 1]); - var powers2Length = powersOfTwo.length, highestPower2 = powersOfTwo[powers2Length - 1]; - - function shift_isSmall(n) { - return Math.abs(n) <= BASE; - } - - BigInteger.prototype.shiftLeft = function (v) { - var n = parseValue(v).toJSNumber(); - if (!shift_isSmall(n)) { - throw new Error(String(n) + " is too large for shifting."); - } - if (n < 0) return this.shiftRight(-n); - var result = this; - if (result.isZero()) return result; - while (n >= powers2Length) { - result = result.multiply(highestPower2); - n -= powers2Length - 1; - } - return result.multiply(powersOfTwo[n]); - }; - NativeBigInt.prototype.shiftLeft = SmallInteger.prototype.shiftLeft = BigInteger.prototype.shiftLeft; - - BigInteger.prototype.shiftRight = function (v) { - var remQuo; - var n = parseValue(v).toJSNumber(); - if (!shift_isSmall(n)) { - throw new Error(String(n) + " is too large for shifting."); - } - if (n < 0) return this.shiftLeft(-n); - var result = this; - while (n >= powers2Length) { - if (result.isZero() || (result.isNegative() && result.isUnit())) return result; - remQuo = divModAny(result, highestPower2); - result = remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0]; - n -= powers2Length - 1; - } - remQuo = divModAny(result, powersOfTwo[n]); - return remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0]; - }; - NativeBigInt.prototype.shiftRight = SmallInteger.prototype.shiftRight = BigInteger.prototype.shiftRight; - - function bitwise(x, y, fn) { - y = parseValue(y); - var xSign = x.isNegative(), ySign = y.isNegative(); - var xRem = xSign ? x.not() : x, - yRem = ySign ? y.not() : y; - var xDigit = 0, yDigit = 0; - var xDivMod = null, yDivMod = null; - var result = []; - while (!xRem.isZero() || !yRem.isZero()) { - xDivMod = divModAny(xRem, highestPower2); - xDigit = xDivMod[1].toJSNumber(); - if (xSign) { - xDigit = highestPower2 - 1 - xDigit; // two's complement for negative numbers - } - - yDivMod = divModAny(yRem, highestPower2); - yDigit = yDivMod[1].toJSNumber(); - if (ySign) { - yDigit = highestPower2 - 1 - yDigit; // two's complement for negative numbers - } - - xRem = xDivMod[0]; - yRem = yDivMod[0]; - result.push(fn(xDigit, yDigit)); - } - var sum = fn(xSign ? 1 : 0, ySign ? 1 : 0) !== 0 ? bigInt(-1) : bigInt(0); - for (var i = result.length - 1; i >= 0; i -= 1) { - sum = sum.multiply(highestPower2).add(bigInt(result[i])); - } - return sum; - } - - BigInteger.prototype.not = function () { - return this.negate().prev(); - }; - NativeBigInt.prototype.not = SmallInteger.prototype.not = BigInteger.prototype.not; - - BigInteger.prototype.and = function (n) { - return bitwise(this, n, function (a, b) { return a & b; }); - }; - NativeBigInt.prototype.and = SmallInteger.prototype.and = BigInteger.prototype.and; - - BigInteger.prototype.or = function (n) { - return bitwise(this, n, function (a, b) { return a | b; }); - }; - NativeBigInt.prototype.or = SmallInteger.prototype.or = BigInteger.prototype.or; - - BigInteger.prototype.xor = function (n) { - return bitwise(this, n, function (a, b) { return a ^ b; }); - }; - NativeBigInt.prototype.xor = SmallInteger.prototype.xor = BigInteger.prototype.xor; - - var LOBMASK_I = 1 << 30, LOBMASK_BI = (BASE & -BASE) * (BASE & -BASE) | LOBMASK_I; - function roughLOB(n) { // get lowestOneBit (rough) - // SmallInteger: return Min(lowestOneBit(n), 1 << 30) - // BigInteger: return Min(lowestOneBit(n), 1 << 14) [BASE=1e7] - var v = n.value, - x = typeof v === "number" ? v | LOBMASK_I : - typeof v === "bigint" ? v | BigInt(LOBMASK_I) : - v[0] + v[1] * BASE | LOBMASK_BI; - return x & -x; - } - - function integerLogarithm(value, base) { - if (base.compareTo(value) <= 0) { - var tmp = integerLogarithm(value, base.square(base)); - var p = tmp.p; - var e = tmp.e; - var t = p.multiply(base); - return t.compareTo(value) <= 0 ? { p: t, e: e * 2 + 1 } : { p: p, e: e * 2 }; - } - return { p: bigInt(1), e: 0 }; - } - - BigInteger.prototype.bitLength = function () { - var n = this; - if (n.compareTo(bigInt(0)) < 0) { - n = n.negate().subtract(bigInt(1)); - } - if (n.compareTo(bigInt(0)) === 0) { - return bigInt(0); - } - return bigInt(integerLogarithm(n, bigInt(2)).e).add(bigInt(1)); - } - NativeBigInt.prototype.bitLength = SmallInteger.prototype.bitLength = BigInteger.prototype.bitLength; - - function max(a, b) { - a = parseValue(a); - b = parseValue(b); - return a.greater(b) ? a : b; - } - function min(a, b) { - a = parseValue(a); - b = parseValue(b); - return a.lesser(b) ? a : b; - } - function gcd(a, b) { - a = parseValue(a).abs(); - b = parseValue(b).abs(); - if (a.equals(b)) return a; - if (a.isZero()) return b; - if (b.isZero()) return a; - var c = Integer[1], d, t; - while (a.isEven() && b.isEven()) { - d = min(roughLOB(a), roughLOB(b)); - a = a.divide(d); - b = b.divide(d); - c = c.multiply(d); - } - while (a.isEven()) { - a = a.divide(roughLOB(a)); - } - do { - while (b.isEven()) { - b = b.divide(roughLOB(b)); - } - if (a.greater(b)) { - t = b; b = a; a = t; - } - b = b.subtract(a); - } while (!b.isZero()); - return c.isUnit() ? a : a.multiply(c); - } - function lcm(a, b) { - a = parseValue(a).abs(); - b = parseValue(b).abs(); - return a.divide(gcd(a, b)).multiply(b); - } - function randBetween(a, b, rng) { - a = parseValue(a); - b = parseValue(b); - var usedRNG = rng || Math.random; - var low = min(a, b), high = max(a, b); - var range = high.subtract(low).add(1); - if (range.isSmall) return low.add(Math.floor(usedRNG() * range)); - var digits = toBase(range, BASE).value; - var result = [], restricted = true; - for (var i = 0; i < digits.length; i++) { - var top = restricted ? digits[i] : BASE; - var digit = truncate(usedRNG() * top); - result.push(digit); - if (digit < top) restricted = false; - } - return low.add(Integer.fromArray(result, BASE, false)); - } - - var parseBase = function (text, base, alphabet, caseSensitive) { - alphabet = alphabet || DEFAULT_ALPHABET; - text = String(text); - if (!caseSensitive) { - text = text.toLowerCase(); - alphabet = alphabet.toLowerCase(); - } - var length = text.length; - var i; - var absBase = Math.abs(base); - var alphabetValues = {}; - for (i = 0; i < alphabet.length; i++) { - alphabetValues[alphabet[i]] = i; - } - for (i = 0; i < length; i++) { - var c = text[i]; - if (c === "-") continue; - if (c in alphabetValues) { - if (alphabetValues[c] >= absBase) { - if (c === "1" && absBase === 1) continue; - throw new Error(c + " is not a valid digit in base " + base + "."); - } - } - } - base = parseValue(base); - var digits = []; - var isNegative = text[0] === "-"; - for (i = isNegative ? 1 : 0; i < text.length; i++) { - var c = text[i]; - if (c in alphabetValues) digits.push(parseValue(alphabetValues[c])); - else if (c === "<") { - var start = i; - do { i++; } while (text[i] !== ">" && i < text.length); - digits.push(parseValue(text.slice(start + 1, i))); - } - else throw new Error(c + " is not a valid character"); - } - return parseBaseFromArray(digits, base, isNegative); - }; - - function parseBaseFromArray(digits, base, isNegative) { - var val = Integer[0], pow = Integer[1], i; - for (i = digits.length - 1; i >= 0; i--) { - val = val.add(digits[i].times(pow)); - pow = pow.times(base); - } - return isNegative ? val.negate() : val; - } - - function stringify(digit, alphabet) { - alphabet = alphabet || DEFAULT_ALPHABET; - if (digit < alphabet.length) { - return alphabet[digit]; - } - return "<" + digit + ">"; - } - - function toBase(n, base) { - base = bigInt(base); - if (base.isZero()) { - if (n.isZero()) return { value: [0], isNegative: false }; - throw new Error("Cannot convert nonzero numbers to base 0."); - } - if (base.equals(-1)) { - if (n.isZero()) return { value: [0], isNegative: false }; - if (n.isNegative()) - return { - value: [].concat.apply([], Array.apply(null, Array(-n.toJSNumber())) - .map(Array.prototype.valueOf, [1, 0]) - ), - isNegative: false - }; - - var arr = Array.apply(null, Array(n.toJSNumber() - 1)) - .map(Array.prototype.valueOf, [0, 1]); - arr.unshift([1]); - return { - value: [].concat.apply([], arr), - isNegative: false - }; - } - - var neg = false; - if (n.isNegative() && base.isPositive()) { - neg = true; - n = n.abs(); - } - if (base.isUnit()) { - if (n.isZero()) return { value: [0], isNegative: false }; - - return { - value: Array.apply(null, Array(n.toJSNumber())) - .map(Number.prototype.valueOf, 1), - isNegative: neg - }; - } - var out = []; - var left = n, divmod; - while (left.isNegative() || left.compareAbs(base) >= 0) { - divmod = left.divmod(base); - left = divmod.quotient; - var digit = divmod.remainder; - if (digit.isNegative()) { - digit = base.minus(digit).abs(); - left = left.next(); - } - out.push(digit.toJSNumber()); - } - out.push(left.toJSNumber()); - return { value: out.reverse(), isNegative: neg }; - } - - function toBaseString(n, base, alphabet) { - var arr = toBase(n, base); - return (arr.isNegative ? "-" : "") + arr.value.map(function (x) { - return stringify(x, alphabet); - }).join(''); - } - - BigInteger.prototype.toArray = function (radix) { - return toBase(this, radix); - }; - - SmallInteger.prototype.toArray = function (radix) { - return toBase(this, radix); - }; - - NativeBigInt.prototype.toArray = function (radix) { - return toBase(this, radix); - }; - - BigInteger.prototype.toString = function (radix, alphabet) { - if (radix === undefined) radix = 10; - if (radix !== 10) return toBaseString(this, radix, alphabet); - var v = this.value, l = v.length, str = String(v[--l]), zeros = "0000000", digit; - while (--l >= 0) { - digit = String(v[l]); - str += zeros.slice(digit.length) + digit; - } - var sign = this.sign ? "-" : ""; - return sign + str; - }; - - SmallInteger.prototype.toString = function (radix, alphabet) { - if (radix === undefined) radix = 10; - if (radix != 10) return toBaseString(this, radix, alphabet); - return String(this.value); - }; - - NativeBigInt.prototype.toString = SmallInteger.prototype.toString; - - NativeBigInt.prototype.toJSON = BigInteger.prototype.toJSON = SmallInteger.prototype.toJSON = function () { return this.toString(); } - - BigInteger.prototype.valueOf = function () { - return parseInt(this.toString(), 10); - }; - BigInteger.prototype.toJSNumber = BigInteger.prototype.valueOf; - - SmallInteger.prototype.valueOf = function () { - return this.value; - }; - SmallInteger.prototype.toJSNumber = SmallInteger.prototype.valueOf; - NativeBigInt.prototype.valueOf = NativeBigInt.prototype.toJSNumber = function () { - return parseInt(this.toString(), 10); - } - - function parseStringValue(v) { - if (isPrecise(+v)) { - var x = +v; - if (x === truncate(x)) - return supportsNativeBigInt ? new NativeBigInt(BigInt(x)) : new SmallInteger(x); - throw new Error("Invalid integer: " + v); - } - var sign = v[0] === "-"; - if (sign) v = v.slice(1); - var split = v.split(/e/i); - if (split.length > 2) throw new Error("Invalid integer: " + split.join("e")); - if (split.length === 2) { - var exp = split[1]; - if (exp[0] === "+") exp = exp.slice(1); - exp = +exp; - if (exp !== truncate(exp) || !isPrecise(exp)) throw new Error("Invalid integer: " + exp + " is not a valid exponent."); - var text = split[0]; - var decimalPlace = text.indexOf("."); - if (decimalPlace >= 0) { - exp -= text.length - decimalPlace - 1; - text = text.slice(0, decimalPlace) + text.slice(decimalPlace + 1); - } - if (exp < 0) throw new Error("Cannot include negative exponent part for integers"); - text += (new Array(exp + 1)).join("0"); - v = text; - } - var isValid = /^([0-9][0-9]*)$/.test(v); - if (!isValid) throw new Error("Invalid integer: " + v); - if (supportsNativeBigInt) { - return new NativeBigInt(BigInt(sign ? "-" + v : v)); - } - var r = [], max = v.length, l = LOG_BASE, min = max - l; - while (max > 0) { - r.push(+v.slice(min, max)); - min -= l; - if (min < 0) min = 0; - max -= l; - } - trim(r); - return new BigInteger(r, sign); - } - - function parseNumberValue(v) { - if (supportsNativeBigInt) { - return new NativeBigInt(BigInt(v)); - } - if (isPrecise(v)) { - if (v !== truncate(v)) throw new Error(v + " is not an integer."); - return new SmallInteger(v); - } - return parseStringValue(v.toString()); - } - - function parseValue(v) { - if (typeof v === "number") { - return parseNumberValue(v); - } - if (typeof v === "string") { - return parseStringValue(v); - } - if (typeof v === "bigint") { - return new NativeBigInt(v); - } - return v; - } - // Pre-define numbers in range [-999,999] - for (var i = 0; i < 1000; i++) { - Integer[i] = parseValue(i); - if (i > 0) Integer[-i] = parseValue(-i); - } - // Backwards compatibility - Integer.one = Integer[1]; - Integer.zero = Integer[0]; - Integer.minusOne = Integer[-1]; - Integer.max = max; - Integer.min = min; - Integer.gcd = gcd; - Integer.lcm = lcm; - Integer.isInstance = function (x) { return x instanceof BigInteger || x instanceof SmallInteger || x instanceof NativeBigInt; }; - Integer.randBetween = randBetween; - - Integer.fromArray = function (digits, base, isNegative) { - return parseBaseFromArray(digits.map(parseValue), parseValue(base || 10), isNegative); - }; - - return Integer; -})(); - -// Node.js check -if (typeof module !== "undefined" && module.hasOwnProperty("exports")) { - module.exports = bigInt; -} - -//amd check -if (typeof define === "function" && define.amd) { - define( function () { - return bigInt; - }); -} diff --git a/chabok-starter-cordova/node_modules/big-integer/BigInteger.min.js b/chabok-starter-cordova/node_modules/big-integer/BigInteger.min.js deleted file mode 100644 index 5cc380c..0000000 --- a/chabok-starter-cordova/node_modules/big-integer/BigInteger.min.js +++ /dev/null @@ -1 +0,0 @@ -var bigInt=function(undefined){"use strict";var BASE=1e7,LOG_BASE=7,MAX_INT=9007199254740992,MAX_INT_ARR=smallToArray(MAX_INT),DEFAULT_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyz";var supportsNativeBigInt=typeof BigInt==="function";function Integer(v,radix,alphabet,caseSensitive){if(typeof v==="undefined")return Integer[0];if(typeof radix!=="undefined")return+radix===10&&!alphabet?parseValue(v):parseBase(v,radix,alphabet,caseSensitive);return parseValue(v)}function BigInteger(value,sign){this.value=value;this.sign=sign;this.isSmall=false}BigInteger.prototype=Object.create(Integer.prototype);function SmallInteger(value){this.value=value;this.sign=value<0;this.isSmall=true}SmallInteger.prototype=Object.create(Integer.prototype);function NativeBigInt(value){this.value=value}NativeBigInt.prototype=Object.create(Integer.prototype);function isPrecise(n){return-MAX_INT0)return Math.floor(n);return Math.ceil(n)}function add(a,b){var l_a=a.length,l_b=b.length,r=new Array(l_a),carry=0,base=BASE,sum,i;for(i=0;i=base?1:0;r[i]=sum-carry*base}while(i0)r.push(carry);return r}function addAny(a,b){if(a.length>=b.length)return add(a,b);return add(b,a)}function addSmall(a,carry){var l=a.length,r=new Array(l),base=BASE,sum,i;for(i=0;i0){r[i++]=carry%base;carry=Math.floor(carry/base)}return r}BigInteger.prototype.add=function(v){var n=parseValue(v);if(this.sign!==n.sign){return this.subtract(n.negate())}var a=this.value,b=n.value;if(n.isSmall){return new BigInteger(addSmall(a,Math.abs(b)),this.sign)}return new BigInteger(addAny(a,b),this.sign)};BigInteger.prototype.plus=BigInteger.prototype.add;SmallInteger.prototype.add=function(v){var n=parseValue(v);var a=this.value;if(a<0!==n.sign){return this.subtract(n.negate())}var b=n.value;if(n.isSmall){if(isPrecise(a+b))return new SmallInteger(a+b);b=smallToArray(Math.abs(b))}return new BigInteger(addSmall(b,Math.abs(a)),a<0)};SmallInteger.prototype.plus=SmallInteger.prototype.add;NativeBigInt.prototype.add=function(v){return new NativeBigInt(this.value+parseValue(v).value)};NativeBigInt.prototype.plus=NativeBigInt.prototype.add;function subtract(a,b){var a_l=a.length,b_l=b.length,r=new Array(a_l),borrow=0,base=BASE,i,difference;for(i=0;i=0){value=subtract(a,b)}else{value=subtract(b,a);sign=!sign}value=arrayToSmall(value);if(typeof value==="number"){if(sign)value=-value;return new SmallInteger(value)}return new BigInteger(value,sign)}function subtractSmall(a,b,sign){var l=a.length,r=new Array(l),carry=-b,base=BASE,i,difference;for(i=0;i=0)};SmallInteger.prototype.minus=SmallInteger.prototype.subtract;NativeBigInt.prototype.subtract=function(v){return new NativeBigInt(this.value-parseValue(v).value)};NativeBigInt.prototype.minus=NativeBigInt.prototype.subtract;BigInteger.prototype.negate=function(){return new BigInteger(this.value,!this.sign)};SmallInteger.prototype.negate=function(){var sign=this.sign;var small=new SmallInteger(-this.value);small.sign=!sign;return small};NativeBigInt.prototype.negate=function(){return new NativeBigInt(-this.value)};BigInteger.prototype.abs=function(){return new BigInteger(this.value,false)};SmallInteger.prototype.abs=function(){return new SmallInteger(Math.abs(this.value))};NativeBigInt.prototype.abs=function(){return new NativeBigInt(this.value>=0?this.value:-this.value)};function multiplyLong(a,b){var a_l=a.length,b_l=b.length,l=a_l+b_l,r=createArray(l),base=BASE,product,carry,i,a_i,b_j;for(i=0;i0){r[i++]=carry%base;carry=Math.floor(carry/base)}return r}function shiftLeft(x,n){var r=[];while(n-- >0)r.push(0);return r.concat(x)}function multiplyKaratsuba(x,y){var n=Math.max(x.length,y.length);if(n<=30)return multiplyLong(x,y);n=Math.ceil(n/2);var b=x.slice(n),a=x.slice(0,n),d=y.slice(n),c=y.slice(0,n);var ac=multiplyKaratsuba(a,c),bd=multiplyKaratsuba(b,d),abcd=multiplyKaratsuba(addAny(a,b),addAny(c,d));var product=addAny(addAny(ac,shiftLeft(subtract(subtract(abcd,ac),bd),n)),shiftLeft(bd,2*n));trim(product);return product}function useKaratsuba(l1,l2){return-.012*l1-.012*l2+15e-6*l1*l2>0}BigInteger.prototype.multiply=function(v){var n=parseValue(v),a=this.value,b=n.value,sign=this.sign!==n.sign,abs;if(n.isSmall){if(b===0)return Integer[0];if(b===1)return this;if(b===-1)return this.negate();abs=Math.abs(b);if(abs=0;shift--){quotientDigit=base-1;if(remainder[shift+b_l]!==divisorMostSignificantDigit){quotientDigit=Math.floor((remainder[shift+b_l]*base+remainder[shift+b_l-1])/divisorMostSignificantDigit)}carry=0;borrow=0;l=divisor.length;for(i=0;ib_l){highx=(highx+1)*base}guess=Math.ceil(highx/highy);do{check=multiplySmall(b,guess);if(compareAbs(check,part)<=0)break;guess--}while(guess);result.push(guess);part=subtract(part,check)}result.reverse();return[arrayToSmall(result),arrayToSmall(part)]}function divModSmall(value,lambda){var length=value.length,quotient=createArray(length),base=BASE,i,q,remainder,divisor;remainder=0;for(i=length-1;i>=0;--i){divisor=remainder*base+value[i];q=truncate(divisor/lambda);remainder=divisor-q*lambda;quotient[i]=q|0}return[quotient,remainder|0]}function divModAny(self,v){var value,n=parseValue(v);if(supportsNativeBigInt){return[new NativeBigInt(self.value/n.value),new NativeBigInt(self.value%n.value)]}var a=self.value,b=n.value;var quotient;if(b===0)throw new Error("Cannot divide by zero");if(self.isSmall){if(n.isSmall){return[new SmallInteger(truncate(a/b)),new SmallInteger(a%b)]}return[Integer[0],self]}if(n.isSmall){if(b===1)return[self,Integer[0]];if(b==-1)return[self.negate(),Integer[0]];var abs=Math.abs(b);if(absb.length?1:-1}for(var i=a.length-1;i>=0;i--){if(a[i]!==b[i])return a[i]>b[i]?1:-1}return 0}BigInteger.prototype.compareAbs=function(v){var n=parseValue(v),a=this.value,b=n.value;if(n.isSmall)return 1;return compareAbs(a,b)};SmallInteger.prototype.compareAbs=function(v){var n=parseValue(v),a=Math.abs(this.value),b=n.value;if(n.isSmall){b=Math.abs(b);return a===b?0:a>b?1:-1}return-1};NativeBigInt.prototype.compareAbs=function(v){var a=this.value;var b=parseValue(v).value;a=a>=0?a:-a;b=b>=0?b:-b;return a===b?0:a>b?1:-1};BigInteger.prototype.compare=function(v){if(v===Infinity){return-1}if(v===-Infinity){return 1}var n=parseValue(v),a=this.value,b=n.value;if(this.sign!==n.sign){return n.sign?1:-1}if(n.isSmall){return this.sign?-1:1}return compareAbs(a,b)*(this.sign?-1:1)};BigInteger.prototype.compareTo=BigInteger.prototype.compare;SmallInteger.prototype.compare=function(v){if(v===Infinity){return-1}if(v===-Infinity){return 1}var n=parseValue(v),a=this.value,b=n.value;if(n.isSmall){return a==b?0:a>b?1:-1}if(a<0!==n.sign){return a<0?-1:1}return a<0?1:-1};SmallInteger.prototype.compareTo=SmallInteger.prototype.compare;NativeBigInt.prototype.compare=function(v){if(v===Infinity){return-1}if(v===-Infinity){return 1}var a=this.value;var b=parseValue(v).value;return a===b?0:a>b?1:-1};NativeBigInt.prototype.compareTo=NativeBigInt.prototype.compare;BigInteger.prototype.equals=function(v){return this.compare(v)===0};NativeBigInt.prototype.eq=NativeBigInt.prototype.equals=SmallInteger.prototype.eq=SmallInteger.prototype.equals=BigInteger.prototype.eq=BigInteger.prototype.equals;BigInteger.prototype.notEquals=function(v){return this.compare(v)!==0};NativeBigInt.prototype.neq=NativeBigInt.prototype.notEquals=SmallInteger.prototype.neq=SmallInteger.prototype.notEquals=BigInteger.prototype.neq=BigInteger.prototype.notEquals;BigInteger.prototype.greater=function(v){return this.compare(v)>0};NativeBigInt.prototype.gt=NativeBigInt.prototype.greater=SmallInteger.prototype.gt=SmallInteger.prototype.greater=BigInteger.prototype.gt=BigInteger.prototype.greater;BigInteger.prototype.lesser=function(v){return this.compare(v)<0};NativeBigInt.prototype.lt=NativeBigInt.prototype.lesser=SmallInteger.prototype.lt=SmallInteger.prototype.lesser=BigInteger.prototype.lt=BigInteger.prototype.lesser;BigInteger.prototype.greaterOrEquals=function(v){return this.compare(v)>=0};NativeBigInt.prototype.geq=NativeBigInt.prototype.greaterOrEquals=SmallInteger.prototype.geq=SmallInteger.prototype.greaterOrEquals=BigInteger.prototype.geq=BigInteger.prototype.greaterOrEquals;BigInteger.prototype.lesserOrEquals=function(v){return this.compare(v)<=0};NativeBigInt.prototype.leq=NativeBigInt.prototype.lesserOrEquals=SmallInteger.prototype.leq=SmallInteger.prototype.lesserOrEquals=BigInteger.prototype.leq=BigInteger.prototype.lesserOrEquals;BigInteger.prototype.isEven=function(){return(this.value[0]&1)===0};SmallInteger.prototype.isEven=function(){return(this.value&1)===0};NativeBigInt.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)};BigInteger.prototype.isOdd=function(){return(this.value[0]&1)===1};SmallInteger.prototype.isOdd=function(){return(this.value&1)===1};NativeBigInt.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)};BigInteger.prototype.isPositive=function(){return!this.sign};SmallInteger.prototype.isPositive=function(){return this.value>0};NativeBigInt.prototype.isPositive=SmallInteger.prototype.isPositive;BigInteger.prototype.isNegative=function(){return this.sign};SmallInteger.prototype.isNegative=function(){return this.value<0};NativeBigInt.prototype.isNegative=SmallInteger.prototype.isNegative;BigInteger.prototype.isUnit=function(){return false};SmallInteger.prototype.isUnit=function(){return Math.abs(this.value)===1};NativeBigInt.prototype.isUnit=function(){return this.abs().value===BigInt(1)};BigInteger.prototype.isZero=function(){return false};SmallInteger.prototype.isZero=function(){return this.value===0};NativeBigInt.prototype.isZero=function(){return this.value===BigInt(0)};BigInteger.prototype.isDivisibleBy=function(v){var n=parseValue(v);if(n.isZero())return false;if(n.isUnit())return true;if(n.compareAbs(2)===0)return this.isEven();return this.mod(n).isZero()};NativeBigInt.prototype.isDivisibleBy=SmallInteger.prototype.isDivisibleBy=BigInteger.prototype.isDivisibleBy;function isBasicPrime(v){var n=v.abs();if(n.isUnit())return false;if(n.equals(2)||n.equals(3)||n.equals(5))return true;if(n.isEven()||n.isDivisibleBy(3)||n.isDivisibleBy(5))return false;if(n.lesser(49))return true}function millerRabinTest(n,a){var nPrev=n.prev(),b=nPrev,r=0,d,t,i,x;while(b.isEven())b=b.divide(2),r++;next:for(i=0;i-MAX_INT)return new SmallInteger(value-1);return new BigInteger(MAX_INT_ARR,true)};NativeBigInt.prototype.prev=function(){return new NativeBigInt(this.value-BigInt(1))};var powersOfTwo=[1];while(2*powersOfTwo[powersOfTwo.length-1]<=BASE)powersOfTwo.push(2*powersOfTwo[powersOfTwo.length-1]);var powers2Length=powersOfTwo.length,highestPower2=powersOfTwo[powers2Length-1];function shift_isSmall(n){return Math.abs(n)<=BASE}BigInteger.prototype.shiftLeft=function(v){var n=parseValue(v).toJSNumber();if(!shift_isSmall(n)){throw new Error(String(n)+" is too large for shifting.")}if(n<0)return this.shiftRight(-n);var result=this;if(result.isZero())return result;while(n>=powers2Length){result=result.multiply(highestPower2);n-=powers2Length-1}return result.multiply(powersOfTwo[n])};NativeBigInt.prototype.shiftLeft=SmallInteger.prototype.shiftLeft=BigInteger.prototype.shiftLeft;BigInteger.prototype.shiftRight=function(v){var remQuo;var n=parseValue(v).toJSNumber();if(!shift_isSmall(n)){throw new Error(String(n)+" is too large for shifting.")}if(n<0)return this.shiftLeft(-n);var result=this;while(n>=powers2Length){if(result.isZero()||result.isNegative()&&result.isUnit())return result;remQuo=divModAny(result,highestPower2);result=remQuo[1].isNegative()?remQuo[0].prev():remQuo[0];n-=powers2Length-1}remQuo=divModAny(result,powersOfTwo[n]);return remQuo[1].isNegative()?remQuo[0].prev():remQuo[0]};NativeBigInt.prototype.shiftRight=SmallInteger.prototype.shiftRight=BigInteger.prototype.shiftRight;function bitwise(x,y,fn){y=parseValue(y);var xSign=x.isNegative(),ySign=y.isNegative();var xRem=xSign?x.not():x,yRem=ySign?y.not():y;var xDigit=0,yDigit=0;var xDivMod=null,yDivMod=null;var result=[];while(!xRem.isZero()||!yRem.isZero()){xDivMod=divModAny(xRem,highestPower2);xDigit=xDivMod[1].toJSNumber();if(xSign){xDigit=highestPower2-1-xDigit}yDivMod=divModAny(yRem,highestPower2);yDigit=yDivMod[1].toJSNumber();if(ySign){yDigit=highestPower2-1-yDigit}xRem=xDivMod[0];yRem=yDivMod[0];result.push(fn(xDigit,yDigit))}var sum=fn(xSign?1:0,ySign?1:0)!==0?bigInt(-1):bigInt(0);for(var i=result.length-1;i>=0;i-=1){sum=sum.multiply(highestPower2).add(bigInt(result[i]))}return sum}BigInteger.prototype.not=function(){return this.negate().prev()};NativeBigInt.prototype.not=SmallInteger.prototype.not=BigInteger.prototype.not;BigInteger.prototype.and=function(n){return bitwise(this,n,function(a,b){return a&b})};NativeBigInt.prototype.and=SmallInteger.prototype.and=BigInteger.prototype.and;BigInteger.prototype.or=function(n){return bitwise(this,n,function(a,b){return a|b})};NativeBigInt.prototype.or=SmallInteger.prototype.or=BigInteger.prototype.or;BigInteger.prototype.xor=function(n){return bitwise(this,n,function(a,b){return a^b})};NativeBigInt.prototype.xor=SmallInteger.prototype.xor=BigInteger.prototype.xor;var LOBMASK_I=1<<30,LOBMASK_BI=(BASE&-BASE)*(BASE&-BASE)|LOBMASK_I;function roughLOB(n){var v=n.value,x=typeof v==="number"?v|LOBMASK_I:typeof v==="bigint"?v|BigInt(LOBMASK_I):v[0]+v[1]*BASE|LOBMASK_BI;return x&-x}function integerLogarithm(value,base){if(base.compareTo(value)<=0){var tmp=integerLogarithm(value,base.square(base));var p=tmp.p;var e=tmp.e;var t=p.multiply(base);return t.compareTo(value)<=0?{p:t,e:e*2+1}:{p:p,e:e*2}}return{p:bigInt(1),e:0}}BigInteger.prototype.bitLength=function(){var n=this;if(n.compareTo(bigInt(0))<0){n=n.negate().subtract(bigInt(1))}if(n.compareTo(bigInt(0))===0){return bigInt(0)}return bigInt(integerLogarithm(n,bigInt(2)).e).add(bigInt(1))};NativeBigInt.prototype.bitLength=SmallInteger.prototype.bitLength=BigInteger.prototype.bitLength;function max(a,b){a=parseValue(a);b=parseValue(b);return a.greater(b)?a:b}function min(a,b){a=parseValue(a);b=parseValue(b);return a.lesser(b)?a:b}function gcd(a,b){a=parseValue(a).abs();b=parseValue(b).abs();if(a.equals(b))return a;if(a.isZero())return b;if(b.isZero())return a;var c=Integer[1],d,t;while(a.isEven()&&b.isEven()){d=min(roughLOB(a),roughLOB(b));a=a.divide(d);b=b.divide(d);c=c.multiply(d)}while(a.isEven()){a=a.divide(roughLOB(a))}do{while(b.isEven()){b=b.divide(roughLOB(b))}if(a.greater(b)){t=b;b=a;a=t}b=b.subtract(a)}while(!b.isZero());return c.isUnit()?a:a.multiply(c)}function lcm(a,b){a=parseValue(a).abs();b=parseValue(b).abs();return a.divide(gcd(a,b)).multiply(b)}function randBetween(a,b,rng){a=parseValue(a);b=parseValue(b);var usedRNG=rng||Math.random;var low=min(a,b),high=max(a,b);var range=high.subtract(low).add(1);if(range.isSmall)return low.add(Math.floor(usedRNG()*range));var digits=toBase(range,BASE).value;var result=[],restricted=true;for(var i=0;i=absBase){if(c==="1"&&absBase===1)continue;throw new Error(c+" is not a valid digit in base "+base+".")}}}base=parseValue(base);var digits=[];var isNegative=text[0]==="-";for(i=isNegative?1:0;i"&&i=0;i--){val=val.add(digits[i].times(pow));pow=pow.times(base)}return isNegative?val.negate():val}function stringify(digit,alphabet){alphabet=alphabet||DEFAULT_ALPHABET;if(digit"}function toBase(n,base){base=bigInt(base);if(base.isZero()){if(n.isZero())return{value:[0],isNegative:false};throw new Error("Cannot convert nonzero numbers to base 0.")}if(base.equals(-1)){if(n.isZero())return{value:[0],isNegative:false};if(n.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-n.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:false};var arr=Array.apply(null,Array(n.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);arr.unshift([1]);return{value:[].concat.apply([],arr),isNegative:false}}var neg=false;if(n.isNegative()&&base.isPositive()){neg=true;n=n.abs()}if(base.isUnit()){if(n.isZero())return{value:[0],isNegative:false};return{value:Array.apply(null,Array(n.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:neg}}var out=[];var left=n,divmod;while(left.isNegative()||left.compareAbs(base)>=0){divmod=left.divmod(base);left=divmod.quotient;var digit=divmod.remainder;if(digit.isNegative()){digit=base.minus(digit).abs();left=left.next()}out.push(digit.toJSNumber())}out.push(left.toJSNumber());return{value:out.reverse(),isNegative:neg}}function toBaseString(n,base,alphabet){var arr=toBase(n,base);return(arr.isNegative?"-":"")+arr.value.map(function(x){return stringify(x,alphabet)}).join("")}BigInteger.prototype.toArray=function(radix){return toBase(this,radix)};SmallInteger.prototype.toArray=function(radix){return toBase(this,radix)};NativeBigInt.prototype.toArray=function(radix){return toBase(this,radix)};BigInteger.prototype.toString=function(radix,alphabet){if(radix===undefined)radix=10;if(radix!==10)return toBaseString(this,radix,alphabet);var v=this.value,l=v.length,str=String(v[--l]),zeros="0000000",digit;while(--l>=0){digit=String(v[l]);str+=zeros.slice(digit.length)+digit}var sign=this.sign?"-":"";return sign+str};SmallInteger.prototype.toString=function(radix,alphabet){if(radix===undefined)radix=10;if(radix!=10)return toBaseString(this,radix,alphabet);return String(this.value)};NativeBigInt.prototype.toString=SmallInteger.prototype.toString;NativeBigInt.prototype.toJSON=BigInteger.prototype.toJSON=SmallInteger.prototype.toJSON=function(){return this.toString()};BigInteger.prototype.valueOf=function(){return parseInt(this.toString(),10)};BigInteger.prototype.toJSNumber=BigInteger.prototype.valueOf;SmallInteger.prototype.valueOf=function(){return this.value};SmallInteger.prototype.toJSNumber=SmallInteger.prototype.valueOf;NativeBigInt.prototype.valueOf=NativeBigInt.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};function parseStringValue(v){if(isPrecise(+v)){var x=+v;if(x===truncate(x))return supportsNativeBigInt?new NativeBigInt(BigInt(x)):new SmallInteger(x);throw new Error("Invalid integer: "+v)}var sign=v[0]==="-";if(sign)v=v.slice(1);var split=v.split(/e/i);if(split.length>2)throw new Error("Invalid integer: "+split.join("e"));if(split.length===2){var exp=split[1];if(exp[0]==="+")exp=exp.slice(1);exp=+exp;if(exp!==truncate(exp)||!isPrecise(exp))throw new Error("Invalid integer: "+exp+" is not a valid exponent.");var text=split[0];var decimalPlace=text.indexOf(".");if(decimalPlace>=0){exp-=text.length-decimalPlace-1;text=text.slice(0,decimalPlace)+text.slice(decimalPlace+1)}if(exp<0)throw new Error("Cannot include negative exponent part for integers");text+=new Array(exp+1).join("0");v=text}var isValid=/^([0-9][0-9]*)$/.test(v);if(!isValid)throw new Error("Invalid integer: "+v);if(supportsNativeBigInt){return new NativeBigInt(BigInt(sign?"-"+v:v))}var r=[],max=v.length,l=LOG_BASE,min=max-l;while(max>0){r.push(+v.slice(min,max));min-=l;if(min<0)min=0;max-=l}trim(r);return new BigInteger(r,sign)}function parseNumberValue(v){if(supportsNativeBigInt){return new NativeBigInt(BigInt(v))}if(isPrecise(v)){if(v!==truncate(v))throw new Error(v+" is not an integer.");return new SmallInteger(v)}return parseStringValue(v.toString())}function parseValue(v){if(typeof v==="number"){return parseNumberValue(v)}if(typeof v==="string"){return parseStringValue(v)}if(typeof v==="bigint"){return new NativeBigInt(v)}return v}for(var i=0;i<1e3;i++){Integer[i]=parseValue(i);if(i>0)Integer[-i]=parseValue(-i)}Integer.one=Integer[1];Integer.zero=Integer[0];Integer.minusOne=Integer[-1];Integer.max=max;Integer.min=min;Integer.gcd=gcd;Integer.lcm=lcm;Integer.isInstance=function(x){return x instanceof BigInteger||x instanceof SmallInteger||x instanceof NativeBigInt};Integer.randBetween=randBetween;Integer.fromArray=function(digits,base,isNegative){return parseBaseFromArray(digits.map(parseValue),parseValue(base||10),isNegative)};return Integer}();if(typeof module!=="undefined"&&module.hasOwnProperty("exports")){module.exports=bigInt}if(typeof define==="function"&&define.amd){define(function(){return bigInt})} \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/big-integer/LICENSE b/chabok-starter-cordova/node_modules/big-integer/LICENSE deleted file mode 100644 index cf1ab25..0000000 --- a/chabok-starter-cordova/node_modules/big-integer/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -This is free and unencumbered software released into the public domain. - -Anyone is free to copy, modify, publish, use, compile, sell, or -distribute this software, either in source code form or as a compiled -binary, for any purpose, commercial or non-commercial, and by any -means. - -In jurisdictions that recognize copyright laws, the author or authors -of this software dedicate any and all copyright interest in the -software to the public domain. We make this dedication for the benefit -of the public at large and to the detriment of our heirs and -successors. We intend this dedication to be an overt act of -relinquishment in perpetuity of all present and future rights to this -software under copyright law. - -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 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. - -For more information, please refer to diff --git a/chabok-starter-cordova/node_modules/big-integer/README.md b/chabok-starter-cordova/node_modules/big-integer/README.md deleted file mode 100644 index 5668e58..0000000 --- a/chabok-starter-cordova/node_modules/big-integer/README.md +++ /dev/null @@ -1,588 +0,0 @@ -# BigInteger.js [![Build Status][travis-img]][travis-url] [![Coverage Status][coveralls-img]][coveralls-url] [![Monthly Downloads][downloads-img]][downloads-url] - -[travis-url]: https://travis-ci.org/peterolson/BigInteger.js -[travis-img]: https://travis-ci.org/peterolson/BigInteger.js.svg?branch=master -[coveralls-url]: https://coveralls.io/github/peterolson/BigInteger.js?branch=master -[coveralls-img]: https://coveralls.io/repos/peterolson/BigInteger.js/badge.svg?branch=master&service=github -[downloads-url]: https://www.npmjs.com/package/big-integer -[downloads-img]: https://img.shields.io/npm/dm/big-integer.svg - -**BigInteger.js** is an arbitrary-length integer library for Javascript, allowing arithmetic operations on integers of unlimited size, notwithstanding memory and time limitations. - -**Update (December 2, 2018):** [`BigInt` is being added as a native feature of JavaScript](https://tc39.github.io/proposal-bigint/). This library now works as a polyfill: if the environment supports the native `BigInt`, this library acts as a thin wrapper over the native implementation. - -## Installation - -If you are using a browser, you can download [BigInteger.js from GitHub](http://peterolson.github.com/BigInteger.js/BigInteger.min.js) or just hotlink to it: - - - -If you are using node, you can install BigInteger with [npm](https://npmjs.org/). - - npm install big-integer - -Then you can include it in your code: - - var bigInt = require("big-integer"); - - -## Usage -### `bigInt(number, [base], [alphabet], [caseSensitive])` - -You can create a bigInt by calling the `bigInt` function. You can pass in - - - a string, which it will parse as an bigInt and throw an `"Invalid integer"` error if the parsing fails. - - a Javascript number, which it will parse as an bigInt and throw an `"Invalid integer"` error if the parsing fails. - - another bigInt. - - nothing, and it will return `bigInt.zero`. - - If you provide a second parameter, then it will parse `number` as a number in base `base`. Note that `base` can be any bigInt (even negative or zero). The letters "a-z" and "A-Z" will be interpreted as the numbers 10 to 35. Higher digits can be specified in angle brackets (`<` and `>`). The default `base` is `10`. - - You can specify a custom alphabet for base conversion with the third parameter. The default `alphabet` is `"0123456789abcdefghijklmnopqrstuvwxyz"`. - - The fourth parameter specifies whether or not the number string should be case-sensitive, i.e. whether `a` and `A` should be treated as different digits. By default `caseSensitive` is `false`. - -Examples: - - var zero = bigInt(); - var ninetyThree = bigInt(93); - var largeNumber = bigInt("75643564363473453456342378564387956906736546456235345"); - var googol = bigInt("1e100"); - var bigNumber = bigInt(largeNumber); - - var maximumByte = bigInt("FF", 16); - var fiftyFiveGoogol = bigInt("<55>0", googol); - -Note that Javascript numbers larger than `9007199254740992` and smaller than `-9007199254740992` are not precisely represented numbers and will not produce exact results. If you are dealing with numbers outside that range, it is better to pass in strings. - -### Method Chaining - -Note that bigInt operations return bigInts, which allows you to chain methods, for example: - - var salary = bigInt(dollarsPerHour).times(hoursWorked).plus(randomBonuses) - -### Constants - -There are three named constants already stored that you do not have to construct with the `bigInt` function yourself: - - - `bigInt.one`, equivalent to `bigInt(1)` - - `bigInt.zero`, equivalent to `bigInt(0)` - - `bigInt.minusOne`, equivalent to `bigInt(-1)` - -The numbers from -999 to 999 are also already prestored and can be accessed using `bigInt[index]`, for example: - - - `bigInt[-999]`, equivalent to `bigInt(-999)` - - `bigInt[256]`, equivalent to `bigInt(256)` - -### Methods - -#### `abs()` - -Returns the absolute value of a bigInt. - - - `bigInt(-45).abs()` => `45` - - `bigInt(45).abs()` => `45` - -#### `add(number)` - -Performs addition. - - - `bigInt(5).add(7)` => `12` - -[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Addition) - -#### `and(number)` - -Performs the bitwise AND operation. The operands are treated as if they were represented using [two's complement representation](http://en.wikipedia.org/wiki/Two%27s_complement). - - - `bigInt(6).and(3)` => `2` - - `bigInt(6).and(-3)` => `4` - -#### `bitLength()` - -Returns the number of digits required to represent a bigInt in binary. - - - `bigInt(5)` => `3` (since 5 is `101` in binary, which is three digits long) - -#### `compare(number)` - -Performs a comparison between two numbers. If the numbers are equal, it returns `0`. If the first number is greater, it returns `1`. If the first number is lesser, it returns `-1`. - - - `bigInt(5).compare(5)` => `0` - - `bigInt(5).compare(4)` => `1` - - `bigInt(4).compare(5)` => `-1` - -#### `compareAbs(number)` - -Performs a comparison between the absolute value of two numbers. - - - `bigInt(5).compareAbs(-5)` => `0` - - `bigInt(5).compareAbs(4)` => `1` - - `bigInt(4).compareAbs(-5)` => `-1` - -#### `compareTo(number)` - -Alias for the `compare` method. - -#### `divide(number)` - -Performs integer division, disregarding the remainder. - - - `bigInt(59).divide(5)` => `11` - -[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Division) - -#### `divmod(number)` - -Performs division and returns an object with two properties: `quotient` and `remainder`. The sign of the remainder will match the sign of the dividend. - - - `bigInt(59).divmod(5)` => `{quotient: bigInt(11), remainder: bigInt(4) }` - - `bigInt(-5).divmod(2)` => `{quotient: bigInt(-2), remainder: bigInt(-1) }` - -[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Division) - -#### `eq(number)` - -Alias for the `equals` method. - -#### `equals(number)` - -Checks if two numbers are equal. - - - `bigInt(5).equals(5)` => `true` - - `bigInt(4).equals(7)` => `false` - -#### `geq(number)` - -Alias for the `greaterOrEquals` method. - - -#### `greater(number)` - -Checks if the first number is greater than the second. - - - `bigInt(5).greater(6)` => `false` - - `bigInt(5).greater(5)` => `false` - - `bigInt(5).greater(4)` => `true` - -#### `greaterOrEquals(number)` - -Checks if the first number is greater than or equal to the second. - - - `bigInt(5).greaterOrEquals(6)` => `false` - - `bigInt(5).greaterOrEquals(5)` => `true` - - `bigInt(5).greaterOrEquals(4)` => `true` - -#### `gt(number)` - -Alias for the `greater` method. - -#### `isDivisibleBy(number)` - -Returns `true` if the first number is divisible by the second number, `false` otherwise. - - - `bigInt(999).isDivisibleBy(333)` => `true` - - `bigInt(99).isDivisibleBy(5)` => `false` - -#### `isEven()` - -Returns `true` if the number is even, `false` otherwise. - - - `bigInt(6).isEven()` => `true` - - `bigInt(3).isEven()` => `false` - -#### `isNegative()` - -Returns `true` if the number is negative, `false` otherwise. -Returns `false` for `0` and `-0`. - - - `bigInt(-23).isNegative()` => `true` - - `bigInt(50).isNegative()` => `false` - -#### `isOdd()` - -Returns `true` if the number is odd, `false` otherwise. - - - `bigInt(13).isOdd()` => `true` - - `bigInt(40).isOdd()` => `false` - -#### `isPositive()` - -Return `true` if the number is positive, `false` otherwise. -Returns `false` for `0` and `-0`. - - - `bigInt(54).isPositive()` => `true` - - `bigInt(-1).isPositive()` => `false` - -#### `isPrime()` - -Returns `true` if the number is prime, `false` otherwise. - - - `bigInt(5).isPrime()` => `true` - - `bigInt(6).isPrime()` => `false` - -#### `isProbablePrime([iterations], [rng])` - -Returns `true` if the number is very likely to be prime, `false` otherwise. -Supplying `iterations` is optional - it determines the number of iterations of the test (default: `5`). The more iterations, the lower chance of getting a false positive. -This uses the [Miller Rabin test](https://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test). - - - `bigInt(5).isProbablePrime()` => `true` - - `bigInt(49).isProbablePrime()` => `false` - - `bigInt(1729).isProbablePrime()` => `false` - -Note that this function is not deterministic, since it relies on random sampling of factors, so the result for some numbers is not always the same - unless you pass a predictable random number generator as `rng`. The behavior and requirements are the same as with `randBetween`. - - - `bigInt(1729).isProbablePrime(1, () => 0.1)` => `false` - - `bigInt(1729).isProbablePrime(1, () => 0.2)` => `true` - -If the number is composite then the Miller–Rabin primality test declares the number probably prime with a probability at most `4` to the power `−iterations`. -If the number is prime, this function always returns `true`. - -#### `isUnit()` - -Returns `true` if the number is `1` or `-1`, `false` otherwise. - - - `bigInt.one.isUnit()` => `true` - - `bigInt.minusOne.isUnit()` => `true` - - `bigInt(5).isUnit()` => `false` - -#### `isZero()` - -Return `true` if the number is `0` or `-0`, `false` otherwise. - - - `bigInt.zero.isZero()` => `true` - - `bigInt("-0").isZero()` => `true` - - `bigInt(50).isZero()` => `false` - -#### `leq(number)` - -Alias for the `lesserOrEquals` method. - -#### `lesser(number)` - -Checks if the first number is lesser than the second. - - - `bigInt(5).lesser(6)` => `true` - - `bigInt(5).lesser(5)` => `false` - - `bigInt(5).lesser(4)` => `false` - -#### `lesserOrEquals(number)` - -Checks if the first number is less than or equal to the second. - - - `bigInt(5).lesserOrEquals(6)` => `true` - - `bigInt(5).lesserOrEquals(5)` => `true` - - `bigInt(5).lesserOrEquals(4)` => `false` - -#### `lt(number)` - -Alias for the `lesser` method. - -#### `minus(number)` - -Alias for the `subtract` method. - - - `bigInt(3).minus(5)` => `-2` - -[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Subtraction) - -#### `mod(number)` - -Performs division and returns the remainder, disregarding the quotient. The sign of the remainder will match the sign of the dividend. - - - `bigInt(59).mod(5)` => `4` - - `bigInt(-5).mod(2)` => `-1` - -[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Division) - -#### `modInv(mod)` - -Finds the [multiplicative inverse](https://en.wikipedia.org/wiki/Modular_multiplicative_inverse) of the number modulo `mod`. - - - `bigInt(3).modInv(11)` => `4` - - `bigInt(42).modInv(2017)` => `1969` - -#### `modPow(exp, mod)` - -Takes the number to the power `exp` modulo `mod`. - - - `bigInt(10).modPow(3, 30)` => `10` - -#### `multiply(number)` - -Performs multiplication. - - - `bigInt(111).multiply(111)` => `12321` - -[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Multiplication) - -#### `neq(number)` - -Alias for the `notEquals` method. - -#### `next()` - -Adds one to the number. - - - `bigInt(6).next()` => `7` - -#### `not()` - -Performs the bitwise NOT operation. The operands are treated as if they were represented using [two's complement representation](http://en.wikipedia.org/wiki/Two%27s_complement). - - - `bigInt(10).not()` => `-11` - - `bigInt(0).not()` => `-1` - -#### `notEquals(number)` - -Checks if two numbers are not equal. - - - `bigInt(5).notEquals(5)` => `false` - - `bigInt(4).notEquals(7)` => `true` - -#### `or(number)` - -Performs the bitwise OR operation. The operands are treated as if they were represented using [two's complement representation](http://en.wikipedia.org/wiki/Two%27s_complement). - - - `bigInt(13).or(10)` => `15` - - `bigInt(13).or(-8)` => `-3` - -#### `over(number)` - -Alias for the `divide` method. - - - `bigInt(59).over(5)` => `11` - -[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Division) - -#### `plus(number)` - -Alias for the `add` method. - - - `bigInt(5).plus(7)` => `12` - -[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Addition) - -#### `pow(number)` - -Performs exponentiation. If the exponent is less than `0`, `pow` returns `0`. `bigInt.zero.pow(0)` returns `1`. - - - `bigInt(16).pow(16)` => `18446744073709551616` - -[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Exponentiation) - -#### `prev(number)` - -Subtracts one from the number. - - - `bigInt(6).prev()` => `5` - -#### `remainder(number)` - -Alias for the `mod` method. - -[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Division) - -#### `shiftLeft(n)` - -Shifts the number left by `n` places in its binary representation. If a negative number is provided, it will shift right. Throws an error if `n` is outside of the range `[-9007199254740992, 9007199254740992]`. - - - `bigInt(8).shiftLeft(2)` => `32` - - `bigInt(8).shiftLeft(-2)` => `2` - -#### `shiftRight(n)` - -Shifts the number right by `n` places in its binary representation. If a negative number is provided, it will shift left. Throws an error if `n` is outside of the range `[-9007199254740992, 9007199254740992]`. - - - `bigInt(8).shiftRight(2)` => `2` - - `bigInt(8).shiftRight(-2)` => `32` - -#### `square()` - -Squares the number - - - `bigInt(3).square()` => `9` - -[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Squaring) - -#### `subtract(number)` - -Performs subtraction. - - - `bigInt(3).subtract(5)` => `-2` - -[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Subtraction) - -#### `times(number)` - -Alias for the `multiply` method. - - - `bigInt(111).times(111)` => `12321` - -[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Multiplication) - -#### `toArray(radix)` - -Converts a bigInt into an object with the properties "value" and "isNegative." "Value" is an array of integers modulo the given radix. "isNegative" is a boolean that represents the sign of the result. - - - `bigInt("1e9").toArray(10)` => { - value: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0], - isNegative: false - } - - `bigInt("1e9").toArray(16)` => { - value: [3, 11, 9, 10, 12, 10, 0, 0], - isNegative: false - } - - `bigInt(567890).toArray(100)` => { - value: [56, 78, 90], - isNegative: false - } - -Negative bases are supported. - - - `bigInt(12345).toArray(-10)` => { - value: [2, 8, 4, 6, 5], - isNegative: false - } - -Base 1 and base -1 are also supported. - - - `bigInt(-15).toArray(1)` => { - value: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], - isNegative: true - } - - `bigInt(-15).toArray(-1)` => { - value: [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, - 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0], - isNegative: false - } - -Base 0 is only allowed for the number zero. - - - `bigInt(0).toArray(0)` => { - value: [0], - isNegative: false - } - - `bigInt(1).toArray(0)` => `Error: Cannot convert nonzero numbers to base 0.` - -#### `toJSNumber()` - -Converts a bigInt into a native Javascript number. Loses precision for numbers outside the range `[-9007199254740992, 9007199254740992]`. - - - `bigInt("18446744073709551616").toJSNumber()` => `18446744073709552000` - -#### `xor(number)` - -Performs the bitwise XOR operation. The operands are treated as if they were represented using [two's complement representation](http://en.wikipedia.org/wiki/Two%27s_complement). - - - `bigInt(12).xor(5)` => `9` - - `bigInt(12).xor(-5)` => `-9` - -### Static Methods - -#### `fromArray(digits, base = 10, isNegative?)` - -Constructs a bigInt from an array of digits in base `base`. The optional `isNegative` flag will make the number negative. - - - `bigInt.fromArray([1, 2, 3, 4, 5], 10)` => `12345` - - `bigInt.fromArray([1, 0, 0], 2, true)` => `-4` - -#### `gcd(a, b)` - -Finds the greatest common denominator of `a` and `b`. - - - `bigInt.gcd(42,56)` => `14` - -#### `isInstance(x)` - -Returns `true` if `x` is a BigInteger, `false` otherwise. - - - `bigInt.isInstance(bigInt(14))` => `true` - - `bigInt.isInstance(14)` => `false` - -#### `lcm(a,b)` - -Finds the least common multiple of `a` and `b`. - - - `bigInt.lcm(21, 6)` => `42` - -#### `max(a,b)` - -Returns the largest of `a` and `b`. - - - `bigInt.max(77, 432)` => `432` - -#### `min(a,b)` - -Returns the smallest of `a` and `b`. - - - `bigInt.min(77, 432)` => `77` - -#### `randBetween(min, max, [rng])` - -Returns a random number between `min` and `max`, optionally using `rng` to generate randomness. - - - `bigInt.randBetween("-1e100", "1e100")` => (for example) `8494907165436643479673097939554427056789510374838494147955756275846226209006506706784609314471378745` - -`rng` should take no arguments and return a `number` between 0 and 1. It defaults to `Math.random`. - - - `bigInt.randBetween("-1e100", "1e100", () => 0.5)` => (always) `50000005000000500000050000005000000500000050000005000000500000050000005000000500000050000005000000` - - -### Override Methods - -#### `toString(radix = 10, [alphabet])` - -Converts a bigInt to a string. There is an optional radix parameter (which defaults to 10) that converts the number to the given radix. Digits in the range `10-35` will use the letters `a-z`. - - - `bigInt("1e9").toString()` => `"1000000000"` - - `bigInt("1e9").toString(16)` => `"3b9aca00"` - - You can use a custom base alphabet with the second parameter. The default `alphabet` is `"0123456789abcdefghijklmnopqrstuvwxyz"`. - - - `bigInt("5").toString(2, "aA")` => `"AaA"` - -**Note that arithmetical operators will trigger the `valueOf` function rather than the `toString` function.** When converting a bigInteger to a string, you should use the `toString` method or the `String` function instead of adding the empty string. - - - `bigInt("999999999999999999").toString()` => `"999999999999999999"` - - `String(bigInt("999999999999999999"))` => `"999999999999999999"` - - `bigInt("999999999999999999") + ""` => `1000000000000000000` - -Bases larger than 36 are supported. If a digit is greater than or equal to 36, it will be enclosed in angle brackets. - - - `bigInt(567890).toString(100)` => `"<56><78><90>"` - -Negative bases are also supported. - - - `bigInt(12345).toString(-10)` => `"28465"` - -Base 1 and base -1 are also supported. - - - `bigInt(-15).toString(1)` => `"-111111111111111"` - - `bigInt(-15).toString(-1)` => `"101010101010101010101010101010"` - -Base 0 is only allowed for the number zero. - - - `bigInt(0).toString(0)` => `0` - - `bigInt(1).toString(0)` => `Error: Cannot convert nonzero numbers to base 0.` - -[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#toString) - -#### `valueOf()` - -Converts a bigInt to a native Javascript number. This override allows you to use native arithmetic operators without explicit conversion: - - - `bigInt("100") + bigInt("200") === 300; //true` - -## Contributors - -To contribute, just fork the project, make some changes, and submit a pull request. Please verify that the unit tests pass before submitting. - -The unit tests are contained in the `spec/spec.js` file. You can run them locally by opening the `spec/SpecRunner.html` or file or running `npm test`. You can also [run the tests online from GitHub](http://peterolson.github.io/BigInteger.js/spec/SpecRunner.html). - -There are performance benchmarks that can be viewed from the `benchmarks/index.html` page. You can [run them online from GitHub](http://peterolson.github.io/BigInteger.js/benchmark/). - -## License - -This project is public domain. For more details, read about the [Unlicense](http://unlicense.org/). diff --git a/chabok-starter-cordova/node_modules/big-integer/bower.json b/chabok-starter-cordova/node_modules/big-integer/bower.json deleted file mode 100644 index 22dc58f..0000000 --- a/chabok-starter-cordova/node_modules/big-integer/bower.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "big-integer", - "description": "An arbitrary length integer library for Javascript", - "main": "./BigInteger.js", - "authors": [ - "Peter Olson" - ], - "license": "Unlicense", - "keywords": [ - "math", - "big", - "bignum", - "bigint", - "biginteger", - "integer", - "arbitrary", - "precision", - "arithmetic" - ], - "homepage": "https://github.com/peterolson/BigInteger.js", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "coverage", - "tests" - ] -} diff --git a/chabok-starter-cordova/node_modules/big-integer/package.json b/chabok-starter-cordova/node_modules/big-integer/package.json deleted file mode 100644 index 4bcd089..0000000 --- a/chabok-starter-cordova/node_modules/big-integer/package.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "_from": "big-integer@^1.6.7", - "_id": "big-integer@1.6.48", - "_inBundle": false, - "_integrity": "sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w==", - "_location": "/big-integer", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "big-integer@^1.6.7", - "name": "big-integer", - "escapedName": "big-integer", - "rawSpec": "^1.6.7", - "saveSpec": null, - "fetchSpec": "^1.6.7" - }, - "_requiredBy": [ - "/bplist-parser" - ], - "_resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.48.tgz", - "_shasum": "8fd88bd1632cba4a1c8c3e3d7159f08bb95b4b9e", - "_spec": "big-integer@^1.6.7", - "_where": "/Users/farbod/Documents/Github/chabok/chabok-starter-cordova/chabok-starter-cordova/node_modules/bplist-parser", - "author": { - "name": "Peter Olson", - "email": "peter.e.c.olson+npm@gmail.com" - }, - "bin": {}, - "bugs": { - "url": "https://github.com/peterolson/BigInteger.js/issues" - }, - "bundleDependencies": false, - "contributors": [], - "deprecated": false, - "description": "An arbitrary length integer library for Javascript", - "devDependencies": { - "@types/lodash": "^4.14.118", - "@types/node": "^7.10.2", - "coveralls": "^3.0.6", - "jasmine": "3.5.0", - "jasmine-core": "^3.5.0", - "karma": "^4.3.0", - "karma-cli": "^2.0.0", - "karma-coverage": "^2.0.1", - "karma-jasmine": "^2.0.1", - "karma-phantomjs-launcher": "^1.0.4", - "lodash": "^4.17.11", - "typescript": "^3.6.3", - "uglifyjs": "^2.4.10" - }, - "engines": { - "node": ">=0.6" - }, - "homepage": "https://github.com/peterolson/BigInteger.js#readme", - "keywords": [ - "math", - "big", - "bignum", - "bigint", - "biginteger", - "integer", - "arbitrary", - "precision", - "arithmetic" - ], - "license": "Unlicense", - "main": "./BigInteger", - "name": "big-integer", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/peterolson/BigInteger.js.git" - }, - "scripts": { - "minify": "uglifyjs BigInteger.js -o BigInteger.min.js", - "test": "tsc && karma start my.conf.js && node spec/tsDefinitions.js" - }, - "typings": "./BigInteger.d.ts", - "version": "1.6.48" -} diff --git a/chabok-starter-cordova/node_modules/big-integer/tsconfig.json b/chabok-starter-cordova/node_modules/big-integer/tsconfig.json deleted file mode 100644 index dae01d4..0000000 --- a/chabok-starter-cordova/node_modules/big-integer/tsconfig.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "compilerOptions": { - "target": "esnext", - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "./", - "moduleResolution": "node", - "allowJs": true, - "typeRoots": [ - "./" - ], - "types": [ - "node" - ], - "forceConsistentCasingInFileNames": true - }, - "files": [ - "BigInteger.d.ts", - "spec/tsDefinitions.ts" - ] -} diff --git a/chabok-starter-cordova/node_modules/bplist-creator/LICENSE b/chabok-starter-cordova/node_modules/bplist-creator/LICENSE deleted file mode 100644 index f612fed..0000000 --- a/chabok-starter-cordova/node_modules/bplist-creator/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -(The MIT License) - -Copyright (c) 2012 Near Infinity Corporation - -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. diff --git a/chabok-starter-cordova/node_modules/bplist-creator/README.md b/chabok-starter-cordova/node_modules/bplist-creator/README.md deleted file mode 100644 index 786783e..0000000 --- a/chabok-starter-cordova/node_modules/bplist-creator/README.md +++ /dev/null @@ -1,64 +0,0 @@ -bplist-creator -============== - -Binary Mac OS X Plist (property list) creator. - -## Installation - -```bash -$ npm install bplist-creator -``` - -## Quick Examples - -```javascript -var bplist = require('bplist-creator'); - -var buffer = bplist({ - key1: [1, 2, 3] -}); -``` - -## Real/Double/Float handling - -Javascript don't have different types for `1` and `1.0`. This package -will automatically store numbers as the appropriate type, but can't -detect floats that is also integers. - -If you need to force a value to be written with the `real` type pass -an instance of `Real`. - -```javascript -var buffer = bplist({ - backgroundRed: new bplist.Real(1), - backgroundGreen: new bplist.Real(0), - backgroundBlue: new bplist.Real(0) -}); -``` - -In `xml` the corresponding tags is `` and ``. - -## License - -(The MIT License) - -Copyright (c) 2012 Near Infinity Corporation - -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. diff --git a/chabok-starter-cordova/node_modules/bplist-creator/bplistCreator.js b/chabok-starter-cordova/node_modules/bplist-creator/bplistCreator.js deleted file mode 100644 index 5362d33..0000000 --- a/chabok-starter-cordova/node_modules/bplist-creator/bplistCreator.js +++ /dev/null @@ -1,456 +0,0 @@ -'use strict'; - -// adapted from http://code.google.com/p/plist/source/browse/trunk/src/main/java/com/dd/plist/BinaryPropertyListWriter.java - -var streamBuffers = require("stream-buffers"); - -var debug = false; - -function Real(value) { - this.value = value; -} - -module.exports = function(dicts) { - var buffer = new streamBuffers.WritableStreamBuffer(); - buffer.write(new Buffer("bplist00")); - - if (debug) { - console.log('create', require('util').inspect(dicts, false, 10)); - } - - if (dicts instanceof Array && dicts.length === 1) { - dicts = dicts[0]; - } - - var entries = toEntries(dicts); - if (debug) { - console.log('entries', entries); - } - var idSizeInBytes = computeIdSizeInBytes(entries.length); - var offsets = []; - var offsetSizeInBytes; - var offsetTableOffset; - - updateEntryIds(); - - entries.forEach(function(entry, entryIdx) { - offsets[entryIdx] = buffer.size(); - if (!entry) { - buffer.write(0x00); - } else { - write(entry); - } - }); - - writeOffsetTable(); - writeTrailer(); - return buffer.getContents(); - - function updateEntryIds() { - var strings = {}; - var entryId = 0; - entries.forEach(function(entry) { - if (entry.id) { - return; - } - if (entry.type === 'string') { - if (!entry.bplistOverride && strings.hasOwnProperty(entry.value)) { - entry.type = 'stringref'; - entry.id = strings[entry.value]; - } else { - strings[entry.value] = entry.id = entryId++; - } - } else { - entry.id = entryId++; - } - }); - - entries = entries.filter(function(entry) { - return (entry.type !== 'stringref'); - }); - } - - function writeTrailer() { - if (debug) { - console.log('0x' + buffer.size().toString(16), 'writeTrailer'); - } - // 6 null bytes - buffer.write(new Buffer([0, 0, 0, 0, 0, 0])); - - // size of an offset - if (debug) { - console.log('0x' + buffer.size().toString(16), 'writeTrailer(offsetSizeInBytes):', offsetSizeInBytes); - } - writeByte(offsetSizeInBytes); - - // size of a ref - if (debug) { - console.log('0x' + buffer.size().toString(16), 'writeTrailer(offsetSizeInBytes):', idSizeInBytes); - } - writeByte(idSizeInBytes); - - // number of objects - if (debug) { - console.log('0x' + buffer.size().toString(16), 'writeTrailer(number of objects):', entries.length); - } - writeLong(entries.length); - - // top object - if (debug) { - console.log('0x' + buffer.size().toString(16), 'writeTrailer(top object)'); - } - writeLong(0); - - // offset table offset - if (debug) { - console.log('0x' + buffer.size().toString(16), 'writeTrailer(offset table offset):', offsetTableOffset); - } - writeLong(offsetTableOffset); - } - - function writeOffsetTable() { - if (debug) { - console.log('0x' + buffer.size().toString(16), 'writeOffsetTable'); - } - offsetTableOffset = buffer.size(); - offsetSizeInBytes = computeOffsetSizeInBytes(offsetTableOffset); - offsets.forEach(function(offset) { - writeBytes(offset, offsetSizeInBytes); - }); - } - - function write(entry) { - switch (entry.type) { - case 'dict': - writeDict(entry); - break; - case 'number': - case 'double': - writeNumber(entry); - break; - case 'UID': - writeUID(entry); - break; - case 'array': - writeArray(entry); - break; - case 'boolean': - writeBoolean(entry); - break; - case 'string': - case 'string-utf16': - writeString(entry); - break; - case 'date': - writeDate(entry); - break; - case 'data': - writeData(entry); - break; - default: - throw new Error("unhandled entry type: " + entry.type); - } - } - - function writeDate(entry) { - writeByte(0x33); - var date = (Date.parse(entry.value)/1000) - 978307200 - writeDouble(date) - } - - function writeDict(entry) { - if (debug) { - var keysStr = entry.entryKeys.map(function(k) {return k.id;}); - var valsStr = entry.entryValues.map(function(k) {return k.id;}); - console.log('0x' + buffer.size().toString(16), 'writeDict', '(id: ' + entry.id + ')', '(keys: ' + keysStr + ')', '(values: ' + valsStr + ')'); - } - writeIntHeader(0xD, entry.entryKeys.length); - entry.entryKeys.forEach(function(entry) { - writeID(entry.id); - }); - entry.entryValues.forEach(function(entry) { - writeID(entry.id); - }); - } - - function writeNumber(entry) { - if (debug) { - console.log('0x' + buffer.size().toString(16), 'writeNumber', entry.value, ' (type: ' + entry.type + ')', '(id: ' + entry.id + ')'); - } - - if (entry.type !== 'double' && parseFloat(entry.value.toFixed()) == entry.value) { - if (entry.value < 0) { - writeByte(0x13); - writeBytes(entry.value, 8, true); - } else if (entry.value <= 0xff) { - writeByte(0x10); - writeBytes(entry.value, 1); - } else if (entry.value <= 0xffff) { - writeByte(0x11); - writeBytes(entry.value, 2); - } else if (entry.value <= 0xffffffff) { - writeByte(0x12); - writeBytes(entry.value, 4); - } else { - writeByte(0x14); - writeBytes(entry.value, 8); - } - } else { - writeByte(0x23); - writeDouble(entry.value); - } - } - - function writeUID(entry) { - if (debug) { - console.log('0x' + buffer.size().toString(16), 'writeUID', entry.value, ' (type: ' + entry.type + ')', '(id: ' + entry.id + ')'); - } - - writeIntHeader(0x8, 0x0); - writeID(entry.value); - } - - function writeArray(entry) { - if (debug) { - console.log('0x' + buffer.size().toString(16), 'writeArray (length: ' + entry.entries.length + ')', '(id: ' + entry.id + ')'); - } - writeIntHeader(0xA, entry.entries.length); - entry.entries.forEach(function(e) { - writeID(e.id); - }); - } - - function writeBoolean(entry) { - if (debug) { - console.log('0x' + buffer.size().toString(16), 'writeBoolean', entry.value, '(id: ' + entry.id + ')'); - } - writeByte(entry.value ? 0x09 : 0x08); - } - - function writeString(entry) { - if (debug) { - console.log('0x' + buffer.size().toString(16), 'writeString', entry.value, '(id: ' + entry.id + ')'); - } - if (entry.type === 'string-utf16' || mustBeUtf16(entry.value)) { - var utf16 = new Buffer(entry.value, 'ucs2'); - writeIntHeader(0x6, utf16.length / 2); - // needs to be big endian so swap the bytes - for (var i = 0; i < utf16.length; i += 2) { - var t = utf16[i + 0]; - utf16[i + 0] = utf16[i + 1]; - utf16[i + 1] = t; - } - buffer.write(utf16); - } else { - var utf8 = new Buffer(entry.value, 'ascii'); - writeIntHeader(0x5, utf8.length); - buffer.write(utf8); - } - } - - function writeData(entry) { - if (debug) { - console.log('0x' + buffer.size().toString(16), 'writeData', entry.value, '(id: ' + entry.id + ')'); - } - writeIntHeader(0x4, entry.value.length); - buffer.write(entry.value); - } - - function writeLong(l) { - writeBytes(l, 8); - } - - function writeByte(b) { - buffer.write(new Buffer([b])); - } - - function writeDouble(v) { - var buf = new Buffer(8); - buf.writeDoubleBE(v, 0); - buffer.write(buf); - } - - function writeIntHeader(kind, value) { - if (value < 15) { - writeByte((kind << 4) + value); - } else if (value < 256) { - writeByte((kind << 4) + 15); - writeByte(0x10); - writeBytes(value, 1); - } else if (value < 65536) { - writeByte((kind << 4) + 15); - writeByte(0x11); - writeBytes(value, 2); - } else { - writeByte((kind << 4) + 15); - writeByte(0x12); - writeBytes(value, 4); - } - } - - function writeID(id) { - writeBytes(id, idSizeInBytes); - } - - function writeBytes(value, bytes, is_signedint) { - // write low-order bytes big-endian style - var buf = new Buffer(bytes); - var z = 0; - - // javascript doesn't handle large numbers - if(!is_signedint) { - while (bytes > 4) { - buf[z++] = 0; - bytes--; - } - } - - for (var i = bytes - 1; i >= 0; i--) { - buf[z++] = value >> (8 * i); - } - buffer.write(buf); - } - - function mustBeUtf16(string) { - return Buffer.byteLength(string, 'utf8') != string.length; - } -}; - -function toEntries(dicts) { - if (dicts.bplistOverride) { - return [dicts]; - } - - if (dicts instanceof Array) { - return toEntriesArray(dicts); - } else if (dicts instanceof Buffer) { - return [ - { - type: 'data', - value: dicts - } - ]; - } else if (dicts instanceof Real) { - return [ - { - type: 'double', - value: dicts.value - } - ]; - } else if (typeof(dicts) === 'object') { - if (dicts instanceof Date) { - return [ - { - type: 'date', - value: dicts - } - ] - } else if (Object.keys(dicts).length == 1 && typeof(dicts.UID) === 'number') { - return [ - { - type: 'UID', - value: dicts.UID - } - ] - } else { - return toEntriesObject(dicts); - } - } else if (typeof(dicts) === 'string') { - return [ - { - type: 'string', - value: dicts - } - ]; - } else if (typeof(dicts) === 'number') { - return [ - { - type: 'number', - value: dicts - } - ]; - } else if (typeof(dicts) === 'boolean') { - return [ - { - type: 'boolean', - value: dicts - } - ]; - } else if (typeof(dicts) === 'bigint') { - return [ - { - type: 'number', - value: Number(BigInt.asIntN(32, dicts)) - } - ]; - } else { - throw new Error('unhandled entry: ' + dicts); - } -} - -function toEntriesArray(arr) { - if (debug) { - console.log('toEntriesArray'); - } - var results = [ - { - type: 'array', - entries: [] - } - ]; - arr.forEach(function(v) { - var entry = toEntries(v); - results[0].entries.push(entry[0]); - results = results.concat(entry); - }); - return results; -} - -function toEntriesObject(dict) { - if (debug) { - console.log('toEntriesObject'); - } - var results = [ - { - type: 'dict', - entryKeys: [], - entryValues: [] - } - ]; - Object.keys(dict).forEach(function(key) { - var entryKey = toEntries(key); - results[0].entryKeys.push(entryKey[0]); - results = results.concat(entryKey[0]); - }); - Object.keys(dict).forEach(function(key) { - var entryValue = toEntries(dict[key]); - results[0].entryValues.push(entryValue[0]); - results = results.concat(entryValue); - }); - return results; -} - -function computeOffsetSizeInBytes(maxOffset) { - if (maxOffset < 256) { - return 1; - } - if (maxOffset < 65536) { - return 2; - } - if (maxOffset < 4294967296) { - return 4; - } - return 8; -} - -function computeIdSizeInBytes(numberOfIds) { - if (numberOfIds < 256) { - return 1; - } - if (numberOfIds < 65536) { - return 2; - } - return 4; -} - -module.exports.Real = Real; diff --git a/chabok-starter-cordova/node_modules/bplist-creator/package.json b/chabok-starter-cordova/node_modules/bplist-creator/package.json deleted file mode 100644 index 46275a7..0000000 --- a/chabok-starter-cordova/node_modules/bplist-creator/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "_from": "bplist-creator@0.0.8", - "_id": "bplist-creator@0.0.8", - "_inBundle": false, - "_integrity": "sha512-Za9JKzD6fjLC16oX2wsXfc+qBEhJBJB1YPInoAQpMLhDuj5aVOv1baGeIQSq1Fr3OCqzvsoQcSBSwGId/Ja2PA==", - "_location": "/bplist-creator", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "bplist-creator@0.0.8", - "name": "bplist-creator", - "escapedName": "bplist-creator", - "rawSpec": "0.0.8", - "saveSpec": null, - "fetchSpec": "0.0.8" - }, - "_requiredBy": [ - "/simple-plist" - ], - "_resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.0.8.tgz", - "_shasum": "56b2a6e79e9aec3fc33bf831d09347d73794e79c", - "_spec": "bplist-creator@0.0.8", - "_where": "/Users/farbod/Documents/Github/chabok/chabok-starter-cordova/chabok-starter-cordova/node_modules/simple-plist", - "author": { - "name": "Joe Ferner" - }, - "bugs": { - "url": "https://github.com/nearinfinity/node-bplist-creator/issues" - }, - "bundleDependencies": false, - "dependencies": { - "stream-buffers": "~2.2.0" - }, - "deprecated": false, - "description": "Binary Mac OS X Plist (property list) creator.", - "devDependencies": { - "bplist-parser": "~0.1.0", - "is-buffer": "1.1.4", - "nodeunit": "0.9.1" - }, - "homepage": "https://github.com/nearinfinity/node-bplist-creator#readme", - "keywords": [ - "bplist", - "plist", - "creator" - ], - "license": "MIT", - "main": "bplistCreator.js", - "name": "bplist-creator", - "repository": { - "type": "git", - "url": "git+https://github.com/nearinfinity/node-bplist-creator.git" - }, - "scripts": { - "test": "./node_modules/nodeunit/bin/nodeunit test" - }, - "version": "0.0.8" -} diff --git a/chabok-starter-cordova/node_modules/bplist-creator/test/airplay.bplist b/chabok-starter-cordova/node_modules/bplist-creator/test/airplay.bplist deleted file mode 100644 index 931adea..0000000 Binary files a/chabok-starter-cordova/node_modules/bplist-creator/test/airplay.bplist and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/bplist-creator/test/binaryData.bplist b/chabok-starter-cordova/node_modules/bplist-creator/test/binaryData.bplist deleted file mode 100644 index 4c03581..0000000 Binary files a/chabok-starter-cordova/node_modules/bplist-creator/test/binaryData.bplist and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/bplist-creator/test/creatorTest.js b/chabok-starter-cordova/node_modules/bplist-creator/test/creatorTest.js deleted file mode 100644 index af427a1..0000000 --- a/chabok-starter-cordova/node_modules/bplist-creator/test/creatorTest.js +++ /dev/null @@ -1,197 +0,0 @@ -'use strict'; - -var fs = require('fs'); -var path = require('path'); -var nodeunit = require('nodeunit'); -var bplistParser = require('bplist-parser'); -var bplistCreator = require('../'); - -module.exports = { -// 'iTunes Small': function(test) { -// var file = path.join(__dirname, "iTunes-small.bplist"); -// testFile(test, file); -// }, - - 'sample1': function(test) { - var file = path.join(__dirname, "sample1.bplist"); - testFile(test, file); - }, - - 'sample2': function(test) { - var file = path.join(__dirname, "sample2.bplist"); - testFile(test, file); - }, - - 'binary data': function(test) { - var file = path.join(__dirname, "binaryData.bplist"); - testFile(test, file); - }, - - 'airplay': function(test) { - var file = path.join(__dirname, "airplay.bplist"); - testFile(test, file); - }, - -// 'utf16': function(test) { -// var file = path.join(__dirname, "utf16.bplist"); -// testFile(test, file); -// }, - -// 'uid': function(test) { -// var file = path.join(__dirname, "uid.bplist"); -// testFile(test, file); -// } -}; - -function testFile(test, file) { - fs.readFile(file, function(err, fileData) { - if (err) { - return test.done(err); - } - - bplistParser.parseFile(file, function(err, dicts) { - if (err) { - return test.done(err); - } - - // airplay overrides - if (dicts && dicts[0] && dicts[0].loadedTimeRanges && dicts[0].loadedTimeRanges[0] && dicts[0].loadedTimeRanges[0].hasOwnProperty('start')) { - dicts[0].loadedTimeRanges[0].start = { - bplistOverride: true, - type: 'double', - value: dicts[0].loadedTimeRanges[0].start - }; - } - if (dicts && dicts[0] && dicts[0].loadedTimeRanges && dicts[0].seekableTimeRanges[0] && dicts[0].seekableTimeRanges[0].hasOwnProperty('start')) { - dicts[0].seekableTimeRanges[0].start = { - bplistOverride: true, - type: 'double', - value: dicts[0].seekableTimeRanges[0].start - }; - } - if (dicts && dicts[0] && dicts[0].hasOwnProperty('rate')) { - dicts[0].rate = { - bplistOverride: true, - type: 'double', - value: dicts[0].rate - }; - } - - // utf16 - if (dicts && dicts[0] && dicts[0].hasOwnProperty('NSHumanReadableCopyright')) { - dicts[0].NSHumanReadableCopyright = { - bplistOverride: true, - type: 'string-utf16', - value: dicts[0].NSHumanReadableCopyright - }; - } - if (dicts && dicts[0] && dicts[0].hasOwnProperty('CFBundleExecutable')) { - dicts[0].CFBundleExecutable = { - bplistOverride: true, - type: 'string', - value: dicts[0].CFBundleExecutable - }; - } - if (dicts && dicts[0] && dicts[0].CFBundleURLTypes && dicts[0].CFBundleURLTypes[0] && dicts[0].CFBundleURLTypes[0].hasOwnProperty('CFBundleURLSchemes')) { - dicts[0].CFBundleURLTypes[0].CFBundleURLSchemes[0] = { - bplistOverride: true, - type: 'string', - value: dicts[0].CFBundleURLTypes[0].CFBundleURLSchemes[0] - }; - } - if (dicts && dicts[0] && dicts[0].hasOwnProperty('CFBundleDisplayName')) { - dicts[0].CFBundleDisplayName = { - bplistOverride: true, - type: 'string', - value: dicts[0].CFBundleDisplayName - }; - } - if (dicts && dicts[0] && dicts[0].hasOwnProperty('DTPlatformBuild')) { - dicts[0].DTPlatformBuild = { - bplistOverride: true, - type: 'string', - value: dicts[0].DTPlatformBuild - }; - } - - var buf = bplistCreator(dicts); - compareBuffers(test, buf, fileData); - return test.done(); - }); - }); -} - -function compareBuffers(test, buf1, buf2) { - if (buf1.length !== buf2.length) { - printBuffers(buf1, buf2); - return test.fail("buffer size mismatch. found: " + buf1.length + ", expected: " + buf2.length + "."); - } - for (var i = 0; i < buf1.length; i++) { - if (buf1[i] !== buf2[i]) { - printBuffers(buf1, buf2); - return test.fail("buffer mismatch at offset 0x" + i.toString(16) + ". found: 0x" + buf1[i].toString(16) + ", expected: 0x" + buf2[i].toString(16) + "."); - } - } -} - -function printBuffers(buf1, buf2) { - var i, t; - for (var lineOffset = 0; lineOffset < buf1.length || lineOffset < buf2.length; lineOffset += 16) { - var line = ''; - - t = ('000000000' + lineOffset.toString(16)); - line += t.substr(t.length - 8) + ': '; - - for (i = 0; i < 16; i++) { - if (i == 8) { - line += ' '; - } - if (lineOffset + i < buf1.length) { - t = ('00' + buf1[lineOffset + i].toString(16)); - line += t.substr(t.length - 2) + ' '; - } else { - line += ' '; - } - } - line += ' '; - for (i = 0; i < 16; i++) { - if (lineOffset + i < buf1.length) { - t = String.fromCharCode(buf1[lineOffset + i]); - if (t < ' ' || t > '~') { - t = '.'; - } - line += t; - } else { - line += ' '; - } - } - - line += ' - '; - - for (i = 0; i < 16; i++) { - if (i == 8) { - line += ' '; - } - if (lineOffset + i < buf2.length) { - t = ('00' + buf2[lineOffset + i].toString(16)); - line += t.substr(t.length - 2) + ' '; - } else { - line += ' '; - } - } - line += ' '; - for (i = 0; i < 16; i++) { - if (lineOffset + i < buf2.length) { - t = String.fromCharCode(buf2[lineOffset + i]); - if (t < ' ' || t > '~') { - t = '.'; - } - line += t; - } else { - line += ' '; - } - } - - console.log(line); - } -} diff --git a/chabok-starter-cordova/node_modules/bplist-creator/test/iTunes-small.bplist b/chabok-starter-cordova/node_modules/bplist-creator/test/iTunes-small.bplist deleted file mode 100644 index b7edb14..0000000 Binary files a/chabok-starter-cordova/node_modules/bplist-creator/test/iTunes-small.bplist and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/bplist-creator/test/sample1.bplist b/chabok-starter-cordova/node_modules/bplist-creator/test/sample1.bplist deleted file mode 100644 index d5fa833..0000000 Binary files a/chabok-starter-cordova/node_modules/bplist-creator/test/sample1.bplist and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/bplist-creator/test/sample2.bplist b/chabok-starter-cordova/node_modules/bplist-creator/test/sample2.bplist deleted file mode 100644 index fc42979..0000000 Binary files a/chabok-starter-cordova/node_modules/bplist-creator/test/sample2.bplist and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/bplist-creator/test/uid.bplist b/chabok-starter-cordova/node_modules/bplist-creator/test/uid.bplist deleted file mode 100644 index 59f341e..0000000 Binary files a/chabok-starter-cordova/node_modules/bplist-creator/test/uid.bplist and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/bplist-creator/test/utf16.bplist b/chabok-starter-cordova/node_modules/bplist-creator/test/utf16.bplist deleted file mode 100644 index ba4bcfa..0000000 Binary files a/chabok-starter-cordova/node_modules/bplist-creator/test/utf16.bplist and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/bplist-parser/.npmignore b/chabok-starter-cordova/node_modules/bplist-parser/.npmignore deleted file mode 100644 index a9b46ea..0000000 --- a/chabok-starter-cordova/node_modules/bplist-parser/.npmignore +++ /dev/null @@ -1,8 +0,0 @@ -/build/* -node_modules -*.node -*.sh -*.swp -.lock* -npm-debug.log -.idea diff --git a/chabok-starter-cordova/node_modules/bplist-parser/README.md b/chabok-starter-cordova/node_modules/bplist-parser/README.md deleted file mode 100644 index 37e5e1c..0000000 --- a/chabok-starter-cordova/node_modules/bplist-parser/README.md +++ /dev/null @@ -1,47 +0,0 @@ -bplist-parser -============= - -Binary Mac OS X Plist (property list) parser. - -## Installation - -```bash -$ npm install bplist-parser -``` - -## Quick Examples - -```javascript -var bplist = require('bplist-parser'); - -bplist.parseFile('myPlist.bplist', function(err, obj) { - if (err) throw err; - - console.log(JSON.stringify(obj)); -}); -``` - -## License - -(The MIT License) - -Copyright (c) 2012 Near Infinity Corporation - -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. diff --git a/chabok-starter-cordova/node_modules/bplist-parser/bplistParser.js b/chabok-starter-cordova/node_modules/bplist-parser/bplistParser.js deleted file mode 100644 index f8335bc..0000000 --- a/chabok-starter-cordova/node_modules/bplist-parser/bplistParser.js +++ /dev/null @@ -1,357 +0,0 @@ -'use strict'; - -// adapted from http://code.google.com/p/plist/source/browse/trunk/src/com/dd/plist/BinaryPropertyListParser.java - -var fs = require('fs'); -var bigInt = require("big-integer"); -var debug = false; - -exports.maxObjectSize = 100 * 1000 * 1000; // 100Meg -exports.maxObjectCount = 32768; - -// EPOCH = new SimpleDateFormat("yyyy MM dd zzz").parse("2001 01 01 GMT").getTime(); -// ...but that's annoying in a static initializer because it can throw exceptions, ick. -// So we just hardcode the correct value. -var EPOCH = 978307200000; - -// UID object definition -var UID = exports.UID = function(id) { - this.UID = id; -} - -var parseFile = exports.parseFile = function (fileNameOrBuffer, callback) { - function tryParseBuffer(buffer) { - var err = null; - var result; - try { - result = parseBuffer(buffer); - } catch (ex) { - err = ex; - } - callback(err, result); - } - - if (Buffer.isBuffer(fileNameOrBuffer)) { - return tryParseBuffer(fileNameOrBuffer); - } else { - fs.readFile(fileNameOrBuffer, function (err, data) { - if (err) { return callback(err); } - tryParseBuffer(data); - }); - } -}; - -var parseBuffer = exports.parseBuffer = function (buffer) { - var result = {}; - - // check header - var header = buffer.slice(0, 'bplist'.length).toString('utf8'); - if (header !== 'bplist') { - throw new Error("Invalid binary plist. Expected 'bplist' at offset 0."); - } - - // Handle trailer, last 32 bytes of the file - var trailer = buffer.slice(buffer.length - 32, buffer.length); - // 6 null bytes (index 0 to 5) - var offsetSize = trailer.readUInt8(6); - if (debug) { - console.log("offsetSize: " + offsetSize); - } - var objectRefSize = trailer.readUInt8(7); - if (debug) { - console.log("objectRefSize: " + objectRefSize); - } - var numObjects = readUInt64BE(trailer, 8); - if (debug) { - console.log("numObjects: " + numObjects); - } - var topObject = readUInt64BE(trailer, 16); - if (debug) { - console.log("topObject: " + topObject); - } - var offsetTableOffset = readUInt64BE(trailer, 24); - if (debug) { - console.log("offsetTableOffset: " + offsetTableOffset); - } - - if (numObjects > exports.maxObjectCount) { - throw new Error("maxObjectCount exceeded"); - } - - // Handle offset table - var offsetTable = []; - - for (var i = 0; i < numObjects; i++) { - var offsetBytes = buffer.slice(offsetTableOffset + i * offsetSize, offsetTableOffset + (i + 1) * offsetSize); - offsetTable[i] = readUInt(offsetBytes, 0); - if (debug) { - console.log("Offset for Object #" + i + " is " + offsetTable[i] + " [" + offsetTable[i].toString(16) + "]"); - } - } - - // Parses an object inside the currently parsed binary property list. - // For the format specification check - // - // Apple's binary property list parser implementation. - function parseObject(tableOffset) { - var offset = offsetTable[tableOffset]; - var type = buffer[offset]; - var objType = (type & 0xF0) >> 4; //First 4 bits - var objInfo = (type & 0x0F); //Second 4 bits - switch (objType) { - case 0x0: - return parseSimple(); - case 0x1: - return parseInteger(); - case 0x8: - return parseUID(); - case 0x2: - return parseReal(); - case 0x3: - return parseDate(); - case 0x4: - return parseData(); - case 0x5: // ASCII - return parsePlistString(); - case 0x6: // UTF-16 - return parsePlistString(true); - case 0xA: - return parseArray(); - case 0xD: - return parseDictionary(); - default: - throw new Error("Unhandled type 0x" + objType.toString(16)); - } - - function parseSimple() { - //Simple - switch (objInfo) { - case 0x0: // null - return null; - case 0x8: // false - return false; - case 0x9: // true - return true; - case 0xF: // filler byte - return null; - default: - throw new Error("Unhandled simple type 0x" + objType.toString(16)); - } - } - - function bufferToHexString(buffer) { - var str = ''; - var i; - for (i = 0; i < buffer.length; i++) { - if (buffer[i] != 0x00) { - break; - } - } - for (; i < buffer.length; i++) { - var part = '00' + buffer[i].toString(16); - str += part.substr(part.length - 2); - } - return str; - } - - function parseInteger() { - var length = Math.pow(2, objInfo); - if (length > 4) { - var data = buffer.slice(offset + 1, offset + 1 + length); - var str = bufferToHexString(data); - return bigInt(str, 16); - } if (length < exports.maxObjectSize) { - return readUInt(buffer.slice(offset + 1, offset + 1 + length)); - } else { - throw new Error("To little heap space available! Wanted to read " + length + " bytes, but only " + exports.maxObjectSize + " are available."); - } - } - - function parseUID() { - var length = objInfo + 1; - if (length < exports.maxObjectSize) { - return new UID(readUInt(buffer.slice(offset + 1, offset + 1 + length))); - } else { - throw new Error("To little heap space available! Wanted to read " + length + " bytes, but only " + exports.maxObjectSize + " are available."); - } - } - - function parseReal() { - var length = Math.pow(2, objInfo); - if (length < exports.maxObjectSize) { - var realBuffer = buffer.slice(offset + 1, offset + 1 + length); - if (length === 4) { - return realBuffer.readFloatBE(0); - } - else if (length === 8) { - return realBuffer.readDoubleBE(0); - } - } else { - throw new Error("To little heap space available! Wanted to read " + length + " bytes, but only " + exports.maxObjectSize + " are available."); - } - } - - function parseDate() { - if (objInfo != 0x3) { - console.error("Unknown date type :" + objInfo + ". Parsing anyway..."); - } - var dateBuffer = buffer.slice(offset + 1, offset + 9); - return new Date(EPOCH + (1000 * dateBuffer.readDoubleBE(0))); - } - - function parseData() { - var dataoffset = 1; - var length = objInfo; - if (objInfo == 0xF) { - var int_type = buffer[offset + 1]; - var intType = (int_type & 0xF0) / 0x10; - if (intType != 0x1) { - console.error("0x4: UNEXPECTED LENGTH-INT TYPE! " + intType); - } - var intInfo = int_type & 0x0F; - var intLength = Math.pow(2, intInfo); - dataoffset = 2 + intLength; - if (intLength < 3) { - length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength)); - } else { - length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength)); - } - } - if (length < exports.maxObjectSize) { - return buffer.slice(offset + dataoffset, offset + dataoffset + length); - } else { - throw new Error("To little heap space available! Wanted to read " + length + " bytes, but only " + exports.maxObjectSize + " are available."); - } - } - - function parsePlistString (isUtf16) { - isUtf16 = isUtf16 || 0; - var enc = "utf8"; - var length = objInfo; - var stroffset = 1; - if (objInfo == 0xF) { - var int_type = buffer[offset + 1]; - var intType = (int_type & 0xF0) / 0x10; - if (intType != 0x1) { - console.err("UNEXPECTED LENGTH-INT TYPE! " + intType); - } - var intInfo = int_type & 0x0F; - var intLength = Math.pow(2, intInfo); - var stroffset = 2 + intLength; - if (intLength < 3) { - length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength)); - } else { - length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength)); - } - } - // length is String length -> to get byte length multiply by 2, as 1 character takes 2 bytes in UTF-16 - length *= (isUtf16 + 1); - if (length < exports.maxObjectSize) { - var plistString = new Buffer(buffer.slice(offset + stroffset, offset + stroffset + length)); - if (isUtf16) { - plistString = swapBytes(plistString); - enc = "ucs2"; - } - return plistString.toString(enc); - } else { - throw new Error("To little heap space available! Wanted to read " + length + " bytes, but only " + exports.maxObjectSize + " are available."); - } - } - - function parseArray() { - var length = objInfo; - var arrayoffset = 1; - if (objInfo == 0xF) { - var int_type = buffer[offset + 1]; - var intType = (int_type & 0xF0) / 0x10; - if (intType != 0x1) { - console.error("0xa: UNEXPECTED LENGTH-INT TYPE! " + intType); - } - var intInfo = int_type & 0x0F; - var intLength = Math.pow(2, intInfo); - arrayoffset = 2 + intLength; - if (intLength < 3) { - length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength)); - } else { - length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength)); - } - } - if (length * objectRefSize > exports.maxObjectSize) { - throw new Error("To little heap space available!"); - } - var array = []; - for (var i = 0; i < length; i++) { - var objRef = readUInt(buffer.slice(offset + arrayoffset + i * objectRefSize, offset + arrayoffset + (i + 1) * objectRefSize)); - array[i] = parseObject(objRef); - } - return array; - } - - function parseDictionary() { - var length = objInfo; - var dictoffset = 1; - if (objInfo == 0xF) { - var int_type = buffer[offset + 1]; - var intType = (int_type & 0xF0) / 0x10; - if (intType != 0x1) { - console.error("0xD: UNEXPECTED LENGTH-INT TYPE! " + intType); - } - var intInfo = int_type & 0x0F; - var intLength = Math.pow(2, intInfo); - dictoffset = 2 + intLength; - if (intLength < 3) { - length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength)); - } else { - length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength)); - } - } - if (length * 2 * objectRefSize > exports.maxObjectSize) { - throw new Error("To little heap space available!"); - } - if (debug) { - console.log("Parsing dictionary #" + tableOffset); - } - var dict = {}; - for (var i = 0; i < length; i++) { - var keyRef = readUInt(buffer.slice(offset + dictoffset + i * objectRefSize, offset + dictoffset + (i + 1) * objectRefSize)); - var valRef = readUInt(buffer.slice(offset + dictoffset + (length * objectRefSize) + i * objectRefSize, offset + dictoffset + (length * objectRefSize) + (i + 1) * objectRefSize)); - var key = parseObject(keyRef); - var val = parseObject(valRef); - if (debug) { - console.log(" DICT #" + tableOffset + ": Mapped " + key + " to " + val); - } - dict[key] = val; - } - return dict; - } - } - - return [ parseObject(topObject) ]; -}; - -function readUInt(buffer, start) { - start = start || 0; - - var l = 0; - for (var i = start; i < buffer.length; i++) { - l <<= 8; - l |= buffer[i] & 0xFF; - } - return l; -} - -// we're just going to toss the high order bits because javascript doesn't have 64-bit ints -function readUInt64BE(buffer, start) { - var data = buffer.slice(start, start + 8); - return data.readUInt32BE(4, 8); -} - -function swapBytes(buffer) { - var len = buffer.length; - for (var i = 0; i < len; i += 2) { - var a = buffer[i]; - buffer[i] = buffer[i+1]; - buffer[i+1] = a; - } - return buffer; -} diff --git a/chabok-starter-cordova/node_modules/bplist-parser/package.json b/chabok-starter-cordova/node_modules/bplist-parser/package.json deleted file mode 100644 index eee5e99..0000000 --- a/chabok-starter-cordova/node_modules/bplist-parser/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "_from": "bplist-parser@^0.1.0", - "_id": "bplist-parser@0.1.1", - "_inBundle": false, - "_integrity": "sha1-1g1dzCDLptx+HymbNdPh+V2vuuY=", - "_location": "/bplist-parser", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "bplist-parser@^0.1.0", - "name": "bplist-parser", - "escapedName": "bplist-parser", - "rawSpec": "^0.1.0", - "saveSpec": null, - "fetchSpec": "^0.1.0" - }, - "_requiredBy": [ - "/cordova-common" - ], - "_resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.1.1.tgz", - "_shasum": "d60d5dcc20cba6dc7e1f299b35d3e1f95dafbae6", - "_spec": "bplist-parser@^0.1.0", - "_where": "/Users/farbod/Documents/Github/chabok/chabok-starter-cordova/chabok-starter-cordova/node_modules/cordova-common", - "author": { - "name": "Joe Ferner", - "email": "joe.ferner@nearinfinity.com" - }, - "bugs": { - "url": "https://github.com/nearinfinity/node-bplist-parser/issues" - }, - "bundleDependencies": false, - "dependencies": { - "big-integer": "^1.6.7" - }, - "deprecated": false, - "description": "Binary plist parser.", - "devDependencies": { - "nodeunit": "~0.9.1" - }, - "homepage": "https://github.com/nearinfinity/node-bplist-parser#readme", - "keywords": [ - "bplist", - "plist", - "parser" - ], - "license": "MIT", - "main": "bplistParser.js", - "name": "bplist-parser", - "repository": { - "type": "git", - "url": "git+https://github.com/nearinfinity/node-bplist-parser.git" - }, - "scripts": { - "test": "./node_modules/nodeunit/bin/nodeunit test" - }, - "version": "0.1.1" -} diff --git a/chabok-starter-cordova/node_modules/bplist-parser/test/airplay.bplist b/chabok-starter-cordova/node_modules/bplist-parser/test/airplay.bplist deleted file mode 100644 index 931adea..0000000 Binary files a/chabok-starter-cordova/node_modules/bplist-parser/test/airplay.bplist and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/bplist-parser/test/iTunes-small.bplist b/chabok-starter-cordova/node_modules/bplist-parser/test/iTunes-small.bplist deleted file mode 100644 index b7edb14..0000000 Binary files a/chabok-starter-cordova/node_modules/bplist-parser/test/iTunes-small.bplist and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/bplist-parser/test/int64.bplist b/chabok-starter-cordova/node_modules/bplist-parser/test/int64.bplist deleted file mode 100644 index 6da9c04..0000000 Binary files a/chabok-starter-cordova/node_modules/bplist-parser/test/int64.bplist and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/bplist-parser/test/int64.xml b/chabok-starter-cordova/node_modules/bplist-parser/test/int64.xml deleted file mode 100644 index cc6cb03..0000000 --- a/chabok-starter-cordova/node_modules/bplist-parser/test/int64.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - zero - 0 - int64item - 12345678901234567890 - - diff --git a/chabok-starter-cordova/node_modules/bplist-parser/test/parseTest.js b/chabok-starter-cordova/node_modules/bplist-parser/test/parseTest.js deleted file mode 100644 index 67e7bfa..0000000 --- a/chabok-starter-cordova/node_modules/bplist-parser/test/parseTest.js +++ /dev/null @@ -1,159 +0,0 @@ -'use strict'; - -// tests are adapted from https://github.com/TooTallNate/node-plist - -var path = require('path'); -var nodeunit = require('nodeunit'); -var bplist = require('../'); - -module.exports = { - 'iTunes Small': function (test) { - var file = path.join(__dirname, "iTunes-small.bplist"); - var startTime1 = new Date(); - - bplist.parseFile(file, function (err, dicts) { - if (err) { - throw err; - } - - var endTime = new Date(); - console.log('Parsed "' + file + '" in ' + (endTime - startTime1) + 'ms'); - var dict = dicts[0]; - test.equal(dict['Application Version'], "9.0.3"); - test.equal(dict['Library Persistent ID'], "6F81D37F95101437"); - test.done(); - }); - }, - - 'sample1': function (test) { - var file = path.join(__dirname, "sample1.bplist"); - var startTime = new Date(); - - bplist.parseFile(file, function (err, dicts) { - if (err) { - throw err; - } - - var endTime = new Date(); - console.log('Parsed "' + file + '" in ' + (endTime - startTime) + 'ms'); - var dict = dicts[0]; - test.equal(dict['CFBundleIdentifier'], 'com.apple.dictionary.MySample'); - test.done(); - }); - }, - - 'sample2': function (test) { - var file = path.join(__dirname, "sample2.bplist"); - var startTime = new Date(); - - bplist.parseFile(file, function (err, dicts) { - if (err) { - throw err; - } - - var endTime = new Date(); - console.log('Parsed "' + file + '" in ' + (endTime - startTime) + 'ms'); - var dict = dicts[0]; - test.equal(dict['PopupMenu'][2]['Key'], "\n #import \n\n#import \n\nint main(int argc, char *argv[])\n{\n return macruby_main(\"rb_main.rb\", argc, argv);\n}\n"); - test.done(); - }); - }, - - 'airplay': function (test) { - var file = path.join(__dirname, "airplay.bplist"); - var startTime = new Date(); - - bplist.parseFile(file, function (err, dicts) { - if (err) { - throw err; - } - - var endTime = new Date(); - console.log('Parsed "' + file + '" in ' + (endTime - startTime) + 'ms'); - - var dict = dicts[0]; - test.equal(dict['duration'], 5555.0495000000001); - test.equal(dict['position'], 4.6269989039999997); - test.done(); - }); - }, - - 'utf16': function (test) { - var file = path.join(__dirname, "utf16.bplist"); - var startTime = new Date(); - - bplist.parseFile(file, function (err, dicts) { - if (err) { - throw err; - } - - var endTime = new Date(); - console.log('Parsed "' + file + '" in ' + (endTime - startTime) + 'ms'); - - var dict = dicts[0]; - test.equal(dict['CFBundleName'], 'sellStuff'); - test.equal(dict['CFBundleShortVersionString'], '2.6.1'); - test.equal(dict['NSHumanReadableCopyright'], '©2008-2012, sellStuff, Inc.'); - test.done(); - }); - }, - - 'utf16chinese': function (test) { - var file = path.join(__dirname, "utf16_chinese.plist"); - var startTime = new Date(); - - bplist.parseFile(file, function (err, dicts) { - if (err) { - throw err; - } - - var endTime = new Date(); - console.log('Parsed "' + file + '" in ' + (endTime - startTime) + 'ms'); - - var dict = dicts[0]; - test.equal(dict['CFBundleName'], '天翼阅读'); - test.equal(dict['CFBundleDisplayName'], '天翼阅读'); - test.done(); - }); - }, - - - - 'uid': function (test) { - var file = path.join(__dirname, "uid.bplist"); - var startTime = new Date(); - - bplist.parseFile(file, function (err, dicts) { - if (err) { - throw err; - } - - var endTime = new Date(); - console.log('Parsed "' + file + '" in ' + (endTime - startTime) + 'ms'); - - var dict = dicts[0]; - test.deepEqual(dict['$objects'][1]['NS.keys'], [{UID:2}, {UID:3}, {UID:4}]); - test.deepEqual(dict['$objects'][1]['NS.objects'], [{UID: 5}, {UID:6}, {UID:7}]); - test.deepEqual(dict['$top']['root'], {UID:1}); - test.done(); - }); - }, - - 'int64': function (test) { - var file = path.join(__dirname, "int64.bplist"); - var startTime = new Date(); - - bplist.parseFile(file, function (err, dicts) { - if (err) { - throw err; - } - - var endTime = new Date(); - console.log('Parsed "' + file + '" in ' + (endTime - startTime) + 'ms'); - var dict = dicts[0]; - test.equal(dict['zero'], '0'); - test.equal(dict['int64item'], '12345678901234567890'); - test.done(); - }); - } -}; diff --git a/chabok-starter-cordova/node_modules/bplist-parser/test/sample1.bplist b/chabok-starter-cordova/node_modules/bplist-parser/test/sample1.bplist deleted file mode 100644 index 5b808ff..0000000 Binary files a/chabok-starter-cordova/node_modules/bplist-parser/test/sample1.bplist and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/bplist-parser/test/sample2.bplist b/chabok-starter-cordova/node_modules/bplist-parser/test/sample2.bplist deleted file mode 100644 index fc42979..0000000 Binary files a/chabok-starter-cordova/node_modules/bplist-parser/test/sample2.bplist and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/bplist-parser/test/uid.bplist b/chabok-starter-cordova/node_modules/bplist-parser/test/uid.bplist deleted file mode 100644 index 59f341e..0000000 Binary files a/chabok-starter-cordova/node_modules/bplist-parser/test/uid.bplist and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/bplist-parser/test/utf16.bplist b/chabok-starter-cordova/node_modules/bplist-parser/test/utf16.bplist deleted file mode 100644 index ba4bcfa..0000000 Binary files a/chabok-starter-cordova/node_modules/bplist-parser/test/utf16.bplist and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/bplist-parser/test/utf16_chinese.plist b/chabok-starter-cordova/node_modules/bplist-parser/test/utf16_chinese.plist deleted file mode 100755 index ba1e2d7..0000000 Binary files a/chabok-starter-cordova/node_modules/bplist-parser/test/utf16_chinese.plist and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/brace-expansion/LICENSE b/chabok-starter-cordova/node_modules/brace-expansion/LICENSE deleted file mode 100644 index de32266..0000000 --- a/chabok-starter-cordova/node_modules/brace-expansion/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2013 Julian Gruber - -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. diff --git a/chabok-starter-cordova/node_modules/brace-expansion/README.md b/chabok-starter-cordova/node_modules/brace-expansion/README.md deleted file mode 100644 index 6b4e0e1..0000000 --- a/chabok-starter-cordova/node_modules/brace-expansion/README.md +++ /dev/null @@ -1,129 +0,0 @@ -# brace-expansion - -[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), -as known from sh/bash, in JavaScript. - -[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) -[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) -[![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/) - -[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) - -## Example - -```js -var expand = require('brace-expansion'); - -expand('file-{a,b,c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('-v{,,}') -// => ['-v', '-v', '-v'] - -expand('file{0..2}.jpg') -// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] - -expand('file-{a..c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('file{2..0}.jpg') -// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] - -expand('file{0..4..2}.jpg') -// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] - -expand('file-{a..e..2}.jpg') -// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] - -expand('file{00..10..5}.jpg') -// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] - -expand('{{A..C},{a..c}}') -// => ['A', 'B', 'C', 'a', 'b', 'c'] - -expand('ppp{,config,oe{,conf}}') -// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] -``` - -## API - -```js -var expand = require('brace-expansion'); -``` - -### var expanded = expand(str) - -Return an array of all possible and valid expansions of `str`. If none are -found, `[str]` is returned. - -Valid expansions are: - -```js -/^(.*,)+(.+)?$/ -// {a,b,...} -``` - -A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -A numeric sequence from `x` to `y` inclusive, with optional increment. -If `x` or `y` start with a leading `0`, all the numbers will be padded -to have equal length. Negative numbers and backwards iteration work too. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -An alphabetic sequence from `x` to `y` inclusive, with optional increment. -`x` and `y` must be exactly one character, and if given, `incr` must be a -number. - -For compatibility reasons, the string `${` is not eligible for brace expansion. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install brace-expansion -``` - -## Contributors - -- [Julian Gruber](https://github.com/juliangruber) -- [Isaac Z. Schlueter](https://github.com/isaacs) - -## Sponsors - -This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)! - -Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)! - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -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. diff --git a/chabok-starter-cordova/node_modules/brace-expansion/index.js b/chabok-starter-cordova/node_modules/brace-expansion/index.js deleted file mode 100644 index 0478be8..0000000 --- a/chabok-starter-cordova/node_modules/brace-expansion/index.js +++ /dev/null @@ -1,201 +0,0 @@ -var concatMap = require('concat-map'); -var balanced = require('balanced-match'); - -module.exports = expandTop; - -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; - -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} - -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} - -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} - - -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; - - var parts = []; - var m = balanced('{', '}', str); - - if (!m) - return str.split(','); - - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); - - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } - - parts.push.apply(parts, p); - - return parts; -} - -function expandTop(str) { - if (!str) - return []; - - // I don't know why Bash 4.3 does this, but it does. - // Anything starting with {} will have the first two bytes preserved - // but *only* at the top level, so {},a}b will not expand to anything, - // but a{},b}c will be expanded to [a}c,abc]. - // One could argue that this is a bug in Bash, but since the goal of - // this module is to match Bash's rules, we escape a leading {} - if (str.substr(0, 2) === '{}') { - str = '\\{\\}' + str.substr(2); - } - - return expand(escapeBraces(str), true).map(unescapeBraces); -} - -function identity(e) { - return e; -} - -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} - -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} - -function expand(str, isTop) { - var expansions = []; - - var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; - - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = m.body.indexOf(',') >= 0; - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*\}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post, false) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post, false) - : ['']; - - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { return expand(el, false) }); - } - - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } - } - - return expansions; -} - diff --git a/chabok-starter-cordova/node_modules/brace-expansion/package.json b/chabok-starter-cordova/node_modules/brace-expansion/package.json deleted file mode 100644 index 8428920..0000000 --- a/chabok-starter-cordova/node_modules/brace-expansion/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "_from": "brace-expansion@^1.1.7", - "_id": "brace-expansion@1.1.11", - "_inBundle": false, - "_integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "_location": "/brace-expansion", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "brace-expansion@^1.1.7", - "name": "brace-expansion", - "escapedName": "brace-expansion", - "rawSpec": "^1.1.7", - "saveSpec": null, - "fetchSpec": "^1.1.7" - }, - "_requiredBy": [ - "/minimatch" - ], - "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "_shasum": "3c7fcbf529d87226f3d2f52b966ff5271eb441dd", - "_spec": "brace-expansion@^1.1.7", - "_where": "/Users/farbod/Documents/Github/chabok/chabok-starter-cordova/chabok-starter-cordova/node_modules/minimatch", - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "bugs": { - "url": "https://github.com/juliangruber/brace-expansion/issues" - }, - "bundleDependencies": false, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - }, - "deprecated": false, - "description": "Brace expansion as known from sh/bash", - "devDependencies": { - "matcha": "^0.7.0", - "tape": "^4.6.0" - }, - "homepage": "https://github.com/juliangruber/brace-expansion", - "keywords": [], - "license": "MIT", - "main": "index.js", - "name": "brace-expansion", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/brace-expansion.git" - }, - "scripts": { - "bench": "matcha test/perf/bench.js", - "gentest": "bash test/generate.sh", - "test": "tape test/*.js" - }, - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "version": "1.1.11" -} diff --git a/chabok-starter-cordova/node_modules/com.chabokpush.cordova/package.json b/chabok-starter-cordova/node_modules/com.chabokpush.cordova/package.json deleted file mode 100644 index 9130b36..0000000 --- a/chabok-starter-cordova/node_modules/com.chabokpush.cordova/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "_from": "com.chabokpush.cordova", - "_id": "com.chabokpush.cordova@1.0.0", - "_inBundle": false, - "_integrity": "sha512-sTy5VRL3aKLo5IzsjArn1kb7WxBsNcAsixlZzSKMG8kQ5KPZiY8fJ8XJ/MmPOGcH96+htAo+NtcBmHXGQ93Lmg==", - "_location": "/com.chabokpush.cordova", - "_phantomChildren": {}, - "_requested": { - "type": "tag", - "registry": true, - "raw": "com.chabokpush.cordova", - "name": "com.chabokpush.cordova", - "escapedName": "com.chabokpush.cordova", - "rawSpec": "", - "saveSpec": null, - "fetchSpec": "latest" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/com.chabokpush.cordova/-/com.chabokpush.cordova-1.0.0.tgz", - "_shasum": "66ea1acc726cfb92694b06b394973d7fc971e898", - "_spec": "com.chabokpush.cordova", - "_where": "/Users/farbod/Documents/Github/chabok/chabok-starter-cordova/chabok-starter-cordova", - "author": { - "name": "Chabok Realtime Solutions" - }, - "bundleDependencies": false, - "cordova": { - "id": "com.chabokpush.cordova", - "platforms": [ - "android", - "ios" - ] - }, - "deprecated": false, - "description": "ChabokPush Realtime messaging", - "keywords": [ - "ecosystem:cordova", - "cordova-android", - "cordova-ios" - ], - "license": "ISC", - "name": "com.chabokpush.cordova", - "version": "1.0.0" -} diff --git a/chabok-starter-cordova/node_modules/com.chabokpush.cordova/plugin.xml b/chabok-starter-cordova/node_modules/com.chabokpush.cordova/plugin.xml deleted file mode 100644 index 1e4132a..0000000 --- a/chabok-starter-cordova/node_modules/com.chabokpush.cordova/plugin.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - ChabokPush - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - remote-notification - - - - - NSAllowsArbitraryLoads - - - - - - - - - - - - - \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/com.chabokpush.cordova/src/android/ChabokPush.java b/chabok-starter-cordova/node_modules/com.chabokpush.cordova/src/android/ChabokPush.java deleted file mode 100644 index cbf8b57..0000000 --- a/chabok-starter-cordova/node_modules/com.chabokpush.cordova/src/android/ChabokPush.java +++ /dev/null @@ -1,455 +0,0 @@ -package com.chabokpush.cordova; - -import android.content.Context; -import android.net.Uri; -import android.util.Log; - -import com.adpdigital.push.AdpPushClient; -import com.adpdigital.push.AppState; -import com.adpdigital.push.Callback; -import com.adpdigital.push.ConnectionStatus; -import com.adpdigital.push.config.Environment; -import com.adpdigital.push.LogLevel; -import com.adpdigital.push.PushMessage; - -import org.apache.cordova.CallbackContext; -import org.apache.cordova.CordovaPlugin; -import org.apache.cordova.PluginResult; -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -/** - * This class echoes a string called from JavaScript. - */ -public class ChabokPush extends CordovaPlugin { - - private static final String TAG = "CHK"; - private CallbackContext onMessageCallbackContext; - private CallbackContext onRegisterCallbackContext; - private CallbackContext onConnectionStatusCallbackContext; - - @Override - protected void pluginInitialize() { - final Context context = this.cordova.getActivity().getApplicationContext(); - this.cordova.getThreadPool().execute(new Runnable() { - public void run() { - Log.d(TAG, "Starting Chabok plugin"); - AdpPushClient.setApplicationContext(context); - } - }); - } - - @Override - public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { - android.util.Log.d(TAG, "----------- execute: action = " + action + " , args = " + args); - - if (action.equals("configureEnvironment")) { - boolean devMode = args.getBoolean(0); - configureEnvironment(devMode, callbackContext); - return true; - } else if (action.equals("login")) { - String userId = args.getString(0); - login(userId, callbackContext); - return true; - } else if (action.equals("getUserId")){ - getUserId(callbackContext); - return true; - } else if (action.equals("getInstallation")){ - getInstallation(callbackContext); - return true; - } else if (action.equals("setDefaultTracker")){ - String defaultTracker = args.getString(0); - setDefaultTracker(defaultTracker); - return true; - } else if (action.equals("resetBadge")){ - resetBadge(); - return true; - } else if (action.equals("appWillOpenUrl")){ - String url = args.getString(0); - - appWillOpenUrl(url); - return true; - } else if (action.equals("logout")) { - logout(); - return true; - } else if (action.equals("addTag")){ - String tagName = args.getString(0); - - addTag(tagName, callbackContext); - return true; - } else if (action.equals("removeTag")){ - String tagName = args.getString(0); - - removeTag(tagName, callbackContext); - return true; - } else if (action.equals("setUserAttributes")) { - JSONObject userInfo = args.getJSONObject(0); - - setUserAttributes(userInfo); - return true; - } else if (action.equals("track")){ - String trackName = args.getString(0); - JSONObject data = args.getJSONObject(1); - - track(trackName, data); - return true; - } else if (action.equals("setOnMessageCallback")){ - this.setOnMessageCallbackContext(callbackContext); - return true; - } else if (action.equals("setOnConnectionStatusCallback")){ - this.setOnConnectionStatusCallbackContext(callbackContext); - return true; - } - return false; - } - - public void configureEnvironment(boolean devMode, CallbackContext callbackContext) { - AdpPushClient.setApplicationContext(getApplicationContext()); - AdpPushClient.configureEnvironment(devMode ? Environment.SANDBOX : Environment.PRODUCTION); - AdpPushClient.setLogLevel(LogLevel.VERBOSE); - - AdpPushClient chabok = AdpPushClient.get(); - if (chabok != null) { - android.util.Log.d(TAG, "init: Initilized sucessfully"); - callbackContext.success("Initilized sucessfully"); - } else { - android.util.Log.d(TAG, "Could not init chabok parameters"); - callbackContext.error("Could not init chabok parameters"); - return; - } - - chabok.addListener(this); - } - - public void login(String userId, CallbackContext callbackContext) { - this.onRegisterCallbackContext = callbackContext; - AdpPushClient.get().login(userId); - } - - public void logout() { - AdpPushClient.get().logout(); - } - - public void publish(JSONObject message, CallbackContext callbackContext) { - try { - JSONObject dataMap = null; - if (message.has("data")) { - dataMap = message.getJSONObject("data"); - } - String body = message.getString("content"); - String userId = message.getString("userId"); - String channel = message.getString("channel"); - - PushMessage msg = new PushMessage(); - - if (body != null) { - msg.setBody(body); - } - if (userId != null) { - msg.setUser(userId); - } - if (userId != null) { - msg.setUser(userId); - } - if (channel != null) { - msg.setChannel(channel); - } - - if (dataMap != null) { - msg.setData(dataMap); - } - - AdpPushClient.get().publish(msg, new Callback() { - @Override - public void onSuccess(Object o) { - callbackContext.success("Message published"); - } - - @Override - public void onFailure(Throwable throwable) { - callbackContext.error(throwable.getMessage()); - } - }); - } catch (JSONException e) { - e.printStackTrace(); - callbackContext.error(e.getMessage()); - } - } - - public void track(String trackName, JSONObject data){ - AdpPushClient.get().track(trackName, data); - } - - public void addTag(String tagName, CallbackContext callbackContext){ - AdpPushClient.get().addTag(tagName, new Callback() { - @Override - public void onSuccess(Object o) { - android.util.Log.d(TAG, "The addTags onSuccess: called"); - callbackContext.success("Tag Added"); - } - - @Override - public void onFailure(Throwable throwable) { - android.util.Log.d(TAG, "The addTag onFailure: called"); - callbackContext.error(throwable.getMessage()); - } - }); - } - - public void removeTag(String tagName, CallbackContext callbackContext){ - AdpPushClient.get().removeTag(tagName, new Callback() { - @Override - public void onSuccess(Object o) { - android.util.Log.d(TAG, "The removeTag onSuccess: called"); - callbackContext.success("Tag removed"); - } - - @Override - public void onFailure(Throwable throwable) { - android.util.Log.d(TAG, "The removeTag onFailure: called"); - callbackContext.error(throwable.getMessage()); - } - }); - } - - public void setDefaultTracker(String defaultTracker){ - AdpPushClient.get().setDefaultTracker(defaultTracker); - } - - public void appWillOpenUrl(String link) { - if (link == null) { - return; - } - - Uri uri = Uri.parse(link); - AdpPushClient.get().appWillOpenUrl(uri); - } - - public void setUserAttributes(JSONObject userInfo) { - try { - HashMap userInfoMap = (HashMap) jsonToMap(userInfo); - AdpPushClient.get().setUserAttributes(userInfoMap); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public String getUserId(CallbackContext callbackContext){ - String userId = AdpPushClient.get().getUserId(); - - if (callbackContext != null){ - if (userId != null){ - callbackContext.success(userId); - } else { - callbackContext.error("The userId is null, You didn't register yet!"); - } - } - - return userId; - } - - public String getInstallation(CallbackContext callbackContext){ - String installationId = AdpPushClient.get().getUserId(); - - if (callbackContext != null){ - if (installationId != null){ - callbackContext.success(installationId); - } else { - callbackContext.error("The installationId is null, You didn't register yet!"); - } - } - - return installationId; - } - - public void resetBadge(){ - AdpPushClient.get().resetBadge(); - } - - public void setOnMessageCallbackContext(CallbackContext callbackContext){ - this.onMessageCallbackContext = callbackContext; - } - - public void setOnConnectionStatusCallbackContext(CallbackContext callbackContext){ - this.onConnectionStatusCallbackContext = callbackContext; - } - - public void onEvent(AppState state){ - android.util.Log.d(TAG, "=================== onEvent: state = " + state + ", this.onRegisterCallbackContext = " + this.onRegisterCallbackContext); - if (state == AppState.REGISTERED){ - if ( this.onRegisterCallbackContext == null){ - return; - } - - try { - JSONObject successData = new JSONObject(); - successData.put("registered", true); - - PluginResult pluginResult = new PluginResult(PluginResult.Status.OK, successData); - this.onRegisterCallbackContext.sendPluginResult(pluginResult); - } catch (JSONException e) { - e.printStackTrace(); - } - - } - } - - public void onEvent(final ConnectionStatus status) { - String connectionStatus = null; - - switch (status) { - case CONNECTED: - android.util.Log.d(TAG, "Connected to the chabok"); - connectionStatus = "CONNECTED"; - break; - case CONNECTING: - android.util.Log.d(TAG, "Connecting to the chabok"); - connectionStatus = "CONNECTING"; - break; - case DISCONNECTED: - android.util.Log.d(TAG, "Disconnected"); - connectionStatus = "DISCONNECTED"; - break; - case NOT_INITIALIZED: - android.util.Log.d(TAG, "NOT_INITIALIZED"); - connectionStatus = "NOT_INITIALIZED"; - break; - case SOCKET_TIMEOUT: - android.util.Log.d(TAG, "SOCKET_TIMEOUT"); - connectionStatus = "SOCKET_TIMEOUT"; - break; - default: - android.util.Log.d(TAG, "Disconnected"); - connectionStatus = "DISCONNECTED"; - } - - if (connectionStatus != null && this.onConnectionStatusCallbackContext != null){ - successCallback(this.onConnectionStatusCallbackContext, connectionStatus); - } - } - - public void onEvent(final PushMessage msg) { - final CallbackContext callbackContext = this.onMessageCallbackContext; - - this.cordova.getActivity().runOnUiThread(new Runnable() { - @Override - public void run() { - JSONObject message = new JSONObject(); - - try { - message.put("id", msg.getId()); - message.put("body", msg.getBody()); - message.put("sound", msg.getSound()); - message.put("sentId", msg.getSentId()); - message.put("channel", msg.getChannel()); - message.put("senderId", msg.getSenderId()); - message.put("expireAt", msg.getExpireAt()); - message.put("alertText", msg.getAlertText()); - message.put("createdAt", msg.getCreatedAt()); - message.put("alertTitle", msg.getAlertTitle()); - message.put("intentType", msg.getIntentType()); - message.put("receivedAt", msg.getReceivedAt()); - - if (msg.getData() != null) { - message.put("data", msg.getData()); - } - - if (msg.getNotification() != null) { - message.put("notification", msg.getNotification()); - } - } catch (JSONException e) { - e.printStackTrace(); - } - - if (message != null && callbackContext != null) { - successCallback(callbackContext, message); - } - } - }); - } - - public void successCallback(CallbackContext callbackContext, String message){ - PluginResult pluginResult = new PluginResult(PluginResult.Status.OK, message); - pluginResult.setKeepCallback(true); - callbackContext.sendPluginResult(pluginResult); - } - - public void successCallback(CallbackContext callbackContext, JSONObject data){ - PluginResult pluginResult = new PluginResult(PluginResult.Status.OK, data); - pluginResult.setKeepCallback(true); - callbackContext.sendPluginResult(pluginResult); - } - - public void failureCallback(CallbackContext callbackContext, String message){ - PluginResult pluginResult = new PluginResult(PluginResult.Status.ERROR, message); - pluginResult.setKeepCallback(true); - callbackContext.sendPluginResult(pluginResult); - } - - public void failureCallback(CallbackContext callbackContext, JSONObject data){ - PluginResult pluginResult = new PluginResult(PluginResult.Status.ERROR, data); - pluginResult.setKeepCallback(true); - callbackContext.sendPluginResult(pluginResult); - } - - /** - * Gets the application context from cordova's main activity. - * - * @return the application context - */ - private Context getApplicationContext() { - return this.cordova.getActivity().getApplicationContext(); - } - - public static Map jsonToMap(JSONObject json) throws JSONException { - Map retMap = new HashMap(); - - if(json != JSONObject.NULL) { - retMap = toMap(json); - } - return retMap; - } - - public static Map toMap(JSONObject object) throws JSONException { - Map map = new HashMap(); - - Iterator keysItr = object.keys(); - while(keysItr.hasNext()) { - String key = keysItr.next(); - Object value = object.get(key); - - if(value instanceof JSONArray) { - value = toList((JSONArray) value); - } - - else if(value instanceof JSONObject) { - value = toMap((JSONObject) value); - } - map.put(key, value); - } - return map; - } - - public static List toList(JSONArray array) throws JSONException { - List list = new ArrayList(); - for(int i = 0; i < array.length(); i++) { - Object value = array.get(i); - if(value instanceof JSONArray) { - value = toList((JSONArray) value); - } - - else if(value instanceof JSONObject) { - value = toMap((JSONObject) value); - } - list.add(value); - } - return list; - } -} diff --git a/chabok-starter-cordova/node_modules/com.chabokpush.cordova/src/android/MyAppClass.java b/chabok-starter-cordova/node_modules/com.chabokpush.cordova/src/android/MyAppClass.java deleted file mode 100644 index d5df4a4..0000000 --- a/chabok-starter-cordova/node_modules/com.chabokpush.cordova/src/android/MyAppClass.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.chabokpush.cordova; - -import android.app.Application; - -public class MyAppClass extends Application { - @Override - public void onCreate() { - super.onCreate(); - } -} \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/com.chabokpush.cordova/src/android/build.gradle b/chabok-starter-cordova/node_modules/com.chabokpush.cordova/src/android/build.gradle deleted file mode 100644 index 550fa94..0000000 --- a/chabok-starter-cordova/node_modules/com.chabokpush.cordova/src/android/build.gradle +++ /dev/null @@ -1,21 +0,0 @@ -repositories { - flatDir { - dirs 'libs' - } -} - -dependencies { - implementation(name:'chabok-lib-3.1.0', ext:'aar') -} - -android { - packagingOptions { - exclude 'META-INF/NOTICE' - exclude 'META-INF/LICENSE' - } -} - -cdvPluginPostBuildExtras.add({ - apply plugin: 'com.google.gms.google-services' - apply plugin: 'io.chabok.plugin.chabok-services' -}) \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/com.chabokpush.cordova/src/android/libs/chabok-lib-3.1.0.aar b/chabok-starter-cordova/node_modules/com.chabokpush.cordova/src/android/libs/chabok-lib-3.1.0.aar deleted file mode 100644 index de5774c..0000000 Binary files a/chabok-starter-cordova/node_modules/com.chabokpush.cordova/src/android/libs/chabok-lib-3.1.0.aar and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/com.chabokpush.cordova/src/ios/ChabokPush.m b/chabok-starter-cordova/node_modules/com.chabokpush.cordova/src/ios/ChabokPush.m deleted file mode 100644 index 986226b..0000000 --- a/chabok-starter-cordova/node_modules/com.chabokpush.cordova/src/ios/ChabokPush.m +++ /dev/null @@ -1,458 +0,0 @@ -/********* ChabokPush.m Cordova Plugin Implementation *******/ - -#import -#import -#import - -id pluginCommandDelegate; - -void successCallback(NSString* callbackId, NSDictionary* data) { - CDVPluginResult* commandResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:data]; - commandResult.keepCallback = @1; - [pluginCommandDelegate sendPluginResult:commandResult callbackId:callbackId]; -} - -void failureCallback(NSString* callbackId, NSDictionary* data) { - CDVPluginResult* commandResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:data]; - commandResult.keepCallback = @1; - [pluginCommandDelegate sendPluginResult:commandResult callbackId:callbackId]; -} - -@interface ChabokPush : CDVPlugin { - NSString * _onMessageCallback; - NSString * _onRegisterCallback; - NSString * _onConnectionStatusCallback; -} - // Member variables go here. -@property (nonatomic, retain) NSString *appId; - -//@property (class) NSDictionary *coldStartNotificationResult; - -@property (nonatomic, retain) NSString *onMessageCallback; -@property (nonatomic, retain) NSString *onRegisterCallback; -@property (nonatomic, retain) NSString *onConnectionStatusCallback; -//@property (nonatomic, retain) NSString *notificationOpenedCallback; - --(void) configureEnvironment:(CDVInvokedUrlCommand *)command; --(void) login:(CDVInvokedUrlCommand *)command; --(void) logout:(CDVInvokedUrlCommand *)command; - --(void) getUserId:(CDVInvokedUrlCommand *) command; --(void) getInstallationId:(CDVInvokedUrlCommand *) command; - --(void) addTag:(CDVInvokedUrlCommand *) command; --(void) removeTag:(CDVInvokedUrlCommand *) command; - --(void) publish:(CDVInvokedUrlCommand *) command; --(void) resetBadge:(CDVInvokedUrlCommand *) command; --(void) track:(CDVInvokedUrlCommand *) command; --(void) setDefaultTracker:(CDVInvokedUrlCommand *) command; - -@end - -@implementation ChabokPush - -@synthesize onRegisterCallback = _onRegisterCallback; - -//@dynamic coldStartNotificationResult; -//static NSDictionary *_coldStartNotificationResult; - --(void)pluginInitialize { - NSLog(@"Starting Chabok plugin"); -} --(void)configureEnvironment:(CDVInvokedUrlCommand*)command { - BOOL devMode = [command.arguments objectAtIndex:0]; - NSInteger chabokEnv = devMode ? 0 : 1; - - [PushClientManager.defaultManager addDelegate:self]; - [PushClientManager.defaultManager setLogLevel:ChabokLogLevelVerbose]; - - BOOL state = [PushClientManager.defaultManager configureEnvironment:chabokEnv]; - - CDVPluginResult* pluginResult = nil; - if (state) { - NSString *msg = @"Initilized sucessfully"; - - NSLog(msg); - pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:msg]; - } else { - NSString *msg = @"Could not init chabok parameters"; - - NSLog(msg); - pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:msg]; - } - - if (!command.callbackId) { - return; - } - - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; -} - -#pragma mark - Register - --(void)login:(CDVInvokedUrlCommand*)command { - CDVPluginResult* pluginResult = nil; - - NSString *userId = [command.arguments objectAtIndex:0]; - if (!userId || [userId isEqual:[NSNull null]]){ - NSString *msg = @"Could not register userId to chabok"; - - NSLog(msg); - pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:msg]; - return; - } - - BOOL state = [PushClientManager.defaultManager login:userId - handler:^(BOOL isRegistered, NSError *error) { - CDVPluginResult* pluginResult = nil; - - NSLog(@"isRegistered : %d userId : %@ error : %@",isRegistered, userId, error); - - if (error) { - if (command.callbackId) { - NSDictionary *jsonDic = @{@"registered": @(NO), - @"error": error - }; - NSString *json = [self dictionaryToJson:jsonDic]; - - pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:json]; - - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - } - - if (_onRegisterCallback){ - successCallback(_onRegisterCallback, @(false)); - } - } else { - - if (command.callbackId) { - NSDictionary *jsonDic = @{@"registered": @(YES)}; - NSString *json = [self dictionaryToJson:jsonDic]; - - pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:json]; - - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - } - if (_onRegisterCallback){ - successCallback(_onRegisterCallback, @(true)); - } - } - }]; -} - -#pragma mark - unregister - --(void) logout:(CDVInvokedUrlCommand*)command { - [PushClientManager.defaultManager logout]; -} - -#pragma mark - user --(void) getInstallationId:(CDVInvokedUrlCommand*) command { - CDVPluginResult* pluginResult = nil; - - NSString *installationId = [PushClientManager.defaultManager getInstallationId]; - if (!installationId) { - NSString *msg = @"The installationId is null, You didn't register yet!"; - - NSLog(msg); - pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:msg]; - } else { - pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:installationId]; - } - - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; -} - --(void) getUserId:(CDVInvokedUrlCommand*) command { - CDVPluginResult* pluginResult = nil; - - NSString *userId = [PushClientManager.defaultManager userId]; - if (!userId) { - NSString *msg = @"The userId is null, You didn't register yet!"; - - NSLog(msg); - pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:msg]; - } else { - pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:userId]; - } - - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; -} - -#pragma mark - tags - --(void) addTag:(CDVInvokedUrlCommand *) command { - CDVPluginResult* pluginResult = nil; - - NSString *tagName = [command.arguments objectAtIndex:0]; - - //TODO: This should handle in android sdk - if (![PushClientManager.defaultManager getInstallationId]) { - if (!command.callbackId) { - return; - } - - CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"UserId not registered yet."]; - - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - return; - } - - [PushClientManager.defaultManager addTag:tagName - success:^(NSInteger count) { - if (!command.callbackId) { - return; - } - NSDictionary *jsonDic = @{@"count": @(count)}; - NSString *json = [self dictionaryToJson:jsonDic]; - - CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:json]; - - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - } failure:^(NSError *error) { - if (!command.callbackId) { - return; - } - - CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:error.localizedDescription]; - - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - }]; -} - --(void) removeTag:(CDVInvokedUrlCommand *) command { - CDVPluginResult* pluginResult = nil; - - NSString *tagName = [command.arguments objectAtIndex:0]; - - [PushClientManager.defaultManager removeTag:tagName - success:^(NSInteger count) { - if (!command.callbackId) { - return; - } - - NSDictionary *jsonDic = @{@"count": @(count)}; - NSString *json = [self dictionaryToJson:jsonDic]; - - CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:json]; - - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - } failure:^(NSError *error) { - if (!command.callbackId) { - return; - } - - CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:error.localizedDescription]; - - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - }]; -} - -#pragma mark - publish - --(void) publish:(CDVInvokedUrlCommand *) command{ - CDVPluginResult* pluginResult = nil; - - NSDictionary *message = [command.arguments objectAtIndex:0]; - - NSDictionary *data = [message valueForKey:@"data"]; - NSString *userId = [message valueForKey:@"userId"]; - NSString *content = [message valueForKey:@"content"]; - NSString *channel = [message valueForKey:@"channel"]; - - PushClientMessage *chabokMessage; - if (data) { - chabokMessage = [[PushClientMessage alloc] initWithMessage:content withData:data toUserId:userId channel:channel]; - } else { - chabokMessage = [[PushClientMessage alloc] initWithMessage:content toUserId:userId channel:channel]; - } - - BOOL publishState = [PushClientManager.defaultManager publish:chabokMessage]; - - if (publishState) { - pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - } else { - pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR]; - } - - if (!command.callbackId) { - return; - } - - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; -} - -#pragma mark - badge --(void) resetBadge:(CDVInvokedUrlCommand *) command { - [PushClientManager resetBadge]; -} - -#pragma mark - track --(void) track:(CDVInvokedUrlCommand *) command { - - //TODO: This should handle in SDK - if (![PushClientManager.defaultManager getInstallationId] || PushClientManager.defaultManager.connectionState != PushClientServerConnectedState) { - NSLog(@"chabokpush ----------- Not connected, Queue the operation"); - [self enqueueWhenSessionIsConnected:^{ - NSLog(@"chabokpush ----------- Now connected and dequeue"); - [self track:command]; - }]; - return; - } - NSLog(@"chabokpush ----------- Track event called"); - NSString *trackName = [command.arguments objectAtIndex:0]; - NSDictionary *trackData = [command.arguments objectAtIndex:1]; - - [PushClientManager.defaultManager track:trackName data:trackData]; -} - -#pragma mark - default tracker --(void) setDefaultTracker:(CDVInvokedUrlCommand *) command { - NSString *defaultTracker = [command.arguments objectAtIndex:0]; - - [PushClientManager.defaultManager setDefaultTracker:defaultTracker];; -} - -#pragma mark - userInfo --(void) setUserAttributes:(CDVInvokedUrlCommand *) command { - NSDictionary *userInfo = [command.arguments objectAtIndex:0]; - - [PushClientManager.defaultManager setUserAttributes:userInfo]; -} - --(void) getUserAttributes:(CDVInvokedUrlCommand *) command { - CDVPluginResult* pluginResult = nil; - NSDictionary *userInfo = PushClientManager.defaultManager.userAttributes; - - NSString *json = [self dictionaryToJson:userInfo]; - - pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:json]; - if (!command.callbackId) { - return; - } - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; -} - -#pragma mark - deeplink --(void) appWillOpenUrl:(CDVInvokedUrlCommand *) command { - // CDVPluginResult* pluginResult = nil; - // NSString *link = [command.arguments objectAtIndex:0]; - - // if(!link){ - // return; - // } - - // NSURL *url = [[NSURL alloc] initWithString:link]; - // [PushClientManager.defaultManager appWillOpenUrl:url]; -} - -//-(void) setNotificationOpenedHandler:(CDVInvokedUrlCommand *) command { -// CDVPluginResult* pluginResult = nil; -// -// [self sendEventWithName:@"notificationOpened" body:_coldStartNotificationResult]; -//} - -#pragma mark - callback --(void) setOnMessageCallback:(CDVInvokedUrlCommand *) command{ - self.onMessageCallback = command.callbackId; -} - --(void) setOnRegisterCallback:(CDVInvokedUrlCommand *) command{ - _onRegisterCallback = command.callbackId; -} - --(void) setOnConnectionStatusCallback:(CDVInvokedUrlCommand *) command { - self.onConnectionStatusCallback = command.callbackId; -} - -//-(void) setNotificationOpenedHandler:(CDVInvokedUrlCommand *) command{ -// self.notificationOpened = command.callbackId; -//} - -#pragma mark - delegate method --(void) pushClientManagerDidChangedServerConnectionState { - NSString *connectionState = @""; - if (PushClientManager.defaultManager.connectionState == PushClientServerConnectedState) { - connectionState = @"CONNECTED"; - } else if (PushClientManager.defaultManager.connectionState == PushClientServerConnectingState || - PushClientManager.defaultManager.connectionState == PushClientServerConnectingStartState) { - connectionState = @"CONNECTING"; - } else if (PushClientManager.defaultManager.connectionState == PushClientServerDisconnectedState || - PushClientManager.defaultManager.connectionState == PushClientServerDisconnectedErrorState) { - connectionState = @"DISCONNECTED"; - } else if (PushClientManager.defaultManager.connectionState == PushClientServerSocketTimeoutState) { - connectionState = @"SocketTimeout"; - } else { - connectionState = @"NOT_INITIALIZED"; - } - - if (self.onConnectionStatusCallback) { - successCallback(self.onConnectionStatusCallback, connectionState); - } -} - --(void) pushClientManagerDidReceivedMessage:(PushClientMessage *)message{ - NSMutableDictionary *messageDict = [NSMutableDictionary.alloc initWithDictionary:[message toDict]]; - [messageDict setObject:message.channel forKey:@"channel"]; - - if (self.onMessageCallback) { - successCallback(self.onMessageCallback, messageDict); - } -} - -// called when PushClientManager Register User Successfully -- (void)pushClientManagerDidRegisterUser:(BOOL)registration{ - NSLog(@"------------ %@ %@ cid = %@",@(__PRETTY_FUNCTION__),@(registration), _onRegisterCallback); - - if (_onRegisterCallback) { - NSDictionary *successDic = @{@"regisered":@(registration)}; - CDVPluginResult* commandResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:successDic]; - [self.commandDelegate sendPluginResult:commandResult callbackId:_onRegisterCallback]; - } -} - -// called when PushClientManager Register User failed -- (void)pushClientManagerDidFailRegisterUser:(NSError *)error{ - NSLog(@"------------ %@ %@ cid = %@",@(__PRETTY_FUNCTION__),error, _onRegisterCallback); - - if (_onRegisterCallback) { - NSDictionary *errorDic = @{@"error":error.localizedDescription}; - CDVPluginResult* commandResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:errorDic]; - [self.commandDelegate sendPluginResult:commandResult callbackId:_onRegisterCallback]; - } -} - - -#pragma mark - json --(NSString *) dictionaryToJson:(NSDictionary *) dic{ - NSError *error; - NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dic - options:NSJSONWritingPrettyPrinted - error:&error]; - - if (!jsonData) { - NSLog(@"Got an error: %@", error); - return nil; - } - - return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; -} - -#pragma mark - private --(void) enqueueWhenSessionIsConnected:(void(^)(void))block{ - NSString *observerKey = kPushClientDidChangeServerConnectionStateNotification; - NSOperationQueue *queue = [NSOperationQueue mainQueue]; - __block __weak id observer = [[NSNotificationCenter defaultCenter] - addObserverForName:observerKey - object:nil - queue:queue - usingBlock:^(NSNotification * _Nonnull note) { - if( PushClientManager.defaultManager.connectionState == PushClientServerConnectedState ) { - [[NSNotificationCenter defaultCenter] removeObserver:observer]; - block(); - } - }]; -} - -@end diff --git a/chabok-starter-cordova/node_modules/com.chabokpush.cordova/www/ChabokPush.js b/chabok-starter-cordova/node_modules/com.chabokpush.cordova/www/ChabokPush.js deleted file mode 100644 index 131b071..0000000 --- a/chabok-starter-cordova/node_modules/com.chabokpush.cordova/www/ChabokPush.js +++ /dev/null @@ -1,102 +0,0 @@ -var exec = require('cordova/exec'); - -const bridgeName = 'ChabokPush'; -var ChabokPush = function () {} - -ChabokPush.prototype.configureEnvironment = function (devMode, success, error) { - exec(success, error, bridgeName, 'configureEnvironment', [devMode]); -}; - -ChabokPush.prototype.login = function (userId, success, error) { - exec(success, error, bridgeName, 'login', [userId]); -}; - -ChabokPush.prototype.logout = function () { - exec(function () { - }, function () { - }, bridgeName, 'logout', []); -}; - -ChabokPush.prototype.addTag = function (tagName, success, error) { - exec(success, error, bridgeName, 'addTag', [tagName]); -}; - -ChabokPush.prototype.removeTag = function (tagName, success, error) { - exec(success, error, bridgeName, 'removeTag', [tagName]); -}; - -ChabokPush.prototype.appWillOpenUrl = function (url) { - exec(function () { - }, function () { - }, bridgeName, 'appWillOpenUrl', [url]); -}; - -ChabokPush.prototype.getUserAttributes = function (success, error) { - exec(success, error, bridgeName, 'getUserAttributes', []); -}; - -ChabokPush.prototype.setUserAttributes = function (userInfo) { - exec(function () { - }, function () { - }, bridgeName, 'setUserAttributes', [userInfo]); -}; - -ChabokPush.prototype.getUserInfo = function (success, error) { - exec(success, error, bridgeName, 'getUserAttributes', []); -}; - -ChabokPush.prototype.setUserInfo = function (userInfo) { - exec(function () { - }, function () { - }, bridgeName, 'setUserAttributes', [userInfo]); -}; - -ChabokPush.prototype.setDefaultTracker = function (trackerName) { - exec(function () { - }, function () { - }, bridgeName, 'setDefaultTracker', [trackerName]); -}; - -ChabokPush.prototype.track = function (trackName, data) { - exec(function () { - }, function () { - }, bridgeName, 'track', [trackName, data]); -}; - -ChabokPush.prototype.resetBadge = function () { - exec(function () { - }, function () { - }, bridgeName, 'resetBadge', []); -}; - -ChabokPush.prototype.publish = function (message, success, error) { - exec(success, error, bridgeName, 'publish', [message]); -}; - -ChabokPush.prototype.getUserId = function (success, error) { - exec(success, error, bridgeName, 'getUserId', []); -}; - -ChabokPush.prototype.getInstallationId = function (success, error) { - exec(success, error, bridgeName, 'getInstallationId', []); -}; - -ChabokPush.prototype.setOnMessageCallback = function (oneMessage) { - exec(oneMessage, function () {}, bridgeName, 'setOnMessageCallback', []); -}; - -ChabokPush.prototype.setOnConnectionStatusCallback = function (onConnection) { - exec(onConnection, function () {}, bridgeName, 'setOnConnectionStatusCallback', []); -}; - - -//------------------------------------------------------------------- - -if(!window.plugins) - window.plugins = {}; - -if (!window.plugins.OneSignal) - window.plugins.ChabokPush = new ChabokPush(); - -if (typeof module != 'undefined' && module.exports) - module.exports = ChabokPush; diff --git a/chabok-starter-cordova/node_modules/compare-func/README.md b/chabok-starter-cordova/node_modules/compare-func/README.md deleted file mode 100644 index a823301..0000000 --- a/chabok-starter-cordova/node_modules/compare-func/README.md +++ /dev/null @@ -1,70 +0,0 @@ -# [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage Status][coveralls-image]][coveralls-url] - -> Get a compare function for array to sort - - -## Install - -```sh -$ npm install --save compare-func -``` - - -## Usage - -```js -var compareFunc = require('compare-func'); - -// sort by an object property -[{x: 'b'}, {x: 'a'}, {x: 'c'}].sort(compareFunc('x')); -//=> [{x: 'a'}, {x: 'b'}, {x: 'c'}] - -// sort by a nested object property -[{x: {y: 'b'}}, {x: {y: 'a'}}].sort(compareFunc('x.y')); -//=> [{x: {y: 'a'}}, {x: {y: 'b'}}] - -// sort by the `x` propery, then `y` -[{x: 'c', y: 'c'}, {x: 'b', y: 'a'}, {x: 'b', y: 'b'}].sort(compareFunc(['x', 'y'])); -//=> [{x: 'b', y: 'a'}, {x: 'b', y: 'b'}, {x: 'c', y: 'c'}] - -// sort by the returned value -[{x: 'b'}, {x: 'a'}, {x: 'c'}].sort(compareFunc(function(el) { - return el.x; -})); -//=> [{x: 'a'}, {x: 'b'}, {x: 'c'}] -``` - - -## API - -### compareFunc([property]) - -Returns a compare function for array to sort - -#### property - -Type: `string`, `function` or `array` of either - -If missing it sorts on itself. - -The string can be a [dot path](https://github.com/sindresorhus/dot-prop) to a nested object property. - - -## Related - -- [sort-on](https://github.com/sindresorhus/sort-on) - Sort an array on an object property - - -## License - -MIT © [Steve Mao](https://github.com/stevemao) - - -[npm-image]: https://badge.fury.io/js/compare-func.svg -[npm-url]: https://npmjs.org/package/compare-func -[travis-image]: https://travis-ci.org/stevemao/compare-func.svg?branch=master -[travis-url]: https://travis-ci.org/stevemao/compare-func -[daviddm-image]: https://david-dm.org/stevemao/compare-func.svg?theme=shields.io -[daviddm-url]: https://david-dm.org/stevemao/compare-func -[coveralls-image]: https://coveralls.io/repos/stevemao/compare-func/badge.svg -[coveralls-url]: https://coveralls.io/r/stevemao/compare-func diff --git a/chabok-starter-cordova/node_modules/compare-func/index.js b/chabok-starter-cordova/node_modules/compare-func/index.js deleted file mode 100644 index 87a7a10..0000000 --- a/chabok-starter-cordova/node_modules/compare-func/index.js +++ /dev/null @@ -1,42 +0,0 @@ -'use strict'; -var arrayify = require('array-ify'); -var dotPropGet = require('dot-prop').get; - -function compareFunc(prop) { - return function(a, b) { - var ret = 0; - - arrayify(prop).some(function(el) { - var x; - var y; - - if (typeof el === 'function') { - x = el(a); - y = el(b); - } else if (typeof el === 'string') { - x = dotPropGet(a, el); - y = dotPropGet(b, el); - } else { - x = a; - y = b; - } - - if (x === y) { - ret = 0; - return; - } - - if (typeof x === 'string' && typeof y === 'string') { - ret = x.localeCompare(y); - return ret !== 0; - } - - ret = x < y ? -1 : 1; - return true; - }); - - return ret; - }; -} - -module.exports = compareFunc; diff --git a/chabok-starter-cordova/node_modules/compare-func/package.json b/chabok-starter-cordova/node_modules/compare-func/package.json deleted file mode 100644 index f8b0d57..0000000 --- a/chabok-starter-cordova/node_modules/compare-func/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "_from": "compare-func@^1.3.2", - "_id": "compare-func@1.3.2", - "_inBundle": false, - "_integrity": "sha1-md0LpFfh+bxyKxLAjsM+6rMfpkg=", - "_location": "/compare-func", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "compare-func@^1.3.2", - "name": "compare-func", - "escapedName": "compare-func", - "rawSpec": "^1.3.2", - "saveSpec": null, - "fetchSpec": "^1.3.2" - }, - "_requiredBy": [ - "/cordova-android" - ], - "_resolved": "https://registry.npmjs.org/compare-func/-/compare-func-1.3.2.tgz", - "_shasum": "99dd0ba457e1f9bc722b12c08ec33eeab31fa648", - "_spec": "compare-func@^1.3.2", - "_where": "/Users/farbod/Documents/Github/chabok/chabok-starter-cordova/chabok-starter-cordova/node_modules/cordova-android", - "author": { - "name": "Steve Mao", - "email": "maochenyan@gmail.com", - "url": "https://github.com/stevemao" - }, - "bugs": { - "url": "https://github.com/stevemao/compare-func/issues" - }, - "bundleDependencies": false, - "dependencies": { - "array-ify": "^1.0.0", - "dot-prop": "^3.0.0" - }, - "deprecated": false, - "description": "Get a compare function for array to sort", - "devDependencies": { - "coveralls": "^2.11.2", - "istanbul": "^0.4.4", - "jscs": "^3.0.5", - "jshint": "^2.7.0", - "mocha": "*" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/stevemao/compare-func", - "keywords": [ - "compare-func", - "arr", - "array", - "by", - "compare", - "dot", - "get", - "obj", - "object", - "prop", - "property", - "sort", - "sorting" - ], - "license": "MIT", - "name": "compare-func", - "repository": { - "type": "git", - "url": "git+https://github.com/stevemao/compare-func.git" - }, - "scripts": { - "coverage": "istanbul cover _mocha -- -R spec && rm -rf ./coverage", - "lint": "jshint *.js --exclude node_modules && jscs *.js", - "test": "npm run-script lint && mocha" - }, - "version": "1.3.2" -} diff --git a/chabok-starter-cordova/node_modules/concat-map/.travis.yml b/chabok-starter-cordova/node_modules/concat-map/.travis.yml deleted file mode 100644 index f1d0f13..0000000 --- a/chabok-starter-cordova/node_modules/concat-map/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.4 - - 0.6 diff --git a/chabok-starter-cordova/node_modules/concat-map/LICENSE b/chabok-starter-cordova/node_modules/concat-map/LICENSE deleted file mode 100644 index ee27ba4..0000000 --- a/chabok-starter-cordova/node_modules/concat-map/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -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. diff --git a/chabok-starter-cordova/node_modules/concat-map/README.markdown b/chabok-starter-cordova/node_modules/concat-map/README.markdown deleted file mode 100644 index 408f70a..0000000 --- a/chabok-starter-cordova/node_modules/concat-map/README.markdown +++ /dev/null @@ -1,62 +0,0 @@ -concat-map -========== - -Concatenative mapdashery. - -[![browser support](http://ci.testling.com/substack/node-concat-map.png)](http://ci.testling.com/substack/node-concat-map) - -[![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map) - -example -======= - -``` js -var concatMap = require('concat-map'); -var xs = [ 1, 2, 3, 4, 5, 6 ]; -var ys = concatMap(xs, function (x) { - return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; -}); -console.dir(ys); -``` - -*** - -``` -[ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ] -``` - -methods -======= - -``` js -var concatMap = require('concat-map') -``` - -concatMap(xs, fn) ------------------ - -Return an array of concatenated elements by calling `fn(x, i)` for each element -`x` and each index `i` in the array `xs`. - -When `fn(x, i)` returns an array, its result will be concatenated with the -result array. If `fn(x, i)` returns anything else, that value will be pushed -onto the end of the result array. - -install -======= - -With [npm](http://npmjs.org) do: - -``` -npm install concat-map -``` - -license -======= - -MIT - -notes -===== - -This module was written while sitting high above the ground in a tree. diff --git a/chabok-starter-cordova/node_modules/concat-map/example/map.js b/chabok-starter-cordova/node_modules/concat-map/example/map.js deleted file mode 100644 index 3365621..0000000 --- a/chabok-starter-cordova/node_modules/concat-map/example/map.js +++ /dev/null @@ -1,6 +0,0 @@ -var concatMap = require('../'); -var xs = [ 1, 2, 3, 4, 5, 6 ]; -var ys = concatMap(xs, function (x) { - return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; -}); -console.dir(ys); diff --git a/chabok-starter-cordova/node_modules/concat-map/index.js b/chabok-starter-cordova/node_modules/concat-map/index.js deleted file mode 100644 index b29a781..0000000 --- a/chabok-starter-cordova/node_modules/concat-map/index.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = function (xs, fn) { - var res = []; - for (var i = 0; i < xs.length; i++) { - var x = fn(xs[i], i); - if (isArray(x)) res.push.apply(res, x); - else res.push(x); - } - return res; -}; - -var isArray = Array.isArray || function (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; diff --git a/chabok-starter-cordova/node_modules/concat-map/package.json b/chabok-starter-cordova/node_modules/concat-map/package.json deleted file mode 100644 index 5ebf821..0000000 --- a/chabok-starter-cordova/node_modules/concat-map/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "_from": "concat-map@0.0.1", - "_id": "concat-map@0.0.1", - "_inBundle": false, - "_integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "_location": "/concat-map", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "concat-map@0.0.1", - "name": "concat-map", - "escapedName": "concat-map", - "rawSpec": "0.0.1", - "saveSpec": null, - "fetchSpec": "0.0.1" - }, - "_requiredBy": [ - "/brace-expansion" - ], - "_resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "_shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", - "_spec": "concat-map@0.0.1", - "_where": "/Users/farbod/Documents/Github/chabok/chabok-starter-cordova/chabok-starter-cordova/node_modules/brace-expansion", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bugs": { - "url": "https://github.com/substack/node-concat-map/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "concatenative mapdashery", - "devDependencies": { - "tape": "~2.4.0" - }, - "directories": { - "example": "example", - "test": "test" - }, - "homepage": "https://github.com/substack/node-concat-map#readme", - "keywords": [ - "concat", - "concatMap", - "map", - "functional", - "higher-order" - ], - "license": "MIT", - "main": "index.js", - "name": "concat-map", - "repository": { - "type": "git", - "url": "git://github.com/substack/node-concat-map.git" - }, - "scripts": { - "test": "tape test/*.js" - }, - "testling": { - "files": "test/*.js", - "browsers": { - "ie": [ - 6, - 7, - 8, - 9 - ], - "ff": [ - 3.5, - 10, - 15 - ], - "chrome": [ - 10, - 22 - ], - "safari": [ - 5.1 - ], - "opera": [ - 12 - ] - } - }, - "version": "0.0.1" -} diff --git a/chabok-starter-cordova/node_modules/concat-map/test/map.js b/chabok-starter-cordova/node_modules/concat-map/test/map.js deleted file mode 100644 index fdbd702..0000000 --- a/chabok-starter-cordova/node_modules/concat-map/test/map.js +++ /dev/null @@ -1,39 +0,0 @@ -var concatMap = require('../'); -var test = require('tape'); - -test('empty or not', function (t) { - var xs = [ 1, 2, 3, 4, 5, 6 ]; - var ixes = []; - var ys = concatMap(xs, function (x, ix) { - ixes.push(ix); - return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; - }); - t.same(ys, [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]); - t.same(ixes, [ 0, 1, 2, 3, 4, 5 ]); - t.end(); -}); - -test('always something', function (t) { - var xs = [ 'a', 'b', 'c', 'd' ]; - var ys = concatMap(xs, function (x) { - return x === 'b' ? [ 'B', 'B', 'B' ] : [ x ]; - }); - t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); - t.end(); -}); - -test('scalars', function (t) { - var xs = [ 'a', 'b', 'c', 'd' ]; - var ys = concatMap(xs, function (x) { - return x === 'b' ? [ 'B', 'B', 'B' ] : x; - }); - t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); - t.end(); -}); - -test('undefs', function (t) { - var xs = [ 'a', 'b', 'c', 'd' ]; - var ys = concatMap(xs, function () {}); - t.same(ys, [ undefined, undefined, undefined, undefined ]); - t.end(); -}); diff --git a/chabok-starter-cordova/node_modules/cordova-android/.eslintignore b/chabok-starter-cordova/node_modules/cordova-android/.eslintignore deleted file mode 100644 index 0d61c6c..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -bin/templates/project/assets/www/cordova.js -test/app diff --git a/chabok-starter-cordova/node_modules/cordova-android/.eslintrc.yml b/chabok-starter-cordova/node_modules/cordova-android/.eslintrc.yml deleted file mode 100644 index f6aae32..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/.eslintrc.yml +++ /dev/null @@ -1,10 +0,0 @@ -root: true -extends: semistandard -rules: - indent: - - error - - 4 - camelcase: off - padded-blocks: off - operator-linebreak: off - no-throw-literal: off diff --git a/chabok-starter-cordova/node_modules/cordova-android/.gitattributes b/chabok-starter-cordova/node_modules/cordova-android/.gitattributes deleted file mode 100644 index f63e59a..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/.gitattributes +++ /dev/null @@ -1,94 +0,0 @@ -* text eol=lf - -# source code -*.php text -*.css text -*.sass text -*.scss text -*.less text -*.styl text -*.js text -*.coffee text -*.json text -*.htm text -*.html text -*.xml text -*.svg text -*.txt text -*.ini text -*.inc text -*.pl text -*.rb text -*.py text -*.scm text -*.sql text -*.sh text -*.bat text - -# templates -*.ejs text -*.hbt text -*.jade text -*.haml text -*.hbs text -*.dot text -*.tmpl text -*.phtml text - -# server config -.htaccess text - -# git config -.gitattributes text -.gitignore text -.gitconfig text - -# code analysis config -.jshintrc text -.jscsrc text -.jshintignore text -.csslintrc text - -# misc config -*.yaml text -*.yml text -.editorconfig text - -# build config -*.npmignore text -*.bowerrc text - -# Heroku -Procfile text -.slugignore text - -# Documentation -*.md text -LICENSE text -AUTHORS text - - -# -## These files are binary and should be left untouched -# - -# (binary is a macro for -text -diff) -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.mov binary -*.mp4 binary -*.mp3 binary -*.flv binary -*.fla binary -*.swf binary -*.gz binary -*.zip binary -*.7z binary -*.ttf binary -*.eot binary -*.woff binary -*.pyc binary -*.pdf binary diff --git a/chabok-starter-cordova/node_modules/cordova-android/.github/ISSUE_TEMPLATE.md b/chabok-starter-cordova/node_modules/cordova-android/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 3220c25..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,42 +0,0 @@ - - -### Issue Type - - -- [ ] Bug Report -- [ ] Feature Request -- [ ] Support Question - -## Description - -## Information - - -### Command or Code - - -### Environment, Platform, Device - - - - -### Version information - - - - -## Checklist - - -- [ ] I searched for already existing GitHub issues about this -- [ ] I updated all Cordova tooling to their most recent version -- [ ] I included all the necessary information above diff --git a/chabok-starter-cordova/node_modules/cordova-android/.github/ISSUE_TEMPLATE/BUG_REPORT.md b/chabok-starter-cordova/node_modules/cordova-android/.github/ISSUE_TEMPLATE/BUG_REPORT.md deleted file mode 100644 index bd8a3ac..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/.github/ISSUE_TEMPLATE/BUG_REPORT.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -name: 🐛 Bug Report -about: If something isn't working as expected. - ---- - -# Bug Report - -## Problem - -### What is expected to happen? - - - -### What does actually happen? - - - -## Information - - - - -### Command or Code - - - - -### Environment, Platform, Device - - - - -### Version information - - - - -## Checklist - - -- [ ] I searched for existing GitHub issues -- [ ] I updated all Cordova tooling to most recent version -- [ ] I included all the necessary information above diff --git a/chabok-starter-cordova/node_modules/cordova-android/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md b/chabok-starter-cordova/node_modules/cordova-android/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md deleted file mode 100644 index 381fc8a..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -name: 🚀 Feature Request -about: A suggestion for a new functionality - ---- - -# Feature Request - -## Motivation Behind Feature - - - - -## Feature Description - - - - -## Alternatives or Workarounds - - - diff --git a/chabok-starter-cordova/node_modules/cordova-android/.github/ISSUE_TEMPLATE/SUPPORT_QUESTION.md b/chabok-starter-cordova/node_modules/cordova-android/.github/ISSUE_TEMPLATE/SUPPORT_QUESTION.md deleted file mode 100644 index 516c6e6..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/.github/ISSUE_TEMPLATE/SUPPORT_QUESTION.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -name: 💬 Support Question -about: If you have a question, please check out our Slack or StackOverflow! - ---- - - - -Apache Cordova uses GitHub Issues as a feature request and bug tracker _only_. -For usage and support questions, please check out the resources below. Thanks! - ---- - -You can get answers to your usage and support questions about **Apache Cordova** on: - -* Slack Community Chat: https://cordova.slack.com (you can sign-up at http://slack.cordova.io/) -* StackOverflow: https://stackoverflow.com/questions/tagged/cordova using the tag `cordova` - ---- - -If you are using a tool that uses Cordova internally, like e.g. Ionic, check their support channels: - -* **Ionic Framework** - * [Ionic Community Forum](https://forum.ionicframework.com/) - * [Ionic Worldwide Slack](https://ionicworldwide.herokuapp.com/) -* **PhoneGap** - * [PhoneGap Developer Community](https://forums.adobe.com/community/phonegap) diff --git a/chabok-starter-cordova/node_modules/cordova-android/.github/PULL_REQUEST_TEMPLATE.md b/chabok-starter-cordova/node_modules/cordova-android/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 712b2ff..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,35 +0,0 @@ - - -### Platforms affected - - - -### Motivation and Context - - - - - -### Description - - - - -### Testing - - - - -### Checklist - -- [ ] I've run the tests to see all new and existing tests pass -- [ ] I added automated test coverage as appropriate for this change -- [ ] Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`) -- [ ] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/)) -- [ ] I've updated the documentation if necessary diff --git a/chabok-starter-cordova/node_modules/cordova-android/.ratignore b/chabok-starter-cordova/node_modules/cordova-android/.ratignore deleted file mode 100644 index 74a80f2..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/.ratignore +++ /dev/null @@ -1,9 +0,0 @@ -*.properties -bin -gen -proguard-project.txt -spec -appveyor.yml -framework/build -ic_launcher.png -build diff --git a/chabok-starter-cordova/node_modules/cordova-android/.reviewboardrc b/chabok-starter-cordova/node_modules/cordova-android/.reviewboardrc deleted file mode 100644 index 30e9587..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/.reviewboardrc +++ /dev/null @@ -1,8 +0,0 @@ -# -# Settings for post-review (used for uploading diffs to reviews.apache.org). -# -GUESS_FIELDS = True -OPEN_BROWSER = True -TARGET_GROUPS = 'cordova' -REVIEWBOARD_URL = 'http://reviews.apache.org' - diff --git a/chabok-starter-cordova/node_modules/cordova-android/.travis.yml b/chabok-starter-cordova/node_modules/cordova-android/.travis.yml deleted file mode 100644 index 0fb2354..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/.travis.yml +++ /dev/null @@ -1,48 +0,0 @@ -sudo: false - -# NOTE: dist is added here to ensure that Travis CI works consistently -# on Node.js 12. It is desired to remove it once this issue is resolved -# or otherwise goes away. -dist: trusty - -env: - global: - - ANDROID_API_LEVEL=28 - - ANDROID_BUILD_TOOLS_VERSION=28.0.3 - - TERM=dumb # Keep gradle from crapping all over the log - matrix: - - nodejs_version=6 - - nodejs_version=8 - - nodejs_version=10 - - nodejs_version=12 - -language: android -jdk: - - oraclejdk8 - -android: - components: - - tools - - build-tools-$ANDROID_BUILD_TOOLS_VERSION - - android-$ANDROID_API_LEVEL - licenses: - - 'android-sdk-preview-license-.+' - - 'android-sdk-license-.+' - - 'google-gdk-license-.+' - -before_install: - - nvm install $nodejs_version - - node --version - - npm --version - - gradle --version - -install: - - npm install - - npm install -g codecov - -script: - - npm test - - npm run cover - -after_script: - - codecov diff --git a/chabok-starter-cordova/node_modules/cordova-android/CONTRIBUTING.md b/chabok-starter-cordova/node_modules/cordova-android/CONTRIBUTING.md deleted file mode 100644 index 9a4461b..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/CONTRIBUTING.md +++ /dev/null @@ -1,37 +0,0 @@ - - -# Contributing to Apache Cordova - -Anyone can contribute to Cordova. And we need your contributions. - -There are multiple ways to contribute: report bugs, improve the docs, and -contribute code. - -For instructions on this, start with the -[contribution overview](http://cordova.apache.org/contribute/). - -The details are explained there, but the important items are: - - Have a Jira issue open that corresponds to your contribution. - - Run the tests so your patch doesn't break existing functionality. - -We look forward to your contributions! - diff --git a/chabok-starter-cordova/node_modules/cordova-android/LICENSE b/chabok-starter-cordova/node_modules/cordova-android/LICENSE deleted file mode 100644 index c47288d..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/LICENSE +++ /dev/null @@ -1,314 +0,0 @@ - - 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 2015 Apache Cordova - - 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. - - ADDITIONAL LICENSES: - -================================================================================ -bin/node_modules/q -================================================================================ - -Copyright 2009–2012 Kristopher Michael Kowal. All rights reserved. -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. - -================================================================================ -bin/node_modules/shelljs -================================================================================ -Copyright (c) 2012, Artur Adib -All rights reserved. - -You may use this project under the terms of the New BSD license as follows: - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of Artur Adib nor the - names of the contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL ARTUR ADIB BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -================================================================================ -bin/node_modules/nopt -================================================================================ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -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. - -================================================================================ -bin/node_modules/which -================================================================================ - -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -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. - - diff --git a/chabok-starter-cordova/node_modules/cordova-android/NOTICE b/chabok-starter-cordova/node_modules/cordova-android/NOTICE deleted file mode 100644 index 788ab0b..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/NOTICE +++ /dev/null @@ -1,15 +0,0 @@ -Apache Cordova -Copyright 2015 The Apache Software Foundation - -This product includes software developed at -The Apache Software Foundation (http://www.apache.org) - -========================================================================= -== NOTICE file corresponding to the section 4 d of == -== the Apache License, Version 2.0, == -== in this case for the Android-specific code. == -========================================================================= - -This product includes software developed as part of -The Android Open Source Project (http://source.android.com). - diff --git a/chabok-starter-cordova/node_modules/cordova-android/README.md b/chabok-starter-cordova/node_modules/cordova-android/README.md deleted file mode 100644 index a54f2f6..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/README.md +++ /dev/null @@ -1,67 +0,0 @@ - - -[![Build status](https://ci.appveyor.com/api/projects/status/github/apache/cordova-android?branch=master)](https://ci.appveyor.com/project/Humbedooh/cordova-android) -[![Build Status](https://travis-ci.org/apache/cordova-android.svg?branch=master)](https://travis-ci.org/apache/cordova-android) -[![codecov.io](https://codecov.io/github/apache/cordova-android/coverage.svg?branch=master)](https://codecov.io/github/apache/cordova-android?branch=master) - -# Cordova Android - -Cordova Android is an Android application library that allows for Cordova-based -projects to be built for the Android Platform. Cordova based applications are, -at the core, applications written with web technology: HTML, CSS and JavaScript. - -[Apache Cordova](https://cordova.apache.org) is a project of The Apache Software Foundation (ASF). - -## Requires - -- Java JDK 1.8 or greater -- Android SDK [http://developer.android.com](http://developer.android.com) - - -## Cordova Android Developer Tools - -We recommend using the [Cordova command-line tool](https://www.npmjs.com/package/cordova) to create projects and be able to easily install plugins. - -However, the following scripts can be used instead: - - ./bin/create [path package activity] ... creates the ./example app or a cordova android project - ./bin/check_reqs ....................... checks that your environment is set up for cordova-android development - ./bin/update [path] .................... updates an existing cordova-android project to the version of the framework - -These commands live in a generated Cordova Android project. Any interactions with the emulator require you to have an AVD defined. - - ./cordova/clean ........................ cleans the project - ./cordova/build ........................ calls `clean` then compiles the project - ./cordova/log ........................ streams device or emulator logs to STDOUT - ./cordova/run ........................ calls `build` then deploys to a connected Android device. If no Android device is detected, will launch an emulator and deploy to it. - ./cordova/version ...................... returns the cordova-android version of the current project - -## Using Android Studio - -1. Create a project -2. Import it via "Non-Android Studio Project" - -## Running the Native Tests - -The `test/` directory in this project contains an Android test project that can -be used to run different kinds of native tests. Check out the -[README contained therein](test/README.md) for more details! diff --git a/chabok-starter-cordova/node_modules/cordova-android/RELEASENOTES.md b/chabok-starter-cordova/node_modules/cordova-android/RELEASENOTES.md deleted file mode 100644 index 285310b..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/RELEASENOTES.md +++ /dev/null @@ -1,775 +0,0 @@ - -## Release Notes for Cordova (Android) ## - -### 8.1.0 (Sep 11, 2019) - -* [GH-827](https://github.com/apache/cordova-android/pull/827) chore: bump dependencies for release 8.1.0 -* [GH-651](https://github.com/apache/cordova-android/pull/651) feat: added multiple selection for filepicker -* [GH-672](https://github.com/apache/cordova-android/pull/672) chore: compress files in /res with tinypng.com -* [GH-815](https://github.com/apache/cordova-android/pull/815) fix: `clean` command -* [GH-750](https://github.com/apache/cordova-android/pull/750) Don't request focus explicitly if not needed -* [GH-800](https://github.com/apache/cordova-android/pull/800) [GH-799](https://github.com/apache/cordova-android/pull/799) (android) Stop webview from restarting when activity resizes -* [GH-764](https://github.com/apache/cordova-android/pull/764) feat: Build app bundles (.aab files) -* [GH-788](https://github.com/apache/cordova-android/pull/788) Simplify `apkSorter` using `compare-func` package -* [GH-787](https://github.com/apache/cordova-android/pull/787) Simplify and fix promise handling in specs -* [GH-784](https://github.com/apache/cordova-android/pull/784) Properly handle promise in create script -* [GH-783](https://github.com/apache/cordova-android/pull/783) Do not clobber process properties with test mocks -* [GH-782](https://github.com/apache/cordova-android/pull/782) Do not clobber `console.log` to spy on it -* [GH-724](https://github.com/apache/cordova-android/pull/724) Add Node.js 12 to CI Services -* [GH-777](https://github.com/apache/cordova-android/pull/777) ci(travis): set `dist: trusty` in `.travis.yml` -* [GH-779](https://github.com/apache/cordova-android/pull/779) Consistent order from `ProjectBuilder.apkSorter` -* [GH-778](https://github.com/apache/cordova-android/pull/778) test: use verbose spec reporter -* [GH-774](https://github.com/apache/cordova-android/pull/774) `rewire` workaround for NodeJS 12 -* [GH-772](https://github.com/apache/cordova-android/pull/772) `nyc@14` update in devDependencies -* [GH-765](https://github.com/apache/cordova-android/pull/765) ci(travis): Fix **Android** SDK -* [GH-713](https://github.com/apache/cordova-android/pull/713) Do not explicitly require modules from project directory -* [GH-676](https://github.com/apache/cordova-android/pull/676) Added allprojects repositories for Framework Release Builds -* [GH-699](https://github.com/apache/cordova-android/pull/699) Improve Gradle Build Arguments -* [GH-710](https://github.com/apache/cordova-android/pull/710) Fix deprecation warning in `SystemCookieManager` -* [GH-691](https://github.com/apache/cordova-android/pull/691) [GH-690](https://github.com/apache/cordova-android/pull/690): Run `prepare` with the correct `ConfigParser` -* [GH-673](https://github.com/apache/cordova-android/pull/673) Updated `Android_HOME` Test to Follow [GH-656](https://github.com/apache/cordova-android/pull/656) Change - -### 8.0.0 (Feb 13, 2019) -* [GH-669](https://github.com/apache/cordova-android/pull/669) Added Missing License Headers -* [GH-655](https://github.com/apache/cordova-android/pull/655) Use custom Gradle properties to read minSdkVersion value from `config.xml` -* [GH-656](https://github.com/apache/cordova-android/pull/656) Quick fix to support **Android**_SDK_ROOT -* [GH-632](https://github.com/apache/cordova-android/pull/632) Ignore more Gradle build artifacts in **Android** project -* [GH-642](https://github.com/apache/cordova-android/pull/642) **Android** tools 3.3 & **Gradle** 4.10.3 update -* [GH-654](https://github.com/apache/cordova-android/pull/654) Quick updates to top-level `project.properties` -* [GH-635](https://github.com/apache/cordova-android/pull/635) Ignore **Android** Studio `.idea` files in project -* [GH-624](https://github.com/apache/cordova-android/pull/624) Add missing log to Java version check -* [GH-630](https://github.com/apache/cordova-android/pull/630) Update `emulator.js` to fix issue [GH-608](https://github.com/apache/cordova-android/pull/608) -* [GH-626](https://github.com/apache/cordova-android/pull/626) Added `package-lock.json` to `.gitignore` -* [GH-620](https://github.com/apache/cordova-android/pull/620) Fix requirements error messages for JDK 8 -* [GH-619](https://github.com/apache/cordova-android/pull/619) javac error message fixes in requirements check -* [GH-612](https://github.com/apache/cordova-android/pull/612) Android Platform Release Preparation (Cordova 9) -* [GH-607](https://github.com/apache/cordova-android/pull/607) Copy `node_modules` if the directory exists -* [GH-582](https://github.com/apache/cordova-android/pull/582) Improve Test `README` -* [GH-589](https://github.com/apache/cordova-android/pull/589) Rewrite install dir resolution for legacy plugins -* [GH-572](https://github.com/apache/cordova-android/pull/572) Resolve issue with plugin `target-dir="app*"` subdirs -* [GH-567](https://github.com/apache/cordova-android/pull/567) Output current package name if package name can't be validated -* [GH-507](https://github.com/apache/cordova-android/pull/507) Gradle Updates -* [GH-559](https://github.com/apache/cordova-android/pull/559) Eslint ignore version file -* [GH-550](https://github.com/apache/cordova-android/pull/550) Fix for old plugins with non-Java sources -* [GH-558](https://github.com/apache/cordova-android/pull/558) Update `cordova.js` from `cordova-js@4.2.3` -* [GH-553](https://github.com/apache/cordova-android/pull/553) Check for `build-extras.gradle` in the app-parent directory -* [GH-551](https://github.com/apache/cordova-android/pull/551) Add missing cast for `cdvMinSdkVersion` -* [GH-539](https://github.com/apache/cordova-android/pull/539) Fix destination path fallback -* [GH-544](https://github.com/apache/cordova-android/pull/544) Remove obsolete check for JellyBean -* [GH-465](https://github.com/apache/cordova-android/pull/465) Removes Gradle property in-line command arguments for `gradle.properties` -* [GH-523](https://github.com/apache/cordova-android/pull/523) Always put the Google repo above jcenter -* [GH-486](https://github.com/apache/cordova-android/pull/486) Change deprecated "compile" to "implementation" -* [GH-495](https://github.com/apache/cordova-android/pull/495) Incorrect default sdk version issue fix -* [GH-493](https://github.com/apache/cordova-android/pull/493) Remove bundled dependencies -* [GH-490](https://github.com/apache/cordova-android/pull/490) Fixes build & run related bugs from builder refactor -* [GH-464](https://github.com/apache/cordova-android/pull/464) Unit tests for **Android**_sdk and **Android**Project -* [GH-448](https://github.com/apache/cordova-android/pull/448) [CB-13685](https://issues.apache.org/jira/browse/CB-13685) Adaptive Icon Support -* [GH-487](https://github.com/apache/cordova-android/pull/487) Do not attempt an activity intent AND a url load into the webview, return from the internal webview load. -* [GH-461](https://github.com/apache/cordova-android/pull/461) Remove old builders code -* [GH-463](https://github.com/apache/cordova-android/pull/463) Emulator: Add unit tests and remove Q -* [GH-462](https://github.com/apache/cordova-android/pull/462) Device: Add unit tests and remove Q -* [GH-457](https://github.com/apache/cordova-android/pull/457) Emulator: handle "device still connecting" error -* [GH-445](https://github.com/apache/cordova-android/pull/445) Run and retryPromise improvements and tests -* [GH-453](https://github.com/apache/cordova-android/pull/453) Lint JS files w/out extension too -* [GH-452](https://github.com/apache/cordova-android/pull/452) Emit log event instead of logging directly -* [GH-449](https://github.com/apache/cordova-android/pull/449) Increase old plugin compatibility -* [GH-442](https://github.com/apache/cordova-android/pull/442) Fixes and cleanup for Java tests and CI -* [GH-446](https://github.com/apache/cordova-android/pull/446) [CB-14101](https://issues.apache.org/jira/browse/CB-14101) Fix Java version check for Java >= 9 -* [CB-14127](https://issues.apache.org/jira/browse/CB-14127) Move google maven repo ahead of jcenter -* [CB-14038](https://issues.apache.org/jira/browse/CB-14038) Fix false positive detecting project type -* [CB-14008](https://issues.apache.org/jira/browse/CB-14008) Updating Gradle Libraries to work with **Android** Studio 3.1.0 -* [CB-13975](https://issues.apache.org/jira/browse/CB-13975) Fix to fire pause event when cdvStartInBackground=true -* [CB-13830](https://issues.apache.org/jira/browse/CB-13830) Add handlers for plugins that use non-Java source files, such as Camera -* [CB-13923](https://issues.apache.org/jira/browse/CB-13923) Fix -1 length for compressed files - -### 7.1.0 (Feb 20, 2018) -* [CB-13879](https://issues.apache.org/jira/browse/CB-13879) updated gradle tools dependency to 3.0.1 for project template -* [CB-13831](https://issues.apache.org/jira/browse/CB-13831) Update `android-versions` to 1.3.0 to support SDK 27. -* [CB-13800](https://issues.apache.org/jira/browse/CB-13800) Drop pre-KitKat specific code -* [CB-13724](https://issues.apache.org/jira/browse/CB-13724) Updated the **Android** Tooling required for the latest version on both the test project, and the template -* [CB-13724](https://issues.apache.org/jira/browse/CB-13724) Bump Target SDK to API 27 -* [CB-13646](https://issues.apache.org/jira/browse/CB-13646) Using the deprecated `NDK` by default breaks the build. Crosswalk users need to specify the Gradle parameters to keep it working. -* [CB-12218](https://issues.apache.org/jira/browse/CB-12218) Fix consistency of null result message -* [CB-13571](https://issues.apache.org/jira/browse/CB-13571) Prevent crash with unrecognized **Android** version -* [CB-13721](https://issues.apache.org/jira/browse/CB-13721) Fix build apps that use `cdvHelpers.getConfigPreference` -* [CB-13621](https://issues.apache.org/jira/browse/CB-13621) Wrote similar warning to [CB-12948](https://issues.apache.org/jira/browse/CB-12948) on **iOS**. We no longer support `cordova update` command. - -### 7.0.0 (Nov 30, 2017) -* [CB-13612](https://issues.apache.org/jira/browse/CB-13612) Fix the remapper so that XML files copy over and the Camera works again. -* [CB-13741](https://issues.apache.org/jira/browse/CB-13741) Bump `package.json` so we can install plugins -* [CB-13610](https://issues.apache.org/jira/browse/CB-13610) Compress the default app assets -* [CB-12835](https://issues.apache.org/jira/browse/CB-12835) add a Context getter in CordovaInterface -* [CB-8976](https://issues.apache.org/jira/browse/CB-8976) Added the `cdvVersionCodeForceAbiDigit` flag to the template build.gradle that appends 0 to the versionCode when `cdvBuildMultipleApks` is not set -* [CB-12291](https://issues.apache.org/jira/browse/CB-12291) (android) Add x86_64, arm64 and armeabi architecture flavors -* [CB-13602](https://issues.apache.org/jira/browse/CB-13602) We were setting the path wrong, this is hacky but it works -* [CB-13601](https://issues.apache.org/jira/browse/CB-13601) Fixing the standalone run scripts to make sure this works without using the CLI -* [CB-13580](https://issues.apache.org/jira/browse/CB-13580) fix build for multiple apks (different product flavors) -* [CB-13558](https://issues.apache.org/jira/browse/CB-13558) Upgrading the gradle so we can upload the AAR -* [CB-13297](https://issues.apache.org/jira/browse/CB-13297) This just works once you bump the project structure. Java 1.8 compatibility baked-in -* [CB-11244](https://issues.apache.org/jira/browse/CB-11244) **Android** Studio 3 work, things have changed with how the platform is built -* [CB-11244](https://issues.apache.org/jira/browse/CB-11244) Found bug where the gradle subproject changes weren't actually getting written to the correct gradle file -* [CB-13470](https://issues.apache.org/jira/browse/CB-13470) Fix Clean so that it cleans the **Android** Studio structure -* [CB-11244](https://issues.apache.org/jira/browse/CB-11244) Adding specs for resource files inside an **Android** Studio Project -* [CB-11244](https://issues.apache.org/jira/browse/CB-11244) Added remapping for drawables -* [CB-11244](https://issues.apache.org/jira/browse/CB-11244) Found bug in Api.js where xml/strings.xml is used instead of values/strings.xml -* [CB-11244](https://issues.apache.org/jira/browse/CB-11244) Setup Api.js to support multiple builders based on project structure -* [CB-11244](https://issues.apache.org/jira/browse/CB-11244) Changing directory creation, will most likely hide this behind a flag for the next release of `cordova-android`, and then make it default in the next major pending feedback -* Adding the Studio Builder to build a project based on **Android** Studio, and deleting Ant, since Google does not support Ant Builds anymore. Sorry guys! - -### 6.4.0 (Nov 06, 2017) -* [CB-13289](https://issues.apache.org/jira/browse/CB-13289) Fixing build problems with Studio Three, but keeping **Windows** Gradle fix for now, will be deprecated -* [CB-13289](https://issues.apache.org/jira/browse/CB-13289) Fix test to work with new Google **Android** Gradle DSL -* :CB-13501 : update appveyor node versions to support node 8 -* [CB-13499](https://issues.apache.org/jira/browse/CB-13499) Remove duplicate "setting" in error strings -* Include missing values for task.name when 'cdvBuildMultipleApks' option is true, 'task.name' can have 'validateSigningArmv7Release' or 'validateSigningX86Release' values too. -* [CB-13406](https://issues.apache.org/jira/browse/CB-13406) Fixed AVD API level comparison when choosing sub-par API level match. Added tests for the best_image method. -* [CB-13404](https://issues.apache.org/jira/browse/CB-13404) add **Android**-versions to bundledDependencies. Ignore best emulator selection when parsed AVD information does not include API level in the target -* [CB-12895](https://issues.apache.org/jira/browse/CB-12895) : eslint ignoring cordova.js -* [CB-12895](https://issues.apache.org/jira/browse/CB-12895) Temporarily disabling eslint since cordova-js does not have eslint yet. - -### 6.3.0 (Sep 25, 2017) -* [CB-6936](https://issues.apache.org/jira/browse/CB-6936) fix crash when calling methods on a destroyed webview -* [CB-12981](https://issues.apache.org/jira/browse/CB-12981) handle SDK 26.0.2 slightly different AVD list output for **Android** 8+ AVDs. Would cause "cannot read property replace of undefined" errors when trying to deploy an **Android** 8 emulator. -* Updated maven repo to include most recent lib versions -* [CB-13177](https://issues.apache.org/jira/browse/CB-13177) Updating to API Level 26 -* Revert [CB-12015](https://issues.apache.org/jira/browse/CB-12015) initial-scale values less than 1.0 are ignored on **Android** -* [CB-12730](https://issues.apache.org/jira/browse/CB-12730) The Cordova Compatibility Plugin is now integrated into cordova-android -* [CB-12453](https://issues.apache.org/jira/browse/CB-12453) Remove unnecessary double quotes from .bat files which are the causes of crash if project path contains spaces -* [CB-13031](https://issues.apache.org/jira/browse/CB-13031) Fix bug with case-sensitivity of **Android**-packageName -* [CB-10916](https://issues.apache.org/jira/browse/CB-10916) Support display name for **Android** -* [CB-12423](https://issues.apache.org/jira/browse/CB-12423) make explicit JDK 1.8 or greater is needed in the `README`, we require 1.8 for compilation, but do not have 1.8 Java features yet -* [CB-13006](https://issues.apache.org/jira/browse/CB-13006) removed create and update end-to-end tests, and instead added more unit test coverage. tweaked code coverage invocation so that we get coverage details on the create.js module. slight changes to the create.js module so that it is slightly easier to test. -* [CB-12950](https://issues.apache.org/jira/browse/CB-12950) lots of tweaks for end-to-end test runs, especially on CI: - rename npm tasks to reflect what they do (npm run unit-tests, npm run e2e-tests). main `npm test` runs linter, unit tests and e2e tests now. - locked jasmine down to ~2.6.0. - consolidate gitignores. - updated travis to run `npm test`. add **Android** sdk installation to appveyor ci run.align **Android** dpendencies across travis and appveyor. have appveyor install gradle. force gradle to version 3.4.1 in appveyor, as that seems to be the only version choco has. explicitly invoke sdkmanager to move license accepting process along. -* [CB-12605](https://issues.apache.org/jira/browse/CB-12605) In **Windows** get **Android** studio path from the registry -* [CB-12762](https://issues.apache.org/jira/browse/CB-12762) : pointed `package.json` repo items to github mirrors instead of apache repos site -* [CB-12617](https://issues.apache.org/jira/browse/CB-12617) : removed node0.x support for platforms and added engineStrict - -### 6.2.3 (May 2, 2017) -* [CB-12640](https://issues.apache.org/jira/browse/CB-12640) better handling of unrecognized Android SDK commands on **Windows**. -* [CB-12640](https://issues.apache.org/jira/browse/CB-12640) flipped avd parsing logic so that it always tries to use avdmanager to retrieve avds first, then falls back to android command if avdmanager cannot be found (and errors with ENOENT). updated tests - and added explicit tests to ensure to shell out to singular forms of sub-commands when executing `android` -* [CB-12640](https://issues.apache.org/jira/browse/CB-12640) support for android sdk tools 26.0.1. - -### 6.2.2 (Apr 24, 2017) -* [CB-12697](https://issues.apache.org/jira/browse/CB-12697) Updated checked-in `node_modules` - -### 6.2.1 (Apr 02, 2017) -* [CB-12621](https://issues.apache.org/jira/browse/CB-12621) reverted elementtree dep to 0.1.6 - -### 6.2.0 (Mar 28, 2017) -* [CB-12614](https://issues.apache.org/jira/browse/CB-12614) Adding headers to tests -* [CB-8978](https://issues.apache.org/jira/browse/CB-8978) Prepare copy `resource-files` from `config.xml` -* [CB-12605](https://issues.apache.org/jira/browse/CB-12605) Fix a requirements check failure on **Windows** -* [CB-12595](https://issues.apache.org/jira/browse/CB-12595) This should find an **Android Studio** installation and use the sweet gradle center found inside -* [CB-12546](https://issues.apache.org/jira/browse/CB-12546) leverage `avdmanager` if `android` warns it is no longer useful, which happens in **Android SDK Tools 25.3.1**. Explicitly set the `CWD` of the spawned emulator process to workaround a recent google android sdk bug. Rename `android_sdk_version.js` to `android_sdk.js`, to better reflect its contents. Have `create.js` copy over the `android_sdk_version` batch file. -* [CB-12524](https://issues.apache.org/jira/browse/CB-12524) Fix for missing gradle template error. This now fetches the template from inside of the **Android Studio** directory, and falls back to a locally installed Gradle instance -* [CB-12465](https://issues.apache.org/jira/browse/CB-12465) Writing new JUnit Test Instrumentation to replace tests and retire problmatic tests - -### 6.1.2 (Jan 26, 2017) -* **Security** Change to `https` by default -* [CB-12018](https://issues.apache.org/jira/browse/CB-12018): updated tests to work with jasmine (promise matcher tests commented out for now) -* created directories and corresponding images for `xxhdpi` and `xxxhdpi`, both drawables and `mipmaps` - -### 6.1.1 (Jan 03, 2017) -* [CB-12159](https://issues.apache.org/jira/browse/CB-12159) **Android** Keystore password prompt won't show up -* [CB-12169](https://issues.apache.org/jira/browse/CB-12169) Check for build directory before running a clean -* Fixed `AndroidStudio` tests to actually run, removed `app/src/main/assets/` as a requirement and added `app/src/main/res` instead, added placeholder for `build/` folder, Removed dupe `gitignore` - -### 6.1.0 (Nov 02, 2016) -* [CB-12108](https://issues.apache.org/jira/browse/CB-12108) Updating gradle files to work with the latest version of Android Studio -* [CB-12102](https://issues.apache.org/jira/browse/CB-12102) Bump travis to build to API 25 -* Bumping up the version -* [CB-12101](https://issues.apache.org/jira/browse/CB-12101) Fix so that CLI builds don't conflict with Android Studio builds -* [CB-12077](https://issues.apache.org/jira/browse/CB-12077) Fix paths for Android icons/splashscreens -* added framework/build to .ratignore -* Fix for broken testUrl test -* Last minute change of test targets -* Update JS snapshot to version 6.1.0-dev (via coho) -* Set VERSION to 6.1.0-dev (via coho) - -### 6.0.0 (Oct 20, 2016) - -This release adds significant functionality, and also introduces a number -of breaking changes. Some of the changes to the code base will be of -particular interest to third party webview plugin developers. - -#### Major Changes #### -* Primary bridge is the EVAL_BRIDGE, which tells the WebView to execute JS directly. This is more stable than the ONLINE_EVENT bridge -* Full Support for Android Nougat (API 24) -* Ice Cream Sandwich Support has been deprecated. Minimum Supported Android Version is Jellybean (API 16/ Android 4.1) -* Plugin Installation now CLEANS the build directory, this speeds up gradle build times and allows for CLI develoment to be more predictable - -Changes For Third-Party WebView Developers: -* executeJavascript method added and is an abstract method that must be implemented -* the EVAL_BRIDGE must be added to the WebView - - -#### Curated Changes from the Git Commit Logs #### -* Updating the gradle build for test to use the latest -* [CB-11083](https://issues.apache.org/jira/browse/CB-11083) Fixing syncronous file check and future-proofing the JS for Travis -* [CB-11083](https://issues.apache.org/jira/browse/CB-11083) Reading files to check for CordovaLib dependency, if so, we exclude CordovaLib to be safe -* [CB-11083](https://issues.apache.org/jira/browse/CB-11083) Plugin build script for dependencies without a gradle file -* [CB-11083](https://issues.apache.org/jira/browse/CB-11083) The GradleBuidler can tell the difference between a Cordova Plugin Framework and a regular framework based on the name -* [CB-11083](https://issues.apache.org/jira/browse/CB-11083) Fix to deal with custom frameworks with their own Gradle configuration -* [CB-12003](https://issues.apache.org/jira/browse/CB-12003) updated node_modules -* [CB-11771](https://issues.apache.org/jira/browse/CB-11771) Deep symlink directories to target project instead of linking the directory itself -* [CB-11880](https://issues.apache.org/jira/browse/CB-11880) android: Fail-safe for cordova.exec() -* [CB-11999](https://issues.apache.org/jira/browse/CB-11999) add message, catch exception if require fails -* fix issue with app_name containing apostrophes -* [CB-8722](https://issues.apache.org/jira/browse/CB-8722) - Move icons from drawable to mipmap -* [CB-11964](https://issues.apache.org/jira/browse/CB-11964) Call clean after plugin install and mock it in tests -* Did a try/catch to deal with the unit tests vs actual project environment, code duplication is needed because of builderEnv -* [CB-11964](https://issues.apache.org/jira/browse/CB-11964) Do a clean when installing a plugin to et around the bug -* [CB-11921](https://issues.apache.org/jira/browse/CB-11921) - Add github pull request template -* [CB-11935](https://issues.apache.org/jira/browse/CB-11935) Does a best-effort attempt to pause any processing that can be paused safely, such as animations and geolocation. -* [CB-11640](https://issues.apache.org/jira/browse/CB-11640) Fixing check_reqs.js so it actually works -* [CB-11640](https://issues.apache.org/jira/browse/CB-11640) Changing requirements check to ask for Java 8 -* [CB-11869](https://issues.apache.org/jira/browse/CB-11869) Fix cordova-js android exec tests -* [CB-11907](https://issues.apache.org/jira/browse/CB-11907) Bumping Gradle to work with Android Studio 2.2 and the Android Gradle Plugin -* Enable background start of Cordova Android apps -* fixing jshint issues -* replace Integer.parseInt with BigInteger so that you can use longer Android version codes -* [CB-11828](https://issues.apache.org/jira/browse/CB-11828) Adding dirty userAgent checking to see if we're running Jellybean or not for bridge modes -* [CB-11828](https://issues.apache.org/jira/browse/CB-11828) Switching default bridge back to ONLINE_BRIDGE -* Add gradle build flag to enable dex in process for large projects -* added ability for cordova activity to be viewed in a real full screen regardless of android version (as was the case in previous cordova versions) -* Updating travis -* Adding Static Method to CoreAndroid Plugin so we can get the BuildConfig data from other plugins -* Bump Target and Min API levels -* Make evaluateJavaScript brige default -* Creating an evaluateJavascript branch -* [CB-11727](https://issues.apache.org/jira/browse/CB-11727) - travis ci setup is still using 0.10.32 node -* [CB-11726](https://issues.apache.org/jira/browse/CB-11726) - Update appveyor node versions to 4 and 6, so they will always use the latest versions -* Close invalid PRs -* [CB-11683](https://issues.apache.org/jira/browse/CB-11683) Fixed linking to directories during plugin installation. -* fixed [CB-11078](https://issues.apache.org/jira/browse/CB-11078) Empty string for BackgroundColor preference crashes application This closes #316 -* Update JS snapshot to version 5.3.0-dev (via coho) -* Set VERSION to 5.3.0-dev (via coho) -* [CB-11626](https://issues.apache.org/jira/browse/CB-11626) Updated RELEASENOTES and Version for release 5.2.2 -* updated cordoova-common to 1.4.0 -* This closes #195 -* Updaing the gradle for the tests to the latest -* [CB-11550](https://issues.apache.org/jira/browse/CB-11550) Updated RELEASENOTES for release 5.2.1 -* [CB-9489](https://issues.apache.org/jira/browse/CB-9489) Fixed "endless waiting for emulator" issue -* Update JS snapshot to version 5.3.0-dev (via coho) -* Set VERSION to 5.3.0-dev (via coho) -* [CB-11444](https://issues.apache.org/jira/browse/CB-11444) Updated RELEASENOTES and Version for release 5.2.0 -* [CB-11481](https://issues.apache.org/jira/browse/CB-11481) android-library is deprecated use com.android.library instead - -### 5.2.2 (Jul 26, 2016) -* [CB-11615](https://issues.apache.org/jira/browse/CB-11615) updated `cordoova-common` to `1.4.0` - -### 5.2.1 (Jul 11, 2016) -* [CB-9489](https://issues.apache.org/jira/browse/CB-9489) Fixed "endless waiting for emulator" issue -* [CB-11481](https://issues.apache.org/jira/browse/CB-11481) android-library is deprecated use com.android.library instead - -### 5.2.0 (Jun 29, 2016) -* [CB-11383](https://issues.apache.org/jira/browse/CB-11383) Update to gradle for using `jcenter` and correct Application plugin -* [CB-11365](https://issues.apache.org/jira/browse/CB-11365) fixed plugin rm issue with emit being `undefined` -* [CB-11117](https://issues.apache.org/jira/browse/CB-11117) Use `FileUpdater` to optimize prepare for **android** platform -* [CB-10096](https://issues.apache.org/jira/browse/CB-10096) Upgrade test project to `Gradle Plugin 2.1.0` -* [CB-11292](https://issues.apache.org/jira/browse/CB-11292) fix broken `MessageChannel` after plugins are recreated -* [CB-11259](https://issues.apache.org/jira/browse/CB-11259) Improving build output -* [CB-10096](https://issues.apache.org/jira/browse/CB-10096) Upgrading to `Gradle Plugin 2.1.0` -* [CB-11198](https://issues.apache.org/jira/browse/CB-11198) Skip **android** target sdk check. This closes #303. -* [CB-11138](https://issues.apache.org/jira/browse/CB-11138) Reuse `PluginManager` from `common` to add/rm plugins -* [CB-11133](https://issues.apache.org/jira/browse/CB-11133) Handle **android** emulator start failure -* [CB-11132](https://issues.apache.org/jira/browse/CB-11132) Fix Error: Cannot read property `match` of undefined in `cordova-android` `emulator.js` -* Add simple log for package name being deployed -* [CB-11015](https://issues.apache.org/jira/browse/CB-11015) Error adding plugin with gradle extras -* [CB-11095](https://issues.apache.org/jira/browse/CB-11095) Fix plugin add/removal when running on `Node v.010` -* [CB-11022](https://issues.apache.org/jira/browse/CB-11022) Duplicate www files to both destinations on plugin operations -* [CB-10964](https://issues.apache.org/jira/browse/CB-10964) Handle `build.json` file starting with a BOM. -* [CB-10963](https://issues.apache.org/jira/browse/CB-10963) Handle overlapping permission requests from plugins -* [CB-8582](https://issues.apache.org/jira/browse/CB-8582) Obscure `INSTALL_FAILED_VERSION_DOWNGRADE` error when installing app -* [CB-10862](https://issues.apache.org/jira/browse/CB-10862) Cannot set `minsdkversion` -* [CB-10896](https://issues.apache.org/jira/browse/CB-10896) We never enabled cookies on the `WebView` proper -* [CB-10837](https://issues.apache.org/jira/browse/CB-10837) Support platform-specific orientation on **Android** -* [CB-10600](https://issues.apache.org/jira/browse/CB-10600) `cordova run android --release` does not use signed and zip-aligned version of `APK` -* [CB-9710](https://issues.apache.org/jira/browse/CB-9710) Fixing issues parsing `android avd list` output for certain AVDs which resulted in them not being included in the selection process even if they are the best match. -* [CB-10888](https://issues.apache.org/jira/browse/CB-10888) Enable coverage reports collection via codecov -* [CB-10846](https://issues.apache.org/jira/browse/CB-10846) Add Travis and AppVeyor badges to readme -* [CB-10846](https://issues.apache.org/jira/browse/CB-10846) Add AppVeyor configuration -* [CB-10749](https://issues.apache.org/jira/browse/CB-10749) Use `cordova-common.CordovaLogger` in `cordova-android` -* [CB-10673](https://issues.apache.org/jira/browse/CB-10673) fixed conflicting plugin install issue with overlapped `` tag. Add `--force` flag. -* [CB-8976](https://issues.apache.org/jira/browse/CB-8976) Removing the auto-version for non-Crosswalk applications -* [CB-10768](https://issues.apache.org/jira/browse/CB-10768) Use `cordova-common.superspawn` in `GradleBuilder` -* [CB-10729](https://issues.apache.org/jira/browse/CB-10729) Move plugin handlers tests for into platform's repo -* [CB-10669](https://issues.apache.org/jira/browse/CB-10669) `cordova run --list` cannot find `adb` -* [CB-10660](https://issues.apache.org/jira/browse/CB-10660) fixed the exception when removing a non-existing directory. - -### 5.1.1 (Feb 24, 2016) -* updated `cordova-common` dependnecy to `1.1.0` -* [CB-10628](https://issues.apache.org/jira/browse/CB-10628) Fix `emulate android --target` -* [CB-10618](https://issues.apache.org/jira/browse/CB-10618) Handle gradle frameworks on plugin installation/uninstallation -* [CB-10510](https://issues.apache.org/jira/browse/CB-10510) Add an optional timeout to `emu` start script -* [CB-10498](https://issues.apache.org/jira/browse/CB-10498) Resume event should be sticky if it has a plugin result -* fix `HtmlNotFoundTest` so that it passes when file not found is handled correctly -* [CB-10472](https://issues.apache.org/jira/browse/CB-10472) `NullPointerException`: `org.apache.cordova.PluginManager.onSaveInstanceState` check if `pluginManager` is `null` before using it -* [CB-10138](https://issues.apache.org/jira/browse/CB-10138) Adds missing plugin metadata to `plugin_list` module. -* [CB-10443](https://issues.apache.org/jira/browse/CB-10443) Pass original options instead of remaining -* [CB-10443](https://issues.apache.org/jira/browse/CB-10443) Fix `this.root` null reference -* [CB-10421](https://issues.apache.org/jira/browse/CB-10421) Fixes exception when calling run script with `--help` option -* updated `.gitignore` -* [CB-10406](https://issues.apache.org/jira/browse/CB-10406) Fixes an exception, thrown when building using Ant. -* [CB-10157](https://issues.apache.org/jira/browse/CB-10157) Uninstall app from device/emulator only when signed apk is already installed - -### 5.1.0 (Jan 19, 2016) -* [CB-10386](https://issues.apache.org/jira/browse/CB-10386) Add `android.useDeprecatedNdk=true` to support `NDK` in `gradle` -* [CB-8864](https://issues.apache.org/jira/browse/CB-8864) Fixing this to mitigate [CB-8685](https://issues.apache.org/jira/browse/CB-8685) and [CB-10104](https://issues.apache.org/jira/browse/CB-10104) -* [CB-10105](https://issues.apache.org/jira/browse/CB-10105) Spot fix for tilde errors on paths. -* Update theme to `Theme.DeviceDefault.NoActionBar` -* [CB-10014](https://issues.apache.org/jira/browse/CB-10014) Set gradle `applicationId` to `package name`. -* [CB-9949](https://issues.apache.org/jira/browse/CB-9949) Fixing menu button event not fired in **Android** -* [CB-9479](https://issues.apache.org/jira/browse/CB-9479) Fixing the conditionals again, we should -* [CB-8917](https://issues.apache.org/jira/browse/CB-8917) New Plugin API for passing results on resume after Activity destruction -* [CB-9971](https://issues.apache.org/jira/browse/CB-9971) Suppress `gradlew _JAVA_OPTIONS` output during build -* [CB-9836](https://issues.apache.org/jira/browse/CB-9836) Add `.gitattributes` to prevent `CRLF` line endings in repos -* added node_modules back into `.gitignore` - -### 5.0.0 (Nov 01, 2015) -* Update CordovaWebViewEngine.java -* [CB-9909](https://issues.apache.org/jira/browse/CB-9909) Shouldn't escape spaces in paths on Windows. -* [CB-9870](https://issues.apache.org/jira/browse/CB-9870) updated hello world template -* [CB-9880](https://issues.apache.org/jira/browse/CB-9880) Fixes platform update failure when upgrading from android@<4.1.0 -* [CB-9844](https://issues.apache.org/jira/browse/CB-9844) Remove old .java after renaming activity -* [CB-9800](https://issues.apache.org/jira/browse/CB-9800) Fixing contribute link. -* [CB-9782](https://issues.apache.org/jira/browse/CB-9782) Check in `cordova-common` dependency -* Adds licence header to Adb to pass rat audit -* [CB-9835](https://issues.apache.org/jira/browse/CB-9835) Downgrade `properties-parser` to prevent failures in Node < 4.x -* [CB-9782](https://issues.apache.org/jira/browse/CB-9782) Implements PlatformApi contract for Android platform. -* [CB-9826](https://issues.apache.org/jira/browse/CB-9826) Fixed `test-build` script on windows. -* Refactor of the Cordova Plugin/Permissions API -* Manually updating version to 5.0.0-dev for engine tags -* Bump up to API level 23 -* Commiting code to handle permissions, and the special case of the Geolocation Plugin -* [CB-9608](https://issues.apache.org/jira/browse/CB-9608) cordova-android no longer builds on Node 0.10 or below -* [CB-9080](https://issues.apache.org/jira/browse/CB-9080) Cordova CLI run for Android versions 4.1.1 and lower throws error -* [CB-9557](https://issues.apache.org/jira/browse/CB-9557) Fixes apk install failure when switching from debug to release build -* [CB-9496](https://issues.apache.org/jira/browse/CB-9496) removed permissions added for crosswalk -* [CB-9402](https://issues.apache.org/jira/browse/CB-9402) Allow to set gradle distubutionUrl via env variable CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL -* [CB-9428](https://issues.apache.org/jira/browse/CB-9428) update script now bumps up minSdkVersion to 14 if it is less than that. -* [CB-9430](https://issues.apache.org/jira/browse/CB-9430) Fixes check_reqs failure when javac returns an extra line -* [CB-9172](https://issues.apache.org/jira/browse/CB-9172) Improved emulator deploy stability. This closes #188. -* [CB-9404](https://issues.apache.org/jira/browse/CB-9404) Fixed an exception when path contained -debug or -release -* [CB-8320](https://issues.apache.org/jira/browse/CB-8320) Setting up gradle so we can use CordovaLib as a standard Android Library -* [CB-9185](https://issues.apache.org/jira/browse/CB-9185) Fixed an issue when unsigned apks couldn't be found. -* [CB-9397](https://issues.apache.org/jira/browse/CB-9397) Fixes minor issues with `cordova requirements android` -* [CB-9389](https://issues.apache.org/jira/browse/CB-9389) Fixes build/check_reqs hang - -### Release 4.1.1 (Aug 2015) ### - -* [CB-9428](https://issues.apache.org/jira/browse/CB-9428) update script now bumps up minSdkVersion to 14 if it is less than that -* [CB-9430](https://issues.apache.org/jira/browse/CB-9430) Fixes check_reqs failure when javac returns an extra line - -### Release 4.1.0 (Jul 2015) ### -* [CB-9392](https://issues.apache.org/jira/browse/CB-9392) Fixed printing flavored versions. This closes #184. -* [CB-9382](https://issues.apache.org/jira/browse/CB-9382) [Android] Fix KeepRunning setting when Plugin activity is showed. This closes #200 -* [CB-9391](https://issues.apache.org/jira/browse/CB-9391) Fixes cdvBuildMultipleApks option casting -* [CB-9343](https://issues.apache.org/jira/browse/CB-9343) Split the Content-Type to obtain a clean mimetype -* [CB-9255](https://issues.apache.org/jira/browse/CB-9255) Make getUriType case insensitive. -* [CB-9149](https://issues.apache.org/jira/browse/CB-9149) Fixes JSHint issue introduced by 899daa9 -* [CB-9372](https://issues.apache.org/jira/browse/CB-9372) Remove unused files: 'main.js' & 'master.css'. This closes #198 -* [CB-9149](https://issues.apache.org/jira/browse/CB-9149) Make gradle alias subprojects in order to handle libs that depend on libs. This closes #182 -* Update min SDK version to 14 -* Update licenses. This closes #190 -* [CB-9185](https://issues.apache.org/jira/browse/CB-9185) Fix signed release build exception. This closes #193. -* [CB-9286](https://issues.apache.org/jira/browse/CB-9286) Fixes build failure when ANDROID_HOME is not set. -* [CB-9284](https://issues.apache.org/jira/browse/CB-9284) Fix for handling absolute path for keystore in build.json -* [CB-9260](https://issues.apache.org/jira/browse/CB-9260) Install Android-22 on Travis-CI -* Adding .ratignore file. -* [CB-9119](https://issues.apache.org/jira/browse/CB-9119) Adding lib/retry.js for retrying promise-returning functions. Retrying 'adb install' in emulator.js because it sometimes hangs. -* [CB-9115](https://issues.apache.org/jira/browse/CB-9115) android: Grant Lollipop permission req -* Remove extra console message -* [CB-8898](https://issues.apache.org/jira/browse/CB-8898) Report expected gradle location properly -* [CB-8898](https://issues.apache.org/jira/browse/CB-8898) Fixes gradle check failure due to missing quotes -* [CB-9080](https://issues.apache.org/jira/browse/CB-9080) -d option is not supported on Android 4.1.1 and lower, removing -* [CB-8954](https://issues.apache.org/jira/browse/CB-8954) Adds `requirements` command support to check_reqs module -* Update JS snapshot to version 4.1.0-dev (via coho) -* [CB-8417](https://issues.apache.org/jira/browse/CB-8417) updated platform specific files from cordova.js repo -* Adding tests to confirm that preferences aren't changed by Intents -* Forgot to remove the method that copied over the intent data -* Getting around to removing this old Intent code -* Update JS snapshot to version 4.1.0-dev (via coho) -* Fix CordovaPluginTest on KitKat (start-up events seem to change) -* [CB-3360](https://issues.apache.org/jira/browse/CB-3360) Allow setting a custom User-Agent (close #162) -* [CB-8902](https://issues.apache.org/jira/browse/CB-8902) Use immersive mode when available when going fullscreen (close #175) -* Make BridgeMode methods public (they were always supposed to be) -* Simplify: EncodingUtils.getBytes(str) -> str.getBytes() -* Don't show warning when gradlew file is read-only -* Don't show warning when prepEnv copies gradlew and it's read-only -* Make gradle wrapper prepEnv code work even when android-sdk is read-only -* [CB-8897](https://issues.apache.org/jira/browse/CB-8897) Delete drawable/icon.png since it duplicates drawable-mdpi/icon.png -* Updating the template to target mininumSdkTarget=14 -* [CB-8894](https://issues.apache.org/jira/browse/CB-8894) Updating the template to target mininumSdkTarget=14 -* [CB-8891](https://issues.apache.org/jira/browse/CB-8891) Add a note about when the gradle helpers were added -* [CB-8891](https://issues.apache.org/jira/browse/CB-8891) Add a gradle helper for retrieving config.xml preference values -* [CB-8884](https://issues.apache.org/jira/browse/CB-8884) Delete Eclipse tweaks from create script -* [CB-8834](https://issues.apache.org/jira/browse/CB-8834) Don't fail to install on VERSION_DOWNGRADE -* Automated tools fail, and you have to remember all four places where this is set. -* Update the package.json -* [CB-9042](https://issues.apache.org/jira/browse/CB-9042) coho failed to update version, so here we are -* CB9042 - Updating Release Notes -* Adding tests to confirm that preferences aren't changed by Intents -* updating existing test code -* Forgot to remove the method that copied over the intent data -* Getting around to removing this old Intent code -* [CB-8834](https://issues.apache.org/jira/browse/CB-8834) Don't fail to install on VERSION_DOWNGRADE - -### Release 4.0.2 (May 2015) ### - -* Removed Intent Functionality from Preferences - Preferences can no longer be set by intents - -### Release 4.0.1 (April 2015) ### - -* Bug fixed where platform failed to install on a version downgrade - -### Release 4.0.0 (March 2015) ### - -This release adds significant functionality, and also introduces a number -of breaking changes. Some of the changes to the code base will be of -particular interest to plugin developers. - -#### Major Changes #### -* Support for pluggable WebViews - * The system WebView can be replaced in your app, via a plugin - * Core WebView functionality is encapsulated, with extension points exposed - via interfaces -* Support for Crosswalk to bring the modern Chromium WebView to older devices - * Uses the pluggable WebView framework - * You will need to add the new [cordova-crosswalk-engine](https://github.com/MobileChromeApps/cordova-crosswalk-engine) plugin -* Splash screen functionality is now provided via plugin - * You will need to add the new [cordova-plugin-splashscreen](https://github.com/apache/cordova-plugin-splashscreen) plugin to continue using a splash screen -* Whitelist functionality is now provided via plugin (CB-7747) - * The whitelist has been enhanced to be more secure and configurable - * Setting of Content-Security-Policy is now supported by the framework (see details in plugin readme) - * You will need to add the new [cordova-plugin-whitelist](https://github.com/apache/cordova-plugin-whitelist) plugin - * Legacy whitelist behaviour is still available via plugin (although not recommended). - -Changes For Plugin Developers: - -* Develop in Android Studio - * Android Studio is now fully supported, and recommended over Eclipse -* Build using Gradle - * All builds [use Gradle by default](Android%20Shell%20Tool%20Guide_building_with_gradle), instead of Ant - * Plugins can add their own gradle build steps! - * Plugins can depend on Maven libraries using `` tags -* New APIs: `onStart`, `onStop`, `onConfigurationChanged` -* `"onScrollChanged"` message removed. Use `view.getViewTreeObserver().addOnScrollChangedListener(...)` instead -* [CB-8702](https://issues.apache.org/jira/browse/CB-8702) New API for plugins to override `shouldInterceptRequest` with a stream - -#### Other Changes #### -* [CB-8378](https://issues.apache.org/jira/browse/CB-8378) Removed `hidekeyboard` and `showkeyboard` events (apps should use a plugin instead) -* [CB-8735](https://issues.apache.org/jira/browse/CB-8735) `bin/create` regex relaxed / better support for numbers -* [CB-8699](https://issues.apache.org/jira/browse/CB-8699) Fix CordovaResourceApi `copyResource` creating zero-length files when src=uncompressed asset -* [CB-8693](https://issues.apache.org/jira/browse/CB-8693) CordovaLib should not contain icons / splashscreens -* [CB-8592](https://issues.apache.org/jira/browse/CB-8592) Fix NPE if lifecycle events reach CordovaWebView before `init()` has been called -* [CB-8588](https://issues.apache.org/jira/browse/CB-8588) Add CATEGORY_BROWSABLE to intents from showWebPage openExternal=true -* [CB-8587](https://issues.apache.org/jira/browse/CB-8587) Don't allow WebView navigations within showWebPage that are not whitelisted -* [CB-7827](https://issues.apache.org/jira/browse/CB-7827) Add `--activity-name` for `bin/create` -* [CB-8548](https://issues.apache.org/jira/browse/CB-8548) Use debug-signing.properties and release-signing.properties when they exist -* [CB-8545](https://issues.apache.org/jira/browse/CB-8545) Don't add a layout as a parent of the WebView -* [CB-7159](https://issues.apache.org/jira/browse/CB-7159) BackgroundColor not used when ``, nor during screen rotation -* [CB-6630](https://issues.apache.org/jira/browse/CB-6630) Removed OkHttp from core library. It's now available as a plugin: [cordova-plugin-okhttp](https://www.npmjs.com/package/cordova-plugin-okhttp) - -### Release 3.7.1 (January 2015) ### -* [CB-8411](https://issues.apache.org/jira/browse/CB-8411) Initialize plugins only after `createViews()` is called (regression in 3.7.0) - -### Release 3.7.0 (January 2015) ### - -* [CB-8328](https://issues.apache.org/jira/browse/CB-8328) Allow plugins to handle certificate challenges (close #150) -* [CB-8201](https://issues.apache.org/jira/browse/CB-8201) Add support for auth dialogs into Cordova Android -* [CB-8017](https://issues.apache.org/jira/browse/CB-8017) Add support for `` for Lollipop -* [CB-8143](https://issues.apache.org/jira/browse/CB-8143) Loads of gradle improvements (try it with cordova/build --gradle) -* [CB-8329](https://issues.apache.org/jira/browse/CB-8329) Cancel outstanding ActivityResult requests when a new startActivityForResult occurs -* [CB-8026](https://issues.apache.org/jira/browse/CB-8026) Bumping up Android Version and setting it up to allow third-party cookies. This might change later. -* [CB-8210](https://issues.apache.org/jira/browse/CB-8210) Use PluginResult for various events from native so that content-security-policy can be used -* [CB-8168](https://issues.apache.org/jira/browse/CB-8168) Add support for `cordova/run --list` (closes #139) -* [CB-8176](https://issues.apache.org/jira/browse/CB-8176) Vastly better auto-detection of SDK & JDK locations -* [CB-8079](https://issues.apache.org/jira/browse/CB-8079) Use activity class package name, but fallback to application package name when looking for splash screen drawable -* [CB-8147](https://issues.apache.org/jira/browse/CB-8147) Have corodva/build warn about unrecognized flags rather than fail -* [CB-7881](https://issues.apache.org/jira/browse/CB-7881) Android tooling shouldn't lock application directory -* [CB-8112](https://issues.apache.org/jira/browse/CB-8112) Turn off mediaPlaybackRequiresUserGesture -* [CB-6153](https://issues.apache.org/jira/browse/CB-6153) Add a preference for controlling hardware button audio stream (DefaultVolumeStream) -* [CB-8031](https://issues.apache.org/jira/browse/CB-8031) Fix race condition that shows as ConcurrentModificationException -* [CB-7974](https://issues.apache.org/jira/browse/CB-7974) Cancel timeout timer if view is destroyed -* [CB-7940](https://issues.apache.org/jira/browse/CB-7940) Disable exec bridge if bridgeSecret is wrong -* [CB-7758](https://issues.apache.org/jira/browse/CB-7758) Allow content-url-hosted pages to access the bridge -* [CB-6511](https://issues.apache.org/jira/browse/CB-6511) Fixes build for android when app name contains unicode characters. -* [CB-7707](https://issues.apache.org/jira/browse/CB-7707) Added multipart PluginResult -* [CB-6837](https://issues.apache.org/jira/browse/CB-6837) Fix leaked window when hitting back button while alert being rendered -* [CB-7674](https://issues.apache.org/jira/browse/CB-7674) Move preference activation back into onCreate() -* [CB-7499](https://issues.apache.org/jira/browse/CB-7499) Support RTL text direction -* [CB-7330](https://issues.apache.org/jira/browse/CB-7330) Don't run check_reqs for bin/create. - -### 3.6.4 (Sept 30, 2014) ### - -* Set VERSION to 3.6.4 (via coho) -* Update JS snapshot to version 3.6.4 (via coho) -* [CB-7634](https://issues.apache.org/jira/browse/CB-7634) Detect JAVA_HOME properly on Ubuntu -* [CB-7579](https://issues.apache.org/jira/browse/CB-7579) Fix run script's ability to use non-arch-specific APKs -* [CB-6511](https://issues.apache.org/jira/browse/CB-6511) Fixes build for android when app name contains unicode characters. -* [CB-7463](https://issues.apache.org/jira/browse/CB-7463) Adding licences. I don't know what the gradle syntax is for comments, that still needs to be done. -* [CB-7463](https://issues.apache.org/jira/browse/CB-7463) Looked at the Apache BigTop git, gradle uses C-style comments -* [CB-7460](https://issues.apache.org/jira/browse/CB-7460) Fixing bug with KitKat where the background colour would override the CSS colours on the application - -### 3.6.0 (Sept 2014) ### - -* Set VERSION to 3.6.0 (via coho) -* [CB-7410](https://issues.apache.org/jira/browse/CB-7410) fix the menu test -* [CB-7410](https://issues.apache.org/jira/browse/CB-7410) Fix the errorUrl test -* [CB-7410](https://issues.apache.org/jira/browse/CB-7410) Fix Basic Authentication test -* [CB-3445](https://issues.apache.org/jira/browse/CB-3445) Allow build and run scripts to select APK by architecture -* [CB-3445](https://issues.apache.org/jira/browse/CB-3445) Add environment variable 'BUILD_MULTIPLE_APKS' for splitting APKs based on architecture -* [CB-3445](https://issues.apache.org/jira/browse/CB-3445) Ensure that JAR files in libs directory are included -* [CB-7267](https://issues.apache.org/jira/browse/CB-7267) update RELEASENOTES for 3.5.1 -* [CB-7410](https://issues.apache.org/jira/browse/CB-7410) clarify the title -* [CB-7385](https://issues.apache.org/jira/browse/CB-7385) update cordova.js for testing prior to branch/tag -* [CB-7410](https://issues.apache.org/jira/browse/CB-7410) add whitelist entries to get iframe/GoogleMaps working -* [CB-7291](https://issues.apache.org/jira/browse/CB-7291) propogate change in method signature to the native tests -* [CB-7291](https://issues.apache.org/jira/browse/CB-7291) Restrict meaning of "\*" in internal whitelist to just http and https -* [CB-7291](https://issues.apache.org/jira/browse/CB-7291) Only add file, content and data URLs to internal whitelist -* [CB-7291](https://issues.apache.org/jira/browse/CB-7291) Add defaults to external whitelist -* [CB-7291](https://issues.apache.org/jira/browse/CB-7291) Add external-launch-whitelist and use it for filtering intent launches -* [CB-3445](https://issues.apache.org/jira/browse/CB-3445) Read project.properties to configure gradle libraries -* [CB-7325](https://issues.apache.org/jira/browse/CB-7325) Fix error message in android_sdk_version.js when missing SDK on windows -* [CB-7335](https://issues.apache.org/jira/browse/CB-7335) Add a .gitignore to android project template -* [CB-7330](https://issues.apache.org/jira/browse/CB-7330) Fix dangling function call in last commit (broke gradle builds) -* [CB-7330](https://issues.apache.org/jira/browse/CB-7330) Don't run "android update" during creation -* [CB-3445](https://issues.apache.org/jira/browse/CB-3445) Add gradle support clean command (plus some code cleanup) -* [CB-7044](https://issues.apache.org/jira/browse/CB-7044) Fix typo in prev commit causing check_reqs to always fail. -* [CB-3445](https://issues.apache.org/jira/browse/CB-3445) Copy gradle wrapper in build instead of create -* [CB-3445](https://issues.apache.org/jira/browse/CB-3445) Add .gradle template files for "update" as well as "create" -* [CB-7044](https://issues.apache.org/jira/browse/CB-7044) Add JAVA_HOME when not set. Be stricter about ANDROID_HOME -* [CB-3445](https://issues.apache.org/jira/browse/CB-3445) Speed up gradle building (incremental builds go from 10s -> 1.5s for me) -* [CB-3445](https://issues.apache.org/jira/browse/CB-3445) android: Copy Gradle wrapper from Android SDK rather than bundling a JAR -* [CB-3445](https://issues.apache.org/jira/browse/CB-3445) Add which to checked-in node_modules -* [CB-3445](https://issues.apache.org/jira/browse/CB-3445) Add option to build and install with gradle -* [CB-3445](https://issues.apache.org/jira/browse/CB-3445) Add an initial set of Gradle build scripts -* [CB-7321](https://issues.apache.org/jira/browse/CB-7321) Don't require ant for create script -* CB-7044, [CB-7299](https://issues.apache.org/jira/browse/CB-7299) Fix up PATH problems when possible. -* Change in test's AndroidManifest.xml needed for the test to run properly. Forgot the manifest. -* Change in test's AndroidManifest.xml needed for the test to run properly -* Adding tests related to 3.5.1 -* [CB-7261](https://issues.apache.org/jira/browse/CB-7261) Fix setNativeToJsBridgeMode sometimes crashing when switching to ONLINE_EVENT -* [CB-7265](https://issues.apache.org/jira/browse/CB-7265) Fix crash when navigating to custom protocol (introduced in 3.5.1) -* Filter out non-launchable intents -* Handle unsupported protocol errors in webview better -* [CB-7238](https://issues.apache.org/jira/browse/CB-7238) I should have collapsed this, but Config.init() must go before the creation of CordovaWebView -* [CB-7238](https://issues.apache.org/jira/browse/CB-7238) Minor band-aid to get tests running again, this has to go away before 3.6.0 is released, since this is an API change. -* Extend whitelist to handle URLs without // chars -* [CB-7172](https://issues.apache.org/jira/browse/CB-7172) Force window to have focus after resume -* [CB-7159](https://issues.apache.org/jira/browse/CB-7159) Set background color of webView as well as its parent -* [CB-7018](https://issues.apache.org/jira/browse/CB-7018) Fix setButtonPlumbedToJs never un-listening -* Undeprecate some just-deprecated symbols in PluginManager. -* @Deprecate methods of PluginManager that were never meant to be public -* Move plugin instantiation and instance storing logic PluginEntry->PluginManager -* Fix broken unit test due to missing Config.init() call -* Update to check for Google Glass APIs -* Fix for `android` not being in PATH check on Windows -* Displaying error when regex does not match. -* Fix broken compile due to previous commit :( -* Tweak CordovaPlugin.initialize method to be less deprecated. -* Un-deprecate CordovaActivity.init() - it's needed to tweak prefs in onCreate -* Tweak log messages in CordovaBridge with bridgeSecret is wrong -* Backport CordovaBridge from 4.0.x -> master -* Update unit tests to not use most deprecated things (e.g. DroidGap) -* Add non-String overloades for CordovaPreferences.set() -* Make CordovaWebview resilient to init() not being called (for backwards-compatibility) -* Add node_module licenses to LICENSE -* Update cordova.js snapshot to work with bridge changes -* Provide CordovaPlugin with CordovaPreferences. Add new Plugin.initialize() -* Convert usages of Config.\* to use the non-static versions -* Change getProperty -> prefs.get\* within CordovaActivity -* Make CordovaUriHelper class package-private -* Fix PluginManager.setPluginEntries not removing old entries -* Move registration of App plugin from config.xml -> code -* Make setWebViewClient an override instead of an overload. Delete Location-change JS->Native bridge mode (missed some of it). -* [CB-4404](https://issues.apache.org/jira/browse/CB-4404) Revert setting android:windowSoftInputMode to "adjustPan" -* Refactor: Use ConfigXmlParser in activity. Adds CordovaWebView.init() -* Deprecate some convenience methods on CordovaActivity -* Fix CordovaPreferences not correctly parsing hex values (valueOf->decode) -* Refactor: Move url-filter information into PluginEntry. -* Don't re-parse config.xml in onResume. -* Move handling of Fullscreen preference to CordovaActivity -* Delete dead code from CordovaActivity -* Update .classpath to make Eclipse happy (just re-orders one line) -* Delete "CB-3064: The errorUrl is..." Log message left over from debugging presumably -* Refactor Config into ConfigXmlParser, CordovaPreferences -* Delete Location-change JS->Native bridge mode -* [CB-5988](https://issues.apache.org/jira/browse/CB-5988) Allow exec() only from file: or start-up URL's domain -* [CB-6761](https://issues.apache.org/jira/browse/CB-6761) Fix native->JS bridge ceasing to fire when page changes and online is set to false and the JS loads quickly -* Update the errorurl to no longer use intents -* This breaks running the JUnit tests, we'll bring it back soon -* Refactoring the URI handling on Cordova, removing dead code -* [CB-7018](https://issues.apache.org/jira/browse/CB-7018) Clean up and deprecation of some button-related functions -* [CB-7017](https://issues.apache.org/jira/browse/CB-7017) Fix onload=true being set on all subsequent plugins -* [CB-5971](https://issues.apache.org/jira/browse/CB-5971) Fix package / project validation -* [CB-5971](https://issues.apache.org/jira/browse/CB-5971) Add unit tests to cordova-android -* [CB-5971](https://issues.apache.org/jira/browse/CB-5971) Factor out package/project name validation logic -* Delete explicit activity.finish() in back button handling. No change in behaviour. -* [CB-5971](https://issues.apache.org/jira/browse/CB-5971) This would have been a good first bug, too bad -* [CB-4404](https://issues.apache.org/jira/browse/CB-4404) Changing where android:windowSoftInputMode is in the manifest so it works -* Add documentation referencing other implementation. -* [CB-6851](https://issues.apache.org/jira/browse/CB-6851) Deprecate WebView.sendJavascript() -* [CB-6876](https://issues.apache.org/jira/browse/CB-6876) Show the correct executable name -* [CB-6876](https://issues.apache.org/jira/browse/CB-6876) Fix the "print usage" -* Trivial spelling fix in comments when reading CordovaResourceApi -* [CB-6818](https://issues.apache.org/jira/browse/CB-6818) I want to remove this code, because Square didn't do their headers properly -* [CB-6860](https://issues.apache.org/jira/browse/CB-6860) Add activity_name and launcher_name to AndroidManifest.xml & strings.xml -* Add a comment to custom_rules.xml saying why we move AndroidManifest.xml -* Remove +x from README.md -* [CB-6784](https://issues.apache.org/jira/browse/CB-6784) Add missing licenses -* [CB-6784](https://issues.apache.org/jira/browse/CB-6784) Add license to CONTRIBUTING.md -* Revert "defaults.xml: Add AndroidLaunchMode preference" -* updated RELEASENOTES -* [CB-6315](https://issues.apache.org/jira/browse/CB-6315) Wrapping this so it runs on the UI thread -* [CB-6723](https://issues.apache.org/jira/browse/CB-6723) Update package name for Robotium -* [CB-6707](https://issues.apache.org/jira/browse/CB-6707) Update minSdkVersion to 10 consistently -* [CB-5652](https://issues.apache.org/jira/browse/CB-5652) make visible cordova version -* Update JS snapshot to version 3.6.0-dev (via coho) -* Update JS snapshot to version 3.6.0-dev (via coho) -* Set VERSION to 3.6.0-dev (via coho) - -### 3.5.1 (August 2014) ### - -This was a security update to address CVE-2014-3500, CVE-2014-3501, -and CVE-2014-3502. For more information, see -http://cordova.apache.org/announcements/2014/08/04/android-351.html - -* Filter out non-launchable intents -* Handle unsupported protocol errors in webview better -* Update the errorurl to no longer use intents -* Refactoring the URI handling on Cordova, removing dead code - -### 3.5.0 (May 2014) ### - -* OkHttp has broken headers. Updating for ASF compliance. -* Revert accidentally removed lines from NOTICE -* [CB-6552](https://issues.apache.org/jira/browse/CB-6552) added top level package.json -* [CB-6491](https://issues.apache.org/jira/browse/CB-6491) add CONTRIBUTING.md -* [CB-6543](https://issues.apache.org/jira/browse/CB-6543) Fix cordova/run failure when no custom_rules.xml available -* defaults.xml: Add AndroidLaunchMode preference -* Add JavaDoc for CordovaResourceApi -* [CB-6388](https://issues.apache.org/jira/browse/CB-6388) Handle binary data correctly in LOAD_URL bridge -* Fix [CB-6048](https://issues.apache.org/jira/browse/CB-6048) Set launchMode=singleTop so tapping app icon does not always restart app -* Remove incorrect usage of AlertDialog.Builder.create -* Catch uncaught exceptions in from plugins and turn them into error responses. -* Add NOTICE file -* [CB-6047](https://issues.apache.org/jira/browse/CB-6047) Fix online sometimes getting in a bad state on page transitions. -* Add another convenience overload for CordovaResourceApi.copyResource -* Update framework's .classpath to what Eclipse wants it to be. -* README.md: `android update` to `android-19`. -* Fix NPE when POLLING bridge mode is used. -* Updating NOTICE to include Square for OkHttp -* [CB-5398](https://issues.apache.org/jira/browse/CB-5398) Apply KitKat content URI fix to all content URIs -* [CB-5398](https://issues.apache.org/jira/browse/CB-5398) Work-around for KitKat content: URLs not rendering in tags -* [CB-5908](https://issues.apache.org/jira/browse/CB-5908) add splascreen images to template -* [CB-5395](https://issues.apache.org/jira/browse/CB-5395) Make scheme and host (but not path) case-insensitive in whitelist -* Ignore multiple onPageFinished() callbacks & onReceivedError due to stopLoading() -* Removing addJavascriptInterface support from all Android versions lower than 4.2 due to security vu -* [CB-4984](https://issues.apache.org/jira/browse/CB-4984) Don't create on CordovaActivity name -* [CB-5917](https://issues.apache.org/jira/browse/CB-5917) Add a loadUrlIntoView overload that doesn't recreate plugins. -* Use thread pool for load timeout. -* [CB-5715](https://issues.apache.org/jira/browse/CB-5715) For CLI, hide assets/www and res/xml/config.xml by default -* [CB-5793](https://issues.apache.org/jira/browse/CB-5793) ant builds: Rename AndroidManifest during -post-build to avoid Eclipse detecting ant-build/ -* [CB-5889](https://issues.apache.org/jira/browse/CB-5889) Make update script find project name instead of using "null" for CordovaLib -* [CB-5889](https://issues.apache.org/jira/browse/CB-5889) Add a message in the update script about needing to import CordovaLib when using an IDE. - -### 3.4.0 (Feb 2014) ### - -43 commits from 10 authors. Highlights include: - -* Removing addJavascriptInterface support from all Android versions lower than 4.2 due to security vulnerability -* [CB-5917](https://issues.apache.org/jira/browse/CB-5917) Add a loadUrlIntoView overload that doesn't recreate plugins. -* [CB-5889](https://issues.apache.org/jira/browse/CB-5889) Make update script find project name instead of using "null" for CordovaLib -* [CB-5889](https://issues.apache.org/jira/browse/CB-5889) Add a message in the update script about needing to import CordovaLib when using an IDE. -* [CB-5793](https://issues.apache.org/jira/browse/CB-5793) Don't clean before build and change output directory to ant-build to avoid conflicts with Eclipse. -* [CB-5803](https://issues.apache.org/jira/browse/CB-5803) Fix cordova/emulate on windows. -* [CB-5801](https://issues.apache.org/jira/browse/CB-5801) exec->spawn in build to make sure compile errors are shown. -* [CB-5799](https://issues.apache.org/jira/browse/CB-5799) Update version of OkHTTP to 1.3 -* [CB-4910](https://issues.apache.org/jira/browse/CB-4910) Update CLI project template to point to config.xml at the root now that it's not in www/ by default. -* [CB-5504](https://issues.apache.org/jira/browse/CB-5504) Adding onDestroy to app plugin to deregister telephonyReceiver -* [CB-5715](https://issues.apache.org/jira/browse/CB-5715) Add Eclipse .project file to create template. For CLI projects, it adds refs for root www/ & config.xml and hides platform versions -* [CB-5447](https://issues.apache.org/jira/browse/CB-5447) Removed android:debuggable=“true” from project template. -* [CB-5714](https://issues.apache.org/jira/browse/CB-5714) Fix of android build when too big output stops build with error due to buffer overflow. -* [CB-5592](https://issues.apache.org/jira/browse/CB-5592) Set MIME type for openExternal when scheme is file: - -### 3.3.0 (Dec 2013) ### - -41 commits from 11 authors. Highlights include: - -* [CB-5481](https://issues.apache.org/jira/browse/CB-5481) Fix for Cordova trying to get config.xml from the wrong namespace -* [CB-5487](https://issues.apache.org/jira/browse/CB-5487) Enable Remote Debugging when your Android app is debuggable. -* [CB-5445](https://issues.apache.org/jira/browse/CB-5445) Adding onScrollChanged and the ScrollEvent object -* [CB-5422](https://issues.apache.org/jira/browse/CB-5422) Don't require JAVA_HOME to be defined -* [CB-5490](https://issues.apache.org/jira/browse/CB-5490) Add javadoc target to ant script -* [CB-5471](https://issues.apache.org/jira/browse/CB-5471) Deprecated DroidGap class -* [CB-5255](https://issues.apache.org/jira/browse/CB-5255) Prefer Google API targets over android-## targets when building. -* [CB-5232](https://issues.apache.org/jira/browse/CB-5232) Change create script to use Cordova as a Library Project instead of a .jar -* [CB-5302](https://issues.apache.org/jira/browse/CB-5302) Massive movement to get tests working again -* [CB-4996](https://issues.apache.org/jira/browse/CB-4996) Fix paths with spaces while launching on emulator and device -* [CB-5209](https://issues.apache.org/jira/browse/CB-5209) Cannot build Android app if project path contains spaces - - -### 3.2.0 (Nov 2013) ### - -27 commits from 7 authors. Highlights include: - -* [CB-5193](https://issues.apache.org/jira/browse/CB-5193) Fix Android WebSQL sometime throwing SECURITY_ERR. -* [CB-5191](https://issues.apache.org/jira/browse/CB-5191) Deprecate -* Updating shelljs to 0.2.6. Copy now preserves mode bits. -* [CB-4872](https://issues.apache.org/jira/browse/CB-4872) Added android version scripts (android_sdk_version, etc) -* [CB-5117](https://issues.apache.org/jira/browse/CB-5117) Output confirmation message if check_reqs passes. -* [CB-5080](https://issues.apache.org/jira/browse/CB-5080) Find resources in a way that works with aapt's --rename-manifest-package -* [CB-4527](https://issues.apache.org/jira/browse/CB-4527) Don't delete .bat files even when on non-windows platform -* [CB-4892](https://issues.apache.org/jira/browse/CB-4892) Fix create script only escaping the first space instead of all spaces. - -### 3.1.0 (Sept 2013) ### - -55 commits from 9 authors. Highlights include: - -* [CB-4817](https://issues.apache.org/jira/browse/CB-4817) Remove unused assets in project template. -* Fail fast in create script if package name is not com.foo.bar. -* [CB-4782](https://issues.apache.org/jira/browse/CB-4782) Convert ApplicationInfo.java -> appinfo.js -* [CB-4766](https://issues.apache.org/jira/browse/CB-4766) Deprecated JSONUtils.java (moved into plugins) -* [CB-4765](https://issues.apache.org/jira/browse/CB-4765) Deprecated ExifHelper.java (moved into plugins) -* [CB-4764](https://issues.apache.org/jira/browse/CB-4764) Deprecated DirectoryManager.java (moved into plugins) -* [CB-4763](https://issues.apache.org/jira/browse/CB-4763) Deprecated FileHelper.java (moved into plugins), Move getMimeType() into CordovaResourceApi. -* [CB-4725](https://issues.apache.org/jira/browse/CB-4725) Add CordovaWebView.CORDOVA_VERSION constant -* Incrementing version check for Android 4.3 API Level 18 -* [CB-3542](https://issues.apache.org/jira/browse/CB-3542) rewrote cli tooling scripts in node -* Allow CordovaChromeClient subclasses access to CordovaInterface and CordovaWebView members -* Refactor CordovaActivity.init so that subclasses can easily override factory methods for webview objects -* [CB-4652](https://issues.apache.org/jira/browse/CB-4652) Allow default project template to be overridden on create -* Tweak the online bridge to not send excess online events. -* [CB-4495](https://issues.apache.org/jira/browse/CB-4495) Modify start-emulator script to exit immediately on a fatal emulator error. -* Log WebView IOExceptions only when they are not 404s -* Use a higher threshold for slow exec() warnings when debugger is attached. -* Fix data URI decoding in CordovaResourceApi -* [CB-3819](https://issues.apache.org/jira/browse/CB-3819) Made it easier to set SplashScreen delay. -* [CB-4013](https://issues.apache.org/jira/browse/CB-4013) Fixed loadUrlTimeoutValue preference. -* Upgrading project to Android 4.3 -* [CB-4198](https://issues.apache.org/jira/browse/CB-4198) bin/create script should be better at handling non-word characters in activity name. Patched windows script as well. -* [CB-4198](https://issues.apache.org/jira/browse/CB-4198) bin/create should handle spaces in activity better. -* [CB-4096](https://issues.apache.org/jira/browse/CB-4096) Implemented new unified whitelist for android -* [CB-3384](https://issues.apache.org/jira/browse/CB-3384) Fix thread assertion when plugins remap URIs - diff --git a/chabok-starter-cordova/node_modules/cordova-android/VERSION b/chabok-starter-cordova/node_modules/cordova-android/VERSION deleted file mode 100644 index 8104cab..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/VERSION +++ /dev/null @@ -1 +0,0 @@ -8.1.0 diff --git a/chabok-starter-cordova/node_modules/cordova-android/appveyor.yml b/chabok-starter-cordova/node_modules/cordova-android/appveyor.yml deleted file mode 100644 index f7eed5b..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/appveyor.yml +++ /dev/null @@ -1,37 +0,0 @@ -environment: - ANDROID_HOME: "C:\\android" - - # If the gradle daemon is used, the build hangs after generating the wrapper - GRADLE_OPTS: -Dorg.gradle.daemon=false - - # URL for SDK Tools, Revision 26.1.1 (September 2017) - SDK_TOOLS_URL: https://dl.google.com/android/repository/sdk-tools-windows-4333796.zip - - matrix: - - nodejs_version: 6 - - nodejs_version: 8 - - nodejs_version: 10 - - nodejs_version: 12 - -install: - # Install Android SDK Tools - - mkdir "%ANDROID_HOME%" - - appveyor DownloadFile "%SDK_TOOLS_URL%" -FileName "%TMP%/sdk-tools.zip" - - 7z x "%TMP%/sdk-tools.zip" -o"%ANDROID_HOME%" > nul - - set PATH=%PATH%;"%ANDROID_HOME%\tools\bin" - - - yes 2> nul | sdkmanager --licenses > nul - - sdkmanager "build-tools;28.0.3" - - - choco install gradle --version 3.4.1 - - - ps: Install-Product node $env:nodejs_version - - npm install - -build: off - -test_script: - - gradle --version - - node --version - - npm --version - - npm test diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/android_sdk_version b/chabok-starter-cordova/node_modules/cordova-android/bin/android_sdk_version deleted file mode 100755 index 99e2baf..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/android_sdk_version +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env node - -/* - 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 android_sdk = require('./templates/cordova/lib/android_sdk'); - -android_sdk.print_newest_available_sdk_target().done(null, function (err) { - console.error(err); - process.exit(2); -}); diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/android_sdk_version.bat b/chabok-starter-cordova/node_modules/cordova-android/bin/android_sdk_version.bat deleted file mode 100644 index a6bc104..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/android_sdk_version.bat +++ /dev/null @@ -1,26 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. - -@ECHO OFF -SET script_path="%~dp0android_sdk_version" -IF EXIST %script_path% ( - node %script_path% %* -) ELSE ( - ECHO. - ECHO ERROR: Could not find 'android_sdk_version' script in 'bin' folder, aborting...>&2 - EXIT /B 1 -) diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/check_reqs b/chabok-starter-cordova/node_modules/cordova-android/bin/check_reqs deleted file mode 100755 index 39b6ca5..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/check_reqs +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env node - -/* - 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 check_reqs = require('./templates/cordova/lib/check_reqs'); - -check_reqs.run().done( - function success () { - console.log('Looks like your environment fully supports cordova-android development!'); - }, - function fail (err) { - console.log(err); - process.exit(2); - } -); diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/check_reqs.bat b/chabok-starter-cordova/node_modules/cordova-android/bin/check_reqs.bat deleted file mode 100644 index 846dfa1..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/check_reqs.bat +++ /dev/null @@ -1,26 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. - -@ECHO OFF -SET script_path="%~dp0check_reqs" -IF EXIST %script_path% ( - node %script_path% %* -) ELSE ( - ECHO. - ECHO ERROR: Could not find 'check_reqs' script in 'bin' folder, aborting...>&2 - EXIT /B 1 -) diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/create b/chabok-starter-cordova/node_modules/cordova-android/bin/create deleted file mode 100755 index fbab242..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/create +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env node - -/* - 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 path = require('path'); -var ConfigParser = require('cordova-common').ConfigParser; -var Api = require('./templates/cordova/Api'); - -var argv = require('nopt')({ - 'help': Boolean, - 'cli': Boolean, - 'shared': Boolean, - 'link': Boolean, - 'activity-name': [String, undefined] -}, { 'd': '--verbose' }); - -if (argv.help || argv.argv.remain.length === 0) { - console.log('Usage: ' + path.relative(process.cwd(), path.join(__dirname, 'create')) + ' [] [--activity-name ] [--link]'); - console.log(' : Path to your new Cordova Android project'); - console.log(' : Package name, following reverse-domain style convention'); - console.log(' : Project name'); - console.log(' : Path to a custom application template to use'); - console.log(' --activity-name : Activity name'); - console.log(' --link will use the CordovaLib project directly instead of making a copy.'); - process.exit(1); -} - -var config = new ConfigParser(path.resolve(__dirname, 'templates/project/res/xml/config.xml')); - -if (argv.argv.remain[1]) config.setPackageName(argv.argv.remain[1]); -if (argv.argv.remain[2]) config.setName(argv.argv.remain[2]); -if (argv['activity-name']) config.setName(argv['activity-name']); - -var options = { - link: argv.link || argv.shared, - customTemplate: argv.argv.remain[3], - activityName: argv['activity-name'] -}; - -require('./templates/cordova/loggingHelper').adjustLoggerLevel(argv); - -Api.createPlatform(argv.argv.remain[0], config, options).done(); diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/create.bat b/chabok-starter-cordova/node_modules/cordova-android/bin/create.bat deleted file mode 100644 index 4b475a2..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/create.bat +++ /dev/null @@ -1,26 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. - -@ECHO OFF -SET script_path="%~dp0create" -IF EXIST %script_path% ( - node %script_path% %* -) ELSE ( - ECHO. - ECHO ERROR: Could not find 'create' script in 'bin' folder, aborting...>&2 - EXIT /B 1 -) \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/lib/create.js b/chabok-starter-cordova/node_modules/cordova-android/bin/lib/create.js deleted file mode 100755 index 3c4b837..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/lib/create.js +++ /dev/null @@ -1,362 +0,0 @@ -#!/usr/bin/env node - -/* - 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 shell = require('shelljs'); -var Q = require('q'); -var path = require('path'); -var fs = require('fs'); -var check_reqs = require('./../templates/cordova/lib/check_reqs'); -var ROOT = path.join(__dirname, '..', '..'); - -var CordovaError = require('cordova-common').CordovaError; -var AndroidManifest = require('../templates/cordova/lib/AndroidManifest'); - -// Export all helper functions, and make sure internally within this module, we -// reference these methods via the `exports` object - this helps with testing -// (since we can then mock and control behaviour of all of these functions) -exports.validatePackageName = validatePackageName; -exports.validateProjectName = validateProjectName; -exports.setShellFatal = setShellFatal; -exports.copyJsAndLibrary = copyJsAndLibrary; -exports.copyScripts = copyScripts; -exports.copyBuildRules = copyBuildRules; -exports.writeProjectProperties = writeProjectProperties; -exports.prepBuildFiles = prepBuildFiles; - -function setShellFatal (value, func) { - var oldVal = shell.config.fatal; - shell.config.fatal = value; - func(); - shell.config.fatal = oldVal; -} - -function getFrameworkDir (projectPath, shared) { - return shared ? path.join(ROOT, 'framework') : path.join(projectPath, 'CordovaLib'); -} - -function copyJsAndLibrary (projectPath, shared, projectName, isLegacy) { - var nestedCordovaLibPath = getFrameworkDir(projectPath, false); - var srcCordovaJsPath = path.join(ROOT, 'bin', 'templates', 'project', 'assets', 'www', 'cordova.js'); - var app_path = path.join(projectPath, 'app', 'src', 'main'); - - if (isLegacy) { - app_path = projectPath; - } - - shell.cp('-f', srcCordovaJsPath, path.join(app_path, 'assets', 'www', 'cordova.js')); - - // Copy the cordova.js file to platforms//platform_www/ - // The www dir is nuked on each prepare so we keep cordova.js in platform_www - shell.mkdir('-p', path.join(projectPath, 'platform_www')); - shell.cp('-f', srcCordovaJsPath, path.join(projectPath, 'platform_www')); - - // Copy cordova-js-src directory into platform_www directory. - // We need these files to build cordova.js if using browserify method. - shell.cp('-rf', path.join(ROOT, 'cordova-js-src'), path.join(projectPath, 'platform_www')); - - // Don't fail if there are no old jars. - exports.setShellFatal(false, function () { - shell.ls(path.join(app_path, 'libs', 'cordova-*.jar')).forEach(function (oldJar) { - console.log('Deleting ' + oldJar); - shell.rm('-f', oldJar); - }); - var wasSymlink = true; - try { - // Delete the symlink if it was one. - fs.unlinkSync(nestedCordovaLibPath); - } catch (e) { - wasSymlink = false; - } - // Delete old library project if it existed. - if (shared) { - shell.rm('-rf', nestedCordovaLibPath); - } else if (!wasSymlink) { - // Delete only the src, since Eclipse / Android Studio can't handle their project files being deleted. - shell.rm('-rf', path.join(nestedCordovaLibPath, 'src')); - } - }); - if (shared) { - var relativeFrameworkPath = path.relative(projectPath, getFrameworkDir(projectPath, true)); - fs.symlinkSync(relativeFrameworkPath, nestedCordovaLibPath, 'dir'); - } else { - shell.mkdir('-p', nestedCordovaLibPath); - shell.cp('-f', path.join(ROOT, 'framework', 'AndroidManifest.xml'), nestedCordovaLibPath); - shell.cp('-f', path.join(ROOT, 'framework', 'project.properties'), nestedCordovaLibPath); - shell.cp('-f', path.join(ROOT, 'framework', 'build.gradle'), nestedCordovaLibPath); - shell.cp('-f', path.join(ROOT, 'framework', 'cordova.gradle'), nestedCordovaLibPath); - shell.cp('-r', path.join(ROOT, 'framework', 'src'), nestedCordovaLibPath); - } -} - -function extractSubProjectPaths (data) { - var ret = {}; - var r = /^\s*android\.library\.reference\.\d+=(.*)(?:\s|$)/mg; - var m; - while ((m = r.exec(data))) { - ret[m[1]] = 1; - } - return Object.keys(ret); -} - -function writeProjectProperties (projectPath, target_api) { - var dstPath = path.join(projectPath, 'project.properties'); - var templatePath = path.join(ROOT, 'bin', 'templates', 'project', 'project.properties'); - var srcPath = fs.existsSync(dstPath) ? dstPath : templatePath; - - var data = fs.readFileSync(srcPath, 'utf8'); - data = data.replace(/^target=.*/m, 'target=' + target_api); - var subProjects = extractSubProjectPaths(data); - subProjects = subProjects.filter(function (p) { - return !(/^CordovaLib$/m.exec(p) || - /[\\/]cordova-android[\\/]framework$/m.exec(p) || - /^(\.\.[\\/])+framework$/m.exec(p)); - }); - subProjects.unshift('CordovaLib'); - data = data.replace(/^\s*android\.library\.reference\.\d+=.*\n/mg, ''); - if (!/\n$/.exec(data)) { - data += '\n'; - } - for (var i = 0; i < subProjects.length; ++i) { - data += 'android.library.reference.' + (i + 1) + '=' + subProjects[i] + '\n'; - } - fs.writeFileSync(dstPath, data); -} - -// This makes no sense, what if you're building with a different build system? -function prepBuildFiles (projectPath) { - var buildModule = require('../templates/cordova/lib/builders/builders'); - buildModule.getBuilder(projectPath).prepBuildFiles(); -} - -function copyBuildRules (projectPath, isLegacy) { - var srcDir = path.join(ROOT, 'bin', 'templates', 'project'); - - if (isLegacy) { - // The project's build.gradle is identical to the earlier build.gradle, so it should still work - shell.cp('-f', path.join(srcDir, 'legacy', 'build.gradle'), projectPath); - shell.cp('-f', path.join(srcDir, 'wrapper.gradle'), projectPath); - } else { - shell.cp('-f', path.join(srcDir, 'build.gradle'), projectPath); - shell.cp('-f', path.join(srcDir, 'app', 'build.gradle'), path.join(projectPath, 'app')); - shell.cp('-f', path.join(srcDir, 'wrapper.gradle'), projectPath); - } -} - -function copyScripts (projectPath) { - var bin = path.join(ROOT, 'bin'); - var srcScriptsDir = path.join(bin, 'templates', 'cordova'); - var destScriptsDir = path.join(projectPath, 'cordova'); - // Delete old scripts directory if this is an update. - shell.rm('-rf', destScriptsDir); - // Copy in the new ones. - shell.cp('-r', srcScriptsDir, projectPath); - - let nodeModulesDir = path.join(ROOT, 'node_modules'); - if (fs.existsSync(nodeModulesDir)) shell.cp('-r', nodeModulesDir, destScriptsDir); - - shell.cp(path.join(bin, 'check_reqs*'), destScriptsDir); - shell.cp(path.join(bin, 'android_sdk_version*'), destScriptsDir); - var check_reqs = path.join(destScriptsDir, 'check_reqs'); - var android_sdk_version = path.join(destScriptsDir, 'android_sdk_version'); - // TODO: the two files being edited on-the-fly here are shared between - // platform and project-level commands. the below `sed` is updating the - // `require` path for the two libraries. if there's a better way to share - // modules across both the repo and generated projects, we should make sure - // to remove/update this. - shell.sed('-i', /templates\/cordova\//, '', android_sdk_version); - shell.sed('-i', /templates\/cordova\//, '', check_reqs); -} - -/** - * Test whether a package name is acceptable for use as an android project. - * Returns a promise, fulfilled if the package name is acceptable; rejected - * otherwise. - */ -function validatePackageName (package_name) { - // Make the package conform to Java package types - // http://developer.android.com/guide/topics/manifest/manifest-element.html#package - // Enforce underscore limitation - var msg = 'Error validating package name. '; - - if (!/^[a-zA-Z][a-zA-Z0-9_]+(\.[a-zA-Z][a-zA-Z0-9_]*)+$/.test(package_name)) { - return Q.reject(new CordovaError(msg + 'Must look like: `com.company.Name`. Currently is: `' + package_name + '`')); - } - - // Class is a reserved word - if (/\b[Cc]lass\b/.test(package_name)) { - return Q.reject(new CordovaError(msg + '"class" is a reserved word')); - } - - return Q.resolve(); -} - -/** - * Test whether a project name is acceptable for use as an android class. - * Returns a promise, fulfilled if the project name is acceptable; rejected - * otherwise. - */ -function validateProjectName (project_name) { - var msg = 'Error validating project name. '; - // Make sure there's something there - if (project_name === '') { - return Q.reject(new CordovaError(msg + 'Project name cannot be empty')); - } - - // Enforce stupid name error - if (project_name === 'CordovaActivity') { - return Q.reject(new CordovaError(msg + 'Project name cannot be CordovaActivity')); - } - - // Classes in Java don't begin with numbers - if (/^[0-9]/.test(project_name)) { - return Q.reject(new CordovaError(msg + 'Project name must not begin with a number')); - } - - return Q.resolve(); -} - -/** - * Creates an android application with the given options. - * - * @param {String} project_path Path to the new Cordova android project. - * @param {ConfigParser} config Instance of ConfigParser to retrieve basic - * project properties. - * @param {Object} [options={}] Various options - * @param {String} [options.activityName='MainActivity'] Name for the - * activity - * @param {Boolean} [options.link=false] Specifies whether javascript files - * and CordovaLib framework will be symlinked to created application. - * @param {String} [options.customTemplate] Path to project template - * (override) - * @param {EventEmitter} [events] An EventEmitter instance for logging - * events - * - * @return {Promise} Directory where application has been created - */ -exports.create = function (project_path, config, options, events) { - - options = options || {}; - - // Set default values for path, package and name - project_path = path.relative(process.cwd(), (project_path || 'CordovaExample')); - // Check if project already exists - if (fs.existsSync(project_path)) { - return Q.reject(new CordovaError('Project already exists! Delete and recreate')); - } - - var package_name = config.android_packageName() || config.packageName() || 'my.cordova.project'; - var project_name = config.name() ? - config.name().replace(/[^\w.]/g, '_') : 'CordovaExample'; - - var safe_activity_name = config.android_activityName() || options.activityName || 'MainActivity'; - var target_api = check_reqs.get_target(); - - // Make the package conform to Java package types - return exports.validatePackageName(package_name) - .then(function () { - return exports.validateProjectName(project_name); - }).then(function () { - // Log the given values for the project - events.emit('log', 'Creating Cordova project for the Android platform:'); - events.emit('log', '\tPath: ' + project_path); - events.emit('log', '\tPackage: ' + package_name); - events.emit('log', '\tName: ' + project_name); - events.emit('log', '\tActivity: ' + safe_activity_name); - events.emit('log', '\tAndroid target: ' + target_api); - - events.emit('verbose', 'Copying android template project to ' + project_path); - - exports.setShellFatal(true, function () { - var project_template_dir = options.customTemplate || path.join(ROOT, 'bin', 'templates', 'project'); - var app_path = path.join(project_path, 'app', 'src', 'main'); - - // copy project template - shell.mkdir('-p', app_path); - shell.cp('-r', path.join(project_template_dir, 'assets'), app_path); - shell.cp('-r', path.join(project_template_dir, 'res'), app_path); - shell.cp(path.join(project_template_dir, 'gitignore'), path.join(project_path, '.gitignore')); - - // Manually create directories that would be empty within the template (since git doesn't track directories). - shell.mkdir(path.join(app_path, 'libs')); - - // copy cordova.js, cordova.jar - exports.copyJsAndLibrary(project_path, options.link, safe_activity_name); - - // Set up ther Android Studio paths - var java_path = path.join(app_path, 'java'); - var assets_path = path.join(app_path, 'assets'); - var resource_path = path.join(app_path, 'res'); - shell.mkdir('-p', java_path); - shell.mkdir('-p', assets_path); - shell.mkdir('-p', resource_path); - - // interpolate the activity name and package - var packagePath = package_name.replace(/\./g, path.sep); - var activity_dir = path.join(java_path, packagePath); - var activity_path = path.join(activity_dir, safe_activity_name + '.java'); - - shell.mkdir('-p', activity_dir); - shell.cp('-f', path.join(project_template_dir, 'Activity.java'), activity_path); - shell.sed('-i', /__ACTIVITY__/, safe_activity_name, activity_path); - shell.sed('-i', /__NAME__/, project_name, path.join(app_path, 'res', 'values', 'strings.xml')); - shell.sed('-i', /__ID__/, package_name, activity_path); - - var manifest = new AndroidManifest(path.join(project_template_dir, 'AndroidManifest.xml')); - manifest.setPackageId(package_name) - .getActivity().setName(safe_activity_name); - - var manifest_path = path.join(app_path, 'AndroidManifest.xml'); - manifest.write(manifest_path); - - exports.copyScripts(project_path); - exports.copyBuildRules(project_path); - }); - // Link it to local android install. - exports.writeProjectProperties(project_path, target_api); - exports.prepBuildFiles(project_path); - events.emit('log', generateDoneMessage('create', options.link)); - }).thenResolve(project_path); -}; - -function generateDoneMessage (type, link) { - var pkg = require('../../package'); - var msg = 'Android project ' + (type === 'update' ? 'updated ' : 'created ') + 'with ' + pkg.name + '@' + pkg.version; - if (link) { - msg += ' and has a linked CordovaLib'; - } - return msg; -} - -// Returns a promise. -exports.update = function (projectPath, options, events) { - - var errorString = - 'An in-place platform update is not supported. \n' + - 'The `platforms` folder is always treated as a build artifact in the CLI workflow.\n' + - 'To update your platform, you have to remove, then add your android platform again.\n' + - 'Make sure you save your plugins beforehand using `cordova plugin save`, and save \n' + 'a copy of the platform first if you had manual changes in it.\n' + - '\tcordova plugin save\n' + - '\tcordova platform rm android\n' + - '\tcordova platform add android\n' - ; - - return Q.reject(errorString); -}; diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/Api.js b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/Api.js deleted file mode 100644 index dd4a209..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/Api.js +++ /dev/null @@ -1,368 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -var path = require('path'); -var Q = require('q'); - -var AndroidProject = require('./lib/AndroidProject'); -var PluginManager = require('cordova-common').PluginManager; - -var CordovaLogger = require('cordova-common').CordovaLogger; -var selfEvents = require('cordova-common').events; -var ConfigParser = require('cordova-common').ConfigParser; - -var PLATFORM = 'android'; - -function setupEvents (externalEventEmitter) { - if (externalEventEmitter) { - // This will make the platform internal events visible outside - selfEvents.forwardEventsTo(externalEventEmitter); - return externalEventEmitter; - } - - // There is no logger if external emitter is not present, - // so attach a console logger - CordovaLogger.get().subscribe(selfEvents); - return selfEvents; -} - -/** - * Class, that acts as abstraction over particular platform. Encapsulates the - * platform's properties and methods. - * - * Platform that implements own PlatformApi instance _should implement all - * prototype methods_ of this class to be fully compatible with cordova-lib. - * - * The PlatformApi instance also should define the following field: - * - * * platform: String that defines a platform name. - */ -function Api (platform, platformRootDir, events) { - this.platform = PLATFORM; - this.root = path.resolve(__dirname, '..'); - - setupEvents(events); - - const appMain = path.join(this.root, 'app', 'src', 'main'); - const appRes = path.join(appMain, 'res'); - - this.locations = { - root: this.root, - www: path.join(appMain, 'assets', 'www'), - res: appRes, - platformWww: path.join(this.root, 'platform_www'), - configXml: path.join(appRes, 'xml', 'config.xml'), - defaultConfigXml: path.join(this.root, 'cordova', 'defaults.xml'), - strings: path.join(appRes, 'values', 'strings.xml'), - manifest: path.join(appMain, 'AndroidManifest.xml'), - build: path.join(this.root, 'build'), - javaSrc: path.join(appMain, 'java') - }; -} - -/** - * Installs platform to specified directory and creates a platform project. - * - * @param {String} destination Destination directory, where insatll platform to - * @param {ConfigParser} [config] ConfgiParser instance, used to retrieve - * project creation options, such as package id and project name. - * @param {Object} [options] An options object. The most common options are: - * @param {String} [options.customTemplate] A path to custom template, that - * should override the default one from platform. - * @param {Boolean} [options.link] Flag that indicates that platform's - * sources will be linked to installed platform instead of copying. - * @param {EventEmitter} [events] An EventEmitter instance that will be used for - * logging purposes. If no EventEmitter provided, all events will be logged to - * console - * - * @return {Promise} Promise either fulfilled with PlatformApi - * instance or rejected with CordovaError. - */ -Api.createPlatform = function (destination, config, options, events) { - events = setupEvents(events); - var result; - try { - result = require('../../lib/create').create(destination, config, options, events).then(function (destination) { - return new Api(PLATFORM, destination, events); - }); - } catch (e) { - events.emit('error', 'createPlatform is not callable from the android project API.'); - throw (e); - } - return result; -}; - -/** - * Updates already installed platform. - * - * @param {String} destination Destination directory, where platform installed - * @param {Object} [options] An options object. The most common options are: - * @param {String} [options.customTemplate] A path to custom template, that - * should override the default one from platform. - * @param {Boolean} [options.link] Flag that indicates that platform's - * sources will be linked to installed platform instead of copying. - * @param {EventEmitter} [events] An EventEmitter instance that will be used for - * logging purposes. If no EventEmitter provided, all events will be logged to - * console - * - * @return {Promise} Promise either fulfilled with PlatformApi - * instance or rejected with CordovaError. - */ -Api.updatePlatform = function (destination, options, events) { - events = setupEvents(events); - var result; - try { - result = require('../../lib/create').update(destination, options, events).then(function (destination) { - return new Api(PLATFORM, destination, events); - }); - } catch (e) { - events.emit('error', 'updatePlatform is not callable from the android project API, you will need to do this manually.'); - throw (e); - } - return result; -}; - -/** - * Gets a CordovaPlatform object, that represents the platform structure. - * - * @return {CordovaPlatform} A structure that contains the description of - * platform's file structure and other properties of platform. - */ -Api.prototype.getPlatformInfo = function () { - var result = {}; - result.locations = this.locations; - result.root = this.root; - result.name = this.platform; - result.version = require('./version'); - result.projectConfig = this._config; - - return result; -}; - -/** - * Updates installed platform with provided www assets and new app - * configuration. This method is required for CLI workflow and will be called - * each time before build, so the changes, made to app configuration and www - * code, will be applied to platform. - * - * @param {CordovaProject} cordovaProject A CordovaProject instance, that defines a - * project structure and configuration, that should be applied to platform - * (contains project's www location and ConfigParser instance for project's - * config). - * - * @return {Promise} Return a promise either fulfilled, or rejected with - * CordovaError instance. - */ -Api.prototype.prepare = function (cordovaProject, prepareOptions) { - cordovaProject.projectConfig = new ConfigParser(cordovaProject.locations.rootConfigXml || cordovaProject.projectConfig.path); - - return require('./lib/prepare').prepare.call(this, cordovaProject, prepareOptions); -}; - -/** - * Installs a new plugin into platform. This method only copies non-www files - * (sources, libs, etc.) to platform. It also doesn't resolves the - * dependencies of plugin. Both of handling of www files, such as assets and - * js-files and resolving dependencies are the responsibility of caller. - * - * @param {PluginInfo} plugin A PluginInfo instance that represents plugin - * that will be installed. - * @param {Object} installOptions An options object. Possible options below: - * @param {Boolean} installOptions.link: Flag that specifies that plugin - * sources will be symlinked to app's directory instead of copying (if - * possible). - * @param {Object} installOptions.variables An object that represents - * variables that will be used to install plugin. See more details on plugin - * variables in documentation: - * https://cordova.apache.org/docs/en/4.0.0/plugin_ref_spec.md.html - * - * @return {Promise} Return a promise either fulfilled, or rejected with - * CordovaError instance. - */ -Api.prototype.addPlugin = function (plugin, installOptions) { - var project = AndroidProject.getProjectFile(this.root); - var self = this; - - installOptions = installOptions || {}; - installOptions.variables = installOptions.variables || {}; - // Add PACKAGE_NAME variable into vars - if (!installOptions.variables.PACKAGE_NAME) { - installOptions.variables.PACKAGE_NAME = project.getPackageName(); - } - - return Q().then(function () { - return PluginManager.get(self.platform, self.locations, project).addPlugin(plugin, installOptions); - }).then(function () { - if (plugin.getFrameworks(this.platform).length === 0) return; - selfEvents.emit('verbose', 'Updating build files since android plugin contained '); - // This should pick the correct builder, not just get gradle - require('./lib/builders/builders').getBuilder().prepBuildFiles(); - }.bind(this)) - // CB-11022 Return truthy value to prevent running prepare after - .thenResolve(true); -}; - -/** - * Removes an installed plugin from platform. - * - * Since method accepts PluginInfo instance as input parameter instead of plugin - * id, caller shoud take care of managing/storing PluginInfo instances for - * future uninstalls. - * - * @param {PluginInfo} plugin A PluginInfo instance that represents plugin - * that will be installed. - * - * @return {Promise} Return a promise either fulfilled, or rejected with - * CordovaError instance. - */ -Api.prototype.removePlugin = function (plugin, uninstallOptions) { - var project = AndroidProject.getProjectFile(this.root); - - if (uninstallOptions && uninstallOptions.usePlatformWww === true) { - uninstallOptions.usePlatformWww = false; - } - - return PluginManager.get(this.platform, this.locations, project) - .removePlugin(plugin, uninstallOptions) - .then(function () { - if (plugin.getFrameworks(this.platform).length === 0) return; - - selfEvents.emit('verbose', 'Updating build files since android plugin contained '); - require('./lib/builders/builders').getBuilder().prepBuildFiles(); - }.bind(this)) - // CB-11022 Return truthy value to prevent running prepare after - .thenResolve(true); -}; - -/** - * Builds an application package for current platform. - * - * @param {Object} buildOptions A build options. This object's structure is - * highly depends on platform's specific. The most common options are: - * @param {Boolean} buildOptions.debug Indicates that packages should be - * built with debug configuration. This is set to true by default unless the - * 'release' option is not specified. - * @param {Boolean} buildOptions.release Indicates that packages should be - * built with release configuration. If not set to true, debug configuration - * will be used. - * @param {Boolean} buildOptions.device Specifies that built app is intended - * to run on device - * @param {Boolean} buildOptions.emulator: Specifies that built app is - * intended to run on emulator - * @param {String} buildOptions.target Specifies the device id that will be - * used to run built application. - * @param {Boolean} buildOptions.nobuild Indicates that this should be a - * dry-run call, so no build artifacts will be produced. - * @param {String[]} buildOptions.archs Specifies chip architectures which - * app packages should be built for. List of valid architectures is depends on - * platform. - * @param {String} buildOptions.buildConfig The path to build configuration - * file. The format of this file is depends on platform. - * @param {String[]} buildOptions.argv Raw array of command-line arguments, - * passed to `build` command. The purpose of this property is to pass a - * platform-specific arguments, and eventually let platform define own - * arguments processing logic. - * - * @return {Promise} A promise either fulfilled with an array of build - * artifacts (application packages) if package was built successfully, - * or rejected with CordovaError. The resultant build artifact objects is not - * strictly typed and may conatin arbitrary set of fields as in sample below. - * - * { - * architecture: 'x86', - * buildType: 'debug', - * path: '/path/to/build', - * type: 'app' - * } - * - * The return value in most cases will contain only one item but in some cases - * there could be multiple items in output array, e.g. when multiple - * arhcitectures is specified. - */ -Api.prototype.build = function (buildOptions) { - var self = this; - - return require('./lib/check_reqs').run().then(function () { - return require('./lib/build').run.call(self, buildOptions); - }).then(function (buildResults) { - // Cast build result to array of build artifacts - return buildResults.paths.map(function (apkPath) { - return { - buildType: buildResults.buildType, - buildMethod: buildResults.buildMethod, - path: apkPath, - type: path.extname(apkPath).replace(/\./g, '') - }; - }); - }); -}; - -/** - * Builds an application package for current platform and runs it on - * specified/default device. If no 'device'/'emulator'/'target' options are - * specified, then tries to run app on default device if connected, otherwise - * runs the app on emulator. - * - * @param {Object} runOptions An options object. The structure is the same - * as for build options. - * - * @return {Promise} A promise either fulfilled if package was built and ran - * successfully, or rejected with CordovaError. - */ -Api.prototype.run = function (runOptions) { - var self = this; - return require('./lib/check_reqs').run().then(function () { - return require('./lib/run').run.call(self, runOptions); - }); -}; - -/** - * Cleans out the build artifacts from platform's directory, and also - * cleans out the platform www directory if called without options specified. - * - * @return {Promise} Return a promise either fulfilled, or rejected with - * CordovaError. - */ -Api.prototype.clean = function (cleanOptions) { - var self = this; - // This will lint, checking for null won't - if (typeof cleanOptions === 'undefined') { - cleanOptions = {}; - } - - return require('./lib/check_reqs').run().then(function () { - return require('./lib/build').runClean.call(self, cleanOptions); - }).then(function () { - return require('./lib/prepare').clean.call(self, cleanOptions); - }); -}; - -/** - * Performs a requirements check for current platform. Each platform defines its - * own set of requirements, which should be resolved before platform can be - * built successfully. - * - * @return {Promise} Promise, resolved with set of Requirement - * objects for current platform. - */ -Api.prototype.requirements = function () { - return require('./lib/check_reqs').check_all(); -}; - -module.exports = Api; diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/build b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/build deleted file mode 100755 index d703547..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/build +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env node - -/* - 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 args = process.argv; -var Api = require('./Api'); -var nopt = require('nopt'); -var path = require('path'); - -// Support basic help commands -if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(args[2]) >= 0) { - require('./lib/build').help(); -} - -// Do some basic argument parsing -var buildOpts = nopt({ - 'verbose': Boolean, - 'silent': Boolean, - 'debug': Boolean, - 'release': Boolean, - 'nobuild': Boolean, - 'buildConfig': path -}, { 'd': '--verbose' }); - -// Make buildOptions compatible with PlatformApi build method spec -buildOpts.argv = buildOpts.argv.original; - -require('./loggingHelper').adjustLoggerLevel(buildOpts); - -new Api().build(buildOpts) - .catch(function (err) { - console.error(err.stack); - process.exit(2); - }); diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/build.bat b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/build.bat deleted file mode 100644 index 46e966a..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/build.bat +++ /dev/null @@ -1,26 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. - -@ECHO OFF -SET script_path="%~dp0build" -IF EXIST %script_path% ( - node %script_path% %* -) ELSE ( - ECHO. - ECHO ERROR: Could not find 'build' script in 'cordova' folder, aborting...>&2 - EXIT /B 1 -) \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/clean b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/clean deleted file mode 100755 index 9db5847..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/clean +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env node - -/* - 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 Api = require('./Api'); -var path = require('path'); -var nopt = require('nopt'); - -// Support basic help commands -if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) >= 0) { - console.log('Usage: ' + path.relative(process.cwd(), process.argv[1])); - console.log('Cleans the project directory.'); - process.exit(0); -} - -// Do some basic argument parsing -var opts = nopt({ - 'verbose': Boolean, - 'silent': Boolean -}, { 'd': '--verbose' }); - -// Make buildOptions compatible with PlatformApi clean method spec -opts.argv = opts.argv.original; - -// Skip cleaning prepared files when not invoking via cordova CLI. -opts.noPrepare = true; - -require('./loggingHelper').adjustLoggerLevel(opts); - -new Api().clean(opts) - .catch(function (err) { - console.error(err.stack); - process.exit(2); - }); diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/clean.bat b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/clean.bat deleted file mode 100644 index 445ef6e..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/clean.bat +++ /dev/null @@ -1,26 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. - -@ECHO OFF -SET script_path="%~dp0clean" -IF EXIST %script_path% ( - node %script_path% %* -) ELSE ( - ECHO. - ECHO ERROR: Could not find 'clean' script in 'cordova' folder, aborting...>&2 - EXIT /B 1 -) \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/defaults.xml b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/defaults.xml deleted file mode 100644 index 5286ab9..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/defaults.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/Adb.js b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/Adb.js deleted file mode 100644 index b6ad8f1..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/Adb.js +++ /dev/null @@ -1,101 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -var Q = require('q'); -var os = require('os'); -var events = require('cordova-common').events; -var spawn = require('cordova-common').superspawn.spawn; -var CordovaError = require('cordova-common').CordovaError; - -var Adb = {}; - -function isDevice (line) { - return line.match(/\w+\tdevice/) && !line.match(/emulator/); -} - -function isEmulator (line) { - return line.match(/device/) && line.match(/emulator/); -} - -/** - * Lists available/connected devices and emulators - * - * @param {Object} opts Various options - * @param {Boolean} opts.emulators Specifies whether this method returns - * emulators only - * - * @return {Promise} list of available/connected - * devices/emulators - */ -Adb.devices = function (opts) { - return spawn('adb', ['devices'], { cwd: os.tmpdir() }).then(function (output) { - return output.split('\n').filter(function (line) { - // Filter out either real devices or emulators, depending on options - return (line && opts && opts.emulators) ? isEmulator(line) : isDevice(line); - }).map(function (line) { - return line.replace(/\tdevice/, '').replace('\r', ''); - }); - }); -}; - -Adb.install = function (target, packagePath, opts) { - events.emit('verbose', 'Installing apk ' + packagePath + ' on target ' + target + '...'); - var args = ['-s', target, 'install']; - if (opts && opts.replace) args.push('-r'); - return spawn('adb', args.concat(packagePath), { cwd: os.tmpdir() }).then(function (output) { - // 'adb install' seems to always returns no error, even if installation fails - // so we catching output to detect installation failure - if (output.match(/Failure/)) { - if (output.match(/INSTALL_PARSE_FAILED_NO_CERTIFICATES/)) { - output += '\n\n' + 'Sign the build using \'-- --keystore\' or \'--buildConfig\'' + - ' or sign and deploy the unsigned apk manually using Android tools.'; - } else if (output.match(/INSTALL_FAILED_VERSION_DOWNGRADE/)) { - output += '\n\n' + 'You\'re trying to install apk with a lower versionCode that is already installed.' + - '\nEither uninstall an app or increment the versionCode.'; - } - - return Q.reject(new CordovaError('Failed to install apk to device: ' + output)); - } - }); -}; - -Adb.uninstall = function (target, packageId) { - events.emit('verbose', 'Uninstalling package ' + packageId + ' from target ' + target + '...'); - return spawn('adb', ['-s', target, 'uninstall', packageId], { cwd: os.tmpdir() }); -}; - -Adb.shell = function (target, shellCommand) { - events.emit('verbose', 'Running adb shell command "' + shellCommand + '" on target ' + target + '...'); - var args = ['-s', target, 'shell']; - shellCommand = shellCommand.split(/\s+/); - return spawn('adb', args.concat(shellCommand), { cwd: os.tmpdir() }).catch(function (output) { - return Q.reject(new CordovaError('Failed to execute shell command "' + - shellCommand + '"" on device: ' + output)); - }); -}; - -Adb.start = function (target, activityName) { - events.emit('verbose', 'Starting application "' + activityName + '" on target ' + target + '...'); - return Adb.shell(target, 'am start -W -a android.intent.action.MAIN -n' + activityName).catch(function (output) { - return Q.reject(new CordovaError('Failed to start application "' + - activityName + '"" on device: ' + output)); - }); -}; - -module.exports = Adb; diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/AndroidManifest.js b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/AndroidManifest.js deleted file mode 100644 index a4489f1..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/AndroidManifest.js +++ /dev/null @@ -1,126 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -var fs = require('fs'); -var xml = require('cordova-common').xmlHelpers; - -var DEFAULT_ORIENTATION = 'default'; - -/** Wraps an AndroidManifest file */ -function AndroidManifest (path) { - this.path = path; - this.doc = xml.parseElementtreeSync(path); - if (this.doc.getroot().tag !== 'manifest') { - throw new Error('AndroidManifest at ' + path + ' has incorrect root node name (expected "manifest")'); - } -} - -AndroidManifest.prototype.getVersionName = function () { - return this.doc.getroot().attrib['android:versionName']; -}; - -AndroidManifest.prototype.setVersionName = function (versionName) { - this.doc.getroot().attrib['android:versionName'] = versionName; - return this; -}; - -AndroidManifest.prototype.getVersionCode = function () { - return this.doc.getroot().attrib['android:versionCode']; -}; - -AndroidManifest.prototype.setVersionCode = function (versionCode) { - this.doc.getroot().attrib['android:versionCode'] = versionCode; - return this; -}; - -AndroidManifest.prototype.getPackageId = function () { - return this.doc.getroot().attrib['package']; -}; - -AndroidManifest.prototype.setPackageId = function (pkgId) { - this.doc.getroot().attrib['package'] = pkgId; - return this; -}; - -AndroidManifest.prototype.getActivity = function () { - var activity = this.doc.getroot().find('./application/activity'); - return { - getName: function () { - return activity.attrib['android:name']; - }, - setName: function (name) { - if (!name) { - delete activity.attrib['android:name']; - } else { - activity.attrib['android:name'] = name; - } - return this; - }, - getOrientation: function () { - return activity.attrib['android:screenOrientation']; - }, - setOrientation: function (orientation) { - if (!orientation || orientation.toLowerCase() === DEFAULT_ORIENTATION) { - delete activity.attrib['android:screenOrientation']; - } else { - activity.attrib['android:screenOrientation'] = orientation; - } - return this; - }, - getLaunchMode: function () { - return activity.attrib['android:launchMode']; - }, - setLaunchMode: function (launchMode) { - if (!launchMode) { - delete activity.attrib['android:launchMode']; - } else { - activity.attrib['android:launchMode'] = launchMode; - } - return this; - } - }; -}; - -AndroidManifest.prototype.getDebuggable = function () { - return this.doc.getroot().find('./application').attrib['android:debuggable'] === 'true'; -}; - -AndroidManifest.prototype.setDebuggable = function (value) { - var application = this.doc.getroot().find('./application'); - if (value) { - application.attrib['android:debuggable'] = 'true'; - } else { - // The default value is "false", so we can remove attribute at all. - delete application.attrib['android:debuggable']; - } - return this; -}; - -/** - * Writes manifest to disk syncronously. If filename is specified, then manifest - * will be written to that file - * - * @param {String} [destPath] File to write manifest to. If omitted, - * manifest will be written to file it has been read from. - */ -AndroidManifest.prototype.write = function (destPath) { - fs.writeFileSync(destPath || this.path, this.doc.write({ indent: 4 }), 'utf-8'); -}; - -module.exports = AndroidManifest; diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/AndroidProject.js b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/AndroidProject.js deleted file mode 100644 index 3c2586a..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/AndroidProject.js +++ /dev/null @@ -1,202 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -var fs = require('fs'); -var path = require('path'); -var properties_parser = require('properties-parser'); -var AndroidManifest = require('./AndroidManifest'); -var pluginHandlers = require('./pluginHandlers'); - -var projectFileCache = {}; - -function addToPropertyList (projectProperties, key, value) { - var i = 1; - while (projectProperties.get(key + '.' + i)) { i++; } - - projectProperties.set(key + '.' + i, value); - projectProperties.dirty = true; -} - -function removeFromPropertyList (projectProperties, key, value) { - var i = 1; - var currentValue; - while ((currentValue = projectProperties.get(key + '.' + i))) { - if (currentValue === value) { - while ((currentValue = projectProperties.get(key + '.' + (i + 1)))) { - projectProperties.set(key + '.' + i, currentValue); - i++; - } - projectProperties.set(key + '.' + i); - break; - } - i++; - } - projectProperties.dirty = true; -} - -function getRelativeLibraryPath (parentDir, subDir) { - var libraryPath = path.relative(parentDir, subDir); - return (path.sep === '\\') ? libraryPath.replace(/\\/g, '/') : libraryPath; -} - -function AndroidProject (projectDir) { - this._propertiesEditors = {}; - this._subProjectDirs = {}; - this._dirty = false; - this.projectDir = projectDir; - this.platformWww = path.join(this.projectDir, 'platform_www'); - this.www = path.join(this.projectDir, 'app/src/main/assets/www'); -} - -AndroidProject.getProjectFile = function (projectDir) { - if (!projectFileCache[projectDir]) { - projectFileCache[projectDir] = new AndroidProject(projectDir); - } - - return projectFileCache[projectDir]; -}; - -AndroidProject.purgeCache = function (projectDir) { - if (projectDir) { - delete projectFileCache[projectDir]; - } else { - projectFileCache = {}; - } -}; - -/** - * Reads the package name out of the Android Manifest file - * - * @param {String} projectDir The absolute path to the directory containing the project - * - * @return {String} The name of the package - */ -AndroidProject.prototype.getPackageName = function () { - var manifestPath = path.join(this.projectDir, 'app/src/main/AndroidManifest.xml'); - return new AndroidManifest(manifestPath).getPackageId(); -}; - -AndroidProject.prototype.getCustomSubprojectRelativeDir = function (plugin_id, src) { - // All custom subprojects are prefixed with the last portion of the package id. - // This is to avoid collisions when opening multiple projects in Eclipse that have subprojects with the same name. - var packageName = this.getPackageName(); - var lastDotIndex = packageName.lastIndexOf('.'); - var prefix = packageName.substring(lastDotIndex + 1); - var subRelativeDir = path.join(plugin_id, prefix + '-' + path.basename(src)); - return subRelativeDir; -}; - -AndroidProject.prototype.addSubProject = function (parentDir, subDir) { - var parentProjectFile = path.resolve(parentDir, 'project.properties'); - var subProjectFile = path.resolve(subDir, 'project.properties'); - var parentProperties = this._getPropertiesFile(parentProjectFile); - // TODO: Setting the target needs to happen only for pre-3.7.0 projects - if (fs.existsSync(subProjectFile)) { - var subProperties = this._getPropertiesFile(subProjectFile); - subProperties.set('target', parentProperties.get('target')); - subProperties.dirty = true; - this._subProjectDirs[subDir] = true; - } - addToPropertyList(parentProperties, 'android.library.reference', getRelativeLibraryPath(parentDir, subDir)); - - this._dirty = true; -}; - -AndroidProject.prototype.removeSubProject = function (parentDir, subDir) { - var parentProjectFile = path.resolve(parentDir, 'project.properties'); - var parentProperties = this._getPropertiesFile(parentProjectFile); - removeFromPropertyList(parentProperties, 'android.library.reference', getRelativeLibraryPath(parentDir, subDir)); - delete this._subProjectDirs[subDir]; - this._dirty = true; -}; - -AndroidProject.prototype.addGradleReference = function (parentDir, subDir) { - var parentProjectFile = path.resolve(parentDir, 'project.properties'); - var parentProperties = this._getPropertiesFile(parentProjectFile); - addToPropertyList(parentProperties, 'cordova.gradle.include', getRelativeLibraryPath(parentDir, subDir)); - this._dirty = true; -}; - -AndroidProject.prototype.removeGradleReference = function (parentDir, subDir) { - var parentProjectFile = path.resolve(parentDir, 'project.properties'); - var parentProperties = this._getPropertiesFile(parentProjectFile); - removeFromPropertyList(parentProperties, 'cordova.gradle.include', getRelativeLibraryPath(parentDir, subDir)); - this._dirty = true; -}; - -AndroidProject.prototype.addSystemLibrary = function (parentDir, value) { - var parentProjectFile = path.resolve(parentDir, 'project.properties'); - var parentProperties = this._getPropertiesFile(parentProjectFile); - addToPropertyList(parentProperties, 'cordova.system.library', value); - this._dirty = true; -}; - -AndroidProject.prototype.removeSystemLibrary = function (parentDir, value) { - var parentProjectFile = path.resolve(parentDir, 'project.properties'); - var parentProperties = this._getPropertiesFile(parentProjectFile); - removeFromPropertyList(parentProperties, 'cordova.system.library', value); - this._dirty = true; -}; - -AndroidProject.prototype.write = function () { - if (!this._dirty) { - return; - } - this._dirty = false; - - for (var filename in this._propertiesEditors) { - var editor = this._propertiesEditors[filename]; - if (editor.dirty) { - fs.writeFileSync(filename, editor.toString()); - editor.dirty = false; - } - } -}; - -AndroidProject.prototype._getPropertiesFile = function (filename) { - if (!this._propertiesEditors[filename]) { - if (fs.existsSync(filename)) { - this._propertiesEditors[filename] = properties_parser.createEditor(filename); - } else { - this._propertiesEditors[filename] = properties_parser.createEditor(); - } - } - - return this._propertiesEditors[filename]; -}; - -AndroidProject.prototype.getInstaller = function (type) { - return pluginHandlers.getInstaller(type); -}; - -AndroidProject.prototype.getUninstaller = function (type) { - return pluginHandlers.getUninstaller(type); -}; - -/* - * This checks if an Android project is clean or has old build artifacts - */ - -AndroidProject.prototype.isClean = function () { - var build_path = path.join(this.projectDir, 'build'); - // If the build directory doesn't exist, it's clean - return !(fs.existsSync(build_path)); -}; - -module.exports = AndroidProject; diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/PackageType.js b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/PackageType.js deleted file mode 100644 index fd129f1..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/PackageType.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -const PackageType = { - APK: 'apk', - BUNDLE: 'bundle' -}; - -module.exports = PackageType; diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/android_sdk.js b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/android_sdk.js deleted file mode 100755 index 1c0ab20..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/android_sdk.js +++ /dev/null @@ -1,101 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -var superspawn = require('cordova-common').superspawn; - -var suffix_number_regex = /(\d+)$/; -// Used for sorting Android targets, example strings to sort: -// android-19 -// android-L -// Google Inc.:Google APIs:20 -// Google Inc.:Glass Development Kit Preview:20 -// The idea is to sort based on largest "suffix" number - meaning the bigger -// the number at the end, the more recent the target, the closer to the -// start of the array. -function sort_by_largest_numerical_suffix (a, b) { - var suffix_a = a.match(suffix_number_regex); - var suffix_b = b.match(suffix_number_regex); - if (suffix_a && suffix_b) { - // If the two targets being compared have suffixes, return less than - // zero, or greater than zero, based on which suffix is larger. - return (parseInt(suffix_a[1]) > parseInt(suffix_b[1]) ? -1 : 1); - } else { - // If no suffix numbers were detected, leave the order as-is between - // elements a and b. - return 0; - } -} - -module.exports.print_newest_available_sdk_target = function () { - return module.exports.list_targets().then(function (targets) { - targets.sort(sort_by_largest_numerical_suffix); - console.log(targets[0]); - }); -}; - -module.exports.version_string_to_api_level = { - '4.0': 14, - '4.0.3': 15, - '4.1': 16, - '4.2': 17, - '4.3': 18, - '4.4': 19, - '4.4W': 20, - '5.0': 21, - '5.1': 22, - '6.0': 23, - '7.0': 24, - '7.1.1': 25, - '8.0': 26 -}; - -function parse_targets (output) { - var target_out = output.split('\n'); - var targets = []; - for (var i = target_out.length - 1; i >= 0; i--) { - if (target_out[i].match(/id:/)) { // if "id:" is in the line... - targets.push(target_out[i].match(/"(.+)"/)[1]); // .. match whatever is in quotes. - } - } - return targets; -} - -module.exports.list_targets_with_android = function () { - return superspawn.spawn('android', ['list', 'target']).then(parse_targets); -}; - -module.exports.list_targets_with_avdmanager = function () { - return superspawn.spawn('avdmanager', ['list', 'target']).then(parse_targets); -}; - -module.exports.list_targets = function () { - return module.exports.list_targets_with_avdmanager().catch(function (err) { - // If there's an error, like avdmanager could not be found, we can try - // as a last resort, to run `android`, in case this is a super old - // SDK installation. - if (err && (err.code === 'ENOENT' || (err.stderr && err.stderr.match(/not recognized/)))) { - return module.exports.list_targets_with_android(); - } else throw err; - }).then(function (targets) { - if (targets.length === 0) { - return Promise.reject(new Error('No android targets (SDKs) installed!')); - } - return targets; - }); -}; diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/build.js b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/build.js deleted file mode 100644 index 0695539..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/build.js +++ /dev/null @@ -1,321 +0,0 @@ -#!/usr/bin/env node - -/* - 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 Q = require('q'); -var path = require('path'); -var fs = require('fs'); -var nopt = require('nopt'); - -var Adb = require('./Adb'); - -var builders = require('./builders/builders'); -var events = require('cordova-common').events; -var spawn = require('cordova-common').superspawn.spawn; -var CordovaError = require('cordova-common').CordovaError; -var PackageType = require('./PackageType'); - -module.exports.parseBuildOptions = parseOpts; -function parseOpts (options, resolvedTarget, projectRoot) { - options = options || {}; - options.argv = nopt({ - prepenv: Boolean, - versionCode: String, - minSdkVersion: String, - maxSdkVersion: String, - targetSdkVersion: String, - gradleArg: [String, Array], - keystore: path, - alias: String, - storePassword: String, - password: String, - keystoreType: String, - packageType: String - }, {}, options.argv, 0); - - // Android Studio Build method is the default - var ret = { - buildType: options.release ? 'release' : 'debug', - prepEnv: options.argv.prepenv, - arch: resolvedTarget && resolvedTarget.arch, - extraArgs: [] - }; - - if (options.argv.versionCode) { ret.extraArgs.push('-PcdvVersionCode=' + options.argv.versionCode); } - if (options.argv.minSdkVersion) { ret.extraArgs.push('-PcdvMinSdkVersion=' + options.argv.minSdkVersion); } - if (options.argv.maxSdkVersion) { ret.extraArgs.push('-PcdvMaxSdkVersion=' + options.argv.maxSdkVersion); } - if (options.argv.targetSdkVersion) { ret.extraArgs.push('-PcdvTargetSdkVersion=' + options.argv.targetSdkVersion); } - if (options.argv.gradleArg) { - ret.extraArgs = ret.extraArgs.concat(options.argv.gradleArg); - } - - var packageArgs = {}; - - if (options.argv.keystore) { packageArgs.keystore = path.relative(projectRoot, path.resolve(options.argv.keystore)); } - - ['alias', 'storePassword', 'password', 'keystoreType', 'packageType'].forEach(function (flagName) { - if (options.argv[flagName]) { packageArgs[flagName] = options.argv[flagName]; } - }); - - var buildConfig = options.buildConfig; - - // If some values are not specified as command line arguments - use build config to supplement them. - // Command line arguments have precedence over build config. - if (buildConfig) { - if (!fs.existsSync(buildConfig)) { - throw new Error('Specified build config file does not exist: ' + buildConfig); - } - events.emit('log', 'Reading build config file: ' + path.resolve(buildConfig)); - var buildjson = fs.readFileSync(buildConfig, 'utf8'); - var config = JSON.parse(buildjson.replace(/^\ufeff/, '')); // Remove BOM - if (config.android && config.android[ret.buildType]) { - var androidInfo = config.android[ret.buildType]; - if (androidInfo.keystore && !packageArgs.keystore) { - if (androidInfo.keystore.substr(0, 1) === '~') { - androidInfo.keystore = process.env.HOME + androidInfo.keystore.substr(1); - } - packageArgs.keystore = path.resolve(path.dirname(buildConfig), androidInfo.keystore); - events.emit('log', 'Reading the keystore from: ' + packageArgs.keystore); - } - - ['alias', 'storePassword', 'password', 'keystoreType', 'packageType'].forEach(function (key) { - packageArgs[key] = packageArgs[key] || androidInfo[key]; - }); - } - } - - if (packageArgs.keystore && packageArgs.alias) { - ret.packageInfo = new PackageInfo(packageArgs.keystore, packageArgs.alias, packageArgs.storePassword, - packageArgs.password, packageArgs.keystoreType); - } - - if (!ret.packageInfo) { - // The following loop is to decide whether to print a warning about generating a signed archive - // We only want to produce a warning if they are using a config property that is related to signing, but - // missing the required properties for signing. We don't want to produce a warning if they are simply - // using a build property that isn't related to signing, such as --packageType - let shouldWarn = false; - const signingKeys = ['keystore', 'alias', 'storePassword', 'password', 'keystoreType']; - - for (let key in packageArgs) { - if (!shouldWarn && signingKeys.indexOf(key) > -1) { - // If we enter this condition, we have a key used for signing a build, - // but we are missing some required signing properties - shouldWarn = true; - } - } - - if (shouldWarn) { - events.emit('warn', '\'keystore\' and \'alias\' need to be specified to generate a signed archive.'); - } - } - - if (packageArgs.packageType) { - const VALID_PACKAGE_TYPES = [PackageType.APK, PackageType.BUNDLE]; - if (VALID_PACKAGE_TYPES.indexOf(packageArgs.packageType) === -1) { - events.emit('warn', '"' + packageArgs.packageType + '" is an invalid packageType. Valid values are: ' + VALID_PACKAGE_TYPES.join(', ') + '\nDefaulting packageType to ' + PackageType.APK); - ret.packageType = PackageType.APK; - } else { - ret.packageType = packageArgs.packageType; - } - } else { - ret.packageType = PackageType.APK; - } - - return ret; -} - -/* - * Builds the project with the specifed options - * Returns a promise. - */ -module.exports.runClean = function (options) { - var opts = parseOpts(options, null, this.root); - var builder = builders.getBuilder(); - - return builder.prepEnv(opts).then(function () { - return builder.clean(opts); - }); -}; - -/** - * Builds the project with the specifed options. - * - * @param {BuildOptions} options A set of options. See PlatformApi.build - * method documentation for reference. - * @param {Object} optResolvedTarget A deployment target. Used to pass - * target architecture from upstream 'run' call. TODO: remove this option in - * favor of setting buildOptions.archs field. - * - * @return {Promise} Promise, resolved with built packages - * information. - */ -module.exports.run = function (options, optResolvedTarget) { - var opts = parseOpts(options, optResolvedTarget, this.root); - var builder = builders.getBuilder(); - - return builder.prepEnv(opts).then(function () { - if (opts.prepEnv) { - events.emit('verbose', 'Build file successfully prepared.'); - return; - } - return builder.build(opts).then(function () { - var paths; - if (opts.packageType === PackageType.BUNDLE) { - paths = builder.findOutputBundles(opts.buildType); - events.emit('log', 'Built the following bundle(s): \n\t' + paths.join('\n\t')); - } else { - paths = builder.findOutputApks(opts.buildType, opts.arch); - events.emit('log', 'Built the following apk(s): \n\t' + paths.join('\n\t')); - } - - return { - paths: paths, - buildType: opts.buildType - }; - }); - }); -}; - -/* - * Detects the architecture of a device/emulator - * Returns "arm" or "x86". - */ -module.exports.detectArchitecture = function (target) { - function helper () { - return Adb.shell(target, 'cat /proc/cpuinfo').then(function (output) { - return /intel/i.exec(output) ? 'x86' : 'arm'; - }); - } - // It sometimes happens (at least on OS X), that this command will hang forever. - // To fix it, either unplug & replug device, or restart adb server. - return helper().timeout(1000, new CordovaError('Device communication timed out. Try unplugging & replugging the device.')).then(null, function (err) { - if (/timed out/.exec('' + err)) { - // adb kill-server doesn't seem to do the trick. - // Could probably find a x-platform version of killall, but I'm not actually - // sure that this scenario even happens on non-OSX machines. - events.emit('verbose', 'adb timed out while detecting device/emulator architecture. Killing adb and trying again.'); - return spawn('killall', ['adb']).then(function () { - return helper().then(null, function () { - // The double kill is sadly often necessary, at least on mac. - events.emit('warn', 'adb timed out a second time while detecting device/emulator architecture. Killing adb and trying again.'); - return spawn('killall', ['adb']).then(function () { - return helper().then(null, function () { - return Q.reject(new CordovaError('adb timed out a third time while detecting device/emulator architecture. Try unplugging & replugging the device.')); - }); - }); - }); - }, function () { - // For non-killall OS's. - return Q.reject(err); - }); - } - throw err; - }); -}; - -module.exports.findBestApkForArchitecture = function (buildResults, arch) { - var paths = buildResults.apkPaths.filter(function (p) { - var apkName = path.basename(p); - if (buildResults.buildType === 'debug') { - return /-debug/.exec(apkName); - } - return !/-debug/.exec(apkName); - }); - var archPattern = new RegExp('-' + arch); - var hasArchPattern = /-x86|-arm/; - for (var i = 0; i < paths.length; ++i) { - var apkName = path.basename(paths[i]); - if (hasArchPattern.exec(apkName)) { - if (archPattern.exec(apkName)) { - return paths[i]; - } - } else { - return paths[i]; - } - } - throw new Error('Could not find apk architecture: ' + arch + ' build-type: ' + buildResults.buildType); -}; - -function PackageInfo (keystore, alias, storePassword, password, keystoreType) { - this.keystore = { - 'name': 'key.store', - 'value': keystore - }; - this.alias = { - 'name': 'key.alias', - 'value': alias - }; - if (storePassword) { - this.storePassword = { - 'name': 'key.store.password', - 'value': storePassword - }; - } - if (password) { - this.password = { - 'name': 'key.alias.password', - 'value': password - }; - } - if (keystoreType) { - this.keystoreType = { - 'name': 'key.store.type', - 'value': keystoreType - }; - } -} - -PackageInfo.prototype = { - toProperties: function () { - var self = this; - var result = ''; - Object.keys(self).forEach(function (key) { - result += self[key].name; - result += '='; - result += self[key].value.replace(/\\/g, '\\\\'); - result += '\n'; - }); - return result; - } -}; - -module.exports.help = function () { - console.log('Usage: ' + path.relative(process.cwd(), path.join('../build')) + ' [flags] [Signed APK flags]'); - console.log('Flags:'); - console.log(' \'--debug\': will build project in debug mode (default)'); - console.log(' \'--release\': will build project for release'); - console.log(' \'--nobuild\': will skip build process (useful when using run command)'); - console.log(' \'--prepenv\': don\'t build, but copy in build scripts where necessary'); - console.log(' \'--versionCode=#\': Override versionCode for this build. Useful for uploading multiple APKs.'); - console.log(' \'--minSdkVersion=#\': Override minSdkVersion for this build.'); - console.log(' \'--maxSdkVersion=#\': Override maxSdkVersion for this build. (Not Recommended)'); - console.log(' \'--targetSdkVersion=#\': Override targetSdkVersion for this build.'); - console.log(' \'--gradleArg=\': Extra args to pass to the gradle command. Use one flag per arg. Ex. --gradleArg=-PcdvBuildMultipleApks=true'); - console.log(' \'--packageType=\': Builds an APK or a bundle'); - console.log(''); - console.log('Signed APK flags (overwrites debug/release-signing.proprties) :'); - console.log(' \'--keystore=\': Key store used to build a signed archive. (Required)'); - console.log(' \'--alias=\': Alias for the key store. (Required)'); - console.log(' \'--storePassword=\': Password for the key store. (Optional - prompted)'); - console.log(' \'--password=\': Password for the key. (Optional - prompted)'); - console.log(' \'--keystoreType\': Type of the keystore. (Optional)'); - process.exit(0); -}; diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/builders/ProjectBuilder.js b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/builders/ProjectBuilder.js deleted file mode 100644 index 4db8bec..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/builders/ProjectBuilder.js +++ /dev/null @@ -1,412 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ -/* eslint no-self-assign: 0 */ -/* eslint no-unused-vars: 0 */ - -var Q = require('q'); -var fs = require('fs'); -var path = require('path'); -var shell = require('shelljs'); -var spawn = require('cordova-common').superspawn.spawn; -var events = require('cordova-common').events; -var CordovaError = require('cordova-common').CordovaError; -var check_reqs = require('../check_reqs'); -var PackageType = require('../PackageType'); -const compareFunc = require('compare-func'); - -const MARKER = 'YOUR CHANGES WILL BE ERASED!'; -const SIGNING_PROPERTIES = '-signing.properties'; -const TEMPLATE = - '# This file is automatically generated.\n' + - '# Do not modify this file -- ' + MARKER + '\n'; - -class ProjectBuilder { - constructor (rootDirectory) { - this.root = rootDirectory || path.resolve(__dirname, '../../..'); - this.apkDir = path.join(this.root, 'app', 'build', 'outputs', 'apk'); - this.aabDir = path.join(this.root, 'app', 'build', 'outputs', 'bundle'); - } - - getArgs (cmd, opts) { - let args; - let buildCmd = cmd; - if (opts.packageType === PackageType.BUNDLE) { - if (cmd === 'release') { - buildCmd = ':app:bundleRelease'; - } else if (cmd === 'debug') { - buildCmd = ':app:bundleDebug'; - } - - args = [buildCmd, '-b', path.join(this.root, 'build.gradle')]; - } else { - if (cmd === 'release') { - buildCmd = 'cdvBuildRelease'; - } else if (cmd === 'debug') { - buildCmd = 'cdvBuildDebug'; - } - - args = [buildCmd, '-b', path.join(this.root, 'build.gradle')]; - - if (opts.arch) { - args.push('-PcdvBuildArch=' + opts.arch); - } - - args.push.apply(args, opts.extraArgs); - } - - return args; - } - - /* - * This returns a promise - */ - runGradleWrapper (gradle_cmd) { - var gradlePath = path.join(this.root, 'gradlew'); - var wrapperGradle = path.join(this.root, 'wrapper.gradle'); - if (fs.existsSync(gradlePath)) { - // Literally do nothing, for some reason this works, while !fs.existsSync didn't on Windows - } else { - return spawn(gradle_cmd, ['-p', this.root, 'wrapper', '-b', wrapperGradle], { stdio: 'inherit' }); - } - } - - readProjectProperties () { - function findAllUniq (data, r) { - var s = {}; - var m; - while ((m = r.exec(data))) { - s[m[1]] = 1; - } - return Object.keys(s); - } - - var data = fs.readFileSync(path.join(this.root, 'project.properties'), 'utf8'); - return { - libs: findAllUniq(data, /^\s*android\.library\.reference\.\d+=(.*)(?:\s|$)/mg), - gradleIncludes: findAllUniq(data, /^\s*cordova\.gradle\.include\.\d+=(.*)(?:\s|$)/mg), - systemLibs: findAllUniq(data, /^\s*cordova\.system\.library\.\d+=(.*)(?:\s|$)/mg) - }; - } - - extractRealProjectNameFromManifest () { - var manifestPath = path.join(this.root, 'app', 'src', 'main', 'AndroidManifest.xml'); - var manifestData = fs.readFileSync(manifestPath, 'utf8'); - var m = /= 0) { - return check_reqs.check_android_target(error).then(function () { - // If due to some odd reason - check_android_target succeeds - // we should still fail here. - return Q.reject(error); - }); - } - return Q.reject(error); - }); - } - - clean (opts) { - var builder = this; - var wrapper = path.join(this.root, 'gradlew'); - var args = builder.getArgs('clean', opts); - return Q().then(function () { - return spawn(wrapper, args, { stdio: 'inherit' }); - }) - .then(function () { - shell.rm('-rf', path.join(builder.root, 'out')); - - ['debug', 'release'].forEach(function (config) { - var propertiesFilePath = path.join(builder.root, config + SIGNING_PROPERTIES); - if (isAutoGenerated(propertiesFilePath)) { - shell.rm('-f', propertiesFilePath); - } - }); - }); - } - - findOutputApks (build_type, arch) { - return findOutputApksHelper(this.apkDir, build_type, arch).sort(apkSorter); - } - - findOutputBundles (build_type) { - return findOutputBundlesHelper(this.aabDir, build_type); - } - - fetchBuildResults (build_type, arch) { - return { - apkPaths: this.findOutputApks(build_type, arch), - buildType: build_type - }; - } -} - -module.exports = ProjectBuilder; - -const apkSorter = compareFunc([ - // Sort arch specific builds after generic ones - apkPath => /-x86|-arm/.test(apkPath), - - // Sort unsigned builds after signed ones - apkPath => /-unsigned/.test(apkPath), - - // Sort by file modification time, latest first - apkPath => -fs.statSync(apkPath).mtime.getTime(), - - // Sort by file name length, ascending - 'length' -]); - -function findOutputApksHelper (dir, build_type, arch) { - var shellSilent = shell.config.silent; - shell.config.silent = true; - - // list directory recursively - var ret = shell.ls('-R', dir).map(function (file) { - // ls does not include base directory - return path.join(dir, file); - }).filter(function (file) { - // find all APKs - return file.match(/\.apk?$/i); - }).filter(function (candidate) { - var apkName = path.basename(candidate); - // Need to choose between release and debug .apk. - if (build_type === 'debug') { - return /-debug/.exec(apkName) && !/-unaligned|-unsigned/.exec(apkName); - } - if (build_type === 'release') { - return /-release/.exec(apkName) && !/-unaligned/.exec(apkName); - } - return true; - }).sort(apkSorter); - - shellSilent = shellSilent; - - if (ret.length === 0) { - return ret; - } - // Assume arch-specific build if newest apk has -x86 or -arm. - var archSpecific = !!/-x86|-arm/.exec(path.basename(ret[0])); - // And show only arch-specific ones (or non-arch-specific) - ret = ret.filter(function (p) { - return !!/-x86|-arm/.exec(path.basename(p)) === archSpecific; - }); - - if (archSpecific && ret.length > 1 && arch) { - ret = ret.filter(function (p) { - return path.basename(p).indexOf('-' + arch) !== -1; - }); - } - - return ret; -} - -// This method was a copy of findOutputApksHelper and modified to look for bundles -// While replacing shell with fs-extra, it might be a good idea to see if we can -// generalise these findOutput methods. -function findOutputBundlesHelper (dir, build_type) { - // This is an unused variable that was copied from findOutputApksHelper - // we are pretty sure it was meant to reset shell.config.silent back to - // the original value. However shell is planned to be replaced, - // it was left as is to avoid unintended consequences. - const shellSilent = shell.config.silent; - shell.config.silent = true; - - // list directory recursively - const ret = shell.ls('-R', dir).map(function (file) { - return path.join(dir, file); // ls does not include base directory - }).filter(function (file) { - return file.match(/\.aab?$/i); // find all bundles - }).filter(function (candidate) { - // Need to choose between release and debug bundle. - if (build_type === 'debug') { - return /debug/.exec(candidate); - } - if (build_type === 'release') { - return /release/.exec(candidate); - } - return true; - }); - - return ret; -} - -function isAutoGenerated (file) { - return fs.existsSync(file) && fs.readFileSync(file, 'utf8').indexOf(MARKER) > 0; -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/builders/builders.js b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/builders/builders.js deleted file mode 100644 index edc1a52..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/builders/builders.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -const CordovaError = require('cordova-common').CordovaError; - -/** - * Helper method that instantiates and returns a builder for specified build type. - * - * @return {Builder} A builder instance for specified build type. - */ -module.exports.getBuilder = function (projectPath) { - try { - const Builder = require('./ProjectBuilder'); - return new Builder(projectPath); - } catch (err) { - throw new CordovaError('Failed to instantiate ProjectBuilder builder: ' + err); - } -}; diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/check_reqs.js b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/check_reqs.js deleted file mode 100644 index 6435e01..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/check_reqs.js +++ /dev/null @@ -1,436 +0,0 @@ -#!/usr/bin/env node - -/* - 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 shelljs = require('shelljs'); -var child_process = require('child_process'); -var Q = require('q'); -var path = require('path'); -var fs = require('fs'); -var os = require('os'); -var REPO_ROOT = path.join(__dirname, '..', '..', '..', '..'); -var PROJECT_ROOT = path.join(__dirname, '..', '..'); -var CordovaError = require('cordova-common').CordovaError; -var superspawn = require('cordova-common').superspawn; -var android_sdk = require('./android_sdk'); - -function forgivingWhichSync (cmd) { - try { - return fs.realpathSync(shelljs.which(cmd)); - } catch (e) { - return ''; - } -} - -module.exports.isWindows = function () { - return (os.platform() === 'win32'); -}; - -module.exports.isDarwin = function () { - return (os.platform() === 'darwin'); -}; - -// Get valid target from framework/project.properties if run from this repo -// Otherwise get target from project.properties file within a generated cordova-android project -module.exports.get_target = function () { - function extractFromFile (filePath) { - var target = shelljs.grep(/\btarget=/, filePath); - if (!target) { - throw new Error('Could not find android target within: ' + filePath); - } - return target.split('=')[1].trim(); - } - var repo_file = path.join(REPO_ROOT, 'framework', 'project.properties'); - if (fs.existsSync(repo_file)) { - return extractFromFile(repo_file); - } - var project_file = path.join(PROJECT_ROOT, 'project.properties'); - if (fs.existsSync(project_file)) { - // if no target found, we're probably in a project and project.properties is in PROJECT_ROOT. - return extractFromFile(project_file); - } - throw new Error('Could not find android target in either ' + repo_file + ' nor ' + project_file); -}; - -// Returns a promise. Called only by build and clean commands. -module.exports.check_ant = function () { - return superspawn.spawn('ant', ['-version']).then(function (output) { - // Parse Ant version from command output - return /version ((?:\d+\.)+(?:\d+))/i.exec(output)[1]; - }).catch(function (err) { - if (err) { - throw new CordovaError('Failed to run `ant -version`. Make sure you have `ant` on your $PATH.'); - } - }); -}; - -module.exports.get_gradle_wrapper = function () { - var androidStudioPath; - var i = 0; - var foundStudio = false; - var program_dir; - // OK, This hack only works on Windows, not on Mac OS or Linux. We will be deleting this eventually! - if (module.exports.isWindows()) { - - var result = child_process.spawnSync(path.join(__dirname, 'getASPath.bat')); - // console.log('result.stdout =' + result.stdout.toString()); - // console.log('result.stderr =' + result.stderr.toString()); - - if (result.stderr.toString().length > 0) { - var androidPath = path.join(process.env['ProgramFiles'], 'Android') + '/'; - if (fs.existsSync(androidPath)) { - program_dir = fs.readdirSync(androidPath); - while (i < program_dir.length && !foundStudio) { - if (program_dir[i].startsWith('Android Studio')) { - foundStudio = true; - androidStudioPath = path.join(process.env['ProgramFiles'], 'Android', program_dir[i], 'gradle'); - } else { ++i; } - } - } - } else { - // console.log('got android studio path from registry'); - // remove the (os independent) new line char at the end of stdout - // add gradle to match the above. - androidStudioPath = path.join(result.stdout.toString().split('\r\n')[0], 'gradle'); - } - } - - if (androidStudioPath !== null && fs.existsSync(androidStudioPath)) { - var dirs = fs.readdirSync(androidStudioPath); - if (dirs[0].split('-')[0] === 'gradle') { - return path.join(androidStudioPath, dirs[0], 'bin', 'gradle'); - } - } else { - // OK, let's try to check for Gradle! - return forgivingWhichSync('gradle'); - } -}; - -// Returns a promise. Called only by build and clean commands. -module.exports.check_gradle = function () { - var sdkDir = process.env['ANDROID_HOME']; - var d = Q.defer(); - if (!sdkDir) { - return Q.reject(new CordovaError('Could not find gradle wrapper within Android SDK. Could not find Android SDK directory.\n' + - 'Might need to install Android SDK or set up \'ANDROID_HOME\' env variable.')); - } - - var gradlePath = module.exports.get_gradle_wrapper(); - if (gradlePath.length !== 0) { d.resolve(gradlePath); } else { - d.reject(new CordovaError('Could not find an installed version of Gradle either in Android Studio,\n' + - 'or on your system to install the gradle wrapper. Please include gradle \n' + - 'in your path, or install Android Studio')); - } - return d.promise; -}; - -// Returns a promise. -module.exports.check_java = function () { - var javacPath = forgivingWhichSync('javac'); - var hasJavaHome = !!process.env['JAVA_HOME']; - return Q().then(function () { - if (hasJavaHome) { - // Windows java installer doesn't add javac to PATH, nor set JAVA_HOME (ugh). - if (!javacPath) { - process.env['PATH'] += path.delimiter + path.join(process.env['JAVA_HOME'], 'bin'); - } - } else { - if (javacPath) { - // OS X has a command for finding JAVA_HOME. - var find_java = '/usr/libexec/java_home'; - var default_java_error_msg = 'Failed to find \'JAVA_HOME\' environment variable. Try setting it manually.'; - if (fs.existsSync(find_java)) { - return superspawn.spawn(find_java).then(function (stdout) { - process.env['JAVA_HOME'] = stdout.trim(); - }).catch(function (err) { - if (err) { - throw new CordovaError(default_java_error_msg); - } - }); - } else { - // See if we can derive it from javac's location. - // fs.realpathSync is require on Ubuntu, which symplinks from /usr/bin -> JDK - var maybeJavaHome = path.dirname(path.dirname(javacPath)); - if (fs.existsSync(path.join(maybeJavaHome, 'lib', 'tools.jar'))) { - process.env['JAVA_HOME'] = maybeJavaHome; - } else { - throw new CordovaError(default_java_error_msg); - } - } - } else if (module.exports.isWindows()) { - // Try to auto-detect java in the default install paths. - var oldSilent = shelljs.config.silent; - shelljs.config.silent = true; - var firstJdkDir = - shelljs.ls(process.env['ProgramFiles'] + '\\java\\jdk*')[0] || - shelljs.ls('C:\\Program Files\\java\\jdk*')[0] || - shelljs.ls('C:\\Program Files (x86)\\java\\jdk*')[0]; - shelljs.config.silent = oldSilent; - if (firstJdkDir) { - // shelljs always uses / in paths. - firstJdkDir = firstJdkDir.replace(/\//g, path.sep); - if (!javacPath) { - process.env['PATH'] += path.delimiter + path.join(firstJdkDir, 'bin'); - } - process.env['JAVA_HOME'] = firstJdkDir; - } - } - } - }).then(function () { - return Q.denodeify(child_process.exec)('javac -version') - .then(outputs => { - // outputs contains two entries: stdout and stderr - // Java <= 8 writes version info to stderr, Java >= 9 to stdout - const output = outputs.join('').trim(); - const match = /javac\s+([\d.]+)/i.exec(output); - return match && match[1]; - }, () => { - var msg = - 'Failed to run "javac -version", make sure that you have a JDK version 8 installed.\n' + - 'You can get it from the following location:\n' + - 'https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html'; - if (process.env['JAVA_HOME']) { - msg += '\n\n'; - msg += 'Your JAVA_HOME is invalid: ' + process.env['JAVA_HOME']; - } - throw new CordovaError(msg); - }); - }); -}; - -// Returns a promise. -module.exports.check_android = function () { - return Q().then(function () { - var androidCmdPath = forgivingWhichSync('android'); - var adbInPath = forgivingWhichSync('adb'); - var avdmanagerInPath = forgivingWhichSync('avdmanager'); - var hasAndroidHome = !!process.env['ANDROID_HOME'] && fs.existsSync(process.env['ANDROID_HOME']); - function maybeSetAndroidHome (value) { - if (!hasAndroidHome && fs.existsSync(value)) { - hasAndroidHome = true; - process.env['ANDROID_HOME'] = value; - } - } - // First ensure ANDROID_HOME is set - // If we have no hints (nothing in PATH), try a few default locations - if (!hasAndroidHome && !androidCmdPath && !adbInPath && !avdmanagerInPath) { - if (process.env['ANDROID_SDK_ROOT']) { - // Quick fix to set ANDROID_HOME according to ANDROID_SDK_ROOT - // if ANDROID_HOME is **not** defined and - // ANDROID_SDK_ROOT **is** defined - // according to environment variables as documented in: - // https://developer.android.com/studio/command-line/variables - maybeSetAndroidHome(path.join(process.env['ANDROID_SDK_ROOT'])); - } - if (module.exports.isWindows()) { - // Android Studio 1.0 installer - maybeSetAndroidHome(path.join(process.env['LOCALAPPDATA'], 'Android', 'sdk')); - maybeSetAndroidHome(path.join(process.env['ProgramFiles'], 'Android', 'sdk')); - // Android Studio pre-1.0 installer - maybeSetAndroidHome(path.join(process.env['LOCALAPPDATA'], 'Android', 'android-studio', 'sdk')); - maybeSetAndroidHome(path.join(process.env['ProgramFiles'], 'Android', 'android-studio', 'sdk')); - // Stand-alone installer - maybeSetAndroidHome(path.join(process.env['LOCALAPPDATA'], 'Android', 'android-sdk')); - maybeSetAndroidHome(path.join(process.env['ProgramFiles'], 'Android', 'android-sdk')); - } else if (module.exports.isDarwin()) { - // Android Studio 1.0 installer - maybeSetAndroidHome(path.join(process.env['HOME'], 'Library', 'Android', 'sdk')); - // Android Studio pre-1.0 installer - maybeSetAndroidHome('/Applications/Android Studio.app/sdk'); - // Stand-alone zip file that user might think to put under /Applications - maybeSetAndroidHome('/Applications/android-sdk-macosx'); - maybeSetAndroidHome('/Applications/android-sdk'); - } - if (process.env['HOME']) { - // Stand-alone zip file that user might think to put under their home directory - maybeSetAndroidHome(path.join(process.env['HOME'], 'android-sdk-macosx')); - maybeSetAndroidHome(path.join(process.env['HOME'], 'android-sdk')); - } - } - if (!hasAndroidHome) { - // If we dont have ANDROID_HOME, but we do have some tools on the PATH, try to infer from the tooling PATH. - var parentDir, grandParentDir; - if (androidCmdPath) { - parentDir = path.dirname(androidCmdPath); - grandParentDir = path.dirname(parentDir); - if (path.basename(parentDir) === 'tools' || fs.existsSync(path.join(grandParentDir, 'tools', 'android'))) { - maybeSetAndroidHome(grandParentDir); - } else { - throw new CordovaError('Failed to find \'ANDROID_HOME\' environment variable. Try setting it manually.\n' + - 'Detected \'android\' command at ' + parentDir + ' but no \'tools\' directory found near.\n' + - 'Try reinstall Android SDK or update your PATH to include valid path to SDK' + path.sep + 'tools directory.'); - } - } - if (adbInPath) { - parentDir = path.dirname(adbInPath); - grandParentDir = path.dirname(parentDir); - if (path.basename(parentDir) === 'platform-tools') { - maybeSetAndroidHome(grandParentDir); - } else { - throw new CordovaError('Failed to find \'ANDROID_HOME\' environment variable. Try setting it manually.\n' + - 'Detected \'adb\' command at ' + parentDir + ' but no \'platform-tools\' directory found near.\n' + - 'Try reinstall Android SDK or update your PATH to include valid path to SDK' + path.sep + 'platform-tools directory.'); - } - } - if (avdmanagerInPath) { - parentDir = path.dirname(avdmanagerInPath); - grandParentDir = path.dirname(parentDir); - if (path.basename(parentDir) === 'bin' && path.basename(grandParentDir) === 'tools') { - maybeSetAndroidHome(path.dirname(grandParentDir)); - } else { - throw new CordovaError('Failed to find \'ANDROID_HOME\' environment variable. Try setting it manually.\n' + - 'Detected \'avdmanager\' command at ' + parentDir + ' but no \'tools' + path.sep + 'bin\' directory found near.\n' + - 'Try reinstall Android SDK or update your PATH to include valid path to SDK' + path.sep + 'tools' + path.sep + 'bin directory.'); - } - } - } - if (!process.env['ANDROID_HOME']) { - throw new CordovaError('Failed to find \'ANDROID_HOME\' environment variable. Try setting it manually.\n' + - 'Failed to find \'android\' command in your \'PATH\'. Try update your \'PATH\' to include path to valid SDK directory.'); - } - if (!fs.existsSync(process.env['ANDROID_HOME'])) { - throw new CordovaError('\'ANDROID_HOME\' environment variable is set to non-existent path: ' + process.env['ANDROID_HOME'] + - '\nTry update it manually to point to valid SDK directory.'); - } - // Next let's make sure relevant parts of the SDK tooling is in our PATH - if (hasAndroidHome && !androidCmdPath) { - process.env['PATH'] += path.delimiter + path.join(process.env['ANDROID_HOME'], 'tools'); - } - if (hasAndroidHome && !adbInPath) { - process.env['PATH'] += path.delimiter + path.join(process.env['ANDROID_HOME'], 'platform-tools'); - } - if (hasAndroidHome && !avdmanagerInPath) { - process.env['PATH'] += path.delimiter + path.join(process.env['ANDROID_HOME'], 'tools', 'bin'); - } - return hasAndroidHome; - }); -}; - -// TODO: is this actually needed? -module.exports.getAbsoluteAndroidCmd = function () { - var cmd = forgivingWhichSync('android'); - if (cmd.length === 0) { - cmd = forgivingWhichSync('sdkmanager'); - } - if (module.exports.isWindows()) { - return '"' + cmd + '"'; - } - return cmd.replace(/(\s)/g, '\\$1'); -}; - -module.exports.check_android_target = function (originalError) { - // valid_target can look like: - // android-19 - // android-L - // Google Inc.:Google APIs:20 - // Google Inc.:Glass Development Kit Preview:20 - var desired_api_level = module.exports.get_target(); - return android_sdk.list_targets().then(function (targets) { - if (targets.indexOf(desired_api_level) >= 0) { - return targets; - } - var androidCmd = module.exports.getAbsoluteAndroidCmd(); - var msg = 'Please install Android target / API level: "' + desired_api_level + '".\n\n' + - 'Hint: Open the SDK manager by running: ' + androidCmd + '\n' + - 'You will require:\n' + - '1. "SDK Platform" for API level ' + desired_api_level + '\n' + - '2. "Android SDK Platform-tools (latest)\n' + - '3. "Android SDK Build-tools" (latest)'; - if (originalError) { - msg = originalError + '\n' + msg; - } - throw new CordovaError(msg); - }); -}; - -// Returns a promise. -module.exports.run = function () { - return Q.all([this.check_java(), this.check_android()]).then(function (values) { - console.log('Checking Java JDK and Android SDK versions'); - console.log('ANDROID_SDK_ROOT=' + process.env['ANDROID_SDK_ROOT'] + ' (recommended setting)'); - console.log('ANDROID_HOME=' + process.env['ANDROID_HOME'] + ' (DEPRECATED)'); - - if (!String(values[0]).startsWith('1.8.')) { - throw new CordovaError( - 'Requirements check failed for JDK 8 (\'1.8.*\')! Detected version: ' + values[0] + '\n' + - 'Check your ANDROID_SDK_ROOT / JAVA_HOME / PATH environment variables.' - ); - } - - if (!values[1]) { - throw new CordovaError('Requirements check failed for Android SDK! Android SDK was not detected.'); - } - }); -}; - -/** - * Object thar represents one of requirements for current platform. - * @param {String} id The unique identifier for this requirements. - * @param {String} name The name of requirements. Human-readable field. - * @param {String} version The version of requirement installed. In some cases could be an array of strings - * (for example, check_android_target returns an array of android targets installed) - * @param {Boolean} installed Indicates whether the requirement is installed or not - */ -var Requirement = function (id, name, version, installed) { - this.id = id; - this.name = name; - this.installed = installed || false; - this.metadata = { - version: version - }; -}; - -/** - * Methods that runs all checks one by one and returns a result of checks - * as an array of Requirement objects. This method intended to be used by cordova-lib check_reqs method - * - * @return Promise Array of requirements. Due to implementation, promise is always fulfilled. - */ -module.exports.check_all = function () { - - var requirements = [ - new Requirement('java', 'Java JDK'), - new Requirement('androidSdk', 'Android SDK'), - new Requirement('androidTarget', 'Android target'), - new Requirement('gradle', 'Gradle') - ]; - - var checkFns = [ - this.check_java, - this.check_android, - this.check_android_target, - this.check_gradle - ]; - - // Then execute requirement checks one-by-one - return checkFns.reduce(function (promise, checkFn, idx) { - // Update each requirement with results - var requirement = requirements[idx]; - return promise.then(checkFn).then(function (version) { - requirement.installed = true; - requirement.metadata.version = version; - }, function (err) { - requirement.metadata.reason = err instanceof Error ? err.message : err; - }); - }, Q()).then(function () { - // When chain is completed, return requirements array to upstream API - return requirements; - }); -}; diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/config/GradlePropertiesParser.js b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/config/GradlePropertiesParser.js deleted file mode 100644 index 59d9eac..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/config/GradlePropertiesParser.js +++ /dev/null @@ -1,114 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -let fs = require('fs'); -let path = require('path'); -let propertiesParser = require('properties-parser'); -let events = require('cordova-common').events; - -class GradlePropertiesParser { - /** - * Loads and Edits Gradle Properties File. - * - * @param {String} platformDir is the path of the Android platform directory - */ - constructor (platformDir) { - this._defaults = { - // 10 seconds -> 6 seconds - 'org.gradle.daemon': 'true', - - // to allow dex in process - 'org.gradle.jvmargs': '-Xmx2048m', - - // allow NDK to be used - required by Gradle 1.5 plugin - 'android.useDeprecatedNdk': 'true' - - // Shaves another 100ms, but produces a "try at own risk" warning. Not worth it (yet): - // 'org.gradle.parallel': 'true' - }; - - this.gradleFilePath = path.join(platformDir, 'gradle.properties'); - } - - configure (userConfigs) { - events.emit('verbose', '[Gradle Properties] Preparing Configuration'); - - this._initializeEditor(); - - events.emit('verbose', '[Gradle Properties] Appending default configuration properties'); - this._configureProperties(this._defaults); - - events.emit('verbose', '[Gradle Properties] Appending custom configuration properties'); - this._configureProperties(userConfigs); - - this._save(); - } - - /** - * Initialize the properties editor for parsing, setting, etc. - */ - _initializeEditor () { - // Touch empty gradle.properties file if missing. - if (!fs.existsSync(this.gradleFilePath)) { - events.emit('verbose', '[Gradle Properties] File missing, creating file with Cordova defaults.'); - fs.writeFileSync(this.gradleFilePath, '', 'utf-8'); - } - - // Create an editor for parsing, getting, and setting configurations. - this.gradleFile = propertiesParser.createEditor(this.gradleFilePath); - } - - /** - * Validate that defaults or user configuration properties are set and - * set the missing items. - */ - _configureProperties (properties) { - // Iterate though the properties and set only if missing. - Object.keys(properties).forEach(key => { - let value = this.gradleFile.get(key); - - if (!value) { - // Handles the case of adding missing defaults or new properties that are missing. - events.emit('verbose', `[Gradle Properties] Appending configuration item: ${key}=${properties[key]}`); - this.gradleFile.set(key, properties[key]); - } else if (value !== properties[key]) { - if (this._defaults[key] && this._defaults[key] !== properties[key]) { - // Since the value does not match default, we will notify the discrepancy with Cordova's recommended value. - events.emit('info', `[Gradle Properties] Detected Gradle property "${key}" with the value of "${properties[key]}", Cordova's recommended value is "${this._defaults[key]}"`); - } else { - // When the current value exists but does not match the new value or does matches the default key value, the new value it set. - events.emit('verbose', `[Gradle Properties] Updating Gradle property "${key}" with the value of "${properties[key]}"`); - } - - // We will set the new value in either case. - this.gradleFile.set(key, properties[key]); - } - }); - } - - /** - * Saves any changes that has been made to the properties file. - */ - _save () { - events.emit('verbose', '[Gradle Properties] Updating and Saving File'); - this.gradleFile.save(); - } -} - -module.exports = GradlePropertiesParser; diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/device.js b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/device.js deleted file mode 100644 index 1559e9b..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/device.js +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/env node - -/* - 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 build = require('./build'); -var path = require('path'); -var Adb = require('./Adb'); -var AndroidManifest = require('./AndroidManifest'); -var spawn = require('cordova-common').superspawn.spawn; -var CordovaError = require('cordova-common').CordovaError; -var events = require('cordova-common').events; - -/** - * Returns a promise for the list of the device ID's found - * @param lookHarder When true, try restarting adb if no devices are found. - */ -module.exports.list = function (lookHarder) { - return Adb.devices().then(function (list) { - if (list.length === 0 && lookHarder) { - // adb kill-server doesn't seem to do the trick. - // Could probably find a x-platform version of killall, but I'm not actually - // sure that this scenario even happens on non-OSX machines. - return spawn('killall', ['adb']).then(function () { - events.emit('verbose', 'Restarting adb to see if more devices are detected.'); - return Adb.devices(); - }, function () { - // For non-killall OS's. - return list; - }); - } - return list; - }); -}; - -module.exports.resolveTarget = function (target) { - return this.list(true).then(function (device_list) { - if (!device_list || !device_list.length) { - return Promise.reject(new CordovaError('Failed to deploy to device, no devices found.')); - } - // default device - target = target || device_list[0]; - - if (device_list.indexOf(target) < 0) { - return Promise.reject(new CordovaError('ERROR: Unable to find target \'' + target + '\'.')); - } - - return build.detectArchitecture(target).then(function (arch) { - return { target: target, arch: arch, isEmulator: false }; - }); - }); -}; - -/* - * Installs a previously built application on the device - * and launches it. - * Returns a promise. - */ -module.exports.install = function (target, buildResults) { - return Promise.resolve().then(function () { - if (target && typeof target === 'object') { - return target; - } - return module.exports.resolveTarget(target); - }).then(function (resolvedTarget) { - var apk_path = build.findBestApkForArchitecture(buildResults, resolvedTarget.arch); - var manifest = new AndroidManifest(path.join(__dirname, '../../app/src/main/AndroidManifest.xml')); - var pkgName = manifest.getPackageId(); - var launchName = pkgName + '/.' + manifest.getActivity().getName(); - events.emit('log', 'Using apk: ' + apk_path); - events.emit('log', 'Package name: ' + pkgName); - - return Adb.install(resolvedTarget.target, apk_path, { replace: true }).catch(function (error) { - // CB-9557 CB-10157 only uninstall and reinstall app if the one that - // is already installed on device was signed w/different certificate - if (!/INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES/.test(error.toString())) { throw error; } - - events.emit('warn', 'Uninstalling app from device and reinstalling it again because the ' + - 'installed app already signed with different key'); - - // This promise is always resolved, even if 'adb uninstall' fails to uninstall app - // or the app doesn't installed at all, so no error catching needed. - return Adb.uninstall(resolvedTarget.target, pkgName).then(function () { - return Adb.install(resolvedTarget.target, apk_path, { replace: true }); - }); - }).then(function () { - // unlock screen - return Adb.shell(resolvedTarget.target, 'input keyevent 82'); - }).then(function () { - return Adb.start(resolvedTarget.target, launchName); - }).then(function () { - events.emit('log', 'LAUNCH SUCCESS'); - }); - }); -}; diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/emulator.js b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/emulator.js deleted file mode 100644 index fcdc170..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/emulator.js +++ /dev/null @@ -1,530 +0,0 @@ -#!/usr/bin/env node - -/* - 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 android_versions = require('android-versions'); -var retry = require('./retry'); -var build = require('./build'); -var path = require('path'); -var Adb = require('./Adb'); -var AndroidManifest = require('./AndroidManifest'); -var events = require('cordova-common').events; -var superspawn = require('cordova-common').superspawn; -var CordovaError = require('cordova-common').CordovaError; -var shelljs = require('shelljs'); -var android_sdk = require('./android_sdk'); -var check_reqs = require('./check_reqs'); - -var os = require('os'); -var fs = require('fs'); -var child_process = require('child_process'); - -// constants -var ONE_SECOND = 1000; // in milliseconds -var ONE_MINUTE = 60 * ONE_SECOND; // in milliseconds -var INSTALL_COMMAND_TIMEOUT = 5 * ONE_MINUTE; // in milliseconds -var NUM_INSTALL_RETRIES = 3; -var CHECK_BOOTED_INTERVAL = 3 * ONE_SECOND; // in milliseconds -var EXEC_KILL_SIGNAL = 'SIGKILL'; - -function forgivingWhichSync (cmd) { - try { - return fs.realpathSync(shelljs.which(cmd)); - } catch (e) { - return ''; - } -} - -module.exports.list_images_using_avdmanager = function () { - return superspawn.spawn('avdmanager', ['list', 'avd']).then(function (output) { - var response = output.split('\n'); - var emulator_list = []; - for (var i = 1; i < response.length; i++) { - // To return more detailed information use img_obj - var img_obj = {}; - if (response[i].match(/Name:\s/)) { - img_obj['name'] = response[i].split('Name: ')[1].replace('\r', ''); - if (response[i + 1].match(/Device:\s/)) { - i++; - img_obj['device'] = response[i].split('Device: ')[1].replace('\r', ''); - } - if (response[i + 1].match(/Path:\s/)) { - i++; - img_obj['path'] = response[i].split('Path: ')[1].replace('\r', ''); - } - if (response[i + 1].match(/Target:\s/)) { - i++; - if (response[i + 1].match(/ABI:\s/)) { - img_obj['abi'] = response[i + 1].split('ABI: ')[1].replace('\r', ''); - } - // This next conditional just aims to match the old output of `android list avd` - // We do so so that we don't have to change the logic when parsing for the - // best emulator target to spawn (see below in `best_image`) - // This allows us to transitionally support both `android` and `avdmanager` binaries, - // depending on what SDK version the user has - if (response[i + 1].match(/Based\son:\s/)) { - img_obj['target'] = response[i + 1].split('Based on:')[1]; - if (img_obj['target'].match(/Tag\/ABI:\s/)) { - img_obj['target'] = img_obj['target'].split('Tag/ABI:')[0].replace('\r', '').trim(); - if (img_obj['target'].indexOf('(') > -1) { - img_obj['target'] = img_obj['target'].substr(0, img_obj['target'].indexOf('(') - 1).trim(); - } - } - var version_string = img_obj['target'].replace(/Android\s+/, ''); - - var api_level = android_sdk.version_string_to_api_level[version_string]; - if (api_level) { - img_obj['target'] += ' (API level ' + api_level + ')'; - } - } - } - if (response[i + 1].match(/Skin:\s/)) { - i++; - img_obj['skin'] = response[i].split('Skin: ')[1].replace('\r', ''); - } - - emulator_list.push(img_obj); - } - /* To just return a list of names use this - if (response[i].match(/Name:\s/)) { - emulator_list.push(response[i].split('Name: ')[1].replace('\r', ''); - } */ - - } - return emulator_list; - }); -}; - -module.exports.list_images_using_android = function () { - return superspawn.spawn('android', ['list', 'avd']).then(function (output) { - var response = output.split('\n'); - var emulator_list = []; - for (var i = 1; i < response.length; i++) { - // To return more detailed information use img_obj - var img_obj = {}; - if (response[i].match(/Name:\s/)) { - img_obj['name'] = response[i].split('Name: ')[1].replace('\r', ''); - if (response[i + 1].match(/Device:\s/)) { - i++; - img_obj['device'] = response[i].split('Device: ')[1].replace('\r', ''); - } - if (response[i + 1].match(/Path:\s/)) { - i++; - img_obj['path'] = response[i].split('Path: ')[1].replace('\r', ''); - } - if (response[i + 1].match(/\(API\slevel\s/) || (response[i + 2] && response[i + 2].match(/\(API\slevel\s/))) { - i++; - var secondLine = response[i + 1].match(/\(API\slevel\s/) ? response[i + 1] : ''; - img_obj['target'] = (response[i] + secondLine).split('Target: ')[1].replace('\r', ''); - } - if (response[i + 1].match(/ABI:\s/)) { - i++; - img_obj['abi'] = response[i].split('ABI: ')[1].replace('\r', ''); - } - if (response[i + 1].match(/Skin:\s/)) { - i++; - img_obj['skin'] = response[i].split('Skin: ')[1].replace('\r', ''); - } - - emulator_list.push(img_obj); - } - /* To just return a list of names use this - if (response[i].match(/Name:\s/)) { - emulator_list.push(response[i].split('Name: ')[1].replace('\r', ''); - } */ - - } - return emulator_list; - }); -}; - -/** - * Returns a Promise for a list of emulator images in the form of objects - * { - name : , - device : , - path : , - target : , - abi : , - skin : - } - */ -module.exports.list_images = function () { - return Promise.resolve().then(function () { - if (forgivingWhichSync('avdmanager')) { - return module.exports.list_images_using_avdmanager(); - } else if (forgivingWhichSync('android')) { - return module.exports.list_images_using_android(); - } else { - return Promise.reject(new CordovaError('Could not find either `android` or `avdmanager` on your $PATH! Are you sure the Android SDK is installed and available?')); - } - }).then(function (avds) { - // In case we're missing the Android OS version string from the target description, add it. - return avds.map(function (avd) { - if (avd.target && avd.target.indexOf('Android API') > -1 && avd.target.indexOf('API level') < 0) { - var api_level = avd.target.match(/\d+/); - if (api_level) { - var level = android_versions.get(api_level); - if (level) { - avd.target = 'Android ' + level.semver + ' (API level ' + api_level + ')'; - } - } - } - return avd; - }); - }); -}; - -/** - * Will return the closest avd to the projects target - * or undefined if no avds exist. - * Returns a promise. - */ -module.exports.best_image = function () { - return this.list_images().then(function (images) { - // Just return undefined if there is no images - if (images.length === 0) return; - - var closest = 9999; - var best = images[0]; - var project_target = parseInt(check_reqs.get_target().replace('android-', '')); - for (var i in images) { - var target = images[i].target; - if (target && target.indexOf('API level') > -1) { - var num = parseInt(target.split('(API level ')[1].replace(')', '')); - if (num === project_target) { - return images[i]; - } else if (project_target - num < closest && project_target > num) { - closest = project_target - num; - best = images[i]; - } - } - } - return best; - }); -}; - -// Returns a promise. -module.exports.list_started = function () { - return Adb.devices({ emulators: true }); -}; - -// Returns a promise. -// TODO: we should remove this, there's a more robust method under android_sdk.js -module.exports.list_targets = function () { - return superspawn.spawn('android', ['list', 'targets'], { cwd: os.tmpdir() }).then(function (output) { - var target_out = output.split('\n'); - var targets = []; - for (var i = target_out.length; i >= 0; i--) { - if (target_out[i].match(/id:/)) { - targets.push(targets[i].split(' ')[1]); - } - } - return targets; - }); -}; - -/* - * Gets unused port for android emulator, between 5554 and 5584 - * Returns a promise. - */ -module.exports.get_available_port = function () { - var self = this; - - return self.list_started().then(function (emulators) { - for (var p = 5584; p >= 5554; p -= 2) { - if (emulators.indexOf('emulator-' + p) === -1) { - events.emit('verbose', 'Found available port: ' + p); - return p; - } - } - throw new CordovaError('Could not find an available avd port'); - }); -}; - -/* - * Starts an emulator with the given ID, - * and returns the started ID of that emulator. - * If no ID is given it will use the first image available, - * if no image is available it will error out (maybe create one?). - * If no boot timeout is given or the value is negative it will wait forever for - * the emulator to boot - * - * Returns a promise. - */ -module.exports.start = function (emulator_ID, boot_timeout) { - var self = this; - - return Promise.resolve().then(function () { - if (emulator_ID) return Promise.resolve(emulator_ID); - - return self.best_image().then(function (best) { - if (best && best.name) { - events.emit('warn', 'No emulator specified, defaulting to ' + best.name); - return best.name; - } - - var androidCmd = check_reqs.getAbsoluteAndroidCmd(); - return Promise.reject(new CordovaError('No emulator images (avds) found.\n' + - '1. Download desired System Image by running: ' + androidCmd + ' sdk\n' + - '2. Create an AVD by running: ' + androidCmd + ' avd\n' + - 'HINT: For a faster emulator, use an Intel System Image and install the HAXM device driver\n')); - }); - }).then(function (emulatorId) { - return self.get_available_port().then(function (port) { - // Figure out the directory the emulator binary runs in, and set the cwd to that directory. - // Workaround for https://code.google.com/p/android/issues/detail?id=235461 - var emulator_dir = path.dirname(shelljs.which('emulator')); - var args = ['-avd', emulatorId, '-port', port]; - // Don't wait for it to finish, since the emulator will probably keep running for a long time. - child_process - .spawn('emulator', args, { stdio: 'inherit', detached: true, cwd: emulator_dir }) - .unref(); - - // wait for emulator to start - events.emit('log', 'Waiting for emulator to start...'); - return self.wait_for_emulator(port); - }); - }).then(function (emulatorId) { - if (!emulatorId) { return Promise.reject(new CordovaError('Failed to start emulator')); } - - // wait for emulator to boot up - process.stdout.write('Waiting for emulator to boot (this may take a while)...'); - return self.wait_for_boot(emulatorId, boot_timeout).then(function (success) { - if (success) { - events.emit('log', 'BOOT COMPLETE'); - // unlock screen - return Adb.shell(emulatorId, 'input keyevent 82').then(function () { - // return the new emulator id for the started emulators - return emulatorId; - }); - } else { - // We timed out waiting for the boot to happen - return null; - } - }); - }); -}; - -/* - * Waits for an emulator to boot on a given port. - * Returns this emulator's ID in a promise. - */ -module.exports.wait_for_emulator = function (port) { - var self = this; - return Promise.resolve().then(function () { - var emulator_id = 'emulator-' + port; - return Adb.shell(emulator_id, 'getprop dev.bootcomplete').then(function (output) { - if (output.indexOf('1') >= 0) { - return emulator_id; - } - return self.wait_for_emulator(port); - }, function (error) { - if ((error && error.message && - (error.message.indexOf('not found') > -1)) || - (error.message.indexOf('device offline') > -1) || - (error.message.indexOf('device still connecting') > -1) || - (error.message.indexOf('device still authorizing') > -1)) { - // emulator not yet started, continue waiting - return self.wait_for_emulator(port); - } else { - // something unexpected has happened - throw error; - } - }); - }); -}; - -/* - * Waits for the core android process of the emulator to start. Returns a - * promise that resolves to a boolean indicating success. Not specifying a - * time_remaining or passing a negative value will cause it to wait forever - */ -module.exports.wait_for_boot = function (emulator_id, time_remaining) { - var self = this; - return Adb.shell(emulator_id, 'ps').then(function (output) { - if (output.match(/android\.process\.acore/)) { - return true; - } else if (time_remaining === 0) { - return false; - } else { - process.stdout.write('.'); - - return new Promise(resolve => { - const delay = time_remaining < CHECK_BOOTED_INTERVAL ? time_remaining : CHECK_BOOTED_INTERVAL; - - setTimeout(() => { - const updated_time = time_remaining >= 0 ? Math.max(time_remaining - CHECK_BOOTED_INTERVAL, 0) : time_remaining; - resolve(self.wait_for_boot(emulator_id, updated_time)); - }, delay); - }); - } - }); -}; - -/* - * Create avd - * TODO : Enter the stdin input required to complete the creation of an avd. - * Returns a promise. - */ -module.exports.create_image = function (name, target) { - console.log('Creating new avd named ' + name); - if (target) { - return superspawn.spawn('android', ['create', 'avd', '--name', name, '--target', target]).then(null, function (error) { - console.error('ERROR : Failed to create emulator image : '); - console.error(' Do you have the latest android targets including ' + target + '?'); - console.error(error); - }); - } else { - console.log('WARNING : Project target not found, creating avd with a different target but the project may fail to install.'); - // TODO: there's a more robust method for finding targets in android_sdk.js - return superspawn.spawn('android', ['create', 'avd', '--name', name, '--target', this.list_targets()[0]]).then(function () { - // TODO: This seems like another error case, even though it always happens. - console.error('ERROR : Unable to create an avd emulator, no targets found.'); - console.error('Ensure you have targets available by running the "android" command'); - return Promise.reject(new CordovaError()); - }, function (error) { - console.error('ERROR : Failed to create emulator image : '); - console.error(error); - }); - } -}; - -module.exports.resolveTarget = function (target) { - return this.list_started().then(function (emulator_list) { - if (emulator_list.length < 1) { - return Promise.reject(new CordovaError('No running Android emulators found, please start an emulator before deploying your project.')); - } - - // default emulator - target = target || emulator_list[0]; - if (emulator_list.indexOf(target) < 0) { - return Promise.reject(new CordovaError('Unable to find target \'' + target + '\'. Failed to deploy to emulator.')); - } - - return build.detectArchitecture(target).then(function (arch) { - return { target: target, arch: arch, isEmulator: true }; - }); - }); -}; - -/* - * Installs a previously built application on the emulator and launches it. - * If no target is specified, then it picks one. - * If no started emulators are found, error out. - * Returns a promise. - */ -module.exports.install = function (givenTarget, buildResults) { - - var target; - // We need to find the proper path to the Android Manifest - const manifestPath = path.join(__dirname, '..', '..', 'app', 'src', 'main', 'AndroidManifest.xml'); - const manifest = new AndroidManifest(manifestPath); - const pkgName = manifest.getPackageId(); - - // resolve the target emulator - return Promise.resolve().then(function () { - if (givenTarget && typeof givenTarget === 'object') { - return givenTarget; - } else { - return module.exports.resolveTarget(givenTarget); - } - - // set the resolved target - }).then(function (resolvedTarget) { - target = resolvedTarget; - - // install the app - }).then(function () { - // This promise is always resolved, even if 'adb uninstall' fails to uninstall app - // or the app doesn't installed at all, so no error catching needed. - return Promise.resolve().then(function () { - - var apk_path = build.findBestApkForArchitecture(buildResults, target.arch); - var execOptions = { - cwd: os.tmpdir(), - timeout: INSTALL_COMMAND_TIMEOUT, // in milliseconds - killSignal: EXEC_KILL_SIGNAL - }; - - events.emit('log', 'Using apk: ' + apk_path); - events.emit('log', 'Package name: ' + pkgName); - events.emit('verbose', 'Installing app on emulator...'); - - // A special function to call adb install in specific environment w/ specific options. - // Introduced as a part of fix for http://issues.apache.org/jira/browse/CB-9119 - // to workaround sporadic emulator hangs - function adbInstallWithOptions (target, apk, opts) { - events.emit('verbose', 'Installing apk ' + apk + ' on ' + target + '...'); - - var command = 'adb -s ' + target + ' install -r "' + apk + '"'; - return new Promise(function (resolve, reject) { - child_process.exec(command, opts, function (err, stdout, stderr) { - if (err) reject(new CordovaError('Error executing "' + command + '": ' + stderr)); - // adb does not return an error code even if installation fails. Instead it puts a specific - // message to stdout, so we have to use RegExp matching to detect installation failure. - else if (/Failure/.test(stdout)) { - if (stdout.match(/INSTALL_PARSE_FAILED_NO_CERTIFICATES/)) { - stdout += 'Sign the build using \'-- --keystore\' or \'--buildConfig\'' + - ' or sign and deploy the unsigned apk manually using Android tools.'; - } else if (stdout.match(/INSTALL_FAILED_VERSION_DOWNGRADE/)) { - stdout += 'You\'re trying to install apk with a lower versionCode that is already installed.' + - '\nEither uninstall an app or increment the versionCode.'; - } - - reject(new CordovaError('Failed to install apk to emulator: ' + stdout)); - } else resolve(stdout); - }); - }); - } - - function installPromise () { - return adbInstallWithOptions(target.target, apk_path, execOptions).catch(function (error) { - // CB-9557 CB-10157 only uninstall and reinstall app if the one that - // is already installed on device was signed w/different certificate - if (!/INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES/.test(error.toString())) { throw error; } - - events.emit('warn', 'Uninstalling app from device and reinstalling it because the ' + - 'currently installed app was signed with different key'); - - // This promise is always resolved, even if 'adb uninstall' fails to uninstall app - // or the app doesn't installed at all, so no error catching needed. - return Adb.uninstall(target.target, pkgName).then(function () { - return adbInstallWithOptions(target.target, apk_path, execOptions); - }); - }); - } - - return retry.retryPromise(NUM_INSTALL_RETRIES, installPromise).then(function (output) { - events.emit('log', 'INSTALL SUCCESS'); - }); - }); - // unlock screen - }).then(function () { - - events.emit('verbose', 'Unlocking screen...'); - return Adb.shell(target.target, 'input keyevent 82'); - }).then(function () { - Adb.start(target.target, pkgName + '/.' + manifest.getActivity().getName()); - // report success or failure - }).then(function (output) { - events.emit('log', 'LAUNCH SUCCESS'); - }); -}; diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/getASPath.bat b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/getASPath.bat deleted file mode 100644 index 14dad43..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/getASPath.bat +++ /dev/null @@ -1,3 +0,0 @@ -@ECHO OFF -for /f "tokens=2*" %%a in ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Android Studio" /v Path') do set "ASPath=%%~b" -ECHO %ASPath% \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/install-device b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/install-device deleted file mode 100755 index 0387388..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/install-device +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env node - -/* - 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 device = require('./device'); -var args = process.argv; - -if (args.length > 2) { - var install_target; - if (args[2].substring(0, 9) === '--target=') { - install_target = args[2].substring(9, args[2].length); - device.install(install_target).catch(function (err) { - console.error('ERROR: ' + err); - process.exit(2); - }); - } else { - console.error('ERROR : argument \'' + args[2] + '\' not recognized.'); - process.exit(2); - } -} else { - device.install().catch(function (err) { - console.error('ERROR: ' + err); - process.exit(2); - }); -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/install-device.bat b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/install-device.bat deleted file mode 100644 index 109b470..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/install-device.bat +++ /dev/null @@ -1,26 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. - -@ECHO OFF -SET script_path="%~dp0install-device" -IF EXIST %script_path% ( - node %script_path% %* -) ELSE ( - ECHO. - ECHO ERROR: Could not find 'install-device' script in 'cordova\lib' folder, aborting...>&2 - EXIT /B 1 -) \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/install-emulator b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/install-emulator deleted file mode 100755 index 2d46dbe..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/install-emulator +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env node - -/* - 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 emulator = require('./emulator'); -var args = process.argv; - -var install_target; -if (args.length > 2) { - if (args[2].substring(0, 9) === '--target=') { - install_target = args[2].substring(9, args[2].length); - } else { - console.error('ERROR : argument \'' + args[2] + '\' not recognized.'); - process.exit(2); - } -} - -emulator.install(install_target).catch(function (err) { - console.error('ERROR: ' + err); - process.exit(2); -}); diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/install-emulator.bat b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/install-emulator.bat deleted file mode 100644 index a28c23a..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/install-emulator.bat +++ /dev/null @@ -1,26 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. - -@ECHO OFF -SET script_path="%~dp0install-emulator" -IF EXIST %script_path% ( - node %script_path% %* -) ELSE ( - ECHO. - ECHO ERROR: Could not find 'install-emulator' script in 'cordova\lib' folder, aborting...>&2 - EXIT /B 1 -) \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/list-devices b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/list-devices deleted file mode 100755 index 339c665..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/list-devices +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env node - -/* - 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 devices = require('./device'); - -// Usage support for when args are given -require('./check_reqs').check_android().then(function () { - devices.list().then(function (device_list) { - device_list && device_list.forEach(function (dev) { - console.log(dev); - }); - }, function (err) { - console.error('ERROR: ' + err); - process.exit(2); - }); -}); diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/list-devices.bat b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/list-devices.bat deleted file mode 100644 index ad5f03e..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/list-devices.bat +++ /dev/null @@ -1,26 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. - -@ECHO OFF -SET script_path="%~dp0list-devices" -IF EXIST %script_path% ( - node %script_path% %* -) ELSE ( - ECHO. - ECHO ERROR: Could not find 'list-devices' script in 'cordova\lib' folder, aborting...>&2 - EXIT /B 1 -) \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/list-emulator-images b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/list-emulator-images deleted file mode 100755 index 03cfb19..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/list-emulator-images +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env node - -/* - 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 emulators = require('./emulator'); - -// Usage support for when args are given -require('./check_reqs').check_android().then(function () { - emulators.list_images().then(function (emulator_list) { - emulator_list && emulator_list.forEach(function (emu) { - console.log(emu.name); - }); - }, function (err) { - console.error('ERROR: ' + err); - process.exit(2); - }); -}); diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/list-emulator-images.bat b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/list-emulator-images.bat deleted file mode 100644 index 616ffb7..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/list-emulator-images.bat +++ /dev/null @@ -1,26 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. - -@ECHO OFF -SET script_path="%~dp0list-emulator-images" -IF EXIST %script_path% ( - node %script_path% %* -) ELSE ( - ECHO. - ECHO ERROR: Could not find 'list-emulator-images' script in 'cordova\lib' folder, aborting...>&2 - EXIT /B 1 -) diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/list-started-emulators b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/list-started-emulators deleted file mode 100755 index 2a83e03..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/list-started-emulators +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env node - -/* - 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 emulators = require('./emulator'); - -// Usage support for when args are given -require('./check_reqs').check_android().then(function () { - emulators.list_started().then(function (emulator_list) { - emulator_list && emulator_list.forEach(function (emu) { - console.log(emu); - }); - }, function (err) { - console.error('ERROR: ' + err); - process.exit(2); - }); -}); diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/list-started-emulators.bat b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/list-started-emulators.bat deleted file mode 100644 index eed02a5..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/list-started-emulators.bat +++ /dev/null @@ -1,26 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. - -@ECHO OFF -SET script_path="%~dp0list-started-emulators" -IF EXIST %script_path% ( - node %script_path% %* -) ELSE ( - ECHO. - ECHO ERROR: Could not find 'list-started-emulators' script in 'cordova\lib' folder, aborting...>&2 - EXIT /B 1 -) \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/log.js b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/log.js deleted file mode 100644 index ec69f8c..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/log.js +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env node - -/* - 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 path = require('path'); -var os = require('os'); -var Q = require('q'); -var child_process = require('child_process'); -var ROOT = path.join(__dirname, '..', '..'); - -/* - * Starts running logcat in the shell. - * Returns a promise. - */ -module.exports.run = function () { - var d = Q.defer(); - var adb = child_process.spawn('adb', ['logcat'], { cwd: os.tmpdir() }); - - adb.stdout.on('data', function (data) { - var lines = data ? data.toString().split('\n') : []; - var out = lines.filter(function (x) { return x.indexOf('nativeGetEnabledTags') < 0; }); - console.log(out.join('\n')); - }); - - adb.stderr.on('data', console.error); - adb.on('close', function (code) { - if (code > 0) { - d.reject('Failed to run logcat command.'); - } else d.resolve(); - }); - - return d.promise; -}; - -module.exports.help = function () { - console.log('Usage: ' + path.relative(process.cwd(), path.join(ROOT, 'cordova', 'log'))); - console.log('Gives the logcat output on the command line.'); - process.exit(0); -}; diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/plugin-build.gradle b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/plugin-build.gradle deleted file mode 100644 index 032b870..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/plugin-build.gradle +++ /dev/null @@ -1,69 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -// GENERATED FILE! DO NOT EDIT! - -buildscript { - repositories { - google() - jcenter() - } - - // Switch the Android Gradle plugin version requirement depending on the - // installed version of Gradle. This dependency is documented at - // http://tools.android.com/tech-docs/new-build-system/version-compatibility - // and https://issues.apache.org/jira/browse/CB-8143 - dependencies { - classpath 'com.android.tools.build:gradle:1.0.0+' - } -} - -apply plugin: 'com.android.library' - -dependencies { - implementation fileTree(dir: 'libs', include: '*.jar') - debugCompile project(path: ":CordovaLib", configuration: "debug") - releaseCompile project(path: ":CordovaLib", configuration: "release") -} - -android { - compileSdkVersion cdvCompileSdkVersion - buildToolsVersion cdvBuildToolsVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_6 - targetCompatibility JavaVersion.VERSION_1_6 - } - - sourceSets { - main { - manifest.srcFile 'AndroidManifest.xml' - java.srcDirs = ['src'] - resources.srcDirs = ['src'] - aidl.srcDirs = ['src'] - renderscript.srcDirs = ['src'] - res.srcDirs = ['res'] - assets.srcDirs = ['assets'] - jniLibs.srcDirs = ['libs'] - } - } -} - -if (file('build-extras.gradle').exists()) { - apply from: 'build-extras.gradle' -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/pluginHandlers.js b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/pluginHandlers.js deleted file mode 100644 index 6d1a733..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/pluginHandlers.js +++ /dev/null @@ -1,334 +0,0 @@ -/* - * 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. - * -*/ - -var fs = require('fs'); -var path = require('path'); -var shell = require('shelljs'); -var events = require('cordova-common').events; -var CordovaError = require('cordova-common').CordovaError; - -var handlers = { - 'source-file': { - install: function (obj, plugin, project, options) { - if (!obj.src) throw new CordovaError(generateAttributeError('src', 'source-file', plugin.id)); - if (!obj.targetDir) throw new CordovaError(generateAttributeError('target-dir', 'source-file', plugin.id)); - - var dest = getInstallDestination(obj); - - if (options && options.force) { - copyFile(plugin.dir, obj.src, project.projectDir, dest, !!(options && options.link)); - } else { - copyNewFile(plugin.dir, obj.src, project.projectDir, dest, !!(options && options.link)); - } - }, - uninstall: function (obj, plugin, project, options) { - var dest = getInstallDestination(obj); - - // TODO: Add Koltin extension to uninstall, since they are handled like Java files - if (obj.src.endsWith('java')) { - deleteJava(project.projectDir, dest); - } else { - // Just remove the file, not the whole parent directory - removeFile(project.projectDir, dest); - } - } - }, - 'lib-file': { - install: function (obj, plugin, project, options) { - var dest = path.join('app/libs', path.basename(obj.src)); - copyFile(plugin.dir, obj.src, project.projectDir, dest, !!(options && options.link)); - }, - uninstall: function (obj, plugin, project, options) { - var dest = path.join('app/libs', path.basename(obj.src)); - removeFile(project.projectDir, dest); - } - }, - 'resource-file': { - install: function (obj, plugin, project, options) { - var dest = path.join('app', 'src', 'main', obj.target); - copyFile(plugin.dir, obj.src, project.projectDir, dest, !!(options && options.link)); - }, - uninstall: function (obj, plugin, project, options) { - var dest = path.join('app', 'src', 'main', obj.target); - removeFile(project.projectDir, dest); - } - }, - 'framework': { - install: function (obj, plugin, project, options) { - var src = obj.src; - if (!src) throw new CordovaError(generateAttributeError('src', 'framework', plugin.id)); - - events.emit('verbose', 'Installing Android library: ' + src); - var parentDir = obj.parent ? path.resolve(project.projectDir, obj.parent) : project.projectDir; - var subDir; - - if (obj.custom) { - var subRelativeDir = project.getCustomSubprojectRelativeDir(plugin.id, src); - copyNewFile(plugin.dir, src, project.projectDir, subRelativeDir, !!(options && options.link)); - subDir = path.resolve(project.projectDir, subRelativeDir); - } else { - obj.type = 'sys'; - subDir = src; - } - - if (obj.type === 'gradleReference') { - project.addGradleReference(parentDir, subDir); - } else if (obj.type === 'sys') { - project.addSystemLibrary(parentDir, subDir); - } else { - project.addSubProject(parentDir, subDir); - } - }, - uninstall: function (obj, plugin, project, options) { - var src = obj.src; - if (!src) throw new CordovaError(generateAttributeError('src', 'framework', plugin.id)); - - events.emit('verbose', 'Uninstalling Android library: ' + src); - var parentDir = obj.parent ? path.resolve(project.projectDir, obj.parent) : project.projectDir; - var subDir; - - if (obj.custom) { - var subRelativeDir = project.getCustomSubprojectRelativeDir(plugin.id, src); - removeFile(project.projectDir, subRelativeDir); - subDir = path.resolve(project.projectDir, subRelativeDir); - // If it's the last framework in the plugin, remove the parent directory. - var parDir = path.dirname(subDir); - if (fs.existsSync(parDir) && fs.readdirSync(parDir).length === 0) { - fs.rmdirSync(parDir); - } - } else { - obj.type = 'sys'; - subDir = src; - } - - if (obj.type === 'gradleReference') { - project.removeGradleReference(parentDir, subDir); - } else if (obj.type === 'sys') { - project.removeSystemLibrary(parentDir, subDir); - } else { - project.removeSubProject(parentDir, subDir); - } - } - }, - asset: { - install: function (obj, plugin, project, options) { - if (!obj.src) { - throw new CordovaError(generateAttributeError('src', 'asset', plugin.id)); - } - if (!obj.target) { - throw new CordovaError(generateAttributeError('target', 'asset', plugin.id)); - } - - copyFile(plugin.dir, obj.src, project.www, obj.target); - if (options && options.usePlatformWww) { - // CB-11022 copy file to both directories if usePlatformWww is specified - copyFile(plugin.dir, obj.src, project.platformWww, obj.target); - } - }, - uninstall: function (obj, plugin, project, options) { - var target = obj.target || obj.src; - - if (!target) throw new CordovaError(generateAttributeError('target', 'asset', plugin.id)); - - removeFileF(path.resolve(project.www, target)); - removeFileF(path.resolve(project.www, 'plugins', plugin.id)); - if (options && options.usePlatformWww) { - // CB-11022 remove file from both directories if usePlatformWww is specified - removeFileF(path.resolve(project.platformWww, target)); - removeFileF(path.resolve(project.platformWww, 'plugins', plugin.id)); - } - } - }, - 'js-module': { - install: function (obj, plugin, project, options) { - // Copy the plugin's files into the www directory. - var moduleSource = path.resolve(plugin.dir, obj.src); - var moduleName = plugin.id + '.' + (obj.name || path.basename(obj.src, path.extname(obj.src))); - - // Read in the file, prepend the cordova.define, and write it back out. - var scriptContent = fs.readFileSync(moduleSource, 'utf-8').replace(/^\ufeff/, ''); // Window BOM - if (moduleSource.match(/.*\.json$/)) { - scriptContent = 'module.exports = ' + scriptContent; - } - scriptContent = 'cordova.define("' + moduleName + '", function(require, exports, module) {\n' + scriptContent + '\n});\n'; - - var wwwDest = path.resolve(project.www, 'plugins', plugin.id, obj.src); - shell.mkdir('-p', path.dirname(wwwDest)); - fs.writeFileSync(wwwDest, scriptContent, 'utf-8'); - - if (options && options.usePlatformWww) { - // CB-11022 copy file to both directories if usePlatformWww is specified - var platformWwwDest = path.resolve(project.platformWww, 'plugins', plugin.id, obj.src); - shell.mkdir('-p', path.dirname(platformWwwDest)); - fs.writeFileSync(platformWwwDest, scriptContent, 'utf-8'); - } - }, - uninstall: function (obj, plugin, project, options) { - var pluginRelativePath = path.join('plugins', plugin.id, obj.src); - removeFileAndParents(project.www, pluginRelativePath); - if (options && options.usePlatformWww) { - // CB-11022 remove file from both directories if usePlatformWww is specified - removeFileAndParents(project.platformWww, pluginRelativePath); - } - } - } -}; - -module.exports.getInstaller = function (type) { - if (handlers[type] && handlers[type].install) { - return handlers[type].install; - } - - events.emit('verbose', '<' + type + '> is not supported for android plugins'); -}; - -module.exports.getUninstaller = function (type) { - if (handlers[type] && handlers[type].uninstall) { - return handlers[type].uninstall; - } - - events.emit('verbose', '<' + type + '> is not supported for android plugins'); -}; - -function copyFile (plugin_dir, src, project_dir, dest, link) { - src = path.resolve(plugin_dir, src); - if (!fs.existsSync(src)) throw new CordovaError('"' + src + '" not found!'); - - // check that src path is inside plugin directory - var real_path = fs.realpathSync(src); - var real_plugin_path = fs.realpathSync(plugin_dir); - if (real_path.indexOf(real_plugin_path) !== 0) { throw new CordovaError('File "' + src + '" is located outside the plugin directory "' + plugin_dir + '"'); } - - dest = path.resolve(project_dir, dest); - - // check that dest path is located in project directory - if (dest.indexOf(project_dir) !== 0) { throw new CordovaError('Destination "' + dest + '" for source file "' + src + '" is located outside the project'); } - - shell.mkdir('-p', path.dirname(dest)); - if (link) { - symlinkFileOrDirTree(src, dest); - } else if (fs.statSync(src).isDirectory()) { - // XXX shelljs decides to create a directory when -R|-r is used which sucks. http://goo.gl/nbsjq - shell.cp('-Rf', src + '/*', dest); - } else { - shell.cp('-f', src, dest); - } -} - -// Same as copy file but throws error if target exists -function copyNewFile (plugin_dir, src, project_dir, dest, link) { - var target_path = path.resolve(project_dir, dest); - if (fs.existsSync(target_path)) { throw new CordovaError('"' + target_path + '" already exists!'); } - - copyFile(plugin_dir, src, project_dir, dest, !!link); -} - -function symlinkFileOrDirTree (src, dest) { - if (fs.existsSync(dest)) { - shell.rm('-Rf', dest); - } - - if (fs.statSync(src).isDirectory()) { - shell.mkdir('-p', dest); - fs.readdirSync(src).forEach(function (entry) { - symlinkFileOrDirTree(path.join(src, entry), path.join(dest, entry)); - }); - } else { - fs.symlinkSync(path.relative(fs.realpathSync(path.dirname(dest)), src), dest); - } -} - -// checks if file exists and then deletes. Error if doesn't exist -function removeFile (project_dir, src) { - var file = path.resolve(project_dir, src); - shell.rm('-Rf', file); -} - -// deletes file/directory without checking -function removeFileF (file) { - shell.rm('-Rf', file); -} - -// Sometimes we want to remove some java, and prune any unnecessary empty directories -function deleteJava (project_dir, destFile) { - removeFileAndParents(project_dir, destFile, 'src'); -} - -function removeFileAndParents (baseDir, destFile, stopper) { - stopper = stopper || '.'; - var file = path.resolve(baseDir, destFile); - if (!fs.existsSync(file)) return; - - removeFileF(file); - - // check if directory is empty - var curDir = path.dirname(file); - - while (curDir !== path.resolve(baseDir, stopper)) { - if (fs.existsSync(curDir) && fs.readdirSync(curDir).length === 0) { - fs.rmdirSync(curDir); - curDir = path.resolve(curDir, '..'); - } else { - // directory not empty...do nothing - break; - } - } -} - -function generateAttributeError (attribute, element, id) { - return 'Required attribute "' + attribute + '" not specified in <' + element + '> element from plugin: ' + id; -} - -function getInstallDestination (obj) { - var APP_MAIN_PREFIX = 'app/src/main'; - var PATH_SEPARATOR = '/'; - - var PATH_SEP_MATCH = '\\' + PATH_SEPARATOR; - var PATH_SEP_OR_EOL_MATCH = '(\\' + PATH_SEPARATOR + '|$)'; - - var appReg = new RegExp('^app' + PATH_SEP_OR_EOL_MATCH); - var libsReg = new RegExp('^libs' + PATH_SEP_OR_EOL_MATCH); - var srcReg = new RegExp('^src' + PATH_SEP_OR_EOL_MATCH); - var srcMainReg = new RegExp('^src' + PATH_SEP_MATCH + 'main' + PATH_SEP_OR_EOL_MATCH); - - if (appReg.test(obj.targetDir)) { - // If any source file is using the new app directory structure, - // don't penalize it - return path.join(obj.targetDir, path.basename(obj.src)); - } else { - // Plugin using deprecated target directory structure (GH-580) - if (obj.src.endsWith('.java')) { - return path.join(APP_MAIN_PREFIX, 'java', obj.targetDir.replace(srcReg, ''), - path.basename(obj.src)); - } else if (obj.src.endsWith('.aidl')) { - return path.join(APP_MAIN_PREFIX, 'aidl', obj.targetDir.replace(srcReg, ''), - path.basename(obj.src)); - } else if (libsReg.test(obj.targetDir)) { - if (obj.src.endsWith('.so')) { - return path.join(APP_MAIN_PREFIX, 'jniLibs', obj.targetDir.replace(libsReg, ''), - path.basename(obj.src)); - } else { - return path.join('app', obj.targetDir, path.basename(obj.src)); - } - } else if (srcMainReg.test(obj.targetDir)) { - return path.join('app', obj.targetDir, path.basename(obj.src)); - } - - // For all other source files not using the new app directory structure, - // add 'app/src/main' to the targetDir - return path.join(APP_MAIN_PREFIX, obj.targetDir, path.basename(obj.src)); - } -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/prepare.js b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/prepare.js deleted file mode 100644 index 64970e8..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/prepare.js +++ /dev/null @@ -1,702 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ -/* eslint no-useless-escape: 0 */ - -var Q = require('q'); -var fs = require('fs'); -var path = require('path'); -var shell = require('shelljs'); -var events = require('cordova-common').events; -var AndroidManifest = require('./AndroidManifest'); -var checkReqs = require('./check_reqs'); -var xmlHelpers = require('cordova-common').xmlHelpers; -var CordovaError = require('cordova-common').CordovaError; -var ConfigParser = require('cordova-common').ConfigParser; -var FileUpdater = require('cordova-common').FileUpdater; -var PlatformJson = require('cordova-common').PlatformJson; -var PlatformMunger = require('cordova-common').ConfigChanges.PlatformMunger; -var PluginInfoProvider = require('cordova-common').PluginInfoProvider; - -const GradlePropertiesParser = require('./config/GradlePropertiesParser'); - -module.exports.prepare = function (cordovaProject, options) { - var self = this; - - var platformJson = PlatformJson.load(this.locations.root, this.platform); - var munger = new PlatformMunger(this.platform, this.locations.root, platformJson, new PluginInfoProvider()); - - this._config = updateConfigFilesFrom(cordovaProject.projectConfig, munger, this.locations); - - // Get the min SDK version from config.xml - const minSdkVersion = this._config.getPreference('android-minSdkVersion', 'android'); - const maxSdkVersion = this._config.getPreference('android-maxSdkVersion', 'android'); - const targetSdkVersion = this._config.getPreference('android-targetSdkVersion', 'android'); - - let gradlePropertiesUserConfig = {}; - if (minSdkVersion) gradlePropertiesUserConfig.cdvMinSdkVersion = minSdkVersion; - if (maxSdkVersion) gradlePropertiesUserConfig.cdvMaxSdkVersion = maxSdkVersion; - if (targetSdkVersion) gradlePropertiesUserConfig.cdvTargetSdkVersion = targetSdkVersion; - - let gradlePropertiesParser = new GradlePropertiesParser(this.locations.root); - gradlePropertiesParser.configure(gradlePropertiesUserConfig); - - // Update own www dir with project's www assets and plugins' assets and js-files - return Q.when(updateWww(cordovaProject, this.locations)).then(function () { - // update project according to config.xml changes. - return updateProjectAccordingTo(self._config, self.locations); - }).then(function () { - updateIcons(cordovaProject, path.relative(cordovaProject.root, self.locations.res)); - updateSplashes(cordovaProject, path.relative(cordovaProject.root, self.locations.res)); - updateFileResources(cordovaProject, path.relative(cordovaProject.root, self.locations.root)); - }).then(function () { - events.emit('verbose', 'Prepared android project successfully'); - }); -}; - -module.exports.clean = function (options) { - // A cordovaProject isn't passed into the clean() function, because it might have - // been called from the platform shell script rather than the CLI. Check for the - // noPrepare option passed in by the non-CLI clean script. If that's present, or if - // there's no config.xml found at the project root, then don't clean prepared files. - var projectRoot = path.resolve(this.root, '../..'); - if ((options && options.noPrepare) || !fs.existsSync(this.locations.configXml) || - !fs.existsSync(this.locations.configXml)) { - return Q(); - } - - var projectConfig = new ConfigParser(this.locations.configXml); - - var self = this; - return Q().then(function () { - cleanWww(projectRoot, self.locations); - cleanIcons(projectRoot, projectConfig, path.relative(projectRoot, self.locations.res)); - cleanSplashes(projectRoot, projectConfig, path.relative(projectRoot, self.locations.res)); - cleanFileResources(projectRoot, projectConfig, path.relative(projectRoot, self.locations.root)); - }); -}; - -/** - * Updates config files in project based on app's config.xml and config munge, - * generated by plugins. - * - * @param {ConfigParser} sourceConfig A project's configuration that will - * be merged into platform's config.xml - * @param {ConfigChanges} configMunger An initialized ConfigChanges instance - * for this platform. - * @param {Object} locations A map of locations for this platform - * - * @return {ConfigParser} An instance of ConfigParser, that - * represents current project's configuration. When returned, the - * configuration is already dumped to appropriate config.xml file. - */ -function updateConfigFilesFrom (sourceConfig, configMunger, locations) { - events.emit('verbose', 'Generating platform-specific config.xml from defaults for android at ' + locations.configXml); - - // First cleanup current config and merge project's one into own - // Overwrite platform config.xml with defaults.xml. - shell.cp('-f', locations.defaultConfigXml, locations.configXml); - - // Then apply config changes from global munge to all config files - // in project (including project's config) - configMunger.reapply_global_munge().save_all(); - - events.emit('verbose', 'Merging project\'s config.xml into platform-specific android config.xml'); - // Merge changes from app's config.xml into platform's one - var config = new ConfigParser(locations.configXml); - xmlHelpers.mergeXml(sourceConfig.doc.getroot(), - config.doc.getroot(), 'android', /* clobber= */true); - - config.write(); - return config; -} - -/** - * Logs all file operations via the verbose event stream, indented. - */ -function logFileOp (message) { - events.emit('verbose', ' ' + message); -} - -/** - * Updates platform 'www' directory by replacing it with contents of - * 'platform_www' and app www. Also copies project's overrides' folder into - * the platform 'www' folder - * - * @param {Object} cordovaProject An object which describes cordova project. - * @param {Object} destinations An object that contains destination - * paths for www files. - */ -function updateWww (cordovaProject, destinations) { - var sourceDirs = [ - path.relative(cordovaProject.root, cordovaProject.locations.www), - path.relative(cordovaProject.root, destinations.platformWww) - ]; - - // If project contains 'merges' for our platform, use them as another overrides - var merges_path = path.join(cordovaProject.root, 'merges', 'android'); - if (fs.existsSync(merges_path)) { - events.emit('verbose', 'Found "merges/android" folder. Copying its contents into the android project.'); - sourceDirs.push(path.join('merges', 'android')); - } - - var targetDir = path.relative(cordovaProject.root, destinations.www); - events.emit( - 'verbose', 'Merging and updating files from [' + sourceDirs.join(', ') + '] to ' + targetDir); - FileUpdater.mergeAndUpdateDir( - sourceDirs, targetDir, { rootDir: cordovaProject.root }, logFileOp); -} - -/** - * Cleans all files from the platform 'www' directory. - */ -function cleanWww (projectRoot, locations) { - var targetDir = path.relative(projectRoot, locations.www); - events.emit('verbose', 'Cleaning ' + targetDir); - - // No source paths are specified, so mergeAndUpdateDir() will clear the target directory. - FileUpdater.mergeAndUpdateDir( - [], targetDir, { rootDir: projectRoot, all: true }, logFileOp); -} - -/** - * Updates project structure and AndroidManifest according to project's configuration. - * - * @param {ConfigParser} platformConfig A project's configuration that will - * be used to update project - * @param {Object} locations A map of locations for this platform - */ -function updateProjectAccordingTo (platformConfig, locations) { - // Update app name by editing res/values/strings.xml - var strings = xmlHelpers.parseElementtreeSync(locations.strings); - - var name = platformConfig.name(); - strings.find('string[@name="app_name"]').text = name.replace(/\'/g, '\\\''); - - var shortName = platformConfig.shortName && platformConfig.shortName(); - if (shortName && shortName !== name) { - strings.find('string[@name="launcher_name"]').text = shortName.replace(/\'/g, '\\\''); - } - - fs.writeFileSync(locations.strings, strings.write({ indent: 4 }), 'utf-8'); - events.emit('verbose', 'Wrote out android application name "' + name + '" to ' + locations.strings); - - // Java packages cannot support dashes - var androidPkgName = (platformConfig.android_packageName() || platformConfig.packageName()).replace(/-/g, '_'); - - var manifest = new AndroidManifest(locations.manifest); - var manifestId = manifest.getPackageId(); - - manifest.getActivity() - .setOrientation(platformConfig.getPreference('orientation')) - .setLaunchMode(findAndroidLaunchModePreference(platformConfig)); - - manifest.setVersionName(platformConfig.version()) - .setVersionCode(platformConfig.android_versionCode() || default_versionCode(platformConfig.version())) - .setPackageId(androidPkgName) - .write(); - - // Java file paths shouldn't be hard coded - var javaPattern = path.join(locations.javaSrc, manifestId.replace(/\./g, '/'), '*.java'); - var java_files = shell.ls(javaPattern).filter(function (f) { - return shell.grep(/extends\s+CordovaActivity/g, f); - }); - - if (java_files.length === 0) { - throw new CordovaError('No Java files found that extend CordovaActivity.'); - } else if (java_files.length > 1) { - events.emit('log', 'Multiple candidate Java files that extend CordovaActivity found. Guessing at the first one, ' + java_files[0]); - } - - var destFile = path.join(locations.root, 'app', 'src', 'main', 'java', androidPkgName.replace(/\./g, '/'), path.basename(java_files[0])); - shell.mkdir('-p', path.dirname(destFile)); - shell.sed(/package [\w\.]*;/, 'package ' + androidPkgName + ';', java_files[0]).to(destFile); - events.emit('verbose', 'Wrote out Android package name "' + androidPkgName + '" to ' + destFile); - - var removeOrigPkg = checkReqs.isWindows() || checkReqs.isDarwin() ? - manifestId.toUpperCase() !== androidPkgName.toUpperCase() : - manifestId !== androidPkgName; - - if (removeOrigPkg) { - // If package was name changed we need to remove old java with main activity - shell.rm('-Rf', java_files[0]); - // remove any empty directories - var currentDir = path.dirname(java_files[0]); - var sourcesRoot = path.resolve(locations.root, 'src'); - while (currentDir !== sourcesRoot) { - if (fs.existsSync(currentDir) && fs.readdirSync(currentDir).length === 0) { - fs.rmdirSync(currentDir); - currentDir = path.resolve(currentDir, '..'); - } else { - break; - } - } - } -} - -// Consturct the default value for versionCode as -// PATCH + MINOR * 100 + MAJOR * 10000 -// see http://developer.android.com/tools/publishing/versioning.html -function default_versionCode (version) { - var nums = version.split('-')[0].split('.'); - var versionCode = 0; - if (+nums[0]) { - versionCode += +nums[0] * 10000; - } - if (+nums[1]) { - versionCode += +nums[1] * 100; - } - if (+nums[2]) { - versionCode += +nums[2]; - } - - events.emit('verbose', 'android-versionCode not found in config.xml. Generating a code based on version in config.xml (' + version + '): ' + versionCode); - return versionCode; -} - -function getImageResourcePath (resourcesDir, type, density, name, sourceName) { - if (/\.9\.png$/.test(sourceName)) { - name = name.replace(/\.png$/, '.9.png'); - } - var resourcePath = path.join(resourcesDir, (density ? type + '-' + density : type), name); - return resourcePath; -} - -function getAdaptiveImageResourcePath (resourcesDir, type, density, name, sourceName) { - if (/\.9\.png$/.test(sourceName)) { - name = name.replace(/\.png$/, '.9.png'); - } - var resourcePath = path.join(resourcesDir, (density ? type + '-' + density + '-v26' : type), name); - return resourcePath; -} - -function updateSplashes (cordovaProject, platformResourcesDir) { - var resources = cordovaProject.projectConfig.getSplashScreens('android'); - - // if there are "splash" elements in config.xml - if (resources.length === 0) { - events.emit('verbose', 'This app does not have splash screens defined'); - return; - } - - var resourceMap = mapImageResources(cordovaProject.root, platformResourcesDir, 'drawable', 'screen.png'); - - var hadMdpi = false; - resources.forEach(function (resource) { - if (!resource.density) { - return; - } - if (resource.density === 'mdpi') { - hadMdpi = true; - } - var targetPath = getImageResourcePath( - platformResourcesDir, 'drawable', resource.density, 'screen.png', path.basename(resource.src)); - resourceMap[targetPath] = resource.src; - }); - - // There's no "default" drawable, so assume default == mdpi. - if (!hadMdpi && resources.defaultResource) { - var targetPath = getImageResourcePath( - platformResourcesDir, 'drawable', 'mdpi', 'screen.png', path.basename(resources.defaultResource.src)); - resourceMap[targetPath] = resources.defaultResource.src; - } - - events.emit('verbose', 'Updating splash screens at ' + platformResourcesDir); - FileUpdater.updatePaths( - resourceMap, { rootDir: cordovaProject.root }, logFileOp); -} - -function cleanSplashes (projectRoot, projectConfig, platformResourcesDir) { - var resources = projectConfig.getSplashScreens('android'); - if (resources.length > 0) { - var resourceMap = mapImageResources(projectRoot, platformResourcesDir, 'drawable', 'screen.png'); - events.emit('verbose', 'Cleaning splash screens at ' + platformResourcesDir); - - // No source paths are specified in the map, so updatePaths() will delete the target files. - FileUpdater.updatePaths( - resourceMap, { rootDir: projectRoot, all: true }, logFileOp); - } -} - -function updateIcons (cordovaProject, platformResourcesDir) { - let icons = cordovaProject.projectConfig.getIcons('android'); - - // Skip if there are no app defined icons in config.xml - if (icons.length === 0) { - events.emit('verbose', 'This app does not have launcher icons defined'); - return; - } - - // 1. loop icons determin if there is an error in the setup. - // 2. during initial loop, also setup for legacy support. - let errorMissingAttributes = []; - let errorLegacyIconNeeded = []; - let hasAdaptive = false; - icons.forEach((icon, key) => { - if ( - (icon.background && !icon.foreground) - || (!icon.background && icon.foreground) - || (!icon.background && !icon.foreground && !icon.src) - ) { - errorMissingAttributes.push(icon.density ? icon.density : 'size=' + (icon.height || icon.width)); - } - - if (icon.foreground) { - hasAdaptive = true; - - if ( - !icon.src - && ( - icon.foreground.startsWith('@color') - || path.extname(path.basename(icon.foreground)) === '.xml' - ) - ) { - errorLegacyIconNeeded.push(icon.density ? icon.density : 'size=' + (icon.height || icon.width)); - } else if (!icon.src) { - icons[key].src = icon.foreground; - } - } - }); - - let errorMessage = []; - if (errorMissingAttributes.length > 0) { - errorMessage.push('One of the following attributes are set but missing the other for the density type: ' + errorMissingAttributes.join(', ') + '. Please ensure that all require attributes are defined.'); - } - - if (errorLegacyIconNeeded.length > 0) { - errorMessage.push('For the following icons with the density of: ' + errorLegacyIconNeeded.join(', ') + ', adaptive foreground with a defined color or vector can not be used as a standard fallback icon for older Android devices. To support older Android environments, please provide a value for the src attribute.'); - } - - if (errorMessage.length > 0) { - throw new CordovaError(errorMessage.join(' ')); - } - - let resourceMap = Object.assign( - {}, - mapImageResources(cordovaProject.root, platformResourcesDir, 'mipmap', 'ic_launcher.png'), - mapImageResources(cordovaProject.root, platformResourcesDir, 'mipmap', 'ic_launcher_foreground.png'), - mapImageResources(cordovaProject.root, platformResourcesDir, 'mipmap', 'ic_launcher_background.png'), - mapImageResources(cordovaProject.root, platformResourcesDir, 'mipmap', 'ic_launcher_foreground.xml'), - mapImageResources(cordovaProject.root, platformResourcesDir, 'mipmap', 'ic_launcher_background.xml'), - mapImageResources(cordovaProject.root, platformResourcesDir, 'mipmap', 'ic_launcher.xml') - ); - - let preparedIcons = prepareIcons(icons); - - if (hasAdaptive) { - resourceMap = updateIconResourceForAdaptive(preparedIcons, resourceMap, platformResourcesDir); - } - - resourceMap = updateIconResourceForLegacy(preparedIcons, resourceMap, platformResourcesDir); - - events.emit('verbose', 'Updating icons at ' + platformResourcesDir); - FileUpdater.updatePaths(resourceMap, { rootDir: cordovaProject.root }, logFileOp); -} - -function updateIconResourceForAdaptive (preparedIcons, resourceMap, platformResourcesDir) { - let android_icons = preparedIcons.android_icons; - let default_icon = preparedIcons.default_icon; - - // The source paths for icons and splashes are relative to - // project's config.xml location, so we use it as base path. - let background; - let foreground; - let targetPathBackground; - let targetPathForeground; - - for (let density in android_icons) { - let backgroundVal = '@mipmap/ic_launcher_background'; - let foregroundVal = '@mipmap/ic_launcher_foreground'; - - background = android_icons[density].background; - foreground = android_icons[density].foreground; - - if (background.startsWith('@color')) { - // Colors Use Case - backgroundVal = background; // Example: @color/background_foobar_1 - } else if (path.extname(path.basename(background)) === '.xml') { - // Vector Use Case - targetPathBackground = getAdaptiveImageResourcePath(platformResourcesDir, 'mipmap', density, 'ic_launcher_background.xml', path.basename(android_icons[density].background)); - resourceMap[targetPathBackground] = android_icons[density].background; - } else if (path.extname(path.basename(background)) === '.png') { - // Images Use Case - targetPathBackground = getAdaptiveImageResourcePath(platformResourcesDir, 'mipmap', density, 'ic_launcher_background.png', path.basename(android_icons[density].background)); - resourceMap[targetPathBackground] = android_icons[density].background; - } - - if (foreground.startsWith('@color')) { - // Colors Use Case - foregroundVal = foreground; - } else if (path.extname(path.basename(foreground)) === '.xml') { - // Vector Use Case - targetPathForeground = getAdaptiveImageResourcePath(platformResourcesDir, 'mipmap', density, 'ic_launcher_foreground.xml', path.basename(android_icons[density].foreground)); - resourceMap[targetPathForeground] = android_icons[density].foreground; - } else if (path.extname(path.basename(foreground)) === '.png') { - // Images Use Case - targetPathForeground = getAdaptiveImageResourcePath(platformResourcesDir, 'mipmap', density, 'ic_launcher_foreground.png', path.basename(android_icons[density].foreground)); - resourceMap[targetPathForeground] = android_icons[density].foreground; - } - - // create an XML for DPI and set color - const icLauncherTemplate = ` - - - -`; - - let launcherXmlPath = path.join(platformResourcesDir, 'mipmap-' + density + '-v26', 'ic_launcher.xml'); - - // Remove the XML from the resourceMap so the file does not get removed. - delete resourceMap[launcherXmlPath]; - - fs.writeFileSync(path.resolve(launcherXmlPath), icLauncherTemplate); - } - - // There's no "default" drawable, so assume default == mdpi. - if (default_icon && !android_icons.mdpi) { - let defaultTargetPathBackground; - let defaultTargetPathForeground; - - if (background.startsWith('@color')) { - // Colors Use Case - targetPathBackground = default_icon.background; - } else if (path.extname(path.basename(background)) === '.xml') { - // Vector Use Case - defaultTargetPathBackground = getAdaptiveImageResourcePath(platformResourcesDir, 'mipmap', 'mdpi', 'ic_launcher_background.xml', path.basename(default_icon.background)); - resourceMap[defaultTargetPathBackground] = default_icon.background; - } else if (path.extname(path.basename(background)) === '.png') { - // Images Use Case - defaultTargetPathBackground = getAdaptiveImageResourcePath(platformResourcesDir, 'mipmap', 'mdpi', 'ic_launcher_background.png', path.basename(default_icon.background)); - resourceMap[defaultTargetPathBackground] = default_icon.background; - } - - if (foreground.startsWith('@color')) { - // Colors Use Case - targetPathForeground = default_icon.foreground; - } else if (path.extname(path.basename(foreground)) === '.xml') { - // Vector Use Case - defaultTargetPathForeground = getAdaptiveImageResourcePath(platformResourcesDir, 'mipmap', 'mdpi', 'ic_launcher_foreground.xml', path.basename(default_icon.foreground)); - resourceMap[defaultTargetPathForeground] = default_icon.foreground; - } else if (path.extname(path.basename(foreground)) === '.png') { - // Images Use Case - defaultTargetPathForeground = getAdaptiveImageResourcePath(platformResourcesDir, 'mipmap', 'mdpi', 'ic_launcher_foreground.png', path.basename(default_icon.foreground)); - resourceMap[defaultTargetPathForeground] = default_icon.foreground; - } - } - - return resourceMap; -} - -function updateIconResourceForLegacy (preparedIcons, resourceMap, platformResourcesDir) { - let android_icons = preparedIcons.android_icons; - let default_icon = preparedIcons.default_icon; - - // The source paths for icons and splashes are relative to - // project's config.xml location, so we use it as base path. - for (var density in android_icons) { - var targetPath = getImageResourcePath(platformResourcesDir, 'mipmap', density, 'ic_launcher.png', path.basename(android_icons[density].src)); - resourceMap[targetPath] = android_icons[density].src; - } - - // There's no "default" drawable, so assume default == mdpi. - if (default_icon && !android_icons.mdpi) { - var defaultTargetPath = getImageResourcePath(platformResourcesDir, 'mipmap', 'mdpi', 'ic_launcher.png', path.basename(default_icon.src)); - resourceMap[defaultTargetPath] = default_icon.src; - } - - return resourceMap; -} - -function prepareIcons (icons) { - // http://developer.android.com/design/style/iconography.html - const SIZE_TO_DENSITY_MAP = { - 36: 'ldpi', - 48: 'mdpi', - 72: 'hdpi', - 96: 'xhdpi', - 144: 'xxhdpi', - 192: 'xxxhdpi' - }; - - let android_icons = {}; - let default_icon; - - // find the best matching icon for a given density or size - // @output android_icons - var parseIcon = function (icon, icon_size) { - // do I have a platform icon for that density already - var density = icon.density || SIZE_TO_DENSITY_MAP[icon_size]; - if (!density) { - // invalid icon defition ( or unsupported size) - return; - } - var previous = android_icons[density]; - if (previous && previous.platform) { - return; - } - android_icons[density] = icon; - }; - - // iterate over all icon elements to find the default icon and call parseIcon - for (var i = 0; i < icons.length; i++) { - var icon = icons[i]; - var size = icon.width; - - if (!size) { - size = icon.height; - } - - if (!size && !icon.density) { - if (default_icon) { - let found = {}; - let favor = {}; - - // populating found icon. - if (icon.background && icon.foreground) { - found.background = icon.background; - found.foreground = icon.foreground; - } - if (icon.src) { - found.src = icon.src; - } - - if (default_icon.background && default_icon.foreground) { - favor.background = default_icon.background; - favor.foreground = default_icon.foreground; - } - if (default_icon.src) { - favor.src = default_icon.src; - } - - events.emit('verbose', 'Found extra default icon: ' + JSON.stringify(found) + ' and ignoring in favor of ' + JSON.stringify(favor) + '.'); - } else { - default_icon = icon; - } - } else { - parseIcon(icon, size); - } - } - - return { - android_icons: android_icons, - default_icon: default_icon - }; -} - -function cleanIcons (projectRoot, projectConfig, platformResourcesDir) { - var icons = projectConfig.getIcons('android'); - - // Skip if there are no app defined icons in config.xml - if (icons.length === 0) { - events.emit('verbose', 'This app does not have launcher icons defined'); - return; - } - - let resourceMap = Object.assign( - {}, - mapImageResources(projectRoot, platformResourcesDir, 'mipmap', 'ic_launcher.png'), - mapImageResources(projectRoot, platformResourcesDir, 'mipmap', 'ic_launcher_foreground.png'), - mapImageResources(projectRoot, platformResourcesDir, 'mipmap', 'ic_launcher_background.png'), - mapImageResources(projectRoot, platformResourcesDir, 'mipmap', 'ic_launcher_foreground.xml'), - mapImageResources(projectRoot, platformResourcesDir, 'mipmap', 'ic_launcher_background.xml'), - mapImageResources(projectRoot, platformResourcesDir, 'mipmap', 'ic_launcher.xml') - ); - - events.emit('verbose', 'Cleaning icons at ' + platformResourcesDir); - - // No source paths are specified in the map, so updatePaths() will delete the target files. - FileUpdater.updatePaths(resourceMap, { rootDir: projectRoot, all: true }, logFileOp); -} - -/** - * Gets a map containing resources of a specified name from all drawable folders in a directory. - */ -function mapImageResources (rootDir, subDir, type, resourceName) { - var pathMap = {}; - shell.ls(path.join(rootDir, subDir, type + '-*')).forEach(function (drawableFolder) { - var imagePath = path.join(subDir, path.basename(drawableFolder), resourceName); - pathMap[imagePath] = null; - }); - return pathMap; -} - -function updateFileResources (cordovaProject, platformDir) { - var files = cordovaProject.projectConfig.getFileResources('android'); - - // if there are resource-file elements in config.xml - if (files.length === 0) { - events.emit('verbose', 'This app does not have additional resource files defined'); - return; - } - - var resourceMap = {}; - files.forEach(function (res) { - var targetPath = path.join(platformDir, res.target); - resourceMap[targetPath] = res.src; - }); - - events.emit('verbose', 'Updating resource files at ' + platformDir); - FileUpdater.updatePaths( - resourceMap, { rootDir: cordovaProject.root }, logFileOp); -} - -function cleanFileResources (projectRoot, projectConfig, platformDir) { - var files = projectConfig.getFileResources('android', true); - if (files.length > 0) { - events.emit('verbose', 'Cleaning resource files at ' + platformDir); - - var resourceMap = {}; - files.forEach(function (res) { - var filePath = path.join(platformDir, res.target); - resourceMap[filePath] = null; - }); - - FileUpdater.updatePaths( - resourceMap, { - rootDir: projectRoot, all: true }, logFileOp); - } -} - -/** - * Gets and validates 'AndroidLaunchMode' prepference from config.xml. Returns - * preference value and warns if it doesn't seems to be valid - * - * @param {ConfigParser} platformConfig A configParser instance for - * platform. - * - * @return {String} Preference's value from config.xml or - * default value, if there is no such preference. The default value is - * 'singleTop' - */ -function findAndroidLaunchModePreference (platformConfig) { - var launchMode = platformConfig.getPreference('AndroidLaunchMode'); - if (!launchMode) { - // Return a default value - return 'singleTop'; - } - - var expectedValues = ['standard', 'singleTop', 'singleTask', 'singleInstance']; - var valid = expectedValues.indexOf(launchMode) >= 0; - if (!valid) { - // Note: warn, but leave the launch mode as developer wanted, in case the list of options changes in the future - events.emit('warn', 'Unrecognized value for AndroidLaunchMode preference: ' + - launchMode + '. Expected values are: ' + expectedValues.join(', ')); - } - - return launchMode; -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/retry.js b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/retry.js deleted file mode 100644 index b2b9a44..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/retry.js +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env node - -/* - 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. -*/ - -'use strict'; - -var events = require('cordova-common').events; - -/* - * Retry a promise-returning function a number of times, propagating its - * results on success or throwing its error on a failed final attempt. - * - * @arg {Number} attemptsLeft - The number of times to retry the passed call. - * @arg {Function} promiseFunction - A function that returns a promise. - * @arg {...} - Arguments to pass to promiseFunction. - * - * @returns {Promise} - */ -module.exports.retryPromise = function (attemptsLeft, promiseFunction) { - - // NOTE: - // get all trailing arguments, by skipping the first two (attemptsLeft and - // promiseFunction) because they shouldn't get passed to promiseFunction - var promiseFunctionArguments = Array.prototype.slice.call(arguments, 2); - - return promiseFunction.apply(undefined, promiseFunctionArguments).then( - // on success pass results through - function onFulfilled (value) { - return value; - }, - - // on rejection either retry, or throw the error - function onRejected (error) { - attemptsLeft -= 1; - - if (attemptsLeft < 1) { - throw error; - } - - events.emit('verbose', 'A retried call failed. Retrying ' + attemptsLeft + ' more time(s).'); - - // retry call self again with the same arguments, except attemptsLeft is now lower - var fullArguments = [attemptsLeft, promiseFunction].concat(promiseFunctionArguments); - return module.exports.retryPromise.apply(undefined, fullArguments); - } - ); -}; diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/run.js b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/run.js deleted file mode 100644 index f1c70f2..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/run.js +++ /dev/null @@ -1,140 +0,0 @@ -#!/usr/bin/env node - -/* - 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 path = require('path'); -var emulator = require('./emulator'); -var device = require('./device'); -var Q = require('q'); -var PackageType = require('./PackageType'); -var events = require('cordova-common').events; - -function getInstallTarget (runOptions) { - var install_target; - if (runOptions.target) { - install_target = runOptions.target; - } else if (runOptions.device) { - install_target = '--device'; - } else if (runOptions.emulator) { - install_target = '--emulator'; - } - - return install_target; -} - -/** - * Runs the application on a device if available. If no device is found, it will - * use a started emulator. If no started emulators are found it will attempt - * to start an avd. If no avds are found it will error out. - * - * @param {Object} runOptions various run/build options. See Api.js build/run - * methods for reference. - * - * @return {Promise} - */ -module.exports.run = function (runOptions) { - runOptions = runOptions || {}; - - var self = this; - var install_target = getInstallTarget(runOptions); - - return Q().then(function () { - if (!install_target) { - // no target given, deploy to device if available, otherwise use the emulator. - return device.list().then(function (device_list) { - if (device_list.length > 0) { - events.emit('warn', 'No target specified, deploying to device \'' + device_list[0] + '\'.'); - install_target = device_list[0]; - } else { - events.emit('warn', 'No target specified and no devices found, deploying to emulator'); - install_target = '--emulator'; - } - }); - } - }).then(function () { - if (install_target === '--device') { - return device.resolveTarget(null); - } else if (install_target === '--emulator') { - // Give preference to any already started emulators. Else, start one. - return emulator.list_started().then(function (started) { - return started && started.length > 0 ? started[0] : emulator.start(); - }).then(function (emulatorId) { - return emulator.resolveTarget(emulatorId); - }); - } - // They specified a specific device/emulator ID. - return device.list().then(function (devices) { - if (devices.indexOf(install_target) > -1) { - return device.resolveTarget(install_target); - } - return emulator.list_started().then(function (started_emulators) { - if (started_emulators.indexOf(install_target) > -1) { - return emulator.resolveTarget(install_target); - } - return emulator.list_images().then(function (avds) { - // if target emulator isn't started, then start it. - for (var avd in avds) { - if (avds[avd].name === install_target) { - return emulator.start(install_target).then(function (emulatorId) { - return emulator.resolveTarget(emulatorId); - }); - } - } - return Q.reject('Target \'' + install_target + '\' not found, unable to run project'); - }); - }); - }); - }).then(function (resolvedTarget) { - return new Promise((resolve) => { - const builder = require('./builders/builders').getBuilder(); - const buildOptions = require('./build').parseBuildOptions(runOptions, null, self.root); - - // Android app bundles cannot be deployed directly to the device - if (buildOptions.packageType === PackageType.BUNDLE) { - const packageTypeErrorMessage = 'Package type "bundle" is not supported during cordova run.'; - events.emit('error', packageTypeErrorMessage); - throw packageTypeErrorMessage; - } - - resolve(builder.fetchBuildResults(buildOptions.buildType, buildOptions.arch)); - }).then(function (buildResults) { - if (resolvedTarget && resolvedTarget.isEmulator) { - return emulator.wait_for_boot(resolvedTarget.target).then(function () { - return emulator.install(resolvedTarget, buildResults); - }); - } - - return device.install(resolvedTarget, buildResults); - }); - }); -}; - -module.exports.help = function () { - console.log('Usage: ' + path.relative(process.cwd(), process.argv[1]) + ' [options]'); - console.log('Build options :'); - console.log(' --debug : Builds project in debug mode'); - console.log(' --release : Builds project in release mode'); - console.log(' --nobuild : Runs the currently built project without recompiling'); - console.log('Deploy options :'); - console.log(' --device : Will deploy the built project to a device'); - console.log(' --emulator : Will deploy the built project to an emulator if one exists'); - console.log(' --target= : Installs to the target with the specified id.'); - process.exit(0); -}; diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/start-emulator b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/start-emulator deleted file mode 100755 index 20c92b7..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/start-emulator +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env node - -/* - 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 emulator = require('./emulator'); -var args = process.argv; - -var install_target; -if (args.length > 2) { - if (args[2].substring(0, 9) === '--target=') { - install_target = args[2].substring(9, args[2].length); - } else { - console.error('ERROR : argument \'' + args[2] + '\' not recognized.'); - process.exit(2); - } -} - -emulator.start(install_target).catch(function (err) { - console.error('ERROR: ' + err); - process.exit(2); -}); diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/start-emulator.bat b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/start-emulator.bat deleted file mode 100644 index 6c237ea..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/lib/start-emulator.bat +++ /dev/null @@ -1,26 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. - -@ECHO OFF -SET script_path="%~dp0start-emulator" -IF EXIST %script_path% ( - node %script_path% %* -) ELSE ( - ECHO. - ECHO ERROR: Could not find 'start-emulator' script in 'cordova\lib' folder, aborting...>&2 - EXIT /B 1 -) \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/log b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/log deleted file mode 100755 index 6829f28..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/log +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env node - -/* - 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 log = require('./lib/log'); -var reqs = require('./lib/check_reqs'); -var args = process.argv; - -// Usage support for when args are given -if (args.length > 2) { - log.help(); -} else { - reqs.run().done(function () { - return log.run(); - }, function (err) { - console.error('ERROR: ' + err); - process.exit(2); - }); -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/log.bat b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/log.bat deleted file mode 100644 index 4b2b434..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/log.bat +++ /dev/null @@ -1,26 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. - -@ECHO OFF -SET script_path="%~dp0log" -IF EXIST %script_path% ( - node %script_path% %* -) ELSE ( - ECHO. - ECHO ERROR: Could not find 'log' script in 'cordova' folder, aborting...>&2 - EXIT /B 1 -) \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/loggingHelper.js b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/loggingHelper.js deleted file mode 100644 index 32b2ee0..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/loggingHelper.js +++ /dev/null @@ -1,18 +0,0 @@ -var CordovaLogger = require('cordova-common').CordovaLogger; - -module.exports = { - adjustLoggerLevel: function (opts) { - if (opts instanceof Array) { - opts.silent = opts.indexOf('--silent') !== -1; - opts.verbose = opts.indexOf('--verbose') !== -1; - } - - if (opts.silent) { - CordovaLogger.get().setLevel('error'); - } - - if (opts.verbose) { - CordovaLogger.get().setLevel('verbose'); - } - } -}; diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/run b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/run deleted file mode 100755 index a3d6f53..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/run +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env node - -/* - 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 Api = require('./Api'); -var nopt = require('nopt'); -var path = require('path'); - -// Support basic help commands -if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) >= 0) { - require('./lib/run').help(); -} - -// Do some basic argument parsing -var runOpts = nopt({ - 'verbose': Boolean, - 'silent': Boolean, - 'debug': Boolean, - 'release': Boolean, - 'nobuild': Boolean, - 'buildConfig': path, - 'archs': String, - 'device': Boolean, - 'emulator': Boolean, - 'target': String -}, { 'd': '--verbose' }); - -// Make runOptions compatible with PlatformApi run method spec -runOpts.argv = runOpts.argv.remain; - -require('./loggingHelper').adjustLoggerLevel(runOpts); - -new Api().run(runOpts) - .catch(function (err) { - console.error(err, err.stack); - process.exit(2); - }); diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/run.bat b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/run.bat deleted file mode 100644 index b0bc28b..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/run.bat +++ /dev/null @@ -1,26 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. - -@ECHO OFF -SET script_path="%~dp0run" -IF EXIST %script_path% ( - node %script_path% %* -) ELSE ( - ECHO. - ECHO ERROR: Could not find 'run' script in 'cordova' folder, aborting...>&2 - EXIT /B 1 -) \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/version b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/version deleted file mode 100755 index f6c759f..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/version +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env node - -/* - 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. -*/ - -// Coho updates this line: -var VERSION = "8.1.0"; - -module.exports.version = VERSION; - -if (!module.parent) { - console.log(VERSION); -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/version.bat b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/version.bat deleted file mode 100644 index 3610c17..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/cordova/version.bat +++ /dev/null @@ -1,26 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. - -@ECHO OFF -SET script_path="%~dp0version" -IF EXIST %script_path% ( - node %script_path% %* -) ELSE ( - ECHO. - ECHO ERROR: Could not find 'version' script in 'cordova' folder, aborting...>&2 - EXIT /B 1 -) diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/Activity.java b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/Activity.java deleted file mode 100644 index 567b6c7..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/Activity.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -package __ID__; - -import android.os.Bundle; -import org.apache.cordova.*; - -public class __ACTIVITY__ extends CordovaActivity -{ - @Override - public void onCreate(Bundle savedInstanceState) - { - super.onCreate(savedInstanceState); - - // enable Cordova apps to be started in the background - Bundle extras = getIntent().getExtras(); - if (extras != null && extras.getBoolean("cdvStartInBackground", false)) { - moveTaskToBack(true); - } - - // Set by in config.xml - loadUrl(launchUrl); - } -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/AndroidManifest.xml b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/AndroidManifest.xml deleted file mode 100644 index 2df92fd..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/AndroidManifest.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/app/build.gradle b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/app/build.gradle deleted file mode 100644 index ea26195..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/app/build.gradle +++ /dev/null @@ -1,358 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -apply plugin: 'com.android.application' - -buildscript { - repositories { - mavenCentral() - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' - } -} - -// Allow plugins to declare Maven dependencies via build-extras.gradle. -allprojects { - repositories { - mavenCentral() - jcenter() - } -} - -task wrapper(type: Wrapper) { - gradleVersion = '4.10.3' -} - -// Configuration properties. Set these via environment variables, build-extras.gradle, or gradle.properties. -// Refer to: http://www.gradle.org/docs/current/userguide/tutorial_this_and_that.html -ext { - apply from: '../CordovaLib/cordova.gradle' - - // The value for android.compileSdkVersion. - if (!project.hasProperty('cdvCompileSdkVersion')) { - cdvCompileSdkVersion = null; - } - // The value for android.buildToolsVersion. - if (!project.hasProperty('cdvBuildToolsVersion')) { - cdvBuildToolsVersion = null; - } - // Sets the versionCode to the given value. - if (!project.hasProperty('cdvVersionCode')) { - cdvVersionCode = null - } - // Sets the minSdkVersion to the given value. - if (!project.hasProperty('cdvMinSdkVersion')) { - cdvMinSdkVersion = null - } - // Sets the maxSdkVersion to the given value. - if (!project.hasProperty('cdvMaxSdkVersion')) { - cdvMaxSdkVersion = null - } - // The value for android.targetSdkVersion. - if (!project.hasProperty('cdvTargetSdkVersion')) { - cdvTargetSdkVersion = null; - } - // Whether to build architecture-specific APKs. - if (!project.hasProperty('cdvBuildMultipleApks')) { - cdvBuildMultipleApks = null - } - // Whether to append a 0 "abi digit" to versionCode when only a single APK is build - if (!project.hasProperty('cdvVersionCodeForceAbiDigit')) { - cdvVersionCodeForceAbiDigit = null - } - // .properties files to use for release signing. - if (!project.hasProperty('cdvReleaseSigningPropertiesFile')) { - cdvReleaseSigningPropertiesFile = null - } - // .properties files to use for debug signing. - if (!project.hasProperty('cdvDebugSigningPropertiesFile')) { - cdvDebugSigningPropertiesFile = null - } - // Set by build.js script. - if (!project.hasProperty('cdvBuildArch')) { - cdvBuildArch = null - } - - // Plugin gradle extensions can append to this to have code run at the end. - cdvPluginPostBuildExtras = [] -} - -// PLUGIN GRADLE EXTENSIONS START -// PLUGIN GRADLE EXTENSIONS END - -def hasBuildExtras1 = file('build-extras.gradle').exists() -if (hasBuildExtras1) { - apply from: 'build-extras.gradle' -} - -def hasBuildExtras2 = file('../build-extras.gradle').exists() -if (hasBuildExtras2) { - apply from: '../build-extras.gradle' -} - -// Set property defaults after extension .gradle files. -ext.cdvCompileSdkVersion = cdvCompileSdkVersion == null ? ( - defaultCompileSdkVersion == null - ? privateHelpers.getProjectTarget() - : defaultCompileSdkVersion -) : Integer.parseInt('' + cdvCompileSdkVersion); - -if (ext.cdvBuildToolsVersion == null) { - ext.cdvBuildToolsVersion = privateHelpers.findLatestInstalledBuildTools() - //ext.cdvBuildToolsVersion = project.ext.defaultBuildToolsVersion -} -if (ext.cdvDebugSigningPropertiesFile == null && file('../debug-signing.properties').exists()) { - ext.cdvDebugSigningPropertiesFile = '../debug-signing.properties' -} -if (ext.cdvReleaseSigningPropertiesFile == null && file('../release-signing.properties').exists()) { - ext.cdvReleaseSigningPropertiesFile = '../release-signing.properties' -} - -// Cast to appropriate types. -ext.cdvBuildMultipleApks = cdvBuildMultipleApks == null ? false : cdvBuildMultipleApks.toBoolean(); -ext.cdvVersionCodeForceAbiDigit = cdvVersionCodeForceAbiDigit == null ? false : cdvVersionCodeForceAbiDigit.toBoolean(); - -// minSdkVersion, maxSdkVersion and targetSdkVersion -ext.cdvMinSdkVersion = cdvMinSdkVersion == null ? defaultMinSdkVersion : Integer.parseInt('' + cdvMinSdkVersion) -if (cdvMaxSdkVersion != null) { - ext.cdvMaxSdkVersion = Integer.parseInt('' + cdvMaxSdkVersion) -} -ext.cdvTargetSdkVersion = cdvTargetSdkVersion == null ? defaultTargetSdkVersion : Integer.parseInt('' + cdvTargetSdkVersion) - -ext.cdvVersionCode = cdvVersionCode == null ? null : Integer.parseInt('' + cdvVersionCode) - -def computeBuildTargetName(debugBuild) { - def ret = 'assemble' - if (cdvBuildMultipleApks && cdvBuildArch) { - def arch = cdvBuildArch == 'arm' ? 'armv7' : cdvBuildArch - ret += '' + arch.toUpperCase().charAt(0) + arch.substring(1); - } - return ret + (debugBuild ? 'Debug' : 'Release') -} - -// Make cdvBuild a task that depends on the debug/arch-sepecific task. -task cdvBuildDebug -cdvBuildDebug.dependsOn { - return computeBuildTargetName(true) -} - -task cdvBuildRelease -cdvBuildRelease.dependsOn { - return computeBuildTargetName(false) -} - -task cdvPrintProps { - doLast { - println('cdvCompileSdkVersion=' + cdvCompileSdkVersion) - println('cdvBuildToolsVersion=' + cdvBuildToolsVersion) - println('cdvVersionCode=' + cdvVersionCode) - println('cdvVersionCodeForceAbiDigit=' + cdvVersionCodeForceAbiDigit) - println('cdvMinSdkVersion=' + cdvMinSdkVersion) - println('cdvMaxSdkVersion=' + cdvMaxSdkVersion) - println('cdvTargetSdkVersion=' + cdvTargetSdkVersion) - println('cdvBuildMultipleApks=' + cdvBuildMultipleApks) - println('cdvReleaseSigningPropertiesFile=' + cdvReleaseSigningPropertiesFile) - println('cdvDebugSigningPropertiesFile=' + cdvDebugSigningPropertiesFile) - println('cdvBuildArch=' + cdvBuildArch) - println('computedVersionCode=' + android.defaultConfig.versionCode) - android.productFlavors.each { flavor -> - println('computed' + flavor.name.capitalize() + 'VersionCode=' + flavor.versionCode) - } - } -} - -android { - defaultConfig { - versionCode cdvVersionCode ?: new BigInteger("" + privateHelpers.extractIntFromManifest("versionCode")) - applicationId privateHelpers.extractStringFromManifest("package") - - if (cdvMinSdkVersion != null) { - minSdkVersion cdvMinSdkVersion - } - - if (cdvMaxSdkVersion != null) { - maxSdkVersion cdvMaxSdkVersion - } - - if(cdvTargetSdkVersion != null) { - targetSdkVersion cdvTargetSdkVersion - } - } - - lintOptions { - abortOnError false; - } - - compileSdkVersion cdvCompileSdkVersion - buildToolsVersion cdvBuildToolsVersion - - // 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. - storeFile = null - storePassword = "__unset" - } - } - buildTypes { - release { - signingConfig signingConfigs.release - } - } - addSigningProps(cdvReleaseSigningPropertiesFile, signingConfigs.release) - } - - if (cdvDebugSigningPropertiesFile) { - addSigningProps(cdvDebugSigningPropertiesFile, signingConfigs.debug) - } -} - -/* - * WARNING: Cordova Lib and platform scripts do management inside of this code here, - * if you are adding the dependencies manually, do so outside the comments, otherwise - * the Cordova tools will overwrite them - */ - - -dependencies { - implementation fileTree(dir: 'libs', include: '*.jar') - // SUB-PROJECT DEPENDENCIES START - debugCompile(project(path: ":CordovaLib", configuration: "debug")) - releaseCompile(project(path: ":CordovaLib", configuration: "release")) - // SUB-PROJECT DEPENDENCIES END -} - -def promptForReleaseKeyPassword() { - if (!cdvReleaseSigningPropertiesFile) { - return; - } - if ('__unset'.equals(android.signingConfigs.release.storePassword)) { - android.signingConfigs.release.storePassword = privateHelpers.promptForPassword('Enter key store password: ') - } - if ('__unset'.equals(android.signingConfigs.release.keyPassword)) { - android.signingConfigs.release.keyPassword = privateHelpers.promptForPassword('Enter key password: '); - } -} - -gradle.taskGraph.whenReady { taskGraph -> - taskGraph.getAllTasks().each() { task -> - if(['validateReleaseSigning', 'validateSigningRelease', 'validateSigningArmv7Release', 'validateSigningX76Release'].contains(task.name)) { - promptForReleaseKeyPassword() - } - } -} - -def addSigningProps(propsFilePath, signingConfig) { - def propsFile = file(propsFilePath) - def props = new Properties() - propsFile.withReader { reader -> - props.load(reader) - } - - def storeFile = new File(props.get('key.store') ?: privateHelpers.ensureValueExists(propsFilePath, props, 'storeFile')) - if (!storeFile.isAbsolute()) { - storeFile = RelativePath.parse(true, storeFile.toString()).getFile(propsFile.getParentFile()) - } - if (!storeFile.exists()) { - throw new FileNotFoundException('Keystore file does not exist: ' + storeFile.getAbsolutePath()) - } - signingConfig.keyAlias = props.get('key.alias') ?: privateHelpers.ensureValueExists(propsFilePath, props, 'keyAlias') - signingConfig.keyPassword = props.get('keyPassword', props.get('key.alias.password', signingConfig.keyPassword)) - signingConfig.storeFile = storeFile - signingConfig.storePassword = props.get('storePassword', props.get('key.store.password', signingConfig.storePassword)) - def storeType = props.get('storeType', props.get('key.store.type', '')) - if (!storeType) { - def filename = storeFile.getName().toLowerCase(); - if (filename.endsWith('.p12') || filename.endsWith('.pfx')) { - storeType = 'pkcs12' - } else { - storeType = signingConfig.storeType // "jks" - } - } - signingConfig.storeType = storeType -} - -for (def func : cdvPluginPostBuildExtras) { - func() -} - -// This can be defined within build-extras.gradle as: -// ext.postBuildExtras = { ... code here ... } -if (hasProperty('postBuildExtras')) { - postBuildExtras() -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/assets/www/cordova.js b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/assets/www/cordova.js deleted file mode 100644 index 8f6d6e8..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/assets/www/cordova.js +++ /dev/null @@ -1,1935 +0,0 @@ -// Platform: android -// 74fdba8b327b2a13b4366dd141b52def96d4cb56 -/* - 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. -*/ -;(function() { -var PLATFORM_VERSION_BUILD_LABEL = '8.1.0'; -// file: src/scripts/require.js -var require; -var define; - -(function () { - var modules = {}; - // Stack of moduleIds currently being built. - var requireStack = []; - // Map of module ID -> index into requireStack of modules currently being built. - var inProgressModules = {}; - var SEPARATOR = '.'; - - function build (module) { - var factory = module.factory; - var localRequire = function (id) { - var resultantId = id; - // Its a relative path, so lop off the last portion and add the id (minus "./") - if (id.charAt(0) === '.') { - resultantId = module.id.slice(0, module.id.lastIndexOf(SEPARATOR)) + SEPARATOR + id.slice(2); - } - return require(resultantId); - }; - module.exports = {}; - delete module.factory; - factory(localRequire, module.exports, module); - return module.exports; - } - - require = function (id) { - if (!modules[id]) { - throw 'module ' + id + ' not found'; - } else if (id in inProgressModules) { - var cycle = requireStack.slice(inProgressModules[id]).join('->') + '->' + id; - throw 'Cycle in require graph: ' + cycle; - } - if (modules[id].factory) { - try { - inProgressModules[id] = requireStack.length; - requireStack.push(id); - return build(modules[id]); - } finally { - delete inProgressModules[id]; - requireStack.pop(); - } - } - return modules[id].exports; - }; - - define = function (id, factory) { - if (Object.prototype.hasOwnProperty.call(modules, id)) { - throw 'module ' + id + ' already defined'; - } - - modules[id] = { - id: id, - factory: factory - }; - }; - - define.remove = function (id) { - delete modules[id]; - }; - - define.moduleMap = modules; -})(); - -// Export for use in node -if (typeof module === 'object' && typeof require === 'function') { - module.exports.require = require; - module.exports.define = define; -} - -// file: src/cordova.js -define("cordova", function(require, exports, module) { - -// Workaround for Windows 10 in hosted environment case -// http://www.w3.org/html/wg/drafts/html/master/browsers.html#named-access-on-the-window-object -if (window.cordova && !(window.cordova instanceof HTMLElement)) { // eslint-disable-line no-undef - throw new Error('cordova already defined'); -} - -var channel = require('cordova/channel'); -var platform = require('cordova/platform'); - -/** - * Intercept calls to addEventListener + removeEventListener and handle deviceready, - * resume, and pause events. - */ -var m_document_addEventListener = document.addEventListener; -var m_document_removeEventListener = document.removeEventListener; -var m_window_addEventListener = window.addEventListener; -var m_window_removeEventListener = window.removeEventListener; - -/** - * Houses custom event handlers to intercept on document + window event listeners. - */ -var documentEventHandlers = {}; -var windowEventHandlers = {}; - -document.addEventListener = function (evt, handler, capture) { - var e = evt.toLowerCase(); - if (typeof documentEventHandlers[e] !== 'undefined') { - documentEventHandlers[e].subscribe(handler); - } else { - m_document_addEventListener.call(document, evt, handler, capture); - } -}; - -window.addEventListener = function (evt, handler, capture) { - var e = evt.toLowerCase(); - if (typeof windowEventHandlers[e] !== 'undefined') { - windowEventHandlers[e].subscribe(handler); - } else { - m_window_addEventListener.call(window, evt, handler, capture); - } -}; - -document.removeEventListener = function (evt, handler, capture) { - var e = evt.toLowerCase(); - // If unsubscribing from an event that is handled by a plugin - if (typeof documentEventHandlers[e] !== 'undefined') { - documentEventHandlers[e].unsubscribe(handler); - } else { - m_document_removeEventListener.call(document, evt, handler, capture); - } -}; - -window.removeEventListener = function (evt, handler, capture) { - var e = evt.toLowerCase(); - // If unsubscribing from an event that is handled by a plugin - if (typeof windowEventHandlers[e] !== 'undefined') { - windowEventHandlers[e].unsubscribe(handler); - } else { - m_window_removeEventListener.call(window, evt, handler, capture); - } -}; - -function createEvent (type, data) { - var event = document.createEvent('Events'); - event.initEvent(type, false, false); - if (data) { - for (var i in data) { - if (data.hasOwnProperty(i)) { - event[i] = data[i]; - } - } - } - return event; -} - -/* eslint-disable no-undef */ -var cordova = { - define: define, - require: require, - version: PLATFORM_VERSION_BUILD_LABEL, - platformVersion: PLATFORM_VERSION_BUILD_LABEL, - platformId: platform.id, - - /* eslint-enable no-undef */ - - /** - * Methods to add/remove your own addEventListener hijacking on document + window. - */ - addWindowEventHandler: function (event) { - return (windowEventHandlers[event] = channel.create(event)); - }, - addStickyDocumentEventHandler: function (event) { - return (documentEventHandlers[event] = channel.createSticky(event)); - }, - addDocumentEventHandler: function (event) { - return (documentEventHandlers[event] = channel.create(event)); - }, - removeWindowEventHandler: function (event) { - delete windowEventHandlers[event]; - }, - removeDocumentEventHandler: function (event) { - delete documentEventHandlers[event]; - }, - /** - * Retrieve original event handlers that were replaced by Cordova - * - * @return object - */ - getOriginalHandlers: function () { - return { 'document': { 'addEventListener': m_document_addEventListener, 'removeEventListener': m_document_removeEventListener }, - 'window': { 'addEventListener': m_window_addEventListener, 'removeEventListener': m_window_removeEventListener } }; - }, - /** - * Method to fire event from native code - * bNoDetach is required for events which cause an exception which needs to be caught in native code - */ - fireDocumentEvent: function (type, data, bNoDetach) { - var evt = createEvent(type, data); - if (typeof documentEventHandlers[type] !== 'undefined') { - if (bNoDetach) { - documentEventHandlers[type].fire(evt); - } else { - setTimeout(function () { - // Fire deviceready on listeners that were registered before cordova.js was loaded. - if (type === 'deviceready') { - document.dispatchEvent(evt); - } - documentEventHandlers[type].fire(evt); - }, 0); - } - } else { - document.dispatchEvent(evt); - } - }, - fireWindowEvent: function (type, data) { - var evt = createEvent(type, data); - if (typeof windowEventHandlers[type] !== 'undefined') { - setTimeout(function () { - windowEventHandlers[type].fire(evt); - }, 0); - } else { - window.dispatchEvent(evt); - } - }, - - /** - * Plugin callback mechanism. - */ - // Randomize the starting callbackId to avoid collisions after refreshing or navigating. - // This way, it's very unlikely that any new callback would get the same callbackId as an old callback. - callbackId: Math.floor(Math.random() * 2000000000), - callbacks: {}, - callbackStatus: { - NO_RESULT: 0, - OK: 1, - CLASS_NOT_FOUND_EXCEPTION: 2, - ILLEGAL_ACCESS_EXCEPTION: 3, - INSTANTIATION_EXCEPTION: 4, - MALFORMED_URL_EXCEPTION: 5, - IO_EXCEPTION: 6, - INVALID_ACTION: 7, - JSON_EXCEPTION: 8, - ERROR: 9 - }, - - /** - * Called by native code when returning successful result from an action. - */ - callbackSuccess: function (callbackId, args) { - cordova.callbackFromNative(callbackId, true, args.status, [args.message], args.keepCallback); - }, - - /** - * Called by native code when returning error result from an action. - */ - callbackError: function (callbackId, args) { - // TODO: Deprecate callbackSuccess and callbackError in favour of callbackFromNative. - // Derive success from status. - cordova.callbackFromNative(callbackId, false, args.status, [args.message], args.keepCallback); - }, - - /** - * Called by native code when returning the result from an action. - */ - callbackFromNative: function (callbackId, isSuccess, status, args, keepCallback) { - try { - var callback = cordova.callbacks[callbackId]; - if (callback) { - if (isSuccess && status === cordova.callbackStatus.OK) { - callback.success && callback.success.apply(null, args); - } else if (!isSuccess) { - callback.fail && callback.fail.apply(null, args); - } - /* - else - Note, this case is intentionally not caught. - this can happen if isSuccess is true, but callbackStatus is NO_RESULT - which is used to remove a callback from the list without calling the callbacks - typically keepCallback is false in this case - */ - // Clear callback if not expecting any more results - if (!keepCallback) { - delete cordova.callbacks[callbackId]; - } - } - } catch (err) { - var msg = 'Error in ' + (isSuccess ? 'Success' : 'Error') + ' callbackId: ' + callbackId + ' : ' + err; - console && console.log && console.log(msg); - console && console.log && err.stack && console.log(err.stack); - cordova.fireWindowEvent('cordovacallbackerror', { 'message': msg }); - throw err; - } - }, - addConstructor: function (func) { - channel.onCordovaReady.subscribe(function () { - try { - func(); - } catch (e) { - console.log('Failed to run constructor: ' + e); - } - }); - } -}; - -module.exports = cordova; - -}); - -// file: ../cordova-android/cordova-js-src/android/nativeapiprovider.js -define("cordova/android/nativeapiprovider", function(require, exports, module) { - -/** - * Exports the ExposedJsApi.java object if available, otherwise exports the PromptBasedNativeApi. - */ - -var nativeApi = this._cordovaNative || require('cordova/android/promptbasednativeapi'); -var currentApi = nativeApi; - -module.exports = { - get: function() { return currentApi; }, - setPreferPrompt: function(value) { - currentApi = value ? require('cordova/android/promptbasednativeapi') : nativeApi; - }, - // Used only by tests. - set: function(value) { - currentApi = value; - } -}; - -}); - -// file: ../cordova-android/cordova-js-src/android/promptbasednativeapi.js -define("cordova/android/promptbasednativeapi", function(require, exports, module) { - -/** - * Implements the API of ExposedJsApi.java, but uses prompt() to communicate. - * This is used pre-JellyBean, where addJavascriptInterface() is disabled. - */ - -module.exports = { - exec: function(bridgeSecret, service, action, callbackId, argsJson) { - return prompt(argsJson, 'gap:'+JSON.stringify([bridgeSecret, service, action, callbackId])); - }, - setNativeToJsBridgeMode: function(bridgeSecret, value) { - prompt(value, 'gap_bridge_mode:' + bridgeSecret); - }, - retrieveJsMessages: function(bridgeSecret, fromOnlineEvent) { - return prompt(+fromOnlineEvent, 'gap_poll:' + bridgeSecret); - } -}; - -}); - -// file: src/common/argscheck.js -define("cordova/argscheck", function(require, exports, module) { - -var utils = require('cordova/utils'); - -var moduleExports = module.exports; - -var typeMap = { - 'A': 'Array', - 'D': 'Date', - 'N': 'Number', - 'S': 'String', - 'F': 'Function', - 'O': 'Object' -}; - -function extractParamName (callee, argIndex) { - return (/\(\s*([^)]*?)\s*\)/).exec(callee)[1].split(/\s*,\s*/)[argIndex]; -} - -/** - * Checks the given arguments' types and throws if they are not as expected. - * - * `spec` is a string where each character stands for the required type of the - * argument at the same position. In other words: the character at `spec[i]` - * specifies the required type for `args[i]`. The characters in `spec` are the - * first letter of the required type's name. The supported types are: - * - * Array, Date, Number, String, Function, Object - * - * Lowercase characters specify arguments that must not be `null` or `undefined` - * while uppercase characters allow those values to be passed. - * - * Finally, `*` can be used to allow any type at the corresponding position. - * - * @example - * function foo (arr, opts) { - * // require `arr` to be an Array and `opts` an Object, null or undefined - * checkArgs('aO', 'my.package.foo', arguments); - * // ... - * } - * @param {String} spec - the type specification for `args` as described above - * @param {String} functionName - full name of the callee. - * Used in the error message - * @param {Array|arguments} args - the arguments to be checked against `spec` - * @param {Function} [opt_callee=args.callee] - the recipient of `args`. - * Used to extract parameter names for the error message - * @throws {TypeError} if args do not satisfy spec - */ -function checkArgs (spec, functionName, args, opt_callee) { - if (!moduleExports.enableChecks) { - return; - } - var errMsg = null; - var typeName; - for (var i = 0; i < spec.length; ++i) { - var c = spec.charAt(i); - var cUpper = c.toUpperCase(); - var arg = args[i]; - // Asterix means allow anything. - if (c === '*') { - continue; - } - typeName = utils.typeName(arg); - if ((arg === null || arg === undefined) && c === cUpper) { - continue; - } - if (typeName !== typeMap[cUpper]) { - errMsg = 'Expected ' + typeMap[cUpper]; - break; - } - } - if (errMsg) { - errMsg += ', but got ' + typeName + '.'; - errMsg = 'Wrong type for parameter "' + extractParamName(opt_callee || args.callee, i) + '" of ' + functionName + ': ' + errMsg; - // Don't log when running unit tests. - if (typeof jasmine === 'undefined') { - console.error(errMsg); - } - throw TypeError(errMsg); - } -} - -function getValue (value, defaultValue) { - return value === undefined ? defaultValue : value; -} - -moduleExports.checkArgs = checkArgs; -moduleExports.getValue = getValue; -moduleExports.enableChecks = true; - -}); - -// file: src/common/base64.js -define("cordova/base64", function(require, exports, module) { - -var base64 = exports; - -base64.fromArrayBuffer = function (arrayBuffer) { - var array = new Uint8Array(arrayBuffer); - return uint8ToBase64(array); -}; - -base64.toArrayBuffer = function (str) { - var decodedStr = typeof atob !== 'undefined' ? atob(str) : Buffer.from(str, 'base64').toString('binary'); // eslint-disable-line no-undef - var arrayBuffer = new ArrayBuffer(decodedStr.length); - var array = new Uint8Array(arrayBuffer); - for (var i = 0, len = decodedStr.length; i < len; i++) { - array[i] = decodedStr.charCodeAt(i); - } - return arrayBuffer; -}; - -// ------------------------------------------------------------------------------ - -/* This code is based on the performance tests at http://jsperf.com/b64tests - * This 12-bit-at-a-time algorithm was the best performing version on all - * platforms tested. - */ - -var b64_6bit = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; -var b64_12bit; - -var b64_12bitTable = function () { - b64_12bit = []; - for (var i = 0; i < 64; i++) { - for (var j = 0; j < 64; j++) { - b64_12bit[i * 64 + j] = b64_6bit[i] + b64_6bit[j]; - } - } - b64_12bitTable = function () { return b64_12bit; }; - return b64_12bit; -}; - -function uint8ToBase64 (rawData) { - var numBytes = rawData.byteLength; - var output = ''; - var segment; - var table = b64_12bitTable(); - for (var i = 0; i < numBytes - 2; i += 3) { - segment = (rawData[i] << 16) + (rawData[i + 1] << 8) + rawData[i + 2]; - output += table[segment >> 12]; - output += table[segment & 0xfff]; - } - if (numBytes - i === 2) { - segment = (rawData[i] << 16) + (rawData[i + 1] << 8); - output += table[segment >> 12]; - output += b64_6bit[(segment & 0xfff) >> 6]; - output += '='; - } else if (numBytes - i === 1) { - segment = (rawData[i] << 16); - output += table[segment >> 12]; - output += '=='; - } - return output; -} - -}); - -// file: src/common/builder.js -define("cordova/builder", function(require, exports, module) { - -var utils = require('cordova/utils'); - -function each (objects, func, context) { - for (var prop in objects) { - if (objects.hasOwnProperty(prop)) { - func.apply(context, [objects[prop], prop]); - } - } -} - -function clobber (obj, key, value) { - exports.replaceHookForTesting(obj, key); - var needsProperty = false; - try { - obj[key] = value; - } catch (e) { - needsProperty = true; - } - // Getters can only be overridden by getters. - if (needsProperty || obj[key] !== value) { - utils.defineGetter(obj, key, function () { - return value; - }); - } -} - -function assignOrWrapInDeprecateGetter (obj, key, value, message) { - if (message) { - utils.defineGetter(obj, key, function () { - console.log(message); - delete obj[key]; - clobber(obj, key, value); - return value; - }); - } else { - clobber(obj, key, value); - } -} - -function include (parent, objects, clobber, merge) { - each(objects, function (obj, key) { - try { - var result = obj.path ? require(obj.path) : {}; - - if (clobber) { - // Clobber if it doesn't exist. - if (typeof parent[key] === 'undefined') { - assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated); - } else if (typeof obj.path !== 'undefined') { - // If merging, merge properties onto parent, otherwise, clobber. - if (merge) { - recursiveMerge(parent[key], result); - } else { - assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated); - } - } - result = parent[key]; - } else { - // Overwrite if not currently defined. - if (typeof parent[key] === 'undefined') { - assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated); - } else { - // Set result to what already exists, so we can build children into it if they exist. - result = parent[key]; - } - } - - if (obj.children) { - include(result, obj.children, clobber, merge); - } - } catch (e) { - utils.alert('Exception building Cordova JS globals: ' + e + ' for key "' + key + '"'); - } - }); -} - -/** - * Merge properties from one object onto another recursively. Properties from - * the src object will overwrite existing target property. - * - * @param target Object to merge properties into. - * @param src Object to merge properties from. - */ -function recursiveMerge (target, src) { - for (var prop in src) { - if (src.hasOwnProperty(prop)) { - if (target.prototype && target.prototype.constructor === target) { - // If the target object is a constructor override off prototype. - clobber(target.prototype, prop, src[prop]); - } else { - if (typeof src[prop] === 'object' && typeof target[prop] === 'object') { - recursiveMerge(target[prop], src[prop]); - } else { - clobber(target, prop, src[prop]); - } - } - } - } -} - -exports.buildIntoButDoNotClobber = function (objects, target) { - include(target, objects, false, false); -}; -exports.buildIntoAndClobber = function (objects, target) { - include(target, objects, true, false); -}; -exports.buildIntoAndMerge = function (objects, target) { - include(target, objects, true, true); -}; -exports.recursiveMerge = recursiveMerge; -exports.assignOrWrapInDeprecateGetter = assignOrWrapInDeprecateGetter; -exports.replaceHookForTesting = function () {}; - -}); - -// file: src/common/channel.js -define("cordova/channel", function(require, exports, module) { - -var utils = require('cordova/utils'); -var nextGuid = 1; - -/** - * Custom pub-sub "channel" that can have functions subscribed to it - * This object is used to define and control firing of events for - * cordova initialization, as well as for custom events thereafter. - * - * The order of events during page load and Cordova startup is as follows: - * - * onDOMContentLoaded* Internal event that is received when the web page is loaded and parsed. - * onNativeReady* Internal event that indicates the Cordova native side is ready. - * onCordovaReady* Internal event fired when all Cordova JavaScript objects have been created. - * onDeviceReady* User event fired to indicate that Cordova is ready - * onResume User event fired to indicate a start/resume lifecycle event - * onPause User event fired to indicate a pause lifecycle event - * - * The events marked with an * are sticky. Once they have fired, they will stay in the fired state. - * All listeners that subscribe after the event is fired will be executed right away. - * - * The only Cordova events that user code should register for are: - * deviceready Cordova native code is initialized and Cordova APIs can be called from JavaScript - * pause App has moved to background - * resume App has returned to foreground - * - * Listeners can be registered as: - * document.addEventListener("deviceready", myDeviceReadyListener, false); - * document.addEventListener("resume", myResumeListener, false); - * document.addEventListener("pause", myPauseListener, false); - * - * The DOM lifecycle events should be used for saving and restoring state - * window.onload - * window.onunload - * - */ - -/** - * Channel - * @constructor - * @param type String the channel name - */ -var Channel = function (type, sticky) { - this.type = type; - // Map of guid -> function. - this.handlers = {}; - // 0 = Non-sticky, 1 = Sticky non-fired, 2 = Sticky fired. - this.state = sticky ? 1 : 0; - // Used in sticky mode to remember args passed to fire(). - this.fireArgs = null; - // Used by onHasSubscribersChange to know if there are any listeners. - this.numHandlers = 0; - // Function that is called when the first listener is subscribed, or when - // the last listener is unsubscribed. - this.onHasSubscribersChange = null; -}; -var channel = { - /** - * Calls the provided function only after all of the channels specified - * have been fired. All channels must be sticky channels. - */ - join: function (h, c) { - var len = c.length; - var i = len; - var f = function () { - if (!(--i)) h(); - }; - for (var j = 0; j < len; j++) { - if (c[j].state === 0) { - throw Error('Can only use join with sticky channels.'); - } - c[j].subscribe(f); - } - if (!len) h(); - }, - /* eslint-disable no-return-assign */ - create: function (type) { - return channel[type] = new Channel(type, false); - }, - createSticky: function (type) { - return channel[type] = new Channel(type, true); - }, - /* eslint-enable no-return-assign */ - /** - * cordova Channels that must fire before "deviceready" is fired. - */ - deviceReadyChannelsArray: [], - deviceReadyChannelsMap: {}, - - /** - * Indicate that a feature needs to be initialized before it is ready to be used. - * This holds up Cordova's "deviceready" event until the feature has been initialized - * and Cordova.initComplete(feature) is called. - * - * @param feature {String} The unique feature name - */ - waitForInitialization: function (feature) { - if (feature) { - var c = channel[feature] || this.createSticky(feature); - this.deviceReadyChannelsMap[feature] = c; - this.deviceReadyChannelsArray.push(c); - } - }, - - /** - * Indicate that initialization code has completed and the feature is ready to be used. - * - * @param feature {String} The unique feature name - */ - initializationComplete: function (feature) { - var c = this.deviceReadyChannelsMap[feature]; - if (c) { - c.fire(); - } - } -}; - -function checkSubscriptionArgument (argument) { - if (typeof argument !== 'function' && typeof argument.handleEvent !== 'function') { - throw new Error( - 'Must provide a function or an EventListener object ' + - 'implementing the handleEvent interface.' - ); - } -} - -/** - * Subscribes the given function to the channel. Any time that - * Channel.fire is called so too will the function. - * Optionally specify an execution context for the function - * and a guid that can be used to stop subscribing to the channel. - * Returns the guid. - */ -Channel.prototype.subscribe = function (eventListenerOrFunction, eventListener) { - checkSubscriptionArgument(eventListenerOrFunction); - var handleEvent, guid; - - if (eventListenerOrFunction && typeof eventListenerOrFunction === 'object') { - // Received an EventListener object implementing the handleEvent interface - handleEvent = eventListenerOrFunction.handleEvent; - eventListener = eventListenerOrFunction; - } else { - // Received a function to handle event - handleEvent = eventListenerOrFunction; - } - - if (this.state === 2) { - handleEvent.apply(eventListener || this, this.fireArgs); - return; - } - - guid = eventListenerOrFunction.observer_guid; - if (typeof eventListener === 'object') { - handleEvent = utils.close(eventListener, handleEvent); - } - - if (!guid) { - // First time any channel has seen this subscriber - guid = '' + nextGuid++; - } - handleEvent.observer_guid = guid; - eventListenerOrFunction.observer_guid = guid; - - // Don't add the same handler more than once. - if (!this.handlers[guid]) { - this.handlers[guid] = handleEvent; - this.numHandlers++; - if (this.numHandlers === 1) { - this.onHasSubscribersChange && this.onHasSubscribersChange(); - } - } -}; - -/** - * Unsubscribes the function with the given guid from the channel. - */ -Channel.prototype.unsubscribe = function (eventListenerOrFunction) { - checkSubscriptionArgument(eventListenerOrFunction); - var handleEvent, guid, handler; - - if (eventListenerOrFunction && typeof eventListenerOrFunction === 'object') { - // Received an EventListener object implementing the handleEvent interface - handleEvent = eventListenerOrFunction.handleEvent; - } else { - // Received a function to handle event - handleEvent = eventListenerOrFunction; - } - - guid = handleEvent.observer_guid; - handler = this.handlers[guid]; - if (handler) { - delete this.handlers[guid]; - this.numHandlers--; - if (this.numHandlers === 0) { - this.onHasSubscribersChange && this.onHasSubscribersChange(); - } - } -}; - -/** - * Calls all functions subscribed to this channel. - */ -Channel.prototype.fire = function (e) { - var fail = false; // eslint-disable-line no-unused-vars - var fireArgs = Array.prototype.slice.call(arguments); - // Apply stickiness. - if (this.state === 1) { - this.state = 2; - this.fireArgs = fireArgs; - } - if (this.numHandlers) { - // Copy the values first so that it is safe to modify it from within - // callbacks. - var toCall = []; - for (var item in this.handlers) { - toCall.push(this.handlers[item]); - } - for (var i = 0; i < toCall.length; ++i) { - toCall[i].apply(this, fireArgs); - } - if (this.state === 2 && this.numHandlers) { - this.numHandlers = 0; - this.handlers = {}; - this.onHasSubscribersChange && this.onHasSubscribersChange(); - } - } -}; - -// defining them here so they are ready super fast! -// DOM event that is received when the web page is loaded and parsed. -channel.createSticky('onDOMContentLoaded'); - -// Event to indicate the Cordova native side is ready. -channel.createSticky('onNativeReady'); - -// Event to indicate that all Cordova JavaScript objects have been created -// and it's time to run plugin constructors. -channel.createSticky('onCordovaReady'); - -// Event to indicate that all automatically loaded JS plugins are loaded and ready. -// FIXME remove this -channel.createSticky('onPluginsReady'); - -// Event to indicate that Cordova is ready -channel.createSticky('onDeviceReady'); - -// Event to indicate a resume lifecycle event -channel.create('onResume'); - -// Event to indicate a pause lifecycle event -channel.create('onPause'); - -// Channels that must fire before "deviceready" is fired. -channel.waitForInitialization('onCordovaReady'); -channel.waitForInitialization('onDOMContentLoaded'); - -module.exports = channel; - -}); - -// file: ../cordova-android/cordova-js-src/exec.js -define("cordova/exec", function(require, exports, module) { - -/** - * Execute a cordova command. It is up to the native side whether this action - * is synchronous or asynchronous. The native side can return: - * Synchronous: PluginResult object as a JSON string - * Asynchronous: Empty string "" - * If async, the native side will cordova.callbackSuccess or cordova.callbackError, - * depending upon the result of the action. - * - * @param {Function} success The success callback - * @param {Function} fail The fail callback - * @param {String} service The name of the service to use - * @param {String} action Action to be run in cordova - * @param {String[]} [args] Zero or more arguments to pass to the method - */ -var cordova = require('cordova'), - nativeApiProvider = require('cordova/android/nativeapiprovider'), - utils = require('cordova/utils'), - base64 = require('cordova/base64'), - channel = require('cordova/channel'), - jsToNativeModes = { - PROMPT: 0, - JS_OBJECT: 1 - }, - nativeToJsModes = { - // Polls for messages using the JS->Native bridge. - POLLING: 0, - // For LOAD_URL to be viable, it would need to have a work-around for - // the bug where the soft-keyboard gets dismissed when a message is sent. - LOAD_URL: 1, - // For the ONLINE_EVENT to be viable, it would need to intercept all event - // listeners (both through addEventListener and window.ononline) as well - // as set the navigator property itself. - ONLINE_EVENT: 2, - EVAL_BRIDGE: 3 - }, - jsToNativeBridgeMode, // Set lazily. - nativeToJsBridgeMode = nativeToJsModes.EVAL_BRIDGE, - pollEnabled = false, - bridgeSecret = -1; - -var messagesFromNative = []; -var isProcessing = false; -var resolvedPromise = typeof Promise == 'undefined' ? null : Promise.resolve(); -var nextTick = resolvedPromise ? function(fn) { resolvedPromise.then(fn); } : function(fn) { setTimeout(fn); }; - -function androidExec(success, fail, service, action, args) { - if (bridgeSecret < 0) { - // If we ever catch this firing, we'll need to queue up exec()s - // and fire them once we get a secret. For now, I don't think - // it's possible for exec() to be called since plugins are parsed but - // not run until until after onNativeReady. - throw new Error('exec() called without bridgeSecret'); - } - // Set default bridge modes if they have not already been set. - // By default, we use the failsafe, since addJavascriptInterface breaks too often - if (jsToNativeBridgeMode === undefined) { - androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT); - } - - // If args is not provided, default to an empty array - args = args || []; - - // Process any ArrayBuffers in the args into a string. - for (var i = 0; i < args.length; i++) { - if (utils.typeName(args[i]) == 'ArrayBuffer') { - args[i] = base64.fromArrayBuffer(args[i]); - } - } - - var callbackId = service + cordova.callbackId++, - argsJson = JSON.stringify(args); - if (success || fail) { - cordova.callbacks[callbackId] = {success:success, fail:fail}; - } - - var msgs = nativeApiProvider.get().exec(bridgeSecret, service, action, callbackId, argsJson); - // If argsJson was received by Java as null, try again with the PROMPT bridge mode. - // This happens in rare circumstances, such as when certain Unicode characters are passed over the bridge on a Galaxy S2. See CB-2666. - if (jsToNativeBridgeMode == jsToNativeModes.JS_OBJECT && msgs === "@Null arguments.") { - androidExec.setJsToNativeBridgeMode(jsToNativeModes.PROMPT); - androidExec(success, fail, service, action, args); - androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT); - } else if (msgs) { - messagesFromNative.push(msgs); - // Always process async to avoid exceptions messing up stack. - nextTick(processMessages); - } -} - -androidExec.init = function() { - bridgeSecret = +prompt('', 'gap_init:' + nativeToJsBridgeMode); - channel.onNativeReady.fire(); -}; - -function pollOnceFromOnlineEvent() { - pollOnce(true); -} - -function pollOnce(opt_fromOnlineEvent) { - if (bridgeSecret < 0) { - // This can happen when the NativeToJsMessageQueue resets the online state on page transitions. - // We know there's nothing to retrieve, so no need to poll. - return; - } - var msgs = nativeApiProvider.get().retrieveJsMessages(bridgeSecret, !!opt_fromOnlineEvent); - if (msgs) { - messagesFromNative.push(msgs); - // Process sync since we know we're already top-of-stack. - processMessages(); - } -} - -function pollingTimerFunc() { - if (pollEnabled) { - pollOnce(); - setTimeout(pollingTimerFunc, 50); - } -} - -function hookOnlineApis() { - function proxyEvent(e) { - cordova.fireWindowEvent(e.type); - } - // The network module takes care of firing online and offline events. - // It currently fires them only on document though, so we bridge them - // to window here (while first listening for exec()-releated online/offline - // events). - window.addEventListener('online', pollOnceFromOnlineEvent, false); - window.addEventListener('offline', pollOnceFromOnlineEvent, false); - cordova.addWindowEventHandler('online'); - cordova.addWindowEventHandler('offline'); - document.addEventListener('online', proxyEvent, false); - document.addEventListener('offline', proxyEvent, false); -} - -hookOnlineApis(); - -androidExec.jsToNativeModes = jsToNativeModes; -androidExec.nativeToJsModes = nativeToJsModes; - -androidExec.setJsToNativeBridgeMode = function(mode) { - if (mode == jsToNativeModes.JS_OBJECT && !window._cordovaNative) { - mode = jsToNativeModes.PROMPT; - } - nativeApiProvider.setPreferPrompt(mode == jsToNativeModes.PROMPT); - jsToNativeBridgeMode = mode; -}; - -androidExec.setNativeToJsBridgeMode = function(mode) { - if (mode == nativeToJsBridgeMode) { - return; - } - if (nativeToJsBridgeMode == nativeToJsModes.POLLING) { - pollEnabled = false; - } - - nativeToJsBridgeMode = mode; - // Tell the native side to switch modes. - // Otherwise, it will be set by androidExec.init() - if (bridgeSecret >= 0) { - nativeApiProvider.get().setNativeToJsBridgeMode(bridgeSecret, mode); - } - - if (mode == nativeToJsModes.POLLING) { - pollEnabled = true; - setTimeout(pollingTimerFunc, 1); - } -}; - -function buildPayload(payload, message) { - var payloadKind = message.charAt(0); - if (payloadKind == 's') { - payload.push(message.slice(1)); - } else if (payloadKind == 't') { - payload.push(true); - } else if (payloadKind == 'f') { - payload.push(false); - } else if (payloadKind == 'N') { - payload.push(null); - } else if (payloadKind == 'n') { - payload.push(+message.slice(1)); - } else if (payloadKind == 'A') { - var data = message.slice(1); - payload.push(base64.toArrayBuffer(data)); - } else if (payloadKind == 'S') { - payload.push(window.atob(message.slice(1))); - } else if (payloadKind == 'M') { - var multipartMessages = message.slice(1); - while (multipartMessages !== "") { - var spaceIdx = multipartMessages.indexOf(' '); - var msgLen = +multipartMessages.slice(0, spaceIdx); - var multipartMessage = multipartMessages.substr(spaceIdx + 1, msgLen); - multipartMessages = multipartMessages.slice(spaceIdx + msgLen + 1); - buildPayload(payload, multipartMessage); - } - } else { - payload.push(JSON.parse(message)); - } -} - -// Processes a single message, as encoded by NativeToJsMessageQueue.java. -function processMessage(message) { - var firstChar = message.charAt(0); - if (firstChar == 'J') { - // This is deprecated on the .java side. It doesn't work with CSP enabled. - eval(message.slice(1)); - } else if (firstChar == 'S' || firstChar == 'F') { - var success = firstChar == 'S'; - var keepCallback = message.charAt(1) == '1'; - var spaceIdx = message.indexOf(' ', 2); - var status = +message.slice(2, spaceIdx); - var nextSpaceIdx = message.indexOf(' ', spaceIdx + 1); - var callbackId = message.slice(spaceIdx + 1, nextSpaceIdx); - var payloadMessage = message.slice(nextSpaceIdx + 1); - var payload = []; - buildPayload(payload, payloadMessage); - cordova.callbackFromNative(callbackId, success, status, payload, keepCallback); - } else { - console.log("processMessage failed: invalid message: " + JSON.stringify(message)); - } -} - -function processMessages() { - // Check for the reentrant case. - if (isProcessing) { - return; - } - if (messagesFromNative.length === 0) { - return; - } - isProcessing = true; - try { - var msg = popMessageFromQueue(); - // The Java side can send a * message to indicate that it - // still has messages waiting to be retrieved. - if (msg == '*' && messagesFromNative.length === 0) { - nextTick(pollOnce); - return; - } - processMessage(msg); - } finally { - isProcessing = false; - if (messagesFromNative.length > 0) { - nextTick(processMessages); - } - } -} - -function popMessageFromQueue() { - var messageBatch = messagesFromNative.shift(); - if (messageBatch == '*') { - return '*'; - } - - var spaceIdx = messageBatch.indexOf(' '); - var msgLen = +messageBatch.slice(0, spaceIdx); - var message = messageBatch.substr(spaceIdx + 1, msgLen); - messageBatch = messageBatch.slice(spaceIdx + msgLen + 1); - if (messageBatch) { - messagesFromNative.unshift(messageBatch); - } - return message; -} - -module.exports = androidExec; - -}); - -// file: src/common/exec/proxy.js -define("cordova/exec/proxy", function(require, exports, module) { - -// internal map of proxy function -var CommandProxyMap = {}; - -module.exports = { - - // example: cordova.commandProxy.add("Accelerometer",{getCurrentAcceleration: function(successCallback, errorCallback, options) {...},...); - add: function (id, proxyObj) { - console.log('adding proxy for ' + id); - CommandProxyMap[id] = proxyObj; - return proxyObj; - }, - - // cordova.commandProxy.remove("Accelerometer"); - remove: function (id) { - var proxy = CommandProxyMap[id]; - delete CommandProxyMap[id]; - CommandProxyMap[id] = null; - return proxy; - }, - - get: function (service, action) { - return (CommandProxyMap[service] ? CommandProxyMap[service][action] : null); - } -}; - -}); - -// file: src/common/init.js -define("cordova/init", function(require, exports, module) { - -var channel = require('cordova/channel'); -var cordova = require('cordova'); -var modulemapper = require('cordova/modulemapper'); -var platform = require('cordova/platform'); -var pluginloader = require('cordova/pluginloader'); -var utils = require('cordova/utils'); - -var platformInitChannelsArray = [channel.onNativeReady, channel.onPluginsReady]; - -function logUnfiredChannels (arr) { - for (var i = 0; i < arr.length; ++i) { - if (arr[i].state !== 2) { - console.log('Channel not fired: ' + arr[i].type); - } - } -} - -window.setTimeout(function () { - if (channel.onDeviceReady.state !== 2) { - console.log('deviceready has not fired after 5 seconds.'); - logUnfiredChannels(platformInitChannelsArray); - logUnfiredChannels(channel.deviceReadyChannelsArray); - } -}, 5000); - -// Replace navigator before any modules are required(), to ensure it happens as soon as possible. -// We replace it so that properties that can't be clobbered can instead be overridden. -function replaceNavigator (origNavigator) { - var CordovaNavigator = function () {}; - CordovaNavigator.prototype = origNavigator; - var newNavigator = new CordovaNavigator(); - // This work-around really only applies to new APIs that are newer than Function.bind. - // Without it, APIs such as getGamepads() break. - if (CordovaNavigator.bind) { - for (var key in origNavigator) { - if (typeof origNavigator[key] === 'function') { - newNavigator[key] = origNavigator[key].bind(origNavigator); - } else { - (function (k) { - utils.defineGetterSetter(newNavigator, key, function () { - return origNavigator[k]; - }); - })(key); - } - } - } - return newNavigator; -} - -if (window.navigator) { - window.navigator = replaceNavigator(window.navigator); -} - -if (!window.console) { - window.console = { - log: function () {} - }; -} -if (!window.console.warn) { - window.console.warn = function (msg) { - this.log('warn: ' + msg); - }; -} - -// Register pause, resume and deviceready channels as events on document. -channel.onPause = cordova.addDocumentEventHandler('pause'); -channel.onResume = cordova.addDocumentEventHandler('resume'); -channel.onActivated = cordova.addDocumentEventHandler('activated'); -channel.onDeviceReady = cordova.addStickyDocumentEventHandler('deviceready'); - -// Listen for DOMContentLoaded and notify our channel subscribers. -if (document.readyState === 'complete' || document.readyState === 'interactive') { - channel.onDOMContentLoaded.fire(); -} else { - document.addEventListener('DOMContentLoaded', function () { - channel.onDOMContentLoaded.fire(); - }, false); -} - -// _nativeReady is global variable that the native side can set -// to signify that the native code is ready. It is a global since -// it may be called before any cordova JS is ready. -if (window._nativeReady) { - channel.onNativeReady.fire(); -} - -modulemapper.clobbers('cordova', 'cordova'); -modulemapper.clobbers('cordova/exec', 'cordova.exec'); -modulemapper.clobbers('cordova/exec', 'Cordova.exec'); - -// Call the platform-specific initialization. -platform.bootstrap && platform.bootstrap(); - -// Wrap in a setTimeout to support the use-case of having plugin JS appended to cordova.js. -// The delay allows the attached modules to be defined before the plugin loader looks for them. -setTimeout(function () { - pluginloader.load(function () { - channel.onPluginsReady.fire(); - }); -}, 0); - -/** - * Create all cordova objects once native side is ready. - */ -channel.join(function () { - modulemapper.mapModules(window); - - platform.initialize && platform.initialize(); - - // Fire event to notify that all objects are created - channel.onCordovaReady.fire(); - - // Fire onDeviceReady event once page has fully loaded, all - // constructors have run and cordova info has been received from native - // side. - channel.join(function () { - require('cordova').fireDocumentEvent('deviceready'); - }, channel.deviceReadyChannelsArray); - -}, platformInitChannelsArray); - -}); - -// file: src/common/modulemapper.js -define("cordova/modulemapper", function(require, exports, module) { - -var builder = require('cordova/builder'); -var moduleMap = define.moduleMap; // eslint-disable-line no-undef -var symbolList; -var deprecationMap; - -exports.reset = function () { - symbolList = []; - deprecationMap = {}; -}; - -function addEntry (strategy, moduleName, symbolPath, opt_deprecationMessage) { - if (!(moduleName in moduleMap)) { - throw new Error('Module ' + moduleName + ' does not exist.'); - } - symbolList.push(strategy, moduleName, symbolPath); - if (opt_deprecationMessage) { - deprecationMap[symbolPath] = opt_deprecationMessage; - } -} - -// Note: Android 2.3 does have Function.bind(). -exports.clobbers = function (moduleName, symbolPath, opt_deprecationMessage) { - addEntry('c', moduleName, symbolPath, opt_deprecationMessage); -}; - -exports.merges = function (moduleName, symbolPath, opt_deprecationMessage) { - addEntry('m', moduleName, symbolPath, opt_deprecationMessage); -}; - -exports.defaults = function (moduleName, symbolPath, opt_deprecationMessage) { - addEntry('d', moduleName, symbolPath, opt_deprecationMessage); -}; - -exports.runs = function (moduleName) { - addEntry('r', moduleName, null); -}; - -function prepareNamespace (symbolPath, context) { - if (!symbolPath) { - return context; - } - var parts = symbolPath.split('.'); - var cur = context; - for (var i = 0, part; part = parts[i]; ++i) { // eslint-disable-line no-cond-assign - cur = cur[part] = cur[part] || {}; - } - return cur; -} - -exports.mapModules = function (context) { - var origSymbols = {}; - context.CDV_origSymbols = origSymbols; - for (var i = 0, len = symbolList.length; i < len; i += 3) { - var strategy = symbolList[i]; - var moduleName = symbolList[i + 1]; - var module = require(moduleName); - // - if (strategy === 'r') { - continue; - } - var symbolPath = symbolList[i + 2]; - var lastDot = symbolPath.lastIndexOf('.'); - var namespace = symbolPath.substr(0, lastDot); - var lastName = symbolPath.substr(lastDot + 1); - - var deprecationMsg = symbolPath in deprecationMap ? 'Access made to deprecated symbol: ' + symbolPath + '. ' + deprecationMsg : null; - var parentObj = prepareNamespace(namespace, context); - var target = parentObj[lastName]; - - if (strategy === 'm' && target) { - builder.recursiveMerge(target, module); - } else if ((strategy === 'd' && !target) || (strategy !== 'd')) { - if (!(symbolPath in origSymbols)) { - origSymbols[symbolPath] = target; - } - builder.assignOrWrapInDeprecateGetter(parentObj, lastName, module, deprecationMsg); - } - } -}; - -exports.getOriginalSymbol = function (context, symbolPath) { - var origSymbols = context.CDV_origSymbols; - if (origSymbols && (symbolPath in origSymbols)) { - return origSymbols[symbolPath]; - } - var parts = symbolPath.split('.'); - var obj = context; - for (var i = 0; i < parts.length; ++i) { - obj = obj && obj[parts[i]]; - } - return obj; -}; - -exports.reset(); - -}); - -// file: ../cordova-android/cordova-js-src/platform.js -define("cordova/platform", function(require, exports, module) { - -// The last resume event that was received that had the result of a plugin call. -var lastResumeEvent = null; - -module.exports = { - id: 'android', - bootstrap: function() { - var channel = require('cordova/channel'), - cordova = require('cordova'), - exec = require('cordova/exec'), - modulemapper = require('cordova/modulemapper'); - - // Get the shared secret needed to use the bridge. - exec.init(); - - // TODO: Extract this as a proper plugin. - modulemapper.clobbers('cordova/plugin/android/app', 'navigator.app'); - - var APP_PLUGIN_NAME = Number(cordova.platformVersion.split('.')[0]) >= 4 ? 'CoreAndroid' : 'App'; - - // Inject a listener for the backbutton on the document. - var backButtonChannel = cordova.addDocumentEventHandler('backbutton'); - backButtonChannel.onHasSubscribersChange = function() { - // If we just attached the first handler or detached the last handler, - // let native know we need to override the back button. - exec(null, null, APP_PLUGIN_NAME, "overrideBackbutton", [this.numHandlers == 1]); - }; - - // Add hardware MENU and SEARCH button handlers - cordova.addDocumentEventHandler('menubutton'); - cordova.addDocumentEventHandler('searchbutton'); - - function bindButtonChannel(buttonName) { - // generic button bind used for volumeup/volumedown buttons - var volumeButtonChannel = cordova.addDocumentEventHandler(buttonName + 'button'); - volumeButtonChannel.onHasSubscribersChange = function() { - exec(null, null, APP_PLUGIN_NAME, "overrideButton", [buttonName, this.numHandlers == 1]); - }; - } - // Inject a listener for the volume buttons on the document. - bindButtonChannel('volumeup'); - bindButtonChannel('volumedown'); - - // The resume event is not "sticky", but it is possible that the event - // will contain the result of a plugin call. We need to ensure that the - // plugin result is delivered even after the event is fired (CB-10498) - var cordovaAddEventListener = document.addEventListener; - - document.addEventListener = function(evt, handler, capture) { - cordovaAddEventListener(evt, handler, capture); - - if (evt === 'resume' && lastResumeEvent) { - handler(lastResumeEvent); - } - }; - - // Let native code know we are all done on the JS side. - // Native code will then un-hide the WebView. - channel.onCordovaReady.subscribe(function() { - exec(onMessageFromNative, null, APP_PLUGIN_NAME, 'messageChannel', []); - exec(null, null, APP_PLUGIN_NAME, "show", []); - }); - } -}; - -function onMessageFromNative(msg) { - var cordova = require('cordova'); - var action = msg.action; - - switch (action) - { - // Button events - case 'backbutton': - case 'menubutton': - case 'searchbutton': - // App life cycle events - case 'pause': - // Volume events - case 'volumedownbutton': - case 'volumeupbutton': - cordova.fireDocumentEvent(action); - break; - case 'resume': - if(arguments.length > 1 && msg.pendingResult) { - if(arguments.length === 2) { - msg.pendingResult.result = arguments[1]; - } else { - // The plugin returned a multipart message - var res = []; - for(var i = 1; i < arguments.length; i++) { - res.push(arguments[i]); - } - msg.pendingResult.result = res; - } - - // Save the plugin result so that it can be delivered to the js - // even if they miss the initial firing of the event - lastResumeEvent = msg; - } - cordova.fireDocumentEvent(action, msg); - break; - default: - throw new Error('Unknown event action ' + action); - } -} - -}); - -// file: ../cordova-android/cordova-js-src/plugin/android/app.js -define("cordova/plugin/android/app", function(require, exports, module) { - -var exec = require('cordova/exec'); -var APP_PLUGIN_NAME = Number(require('cordova').platformVersion.split('.')[0]) >= 4 ? 'CoreAndroid' : 'App'; - -module.exports = { - /** - * Clear the resource cache. - */ - clearCache:function() { - exec(null, null, APP_PLUGIN_NAME, "clearCache", []); - }, - - /** - * Load the url into the webview or into new browser instance. - * - * @param url The URL to load - * @param props Properties that can be passed in to the activity: - * wait: int => wait msec before loading URL - * loadingDialog: "Title,Message" => display a native loading dialog - * loadUrlTimeoutValue: int => time in msec to wait before triggering a timeout error - * clearHistory: boolean => clear webview history (default=false) - * openExternal: boolean => open in a new browser (default=false) - * - * Example: - * navigator.app.loadUrl("http://server/myapp/index.html", {wait:2000, loadingDialog:"Wait,Loading App", loadUrlTimeoutValue: 60000}); - */ - loadUrl:function(url, props) { - exec(null, null, APP_PLUGIN_NAME, "loadUrl", [url, props]); - }, - - /** - * Cancel loadUrl that is waiting to be loaded. - */ - cancelLoadUrl:function() { - exec(null, null, APP_PLUGIN_NAME, "cancelLoadUrl", []); - }, - - /** - * Clear web history in this web view. - * Instead of BACK button loading the previous web page, it will exit the app. - */ - clearHistory:function() { - exec(null, null, APP_PLUGIN_NAME, "clearHistory", []); - }, - - /** - * Go to previous page displayed. - * This is the same as pressing the backbutton on Android device. - */ - backHistory:function() { - exec(null, null, APP_PLUGIN_NAME, "backHistory", []); - }, - - /** - * Override the default behavior of the Android back button. - * If overridden, when the back button is pressed, the "backKeyDown" JavaScript event will be fired. - * - * Note: The user should not have to call this method. Instead, when the user - * registers for the "backbutton" event, this is automatically done. - * - * @param override T=override, F=cancel override - */ - overrideBackbutton:function(override) { - exec(null, null, APP_PLUGIN_NAME, "overrideBackbutton", [override]); - }, - - /** - * Override the default behavior of the Android volume button. - * If overridden, when the volume button is pressed, the "volume[up|down]button" - * JavaScript event will be fired. - * - * Note: The user should not have to call this method. Instead, when the user - * registers for the "volume[up|down]button" event, this is automatically done. - * - * @param button volumeup, volumedown - * @param override T=override, F=cancel override - */ - overrideButton:function(button, override) { - exec(null, null, APP_PLUGIN_NAME, "overrideButton", [button, override]); - }, - - /** - * Exit and terminate the application. - */ - exitApp:function() { - return exec(null, null, APP_PLUGIN_NAME, "exitApp", []); - } -}; - -}); - -// file: src/common/pluginloader.js -define("cordova/pluginloader", function(require, exports, module) { - -var modulemapper = require('cordova/modulemapper'); - -// Helper function to inject a - - - diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/assets/www/js/index.js b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/assets/www/js/index.js deleted file mode 100644 index f6d6793..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/assets/www/js/index.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -var app = { - // Application Constructor - initialize: function () { - this.bindEvents(); - }, - // Bind Event Listeners - // - // Bind any events that are required on startup. Common events are: - // 'load', 'deviceready', 'offline', and 'online'. - bindEvents: function () { - document.addEventListener('deviceready', this.onDeviceReady, false); - }, - // deviceready Event Handler - // - // The scope of 'this' is the event. In order to call the 'receivedEvent' - // function, we must explicitly call 'app.receivedEvent(...);' - onDeviceReady: function () { - app.receivedEvent('deviceready'); - }, - // Update DOM on a Received Event - receivedEvent: function (id) { - var parentElement = document.getElementById(id); - var listeningElement = parentElement.querySelector('.listening'); - var receivedElement = parentElement.querySelector('.received'); - - listeningElement.setAttribute('style', 'display:none;'); - receivedElement.setAttribute('style', 'display:block;'); - - console.log('Received Event: ' + id); - } -}; - -app.initialize(); diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/build.gradle b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/build.gradle deleted file mode 100644 index bea8a74..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/build.gradle +++ /dev/null @@ -1,52 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - - classpath 'com.android.tools.build:gradle:3.3.0' - } -} - -allprojects { - repositories { - google() - jcenter() - } - - //This replaces project.properties w.r.t. build settings - project.ext { - defaultBuildToolsVersion="28.0.3" //String - defaultMinSdkVersion=19 //Integer - Minimum requirement is Android 4.4 - defaultTargetSdkVersion=28 //Integer - We ALWAYS target the latest by default - defaultCompileSdkVersion=28 //Integer - We ALWAYS compile with the latest by default - } -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/gitignore b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/gitignore deleted file mode 100644 index 427a160..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/gitignore +++ /dev/null @@ -1,21 +0,0 @@ -# Non-project-specific build files: -build.xml -local.properties -/gradlew -/gradlew.bat -/gradle -# Ant builds -ant-build -ant-gen -# Eclipse builds -gen -out -# Gradle build artifacts -.gradle -.gradletasknamecache -/build -/CordovaLib/build -/app/build -gradle-app.setting -# Android Studio -.idea diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/legacy/build.gradle b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/legacy/build.gradle deleted file mode 100644 index f97c734..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/legacy/build.gradle +++ /dev/null @@ -1,334 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -apply plugin: 'com.android.application' - -buildscript { - repositories { - mavenCentral() - jcenter() - } - - // Switch the Android Gradle plugin version requirement depending on the - // installed version of Gradle. This dependency is documented at - // http://tools.android.com/tech-docs/new-build-system/version-compatibility - // and https://issues.apache.org/jira/browse/CB-8143 - dependencies { - classpath 'com.android.tools.build:gradle:2.2.3' - } -} - -// Allow plugins to declare Maven dependencies via build-extras.gradle. -allprojects { - repositories { - mavenCentral(); - jcenter() - } -} - -task wrapper(type: Wrapper) { - gradleVersion = '2.14.1' -} - -// Configuration properties. Set these via environment variables, build-extras.gradle, or gradle.properties. -// Refer to: http://www.gradle.org/docs/current/userguide/tutorial_this_and_that.html -ext { - apply from: 'CordovaLib/cordova.gradle' - // The value for android.compileSdkVersion. - if (!project.hasProperty('cdvCompileSdkVersion')) { - cdvCompileSdkVersion = null; - } - // The value for android.buildToolsVersion. - if (!project.hasProperty('cdvBuildToolsVersion')) { - cdvBuildToolsVersion = null; - } - // Sets the versionCode to the given value. - if (!project.hasProperty('cdvVersionCode')) { - cdvVersionCode = null - } - // Sets the minSdkVersion to the given value. - if (!project.hasProperty('cdvMinSdkVersion')) { - cdvMinSdkVersion = null - } - // Sets the maxSdkVersion to the given value. - if (!project.hasProperty('cdvMaxSdkVersion')) { - cdvMaxSdkVersion = null - } - // The value for android.targetSdkVersion. - if (!project.hasProperty('cdvTargetSdkVersion')) { - cdvTargetSdkVersion = null; - } - // Whether to build architecture-specific APKs. - if (!project.hasProperty('cdvBuildMultipleApks')) { - cdvBuildMultipleApks = null - } - // .properties files to use for release signing. - if (!project.hasProperty('cdvReleaseSigningPropertiesFile')) { - cdvReleaseSigningPropertiesFile = null - } - // .properties files to use for debug signing. - if (!project.hasProperty('cdvDebugSigningPropertiesFile')) { - cdvDebugSigningPropertiesFile = null - } - // Set by build.js script. - if (!project.hasProperty('cdvBuildArch')) { - cdvBuildArch = null - } - - // Plugin gradle extensions can append to this to have code run at the end. - cdvPluginPostBuildExtras = [] -} - -// PLUGIN GRADLE EXTENSIONS START -// PLUGIN GRADLE EXTENSIONS END - -def hasBuildExtras = file('build-extras.gradle').exists() -if (hasBuildExtras) { - apply from: 'build-extras.gradle' -} - -// Set property defaults after extension .gradle files. -if (ext.cdvCompileSdkVersion == null) { - ext.cdvCompileSdkVersion = privateHelpers.getProjectTarget() -} -if (ext.cdvBuildToolsVersion == null) { - ext.cdvBuildToolsVersion = privateHelpers.findLatestInstalledBuildTools() -} -if (ext.cdvDebugSigningPropertiesFile == null && file('debug-signing.properties').exists()) { - ext.cdvDebugSigningPropertiesFile = 'debug-signing.properties' -} -if (ext.cdvReleaseSigningPropertiesFile == null && file('release-signing.properties').exists()) { - ext.cdvReleaseSigningPropertiesFile = 'release-signing.properties' -} - -// Cast to appropriate types. -ext.cdvBuildMultipleApks = cdvBuildMultipleApks == null ? false : cdvBuildMultipleApks.toBoolean(); -ext.cdvMinSdkVersion = cdvMinSdkVersion == null ? null : Integer.parseInt('' + cdvMinSdkVersion) - -if(cdvMaxSdkVersion != null) { - ext.cdvMaxSdkVersion = Integer.parseInt('' + cdvMaxSdkVersion) -} - -ext.cdvVersionCode = cdvVersionCode == null ? null : Integer.parseInt('' + cdvVersionCode) - -def computeBuildTargetName(debugBuild) { - def ret = 'assemble' - if (cdvBuildMultipleApks && cdvBuildArch) { - def arch = cdvBuildArch == 'arm' ? 'armv7' : cdvBuildArch - ret += '' + arch.toUpperCase().charAt(0) + arch.substring(1); - } - return ret + (debugBuild ? 'Debug' : 'Release') -} - -// Make cdvBuild a task that depends on the debug/arch-sepecific task. -task cdvBuildDebug -cdvBuildDebug.dependsOn { - return computeBuildTargetName(true) -} - -task cdvBuildRelease -cdvBuildRelease.dependsOn { - return computeBuildTargetName(false) -} - -task cdvPrintProps << { - println('cdvCompileSdkVersion=' + cdvCompileSdkVersion) - println('cdvBuildToolsVersion=' + cdvBuildToolsVersion) - println('cdvVersionCode=' + cdvVersionCode) - println('cdvMinSdkVersion=' + cdvMinSdkVersion) - println('cdvMaxSdkVersion=' + cdvMaxSdkVersion) - println('cdvTargetSdkVersion=' + cdvTargetSdkVersion) - println('cdvBuildMultipleApks=' + cdvBuildMultipleApks) - println('cdvReleaseSigningPropertiesFile=' + cdvReleaseSigningPropertiesFile) - println('cdvDebugSigningPropertiesFile=' + cdvDebugSigningPropertiesFile) - println('cdvBuildArch=' + cdvBuildArch) - println('computedVersionCode=' + android.defaultConfig.versionCode) - android.productFlavors.each { flavor -> - println('computed' + flavor.name.capitalize() + 'VersionCode=' + flavor.versionCode) - } -} - -android { - sourceSets { - main { - manifest.srcFile 'AndroidManifest.xml' - java.srcDirs = ['src'] - resources.srcDirs = ['src'] - aidl.srcDirs = ['src'] - renderscript.srcDirs = ['src'] - res.srcDirs = ['res'] - assets.srcDirs = ['assets'] - jniLibs.srcDirs = ['libs'] - } - } - - defaultConfig { - versionCode cdvVersionCode ?: new BigInteger("" + privateHelpers.extractIntFromManifest("versionCode")) - applicationId privateHelpers.extractStringFromManifest("package") - - if (cdvMinSdkVersion != null) { - minSdkVersion cdvMinSdkVersion - } - - if (cdvMaxSdkVersion != null) { - maxSdkVersion cdvMaxSdkVersion - } - - if(cdvTargetSdkVersion != null) { - targetSdkVersion cdvTargetSdkVersion - } - } - - lintOptions { - abortOnError false; - } - - compileSdkVersion cdvCompileSdkVersion - buildToolsVersion cdvBuildToolsVersion - - if (Boolean.valueOf(cdvBuildMultipleApks)) { - productFlavors { - armv7 { - versionCode defaultConfig.versionCode*10 + 2 - ndk { - abiFilters "armeabi-v7a", "" - } - } - x86 { - versionCode defaultConfig.versionCode*10 + 4 - ndk { - abiFilters "x86", "" - } - } - all { - ndk { - abiFilters "all", "" - } - } - } - } - /* - - ELSE NOTHING! DON'T MESS WITH THE VERSION CODE IF YOU DON'T HAVE TO! - - else if (!cdvVersionCode) { - def minSdkVersion = cdvMinSdkVersion ?: privateHelpers.extractIntFromManifest("minSdkVersion") - // Vary versionCode by the two most common API levels: - // 14 is ICS, which is the lowest API level for many apps. - // 20 is Lollipop, which is the lowest API level for the updatable system webview. - if (minSdkVersion >= 20) { - defaultConfig.versionCode += 9 - } else if (minSdkVersion >= 14) { - defaultConfig.versionCode += 8 - } - } - */ - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_6 - targetCompatibility JavaVersion.VERSION_1_6 - } - - 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. - storeFile = null - storePassword = "__unset" - } - } - buildTypes { - release { - signingConfig signingConfigs.release - } - } - addSigningProps(cdvReleaseSigningPropertiesFile, signingConfigs.release) - } - if (cdvDebugSigningPropertiesFile) { - addSigningProps(cdvDebugSigningPropertiesFile, signingConfigs.debug) - } -} - -dependencies { - implementation fileTree(dir: 'libs', include: '*.jar') - // SUB-PROJECT DEPENDENCIES START - // SUB-PROJECT DEPENDENCIES END -} - -def promptForReleaseKeyPassword() { - if (!cdvReleaseSigningPropertiesFile) { - return; - } - if ('__unset'.equals(android.signingConfigs.release.storePassword)) { - android.signingConfigs.release.storePassword = privateHelpers.promptForPassword('Enter key store password: ') - } - if ('__unset'.equals(android.signingConfigs.release.keyPassword)) { - android.signingConfigs.release.keyPassword = privateHelpers.promptForPassword('Enter key password: '); - } -} - -gradle.taskGraph.whenReady { taskGraph -> - taskGraph.getAllTasks().each() { task -> - if (task.name == 'validateReleaseSigning' || task.name == 'validateSigningRelease') { - promptForReleaseKeyPassword() - } - } -} - -def addSigningProps(propsFilePath, signingConfig) { - def propsFile = file(propsFilePath) - def props = new Properties() - propsFile.withReader { reader -> - props.load(reader) - } - - def storeFile = new File(props.get('key.store') ?: privateHelpers.ensureValueExists(propsFilePath, props, 'storeFile')) - if (!storeFile.isAbsolute()) { - storeFile = RelativePath.parse(true, storeFile.toString()).getFile(propsFile.getParentFile()) - } - if (!storeFile.exists()) { - throw new FileNotFoundException('Keystore file does not exist: ' + storeFile.getAbsolutePath()) - } - signingConfig.keyAlias = props.get('key.alias') ?: privateHelpers.ensureValueExists(propsFilePath, props, 'keyAlias') - signingConfig.keyPassword = props.get('keyPassword', props.get('key.alias.password', signingConfig.keyPassword)) - signingConfig.storeFile = storeFile - signingConfig.storePassword = props.get('storePassword', props.get('key.store.password', signingConfig.storePassword)) - def storeType = props.get('storeType', props.get('key.store.type', '')) - if (!storeType) { - def filename = storeFile.getName().toLowerCase(); - if (filename.endsWith('.p12') || filename.endsWith('.pfx')) { - storeType = 'pkcs12' - } else { - storeType = signingConfig.storeType // "jks" - } - } - signingConfig.storeType = storeType -} - -for (def func : cdvPluginPostBuildExtras) { - func() -} - -// This can be defined within build-extras.gradle as: -// ext.postBuildExtras = { ... code here ... } -if (hasProperty('postBuildExtras')) { - postBuildExtras() -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/project.properties b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/project.properties deleted file mode 100644 index 6ea5ac2..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/project.properties +++ /dev/null @@ -1,13 +0,0 @@ -# This file was originally created by the Android Tools, but is now -# used by cordova-android to manage the state of the various third party -# libraries used in your application - -# This is the Library Module that contains the Cordova Library, this is not -# required when using an AAR -android.library.reference.1=CordovaLib - -# This is the application project. This is only required for Android Studio Gradle projects -android.library.reference.2=app - -# Project target. -target=This_gets_replaced diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-land-hdpi/screen.png b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-land-hdpi/screen.png deleted file mode 100644 index 1600863..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-land-hdpi/screen.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-land-ldpi/screen.png b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-land-ldpi/screen.png deleted file mode 100644 index f7ad3cf..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-land-ldpi/screen.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-land-mdpi/screen.png b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-land-mdpi/screen.png deleted file mode 100644 index b624313..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-land-mdpi/screen.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-land-xhdpi/screen.png b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-land-xhdpi/screen.png deleted file mode 100644 index 9720f41..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-land-xhdpi/screen.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-land-xxhdpi/screen.png b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-land-xxhdpi/screen.png deleted file mode 100644 index 80d6b47..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-land-xxhdpi/screen.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-land-xxxhdpi/screen.png b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-land-xxxhdpi/screen.png deleted file mode 100644 index 84c5a2b..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-land-xxxhdpi/screen.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-port-hdpi/screen.png b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-port-hdpi/screen.png deleted file mode 100644 index b2f60af..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-port-hdpi/screen.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-port-ldpi/screen.png b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-port-ldpi/screen.png deleted file mode 100644 index 4b2abbb..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-port-ldpi/screen.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-port-mdpi/screen.png b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-port-mdpi/screen.png deleted file mode 100644 index 1f1ae9d..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-port-mdpi/screen.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-port-xhdpi/screen.png b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-port-xhdpi/screen.png deleted file mode 100644 index 690c57e..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-port-xhdpi/screen.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-port-xxhdpi/screen.png b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-port-xxhdpi/screen.png deleted file mode 100644 index 214f0a0..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-port-xxhdpi/screen.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-port-xxxhdpi/screen.png b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-port-xxxhdpi/screen.png deleted file mode 100644 index c4ef772..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/drawable-port-xxxhdpi/screen.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-hdpi-v26/ic_launcher.xml b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-hdpi-v26/ic_launcher.xml deleted file mode 100644 index be31618..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-hdpi-v26/ic_launcher.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-hdpi-v26/ic_launcher_background.png b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-hdpi-v26/ic_launcher_background.png deleted file mode 100644 index 8614ac3..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-hdpi-v26/ic_launcher_background.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-hdpi-v26/ic_launcher_foreground.png b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-hdpi-v26/ic_launcher_foreground.png deleted file mode 100644 index a142f17..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-hdpi-v26/ic_launcher_foreground.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-hdpi/ic_launcher.png b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index a142f17..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-ldpi-v26/ic_launcher.xml b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-ldpi-v26/ic_launcher.xml deleted file mode 100644 index be31618..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-ldpi-v26/ic_launcher.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-ldpi-v26/ic_launcher_background.png b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-ldpi-v26/ic_launcher_background.png deleted file mode 100644 index 323bd95..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-ldpi-v26/ic_launcher_background.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-ldpi-v26/ic_launcher_foreground.png b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-ldpi-v26/ic_launcher_foreground.png deleted file mode 100644 index a91172c..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-ldpi-v26/ic_launcher_foreground.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-ldpi/ic_launcher.png b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-ldpi/ic_launcher.png deleted file mode 100644 index 7c6438f..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-ldpi/ic_launcher.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-mdpi-v26/ic_launcher.xml b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-mdpi-v26/ic_launcher.xml deleted file mode 100644 index be31618..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-mdpi-v26/ic_launcher.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-mdpi-v26/ic_launcher_background.png b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-mdpi-v26/ic_launcher_background.png deleted file mode 100644 index 3f8f989..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-mdpi-v26/ic_launcher_background.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-mdpi-v26/ic_launcher_foreground.png b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-mdpi-v26/ic_launcher_foreground.png deleted file mode 100644 index bd82b96..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-mdpi-v26/ic_launcher_foreground.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-mdpi/ic_launcher.png b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index f1458ec..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xhdpi-v26/ic_launcher.xml b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xhdpi-v26/ic_launcher.xml deleted file mode 100644 index be31618..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xhdpi-v26/ic_launcher.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xhdpi-v26/ic_launcher_background.png b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xhdpi-v26/ic_launcher_background.png deleted file mode 100644 index c6c0d7a..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xhdpi-v26/ic_launcher_background.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xhdpi-v26/ic_launcher_foreground.png b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xhdpi-v26/ic_launcher_foreground.png deleted file mode 100644 index 749bc1b..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xhdpi-v26/ic_launcher_foreground.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xhdpi/ic_launcher.png b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 59c67a8..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xxhdpi-v26/ic_launcher.xml b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xxhdpi-v26/ic_launcher.xml deleted file mode 100644 index be31618..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xxhdpi-v26/ic_launcher.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xxhdpi-v26/ic_launcher_background.png b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xxhdpi-v26/ic_launcher_background.png deleted file mode 100644 index 7066fd1..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xxhdpi-v26/ic_launcher_background.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xxhdpi-v26/ic_launcher_foreground.png b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xxhdpi-v26/ic_launcher_foreground.png deleted file mode 100644 index 3b7a89e..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xxhdpi-v26/ic_launcher_foreground.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xxhdpi/ic_launcher.png b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index cd9bb4d..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xxxhdpi-v26/ic_launcher.xml b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xxxhdpi-v26/ic_launcher.xml deleted file mode 100644 index be31618..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xxxhdpi-v26/ic_launcher.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xxxhdpi-v26/ic_launcher_background.png b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xxxhdpi-v26/ic_launcher_background.png deleted file mode 100644 index 76625dd..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xxxhdpi-v26/ic_launcher_background.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xxxhdpi-v26/ic_launcher_foreground.png b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xxxhdpi-v26/ic_launcher_foreground.png deleted file mode 100644 index 9da0cdf..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xxxhdpi-v26/ic_launcher_foreground.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xxxhdpi/ic_launcher.png b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 5365248..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/values/strings.xml b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/values/strings.xml deleted file mode 100644 index bb049db..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/values/strings.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - __NAME__ - - @string/app_name - - @string/launcher_name - diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/xml/config.xml b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/xml/config.xml deleted file mode 100644 index ae06783..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/res/xml/config.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - Hello Cordova - - - A sample Apache Cordova application that responds to the deviceready event. - - - - Apache Cordova Team - - - - - - - - - - - - - - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/wrapper.gradle b/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/wrapper.gradle deleted file mode 100644 index d7ebabd..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/templates/project/wrapper.gradle +++ /dev/null @@ -1 +0,0 @@ -//This file is intentionally just a comment diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/update b/chabok-starter-cordova/node_modules/cordova-android/bin/update deleted file mode 100755 index 419d34e..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/update +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env node - -/* - 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 path = require('path'); -var Api = require('./templates/cordova/Api'); -var args = require('nopt')({ - 'link': Boolean, - 'shared': Boolean, - 'help': Boolean -}, { 'd': '--verbose' }); - -if (args.help || args.argv.remain.length === 0) { - console.log('Usage: ' + path.relative(process.cwd(), path.join(__dirname, 'update')) + ' [--link]'); - console.log(' --link will use the CordovaLib project directly instead of making a copy.'); - process.exit(1); -} - -require('./templates/cordova/loggingHelper').adjustLoggerLevel(args); - -Api.updatePlatform(args.argv.remain[0], { link: (args.link || args.shared) }).done(); diff --git a/chabok-starter-cordova/node_modules/cordova-android/bin/update.bat b/chabok-starter-cordova/node_modules/cordova-android/bin/update.bat deleted file mode 100644 index d0aa7a0..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/bin/update.bat +++ /dev/null @@ -1,26 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. - -@ECHO OFF -SET script_path="%~dp0update" -IF EXIST %script_path% ( - node %script_path% %* -) ELSE ( - ECHO. - ECHO ERROR: Could not find 'update' script in 'bin' folder, aborting...>&2 - EXIT /B 1 -) diff --git a/chabok-starter-cordova/node_modules/cordova-android/cordova-js-src/android/nativeapiprovider.js b/chabok-starter-cordova/node_modules/cordova-android/cordova-js-src/android/nativeapiprovider.js deleted file mode 100644 index 2e9aa67..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/cordova-js-src/android/nativeapiprovider.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. -*/ - -/** - * Exports the ExposedJsApi.java object if available, otherwise exports the PromptBasedNativeApi. - */ - -var nativeApi = this._cordovaNative || require('cordova/android/promptbasednativeapi'); -var currentApi = nativeApi; - -module.exports = { - get: function() { return currentApi; }, - setPreferPrompt: function(value) { - currentApi = value ? require('cordova/android/promptbasednativeapi') : nativeApi; - }, - // Used only by tests. - set: function(value) { - currentApi = value; - } -}; diff --git a/chabok-starter-cordova/node_modules/cordova-android/cordova-js-src/android/promptbasednativeapi.js b/chabok-starter-cordova/node_modules/cordova-android/cordova-js-src/android/promptbasednativeapi.js deleted file mode 100644 index f7fb6bc..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/cordova-js-src/android/promptbasednativeapi.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. -*/ - -/** - * Implements the API of ExposedJsApi.java, but uses prompt() to communicate. - * This is used pre-JellyBean, where addJavascriptInterface() is disabled. - */ - -module.exports = { - exec: function(bridgeSecret, service, action, callbackId, argsJson) { - return prompt(argsJson, 'gap:'+JSON.stringify([bridgeSecret, service, action, callbackId])); - }, - setNativeToJsBridgeMode: function(bridgeSecret, value) { - prompt(value, 'gap_bridge_mode:' + bridgeSecret); - }, - retrieveJsMessages: function(bridgeSecret, fromOnlineEvent) { - return prompt(+fromOnlineEvent, 'gap_poll:' + bridgeSecret); - } -}; diff --git a/chabok-starter-cordova/node_modules/cordova-android/cordova-js-src/exec.js b/chabok-starter-cordova/node_modules/cordova-android/cordova-js-src/exec.js deleted file mode 100644 index 39e8c97..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/cordova-js-src/exec.js +++ /dev/null @@ -1,286 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -/** - * Execute a cordova command. It is up to the native side whether this action - * is synchronous or asynchronous. The native side can return: - * Synchronous: PluginResult object as a JSON string - * Asynchronous: Empty string "" - * If async, the native side will cordova.callbackSuccess or cordova.callbackError, - * depending upon the result of the action. - * - * @param {Function} success The success callback - * @param {Function} fail The fail callback - * @param {String} service The name of the service to use - * @param {String} action Action to be run in cordova - * @param {String[]} [args] Zero or more arguments to pass to the method - */ -var cordova = require('cordova'), - nativeApiProvider = require('cordova/android/nativeapiprovider'), - utils = require('cordova/utils'), - base64 = require('cordova/base64'), - channel = require('cordova/channel'), - jsToNativeModes = { - PROMPT: 0, - JS_OBJECT: 1 - }, - nativeToJsModes = { - // Polls for messages using the JS->Native bridge. - POLLING: 0, - // For LOAD_URL to be viable, it would need to have a work-around for - // the bug where the soft-keyboard gets dismissed when a message is sent. - LOAD_URL: 1, - // For the ONLINE_EVENT to be viable, it would need to intercept all event - // listeners (both through addEventListener and window.ononline) as well - // as set the navigator property itself. - ONLINE_EVENT: 2, - EVAL_BRIDGE: 3 - }, - jsToNativeBridgeMode, // Set lazily. - nativeToJsBridgeMode = nativeToJsModes.EVAL_BRIDGE, - pollEnabled = false, - bridgeSecret = -1; - -var messagesFromNative = []; -var isProcessing = false; -var resolvedPromise = typeof Promise == 'undefined' ? null : Promise.resolve(); -var nextTick = resolvedPromise ? function(fn) { resolvedPromise.then(fn); } : function(fn) { setTimeout(fn); }; - -function androidExec(success, fail, service, action, args) { - if (bridgeSecret < 0) { - // If we ever catch this firing, we'll need to queue up exec()s - // and fire them once we get a secret. For now, I don't think - // it's possible for exec() to be called since plugins are parsed but - // not run until until after onNativeReady. - throw new Error('exec() called without bridgeSecret'); - } - // Set default bridge modes if they have not already been set. - // By default, we use the failsafe, since addJavascriptInterface breaks too often - if (jsToNativeBridgeMode === undefined) { - androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT); - } - - // If args is not provided, default to an empty array - args = args || []; - - // Process any ArrayBuffers in the args into a string. - for (var i = 0; i < args.length; i++) { - if (utils.typeName(args[i]) == 'ArrayBuffer') { - args[i] = base64.fromArrayBuffer(args[i]); - } - } - - var callbackId = service + cordova.callbackId++, - argsJson = JSON.stringify(args); - if (success || fail) { - cordova.callbacks[callbackId] = {success:success, fail:fail}; - } - - var msgs = nativeApiProvider.get().exec(bridgeSecret, service, action, callbackId, argsJson); - // If argsJson was received by Java as null, try again with the PROMPT bridge mode. - // This happens in rare circumstances, such as when certain Unicode characters are passed over the bridge on a Galaxy S2. See CB-2666. - if (jsToNativeBridgeMode == jsToNativeModes.JS_OBJECT && msgs === "@Null arguments.") { - androidExec.setJsToNativeBridgeMode(jsToNativeModes.PROMPT); - androidExec(success, fail, service, action, args); - androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT); - } else if (msgs) { - messagesFromNative.push(msgs); - // Always process async to avoid exceptions messing up stack. - nextTick(processMessages); - } -} - -androidExec.init = function() { - bridgeSecret = +prompt('', 'gap_init:' + nativeToJsBridgeMode); - channel.onNativeReady.fire(); -}; - -function pollOnceFromOnlineEvent() { - pollOnce(true); -} - -function pollOnce(opt_fromOnlineEvent) { - if (bridgeSecret < 0) { - // This can happen when the NativeToJsMessageQueue resets the online state on page transitions. - // We know there's nothing to retrieve, so no need to poll. - return; - } - var msgs = nativeApiProvider.get().retrieveJsMessages(bridgeSecret, !!opt_fromOnlineEvent); - if (msgs) { - messagesFromNative.push(msgs); - // Process sync since we know we're already top-of-stack. - processMessages(); - } -} - -function pollingTimerFunc() { - if (pollEnabled) { - pollOnce(); - setTimeout(pollingTimerFunc, 50); - } -} - -function hookOnlineApis() { - function proxyEvent(e) { - cordova.fireWindowEvent(e.type); - } - // The network module takes care of firing online and offline events. - // It currently fires them only on document though, so we bridge them - // to window here (while first listening for exec()-releated online/offline - // events). - window.addEventListener('online', pollOnceFromOnlineEvent, false); - window.addEventListener('offline', pollOnceFromOnlineEvent, false); - cordova.addWindowEventHandler('online'); - cordova.addWindowEventHandler('offline'); - document.addEventListener('online', proxyEvent, false); - document.addEventListener('offline', proxyEvent, false); -} - -hookOnlineApis(); - -androidExec.jsToNativeModes = jsToNativeModes; -androidExec.nativeToJsModes = nativeToJsModes; - -androidExec.setJsToNativeBridgeMode = function(mode) { - if (mode == jsToNativeModes.JS_OBJECT && !window._cordovaNative) { - mode = jsToNativeModes.PROMPT; - } - nativeApiProvider.setPreferPrompt(mode == jsToNativeModes.PROMPT); - jsToNativeBridgeMode = mode; -}; - -androidExec.setNativeToJsBridgeMode = function(mode) { - if (mode == nativeToJsBridgeMode) { - return; - } - if (nativeToJsBridgeMode == nativeToJsModes.POLLING) { - pollEnabled = false; - } - - nativeToJsBridgeMode = mode; - // Tell the native side to switch modes. - // Otherwise, it will be set by androidExec.init() - if (bridgeSecret >= 0) { - nativeApiProvider.get().setNativeToJsBridgeMode(bridgeSecret, mode); - } - - if (mode == nativeToJsModes.POLLING) { - pollEnabled = true; - setTimeout(pollingTimerFunc, 1); - } -}; - -function buildPayload(payload, message) { - var payloadKind = message.charAt(0); - if (payloadKind == 's') { - payload.push(message.slice(1)); - } else if (payloadKind == 't') { - payload.push(true); - } else if (payloadKind == 'f') { - payload.push(false); - } else if (payloadKind == 'N') { - payload.push(null); - } else if (payloadKind == 'n') { - payload.push(+message.slice(1)); - } else if (payloadKind == 'A') { - var data = message.slice(1); - payload.push(base64.toArrayBuffer(data)); - } else if (payloadKind == 'S') { - payload.push(window.atob(message.slice(1))); - } else if (payloadKind == 'M') { - var multipartMessages = message.slice(1); - while (multipartMessages !== "") { - var spaceIdx = multipartMessages.indexOf(' '); - var msgLen = +multipartMessages.slice(0, spaceIdx); - var multipartMessage = multipartMessages.substr(spaceIdx + 1, msgLen); - multipartMessages = multipartMessages.slice(spaceIdx + msgLen + 1); - buildPayload(payload, multipartMessage); - } - } else { - payload.push(JSON.parse(message)); - } -} - -// Processes a single message, as encoded by NativeToJsMessageQueue.java. -function processMessage(message) { - var firstChar = message.charAt(0); - if (firstChar == 'J') { - // This is deprecated on the .java side. It doesn't work with CSP enabled. - eval(message.slice(1)); - } else if (firstChar == 'S' || firstChar == 'F') { - var success = firstChar == 'S'; - var keepCallback = message.charAt(1) == '1'; - var spaceIdx = message.indexOf(' ', 2); - var status = +message.slice(2, spaceIdx); - var nextSpaceIdx = message.indexOf(' ', spaceIdx + 1); - var callbackId = message.slice(spaceIdx + 1, nextSpaceIdx); - var payloadMessage = message.slice(nextSpaceIdx + 1); - var payload = []; - buildPayload(payload, payloadMessage); - cordova.callbackFromNative(callbackId, success, status, payload, keepCallback); - } else { - console.log("processMessage failed: invalid message: " + JSON.stringify(message)); - } -} - -function processMessages() { - // Check for the reentrant case. - if (isProcessing) { - return; - } - if (messagesFromNative.length === 0) { - return; - } - isProcessing = true; - try { - var msg = popMessageFromQueue(); - // The Java side can send a * message to indicate that it - // still has messages waiting to be retrieved. - if (msg == '*' && messagesFromNative.length === 0) { - nextTick(pollOnce); - return; - } - processMessage(msg); - } finally { - isProcessing = false; - if (messagesFromNative.length > 0) { - nextTick(processMessages); - } - } -} - -function popMessageFromQueue() { - var messageBatch = messagesFromNative.shift(); - if (messageBatch == '*') { - return '*'; - } - - var spaceIdx = messageBatch.indexOf(' '); - var msgLen = +messageBatch.slice(0, spaceIdx); - var message = messageBatch.substr(spaceIdx + 1, msgLen); - messageBatch = messageBatch.slice(spaceIdx + msgLen + 1); - if (messageBatch) { - messagesFromNative.unshift(messageBatch); - } - return message; -} - -module.exports = androidExec; diff --git a/chabok-starter-cordova/node_modules/cordova-android/cordova-js-src/platform.js b/chabok-starter-cordova/node_modules/cordova-android/cordova-js-src/platform.js deleted file mode 100644 index 2bfd024..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/cordova-js-src/platform.js +++ /dev/null @@ -1,125 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -// The last resume event that was received that had the result of a plugin call. -var lastResumeEvent = null; - -module.exports = { - id: 'android', - bootstrap: function() { - var channel = require('cordova/channel'), - cordova = require('cordova'), - exec = require('cordova/exec'), - modulemapper = require('cordova/modulemapper'); - - // Get the shared secret needed to use the bridge. - exec.init(); - - // TODO: Extract this as a proper plugin. - modulemapper.clobbers('cordova/plugin/android/app', 'navigator.app'); - - var APP_PLUGIN_NAME = Number(cordova.platformVersion.split('.')[0]) >= 4 ? 'CoreAndroid' : 'App'; - - // Inject a listener for the backbutton on the document. - var backButtonChannel = cordova.addDocumentEventHandler('backbutton'); - backButtonChannel.onHasSubscribersChange = function() { - // If we just attached the first handler or detached the last handler, - // let native know we need to override the back button. - exec(null, null, APP_PLUGIN_NAME, "overrideBackbutton", [this.numHandlers == 1]); - }; - - // Add hardware MENU and SEARCH button handlers - cordova.addDocumentEventHandler('menubutton'); - cordova.addDocumentEventHandler('searchbutton'); - - function bindButtonChannel(buttonName) { - // generic button bind used for volumeup/volumedown buttons - var volumeButtonChannel = cordova.addDocumentEventHandler(buttonName + 'button'); - volumeButtonChannel.onHasSubscribersChange = function() { - exec(null, null, APP_PLUGIN_NAME, "overrideButton", [buttonName, this.numHandlers == 1]); - }; - } - // Inject a listener for the volume buttons on the document. - bindButtonChannel('volumeup'); - bindButtonChannel('volumedown'); - - // The resume event is not "sticky", but it is possible that the event - // will contain the result of a plugin call. We need to ensure that the - // plugin result is delivered even after the event is fired (CB-10498) - var cordovaAddEventListener = document.addEventListener; - - document.addEventListener = function(evt, handler, capture) { - cordovaAddEventListener(evt, handler, capture); - - if (evt === 'resume' && lastResumeEvent) { - handler(lastResumeEvent); - } - }; - - // Let native code know we are all done on the JS side. - // Native code will then un-hide the WebView. - channel.onCordovaReady.subscribe(function() { - exec(onMessageFromNative, null, APP_PLUGIN_NAME, 'messageChannel', []); - exec(null, null, APP_PLUGIN_NAME, "show", []); - }); - } -}; - -function onMessageFromNative(msg) { - var cordova = require('cordova'); - var action = msg.action; - - switch (action) - { - // Button events - case 'backbutton': - case 'menubutton': - case 'searchbutton': - // App life cycle events - case 'pause': - // Volume events - case 'volumedownbutton': - case 'volumeupbutton': - cordova.fireDocumentEvent(action); - break; - case 'resume': - if(arguments.length > 1 && msg.pendingResult) { - if(arguments.length === 2) { - msg.pendingResult.result = arguments[1]; - } else { - // The plugin returned a multipart message - var res = []; - for(var i = 1; i < arguments.length; i++) { - res.push(arguments[i]); - } - msg.pendingResult.result = res; - } - - // Save the plugin result so that it can be delivered to the js - // even if they miss the initial firing of the event - lastResumeEvent = msg; - } - cordova.fireDocumentEvent(action, msg); - break; - default: - throw new Error('Unknown event action ' + action); - } -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/cordova-js-src/plugin/android/app.js b/chabok-starter-cordova/node_modules/cordova-android/cordova-js-src/plugin/android/app.js deleted file mode 100644 index 22cf96e..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/cordova-js-src/plugin/android/app.js +++ /dev/null @@ -1,108 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var exec = require('cordova/exec'); -var APP_PLUGIN_NAME = Number(require('cordova').platformVersion.split('.')[0]) >= 4 ? 'CoreAndroid' : 'App'; - -module.exports = { - /** - * Clear the resource cache. - */ - clearCache:function() { - exec(null, null, APP_PLUGIN_NAME, "clearCache", []); - }, - - /** - * Load the url into the webview or into new browser instance. - * - * @param url The URL to load - * @param props Properties that can be passed in to the activity: - * wait: int => wait msec before loading URL - * loadingDialog: "Title,Message" => display a native loading dialog - * loadUrlTimeoutValue: int => time in msec to wait before triggering a timeout error - * clearHistory: boolean => clear webview history (default=false) - * openExternal: boolean => open in a new browser (default=false) - * - * Example: - * navigator.app.loadUrl("http://server/myapp/index.html", {wait:2000, loadingDialog:"Wait,Loading App", loadUrlTimeoutValue: 60000}); - */ - loadUrl:function(url, props) { - exec(null, null, APP_PLUGIN_NAME, "loadUrl", [url, props]); - }, - - /** - * Cancel loadUrl that is waiting to be loaded. - */ - cancelLoadUrl:function() { - exec(null, null, APP_PLUGIN_NAME, "cancelLoadUrl", []); - }, - - /** - * Clear web history in this web view. - * Instead of BACK button loading the previous web page, it will exit the app. - */ - clearHistory:function() { - exec(null, null, APP_PLUGIN_NAME, "clearHistory", []); - }, - - /** - * Go to previous page displayed. - * This is the same as pressing the backbutton on Android device. - */ - backHistory:function() { - exec(null, null, APP_PLUGIN_NAME, "backHistory", []); - }, - - /** - * Override the default behavior of the Android back button. - * If overridden, when the back button is pressed, the "backKeyDown" JavaScript event will be fired. - * - * Note: The user should not have to call this method. Instead, when the user - * registers for the "backbutton" event, this is automatically done. - * - * @param override T=override, F=cancel override - */ - overrideBackbutton:function(override) { - exec(null, null, APP_PLUGIN_NAME, "overrideBackbutton", [override]); - }, - - /** - * Override the default behavior of the Android volume button. - * If overridden, when the volume button is pressed, the "volume[up|down]button" - * JavaScript event will be fired. - * - * Note: The user should not have to call this method. Instead, when the user - * registers for the "volume[up|down]button" event, this is automatically done. - * - * @param button volumeup, volumedown - * @param override T=override, F=cancel override - */ - overrideButton:function(button, override) { - exec(null, null, APP_PLUGIN_NAME, "overrideButton", [button, override]); - }, - - /** - * Exit and terminate the application. - */ - exitApp:function() { - return exec(null, null, APP_PLUGIN_NAME, "exitApp", []); - } -}; diff --git a/chabok-starter-cordova/node_modules/cordova-android/framework/.classpath b/chabok-starter-cordova/node_modules/cordova-android/framework/.classpath deleted file mode 100644 index 0461652..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/framework/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-android/framework/.project b/chabok-starter-cordova/node_modules/cordova-android/framework/.project deleted file mode 100644 index ed4a955..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/framework/.project +++ /dev/null @@ -1,33 +0,0 @@ - - - Cordova - - - - - - com.android.ide.eclipse.adt.ResourceManagerBuilder - - - - - com.android.ide.eclipse.adt.PreCompilerBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - com.android.ide.eclipse.adt.ApkBuilder - - - - - - com.android.ide.eclipse.adt.AndroidNature - org.eclipse.jdt.core.javanature - - diff --git a/chabok-starter-cordova/node_modules/cordova-android/framework/.settings/org.eclipse.jdt.core.prefs b/chabok-starter-cordova/node_modules/cordova-android/framework/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index b080d2d..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/framework/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/chabok-starter-cordova/node_modules/cordova-android/framework/AndroidManifest.xml b/chabok-starter-cordova/node_modules/cordova-android/framework/AndroidManifest.xml deleted file mode 100755 index 320c253..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/framework/AndroidManifest.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-android/framework/ant.properties b/chabok-starter-cordova/node_modules/cordova-android/framework/ant.properties deleted file mode 100644 index 243b691..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/framework/ant.properties +++ /dev/null @@ -1,34 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -# This file is used to override default values used by the Ant build system. -# -# This file must be checked in Version Control Systems, as it is -# integral to the build system of your project. - -# This file is only used by the Ant script. - -# You can use this to override default values such as -# 'source.dir' for the location of your java source folder and -# 'out.dir' for the location of your output folder. - -# You can also use it define how the release builds are signed by declaring -# the following properties: -# 'key.store' for the location of your keystore and -# 'key.alias' for the name of the key to use. -# The password will be asked during the build when you use the 'release' target. - diff --git a/chabok-starter-cordova/node_modules/cordova-android/framework/build.gradle b/chabok-starter-cordova/node_modules/cordova-android/framework/build.gradle deleted file mode 100644 index 03256a1..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/framework/build.gradle +++ /dev/null @@ -1,148 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -ext { - apply from: 'cordova.gradle' - cdvCompileSdkVersion = privateHelpers.getProjectTarget() - cdvBuildToolsVersion = privateHelpers.findLatestInstalledBuildTools() -} - -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - // The gradle plugin and the maven plugin have to be updated after each version of Android - // studio comes out - classpath 'com.android.tools.build:gradle:3.3.0' - classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' - classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' - } -} - -allprojects { - repositories { - google() - jcenter() - } -} - -apply plugin: 'com.android.library' -apply plugin: 'com.github.dcendents.android-maven' -apply plugin: 'com.jfrog.bintray' - -group = 'org.apache.cordova' -version = '8.1.0' - -android { - compileSdkVersion cdvCompileSdkVersion - buildToolsVersion cdvBuildToolsVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - // For the Android Cordova Lib, we will hardcode the minSdkVersion and not allow changes. - defaultConfig { - minSdkVersion 19 - } - - sourceSets { - main { - manifest.srcFile 'AndroidManifest.xml' - java.srcDirs = ['src'] - resources.srcDirs = ['src'] - aidl.srcDirs = ['src'] - renderscript.srcDirs = ['src'] - res.srcDirs = ['res'] - assets.srcDirs = ['assets'] - } - } - - packagingOptions { - exclude 'META-INF/LICENSE' - exclude 'META-INF/LICENSE.txt' - exclude 'META-INF/DEPENDENCIES' - exclude 'META-INF/NOTICE' - } -} - -install { - repositories.mavenInstaller { - pom { - project { - packaging 'aar' - name 'Cordova' - url 'https://cordova.apache.org' - licenses { - license { - name 'The Apache Software License, Version 2.0' - url 'http://www.apache.org/licenses/LICENSE-2.0.txt' - } - } - developers { - developer { - id 'stevengill' - name 'Steve Gill' - } - } - scm { - connection 'scm:git:https://github.com/apache/cordova-android.git' - developerConnection 'scm:git:git@github.com:apache/cordova-android.git' - url 'https://github.com/apache/cordova-android' - - } - } - } - } -} - -task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' -} - -artifacts { - archives sourcesJar -} - -bintray { - user = System.getenv('BINTRAY_USER') - key = System.getenv('BINTRAY_KEY') - configurations = ['archives'] - pkg { - repo = 'maven' - name = 'cordova-android' - userOrg = 'cordova' - licenses = ['Apache-2.0'] - vcsUrl = 'https://github.com/apache/cordova-android' - websiteUrl = 'https://cordova.apache.org' - issueTrackerUrl = 'https://github.com/apache/cordova-android/issues' - publicDownloadNumbers = true - licenses = ['Apache-2.0'] - labels = ['android', 'cordova', 'phonegap'] - version { - name = '8.1.0' - released = new Date() - vcsTag = '8.1.0' - } - } -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/framework/build.xml b/chabok-starter-cordova/node_modules/cordova-android/framework/build.xml deleted file mode 100644 index 3957084..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/framework/build.xml +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-android/framework/cordova.gradle b/chabok-starter-cordova/node_modules/cordova-android/framework/cordova.gradle deleted file mode 100644 index 6c6819a..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/framework/cordova.gradle +++ /dev/null @@ -1,205 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -import java.util.regex.Pattern -import groovy.swing.SwingBuilder - -String doEnsureValueExists(filePath, props, key) { - if (props.get(key) == null) { - throw new GradleException(filePath + ': Missing key required "' + key + '"') - } - return props.get(key) -} - -String doGetProjectTarget() { - def props = new Properties() - def propertiesFile = 'project.properties'; - if(!(file(propertiesFile).exists())) { - propertiesFile = '../project.properties'; - } - file(propertiesFile).withReader { reader -> - props.load(reader) - } - return doEnsureValueExists('project.properties', props, 'target') -} - -String[] getAvailableBuildTools() { - def buildToolsDir = new File(getAndroidSdkDir(), "build-tools") - buildToolsDir.list() - .findAll { it ==~ /[0-9.]+/ } - .sort { a, b -> compareVersions(b, a) } -} - -String doFindLatestInstalledBuildTools(String minBuildToolsVersion) { - def availableBuildToolsVersions - try { - availableBuildToolsVersions = getAvailableBuildTools() - } catch (e) { - println "An exception occurred while trying to find the Android build tools." - throw e - } - if (availableBuildToolsVersions.length > 0) { - def highestBuildToolsVersion = availableBuildToolsVersions[0] - if (compareVersions(highestBuildToolsVersion, minBuildToolsVersion) < 0) { - throw new RuntimeException( - "No usable Android build tools found. Highest installed version is " + - highestBuildToolsVersion + "; minimum version required is " + - minBuildToolsVersion + ".") - } - highestBuildToolsVersion - } else { - throw new RuntimeException( - "No installed build tools found. Install the Android build tools version " + - minBuildToolsVersion + " or higher.") - } -} - -// Return the first non-zero result of subtracting version list elements -// pairwise. If they are all identical, return the difference in length of -// the two lists. -int compareVersionList(Collection aParts, Collection bParts) { - def pairs = ([aParts, bParts]).transpose() - pairs.findResult(aParts.size()-bParts.size()) {it[0] - it[1] != 0 ? it[0] - it[1] : null} -} - -// Compare two version strings, such as "19.0.0" and "18.1.1.0". If all matched -// elements are identical, the longer version is the largest by this method. -// Examples: -// "19.0.0" > "19" -// "19.0.1" > "19.0.0" -// "19.1.0" > "19.0.1" -// "19" > "18.999.999" -int compareVersions(String a, String b) { - def aParts = a.tokenize('.').collect {it.toInteger()} - def bParts = b.tokenize('.').collect {it.toInteger()} - compareVersionList(aParts, bParts) -} - -String getAndroidSdkDir() { - def rootDir = project.rootDir - def androidSdkDir = null - String envVar = System.getenv("ANDROID_HOME") - def localProperties = new File(rootDir, 'local.properties') - String systemProperty = System.getProperty("android.home") - if (envVar != null) { - androidSdkDir = envVar - } else if (localProperties.exists()) { - Properties properties = new Properties() - localProperties.withInputStream { instr -> - properties.load(instr) - } - def sdkDirProp = properties.getProperty('sdk.dir') - if (sdkDirProp != null) { - androidSdkDir = sdkDirProp - } else { - sdkDirProp = properties.getProperty('android.dir') - if (sdkDirProp != null) { - androidSdkDir = (new File(rootDir, sdkDirProp)).getAbsolutePath() - } - } - } - if (androidSdkDir == null && systemProperty != null) { - androidSdkDir = systemProperty - } - if (androidSdkDir == null) { - throw new RuntimeException( - "Unable to determine Android SDK directory.") - } - androidSdkDir -} - -def doExtractIntFromManifest(name) { - def manifestFile = file(android.sourceSets.main.manifest.srcFile) - def pattern = Pattern.compile(name + "=\"(\\d+)\"") - def matcher = pattern.matcher(manifestFile.getText()) - matcher.find() - return new BigInteger(matcher.group(1)) -} - -def doExtractStringFromManifest(name) { - def manifestFile = file(android.sourceSets.main.manifest.srcFile) - def pattern = Pattern.compile(name + "=\"(\\S+)\"") - def matcher = pattern.matcher(manifestFile.getText()) - matcher.find() - return matcher.group(1) -} - -def doPromptForPassword(msg) { - if (System.console() == null) { - def ret = null - new SwingBuilder().edt { - dialog(modal: true, title: 'Enter password', alwaysOnTop: true, resizable: false, locationRelativeTo: null, pack: true, show: true) { - vbox { - label(text: msg) - def input = passwordField() - button(defaultButton: true, text: 'OK', actionPerformed: { - ret = input.password; - dispose(); - }) - } - } - } - if (!ret) { - throw new GradleException('User canceled build') - } - return new String(ret) - } else { - return System.console().readPassword('\n' + msg); - } -} - -def doGetConfigXml() { - def xml = file("src/main/res/xml/config.xml").getText() - // Disable namespace awareness since Cordova doesn't use them properly - return new XmlParser(false, false).parseText(xml) -} - -def doGetConfigPreference(name, defaultValue) { - name = name.toLowerCase() - def root = doGetConfigXml() - - def ret = defaultValue - root.preference.each { it -> - def attrName = it.attribute("name") - if (attrName && attrName.toLowerCase() == name) { - ret = it.attribute("value") - } - } - return ret -} - -// Properties exported here are visible to all plugins. -ext { - // These helpers are shared, but are not guaranteed to be stable / unchanged. - privateHelpers = {} - privateHelpers.getProjectTarget = { doGetProjectTarget() } - privateHelpers.findLatestInstalledBuildTools = { doFindLatestInstalledBuildTools('19.1.0') } - privateHelpers.extractIntFromManifest = { name -> doExtractIntFromManifest(name) } - privateHelpers.extractStringFromManifest = { name -> doExtractStringFromManifest(name) } - privateHelpers.promptForPassword = { msg -> doPromptForPassword(msg) } - privateHelpers.ensureValueExists = { filePath, props, key -> doEnsureValueExists(filePath, props, key) } - - // These helpers can be used by plugins / projects and will not change. - cdvHelpers = {} - // Returns a XmlParser for the config.xml. Added in 4.1.0. - cdvHelpers.getConfigXml = { doGetConfigXml() } - // Returns the value for the desired . Added in 4.1.0. - cdvHelpers.getConfigPreference = { name, defaultValue -> doGetConfigPreference(name, defaultValue) } -} - diff --git a/chabok-starter-cordova/node_modules/cordova-android/framework/gradle/wrapper/gradle-wrapper.properties b/chabok-starter-cordova/node_modules/cordova-android/framework/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index d4c7ae1..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/framework/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Thu Nov 09 10:50:25 PST 2017 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip diff --git a/chabok-starter-cordova/node_modules/cordova-android/framework/project.properties b/chabok-starter-cordova/node_modules/cordova-android/framework/project.properties deleted file mode 100644 index cbb644c..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/framework/project.properties +++ /dev/null @@ -1,11 +0,0 @@ -# This file was originally created by the Android Tools, but is now -# used by cordova-android to manage the project configuration. - -# Indicates whether an apk should be generated for each density. -split.density=false - -# Project target. -target=android-28 -apk-configurations= -renderscript.opt.level=O0 -android.library=true diff --git a/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/AuthenticationToken.java b/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/AuthenticationToken.java deleted file mode 100644 index d3a231a..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/AuthenticationToken.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ -package org.apache.cordova; - -/** - * The Class AuthenticationToken defines the userName and password to be used for authenticating a web resource - */ -public class AuthenticationToken { - private String userName; - private String password; - - /** - * Gets the user name. - * - * @return the user name - */ - public String getUserName() { - return userName; - } - - /** - * Sets the user name. - * - * @param userName - * the new user name - */ - public void setUserName(String userName) { - this.userName = userName; - } - - /** - * Gets the password. - * - * @return the password - */ - public String getPassword() { - return password; - } - - /** - * Sets the password. - * - * @param password - * the new password - */ - public void setPassword(String password) { - this.password = password; - } - - - - -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/BuildHelper.java b/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/BuildHelper.java deleted file mode 100644 index 6d9daa4..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/BuildHelper.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -package org.apache.cordova; - -/* - * This is a utility class that allows us to get the BuildConfig variable, which is required - * for the use of different providers. This is not guaranteed to work, and it's better for this - * to be set in the build step in config.xml - * - */ - -import android.app.Activity; -import android.content.Context; - -import java.lang.reflect.Field; - - -public class BuildHelper { - - - private static String TAG="BuildHelper"; - - /* - * This needs to be implemented if you wish to use the Camera Plugin or other plugins - * that read the Build Configuration. - * - * Thanks to Phil@Medtronic and Graham Borland for finding the answer and posting it to - * StackOverflow. This is annoying as hell! However, this method does not work with - * ProGuard, and you should use the config.xml to define the application_id - * - */ - - public static Object getBuildConfigValue(Context ctx, String key) - { - try - { - Class clazz = Class.forName(ctx.getPackageName() + ".BuildConfig"); - Field field = clazz.getField(key); - return field.get(null); - } catch (ClassNotFoundException e) { - LOG.d(TAG, "Unable to get the BuildConfig, is this built with ANT?"); - e.printStackTrace(); - } catch (NoSuchFieldException e) { - LOG.d(TAG, key + " is not a valid field. Check your build.gradle"); - } catch (IllegalAccessException e) { - LOG.d(TAG, "Illegal Access Exception: Let's print a stack trace."); - e.printStackTrace(); - } - - return null; - } - -} \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CallbackContext.java b/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CallbackContext.java deleted file mode 100644 index 4336386..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CallbackContext.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ -package org.apache.cordova; - -import org.json.JSONArray; - -import org.apache.cordova.CordovaWebView; -import org.apache.cordova.PluginResult; -import org.json.JSONObject; - -public class CallbackContext { - private static final String LOG_TAG = "CordovaPlugin"; - - private String callbackId; - private CordovaWebView webView; - protected boolean finished; - private int changingThreads; - - public CallbackContext(String callbackId, CordovaWebView webView) { - this.callbackId = callbackId; - this.webView = webView; - } - - public boolean isFinished() { - return finished; - } - - public boolean isChangingThreads() { - return changingThreads > 0; - } - - public String getCallbackId() { - return callbackId; - } - - public void sendPluginResult(PluginResult pluginResult) { - synchronized (this) { - if (finished) { - LOG.w(LOG_TAG, "Attempted to send a second callback for ID: " + callbackId + "\nResult was: " + pluginResult.getMessage()); - return; - } else { - finished = !pluginResult.getKeepCallback(); - } - } - webView.sendPluginResult(pluginResult, callbackId); - } - - /** - * Helper for success callbacks that just returns the Status.OK by default - * - * @param message The message to add to the success result. - */ - public void success(JSONObject message) { - sendPluginResult(new PluginResult(PluginResult.Status.OK, message)); - } - - /** - * Helper for success callbacks that just returns the Status.OK by default - * - * @param message The message to add to the success result. - */ - public void success(String message) { - sendPluginResult(new PluginResult(PluginResult.Status.OK, message)); - } - - /** - * Helper for success callbacks that just returns the Status.OK by default - * - * @param message The message to add to the success result. - */ - public void success(JSONArray message) { - sendPluginResult(new PluginResult(PluginResult.Status.OK, message)); - } - - /** - * Helper for success callbacks that just returns the Status.OK by default - * - * @param message The message to add to the success result. - */ - public void success(byte[] message) { - sendPluginResult(new PluginResult(PluginResult.Status.OK, message)); - } - - /** - * Helper for success callbacks that just returns the Status.OK by default - * - * @param message The message to add to the success result. - */ - public void success(int message) { - sendPluginResult(new PluginResult(PluginResult.Status.OK, message)); - } - - /** - * Helper for success callbacks that just returns the Status.OK by default - */ - public void success() { - sendPluginResult(new PluginResult(PluginResult.Status.OK)); - } - - /** - * Helper for error callbacks that just returns the Status.ERROR by default - * - * @param message The message to add to the error result. - */ - public void error(JSONObject message) { - sendPluginResult(new PluginResult(PluginResult.Status.ERROR, message)); - } - - /** - * Helper for error callbacks that just returns the Status.ERROR by default - * - * @param message The message to add to the error result. - */ - public void error(String message) { - sendPluginResult(new PluginResult(PluginResult.Status.ERROR, message)); - } - - /** - * Helper for error callbacks that just returns the Status.ERROR by default - * - * @param message The message to add to the error result. - */ - public void error(int message) { - sendPluginResult(new PluginResult(PluginResult.Status.ERROR, message)); - } -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CallbackMap.java b/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CallbackMap.java deleted file mode 100644 index 050daa0..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CallbackMap.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ -package org.apache.cordova; - -import android.util.Pair; -import android.util.SparseArray; - -/** - * Provides a collection that maps unique request codes to CordovaPlugins and Integers. - * Used to ensure that when plugins make requests for runtime permissions, those requests do not - * collide with requests from other plugins that use the same request code value. - */ -public class CallbackMap { - private int currentCallbackId = 0; - private SparseArray> callbacks; - - public CallbackMap() { - this.callbacks = new SparseArray>(); - } - - /** - * Stores a CordovaPlugin and request code and returns a new unique request code to use - * in a permission request. - * - * @param receiver The plugin that is making the request - * @param requestCode The original request code used by the plugin - * @return A unique request code that can be used to retrieve this callback - * with getAndRemoveCallback() - */ - public synchronized int registerCallback(CordovaPlugin receiver, int requestCode) { - int mappedId = this.currentCallbackId++; - callbacks.put(mappedId, new Pair(receiver, requestCode)); - return mappedId; - } - - /** - * Retrieves and removes a callback stored in the map using the mapped request code - * obtained from registerCallback() - * - * @param mappedId The request code obtained from registerCallback() - * @return The CordovaPlugin and orignal request code that correspond to the - * given mappedCode - */ - public synchronized Pair getAndRemoveCallback(int mappedId) { - Pair callback = callbacks.get(mappedId); - callbacks.remove(mappedId); - return callback; - } -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/Config.java b/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/Config.java deleted file mode 100644 index 0739795..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/Config.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -package org.apache.cordova; - -import java.util.List; - -import android.app.Activity; - -@Deprecated // Use Whitelist, CordovaPrefences, etc. directly. -public class Config { - private static final String TAG = "Config"; - - static ConfigXmlParser parser; - - private Config() { - } - - public static void init(Activity action) { - parser = new ConfigXmlParser(); - parser.parse(action); - //TODO: Add feature to bring this back. Some preferences should be overridden by intents, but not all - parser.getPreferences().setPreferencesBundle(action.getIntent().getExtras()); - } - - // Intended to be used for testing only; creates an empty configuration. - public static void init() { - if (parser == null) { - parser = new ConfigXmlParser(); - } - } - - public static String getStartUrl() { - if (parser == null) { - return "file:///android_asset/www/index.html"; - } - return parser.getLaunchUrl(); - } - - public static String getErrorUrl() { - return parser.getPreferences().getString("errorurl", null); - } - - public static List getPluginEntries() { - return parser.getPluginEntries(); - } - - public static CordovaPreferences getPreferences() { - return parser.getPreferences(); - } - - public static boolean isInitialized() { - return parser != null; - } -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/ConfigXmlParser.java b/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/ConfigXmlParser.java deleted file mode 100644 index 01a97f2..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/ConfigXmlParser.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -package org.apache.cordova; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Locale; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.xmlpull.v1.XmlPullParser; -import org.xmlpull.v1.XmlPullParserException; - -import android.content.Context; - -public class ConfigXmlParser { - private static String TAG = "ConfigXmlParser"; - - private String launchUrl = "file:///android_asset/www/index.html"; - private CordovaPreferences prefs = new CordovaPreferences(); - private ArrayList pluginEntries = new ArrayList(20); - - public CordovaPreferences getPreferences() { - return prefs; - } - - public ArrayList getPluginEntries() { - return pluginEntries; - } - - public String getLaunchUrl() { - return launchUrl; - } - - public void parse(Context action) { - // First checking the class namespace for config.xml - int id = action.getResources().getIdentifier("config", "xml", action.getClass().getPackage().getName()); - if (id == 0) { - // If we couldn't find config.xml there, we'll look in the namespace from AndroidManifest.xml - id = action.getResources().getIdentifier("config", "xml", action.getPackageName()); - if (id == 0) { - LOG.e(TAG, "res/xml/config.xml is missing!"); - return; - } - } - parse(action.getResources().getXml(id)); - } - - boolean insideFeature = false; - String service = "", pluginClass = "", paramType = ""; - boolean onload = false; - - public void parse(XmlPullParser xml) { - int eventType = -1; - - while (eventType != XmlPullParser.END_DOCUMENT) { - if (eventType == XmlPullParser.START_TAG) { - handleStartTag(xml); - } - else if (eventType == XmlPullParser.END_TAG) - { - handleEndTag(xml); - } - try { - eventType = xml.next(); - } catch (XmlPullParserException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - - public void handleStartTag(XmlPullParser xml) { - String strNode = xml.getName(); - if (strNode.equals("feature")) { - //Check for supported feature sets aka. plugins (Accelerometer, Geolocation, etc) - //Set the bit for reading params - insideFeature = true; - service = xml.getAttributeValue(null, "name"); - } - else if (insideFeature && strNode.equals("param")) { - paramType = xml.getAttributeValue(null, "name"); - if (paramType.equals("service")) // check if it is using the older service param - service = xml.getAttributeValue(null, "value"); - else if (paramType.equals("package") || paramType.equals("android-package")) - pluginClass = xml.getAttributeValue(null,"value"); - else if (paramType.equals("onload")) - onload = "true".equals(xml.getAttributeValue(null, "value")); - } - else if (strNode.equals("preference")) { - String name = xml.getAttributeValue(null, "name").toLowerCase(Locale.ENGLISH); - String value = xml.getAttributeValue(null, "value"); - prefs.set(name, value); - } - else if (strNode.equals("content")) { - String src = xml.getAttributeValue(null, "src"); - if (src != null) { - setStartUrl(src); - } - } - } - - public void handleEndTag(XmlPullParser xml) { - String strNode = xml.getName(); - if (strNode.equals("feature")) { - pluginEntries.add(new PluginEntry(service, pluginClass, onload)); - - service = ""; - pluginClass = ""; - insideFeature = false; - onload = false; - } - } - - private void setStartUrl(String src) { - Pattern schemeRegex = Pattern.compile("^[a-z-]+://"); - Matcher matcher = schemeRegex.matcher(src); - if (matcher.find()) { - launchUrl = src; - } else { - if (src.charAt(0) == '/') { - src = src.substring(1); - } - launchUrl = "file:///android_asset/www/" + src; - } - } -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CordovaActivity.java b/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CordovaActivity.java deleted file mode 100755 index f2f5619..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CordovaActivity.java +++ /dev/null @@ -1,521 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ -package org.apache.cordova; - -import java.util.ArrayList; -import java.util.Locale; - -import org.json.JSONException; -import org.json.JSONObject; - -import android.app.Activity; -import android.app.AlertDialog; -import android.annotation.SuppressLint; -import android.content.DialogInterface; -import android.content.Intent; -import android.content.res.Configuration; -import android.graphics.Color; -import android.media.AudioManager; -import android.os.Build; -import android.os.Bundle; -import android.view.Menu; -import android.view.MenuItem; -import android.view.View; -import android.view.ViewGroup; -import android.view.Window; -import android.view.WindowManager; -import android.webkit.WebViewClient; -import android.widget.FrameLayout; - -/** - * This class is the main Android activity that represents the Cordova - * application. It should be extended by the user to load the specific - * html file that contains the application. - * - * As an example: - * - *
- *     package org.apache.cordova.examples;
- *
- *     import android.os.Bundle;
- *     import org.apache.cordova.*;
- *
- *     public class Example extends CordovaActivity {
- *       @Override
- *       public void onCreate(Bundle savedInstanceState) {
- *         super.onCreate(savedInstanceState);
- *         super.init();
- *         // Load your application
- *         loadUrl(launchUrl);
- *       }
- *     }
- * 
- * - * Cordova xml configuration: Cordova uses a configuration file at - * res/xml/config.xml to specify its settings. See "The config.xml File" - * guide in cordova-docs at http://cordova.apache.org/docs for the documentation - * for the configuration. The use of the set*Property() methods is - * deprecated in favor of the config.xml file. - * - */ -public class CordovaActivity extends Activity { - public static String TAG = "CordovaActivity"; - - // The webview for our app - protected CordovaWebView appView; - - private static int ACTIVITY_STARTING = 0; - private static int ACTIVITY_RUNNING = 1; - private static int ACTIVITY_EXITING = 2; - - // Keep app running when pause is received. (default = true) - // If true, then the JavaScript and native code continue to run in the background - // when another application (activity) is started. - protected boolean keepRunning = true; - - // Flag to keep immersive mode if set to fullscreen - protected boolean immersiveMode; - - // Read from config.xml: - protected CordovaPreferences preferences; - protected String launchUrl; - protected ArrayList pluginEntries; - protected CordovaInterfaceImpl cordovaInterface; - - /** - * Called when the activity is first created. - */ - @Override - public void onCreate(Bundle savedInstanceState) { - // need to activate preferences before super.onCreate to avoid "requestFeature() must be called before adding content" exception - loadConfig(); - - String logLevel = preferences.getString("loglevel", "ERROR"); - LOG.setLogLevel(logLevel); - - LOG.i(TAG, "Apache Cordova native platform version " + CordovaWebView.CORDOVA_VERSION + " is starting"); - LOG.d(TAG, "CordovaActivity.onCreate()"); - - if (!preferences.getBoolean("ShowTitle", false)) { - getWindow().requestFeature(Window.FEATURE_NO_TITLE); - } - - if (preferences.getBoolean("SetFullscreen", false)) { - LOG.d(TAG, "The SetFullscreen configuration is deprecated in favor of Fullscreen, and will be removed in a future version."); - preferences.set("Fullscreen", true); - } - if (preferences.getBoolean("Fullscreen", false)) { - // NOTE: use the FullscreenNotImmersive configuration key to set the activity in a REAL full screen - // (as was the case in previous cordova versions) - if (!preferences.getBoolean("FullscreenNotImmersive", false)) { - immersiveMode = true; - } else { - getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, - WindowManager.LayoutParams.FLAG_FULLSCREEN); - } - } else { - getWindow().setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN, - WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN); - } - - super.onCreate(savedInstanceState); - - cordovaInterface = makeCordovaInterface(); - if (savedInstanceState != null) { - cordovaInterface.restoreInstanceState(savedInstanceState); - } - } - - protected void init() { - appView = makeWebView(); - createViews(); - if (!appView.isInitialized()) { - appView.init(cordovaInterface, pluginEntries, preferences); - } - cordovaInterface.onCordovaInit(appView.getPluginManager()); - - // Wire the hardware volume controls to control media if desired. - String volumePref = preferences.getString("DefaultVolumeStream", ""); - if ("media".equals(volumePref.toLowerCase(Locale.ENGLISH))) { - setVolumeControlStream(AudioManager.STREAM_MUSIC); - } - } - - @SuppressWarnings("deprecation") - protected void loadConfig() { - ConfigXmlParser parser = new ConfigXmlParser(); - parser.parse(this); - preferences = parser.getPreferences(); - preferences.setPreferencesBundle(getIntent().getExtras()); - launchUrl = parser.getLaunchUrl(); - pluginEntries = parser.getPluginEntries(); - Config.parser = parser; - } - - //Suppressing warnings in AndroidStudio - @SuppressWarnings({"deprecation", "ResourceType"}) - protected void createViews() { - //Why are we setting a constant as the ID? This should be investigated - appView.getView().setId(100); - appView.getView().setLayoutParams(new FrameLayout.LayoutParams( - ViewGroup.LayoutParams.MATCH_PARENT, - ViewGroup.LayoutParams.MATCH_PARENT)); - - setContentView(appView.getView()); - - if (preferences.contains("BackgroundColor")) { - try { - int backgroundColor = preferences.getInteger("BackgroundColor", Color.BLACK); - // Background of activity: - appView.getView().setBackgroundColor(backgroundColor); - } - catch (NumberFormatException e){ - e.printStackTrace(); - } - } - - appView.getView().requestFocusFromTouch(); - } - - /** - * Construct the default web view object. - *

- * Override this to customize the webview that is used. - */ - protected CordovaWebView makeWebView() { - return new CordovaWebViewImpl(makeWebViewEngine()); - } - - protected CordovaWebViewEngine makeWebViewEngine() { - return CordovaWebViewImpl.createEngine(this, preferences); - } - - protected CordovaInterfaceImpl makeCordovaInterface() { - return new CordovaInterfaceImpl(this) { - @Override - public Object onMessage(String id, Object data) { - // Plumb this to CordovaActivity.onMessage for backwards compatibility - return CordovaActivity.this.onMessage(id, data); - } - }; - } - - /** - * Load the url into the webview. - */ - public void loadUrl(String url) { - if (appView == null) { - init(); - } - - // If keepRunning - this.keepRunning = preferences.getBoolean("KeepRunning", true); - - appView.loadUrlIntoView(url, true); - } - - /** - * Called when the system is about to start resuming a previous activity. - */ - @Override - protected void onPause() { - super.onPause(); - LOG.d(TAG, "Paused the activity."); - - if (this.appView != null) { - // CB-9382 If there is an activity that started for result and main activity is waiting for callback - // result, we shoudn't stop WebView Javascript timers, as activity for result might be using them - boolean keepRunning = this.keepRunning || this.cordovaInterface.activityResultCallback != null; - this.appView.handlePause(keepRunning); - } - } - - /** - * Called when the activity receives a new intent - */ - @Override - protected void onNewIntent(Intent intent) { - super.onNewIntent(intent); - //Forward to plugins - if (this.appView != null) - this.appView.onNewIntent(intent); - } - - /** - * Called when the activity will start interacting with the user. - */ - @Override - protected void onResume() { - super.onResume(); - LOG.d(TAG, "Resumed the activity."); - - if (this.appView == null) { - return; - } - if (! this.getWindow().getDecorView().hasFocus()) { - // Force window to have focus, so application always - // receive user input. Workaround for some devices (Samsung Galaxy Note 3 at least) - this.getWindow().getDecorView().requestFocus(); - } - - this.appView.handleResume(this.keepRunning); - } - - /** - * Called when the activity is no longer visible to the user. - */ - @Override - protected void onStop() { - super.onStop(); - LOG.d(TAG, "Stopped the activity."); - - if (this.appView == null) { - return; - } - this.appView.handleStop(); - } - - /** - * Called when the activity is becoming visible to the user. - */ - @Override - protected void onStart() { - super.onStart(); - LOG.d(TAG, "Started the activity."); - - if (this.appView == null) { - return; - } - this.appView.handleStart(); - } - - /** - * The final call you receive before your activity is destroyed. - */ - @Override - public void onDestroy() { - LOG.d(TAG, "CordovaActivity.onDestroy()"); - super.onDestroy(); - - if (this.appView != null) { - appView.handleDestroy(); - } - } - - /** - * Called when view focus is changed - */ - @SuppressLint("InlinedApi") - @Override - public void onWindowFocusChanged(boolean hasFocus) { - super.onWindowFocusChanged(hasFocus); - if (hasFocus && immersiveMode) { - final int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE - | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION - | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN - | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION - | View.SYSTEM_UI_FLAG_FULLSCREEN - | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; - - getWindow().getDecorView().setSystemUiVisibility(uiOptions); - } - } - - @SuppressLint("NewApi") - @Override - public void startActivityForResult(Intent intent, int requestCode, Bundle options) { - // Capture requestCode here so that it is captured in the setActivityResultCallback() case. - cordovaInterface.setActivityResultRequestCode(requestCode); - super.startActivityForResult(intent, requestCode, options); - } - - /** - * Called when an activity you launched exits, giving you the requestCode you started it with, - * the resultCode it returned, and any additional data from it. - * - * @param requestCode The request code originally supplied to startActivityForResult(), - * allowing you to identify who this result came from. - * @param resultCode The integer result code returned by the child activity through its setResult(). - * @param intent An Intent, which can return result data to the caller (various data can be attached to Intent "extras"). - */ - @Override - protected void onActivityResult(int requestCode, int resultCode, Intent intent) { - LOG.d(TAG, "Incoming Result. Request code = " + requestCode); - super.onActivityResult(requestCode, resultCode, intent); - cordovaInterface.onActivityResult(requestCode, resultCode, intent); - } - - /** - * Report an error to the host application. These errors are unrecoverable (i.e. the main resource is unavailable). - * The errorCode parameter corresponds to one of the ERROR_* constants. - * - * @param errorCode The error code corresponding to an ERROR_* value. - * @param description A String describing the error. - * @param failingUrl The url that failed to load. - */ - public void onReceivedError(final int errorCode, final String description, final String failingUrl) { - final CordovaActivity me = this; - - // If errorUrl specified, then load it - final String errorUrl = preferences.getString("errorUrl", null); - if ((errorUrl != null) && (!failingUrl.equals(errorUrl)) && (appView != null)) { - // Load URL on UI thread - me.runOnUiThread(new Runnable() { - public void run() { - me.appView.showWebPage(errorUrl, false, true, null); - } - }); - } - // If not, then display error dialog - else { - final boolean exit = !(errorCode == WebViewClient.ERROR_HOST_LOOKUP); - me.runOnUiThread(new Runnable() { - public void run() { - if (exit) { - me.appView.getView().setVisibility(View.GONE); - me.displayError("Application Error", description + " (" + failingUrl + ")", "OK", exit); - } - } - }); - } - } - - /** - * Display an error dialog and optionally exit application. - */ - public void displayError(final String title, final String message, final String button, final boolean exit) { - final CordovaActivity me = this; - me.runOnUiThread(new Runnable() { - public void run() { - try { - AlertDialog.Builder dlg = new AlertDialog.Builder(me); - dlg.setMessage(message); - dlg.setTitle(title); - dlg.setCancelable(false); - dlg.setPositiveButton(button, - new AlertDialog.OnClickListener() { - public void onClick(DialogInterface dialog, int which) { - dialog.dismiss(); - if (exit) { - finish(); - } - } - }); - dlg.create(); - dlg.show(); - } catch (Exception e) { - finish(); - } - } - }); - } - - /* - * Hook in Cordova for menu plugins - */ - @Override - public boolean onCreateOptionsMenu(Menu menu) { - if (appView != null) { - appView.getPluginManager().postMessage("onCreateOptionsMenu", menu); - } - return super.onCreateOptionsMenu(menu); - } - - @Override - public boolean onPrepareOptionsMenu(Menu menu) { - if (appView != null) { - appView.getPluginManager().postMessage("onPrepareOptionsMenu", menu); - } - return true; - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - if (appView != null) { - appView.getPluginManager().postMessage("onOptionsItemSelected", item); - } - return true; - } - - /** - * Called when a message is sent to plugin. - * - * @param id The message id - * @param data The message data - * @return Object or null - */ - public Object onMessage(String id, Object data) { - if ("onReceivedError".equals(id)) { - JSONObject d = (JSONObject) data; - try { - this.onReceivedError(d.getInt("errorCode"), d.getString("description"), d.getString("url")); - } catch (JSONException e) { - e.printStackTrace(); - } - } else if ("exit".equals(id)) { - finish(); - } - return null; - } - - protected void onSaveInstanceState(Bundle outState) { - cordovaInterface.onSaveInstanceState(outState); - super.onSaveInstanceState(outState); - } - - /** - * Called by the system when the device configuration changes while your activity is running. - * - * @param newConfig The new device configuration - */ - @Override - public void onConfigurationChanged(Configuration newConfig) { - super.onConfigurationChanged(newConfig); - if (this.appView == null) { - return; - } - PluginManager pm = this.appView.getPluginManager(); - if (pm != null) { - pm.onConfigurationChanged(newConfig); - } - } - - /** - * Called by the system when the user grants permissions - * - * @param requestCode - * @param permissions - * @param grantResults - */ - @Override - public void onRequestPermissionsResult(int requestCode, String permissions[], - int[] grantResults) { - try - { - cordovaInterface.onRequestPermissionResult(requestCode, permissions, grantResults); - } - catch (JSONException e) - { - LOG.d(TAG, "JSONException: Parameters fed into the method are not valid"); - e.printStackTrace(); - } - - } - -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CordovaArgs.java b/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CordovaArgs.java deleted file mode 100644 index d40d26e..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CordovaArgs.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ -package org.apache.cordova; - -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; - -import android.util.Base64; - -public class CordovaArgs { - private JSONArray baseArgs; - - public CordovaArgs(JSONArray args) { - this.baseArgs = args; - } - - - // Pass through the basics to the base args. - public Object get(int index) throws JSONException { - return baseArgs.get(index); - } - - public boolean getBoolean(int index) throws JSONException { - return baseArgs.getBoolean(index); - } - - public double getDouble(int index) throws JSONException { - return baseArgs.getDouble(index); - } - - public int getInt(int index) throws JSONException { - return baseArgs.getInt(index); - } - - public JSONArray getJSONArray(int index) throws JSONException { - return baseArgs.getJSONArray(index); - } - - public JSONObject getJSONObject(int index) throws JSONException { - return baseArgs.getJSONObject(index); - } - - public long getLong(int index) throws JSONException { - return baseArgs.getLong(index); - } - - public String getString(int index) throws JSONException { - return baseArgs.getString(index); - } - - - public Object opt(int index) { - return baseArgs.opt(index); - } - - public boolean optBoolean(int index) { - return baseArgs.optBoolean(index); - } - - public double optDouble(int index) { - return baseArgs.optDouble(index); - } - - public int optInt(int index) { - return baseArgs.optInt(index); - } - - public JSONArray optJSONArray(int index) { - return baseArgs.optJSONArray(index); - } - - public JSONObject optJSONObject(int index) { - return baseArgs.optJSONObject(index); - } - - public long optLong(int index) { - return baseArgs.optLong(index); - } - - public String optString(int index) { - return baseArgs.optString(index); - } - - public boolean isNull(int index) { - return baseArgs.isNull(index); - } - - - // The interesting custom helpers. - public byte[] getArrayBuffer(int index) throws JSONException { - String encoded = baseArgs.getString(index); - return Base64.decode(encoded, Base64.DEFAULT); - } -} - - diff --git a/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CordovaBridge.java b/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CordovaBridge.java deleted file mode 100644 index 28c407f..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CordovaBridge.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ -package org.apache.cordova; - -import android.annotation.SuppressLint; - -import java.security.SecureRandom; - -import org.json.JSONArray; -import org.json.JSONException; - -/** - * Contains APIs that the JS can call. All functions in here should also have - * an equivalent entry in CordovaChromeClient.java, and be added to - * cordova-js/lib/android/plugin/android/promptbasednativeapi.js - */ -public class CordovaBridge { - private static final String LOG_TAG = "CordovaBridge"; - private PluginManager pluginManager; - private NativeToJsMessageQueue jsMessageQueue; - private volatile int expectedBridgeSecret = -1; // written by UI thread, read by JS thread. - - public CordovaBridge(PluginManager pluginManager, NativeToJsMessageQueue jsMessageQueue) { - this.pluginManager = pluginManager; - this.jsMessageQueue = jsMessageQueue; - } - - public String jsExec(int bridgeSecret, String service, String action, String callbackId, String arguments) throws JSONException, IllegalAccessException { - if (!verifySecret("exec()", bridgeSecret)) { - return null; - } - // If the arguments weren't received, send a message back to JS. It will switch bridge modes and try again. See CB-2666. - // We send a message meant specifically for this case. It starts with "@" so no other message can be encoded into the same string. - if (arguments == null) { - return "@Null arguments."; - } - - jsMessageQueue.setPaused(true); - try { - // Tell the resourceApi what thread the JS is running on. - CordovaResourceApi.jsThread = Thread.currentThread(); - - pluginManager.exec(service, action, callbackId, arguments); - String ret = null; - if (!NativeToJsMessageQueue.DISABLE_EXEC_CHAINING) { - ret = jsMessageQueue.popAndEncode(false); - } - return ret; - } catch (Throwable e) { - e.printStackTrace(); - return ""; - } finally { - jsMessageQueue.setPaused(false); - } - } - - public void jsSetNativeToJsBridgeMode(int bridgeSecret, int value) throws IllegalAccessException { - if (!verifySecret("setNativeToJsBridgeMode()", bridgeSecret)) { - return; - } - jsMessageQueue.setBridgeMode(value); - } - - public String jsRetrieveJsMessages(int bridgeSecret, boolean fromOnlineEvent) throws IllegalAccessException { - if (!verifySecret("retrieveJsMessages()", bridgeSecret)) { - return null; - } - return jsMessageQueue.popAndEncode(fromOnlineEvent); - } - - private boolean verifySecret(String action, int bridgeSecret) throws IllegalAccessException { - if (!jsMessageQueue.isBridgeEnabled()) { - if (bridgeSecret == -1) { - LOG.d(LOG_TAG, action + " call made before bridge was enabled."); - } else { - LOG.d(LOG_TAG, "Ignoring " + action + " from previous page load."); - } - return false; - } - // Bridge secret wrong and bridge not due to it being from the previous page. - if (expectedBridgeSecret < 0 || bridgeSecret != expectedBridgeSecret) { - LOG.e(LOG_TAG, "Bridge access attempt with wrong secret token, possibly from malicious code. Disabling exec() bridge!"); - clearBridgeSecret(); - throw new IllegalAccessException(); - } - return true; - } - - /** Called on page transitions */ - void clearBridgeSecret() { - expectedBridgeSecret = -1; - } - - public boolean isSecretEstablished() { - return expectedBridgeSecret != -1; - } - - /** Called by cordova.js to initialize the bridge. */ - //On old Androids SecureRandom isn't really secure, this is the least of your problems if - //you're running Android 4.3 and below in 2017 - @SuppressLint("TrulyRandom") - int generateBridgeSecret() { - SecureRandom randGen = new SecureRandom(); - expectedBridgeSecret = randGen.nextInt(Integer.MAX_VALUE); - return expectedBridgeSecret; - } - - public void reset() { - jsMessageQueue.reset(); - clearBridgeSecret(); - } - - public String promptOnJsPrompt(String origin, String message, String defaultValue) { - if (defaultValue != null && defaultValue.length() > 3 && defaultValue.startsWith("gap:")) { - JSONArray array; - try { - array = new JSONArray(defaultValue.substring(4)); - int bridgeSecret = array.getInt(0); - String service = array.getString(1); - String action = array.getString(2); - String callbackId = array.getString(3); - String r = jsExec(bridgeSecret, service, action, callbackId, message); - return r == null ? "" : r; - } catch (JSONException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - return ""; - } - // Sets the native->JS bridge mode. - else if (defaultValue != null && defaultValue.startsWith("gap_bridge_mode:")) { - try { - int bridgeSecret = Integer.parseInt(defaultValue.substring(16)); - jsSetNativeToJsBridgeMode(bridgeSecret, Integer.parseInt(message)); - } catch (NumberFormatException e){ - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - return ""; - } - // Polling for JavaScript messages - else if (defaultValue != null && defaultValue.startsWith("gap_poll:")) { - int bridgeSecret = Integer.parseInt(defaultValue.substring(9)); - try { - String r = jsRetrieveJsMessages(bridgeSecret, "1".equals(message)); - return r == null ? "" : r; - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - return ""; - } - else if (defaultValue != null && defaultValue.startsWith("gap_init:")) { - // Protect against random iframes being able to talk through the bridge. - // Trust only pages which the app would have been allowed to navigate to anyway. - if (pluginManager.shouldAllowBridgeAccess(origin)) { - // Enable the bridge - int bridgeMode = Integer.parseInt(defaultValue.substring(9)); - jsMessageQueue.setBridgeMode(bridgeMode); - // Tell JS the bridge secret. - int secret = generateBridgeSecret(); - return ""+secret; - } else { - LOG.e(LOG_TAG, "gap_init called from restricted origin: " + origin); - } - return ""; - } - return null; - } -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CordovaClientCertRequest.java b/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CordovaClientCertRequest.java deleted file mode 100644 index ccda027..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CordovaClientCertRequest.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ -package org.apache.cordova; - -import java.security.Principal; -import java.security.PrivateKey; -import java.security.cert.X509Certificate; - -import android.annotation.SuppressLint; -import android.webkit.ClientCertRequest; - -/** - * Implementation of the ICordovaClientCertRequest for Android WebView. - * - */ -public class CordovaClientCertRequest implements ICordovaClientCertRequest { - - private final ClientCertRequest request; - - public CordovaClientCertRequest(ClientCertRequest request) { - this.request = request; - } - - /** - * Cancel this request - */ - @SuppressLint("NewApi") - public void cancel() - { - request.cancel(); - } - - /* - * Returns the host name of the server requesting the certificate. - */ - @SuppressLint("NewApi") - public String getHost() - { - return request.getHost(); - } - - /* - * Returns the acceptable types of asymmetric keys (can be null). - */ - @SuppressLint("NewApi") - public String[] getKeyTypes() - { - return request.getKeyTypes(); - } - - /* - * Returns the port number of the server requesting the certificate. - */ - @SuppressLint("NewApi") - public int getPort() - { - return request.getPort(); - } - - /* - * Returns the acceptable certificate issuers for the certificate matching the private key (can be null). - */ - @SuppressLint("NewApi") - public Principal[] getPrincipals() - { - return request.getPrincipals(); - } - - /* - * Ignore the request for now. Do not remember user's choice. - */ - @SuppressLint("NewApi") - public void ignore() - { - request.ignore(); - } - - /* - * Proceed with the specified private key and client certificate chain. Remember the user's positive choice and use it for future requests. - * - * @param privateKey The privateKey - * @param chain The certificate chain - */ - @SuppressLint("NewApi") - public void proceed(PrivateKey privateKey, X509Certificate[] chain) - { - request.proceed(privateKey, chain); - } -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CordovaDialogsHelper.java b/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CordovaDialogsHelper.java deleted file mode 100644 index a219c99..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CordovaDialogsHelper.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ -package org.apache.cordova; - -import android.app.AlertDialog; -import android.content.Context; -import android.content.DialogInterface; -import android.view.KeyEvent; -import android.widget.EditText; - -/** - * Helper class for WebViews to implement prompt(), alert(), confirm() dialogs. - */ -public class CordovaDialogsHelper { - private final Context context; - private AlertDialog lastHandledDialog; - - public CordovaDialogsHelper(Context context) { - this.context = context; - } - - public void showAlert(String message, final Result result) { - AlertDialog.Builder dlg = new AlertDialog.Builder(context); - dlg.setMessage(message); - dlg.setTitle("Alert"); - //Don't let alerts break the back button - dlg.setCancelable(true); - dlg.setPositiveButton(android.R.string.ok, - new AlertDialog.OnClickListener() { - public void onClick(DialogInterface dialog, int which) { - result.gotResult(true, null); - } - }); - dlg.setOnCancelListener( - new DialogInterface.OnCancelListener() { - public void onCancel(DialogInterface dialog) { - result.gotResult(false, null); - } - }); - dlg.setOnKeyListener(new DialogInterface.OnKeyListener() { - //DO NOTHING - public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) { - if (keyCode == KeyEvent.KEYCODE_BACK) - { - result.gotResult(true, null); - return false; - } - else - return true; - } - }); - lastHandledDialog = dlg.show(); - } - - public void showConfirm(String message, final Result result) { - AlertDialog.Builder dlg = new AlertDialog.Builder(context); - dlg.setMessage(message); - dlg.setTitle("Confirm"); - dlg.setCancelable(true); - dlg.setPositiveButton(android.R.string.ok, - new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int which) { - result.gotResult(true, null); - } - }); - dlg.setNegativeButton(android.R.string.cancel, - new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int which) { - result.gotResult(false, null); - } - }); - dlg.setOnCancelListener( - new DialogInterface.OnCancelListener() { - public void onCancel(DialogInterface dialog) { - result.gotResult(false, null); - } - }); - dlg.setOnKeyListener(new DialogInterface.OnKeyListener() { - //DO NOTHING - public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) { - if (keyCode == KeyEvent.KEYCODE_BACK) - { - result.gotResult(false, null); - return false; - } - else - return true; - } - }); - lastHandledDialog = dlg.show(); - } - - /** - * Tell the client to display a prompt dialog to the user. - * If the client returns true, WebView will assume that the client will - * handle the prompt dialog and call the appropriate JsPromptResult method. - * - * Since we are hacking prompts for our own purposes, we should not be using them for - * this purpose, perhaps we should hack console.log to do this instead! - */ - public void showPrompt(String message, String defaultValue, final Result result) { - // Returning false would also show a dialog, but the default one shows the origin (ugly). - AlertDialog.Builder dlg = new AlertDialog.Builder(context); - dlg.setMessage(message); - final EditText input = new EditText(context); - if (defaultValue != null) { - input.setText(defaultValue); - } - dlg.setView(input); - dlg.setCancelable(false); - dlg.setPositiveButton(android.R.string.ok, - new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int which) { - String userText = input.getText().toString(); - result.gotResult(true, userText); - } - }); - dlg.setNegativeButton(android.R.string.cancel, - new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int which) { - result.gotResult(false, null); - } - }); - lastHandledDialog = dlg.show(); - } - - public void destroyLastDialog(){ - if (lastHandledDialog != null){ - lastHandledDialog.cancel(); - } - } - - public interface Result { - public void gotResult(boolean success, String value); - } -} \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CordovaHttpAuthHandler.java b/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CordovaHttpAuthHandler.java deleted file mode 100644 index 724381e..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CordovaHttpAuthHandler.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ -package org.apache.cordova; - -import android.webkit.HttpAuthHandler; - -/** - * Specifies interface for HTTP auth handler object which is used to handle auth requests and - * specifying user credentials. - */ -public class CordovaHttpAuthHandler implements ICordovaHttpAuthHandler { - - private final HttpAuthHandler handler; - - public CordovaHttpAuthHandler(HttpAuthHandler handler) { - this.handler = handler; - } - - /** - * Instructs the WebView to cancel the authentication request. - */ - public void cancel () { - this.handler.cancel(); - } - - /** - * Instructs the WebView to proceed with the authentication with the given credentials. - * - * @param username - * @param password - */ - public void proceed (String username, String password) { - this.handler.proceed(username, password); - } -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CordovaInterface.java b/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CordovaInterface.java deleted file mode 100755 index ff90683..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CordovaInterface.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ -package org.apache.cordova; - -import android.app.Activity; -import android.content.Context; -import android.content.Intent; - -import org.apache.cordova.CordovaPlugin; - -import java.util.concurrent.ExecutorService; - -/** - * The Activity interface that is implemented by CordovaActivity. - * It is used to isolate plugin development, and remove dependency on entire Cordova library. - */ -public interface CordovaInterface { - - /** - * Launch an activity for which you would like a result when it finished. When this activity exits, - * your onActivityResult() method will be called. - * - * @param command The command object - * @param intent The intent to start - * @param requestCode The request code that is passed to callback to identify the activity - */ - abstract public void startActivityForResult(CordovaPlugin command, Intent intent, int requestCode); - - /** - * Set the plugin to be called when a sub-activity exits. - * - * @param plugin The plugin on which onActivityResult is to be called - */ - abstract public void setActivityResultCallback(CordovaPlugin plugin); - - /** - * Get the Android activity. - * - * If a custom engine lives outside of the Activity's lifecycle the return value may be null. - * - * @return the Activity - */ - public abstract Activity getActivity(); - - /** - * Get the Android context. - * - * @return the Context - */ - public Context getContext(); - - /** - * Called when a message is sent to plugin. - * - * @param id The message id - * @param data The message data - * @return Object or null - */ - public Object onMessage(String id, Object data); - - /** - * Returns a shared thread pool that can be used for background tasks. - */ - public ExecutorService getThreadPool(); - - /** - * Sends a permission request to the activity for one permission. - */ - public void requestPermission(CordovaPlugin plugin, int requestCode, String permission); - - /** - * Sends a permission request to the activity for a group of permissions - */ - public void requestPermissions(CordovaPlugin plugin, int requestCode, String [] permissions); - - /** - * Check for a permission. Returns true if the permission is granted, false otherwise. - */ - public boolean hasPermission(String permission); - -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CordovaInterfaceImpl.java b/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CordovaInterfaceImpl.java deleted file mode 100644 index 9a6e924..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CordovaInterfaceImpl.java +++ /dev/null @@ -1,249 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -package org.apache.cordova; - -import android.annotation.SuppressLint; -import android.app.Activity; -import android.content.Context; -import android.content.Intent; -import android.content.pm.PackageManager; -import android.os.Build; -import android.os.Bundle; -import android.util.Pair; - -import org.json.JSONException; -import org.json.JSONObject; - -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - -/** - * Default implementation of CordovaInterface. - */ -public class CordovaInterfaceImpl implements CordovaInterface { - private static final String TAG = "CordovaInterfaceImpl"; - protected Activity activity; - protected ExecutorService threadPool; - protected PluginManager pluginManager; - - protected ActivityResultHolder savedResult; - protected CallbackMap permissionResultCallbacks; - protected CordovaPlugin activityResultCallback; - protected String initCallbackService; - protected int activityResultRequestCode; - protected boolean activityWasDestroyed = false; - protected Bundle savedPluginState; - - public CordovaInterfaceImpl(Activity activity) { - this(activity, Executors.newCachedThreadPool()); - } - - public CordovaInterfaceImpl(Activity activity, ExecutorService threadPool) { - this.activity = activity; - this.threadPool = threadPool; - this.permissionResultCallbacks = new CallbackMap(); - } - - @Override - public void startActivityForResult(CordovaPlugin command, Intent intent, int requestCode) { - setActivityResultCallback(command); - try { - activity.startActivityForResult(intent, requestCode); - } catch (RuntimeException e) { // E.g.: ActivityNotFoundException - activityResultCallback = null; - throw e; - } - } - - @Override - public void setActivityResultCallback(CordovaPlugin plugin) { - // Cancel any previously pending activity. - if (activityResultCallback != null) { - activityResultCallback.onActivityResult(activityResultRequestCode, Activity.RESULT_CANCELED, null); - } - activityResultCallback = plugin; - } - - @Override - public Activity getActivity() { - return activity; - } - - @Override - public Context getContext() { - return activity; - } - - @Override - public Object onMessage(String id, Object data) { - if ("exit".equals(id)) { - activity.finish(); - } - return null; - } - - @Override - public ExecutorService getThreadPool() { - return threadPool; - } - - /** - * Dispatches any pending onActivityResult callbacks and sends the resume event if the - * Activity was destroyed by the OS. - */ - public void onCordovaInit(PluginManager pluginManager) { - this.pluginManager = pluginManager; - if (savedResult != null) { - onActivityResult(savedResult.requestCode, savedResult.resultCode, savedResult.intent); - } else if(activityWasDestroyed) { - // If there was no Activity result, we still need to send out the resume event if the - // Activity was destroyed by the OS - activityWasDestroyed = false; - if(pluginManager != null) - { - CoreAndroid appPlugin = (CoreAndroid) pluginManager.getPlugin(CoreAndroid.PLUGIN_NAME); - if(appPlugin != null) { - JSONObject obj = new JSONObject(); - try { - obj.put("action", "resume"); - } catch (JSONException e) { - LOG.e(TAG, "Failed to create event message", e); - } - appPlugin.sendResumeEvent(new PluginResult(PluginResult.Status.OK, obj)); - } - } - - } - } - - /** - * Routes the result to the awaiting plugin. Returns false if no plugin was waiting. - */ - public boolean onActivityResult(int requestCode, int resultCode, Intent intent) { - CordovaPlugin callback = activityResultCallback; - if(callback == null && initCallbackService != null) { - // The application was restarted, but had defined an initial callback - // before being shut down. - savedResult = new ActivityResultHolder(requestCode, resultCode, intent); - if (pluginManager != null) { - callback = pluginManager.getPlugin(initCallbackService); - if(callback != null) { - callback.onRestoreStateForActivityResult(savedPluginState.getBundle(callback.getServiceName()), - new ResumeCallback(callback.getServiceName(), pluginManager)); - } - } - } - activityResultCallback = null; - - if (callback != null) { - LOG.d(TAG, "Sending activity result to plugin"); - initCallbackService = null; - savedResult = null; - callback.onActivityResult(requestCode, resultCode, intent); - return true; - } - LOG.w(TAG, "Got an activity result, but no plugin was registered to receive it" + (savedResult != null ? " yet!" : ".")); - return false; - } - - /** - * Call this from your startActivityForResult() overload. This is required to catch the case - * where plugins use Activity.startActivityForResult() + CordovaInterface.setActivityResultCallback() - * rather than CordovaInterface.startActivityForResult(). - */ - public void setActivityResultRequestCode(int requestCode) { - activityResultRequestCode = requestCode; - } - - /** - * Saves parameters for startActivityForResult(). - */ - public void onSaveInstanceState(Bundle outState) { - if (activityResultCallback != null) { - String serviceName = activityResultCallback.getServiceName(); - outState.putString("callbackService", serviceName); - } - if(pluginManager != null){ - outState.putBundle("plugin", pluginManager.onSaveInstanceState()); - } - - } - - /** - * Call this from onCreate() so that any saved startActivityForResult parameters will be restored. - */ - public void restoreInstanceState(Bundle savedInstanceState) { - initCallbackService = savedInstanceState.getString("callbackService"); - savedPluginState = savedInstanceState.getBundle("plugin"); - activityWasDestroyed = true; - } - - private static class ActivityResultHolder { - private int requestCode; - private int resultCode; - private Intent intent; - - public ActivityResultHolder(int requestCode, int resultCode, Intent intent) { - this.requestCode = requestCode; - this.resultCode = resultCode; - this.intent = intent; - } - } - - /** - * Called by the system when the user grants permissions - * - * @param requestCode - * @param permissions - * @param grantResults - */ - public void onRequestPermissionResult(int requestCode, String[] permissions, - int[] grantResults) throws JSONException { - Pair callback = permissionResultCallbacks.getAndRemoveCallback(requestCode); - if(callback != null) { - callback.first.onRequestPermissionResult(callback.second, permissions, grantResults); - } - } - - public void requestPermission(CordovaPlugin plugin, int requestCode, String permission) { - String[] permissions = new String [1]; - permissions[0] = permission; - requestPermissions(plugin, requestCode, permissions); - } - - @SuppressLint("NewApi") - public void requestPermissions(CordovaPlugin plugin, int requestCode, String [] permissions) { - int mappedRequestCode = permissionResultCallbacks.registerCallback(plugin, requestCode); - getActivity().requestPermissions(permissions, mappedRequestCode); - } - - public boolean hasPermission(String permission) - { - if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) - { - int result = activity.checkSelfPermission(permission); - return PackageManager.PERMISSION_GRANTED == result; - } - else - { - return true; - } - } -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CordovaPlugin.java b/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CordovaPlugin.java deleted file mode 100644 index 41af1db..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/framework/src/org/apache/cordova/CordovaPlugin.java +++ /dev/null @@ -1,422 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ -package org.apache.cordova; - -import org.apache.cordova.CordovaArgs; -import org.apache.cordova.CordovaWebView; -import org.apache.cordova.CordovaInterface; -import org.apache.cordova.CallbackContext; -import org.json.JSONArray; -import org.json.JSONException; - -import android.content.Intent; -import android.content.pm.PackageManager; -import android.content.res.Configuration; -import android.net.Uri; -import android.os.Build; -import android.os.Bundle; - -import java.io.FileNotFoundException; -import java.io.IOException; - -/** - * Plugins must extend this class and override one of the execute methods. - */ -public class CordovaPlugin { - public CordovaWebView webView; - public CordovaInterface cordova; - protected CordovaPreferences preferences; - private String serviceName; - - /** - * Call this after constructing to initialize the plugin. - * Final because we want to be able to change args without breaking plugins. - */ - public final void privateInitialize(String serviceName, CordovaInterface cordova, CordovaWebView webView, CordovaPreferences preferences) { - assert this.cordova == null; - this.serviceName = serviceName; - this.cordova = cordova; - this.webView = webView; - this.preferences = preferences; - initialize(cordova, webView); - pluginInitialize(); - } - - /** - * Called after plugin construction and fields have been initialized. - * Prefer to use pluginInitialize instead since there is no value in - * having parameters on the initialize() function. - */ - public void initialize(CordovaInterface cordova, CordovaWebView webView) { - } - - /** - * Called after plugin construction and fields have been initialized. - */ - protected void pluginInitialize() { - } - - /** - * Returns the plugin's service name (what you'd use when calling pluginManger.getPlugin()) - */ - public String getServiceName() { - return serviceName; - } - - /** - * Executes the request. - * - * This method is called from the WebView thread. To do a non-trivial amount of work, use: - * cordova.getThreadPool().execute(runnable); - * - * To run on the UI thread, use: - * cordova.getActivity().runOnUiThread(runnable); - * - * @param action The action to execute. - * @param rawArgs The exec() arguments in JSON form. - * @param callbackContext The callback context used when calling back into JavaScript. - * @return Whether the action was valid. - */ - public boolean execute(String action, String rawArgs, CallbackContext callbackContext) throws JSONException { - JSONArray args = new JSONArray(rawArgs); - return execute(action, args, callbackContext); - } - - /** - * Executes the request. - * - * This method is called from the WebView thread. To do a non-trivial amount of work, use: - * cordova.getThreadPool().execute(runnable); - * - * To run on the UI thread, use: - * cordova.getActivity().runOnUiThread(runnable); - * - * @param action The action to execute. - * @param args The exec() arguments. - * @param callbackContext The callback context used when calling back into JavaScript. - * @return Whether the action was valid. - */ - public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { - CordovaArgs cordovaArgs = new CordovaArgs(args); - return execute(action, cordovaArgs, callbackContext); - } - - /** - * Executes the request. - * - * This method is called from the WebView thread. To do a non-trivial amount of work, use: - * cordova.getThreadPool().execute(runnable); - * - * To run on the UI thread, use: - * cordova.getActivity().runOnUiThread(runnable); - * - * @param action The action to execute. - * @param args The exec() arguments, wrapped with some Cordova helpers. - * @param callbackContext The callback context used when calling back into JavaScript. - * @return Whether the action was valid. - */ - public boolean execute(String action, CordovaArgs args, CallbackContext callbackContext) throws JSONException { - return false; - } - - /** - * Called when the system is about to start resuming a previous activity. - * - * @param multitasking Flag indicating if multitasking is turned on for app - */ - public void onPause(boolean multitasking) { - } - - /** - * Called when the activity will start interacting with the user. - * - * @param multitasking Flag indicating if multitasking is turned on for app - */ - public void onResume(boolean multitasking) { - } - - /** - * Called when the activity is becoming visible to the user. - */ - public void onStart() { - } - - /** - * Called when the activity is no longer visible to the user. - */ - public void onStop() { - } - - /** - * Called when the activity receives a new intent. - */ - public void onNewIntent(Intent intent) { - } - - /** - * The final call you receive before your activity is destroyed. - */ - public void onDestroy() { - } - - /** - * Called when the Activity is being destroyed (e.g. if a plugin calls out to an external - * Activity and the OS kills the CordovaActivity in the background). The plugin should save its - * state in this method only if it is awaiting the result of an external Activity and needs - * to preserve some information so as to handle that result; onRestoreStateForActivityResult() - * will only be called if the plugin is the recipient of an Activity result - * - * @return Bundle containing the state of the plugin or null if state does not need to be saved - */ - public Bundle onSaveInstanceState() { - return null; - } - - /** - * Called when a plugin is the recipient of an Activity result after the CordovaActivity has - * been destroyed. The Bundle will be the same as the one the plugin returned in - * onSaveInstanceState() - * - * @param state Bundle containing the state of the plugin - * @param callbackContext Replacement Context to return the plugin result to - */ - public void onRestoreStateForActivityResult(Bundle state, CallbackContext callbackContext) {} - - /** - * Called when a message is sent to plugin. - * - * @param id The message id - * @param data The message data - * @return Object to stop propagation or null - */ - public Object onMessage(String id, Object data) { - return null; - } - - /** - * Called when an activity you launched exits, giving you the requestCode you started it with, - * the resultCode it returned, and any additional data from it. - * - * @param requestCode The request code originally supplied to startActivityForResult(), - * allowing you to identify who this result came from. - * @param resultCode The integer result code returned by the child activity through its setResult(). - * @param intent An Intent, which can return result data to the caller (various data can be - * attached to Intent "extras"). - */ - public void onActivityResult(int requestCode, int resultCode, Intent intent) { - } - - /** - * Hook for blocking the loading of external resources. - * - * This will be called when the WebView's shouldInterceptRequest wants to - * know whether to open a connection to an external resource. Return false - * to block the request: if any plugin returns false, Cordova will block - * the request. If all plugins return null, the default policy will be - * enforced. If at least one plugin returns true, and no plugins return - * false, then the request will proceed. - * - * Note that this only affects resource requests which are routed through - * WebViewClient.shouldInterceptRequest, such as XMLHttpRequest requests and - * img tag loads. WebSockets and media requests (such as

Cordova Android Tests

-
-

Cordova:  

-

Deviceready:  

-
-
-

Page 1

- Go to next page.
- If returning from previous page, press "backbutton". You should exit this app. -
- Next page - - diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/backbuttonmultipage/sample2.html b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/backbuttonmultipage/sample2.html deleted file mode 100755 index 0b5be64..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/backbuttonmultipage/sample2.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - -Backbutton - - - - - -

Cordova Android Tests

-
-

Cordova:  

-

Deviceready:  

-
-
-

Page 2

- Go to next page.
- If returning from previous page, press "backbutton". You should go to Page 1. -
- Next page - - diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/backbuttonmultipage/sample3.html b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/backbuttonmultipage/sample3.html deleted file mode 100755 index 7aa1e3b..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/backbuttonmultipage/sample3.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - -Backbutton - - - - - -

Cordova Android Tests

-
-

Cordova:  

-

Deviceready:  

-
-
-

Page 3

- Press the 3 buttons below. You should stay on same page.
- Press "backbutton" 4 times. This will go back to #test3, #test2, #test1, then return to previous Page 2.
-
- page3#test1 - page3#test2 - page3#test3 - - diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/backgroundcolor/index.html b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/backgroundcolor/index.html deleted file mode 100755 index 3b09d64..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/backgroundcolor/index.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - Cordova Tests - - - - - -

Background Color Test

-
-

Cordova:  

-

Deviceready:  

-
-
- Before this page was show, you should have seen the background flash green.
-
- - diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/cordova.js b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/cordova.js deleted file mode 100644 index 11da9eb..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/cordova.js +++ /dev/null @@ -1,2206 +0,0 @@ -// Platform: android -// 7c5fcc5a5adfbf3fb8ceaf36fbdd4bd970bd9c20 -/* - 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. -*/ -;(function() { -var PLATFORM_VERSION_BUILD_LABEL = '6.2.0-dev'; -// file: src/scripts/require.js - - -var require, - define; - -(function () { - var modules = {}, - // Stack of moduleIds currently being built. - requireStack = [], - // Map of module ID -> index into requireStack of modules currently being built. - inProgressModules = {}, - SEPARATOR = "."; - - - - function build(module) { - var factory = module.factory, - localRequire = function (id) { - var resultantId = id; - //Its a relative path, so lop off the last portion and add the id (minus "./") - if (id.charAt(0) === ".") { - resultantId = module.id.slice(0, module.id.lastIndexOf(SEPARATOR)) + SEPARATOR + id.slice(2); - } - return require(resultantId); - }; - module.exports = {}; - delete module.factory; - factory(localRequire, module.exports, module); - return module.exports; - } - - require = function (id) { - if (!modules[id]) { - throw "module " + id + " not found"; - } else if (id in inProgressModules) { - var cycle = requireStack.slice(inProgressModules[id]).join('->') + '->' + id; - throw "Cycle in require graph: " + cycle; - } - if (modules[id].factory) { - try { - inProgressModules[id] = requireStack.length; - requireStack.push(id); - return build(modules[id]); - } finally { - delete inProgressModules[id]; - requireStack.pop(); - } - } - return modules[id].exports; - }; - - define = function (id, factory) { - if (modules[id]) { - throw "module " + id + " already defined"; - } - - modules[id] = { - id: id, - factory: factory - }; - }; - - define.remove = function (id) { - delete modules[id]; - }; - - define.moduleMap = modules; -})(); - -//Export for use in node -if (typeof module === "object" && typeof require === "function") { - module.exports.require = require; - module.exports.define = define; -} - -// file: src/cordova.js -define("cordova", function(require, exports, module) { - -// Workaround for Windows 10 in hosted environment case -// http://www.w3.org/html/wg/drafts/html/master/browsers.html#named-access-on-the-window-object -if (window.cordova && !(window.cordova instanceof HTMLElement)) { - throw new Error("cordova already defined"); -} - - -var channel = require('cordova/channel'); -var platform = require('cordova/platform'); - - -/** - * Intercept calls to addEventListener + removeEventListener and handle deviceready, - * resume, and pause events. - */ -var m_document_addEventListener = document.addEventListener; -var m_document_removeEventListener = document.removeEventListener; -var m_window_addEventListener = window.addEventListener; -var m_window_removeEventListener = window.removeEventListener; - -/** - * Houses custom event handlers to intercept on document + window event listeners. - */ -var documentEventHandlers = {}, - windowEventHandlers = {}; - -document.addEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - if (typeof documentEventHandlers[e] != 'undefined') { - documentEventHandlers[e].subscribe(handler); - } else { - m_document_addEventListener.call(document, evt, handler, capture); - } -}; - -window.addEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - if (typeof windowEventHandlers[e] != 'undefined') { - windowEventHandlers[e].subscribe(handler); - } else { - m_window_addEventListener.call(window, evt, handler, capture); - } -}; - -document.removeEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - // If unsubscribing from an event that is handled by a plugin - if (typeof documentEventHandlers[e] != "undefined") { - documentEventHandlers[e].unsubscribe(handler); - } else { - m_document_removeEventListener.call(document, evt, handler, capture); - } -}; - -window.removeEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - // If unsubscribing from an event that is handled by a plugin - if (typeof windowEventHandlers[e] != "undefined") { - windowEventHandlers[e].unsubscribe(handler); - } else { - m_window_removeEventListener.call(window, evt, handler, capture); - } -}; - -function createEvent(type, data) { - var event = document.createEvent('Events'); - event.initEvent(type, false, false); - if (data) { - for (var i in data) { - if (data.hasOwnProperty(i)) { - event[i] = data[i]; - } - } - } - return event; -} - - -var cordova = { - define:define, - require:require, - version:PLATFORM_VERSION_BUILD_LABEL, - platformVersion:PLATFORM_VERSION_BUILD_LABEL, - platformId:platform.id, - /** - * Methods to add/remove your own addEventListener hijacking on document + window. - */ - addWindowEventHandler:function(event) { - return (windowEventHandlers[event] = channel.create(event)); - }, - addStickyDocumentEventHandler:function(event) { - return (documentEventHandlers[event] = channel.createSticky(event)); - }, - addDocumentEventHandler:function(event) { - return (documentEventHandlers[event] = channel.create(event)); - }, - removeWindowEventHandler:function(event) { - delete windowEventHandlers[event]; - }, - removeDocumentEventHandler:function(event) { - delete documentEventHandlers[event]; - }, - /** - * Retrieve original event handlers that were replaced by Cordova - * - * @return object - */ - getOriginalHandlers: function() { - return {'document': {'addEventListener': m_document_addEventListener, 'removeEventListener': m_document_removeEventListener}, - 'window': {'addEventListener': m_window_addEventListener, 'removeEventListener': m_window_removeEventListener}}; - }, - /** - * Method to fire event from native code - * bNoDetach is required for events which cause an exception which needs to be caught in native code - */ - fireDocumentEvent: function(type, data, bNoDetach) { - var evt = createEvent(type, data); - if (typeof documentEventHandlers[type] != 'undefined') { - if( bNoDetach ) { - documentEventHandlers[type].fire(evt); - } - else { - setTimeout(function() { - // Fire deviceready on listeners that were registered before cordova.js was loaded. - if (type == 'deviceready') { - document.dispatchEvent(evt); - } - documentEventHandlers[type].fire(evt); - }, 0); - } - } else { - document.dispatchEvent(evt); - } - }, - fireWindowEvent: function(type, data) { - var evt = createEvent(type,data); - if (typeof windowEventHandlers[type] != 'undefined') { - setTimeout(function() { - windowEventHandlers[type].fire(evt); - }, 0); - } else { - window.dispatchEvent(evt); - } - }, - - /** - * Plugin callback mechanism. - */ - // Randomize the starting callbackId to avoid collisions after refreshing or navigating. - // This way, it's very unlikely that any new callback would get the same callbackId as an old callback. - callbackId: Math.floor(Math.random() * 2000000000), - callbacks: {}, - callbackStatus: { - NO_RESULT: 0, - OK: 1, - CLASS_NOT_FOUND_EXCEPTION: 2, - ILLEGAL_ACCESS_EXCEPTION: 3, - INSTANTIATION_EXCEPTION: 4, - MALFORMED_URL_EXCEPTION: 5, - IO_EXCEPTION: 6, - INVALID_ACTION: 7, - JSON_EXCEPTION: 8, - ERROR: 9 - }, - - /** - * Called by native code when returning successful result from an action. - */ - callbackSuccess: function(callbackId, args) { - cordova.callbackFromNative(callbackId, true, args.status, [args.message], args.keepCallback); - }, - - /** - * Called by native code when returning error result from an action. - */ - callbackError: function(callbackId, args) { - // TODO: Deprecate callbackSuccess and callbackError in favour of callbackFromNative. - // Derive success from status. - cordova.callbackFromNative(callbackId, false, args.status, [args.message], args.keepCallback); - }, - - /** - * Called by native code when returning the result from an action. - */ - callbackFromNative: function(callbackId, isSuccess, status, args, keepCallback) { - try { - var callback = cordova.callbacks[callbackId]; - if (callback) { - if (isSuccess && status == cordova.callbackStatus.OK) { - callback.success && callback.success.apply(null, args); - } else if (!isSuccess) { - callback.fail && callback.fail.apply(null, args); - } - /* - else - Note, this case is intentionally not caught. - this can happen if isSuccess is true, but callbackStatus is NO_RESULT - which is used to remove a callback from the list without calling the callbacks - typically keepCallback is false in this case - */ - // Clear callback if not expecting any more results - if (!keepCallback) { - delete cordova.callbacks[callbackId]; - } - } - } - catch (err) { - var msg = "Error in " + (isSuccess ? "Success" : "Error") + " callbackId: " + callbackId + " : " + err; - console && console.log && console.log(msg); - cordova.fireWindowEvent("cordovacallbackerror", { 'message': msg }); - throw err; - } - }, - addConstructor: function(func) { - channel.onCordovaReady.subscribe(function() { - try { - func(); - } catch(e) { - console.log("Failed to run constructor: " + e); - } - }); - } -}; - - -module.exports = cordova; - -}); - -// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/android/nativeapiprovider.js -define("cordova/android/nativeapiprovider", function(require, exports, module) { - -/** - * Exports the ExposedJsApi.java object if available, otherwise exports the PromptBasedNativeApi. - */ - -var nativeApi = this._cordovaNative || require('cordova/android/promptbasednativeapi'); -var currentApi = nativeApi; - -module.exports = { - get: function() { return currentApi; }, - setPreferPrompt: function(value) { - currentApi = value ? require('cordova/android/promptbasednativeapi') : nativeApi; - }, - // Used only by tests. - set: function(value) { - currentApi = value; - } -}; - -}); - -// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/android/promptbasednativeapi.js -define("cordova/android/promptbasednativeapi", function(require, exports, module) { - -/** - * Implements the API of ExposedJsApi.java, but uses prompt() to communicate. - * This is used pre-JellyBean, where addJavascriptInterface() is disabled. - */ - -module.exports = { - exec: function(bridgeSecret, service, action, callbackId, argsJson) { - return prompt(argsJson, 'gap:'+JSON.stringify([bridgeSecret, service, action, callbackId])); - }, - setNativeToJsBridgeMode: function(bridgeSecret, value) { - prompt(value, 'gap_bridge_mode:' + bridgeSecret); - }, - retrieveJsMessages: function(bridgeSecret, fromOnlineEvent) { - return prompt(+fromOnlineEvent, 'gap_poll:' + bridgeSecret); - } -}; - -}); - -// file: src/common/argscheck.js -define("cordova/argscheck", function(require, exports, module) { - -var utils = require('cordova/utils'); - -var moduleExports = module.exports; - -var typeMap = { - 'A': 'Array', - 'D': 'Date', - 'N': 'Number', - 'S': 'String', - 'F': 'Function', - 'O': 'Object' -}; - -function extractParamName(callee, argIndex) { - return (/.*?\((.*?)\)/).exec(callee)[1].split(', ')[argIndex]; -} - -function checkArgs(spec, functionName, args, opt_callee) { - if (!moduleExports.enableChecks) { - return; - } - var errMsg = null; - var typeName; - for (var i = 0; i < spec.length; ++i) { - var c = spec.charAt(i), - cUpper = c.toUpperCase(), - arg = args[i]; - // Asterix means allow anything. - if (c == '*') { - continue; - } - typeName = utils.typeName(arg); - if ((arg === null || arg === undefined) && c == cUpper) { - continue; - } - if (typeName != typeMap[cUpper]) { - errMsg = 'Expected ' + typeMap[cUpper]; - break; - } - } - if (errMsg) { - errMsg += ', but got ' + typeName + '.'; - errMsg = 'Wrong type for parameter "' + extractParamName(opt_callee || args.callee, i) + '" of ' + functionName + ': ' + errMsg; - // Don't log when running unit tests. - if (typeof jasmine == 'undefined') { - console.error(errMsg); - } - throw TypeError(errMsg); - } -} - -function getValue(value, defaultValue) { - return value === undefined ? defaultValue : value; -} - -moduleExports.checkArgs = checkArgs; -moduleExports.getValue = getValue; -moduleExports.enableChecks = true; - - -}); - -// file: src/common/base64.js -define("cordova/base64", function(require, exports, module) { - -var base64 = exports; - -base64.fromArrayBuffer = function(arrayBuffer) { - var array = new Uint8Array(arrayBuffer); - return uint8ToBase64(array); -}; - -base64.toArrayBuffer = function(str) { - var decodedStr = typeof atob != 'undefined' ? atob(str) : new Buffer(str,'base64').toString('binary'); - var arrayBuffer = new ArrayBuffer(decodedStr.length); - var array = new Uint8Array(arrayBuffer); - for (var i=0, len=decodedStr.length; i < len; i++) { - array[i] = decodedStr.charCodeAt(i); - } - return arrayBuffer; -}; - -//------------------------------------------------------------------------------ - -/* This code is based on the performance tests at http://jsperf.com/b64tests - * This 12-bit-at-a-time algorithm was the best performing version on all - * platforms tested. - */ - -var b64_6bit = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -var b64_12bit; - -var b64_12bitTable = function() { - b64_12bit = []; - for (var i=0; i<64; i++) { - for (var j=0; j<64; j++) { - b64_12bit[i*64+j] = b64_6bit[i] + b64_6bit[j]; - } - } - b64_12bitTable = function() { return b64_12bit; }; - return b64_12bit; -}; - -function uint8ToBase64(rawData) { - var numBytes = rawData.byteLength; - var output=""; - var segment; - var table = b64_12bitTable(); - for (var i=0;i> 12]; - output += table[segment & 0xfff]; - } - if (numBytes - i == 2) { - segment = (rawData[i] << 16) + (rawData[i+1] << 8); - output += table[segment >> 12]; - output += b64_6bit[(segment & 0xfff) >> 6]; - output += '='; - } else if (numBytes - i == 1) { - segment = (rawData[i] << 16); - output += table[segment >> 12]; - output += '=='; - } - return output; -} - -}); - -// file: src/common/builder.js -define("cordova/builder", function(require, exports, module) { - -var utils = require('cordova/utils'); - -function each(objects, func, context) { - for (var prop in objects) { - if (objects.hasOwnProperty(prop)) { - func.apply(context, [objects[prop], prop]); - } - } -} - -function clobber(obj, key, value) { - exports.replaceHookForTesting(obj, key); - var needsProperty = false; - try { - obj[key] = value; - } catch (e) { - needsProperty = true; - } - // Getters can only be overridden by getters. - if (needsProperty || obj[key] !== value) { - utils.defineGetter(obj, key, function() { - return value; - }); - } -} - -function assignOrWrapInDeprecateGetter(obj, key, value, message) { - if (message) { - utils.defineGetter(obj, key, function() { - console.log(message); - delete obj[key]; - clobber(obj, key, value); - return value; - }); - } else { - clobber(obj, key, value); - } -} - -function include(parent, objects, clobber, merge) { - each(objects, function (obj, key) { - try { - var result = obj.path ? require(obj.path) : {}; - - if (clobber) { - // Clobber if it doesn't exist. - if (typeof parent[key] === 'undefined') { - assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated); - } else if (typeof obj.path !== 'undefined') { - // If merging, merge properties onto parent, otherwise, clobber. - if (merge) { - recursiveMerge(parent[key], result); - } else { - assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated); - } - } - result = parent[key]; - } else { - // Overwrite if not currently defined. - if (typeof parent[key] == 'undefined') { - assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated); - } else { - // Set result to what already exists, so we can build children into it if they exist. - result = parent[key]; - } - } - - if (obj.children) { - include(result, obj.children, clobber, merge); - } - } catch(e) { - utils.alert('Exception building Cordova JS globals: ' + e + ' for key "' + key + '"'); - } - }); -} - -/** - * Merge properties from one object onto another recursively. Properties from - * the src object will overwrite existing target property. - * - * @param target Object to merge properties into. - * @param src Object to merge properties from. - */ -function recursiveMerge(target, src) { - for (var prop in src) { - if (src.hasOwnProperty(prop)) { - if (target.prototype && target.prototype.constructor === target) { - // If the target object is a constructor override off prototype. - clobber(target.prototype, prop, src[prop]); - } else { - if (typeof src[prop] === 'object' && typeof target[prop] === 'object') { - recursiveMerge(target[prop], src[prop]); - } else { - clobber(target, prop, src[prop]); - } - } - } - } -} - -exports.buildIntoButDoNotClobber = function(objects, target) { - include(target, objects, false, false); -}; -exports.buildIntoAndClobber = function(objects, target) { - include(target, objects, true, false); -}; -exports.buildIntoAndMerge = function(objects, target) { - include(target, objects, true, true); -}; -exports.recursiveMerge = recursiveMerge; -exports.assignOrWrapInDeprecateGetter = assignOrWrapInDeprecateGetter; -exports.replaceHookForTesting = function() {}; - -}); - -// file: src/common/channel.js -define("cordova/channel", function(require, exports, module) { - -var utils = require('cordova/utils'), - nextGuid = 1; - -/** - * Custom pub-sub "channel" that can have functions subscribed to it - * This object is used to define and control firing of events for - * cordova initialization, as well as for custom events thereafter. - * - * The order of events during page load and Cordova startup is as follows: - * - * onDOMContentLoaded* Internal event that is received when the web page is loaded and parsed. - * onNativeReady* Internal event that indicates the Cordova native side is ready. - * onCordovaReady* Internal event fired when all Cordova JavaScript objects have been created. - * onDeviceReady* User event fired to indicate that Cordova is ready - * onResume User event fired to indicate a start/resume lifecycle event - * onPause User event fired to indicate a pause lifecycle event - * - * The events marked with an * are sticky. Once they have fired, they will stay in the fired state. - * All listeners that subscribe after the event is fired will be executed right away. - * - * The only Cordova events that user code should register for are: - * deviceready Cordova native code is initialized and Cordova APIs can be called from JavaScript - * pause App has moved to background - * resume App has returned to foreground - * - * Listeners can be registered as: - * document.addEventListener("deviceready", myDeviceReadyListener, false); - * document.addEventListener("resume", myResumeListener, false); - * document.addEventListener("pause", myPauseListener, false); - * - * The DOM lifecycle events should be used for saving and restoring state - * window.onload - * window.onunload - * - */ - -/** - * Channel - * @constructor - * @param type String the channel name - */ -var Channel = function(type, sticky) { - this.type = type; - // Map of guid -> function. - this.handlers = {}; - // 0 = Non-sticky, 1 = Sticky non-fired, 2 = Sticky fired. - this.state = sticky ? 1 : 0; - // Used in sticky mode to remember args passed to fire(). - this.fireArgs = null; - // Used by onHasSubscribersChange to know if there are any listeners. - this.numHandlers = 0; - // Function that is called when the first listener is subscribed, or when - // the last listener is unsubscribed. - this.onHasSubscribersChange = null; -}, - channel = { - /** - * Calls the provided function only after all of the channels specified - * have been fired. All channels must be sticky channels. - */ - join: function(h, c) { - var len = c.length, - i = len, - f = function() { - if (!(--i)) h(); - }; - for (var j=0; jNative bridge. - POLLING: 0, - // For LOAD_URL to be viable, it would need to have a work-around for - // the bug where the soft-keyboard gets dismissed when a message is sent. - LOAD_URL: 1, - // For the ONLINE_EVENT to be viable, it would need to intercept all event - // listeners (both through addEventListener and window.ononline) as well - // as set the navigator property itself. - ONLINE_EVENT: 2, - EVAL_BRIDGE: 3 - }, - jsToNativeBridgeMode, // Set lazily. - nativeToJsBridgeMode = nativeToJsModes.EVAL_BRIDGE, - pollEnabled = false, - bridgeSecret = -1; - -var messagesFromNative = []; -var isProcessing = false; -var resolvedPromise = typeof Promise == 'undefined' ? null : Promise.resolve(); -var nextTick = resolvedPromise ? function(fn) { resolvedPromise.then(fn); } : function(fn) { setTimeout(fn); }; - -function androidExec(success, fail, service, action, args) { - if (bridgeSecret < 0) { - // If we ever catch this firing, we'll need to queue up exec()s - // and fire them once we get a secret. For now, I don't think - // it's possible for exec() to be called since plugins are parsed but - // not run until until after onNativeReady. - throw new Error('exec() called without bridgeSecret'); - } - // Set default bridge modes if they have not already been set. - // By default, we use the failsafe, since addJavascriptInterface breaks too often - if (jsToNativeBridgeMode === undefined) { - androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT); - } - - // If args is not provided, default to an empty array - args = args || []; - - // Process any ArrayBuffers in the args into a string. - for (var i = 0; i < args.length; i++) { - if (utils.typeName(args[i]) == 'ArrayBuffer') { - args[i] = base64.fromArrayBuffer(args[i]); - } - } - - var callbackId = service + cordova.callbackId++, - argsJson = JSON.stringify(args); - if (success || fail) { - cordova.callbacks[callbackId] = {success:success, fail:fail}; - } - - var msgs = nativeApiProvider.get().exec(bridgeSecret, service, action, callbackId, argsJson); - // If argsJson was received by Java as null, try again with the PROMPT bridge mode. - // This happens in rare circumstances, such as when certain Unicode characters are passed over the bridge on a Galaxy S2. See CB-2666. - if (jsToNativeBridgeMode == jsToNativeModes.JS_OBJECT && msgs === "@Null arguments.") { - androidExec.setJsToNativeBridgeMode(jsToNativeModes.PROMPT); - androidExec(success, fail, service, action, args); - androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT); - } else if (msgs) { - messagesFromNative.push(msgs); - // Always process async to avoid exceptions messing up stack. - nextTick(processMessages); - } -} - -androidExec.init = function() { - //CB-11828 - //This failsafe checks the version of Android and if it's Jellybean, it switches it to - //using the Online Event bridge for communicating from Native to JS - // - //It's ugly, but it's necessary. - var check = navigator.userAgent.toLowerCase().match(/android\s[0-9].[0-9]/); - var version_code = check && check[0].match(/4.[0-3].*/); - if (version_code != null && nativeToJsBridgeMode == nativeToJsModes.EVAL_BRIDGE) { - nativeToJsBridgeMode = nativeToJsModes.ONLINE_EVENT; - } - - bridgeSecret = +prompt('', 'gap_init:' + nativeToJsBridgeMode); - channel.onNativeReady.fire(); -}; - -function pollOnceFromOnlineEvent() { - pollOnce(true); -} - -function pollOnce(opt_fromOnlineEvent) { - if (bridgeSecret < 0) { - // This can happen when the NativeToJsMessageQueue resets the online state on page transitions. - // We know there's nothing to retrieve, so no need to poll. - return; - } - var msgs = nativeApiProvider.get().retrieveJsMessages(bridgeSecret, !!opt_fromOnlineEvent); - if (msgs) { - messagesFromNative.push(msgs); - // Process sync since we know we're already top-of-stack. - processMessages(); - } -} - -function pollingTimerFunc() { - if (pollEnabled) { - pollOnce(); - setTimeout(pollingTimerFunc, 50); - } -} - -function hookOnlineApis() { - function proxyEvent(e) { - cordova.fireWindowEvent(e.type); - } - // The network module takes care of firing online and offline events. - // It currently fires them only on document though, so we bridge them - // to window here (while first listening for exec()-releated online/offline - // events). - window.addEventListener('online', pollOnceFromOnlineEvent, false); - window.addEventListener('offline', pollOnceFromOnlineEvent, false); - cordova.addWindowEventHandler('online'); - cordova.addWindowEventHandler('offline'); - document.addEventListener('online', proxyEvent, false); - document.addEventListener('offline', proxyEvent, false); -} - -hookOnlineApis(); - -androidExec.jsToNativeModes = jsToNativeModes; -androidExec.nativeToJsModes = nativeToJsModes; - -androidExec.setJsToNativeBridgeMode = function(mode) { - if (mode == jsToNativeModes.JS_OBJECT && !window._cordovaNative) { - mode = jsToNativeModes.PROMPT; - } - nativeApiProvider.setPreferPrompt(mode == jsToNativeModes.PROMPT); - jsToNativeBridgeMode = mode; -}; - -androidExec.setNativeToJsBridgeMode = function(mode) { - if (mode == nativeToJsBridgeMode) { - return; - } - if (nativeToJsBridgeMode == nativeToJsModes.POLLING) { - pollEnabled = false; - } - - nativeToJsBridgeMode = mode; - // Tell the native side to switch modes. - // Otherwise, it will be set by androidExec.init() - if (bridgeSecret >= 0) { - nativeApiProvider.get().setNativeToJsBridgeMode(bridgeSecret, mode); - } - - if (mode == nativeToJsModes.POLLING) { - pollEnabled = true; - setTimeout(pollingTimerFunc, 1); - } -}; - -function buildPayload(payload, message) { - var payloadKind = message.charAt(0); - if (payloadKind == 's') { - payload.push(message.slice(1)); - } else if (payloadKind == 't') { - payload.push(true); - } else if (payloadKind == 'f') { - payload.push(false); - } else if (payloadKind == 'N') { - payload.push(null); - } else if (payloadKind == 'n') { - payload.push(+message.slice(1)); - } else if (payloadKind == 'A') { - var data = message.slice(1); - payload.push(base64.toArrayBuffer(data)); - } else if (payloadKind == 'S') { - payload.push(window.atob(message.slice(1))); - } else if (payloadKind == 'M') { - var multipartMessages = message.slice(1); - while (multipartMessages !== "") { - var spaceIdx = multipartMessages.indexOf(' '); - var msgLen = +multipartMessages.slice(0, spaceIdx); - var multipartMessage = multipartMessages.substr(spaceIdx + 1, msgLen); - multipartMessages = multipartMessages.slice(spaceIdx + msgLen + 1); - buildPayload(payload, multipartMessage); - } - } else { - payload.push(JSON.parse(message)); - } -} - -// Processes a single message, as encoded by NativeToJsMessageQueue.java. -function processMessage(message) { - var firstChar = message.charAt(0); - if (firstChar == 'J') { - // This is deprecated on the .java side. It doesn't work with CSP enabled. - eval(message.slice(1)); - } else if (firstChar == 'S' || firstChar == 'F') { - var success = firstChar == 'S'; - var keepCallback = message.charAt(1) == '1'; - var spaceIdx = message.indexOf(' ', 2); - var status = +message.slice(2, spaceIdx); - var nextSpaceIdx = message.indexOf(' ', spaceIdx + 1); - var callbackId = message.slice(spaceIdx + 1, nextSpaceIdx); - var payloadMessage = message.slice(nextSpaceIdx + 1); - var payload = []; - buildPayload(payload, payloadMessage); - cordova.callbackFromNative(callbackId, success, status, payload, keepCallback); - } else { - console.log("processMessage failed: invalid message: " + JSON.stringify(message)); - } -} - -function processMessages() { - // Check for the reentrant case. - if (isProcessing) { - return; - } - if (messagesFromNative.length === 0) { - return; - } - isProcessing = true; - try { - var msg = popMessageFromQueue(); - // The Java side can send a * message to indicate that it - // still has messages waiting to be retrieved. - if (msg == '*' && messagesFromNative.length === 0) { - nextTick(pollOnce); - return; - } - processMessage(msg); - } finally { - isProcessing = false; - if (messagesFromNative.length > 0) { - nextTick(processMessages); - } - } -} - -function popMessageFromQueue() { - var messageBatch = messagesFromNative.shift(); - if (messageBatch == '*') { - return '*'; - } - - var spaceIdx = messageBatch.indexOf(' '); - var msgLen = +messageBatch.slice(0, spaceIdx); - var message = messageBatch.substr(spaceIdx + 1, msgLen); - messageBatch = messageBatch.slice(spaceIdx + msgLen + 1); - if (messageBatch) { - messagesFromNative.unshift(messageBatch); - } - return message; -} - -module.exports = androidExec; - -}); - -// file: src/common/exec/proxy.js -define("cordova/exec/proxy", function(require, exports, module) { - - -// internal map of proxy function -var CommandProxyMap = {}; - -module.exports = { - - // example: cordova.commandProxy.add("Accelerometer",{getCurrentAcceleration: function(successCallback, errorCallback, options) {...},...); - add:function(id,proxyObj) { - console.log("adding proxy for " + id); - CommandProxyMap[id] = proxyObj; - return proxyObj; - }, - - // cordova.commandProxy.remove("Accelerometer"); - remove:function(id) { - var proxy = CommandProxyMap[id]; - delete CommandProxyMap[id]; - CommandProxyMap[id] = null; - return proxy; - }, - - get:function(service,action) { - return ( CommandProxyMap[service] ? CommandProxyMap[service][action] : null ); - } -}; -}); - -// file: src/common/init.js -define("cordova/init", function(require, exports, module) { - -var channel = require('cordova/channel'); -var cordova = require('cordova'); -var modulemapper = require('cordova/modulemapper'); -var platform = require('cordova/platform'); -var pluginloader = require('cordova/pluginloader'); -var utils = require('cordova/utils'); - -var platformInitChannelsArray = [channel.onNativeReady, channel.onPluginsReady]; - -function logUnfiredChannels(arr) { - for (var i = 0; i < arr.length; ++i) { - if (arr[i].state != 2) { - console.log('Channel not fired: ' + arr[i].type); - } - } -} - -window.setTimeout(function() { - if (channel.onDeviceReady.state != 2) { - console.log('deviceready has not fired after 5 seconds.'); - logUnfiredChannels(platformInitChannelsArray); - logUnfiredChannels(channel.deviceReadyChannelsArray); - } -}, 5000); - -// Replace navigator before any modules are required(), to ensure it happens as soon as possible. -// We replace it so that properties that can't be clobbered can instead be overridden. -function replaceNavigator(origNavigator) { - var CordovaNavigator = function() {}; - CordovaNavigator.prototype = origNavigator; - var newNavigator = new CordovaNavigator(); - // This work-around really only applies to new APIs that are newer than Function.bind. - // Without it, APIs such as getGamepads() break. - if (CordovaNavigator.bind) { - for (var key in origNavigator) { - if (typeof origNavigator[key] == 'function') { - newNavigator[key] = origNavigator[key].bind(origNavigator); - } - else { - (function(k) { - utils.defineGetterSetter(newNavigator,key,function() { - return origNavigator[k]; - }); - })(key); - } - } - } - return newNavigator; -} - -if (window.navigator) { - window.navigator = replaceNavigator(window.navigator); -} - -if (!window.console) { - window.console = { - log: function(){} - }; -} -if (!window.console.warn) { - window.console.warn = function(msg) { - this.log("warn: " + msg); - }; -} - -// Register pause, resume and deviceready channels as events on document. -channel.onPause = cordova.addDocumentEventHandler('pause'); -channel.onResume = cordova.addDocumentEventHandler('resume'); -channel.onActivated = cordova.addDocumentEventHandler('activated'); -channel.onDeviceReady = cordova.addStickyDocumentEventHandler('deviceready'); - -// Listen for DOMContentLoaded and notify our channel subscribers. -if (document.readyState == 'complete' || document.readyState == 'interactive') { - channel.onDOMContentLoaded.fire(); -} else { - document.addEventListener('DOMContentLoaded', function() { - channel.onDOMContentLoaded.fire(); - }, false); -} - -// _nativeReady is global variable that the native side can set -// to signify that the native code is ready. It is a global since -// it may be called before any cordova JS is ready. -if (window._nativeReady) { - channel.onNativeReady.fire(); -} - -modulemapper.clobbers('cordova', 'cordova'); -modulemapper.clobbers('cordova/exec', 'cordova.exec'); -modulemapper.clobbers('cordova/exec', 'Cordova.exec'); - -// Call the platform-specific initialization. -platform.bootstrap && platform.bootstrap(); - -// Wrap in a setTimeout to support the use-case of having plugin JS appended to cordova.js. -// The delay allows the attached modules to be defined before the plugin loader looks for them. -setTimeout(function() { - pluginloader.load(function() { - channel.onPluginsReady.fire(); - }); -}, 0); - -/** - * Create all cordova objects once native side is ready. - */ -channel.join(function() { - modulemapper.mapModules(window); - - platform.initialize && platform.initialize(); - - // Fire event to notify that all objects are created - channel.onCordovaReady.fire(); - - // Fire onDeviceReady event once page has fully loaded, all - // constructors have run and cordova info has been received from native - // side. - channel.join(function() { - require('cordova').fireDocumentEvent('deviceready'); - }, channel.deviceReadyChannelsArray); - -}, platformInitChannelsArray); - - -}); - -// file: src/common/init_b.js -define("cordova/init_b", function(require, exports, module) { - -var channel = require('cordova/channel'); -var cordova = require('cordova'); -var modulemapper = require('cordova/modulemapper'); -var platform = require('cordova/platform'); -var pluginloader = require('cordova/pluginloader'); -var utils = require('cordova/utils'); - -var platformInitChannelsArray = [channel.onDOMContentLoaded, channel.onNativeReady, channel.onPluginsReady]; - -// setting exec -cordova.exec = require('cordova/exec'); - -function logUnfiredChannels(arr) { - for (var i = 0; i < arr.length; ++i) { - if (arr[i].state != 2) { - console.log('Channel not fired: ' + arr[i].type); - } - } -} - -window.setTimeout(function() { - if (channel.onDeviceReady.state != 2) { - console.log('deviceready has not fired after 5 seconds.'); - logUnfiredChannels(platformInitChannelsArray); - logUnfiredChannels(channel.deviceReadyChannelsArray); - } -}, 5000); - -// Replace navigator before any modules are required(), to ensure it happens as soon as possible. -// We replace it so that properties that can't be clobbered can instead be overridden. -function replaceNavigator(origNavigator) { - var CordovaNavigator = function() {}; - CordovaNavigator.prototype = origNavigator; - var newNavigator = new CordovaNavigator(); - // This work-around really only applies to new APIs that are newer than Function.bind. - // Without it, APIs such as getGamepads() break. - if (CordovaNavigator.bind) { - for (var key in origNavigator) { - if (typeof origNavigator[key] == 'function') { - newNavigator[key] = origNavigator[key].bind(origNavigator); - } - else { - (function(k) { - utils.defineGetterSetter(newNavigator,key,function() { - return origNavigator[k]; - }); - })(key); - } - } - } - return newNavigator; -} -if (window.navigator) { - window.navigator = replaceNavigator(window.navigator); -} - -if (!window.console) { - window.console = { - log: function(){} - }; -} -if (!window.console.warn) { - window.console.warn = function(msg) { - this.log("warn: " + msg); - }; -} - -// Register pause, resume and deviceready channels as events on document. -channel.onPause = cordova.addDocumentEventHandler('pause'); -channel.onResume = cordova.addDocumentEventHandler('resume'); -channel.onActivated = cordova.addDocumentEventHandler('activated'); -channel.onDeviceReady = cordova.addStickyDocumentEventHandler('deviceready'); - -// Listen for DOMContentLoaded and notify our channel subscribers. -if (document.readyState == 'complete' || document.readyState == 'interactive') { - channel.onDOMContentLoaded.fire(); -} else { - document.addEventListener('DOMContentLoaded', function() { - channel.onDOMContentLoaded.fire(); - }, false); -} - -// _nativeReady is global variable that the native side can set -// to signify that the native code is ready. It is a global since -// it may be called before any cordova JS is ready. -if (window._nativeReady) { - channel.onNativeReady.fire(); -} - -// Call the platform-specific initialization. -platform.bootstrap && platform.bootstrap(); - -// Wrap in a setTimeout to support the use-case of having plugin JS appended to cordova.js. -// The delay allows the attached modules to be defined before the plugin loader looks for them. -setTimeout(function() { - pluginloader.load(function() { - channel.onPluginsReady.fire(); - }); -}, 0); - -/** - * Create all cordova objects once native side is ready. - */ -channel.join(function() { - modulemapper.mapModules(window); - - platform.initialize && platform.initialize(); - - // Fire event to notify that all objects are created - channel.onCordovaReady.fire(); - - // Fire onDeviceReady event once page has fully loaded, all - // constructors have run and cordova info has been received from native - // side. - channel.join(function() { - require('cordova').fireDocumentEvent('deviceready'); - }, channel.deviceReadyChannelsArray); - -}, platformInitChannelsArray); - -}); - -// file: src/common/modulemapper.js -define("cordova/modulemapper", function(require, exports, module) { - -var builder = require('cordova/builder'), - moduleMap = define.moduleMap, - symbolList, - deprecationMap; - -exports.reset = function() { - symbolList = []; - deprecationMap = {}; -}; - -function addEntry(strategy, moduleName, symbolPath, opt_deprecationMessage) { - if (!(moduleName in moduleMap)) { - throw new Error('Module ' + moduleName + ' does not exist.'); - } - symbolList.push(strategy, moduleName, symbolPath); - if (opt_deprecationMessage) { - deprecationMap[symbolPath] = opt_deprecationMessage; - } -} - -// Note: Android 2.3 does have Function.bind(). -exports.clobbers = function(moduleName, symbolPath, opt_deprecationMessage) { - addEntry('c', moduleName, symbolPath, opt_deprecationMessage); -}; - -exports.merges = function(moduleName, symbolPath, opt_deprecationMessage) { - addEntry('m', moduleName, symbolPath, opt_deprecationMessage); -}; - -exports.defaults = function(moduleName, symbolPath, opt_deprecationMessage) { - addEntry('d', moduleName, symbolPath, opt_deprecationMessage); -}; - -exports.runs = function(moduleName) { - addEntry('r', moduleName, null); -}; - -function prepareNamespace(symbolPath, context) { - if (!symbolPath) { - return context; - } - var parts = symbolPath.split('.'); - var cur = context; - for (var i = 0, part; part = parts[i]; ++i) { - cur = cur[part] = cur[part] || {}; - } - return cur; -} - -exports.mapModules = function(context) { - var origSymbols = {}; - context.CDV_origSymbols = origSymbols; - for (var i = 0, len = symbolList.length; i < len; i += 3) { - var strategy = symbolList[i]; - var moduleName = symbolList[i + 1]; - var module = require(moduleName); - // - if (strategy == 'r') { - continue; - } - var symbolPath = symbolList[i + 2]; - var lastDot = symbolPath.lastIndexOf('.'); - var namespace = symbolPath.substr(0, lastDot); - var lastName = symbolPath.substr(lastDot + 1); - - var deprecationMsg = symbolPath in deprecationMap ? 'Access made to deprecated symbol: ' + symbolPath + '. ' + deprecationMsg : null; - var parentObj = prepareNamespace(namespace, context); - var target = parentObj[lastName]; - - if (strategy == 'm' && target) { - builder.recursiveMerge(target, module); - } else if ((strategy == 'd' && !target) || (strategy != 'd')) { - if (!(symbolPath in origSymbols)) { - origSymbols[symbolPath] = target; - } - builder.assignOrWrapInDeprecateGetter(parentObj, lastName, module, deprecationMsg); - } - } -}; - -exports.getOriginalSymbol = function(context, symbolPath) { - var origSymbols = context.CDV_origSymbols; - if (origSymbols && (symbolPath in origSymbols)) { - return origSymbols[symbolPath]; - } - var parts = symbolPath.split('.'); - var obj = context; - for (var i = 0; i < parts.length; ++i) { - obj = obj && obj[parts[i]]; - } - return obj; -}; - -exports.reset(); - - -}); - -// file: src/common/modulemapper_b.js -define("cordova/modulemapper_b", function(require, exports, module) { - -var builder = require('cordova/builder'), - symbolList = [], - deprecationMap; - -exports.reset = function() { - symbolList = []; - deprecationMap = {}; -}; - -function addEntry(strategy, moduleName, symbolPath, opt_deprecationMessage) { - symbolList.push(strategy, moduleName, symbolPath); - if (opt_deprecationMessage) { - deprecationMap[symbolPath] = opt_deprecationMessage; - } -} - -// Note: Android 2.3 does have Function.bind(). -exports.clobbers = function(moduleName, symbolPath, opt_deprecationMessage) { - addEntry('c', moduleName, symbolPath, opt_deprecationMessage); -}; - -exports.merges = function(moduleName, symbolPath, opt_deprecationMessage) { - addEntry('m', moduleName, symbolPath, opt_deprecationMessage); -}; - -exports.defaults = function(moduleName, symbolPath, opt_deprecationMessage) { - addEntry('d', moduleName, symbolPath, opt_deprecationMessage); -}; - -exports.runs = function(moduleName) { - addEntry('r', moduleName, null); -}; - -function prepareNamespace(symbolPath, context) { - if (!symbolPath) { - return context; - } - var parts = symbolPath.split('.'); - var cur = context; - for (var i = 0, part; part = parts[i]; ++i) { - cur = cur[part] = cur[part] || {}; - } - return cur; -} - -exports.mapModules = function(context) { - var origSymbols = {}; - context.CDV_origSymbols = origSymbols; - for (var i = 0, len = symbolList.length; i < len; i += 3) { - var strategy = symbolList[i]; - var moduleName = symbolList[i + 1]; - var module = require(moduleName); - // - if (strategy == 'r') { - continue; - } - var symbolPath = symbolList[i + 2]; - var lastDot = symbolPath.lastIndexOf('.'); - var namespace = symbolPath.substr(0, lastDot); - var lastName = symbolPath.substr(lastDot + 1); - - var deprecationMsg = symbolPath in deprecationMap ? 'Access made to deprecated symbol: ' + symbolPath + '. ' + deprecationMsg : null; - var parentObj = prepareNamespace(namespace, context); - var target = parentObj[lastName]; - - if (strategy == 'm' && target) { - builder.recursiveMerge(target, module); - } else if ((strategy == 'd' && !target) || (strategy != 'd')) { - if (!(symbolPath in origSymbols)) { - origSymbols[symbolPath] = target; - } - builder.assignOrWrapInDeprecateGetter(parentObj, lastName, module, deprecationMsg); - } - } -}; - -exports.getOriginalSymbol = function(context, symbolPath) { - var origSymbols = context.CDV_origSymbols; - if (origSymbols && (symbolPath in origSymbols)) { - return origSymbols[symbolPath]; - } - var parts = symbolPath.split('.'); - var obj = context; - for (var i = 0; i < parts.length; ++i) { - obj = obj && obj[parts[i]]; - } - return obj; -}; - -exports.reset(); - - -}); - -// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/platform.js -define("cordova/platform", function(require, exports, module) { - -// The last resume event that was received that had the result of a plugin call. -var lastResumeEvent = null; - -module.exports = { - id: 'android', - bootstrap: function() { - var channel = require('cordova/channel'), - cordova = require('cordova'), - exec = require('cordova/exec'), - modulemapper = require('cordova/modulemapper'); - - // Get the shared secret needed to use the bridge. - exec.init(); - - // TODO: Extract this as a proper plugin. - modulemapper.clobbers('cordova/plugin/android/app', 'navigator.app'); - - var APP_PLUGIN_NAME = Number(cordova.platformVersion.split('.')[0]) >= 4 ? 'CoreAndroid' : 'App'; - - // Inject a listener for the backbutton on the document. - var backButtonChannel = cordova.addDocumentEventHandler('backbutton'); - backButtonChannel.onHasSubscribersChange = function() { - // If we just attached the first handler or detached the last handler, - // let native know we need to override the back button. - exec(null, null, APP_PLUGIN_NAME, "overrideBackbutton", [this.numHandlers == 1]); - }; - - // Add hardware MENU and SEARCH button handlers - cordova.addDocumentEventHandler('menubutton'); - cordova.addDocumentEventHandler('searchbutton'); - - function bindButtonChannel(buttonName) { - // generic button bind used for volumeup/volumedown buttons - var volumeButtonChannel = cordova.addDocumentEventHandler(buttonName + 'button'); - volumeButtonChannel.onHasSubscribersChange = function() { - exec(null, null, APP_PLUGIN_NAME, "overrideButton", [buttonName, this.numHandlers == 1]); - }; - } - // Inject a listener for the volume buttons on the document. - bindButtonChannel('volumeup'); - bindButtonChannel('volumedown'); - - // The resume event is not "sticky", but it is possible that the event - // will contain the result of a plugin call. We need to ensure that the - // plugin result is delivered even after the event is fired (CB-10498) - var cordovaAddEventListener = document.addEventListener; - - document.addEventListener = function(evt, handler, capture) { - cordovaAddEventListener(evt, handler, capture); - - if (evt === 'resume' && lastResumeEvent) { - handler(lastResumeEvent); - } - }; - - // Let native code know we are all done on the JS side. - // Native code will then un-hide the WebView. - channel.onCordovaReady.subscribe(function() { - exec(onMessageFromNative, null, APP_PLUGIN_NAME, 'messageChannel', []); - exec(null, null, APP_PLUGIN_NAME, "show", []); - }); - } -}; - -function onMessageFromNative(msg) { - var cordova = require('cordova'); - var action = msg.action; - - switch (action) - { - // Button events - case 'backbutton': - case 'menubutton': - case 'searchbutton': - // App life cycle events - case 'pause': - // Volume events - case 'volumedownbutton': - case 'volumeupbutton': - cordova.fireDocumentEvent(action); - break; - case 'resume': - if(arguments.length > 1 && msg.pendingResult) { - if(arguments.length === 2) { - msg.pendingResult.result = arguments[1]; - } else { - // The plugin returned a multipart message - var res = []; - for(var i = 1; i < arguments.length; i++) { - res.push(arguments[i]); - } - msg.pendingResult.result = res; - } - - // Save the plugin result so that it can be delivered to the js - // even if they miss the initial firing of the event - lastResumeEvent = msg; - } - cordova.fireDocumentEvent(action, msg); - break; - default: - throw new Error('Unknown event action ' + action); - } -} - -}); - -// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/plugin/android/app.js -define("cordova/plugin/android/app", function(require, exports, module) { - -var exec = require('cordova/exec'); -var APP_PLUGIN_NAME = Number(require('cordova').platformVersion.split('.')[0]) >= 4 ? 'CoreAndroid' : 'App'; - -module.exports = { - /** - * Clear the resource cache. - */ - clearCache:function() { - exec(null, null, APP_PLUGIN_NAME, "clearCache", []); - }, - - /** - * Load the url into the webview or into new browser instance. - * - * @param url The URL to load - * @param props Properties that can be passed in to the activity: - * wait: int => wait msec before loading URL - * loadingDialog: "Title,Message" => display a native loading dialog - * loadUrlTimeoutValue: int => time in msec to wait before triggering a timeout error - * clearHistory: boolean => clear webview history (default=false) - * openExternal: boolean => open in a new browser (default=false) - * - * Example: - * navigator.app.loadUrl("http://server/myapp/index.html", {wait:2000, loadingDialog:"Wait,Loading App", loadUrlTimeoutValue: 60000}); - */ - loadUrl:function(url, props) { - exec(null, null, APP_PLUGIN_NAME, "loadUrl", [url, props]); - }, - - /** - * Cancel loadUrl that is waiting to be loaded. - */ - cancelLoadUrl:function() { - exec(null, null, APP_PLUGIN_NAME, "cancelLoadUrl", []); - }, - - /** - * Clear web history in this web view. - * Instead of BACK button loading the previous web page, it will exit the app. - */ - clearHistory:function() { - exec(null, null, APP_PLUGIN_NAME, "clearHistory", []); - }, - - /** - * Go to previous page displayed. - * This is the same as pressing the backbutton on Android device. - */ - backHistory:function() { - exec(null, null, APP_PLUGIN_NAME, "backHistory", []); - }, - - /** - * Override the default behavior of the Android back button. - * If overridden, when the back button is pressed, the "backKeyDown" JavaScript event will be fired. - * - * Note: The user should not have to call this method. Instead, when the user - * registers for the "backbutton" event, this is automatically done. - * - * @param override T=override, F=cancel override - */ - overrideBackbutton:function(override) { - exec(null, null, APP_PLUGIN_NAME, "overrideBackbutton", [override]); - }, - - /** - * Override the default behavior of the Android volume button. - * If overridden, when the volume button is pressed, the "volume[up|down]button" - * JavaScript event will be fired. - * - * Note: The user should not have to call this method. Instead, when the user - * registers for the "volume[up|down]button" event, this is automatically done. - * - * @param button volumeup, volumedown - * @param override T=override, F=cancel override - */ - overrideButton:function(button, override) { - exec(null, null, APP_PLUGIN_NAME, "overrideButton", [button, override]); - }, - - /** - * Exit and terminate the application. - */ - exitApp:function() { - return exec(null, null, APP_PLUGIN_NAME, "exitApp", []); - } -}; - -}); - -// file: src/common/pluginloader.js -define("cordova/pluginloader", function(require, exports, module) { - -var modulemapper = require('cordova/modulemapper'); -var urlutil = require('cordova/urlutil'); - -// Helper function to inject a - - - -

Full Screen Test

-
-

Cordova:  

-

Deviceready:  

-
-
- The app should take over the entire screen.
- The top Android status bar should not be shown. -
- - diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/htmlnotfound/error.html b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/htmlnotfound/error.html deleted file mode 100755 index 3852efe..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/htmlnotfound/error.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - Expected Error - - - - - -

Expected Error

-
-

Cordova:  

-

Deviceready:  

-
-
- This is an expected error page because the initial href doesn't exist. - - diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/iframe/index.html b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/iframe/index.html deleted file mode 100755 index c286e24..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/iframe/index.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - Cordova Tests - - - - - - -

IFrame

-
-

Cordova:  

-

Deviceready:  

-
-
- Press the two buttons:
- 1. Google Maps should display in iframe.
- 2. Page 2 replaces current page.
- (NOTE: THIS BEHAVIOR IS WRONG - AND NEEDS TO BE FIXED IN FUTURE RELEASE.) -
- - Google Maps - Page 2 - - diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/iframe/index2.html b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/iframe/index2.html deleted file mode 100755 index b1ca1b0..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/iframe/index2.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - Cordova Tests - - - - - -

IFrame window

-
-

Cordova:  

-

Deviceready:  

-
-
- This should display a Cordova page inside an iframe. The info above should be filled out. - (NOTE: THIS DOES NOT WORK AND NEEDS TO BE FIXED IN FUTURE RELEASE.) -
- - diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/index.html b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/index.html deleted file mode 100755 index 4614826..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/index.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - Cordova Tests - - - - - - - -

Cordova Android Native Tests

-
-

Cordova:  

-

Deviceready:  

-
-
-

Run each of the test activities below:

-
- - - - - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/lifecycle/index.html b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/lifecycle/index.html deleted file mode 100755 index 25fc230..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/lifecycle/index.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - -Lifecycle Page 1 - - - - - - -

Events

-
-

Cordova:  

-

Deviceready:  

-
-
-

Test 1

- Press "Home" button, then return to this app to see pause/resume.
- There should be "Running" entries between pause and resume since app continues to run in the background. -

Test 2

- Press "Load new page" button to load a new Cordova page.
- When returning, you should see -
    -
  • Page2: onunload
  • -
  • Page1: onload
  • -
  • Page1: Running
  • -
-
-
-

Info for event testing:

-
-
- - Load new page - Clear status - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/lifecycle/index2.html b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/lifecycle/index2.html deleted file mode 100755 index 9b22a0d..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/lifecycle/index2.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - -Lifecycle Page 2 - - - - - - -

Events

-
-

Cordova:  

-

Platform:  , Version:  

-

UUID:  , Name:  

-

Width:  , Height:  , Color Depth:

-
-
- You should see
-
    -
  • Page1: onunload
  • -
  • Page2: onload
  • -
  • Page2: Running
  • -
- Press "backbutton" to return to Page 1. -
-
-

Info for event testing:

-
-
- - Load new page - Clear status - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/main.js b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/main.js deleted file mode 100755 index a242139..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/main.js +++ /dev/null @@ -1,27 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -var deviceInfo = function() { - document.getElementById("deviceready").innerHTML = "fired"; - document.getElementById("cordova").innerHTML = cordova.version; -}; - -function init() { - document.addEventListener("deviceready", deviceInfo, true); -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/master.css b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/master.css deleted file mode 100755 index c3e3c45..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/master.css +++ /dev/null @@ -1,136 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - - body { - background:#222 none repeat scroll 0 0; - color:#666; - font-family:Helvetica; - font-size:72%; - line-height:1.5em; - margin:0; - border-top:1px solid #393939; - } - - #info{ - background:#ffa; - border: 1px solid #ffd324; - -webkit-border-radius: 5px; - border-radius: 5px; - clear:both; - margin:15px 6px 0; - width:295px; - padding:4px 0px 2px 10px; - } - - #info > h4{ - font-size:.95em; - margin:5px 0; - } - - #stage.theme{ - padding-top:3px; - } - - /* Definition List */ - #stage.theme > dl{ - padding-top:10px; - clear:both; - margin:0; - list-style-type:none; - padding-left:10px; - overflow:auto; - } - - #stage.theme > dl > dt{ - font-weight:bold; - float:left; - margin-left:5px; - } - - #stage.theme > dl > dd{ - width:45px; - float:left; - color:#a87; - font-weight:bold; - } - - /* Content Styling */ - #stage.theme > h1, #stage.theme > h2, #stage.theme > p{ - margin:1em 0 .5em 13px; - } - - #stage.theme > h1{ - color:#eee; - font-size:1.6em; - text-align:center; - margin:0; - margin-top:15px; - padding:0; - } - - #stage.theme > h2{ - clear:both; - margin:0; - padding:3px; - font-size:1em; - text-align:center; - } - - /* Stage Buttons */ - #stage.theme a.btn{ - border: 1px solid #555; - -webkit-border-radius: 5px; - border-radius: 5px; - text-align:center; - display:block; - float:left; - background:#444; - width:150px; - color:#9ab; - font-size:1.1em; - text-decoration:none; - padding:1.2em 0; - margin:3px 0px 3px 5px; - } - #stage.theme a.btn.large{ - width:308px; - padding:1.2em 0; - } - - /* Stage Buttons */ - #stage.theme button.btn{ - border: 1px solid #555; - -webkit-border-radius: 5px; - border-radius: 5px; - text-align:center; - display:block; - float:left; - background:#444; - width:150px; - color:#9ab; - font-size:1.1em; - text-decoration:none; - padding:1.2em 0; - margin:3px 0px 3px 5px; - } -#stage.theme button.btn.large{ - width:308px; - padding:1.2em 0; - } - diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/whitelist/index.html b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/whitelist/index.html deleted file mode 100755 index b9596c9..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/whitelist/index.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - Cordova Tests - - - - - -

Whitelist Page 1

-
-

Cordova:  

-

Deviceready:  

-
-
- Loading Page 2 should be successful.
- Loading Page 3 should be in web browser.
- Loading Page 2 with target=_blank should be in web browser?
- (THIS DOESN'T HAPPEN.) https://issues.apache.org/jira/browse/CB-362 -
- Page 2 - Page 3 - Page 2 with target=_blank - - diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/whitelist/index2.html b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/whitelist/index2.html deleted file mode 100755 index 5d990ad..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/assets/www/whitelist/index2.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - Cordova Tests - - - - - -

Whitelist Page 2

-
-

Cordova:  

-

Deviceready:  

-
-
- Press "backbutton" -
- - diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/java/org/apache/cordova/unittests/EmbeddedWebViewActivity.java b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/java/org/apache/cordova/unittests/EmbeddedWebViewActivity.java deleted file mode 100644 index 2e60ba5..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/java/org/apache/cordova/unittests/EmbeddedWebViewActivity.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -package org.apache.cordova.unittests; - -import android.content.Intent; -import android.support.v7.app.AppCompatActivity; -import android.os.Bundle; -import android.util.Log; - -import org.apache.cordova.ConfigXmlParser; -import org.apache.cordova.CordovaInterfaceImpl; -import org.apache.cordova.CordovaWebView; -import org.apache.cordova.CordovaWebViewImpl; -import org.apache.cordova.PluginManager; -import org.apache.cordova.engine.SystemWebView; -import org.apache.cordova.engine.SystemWebViewEngine; -import org.json.JSONException; - -public class EmbeddedWebViewActivity extends AppCompatActivity { - - public CordovaWebView webInterface; - private CordovaInterfaceImpl cordovaInterface = new CordovaInterfaceImpl(this); - private String TAG = "CordovaTestActivity"; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - //Set up the webview - ConfigXmlParser parser = new ConfigXmlParser(); - parser.parse(this); - - SystemWebView webView = (SystemWebView) findViewById(R.id.cordovaWebView); - webInterface = new CordovaWebViewImpl(new SystemWebViewEngine(webView)); - webInterface.init(cordovaInterface, parser.getPluginEntries(), parser.getPreferences()); - - webView.loadUrl(parser.getLaunchUrl()); - } - - // This is still required by Cordova - @Override - public void onDestroy() - { - super.onDestroy(); - PluginManager pluginManager = webInterface.getPluginManager(); - if(pluginManager != null) - { - pluginManager.onDestroy(); - } - - } - - /** - * Called when an activity you launched exits, giving you the requestCode you started it with, - * the resultCode it returned, and any additional data from it. - * - * @param requestCode The request code originally supplied to startActivityForResult(), - * allowing you to identify who this result came from. - * @param resultCode The integer result code returned by the child activity through its setResult(). - * @param intent An Intent, which can return result data to the caller (various data can be attached to Intent "extras"). - */ - @Override - protected void onActivityResult(int requestCode, int resultCode, Intent intent) { - super.onActivityResult(requestCode, resultCode, intent); - cordovaInterface.onActivityResult(requestCode, resultCode, intent); - } - - /** - * Called by the system when the user grants permissions! - * - * Note: The fragment gets priority over the activity, since the activity doesn't call - * into the parent onRequestPermissionResult, which is why there's no override. - * - * @param requestCode - * @param permissions - * @param grantResults - */ - public void onRequestPermissionsResult(int requestCode, String permissions[], - int[] grantResults) { - try - { - cordovaInterface.onRequestPermissionResult(requestCode, permissions, grantResults); - } - catch (JSONException e) - { - Log.d(TAG, "JSONException: Parameters fed into the method are not valid"); - e.printStackTrace(); - } - - } - -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/java/org/apache/cordova/unittests/LifeCyclePlugin.java b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/java/org/apache/cordova/unittests/LifeCyclePlugin.java deleted file mode 100644 index deaf74d..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/java/org/apache/cordova/unittests/LifeCyclePlugin.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ -package org.apache.cordova.unittests; - -import org.apache.cordova.CordovaPlugin; -import org.apache.cordova.LOG; - -public class LifeCyclePlugin extends CordovaPlugin { - - static String TAG = "LifeCyclePlugin"; - String calls = ""; - - @Override - public void onStart() { - calls += "start,"; - LOG.d(TAG, "onStart"); - } - @Override - public void onPause(boolean multitasking) { - calls += "pause,"; - LOG.d(TAG, "onPause"); - } - @Override - public void onResume(boolean multitasking) { - calls += "resume,"; - LOG.d(TAG, "onResume"); - } - @Override - public void onStop() { - calls += "stop,"; - LOG.d(TAG, "onStop"); - } -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/java/org/apache/cordova/unittests/StandardActivity.java b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/java/org/apache/cordova/unittests/StandardActivity.java deleted file mode 100644 index 9e7cce9..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/java/org/apache/cordova/unittests/StandardActivity.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -package org.apache.cordova.unittests; - -import android.os.Bundle; - -import org.apache.cordova.CordovaActivity; - -public class StandardActivity extends CordovaActivity { - - @Override - public void onCreate(Bundle savedInstanceState) - { - super.onCreate(savedInstanceState); - - // enable Cordova apps to be started in the background - Bundle extras = getIntent().getExtras(); - if (extras != null && extras.getBoolean("cdvStartInBackground", false)) { - moveTaskToBack(true); - } - - // Set by in config.xml - loadUrl(launchUrl); - } -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/java/org/apache/cordova/unittests/TestActivity.java b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/java/org/apache/cordova/unittests/TestActivity.java deleted file mode 100644 index 024a131..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/java/org/apache/cordova/unittests/TestActivity.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -package org.apache.cordova.unittests; - -import android.os.Bundle; - -import org.apache.cordova.CordovaActivity; -import org.apache.cordova.CordovaWebView; - -import java.util.concurrent.ArrayBlockingQueue; -import java.util.concurrent.RunnableFuture; - -/** - * The purpose of this activity is to allow the test framework to manipulate the start url, which - * is normally locked down by CordovaActivity to standard users who aren't editing their Java code. - */ - -public class TestActivity extends CordovaActivity { - - public final ArrayBlockingQueue onPageFinishedUrl = new ArrayBlockingQueue(500); - - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - // enable Cordova apps to be started in the background - Bundle extras = getIntent().getExtras(); - if (extras != null) { - if (extras.getBoolean("cdvStartInBackground", false)) { - moveTaskToBack(true); - } - launchUrl = extras.getString("startUrl", "index.html"); - } - - // Set by in config.xml - loadUrl(launchUrl); - } - - @Override - public Object onMessage(String id, Object data) { - if ("onPageFinished".equals(id)) { - onPageFinishedUrl.add((String) data); - } - return super.onMessage(id, data); - } - - public CordovaWebView getWebInterface() { return this.appView; } - -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/layout/activity_main.xml b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/layout/activity_main.xml deleted file mode 100644 index 7cbd51d..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/mipmap-hdpi/ic_launcher.png b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index cde69bc..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/mipmap-mdpi/ic_launcher.png b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index c133a0c..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index bfa42f0..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index 324e72c..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index aee44e1..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/values-w820dp/dimens.xml b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/values-w820dp/dimens.xml deleted file mode 100644 index a1a90b9..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/values-w820dp/dimens.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - 64dp - diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/values/colors.xml b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/values/colors.xml deleted file mode 100644 index b184be6..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/values/colors.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - #3F51B5 - #303F9F - #FF4081 - diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/values/dimens.xml b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/values/dimens.xml deleted file mode 100644 index 8f9a14a..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/values/dimens.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - 16dp - 16dp - diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/values/strings.xml b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/values/strings.xml deleted file mode 100644 index 353e3ab..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/values/strings.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - UnitTests - diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/values/styles.xml b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/values/styles.xml deleted file mode 100644 index ae304da..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/xml/config.xml b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/xml/config.xml deleted file mode 100644 index a824011..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/main/res/xml/config.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - Hello Cordova - - A sample Apache Cordova application that responds to the deviceready event. - - - Apache Cordova Team - - - - - - - - - - - - - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/test/java/org/apache/cordova/unittests/NativeToJsMessageQueueTest.java b/chabok-starter-cordova/node_modules/cordova-android/test/app/src/test/java/org/apache/cordova/unittests/NativeToJsMessageQueueTest.java deleted file mode 100644 index dc7bb67..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/app/src/test/java/org/apache/cordova/unittests/NativeToJsMessageQueueTest.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -package org.apache.cordova.unittests; - -import android.app.Activity; -import android.content.Intent; -import android.view.View; -import android.webkit.ValueCallback; - -import org.apache.cordova.CordovaInterface; -import org.apache.cordova.CordovaPlugin; -import org.apache.cordova.CordovaResourceApi; -import org.apache.cordova.CordovaWebView; -import org.apache.cordova.CordovaWebViewEngine; -import org.apache.cordova.ICordovaCookieManager; -import org.apache.cordova.NativeToJsMessageQueue; -import org.apache.cordova.PluginManager; -import org.apache.cordova.PluginResult; -import org.apache.cordova.engine.SystemWebViewEngine; -import org.json.JSONException; -import org.json.JSONObject; -import org.junit.Before; -import org.junit.Test; - -import java.util.ArrayList; -import java.util.concurrent.ExecutorService; - -import static org.junit.Assert.*; - -public class NativeToJsMessageQueueTest { - - NativeToJsMessageQueue queue = new NativeToJsMessageQueue(); - private String TEST_CALLBACK_ID = "MessageQueueTest"; - - //A queue with no bridges should not work - @Test - public void testEmptyBridge() - { - assertFalse(queue.isBridgeEnabled()); - } - - - //A queue with at least one bridge should work, using Eval Bridge - @Test - public void testEnabledBridge() - { - NativeToJsMessageQueue.BridgeMode bridge; - bridge = new NativeToJsMessageQueue.NoOpBridgeMode(); - queue.addBridgeMode(bridge); - queue.setBridgeMode(0); - assertTrue(queue.isBridgeEnabled()); - } - - //This test is for the undocumented encoding system setup for the bridge - //TODO: Document how the non-Javascript bridges are supposed to work - @Test - public void testPopAndEncode() - { - NativeToJsMessageQueue.BridgeMode bridge; - bridge = new NativeToJsMessageQueue.NoOpBridgeMode(); - queue.addBridgeMode(bridge); - queue.setBridgeMode(0); - - PluginResult result = new PluginResult(PluginResult.Status.OK); - queue.addPluginResult(result, TEST_CALLBACK_ID); - assertFalse(queue.isEmpty()); - String resultString = queue.popAndEncode(false); - String [] results = resultString.split(" "); - assertEquals(TEST_CALLBACK_ID, results[2]); - } - - //This test is for the evalBridge, which directly calls cordova.callbackFromNative, skipping - //platform specific NativeToJs code - @Test - public void testBasicPopAndEncodeAsJs() - { - NativeToJsMessageQueue.BridgeMode bridge; - bridge = new NativeToJsMessageQueue.NoOpBridgeMode(); - queue.addBridgeMode(bridge); - queue.setBridgeMode(0); - - PluginResult result = new PluginResult(PluginResult.Status.OK); - queue.addPluginResult(result, TEST_CALLBACK_ID); - assertFalse(queue.isEmpty()); - String resultString = queue.popAndEncodeAsJs(); - assertTrue(resultString.startsWith("cordova.callbackFromNative")); - } - - //This test is for the evalBridge, which directly calls cordova.callbackFromNative, skipping - //platform specific NativeToJs code - @Test - public void testStringPopAndEncodeAsJs() - { - NativeToJsMessageQueue.BridgeMode bridge; - bridge = new NativeToJsMessageQueue.NoOpBridgeMode(); - queue.addBridgeMode(bridge); - queue.setBridgeMode(0); - - PluginResult result = new PluginResult(PluginResult.Status.OK, "String Plugin Result"); - queue.addPluginResult(result, TEST_CALLBACK_ID); - assertFalse(queue.isEmpty()); - String resultString = queue.popAndEncodeAsJs(); - assertTrue(resultString.startsWith("cordova.callbackFromNative")); - } - - //This test is for the evalBridge, which directly calls cordova.callbackFromNative, skipping - //platform specific NativeToJs code - @Test - public void testJsonPopAndEncodeAsJs() - { - NativeToJsMessageQueue.BridgeMode bridge; - bridge = new NativeToJsMessageQueue.NoOpBridgeMode(); - queue.addBridgeMode(bridge); - queue.setBridgeMode(0); - - JSONObject object = new JSONObject(); - try { - object.put("test", "value"); - } catch (JSONException e) { - e.printStackTrace(); - } - PluginResult result = new PluginResult(PluginResult.Status.OK, object); - queue.addPluginResult(result, TEST_CALLBACK_ID); - assertFalse(queue.isEmpty()); - String resultString = queue.popAndEncodeAsJs(); - assertTrue(resultString.startsWith("cordova.callbackFromNative")); - } - - //This test is for the evalBridge, which directly calls cordova.callbackFromNative, skipping - //platform specific NativeToJs code - @Test - public void testMultipartPopAndEncodeAsJs() - { - ArrayList multiparts = new ArrayList(); - for (int i=0; i<5; i++) { - multiparts.add(new PluginResult(PluginResult.Status.OK, i)); - } - PluginResult multipartresult = new PluginResult(PluginResult.Status.OK, multiparts); - NativeToJsMessageQueue queue = new NativeToJsMessageQueue(); - queue.addBridgeMode(new NativeToJsMessageQueue.NoOpBridgeMode()); - queue.setBridgeMode(0); - queue.addPluginResult(multipartresult, "37"); - String result = queue.popAndEncodeAsJs(); - assertEquals(result, "cordova.callbackFromNative('37',true,1,[0,1,2,3,4],false);"); - } - - @Test - public void testNullPopAndEncodeAsJs() - { - NativeToJsMessageQueue queue = new NativeToJsMessageQueue(); - queue.addBridgeMode(new NativeToJsMessageQueue.NoOpBridgeMode()); - queue.setBridgeMode(0); - - PluginResult result = new PluginResult(PluginResult.Status.OK, (String)null); - queue.addPluginResult(result, TEST_CALLBACK_ID); - assertFalse(queue.isEmpty()); - String resultString = queue.popAndEncodeAsJs(); - assertEquals(resultString, "cordova.callbackFromNative('" + TEST_CALLBACK_ID + "',true,1,[null],false);"); - } -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/build.gradle b/chabok-starter-cordova/node_modules/cordova-android/test/build.gradle deleted file mode 100644 index c9bf1e7..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/build.gradle +++ /dev/null @@ -1,44 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - - classpath 'com.android.tools.build:gradle:3.3.0' - } -} - -allprojects { - repositories { - google() - jcenter() - } -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/gradle.properties b/chabok-starter-cordova/node_modules/cordova-android/test/gradle.properties deleted file mode 100644 index aac7c9b..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/gradle.properties +++ /dev/null @@ -1,17 +0,0 @@ -# Project-wide Gradle settings. - -# IDE (e.g. Android Studio) users: -# Gradle settings configured through the IDE *will override* -# any settings specified in this file. - -# For more details on how to configure your build environment visit -# http://www.gradle.org/docs/current/userguide/build_environment.html - -# Specifies the JVM arguments used for the daemon process. -# The setting is particularly useful for tweaking memory settings. -org.gradle.jvmargs=-Xmx1536m - -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/run_java_unit_tests.js b/chabok-starter-cordova/node_modules/cordova-android/test/run_java_unit_tests.js deleted file mode 100644 index 3f99d28..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/run_java_unit_tests.js +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env node - -/* - 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 Q = require('q'); -var path = require('path'); -var superspawn = require('cordova-common').superspawn; -var ProjectBuilder = require('../bin/templates/cordova/lib/builders/ProjectBuilder'); - -Q.resolve() - .then(_ => console.log('Preparing Gradle wrapper for Java unit tests.')) - .then(_ => new ProjectBuilder(__dirname).runGradleWrapper('gradle')) - .then(_ => gradlew('--version')) - - .then(_ => console.log('Gradle wrapper is ready. Running tests now.')) - .then(_ => gradlew('test')) - .then(_ => console.log('Java unit tests completed successfully.')); - -process.on('unhandledRejection', err => { - // If err has a stderr property, we have seen the message already - if (!('stderr' in err)) console.error(err.message); - console.error('JAVA UNIT TESTS FAILED!'); - process.exitCode = err.code || 1; -}); - -function gradlew () { - const wrapperPath = path.join(__dirname, 'gradlew'); - return superspawn.spawn(wrapperPath, Array.from(arguments), { - stdio: 'inherit', - cwd: __dirname - }); -} diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/settings.gradle b/chabok-starter-cordova/node_modules/cordova-android/test/settings.gradle deleted file mode 100644 index 5236022..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/settings.gradle +++ /dev/null @@ -1,21 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -include ':app' -include ":CordovaLib" -project(':CordovaLib').projectDir = new File('../framework') diff --git a/chabok-starter-cordova/node_modules/cordova-android/test/wrapper.gradle b/chabok-starter-cordova/node_modules/cordova-android/test/wrapper.gradle deleted file mode 100644 index 5dd3dbc..0000000 --- a/chabok-starter-cordova/node_modules/cordova-android/test/wrapper.gradle +++ /dev/null @@ -1,21 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -wrapper { - gradleVersion = '4.10.3' -} diff --git a/chabok-starter-cordova/node_modules/cordova-common/.eslintignore b/chabok-starter-cordova/node_modules/cordova-common/.eslintignore deleted file mode 100644 index d606f61..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -spec/fixtures/* diff --git a/chabok-starter-cordova/node_modules/cordova-common/.eslintrc.yml b/chabok-starter-cordova/node_modules/cordova-common/.eslintrc.yml deleted file mode 100644 index 92aaf67..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/.eslintrc.yml +++ /dev/null @@ -1,10 +0,0 @@ -root: true -extends: semistandard -rules: - indent: - - error - - 4 - camelcase: off - no-unused-vars: - - error - - args: after-used diff --git a/chabok-starter-cordova/node_modules/cordova-common/.github/ISSUE_TEMPLATE.md b/chabok-starter-cordova/node_modules/cordova-common/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 3220c25..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,42 +0,0 @@ - - -### Issue Type - - -- [ ] Bug Report -- [ ] Feature Request -- [ ] Support Question - -## Description - -## Information - - -### Command or Code - - -### Environment, Platform, Device - - - - -### Version information - - - - -## Checklist - - -- [ ] I searched for already existing GitHub issues about this -- [ ] I updated all Cordova tooling to their most recent version -- [ ] I included all the necessary information above diff --git a/chabok-starter-cordova/node_modules/cordova-common/.github/ISSUE_TEMPLATE/BUG_REPORT.md b/chabok-starter-cordova/node_modules/cordova-common/.github/ISSUE_TEMPLATE/BUG_REPORT.md deleted file mode 100644 index bd8a3ac..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/.github/ISSUE_TEMPLATE/BUG_REPORT.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -name: 🐛 Bug Report -about: If something isn't working as expected. - ---- - -# Bug Report - -## Problem - -### What is expected to happen? - - - -### What does actually happen? - - - -## Information - - - - -### Command or Code - - - - -### Environment, Platform, Device - - - - -### Version information - - - - -## Checklist - - -- [ ] I searched for existing GitHub issues -- [ ] I updated all Cordova tooling to most recent version -- [ ] I included all the necessary information above diff --git a/chabok-starter-cordova/node_modules/cordova-common/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md b/chabok-starter-cordova/node_modules/cordova-common/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md deleted file mode 100644 index 381fc8a..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -name: 🚀 Feature Request -about: A suggestion for a new functionality - ---- - -# Feature Request - -## Motivation Behind Feature - - - - -## Feature Description - - - - -## Alternatives or Workarounds - - - diff --git a/chabok-starter-cordova/node_modules/cordova-common/.github/ISSUE_TEMPLATE/SUPPORT_QUESTION.md b/chabok-starter-cordova/node_modules/cordova-common/.github/ISSUE_TEMPLATE/SUPPORT_QUESTION.md deleted file mode 100644 index 516c6e6..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/.github/ISSUE_TEMPLATE/SUPPORT_QUESTION.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -name: 💬 Support Question -about: If you have a question, please check out our Slack or StackOverflow! - ---- - - - -Apache Cordova uses GitHub Issues as a feature request and bug tracker _only_. -For usage and support questions, please check out the resources below. Thanks! - ---- - -You can get answers to your usage and support questions about **Apache Cordova** on: - -* Slack Community Chat: https://cordova.slack.com (you can sign-up at http://slack.cordova.io/) -* StackOverflow: https://stackoverflow.com/questions/tagged/cordova using the tag `cordova` - ---- - -If you are using a tool that uses Cordova internally, like e.g. Ionic, check their support channels: - -* **Ionic Framework** - * [Ionic Community Forum](https://forum.ionicframework.com/) - * [Ionic Worldwide Slack](https://ionicworldwide.herokuapp.com/) -* **PhoneGap** - * [PhoneGap Developer Community](https://forums.adobe.com/community/phonegap) diff --git a/chabok-starter-cordova/node_modules/cordova-common/.github/PULL_REQUEST_TEMPLATE.md b/chabok-starter-cordova/node_modules/cordova-common/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 712b2ff..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,35 +0,0 @@ - - -### Platforms affected - - - -### Motivation and Context - - - - - -### Description - - - - -### Testing - - - - -### Checklist - -- [ ] I've run the tests to see all new and existing tests pass -- [ ] I added automated test coverage as appropriate for this change -- [ ] Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`) -- [ ] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/)) -- [ ] I've updated the documentation if necessary diff --git a/chabok-starter-cordova/node_modules/cordova-common/.ratignore b/chabok-starter-cordova/node_modules/cordova-common/.ratignore deleted file mode 100644 index 6ad2449..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/.ratignore +++ /dev/null @@ -1,5 +0,0 @@ -fixtures -coverage -jasmine.json -appveyor.yml -package-lock.json diff --git a/chabok-starter-cordova/node_modules/cordova-common/.travis.yml b/chabok-starter-cordova/node_modules/cordova-common/.travis.yml deleted file mode 100644 index 2361f5d..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: node_js -sudo: false - -git: - depth: 10 - -node_js: - - 6 - - 8 - - 10 - - 12 - -install: - - npm install - - npm install -g codecov - -script: - - npm test - - npm run cover - -after_script: - - codecov diff --git a/chabok-starter-cordova/node_modules/cordova-common/README.md b/chabok-starter-cordova/node_modules/cordova-common/README.md deleted file mode 100644 index 422c98b..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/README.md +++ /dev/null @@ -1,155 +0,0 @@ - - -[![Build status](https://ci.appveyor.com/api/projects/status/wxkmo0jalsr8gane?svg=true)](https://ci.appveyor.com/project/ApacheSoftwareFoundation/cordova-common/branch/master) -[![Build Status](https://travis-ci.org/apache/cordova-common.svg?branch=master)](https://travis-ci.org/apache/cordova-common) -[![NPM](https://nodei.co/npm/cordova-common.png)](https://nodei.co/npm/cordova-common/) - -# cordova-common -Exposes shared functionality used by [cordova-lib](https://github.com/apache/cordova-lib/) and Cordova platforms. -## Exposed APIs - -### `events` - -Represents special instance of NodeJS EventEmitter which is intended to be used to post events to cordova-lib and cordova-cli - -Usage: -```js -var events = require('cordova-common').events; -events.emit('warn', 'Some warning message') -``` - -There are the following events supported by cordova-cli: `verbose`, `log`, `info`, `warn`, `error`. - -### `CordovaError` - -An error class used by Cordova to throw cordova-specific errors. The CordovaError class is inherited from Error, so CordovaError instances is also valid Error instances (`instanceof` check succeeds). - -Usage: - -```js -var CordovaError = require('cordova-common').CordovaError; -throw new CordovaError('Some error message', SOME_ERR_CODE); -``` - -See [CordovaError](src/CordovaError/CordovaError.js) for supported error codes. - -### `ConfigParser` - -Exposes functionality to deal with cordova project `config.xml` files. For ConfigParser API reference check [ConfigParser Readme](src/ConfigParser/README.md). - -Usage: -```js -var ConfigParser = require('cordova-common').ConfigParser; -var appConfig = new ConfigParser('path/to/cordova-app/config.xml'); -console.log(appconfig.name() + ':' + appConfig.version()); -``` - -### `PluginInfoProvider` and `PluginInfo` - -`PluginInfo` is a wrapper for cordova plugins' `plugin.xml` files. This class may be instantiated directly or via `PluginInfoProvider`. The difference is that `PluginInfoProvider` caches `PluginInfo` instances based on plugin source directory. - -Usage: -```js -var PluginInfo: require('cordova-common').PluginInfo; -var PluginInfoProvider: require('cordova-common').PluginInfoProvider; - -// The following instances are equal -var plugin1 = new PluginInfo('path/to/plugin_directory'); -var plugin2 = new PluginInfoProvider().get('path/to/plugin_directory'); - -console.log('The plugin ' + plugin1.id + ' has version ' + plugin1.version) -``` - -### `ActionStack` - -Utility module for dealing with sequential tasks. Provides a set of tasks that are needed to be done and reverts all tasks that are already completed if one of those tasks fail to complete. Used internally by cordova-lib and platform's plugin installation routines. - -Usage: -```js -var ActionStack = require('cordova-common').ActionStack; -var stack = new ActionStack() - -var action1 = stack.createAction(task1, [], task1_reverter, []); -var action2 = stack.createAction(task2, [], task2_reverter, []); - -stack.push(action1); -stack.push(action2); - -stack.process() -.then(function() { - // all actions succeded -}) -.catch(function(error){ - // One of actions failed with error -}) -``` - -### `superspawn` - -Module for spawning child processes with some advanced logic. - -Usage: -```js -var superspawn = require('cordova-common').superspawn; -superspawn.spawn('adb', ['devices']) -.progress(function(data){ - if (data.stderr) - console.error('"adb devices" raised an error: ' + data.stderr); -}) -.then(function(devices){ - // Do something... -}) -``` - -### `xmlHelpers` - -A set of utility methods for dealing with XML files. - -Usage: -```js -var xml = require('cordova-common').xmlHelpers; - -var xmlDoc1 = xml.parseElementtreeSync('some/xml/file'); -var xmlDoc2 = xml.parseElementtreeSync('another/xml/file'); - -xml.mergeXml(doc1, doc2); // doc2 now contains all the nodes from doc1 -``` - -### Other APIs - -The APIs listed below are also exposed but are intended to be only used internally by cordova plugin installation routines. - -``` -PlatformJson -ConfigChanges -ConfigKeeper -ConfigFile -mungeUtil -``` - -## Setup -* Clone this repository onto your local machine - `git clone https://github.com/apache/cordova-common.git` -* Navigate to cordova-common directory, install dependencies and npm-link - `cd cordova-common && npm install && npm link` -* Navigate to cordova-lib directory and link cordova-common - `cd && npm link cordova-common && npm install` diff --git a/chabok-starter-cordova/node_modules/cordova-common/RELEASENOTES.md b/chabok-starter-cordova/node_modules/cordova-common/RELEASENOTES.md deleted file mode 100644 index 139eec2..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/RELEASENOTES.md +++ /dev/null @@ -1,175 +0,0 @@ - -# Cordova-common Release Notes - -### 3.2.1 (Oct 28, 2019) - -* [GH-78](https://github.com/apache/cordova-common/pull/78) (windows) Add `.jsproj` as file extension for XML files ([GH-62](https://github.com/apache/cordova-common/pull/62)) -* [GH-89](https://github.com/apache/cordova-common/pull/89) revert: ([GH-24](https://github.com/apache/cordova-common/pull/24)) [CB-14108](https://issues.apache.org/jira/browse/CB-14108) fix incorrect count in `config_munge` -* [GH-82](https://github.com/apache/cordova-common/pull/82) General cleanup with eslint updates -* [GH-86](https://github.com/apache/cordova-common/pull/86) eslint cleanup fixes: `operator-linebreak` -* [GH-81](https://github.com/apache/cordova-common/pull/81) remove `no-throw-literal` lint exception not needed -* [GH-83](https://github.com/apache/cordova-common/pull/83) Fix ESLint violations where applicable -* [GH-80](https://github.com/apache/cordova-common/pull/80) Update to jasmine 3.4 & fix resulting spec failures -* [GH-79](https://github.com/apache/cordova-common/pull/79) Promise handling cleanup in specs -* [GH-77](https://github.com/apache/cordova-common/pull/77) Do not ignore AppVeyor failures on Node.js 12 - -### 3.2.0 (Jun 12, 2019) -* (ios) plist document not indented with tabs ([#69](https://github.com/apache/cordova-common/pull/69)) -* Update fs-extra to v8 ([#70](https://github.com/apache/cordova-common/pull/70)) -* Add example usage of podspec declarations ([#67](https://github.com/apache/cordova-common/pull/67)) -* implement setPreference and setPlatformPreference ([#63](https://github.com/apache/cordova-common/pull/63)) -* Catch leaked exceptions in superspawn and convert them to rejections ([#66](https://github.com/apache/cordova-common/pull/66)) - -### 3.1.0 (Dec 24, 2018) -* Update Cordova events into a real singleton class ([#60](https://github.com/apache/cordova-common/pull/60)) -* Refactor CordovaLogger to singleton class ([#53](https://github.com/apache/cordova-common/pull/53)) - -### 3.0.0 (Nov 05, 2018) -* [CB-14166](https://issues.apache.org/jira/browse/CB-14166) Use `cross-spawn` for platform-independent spawning -* add `PluginInfo.getPodSpecs` method -* [CB-13496](https://issues.apache.org/jira/browse/CB-13496) Fix greedy regex in plist-helpers -* [CB-14108](https://issues.apache.org/jira/browse/CB-14108) fix incorrect count in config_munge in ios.json and android.json -* [CB-13685](https://issues.apache.org/jira/browse/CB-13685) **Android**: Update ConfigParser for Adaptive Icons -* [CB-10071](https://issues.apache.org/jira/browse/CB-10071) Add BridgingHeader type attributes for header-file -* [CB-12016](https://issues.apache.org/jira/browse/CB-12016) Removed cordova-registry-mapper dependency -* [CB-14099](https://issues.apache.org/jira/browse/CB-14099) **osx**: Fixed Resolve Config Path for OSX -* [CB-14140](https://issues.apache.org/jira/browse/CB-14140) Replace shelljs calls with fs-extra & which - -### 2.2.2 (May 30, 2018) -* [CB-13979](https://issues.apache.org/jira/browse/CB-13979) More consistency for `config.xml` lookups -* [CB-14064](https://issues.apache.org/jira/browse/CB-14064) Remove Node 4 from CI matrix -* [CB-14088](https://issues.apache.org/jira/browse/CB-14088) Update dependencies -* [CB-11691](https://issues.apache.org/jira/browse/CB-11691) Fix for modifying binary plists -* [CB-13770](https://issues.apache.org/jira/browse/CB-13770) Warn when or not found -* [CB-13471](https://issues.apache.org/jira/browse/CB-13471) Fix tests and path issues for **Windows** -* [CB-13471](https://issues.apache.org/jira/browse/CB-13471) added unit test for config file provider -* [CB-13744](https://issues.apache.org/jira/browse/CB-13744) Recognize storyboards as XML files -* [CB-13674](https://issues.apache.org/jira/browse/CB-13674) Incremented package version to -dev - -### 2.2.1 (Dec 14, 2017) -* [CB-13674](https://issues.apache.org/jira/browse/CB-13674): updated dependencies - -### 2.2.0 (Nov 22, 2017) -* [CB-13471](https://issues.apache.org/jira/browse/CB-13471) File Provider fix belongs in cordova-common -* [CB-11244](https://issues.apache.org/jira/browse/CB-11244) Spot fix for upcoming `cordova-android@7` changes. https://github.com/apache/cordova-android/pull/389 - -### 2.1.1 (Oct 04, 2017) -* [CB-13145](https://issues.apache.org/jira/browse/CB-13145) added `getFrameworks` to unit tests -* [CB-13145](https://issues.apache.org/jira/browse/CB-13145) added variable replacing to framework tag - -### 2.1.0 (August 30, 2017) -* [CB-13145](https://issues.apache.org/jira/browse/CB-13145) added variable replacing to `framework` tag -* [CB-13211](https://issues.apache.org/jira/browse/CB-13211) Add `allows-arbitrary-loads-for-media` attribute parsing for `getAccesses` -* [CB-11968](https://issues.apache.org/jira/browse/CB-11968) Added support for `` in `config.xml` -* [CB-12895](https://issues.apache.org/jira/browse/CB-12895) set up `eslint` and removed `jshint` -* [CB-12785](https://issues.apache.org/jira/browse/CB-12785) added `.gitignore`, `travis`, and `appveyor` support -* [CB-12250](https://issues.apache.org/jira/browse/CB-12250) & [CB-12409](https://issues.apache.org/jira/browse/CB-12409) *iOS*: Fix bug with escaping properties from `plist` file -* [CB-12762](https://issues.apache.org/jira/browse/CB-12762) updated `common`, `fetch`, and `serve` `pkgJson` to point `pkgJson` repo items to github mirrors -* [CB-12766](https://issues.apache.org/jira/browse/CB-12766) Consistently write `JSON` with 2 spaces indentation - -### 2.0.3 (May 02, 2017) -* [CB-8978](https://issues.apache.org/jira/browse/CB-8978) Add option to get `resource-file` from `root` -* [CB-11908](https://issues.apache.org/jira/browse/CB-11908) Add tests for `edit-config` in `config.xml` -* [CB-12665](https://issues.apache.org/jira/browse/CB-12665) removed `enginestrict` since it is deprecated - -### 2.0.2 (Apr 14, 2017) -* [CB-11233](https://issues.apache.org/jira/browse/CB-11233) - Support installing frameworks into 'Embedded Binaries' section of the Xcode project -* [CB-10438](https://issues.apache.org/jira/browse/CB-10438) - Install correct dependency version. Removed shell.remove, added pkg.json to dependency tests 1-3, and updated install.js (.replace) to fix tests in uninstall.spec.js and update to workw with jasmine 2.0 -* [CB-11120](https://issues.apache.org/jira/browse/CB-11120) - Allow short/display name in config.xml -* [CB-11346](https://issues.apache.org/jira/browse/CB-11346) - Remove known platforms check -* [CB-11977](https://issues.apache.org/jira/browse/CB-11977) - updated engines and enginescript for common, fetch, and serve - -### 2.0.1 (Mar 09, 2017) -* [CB-12557](https://issues.apache.org/jira/browse/CB-12557) add both stdout and stderr properties to the error object passed to superspawn reject handler. - -### 2.0.0 (Jan 17, 2017) -* [CB-8978](https://issues.apache.org/jira/browse/CB-8978) Add `resource-file` parsing to `config.xml` -* [CB-12018](https://issues.apache.org/jira/browse/CB-12018): updated `jshint` and updated tests to work with `jasmine@2` instead of `jasmine-node` -* [CB-12163](https://issues.apache.org/jira/browse/CB-12163) Add reference attrib to `resource-file` for **Windows** -* Move windows-specific logic to `cordova-windows` -* [CB-12189](https://issues.apache.org/jira/browse/CB-12189) Add implementation attribute to framework - -### 1.5.1 (Oct 12, 2016) -* [CB-12002](https://issues.apache.org/jira/browse/CB-12002) Add `getAllowIntents()` to `ConfigParser` -* [CB-11998](https://issues.apache.org/jira/browse/CB-11998) `cordova platform add` error with `cordova-common@1.5.0` - -### 1.5.0 (Oct 06, 2016) -* [CB-11776](https://issues.apache.org/jira/browse/CB-11776) Add test case for different `edit-config` targets -* [CB-11908](https://issues.apache.org/jira/browse/CB-11908) Add `edit-config` to `config.xml` -* [CB-11936](https://issues.apache.org/jira/browse/CB-11936) Support four new **App Transport Security (ATS)** keys -* update `config.xml` location if it is a **Android Studio** project. -* use `array` methods and `object.keys` for iterating. avoiding `for-in` loops -* [CB-11517](https://issues.apache.org/jira/browse/CB-11517) Allow `.folder` matches -* [CB-11776](https://issues.apache.org/jira/browse/CB-11776) check `edit-config` target exists - -### 1.4.1 (Aug 09, 2016) -* Add general purpose `ConfigParser.getAttribute` API -* [CB-11653](https://issues.apache.org/jira/browse/CB-11653) moved `findProjectRoot` from `cordova-lib` to `cordova-common` -* [CB-11636](https://issues.apache.org/jira/browse/CB-11636) Handle attributes with quotes correctly -* [CB-11645](https://issues.apache.org/jira/browse/CB-11645) added check to see if `getEditConfig` exists before trying to use it -* [CB-9825](https://issues.apache.org/jira/browse/CB-9825) framework tag spec parsing - -### 1.4.0 (Jul 12, 2016) -* [CB-11023](https://issues.apache.org/jira/browse/CB-11023) Add edit-config functionality - -### 1.3.0 (May 12, 2016) -* [CB-11259](https://issues.apache.org/jira/browse/CB-11259): Improving prepare and build logging -* [CB-11194](https://issues.apache.org/jira/browse/CB-11194) Improve cordova load time -* [CB-1117](https://issues.apache.org/jira/browse/CB-1117) Add `FileUpdater` module to `cordova-common`. -* [CB-11131](https://issues.apache.org/jira/browse/CB-11131) Fix `TypeError: message.toUpperCase` is not a function in `CordovaLogger` - -### 1.2.0 (Apr 18, 2016) -* [CB-11022](https://issues.apache.org/jira/browse/CB-11022) Save modulesMetadata to both www and platform_www when necessary -* [CB-10833](https://issues.apache.org/jira/browse/CB-10833) Deduplicate common logic for plugin installation/uninstallation -* [CB-10822](https://issues.apache.org/jira/browse/CB-10822) Manage plugins/modules metadata using PlatformJson -* [CB-10940](https://issues.apache.org/jira/browse/CB-10940) Can't add Android platform from path -* [CB-10965](https://issues.apache.org/jira/browse/CB-10965) xml helper allows multiple instances to be merge in config.xml - -### 1.1.1 (Mar 18, 2016) -* [CB-10694](https://issues.apache.org/jira/browse/CB-10694) Update test to reflect merging of [CB-9264](https://issues.apache.org/jira/browse/CB-9264) fix -* [CB-10694](https://issues.apache.org/jira/browse/CB-10694) Platform-specific configuration preferences don't override global settings -* [CB-9264](https://issues.apache.org/jira/browse/CB-9264) Duplicate entries in `config.xml` -* [CB-10791](https://issues.apache.org/jira/browse/CB-10791) Add `adjustLoggerLevel` to `cordova-common.CordovaLogger` -* [CB-10662](https://issues.apache.org/jira/browse/CB-10662) Add tests for `ConfigParser.getStaticResources` -* [CB-10622](https://issues.apache.org/jira/browse/CB-10622) fix target attribute being ignored for images in `config.xml`. -* [CB-10583](https://issues.apache.org/jira/browse/CB-10583) Protect plugin preferences from adding extra Array properties. - -### 1.1.0 (Feb 16, 2016) -* [CB-10482](https://issues.apache.org/jira/browse/CB-10482) Remove references to windows8 from cordova-lib/cli -* [CB-10430](https://issues.apache.org/jira/browse/CB-10430) Adds forwardEvents method to easily connect two EventEmitters -* [CB-10176](https://issues.apache.org/jira/browse/CB-10176) Adds CordovaLogger class, based on logger module from cordova-cli -* [CB-10052](https://issues.apache.org/jira/browse/CB-10052) Expose child process' io streams via promise progress notification -* [CB-10497](https://issues.apache.org/jira/browse/CB-10497) Prefer .bat over .cmd on windows platform -* [CB-9984](https://issues.apache.org/jira/browse/CB-9984) Bumps plist version and fixes failing cordova-common test - -### 1.0.0 (Oct 29, 2015) - -* [CB-9890](https://issues.apache.org/jira/browse/CB-9890) Documents cordova-common -* [CB-9598](https://issues.apache.org/jira/browse/CB-9598) Correct cordova-lib -> cordova-common in README -* Pick ConfigParser changes from apache@0c3614e -* [CB-9743](https://issues.apache.org/jira/browse/CB-9743) Removes system frameworks handling from ConfigChanges -* [CB-9598](https://issues.apache.org/jira/browse/CB-9598) Cleans out code which has been moved to `cordova-common` -* Pick ConfigParser changes from apache@ddb027b -* Picking CordovaError changes from apache@a3b1fca -* [CB-9598](https://issues.apache.org/jira/browse/CB-9598) Adds tests and fixtures based on existing cordova-lib ones -* [CB-9598](https://issues.apache.org/jira/browse/CB-9598) Initial implementation for cordova-common - diff --git a/chabok-starter-cordova/node_modules/cordova-common/appveyor.yml b/chabok-starter-cordova/node_modules/cordova-common/appveyor.yml deleted file mode 100644 index 5267502..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/appveyor.yml +++ /dev/null @@ -1,22 +0,0 @@ -# appveyor file -# http://www.appveyor.com/docs/appveyor-yml - -shallow_clone: true - -environment: - matrix: - - nodejs_version: 6 - - nodejs_version: 8 - - nodejs_version: 10 - - nodejs_version: 12 - -install: - - ps: Install-Product node $env:nodejs_version - - npm install - -build: off - -test_script: - - node --version - - npm --version - - npm test diff --git a/chabok-starter-cordova/node_modules/cordova-common/cordova-common.js b/chabok-starter-cordova/node_modules/cordova-common/cordova-common.js deleted file mode 100644 index 801d510..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/cordova-common.js +++ /dev/null @@ -1,47 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -var addProperty = require('./src/util/addProperty'); - -module.exports = { }; - -addProperty(module, 'events', './src/events'); -addProperty(module, 'superspawn', './src/superspawn'); - -addProperty(module, 'ActionStack', './src/ActionStack'); -addProperty(module, 'CordovaError', './src/CordovaError/CordovaError'); -addProperty(module, 'CordovaLogger', './src/CordovaLogger'); -addProperty(module, 'CordovaCheck', './src/CordovaCheck'); -addProperty(module, 'CordovaExternalToolErrorContext', './src/CordovaError/CordovaExternalToolErrorContext'); -addProperty(module, 'PlatformJson', './src/PlatformJson'); -addProperty(module, 'ConfigParser', './src/ConfigParser/ConfigParser'); -addProperty(module, 'FileUpdater', './src/FileUpdater'); - -addProperty(module, 'PluginInfo', './src/PluginInfo/PluginInfo'); -addProperty(module, 'PluginInfoProvider', './src/PluginInfo/PluginInfoProvider'); - -addProperty(module, 'PluginManager', './src/PluginManager'); - -addProperty(module, 'ConfigChanges', './src/ConfigChanges/ConfigChanges'); -addProperty(module, 'ConfigKeeper', './src/ConfigChanges/ConfigKeeper'); -addProperty(module, 'ConfigFile', './src/ConfigChanges/ConfigFile'); -addProperty(module, 'mungeUtil', './src/ConfigChanges/munge-util'); - -addProperty(module, 'xmlHelpers', './src/util/xml-helpers'); - diff --git a/chabok-starter-cordova/node_modules/cordova-common/package.json b/chabok-starter-cordova/node_modules/cordova-common/package.json deleted file mode 100644 index 588cfcf..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "_from": "cordova-common@^3.2.0", - "_id": "cordova-common@3.2.1", - "_inBundle": false, - "_integrity": "sha512-xg0EnjnA6EipxXG8cupdlYQYeDA6+ghbN+Pjq88xN1LInwP6Bo7IyGBdSV5QnfjOvzShF9BBwSxBAv0FOO0C2Q==", - "_location": "/cordova-common", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "cordova-common@^3.2.0", - "name": "cordova-common", - "escapedName": "cordova-common", - "rawSpec": "^3.2.0", - "saveSpec": null, - "fetchSpec": "^3.2.0" - }, - "_requiredBy": [ - "/cordova-android" - ], - "_resolved": "https://registry.npmjs.org/cordova-common/-/cordova-common-3.2.1.tgz", - "_shasum": "f4fdbeb40d9049fe28a09fa901756ed66d246661", - "_spec": "cordova-common@^3.2.0", - "_where": "/Users/farbod/Documents/Github/chabok/chabok-starter-cordova/chabok-starter-cordova/node_modules/cordova-android", - "author": { - "name": "Apache Software Foundation" - }, - "bugs": { - "url": "https://issues.apache.org/jira/browse/CB", - "email": "dev@cordova.apache.org" - }, - "bundleDependencies": false, - "contributors": [], - "dependencies": { - "ansi": "^0.3.1", - "bplist-parser": "^0.1.0", - "cross-spawn": "^6.0.5", - "elementtree": "0.1.7", - "endent": "^1.1.1", - "fs-extra": "^8.0.0", - "glob": "^7.1.2", - "minimatch": "^3.0.0", - "plist": "^3.0.1", - "q": "^1.4.1", - "strip-bom": "^3.0.0", - "underscore": "^1.8.3", - "which": "^1.3.0" - }, - "deprecated": false, - "description": "Apache Cordova tools and platforms shared routines", - "devDependencies": { - "eslint": "^5.0.0", - "eslint-config-semistandard": "^14.0.0", - "eslint-config-standard": "^13.0.1", - "eslint-plugin-import": "^2.14.0", - "eslint-plugin-node": "^8.0.0", - "eslint-plugin-promise": "^4.0.0", - "eslint-plugin-standard": "^4.0.0", - "istanbul": "^0.4.5", - "jasmine": "^3.4.0", - "jasmine-spec-reporter": "^4.2.1", - "osenv": "^0.1.3", - "promise-matchers": "^0.9.6", - "rewire": "^4.0.1" - }, - "engines": { - "node": ">=6.0.0" - }, - "homepage": "https://github.com/apache/cordova-common#readme", - "license": "Apache-2.0", - "main": "cordova-common.js", - "name": "cordova-common", - "repository": { - "type": "git", - "url": "git+https://github.com/apache/cordova-common.git" - }, - "scripts": { - "cover": "istanbul cover --root src --print detail jasmine", - "eslint": "eslint src spec", - "jasmine": "jasmine JASMINE_CONFIG_PATH=spec/support/jasmine.json", - "test": "npm run eslint && npm run jasmine" - }, - "version": "3.2.1" -} diff --git a/chabok-starter-cordova/node_modules/cordova-common/src/ActionStack.js b/chabok-starter-cordova/node_modules/cordova-common/src/ActionStack.js deleted file mode 100644 index 6983c5c..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/src/ActionStack.js +++ /dev/null @@ -1,85 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -/* jshint quotmark:false */ - -var events = require('./events'); -var Q = require('q'); - -function ActionStack () { - this.stack = []; - this.completed = []; -} - -ActionStack.prototype = { - createAction: function (handler, action_params, reverter, revert_params) { - return { - handler: { - run: handler, - params: action_params - }, - reverter: { - run: reverter, - params: revert_params - } - }; - }, - push: function (tx) { - this.stack.push(tx); - }, - // Returns a promise. - process: function (platform) { - events.emit('verbose', 'Beginning processing of action stack for ' + platform + ' project...'); - - while (this.stack.length) { - var action = this.stack.shift(); - var handler = action.handler.run; - var action_params = action.handler.params; - - try { - handler.apply(null, action_params); - } catch (e) { - events.emit('warn', 'Error during processing of action! Attempting to revert...'); - this.stack.unshift(action); - var issue = 'Uh oh!\n'; - // revert completed tasks - while (this.completed.length) { - var undo = this.completed.shift(); - var revert = undo.reverter.run; - var revert_params = undo.reverter.params; - - try { - revert.apply(null, revert_params); - } catch (err) { - events.emit('warn', 'Error during reversion of action! We probably really messed up your project now, sorry! D:'); - issue += 'A reversion action failed: ' + err.message + '\n'; - } - } - e.message = issue + e.message; - return Q.reject(e); - } - this.completed.push(action); - } - events.emit('verbose', 'Action stack processing complete.'); - - return Q(); - } -}; - -module.exports = ActionStack; diff --git a/chabok-starter-cordova/node_modules/cordova-common/src/ConfigChanges/ConfigChanges.js b/chabok-starter-cordova/node_modules/cordova-common/src/ConfigChanges/ConfigChanges.js deleted file mode 100644 index 27c2d9e..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/src/ConfigChanges/ConfigChanges.js +++ /dev/null @@ -1,426 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -/* - * This module deals with shared configuration / dependency "stuff". That is: - * - XML configuration files such as config.xml, AndroidManifest.xml or WMAppManifest.xml. - * - plist files in iOS - * Essentially, any type of shared resources that we need to handle with awareness - * of how potentially multiple plugins depend on a single shared resource, should be - * handled in this module. - * - * The implementation uses an object as a hash table, with "leaves" of the table tracking - * reference counts. - */ - -var path = require('path'); -var et = require('elementtree'); -var ConfigKeeper = require('./ConfigKeeper'); -var events = require('../events'); - -var mungeutil = require('./munge-util'); -var xml_helpers = require('../util/xml-helpers'); - -exports.PlatformMunger = PlatformMunger; - -exports.process = function (plugins_dir, project_dir, platform, platformJson, pluginInfoProvider) { - var munger = new PlatformMunger(platform, project_dir, platformJson, pluginInfoProvider); - munger.process(plugins_dir); - munger.save_all(); -}; - -/****************************************************************************** -* PlatformMunger class -* -* Can deal with config file of a single project. -* Parsed config files are cached in a ConfigKeeper object. -******************************************************************************/ -function PlatformMunger (platform, project_dir, platformJson, pluginInfoProvider) { - this.platform = platform; - this.project_dir = project_dir; - this.config_keeper = new ConfigKeeper(project_dir); - this.platformJson = platformJson; - this.pluginInfoProvider = pluginInfoProvider; -} - -// Write out all unsaved files. -PlatformMunger.prototype.save_all = PlatformMunger_save_all; -function PlatformMunger_save_all () { - this.config_keeper.save_all(); - this.platformJson.save(); -} - -// Apply a munge object to a single config file. -// The remove parameter tells whether to add the change or remove it. -PlatformMunger.prototype.apply_file_munge = PlatformMunger_apply_file_munge; -function PlatformMunger_apply_file_munge (file, munge, remove) { - var self = this; - - for (var selector in munge.parents) { - for (var xml_child in munge.parents[selector]) { - // this xml child is new, graft it (only if config file exists) - var config_file = self.config_keeper.get(self.project_dir, self.platform, file); - if (config_file.exists) { - if (remove) config_file.prune_child(selector, munge.parents[selector][xml_child]); - else config_file.graft_child(selector, munge.parents[selector][xml_child]); - } else { - events.emit('warn', 'config file ' + file + ' requested for changes not found at ' + config_file.filepath + ', ignoring'); - } - } - } -} - -PlatformMunger.prototype.remove_plugin_changes = remove_plugin_changes; -function remove_plugin_changes (pluginInfo, is_top_level) { - var self = this; - var platform_config = self.platformJson.root; - var plugin_vars = is_top_level - ? platform_config.installed_plugins[pluginInfo.id] - : platform_config.dependent_plugins[pluginInfo.id]; - var edit_config_changes = null; - if (pluginInfo.getEditConfigs) { - edit_config_changes = pluginInfo.getEditConfigs(self.platform); - } - - // get config munge, aka how did this plugin change various config files - var config_munge = self.generate_plugin_config_munge(pluginInfo, plugin_vars, edit_config_changes); - // global munge looks at all plugins' changes to config files - var global_munge = platform_config.config_munge; - var munge = mungeutil.decrement_munge(global_munge, config_munge); - - for (var file in munge.files) { - self.apply_file_munge(file, munge.files[file], /* remove = */ true); - } - - // Remove from installed_plugins - self.platformJson.removePlugin(pluginInfo.id, is_top_level); - return self; -} - -PlatformMunger.prototype.add_plugin_changes = add_plugin_changes; -function add_plugin_changes (pluginInfo, plugin_vars, is_top_level, should_increment, plugin_force) { - var self = this; - var platform_config = self.platformJson.root; - - var edit_config_changes = null; - if (pluginInfo.getEditConfigs) { - edit_config_changes = pluginInfo.getEditConfigs(self.platform); - } - - var config_munge; - - if (!edit_config_changes || edit_config_changes.length === 0) { - // get config munge, aka how should this plugin change various config files - config_munge = self.generate_plugin_config_munge(pluginInfo, plugin_vars); - } else { - var isConflictingInfo = is_conflicting(edit_config_changes, platform_config.config_munge, self, plugin_force); - - if (isConflictingInfo.conflictWithConfigxml) { - throw new Error(pluginInfo.id + - ' cannot be added. changes in this plugin conflicts with changes in config.xml. Conflicts must be resolved before plugin can be added.'); - } - if (plugin_force) { - events.emit('warn', '--force is used. edit-config will overwrite conflicts if any. Conflicting plugins may not work as expected.'); - - // remove conflicting munges - var conflict_munge = mungeutil.decrement_munge(platform_config.config_munge, isConflictingInfo.conflictingMunge); - for (var conflict_file in conflict_munge.files) { - self.apply_file_munge(conflict_file, conflict_munge.files[conflict_file], /* remove = */ true); - } - - // force add new munges - config_munge = self.generate_plugin_config_munge(pluginInfo, plugin_vars, edit_config_changes); - } else if (isConflictingInfo.conflictFound) { - throw new Error('There was a conflict trying to modify attributes with in plugin ' + pluginInfo.id + - '. The conflicting plugin, ' + isConflictingInfo.conflictingPlugin + ', already modified the same attributes. The conflict must be resolved before ' + - pluginInfo.id + ' can be added. You may use --force to add the plugin and overwrite the conflicting attributes.'); - } else { - // no conflicts, will handle edit-config - config_munge = self.generate_plugin_config_munge(pluginInfo, plugin_vars, edit_config_changes); - } - } - - self = munge_helper(should_increment, self, platform_config, config_munge); - - // Move to installed/dependent_plugins - self.platformJson.addPlugin(pluginInfo.id, plugin_vars || {}, is_top_level); - return self; -} - -// Handle edit-config changes from config.xml -PlatformMunger.prototype.add_config_changes = add_config_changes; -function add_config_changes (config, should_increment) { - var self = this; - var platform_config = self.platformJson.root; - - var config_munge; - var changes = []; - - if (config.getEditConfigs) { - var edit_config_changes = config.getEditConfigs(self.platform); - if (edit_config_changes) { - changes = changes.concat(edit_config_changes); - } - } - - if (config.getConfigFiles) { - var config_files_changes = config.getConfigFiles(self.platform); - if (config_files_changes) { - changes = changes.concat(config_files_changes); - } - } - - if (changes && changes.length > 0) { - var isConflictingInfo = is_conflicting(changes, platform_config.config_munge, self, true /* always force overwrite other edit-config */); - if (isConflictingInfo.conflictFound) { - var conflict_munge; - var conflict_file; - - if (Object.keys(isConflictingInfo.configxmlMunge.files).length !== 0) { - // silently remove conflicting config.xml munges so new munges can be added - conflict_munge = mungeutil.decrement_munge(platform_config.config_munge, isConflictingInfo.configxmlMunge); - for (conflict_file in conflict_munge.files) { - self.apply_file_munge(conflict_file, conflict_munge.files[conflict_file], /* remove = */ true); - } - } - if (Object.keys(isConflictingInfo.conflictingMunge.files).length !== 0) { - events.emit('warn', 'Conflict found, edit-config changes from config.xml will overwrite plugin.xml changes'); - - // remove conflicting plugin.xml munges - conflict_munge = mungeutil.decrement_munge(platform_config.config_munge, isConflictingInfo.conflictingMunge); - for (conflict_file in conflict_munge.files) { - self.apply_file_munge(conflict_file, conflict_munge.files[conflict_file], /* remove = */ true); - } - } - } - } - - // Add config.xml edit-config and config-file munges - config_munge = self.generate_config_xml_munge(config, changes, 'config.xml'); - self = munge_helper(should_increment, self, platform_config, config_munge); - - // Move to installed/dependent_plugins - return self; -} - -function munge_helper (should_increment, self, platform_config, config_munge) { - // global munge looks at all changes to config files - - // TODO: The should_increment param is only used by cordova-cli and is going away soon. - // If should_increment is set to false, avoid modifying the global_munge (use clone) - // and apply the entire config_munge because it's already a proper subset of the global_munge. - var munge, global_munge; - if (should_increment) { - global_munge = platform_config.config_munge; - munge = mungeutil.increment_munge(global_munge, config_munge); - } else { - global_munge = mungeutil.clone_munge(platform_config.config_munge); - munge = config_munge; - } - - for (var file in munge.files) { - self.apply_file_munge(file, munge.files[file]); - } - - return self; -} - -// Load the global munge from platform json and apply all of it. -// Used by cordova prepare to re-generate some config file from platform -// defaults and the global munge. -PlatformMunger.prototype.reapply_global_munge = reapply_global_munge; -function reapply_global_munge () { - var self = this; - - var platform_config = self.platformJson.root; - var global_munge = platform_config.config_munge; - for (var file in global_munge.files) { - self.apply_file_munge(file, global_munge.files[file]); - } - - return self; -} - -// generate_plugin_config_munge -// Generate the munge object from config.xml -PlatformMunger.prototype.generate_config_xml_munge = generate_config_xml_munge; -function generate_config_xml_munge (config, config_changes, type) { - var munge = { files: {} }; - var id; - - if (!config_changes) { - return munge; - } - - if (type === 'config.xml') { - id = type; - } else { - id = config.id; - } - - config_changes.forEach(function (change) { - change.xmls.forEach(function (xml) { - // 1. stringify each xml - var stringified = (new et.ElementTree(xml)).write({ xml_declaration: false }); - // 2. add into munge - if (change.mode) { - mungeutil.deep_add(munge, change.file, change.target, { xml: stringified, count: 1, mode: change.mode, id: id }); - } else { - mungeutil.deep_add(munge, change.target, change.parent, { xml: stringified, count: 1, after: change.after }); - } - }); - }); - return munge; -} - -// generate_plugin_config_munge -// Generate the munge object from plugin.xml + vars -PlatformMunger.prototype.generate_plugin_config_munge = generate_plugin_config_munge; -function generate_plugin_config_munge (pluginInfo, vars, edit_config_changes) { - var self = this; - - vars = vars || {}; - var munge = { files: {} }; - var changes = pluginInfo.getConfigFiles(self.platform); - - if (edit_config_changes) { - Array.prototype.push.apply(changes, edit_config_changes); - } - - changes.forEach(function (change) { - change.xmls.forEach(function (xml) { - // 1. stringify each xml - var stringified = (new et.ElementTree(xml)).write({ xml_declaration: false }); - // interp vars - if (vars) { - Object.keys(vars).forEach(function (key) { - var regExp = new RegExp('\\$' + key, 'g'); - stringified = stringified.replace(regExp, vars[key]); - }); - } - // 2. add into munge - if (change.mode) { - if (change.mode !== 'remove') { - mungeutil.deep_add(munge, change.file, change.target, { xml: stringified, count: 1, mode: change.mode, plugin: pluginInfo.id }); - } - } else { - mungeutil.deep_add(munge, change.target, change.parent, { xml: stringified, count: 1, after: change.after }); - } - }); - }); - return munge; -} - -function is_conflicting (editchanges, config_munge, self, force) { - var files = config_munge.files; - var conflictFound = false; - var conflictWithConfigxml = false; - var conflictingMunge = { files: {} }; - var configxmlMunge = { files: {} }; - var conflictingParent; - var conflictingPlugin; - - editchanges.forEach(function (editchange) { - if (files[editchange.file]) { - var parents = files[editchange.file].parents; - var target = parents[editchange.target]; - - // Check if the edit target will resolve to an existing target - if (!target || target.length === 0) { - var file_xml = self.config_keeper.get(self.project_dir, self.platform, editchange.file).data; - var resolveEditTarget = xml_helpers.resolveParent(file_xml, editchange.target); - var resolveTarget; - - if (resolveEditTarget) { - for (var parent in parents) { - resolveTarget = xml_helpers.resolveParent(file_xml, parent); - if (resolveEditTarget === resolveTarget) { - conflictingParent = parent; - target = parents[parent]; - break; - } - } - } - } else { - conflictingParent = editchange.target; - } - - if (target && target.length !== 0) { - // conflict has been found - conflictFound = true; - - if (editchange.id === 'config.xml') { - if (target[0].id === 'config.xml') { - // Keep track of config.xml/config.xml edit-config conflicts - mungeutil.deep_add(configxmlMunge, editchange.file, conflictingParent, target[0]); - } else { - // Keep track of config.xml x plugin.xml edit-config conflicts - mungeutil.deep_add(conflictingMunge, editchange.file, conflictingParent, target[0]); - } - } else { - if (target[0].id === 'config.xml') { - // plugin.xml cannot overwrite config.xml changes even if --force is used - conflictWithConfigxml = true; - return; - } - - if (force) { - // Need to find all conflicts when --force is used, track conflicting munges - mungeutil.deep_add(conflictingMunge, editchange.file, conflictingParent, target[0]); - } else { - // plugin cannot overwrite other plugin changes without --force - conflictingPlugin = target[0].plugin; - } - } - } - } - }); - - return { conflictFound: conflictFound, - conflictingPlugin: conflictingPlugin, - conflictingMunge: conflictingMunge, - configxmlMunge: configxmlMunge, - conflictWithConfigxml: conflictWithConfigxml - }; -} - -// Go over the prepare queue and apply the config munges for each plugin -// that has been (un)installed. -PlatformMunger.prototype.process = PlatformMunger_process; -function PlatformMunger_process (plugins_dir) { - var self = this; - var platform_config = self.platformJson.root; - - // Uninstallation first - platform_config.prepare_queue.uninstalled.forEach(function (u) { - var pluginInfo = self.pluginInfoProvider.get(path.join(plugins_dir, u.plugin)); - self.remove_plugin_changes(pluginInfo, u.topLevel); - }); - - // Now handle installation - platform_config.prepare_queue.installed.forEach(function (u) { - var pluginInfo = self.pluginInfoProvider.get(path.join(plugins_dir, u.plugin)); - self.add_plugin_changes(pluginInfo, u.vars, u.topLevel, true, u.force); - }); - - // Empty out installed/ uninstalled queues. - platform_config.prepare_queue.uninstalled = []; - platform_config.prepare_queue.installed = []; -} -/** ** END of PlatformMunger ****/ diff --git a/chabok-starter-cordova/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js b/chabok-starter-cordova/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js deleted file mode 100644 index b346978..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js +++ /dev/null @@ -1,265 +0,0 @@ -/* - * 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. - * -*/ - -var fs = require('fs-extra'); -var path = require('path'); - -var modules = {}; -var addProperty = require('../util/addProperty'); - -// Use delay loading to ensure plist and other node modules to not get loaded -// on Android, Windows platforms -addProperty(module, 'bplist', 'bplist-parser', modules); -addProperty(module, 'et', 'elementtree', modules); -addProperty(module, 'glob', 'glob', modules); -addProperty(module, 'plist', 'plist', modules); -addProperty(module, 'plist_helpers', '../util/plist-helpers', modules); -addProperty(module, 'xml_helpers', '../util/xml-helpers', modules); - -/****************************************************************************** -* ConfigFile class -* -* Can load and keep various types of config files. Provides some functionality -* specific to some file types such as grafting XML children. In most cases it -* should be instantiated by ConfigKeeper. -* -* For plugin.xml files use as: -* plugin_config = self.config_keeper.get(plugin_dir, '', 'plugin.xml'); -* -* TODO: Consider moving it out to a separate file and maybe partially with -* overrides in platform handlers. -******************************************************************************/ -function ConfigFile (project_dir, platform, file_tag) { - this.project_dir = project_dir; - this.platform = platform; - this.file_tag = file_tag; - this.is_changed = false; - - this.load(); -} - -// ConfigFile.load() -ConfigFile.prototype.load = ConfigFile_load; -function ConfigFile_load () { - var self = this; - - // config file may be in a place not exactly specified in the target - var filepath = self.filepath = resolveConfigFilePath(self.project_dir, self.platform, self.file_tag); - - if (!filepath || !fs.existsSync(filepath)) { - self.exists = false; - return; - } - self.exists = true; - self.mtime = fs.statSync(self.filepath).mtime; - - var ext = path.extname(filepath); - // Windows8 uses an appxmanifest, and wp8 will likely use - // the same in a future release - if (ext === '.xml' || ext === '.appxmanifest' || ext === '.storyboard' || ext === '.jsproj') { - self.type = 'xml'; - self.data = modules.xml_helpers.parseElementtreeSync(filepath); - } else { - // plist file - self.type = 'plist'; - // TODO: isBinaryPlist() reads the file and then parse re-reads it again. - // We always write out text plist, not binary. - // Do we still need to support binary plist? - // If yes, use plist.parseStringSync() and read the file once. - self.data = isBinaryPlist(filepath) - ? modules.bplist.parseBuffer(fs.readFileSync(filepath))[0] - : modules.plist.parse(fs.readFileSync(filepath, 'utf8')); - } -} - -ConfigFile.prototype.save = function ConfigFile_save () { - var self = this; - if (self.type === 'xml') { - fs.writeFileSync(self.filepath, self.data.write({ indent: 4 }), 'utf-8'); - } else { - // plist - var regExp = /[ \t\r\n]+?<\/string>/g; - fs.writeFileSync(self.filepath, modules.plist.build(self.data, { indent: '\t', offset: -1 }).replace(regExp, '')); - } - self.is_changed = false; -}; - -ConfigFile.prototype.graft_child = function ConfigFile_graft_child (selector, xml_child) { - var self = this; - var filepath = self.filepath; - var result; - if (self.type === 'xml') { - var xml_to_graft = [modules.et.XML(xml_child.xml)]; - switch (xml_child.mode) { - case 'merge': - result = modules.xml_helpers.graftXMLMerge(self.data, xml_to_graft, selector, xml_child); - break; - case 'overwrite': - result = modules.xml_helpers.graftXMLOverwrite(self.data, xml_to_graft, selector, xml_child); - break; - case 'remove': - result = modules.xml_helpers.pruneXMLRemove(self.data, selector, xml_to_graft); - break; - default: - result = modules.xml_helpers.graftXML(self.data, xml_to_graft, selector, xml_child.after); - } - if (!result) { - throw new Error('Unable to graft xml at selector "' + selector + '" from "' + filepath + '" during config install'); - } - } else { - // plist file - result = modules.plist_helpers.graftPLIST(self.data, xml_child.xml, selector); - if (!result) { - throw new Error('Unable to graft plist "' + filepath + '" during config install'); - } - } - self.is_changed = true; -}; - -ConfigFile.prototype.prune_child = function ConfigFile_prune_child (selector, xml_child) { - var self = this; - var filepath = self.filepath; - var result; - if (self.type === 'xml') { - var xml_to_graft = [modules.et.XML(xml_child.xml)]; - switch (xml_child.mode) { - case 'merge': - case 'overwrite': - result = modules.xml_helpers.pruneXMLRestore(self.data, selector, xml_child); - break; - case 'remove': - result = modules.xml_helpers.pruneXMLRemove(self.data, selector, xml_to_graft); - break; - default: - result = modules.xml_helpers.pruneXML(self.data, xml_to_graft, selector); - } - } else { - // plist file - result = modules.plist_helpers.prunePLIST(self.data, xml_child.xml, selector); - } - if (!result) { - var err_msg = 'Pruning at selector "' + selector + '" from "' + filepath + '" went bad.'; - throw new Error(err_msg); - } - self.is_changed = true; -}; - -// Some config-file target attributes are not qualified with a full leading directory, or contain wildcards. -// Resolve to a real path in this function. -// TODO: getIOSProjectname is slow because of glob, try to avoid calling it several times per project. -function resolveConfigFilePath (project_dir, platform, file) { - var filepath = path.join(project_dir, file); - var matches; - - file = path.normalize(file); - - if (file.includes('*')) { - // handle wildcards in targets using glob. - matches = modules.glob.sync(path.join(project_dir, '**', file)); - if (matches.length) filepath = matches[0]; - - // [CB-5989] multiple Info.plist files may exist. default to $PROJECT_NAME-Info.plist - if (matches.length > 1 && file.includes('-Info.plist')) { - var plistName = getIOSProjectname(project_dir) + '-Info.plist'; - for (var i = 0; i < matches.length; i++) { - if (matches[i].includes(plistName)) { - filepath = matches[i]; - break; - } - } - } - return filepath; - } - - // XXX this checks for android studio projects - // only if none of the options above are satisfied does this get called - // TODO: Move this out of cordova-common and into the platforms somehow - if (platform === 'android' && !fs.existsSync(filepath)) { - var config_file; - - if (file === 'AndroidManifest.xml') { - filepath = path.join(project_dir, 'app', 'src', 'main', 'AndroidManifest.xml'); - } else if (file.endsWith('config.xml')) { - filepath = path.join(project_dir, 'app', 'src', 'main', 'res', 'xml', 'config.xml'); - } else if (file.endsWith('strings.xml')) { - // Plugins really shouldn't mess with strings.xml, since it's able to be localized - filepath = path.join(project_dir, 'app', 'src', 'main', 'res', 'values', 'strings.xml'); - } else if (file.includes(path.join('res', 'values'))) { - config_file = path.basename(file); - filepath = path.join(project_dir, 'app', 'src', 'main', 'res', 'values', config_file); - } else if (file.includes(path.join('res', 'xml'))) { - // Catch-all for all other stored XML configuration in legacy plugins - config_file = path.basename(file); - filepath = path.join(project_dir, 'app', 'src', 'main', 'res', 'xml', config_file); - } - return filepath; - } - - // special-case config.xml target that is just "config.xml" for other platforms. This should - // be resolved to the real location of the file. - // TODO: Move this out of cordova-common into platforms - if (file === 'config.xml') { - if (platform === 'ubuntu') { - filepath = path.join(project_dir, 'config.xml'); - } else if (platform === 'ios' || platform === 'osx') { - filepath = path.join( - project_dir, - module.exports.getIOSProjectname(project_dir), - 'config.xml' - ); - } else { - matches = modules.glob.sync(path.join(project_dir, '**', 'config.xml')); - if (matches.length) filepath = matches[0]; - } - return filepath; - } - - // None of the special cases matched, returning project_dir/file. - return filepath; -} - -// Find out the real name of an iOS or OSX project -// TODO: glob is slow, need a better way or caching, or avoid using more than once. -function getIOSProjectname (project_dir) { - var matches = modules.glob.sync(path.join(project_dir, '*.xcodeproj')); - var iospath; - if (matches.length === 1) { - iospath = path.basename(matches[0], '.xcodeproj'); - } else { - var msg; - if (matches.length === 0) { - msg = 'Does not appear to be an xcode project, no xcode project file in ' + project_dir; - } else { - msg = 'There are multiple *.xcodeproj dirs in ' + project_dir; - } - throw new Error(msg); - } - return iospath; -} - -// determine if a plist file is binary -function isBinaryPlist (filename) { - // I wish there was a synchronous way to read only the first 6 bytes of a - // file. This is wasteful :/ - var buf = '' + fs.readFileSync(filename, 'utf8'); - // binary plists start with a magic header, "bplist" - return buf.substring(0, 6) === 'bplist'; -} - -module.exports = ConfigFile; -module.exports.isBinaryPlist = isBinaryPlist; -module.exports.getIOSProjectname = getIOSProjectname; -module.exports.resolveConfigFilePath = resolveConfigFilePath; diff --git a/chabok-starter-cordova/node_modules/cordova-common/src/ConfigChanges/ConfigKeeper.js b/chabok-starter-cordova/node_modules/cordova-common/src/ConfigChanges/ConfigKeeper.js deleted file mode 100644 index 0ef0435..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/src/ConfigChanges/ConfigKeeper.js +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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. - * -*/ -/* jshint sub:true */ - -var path = require('path'); -var ConfigFile = require('./ConfigFile'); - -/****************************************************************************** -* ConfigKeeper class -* -* Used to load and store config files to avoid re-parsing and writing them out -* multiple times. -* -* The config files are referred to by a fake path constructed as -* project_dir/platform/file -* where file is the name used for the file in config munges. -******************************************************************************/ -function ConfigKeeper (project_dir, plugins_dir) { - this.project_dir = project_dir; - this.plugins_dir = plugins_dir; - this._cached = {}; -} - -ConfigKeeper.prototype.get = function ConfigKeeper_get (project_dir, platform, file) { - var self = this; - - // This fixes a bug with older plugins - when specifying config xml instead of res/xml/config.xml - // https://issues.apache.org/jira/browse/CB-6414 - if (file === 'config.xml' && platform === 'android') { - file = 'res/xml/config.xml'; - } - var fake_path = path.join(project_dir, platform, file); - - if (self._cached[fake_path]) { - return self._cached[fake_path]; - } - // File was not cached, need to load. - var config_file = new ConfigFile(project_dir, platform, file); - self._cached[fake_path] = config_file; - return config_file; -}; - -ConfigKeeper.prototype.save_all = function ConfigKeeper_save_all () { - var self = this; - Object.keys(self._cached).forEach(function (fake_path) { - var config_file = self._cached[fake_path]; - if (config_file.is_changed) config_file.save(); - }); -}; - -module.exports = ConfigKeeper; diff --git a/chabok-starter-cordova/node_modules/cordova-common/src/ConfigChanges/munge-util.js b/chabok-starter-cordova/node_modules/cordova-common/src/ConfigChanges/munge-util.js deleted file mode 100644 index 62648d8..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/src/ConfigChanges/munge-util.js +++ /dev/null @@ -1,162 +0,0 @@ -/* - * 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. - * -*/ -/* jshint sub:true */ - -var _ = require('underscore'); - -// add the count of [key1][key2]...[keyN] to obj -// return true if it didn't exist before -exports.deep_add = function deep_add (obj, keys /* or key1, key2 .... */) { - if (!Array.isArray(keys)) { - keys = Array.prototype.slice.call(arguments, 1); - } - - return exports.process_munge(obj, true/* createParents */, function (parentArray, k) { - var found = _.find(parentArray, function (element) { - return element.xml === k.xml; - }); - if (found) { - found.after = found.after || k.after; - found.count += k.count; - } else { - parentArray.push(k); - } - return !found; - }, keys); -}; - -// decrement the count of [key1][key2]...[keyN] from obj and remove if it reaches 0 -// return true if it was removed or not found -exports.deep_remove = function deep_remove (obj, keys /* or key1, key2 .... */) { - if (!Array.isArray(keys)) { - keys = Array.prototype.slice.call(arguments, 1); - } - - var result = exports.process_munge(obj, false/* createParents */, function (parentArray, k) { - var index = -1; - var found = _.find(parentArray, function (element) { - index++; - return element.xml === k.xml; - }); - if (found) { - if (parentArray[index].oldAttrib) { - k.oldAttrib = _.extend({}, parentArray[index].oldAttrib); - } - found.count -= k.count; - if (found.count > 0) { - return false; - } else { - parentArray.splice(index, 1); - } - } - return undefined; - }, keys); - - return typeof result === 'undefined' ? true : result; -}; - -// search for [key1][key2]...[keyN] -// return the object or undefined if not found -exports.deep_find = function deep_find (obj, keys /* or key1, key2 .... */) { - if (!Array.isArray(keys)) { - keys = Array.prototype.slice.call(arguments, 1); - } - - return exports.process_munge(obj, false/* createParents? */, function (parentArray, k) { - return _.find(parentArray, function (element) { - return element.xml === (k.xml || k); - }); - }, keys); -}; - -// Execute func passing it the parent array and the xmlChild key. -// When createParents is true, add the file and parent items they are missing -// When createParents is false, stop and return undefined if the file and/or parent items are missing - -exports.process_munge = function process_munge (obj, createParents, func, keys /* or key1, key2 .... */) { - if (!Array.isArray(keys)) { - keys = Array.prototype.slice.call(arguments, 1); - } - var k = keys[0]; - if (keys.length === 1) { - return func(obj, k); - } else if (keys.length === 2) { - if (!obj.parents[k] && !createParents) { - return undefined; - } - obj.parents[k] = obj.parents[k] || []; - return exports.process_munge(obj.parents[k], createParents, func, keys.slice(1)); - } else if (keys.length === 3) { - if (!obj.files[k] && !createParents) { - return undefined; - } - obj.files[k] = obj.files[k] || { parents: {} }; - return exports.process_munge(obj.files[k], createParents, func, keys.slice(1)); - } else { - throw new Error('Invalid key format. Must contain at most 3 elements (file, parent, xmlChild).'); - } -}; - -// All values from munge are added to base as -// base[file][selector][child] += munge[file][selector][child] -// Returns a munge object containing values that exist in munge -// but not in base. -exports.increment_munge = function increment_munge (base, munge) { - var diff = { files: {} }; - - for (var file in munge.files) { - for (var selector in munge.files[file].parents) { - for (var xml_child in munge.files[file].parents[selector]) { - var val = munge.files[file].parents[selector][xml_child]; - // if node not in base, add it to diff and base - // else increment it's value in base without adding to diff - var newlyAdded = exports.deep_add(base, [file, selector, val]); - if (newlyAdded) { - exports.deep_add(diff, file, selector, val); - } - } - } - } - return diff; -}; - -// Update the base munge object as -// base[file][selector][child] -= munge[file][selector][child] -// nodes that reached zero value are removed from base and added to the returned munge -// object. -exports.decrement_munge = function decrement_munge (base, munge) { - var zeroed = { files: {} }; - - for (var file in munge.files) { - for (var selector in munge.files[file].parents) { - for (var xml_child in munge.files[file].parents[selector]) { - var val = munge.files[file].parents[selector][xml_child]; - // if node not in base, add it to diff and base - // else increment it's value in base without adding to diff - var removed = exports.deep_remove(base, [file, selector, val]); - if (removed) { - exports.deep_add(zeroed, file, selector, val); - } - } - } - } - return zeroed; -}; - -// For better readability where used -exports.clone_munge = function clone_munge (munge) { - return exports.increment_munge({}, munge); -}; diff --git a/chabok-starter-cordova/node_modules/cordova-common/src/ConfigParser/ConfigParser.js b/chabok-starter-cordova/node_modules/cordova-common/src/ConfigParser/ConfigParser.js deleted file mode 100644 index dc1b66d..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/src/ConfigParser/ConfigParser.js +++ /dev/null @@ -1,630 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -var et = require('elementtree'); -var xml = require('../util/xml-helpers'); -var CordovaError = require('../CordovaError/CordovaError'); -var fs = require('fs-extra'); -var events = require('../events'); - -/** Wraps a config.xml file */ -function ConfigParser (path) { - this.path = path; - try { - this.doc = xml.parseElementtreeSync(path); - this.cdvNamespacePrefix = getCordovaNamespacePrefix(this.doc); - et.register_namespace(this.cdvNamespacePrefix, 'http://cordova.apache.org/ns/1.0'); - } catch (e) { - events.emit('error', 'Parsing ' + path + ' failed'); - throw e; - } - var r = this.doc.getroot(); - if (r.tag !== 'widget') { - throw new CordovaError(path + ' has incorrect root node name (expected "widget", was "' + r.tag + '")'); - } -} - -function getNodeTextSafe (el) { - return el && el.text && el.text.trim(); -} - -function findOrCreate (doc, name) { - var ret = doc.find(name); - if (!ret) { - ret = new et.Element(name); - doc.getroot().append(ret); - } - return ret; -} - -function getCordovaNamespacePrefix (doc) { - var rootAtribs = Object.getOwnPropertyNames(doc.getroot().attrib); - var prefix = 'cdv'; - for (var j = 0; j < rootAtribs.length; j++) { - if (rootAtribs[j].startsWith('xmlns:') && - doc.getroot().attrib[rootAtribs[j]] === 'http://cordova.apache.org/ns/1.0') { - var strings = rootAtribs[j].split(':'); - prefix = strings[1]; - break; - } - } - return prefix; -} - -/** - * Finds the value of an element's attribute - * @param {String} attributeName Name of the attribute to search for - * @param {Array} elems An array of ElementTree nodes - * @return {String} - */ -function findElementAttributeValue (attributeName, elems) { - elems = Array.isArray(elems) ? elems : [elems]; - - var value = elems.filter(function (elem) { - return elem.attrib.name.toLowerCase() === attributeName.toLowerCase(); - }).map(function (filteredElems) { - return filteredElems.attrib.value; - }).pop(); - - return value || ''; -} - -function removeChildren (el, selector) { - const matches = el.findall(selector); - matches.forEach(child => el.remove(child)); -} - -ConfigParser.prototype = { - getAttribute: function (attr) { - return this.doc.getroot().attrib[attr]; - }, - - packageName: function () { - return this.getAttribute('id'); - }, - setPackageName: function (id) { - this.doc.getroot().attrib['id'] = id; - }, - android_packageName: function () { - return this.getAttribute('android-packageName'); - }, - android_activityName: function () { - return this.getAttribute('android-activityName'); - }, - ios_CFBundleIdentifier: function () { - return this.getAttribute('ios-CFBundleIdentifier'); - }, - name: function () { - return getNodeTextSafe(this.doc.find('name')); - }, - setName: function (name) { - var el = findOrCreate(this.doc, 'name'); - el.text = name; - }, - shortName: function () { - return this.doc.find('name').attrib['short'] || this.name(); - }, - setShortName: function (shortname) { - var el = findOrCreate(this.doc, 'name'); - if (!el.text) { - el.text = shortname; - } - el.attrib['short'] = shortname; - }, - description: function () { - return getNodeTextSafe(this.doc.find('description')); - }, - setDescription: function (text) { - var el = findOrCreate(this.doc, 'description'); - el.text = text; - }, - version: function () { - return this.getAttribute('version'); - }, - windows_packageVersion: function () { - return this.getAttribute('windows-packageVersion'); - }, - android_versionCode: function () { - return this.getAttribute('android-versionCode'); - }, - ios_CFBundleVersion: function () { - return this.getAttribute('ios-CFBundleVersion'); - }, - setVersion: function (value) { - this.doc.getroot().attrib['version'] = value; - }, - author: function () { - return getNodeTextSafe(this.doc.find('author')); - }, - getGlobalPreference: function (name) { - return findElementAttributeValue(name, this.doc.findall('preference')); - }, - setGlobalPreference: function (name, value) { - var pref = this.doc.find('preference[@name="' + name + '"]'); - if (!pref) { - pref = new et.Element('preference'); - pref.attrib.name = name; - this.doc.getroot().append(pref); - } - pref.attrib.value = value; - }, - getPlatformPreference: function (name, platform) { - return findElementAttributeValue(name, this.doc.findall('./platform[@name="' + platform + '"]/preference')); - }, - setPlatformPreference: function (name, platform, value) { - const platformEl = this.doc.find('./platform[@name="' + platform + '"]'); - if (!platformEl) { - throw new CordovaError('platform does not exist (received platform: ' + platform + ')'); - } - const elems = this.doc.findall('./platform[@name="' + platform + '"]/preference'); - let pref = elems.filter(function (elem) { - return elem.attrib.name.toLowerCase() === name.toLowerCase(); - }).pop(); - - if (!pref) { - pref = new et.Element('preference'); - pref.attrib.name = name; - platformEl.append(pref); - } - pref.attrib.value = value; - }, - getPreference: function (name, platform) { - var platformPreference = ''; - - if (platform) { - platformPreference = this.getPlatformPreference(name, platform); - } - - return platformPreference || this.getGlobalPreference(name); - }, - setPreference: function (name, platform, value) { - if (!value) { - value = platform; - platform = undefined; - } - - if (platform) { - this.setPlatformPreference(name, platform, value); - } else { - this.setGlobalPreference(name, value); - } - }, - /** - * Returns all resources for the platform specified. - * @param {String} platform The platform. - * @param {string} resourceName Type of static resources to return. - * "icon" and "splash" currently supported. - * @return {Array} Resources for the platform specified. - */ - getStaticResources: function (platform, resourceName) { - var ret = []; - var staticResources = []; - if (platform) { // platform specific icons - this.doc.findall('./platform[@name="' + platform + '"]/' + resourceName).forEach(function (elt) { - elt.platform = platform; // mark as platform specific resource - staticResources.push(elt); - }); - } - // root level resources - staticResources = staticResources.concat(this.doc.findall(resourceName)); - // parse resource elements - var that = this; - staticResources.forEach(function (elt) { - var res = {}; - res.src = elt.attrib.src; - res.target = elt.attrib.target || undefined; - res.density = elt.attrib['density'] || elt.attrib[that.cdvNamespacePrefix + ':density'] || elt.attrib['gap:density']; - res.platform = elt.platform || null; // null means icon represents default icon (shared between platforms) - res.width = +elt.attrib.width || undefined; - res.height = +elt.attrib.height || undefined; - res.background = elt.attrib.background || undefined; - res.foreground = elt.attrib.foreground || undefined; - - // default icon - if (!res.width && !res.height && !res.density) { - ret.defaultResource = res; - } - ret.push(res); - }); - - /** - * Returns resource with specified width and/or height. - * @param {number} width Width of resource. - * @param {number} height Height of resource. - * @return {Resource} Resource object or null if not found. - */ - ret.getBySize = function (width, height) { - return ret.filter(function (res) { - if (!res.width && !res.height) { - return false; - } - return ((!res.width || (width === res.width)) && - (!res.height || (height === res.height))); - })[0] || null; - }; - - /** - * Returns resource with specified density. - * @param {string} density Density of resource. - * @return {Resource} Resource object or null if not found. - */ - ret.getByDensity = function (density) { - return ret.filter(function (res) { - return res.density === density; - })[0] || null; - }; - - /** Returns default icons */ - ret.getDefault = function () { - return ret.defaultResource; - }; - - return ret; - }, - - /** - * Returns all icons for specific platform. - * @param {string} platform Platform name - * @return {Resource[]} Array of icon objects. - */ - getIcons: function (platform) { - return this.getStaticResources(platform, 'icon'); - }, - - /** - * Returns all splash images for specific platform. - * @param {string} platform Platform name - * @return {Resource[]} Array of Splash objects. - */ - getSplashScreens: function (platform) { - return this.getStaticResources(platform, 'splash'); - }, - - /** - * Returns all resource-files for a specific platform. - * @param {string} platform Platform name - * @param {boolean} includeGlobal Whether to return resource-files at the - * root level. - * @return {Resource[]} Array of resource file objects. - */ - getFileResources: function (platform, includeGlobal) { - var fileResources = []; - - if (platform) { // platform specific resources - fileResources = this.doc.findall('./platform[@name="' + platform + '"]/resource-file').map(function (tag) { - return { - platform: platform, - src: tag.attrib.src, - target: tag.attrib.target, - versions: tag.attrib.versions, - deviceTarget: tag.attrib['device-target'], - arch: tag.attrib.arch - }; - }); - } - - if (includeGlobal) { - this.doc.findall('resource-file').forEach(function (tag) { - fileResources.push({ - platform: platform || null, - src: tag.attrib.src, - target: tag.attrib.target, - versions: tag.attrib.versions, - deviceTarget: tag.attrib['device-target'], - arch: tag.attrib.arch - }); - }); - } - - return fileResources; - }, - - /** - * Returns all hook scripts for the hook type specified. - * @param {String} hook The hook type. - * @param {Array} platforms Platforms to look for scripts into (root scripts will be included as well). - * @return {Array} Script elements. - */ - getHookScripts: function (hook, platforms) { - var self = this; - var scriptElements = self.doc.findall('./hook'); - - if (platforms) { - platforms.forEach(function (platform) { - scriptElements = scriptElements.concat(self.doc.findall('./platform[@name="' + platform + '"]/hook')); - }); - } - - function filterScriptByHookType (el) { - return el.attrib.src && el.attrib.type && el.attrib.type.toLowerCase() === hook; - } - - return scriptElements.filter(filterScriptByHookType); - }, - /** - * Returns a list of plugin (IDs). - * - * This function also returns any plugin's that - * were defined using the legacy tags. - * @return {string[]} Array of plugin IDs - */ - getPluginIdList: function () { - var plugins = this.doc.findall('plugin'); - var result = plugins.map(function (plugin) { - return plugin.attrib.name; - }); - var features = this.doc.findall('feature'); - features.forEach(function (element) { - var idTag = element.find('./param[@name="id"]'); - if (idTag) { - result.push(idTag.attrib.value); - } - }); - return result; - }, - getPlugins: function () { - return this.getPluginIdList().map(function (pluginId) { - return this.getPlugin(pluginId); - }, this); - }, - /** - * Adds a plugin element. Does not check for duplicates. - * @name addPlugin - * @function - * @param {object} attributes name and spec are supported - * @param {Array|object} variables name, value or arbitary object - */ - addPlugin: function (attributes, variables) { - if (!attributes && !attributes.name) return; - var el = new et.Element('plugin'); - el.attrib.name = attributes.name; - if (attributes.spec) { - el.attrib.spec = attributes.spec; - } - - // support arbitrary object as variables source - if (variables && typeof variables === 'object' && !Array.isArray(variables)) { - variables = Object.keys(variables) - .map(function (variableName) { - return { name: variableName, value: variables[variableName] }; - }); - } - - if (variables) { - variables.forEach(function (variable) { - el.append(new et.Element('variable', { name: variable.name, value: variable.value })); - }); - } - this.doc.getroot().append(el); - }, - /** - * Retrives the plugin with the given id or null if not found. - * - * This function also returns any plugin's that - * were defined using the legacy tags. - * @name getPlugin - * @function - * @param {String} id - * @returns {object} plugin including any variables - */ - getPlugin: function (id) { - if (!id) { - return undefined; - } - var pluginElement = this.doc.find('./plugin/[@name="' + id + '"]'); - if (pluginElement === null) { - var legacyFeature = this.doc.find('./feature/param[@name="id"][@value="' + id + '"]/..'); - if (legacyFeature) { - events.emit('log', 'Found deprecated feature entry for ' + id + ' in config.xml.'); - return featureToPlugin(legacyFeature); - } - return undefined; - } - var plugin = {}; - - plugin.name = pluginElement.attrib.name; - plugin.spec = pluginElement.attrib.spec || pluginElement.attrib.src || pluginElement.attrib.version; - plugin.variables = {}; - var variableElements = pluginElement.findall('variable'); - variableElements.forEach(function (varElement) { - var name = varElement.attrib.name; - var value = varElement.attrib.value; - if (name) { - plugin.variables[name] = value; - } - }); - return plugin; - }, - /** - * Remove the plugin entry with give name (id). - * - * This function also operates on any plugin's that - * were defined using the legacy tags. - * @name removePlugin - * @function - * @param id name of the plugin - */ - removePlugin: function (id) { - if (!id) return; - const root = this.doc.getroot(); - removeChildren(root, `./plugin/[@name="${id}"]`); - removeChildren(root, `./feature/param[@name="id"][@value="${id}"]/..`); - }, - - // Add any element to the root - addElement: function (name, attributes) { - var el = et.Element(name); - for (var a in attributes) { - el.attrib[a] = attributes[a]; - } - this.doc.getroot().append(el); - }, - - /** - * Adds an engine. Does not check for duplicates. - * @param {String} name the engine name - * @param {String} spec engine source location or version (optional) - */ - addEngine: function (name, spec) { - if (!name) return; - var el = et.Element('engine'); - el.attrib.name = name; - if (spec) { - el.attrib.spec = spec; - } - this.doc.getroot().append(el); - }, - /** - * Removes all the engines with given name - * @param {String} name the engine name. - */ - removeEngine: function (name) { - removeChildren(this.doc.getroot(), `./engine/[@name="${name}"]`); - }, - getEngines: function () { - var engines = this.doc.findall('./engine'); - return engines.map(function (engine) { - var spec = engine.attrib.spec || engine.attrib.version; - return { - name: engine.attrib.name, - spec: spec || null - }; - }); - }, - /* Get all the access tags */ - getAccesses: function () { - var accesses = this.doc.findall('./access'); - return accesses.map(function (access) { - var minimum_tls_version = access.attrib['minimum-tls-version']; /* String */ - var requires_forward_secrecy = access.attrib['requires-forward-secrecy']; /* Boolean */ - var requires_certificate_transparency = access.attrib['requires-certificate-transparency']; /* Boolean */ - var allows_arbitrary_loads_in_web_content = access.attrib['allows-arbitrary-loads-in-web-content']; /* Boolean */ - var allows_arbitrary_loads_in_media = access.attrib['allows-arbitrary-loads-in-media']; /* Boolean (DEPRECATED) */ - var allows_arbitrary_loads_for_media = access.attrib['allows-arbitrary-loads-for-media']; /* Boolean */ - var allows_local_networking = access.attrib['allows-local-networking']; /* Boolean */ - - return { - origin: access.attrib.origin, - minimum_tls_version: minimum_tls_version, - requires_forward_secrecy: requires_forward_secrecy, - requires_certificate_transparency: requires_certificate_transparency, - allows_arbitrary_loads_in_web_content: allows_arbitrary_loads_in_web_content, - allows_arbitrary_loads_in_media: allows_arbitrary_loads_in_media, - allows_arbitrary_loads_for_media: allows_arbitrary_loads_for_media, - allows_local_networking: allows_local_networking - }; - }); - }, - /* Get all the allow-navigation tags */ - getAllowNavigations: function () { - var allow_navigations = this.doc.findall('./allow-navigation'); - return allow_navigations.map(function (allow_navigation) { - var minimum_tls_version = allow_navigation.attrib['minimum-tls-version']; /* String */ - var requires_forward_secrecy = allow_navigation.attrib['requires-forward-secrecy']; /* Boolean */ - var requires_certificate_transparency = allow_navigation.attrib['requires-certificate-transparency']; /* Boolean */ - - return { - href: allow_navigation.attrib.href, - minimum_tls_version: minimum_tls_version, - requires_forward_secrecy: requires_forward_secrecy, - requires_certificate_transparency: requires_certificate_transparency - }; - }); - }, - /* Get all the allow-intent tags */ - getAllowIntents: function () { - var allow_intents = this.doc.findall('./allow-intent'); - return allow_intents.map(function (allow_intent) { - return { - href: allow_intent.attrib.href - }; - }); - }, - /* Get all edit-config tags */ - getEditConfigs: function (platform) { - var platform_edit_configs = this.doc.findall('./platform[@name="' + platform + '"]/edit-config'); - var edit_configs = this.doc.findall('edit-config').concat(platform_edit_configs); - - return edit_configs.map(function (tag) { - var editConfig = - { - file: tag.attrib['file'], - target: tag.attrib['target'], - mode: tag.attrib['mode'], - id: 'config.xml', - xmls: tag.getchildren() - }; - return editConfig; - }); - }, - - /* Get all config-file tags */ - getConfigFiles: function (platform) { - var platform_config_files = this.doc.findall('./platform[@name="' + platform + '"]/config-file'); - var config_files = this.doc.findall('config-file').concat(platform_config_files); - - return config_files.map(function (tag) { - var configFile = - { - target: tag.attrib['target'], - parent: tag.attrib['parent'], - after: tag.attrib['after'], - xmls: tag.getchildren(), - // To support demuxing via versions - versions: tag.attrib['versions'], - deviceTarget: tag.attrib['device-target'] - }; - return configFile; - }); - }, - - write: function () { - fs.writeFileSync(this.path, this.doc.write({ indent: 4 }), 'utf-8'); - } -}; - -function featureToPlugin (featureElement) { - var plugin = {}; - plugin.variables = []; - var pluginVersion, - pluginSrc; - - var nodes = featureElement.findall('param'); - nodes.forEach(function (element) { - var n = element.attrib.name; - var v = element.attrib.value; - if (n === 'id') { - plugin.name = v; - } else if (n === 'version') { - pluginVersion = v; - } else if (n === 'url' || n === 'installPath') { - pluginSrc = v; - } else { - plugin.variables[n] = v; - } - }); - - var spec = pluginSrc || pluginVersion; - if (spec) { - plugin.spec = spec; - } - - return plugin; -} -module.exports = ConfigParser; diff --git a/chabok-starter-cordova/node_modules/cordova-common/src/CordovaCheck.js b/chabok-starter-cordova/node_modules/cordova-common/src/CordovaCheck.js deleted file mode 100644 index 5b20ade..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/src/CordovaCheck.js +++ /dev/null @@ -1,76 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -var fs = require('fs-extra'); -var path = require('path'); - -function isRootDir (dir) { - if (fs.existsSync(path.join(dir, 'www'))) { - if (fs.existsSync(path.join(dir, 'config.xml'))) { - // For sure is. - if (fs.existsSync(path.join(dir, 'platforms'))) { - return 2; - } else { - return 1; - } - } - // Might be (or may be under platforms/). - if (fs.existsSync(path.join(dir, 'www', 'config.xml'))) { - return 1; - } - } - return 0; -} - -// Runs up the directory chain looking for a .cordova directory. -// IF it is found we are in a Cordova project. -// Omit argument to use CWD. -function isCordova (dir) { - if (!dir) { - // Prefer PWD over cwd so that symlinked dirs within your PWD work correctly (CB-5687). - var pwd = process.env.PWD; - var cwd = process.cwd(); - if (pwd && pwd !== cwd && pwd !== 'undefined') { - return isCordova(pwd) || isCordova(cwd); - } - return isCordova(cwd); - } - var bestReturnValueSoFar = false; - for (var i = 0; i < 1000; ++i) { - var result = isRootDir(dir); - if (result === 2) { - return dir; - } - if (result === 1) { - bestReturnValueSoFar = dir; - } - var parentDir = path.normalize(path.join(dir, '..')); - // Detect fs root. - if (parentDir === dir) { - return bestReturnValueSoFar; - } - dir = parentDir; - } - console.error('Hit an unhandled case in CordovaCheck.isCordova'); - return false; -} - -module.exports = { - findProjectRoot: isCordova -}; diff --git a/chabok-starter-cordova/node_modules/cordova-common/src/CordovaError/CordovaError.js b/chabok-starter-cordova/node_modules/cordova-common/src/CordovaError/CordovaError.js deleted file mode 100644 index 34230a7..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/src/CordovaError/CordovaError.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -var EOL = require('os').EOL; - -/** - * A derived exception class. See usage example in cli.js - * Based on: - * stackoverflow.com/questions/1382107/whats-a-good-way-to-extend-error-in-javascript/8460753#8460753 - * @param {String} message Error message - * @param {Number} [code=0] Error code - * @param {CordovaExternalToolErrorContext} [context] External tool error context object - * @constructor - */ -function CordovaError (message, code, context) { - Error.captureStackTrace(this, this.constructor); - this.name = this.constructor.name; - this.message = message; - this.code = code || CordovaError.UNKNOWN_ERROR; - this.context = context; -} - -// FIXME __proto__ property has been deprecated as of ECMAScript 3.1 -// eslint-disable-next-line no-proto -CordovaError.prototype.__proto__ = Error.prototype; - -// TODO: Extend error codes according the projects specifics -CordovaError.UNKNOWN_ERROR = 0; -CordovaError.EXTERNAL_TOOL_ERROR = 1; - -/** - * Translates instance's error code number into error code name, e.g. 0 -> UNKNOWN_ERROR - * @returns {string} Error code string name - */ -CordovaError.prototype.getErrorCodeName = function () { - for (const key of Object.keys(CordovaError)) { - if (CordovaError[key] === this.code) { - return key; - } - } -}; - -/** - * Converts CordovaError instance to string representation - * @param {Boolean} [isVerbose] Set up verbose mode. Used to provide more - * details including information about error code name and context - * @return {String} Stringified error representation - */ -CordovaError.prototype.toString = function (isVerbose) { - var message = ''; - var codePrefix = ''; - - if (this.code !== CordovaError.UNKNOWN_ERROR) { - codePrefix = 'code: ' + this.code + (isVerbose ? (' (' + this.getErrorCodeName() + ')') : '') + ' '; - } - - if (this.code === CordovaError.EXTERNAL_TOOL_ERROR) { - if (typeof this.context !== 'undefined') { - if (isVerbose) { - message = codePrefix + EOL + this.context.toString(isVerbose) + '\n failed with an error: ' + - this.message + EOL + 'Stack trace: ' + this.stack; - } else { - message = codePrefix + '\'' + this.context.toString(isVerbose) + '\' ' + this.message; - } - } else { - message = 'External tool failed with an error: ' + this.message; - } - } else { - message = isVerbose ? codePrefix + this.stack : codePrefix + this.message; - } - - return message; -}; - -module.exports = CordovaError; diff --git a/chabok-starter-cordova/node_modules/cordova-common/src/CordovaError/CordovaExternalToolErrorContext.js b/chabok-starter-cordova/node_modules/cordova-common/src/CordovaError/CordovaExternalToolErrorContext.js deleted file mode 100644 index 30699b4..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/src/CordovaError/CordovaExternalToolErrorContext.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -/* jshint proto:true */ - -var path = require('path'); - -/** - * @param {String} cmd Command full path - * @param {String[]} args Command args - * @param {String} [cwd] Command working directory - * @constructor - */ -function CordovaExternalToolErrorContext (cmd, args, cwd) { - this.cmd = cmd; - // Helper field for readability - this.cmdShortName = path.basename(cmd); - this.args = args; - this.cwd = cwd; -} - -CordovaExternalToolErrorContext.prototype.toString = function (isVerbose) { - if (isVerbose) { - return 'External tool \'' + this.cmdShortName + '\'' + - '\nCommand full path: ' + this.cmd + '\nCommand args: ' + this.args + - (typeof this.cwd !== 'undefined' ? '\nCommand cwd: ' + this.cwd : ''); - } - - return this.cmdShortName; -}; - -module.exports = CordovaExternalToolErrorContext; diff --git a/chabok-starter-cordova/node_modules/cordova-common/src/CordovaLogger.js b/chabok-starter-cordova/node_modules/cordova-common/src/CordovaLogger.js deleted file mode 100644 index 85cd3a9..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/src/CordovaLogger.js +++ /dev/null @@ -1,228 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -const ansi = require('ansi'); -const EventEmitter = require('events').EventEmitter; -const EOL = require('os').EOL; -const formatError = require('./util/formatError'); - -const INSTANCE_KEY = Symbol.for('org.apache.cordova.common.CordovaLogger'); - -/** - * @typedef {'verbose'|'normal'|'warn'|'info'|'error'|'results'} CordovaLoggerLevel - */ - -/** - * Implements logging facility that anybody could use. - * - * Should not be instantiated directly! `CordovaLogger.get()` method should be - * used instead to acquire the logger instance. - */ -class CordovaLogger { - // Encapsulate the default logging level values with constants: - static get VERBOSE () { return 'verbose'; } - - static get NORMAL () { return 'normal'; } - - static get WARN () { return 'warn'; } - - static get INFO () { return 'info'; } - - static get ERROR () { return 'error'; } - - static get RESULTS () { return 'results'; } - - /** - * Static method to create new or acquire existing instance. - * - * @returns {CordovaLogger} Logger instance - */ - static get () { - // This singleton instance pattern is based on the ideas from - // https://derickbailey.com/2016/03/09/creating-a-true-singleton-in-node-js-with-es6-symbols/ - if (Object.getOwnPropertySymbols(global).indexOf(INSTANCE_KEY) === -1) { - global[INSTANCE_KEY] = new CordovaLogger(); - } - return global[INSTANCE_KEY]; - } - - constructor () { - /** @private */ - this.levels = {}; - /** @private */ - this.colors = {}; - /** @private */ - this.stdout = process.stdout; - /** @private */ - this.stderr = process.stderr; - - /** @private */ - this.stdoutCursor = ansi(this.stdout); - /** @private */ - this.stderrCursor = ansi(this.stderr); - - this.addLevel(CordovaLogger.VERBOSE, 1000, 'grey'); - this.addLevel(CordovaLogger.NORMAL, 2000); - this.addLevel(CordovaLogger.WARN, 2000, 'yellow'); - this.addLevel(CordovaLogger.INFO, 3000, 'blue'); - this.addLevel(CordovaLogger.ERROR, 5000, 'red'); - this.addLevel(CordovaLogger.RESULTS, 10000); - - this.setLevel(CordovaLogger.NORMAL); - } - - /** - * Emits log message to process' stdout/stderr depending on message's - * severity and current log level. If severity is less than current - * logger's level, then the message is ignored. - * - * @param {CordovaLoggerLevel} logLevel - The message's log level. The - * logger should have corresponding level added (via logger.addLevel), - * otherwise `CordovaLogger.NORMAL` level will be used. - * - * @param {string} message - The message, that should be logged to - * process's stdio. - * - * @returns {CordovaLogger} Return the current instance, to allow chaining. - */ - log (logLevel, message) { - // if there is no such logLevel defined, or provided level has - // less severity than active level, then just ignore this call and return - if (!this.levels[logLevel] || this.levels[logLevel] < this.levels[this.logLevel]) { - // return instance to allow to chain calls - return this; - } - - var isVerbose = this.logLevel === CordovaLogger.VERBOSE; - var cursor = this.stdoutCursor; - - if (message instanceof Error || logLevel === CordovaLogger.ERROR) { - message = formatError(message, isVerbose); - cursor = this.stderrCursor; - } - - var color = this.colors[logLevel]; - if (color) { - cursor.bold().fg[color](); - } - - cursor.write(message).reset().write(EOL); - - return this; - } - - /** - * Adds a new level to logger instance. - * - * This method also creates a shortcut method to log events with the level - * provided. - * (i.e. after adding new level 'debug', the method `logger.debug(message)` - * will exist, equal to `logger.log('debug', message)`) - * - * @param {CordovaLoggerLevel} level - A log level name. The levels with - * the following names are added by default to every instance: 'verbose', - * 'normal', 'warn', 'info', 'error', 'results'. - * - * @param {number} severity - A number that represents level's severity. - * - * @param {string} color - A valid color name, that will be used to log - * messages with this level. Any CSS color code or RGB value is allowed - * (according to ansi documentation: - * https://github.com/TooTallNate/ansi.js#features). - * - * @returns {CordovaLogger} Return the current instance, to allow chaining. - */ - addLevel (level, severity, color) { - this.levels[level] = severity; - - if (color) { - this.colors[level] = color; - } - - // Define own method with corresponding name - if (!this[level]) { - Object.defineProperty(this, level, { - get () { return this.log.bind(this, level); } - }); - } - - return this; - } - - /** - * Sets the current logger level to provided value. - * - * If logger doesn't have level with this name, `CordovaLogger.NORMAL` will - * be used. - * - * @param {CordovaLoggerLevel} logLevel - Level name. The level with this - * name should be added to logger before. - * - * @returns {CordovaLogger} Current instance, to allow chaining. - */ - setLevel (logLevel) { - this.logLevel = this.levels[logLevel] ? logLevel : CordovaLogger.NORMAL; - - return this; - } - - /** - * Adjusts the current logger level according to the passed options. - * - * @param {Object|Array} opts - An object or args array with - * options. - * - * @returns {CordovaLogger} Current instance, to allow chaining. - */ - adjustLevel (opts) { - if (opts.verbose || (Array.isArray(opts) && opts.includes('--verbose'))) { - this.setLevel('verbose'); - } else if (opts.silent || (Array.isArray(opts) && opts.includes('--silent'))) { - this.setLevel('error'); - } - - return this; - } - - /** - * Attaches logger to EventEmitter instance provided. - * - * @param {EventEmitter} eventEmitter - An EventEmitter instance to attach - * the logger to. - * - * @returns {CordovaLogger} Current instance, to allow chaining. - */ - subscribe (eventEmitter) { - if (!(eventEmitter instanceof EventEmitter)) { - throw new Error('Subscribe method only accepts an EventEmitter instance as argument'); - } - - eventEmitter.on('verbose', this.verbose) - .on('log', this.normal) - .on('info', this.info) - .on('warn', this.warn) - .on('warning', this.warn) - // Set up event handlers for logging and results emitted as events. - .on('results', this.results); - - return this; - } -} - -module.exports = CordovaLogger; diff --git a/chabok-starter-cordova/node_modules/cordova-common/src/FileUpdater.js b/chabok-starter-cordova/node_modules/cordova-common/src/FileUpdater.js deleted file mode 100644 index 6f384b5..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/src/FileUpdater.js +++ /dev/null @@ -1,402 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -'use strict'; - -var fs = require('fs-extra'); -var path = require('path'); -var minimatch = require('minimatch'); - -/** - * Logging callback used in the FileUpdater methods. - * @callback loggingCallback - * @param {string} message A message describing a single file update operation. - */ - -/** - * Updates a target file or directory with a source file or directory. (Directory updates are - * not recursive.) Stats for target and source items must be passed in. This is an internal - * helper function used by other methods in this module. - * - * @param {?string} sourcePath Source file or directory to be used to update the - * destination. If the source is null, then the destination is deleted if it exists. - * @param {?fs.Stats} sourceStats An instance of fs.Stats for the source path, or null if - * the source does not exist. - * @param {string} targetPath Required destination file or directory to be updated. If it does - * not exist, it will be created. - * @param {?fs.Stats} targetStats An instance of fs.Stats for the target path, or null if - * the target does not exist. - * @param {Object} [options] Optional additional parameters for the update. - * @param {string} [options.rootDir] Optional root directory (such as a project) to which target - * and source path parameters are relative; may be omitted if the paths are absolute. The - * rootDir is always omitted from any logged paths, to make the logs easier to read. - * @param {boolean} [options.all] If true, all files are copied regardless of last-modified times. - * Otherwise, a file is copied if the source's last-modified time is greather than or - * equal to the target's last-modified time, or if the file sizes are different. - * @param {loggingCallback} [log] Optional logging callback that takes a string message - * describing any file operations that are performed. - * @return {boolean} true if any changes were made, or false if the force flag is not set - * and everything was up to date - */ -function updatePathWithStats (sourcePath, sourceStats, targetPath, targetStats, options, log) { - var updated = false; - - var rootDir = (options && options.rootDir) || ''; - var copyAll = (options && options.all) || false; - - var targetFullPath = path.join(rootDir || '', targetPath); - - if (sourceStats) { - var sourceFullPath = path.join(rootDir || '', sourcePath); - - if (targetStats && (targetStats.isDirectory() !== sourceStats.isDirectory())) { - // The target exists. But if the directory status doesn't match the source, delete it. - log('delete ' + targetPath); - fs.removeSync(targetFullPath); - targetStats = null; - updated = true; - } - - if (!targetStats) { - if (sourceStats.isDirectory()) { - // The target directory does not exist, so it should be created. - log('mkdir ' + targetPath); - fs.ensureDirSync(targetFullPath); - updated = true; - } else if (sourceStats.isFile()) { - // The target file does not exist, so it should be copied from the source. - log('copy ' + sourcePath + ' ' + targetPath + (copyAll ? '' : ' (new file)')); - fs.copySync(sourceFullPath, targetFullPath); - updated = true; - } - } else if (sourceStats.isFile() && targetStats.isFile()) { - // The source and target paths both exist and are files. - if (copyAll) { - // The caller specified all files should be copied. - log('copy ' + sourcePath + ' ' + targetPath); - fs.copySync(sourceFullPath, targetFullPath); - updated = true; - } else { - // Copy if the source has been modified since it was copied to the target, or if - // the file sizes are different. (The latter catches most cases in which something - // was done to the file after copying.) Comparison is >= rather than > to allow - // for timestamps lacking sub-second precision in some filesystems. - if (sourceStats.mtime.getTime() >= targetStats.mtime.getTime() || - sourceStats.size !== targetStats.size) { - log('copy ' + sourcePath + ' ' + targetPath + ' (updated file)'); - fs.copySync(sourceFullPath, targetFullPath); - updated = true; - } - } - } - } else if (targetStats) { - // The target exists but the source is null, so the target should be deleted. - log('delete ' + targetPath + (copyAll ? '' : ' (no source)')); - fs.removeSync(targetFullPath); - updated = true; - } - - return updated; -} - -/** - * Helper for updatePath and updatePaths functions. Queries stats for source and target - * and ensures target directory exists before copying a file. - */ -function updatePathInternal (sourcePath, targetPath, options, log) { - var rootDir = (options && options.rootDir) || ''; - var targetFullPath = path.join(rootDir, targetPath); - var targetStats = fs.existsSync(targetFullPath) ? fs.statSync(targetFullPath) : null; - var sourceStats = null; - - if (sourcePath) { - // A non-null source path was specified. It should exist. - var sourceFullPath = path.join(rootDir, sourcePath); - if (!fs.existsSync(sourceFullPath)) { - throw new Error('Source path does not exist: ' + sourcePath); - } - - sourceStats = fs.statSync(sourceFullPath); - - // Create the target's parent directory if it doesn't exist. - var parentDir = path.dirname(targetFullPath); - if (!fs.existsSync(parentDir)) { - fs.ensureDirSync(parentDir); - } - } - - return updatePathWithStats(sourcePath, sourceStats, targetPath, targetStats, options, log); -} - -/** - * Updates a target file or directory with a source file or directory. (Directory updates are - * not recursive.) - * - * @param {?string} sourcePath Source file or directory to be used to update the - * destination. If the source is null, then the destination is deleted if it exists. - * @param {string} targetPath Required destination file or directory to be updated. If it does - * not exist, it will be created. - * @param {Object} [options] Optional additional parameters for the update. - * @param {string} [options.rootDir] Optional root directory (such as a project) to which target - * and source path parameters are relative; may be omitted if the paths are absolute. The - * rootDir is always omitted from any logged paths, to make the logs easier to read. - * @param {boolean} [options.all] If true, all files are copied regardless of last-modified times. - * Otherwise, a file is copied if the source's last-modified time is greather than or - * equal to the target's last-modified time, or if the file sizes are different. - * @param {loggingCallback} [log] Optional logging callback that takes a string message - * describing any file operations that are performed. - * @return {boolean} true if any changes were made, or false if the force flag is not set - * and everything was up to date - */ -function updatePath (sourcePath, targetPath, options, log) { - if (sourcePath !== null && typeof sourcePath !== 'string') { - throw new Error('A source path (or null) is required.'); - } - - if (!targetPath || typeof targetPath !== 'string') { - throw new Error('A target path is required.'); - } - - log = log || function () { }; - - return updatePathInternal(sourcePath, targetPath, options, log); -} - -/** - * Updates files and directories based on a mapping from target paths to source paths. Targets - * with null sources in the map are deleted. - * - * @param {Object} pathMap A dictionary mapping from target paths to source paths. - * @param {Object} [options] Optional additional parameters for the update. - * @param {string} [options.rootDir] Optional root directory (such as a project) to which target - * and source path parameters are relative; may be omitted if the paths are absolute. The - * rootDir is always omitted from any logged paths, to make the logs easier to read. - * @param {boolean} [options.all] If true, all files are copied regardless of last-modified times. - * Otherwise, a file is copied if the source's last-modified time is greather than or - * equal to the target's last-modified time, or if the file sizes are different. - * @param {loggingCallback} [log] Optional logging callback that takes a string message - * describing any file operations that are performed. - * @return {boolean} true if any changes were made, or false if the force flag is not set - * and everything was up to date - */ -function updatePaths (pathMap, options, log) { - if (!pathMap || typeof pathMap !== 'object' || Array.isArray(pathMap)) { - throw new Error('An object mapping from target paths to source paths is required.'); - } - - log = log || function () { }; - - var updated = false; - - // Iterate in sorted order to ensure directories are created before files under them. - Object.keys(pathMap).sort().forEach(function (targetPath) { - var sourcePath = pathMap[targetPath]; - updated = updatePathInternal(sourcePath, targetPath, options, log) || updated; - }); - - return updated; -} - -/** - * Updates a target directory with merged files and subdirectories from source directories. - * - * @param {string|string[]} sourceDirs Required source directory or array of source directories - * to be merged into the target. The directories are listed in order of precedence; files in - * directories later in the array supersede files in directories earlier in the array - * (regardless of timestamps). - * @param {string} targetDir Required destination directory to be updated. If it does not exist, - * it will be created. If it exists, newer files from source directories will be copied over, - * and files missing in the source directories will be deleted. - * @param {Object} [options] Optional additional parameters for the update. - * @param {string} [options.rootDir] Optional root directory (such as a project) to which target - * and source path parameters are relative; may be omitted if the paths are absolute. The - * rootDir is always omitted from any logged paths, to make the logs easier to read. - * @param {boolean} [options.all] If true, all files are copied regardless of last-modified times. - * Otherwise, a file is copied if the source's last-modified time is greather than or - * equal to the target's last-modified time, or if the file sizes are different. - * @param {string|string[]} [options.include] Optional glob string or array of glob strings that - * are tested against both target and source relative paths to determine if they are included - * in the merge-and-update. If unspecified, all items are included. - * @param {string|string[]} [options.exclude] Optional glob string or array of glob strings that - * are tested against both target and source relative paths to determine if they are excluded - * from the merge-and-update. Exclusions override inclusions. If unspecified, no items are - * excluded. - * @param {loggingCallback} [log] Optional logging callback that takes a string message - * describing any file operations that are performed. - * @return {boolean} true if any changes were made, or false if the force flag is not set - * and everything was up to date - */ -function mergeAndUpdateDir (sourceDirs, targetDir, options, log) { - if (sourceDirs && typeof sourceDirs === 'string') { - sourceDirs = [sourceDirs]; - } else if (!Array.isArray(sourceDirs)) { - throw new Error('A source directory path or array of paths is required.'); - } - - if (!targetDir || typeof targetDir !== 'string') { - throw new Error('A target directory path is required.'); - } - - log = log || function () { }; - - var rootDir = (options && options.rootDir) || ''; - - var include = (options && options.include) || ['**']; - if (typeof include === 'string') { - include = [include]; - } else if (!Array.isArray(include)) { - throw new Error('Include parameter must be a glob string or array of glob strings.'); - } - - var exclude = (options && options.exclude) || []; - if (typeof exclude === 'string') { - exclude = [exclude]; - } else if (!Array.isArray(exclude)) { - throw new Error('Exclude parameter must be a glob string or array of glob strings.'); - } - - // Scan the files in each of the source directories. - var sourceMaps = sourceDirs.map(function (sourceDir) { - return path.join(rootDir, sourceDir); - }).map(function (sourcePath) { - if (!fs.existsSync(sourcePath)) { - throw new Error('Source directory does not exist: ' + sourcePath); - } - return mapDirectory(rootDir, path.relative(rootDir, sourcePath), include, exclude); - }); - - // Scan the files in the target directory, if it exists. - var targetMap = {}; - var targetFullPath = path.join(rootDir, targetDir); - if (fs.existsSync(targetFullPath)) { - targetMap = mapDirectory(rootDir, targetDir, include, exclude); - } - - var pathMap = mergePathMaps(sourceMaps, targetMap, targetDir); - - var updated = false; - - // Iterate in sorted order to ensure directories are created before files under them. - Object.keys(pathMap).sort().forEach(function (subPath) { - var entry = pathMap[subPath]; - updated = updatePathWithStats( - entry.sourcePath, - entry.sourceStats, - entry.targetPath, - entry.targetStats, - options, - log) || updated; - }); - - return updated; -} - -/** - * Creates a dictionary map of all files and directories under a path. - */ -function mapDirectory (rootDir, subDir, include, exclude) { - var dirMap = { '': { subDir: subDir, stats: fs.statSync(path.join(rootDir, subDir)) } }; - mapSubdirectory(rootDir, subDir, '', include, exclude, dirMap); - return dirMap; - - function mapSubdirectory (rootDir, subDir, relativeDir, include, exclude, dirMap) { - var itemMapped = false; - var items = fs.readdirSync(path.join(rootDir, subDir, relativeDir)); - - items.forEach(function (item) { - var relativePath = path.join(relativeDir, item); - if (!matchGlobArray(relativePath, exclude)) { - // Stats obtained here (required at least to know where to recurse in directories) - // are saved for later, where the modified times may also be used. This minimizes - // the number of file I/O operations performed. - var fullPath = path.join(rootDir, subDir, relativePath); - var stats = fs.statSync(fullPath); - - if (stats.isDirectory()) { - // Directories are included if either something under them is included or they - // match an include glob. - if (mapSubdirectory(rootDir, subDir, relativePath, include, exclude, dirMap) || - matchGlobArray(relativePath, include)) { - dirMap[relativePath] = { subDir: subDir, stats: stats }; - itemMapped = true; - } - } else if (stats.isFile()) { - // Files are included only if they match an include glob. - if (matchGlobArray(relativePath, include)) { - dirMap[relativePath] = { subDir: subDir, stats: stats }; - itemMapped = true; - } - } - } - }); - return itemMapped; - } - - function matchGlobArray (path, globs) { - return globs.some(function (elem) { - return minimatch(path, elem, { dot: true }); - }); - } -} - -/** - * Merges together multiple source maps and a target map into a single mapping from - * relative paths to objects with target and source paths and stats. - */ -function mergePathMaps (sourceMaps, targetMap, targetDir) { - // Merge multiple source maps together, along with target path info. - // Entries in later source maps override those in earlier source maps. - // Target stats will be filled in below for targets that exist. - var pathMap = {}; - sourceMaps.forEach(function (sourceMap) { - Object.keys(sourceMap).forEach(function (sourceSubPath) { - var sourceEntry = sourceMap[sourceSubPath]; - pathMap[sourceSubPath] = { - targetPath: path.join(targetDir, sourceSubPath), - targetStats: null, - sourcePath: path.join(sourceEntry.subDir, sourceSubPath), - sourceStats: sourceEntry.stats - }; - }); - }); - - // Fill in target stats for targets that exist, and create entries - // for targets that don't have any corresponding sources. - Object.keys(targetMap).forEach(function (subPath) { - var entry = pathMap[subPath]; - if (entry) { - entry.targetStats = targetMap[subPath].stats; - } else { - pathMap[subPath] = { - targetPath: path.join(targetDir, subPath), - targetStats: targetMap[subPath].stats, - sourcePath: null, - sourceStats: null - }; - } - }); - - return pathMap; -} - -module.exports = { - updatePath: updatePath, - updatePaths: updatePaths, - mergeAndUpdateDir: mergeAndUpdateDir -}; diff --git a/chabok-starter-cordova/node_modules/cordova-common/src/PlatformJson.js b/chabok-starter-cordova/node_modules/cordova-common/src/PlatformJson.js deleted file mode 100644 index 0a87983..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/src/PlatformJson.js +++ /dev/null @@ -1,262 +0,0 @@ -/* - * 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. - * -*/ - -var fs = require('fs-extra'); -var path = require('path'); -var endent = require('endent'); -var mungeutil = require('./ConfigChanges/munge-util'); - -function PlatformJson (filePath, platform, root) { - this.filePath = filePath; - this.platform = platform; - this.root = fix_munge(root || {}); -} - -PlatformJson.load = function (plugins_dir, platform) { - var filePath = path.join(plugins_dir, platform + '.json'); - var root = null; - if (fs.existsSync(filePath)) { - root = JSON.parse(fs.readFileSync(filePath, 'utf-8')); - } - return new PlatformJson(filePath, platform, root); -}; - -PlatformJson.prototype.save = function () { - fs.outputJsonSync(this.filePath, this.root, { spaces: 2 }); -}; - -/** - * Indicates whether the specified plugin is installed as a top-level (not as - * dependency to others) - * @method function - * @param {String} pluginId A plugin id to check for. - * @return {Boolean} true if plugin installed as top-level, otherwise false. - */ -PlatformJson.prototype.isPluginTopLevel = function (pluginId) { - return this.root.installed_plugins[pluginId]; -}; - -/** - * Indicates whether the specified plugin is installed as a dependency to other - * plugin. - * @method function - * @param {String} pluginId A plugin id to check for. - * @return {Boolean} true if plugin installed as a dependency, otherwise false. - */ -PlatformJson.prototype.isPluginDependent = function (pluginId) { - return this.root.dependent_plugins[pluginId]; -}; - -/** - * Indicates whether plugin is installed either as top-level or as dependency. - * @method function - * @param {String} pluginId A plugin id to check for. - * @return {Boolean} true if plugin installed, otherwise false. - */ -PlatformJson.prototype.isPluginInstalled = function (pluginId) { - return this.isPluginTopLevel(pluginId) || - this.isPluginDependent(pluginId); -}; - -PlatformJson.prototype.addPlugin = function (pluginId, variables, isTopLevel) { - var pluginsList = isTopLevel - ? this.root.installed_plugins - : this.root.dependent_plugins; - - pluginsList[pluginId] = variables; - - return this; -}; - -/** - * @chaining - * Generates and adds metadata for provided plugin into associated .json file - * - * @param {PluginInfo} pluginInfo A pluginInfo instance to add metadata from - * @returns {this} Current PlatformJson instance to allow calls chaining - */ -PlatformJson.prototype.addPluginMetadata = function (pluginInfo) { - var installedModules = this.root.modules || []; - - var installedPaths = installedModules.map(function (installedModule) { - return installedModule.file; - }); - - var modulesToInstall = pluginInfo.getJsModules(this.platform) - .map(function (module) { - return new ModuleMetadata(pluginInfo.id, module); - }) - .filter(function (metadata) { - // Filter out modules which are already added to metadata - return !installedPaths.includes(metadata.file); - }); - - this.root.modules = installedModules.concat(modulesToInstall); - - this.root.plugin_metadata = this.root.plugin_metadata || {}; - this.root.plugin_metadata[pluginInfo.id] = pluginInfo.version; - - return this; -}; - -PlatformJson.prototype.removePlugin = function (pluginId, isTopLevel) { - var pluginsList = isTopLevel - ? this.root.installed_plugins - : this.root.dependent_plugins; - - delete pluginsList[pluginId]; - - return this; -}; - -/** - * @chaining - * Removes metadata for provided plugin from associated file - * - * @param {PluginInfo} pluginInfo A PluginInfo instance to which modules' metadata - * we need to remove - * - * @returns {this} Current PlatformJson instance to allow calls chaining - */ -PlatformJson.prototype.removePluginMetadata = function (pluginInfo) { - var modulesToRemove = pluginInfo.getJsModules(this.platform) - .map(function (jsModule) { - return ['plugins', pluginInfo.id, jsModule.src].join('/'); - }); - - var installedModules = this.root.modules || []; - this.root.modules = installedModules - .filter(function (installedModule) { - // Leave only those metadatas which 'file' is not in removed modules - return !modulesToRemove.includes(installedModule.file); - }); - - if (this.root.plugin_metadata) { - delete this.root.plugin_metadata[pluginInfo.id]; - } - - return this; -}; - -PlatformJson.prototype.addInstalledPluginToPrepareQueue = function (pluginDirName, vars, is_top_level, force) { - this.root.prepare_queue.installed.push({ plugin: pluginDirName, vars: vars, topLevel: is_top_level, force: force }); -}; - -PlatformJson.prototype.addUninstalledPluginToPrepareQueue = function (pluginId, is_top_level) { - this.root.prepare_queue.uninstalled.push({ plugin: pluginId, id: pluginId, topLevel: is_top_level }); -}; - -/** - * Moves plugin, specified by id to top-level plugins. If plugin is top-level - * already, then does nothing. - * @method function - * @param {String} pluginId A plugin id to make top-level. - * @return {PlatformJson} PlatformJson instance. - */ -PlatformJson.prototype.makeTopLevel = function (pluginId) { - var plugin = this.root.dependent_plugins[pluginId]; - if (plugin) { - delete this.root.dependent_plugins[pluginId]; - this.root.installed_plugins[pluginId] = plugin; - } - return this; -}; - -/** - * Generates a metadata for all installed plugins and js modules. The resultant - * string is ready to be written to 'cordova_plugins.js' - * - * @returns {String} cordova_plugins.js contents - */ -PlatformJson.prototype.generateMetadata = function () { - const stringify = o => JSON.stringify(o, null, 2); - return endent` - cordova.define('cordova/plugin_list', function(require, exports, module) { - module.exports = ${stringify(this.root.modules)}; - module.exports.metadata = ${stringify(this.root.plugin_metadata)}; - }); - `; -}; - -/** - * @chaining - * Generates and then saves metadata to specified file. Doesn't check if file exists. - * - * @param {String} destination File metadata will be written to - * @return {PlatformJson} PlatformJson instance - */ -PlatformJson.prototype.generateAndSaveMetadata = function (destination) { - fs.outputFileSync(destination, this.generateMetadata()); - - return this; -}; - -// convert a munge from the old format ([file][parent][xml] = count) to the current one -function fix_munge (root) { - root.prepare_queue = root.prepare_queue || { installed: [], uninstalled: [] }; - root.config_munge = root.config_munge || { files: {} }; - root.installed_plugins = root.installed_plugins || {}; - root.dependent_plugins = root.dependent_plugins || {}; - - var munge = root.config_munge; - if (!munge.files) { - var new_munge = { files: {} }; - for (var file in munge) { - for (var selector in munge[file]) { - for (var xml_child in munge[file][selector]) { - var val = parseInt(munge[file][selector][xml_child]); - for (var i = 0; i < val; i++) { - mungeutil.deep_add(new_munge, [file, selector, { xml: xml_child, count: val }]); - } - } - } - } - root.config_munge = new_munge; - } - - return root; -} - -/** - * @constructor - * @class ModuleMetadata - * - * Creates a ModuleMetadata object that represents module entry in 'cordova_plugins.js' - * file at run time - * - * @param {String} pluginId Plugin id where this module installed from - * @param (JsModule|Object) jsModule A js-module entry from PluginInfo class to generate metadata for - */ -function ModuleMetadata (pluginId, jsModule) { - if (!pluginId) throw new TypeError('pluginId argument must be a valid plugin id'); - if (!jsModule.src && !jsModule.name) throw new TypeError('jsModule argument must contain src or/and name properties'); - - this.id = pluginId + '.' + (jsModule.name || jsModule.src.match(/([^/]+)\.js/)[1]); - this.file = ['plugins', pluginId, jsModule.src].join('/'); - this.pluginId = pluginId; - - if (jsModule.clobbers && jsModule.clobbers.length > 0) { - this.clobbers = jsModule.clobbers.map(function (o) { return o.target; }); - } - if (jsModule.merges && jsModule.merges.length > 0) { - this.merges = jsModule.merges.map(function (o) { return o.target; }); - } - if (jsModule.runs) { - this.runs = true; - } -} - -module.exports = PlatformJson; diff --git a/chabok-starter-cordova/node_modules/cordova-common/src/PluginInfo/PluginInfo.js b/chabok-starter-cordova/node_modules/cordova-common/src/PluginInfo/PluginInfo.js deleted file mode 100644 index 0130741..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/src/PluginInfo/PluginInfo.js +++ /dev/null @@ -1,494 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -/* -A class for holidng the information currently stored in plugin.xml -It should also be able to answer questions like whether the plugin -is compatible with a given engine version. - -TODO (kamrik): refactor this to not use sync functions and return promises. -*/ - -var path = require('path'); -var fs = require('fs-extra'); -var xml_helpers = require('../util/xml-helpers'); -var CordovaError = require('../CordovaError/CordovaError'); - -function PluginInfo (dirname) { - var self = this; - - // METHODS - // Defined inside the constructor to avoid the "this" binding problems. - - // tag - // Example: - // Used to require a variable to be specified via --variable when installing the plugin. - // returns { key : default | null} - self.getPreferences = getPreferences; - function getPreferences (platform) { - return _getTags(self._et, 'preference', platform, _parsePreference) - .reduce(function (preferences, pref) { - preferences[pref.preference] = pref.default; - return preferences; - }, {}); - } - - function _parsePreference (prefTag) { - var name = prefTag.attrib.name.toUpperCase(); - var def = prefTag.attrib.default || null; - return { preference: name, default: def }; - } - - // - self.getAssets = getAssets; - function getAssets (platform) { - var assets = _getTags(self._et, 'asset', platform, _parseAsset); - return assets; - } - - function _parseAsset (tag) { - var src = tag.attrib.src; - var target = tag.attrib.target; - - if (!src || !target) { - var msg = - 'Malformed tag. Both "src" and "target" attributes' + - 'must be specified in\n' + - self.filepath - ; - throw new Error(msg); - } - - var asset = { - itemType: 'asset', - src: src, - target: target - }; - return asset; - } - - // - // Example: - // - self.getDependencies = getDependencies; - function getDependencies (platform) { - var deps = _getTags( - self._et, - 'dependency', - platform, - _parseDependency - ); - return deps; - } - - function _parseDependency (tag) { - var dep = - { id: tag.attrib.id, - version: tag.attrib.version || '', - url: tag.attrib.url || '', - subdir: tag.attrib.subdir || '', - commit: tag.attrib.commit - }; - - dep.git_ref = dep.commit; - - if (!dep.id) { - var msg = - ' tag is missing id attribute in ' + - self.filepath - ; - throw new CordovaError(msg); - } - return dep; - } - - // tag - self.getConfigFiles = getConfigFiles; - function getConfigFiles (platform) { - var configFiles = _getTags(self._et, 'config-file', platform, _parseConfigFile); - return configFiles; - } - - function _parseConfigFile (tag) { - var configFile = - { target: tag.attrib['target'], - parent: tag.attrib['parent'], - after: tag.attrib['after'], - xmls: tag.getchildren(), - // To support demuxing via versions - versions: tag.attrib['versions'], - deviceTarget: tag.attrib['device-target'] - }; - return configFile; - } - - self.getEditConfigs = getEditConfigs; - function getEditConfigs (platform) { - var editConfigs = _getTags(self._et, 'edit-config', platform, _parseEditConfigs); - return editConfigs; - } - - function _parseEditConfigs (tag) { - var editConfig = - { file: tag.attrib['file'], - target: tag.attrib['target'], - mode: tag.attrib['mode'], - xmls: tag.getchildren() - }; - return editConfig; - } - - // tags, both global and within a - // TODO (kamrik): Do we ever use under ? Example wanted. - self.getInfo = getInfo; - function getInfo (platform) { - var infos = _getTags( - self._et, - 'info', - platform, - function (elem) { return elem.text; } - ); - // Filter out any undefined or empty strings. - infos = infos.filter(Boolean); - return infos; - } - - // - // Examples: - // - // - self.getSourceFiles = getSourceFiles; - function getSourceFiles (platform) { - var sourceFiles = _getTagsInPlatform(self._et, 'source-file', platform, _parseSourceFile); - return sourceFiles; - } - - function _parseSourceFile (tag) { - return { - itemType: 'source-file', - src: tag.attrib.src, - framework: isStrTrue(tag.attrib.framework), - weak: isStrTrue(tag.attrib.weak), - compilerFlags: tag.attrib['compiler-flags'], - targetDir: tag.attrib['target-dir'] - }; - } - - // - // Example: - // - self.getHeaderFiles = getHeaderFiles; - function getHeaderFiles (platform) { - var headerFiles = _getTagsInPlatform(self._et, 'header-file', platform, function (tag) { - return { - itemType: 'header-file', - src: tag.attrib.src, - targetDir: tag.attrib['target-dir'], - type: tag.attrib['type'] - }; - }); - return headerFiles; - } - - // - // Example: - // - self.getResourceFiles = getResourceFiles; - function getResourceFiles (platform) { - var resourceFiles = _getTagsInPlatform(self._et, 'resource-file', platform, function (tag) { - return { - itemType: 'resource-file', - src: tag.attrib.src, - target: tag.attrib.target, - versions: tag.attrib.versions, - deviceTarget: tag.attrib['device-target'], - arch: tag.attrib.arch, - reference: tag.attrib.reference - }; - }); - return resourceFiles; - } - - // - // Example: - // - self.getLibFiles = getLibFiles; - function getLibFiles (platform) { - var libFiles = _getTagsInPlatform(self._et, 'lib-file', platform, function (tag) { - return { - itemType: 'lib-file', - src: tag.attrib.src, - arch: tag.attrib.arch, - Include: tag.attrib.Include, - versions: tag.attrib.versions, - deviceTarget: tag.attrib['device-target'] || tag.attrib.target - }; - }); - return libFiles; - } - - // - // Example: - // - // - // - // - // - // - // - // - // - // - // - // - // - // - self.getPodSpecs = getPodSpecs; - function getPodSpecs (platform) { - var podSpecs = _getTagsInPlatform(self._et, 'podspec', platform, function (tag) { - var declarations = null; - var sources = null; - var libraries = null; - var config = tag.find('config'); - var pods = tag.find('pods'); - if (config != null) { - sources = config.findall('source').map(function (t) { - return { - url: t.attrib.url - }; - }).reduce(function (acc, val) { - return Object.assign({}, acc, { [val.url]: { source: val.url } }); - }, {}); - } - if (pods != null) { - declarations = Object.keys(pods.attrib).reduce(function (acc, key) { - return pods.attrib[key] === undefined ? acc : Object.assign({}, acc, { [key]: pods.attrib[key] }); - }, {}); - libraries = pods.findall('pod').map(function (t) { - return Object.keys(t.attrib).reduce(function (acc, key) { - return t.attrib[key] === undefined ? acc : Object.assign({}, acc, { [key]: t.attrib[key] }); - }, {}); - }).reduce(function (acc, val) { - return Object.assign({}, acc, { [val.name]: val }); - }, {}); - } - return { - declarations: declarations, - sources: sources, - libraries: libraries - }; - }); - return podSpecs; - } - - // - // Example: - // - self.getHookScripts = getHookScripts; - function getHookScripts (hook, platforms) { - var scriptElements = self._et.findall('./hook'); - - if (platforms) { - platforms.forEach(function (platform) { - scriptElements = scriptElements.concat(self._et.findall('./platform[@name="' + platform + '"]/hook')); - }); - } - - function filterScriptByHookType (el) { - return el.attrib.src && el.attrib.type && el.attrib.type.toLowerCase() === hook; - } - - return scriptElements.filter(filterScriptByHookType); - } - - self.getJsModules = getJsModules; - function getJsModules (platform) { - var modules = _getTags(self._et, 'js-module', platform, _parseJsModule); - return modules; - } - - function _parseJsModule (tag) { - var ret = { - itemType: 'js-module', - name: tag.attrib.name, - src: tag.attrib.src, - clobbers: tag.findall('clobbers').map(function (tag) { return { target: tag.attrib.target }; }), - merges: tag.findall('merges').map(function (tag) { return { target: tag.attrib.target }; }), - runs: tag.findall('runs').length > 0 - }; - - return ret; - } - - self.getEngines = function () { - return self._et.findall('engines/engine').map(function (n) { - return { - name: n.attrib.name, - version: n.attrib.version, - platform: n.attrib.platform, - scriptSrc: n.attrib.scriptSrc - }; - }); - }; - - self.getPlatforms = function () { - return self._et.findall('platform').map(function (n) { - return { name: n.attrib.name }; - }); - }; - - self.getPlatformsArray = function () { - return self._et.findall('platform').map(function (n) { - return n.attrib.name; - }); - }; - - self.getFrameworks = function (platform, options) { - return _getTags(self._et, 'framework', platform, function (el) { - var src = el.attrib.src; - if (options) { - var vars = options.cli_variables || {}; - - if (Object.keys(vars).length === 0) { - // get variable defaults from plugin.xml for removal - vars = self.getPreferences(platform); - } - var regExp; - // Iterate over plugin variables. - // Replace them in framework src if they exist - Object.keys(vars).forEach(function (name) { - if (vars[name]) { - regExp = new RegExp('\\$' + name, 'g'); - src = src.replace(regExp, vars[name]); - } - }); - } - var ret = { - itemType: 'framework', - type: el.attrib.type, - parent: el.attrib.parent, - custom: isStrTrue(el.attrib.custom), - embed: isStrTrue(el.attrib.embed), - src: src, - spec: el.attrib.spec, - weak: isStrTrue(el.attrib.weak), - versions: el.attrib.versions, - targetDir: el.attrib['target-dir'], - deviceTarget: el.attrib['device-target'] || el.attrib.target, - arch: el.attrib.arch, - implementation: el.attrib.implementation - }; - return ret; - }); - }; - - self.getFilesAndFrameworks = getFilesAndFrameworks; - function getFilesAndFrameworks (platform, options) { - // Please avoid changing the order of the calls below, files will be - // installed in this order. - var items = [].concat( - self.getSourceFiles(platform), - self.getHeaderFiles(platform), - self.getResourceFiles(platform), - self.getFrameworks(platform, options), - self.getLibFiles(platform) - ); - return items; - } - /// // End of PluginInfo methods ///// - - /// // PluginInfo Constructor logic ///// - self.filepath = path.join(dirname, 'plugin.xml'); - if (!fs.existsSync(self.filepath)) { - throw new CordovaError('Cannot find plugin.xml for plugin "' + path.basename(dirname) + '". Please try adding it again.'); - } - - self.dir = dirname; - var et = self._et = xml_helpers.parseElementtreeSync(self.filepath); - var pelem = et.getroot(); - self.id = pelem.attrib.id; - self.version = pelem.attrib.version; - - // Optional fields - self.name = pelem.findtext('name'); - self.description = pelem.findtext('description'); - self.license = pelem.findtext('license'); - self.repo = pelem.findtext('repo'); - self.issue = pelem.findtext('issue'); - self.keywords = pelem.findtext('keywords'); - self.info = pelem.findtext('info'); - if (self.keywords) { - self.keywords = self.keywords.split(',').map(function (s) { return s.trim(); }); - } - self.getKeywordsAndPlatforms = function () { - var ret = self.keywords || []; - return ret.concat('ecosystem:cordova').concat(addCordova(self.getPlatformsArray())); - }; -} // End of PluginInfo constructor. - -// Helper function used to prefix every element of an array with cordova- -// Useful when we want to modify platforms to be cordova-platform -function addCordova (someArray) { - var newArray = someArray.map(function (element) { - return 'cordova-' + element; - }); - return newArray; -} - -// Helper function used by most of the getSomething methods of PluginInfo. -// Get all elements of a given name. Both in root and in platform sections -// for the given platform. If transform is given and is a function, it is -// applied to each element. -function _getTags (pelem, tag, platform, transform) { - var platformTag = pelem.find('./platform[@name="' + platform + '"]'); - var tagsInRoot = pelem.findall(tag); - tagsInRoot = tagsInRoot || []; - var tagsInPlatform = platformTag ? platformTag.findall(tag) : []; - var tags = tagsInRoot.concat(tagsInPlatform); - if (typeof transform === 'function') { - tags = tags.map(transform); - } - return tags; -} - -// Same as _getTags() but only looks inside a platform section. -function _getTagsInPlatform (pelem, tag, platform, transform) { - var platformTag = pelem.find('./platform[@name="' + platform + '"]'); - var tags = platformTag ? platformTag.findall(tag) : []; - if (typeof transform === 'function') { - tags = tags.map(transform); - } - return tags; -} - -// Check if x is a string 'true'. -function isStrTrue (x) { - return String(x).toLowerCase() === 'true'; -} - -module.exports = PluginInfo; -// Backwards compat: -PluginInfo.PluginInfo = PluginInfo; -PluginInfo.loadPluginsDir = function (dir) { - var PluginInfoProvider = require('./PluginInfoProvider'); - return new PluginInfoProvider().getAllWithinSearchPath(dir); -}; diff --git a/chabok-starter-cordova/node_modules/cordova-common/src/PluginInfo/PluginInfoProvider.js b/chabok-starter-cordova/node_modules/cordova-common/src/PluginInfo/PluginInfoProvider.js deleted file mode 100644 index 403167d..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/src/PluginInfo/PluginInfoProvider.js +++ /dev/null @@ -1,82 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -/* jshint sub:true, laxcomma:true, laxbreak:true */ - -var fs = require('fs-extra'); -var path = require('path'); -var PluginInfo = require('./PluginInfo'); -var events = require('../events'); - -function PluginInfoProvider () { - this._cache = {}; - this._getAllCache = {}; -} - -PluginInfoProvider.prototype.get = function (dirName) { - var absPath = path.resolve(dirName); - if (!this._cache[absPath]) { - this._cache[absPath] = new PluginInfo(dirName); - } - return this._cache[absPath]; -}; - -// Normally you don't need to put() entries, but it's used -// when copying plugins, and in unit tests. -PluginInfoProvider.prototype.put = function (pluginInfo) { - var absPath = path.resolve(pluginInfo.dir); - this._cache[absPath] = pluginInfo; -}; - -// Used for plugin search path processing. -// Given a dir containing multiple plugins, create a PluginInfo object for -// each of them and return as array. -// Should load them all in parallel and return a promise, but not yet. -PluginInfoProvider.prototype.getAllWithinSearchPath = function (dirName) { - var absPath = path.resolve(dirName); - if (!this._getAllCache[absPath]) { - this._getAllCache[absPath] = getAllHelper(absPath, this); - } - return this._getAllCache[absPath]; -}; - -function getAllHelper (absPath, provider) { - if (!fs.existsSync(absPath)) { - return []; - } - // If dir itself is a plugin, return it in an array with one element. - if (fs.existsSync(path.join(absPath, 'plugin.xml'))) { - return [provider.get(absPath)]; - } - var subdirs = fs.readdirSync(absPath); - var plugins = []; - subdirs.forEach(function (subdir) { - var d = path.join(absPath, subdir); - if (fs.existsSync(path.join(d, 'plugin.xml'))) { - try { - plugins.push(provider.get(d)); - } catch (e) { - events.emit('warn', 'Error parsing ' + path.join(d, 'plugin.xml.\n' + e.stack)); - } - } - }); - return plugins; -} - -module.exports = PluginInfoProvider; diff --git a/chabok-starter-cordova/node_modules/cordova-common/src/PluginManager.js b/chabok-starter-cordova/node_modules/cordova-common/src/PluginManager.js deleted file mode 100644 index 4e9973b..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/src/PluginManager.js +++ /dev/null @@ -1,149 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -var Q = require('q'); -var fs = require('fs-extra'); -var path = require('path'); - -var ActionStack = require('./ActionStack'); -var PlatformJson = require('./PlatformJson'); -var CordovaError = require('./CordovaError/CordovaError'); -var PlatformMunger = require('./ConfigChanges/ConfigChanges').PlatformMunger; -var PluginInfoProvider = require('./PluginInfo/PluginInfoProvider'); - -/** - * @constructor - * @class PluginManager - * Represents an entity for adding/removing plugins for platforms - * - * @param {String} platform Platform name - * @param {Object} locations - Platform files and directories - * @param {IDEProject} ideProject The IDE project to add/remove plugin changes to/from - */ -function PluginManager (platform, locations, ideProject) { - this.platform = platform; - this.locations = locations; - this.project = ideProject; - - var platformJson = PlatformJson.load(locations.root, platform); - this.munger = new PlatformMunger(platform, locations.root, platformJson, new PluginInfoProvider()); -} - -/** - * @constructs PluginManager - * A convenience shortcut to new PluginManager(...) - * - * @param {String} platform Platform name - * @param {Object} locations - Platform files and directories - * @param {IDEProject} ideProject The IDE project to add/remove plugin changes to/from - * @returns new PluginManager instance - */ -PluginManager.get = function (platform, locations, ideProject) { - return new PluginManager(platform, locations, ideProject); -}; - -PluginManager.INSTALL = 'install'; -PluginManager.UNINSTALL = 'uninstall'; - -module.exports = PluginManager; - -/** - * Describes and implements common plugin installation/uninstallation routine. The flow is the following: - * * Validate and set defaults for options. Note that options are empty by default. Everything - * needed for platform IDE project must be passed from outside. Plugin variables (which - * are the part of the options) also must be already populated with 'PACKAGE_NAME' variable. - * * Collect all plugin's native and web files, get installers/uninstallers and process - * all these via ActionStack. - * * Save the IDE project, so the changes made by installers are persisted. - * * Generate config changes munge for plugin and apply it to all required files - * * Generate metadata for plugin and plugin modules and save it to 'cordova_plugins.js' - * - * @param {PluginInfo} plugin A PluginInfo structure representing plugin to install - * @param {Object} [options={}] An installation options. It is expected but is not necessary - * that options would contain 'variables' inner object with 'PACKAGE_NAME' field set by caller. - * - * @returns {Promise} Returns a Q promise, either resolved in case of success, rejected otherwise. - */ -PluginManager.prototype.doOperation = function (operation, plugin, options) { - if (operation !== PluginManager.INSTALL && operation !== PluginManager.UNINSTALL) { return Q.reject(new CordovaError('The parameter is incorrect. The opeation must be either "add" or "remove"')); } - - if (!plugin || plugin.constructor.name !== 'PluginInfo') { return Q.reject(new CordovaError('The parameter is incorrect. The first parameter should be a PluginInfo instance')); } - - // Set default to empty object to play safe when accesing properties - options = options || {}; - - var self = this; - var actions = new ActionStack(); - - // gather all files need to be handled during operation ... - plugin.getFilesAndFrameworks(this.platform, options) - .concat(plugin.getAssets(this.platform)) - .concat(plugin.getJsModules(this.platform)) - // ... put them into stack ... - .forEach(function (item) { - var installer = self.project.getInstaller(item.itemType); - var uninstaller = self.project.getUninstaller(item.itemType); - var actionArgs = [item, plugin, self.project, options]; - - var action; - if (operation === PluginManager.INSTALL) { - action = actions.createAction(installer, actionArgs, uninstaller, actionArgs); - } else /* op === PluginManager.UNINSTALL */{ - action = actions.createAction(uninstaller, actionArgs, installer, actionArgs); - } - actions.push(action); - }); - - // ... and run through the action stack - return actions.process(this.platform) - .then(function () { - if (self.project.write) { - self.project.write(); - } - - if (operation === PluginManager.INSTALL) { - // Ignore passed `is_top_level` option since platform itself doesn't know - // anything about managing dependencies - it's responsibility of caller. - self.munger.add_plugin_changes(plugin, options.variables, /* is_top_level= */true, /* should_increment= */true, options.force); - self.munger.platformJson.addPluginMetadata(plugin); - } else { - self.munger.remove_plugin_changes(plugin, /* is_top_level= */true); - self.munger.platformJson.removePluginMetadata(plugin); - } - - // Save everything (munge and plugin/modules metadata) - self.munger.save_all(); - - var metadata = self.munger.platformJson.generateMetadata(); - fs.writeFileSync(path.join(self.locations.www, 'cordova_plugins.js'), metadata, 'utf-8'); - - // CB-11022 save plugin metadata to both www and platform_www if options.usePlatformWww is specified - if (options.usePlatformWww) { - fs.writeFileSync(path.join(self.locations.platformWww, 'cordova_plugins.js'), metadata, 'utf-8'); - } - }); -}; - -PluginManager.prototype.addPlugin = function (plugin, installOptions) { - return this.doOperation(PluginManager.INSTALL, plugin, installOptions); -}; - -PluginManager.prototype.removePlugin = function (plugin, uninstallOptions) { - return this.doOperation(PluginManager.UNINSTALL, plugin, uninstallOptions); -}; diff --git a/chabok-starter-cordova/node_modules/cordova-common/src/events.js b/chabok-starter-cordova/node_modules/cordova-common/src/events.js deleted file mode 100644 index d16485c..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/src/events.js +++ /dev/null @@ -1,81 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -const EventEmitter = require('events').EventEmitter; - -const MAX_LISTENERS = 20; - -const INSTANCE_KEY = Symbol.for('org.apache.cordova.common.CordovaEvents'); - -let EVENTS_RECEIVER = null; - -class CordovaEventEmitter extends EventEmitter { - /** - * Sets up current instance to forward emitted events to another EventEmitter - * instance. - * - * @param {EventEmitter} [eventEmitter] The emitter instance to forward - * events to. Falsy value, when passed, disables forwarding. - */ - forwardEventsTo (eventEmitter) { - // If no argument is specified disable events forwarding - if (!eventEmitter) { - EVENTS_RECEIVER = undefined; - return; - } - - if (!(eventEmitter instanceof EventEmitter)) { - throw new Error('Cordova events can be redirected to another EventEmitter instance only'); - } - - // CB-10940 Skipping forwarding to self to avoid infinite recursion. - // This is the case when the modules are npm-linked. - if (this !== eventEmitter) { - EVENTS_RECEIVER = eventEmitter; - } else { - // Reset forwarding if we are subscribing to self - EVENTS_RECEIVER = undefined; - } - } - - /** - * Sets up current instance to forward emitted events to another EventEmitter - * instance. - * - * @param {EventEmitter} [eventEmitter] The emitter instance to forward - * events to. Falsy value, when passed, disables forwarding. - */ - emit (eventName, ...args) { - if (EVENTS_RECEIVER) { - EVENTS_RECEIVER.emit(eventName, ...args); - } - - return super.emit(eventName, ...args); - } -} - -// This singleton instance pattern is based on the ideas from -// https://derickbailey.com/2016/03/09/creating-a-true-singleton-in-node-js-with-es6-symbols/ -if (Object.getOwnPropertySymbols(global).indexOf(INSTANCE_KEY) === -1) { - const events = new CordovaEventEmitter(); - events.setMaxListeners(MAX_LISTENERS); - global[INSTANCE_KEY] = events; -} - -module.exports = global[INSTANCE_KEY]; diff --git a/chabok-starter-cordova/node_modules/cordova-common/src/superspawn.js b/chabok-starter-cordova/node_modules/cordova-common/src/superspawn.js deleted file mode 100644 index 7c999a1..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/src/superspawn.js +++ /dev/null @@ -1,155 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -var crossSpawn = require('cross-spawn'); -var fs = require('fs-extra'); -var _ = require('underscore'); -var Q = require('q'); -var events = require('./events'); -var iswin32 = process.platform === 'win32'; - -/** - * A special implementation for child_process.spawn that handles - * Windows-specific issues with batch files and spaces in paths. Returns a - * promise that succeeds only for return code 0. It is also possible to - * subscribe on spawned process' stdout and stderr streams using progress - * handler for resultant promise. - * - * @example spawn('mycommand', [], {stdio: 'pipe'}) .progress(function (stdio){ - * if (stdio.stderr) { console.error(stdio.stderr); } }) - * .then(function(result){ // do other stuff }) - * - * @param {String} cmd A command to spawn - * @param {String[]} [args=[]] An array of arguments, passed to spawned - * process - * @param {Object} [opts={}] A configuration object - * @param {String|String[]|Object} opts.stdio Property that configures how - * spawned process' stdio will behave. Has the same meaning and possible - * values as 'stdio' options for child_process.spawn method - * (https://nodejs.org/api/child_process.html#child_process_options_stdio). - * @param {Object} [env={}] A map of extra environment variables - * @param {String} [cwd=process.cwd()] Working directory for the command - * @param {Boolean} [chmod=false] If truthy, will attempt to set the execute - * bit before executing on non-Windows platforms - * - * @return {Promise} A promise that is either fulfilled if the spawned - * process is exited with zero error code or rejected otherwise. If the - * 'stdio' option set to 'default' or 'pipe', the promise also emits progress - * messages with the following contents: - * { - * 'stdout': ..., - * 'stderr': ... - * } - */ -exports.spawn = function (cmd, args, opts) { - args = args || []; - opts = opts || {}; - var spawnOpts = {}; - var d = Q.defer(); - - if (opts.stdio !== 'default') { - // Ignore 'default' value for stdio because it corresponds to child_process's default 'pipe' option - spawnOpts.stdio = opts.stdio; - } - - if (opts.cwd) { - spawnOpts.cwd = opts.cwd; - } - - if (opts.env) { - spawnOpts.env = _.extend(_.extend({}, process.env), opts.env); - } - - if (opts.chmod && !iswin32) { - try { - // This fails when module is installed in a system directory (e.g. via sudo npm install) - fs.chmodSync(cmd, '755'); - } catch (e) { - // If the perms weren't set right, then this will come as an error upon execution. - } - } - - events.emit(opts.printCommand ? 'log' : 'verbose', 'Running command: ' + cmd + ' ' + args.join(' ')); - - // At least until Node.js 8, child_process.spawn will throw exceptions - // instead of emitting error events in certain cases (like EACCES), Thus we - // have to wrap the execution in try/catch to convert them into rejections. - try { - var child = crossSpawn.spawn(cmd, args, spawnOpts); - } catch (e) { - whenDone(e); - return d.promise; - } - var capturedOut = ''; - var capturedErr = ''; - - if (child.stdout) { - child.stdout.setEncoding('utf8'); - child.stdout.on('data', function (data) { - capturedOut += data; - d.notify({ stdout: data }); - }); - } - - if (child.stderr) { - child.stderr.setEncoding('utf8'); - child.stderr.on('data', function (data) { - capturedErr += data; - d.notify({ stderr: data }); - }); - } - - child.on('close', whenDone); - child.on('error', whenDone); - function whenDone (arg) { - if (child) { - child.removeListener('close', whenDone); - child.removeListener('error', whenDone); - } - var code = typeof arg === 'number' ? arg : arg && arg.code; - - events.emit('verbose', 'Command finished with error code ' + code + ': ' + cmd + ' ' + args); - if (code === 0) { - d.resolve(capturedOut.trim()); - } else { - var errMsg = cmd + ': Command failed with exit code ' + code; - if (capturedErr) { - errMsg += ' Error output:\n' + capturedErr.trim(); - } - var err = new Error(errMsg); - if (capturedErr) { - err.stderr = capturedErr; - } - if (capturedOut) { - err.stdout = capturedOut; - } - err.code = code; - d.reject(err); - } - } - - return d.promise; -}; - -exports.maybeSpawn = function (cmd, args, opts) { - if (fs.existsSync(cmd)) { - return exports.spawn(cmd, args, opts); - } - return Q(null); -}; diff --git a/chabok-starter-cordova/node_modules/cordova-common/src/util/addProperty.js b/chabok-starter-cordova/node_modules/cordova-common/src/util/addProperty.js deleted file mode 100644 index 6e058d3..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/src/util/addProperty.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -module.exports = function addProperty (module, property, modulePath, obj) { - obj = obj || module.exports; - // Add properties as getter to delay load the modules on first invocation - Object.defineProperty(obj, property, { - configurable: true, - get: function () { - var delayLoadedModule = module.require(modulePath); - obj[property] = delayLoadedModule; - return delayLoadedModule; - } - }); -}; diff --git a/chabok-starter-cordova/node_modules/cordova-common/src/util/formatError.js b/chabok-starter-cordova/node_modules/cordova-common/src/util/formatError.js deleted file mode 100644 index c080ad2..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/src/util/formatError.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -const CordovaError = require('../CordovaError/CordovaError'); - -/** - * Formats an error for logging. - * - * @param {Error} error - The error to be formatted. - * @param {boolean} isVerbose - Whether the include additional debugging - * information when formatting the error. - * - * @returns {string} The formatted error message. - */ -module.exports = function formatError (error, isVerbose) { - var message = ''; - - if (error instanceof CordovaError) { - message = error.toString(isVerbose); - } else if (error instanceof Error) { - if (isVerbose) { - message = error.stack; - } else { - message = error.message; - } - } else { - // Plain text error message - message = error; - } - - if (typeof message === 'string' && !message.toUpperCase().startsWith('ERROR:')) { - // Needed for backward compatibility with external tools - message = 'Error: ' + message; - } - - return message; -}; diff --git a/chabok-starter-cordova/node_modules/cordova-common/src/util/plist-helpers.js b/chabok-starter-cordova/node_modules/cordova-common/src/util/plist-helpers.js deleted file mode 100644 index 9e50dbf..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/src/util/plist-helpers.js +++ /dev/null @@ -1,95 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -// contains PLIST utility functions -var __ = require('underscore'); -var plist = require('plist'); - -// adds node to doc at selector -module.exports.graftPLIST = graftPLIST; -function graftPLIST (doc, xml, selector) { - var obj = plist.parse('' + xml + ''); - - var node = doc[selector]; - if (node && Array.isArray(node) && Array.isArray(obj)) { - node = node.concat(obj); - for (var i = 0; i < node.length; i++) { - for (var j = i + 1; j < node.length; ++j) { - if (nodeEqual(node[i], node[j])) { node.splice(j--, 1); } - } - } - doc[selector] = node; - } else { - // plist uses objects for . If we have two dicts we merge them instead of - // overriding the old one. See CB-6472 - if (node && __.isObject(node) && __.isObject(obj) && !__.isDate(node) && !__.isDate(obj)) { // arrays checked above - __.extend(obj, node); - } - doc[selector] = obj; - } - - return true; -} - -// removes node from doc at selector -module.exports.prunePLIST = prunePLIST; -function prunePLIST (doc, xml, selector) { - var obj = plist.parse('' + xml + ''); - - pruneOBJECT(doc, selector, obj); - - return true; -} - -function pruneOBJECT (doc, selector, fragment) { - if (Array.isArray(fragment) && Array.isArray(doc[selector])) { - var empty = true; - for (var i in fragment) { - for (var j in doc[selector]) { - empty = pruneOBJECT(doc[selector], j, fragment[i]) && empty; - } - } - if (empty) { - delete doc[selector]; - return true; - } - } else if (nodeEqual(doc[selector], fragment)) { - delete doc[selector]; - return true; - } - - return false; -} - -function nodeEqual (node1, node2) { - if (typeof node1 !== typeof node2) { return false; } else if (typeof node1 === 'string') { - node2 = escapeRE(node2).replace(/\\\$\(\S+\)/gm, '(.*?)'); - return new RegExp('^' + node2 + '$').test(node1); - } else { - for (var key in node2) { - if (!nodeEqual(node1[key], node2[key])) return false; - } - return true; - } -} - -// escape string for use in regex -function escapeRE (str) { - return str.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&'); -} diff --git a/chabok-starter-cordova/node_modules/cordova-common/src/util/xml-helpers.js b/chabok-starter-cordova/node_modules/cordova-common/src/util/xml-helpers.js deleted file mode 100644 index ad2fdb3..0000000 --- a/chabok-starter-cordova/node_modules/cordova-common/src/util/xml-helpers.js +++ /dev/null @@ -1,339 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -/** - * contains XML utility functions, some of which are specific to elementtree - */ - -var fs = require('fs-extra'); -var path = require('path'); -var _ = require('underscore'); -var et = require('elementtree'); -var stripBom = require('strip-bom'); - -var ROOT = /^\/([^/]*)/; -var ABSOLUTE = /^\/([^/]*)\/(.*)/; - -module.exports = { - // compare two et.XML nodes, see if they match - // compares tagName, text, attributes and children (recursively) - equalNodes: function (one, two) { - if (one.tag !== two.tag) { - return false; - } else if (one.text.trim() !== two.text.trim()) { - return false; - } else if (one._children.length !== two._children.length) { - return false; - } - - if (!attribMatch(one, two)) return false; - - for (var i = 0; i < one._children.length; i++) { - if (!module.exports.equalNodes(one._children[i], two._children[i])) { - return false; - } - } - - return true; - }, - - // adds node to doc at selector, creating parent if it doesn't exist - graftXML: function (doc, nodes, selector, after) { - var parent = module.exports.resolveParent(doc, selector); - if (!parent) { - // Try to create the parent recursively if necessary - try { - var parentToCreate = et.XML('<' + path.basename(selector) + '/>'); - var parentSelector = path.dirname(selector); - - this.graftXML(doc, [parentToCreate], parentSelector); - } catch (e) { - return false; - } - parent = module.exports.resolveParent(doc, selector); - if (!parent) return false; - } - - nodes.forEach(function (node) { - // check if child is unique first - if (uniqueChild(node, parent)) { - var children = parent.getchildren(); - var insertIdx = after ? findInsertIdx(children, after) : children.length; - - // TODO: replace with parent.insert after the bug in ElementTree is fixed - parent.getchildren().splice(insertIdx, 0, node); - } - }); - - return true; - }, - - // adds new attributes to doc at selector - // Will only merge if attribute has not been modified already or --force is used - graftXMLMerge: function (doc, nodes, selector, xml) { - var target = module.exports.resolveParent(doc, selector); - if (!target) return false; - - // saves the attributes of the original xml before making changes - xml.oldAttrib = _.extend({}, target.attrib); - - nodes.forEach(function (node) { - var attributes = node.attrib; - for (var attribute in attributes) { - target.attrib[attribute] = node.attrib[attribute]; - } - }); - - return true; - }, - - // overwrite all attributes to doc at selector with new attributes - // Will only overwrite if attribute has not been modified already or --force is used - graftXMLOverwrite: function (doc, nodes, selector, xml) { - var target = module.exports.resolveParent(doc, selector); - if (!target) return false; - - // saves the attributes of the original xml before making changes - xml.oldAttrib = _.extend({}, target.attrib); - - // remove old attributes from target - var targetAttributes = target.attrib; - for (var targetAttribute in targetAttributes) { - delete targetAttributes[targetAttribute]; - } - - // add new attributes to target - nodes.forEach(function (node) { - var attributes = node.attrib; - for (var attribute in attributes) { - target.attrib[attribute] = node.attrib[attribute]; - } - }); - - return true; - }, - - // removes node from doc at selector - pruneXML: function (doc, nodes, selector) { - var parent = module.exports.resolveParent(doc, selector); - if (!parent) return false; - - nodes.forEach(function (node) { - var matchingKid = findChild(node, parent); - if (matchingKid !== undefined) { - // stupid elementtree takes an index argument it doesn't use - // and does not conform to the python lib - parent.remove(matchingKid); - } - }); - - return true; - }, - - // restores attributes from doc at selector - pruneXMLRestore: function (doc, selector, xml) { - var target = module.exports.resolveParent(doc, selector); - if (!target) return false; - - if (xml.oldAttrib) { - target.attrib = _.extend({}, xml.oldAttrib); - } - - return true; - }, - - pruneXMLRemove: function (doc, selector, nodes) { - var target = module.exports.resolveParent(doc, selector); - if (!target) return false; - - nodes.forEach(function (node) { - var attributes = node.attrib; - for (var attribute in attributes) { - if (target.attrib[attribute]) { - delete target.attrib[attribute]; - } - } - }); - - return true; - }, - - parseElementtreeSync: function (filename) { - var contents = stripBom(fs.readFileSync(filename, 'utf-8')); - return new et.ElementTree(et.XML(contents)); - }, - - resolveParent: function (doc, selector) { - var parent, tagName, subSelector; - - // handle absolute selector (which elementtree doesn't like) - if (ROOT.test(selector)) { - tagName = selector.match(ROOT)[1]; - // test for wildcard "any-tag" root selector - if (tagName === '*' || tagName === doc._root.tag) { - parent = doc._root; - - // could be an absolute path, but not selecting the root - if (ABSOLUTE.test(selector)) { - subSelector = selector.match(ABSOLUTE)[2]; - parent = parent.find(subSelector); - } - } else { - return false; - } - } else { - parent = doc.find(selector); - } - return parent; - } -}; - -function findChild (node, parent) { - const matches = parent.findall(node.tag); - return matches.find(m => module.exports.equalNodes(node, m)); -} - -function uniqueChild (node, parent) { - return !findChild(node, parent); -} - -// Find the index at which to insert an entry. After is a ;-separated priority list -// of tags after which the insertion should be made. E.g. If we need to -// insert an element C, and the rule is that the order of children has to be -// As, Bs, Cs. After will be equal to "C;B;A". -function findInsertIdx (children, after) { - var childrenTags = children.map(function (child) { return child.tag; }); - var afters = after.split(';'); - var afterIndexes = afters.map(function (current) { return childrenTags.lastIndexOf(current); }); - var foundIndex = _.find(afterIndexes, function (index) { return index !== -1; }); - - // add to the beginning if no matching nodes are found - return typeof foundIndex === 'undefined' ? 0 : foundIndex + 1; -} - -var BLACKLIST = ['platform', 'feature', 'plugin', 'engine']; -var SINGLETONS = ['content', 'author', 'name']; -function mergeXml (src, dest, platform, clobber) { - // Do nothing for blacklisted tags. - if (BLACKLIST.includes(src.tag)) return; - - // Handle attributes - Object.getOwnPropertyNames(src.attrib).forEach(function (attribute) { - if (clobber || !dest.attrib[attribute]) { - dest.attrib[attribute] = src.attrib[attribute]; - } - }); - // Handle text - if (src.text && (clobber || !dest.text)) { - dest.text = src.text; - } - // Handle children - src.getchildren().forEach(mergeChild); - - // Handle platform - if (platform) { - src.findall('platform[@name="' + platform + '"]').forEach(function (platformElement) { - platformElement.getchildren().forEach(mergeChild); - }); - } - - // Handle duplicate preference tags (by name attribute) - removeDuplicatePreferences(dest); - - function mergeChild (srcChild) { - var srcTag = srcChild.tag; - var destChild = new et.Element(srcTag); - var foundChild; - var query = srcTag + ''; - var shouldMerge = true; - - if (BLACKLIST.includes(srcTag)) return; - - if (SINGLETONS.includes(srcTag)) { - foundChild = dest.find(query); - if (foundChild) { - destChild = foundChild; - dest.remove(destChild); - } - } else { - // Check for an exact match and if you find one don't add - var mergeCandidates = dest.findall(query) - .filter(function (foundChild) { - return foundChild && textMatch(srcChild, foundChild) && attribMatch(srcChild, foundChild); - }); - - if (mergeCandidates.length > 0) { - destChild = mergeCandidates[0]; - dest.remove(destChild); - shouldMerge = false; - } - } - - mergeXml(srcChild, destChild, platform, clobber && shouldMerge); - dest.append(destChild); - } - - function removeDuplicatePreferences (xml) { - // reduce preference tags to a hashtable to remove dupes - var prefHash = xml.findall('preference[@name][@value]').reduce(function (previousValue, currentValue) { - previousValue[currentValue.attrib.name] = currentValue.attrib.value; - return previousValue; - }, {}); - - // remove all preferences - xml.findall('preference[@name][@value]').forEach(function (pref) { - xml.remove(pref); - }); - - // write new preferences - Object.keys(prefHash).forEach(function (key) { - var element = et.SubElement(xml, 'preference'); - element.set('name', key); - element.set('value', this[key]); - }, prefHash); - } -} - -// Expose for testing. -module.exports.mergeXml = mergeXml; - -function textMatch (elm1, elm2) { - var text1 = elm1.text ? elm1.text.replace(/\s+/, '') : ''; - var text2 = elm2.text ? elm2.text.replace(/\s+/, '') : ''; - return (text1 === '' || text1 === text2); -} - -function attribMatch (one, two) { - var oneAttribKeys = Object.keys(one.attrib); - var twoAttribKeys = Object.keys(two.attrib); - - if (oneAttribKeys.length !== twoAttribKeys.length) { - return false; - } - - for (var i = 0; i < oneAttribKeys.length; i++) { - var attribName = oneAttribKeys[i]; - - if (one.attrib[attribName] !== two.attrib[attribName]) { - return false; - } - } - - return true; -} diff --git a/chabok-starter-cordova/node_modules/cordova-ios/.eslintignore b/chabok-starter-cordova/node_modules/cordova-ios/.eslintignore deleted file mode 100644 index b84d7a8..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/.eslintignore +++ /dev/null @@ -1,10 +0,0 @@ -bin/node_modules/* -bin/templates/project/* -tests/spec/unit/fixtures/* -CordovaLib/cordova.js - -# Non-JS binaries -bin/test -bin/cordova_plist_to_config_xml -bin/templates/scripts/cordova/log -bin/templates/scripts/cordova/lib/start-emulator diff --git a/chabok-starter-cordova/node_modules/cordova-ios/.eslintrc.yml b/chabok-starter-cordova/node_modules/cordova-ios/.eslintrc.yml deleted file mode 100644 index f6aae32..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/.eslintrc.yml +++ /dev/null @@ -1,10 +0,0 @@ -root: true -extends: semistandard -rules: - indent: - - error - - 4 - camelcase: off - padded-blocks: off - operator-linebreak: off - no-throw-literal: off diff --git a/chabok-starter-cordova/node_modules/cordova-ios/.gitattributes b/chabok-starter-cordova/node_modules/cordova-ios/.gitattributes deleted file mode 100644 index f63e59a..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/.gitattributes +++ /dev/null @@ -1,94 +0,0 @@ -* text eol=lf - -# source code -*.php text -*.css text -*.sass text -*.scss text -*.less text -*.styl text -*.js text -*.coffee text -*.json text -*.htm text -*.html text -*.xml text -*.svg text -*.txt text -*.ini text -*.inc text -*.pl text -*.rb text -*.py text -*.scm text -*.sql text -*.sh text -*.bat text - -# templates -*.ejs text -*.hbt text -*.jade text -*.haml text -*.hbs text -*.dot text -*.tmpl text -*.phtml text - -# server config -.htaccess text - -# git config -.gitattributes text -.gitignore text -.gitconfig text - -# code analysis config -.jshintrc text -.jscsrc text -.jshintignore text -.csslintrc text - -# misc config -*.yaml text -*.yml text -.editorconfig text - -# build config -*.npmignore text -*.bowerrc text - -# Heroku -Procfile text -.slugignore text - -# Documentation -*.md text -LICENSE text -AUTHORS text - - -# -## These files are binary and should be left untouched -# - -# (binary is a macro for -text -diff) -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.mov binary -*.mp4 binary -*.mp3 binary -*.flv binary -*.fla binary -*.swf binary -*.gz binary -*.zip binary -*.7z binary -*.ttf binary -*.eot binary -*.woff binary -*.pyc binary -*.pdf binary diff --git a/chabok-starter-cordova/node_modules/cordova-ios/.github/ISSUE_TEMPLATE.md b/chabok-starter-cordova/node_modules/cordova-ios/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 3220c25..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,42 +0,0 @@ - - -### Issue Type - - -- [ ] Bug Report -- [ ] Feature Request -- [ ] Support Question - -## Description - -## Information - - -### Command or Code - - -### Environment, Platform, Device - - - - -### Version information - - - - -## Checklist - - -- [ ] I searched for already existing GitHub issues about this -- [ ] I updated all Cordova tooling to their most recent version -- [ ] I included all the necessary information above diff --git a/chabok-starter-cordova/node_modules/cordova-ios/.github/ISSUE_TEMPLATE/BUG_REPORT.md b/chabok-starter-cordova/node_modules/cordova-ios/.github/ISSUE_TEMPLATE/BUG_REPORT.md deleted file mode 100644 index bd8a3ac..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/.github/ISSUE_TEMPLATE/BUG_REPORT.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -name: 🐛 Bug Report -about: If something isn't working as expected. - ---- - -# Bug Report - -## Problem - -### What is expected to happen? - - - -### What does actually happen? - - - -## Information - - - - -### Command or Code - - - - -### Environment, Platform, Device - - - - -### Version information - - - - -## Checklist - - -- [ ] I searched for existing GitHub issues -- [ ] I updated all Cordova tooling to most recent version -- [ ] I included all the necessary information above diff --git a/chabok-starter-cordova/node_modules/cordova-ios/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md b/chabok-starter-cordova/node_modules/cordova-ios/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md deleted file mode 100644 index 381fc8a..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -name: 🚀 Feature Request -about: A suggestion for a new functionality - ---- - -# Feature Request - -## Motivation Behind Feature - - - - -## Feature Description - - - - -## Alternatives or Workarounds - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/.github/ISSUE_TEMPLATE/SUPPORT_QUESTION.md b/chabok-starter-cordova/node_modules/cordova-ios/.github/ISSUE_TEMPLATE/SUPPORT_QUESTION.md deleted file mode 100644 index 516c6e6..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/.github/ISSUE_TEMPLATE/SUPPORT_QUESTION.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -name: 💬 Support Question -about: If you have a question, please check out our Slack or StackOverflow! - ---- - - - -Apache Cordova uses GitHub Issues as a feature request and bug tracker _only_. -For usage and support questions, please check out the resources below. Thanks! - ---- - -You can get answers to your usage and support questions about **Apache Cordova** on: - -* Slack Community Chat: https://cordova.slack.com (you can sign-up at http://slack.cordova.io/) -* StackOverflow: https://stackoverflow.com/questions/tagged/cordova using the tag `cordova` - ---- - -If you are using a tool that uses Cordova internally, like e.g. Ionic, check their support channels: - -* **Ionic Framework** - * [Ionic Community Forum](https://forum.ionicframework.com/) - * [Ionic Worldwide Slack](https://ionicworldwide.herokuapp.com/) -* **PhoneGap** - * [PhoneGap Developer Community](https://forums.adobe.com/community/phonegap) diff --git a/chabok-starter-cordova/node_modules/cordova-ios/.github/PULL_REQUEST_TEMPLATE.md b/chabok-starter-cordova/node_modules/cordova-ios/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 712b2ff..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,35 +0,0 @@ - - -### Platforms affected - - - -### Motivation and Context - - - - - -### Description - - - - -### Testing - - - - -### Checklist - -- [ ] I've run the tests to see all new and existing tests pass -- [ ] I added automated test coverage as appropriate for this change -- [ ] Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`) -- [ ] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/)) -- [ ] I've updated the documentation if necessary diff --git a/chabok-starter-cordova/node_modules/cordova-ios/.ratignore b/chabok-starter-cordova/node_modules/cordova-ios/.ratignore deleted file mode 100644 index e65b4c0..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/.ratignore +++ /dev/null @@ -1,12 +0,0 @@ -# yes, not .gitignore -gitignore - -# licenses for both below are in the cordova-ios LICENSE file -NSData+Base64.h -NSData+Base64.m - -Contents.json -jasmine.json -fixtures -appveyor.yml -i386 diff --git a/chabok-starter-cordova/node_modules/cordova-ios/.travis.yml b/chabok-starter-cordova/node_modules/cordova-ios/.travis.yml deleted file mode 100644 index 17280f5..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -language: objective-c -sudo: false - -matrix: - include: - # Run one test with Xcode 9.x, the rest with 10.x - - osx_image: xcode9.4 - env: TRAVIS_NODE_VERSION=10 - - osx_image: xcode10.3 - env: TRAVIS_NODE_VERSION=6 - - osx_image: xcode10.3 - env: TRAVIS_NODE_VERSION=8 - - osx_image: xcode10.3 - env: TRAVIS_NODE_VERSION=10 - - osx_image: xcode10.3 - env: TRAVIS_NODE_VERSION=12 - -before_install: - - nvm install $TRAVIS_NODE_VERSION - -install: - - npm install - - npm install ios-deploy - - npm install -g codecov - -script: - - node --version - - npm --version - - npm run eslint - - npm run unit-tests - - npm run test:component - - npm run e2e-tests - - npm run objc-tests - - npm run cover - -after_script: - - codecov diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CONTRIBUTING.md b/chabok-starter-cordova/node_modules/cordova-ios/CONTRIBUTING.md deleted file mode 100644 index 4c8e6a5..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CONTRIBUTING.md +++ /dev/null @@ -1,37 +0,0 @@ - - -# Contributing to Apache Cordova - -Anyone can contribute to Cordova. And we need your contributions. - -There are multiple ways to contribute: report bugs, improve the docs, and -contribute code. - -For instructions on this, start with the -[contribution overview](http://cordova.apache.org/contribute/). - -The details are explained there, but the important items are: - - Sign and submit an Apache ICLA (Contributor License Agreement). - - Have a Jira issue open that corresponds to your contribution. - - Run the tests so your patch doesn't break existing functionality. - -We look forward to your contributions! diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/CDVDebug.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/CDVDebug.h deleted file mode 100644 index 4a0d9f9..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/CDVDebug.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#ifdef DEBUG - #define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) -#else - #define DLog(...) -#endif -#define ALog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/CDVJSON_private.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/CDVJSON_private.h deleted file mode 100644 index afb5cc6..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/CDVJSON_private.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -@interface NSArray (CDVJSONSerializingPrivate) -- (NSString*)cdv_JSONString; -@end - -@interface NSDictionary (CDVJSONSerializingPrivate) -- (NSString*)cdv_JSONString; -@end - -@interface NSString (CDVJSONSerializingPrivate) -- (id)cdv_JSONObject; -- (id)cdv_JSONFragment; -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/CDVJSON_private.m b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/CDVJSON_private.m deleted file mode 100644 index 175ed39..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/CDVJSON_private.m +++ /dev/null @@ -1,99 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "CDVJSON_private.h" -#import - -@implementation NSArray (CDVJSONSerializingPrivate) - -- (NSString*)cdv_JSONString -{ - @autoreleasepool { - NSError* error = nil; - NSData* jsonData = [NSJSONSerialization dataWithJSONObject:self - options:0 - error:&error]; - - if (error != nil) { - NSLog(@"NSArray JSONString error: %@", [error localizedDescription]); - return nil; - } else { - return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; - } - } -} - -@end - -@implementation NSDictionary (CDVJSONSerializingPrivate) - -- (NSString*)cdv_JSONString -{ - @autoreleasepool { - NSError* error = nil; - NSData* jsonData = [NSJSONSerialization dataWithJSONObject:self - options:NSJSONWritingPrettyPrinted - error:&error]; - - if (error != nil) { - NSLog(@"NSDictionary JSONString error: %@", [error localizedDescription]); - return nil; - } else { - return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; - } - } -} - -@end - -@implementation NSString (CDVJSONSerializingPrivate) - -- (id)cdv_JSONObject -{ - @autoreleasepool { - NSError* error = nil; - id object = [NSJSONSerialization JSONObjectWithData:[self dataUsingEncoding:NSUTF8StringEncoding] - options:NSJSONReadingMutableContainers - error:&error]; - - if (error != nil) { - NSLog(@"NSString JSONObject error: %@, Malformed Data: %@", [error localizedDescription], self); - } - - return object; - } -} - -- (id)cdv_JSONFragment -{ - @autoreleasepool { - NSError* error = nil; - id object = [NSJSONSerialization JSONObjectWithData:[self dataUsingEncoding:NSUTF8StringEncoding] - options:NSJSONReadingAllowFragments - error:&error]; - - if (error != nil) { - NSLog(@"NSString JSONObject error: %@", [error localizedDescription]); - } - - return object; - } -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/CDVPlugin+Private.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/CDVPlugin+Private.h deleted file mode 100644 index f88638c..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/CDVPlugin+Private.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -@interface CDVPlugin (Private) - -- (instancetype)initWithWebViewEngine:(id )theWebViewEngine; - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.h deleted file mode 100644 index f39e066..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import - -@interface CDVGestureHandler : CDVPlugin - -@property (nonatomic, strong) UILongPressGestureRecognizer* lpgr; - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.m b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.m deleted file mode 100644 index 34ed463..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.m +++ /dev/null @@ -1,70 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "CDVGestureHandler.h" - -@implementation CDVGestureHandler - -- (void)pluginInitialize -{ - [self applyLongPressFix]; -} - -- (void)applyLongPressFix -{ - // You can't suppress 3D Touch and still have regular longpress, - // so if this is false, let's not consider the 3D Touch setting at all. - if (![self.commandDelegate.settings objectForKey:@"suppresseslongpressgesture"] || - ![[self.commandDelegate.settings objectForKey:@"suppresseslongpressgesture"] boolValue]) { - return; - } - - self.lpgr = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPressGestures:)]; - self.lpgr.minimumPressDuration = 0.45f; - self.lpgr.allowableMovement = 200.0f; - - // 0.45 is ok for 'regular longpress', 0.05-0.08 is required for '3D Touch longpress', - // but since this will also kill onclick handlers (not ontouchend) it's optional. - if ([self.commandDelegate.settings objectForKey:@"suppresses3dtouchgesture"] && - [[self.commandDelegate.settings objectForKey:@"suppresses3dtouchgesture"] boolValue]) { - self.lpgr.minimumPressDuration = 0.15f; - } - - NSArray *views = self.webView.subviews; - if (views.count == 0) { - NSLog(@"No webview subviews found, not applying the longpress fix."); - return; - } - for (int i=0; i - -@interface CDVHandleOpenURL : CDVPlugin - -@property (nonatomic, strong) NSURL* url; -@property (nonatomic, assign) BOOL pageLoaded; - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVHandleOpenURL/CDVHandleOpenURL.m b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVHandleOpenURL/CDVHandleOpenURL.m deleted file mode 100644 index 400cb9d..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVHandleOpenURL/CDVHandleOpenURL.m +++ /dev/null @@ -1,86 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "CDVHandleOpenURL.h" -#import - -@implementation CDVHandleOpenURL - -- (void)pluginInitialize -{ - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationLaunchedWithUrl:) name:CDVPluginHandleOpenURLNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationPageDidLoad:) name:CDVPageDidLoadNotification object:nil]; -} - -- (void)applicationLaunchedWithUrl:(NSNotification*)notification -{ - NSURL* url = [notification object]; - - self.url = url; - - // warm-start handler - if (self.pageLoaded) { - [self processOpenUrl:self.url pageLoaded:YES]; - self.url = nil; - } -} - -- (void)applicationPageDidLoad:(NSNotification*)notification -{ - // cold-start handler - - self.pageLoaded = YES; - - if (self.url) { - [self processOpenUrl:self.url pageLoaded:YES]; - self.url = nil; - } -} - -- (void)processOpenUrl:(NSURL*)url pageLoaded:(BOOL)pageLoaded -{ - __weak __typeof(self) weakSelf = self; - - dispatch_block_t handleOpenUrl = ^(void) { - // calls into javascript global function 'handleOpenURL' - NSString* jsString = [NSString stringWithFormat:@"document.addEventListener('deviceready',function(){if (typeof handleOpenURL === 'function') { handleOpenURL(\"%@\");}});", url.absoluteString]; - - [weakSelf.webViewEngine evaluateJavaScript:jsString completionHandler:nil]; - }; - - if (!pageLoaded) { - NSString* jsString = @"document.readystate"; - [self.webViewEngine evaluateJavaScript:jsString - completionHandler:^(id object, NSError* error) { - if ((error == nil) && [object isKindOfClass:[NSString class]]) { - NSString* readyState = (NSString*)object; - BOOL ready = [readyState isEqualToString:@"loaded"] || [readyState isEqualToString:@"complete"]; - if (ready) { - handleOpenUrl(); - } else { - self.url = url; - } - } - }]; - } else { - handleOpenUrl(); - } -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.h deleted file mode 100644 index a038dbd..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import -#import - -#if WK_WEB_VIEW_ONLY -#define CDVWebViewNavigationType int -#else -#define CDVWebViewNavigationType UIWebViewNavigationType -#endif - -typedef NS_ENUM(NSInteger, CDVIntentAndNavigationFilterValue) { - CDVIntentAndNavigationFilterValueIntentAllowed, - CDVIntentAndNavigationFilterValueNavigationAllowed, - CDVIntentAndNavigationFilterValueNoneAllowed -}; - -@interface CDVIntentAndNavigationFilter : CDVPlugin - -+ (CDVIntentAndNavigationFilterValue) filterUrl:(NSURL*)url intentsWhitelist:(CDVWhitelist*)intentsWhitelist navigationsWhitelist:(CDVWhitelist*)navigationsWhitelist; -+ (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(CDVWebViewNavigationType)navigationType filterValue:(CDVIntentAndNavigationFilterValue)filterValue; -+ (BOOL)shouldOpenURLRequest:(NSURLRequest*)request navigationType:(CDVWebViewNavigationType)navigationType; -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m deleted file mode 100644 index b656cd9..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m +++ /dev/null @@ -1,150 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "CDVIntentAndNavigationFilter.h" -#import - -@interface CDVIntentAndNavigationFilter () - -@property (nonatomic, readwrite) NSMutableArray* allowIntents; -@property (nonatomic, readwrite) NSMutableArray* allowNavigations; -@property (nonatomic, readwrite) CDVWhitelist* allowIntentsWhitelist; -@property (nonatomic, readwrite) CDVWhitelist* allowNavigationsWhitelist; - -@end - -@implementation CDVIntentAndNavigationFilter - -#pragma mark NSXMLParserDelegate - -- (void)parser:(NSXMLParser*)parser didStartElement:(NSString*)elementName namespaceURI:(NSString*)namespaceURI qualifiedName:(NSString*)qualifiedName attributes:(NSDictionary*)attributeDict -{ - if ([elementName isEqualToString:@"allow-navigation"]) { - [self.allowNavigations addObject:attributeDict[@"href"]]; - } - if ([elementName isEqualToString:@"allow-intent"]) { - [self.allowIntents addObject:attributeDict[@"href"]]; - } -} - -- (void)parserDidStartDocument:(NSXMLParser*)parser -{ - // file: url are added by default - self.allowNavigations = [[NSMutableArray alloc] initWithArray:@[ @"file://" ]]; - // no intents are added by default - self.allowIntents = [[NSMutableArray alloc] init]; -} - -- (void)parserDidEndDocument:(NSXMLParser*)parser -{ - self.allowIntentsWhitelist = [[CDVWhitelist alloc] initWithArray:self.allowIntents]; - self.allowNavigationsWhitelist = [[CDVWhitelist alloc] initWithArray:self.allowNavigations]; -} - -- (void)parser:(NSXMLParser*)parser parseErrorOccurred:(NSError*)parseError -{ - NSAssert(NO, @"config.xml parse error line %ld col %ld", (long)[parser lineNumber], (long)[parser columnNumber]); -} - -#pragma mark CDVPlugin - -- (void)pluginInitialize -{ - if ([self.viewController isKindOfClass:[CDVViewController class]]) { - [(CDVViewController*)self.viewController parseSettingsWithParser:self]; - } -} - -+ (CDVIntentAndNavigationFilterValue) filterUrl:(NSURL*)url intentsWhitelist:(CDVWhitelist*)intentsWhitelist navigationsWhitelist:(CDVWhitelist*)navigationsWhitelist -{ - // a URL can only allow-intent OR allow-navigation, if both are specified, - // only allow-navigation is allowed - - BOOL allowNavigationsPass = [navigationsWhitelist URLIsAllowed:url logFailure:NO]; - BOOL allowIntentPass = [intentsWhitelist URLIsAllowed:url logFailure:NO]; - - if (allowNavigationsPass && allowIntentPass) { - return CDVIntentAndNavigationFilterValueNavigationAllowed; - } else if (allowNavigationsPass) { - return CDVIntentAndNavigationFilterValueNavigationAllowed; - } else if (allowIntentPass) { - return CDVIntentAndNavigationFilterValueIntentAllowed; - } - - return CDVIntentAndNavigationFilterValueNoneAllowed; -} - -- (CDVIntentAndNavigationFilterValue) filterUrl:(NSURL*)url -{ - return [[self class] filterUrl:url intentsWhitelist:self.allowIntentsWhitelist navigationsWhitelist:self.allowNavigationsWhitelist]; -} - -#if WK_WEB_VIEW_ONLY -#define CDVWebViewNavigationTypeLinkClicked 0 -#define CDVWebViewNavigationTypeOther 5 -#else -#define CDVWebViewNavigationTypeLinkClicked UIWebViewNavigationTypeLinkClicked -#define CDVWebViewNavigationTypeOther UIWebViewNavigationTypeOther -#endif - -+ (BOOL)shouldOpenURLRequest:(NSURLRequest*)request navigationType:(CDVWebViewNavigationType)navigationType -{ - return (CDVWebViewNavigationTypeLinkClicked == navigationType || - (CDVWebViewNavigationTypeOther == navigationType && - [[request.mainDocumentURL absoluteString] isEqualToString:[request.URL absoluteString]] - ) - ); -} - -+ (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(CDVWebViewNavigationType)navigationType filterValue:(CDVIntentAndNavigationFilterValue)filterValue -{ - NSString* allowIntents_whitelistRejectionFormatString = @"ERROR External navigation rejected - not set for url='%@'"; - NSString* allowNavigations_whitelistRejectionFormatString = @"ERROR Internal navigation rejected - not set for url='%@'"; - - NSURL* url = [request URL]; - - switch (filterValue) { - case CDVIntentAndNavigationFilterValueNavigationAllowed: - return YES; - case CDVIntentAndNavigationFilterValueIntentAllowed: - // only allow-intent if it's a UIWebViewNavigationTypeLinkClicked (anchor tag) OR - // it's a UIWebViewNavigationTypeOther, and it's an internal link - if ([[self class] shouldOpenURLRequest:request navigationType:navigationType]){ - [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil]; - } - - // consume the request (i.e. no error) if it wasn't handled above - return NO; - case CDVIntentAndNavigationFilterValueNoneAllowed: - // allow-navigation attempt failed for sure - NSLog(@"%@", [NSString stringWithFormat:allowNavigations_whitelistRejectionFormatString, [url absoluteString]]); - // anchor tag link means it was an allow-intent attempt that failed as well - if (CDVWebViewNavigationTypeLinkClicked == navigationType) { - NSLog(@"%@", [NSString stringWithFormat:allowIntents_whitelistRejectionFormatString, [url absoluteString]]); - } - return NO; - } -} - -- (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(CDVWebViewNavigationType)navigationType -{ - return [[self class] shouldOverrideLoadWithRequest:request navigationType:navigationType filterValue:[self filterUrl:request.URL]]; -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLocalStorage/CDVLocalStorage.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLocalStorage/CDVLocalStorage.h deleted file mode 100644 index e93675e..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLocalStorage/CDVLocalStorage.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import - -#define kCDVLocalStorageErrorDomain @"kCDVLocalStorageErrorDomain" -#define kCDVLocalStorageFileOperationError 1 - -@interface CDVLocalStorage : CDVPlugin - -@property (nonatomic, readonly, strong) NSMutableArray* backupInfo; - -- (BOOL)shouldBackup; -- (BOOL)shouldRestore; -- (void)backup:(CDVInvokedUrlCommand*)command; -- (void)restore:(CDVInvokedUrlCommand*)command; - -+ (void)__fixupDatabaseLocationsWithBackupType:(NSString*)backupType; -// Visible for testing. -+ (BOOL)__verifyAndFixDatabaseLocationsWithAppPlistDict:(NSMutableDictionary*)appPlistDict - bundlePath:(NSString*)bundlePath - fileManager:(NSFileManager*)fileManager; -@end - -@interface CDVBackupInfo : NSObject - -@property (nonatomic, copy) NSString* original; -@property (nonatomic, copy) NSString* backup; -@property (nonatomic, copy) NSString* label; - -- (BOOL)shouldBackup; -- (BOOL)shouldRestore; - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLocalStorage/CDVLocalStorage.m b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLocalStorage/CDVLocalStorage.m deleted file mode 100644 index 25c4853..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLocalStorage/CDVLocalStorage.m +++ /dev/null @@ -1,493 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "CDVLocalStorage.h" -#import - -@interface CDVLocalStorage () - -@property (nonatomic, readwrite, strong) NSMutableArray* backupInfo; // array of CDVBackupInfo objects -#if !WK_WEB_VIEW_ONLY -@property (nonatomic, readwrite, weak) id webviewDelegate; -#endif - -@end - -@implementation CDVLocalStorage - -#if WK_WEB_VIEW_ONLY -@synthesize backupInfo; -#else -@synthesize backupInfo, webviewDelegate; -#endif - -- (void)pluginInitialize -{ - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onResignActive) - name:UIApplicationWillResignActiveNotification object:nil]; - BOOL cloudBackup = [@"cloud" isEqualToString : self.commandDelegate.settings[[@"BackupWebStorage" lowercaseString]]]; - - self.backupInfo = [[self class] createBackupInfoWithCloudBackup:cloudBackup]; -} - -#pragma mark - -#pragma mark Plugin interface methods - -+ (NSMutableArray*)createBackupInfoWithTargetDir:(NSString*)targetDir backupDir:(NSString*)backupDir targetDirNests:(BOOL)targetDirNests backupDirNests:(BOOL)backupDirNests rename:(BOOL)rename -{ - /* - This "helper" does so much work and has so many options it would probably be clearer to refactor the whole thing. - Basically, there are three database locations: - - 1. "Normal" dir -- LIB// - 2. "Caches" dir -- LIB/Caches/ - 3. "Backup" dir -- DOC/Backups/ - - And between these three, there are various migration paths, most of which only consider 2 of the 3, which is why this helper is based on 2 locations and has a notion of "direction". - */ - NSMutableArray* backupInfo = [NSMutableArray arrayWithCapacity:3]; - - NSString* original; - NSString* backup; - CDVBackupInfo* backupItem; - - // ////////// LOCALSTORAGE - - original = [targetDir stringByAppendingPathComponent:targetDirNests ? @"WebKit/LocalStorage/file__0.localstorage":@"file__0.localstorage"]; - backup = [backupDir stringByAppendingPathComponent:(backupDirNests ? @"WebKit/LocalStorage" : @"")]; - backup = [backup stringByAppendingPathComponent:(rename ? @"localstorage.appdata.db" : @"file__0.localstorage")]; - - backupItem = [[CDVBackupInfo alloc] init]; - backupItem.backup = backup; - backupItem.original = original; - backupItem.label = @"localStorage database"; - - [backupInfo addObject:backupItem]; - - // ////////// WEBSQL MAIN DB - - original = [targetDir stringByAppendingPathComponent:targetDirNests ? @"WebKit/LocalStorage/Databases.db":@"Databases.db"]; - backup = [backupDir stringByAppendingPathComponent:(backupDirNests ? @"WebKit/LocalStorage" : @"")]; - backup = [backup stringByAppendingPathComponent:(rename ? @"websqlmain.appdata.db" : @"Databases.db")]; - - backupItem = [[CDVBackupInfo alloc] init]; - backupItem.backup = backup; - backupItem.original = original; - backupItem.label = @"websql main database"; - - [backupInfo addObject:backupItem]; - - // ////////// WEBSQL DATABASES - - original = [targetDir stringByAppendingPathComponent:targetDirNests ? @"WebKit/LocalStorage/file__0":@"file__0"]; - backup = [backupDir stringByAppendingPathComponent:(backupDirNests ? @"WebKit/LocalStorage" : @"")]; - backup = [backup stringByAppendingPathComponent:(rename ? @"websqldbs.appdata.db" : @"file__0")]; - - backupItem = [[CDVBackupInfo alloc] init]; - backupItem.backup = backup; - backupItem.original = original; - backupItem.label = @"websql databases"; - - [backupInfo addObject:backupItem]; - - return backupInfo; -} - -+ (NSMutableArray*)createBackupInfoWithCloudBackup:(BOOL)cloudBackup -{ - // create backup info from backup folder to caches folder - NSString* appLibraryFolder = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) objectAtIndex:0]; - NSString* appDocumentsFolder = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; - NSString* cacheFolder = [appLibraryFolder stringByAppendingPathComponent:@"Caches"]; - NSString* backupsFolder = [appDocumentsFolder stringByAppendingPathComponent:@"Backups"]; - - // create the backups folder, if needed - [[NSFileManager defaultManager] createDirectoryAtPath:backupsFolder withIntermediateDirectories:YES attributes:nil error:nil]; - - [self addSkipBackupAttributeToItemAtURL:[NSURL fileURLWithPath:backupsFolder] skip:!cloudBackup]; - - return [self createBackupInfoWithTargetDir:cacheFolder backupDir:backupsFolder targetDirNests:NO backupDirNests:NO rename:YES]; -} - -+ (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL*)URL skip:(BOOL)skip -{ - NSError* error = nil; - BOOL success = [URL setResourceValue:[NSNumber numberWithBool:skip] forKey:NSURLIsExcludedFromBackupKey error:&error]; - - if (!success) { - NSLog(@"Error excluding %@ from backup %@", [URL lastPathComponent], error); - } - return success; -} - -+ (BOOL)copyFrom:(NSString*)src to:(NSString*)dest error:(NSError* __autoreleasing*)error -{ - NSFileManager* fileManager = [NSFileManager defaultManager]; - - if (![fileManager fileExistsAtPath:src]) { - NSString* errorString = [NSString stringWithFormat:@"%@ file does not exist.", src]; - if (error != NULL) { - (*error) = [NSError errorWithDomain:kCDVLocalStorageErrorDomain - code:kCDVLocalStorageFileOperationError - userInfo:[NSDictionary dictionaryWithObject:errorString - forKey:NSLocalizedDescriptionKey]]; - } - return NO; - } - - // generate unique filepath in temp directory - CFUUIDRef uuidRef = CFUUIDCreate(kCFAllocatorDefault); - CFStringRef uuidString = CFUUIDCreateString(kCFAllocatorDefault, uuidRef); - NSString* tempBackup = [[NSTemporaryDirectory() stringByAppendingPathComponent:(__bridge NSString*)uuidString] stringByAppendingPathExtension:@"bak"]; - CFRelease(uuidString); - CFRelease(uuidRef); - - BOOL destExists = [fileManager fileExistsAtPath:dest]; - - // backup the dest - if (destExists && ![fileManager copyItemAtPath:dest toPath:tempBackup error:error]) { - return NO; - } - - // remove the dest - if (destExists && ![fileManager removeItemAtPath:dest error:error]) { - return NO; - } - - // create path to dest - if (!destExists && ![fileManager createDirectoryAtPath:[dest stringByDeletingLastPathComponent] withIntermediateDirectories:YES attributes:nil error:error]) { - return NO; - } - - // copy src to dest - if ([fileManager copyItemAtPath:src toPath:dest error:error]) { - // success - cleanup - delete the backup to the dest - if ([fileManager fileExistsAtPath:tempBackup]) { - [fileManager removeItemAtPath:tempBackup error:error]; - } - return YES; - } else { - // failure - we restore the temp backup file to dest - [fileManager copyItemAtPath:tempBackup toPath:dest error:error]; - // cleanup - delete the backup to the dest - if ([fileManager fileExistsAtPath:tempBackup]) { - [fileManager removeItemAtPath:tempBackup error:error]; - } - return NO; - } -} - -- (BOOL)shouldBackup -{ - for (CDVBackupInfo* info in self.backupInfo) { - if ([info shouldBackup]) { - return YES; - } - } - - return NO; -} - -- (BOOL)shouldRestore -{ - for (CDVBackupInfo* info in self.backupInfo) { - if ([info shouldRestore]) { - return YES; - } - } - - return NO; -} - -/* copy from webkitDbLocation to persistentDbLocation */ -- (void)backup:(CDVInvokedUrlCommand*)command -{ - NSString* callbackId = command.callbackId; - - NSError* __autoreleasing error = nil; - CDVPluginResult* result = nil; - NSString* message = nil; - - for (CDVBackupInfo* info in self.backupInfo) { - if ([info shouldBackup]) { - [[self class] copyFrom:info.original to:info.backup error:&error]; - - if (callbackId) { - if (error == nil) { - message = [NSString stringWithFormat:@"Backed up: %@", info.label]; - NSLog(@"%@", message); - - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:message]; - [self.commandDelegate sendPluginResult:result callbackId:callbackId]; - } else { - message = [NSString stringWithFormat:@"Error in CDVLocalStorage (%@) backup: %@", info.label, [error localizedDescription]]; - NSLog(@"%@", message); - - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:message]; - [self.commandDelegate sendPluginResult:result callbackId:callbackId]; - } - } - } - } -} - -/* copy from persistentDbLocation to webkitDbLocation */ -- (void)restore:(CDVInvokedUrlCommand*)command -{ - NSError* __autoreleasing error = nil; - CDVPluginResult* result = nil; - NSString* message = nil; - - for (CDVBackupInfo* info in self.backupInfo) { - if ([info shouldRestore]) { - [[self class] copyFrom:info.backup to:info.original error:&error]; - - if (error == nil) { - message = [NSString stringWithFormat:@"Restored: %@", info.label]; - NSLog(@"%@", message); - - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:message]; - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - } else { - message = [NSString stringWithFormat:@"Error in CDVLocalStorage (%@) restore: %@", info.label, [error localizedDescription]]; - NSLog(@"%@", message); - - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:message]; - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; - } - } - } -} - -+ (void)__fixupDatabaseLocationsWithBackupType:(NSString*)backupType -{ - [self __verifyAndFixDatabaseLocations]; - [self __restoreLegacyDatabaseLocationsWithBackupType:backupType]; -} - -+ (void)__verifyAndFixDatabaseLocations -{ - NSBundle* mainBundle = [NSBundle mainBundle]; - NSString* bundlePath = [[mainBundle bundlePath] stringByDeletingLastPathComponent]; - NSString* bundleIdentifier = [[mainBundle infoDictionary] objectForKey:@"CFBundleIdentifier"]; - NSString* appPlistPath = [bundlePath stringByAppendingPathComponent:[NSString stringWithFormat:@"Library/Preferences/%@.plist", bundleIdentifier]]; - - NSMutableDictionary* appPlistDict = [NSMutableDictionary dictionaryWithContentsOfFile:appPlistPath]; - BOOL modified = [[self class] __verifyAndFixDatabaseLocationsWithAppPlistDict:appPlistDict - bundlePath:bundlePath - fileManager:[NSFileManager defaultManager]]; - - if (modified) { - BOOL ok = [appPlistDict writeToFile:appPlistPath atomically:YES]; - [[NSUserDefaults standardUserDefaults] synchronize]; - NSLog(@"Fix applied for database locations?: %@", ok ? @"YES" : @"NO"); - } -} - -+ (BOOL)__verifyAndFixDatabaseLocationsWithAppPlistDict:(NSMutableDictionary*)appPlistDict - bundlePath:(NSString*)bundlePath - fileManager:(NSFileManager*)fileManager -{ - NSString* libraryCaches = @"Library/Caches"; - NSString* libraryWebKit = @"Library/WebKit"; - - NSArray* keysToCheck = [NSArray arrayWithObjects: - @"WebKitLocalStorageDatabasePathPreferenceKey", - @"WebDatabaseDirectory", - nil]; - - BOOL dirty = NO; - - for (NSString* key in keysToCheck) { - NSString* value = [appPlistDict objectForKey:key]; - // verify key exists, and path is in app bundle, if not - fix - if ((value != nil) && ![value hasPrefix:bundlePath]) { - // the pathSuffix to use may be wrong - OTA upgrades from < 5.1 to 5.1 do keep the old path Library/WebKit, - // while Xcode synced ones do change the storage location to Library/Caches - NSString* newBundlePath = [bundlePath stringByAppendingPathComponent:libraryCaches]; - if (![fileManager fileExistsAtPath:newBundlePath]) { - newBundlePath = [bundlePath stringByAppendingPathComponent:libraryWebKit]; - } - [appPlistDict setValue:newBundlePath forKey:key]; - dirty = YES; - } - } - - return dirty; -} - -+ (void)__restoreLegacyDatabaseLocationsWithBackupType:(NSString*)backupType -{ - // on iOS 6, if you toggle between cloud/local backup, you must move database locations. Default upgrade from iOS5.1 to iOS6 is like a toggle from local to cloud. - NSString* appLibraryFolder = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) objectAtIndex:0]; - NSString* appDocumentsFolder = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; - - NSMutableArray* backupInfo = [NSMutableArray arrayWithCapacity:0]; - - if ([backupType isEqualToString:@"cloud"]) { -#ifdef DEBUG - NSLog(@"\n\nStarted backup to iCloud! Please be careful." - "\nYour application might be rejected by Apple if you store too much data." - "\nFor more information please read \"iOS Data Storage Guidelines\" at:" - "\nhttps://developer.apple.com/icloud/documentation/data-storage/" - "\nTo disable web storage backup to iCloud, set the BackupWebStorage preference to \"local\" in the Cordova config.xml file\n\n"); -#endif - // We would like to restore old backups/caches databases to the new destination (nested in lib folder) - [backupInfo addObjectsFromArray:[self createBackupInfoWithTargetDir:appLibraryFolder backupDir:[appDocumentsFolder stringByAppendingPathComponent:@"Backups"] targetDirNests:YES backupDirNests:NO rename:YES]]; - [backupInfo addObjectsFromArray:[self createBackupInfoWithTargetDir:appLibraryFolder backupDir:[appLibraryFolder stringByAppendingPathComponent:@"Caches"] targetDirNests:YES backupDirNests:NO rename:NO]]; - } else { - // For ios6 local backups we also want to restore from Backups dir -- but we don't need to do that here, since the plugin will do that itself. - [backupInfo addObjectsFromArray:[self createBackupInfoWithTargetDir:[appLibraryFolder stringByAppendingPathComponent:@"Caches"] backupDir:appLibraryFolder targetDirNests:NO backupDirNests:YES rename:NO]]; - } - - NSFileManager* manager = [NSFileManager defaultManager]; - - for (CDVBackupInfo* info in backupInfo) { - if ([manager fileExistsAtPath:info.backup]) { - if ([info shouldRestore]) { - NSLog(@"Restoring old webstorage backup. From: '%@' To: '%@'.", info.backup, info.original); - [self copyFrom:info.backup to:info.original error:nil]; - } - NSLog(@"Removing old webstorage backup: '%@'.", info.backup); - [manager removeItemAtPath:info.backup error:nil]; - } - } - - [[NSUserDefaults standardUserDefaults] setBool:[backupType isEqualToString:@"cloud"] forKey:@"WebKitStoreWebDataForBackup"]; -} - -#pragma mark - -#pragma mark Notification handlers - -- (void)onResignActive -{ - UIDevice* device = [UIDevice currentDevice]; - NSNumber* exitsOnSuspend = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UIApplicationExitsOnSuspend"]; - - BOOL isMultitaskingSupported = [device respondsToSelector:@selector(isMultitaskingSupported)] && [device isMultitaskingSupported]; - - if (exitsOnSuspend == nil) { // if it's missing, it should be NO (i.e. multi-tasking on by default) - exitsOnSuspend = [NSNumber numberWithBool:NO]; - } - - if (exitsOnSuspend) { - [self backup:nil]; - } else if (isMultitaskingSupported) { - __block UIBackgroundTaskIdentifier backgroundTaskID = UIBackgroundTaskInvalid; - - backgroundTaskID = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{ - [[UIApplication sharedApplication] endBackgroundTask:backgroundTaskID]; - backgroundTaskID = UIBackgroundTaskInvalid; - NSLog(@"Background task to backup WebSQL/LocalStorage expired."); - }]; - CDVLocalStorage __weak* weakSelf = self; - [self.commandDelegate runInBackground:^{ - [weakSelf backup:nil]; - - [[UIApplication sharedApplication] endBackgroundTask:backgroundTaskID]; - backgroundTaskID = UIBackgroundTaskInvalid; - }]; - } -} - -- (void)onAppTerminate -{ - [self onResignActive]; -} - -- (void)onReset -{ - [self restore:nil]; -} - -@end - -#pragma mark - -#pragma mark CDVBackupInfo implementation - -@implementation CDVBackupInfo - -@synthesize original, backup, label; - -- (BOOL)file:(NSString*)aPath isNewerThanFile:(NSString*)bPath -{ - NSFileManager* fileManager = [NSFileManager defaultManager]; - NSError* __autoreleasing error = nil; - - NSDictionary* aPathAttribs = [fileManager attributesOfItemAtPath:aPath error:&error]; - NSDictionary* bPathAttribs = [fileManager attributesOfItemAtPath:bPath error:&error]; - - NSDate* aPathModDate = [aPathAttribs objectForKey:NSFileModificationDate]; - NSDate* bPathModDate = [bPathAttribs objectForKey:NSFileModificationDate]; - - if ((nil == aPathModDate) && (nil == bPathModDate)) { - return NO; - } - - return [aPathModDate compare:bPathModDate] == NSOrderedDescending || bPathModDate == nil; -} - -- (BOOL)item:(NSString*)aPath isNewerThanItem:(NSString*)bPath -{ - NSFileManager* fileManager = [NSFileManager defaultManager]; - - BOOL aPathIsDir = NO, bPathIsDir = NO; - BOOL aPathExists = [fileManager fileExistsAtPath:aPath isDirectory:&aPathIsDir]; - - [fileManager fileExistsAtPath:bPath isDirectory:&bPathIsDir]; - - if (!aPathExists) { - return NO; - } - - if (!(aPathIsDir && bPathIsDir)) { // just a file - return [self file:aPath isNewerThanFile:bPath]; - } - - // essentially we want rsync here, but have to settle for our poor man's implementation - // we get the files in aPath, and see if it is newer than the file in bPath - // (it is newer if it doesn't exist in bPath) if we encounter the FIRST file that is newer, - // we return YES - NSDirectoryEnumerator* directoryEnumerator = [fileManager enumeratorAtPath:aPath]; - NSString* path; - - while ((path = [directoryEnumerator nextObject])) { - NSString* aPathFile = [aPath stringByAppendingPathComponent:path]; - NSString* bPathFile = [bPath stringByAppendingPathComponent:path]; - - BOOL isNewer = [self file:aPathFile isNewerThanFile:bPathFile]; - if (isNewer) { - return YES; - } - } - - return NO; -} - -- (BOOL)shouldBackup -{ - return [self item:self.original isNewerThanItem:self.backup]; -} - -- (BOOL)shouldRestore -{ - return [self item:self.backup isNewerThanItem:self.original]; -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLogger/CDVLogger.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLogger/CDVLogger.h deleted file mode 100644 index 7cfb306..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLogger/CDVLogger.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import - -@interface CDVLogger : CDVPlugin - -- (void)logLevel:(CDVInvokedUrlCommand*)command; - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLogger/CDVLogger.m b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLogger/CDVLogger.m deleted file mode 100644 index 810caa5..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLogger/CDVLogger.m +++ /dev/null @@ -1,37 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "CDVLogger.h" - -@implementation CDVLogger - -/* log a message */ -- (void)logLevel:(CDVInvokedUrlCommand*)command -{ - id level = [command argumentAtIndex:0]; - id message = [command argumentAtIndex:1]; - - if ([level isEqualToString:@"LOG"]) { - NSLog(@"%@", message); - } else { - NSLog(@"%@: %@", level, message); - } -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.h deleted file mode 100644 index 8118d5f..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#if !WK_WEB_VIEW_ONLY - -#import -#import - -/** - * Distinguishes top-level navigations from sub-frame navigations. - * shouldStartLoadWithRequest is called for every request, but didStartLoad - * and didFinishLoad is called only for top-level navigations. - * Relevant bug: CB-2389 - */ -@interface CDVUIWebViewDelegate : NSObject { - __weak NSObject * _delegate; - NSInteger _loadCount; - NSInteger _state; - NSInteger _curLoadToken; - NSInteger _loadStartPollCount; -} - -- (id)initWithDelegate:(NSObject *)delegate; - -- (BOOL)request:(NSURLRequest*)newRequest isEqualToRequestAfterStrippingFragments:(NSURLRequest*)originalRequest; - -@end - -#endif diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.m b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.m deleted file mode 100644 index ddef8be..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.m +++ /dev/null @@ -1,408 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -// -// Testing shows: -// -// In all cases, webView.request.URL is the previous page's URL (or empty) during the didStartLoad callback. -// When loading a page with a redirect: -// 1. shouldStartLoading (requestURL is target page) -// 2. didStartLoading -// 3. shouldStartLoading (requestURL is redirect target) -// 4. didFinishLoad (request.URL is redirect target) -// -// Note the lack of a second didStartLoading ** -// -// When loading a page with iframes: -// 1. shouldStartLoading (requestURL is main page) -// 2. didStartLoading -// 3. shouldStartLoading (requestURL is one of the iframes) -// 4. didStartLoading -// 5. didFinishLoad -// 6. didFinishLoad -// -// Note there is no way to distinguish which didFinishLoad maps to which didStartLoad ** -// -// Loading a page by calling window.history.go(-1): -// 1. didStartLoading -// 2. didFinishLoad -// -// Note the lack of a shouldStartLoading call ** -// Actually - this is fixed on iOS6. iOS6 has a shouldStart. ** -// -// Loading a page by calling location.reload() -// 1. shouldStartLoading -// 2. didStartLoading -// 3. didFinishLoad -// -// Loading a page with an iframe that fails to load: -// 1. shouldStart (main page) -// 2. didStart -// 3. shouldStart (iframe) -// 4. didStart -// 5. didFailWithError -// 6. didFinish -// -// Loading a page with an iframe that fails to load due to an invalid URL: -// 1. shouldStart (main page) -// 2. didStart -// 3. shouldStart (iframe) -// 5. didFailWithError -// 6. didFinish -// -// This case breaks our logic since there is a missing didStart. To prevent this, -// we check URLs in shouldStart and return NO if they are invalid. -// -// Loading a page with an invalid URL -// 1. shouldStart (main page) -// 2. didFailWithError -// -// TODO: Record order when page is re-navigated before the first navigation finishes. -// - -#if !WK_WEB_VIEW_ONLY - -#import "CDVUIWebViewDelegate.h" - -// #define VerboseLog NSLog -#define VerboseLog(...) do { \ -} while (0) - -typedef enum { - STATE_IDLE = 0, - STATE_WAITING_FOR_LOAD_START = 1, - STATE_WAITING_FOR_LOAD_FINISH = 2, - STATE_IOS5_POLLING_FOR_LOAD_START = 3, - STATE_IOS5_POLLING_FOR_LOAD_FINISH = 4, - STATE_CANCELLED = 5 -} State; - -static NSString *stripFragment(NSString* url) -{ - NSRange r = [url rangeOfString:@"#"]; - - if (r.location == NSNotFound) { - return url; - } - return [url substringToIndex:r.location]; -} - -@implementation CDVUIWebViewDelegate - -- (id)initWithDelegate:(NSObject *)delegate -{ - self = [super init]; - if (self != nil) { - _delegate = delegate; - _loadCount = -1; - _state = STATE_IDLE; - } - return self; -} - -- (BOOL)request:(NSURLRequest*)newRequest isEqualToRequestAfterStrippingFragments:(NSURLRequest*)originalRequest -{ - if (originalRequest.URL && newRequest.URL) { - NSString* originalRequestUrl = [originalRequest.URL absoluteString]; - NSString* newRequestUrl = [newRequest.URL absoluteString]; - - NSString* baseOriginalRequestUrl = stripFragment(originalRequestUrl); - NSString* baseNewRequestUrl = stripFragment(newRequestUrl); - return [baseOriginalRequestUrl isEqualToString:baseNewRequestUrl]; - } - - return NO; -} - -- (BOOL)isPageLoaded:(UIWebView*)webView -{ - NSString* readyState = [webView stringByEvaluatingJavaScriptFromString:@"document.readyState"]; - - return [readyState isEqualToString:@"loaded"] || [readyState isEqualToString:@"complete"]; -} - -- (BOOL)isJsLoadTokenSet:(UIWebView*)webView -{ - NSString* loadToken = [webView stringByEvaluatingJavaScriptFromString:@"window.__cordovaLoadToken"]; - - return [[NSString stringWithFormat:@"%ld", (long)_curLoadToken] isEqualToString:loadToken]; -} - -- (void)setLoadToken:(UIWebView*)webView -{ - _curLoadToken += 1; - [webView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"window.__cordovaLoadToken=%ld", (long)_curLoadToken]]; -} - -- (NSString*)evalForCurrentURL:(UIWebView*)webView -{ - return [webView stringByEvaluatingJavaScriptFromString:@"location.href"]; -} - -- (void)pollForPageLoadStart:(UIWebView*)webView -{ - if (_state != STATE_IOS5_POLLING_FOR_LOAD_START) { - return; - } - if (![self isJsLoadTokenSet:webView]) { - VerboseLog(@"Polled for page load start. result = YES!"); - _state = STATE_IOS5_POLLING_FOR_LOAD_FINISH; - [self setLoadToken:webView]; - if ([_delegate respondsToSelector:@selector(webViewDidStartLoad:)]) { - [_delegate webViewDidStartLoad:webView]; - } - [self pollForPageLoadFinish:webView]; - } else { - VerboseLog(@"Polled for page load start. result = NO"); - // Poll only for 1 second, and then fall back on checking only when delegate methods are called. - ++_loadStartPollCount; - if (_loadStartPollCount < (1000 * .05)) { - [self performSelector:@selector(pollForPageLoadStart:) withObject:webView afterDelay:.05]; - } - } -} - -- (void)pollForPageLoadFinish:(UIWebView*)webView -{ - if (_state != STATE_IOS5_POLLING_FOR_LOAD_FINISH) { - return; - } - if ([self isPageLoaded:webView]) { - VerboseLog(@"Polled for page load finish. result = YES!"); - _state = STATE_IDLE; - if ([_delegate respondsToSelector:@selector(webViewDidFinishLoad:)]) { - [_delegate webViewDidFinishLoad:webView]; - } - } else { - VerboseLog(@"Polled for page load finish. result = NO"); - [self performSelector:@selector(pollForPageLoadFinish:) withObject:webView afterDelay:.05]; - } -} - -- (BOOL)shouldLoadRequest:(NSURLRequest*)request -{ - NSString* scheme = [[request URL] scheme]; - NSArray* allowedSchemes = [NSArray arrayWithObjects:@"mailto",@"tel",@"blob",@"sms",@"data", nil]; - if([allowedSchemes containsObject:scheme]) { - return YES; - } - else { - return [NSURLConnection canHandleRequest:request]; - } -} - -- (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType -{ - BOOL shouldLoad = YES; - - if ([_delegate respondsToSelector:@selector(webView:shouldStartLoadWithRequest:navigationType:)]) { - shouldLoad = [_delegate webView:webView shouldStartLoadWithRequest:request navigationType:navigationType]; - } - - VerboseLog(@"webView shouldLoad=%d (before) state=%d loadCount=%d URL=%@", shouldLoad, _state, _loadCount, request.URL); - - if (shouldLoad) { - // When devtools refresh occurs, it blindly uses the same request object. If a history.replaceState() has occured, then - // mainDocumentURL != URL even though it's a top-level navigation. - BOOL isDevToolsRefresh = (request == webView.request); - BOOL isTopLevelNavigation = isDevToolsRefresh || [request.URL isEqual:[request mainDocumentURL]]; - if (isTopLevelNavigation) { - // Ignore hash changes that don't navigate to a different page. - // webView.request does actually update when history.replaceState() gets called. - if ([self request:request isEqualToRequestAfterStrippingFragments:webView.request]) { - NSString* prevURL = [self evalForCurrentURL:webView]; - if ([prevURL isEqualToString:[request.URL absoluteString]]) { - VerboseLog(@"Page reload detected."); - } else { - VerboseLog(@"Detected hash change shouldLoad"); - return shouldLoad; - } - } - - switch (_state) { - case STATE_WAITING_FOR_LOAD_FINISH: - // Redirect case. - // We expect loadCount == 1. - if (_loadCount != 1) { - NSLog(@"CDVWebViewDelegate: Detected redirect when loadCount=%ld", (long)_loadCount); - } - break; - - case STATE_IDLE: - case STATE_IOS5_POLLING_FOR_LOAD_START: - case STATE_CANCELLED: - // Page navigation start. - _loadCount = 0; - _state = STATE_WAITING_FOR_LOAD_START; - break; - - default: - { - NSString* description = [NSString stringWithFormat:@"CDVWebViewDelegate: Navigation started when state=%ld", (long)_state]; - NSLog(@"%@", description); - _loadCount = 0; - _state = STATE_WAITING_FOR_LOAD_START; - - NSDictionary* errorDictionary = @{NSLocalizedDescriptionKey : description}; - NSError* error = [[NSError alloc] initWithDomain:@"CDVUIWebViewDelegate" code:1 userInfo:errorDictionary]; - [self webView:webView didFailLoadWithError:error]; - } - } - } else { - // Deny invalid URLs so that we don't get the case where we go straight from - // webViewShouldLoad -> webViewDidFailLoad (messes up _loadCount). - shouldLoad = shouldLoad && [self shouldLoadRequest:request]; - } - VerboseLog(@"webView shouldLoad=%d (after) isTopLevelNavigation=%d state=%d loadCount=%d", shouldLoad, isTopLevelNavigation, _state, _loadCount); - } - return shouldLoad; -} - -- (void)webViewDidStartLoad:(UIWebView*)webView -{ - VerboseLog(@"webView didStartLoad (before). state=%d loadCount=%d", _state, _loadCount); - BOOL fireCallback = NO; - switch (_state) { - case STATE_IDLE: - break; - - case STATE_CANCELLED: - fireCallback = YES; - _state = STATE_WAITING_FOR_LOAD_FINISH; - _loadCount += 1; - break; - - case STATE_WAITING_FOR_LOAD_START: - if (_loadCount != 0) { - NSLog(@"CDVWebViewDelegate: Unexpected loadCount in didStart. count=%ld", (long)_loadCount); - } - fireCallback = YES; - _state = STATE_WAITING_FOR_LOAD_FINISH; - _loadCount = 1; - break; - - case STATE_WAITING_FOR_LOAD_FINISH: - _loadCount += 1; - break; - - case STATE_IOS5_POLLING_FOR_LOAD_START: - [self pollForPageLoadStart:webView]; - break; - - case STATE_IOS5_POLLING_FOR_LOAD_FINISH: - [self pollForPageLoadFinish:webView]; - break; - - default: - NSLog(@"CDVWebViewDelegate: Unexpected didStart with state=%ld loadCount=%ld", (long)_state, (long)_loadCount); - } - VerboseLog(@"webView didStartLoad (after). state=%d loadCount=%d fireCallback=%d", _state, _loadCount, fireCallback); - if (fireCallback && [_delegate respondsToSelector:@selector(webViewDidStartLoad:)]) { - [_delegate webViewDidStartLoad:webView]; - } -} - -- (void)webViewDidFinishLoad:(UIWebView*)webView -{ - VerboseLog(@"webView didFinishLoad (before). state=%d loadCount=%d", _state, _loadCount); - BOOL fireCallback = NO; - switch (_state) { - case STATE_IDLE: - break; - - case STATE_WAITING_FOR_LOAD_START: - NSLog(@"CDVWebViewDelegate: Unexpected didFinish while waiting for load start."); - break; - - case STATE_WAITING_FOR_LOAD_FINISH: - // fix call loadRequest multiple times just callback webViewDidFinishLoad once time in iOS 12 - if (@available(iOS 12.0, *)) { - fireCallback = YES; - } else { - if (_loadCount == 1) { - fireCallback = YES; - _state = STATE_IDLE; - } - } - _loadCount -= 1; - break; - - case STATE_IOS5_POLLING_FOR_LOAD_START: - [self pollForPageLoadStart:webView]; - break; - - case STATE_IOS5_POLLING_FOR_LOAD_FINISH: - [self pollForPageLoadFinish:webView]; - break; - } - VerboseLog(@"webView didFinishLoad (after). state=%d loadCount=%d fireCallback=%d", _state, _loadCount, fireCallback); - if (fireCallback && [_delegate respondsToSelector:@selector(webViewDidFinishLoad:)]) { - [_delegate webViewDidFinishLoad:webView]; - } -} - -- (void)webView:(UIWebView*)webView didFailLoadWithError:(NSError*)error -{ - VerboseLog(@"webView didFailLoad (before). state=%d loadCount=%d", _state, _loadCount); - BOOL fireCallback = NO; - - switch (_state) { - case STATE_IDLE: - break; - - case STATE_WAITING_FOR_LOAD_START: - if ([error code] == NSURLErrorCancelled) { - _state = STATE_CANCELLED; - } else { - _state = STATE_IDLE; - } - fireCallback = YES; - break; - - case STATE_WAITING_FOR_LOAD_FINISH: - if ([error code] != NSURLErrorCancelled) { - if (_loadCount == 1) { - _state = STATE_IDLE; - fireCallback = YES; - } - _loadCount = -1; - } else { - fireCallback = YES; - _state = STATE_CANCELLED; - _loadCount -= 1; - } - break; - - case STATE_IOS5_POLLING_FOR_LOAD_START: - [self pollForPageLoadStart:webView]; - break; - - case STATE_IOS5_POLLING_FOR_LOAD_FINISH: - [self pollForPageLoadFinish:webView]; - break; - } - VerboseLog(@"webView didFailLoad (after). state=%d loadCount=%d, fireCallback=%d", _state, _loadCount, fireCallback); - if (fireCallback && [_delegate respondsToSelector:@selector(webView:didFailLoadWithError:)]) { - [_delegate webView:webView didFailLoadWithError:error]; - } -} - -@end - -#endif diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewEngine.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewEngine.h deleted file mode 100644 index 9b4bf18..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewEngine.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import -#import - -@interface CDVUIWebViewEngine : CDVPlugin - -#if !WK_WEB_VIEW_ONLY -@property (nonatomic, strong, readonly) id uiWebViewDelegate; -#endif - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewEngine.m b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewEngine.m deleted file mode 100644 index e5767b5..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewEngine.m +++ /dev/null @@ -1,206 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#if !WK_WEB_VIEW_ONLY - -#import "CDVUIWebViewEngine.h" -#import "CDVUIWebViewDelegate.h" -#import "CDVUIWebViewNavigationDelegate.h" -#import "NSDictionary+CordovaPreferences.h" - -#import - -@interface CDVUIWebViewEngine () - -@property (nonatomic, strong, readwrite) UIView* engineWebView; -@property (nonatomic, strong, readwrite) id uiWebViewDelegate; -@property (nonatomic, strong, readwrite) CDVUIWebViewNavigationDelegate* navWebViewDelegate; - -@end - -@implementation CDVUIWebViewEngine - -@synthesize engineWebView = _engineWebView; - -- (instancetype)initWithFrame:(CGRect)frame -{ - self = [super init]; - if (self) { - self.engineWebView = [[UIWebView alloc] initWithFrame:frame]; - NSLog(@"Using UIWebView"); - } - - return self; -} - -- (void)pluginInitialize -{ - // viewController would be available now. we attempt to set all possible delegates to it, by default - - UIWebView* uiWebView = (UIWebView*)_engineWebView; - - if ([self.viewController conformsToProtocol:@protocol(UIWebViewDelegate)]) { - self.uiWebViewDelegate = [[CDVUIWebViewDelegate alloc] initWithDelegate:(id )self.viewController]; - uiWebView.delegate = self.uiWebViewDelegate; - } else { - self.navWebViewDelegate = [[CDVUIWebViewNavigationDelegate alloc] initWithEnginePlugin:self]; - self.uiWebViewDelegate = [[CDVUIWebViewDelegate alloc] initWithDelegate:self.navWebViewDelegate]; - uiWebView.delegate = self.uiWebViewDelegate; - } - - [self updateSettings:self.commandDelegate.settings]; -} - -- (void)evaluateJavaScript:(NSString*)javaScriptString completionHandler:(void (^)(id, NSError*))completionHandler -{ - NSString* ret = [(UIWebView*)_engineWebView stringByEvaluatingJavaScriptFromString:javaScriptString]; - - if (completionHandler) { - completionHandler(ret, nil); - } -} - -- (id)loadRequest:(NSURLRequest*)request -{ - [(UIWebView*)_engineWebView loadRequest:request]; - return nil; -} - -- (id)loadHTMLString:(NSString*)string baseURL:(NSURL*)baseURL -{ - [(UIWebView*)_engineWebView loadHTMLString:string baseURL:baseURL]; - return nil; -} - -- (NSURL*)URL -{ - return [[(UIWebView*)_engineWebView request] URL]; -} - -- (BOOL) canLoadRequest:(NSURLRequest*)request -{ - return (request != nil); -} - -- (void)updateSettings:(NSDictionary*)settings -{ - UIWebView* uiWebView = (UIWebView*)_engineWebView; - - uiWebView.scalesPageToFit = [settings cordovaBoolSettingForKey:@"EnableViewportScale" defaultValue:NO]; - uiWebView.allowsInlineMediaPlayback = [settings cordovaBoolSettingForKey:@"AllowInlineMediaPlayback" defaultValue:NO]; - uiWebView.mediaPlaybackRequiresUserAction = [settings cordovaBoolSettingForKey:@"MediaPlaybackRequiresUserAction" defaultValue:YES]; - uiWebView.mediaPlaybackAllowsAirPlay = [settings cordovaBoolSettingForKey:@"MediaPlaybackAllowsAirPlay" defaultValue:YES]; - uiWebView.keyboardDisplayRequiresUserAction = [settings cordovaBoolSettingForKey:@"KeyboardDisplayRequiresUserAction" defaultValue:YES]; - uiWebView.suppressesIncrementalRendering = [settings cordovaBoolSettingForKey:@"SuppressesIncrementalRendering" defaultValue:NO]; - uiWebView.gapBetweenPages = [settings cordovaFloatSettingForKey:@"GapBetweenPages" defaultValue:0.0]; - uiWebView.pageLength = [settings cordovaFloatSettingForKey:@"PageLength" defaultValue:0.0]; - - id prefObj = nil; - - // By default, DisallowOverscroll is false (thus bounce is allowed) - BOOL bounceAllowed = !([settings cordovaBoolSettingForKey:@"DisallowOverscroll" defaultValue:NO]); - - // prevent webView from bouncing - if (!bounceAllowed) { - if ([uiWebView respondsToSelector:@selector(scrollView)]) { - ((UIScrollView*)[uiWebView scrollView]).bounces = NO; - } else { - for (id subview in self.webView.subviews) { - if ([[subview class] isSubclassOfClass:[UIScrollView class]]) { - ((UIScrollView*)subview).bounces = NO; - } - } - } - } - - NSString* decelerationSetting = [settings cordovaSettingForKey:@"UIWebViewDecelerationSpeed"]; - if (![@"fast" isEqualToString:decelerationSetting]) { - [uiWebView.scrollView setDecelerationRate:UIScrollViewDecelerationRateNormal]; - } - - NSInteger paginationBreakingMode = 0; // default - UIWebPaginationBreakingModePage - prefObj = [settings cordovaSettingForKey:@"PaginationBreakingMode"]; - if (prefObj != nil) { - NSArray* validValues = @[@"page", @"column"]; - NSString* prefValue = [validValues objectAtIndex:0]; - - if ([prefObj isKindOfClass:[NSString class]]) { - prefValue = prefObj; - } - - paginationBreakingMode = [validValues indexOfObject:[prefValue lowercaseString]]; - if (paginationBreakingMode == NSNotFound) { - paginationBreakingMode = 0; - } - } - uiWebView.paginationBreakingMode = paginationBreakingMode; - - NSInteger paginationMode = 0; // default - UIWebPaginationModeUnpaginated - prefObj = [settings cordovaSettingForKey:@"PaginationMode"]; - if (prefObj != nil) { - NSArray* validValues = @[@"unpaginated", @"lefttoright", @"toptobottom", @"bottomtotop", @"righttoleft"]; - NSString* prefValue = [validValues objectAtIndex:0]; - - if ([prefObj isKindOfClass:[NSString class]]) { - prefValue = prefObj; - } - - paginationMode = [validValues indexOfObject:[prefValue lowercaseString]]; - if (paginationMode == NSNotFound) { - paginationMode = 0; - } - } - uiWebView.paginationMode = paginationMode; -} - -- (void)updateWithInfo:(NSDictionary*)info -{ - UIWebView* uiWebView = (UIWebView*)_engineWebView; - - id uiWebViewDelegate = [info objectForKey:kCDVWebViewEngineUIWebViewDelegate]; - NSDictionary* settings = [info objectForKey:kCDVWebViewEngineWebViewPreferences]; - - if (uiWebViewDelegate && - [uiWebViewDelegate conformsToProtocol:@protocol(UIWebViewDelegate)]) { - self.uiWebViewDelegate = [[CDVUIWebViewDelegate alloc] initWithDelegate:(id )uiWebViewDelegate]; - uiWebView.delegate = self.uiWebViewDelegate; - } - - if (settings && [settings isKindOfClass:[NSDictionary class]]) { - [self updateSettings:settings]; - } -} - -// This forwards the methods that are in the header that are not implemented here. -// Both WKWebView and UIWebView implement the below: -// loadHTMLString:baseURL: -// loadRequest: -- (id)forwardingTargetForSelector:(SEL)aSelector -{ - return _engineWebView; -} - -- (UIView*)webView -{ - return self.engineWebView; -} - -@end - -#endif diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.h deleted file mode 100644 index 9b9b31f..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#if !WK_WEB_VIEW_ONLY - -#import -#import "CDVUIWebViewEngine.h" - -@interface CDVUIWebViewNavigationDelegate : NSObject - -@property (nonatomic, weak) CDVPlugin* enginePlugin; - -- (instancetype)initWithEnginePlugin:(CDVPlugin*)enginePlugin; - -@end - -#endif diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.m b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.m deleted file mode 100644 index a918e2d..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.m +++ /dev/null @@ -1,157 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#if !WK_WEB_VIEW_ONLY - -#import "CDVUIWebViewNavigationDelegate.h" -#import -#import -#import -#import - -@implementation CDVUIWebViewNavigationDelegate - -- (instancetype)initWithEnginePlugin:(CDVPlugin*)theEnginePlugin -{ - self = [super init]; - if (self) { - self.enginePlugin = theEnginePlugin; - } - - return self; -} - -/** - When web application loads Add stuff to the DOM, mainly the user-defined settings from the Settings.plist file, and - the device's data such as device ID, platform version, etc. - */ -- (void)webViewDidStartLoad:(UIWebView*)theWebView -{ - NSLog(@"Resetting plugins due to page load."); - CDVViewController* vc = (CDVViewController*)self.enginePlugin.viewController; - - [vc.commandQueue resetRequestId]; - [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginResetNotification object:self.enginePlugin.webView]]; -} - -/** - Called when the webview finishes loading. This stops the activity view. - */ -- (void)webViewDidFinishLoad:(UIWebView*)theWebView -{ - NSLog(@"Finished load of: %@", theWebView.request.URL); - CDVViewController* vc = (CDVViewController*)self.enginePlugin.viewController; - - // It's safe to release the lock even if this is just a sub-frame that's finished loading. - [CDVUserAgentUtil releaseLock:vc.userAgentLockToken]; - - /* - * Hide the Top Activity THROBBER in the Battery Bar - */ - [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO]; - - [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPageDidLoadNotification object:self.enginePlugin.webView]]; -} - -- (void)webView:(UIWebView*)theWebView didFailLoadWithError:(NSError*)error -{ - CDVViewController* vc = (CDVViewController*)self.enginePlugin.viewController; - - [CDVUserAgentUtil releaseLock:vc.userAgentLockToken]; - - NSString* message = [NSString stringWithFormat:@"Failed to load webpage with error: %@", [error localizedDescription]]; - NSLog(@"%@", message); - - NSURL* errorUrl = vc.errorURL; - if (errorUrl) { - errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [message stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLPathAllowedCharacterSet]] relativeToURL:errorUrl]; - NSLog(@"%@", [errorUrl absoluteString]); - if(error.code != NSURLErrorCancelled) { - [theWebView loadRequest:[NSURLRequest requestWithURL:errorUrl]]; - } - } -} - -- (BOOL)defaultResourcePolicyForURL:(NSURL*)url -{ - /* - * If a URL is being loaded that's a file url, just load it internally - */ - if ([url isFileURL]) { - return YES; - } - - return NO; -} - -- (BOOL)webView:(UIWebView*)theWebView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType -{ - NSURL* url = [request URL]; - CDVViewController* vc = (CDVViewController*)self.enginePlugin.viewController; - - /* - * Execute any commands queued with cordova.exec() on the JS side. - * The part of the URL after gap:// is irrelevant. - */ - if ([[url scheme] isEqualToString:@"gap"]) { - [vc.commandQueue fetchCommandsFromJs]; - // The delegate is called asynchronously in this case, so we don't have to use - // flushCommandQueueWithDelayedJs (setTimeout(0)) as we do with hash changes. - [vc.commandQueue executePending]; - return NO; - } - - /* - * Give plugins the chance to handle the url - */ - BOOL anyPluginsResponded = NO; - BOOL shouldAllowRequest = NO; - - for (NSString* pluginName in vc.pluginObjects) { - CDVPlugin* plugin = [vc.pluginObjects objectForKey:pluginName]; - SEL selector = NSSelectorFromString(@"shouldOverrideLoadWithRequest:navigationType:"); - if ([plugin respondsToSelector:selector]) { - anyPluginsResponded = YES; - shouldAllowRequest = (((BOOL (*)(id, SEL, id, int))objc_msgSend)(plugin, selector, request, navigationType)); - if (!shouldAllowRequest) { - break; - } - } - } - - if (anyPluginsResponded) { - return shouldAllowRequest; - } - - /* - * Handle all other types of urls (tel:, sms:), and requests to load a url in the main webview. - */ - BOOL shouldAllowNavigation = [self defaultResourcePolicyForURL:url]; - if (shouldAllowNavigation) { - return YES; - } else { - [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]]; - } - - return NO; -} - -@end - -#endif diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDV.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDV.h deleted file mode 100644 index 96d6efc..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDV.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "CDVAvailability.h" -#import "CDVAvailabilityDeprecated.h" -#import "CDVAppDelegate.h" -#import "CDVPlugin.h" -#import "CDVPluginResult.h" -#import "CDVViewController.h" -#import "CDVCommandDelegate.h" -#import "CDVURLProtocol.h" -#import "CDVInvokedUrlCommand.h" -#import "CDVWhitelist.h" -#import "CDVScreenOrientationDelegate.h" -#import "CDVTimer.h" -#import "CDVUserAgentUtil.h" diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVAppDelegate.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVAppDelegate.h deleted file mode 100644 index de5b518..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVAppDelegate.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import -#import "CDVViewController.h" - -@interface CDVAppDelegate : NSObject {} - -@property (nonatomic, strong) IBOutlet UIWindow* window; -@property (nonatomic, strong) IBOutlet CDVViewController* viewController; - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVAppDelegate.m b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVAppDelegate.m deleted file mode 100644 index 6a339f4..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVAppDelegate.m +++ /dev/null @@ -1,118 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "CDVAppDelegate.h" - -@implementation CDVAppDelegate - -@synthesize window, viewController; - -- (id)init -{ - /** If you need to do any extra app-specific initialization, you can do it here - * -jm - **/ - NSHTTPCookieStorage* cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; - - [cookieStorage setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways]; - - int cacheSizeMemory = 8 * 1024 * 1024; // 8MB - int cacheSizeDisk = 32 * 1024 * 1024; // 32MB - NSURLCache* sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:cacheSizeMemory diskCapacity:cacheSizeDisk diskPath:@"nsurlcache"]; - [NSURLCache setSharedURLCache:sharedCache]; - - self = [super init]; - return self; -} - -#pragma mark UIApplicationDelegate implementation - -/** - * This is main kick off after the app inits, the views and Settings are setup here. (preferred - iOS4 and up) - */ -- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions -{ - CGRect screenBounds = [[UIScreen mainScreen] bounds]; - - self.window = [[UIWindow alloc] initWithFrame:screenBounds]; - self.window.autoresizesSubviews = YES; - - // only set if not already set in subclass - if (self.viewController == nil) { - self.viewController = [[CDVViewController alloc] init]; - } - - // Set your app's start page by setting the tag in config.xml. - // If necessary, uncomment the line below to override it. - // self.viewController.startPage = @"index.html"; - - // NOTE: To customize the view's frame size (which defaults to full screen), override - // [self.viewController viewWillAppear:] in your view controller. - - self.window.rootViewController = self.viewController; - [self.window makeKeyAndVisible]; - - return YES; -} - -// this happens while we are running ( in the background, or from within our own app ) -// only valid if 40x-Info.plist specifies a protocol to handle -- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options -{ - if (!url) { - return NO; - } - - NSMutableDictionary * openURLData = [[NSMutableDictionary alloc] init]; - - [openURLData setValue:url forKey:@"url"]; - - if (options[UIApplicationOpenURLOptionsSourceApplicationKey]) { - [openURLData setValue:options[UIApplicationOpenURLOptionsSourceApplicationKey] forKey:@"sourceApplication"]; - } - - if (options[UIApplicationOpenURLOptionsAnnotationKey]) { - [openURLData setValue:options[UIApplicationOpenURLOptionsAnnotationKey] forKey:@"annotation"]; - } - - // all plugins will get the notification, and their handlers will be called - [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]]; - [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification object:openURLData]]; - - return YES; -} - -#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000 -- (NSUInteger)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window -#else //CB-12098. Defaults to UIInterfaceOrientationMask for iOS 9+ -- (UIInterfaceOrientationMask)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window -#endif -{ - // iPhone doesn't support upside down by default, while the iPad does. Override to allow all orientations always, and let the root view controller decide what's allowed (the supported orientations mask gets intersected). - NSUInteger supportedInterfaceOrientations = (1 << UIInterfaceOrientationPortrait) | (1 << UIInterfaceOrientationLandscapeLeft) | (1 << UIInterfaceOrientationLandscapeRight) | (1 << UIInterfaceOrientationPortraitUpsideDown); - - return supportedInterfaceOrientations; -} - -- (void)applicationDidReceiveMemoryWarning:(UIApplication*)application -{ - [[NSURLCache sharedURLCache] removeAllCachedResponses]; -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVAvailability.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVAvailability.h deleted file mode 100644 index 00498ab..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVAvailability.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "CDVAvailabilityDeprecated.h" - -#define __CORDOVA_IOS__ - -#define __CORDOVA_0_9_6 906 -#define __CORDOVA_1_0_0 10000 -#define __CORDOVA_1_1_0 10100 -#define __CORDOVA_1_2_0 10200 -#define __CORDOVA_1_3_0 10300 -#define __CORDOVA_1_4_0 10400 -#define __CORDOVA_1_4_1 10401 -#define __CORDOVA_1_5_0 10500 -#define __CORDOVA_1_6_0 10600 -#define __CORDOVA_1_6_1 10601 -#define __CORDOVA_1_7_0 10700 -#define __CORDOVA_1_8_0 10800 -#define __CORDOVA_1_8_1 10801 -#define __CORDOVA_1_9_0 10900 -#define __CORDOVA_2_0_0 20000 -#define __CORDOVA_2_1_0 20100 -#define __CORDOVA_2_2_0 20200 -#define __CORDOVA_2_3_0 20300 -#define __CORDOVA_2_4_0 20400 -#define __CORDOVA_2_5_0 20500 -#define __CORDOVA_2_6_0 20600 -#define __CORDOVA_2_7_0 20700 -#define __CORDOVA_2_8_0 20800 -#define __CORDOVA_2_9_0 20900 -#define __CORDOVA_3_0_0 30000 -#define __CORDOVA_3_1_0 30100 -#define __CORDOVA_3_2_0 30200 -#define __CORDOVA_3_3_0 30300 -#define __CORDOVA_3_4_0 30400 -#define __CORDOVA_3_4_1 30401 -#define __CORDOVA_3_5_0 30500 -#define __CORDOVA_3_6_0 30600 -#define __CORDOVA_3_7_0 30700 -#define __CORDOVA_3_8_0 30800 -#define __CORDOVA_3_9_0 30900 -#define __CORDOVA_3_9_1 30901 -#define __CORDOVA_3_9_2 30902 -#define __CORDOVA_4_0_0 40000 -#define __CORDOVA_4_0_1 40001 -#define __CORDOVA_4_1_0 40100 -#define __CORDOVA_4_1_1 40101 -#define __CORDOVA_4_2_0 40200 -#define __CORDOVA_4_2_1 40201 -#define __CORDOVA_4_3_0 40300 -#define __CORDOVA_4_3_1 40301 -#define __CORDOVA_4_4_0 40400 -#define __CORDOVA_4_5_0 40500 -#define __CORDOVA_4_5_1 40501 -#define __CORDOVA_4_5_2 40502 -#define __CORDOVA_4_5_4 40504 -#define __CORDOVA_5_0_0 50000 -#define __CORDOVA_5_0_1 50001 -#define __CORDOVA_5_1_0 50100 -#define __CORDOVA_5_1_1 50101 -/* coho:next-version,insert-before */ -#define __CORDOVA_NA 99999 /* not available */ - -/* - #if CORDOVA_VERSION_MIN_REQUIRED >= __CORDOVA_4_0_0 - // do something when its at least 4.0.0 - #else - // do something else (non 4.0.0) - #endif - */ -#ifndef CORDOVA_VERSION_MIN_REQUIRED - /* coho:next-version-min-required,replace-after */ - #define CORDOVA_VERSION_MIN_REQUIRED __CORDOVA_5_1_1 -#endif - -/* - Returns YES if it is at least version specified as NSString(X) - Usage: - if (IsAtLeastiOSVersion(@"5.1")) { - // do something for iOS 5.1 or greater - } - */ -#define IsAtLeastiOSVersion(X) ([[[UIDevice currentDevice] systemVersion] compare:X options:NSNumericSearch] != NSOrderedAscending) - -/* Return the string version of the decimal version */ -#define CDV_VERSION [NSString stringWithFormat:@"%d.%d.%d", \ - (CORDOVA_VERSION_MIN_REQUIRED / 10000), \ - (CORDOVA_VERSION_MIN_REQUIRED % 10000) / 100, \ - (CORDOVA_VERSION_MIN_REQUIRED % 10000) % 100] - -// Enable this to log all exec() calls. -#define CDV_ENABLE_EXEC_LOGGING 0 -#if CDV_ENABLE_EXEC_LOGGING - #define CDV_EXEC_LOG NSLog -#else - #define CDV_EXEC_LOG(...) do { \ -} while (NO) -#endif diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVAvailabilityDeprecated.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVAvailabilityDeprecated.h deleted file mode 100644 index abf7a16..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVAvailabilityDeprecated.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import - -#ifdef __clang__ - #define CDV_DEPRECATED(version, msg) __attribute__((deprecated("Deprecated in Cordova " #version ". " msg))) -#else - #define CDV_DEPRECATED(version, msg) __attribute__((deprecated())) -#endif diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVCommandDelegate.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVCommandDelegate.h deleted file mode 100644 index efc9ad3..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVCommandDelegate.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "CDVAvailability.h" -#import "CDVInvokedUrlCommand.h" - -@class CDVPlugin; -@class CDVPluginResult; -@class CDVWhitelist; - -typedef NSURL* (^ UrlTransformerBlock)(NSURL*); - -@protocol CDVCommandDelegate - -@property (nonatomic, readonly) NSDictionary* settings; -@property (nonatomic, copy) UrlTransformerBlock urlTransformer; - -- (NSString*)pathForResource:(NSString*)resourcepath; -- (id)getCommandInstance:(NSString*)pluginName; - -// Sends a plugin result to the JS. This is thread-safe. -- (void)sendPluginResult:(CDVPluginResult*)result callbackId:(NSString*)callbackId; -// Evaluates the given JS. This is thread-safe. -- (void)evalJs:(NSString*)js; -// Can be used to evaluate JS right away instead of scheduling it on the run-loop. -// This is required for dispatch resign and pause events, but should not be used -// without reason. Without the run-loop delay, alerts used in JS callbacks may result -// in dead-lock. This method must be called from the UI thread. -- (void)evalJs:(NSString*)js scheduledOnRunLoop:(BOOL)scheduledOnRunLoop; -// Runs the given block on a background thread using a shared thread-pool. -- (void)runInBackground:(void (^)(void))block; -// Returns the User-Agent of the associated UIWebView. -- (NSString*)userAgent; - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVCommandDelegateImpl.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVCommandDelegateImpl.h deleted file mode 100644 index 0531134..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVCommandDelegateImpl.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import -#import "CDVCommandDelegate.h" - -@class CDVViewController; -@class CDVCommandQueue; - -@interface CDVCommandDelegateImpl : NSObject { - @private - __weak CDVViewController* _viewController; - NSRegularExpression* _callbackIdPattern; - @protected - __weak CDVCommandQueue* _commandQueue; - BOOL _delayResponses; -} -- (id)initWithViewController:(CDVViewController*)viewController; -- (void)flushCommandQueueWithDelayedJs; -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVCommandDelegateImpl.m b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVCommandDelegateImpl.m deleted file mode 100644 index effca6f..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVCommandDelegateImpl.m +++ /dev/null @@ -1,186 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "CDVCommandDelegateImpl.h" -#import "CDVJSON_private.h" -#import "CDVCommandQueue.h" -#import "CDVPluginResult.h" -#import "CDVViewController.h" - -@implementation CDVCommandDelegateImpl - -@synthesize urlTransformer; - -- (id)initWithViewController:(CDVViewController*)viewController -{ - self = [super init]; - if (self != nil) { - _viewController = viewController; - _commandQueue = _viewController.commandQueue; - - NSError* err = nil; - _callbackIdPattern = [NSRegularExpression regularExpressionWithPattern:@"[^A-Za-z0-9._-]" options:0 error:&err]; - if (err != nil) { - // Couldn't initialize Regex - NSLog(@"Error: Couldn't initialize regex"); - _callbackIdPattern = nil; - } - } - return self; -} - -- (NSString*)pathForResource:(NSString*)resourcepath -{ - NSBundle* mainBundle = [NSBundle mainBundle]; - NSMutableArray* directoryParts = [NSMutableArray arrayWithArray:[resourcepath componentsSeparatedByString:@"/"]]; - NSString* filename = [directoryParts lastObject]; - - [directoryParts removeLastObject]; - - NSString* directoryPartsJoined = [directoryParts componentsJoinedByString:@"/"]; - NSString* directoryStr = _viewController.wwwFolderName; - - if ([directoryPartsJoined length] > 0) { - directoryStr = [NSString stringWithFormat:@"%@/%@", _viewController.wwwFolderName, [directoryParts componentsJoinedByString:@"/"]]; - } - - return [mainBundle pathForResource:filename ofType:@"" inDirectory:directoryStr]; -} - -- (void)flushCommandQueueWithDelayedJs -{ - _delayResponses = YES; - [_commandQueue executePending]; - _delayResponses = NO; -} - -- (void)evalJsHelper2:(NSString*)js -{ - CDV_EXEC_LOG(@"Exec: evalling: %@", [js substringToIndex:MIN([js length], 160)]); - [_viewController.webViewEngine evaluateJavaScript:js completionHandler:^(id obj, NSError* error) { - // TODO: obj can be something other than string - if ([obj isKindOfClass:[NSString class]]) { - NSString* commandsJSON = (NSString*)obj; - if ([commandsJSON length] > 0) { - CDV_EXEC_LOG(@"Exec: Retrieved new exec messages by chaining."); - } - - [self->_commandQueue enqueueCommandBatch:commandsJSON]; - [self->_commandQueue executePending]; - } - }]; -} - -- (void)evalJsHelper:(NSString*)js -{ - // Cycle the run-loop before executing the JS. - // For _delayResponses - - // This ensures that we don't eval JS during the middle of an existing JS - // function (possible since UIWebViewDelegate callbacks can be synchronous). - // For !isMainThread - - // It's a hard error to eval on the non-UI thread. - // For !_commandQueue.currentlyExecuting - - // This works around a bug where sometimes alerts() within callbacks can cause - // dead-lock. - // If the commandQueue is currently executing, then we know that it is safe to - // execute the callback immediately. - // Using (dispatch_get_main_queue()) does *not* fix deadlocks for some reason, - // but performSelectorOnMainThread: does. - if (_delayResponses || ![NSThread isMainThread] || !_commandQueue.currentlyExecuting) { - [self performSelectorOnMainThread:@selector(evalJsHelper2:) withObject:js waitUntilDone:NO]; - } else { - [self evalJsHelper2:js]; - } -} - -- (BOOL)isValidCallbackId:(NSString*)callbackId -{ - if ((callbackId == nil) || (_callbackIdPattern == nil)) { - return NO; - } - - // Disallow if too long or if any invalid characters were found. - if (([callbackId length] > 100) || [_callbackIdPattern firstMatchInString:callbackId options:0 range:NSMakeRange(0, [callbackId length])]) { - return NO; - } - return YES; -} - -- (void)sendPluginResult:(CDVPluginResult*)result callbackId:(NSString*)callbackId -{ - CDV_EXEC_LOG(@"Exec(%@): Sending result. Status=%@", callbackId, result.status); - // This occurs when there is are no win/fail callbacks for the call. - if ([@"INVALID" isEqualToString:callbackId]) { - return; - } - // This occurs when the callback id is malformed. - if (![self isValidCallbackId:callbackId]) { - NSLog(@"Invalid callback id received by sendPluginResult"); - return; - } - int status = [result.status intValue]; - BOOL keepCallback = [result.keepCallback boolValue]; - NSString* argumentsAsJSON = [result argumentsAsJSON]; - BOOL debug = NO; - -#ifdef DEBUG - debug = YES; -#endif - - NSString* js = [NSString stringWithFormat:@"cordova.require('cordova/exec').nativeCallback('%@',%d,%@,%d, %d)", callbackId, status, argumentsAsJSON, keepCallback, debug]; - - [self evalJsHelper:js]; -} - -- (void)evalJs:(NSString*)js -{ - [self evalJs:js scheduledOnRunLoop:YES]; -} - -- (void)evalJs:(NSString*)js scheduledOnRunLoop:(BOOL)scheduledOnRunLoop -{ - js = [NSString stringWithFormat:@"try{cordova.require('cordova/exec').nativeEvalAndFetch(function(){%@})}catch(e){console.log('exception nativeEvalAndFetch : '+e);};", js]; - if (scheduledOnRunLoop) { - [self evalJsHelper:js]; - } else { - [self evalJsHelper2:js]; - } -} - -- (id)getCommandInstance:(NSString*)pluginName -{ - return [_viewController getCommandInstance:pluginName]; -} - -- (void)runInBackground:(void (^)(void))block -{ - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block); -} - -- (NSString*)userAgent -{ - return [_viewController userAgent]; -} - -- (NSDictionary*)settings -{ - return _viewController.settings; -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVCommandQueue.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVCommandQueue.h deleted file mode 100644 index cb7bd6e..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVCommandQueue.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import - -@class CDVInvokedUrlCommand; -@class CDVViewController; - -@interface CDVCommandQueue : NSObject - -@property (nonatomic, readonly) BOOL currentlyExecuting; - -- (id)initWithViewController:(CDVViewController*)viewController; -- (void)dispose; - -- (void)resetRequestId; -- (void)enqueueCommandBatch:(NSString*)batchJSON; - -- (void)fetchCommandsFromJs; -- (void)executePending; -- (BOOL)execute:(CDVInvokedUrlCommand*)command; - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVCommandQueue.m b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVCommandQueue.m deleted file mode 100644 index b78ed83..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVCommandQueue.m +++ /dev/null @@ -1,194 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#include -#import "CDVCommandQueue.h" -#import "CDVViewController.h" -#import "CDVCommandDelegateImpl.h" -#import "CDVJSON_private.h" -#import "CDVDebug.h" - -// Parse JS on the main thread if it's shorter than this. -static const NSInteger JSON_SIZE_FOR_MAIN_THREAD = 4 * 1024; // Chosen arbitrarily. -// Execute multiple commands in one go until this many seconds have passed. -static const double MAX_EXECUTION_TIME = .008; // Half of a 60fps frame. - -@interface CDVCommandQueue () { - NSInteger _lastCommandQueueFlushRequestId; - __weak CDVViewController* _viewController; - NSMutableArray* _queue; - NSTimeInterval _startExecutionTime; -} -@end - -@implementation CDVCommandQueue - -- (BOOL)currentlyExecuting -{ - return _startExecutionTime > 0; -} - -- (id)initWithViewController:(CDVViewController*)viewController -{ - self = [super init]; - if (self != nil) { - _viewController = viewController; - _queue = [[NSMutableArray alloc] init]; - } - return self; -} - -- (void)dispose -{ - // TODO(agrieve): Make this a zeroing weak ref once we drop support for 4.3. - _viewController = nil; -} - -- (void)resetRequestId -{ - _lastCommandQueueFlushRequestId = 0; -} - -- (void)enqueueCommandBatch:(NSString*)batchJSON -{ - if ([batchJSON length] > 0) { - NSMutableArray* commandBatchHolder = [[NSMutableArray alloc] init]; - [_queue addObject:commandBatchHolder]; - if ([batchJSON length] < JSON_SIZE_FOR_MAIN_THREAD) { - [commandBatchHolder addObject:[batchJSON cdv_JSONObject]]; - } else { - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^() { - NSMutableArray* result = [batchJSON cdv_JSONObject]; - @synchronized(commandBatchHolder) { - [commandBatchHolder addObject:result]; - } - [self performSelectorOnMainThread:@selector(executePending) withObject:nil waitUntilDone:NO]; - }); - } - } -} - -- (void)fetchCommandsFromJs -{ - __weak CDVCommandQueue* weakSelf = self; - NSString* js = @"cordova.require('cordova/exec').nativeFetchMessages()"; - - [_viewController.webViewEngine evaluateJavaScript:js - completionHandler:^(id obj, NSError* error) { - if ((error == nil) && [obj isKindOfClass:[NSString class]]) { - NSString* queuedCommandsJSON = (NSString*)obj; - CDV_EXEC_LOG(@"Exec: Flushed JS->native queue (hadCommands=%d).", [queuedCommandsJSON length] > 0); - [weakSelf enqueueCommandBatch:queuedCommandsJSON]; - // this has to be called here now, because fetchCommandsFromJs is now async (previously: synchronous) - [self executePending]; - } - }]; -} - -- (void)executePending -{ - // Make us re-entrant-safe. - if (_startExecutionTime > 0) { - return; - } - @try { - _startExecutionTime = [NSDate timeIntervalSinceReferenceDate]; - - while ([_queue count] > 0) { - NSMutableArray* commandBatchHolder = _queue[0]; - NSMutableArray* commandBatch = nil; - @synchronized(commandBatchHolder) { - // If the next-up command is still being decoded, wait for it. - if ([commandBatchHolder count] == 0) { - break; - } - commandBatch = commandBatchHolder[0]; - } - - while ([commandBatch count] > 0) { - @autoreleasepool { - // Execute the commands one-at-a-time. - NSArray* jsonEntry = [commandBatch cdv_dequeue]; - if ([commandBatch count] == 0) { - [_queue removeObjectAtIndex:0]; - } - CDVInvokedUrlCommand* command = [CDVInvokedUrlCommand commandFromJson:jsonEntry]; - CDV_EXEC_LOG(@"Exec(%@): Calling %@.%@", command.callbackId, command.className, command.methodName); - - if (![self execute:command]) { -#ifdef DEBUG - NSString* commandJson = [jsonEntry cdv_JSONString]; - static NSUInteger maxLogLength = 1024; - NSString* commandString = ([commandJson length] > maxLogLength) ? - [NSString stringWithFormat : @"%@[...]", [commandJson substringToIndex:maxLogLength]] : - commandJson; - - DLog(@"FAILED pluginJSON = %@", commandString); -#endif - } - } - - // Yield if we're taking too long. - if (([_queue count] > 0) && ([NSDate timeIntervalSinceReferenceDate] - _startExecutionTime > MAX_EXECUTION_TIME)) { - [self performSelector:@selector(executePending) withObject:nil afterDelay:0]; - return; - } - } - } - } @finally - { - _startExecutionTime = 0; - } -} - -- (BOOL)execute:(CDVInvokedUrlCommand*)command -{ - if ((command.className == nil) || (command.methodName == nil)) { - NSLog(@"ERROR: Classname and/or methodName not found for command."); - return NO; - } - - // Fetch an instance of this class - CDVPlugin* obj = [_viewController.commandDelegate getCommandInstance:command.className]; - - if (!([obj isKindOfClass:[CDVPlugin class]])) { - NSLog(@"ERROR: Plugin '%@' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.", command.className); - return NO; - } - BOOL retVal = YES; - double started = [[NSDate date] timeIntervalSince1970] * 1000.0; - // Find the proper selector to call. - NSString* methodName = [NSString stringWithFormat:@"%@:", command.methodName]; - SEL normalSelector = NSSelectorFromString(methodName); - if ([obj respondsToSelector:normalSelector]) { - // [obj performSelector:normalSelector withObject:command]; - ((void (*)(id, SEL, id))objc_msgSend)(obj, normalSelector, command); - } else { - // There's no method to call, so throw an error. - NSLog(@"ERROR: Method '%@' not defined in Plugin '%@'", methodName, command.className); - retVal = NO; - } - double elapsed = [[NSDate date] timeIntervalSince1970] * 1000.0 - started; - if (elapsed > 10) { - NSLog(@"THREAD WARNING: ['%@'] took '%f' ms. Plugin should use a background thread.", command.className, elapsed); - } - return retVal; -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVConfigParser.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVConfigParser.h deleted file mode 100644 index bae3d0f..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVConfigParser.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -@interface CDVConfigParser : NSObject -{ - NSString* featureName; -} - -@property (nonatomic, readonly, strong) NSMutableDictionary* pluginsDict; -@property (nonatomic, readonly, strong) NSMutableDictionary* settings; -@property (nonatomic, readonly, strong) NSMutableArray* startupPluginNames; -@property (nonatomic, readonly, strong) NSString* startPage; - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVConfigParser.m b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVConfigParser.m deleted file mode 100644 index ab32b4a..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVConfigParser.m +++ /dev/null @@ -1,81 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "CDVConfigParser.h" - -@interface CDVConfigParser () - -@property (nonatomic, readwrite, strong) NSMutableDictionary* pluginsDict; -@property (nonatomic, readwrite, strong) NSMutableDictionary* settings; -@property (nonatomic, readwrite, strong) NSMutableArray* startupPluginNames; -@property (nonatomic, readwrite, strong) NSString* startPage; - -@end - -@implementation CDVConfigParser - -@synthesize pluginsDict, settings, startPage, startupPluginNames; - -- (id)init -{ - self = [super init]; - if (self != nil) { - self.pluginsDict = [[NSMutableDictionary alloc] initWithCapacity:30]; - self.settings = [[NSMutableDictionary alloc] initWithCapacity:30]; - self.startupPluginNames = [[NSMutableArray alloc] initWithCapacity:8]; - featureName = nil; - } - return self; -} - -- (void)parser:(NSXMLParser*)parser didStartElement:(NSString*)elementName namespaceURI:(NSString*)namespaceURI qualifiedName:(NSString*)qualifiedName attributes:(NSDictionary*)attributeDict -{ - if ([elementName isEqualToString:@"preference"]) { - settings[[attributeDict[@"name"] lowercaseString]] = attributeDict[@"value"]; - } else if ([elementName isEqualToString:@"feature"]) { // store feature name to use with correct parameter set - featureName = [attributeDict[@"name"] lowercaseString]; - } else if ((featureName != nil) && [elementName isEqualToString:@"param"]) { - NSString* paramName = [attributeDict[@"name"] lowercaseString]; - id value = attributeDict[@"value"]; - if ([paramName isEqualToString:@"ios-package"]) { - pluginsDict[featureName] = value; - } - BOOL paramIsOnload = ([paramName isEqualToString:@"onload"] && [@"true" isEqualToString : value]); - BOOL attribIsOnload = [@"true" isEqualToString :[attributeDict[@"onload"] lowercaseString]]; - if (paramIsOnload || attribIsOnload) { - [self.startupPluginNames addObject:featureName]; - } - } else if ([elementName isEqualToString:@"content"]) { - self.startPage = attributeDict[@"src"]; - } -} - -- (void)parser:(NSXMLParser*)parser didEndElement:(NSString*)elementName namespaceURI:(NSString*)namespaceURI qualifiedName:(NSString*)qualifiedName -{ - if ([elementName isEqualToString:@"feature"]) { // no longer handling a feature so release - featureName = nil; - } -} - -- (void)parser:(NSXMLParser*)parser parseErrorOccurred:(NSError*)parseError -{ - NSAssert(NO, @"config.xml parse error line %ld col %ld", (long)[parser lineNumber], (long)[parser columnNumber]); -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVInvokedUrlCommand.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVInvokedUrlCommand.h deleted file mode 100644 index 993e0a2..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVInvokedUrlCommand.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import - -@interface CDVInvokedUrlCommand : NSObject { - NSString* _callbackId; - NSString* _className; - NSString* _methodName; - NSArray* _arguments; -} - -@property (nonatomic, readonly) NSArray* arguments; -@property (nonatomic, readonly) NSString* callbackId; -@property (nonatomic, readonly) NSString* className; -@property (nonatomic, readonly) NSString* methodName; - -+ (CDVInvokedUrlCommand*)commandFromJson:(NSArray*)jsonEntry; - -- (id)initWithArguments:(NSArray*)arguments - callbackId:(NSString*)callbackId - className:(NSString*)className - methodName:(NSString*)methodName; - -- (id)initFromJson:(NSArray*)jsonEntry; - -// Returns the argument at the given index. -// If index >= the number of arguments, returns nil. -// If the argument at the given index is NSNull, returns nil. -- (id)argumentAtIndex:(NSUInteger)index; -// Same as above, but returns defaultValue instead of nil. -- (id)argumentAtIndex:(NSUInteger)index withDefault:(id)defaultValue; -// Same as above, but returns defaultValue instead of nil, and if the argument is not of the expected class, returns defaultValue -- (id)argumentAtIndex:(NSUInteger)index withDefault:(id)defaultValue andClass:(Class)aClass; - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVInvokedUrlCommand.m b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVInvokedUrlCommand.m deleted file mode 100644 index 5b4281d..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVInvokedUrlCommand.m +++ /dev/null @@ -1,116 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "CDVInvokedUrlCommand.h" -#import "CDVJSON_private.h" - -@implementation CDVInvokedUrlCommand - -@synthesize arguments = _arguments; -@synthesize callbackId = _callbackId; -@synthesize className = _className; -@synthesize methodName = _methodName; - -+ (CDVInvokedUrlCommand*)commandFromJson:(NSArray*)jsonEntry -{ - return [[CDVInvokedUrlCommand alloc] initFromJson:jsonEntry]; -} - -- (id)initFromJson:(NSArray*)jsonEntry -{ - id tmp = [jsonEntry objectAtIndex:0]; - NSString* callbackId = tmp == [NSNull null] ? nil : tmp; - NSString* className = [jsonEntry objectAtIndex:1]; - NSString* methodName = [jsonEntry objectAtIndex:2]; - NSMutableArray* arguments = [jsonEntry objectAtIndex:3]; - - return [self initWithArguments:arguments - callbackId:callbackId - className:className - methodName:methodName]; -} - -- (id)initWithArguments:(NSArray*)arguments - callbackId:(NSString*)callbackId - className:(NSString*)className - methodName:(NSString*)methodName -{ - self = [super init]; - if (self != nil) { - _arguments = arguments; - _callbackId = callbackId; - _className = className; - _methodName = methodName; - } - [self massageArguments]; - return self; -} - -- (void)massageArguments -{ - NSMutableArray* newArgs = nil; - - for (NSUInteger i = 0, count = [_arguments count]; i < count; ++i) { - id arg = [_arguments objectAtIndex:i]; - if (![arg isKindOfClass:[NSDictionary class]]) { - continue; - } - NSDictionary* dict = arg; - NSString* type = [dict objectForKey:@"CDVType"]; - if (!type || ![type isEqualToString:@"ArrayBuffer"]) { - continue; - } - NSString* data = [dict objectForKey:@"data"]; - if (!data) { - continue; - } - if (newArgs == nil) { - newArgs = [NSMutableArray arrayWithArray:_arguments]; - _arguments = newArgs; - } - [newArgs replaceObjectAtIndex:i withObject:[[NSData alloc] initWithBase64EncodedString:data options:0]]; - } -} - -- (id)argumentAtIndex:(NSUInteger)index -{ - return [self argumentAtIndex:index withDefault:nil]; -} - -- (id)argumentAtIndex:(NSUInteger)index withDefault:(id)defaultValue -{ - return [self argumentAtIndex:index withDefault:defaultValue andClass:nil]; -} - -- (id)argumentAtIndex:(NSUInteger)index withDefault:(id)defaultValue andClass:(Class)aClass -{ - if (index >= [_arguments count]) { - return defaultValue; - } - id ret = [_arguments objectAtIndex:index]; - if (ret == [NSNull null]) { - ret = defaultValue; - } - if ((aClass != nil) && ![ret isKindOfClass:aClass]) { - ret = defaultValue; - } - return ret; -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVPlugin+Resources.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVPlugin+Resources.h deleted file mode 100644 index cc43b16..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVPlugin+Resources.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import -#import "CDVPlugin.h" - -@interface CDVPlugin (CDVPluginResources) - -/* - This will return the localized string for a key in a .bundle that is named the same as your class - For example, if your plugin class was called Foo, and you have a Spanish localized strings file, it will - try to load the desired key from Foo.bundle/es.lproj/Localizable.strings - */ -- (NSString*)pluginLocalizedString:(NSString*)key; - -/* - This will return the image for a name in a .bundle that is named the same as your class - For example, if your plugin class was called Foo, and you have an image called "bar", - it will try to load the image from Foo.bundle/bar.png (and appropriately named retina versions) - */ -- (UIImage*)pluginImageResource:(NSString*)name; - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVPlugin+Resources.m b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVPlugin+Resources.m deleted file mode 100644 index 5690738..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVPlugin+Resources.m +++ /dev/null @@ -1,38 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "CDVPlugin+Resources.h" - -@implementation CDVPlugin (CDVPluginResources) - -- (NSString*)pluginLocalizedString:(NSString*)key -{ - NSBundle* bundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:NSStringFromClass([self class]) ofType:@"bundle"]]; - - return [bundle localizedStringForKey:(key) value:nil table:nil]; -} - -- (UIImage*)pluginImageResource:(NSString*)name -{ - NSString* resourceIdentifier = [NSString stringWithFormat:@"%@.bundle/%@", NSStringFromClass([self class]), name]; - - return [UIImage imageNamed:resourceIdentifier]; -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVPlugin.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVPlugin.h deleted file mode 100644 index 0bdbbab..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVPlugin.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import -#import -#import "CDVPluginResult.h" -#import "NSMutableArray+QueueAdditions.h" -#import "CDVCommandDelegate.h" -#import "CDVWebViewEngineProtocol.h" - -@interface UIView (org_apache_cordova_UIView_Extension) - -@property (nonatomic, weak) UIScrollView* scrollView; - -@end - -extern NSString* const CDVPageDidLoadNotification; -extern NSString* const CDVPluginHandleOpenURLNotification; -extern NSString* const CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification; -extern NSString* const CDVPluginResetNotification; -extern NSString* const CDVViewWillAppearNotification; -extern NSString* const CDVViewDidAppearNotification; -extern NSString* const CDVViewWillDisappearNotification; -extern NSString* const CDVViewDidDisappearNotification; -extern NSString* const CDVViewWillLayoutSubviewsNotification; -extern NSString* const CDVViewDidLayoutSubviewsNotification; -extern NSString* const CDVViewWillTransitionToSizeNotification; - -@interface CDVPlugin : NSObject {} - -@property (nonatomic, readonly, weak) UIView* webView; -@property (nonatomic, readonly, weak) id webViewEngine; - -@property (nonatomic, weak) UIViewController* viewController; -@property (nonatomic, weak) id commandDelegate; - -@property (readonly, assign) BOOL hasPendingOperation; - -- (void)pluginInitialize; - -- (void)handleOpenURL:(NSNotification*)notification; -- (void)handleOpenURLWithApplicationSourceAndAnnotation:(NSNotification*)notification; -- (void)onAppTerminate; -- (void)onMemoryWarning; -- (void)onReset; -- (void)dispose; - -/* - // see initWithWebView implementation - - (void) onPause {} - - (void) onResume {} - - (void) onOrientationWillChange {} - - (void) onOrientationDidChange {} - */ - -- (id)appDelegate; - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVPlugin.m b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVPlugin.m deleted file mode 100644 index 6af03e9..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVPlugin.m +++ /dev/null @@ -1,199 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "CDVPlugin.h" -#import "CDVPlugin+Private.h" -#import "CDVPlugin+Resources.h" -#import "CDVViewController.h" -#include - -@implementation UIView (org_apache_cordova_UIView_Extension) - -@dynamic scrollView; - -- (UIScrollView*)scrollView -{ - SEL scrollViewSelector = NSSelectorFromString(@"scrollView"); - - if ([self respondsToSelector:scrollViewSelector]) { - return ((id (*)(id, SEL))objc_msgSend)(self, scrollViewSelector); - } - - return nil; -} - -@end - -NSString* const CDVPageDidLoadNotification = @"CDVPageDidLoadNotification"; -NSString* const CDVPluginHandleOpenURLNotification = @"CDVPluginHandleOpenURLNotification"; -NSString* const CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification = @"CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification"; -NSString* const CDVPluginResetNotification = @"CDVPluginResetNotification"; -NSString* const CDVViewWillAppearNotification = @"CDVViewWillAppearNotification"; -NSString* const CDVViewDidAppearNotification = @"CDVViewDidAppearNotification"; -NSString* const CDVViewWillDisappearNotification = @"CDVViewWillDisappearNotification"; -NSString* const CDVViewDidDisappearNotification = @"CDVViewDidDisappearNotification"; -NSString* const CDVViewWillLayoutSubviewsNotification = @"CDVViewWillLayoutSubviewsNotification"; -NSString* const CDVViewDidLayoutSubviewsNotification = @"CDVViewDidLayoutSubviewsNotification"; -NSString* const CDVViewWillTransitionToSizeNotification = @"CDVViewWillTransitionToSizeNotification"; - -@interface CDVPlugin () - -@property (readwrite, assign) BOOL hasPendingOperation; -@property (nonatomic, readwrite, weak) id webViewEngine; - -@end - -@implementation CDVPlugin -@synthesize webViewEngine, viewController, commandDelegate, hasPendingOperation; -@dynamic webView; - -// Do not override these methods. Use pluginInitialize instead. -- (instancetype)initWithWebViewEngine:(id )theWebViewEngine -{ - self = [super init]; - if (self) { - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppTerminate) name:UIApplicationWillTerminateNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onMemoryWarning) name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleOpenURL:) name:CDVPluginHandleOpenURLNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleOpenURLWithApplicationSourceAndAnnotation:) name:CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onReset) name:CDVPluginResetNotification object:theWebViewEngine.engineWebView]; - - self.webViewEngine = theWebViewEngine; - } - return self; -} - -- (void)pluginInitialize -{ - // You can listen to more app notifications, see: - // http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIApplication_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006728-CH3-DontLinkElementID_4 - - // NOTE: if you want to use these, make sure you uncomment the corresponding notification handler - - // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onPause) name:UIApplicationDidEnterBackgroundNotification object:nil]; - // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onResume) name:UIApplicationWillEnterForegroundNotification object:nil]; - // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onOrientationWillChange) name:UIApplicationWillChangeStatusBarOrientationNotification object:nil]; - // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onOrientationDidChange) name:UIApplicationDidChangeStatusBarOrientationNotification object:nil]; - - // Added in 2.5.0 - // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pageDidLoad:) name:CDVPageDidLoadNotification object:self.webView]; - //Added in 4.3.0 - // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(viewWillAppear:) name:CDVViewWillAppearNotification object:nil]; - // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(viewDidAppear:) name:CDVViewDidAppearNotification object:nil]; - // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(viewWillDisappear:) name:CDVViewWillDisappearNotification object:nil]; - // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(viewDidDisappear:) name:CDVViewDidDisappearNotification object:nil]; - // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(viewWillLayoutSubviews:) name:CDVViewWillLayoutSubviewsNotification object:nil]; - // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(viewDidLayoutSubviews:) name:CDVViewDidLayoutSubviewsNotification object:nil]; - // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(viewWillTransitionToSize:) name:CDVViewWillTransitionToSizeNotification object:nil]; -} - -- (void)dispose -{ - viewController = nil; - commandDelegate = nil; -} - -- (UIView*)webView -{ - if (self.webViewEngine != nil) { - return self.webViewEngine.engineWebView; - } - - return nil; -} - -/* -// NOTE: for onPause and onResume, calls into JavaScript must not call or trigger any blocking UI, like alerts -- (void) onPause {} -- (void) onResume {} -- (void) onOrientationWillChange {} -- (void) onOrientationDidChange {} -*/ - -/* NOTE: calls into JavaScript must not call or trigger any blocking UI, like alerts */ -- (void)handleOpenURL:(NSNotification*)notification -{ - // override to handle urls sent to your app - // register your url schemes in your App-Info.plist - - NSURL* url = [notification object]; - - if ([url isKindOfClass:[NSURL class]]) { - /* Do your thing! */ - } -} - -/* - NOTE: calls into JavaScript must not call or trigger any blocking UI, like alerts - */ -- (void)handleOpenURLWithApplicationSourceAndAnnotation: (NSNotification*)notification -{ - - // override to handle urls sent to your app - // register your url schemes in your App-Info.plist - - // The notification object is an NSDictionary which contains - // - url which is a type of NSURL - // - sourceApplication which is a type of NSString and represents the package - // id of the app that calls our app - // - annotation which a type of Property list which can be several different types - // please see https://developer.apple.com/library/content/documentation/General/Conceptual/DevPedia-CocoaCore/PropertyList.html - - NSDictionary* notificationData = [notification object]; - - if ([notificationData isKindOfClass: NSDictionary.class]){ - - NSURL* url = notificationData[@"url"]; - NSString* sourceApplication = notificationData[@"sourceApplication"]; - id annotation = notificationData[@"annotation"]; - - if ([url isKindOfClass:NSURL.class] && [sourceApplication isKindOfClass:NSString.class] && annotation) { - /* Do your thing! */ - } - } -} - - -/* NOTE: calls into JavaScript must not call or trigger any blocking UI, like alerts */ -- (void)onAppTerminate -{ - // override this if you need to do any cleanup on app exit -} - -- (void)onMemoryWarning -{ - // override to remove caches, etc -} - -- (void)onReset -{ - // Override to cancel any long-running requests when the WebView navigates or refreshes. -} - -- (void)dealloc -{ - [[NSNotificationCenter defaultCenter] removeObserver:self]; // this will remove all notifications unless added using addObserverForName:object:queue:usingBlock: -} - -- (id)appDelegate -{ - return [[UIApplication sharedApplication] delegate]; -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVPluginResult.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVPluginResult.h deleted file mode 100644 index 2f62d77..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVPluginResult.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import -#import "CDVAvailability.h" - -typedef NS_ENUM(NSUInteger, CDVCommandStatus) { - CDVCommandStatus_NO_RESULT NS_SWIFT_NAME(noResult) = 0, - CDVCommandStatus_OK NS_SWIFT_NAME(ok), - CDVCommandStatus_CLASS_NOT_FOUND_EXCEPTION NS_SWIFT_NAME(classNotFoundException), - CDVCommandStatus_ILLEGAL_ACCESS_EXCEPTION NS_SWIFT_NAME(illegalAccessException), - CDVCommandStatus_INSTANTIATION_EXCEPTION NS_SWIFT_NAME(instantiationException), - CDVCommandStatus_MALFORMED_URL_EXCEPTION NS_SWIFT_NAME(malformedUrlException), - CDVCommandStatus_IO_EXCEPTION NS_SWIFT_NAME(ioException), - CDVCommandStatus_INVALID_ACTION NS_SWIFT_NAME(invalidAction), - CDVCommandStatus_JSON_EXCEPTION NS_SWIFT_NAME(jsonException), - CDVCommandStatus_ERROR NS_SWIFT_NAME(error) -}; - -// This exists to preserve compatibility with early Swift plugins, who are -// using CDVCommandStatus as ObjC-style constants rather than as Swift enum -// values. -// This declares extern'ed constants (implemented in CDVPluginResult.m) -#define SWIFT_ENUM_COMPAT_HACK(enumVal) extern const CDVCommandStatus SWIFT_##enumVal NS_SWIFT_NAME(enumVal) -SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_NO_RESULT); -SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_OK); -SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_CLASS_NOT_FOUND_EXCEPTION); -SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_ILLEGAL_ACCESS_EXCEPTION); -SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_INSTANTIATION_EXCEPTION); -SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_MALFORMED_URL_EXCEPTION); -SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_IO_EXCEPTION); -SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_INVALID_ACTION); -SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_JSON_EXCEPTION); -SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_ERROR); -#undef SWIFT_ENUM_COMPAT_HACK - -@interface CDVPluginResult : NSObject {} - -@property (nonatomic, strong, readonly) NSNumber* status; -@property (nonatomic, strong, readonly) id message; -@property (nonatomic, strong) NSNumber* keepCallback; -// This property can be used to scope the lifetime of another object. For example, -// Use it to store the associated NSData when `message` is created using initWithBytesNoCopy. -@property (nonatomic, strong) id associatedObject; - -- (CDVPluginResult*)init; -+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal; -+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsString:(NSString*)theMessage; -+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsArray:(NSArray*)theMessage; -+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsInt:(int)theMessage; -+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsNSInteger:(NSInteger)theMessage; -+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsNSUInteger:(NSUInteger)theMessage; -+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsDouble:(double)theMessage; -+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsBool:(BOOL)theMessage; -+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsDictionary:(NSDictionary*)theMessage; -+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsArrayBuffer:(NSData*)theMessage; -+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsMultipart:(NSArray*)theMessages; -+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageToErrorObject:(int)errorCode; - -+ (void)setVerbose:(BOOL)verbose; -+ (BOOL)isVerbose; - -- (void)setKeepCallbackAsBool:(BOOL)bKeepCallback; - -- (NSString*)argumentsAsJSON; - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVPluginResult.m b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVPluginResult.m deleted file mode 100644 index 2f6f3a6..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVPluginResult.m +++ /dev/null @@ -1,203 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "CDVPluginResult.h" -#import "CDVJSON_private.h" -#import "CDVDebug.h" - -// This exists to preserve compatibility with early Swift plugins, who are -// using CDVCommandStatus as ObjC-style constants rather than as Swift enum -// values. -// These constants alias the enum values back to their previous names. -#define SWIFT_ENUM_COMPAT_HACK(enumVal) const CDVCommandStatus SWIFT_##enumVal NS_SWIFT_NAME(enumVal) = enumVal -SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_NO_RESULT); -SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_OK); -SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_CLASS_NOT_FOUND_EXCEPTION); -SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_ILLEGAL_ACCESS_EXCEPTION); -SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_INSTANTIATION_EXCEPTION); -SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_MALFORMED_URL_EXCEPTION); -SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_IO_EXCEPTION); -SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_INVALID_ACTION); -SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_JSON_EXCEPTION); -SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_ERROR); -#undef SWIFT_ENUM_COMPAT_HACK - -@interface CDVPluginResult () - -- (CDVPluginResult*)initWithStatus:(CDVCommandStatus)statusOrdinal message:(id)theMessage; - -@end - -@implementation CDVPluginResult -@synthesize status, message, keepCallback, associatedObject; - -static NSArray* org_apache_cordova_CommandStatusMsgs; - -id messageFromArrayBuffer(NSData* data) -{ - return @{ - @"CDVType" : @"ArrayBuffer", - @"data" :[data base64EncodedStringWithOptions:0] - }; -} - -id massageMessage(id message) -{ - if ([message isKindOfClass:[NSData class]]) { - return messageFromArrayBuffer(message); - } - return message; -} - -id messageFromMultipart(NSArray* theMessages) -{ - NSMutableArray* messages = [NSMutableArray arrayWithArray:theMessages]; - - for (NSUInteger i = 0; i < messages.count; ++i) { - [messages replaceObjectAtIndex:i withObject:massageMessage([messages objectAtIndex:i])]; - } - - return @{ - @"CDVType" : @"MultiPart", - @"messages" : messages - }; -} - -+ (void)initialize -{ - org_apache_cordova_CommandStatusMsgs = [[NSArray alloc] initWithObjects:@"No result", - @"OK", - @"Class not found", - @"Illegal access", - @"Instantiation error", - @"Malformed url", - @"IO error", - @"Invalid action", - @"JSON error", - @"Error", - nil]; -} - -- (CDVPluginResult*)init -{ - return [self initWithStatus:CDVCommandStatus_NO_RESULT message:nil]; -} - -- (CDVPluginResult*)initWithStatus:(CDVCommandStatus)statusOrdinal message:(id)theMessage -{ - self = [super init]; - if (self) { - status = [NSNumber numberWithInt:statusOrdinal]; - message = theMessage; - keepCallback = [NSNumber numberWithBool:NO]; - } - return self; -} - -+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal -{ - return [[self alloc] initWithStatus:statusOrdinal message:nil]; -} - -+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsString:(NSString*)theMessage -{ - return [[self alloc] initWithStatus:statusOrdinal message:theMessage]; -} - -+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsArray:(NSArray*)theMessage -{ - return [[self alloc] initWithStatus:statusOrdinal message:theMessage]; -} - -+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsInt:(int)theMessage -{ - return [[self alloc] initWithStatus:statusOrdinal message:[NSNumber numberWithInt:theMessage]]; -} - -+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsNSInteger:(NSInteger)theMessage -{ - return [[self alloc] initWithStatus:statusOrdinal message:[NSNumber numberWithInteger:theMessage]]; -} - -+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsNSUInteger:(NSUInteger)theMessage -{ - return [[self alloc] initWithStatus:statusOrdinal message:[NSNumber numberWithUnsignedInteger:theMessage]]; -} - -+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsDouble:(double)theMessage -{ - return [[self alloc] initWithStatus:statusOrdinal message:[NSNumber numberWithDouble:theMessage]]; -} - -+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsBool:(BOOL)theMessage -{ - return [[self alloc] initWithStatus:statusOrdinal message:[NSNumber numberWithBool:theMessage]]; -} - -+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsDictionary:(NSDictionary*)theMessage -{ - return [[self alloc] initWithStatus:statusOrdinal message:theMessage]; -} - -+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsArrayBuffer:(NSData*)theMessage -{ - return [[self alloc] initWithStatus:statusOrdinal message:messageFromArrayBuffer(theMessage)]; -} - -+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsMultipart:(NSArray*)theMessages -{ - return [[self alloc] initWithStatus:statusOrdinal message:messageFromMultipart(theMessages)]; -} - -+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageToErrorObject:(int)errorCode -{ - NSDictionary* errDict = @{@"code" :[NSNumber numberWithInt:errorCode]}; - - return [[self alloc] initWithStatus:statusOrdinal message:errDict]; -} - -- (void)setKeepCallbackAsBool:(BOOL)bKeepCallback -{ - [self setKeepCallback:[NSNumber numberWithBool:bKeepCallback]]; -} - -- (NSString*)argumentsAsJSON -{ - id arguments = (self.message == nil ? [NSNull null] : self.message); - NSArray* argumentsWrappedInArray = [NSArray arrayWithObject:arguments]; - - NSString* argumentsJSON = [argumentsWrappedInArray cdv_JSONString]; - - argumentsJSON = [argumentsJSON substringWithRange:NSMakeRange(1, [argumentsJSON length] - 2)]; - - return argumentsJSON; -} - -static BOOL gIsVerbose = NO; -+ (void)setVerbose:(BOOL)verbose -{ - gIsVerbose = verbose; -} - -+ (BOOL)isVerbose -{ - return gIsVerbose; -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVScreenOrientationDelegate.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVScreenOrientationDelegate.h deleted file mode 100644 index 519dd49..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVScreenOrientationDelegate.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import - -@protocol CDVScreenOrientationDelegate - -#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000 -- (NSUInteger)supportedInterfaceOrientations; -#else -- (UIInterfaceOrientationMask)supportedInterfaceOrientations; -#endif - -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation; -- (BOOL)shouldAutorotate; - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVTimer.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVTimer.h deleted file mode 100644 index 6d31593..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVTimer.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import - -@interface CDVTimer : NSObject - -+ (void)start:(NSString*)name; -+ (void)stop:(NSString*)name; - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVTimer.m b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVTimer.m deleted file mode 100644 index 784e94d..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVTimer.m +++ /dev/null @@ -1,123 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "CDVTimer.h" - -#pragma mark CDVTimerItem - -@interface CDVTimerItem : NSObject - -@property (nonatomic, strong) NSString* name; -@property (nonatomic, strong) NSDate* started; -@property (nonatomic, strong) NSDate* ended; - -- (void)log; - -@end - -@implementation CDVTimerItem - -- (void)log -{ - NSLog(@"[CDVTimer][%@] %fms", self.name, [self.ended timeIntervalSinceDate:self.started] * 1000.0); -} - -@end - -#pragma mark CDVTimer - -@interface CDVTimer () - -@property (nonatomic, strong) NSMutableDictionary* items; - -@end - -@implementation CDVTimer - -#pragma mark object methods - -- (id)init -{ - if (self = [super init]) { - self.items = [NSMutableDictionary dictionaryWithCapacity:6]; - } - - return self; -} - -- (void)add:(NSString*)name -{ - if ([self.items objectForKey:[name lowercaseString]] == nil) { - CDVTimerItem* item = [CDVTimerItem new]; - item.name = name; - item.started = [NSDate new]; - [self.items setObject:item forKey:[name lowercaseString]]; - } else { - NSLog(@"Timer called '%@' already exists.", name); - } -} - -- (void)remove:(NSString*)name -{ - CDVTimerItem* item = [self.items objectForKey:[name lowercaseString]]; - - if (item != nil) { - item.ended = [NSDate new]; - [item log]; - [self.items removeObjectForKey:[name lowercaseString]]; - } else { - NSLog(@"Timer called '%@' does not exist.", name); - } -} - -- (void)removeAll -{ - [self.items removeAllObjects]; -} - -#pragma mark class methods - -+ (void)start:(NSString*)name -{ - [[CDVTimer sharedInstance] add:name]; -} - -+ (void)stop:(NSString*)name -{ - [[CDVTimer sharedInstance] remove:name]; -} - -+ (void)clearAll -{ - [[CDVTimer sharedInstance] removeAll]; -} - -+ (CDVTimer*)sharedInstance -{ - static dispatch_once_t pred = 0; - __strong static CDVTimer* _sharedObject = nil; - - dispatch_once(&pred, ^{ - _sharedObject = [[self alloc] init]; - }); - - return _sharedObject; -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVURLProtocol.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVURLProtocol.h deleted file mode 100644 index 0561e04..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVURLProtocol.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import -#import "CDVAvailability.h" - -@class CDVViewController; - -@interface CDVURLProtocol : NSURLProtocol {} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVURLProtocol.m b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVURLProtocol.m deleted file mode 100644 index 7b2c5ce..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVURLProtocol.m +++ /dev/null @@ -1,113 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import -#import -#import -#import -#import "CDVURLProtocol.h" -#import "CDVCommandQueue.h" -#import "CDVViewController.h" - -// Contains a set of NSNumbers of addresses of controllers. It doesn't store -// the actual pointer to avoid retaining. -static NSMutableSet* gRegisteredControllers = nil; - -NSString* const kCDVAssetsLibraryPrefixes = @"assets-library://"; - -@implementation CDVURLProtocol - - -+ (BOOL)canInitWithRequest:(NSURLRequest*)theRequest -{ - NSURL* theUrl = [theRequest URL]; - - if ([[theUrl absoluteString] hasPrefix:kCDVAssetsLibraryPrefixes]) { - return YES; - } - - return NO; -} - -+ (NSURLRequest*)canonicalRequestForRequest:(NSURLRequest*)request -{ - // NSLog(@"%@ received %@", self, NSStringFromSelector(_cmd)); - return request; -} - -- (void)startLoading -{ - // NSLog(@"%@ received %@ - start", self, NSStringFromSelector(_cmd)); - NSURL* url = [[self request] URL]; - - if ([[url absoluteString] hasPrefix:kCDVAssetsLibraryPrefixes]) { - ALAssetsLibraryAssetForURLResultBlock resultBlock = ^(ALAsset* asset) { - if (asset) { - // We have the asset! Get the data and send it along. - ALAssetRepresentation* assetRepresentation = [asset defaultRepresentation]; - NSString* MIMEType = (__bridge_transfer NSString*)UTTypeCopyPreferredTagWithClass((__bridge CFStringRef)[assetRepresentation UTI], kUTTagClassMIMEType); - Byte* buffer = (Byte*)malloc((unsigned long)[assetRepresentation size]); - NSUInteger bufferSize = [assetRepresentation getBytes:buffer fromOffset:0.0 length:(NSUInteger)[assetRepresentation size] error:nil]; - NSData* data = [NSData dataWithBytesNoCopy:buffer length:bufferSize freeWhenDone:YES]; - [self sendResponseWithResponseCode:200 data:data mimeType:MIMEType]; - } else { - // Retrieving the asset failed for some reason. Send an error. - [self sendResponseWithResponseCode:404 data:nil mimeType:nil]; - } - }; - ALAssetsLibraryAccessFailureBlock failureBlock = ^(NSError* error) { - // Retrieving the asset failed for some reason. Send an error. - [self sendResponseWithResponseCode:401 data:nil mimeType:nil]; - }; - - ALAssetsLibrary* assetsLibrary = [[ALAssetsLibrary alloc] init]; - [assetsLibrary assetForURL:url resultBlock:resultBlock failureBlock:failureBlock]; - return; - } - - NSString* body = [NSString stringWithFormat:@"Access not allowed to URL: %@", url]; - [self sendResponseWithResponseCode:401 data:[body dataUsingEncoding:NSASCIIStringEncoding] mimeType:nil]; -} - -- (void)stopLoading -{ - // do any cleanup here -} - -+ (BOOL)requestIsCacheEquivalent:(NSURLRequest*)requestA toRequest:(NSURLRequest*)requestB -{ - return NO; -} - -- (void)sendResponseWithResponseCode:(NSInteger)statusCode data:(NSData*)data mimeType:(NSString*)mimeType -{ - if (mimeType == nil) { - mimeType = @"text/plain"; - } - - NSHTTPURLResponse* response = [[NSHTTPURLResponse alloc] initWithURL:[[self request] URL] statusCode:statusCode HTTPVersion:@"HTTP/1.1" headerFields:@{@"Content-Type" : mimeType}]; - - [[self client] URLProtocol:self didReceiveResponse:response cacheStoragePolicy:NSURLCacheStorageNotAllowed]; - if (data != nil) { - [[self client] URLProtocol:self didLoadData:data]; - } - [[self client] URLProtocolDidFinishLoading:self]; -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVUserAgentUtil.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVUserAgentUtil.h deleted file mode 100644 index 4de382f..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVUserAgentUtil.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import - -@interface CDVUserAgentUtil : NSObject -+ (NSString*)originalUserAgent; -+ (void)acquireLock:(void (^)(NSInteger lockToken))block; -+ (void)releaseLock:(NSInteger*)lockToken; -+ (void)setUserAgent:(NSString*)value lockToken:(NSInteger)lockToken; -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVUserAgentUtil.m b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVUserAgentUtil.m deleted file mode 100644 index c5e9e2b..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVUserAgentUtil.m +++ /dev/null @@ -1,162 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "CDVUserAgentUtil.h" - -#import - -// #define VerboseLog NSLog -#define VerboseLog(...) do {} while (0) - -static NSString* const kCdvUserAgentKey = @"Cordova-User-Agent"; -static NSString* const kCdvUserAgentVersionKey = @"Cordova-User-Agent-Version"; - -static NSString* gOriginalUserAgent = nil; -static NSInteger gNextLockToken = 0; -static NSInteger gCurrentLockToken = 0; -static NSMutableArray* gPendingSetUserAgentBlocks = nil; - -#if WK_WEB_VIEW_ONLY -#import - -@interface WKWebView(SynchronousEvaluateJavaScript) -- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script; -@end - -@implementation WKWebView(SynchronousEvaluateJavaScript) - -- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script -{ - __block NSString *resultString = nil; - __block BOOL finished = NO; - - [self evaluateJavaScript:script completionHandler:^(id result, NSError *error) { - if (error == nil) { - if (result != nil) { - resultString = [NSString stringWithFormat:@"%@", result]; - } - } else { - NSLog(@"evaluateJavaScript error : %@", error.localizedDescription); - } - finished = YES; - }]; - - while (!finished) { - [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; - } - - return resultString; -} -@end -#endif - -@implementation CDVUserAgentUtil - -+ (NSString*)originalUserAgent -{ - if (gOriginalUserAgent == nil) { - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppLocaleDidChange:) - name:NSCurrentLocaleDidChangeNotification object:nil]; - - NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults]; - NSString* systemVersion = [[UIDevice currentDevice] systemVersion]; - NSString* localeStr = [[NSLocale currentLocale] localeIdentifier]; - // Record the model since simulator can change it without re-install (CB-5420). - NSString* model = [UIDevice currentDevice].model; - // Record the version of the app so that we can bust the cache when it changes (CB-10078) - NSString* appVersion = [[NSBundle mainBundle] infoDictionary][@"CFBundleVersion"]; - NSString* systemAndLocale = [NSString stringWithFormat:@"%@ %@ %@ %@", appVersion, model, systemVersion, localeStr]; - - NSString* cordovaUserAgentVersion = [userDefaults stringForKey:kCdvUserAgentVersionKey]; - gOriginalUserAgent = [userDefaults stringForKey:kCdvUserAgentKey]; - BOOL cachedValueIsOld = ![systemAndLocale isEqualToString:cordovaUserAgentVersion]; - - if ((gOriginalUserAgent == nil) || cachedValueIsOld) { - #if WK_WEB_VIEW_ONLY - WKWebView* sampleWebView = [[WKWebView alloc] initWithFrame:CGRectZero]; - #else - UIWebView* sampleWebView = [[UIWebView alloc] initWithFrame:CGRectZero]; -#endif - gOriginalUserAgent = [sampleWebView stringByEvaluatingJavaScriptFromString:@"navigator.userAgent"]; - - [userDefaults setObject:gOriginalUserAgent forKey:kCdvUserAgentKey]; - [userDefaults setObject:systemAndLocale forKey:kCdvUserAgentVersionKey]; - - [userDefaults synchronize]; - } - } - return gOriginalUserAgent; -} - -+ (void)onAppLocaleDidChange:(NSNotification*)notification -{ - // TODO: We should figure out how to update the user-agent of existing UIWebViews when this happens. - // Maybe use the PDF bug (noted in setUserAgent:). - gOriginalUserAgent = nil; -} - -+ (void)acquireLock:(void (^)(NSInteger lockToken))block -{ - if (gCurrentLockToken == 0) { - gCurrentLockToken = ++gNextLockToken; - VerboseLog(@"Gave lock %d", gCurrentLockToken); - block(gCurrentLockToken); - } else { - if (gPendingSetUserAgentBlocks == nil) { - gPendingSetUserAgentBlocks = [[NSMutableArray alloc] initWithCapacity:4]; - } - VerboseLog(@"Waiting for lock"); - [gPendingSetUserAgentBlocks addObject:block]; - } -} - -+ (void)releaseLock:(NSInteger*)lockToken -{ - if (lockToken == nil || *lockToken == 0) { - return; - } - NSAssert(gCurrentLockToken == *lockToken, @"Got token %ld, expected %ld", (long)*lockToken, (long)gCurrentLockToken); - - VerboseLog(@"Released lock %d", *lockToken); - if ([gPendingSetUserAgentBlocks count] > 0) { - void (^block)(NSInteger lockToken) = [gPendingSetUserAgentBlocks objectAtIndex:0]; - [gPendingSetUserAgentBlocks removeObjectAtIndex:0]; - gCurrentLockToken = ++gNextLockToken; - NSLog(@"Gave lock %ld", (long)gCurrentLockToken); - block(gCurrentLockToken); - } else { - gCurrentLockToken = 0; - } - *lockToken = 0; -} - -+ (void)setUserAgent:(NSString*)value lockToken:(NSInteger)lockToken -{ - NSAssert(gCurrentLockToken == lockToken, @"Got token %ld, expected %ld", (long)lockToken, (long)gCurrentLockToken); - VerboseLog(@"User-Agent set to: %@", value); - - // Setting the UserAgent must occur before a UIWebView is instantiated. - // It is read per instantiation, so it does not affect previously created views. - // Except! When a PDF is loaded, all currently active UIWebViews reload their - // User-Agent from the NSUserDefaults some time after the DidFinishLoad of the PDF bah! - NSDictionary* dict = [[NSDictionary alloc] initWithObjectsAndKeys:value, @"UserAgent", nil]; - [[NSUserDefaults standardUserDefaults] registerDefaults:dict]; -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVViewController.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVViewController.h deleted file mode 100644 index 605dbbb..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVViewController.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import -#import -#import "CDVAvailability.h" -#import "CDVInvokedUrlCommand.h" -#import "CDVCommandDelegate.h" -#import "CDVCommandQueue.h" -#import "CDVScreenOrientationDelegate.h" -#import "CDVPlugin.h" -#import "CDVWebViewEngineProtocol.h" - -@interface CDVViewController : UIViewController { - @protected - id _webViewEngine; - @protected - id _commandDelegate; - @protected - CDVCommandQueue* _commandQueue; - NSString* _userAgent; -} - -@property (nonatomic, readonly, weak) IBOutlet UIView* webView; - -@property (nonatomic, readonly, strong) NSMutableDictionary* pluginObjects; -@property (nonatomic, readonly, strong) NSDictionary* pluginsMap; -@property (nonatomic, readonly, strong) NSMutableDictionary* settings; -@property (nonatomic, readonly, strong) NSXMLParser* configParser; - -@property (nonatomic, readwrite, copy) NSString* configFile; -@property (nonatomic, readwrite, copy) NSString* wwwFolderName; -@property (nonatomic, readwrite, copy) NSString* startPage; -@property (nonatomic, readonly, strong) CDVCommandQueue* commandQueue; -@property (nonatomic, readonly, strong) id webViewEngine; -@property (nonatomic, readonly, strong) id commandDelegate; - -/** - The complete user agent that Cordova will use when sending web requests. - */ -@property (nonatomic, readonly) NSString* userAgent; - -/** - The base user agent data that Cordova will use to build its user agent. If this - property isn't set, Cordova will use the standard web view user agent as its - base. - */ -@property (nonatomic, readwrite, copy) NSString* baseUserAgent; - -/** - Takes/Gives an array of UIInterfaceOrientation (int) objects - ex. UIInterfaceOrientationPortrait -*/ -@property (nonatomic, readwrite, strong) NSArray* supportedOrientations; - -/** - The address of the lock token used for controlling access to setting the user-agent - */ -@property (nonatomic, readonly) NSInteger* userAgentLockToken; - -- (UIView*)newCordovaViewWithFrame:(CGRect)bounds; - -- (NSString*)appURLScheme; -- (NSURL*)errorURL; - -- (UIColor*)colorFromColorString:(NSString*)colorString; -- (NSArray*)parseInterfaceOrientations:(NSArray*)orientations; -- (BOOL)supportsOrientation:(UIInterfaceOrientation)orientation; - -- (id)getCommandInstance:(NSString*)pluginName; -- (void)registerPlugin:(CDVPlugin*)plugin withClassName:(NSString*)className; -- (void)registerPlugin:(CDVPlugin*)plugin withPluginName:(NSString*)pluginName; - -- (void)parseSettingsWithParser:(NSObject *)delegate; - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVViewController.m b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVViewController.m deleted file mode 100644 index 75e74ad..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVViewController.m +++ /dev/null @@ -1,810 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import -#import "CDV.h" -#import "CDVPlugin+Private.h" -#import "CDVConfigParser.h" -#import "CDVUserAgentUtil.h" -#import -#import "NSDictionary+CordovaPreferences.h" -#import "CDVLocalStorage.h" -#import "CDVCommandDelegateImpl.h" -#import - -@interface CDVViewController () { - NSInteger _userAgentLockToken; -} - -@property (nonatomic, readwrite, strong) NSXMLParser* configParser; -@property (nonatomic, readwrite, strong) NSMutableDictionary* settings; -@property (nonatomic, readwrite, strong) NSMutableDictionary* pluginObjects; -@property (nonatomic, readwrite, strong) NSMutableArray* startupPluginNames; -@property (nonatomic, readwrite, strong) NSDictionary* pluginsMap; -@property (nonatomic, readwrite, strong) id webViewEngine; - -@property (readwrite, assign) BOOL initialized; - -@property (atomic, strong) NSURL* openURL; - -@end - -@implementation CDVViewController - -@synthesize supportedOrientations; -@synthesize pluginObjects, pluginsMap, startupPluginNames; -@synthesize configParser, settings; -@synthesize wwwFolderName, startPage, initialized, openURL, baseUserAgent; -@synthesize commandDelegate = _commandDelegate; -@synthesize commandQueue = _commandQueue; -@synthesize webViewEngine = _webViewEngine; -@dynamic webView; - -- (void)__init -{ - if ((self != nil) && !self.initialized) { - _commandQueue = [[CDVCommandQueue alloc] initWithViewController:self]; - _commandDelegate = [[CDVCommandDelegateImpl alloc] initWithViewController:self]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppWillTerminate:) - name:UIApplicationWillTerminateNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppWillResignActive:) - name:UIApplicationWillResignActiveNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppDidBecomeActive:) - name:UIApplicationDidBecomeActiveNotification object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppWillEnterForeground:) - name:UIApplicationWillEnterForegroundNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppDidEnterBackground:) - name:UIApplicationDidEnterBackgroundNotification object:nil]; - - // read from UISupportedInterfaceOrientations (or UISupportedInterfaceOrientations~iPad, if its iPad) from -Info.plist - self.supportedOrientations = [self parseInterfaceOrientations: - [[[NSBundle mainBundle] infoDictionary] objectForKey:@"UISupportedInterfaceOrientations"]]; - - [self printVersion]; - [self printMultitaskingInfo]; - [self printPlatformVersionWarning]; - self.initialized = YES; - } -} - -- (id)initWithNibName:(NSString*)nibNameOrNil bundle:(NSBundle*)nibBundleOrNil -{ - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - [self __init]; - return self; -} - -- (id)initWithCoder:(NSCoder*)aDecoder -{ - self = [super initWithCoder:aDecoder]; - [self __init]; - return self; -} - -- (id)init -{ - self = [super init]; - [self __init]; - return self; -} - -- (void)printVersion -{ - NSLog(@"Apache Cordova native platform version %@ is starting.", CDV_VERSION); -} - -- (void)printPlatformVersionWarning -{ - if (!IsAtLeastiOSVersion(@"8.0")) { - NSLog(@"CRITICAL: For Cordova 4.0.0 and above, you will need to upgrade to at least iOS 8.0 or greater. Your current version of iOS is %@.", - [[UIDevice currentDevice] systemVersion] - ); - } -} - -- (void)printMultitaskingInfo -{ - UIDevice* device = [UIDevice currentDevice]; - BOOL backgroundSupported = NO; - - if ([device respondsToSelector:@selector(isMultitaskingSupported)]) { - backgroundSupported = device.multitaskingSupported; - } - - NSNumber* exitsOnSuspend = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UIApplicationExitsOnSuspend"]; - if (exitsOnSuspend == nil) { // if it's missing, it should be NO (i.e. multi-tasking on by default) - exitsOnSuspend = [NSNumber numberWithBool:NO]; - } - - NSLog(@"Multi-tasking -> Device: %@, App: %@", (backgroundSupported ? @"YES" : @"NO"), (![exitsOnSuspend intValue]) ? @"YES" : @"NO"); -} - --(NSString*)configFilePath{ - NSString* path = self.configFile ?: @"config.xml"; - - // if path is relative, resolve it against the main bundle - if(![path isAbsolutePath]){ - NSString* absolutePath = [[NSBundle mainBundle] pathForResource:path ofType:nil]; - if(!absolutePath){ - NSAssert(NO, @"ERROR: %@ not found in the main bundle!", path); - } - path = absolutePath; - } - - // Assert file exists - if (![[NSFileManager defaultManager] fileExistsAtPath:path]) { - NSAssert(NO, @"ERROR: %@ does not exist. Please run cordova-ios/bin/cordova_plist_to_config_xml path/to/project.", path); - return nil; - } - - return path; -} - -- (void)parseSettingsWithParser:(NSObject *)delegate -{ - // read from config.xml in the app bundle - NSString* path = [self configFilePath]; - - NSURL* url = [NSURL fileURLWithPath:path]; - - self.configParser = [[NSXMLParser alloc] initWithContentsOfURL:url]; - if (self.configParser == nil) { - NSLog(@"Failed to initialize XML parser."); - return; - } - [self.configParser setDelegate:((id < NSXMLParserDelegate >)delegate)]; - [self.configParser parse]; -} - -- (void)loadSettings -{ - CDVConfigParser* delegate = [[CDVConfigParser alloc] init]; - - [self parseSettingsWithParser:delegate]; - - // Get the plugin dictionary, whitelist and settings from the delegate. - self.pluginsMap = delegate.pluginsDict; - self.startupPluginNames = delegate.startupPluginNames; - self.settings = delegate.settings; - - // And the start folder/page. - if(self.wwwFolderName == nil){ - self.wwwFolderName = @"www"; - } - if(delegate.startPage && self.startPage == nil){ - self.startPage = delegate.startPage; - } - if (self.startPage == nil) { - self.startPage = @"index.html"; - } - - // Initialize the plugin objects dict. - self.pluginObjects = [[NSMutableDictionary alloc] initWithCapacity:20]; -} - -- (NSURL*)appUrl -{ - NSURL* appURL = nil; - - if ([self.startPage rangeOfString:@"://"].location != NSNotFound) { - appURL = [NSURL URLWithString:self.startPage]; - } else if ([self.wwwFolderName rangeOfString:@"://"].location != NSNotFound) { - appURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@/%@", self.wwwFolderName, self.startPage]]; - } else if([self.wwwFolderName rangeOfString:@".bundle"].location != NSNotFound){ - // www folder is actually a bundle - NSBundle* bundle = [NSBundle bundleWithPath:self.wwwFolderName]; - appURL = [bundle URLForResource:self.startPage withExtension:nil]; - } else if([self.wwwFolderName rangeOfString:@".framework"].location != NSNotFound){ - // www folder is actually a framework - NSBundle* bundle = [NSBundle bundleWithPath:self.wwwFolderName]; - appURL = [bundle URLForResource:self.startPage withExtension:nil]; - } else { - // CB-3005 strip parameters from start page to check if page exists in resources - NSURL* startURL = [NSURL URLWithString:self.startPage]; - NSString* startFilePath = [self.commandDelegate pathForResource:[startURL path]]; - - if (startFilePath == nil) { - appURL = nil; - } else { - appURL = [NSURL fileURLWithPath:startFilePath]; - // CB-3005 Add on the query params or fragment. - NSString* startPageNoParentDirs = self.startPage; - NSRange r = [startPageNoParentDirs rangeOfCharacterFromSet:[NSCharacterSet characterSetWithCharactersInString:@"?#"] options:0]; - if (r.location != NSNotFound) { - NSString* queryAndOrFragment = [self.startPage substringFromIndex:r.location]; - appURL = [NSURL URLWithString:queryAndOrFragment relativeToURL:appURL]; - } - } - } - - return appURL; -} - -- (NSURL*)errorURL -{ - NSURL* errorUrl = nil; - - id setting = [self.settings cordovaSettingForKey:@"ErrorUrl"]; - - if (setting) { - NSString* errorUrlString = (NSString*)setting; - if ([errorUrlString rangeOfString:@"://"].location != NSNotFound) { - errorUrl = [NSURL URLWithString:errorUrlString]; - } else { - NSURL* url = [NSURL URLWithString:(NSString*)setting]; - NSString* errorFilePath = [self.commandDelegate pathForResource:[url path]]; - if (errorFilePath) { - errorUrl = [NSURL fileURLWithPath:errorFilePath]; - } - } - } - - return errorUrl; -} - -- (UIView*)webView -{ - if (self.webViewEngine != nil) { - return self.webViewEngine.engineWebView; - } - - return nil; -} - -// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. -- (void)viewDidLoad -{ - [super viewDidLoad]; - - // Load settings - [self loadSettings]; - - NSString* backupWebStorageType = @"cloud"; // default value - - id backupWebStorage = [self.settings cordovaSettingForKey:@"BackupWebStorage"]; - if ([backupWebStorage isKindOfClass:[NSString class]]) { - backupWebStorageType = backupWebStorage; - } - [self.settings setCordovaSetting:backupWebStorageType forKey:@"BackupWebStorage"]; - - [CDVLocalStorage __fixupDatabaseLocationsWithBackupType:backupWebStorageType]; - - // // Instantiate the WebView /////////////// - - if (!self.webView) { - [self createGapView]; - } - - // ///////////////// - - /* - * Fire up CDVLocalStorage to work-around WebKit storage limitations: on all iOS 5.1+ versions for local-only backups, but only needed on iOS 5.1 for cloud backup. - With minimum iOS 7/8 supported, only first clause applies. - */ - if ([backupWebStorageType isEqualToString:@"local"]) { - NSString* localStorageFeatureName = @"localstorage"; - if ([self.pluginsMap objectForKey:localStorageFeatureName]) { // plugin specified in config - [self.startupPluginNames addObject:localStorageFeatureName]; - } - } - - if ([self.startupPluginNames count] > 0) { - [CDVTimer start:@"TotalPluginStartup"]; - - for (NSString* pluginName in self.startupPluginNames) { - [CDVTimer start:pluginName]; - [self getCommandInstance:pluginName]; - [CDVTimer stop:pluginName]; - } - - [CDVTimer stop:@"TotalPluginStartup"]; - } - - // ///////////////// - NSURL* appURL = [self appUrl]; - __weak __typeof__(self) weakSelf = self; - - [CDVUserAgentUtil acquireLock:^(NSInteger lockToken) { - // Fix the memory leak caused by the strong reference. - [weakSelf setLockToken:lockToken]; - if (appURL) { - NSURLRequest* appReq = [NSURLRequest requestWithURL:appURL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:20.0]; - [self.webViewEngine loadRequest:appReq]; - } else { - NSString* loadErr = [NSString stringWithFormat:@"ERROR: Start Page at '%@/%@' was not found.", self.wwwFolderName, self.startPage]; - NSLog(@"%@", loadErr); - - NSURL* errorUrl = [self errorURL]; - if (errorUrl) { - errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [loadErr stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLPathAllowedCharacterSet]] relativeToURL:errorUrl]; - NSLog(@"%@", [errorUrl absoluteString]); - [self.webViewEngine loadRequest:[NSURLRequest requestWithURL:errorUrl]]; - } else { - NSString* html = [NSString stringWithFormat:@" %@ ", loadErr]; - [self.webViewEngine loadHTMLString:html baseURL:nil]; - } - } - }]; - - // ///////////////// - - NSString* bgColorString = [self.settings cordovaSettingForKey:@"BackgroundColor"]; - UIColor* bgColor = [self colorFromColorString:bgColorString]; - [self.webView setBackgroundColor:bgColor]; -} - -- (void)setLockToken:(NSInteger)lockToken -{ - _userAgentLockToken = lockToken; - [CDVUserAgentUtil setUserAgent:self.userAgent lockToken:lockToken]; -} - --(void)viewWillAppear:(BOOL)animated -{ - [super viewWillAppear:animated]; - [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVViewWillAppearNotification object:nil]]; -} - --(void)viewDidAppear:(BOOL)animated -{ - [super viewDidAppear:animated]; - [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVViewDidAppearNotification object:nil]]; -} - --(void)viewWillDisappear:(BOOL)animated -{ - [super viewWillDisappear:animated]; - [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVViewWillDisappearNotification object:nil]]; -} - --(void)viewDidDisappear:(BOOL)animated -{ - [super viewDidDisappear:animated]; - [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVViewDidDisappearNotification object:nil]]; -} - --(void)viewWillLayoutSubviews -{ - [super viewWillLayoutSubviews]; - [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVViewWillLayoutSubviewsNotification object:nil]]; -} - --(void)viewDidLayoutSubviews -{ - [super viewDidLayoutSubviews]; - [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVViewDidLayoutSubviewsNotification object:nil]]; -} - --(void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator -{ - [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; - [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVViewWillTransitionToSizeNotification object:[NSValue valueWithCGSize:size]]]; -} - -- (UIColor*)colorFromColorString:(NSString*)colorString -{ - // No value, nothing to do - if (!colorString) { - return nil; - } - - // Validate format - NSError* error = NULL; - NSRegularExpression* regex = [NSRegularExpression regularExpressionWithPattern:@"^(#[0-9A-F]{3}|(0x|#)([0-9A-F]{2})?[0-9A-F]{6})$" options:NSRegularExpressionCaseInsensitive error:&error]; - NSUInteger countMatches = [regex numberOfMatchesInString:colorString options:0 range:NSMakeRange(0, [colorString length])]; - - if (!countMatches) { - return nil; - } - - // #FAB to #FFAABB - if ([colorString hasPrefix:@"#"] && [colorString length] == 4) { - NSString* r = [colorString substringWithRange:NSMakeRange(1, 1)]; - NSString* g = [colorString substringWithRange:NSMakeRange(2, 1)]; - NSString* b = [colorString substringWithRange:NSMakeRange(3, 1)]; - colorString = [NSString stringWithFormat:@"#%@%@%@%@%@%@", r, r, g, g, b, b]; - } - - // #RRGGBB to 0xRRGGBB - colorString = [colorString stringByReplacingOccurrencesOfString:@"#" withString:@"0x"]; - - // 0xRRGGBB to 0xAARRGGBB - if ([colorString hasPrefix:@"0x"] && [colorString length] == 8) { - colorString = [@"0xFF" stringByAppendingString:[colorString substringFromIndex:2]]; - } - - // 0xAARRGGBB to int - unsigned colorValue = 0; - NSScanner *scanner = [NSScanner scannerWithString:colorString]; - if (![scanner scanHexInt:&colorValue]) { - return nil; - } - - // int to UIColor - return [UIColor colorWithRed:((float)((colorValue & 0x00FF0000) >> 16))/255.0 - green:((float)((colorValue & 0x0000FF00) >> 8))/255.0 - blue:((float)((colorValue & 0x000000FF) >> 0))/255.0 - alpha:((float)((colorValue & 0xFF000000) >> 24))/255.0]; -} - -- (NSArray*)parseInterfaceOrientations:(NSArray*)orientations -{ - NSMutableArray* result = [[NSMutableArray alloc] init]; - - if (orientations != nil) { - NSEnumerator* enumerator = [orientations objectEnumerator]; - NSString* orientationString; - - while (orientationString = [enumerator nextObject]) { - if ([orientationString isEqualToString:@"UIInterfaceOrientationPortrait"]) { - [result addObject:[NSNumber numberWithInt:UIInterfaceOrientationPortrait]]; - } else if ([orientationString isEqualToString:@"UIInterfaceOrientationPortraitUpsideDown"]) { - [result addObject:[NSNumber numberWithInt:UIInterfaceOrientationPortraitUpsideDown]]; - } else if ([orientationString isEqualToString:@"UIInterfaceOrientationLandscapeLeft"]) { - [result addObject:[NSNumber numberWithInt:UIInterfaceOrientationLandscapeLeft]]; - } else if ([orientationString isEqualToString:@"UIInterfaceOrientationLandscapeRight"]) { - [result addObject:[NSNumber numberWithInt:UIInterfaceOrientationLandscapeRight]]; - } - } - } - - // default - if ([result count] == 0) { - [result addObject:[NSNumber numberWithInt:UIInterfaceOrientationPortrait]]; - } - - return result; -} - -- (BOOL)shouldAutorotate -{ - return YES; -} - -// CB-12098 -#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000 -- (NSUInteger)supportedInterfaceOrientations -#else -- (UIInterfaceOrientationMask)supportedInterfaceOrientations -#endif -{ - NSUInteger ret = 0; - - if ([self supportsOrientation:UIInterfaceOrientationPortrait]) { - ret = ret | (1 << UIInterfaceOrientationPortrait); - } - if ([self supportsOrientation:UIInterfaceOrientationPortraitUpsideDown]) { - ret = ret | (1 << UIInterfaceOrientationPortraitUpsideDown); - } - if ([self supportsOrientation:UIInterfaceOrientationLandscapeRight]) { - ret = ret | (1 << UIInterfaceOrientationLandscapeRight); - } - if ([self supportsOrientation:UIInterfaceOrientationLandscapeLeft]) { - ret = ret | (1 << UIInterfaceOrientationLandscapeLeft); - } - - return ret; -} - -- (BOOL)supportsOrientation:(UIInterfaceOrientation)orientation -{ - return [self.supportedOrientations containsObject:[NSNumber numberWithInt:orientation]]; -} - -- (UIView*)newCordovaViewWithFrame:(CGRect)bounds -{ - NSString* defaultWebViewEngineClass = [self.settings cordovaSettingForKey:@"CordovaDefaultWebViewEngine"]; - NSString* webViewEngineClass = [self.settings cordovaSettingForKey:@"CordovaWebViewEngine"]; - - if (!defaultWebViewEngineClass) { - defaultWebViewEngineClass = @"CDVUIWebViewEngine"; - } - if (!webViewEngineClass) { - webViewEngineClass = defaultWebViewEngineClass; - } - - // Find webViewEngine - if (NSClassFromString(webViewEngineClass)) { - self.webViewEngine = [[NSClassFromString(webViewEngineClass) alloc] initWithFrame:bounds]; - // if a webView engine returns nil (not supported by the current iOS version) or doesn't conform to the protocol, or can't load the request, we use UIWebView - if (!self.webViewEngine || ![self.webViewEngine conformsToProtocol:@protocol(CDVWebViewEngineProtocol)] || ![self.webViewEngine canLoadRequest:[NSURLRequest requestWithURL:self.appUrl]]) { - self.webViewEngine = [[NSClassFromString(defaultWebViewEngineClass) alloc] initWithFrame:bounds]; - } - } else { - self.webViewEngine = [[NSClassFromString(defaultWebViewEngineClass) alloc] initWithFrame:bounds]; - } - - if ([self.webViewEngine isKindOfClass:[CDVPlugin class]]) { - [self registerPlugin:(CDVPlugin*)self.webViewEngine withClassName:webViewEngineClass]; - } - - return self.webViewEngine.engineWebView; -} - -- (NSString*)userAgent -{ - if (_userAgent != nil) { - return _userAgent; - } - - NSString* localBaseUserAgent; - if (self.baseUserAgent != nil) { - localBaseUserAgent = self.baseUserAgent; - } else if ([self.settings cordovaSettingForKey:@"OverrideUserAgent"] != nil) { - localBaseUserAgent = [self.settings cordovaSettingForKey:@"OverrideUserAgent"]; - } else { - localBaseUserAgent = [CDVUserAgentUtil originalUserAgent]; - } - NSString* appendUserAgent = [self.settings cordovaSettingForKey:@"AppendUserAgent"]; - if (appendUserAgent) { - _userAgent = [NSString stringWithFormat:@"%@ %@", localBaseUserAgent, appendUserAgent]; - } else { - // Use our address as a unique number to append to the User-Agent. - _userAgent = localBaseUserAgent; - } - return _userAgent; -} - -- (void)createGapView -{ - CGRect webViewBounds = self.view.bounds; - - webViewBounds.origin = self.view.bounds.origin; - - UIView* view = [self newCordovaViewWithFrame:webViewBounds]; - - view.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight); - [self.view addSubview:view]; - [self.view sendSubviewToBack:view]; -} - -- (void)didReceiveMemoryWarning -{ - // iterate through all the plugin objects, and call hasPendingOperation - // if at least one has a pending operation, we don't call [super didReceiveMemoryWarning] - - NSEnumerator* enumerator = [self.pluginObjects objectEnumerator]; - CDVPlugin* plugin; - - BOOL doPurge = YES; - - while ((plugin = [enumerator nextObject])) { - if (plugin.hasPendingOperation) { - NSLog(@"Plugin '%@' has a pending operation, memory purge is delayed for didReceiveMemoryWarning.", NSStringFromClass([plugin class])); - doPurge = NO; - } - } - - if (doPurge) { - // Releases the view if it doesn't have a superview. - [super didReceiveMemoryWarning]; - } - - // Release any cached data, images, etc. that aren't in use. -} - -#pragma mark CordovaCommands - -- (void)registerPlugin:(CDVPlugin*)plugin withClassName:(NSString*)className -{ - if ([plugin respondsToSelector:@selector(setViewController:)]) { - [plugin setViewController:self]; - } - - if ([plugin respondsToSelector:@selector(setCommandDelegate:)]) { - [plugin setCommandDelegate:_commandDelegate]; - } - - [self.pluginObjects setObject:plugin forKey:className]; - [plugin pluginInitialize]; -} - -- (void)registerPlugin:(CDVPlugin*)plugin withPluginName:(NSString*)pluginName -{ - if ([plugin respondsToSelector:@selector(setViewController:)]) { - [plugin setViewController:self]; - } - - if ([plugin respondsToSelector:@selector(setCommandDelegate:)]) { - [plugin setCommandDelegate:_commandDelegate]; - } - - NSString* className = NSStringFromClass([plugin class]); - [self.pluginObjects setObject:plugin forKey:className]; - [self.pluginsMap setValue:className forKey:[pluginName lowercaseString]]; - [plugin pluginInitialize]; -} - -/** - Returns an instance of a CordovaCommand object, based on its name. If one exists already, it is returned. - */ -- (id)getCommandInstance:(NSString*)pluginName -{ - // first, we try to find the pluginName in the pluginsMap - // (acts as a whitelist as well) if it does not exist, we return nil - // NOTE: plugin names are matched as lowercase to avoid problems - however, a - // possible issue is there can be duplicates possible if you had: - // "org.apache.cordova.Foo" and "org.apache.cordova.foo" - only the lower-cased entry will match - NSString* className = [self.pluginsMap objectForKey:[pluginName lowercaseString]]; - - if (className == nil) { - return nil; - } - - id obj = [self.pluginObjects objectForKey:className]; - if (!obj) { - obj = [[NSClassFromString(className)alloc] initWithWebViewEngine:_webViewEngine]; - if (!obj) { - NSString* fullClassName = [NSString stringWithFormat:@"%@.%@", - NSBundle.mainBundle.infoDictionary[@"CFBundleExecutable"], - className]; - obj = [[NSClassFromString(fullClassName)alloc] initWithWebViewEngine:_webViewEngine]; - } - - if (obj != nil) { - [self registerPlugin:obj withClassName:className]; - } else { - NSLog(@"CDVPlugin class %@ (pluginName: %@) does not exist.", className, pluginName); - } - } - return obj; -} - -#pragma mark - - -- (NSString*)appURLScheme -{ - NSString* URLScheme = nil; - - NSArray* URLTypes = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleURLTypes"]; - - if (URLTypes != nil) { - NSDictionary* dict = [URLTypes objectAtIndex:0]; - if (dict != nil) { - NSArray* URLSchemes = [dict objectForKey:@"CFBundleURLSchemes"]; - if (URLSchemes != nil) { - URLScheme = [URLSchemes objectAtIndex:0]; - } - } - } - - return URLScheme; -} - -#pragma mark - -#pragma mark UIApplicationDelegate impl - -/* - This method lets your application know that it is about to be terminated and purged from memory entirely - */ -- (void)onAppWillTerminate:(NSNotification*)notification -{ - // empty the tmp directory - NSFileManager* fileMgr = [[NSFileManager alloc] init]; - NSError* __autoreleasing err = nil; - - // clear contents of NSTemporaryDirectory - NSString* tempDirectoryPath = NSTemporaryDirectory(); - NSDirectoryEnumerator* directoryEnumerator = [fileMgr enumeratorAtPath:tempDirectoryPath]; - NSString* fileName = nil; - BOOL result; - - while ((fileName = [directoryEnumerator nextObject])) { - NSString* filePath = [tempDirectoryPath stringByAppendingPathComponent:fileName]; - result = [fileMgr removeItemAtPath:filePath error:&err]; - if (!result && err) { - NSLog(@"Failed to delete: %@ (error: %@)", filePath, err); - } - } -} - -- (bool)isUrlEmpty:(NSURL *)url -{ - if (!url || (url == (id) [NSNull null])) { - return true; - } - NSString *urlAsString = [url absoluteString]; - return (urlAsString == (id) [NSNull null] || [urlAsString length]==0 || [urlAsString isEqualToString:@"about:blank"]); -} - -- (bool)checkAndReinitViewUrl -{ - NSURL* appURL = [self appUrl]; - if ([self isUrlEmpty: [self.webViewEngine URL]] && ![self isUrlEmpty: appURL]) { - NSURLRequest* appReq = [NSURLRequest requestWithURL:appURL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:20.0]; - [self.webViewEngine loadRequest:appReq]; - return true; - } - return false; -} - -/* - This method is called to let your application know that it is about to move from the active to inactive state. - You should use this method to pause ongoing tasks, disable timer, ... - */ -- (void)onAppWillResignActive:(NSNotification*)notification -{ - [self checkAndReinitViewUrl]; - // NSLog(@"%@",@"applicationWillResignActive"); - [self.commandDelegate evalJs:@"cordova.fireDocumentEvent('resign');" scheduledOnRunLoop:NO]; -} - -/* - In iOS 4.0 and later, this method is called as part of the transition from the background to the inactive state. - You can use this method to undo many of the changes you made to your application upon entering the background. - invariably followed by applicationDidBecomeActive - */ -- (void)onAppWillEnterForeground:(NSNotification*)notification -{ - [self checkAndReinitViewUrl]; - // NSLog(@"%@",@"applicationWillEnterForeground"); - [self.commandDelegate evalJs:@"cordova.fireDocumentEvent('resume');"]; - - if (!IsAtLeastiOSVersion(@"11.0")) { - /** Clipboard fix **/ - UIPasteboard* pasteboard = [UIPasteboard generalPasteboard]; - NSString* string = pasteboard.string; - if (string) { - [pasteboard setValue:string forPasteboardType:@"public.text"]; - } - } -} - -// This method is called to let your application know that it moved from the inactive to active state. -- (void)onAppDidBecomeActive:(NSNotification*)notification -{ - [self checkAndReinitViewUrl]; - // NSLog(@"%@",@"applicationDidBecomeActive"); - [self.commandDelegate evalJs:@"cordova.fireDocumentEvent('active');"]; -} - -/* - In iOS 4.0 and later, this method is called instead of the applicationWillTerminate: method - when the user quits an application that supports background execution. - */ -- (void)onAppDidEnterBackground:(NSNotification*)notification -{ - [self checkAndReinitViewUrl]; - // NSLog(@"%@",@"applicationDidEnterBackground"); - [self.commandDelegate evalJs:@"cordova.fireDocumentEvent('pause', null, true);" scheduledOnRunLoop:NO]; -} - -// /////////////////////// - -- (void)dealloc -{ - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - [CDVUserAgentUtil releaseLock:&_userAgentLockToken]; - [_commandQueue dispose]; - [[self.pluginObjects allValues] makeObjectsPerformSelector:@selector(dispose)]; - - [self.webViewEngine loadHTMLString:@"about:blank" baseURL:nil]; - [self.pluginObjects removeAllObjects]; - [self.webView removeFromSuperview]; - self.webViewEngine = nil; -} - -- (NSInteger*)userAgentLockToken -{ - return &_userAgentLockToken; -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVWebViewEngineProtocol.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVWebViewEngineProtocol.h deleted file mode 100644 index 34d07f3..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVWebViewEngineProtocol.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import - -#define kCDVWebViewEngineScriptMessageHandlers @"kCDVWebViewEngineScriptMessageHandlers" -#define kCDVWebViewEngineUIWebViewDelegate @"kCDVWebViewEngineUIWebViewDelegate" -#define kCDVWebViewEngineWKNavigationDelegate @"kCDVWebViewEngineWKNavigationDelegate" -#define kCDVWebViewEngineWKUIDelegate @"kCDVWebViewEngineWKUIDelegate" -#define kCDVWebViewEngineWebViewPreferences @"kCDVWebViewEngineWebViewPreferences" - -@protocol CDVWebViewEngineProtocol - -@property (nonatomic, strong, readonly) UIView* engineWebView; - -- (id)loadRequest:(NSURLRequest*)request; -- (id)loadHTMLString:(NSString*)string baseURL:(NSURL*)baseURL; -- (void)evaluateJavaScript:(NSString*)javaScriptString completionHandler:(void (^)(id, NSError*))completionHandler; - -- (NSURL*)URL; -- (BOOL)canLoadRequest:(NSURLRequest*)request; - -- (instancetype)initWithFrame:(CGRect)frame; -- (void)updateWithInfo:(NSDictionary*)info; - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVWhitelist.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVWhitelist.h deleted file mode 100644 index 9165097..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVWhitelist.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import - -extern NSString* const kCDVDefaultWhitelistRejectionString; - -@interface CDVWhitelist : NSObject - -@property (nonatomic, copy) NSString* whitelistRejectionFormatString; - -- (id)initWithArray:(NSArray*)array; -- (BOOL)schemeIsAllowed:(NSString*)scheme; -- (BOOL)URLIsAllowed:(NSURL*)url; -- (BOOL)URLIsAllowed:(NSURL*)url logFailure:(BOOL)logFailure; -- (NSString*)errorStringForURL:(NSURL*)url; - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVWhitelist.m b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVWhitelist.m deleted file mode 100644 index 758f4d1..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/CDVWhitelist.m +++ /dev/null @@ -1,285 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "CDVWhitelist.h" - -NSString* const kCDVDefaultWhitelistRejectionString = @"ERROR whitelist rejection: url='%@'"; -NSString* const kCDVDefaultSchemeName = @"cdv-default-scheme"; - -@interface CDVWhitelistPattern : NSObject { - @private - NSRegularExpression* _scheme; - NSRegularExpression* _host; - NSNumber* _port; - NSRegularExpression* _path; -} - -+ (NSString*)regexFromPattern:(NSString*)pattern allowWildcards:(bool)allowWildcards; -- (id)initWithScheme:(NSString*)scheme host:(NSString*)host port:(NSString*)port path:(NSString*)path; -- (bool)matches:(NSURL*)url; - -@end - -@implementation CDVWhitelistPattern - -+ (NSString*)regexFromPattern:(NSString*)pattern allowWildcards:(bool)allowWildcards -{ - NSString* regex = [NSRegularExpression escapedPatternForString:pattern]; - - if (allowWildcards) { - regex = [regex stringByReplacingOccurrencesOfString:@"\\*" withString:@".*"]; - - /* [NSURL path] has the peculiarity that a trailing slash at the end of a path - * will be omitted. This regex tweak compensates for that. - */ - if ([regex hasSuffix:@"\\/.*"]) { - regex = [NSString stringWithFormat:@"%@(\\/.*)?", [regex substringToIndex:([regex length] - 4)]]; - } - } - return [NSString stringWithFormat:@"%@$", regex]; -} - -- (id)initWithScheme:(NSString*)scheme host:(NSString*)host port:(NSString*)port path:(NSString*)path -{ - self = [super init]; // Potentially change "self" - if (self) { - if ((scheme == nil) || [scheme isEqualToString:@"*"]) { - _scheme = nil; - } else { - _scheme = [NSRegularExpression regularExpressionWithPattern:[CDVWhitelistPattern regexFromPattern:scheme allowWildcards:NO] options:NSRegularExpressionCaseInsensitive error:nil]; - } - if ([host isEqualToString:@"*"] || host == nil) { - _host = nil; - } else if ([host hasPrefix:@"*."]) { - _host = [NSRegularExpression regularExpressionWithPattern:[NSString stringWithFormat:@"([a-z0-9.-]*\\.)?%@", [CDVWhitelistPattern regexFromPattern:[host substringFromIndex:2] allowWildcards:false]] options:NSRegularExpressionCaseInsensitive error:nil]; - } else { - _host = [NSRegularExpression regularExpressionWithPattern:[CDVWhitelistPattern regexFromPattern:host allowWildcards:NO] options:NSRegularExpressionCaseInsensitive error:nil]; - } - if ((port == nil) || [port isEqualToString:@"*"]) { - _port = nil; - } else { - _port = [[NSNumber alloc] initWithInteger:[port integerValue]]; - } - if ((path == nil) || [path isEqualToString:@"/*"]) { - _path = nil; - } else { - _path = [NSRegularExpression regularExpressionWithPattern:[CDVWhitelistPattern regexFromPattern:path allowWildcards:YES] options:0 error:nil]; - } - } - return self; -} - -- (bool)matches:(NSURL*)url -{ - return (_scheme == nil || [_scheme numberOfMatchesInString:[url scheme] options:NSMatchingAnchored range:NSMakeRange(0, [[url scheme] length])]) && - (_host == nil || ([url host] != nil && [_host numberOfMatchesInString:[url host] options:NSMatchingAnchored range:NSMakeRange(0, [[url host] length])])) && - (_port == nil || [[url port] isEqualToNumber:_port]) && - (_path == nil || [_path numberOfMatchesInString:[url path] options:NSMatchingAnchored range:NSMakeRange(0, [[url path] length])]) - ; -} - -@end - -@interface CDVWhitelist () - -@property (nonatomic, readwrite, strong) NSMutableArray* whitelist; -@property (nonatomic, readwrite, strong) NSMutableSet* permittedSchemes; - -- (void)addWhiteListEntry:(NSString*)pattern; - -@end - -@implementation CDVWhitelist - -@synthesize whitelist, permittedSchemes, whitelistRejectionFormatString; - -- (id)initWithArray:(NSArray*)array -{ - self = [super init]; - if (self) { - self.whitelist = [[NSMutableArray alloc] init]; - self.permittedSchemes = [[NSMutableSet alloc] init]; - self.whitelistRejectionFormatString = kCDVDefaultWhitelistRejectionString; - - for (NSString* pattern in array) { - [self addWhiteListEntry:pattern]; - } - } - return self; -} - -- (BOOL)isIPv4Address:(NSString*)externalHost -{ - // an IPv4 address has 4 octets b.b.b.b where b is a number between 0 and 255. - // for our purposes, b can also be the wildcard character '*' - - // we could use a regex to solve this problem but then I would have two problems - // anyways, this is much clearer and maintainable - NSArray* octets = [externalHost componentsSeparatedByString:@"."]; - NSUInteger num_octets = [octets count]; - - // quick check - if (num_octets != 4) { - return NO; - } - - // restrict number parsing to 0-255 - NSNumberFormatter* numberFormatter = [[NSNumberFormatter alloc] init]; - [numberFormatter setMinimum:[NSNumber numberWithUnsignedInteger:0]]; - [numberFormatter setMaximum:[NSNumber numberWithUnsignedInteger:255]]; - - // iterate through each octet, and test for a number between 0-255 or if it equals '*' - for (NSUInteger i = 0; i < num_octets; ++i) { - NSString* octet = [octets objectAtIndex:i]; - - if ([octet isEqualToString:@"*"]) { // passes - check next octet - continue; - } else if ([numberFormatter numberFromString:octet] == nil) { // fails - not a number and not within our range, return - return NO; - } - } - - return YES; -} - -- (void)addWhiteListEntry:(NSString*)origin -{ - if (self.whitelist == nil) { - return; - } - - if ([origin isEqualToString:@"*"]) { - NSLog(@"Unlimited access to network resources"); - self.whitelist = nil; - self.permittedSchemes = nil; - } else { // specific access - NSRegularExpression* parts = [NSRegularExpression regularExpressionWithPattern:@"^((\\*|[A-Za-z-]+):/?/?)?(((\\*\\.)?[^*/:]+)|\\*)?(:(\\d+))?(/.*)?" options:0 error:nil]; - NSTextCheckingResult* m = [parts firstMatchInString:origin options:NSMatchingAnchored range:NSMakeRange(0, [origin length])]; - if (m != nil) { - NSRange r; - NSString* scheme = nil; - r = [m rangeAtIndex:2]; - if (r.location != NSNotFound) { - scheme = [origin substringWithRange:r]; - } - - NSString* host = nil; - r = [m rangeAtIndex:3]; - if (r.location != NSNotFound) { - host = [origin substringWithRange:r]; - } - - // Special case for two urls which are allowed to have empty hosts - if (([scheme isEqualToString:@"file"] || [scheme isEqualToString:@"content"]) && (host == nil)) { - host = @"*"; - } - - NSString* port = nil; - r = [m rangeAtIndex:7]; - if (r.location != NSNotFound) { - port = [origin substringWithRange:r]; - } - - NSString* path = nil; - r = [m rangeAtIndex:8]; - if (r.location != NSNotFound) { - path = [origin substringWithRange:r]; - } - - if (scheme == nil) { - // XXX making it stupid friendly for people who forget to include protocol/SSL - [self.whitelist addObject:[[CDVWhitelistPattern alloc] initWithScheme:@"http" host:host port:port path:path]]; - [self.whitelist addObject:[[CDVWhitelistPattern alloc] initWithScheme:@"https" host:host port:port path:path]]; - } else { - [self.whitelist addObject:[[CDVWhitelistPattern alloc] initWithScheme:scheme host:host port:port path:path]]; - } - - if (self.permittedSchemes != nil) { - if ([scheme isEqualToString:@"*"]) { - self.permittedSchemes = nil; - } else if (scheme != nil) { - [self.permittedSchemes addObject:scheme]; - } - } - } - } -} - -- (BOOL)schemeIsAllowed:(NSString*)scheme -{ - if ([scheme isEqualToString:@"http"] || - [scheme isEqualToString:@"https"] || - [scheme isEqualToString:@"ftp"] || - [scheme isEqualToString:@"ftps"]) { - return YES; - } - - return (self.permittedSchemes == nil) || [self.permittedSchemes containsObject:scheme]; -} - -- (BOOL)URLIsAllowed:(NSURL*)url -{ - return [self URLIsAllowed:url logFailure:YES]; -} - -- (BOOL)URLIsAllowed:(NSURL*)url logFailure:(BOOL)logFailure -{ - // Shortcut acceptance: Are all urls whitelisted ("*" in whitelist)? - if (whitelist == nil) { - return YES; - } - - // Shortcut rejection: Check that the scheme is supported - NSString* scheme = [[url scheme] lowercaseString]; - if (![self schemeIsAllowed:scheme]) { - if (logFailure) { - NSLog(@"%@", [self errorStringForURL:url]); - } - return NO; - } - - // http[s] and ftp[s] should also validate against the common set in the kCDVDefaultSchemeName list - if ([scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"] || [scheme isEqualToString:@"ftp"] || [scheme isEqualToString:@"ftps"]) { - NSURL* newUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@://%@%@", kCDVDefaultSchemeName, [url host], [[url path] stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLPathAllowedCharacterSet]]]; - // If it is allowed, we are done. If not, continue to check for the actual scheme-specific list - if ([self URLIsAllowed:newUrl logFailure:NO]) { - return YES; - } - } - - // Check the url against patterns in the whitelist - for (CDVWhitelistPattern* p in self.whitelist) { - if ([p matches:url]) { - return YES; - } - } - - if (logFailure) { - NSLog(@"%@", [self errorStringForURL:url]); - } - // if we got here, the url host is not in the white-list, do nothing - return NO; -} - -- (NSString*)errorStringForURL:(NSURL*)url -{ - return [NSString stringWithFormat:self.whitelistRejectionFormatString, [url absoluteString]]; -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/NSDictionary+CordovaPreferences.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/NSDictionary+CordovaPreferences.h deleted file mode 100644 index 9be2be2..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/NSDictionary+CordovaPreferences.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import -#import - -@interface NSDictionary (CordovaPreferences) - -- (id)cordovaSettingForKey:(NSString*)key; -- (BOOL)cordovaBoolSettingForKey:(NSString*)key defaultValue:(BOOL)defaultValue; -- (CGFloat)cordovaFloatSettingForKey:(NSString*)key defaultValue:(CGFloat)defaultValue; - -@end - -@interface NSMutableDictionary (CordovaPreferences) - -- (void)setCordovaSetting:(id)value forKey:(NSString*)key; - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/NSDictionary+CordovaPreferences.m b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/NSDictionary+CordovaPreferences.m deleted file mode 100644 index dcac40f..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/NSDictionary+CordovaPreferences.m +++ /dev/null @@ -1,63 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "NSDictionary+CordovaPreferences.h" -#import - -@implementation NSDictionary (CordovaPreferences) - -- (id)cordovaSettingForKey:(NSString*)key -{ - return [self objectForKey:[key lowercaseString]]; -} - -- (BOOL)cordovaBoolSettingForKey:(NSString*)key defaultValue:(BOOL)defaultValue -{ - BOOL value = defaultValue; - id prefObj = [self cordovaSettingForKey:key]; - - if (prefObj != nil) { - value = [(NSNumber*)prefObj boolValue]; - } - - return value; -} - -- (CGFloat)cordovaFloatSettingForKey:(NSString*)key defaultValue:(CGFloat)defaultValue -{ - CGFloat value = defaultValue; - id prefObj = [self cordovaSettingForKey:key]; - - if (prefObj != nil) { - value = [prefObj floatValue]; - } - - return value; -} - -@end - -@implementation NSMutableDictionary (CordovaPreferences) - -- (void)setCordovaSetting:(id)value forKey:(NSString*)key -{ - [self setObject:value forKey:[key lowercaseString]]; -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/NSMutableArray+QueueAdditions.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/NSMutableArray+QueueAdditions.h deleted file mode 100644 index 79e6516..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/NSMutableArray+QueueAdditions.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import - -@interface NSMutableArray (QueueAdditions) - -- (id)cdv_pop; -- (id)cdv_queueHead; -- (id)cdv_dequeue; -- (void)cdv_enqueue:(id)obj; - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/NSMutableArray+QueueAdditions.m b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/NSMutableArray+QueueAdditions.m deleted file mode 100644 index 2b3acdc..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Classes/Public/NSMutableArray+QueueAdditions.m +++ /dev/null @@ -1,58 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "NSMutableArray+QueueAdditions.h" - -@implementation NSMutableArray (QueueAdditions) - -- (id)cdv_queueHead -{ - if ([self count] == 0) { - return nil; - } - - return [self objectAtIndex:0]; -} - -- (__autoreleasing id)cdv_dequeue -{ - if ([self count] == 0) { - return nil; - } - - id head = [self objectAtIndex:0]; - if (head != nil) { - // [[head retain] autorelease]; ARC - the __autoreleasing on the return value should so the same thing - [self removeObjectAtIndex:0]; - } - - return head; -} - -- (id)cdv_pop -{ - return [self cdv_dequeue]; -} - -- (void)cdv_enqueue:(id)object -{ - [self addObject:object]; -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Cordova/Cordova.h b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Cordova/Cordova.h deleted file mode 100644 index 8f31077..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Cordova/Cordova.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import - -//! Project version number for Cordova. -FOUNDATION_EXPORT double CordovaVersionNumber; - -//! Project version string for Cordova. -FOUNDATION_EXPORT const unsigned char CordovaVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import - -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Cordova/Info.plist b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Cordova/Info.plist deleted file mode 100644 index fbe1e6b..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/Cordova/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - NSPrincipalClass - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj deleted file mode 100644 index cb67163..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj +++ /dev/null @@ -1,793 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 48; - objects = { - -/* Begin PBXBuildFile section */ - 28BFF9141F355A4E00DDF01A /* CDVLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 28BFF9121F355A4E00DDF01A /* CDVLogger.h */; }; - 28BFF9151F355A4E00DDF01A /* CDVLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 28BFF9131F355A4E00DDF01A /* CDVLogger.m */; }; - 30193A501AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 30193A4E1AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.m */; }; - 30193A511AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 30193A4F1AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.h */; }; - 3093E2231B16D6A3003F381A /* CDVIntentAndNavigationFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3093E2211B16D6A3003F381A /* CDVIntentAndNavigationFilter.h */; }; - 3093E2241B16D6A3003F381A /* CDVIntentAndNavigationFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 3093E2221B16D6A3003F381A /* CDVIntentAndNavigationFilter.m */; }; - 7E7F69B61ABA35D8007546F4 /* CDVLocalStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CFB1AB9028C008C4574 /* CDVLocalStorage.h */; }; - 7E7F69B81ABA368F007546F4 /* CDVUIWebViewEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D001AB9028C008C4574 /* CDVUIWebViewEngine.h */; }; - 7E7F69B91ABA3692007546F4 /* CDVHandleOpenURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF81AB9028C008C4574 /* CDVHandleOpenURL.h */; }; - 7ED95D021AB9028C008C4574 /* CDVDebug.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF21AB9028C008C4574 /* CDVDebug.h */; }; - 7ED95D031AB9028C008C4574 /* CDVJSON_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF31AB9028C008C4574 /* CDVJSON_private.h */; }; - 7ED95D041AB9028C008C4574 /* CDVJSON_private.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CF41AB9028C008C4574 /* CDVJSON_private.m */; }; - 7ED95D051AB9028C008C4574 /* CDVPlugin+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF51AB9028C008C4574 /* CDVPlugin+Private.h */; }; - 7ED95D071AB9028C008C4574 /* CDVHandleOpenURL.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CF91AB9028C008C4574 /* CDVHandleOpenURL.m */; }; - 7ED95D091AB9028C008C4574 /* CDVLocalStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CFC1AB9028C008C4574 /* CDVLocalStorage.m */; }; - 7ED95D0A1AB9028C008C4574 /* CDVUIWebViewDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CFE1AB9028C008C4574 /* CDVUIWebViewDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D0B1AB9028C008C4574 /* CDVUIWebViewDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CFF1AB9028C008C4574 /* CDVUIWebViewDelegate.m */; }; - 7ED95D0D1AB9028C008C4574 /* CDVUIWebViewEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D011AB9028C008C4574 /* CDVUIWebViewEngine.m */; }; - 7ED95D351AB9029B008C4574 /* CDV.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D0F1AB9029B008C4574 /* CDV.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D361AB9029B008C4574 /* CDVAppDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D101AB9029B008C4574 /* CDVAppDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D371AB9029B008C4574 /* CDVAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D111AB9029B008C4574 /* CDVAppDelegate.m */; }; - 7ED95D381AB9029B008C4574 /* CDVAvailability.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D121AB9029B008C4574 /* CDVAvailability.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D391AB9029B008C4574 /* CDVAvailabilityDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D131AB9029B008C4574 /* CDVAvailabilityDeprecated.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D3A1AB9029B008C4574 /* CDVCommandDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D141AB9029B008C4574 /* CDVCommandDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D3B1AB9029B008C4574 /* CDVCommandDelegateImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D151AB9029B008C4574 /* CDVCommandDelegateImpl.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D3C1AB9029B008C4574 /* CDVCommandDelegateImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D161AB9029B008C4574 /* CDVCommandDelegateImpl.m */; }; - 7ED95D3D1AB9029B008C4574 /* CDVCommandQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D171AB9029B008C4574 /* CDVCommandQueue.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D3E1AB9029B008C4574 /* CDVCommandQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D181AB9029B008C4574 /* CDVCommandQueue.m */; }; - 7ED95D3F1AB9029B008C4574 /* CDVConfigParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D191AB9029B008C4574 /* CDVConfigParser.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D401AB9029B008C4574 /* CDVConfigParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D1A1AB9029B008C4574 /* CDVConfigParser.m */; }; - 7ED95D411AB9029B008C4574 /* CDVInvokedUrlCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D1B1AB9029B008C4574 /* CDVInvokedUrlCommand.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D421AB9029B008C4574 /* CDVInvokedUrlCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D1C1AB9029B008C4574 /* CDVInvokedUrlCommand.m */; }; - 7ED95D431AB9029B008C4574 /* CDVPlugin+Resources.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D1D1AB9029B008C4574 /* CDVPlugin+Resources.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D441AB9029B008C4574 /* CDVPlugin+Resources.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D1E1AB9029B008C4574 /* CDVPlugin+Resources.m */; }; - 7ED95D451AB9029B008C4574 /* CDVPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D1F1AB9029B008C4574 /* CDVPlugin.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D461AB9029B008C4574 /* CDVPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D201AB9029B008C4574 /* CDVPlugin.m */; }; - 7ED95D471AB9029B008C4574 /* CDVPluginResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D211AB9029B008C4574 /* CDVPluginResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D481AB9029B008C4574 /* CDVPluginResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D221AB9029B008C4574 /* CDVPluginResult.m */; }; - 7ED95D491AB9029B008C4574 /* CDVScreenOrientationDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D231AB9029B008C4574 /* CDVScreenOrientationDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D4A1AB9029B008C4574 /* CDVTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D241AB9029B008C4574 /* CDVTimer.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D4B1AB9029B008C4574 /* CDVTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D251AB9029B008C4574 /* CDVTimer.m */; }; - 7ED95D4C1AB9029B008C4574 /* CDVURLProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D261AB9029B008C4574 /* CDVURLProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D4D1AB9029B008C4574 /* CDVURLProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D271AB9029B008C4574 /* CDVURLProtocol.m */; }; - 7ED95D4E1AB9029B008C4574 /* CDVUserAgentUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D281AB9029B008C4574 /* CDVUserAgentUtil.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D4F1AB9029B008C4574 /* CDVUserAgentUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D291AB9029B008C4574 /* CDVUserAgentUtil.m */; }; - 7ED95D501AB9029B008C4574 /* CDVViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2A1AB9029B008C4574 /* CDVViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D511AB9029B008C4574 /* CDVViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D2B1AB9029B008C4574 /* CDVViewController.m */; }; - 7ED95D521AB9029B008C4574 /* CDVWebViewEngineProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2C1AB9029B008C4574 /* CDVWebViewEngineProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D531AB9029B008C4574 /* CDVWhitelist.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2D1AB9029B008C4574 /* CDVWhitelist.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D541AB9029B008C4574 /* CDVWhitelist.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D2E1AB9029B008C4574 /* CDVWhitelist.m */; }; - 7ED95D571AB9029B008C4574 /* NSDictionary+CordovaPreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D311AB9029B008C4574 /* NSDictionary+CordovaPreferences.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D581AB9029B008C4574 /* NSDictionary+CordovaPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D321AB9029B008C4574 /* NSDictionary+CordovaPreferences.m */; }; - 7ED95D591AB9029B008C4574 /* NSMutableArray+QueueAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D331AB9029B008C4574 /* NSMutableArray+QueueAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D5A1AB9029B008C4574 /* NSMutableArray+QueueAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D341AB9029B008C4574 /* NSMutableArray+QueueAdditions.m */; }; - 9052DE712150D040008E83D4 /* CDVAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D111AB9029B008C4574 /* CDVAppDelegate.m */; }; - 9052DE722150D040008E83D4 /* CDVCommandDelegateImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D161AB9029B008C4574 /* CDVCommandDelegateImpl.m */; }; - 9052DE732150D040008E83D4 /* CDVCommandQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D181AB9029B008C4574 /* CDVCommandQueue.m */; }; - 9052DE742150D040008E83D4 /* CDVConfigParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D1A1AB9029B008C4574 /* CDVConfigParser.m */; }; - 9052DE752150D040008E83D4 /* CDVInvokedUrlCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D1C1AB9029B008C4574 /* CDVInvokedUrlCommand.m */; }; - 9052DE762150D040008E83D4 /* CDVPlugin+Resources.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D1E1AB9029B008C4574 /* CDVPlugin+Resources.m */; }; - 9052DE772150D040008E83D4 /* CDVPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D201AB9029B008C4574 /* CDVPlugin.m */; }; - 9052DE782150D040008E83D4 /* CDVPluginResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D221AB9029B008C4574 /* CDVPluginResult.m */; }; - 9052DE792150D040008E83D4 /* CDVTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D251AB9029B008C4574 /* CDVTimer.m */; }; - 9052DE7A2150D040008E83D4 /* CDVURLProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D271AB9029B008C4574 /* CDVURLProtocol.m */; }; - 9052DE7B2150D040008E83D4 /* CDVUserAgentUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D291AB9029B008C4574 /* CDVUserAgentUtil.m */; }; - 9052DE7C2150D040008E83D4 /* CDVViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D2B1AB9029B008C4574 /* CDVViewController.m */; }; - 9052DE7D2150D040008E83D4 /* CDVWhitelist.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D2E1AB9029B008C4574 /* CDVWhitelist.m */; }; - 9052DE7E2150D040008E83D4 /* NSDictionary+CordovaPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D321AB9029B008C4574 /* NSDictionary+CordovaPreferences.m */; }; - 9052DE7F2150D040008E83D4 /* NSMutableArray+QueueAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D341AB9029B008C4574 /* NSMutableArray+QueueAdditions.m */; }; - 9052DE802150D040008E83D4 /* CDVJSON_private.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CF41AB9028C008C4574 /* CDVJSON_private.m */; }; - 9052DE812150D040008E83D4 /* CDVLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 28BFF9131F355A4E00DDF01A /* CDVLogger.m */; }; - 9052DE822150D040008E83D4 /* CDVGestureHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = A3B082D31BB15CEA00D8DC35 /* CDVGestureHandler.m */; }; - 9052DE832150D040008E83D4 /* CDVIntentAndNavigationFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 3093E2221B16D6A3003F381A /* CDVIntentAndNavigationFilter.m */; }; - 9052DE842150D040008E83D4 /* CDVHandleOpenURL.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CF91AB9028C008C4574 /* CDVHandleOpenURL.m */; }; - 9052DE852150D040008E83D4 /* CDVLocalStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CFC1AB9028C008C4574 /* CDVLocalStorage.m */; }; - 9052DE862150D040008E83D4 /* CDVUIWebViewNavigationDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 30193A4E1AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.m */; }; - 9052DE872150D040008E83D4 /* CDVUIWebViewDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CFF1AB9028C008C4574 /* CDVUIWebViewDelegate.m */; }; - 9052DE882150D040008E83D4 /* CDVUIWebViewEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D011AB9028C008C4574 /* CDVUIWebViewEngine.m */; }; - 9052DE892150D06B008E83D4 /* CDVDebug.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF21AB9028C008C4574 /* CDVDebug.h */; }; - 9052DE8A2150D06B008E83D4 /* CDVJSON_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF31AB9028C008C4574 /* CDVJSON_private.h */; }; - 9052DE8B2150D06B008E83D4 /* CDVPlugin+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF51AB9028C008C4574 /* CDVPlugin+Private.h */; }; - 9052DE8C2150D06B008E83D4 /* CDVLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 28BFF9121F355A4E00DDF01A /* CDVLogger.h */; }; - 9052DE8D2150D06B008E83D4 /* CDVGestureHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = A3B082D21BB15CEA00D8DC35 /* CDVGestureHandler.h */; }; - 9052DE8E2150D06B008E83D4 /* CDVIntentAndNavigationFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3093E2211B16D6A3003F381A /* CDVIntentAndNavigationFilter.h */; }; - 9052DE8F2150D06B008E83D4 /* CDVHandleOpenURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF81AB9028C008C4574 /* CDVHandleOpenURL.h */; }; - 9052DE902150D06B008E83D4 /* CDVLocalStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CFB1AB9028C008C4574 /* CDVLocalStorage.h */; }; - 9052DE912150D06B008E83D4 /* CDVUIWebViewNavigationDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 30193A4F1AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.h */; }; - 9052DE922150D06B008E83D4 /* CDVUIWebViewEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D001AB9028C008C4574 /* CDVUIWebViewEngine.h */; }; - A3B082D41BB15CEA00D8DC35 /* CDVGestureHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = A3B082D21BB15CEA00D8DC35 /* CDVGestureHandler.h */; }; - A3B082D51BB15CEA00D8DC35 /* CDVGestureHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = A3B082D31BB15CEA00D8DC35 /* CDVGestureHandler.m */; }; - C0C01EB61E3911D50056E6CB /* Cordova.h in Headers */ = {isa = PBXBuildFile; fileRef = C0C01EB41E3911D50056E6CB /* Cordova.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01EBB1E39131A0056E6CB /* CDV.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D0F1AB9029B008C4574 /* CDV.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01EBC1E39131A0056E6CB /* CDVAppDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D101AB9029B008C4574 /* CDVAppDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01EBD1E39131A0056E6CB /* CDVAvailability.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D121AB9029B008C4574 /* CDVAvailability.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01EBE1E39131A0056E6CB /* CDVAvailabilityDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D131AB9029B008C4574 /* CDVAvailabilityDeprecated.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01EBF1E39131A0056E6CB /* CDVCommandDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D141AB9029B008C4574 /* CDVCommandDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01EC01E39131A0056E6CB /* CDVCommandDelegateImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D151AB9029B008C4574 /* CDVCommandDelegateImpl.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01EC11E39131A0056E6CB /* CDVCommandQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D171AB9029B008C4574 /* CDVCommandQueue.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01EC21E39131A0056E6CB /* CDVConfigParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D191AB9029B008C4574 /* CDVConfigParser.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01EC31E39131A0056E6CB /* CDVInvokedUrlCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D1B1AB9029B008C4574 /* CDVInvokedUrlCommand.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01EC41E39131A0056E6CB /* CDVPlugin+Resources.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D1D1AB9029B008C4574 /* CDVPlugin+Resources.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01EC51E39131A0056E6CB /* CDVPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D1F1AB9029B008C4574 /* CDVPlugin.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01EC61E39131A0056E6CB /* CDVPluginResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D211AB9029B008C4574 /* CDVPluginResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01EC71E39131A0056E6CB /* CDVScreenOrientationDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D231AB9029B008C4574 /* CDVScreenOrientationDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01EC81E39131A0056E6CB /* CDVTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D241AB9029B008C4574 /* CDVTimer.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01EC91E39131A0056E6CB /* CDVURLProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D261AB9029B008C4574 /* CDVURLProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01ECA1E39131A0056E6CB /* CDVUserAgentUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D281AB9029B008C4574 /* CDVUserAgentUtil.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01ECB1E39131A0056E6CB /* CDVViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2A1AB9029B008C4574 /* CDVViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01ECC1E39131A0056E6CB /* CDVWebViewEngineProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2C1AB9029B008C4574 /* CDVWebViewEngineProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01ECD1E39131A0056E6CB /* CDVWhitelist.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2D1AB9029B008C4574 /* CDVWhitelist.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01ECE1E39131A0056E6CB /* NSDictionary+CordovaPreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D311AB9029B008C4574 /* NSDictionary+CordovaPreferences.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01ECF1E39131A0056E6CB /* NSMutableArray+QueueAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D331AB9029B008C4574 /* NSMutableArray+QueueAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01ED01E3913610056E6CB /* CDVUIWebViewDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CFE1AB9028C008C4574 /* CDVUIWebViewDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 28BFF9121F355A4E00DDF01A /* CDVLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVLogger.h; sourceTree = ""; }; - 28BFF9131F355A4E00DDF01A /* CDVLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVLogger.m; sourceTree = ""; }; - 30193A4E1AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVUIWebViewNavigationDelegate.m; sourceTree = ""; }; - 30193A4F1AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVUIWebViewNavigationDelegate.h; sourceTree = ""; }; - 3093E2211B16D6A3003F381A /* CDVIntentAndNavigationFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVIntentAndNavigationFilter.h; sourceTree = ""; }; - 3093E2221B16D6A3003F381A /* CDVIntentAndNavigationFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVIntentAndNavigationFilter.m; sourceTree = ""; }; - 68A32D7114102E1C006B237C /* libCordova.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCordova.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 7ED95CF21AB9028C008C4574 /* CDVDebug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVDebug.h; sourceTree = ""; }; - 7ED95CF31AB9028C008C4574 /* CDVJSON_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVJSON_private.h; sourceTree = ""; }; - 7ED95CF41AB9028C008C4574 /* CDVJSON_private.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVJSON_private.m; sourceTree = ""; }; - 7ED95CF51AB9028C008C4574 /* CDVPlugin+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CDVPlugin+Private.h"; sourceTree = ""; }; - 7ED95CF81AB9028C008C4574 /* CDVHandleOpenURL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVHandleOpenURL.h; sourceTree = ""; }; - 7ED95CF91AB9028C008C4574 /* CDVHandleOpenURL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVHandleOpenURL.m; sourceTree = ""; }; - 7ED95CFB1AB9028C008C4574 /* CDVLocalStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVLocalStorage.h; sourceTree = ""; }; - 7ED95CFC1AB9028C008C4574 /* CDVLocalStorage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVLocalStorage.m; sourceTree = ""; }; - 7ED95CFE1AB9028C008C4574 /* CDVUIWebViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVUIWebViewDelegate.h; sourceTree = ""; }; - 7ED95CFF1AB9028C008C4574 /* CDVUIWebViewDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVUIWebViewDelegate.m; sourceTree = ""; }; - 7ED95D001AB9028C008C4574 /* CDVUIWebViewEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVUIWebViewEngine.h; sourceTree = ""; }; - 7ED95D011AB9028C008C4574 /* CDVUIWebViewEngine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVUIWebViewEngine.m; sourceTree = ""; }; - 7ED95D0F1AB9029B008C4574 /* CDV.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDV.h; sourceTree = ""; }; - 7ED95D101AB9029B008C4574 /* CDVAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVAppDelegate.h; sourceTree = ""; }; - 7ED95D111AB9029B008C4574 /* CDVAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVAppDelegate.m; sourceTree = ""; }; - 7ED95D121AB9029B008C4574 /* CDVAvailability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVAvailability.h; sourceTree = ""; }; - 7ED95D131AB9029B008C4574 /* CDVAvailabilityDeprecated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVAvailabilityDeprecated.h; sourceTree = ""; }; - 7ED95D141AB9029B008C4574 /* CDVCommandDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVCommandDelegate.h; sourceTree = ""; }; - 7ED95D151AB9029B008C4574 /* CDVCommandDelegateImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVCommandDelegateImpl.h; sourceTree = ""; }; - 7ED95D161AB9029B008C4574 /* CDVCommandDelegateImpl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVCommandDelegateImpl.m; sourceTree = ""; }; - 7ED95D171AB9029B008C4574 /* CDVCommandQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVCommandQueue.h; sourceTree = ""; }; - 7ED95D181AB9029B008C4574 /* CDVCommandQueue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVCommandQueue.m; sourceTree = ""; }; - 7ED95D191AB9029B008C4574 /* CDVConfigParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVConfigParser.h; sourceTree = ""; }; - 7ED95D1A1AB9029B008C4574 /* CDVConfigParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVConfigParser.m; sourceTree = ""; }; - 7ED95D1B1AB9029B008C4574 /* CDVInvokedUrlCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVInvokedUrlCommand.h; sourceTree = ""; }; - 7ED95D1C1AB9029B008C4574 /* CDVInvokedUrlCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVInvokedUrlCommand.m; sourceTree = ""; }; - 7ED95D1D1AB9029B008C4574 /* CDVPlugin+Resources.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CDVPlugin+Resources.h"; sourceTree = ""; }; - 7ED95D1E1AB9029B008C4574 /* CDVPlugin+Resources.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CDVPlugin+Resources.m"; sourceTree = ""; }; - 7ED95D1F1AB9029B008C4574 /* CDVPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVPlugin.h; sourceTree = ""; }; - 7ED95D201AB9029B008C4574 /* CDVPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVPlugin.m; sourceTree = ""; }; - 7ED95D211AB9029B008C4574 /* CDVPluginResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVPluginResult.h; sourceTree = ""; }; - 7ED95D221AB9029B008C4574 /* CDVPluginResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVPluginResult.m; sourceTree = ""; }; - 7ED95D231AB9029B008C4574 /* CDVScreenOrientationDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVScreenOrientationDelegate.h; sourceTree = ""; }; - 7ED95D241AB9029B008C4574 /* CDVTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVTimer.h; sourceTree = ""; }; - 7ED95D251AB9029B008C4574 /* CDVTimer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVTimer.m; sourceTree = ""; }; - 7ED95D261AB9029B008C4574 /* CDVURLProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVURLProtocol.h; sourceTree = ""; }; - 7ED95D271AB9029B008C4574 /* CDVURLProtocol.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVURLProtocol.m; sourceTree = ""; }; - 7ED95D281AB9029B008C4574 /* CDVUserAgentUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVUserAgentUtil.h; sourceTree = ""; }; - 7ED95D291AB9029B008C4574 /* CDVUserAgentUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVUserAgentUtil.m; sourceTree = ""; }; - 7ED95D2A1AB9029B008C4574 /* CDVViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVViewController.h; sourceTree = ""; }; - 7ED95D2B1AB9029B008C4574 /* CDVViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVViewController.m; sourceTree = ""; }; - 7ED95D2C1AB9029B008C4574 /* CDVWebViewEngineProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVWebViewEngineProtocol.h; sourceTree = ""; }; - 7ED95D2D1AB9029B008C4574 /* CDVWhitelist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVWhitelist.h; sourceTree = ""; }; - 7ED95D2E1AB9029B008C4574 /* CDVWhitelist.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVWhitelist.m; sourceTree = ""; }; - 7ED95D311AB9029B008C4574 /* NSDictionary+CordovaPreferences.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+CordovaPreferences.h"; sourceTree = ""; }; - 7ED95D321AB9029B008C4574 /* NSDictionary+CordovaPreferences.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+CordovaPreferences.m"; sourceTree = ""; }; - 7ED95D331AB9029B008C4574 /* NSMutableArray+QueueAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableArray+QueueAdditions.h"; sourceTree = ""; }; - 7ED95D341AB9029B008C4574 /* NSMutableArray+QueueAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMutableArray+QueueAdditions.m"; sourceTree = ""; }; - A3B082D21BB15CEA00D8DC35 /* CDVGestureHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVGestureHandler.h; sourceTree = ""; }; - A3B082D31BB15CEA00D8DC35 /* CDVGestureHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVGestureHandler.m; sourceTree = ""; }; - AA747D9E0F9514B9006C5449 /* CordovaLib_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CordovaLib_Prefix.pch; sourceTree = SOURCE_ROOT; }; - C0C01EB21E3911D50056E6CB /* Cordova.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Cordova.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - C0C01EB41E3911D50056E6CB /* Cordova.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Cordova.h; sourceTree = ""; }; - C0C01EB51E3911D50056E6CB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - C0C01EAE1E3911D50056E6CB /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D2AAC07C0554694100DB518D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 034768DFFF38A50411DB9C8B /* Products */ = { - isa = PBXGroup; - children = ( - 68A32D7114102E1C006B237C /* libCordova.a */, - C0C01EB21E3911D50056E6CB /* Cordova.framework */, - ); - name = Products; - sourceTree = ""; - }; - 0867D691FE84028FC02AAC07 = { - isa = PBXGroup; - children = ( - 7ED95D0E1AB9029B008C4574 /* Public */, - 7ED95CF11AB9028C008C4574 /* Private */, - C0C01EB31E3911D50056E6CB /* Cordova */, - 034768DFFF38A50411DB9C8B /* Products */, - ); - sourceTree = ""; - }; - 28BFF9111F355A1D00DDF01A /* CDVLogger */ = { - isa = PBXGroup; - children = ( - 28BFF9121F355A4E00DDF01A /* CDVLogger.h */, - 28BFF9131F355A4E00DDF01A /* CDVLogger.m */, - ); - path = CDVLogger; - sourceTree = ""; - }; - 3093E2201B16D6A3003F381A /* CDVIntentAndNavigationFilter */ = { - isa = PBXGroup; - children = ( - 3093E2211B16D6A3003F381A /* CDVIntentAndNavigationFilter.h */, - 3093E2221B16D6A3003F381A /* CDVIntentAndNavigationFilter.m */, - ); - path = CDVIntentAndNavigationFilter; - sourceTree = ""; - }; - 7ED95CF11AB9028C008C4574 /* Private */ = { - isa = PBXGroup; - children = ( - AA747D9E0F9514B9006C5449 /* CordovaLib_Prefix.pch */, - 7ED95CF21AB9028C008C4574 /* CDVDebug.h */, - 7ED95CF31AB9028C008C4574 /* CDVJSON_private.h */, - 7ED95CF41AB9028C008C4574 /* CDVJSON_private.m */, - 7ED95CF51AB9028C008C4574 /* CDVPlugin+Private.h */, - 7ED95CF61AB9028C008C4574 /* Plugins */, - ); - name = Private; - path = Classes/Private; - sourceTree = ""; - }; - 7ED95CF61AB9028C008C4574 /* Plugins */ = { - isa = PBXGroup; - children = ( - 28BFF9111F355A1D00DDF01A /* CDVLogger */, - A3B082D11BB15CEA00D8DC35 /* CDVGestureHandler */, - 3093E2201B16D6A3003F381A /* CDVIntentAndNavigationFilter */, - 7ED95CF71AB9028C008C4574 /* CDVHandleOpenURL */, - 7ED95CFA1AB9028C008C4574 /* CDVLocalStorage */, - 7ED95CFD1AB9028C008C4574 /* CDVUIWebViewEngine */, - ); - path = Plugins; - sourceTree = ""; - }; - 7ED95CF71AB9028C008C4574 /* CDVHandleOpenURL */ = { - isa = PBXGroup; - children = ( - 7ED95CF81AB9028C008C4574 /* CDVHandleOpenURL.h */, - 7ED95CF91AB9028C008C4574 /* CDVHandleOpenURL.m */, - ); - path = CDVHandleOpenURL; - sourceTree = ""; - }; - 7ED95CFA1AB9028C008C4574 /* CDVLocalStorage */ = { - isa = PBXGroup; - children = ( - 7ED95CFB1AB9028C008C4574 /* CDVLocalStorage.h */, - 7ED95CFC1AB9028C008C4574 /* CDVLocalStorage.m */, - ); - path = CDVLocalStorage; - sourceTree = ""; - }; - 7ED95CFD1AB9028C008C4574 /* CDVUIWebViewEngine */ = { - isa = PBXGroup; - children = ( - 30193A4F1AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.h */, - 30193A4E1AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.m */, - 7ED95CFE1AB9028C008C4574 /* CDVUIWebViewDelegate.h */, - 7ED95CFF1AB9028C008C4574 /* CDVUIWebViewDelegate.m */, - 7ED95D001AB9028C008C4574 /* CDVUIWebViewEngine.h */, - 7ED95D011AB9028C008C4574 /* CDVUIWebViewEngine.m */, - ); - path = CDVUIWebViewEngine; - sourceTree = ""; - }; - 7ED95D0E1AB9029B008C4574 /* Public */ = { - isa = PBXGroup; - children = ( - 7ED95D0F1AB9029B008C4574 /* CDV.h */, - 7ED95D101AB9029B008C4574 /* CDVAppDelegate.h */, - 7ED95D111AB9029B008C4574 /* CDVAppDelegate.m */, - 7ED95D121AB9029B008C4574 /* CDVAvailability.h */, - 7ED95D131AB9029B008C4574 /* CDVAvailabilityDeprecated.h */, - 7ED95D141AB9029B008C4574 /* CDVCommandDelegate.h */, - 7ED95D151AB9029B008C4574 /* CDVCommandDelegateImpl.h */, - 7ED95D161AB9029B008C4574 /* CDVCommandDelegateImpl.m */, - 7ED95D171AB9029B008C4574 /* CDVCommandQueue.h */, - 7ED95D181AB9029B008C4574 /* CDVCommandQueue.m */, - 7ED95D191AB9029B008C4574 /* CDVConfigParser.h */, - 7ED95D1A1AB9029B008C4574 /* CDVConfigParser.m */, - 7ED95D1B1AB9029B008C4574 /* CDVInvokedUrlCommand.h */, - 7ED95D1C1AB9029B008C4574 /* CDVInvokedUrlCommand.m */, - 7ED95D1D1AB9029B008C4574 /* CDVPlugin+Resources.h */, - 7ED95D1E1AB9029B008C4574 /* CDVPlugin+Resources.m */, - 7ED95D1F1AB9029B008C4574 /* CDVPlugin.h */, - 7ED95D201AB9029B008C4574 /* CDVPlugin.m */, - 7ED95D211AB9029B008C4574 /* CDVPluginResult.h */, - 7ED95D221AB9029B008C4574 /* CDVPluginResult.m */, - 7ED95D231AB9029B008C4574 /* CDVScreenOrientationDelegate.h */, - 7ED95D241AB9029B008C4574 /* CDVTimer.h */, - 7ED95D251AB9029B008C4574 /* CDVTimer.m */, - 7ED95D261AB9029B008C4574 /* CDVURLProtocol.h */, - 7ED95D271AB9029B008C4574 /* CDVURLProtocol.m */, - 7ED95D281AB9029B008C4574 /* CDVUserAgentUtil.h */, - 7ED95D291AB9029B008C4574 /* CDVUserAgentUtil.m */, - 7ED95D2A1AB9029B008C4574 /* CDVViewController.h */, - 7ED95D2B1AB9029B008C4574 /* CDVViewController.m */, - 7ED95D2C1AB9029B008C4574 /* CDVWebViewEngineProtocol.h */, - 7ED95D2D1AB9029B008C4574 /* CDVWhitelist.h */, - 7ED95D2E1AB9029B008C4574 /* CDVWhitelist.m */, - 7ED95D311AB9029B008C4574 /* NSDictionary+CordovaPreferences.h */, - 7ED95D321AB9029B008C4574 /* NSDictionary+CordovaPreferences.m */, - 7ED95D331AB9029B008C4574 /* NSMutableArray+QueueAdditions.h */, - 7ED95D341AB9029B008C4574 /* NSMutableArray+QueueAdditions.m */, - ); - name = Public; - path = Classes/Public; - sourceTree = ""; - }; - A3B082D11BB15CEA00D8DC35 /* CDVGestureHandler */ = { - isa = PBXGroup; - children = ( - A3B082D21BB15CEA00D8DC35 /* CDVGestureHandler.h */, - A3B082D31BB15CEA00D8DC35 /* CDVGestureHandler.m */, - ); - path = CDVGestureHandler; - sourceTree = ""; - }; - C0C01EB31E3911D50056E6CB /* Cordova */ = { - isa = PBXGroup; - children = ( - C0C01EB41E3911D50056E6CB /* Cordova.h */, - C0C01EB51E3911D50056E6CB /* Info.plist */, - ); - path = Cordova; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - C0C01EAF1E3911D50056E6CB /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - C0C01EB61E3911D50056E6CB /* Cordova.h in Headers */, - C0C01EBB1E39131A0056E6CB /* CDV.h in Headers */, - C0C01EBC1E39131A0056E6CB /* CDVAppDelegate.h in Headers */, - C0C01EBD1E39131A0056E6CB /* CDVAvailability.h in Headers */, - C0C01EBE1E39131A0056E6CB /* CDVAvailabilityDeprecated.h in Headers */, - C0C01EBF1E39131A0056E6CB /* CDVCommandDelegate.h in Headers */, - C0C01EC01E39131A0056E6CB /* CDVCommandDelegateImpl.h in Headers */, - C0C01EC11E39131A0056E6CB /* CDVCommandQueue.h in Headers */, - C0C01EC21E39131A0056E6CB /* CDVConfigParser.h in Headers */, - C0C01EC31E39131A0056E6CB /* CDVInvokedUrlCommand.h in Headers */, - C0C01EC41E39131A0056E6CB /* CDVPlugin+Resources.h in Headers */, - C0C01EC51E39131A0056E6CB /* CDVPlugin.h in Headers */, - C0C01EC61E39131A0056E6CB /* CDVPluginResult.h in Headers */, - C0C01EC71E39131A0056E6CB /* CDVScreenOrientationDelegate.h in Headers */, - C0C01EC81E39131A0056E6CB /* CDVTimer.h in Headers */, - C0C01EC91E39131A0056E6CB /* CDVURLProtocol.h in Headers */, - C0C01ECA1E39131A0056E6CB /* CDVUserAgentUtil.h in Headers */, - C0C01ECB1E39131A0056E6CB /* CDVViewController.h in Headers */, - C0C01ECC1E39131A0056E6CB /* CDVWebViewEngineProtocol.h in Headers */, - C0C01ECD1E39131A0056E6CB /* CDVWhitelist.h in Headers */, - C0C01ECE1E39131A0056E6CB /* NSDictionary+CordovaPreferences.h in Headers */, - C0C01ECF1E39131A0056E6CB /* NSMutableArray+QueueAdditions.h in Headers */, - 9052DE892150D06B008E83D4 /* CDVDebug.h in Headers */, - 9052DE8A2150D06B008E83D4 /* CDVJSON_private.h in Headers */, - 9052DE8B2150D06B008E83D4 /* CDVPlugin+Private.h in Headers */, - 9052DE8C2150D06B008E83D4 /* CDVLogger.h in Headers */, - 9052DE8D2150D06B008E83D4 /* CDVGestureHandler.h in Headers */, - 9052DE8E2150D06B008E83D4 /* CDVIntentAndNavigationFilter.h in Headers */, - 9052DE8F2150D06B008E83D4 /* CDVHandleOpenURL.h in Headers */, - 9052DE902150D06B008E83D4 /* CDVLocalStorage.h in Headers */, - 9052DE912150D06B008E83D4 /* CDVUIWebViewNavigationDelegate.h in Headers */, - C0C01ED01E3913610056E6CB /* CDVUIWebViewDelegate.h in Headers */, - 9052DE922150D06B008E83D4 /* CDVUIWebViewEngine.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D2AAC07A0554694100DB518D /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 7ED95D351AB9029B008C4574 /* CDV.h in Headers */, - 7ED95D361AB9029B008C4574 /* CDVAppDelegate.h in Headers */, - 7ED95D381AB9029B008C4574 /* CDVAvailability.h in Headers */, - 7ED95D391AB9029B008C4574 /* CDVAvailabilityDeprecated.h in Headers */, - 7ED95D3A1AB9029B008C4574 /* CDVCommandDelegate.h in Headers */, - 7ED95D3B1AB9029B008C4574 /* CDVCommandDelegateImpl.h in Headers */, - 7ED95D3D1AB9029B008C4574 /* CDVCommandQueue.h in Headers */, - 7ED95D3F1AB9029B008C4574 /* CDVConfigParser.h in Headers */, - 7ED95D411AB9029B008C4574 /* CDVInvokedUrlCommand.h in Headers */, - 7ED95D431AB9029B008C4574 /* CDVPlugin+Resources.h in Headers */, - 7ED95D451AB9029B008C4574 /* CDVPlugin.h in Headers */, - 7ED95D471AB9029B008C4574 /* CDVPluginResult.h in Headers */, - 7ED95D491AB9029B008C4574 /* CDVScreenOrientationDelegate.h in Headers */, - 7ED95D4A1AB9029B008C4574 /* CDVTimer.h in Headers */, - 7ED95D4C1AB9029B008C4574 /* CDVURLProtocol.h in Headers */, - 7ED95D4E1AB9029B008C4574 /* CDVUserAgentUtil.h in Headers */, - 7ED95D501AB9029B008C4574 /* CDVViewController.h in Headers */, - 7ED95D521AB9029B008C4574 /* CDVWebViewEngineProtocol.h in Headers */, - 7ED95D531AB9029B008C4574 /* CDVWhitelist.h in Headers */, - 7ED95D571AB9029B008C4574 /* NSDictionary+CordovaPreferences.h in Headers */, - 7ED95D591AB9029B008C4574 /* NSMutableArray+QueueAdditions.h in Headers */, - 7ED95D021AB9028C008C4574 /* CDVDebug.h in Headers */, - 7ED95D031AB9028C008C4574 /* CDVJSON_private.h in Headers */, - 7ED95D051AB9028C008C4574 /* CDVPlugin+Private.h in Headers */, - 28BFF9141F355A4E00DDF01A /* CDVLogger.h in Headers */, - A3B082D41BB15CEA00D8DC35 /* CDVGestureHandler.h in Headers */, - 3093E2231B16D6A3003F381A /* CDVIntentAndNavigationFilter.h in Headers */, - 7E7F69B91ABA3692007546F4 /* CDVHandleOpenURL.h in Headers */, - 7E7F69B61ABA35D8007546F4 /* CDVLocalStorage.h in Headers */, - 30193A511AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.h in Headers */, - 7ED95D0A1AB9028C008C4574 /* CDVUIWebViewDelegate.h in Headers */, - 7E7F69B81ABA368F007546F4 /* CDVUIWebViewEngine.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - C0C01EB11E3911D50056E6CB /* Cordova */ = { - isa = PBXNativeTarget; - buildConfigurationList = C0C01EB91E3911D50056E6CB /* Build configuration list for PBXNativeTarget "Cordova" */; - buildPhases = ( - C0C01EAD1E3911D50056E6CB /* Sources */, - C0C01EAE1E3911D50056E6CB /* Frameworks */, - C0C01EAF1E3911D50056E6CB /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Cordova; - productName = Cordova; - productReference = C0C01EB21E3911D50056E6CB /* Cordova.framework */; - productType = "com.apple.product-type.framework"; - }; - D2AAC07D0554694100DB518D /* CordovaLib */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "CordovaLib" */; - buildPhases = ( - D2AAC07A0554694100DB518D /* Headers */, - D2AAC07B0554694100DB518D /* Sources */, - D2AAC07C0554694100DB518D /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = CordovaLib; - productName = CordovaLib; - productReference = 68A32D7114102E1C006B237C /* libCordova.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 0867D690FE84028FC02AAC07 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1010; - TargetAttributes = { - C0C01EB11E3911D50056E6CB = { - CreatedOnToolsVersion = 10.1; - ProvisioningStyle = Automatic; - }; - D2AAC07D0554694100DB518D = { - CreatedOnToolsVersion = 10.1; - ProvisioningStyle = Automatic; - }; - }; - }; - buildConfigurationList = 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "CordovaLib" */; - compatibilityVersion = "Xcode 8.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 0867D691FE84028FC02AAC07; - productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - D2AAC07D0554694100DB518D /* CordovaLib */, - C0C01EB11E3911D50056E6CB /* Cordova */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - C0C01EAD1E3911D50056E6CB /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 9052DE712150D040008E83D4 /* CDVAppDelegate.m in Sources */, - 9052DE722150D040008E83D4 /* CDVCommandDelegateImpl.m in Sources */, - 9052DE732150D040008E83D4 /* CDVCommandQueue.m in Sources */, - 9052DE742150D040008E83D4 /* CDVConfigParser.m in Sources */, - 9052DE752150D040008E83D4 /* CDVInvokedUrlCommand.m in Sources */, - 9052DE762150D040008E83D4 /* CDVPlugin+Resources.m in Sources */, - 9052DE772150D040008E83D4 /* CDVPlugin.m in Sources */, - 9052DE782150D040008E83D4 /* CDVPluginResult.m in Sources */, - 9052DE792150D040008E83D4 /* CDVTimer.m in Sources */, - 9052DE7A2150D040008E83D4 /* CDVURLProtocol.m in Sources */, - 9052DE7B2150D040008E83D4 /* CDVUserAgentUtil.m in Sources */, - 9052DE7C2150D040008E83D4 /* CDVViewController.m in Sources */, - 9052DE7D2150D040008E83D4 /* CDVWhitelist.m in Sources */, - 9052DE7E2150D040008E83D4 /* NSDictionary+CordovaPreferences.m in Sources */, - 9052DE7F2150D040008E83D4 /* NSMutableArray+QueueAdditions.m in Sources */, - 9052DE802150D040008E83D4 /* CDVJSON_private.m in Sources */, - 9052DE812150D040008E83D4 /* CDVLogger.m in Sources */, - 9052DE822150D040008E83D4 /* CDVGestureHandler.m in Sources */, - 9052DE832150D040008E83D4 /* CDVIntentAndNavigationFilter.m in Sources */, - 9052DE842150D040008E83D4 /* CDVHandleOpenURL.m in Sources */, - 9052DE852150D040008E83D4 /* CDVLocalStorage.m in Sources */, - 9052DE862150D040008E83D4 /* CDVUIWebViewNavigationDelegate.m in Sources */, - 9052DE872150D040008E83D4 /* CDVUIWebViewDelegate.m in Sources */, - 9052DE882150D040008E83D4 /* CDVUIWebViewEngine.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D2AAC07B0554694100DB518D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 7ED95D371AB9029B008C4574 /* CDVAppDelegate.m in Sources */, - 7ED95D3C1AB9029B008C4574 /* CDVCommandDelegateImpl.m in Sources */, - 7ED95D3E1AB9029B008C4574 /* CDVCommandQueue.m in Sources */, - 7ED95D401AB9029B008C4574 /* CDVConfigParser.m in Sources */, - 7ED95D421AB9029B008C4574 /* CDVInvokedUrlCommand.m in Sources */, - 7ED95D441AB9029B008C4574 /* CDVPlugin+Resources.m in Sources */, - 7ED95D461AB9029B008C4574 /* CDVPlugin.m in Sources */, - 7ED95D481AB9029B008C4574 /* CDVPluginResult.m in Sources */, - 7ED95D4B1AB9029B008C4574 /* CDVTimer.m in Sources */, - 7ED95D4D1AB9029B008C4574 /* CDVURLProtocol.m in Sources */, - 7ED95D4F1AB9029B008C4574 /* CDVUserAgentUtil.m in Sources */, - 7ED95D511AB9029B008C4574 /* CDVViewController.m in Sources */, - 7ED95D541AB9029B008C4574 /* CDVWhitelist.m in Sources */, - 7ED95D581AB9029B008C4574 /* NSDictionary+CordovaPreferences.m in Sources */, - 7ED95D5A1AB9029B008C4574 /* NSMutableArray+QueueAdditions.m in Sources */, - 7ED95D041AB9028C008C4574 /* CDVJSON_private.m in Sources */, - 28BFF9151F355A4E00DDF01A /* CDVLogger.m in Sources */, - A3B082D51BB15CEA00D8DC35 /* CDVGestureHandler.m in Sources */, - 3093E2241B16D6A3003F381A /* CDVIntentAndNavigationFilter.m in Sources */, - 7ED95D071AB9028C008C4574 /* CDVHandleOpenURL.m in Sources */, - 7ED95D091AB9028C008C4574 /* CDVLocalStorage.m in Sources */, - 30193A501AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.m in Sources */, - 7ED95D0B1AB9028C008C4574 /* CDVUIWebViewDelegate.m in Sources */, - 7ED95D0D1AB9028C008C4574 /* CDVUIWebViewEngine.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 1DEB921F08733DC00010E9CD /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - PUBLIC_HEADERS_FOLDER_PATH = include/Cordova; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 1DEB922008733DC00010E9CD /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - PUBLIC_HEADERS_FOLDER_PATH = include/Cordova; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; - 1DEB922308733DC00010E9CD /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = ""; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = CordovaLib_Prefix.pch; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "WK_WEB_VIEW_ONLY=$(WK_WEB_VIEW_ONLY)", - "$(inherited)", - ); - 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; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = Cordova; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - WK_WEB_VIEW_ONLY = 0; - }; - name = Debug; - }; - 1DEB922408733DC00010E9CD /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = ""; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = CordovaLib_Prefix.pch; - GCC_PREPROCESSOR_DEFINITIONS = ( - "WK_WEB_VIEW_ONLY=$(WK_WEB_VIEW_ONLY)", - "$(inherited)", - ); - 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; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = Cordova; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - VALIDATE_PRODUCT = YES; - WK_WEB_VIEW_ONLY = 0; - }; - name = Release; - }; - C0C01EB71E3911D50056E6CB /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - DEFINES_MODULE = YES; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = Cordova/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = org.apache.cordova.Cordova; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - C0C01EB81E3911D50056E6CB /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - DEFINES_MODULE = YES; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = Cordova/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = org.apache.cordova.Cordova; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "CordovaLib" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1DEB921F08733DC00010E9CD /* Debug */, - 1DEB922008733DC00010E9CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "CordovaLib" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1DEB922308733DC00010E9CD /* Debug */, - 1DEB922408733DC00010E9CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C0C01EB91E3911D50056E6CB /* Build configuration list for PBXNativeTarget "Cordova" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C0C01EB71E3911D50056E6CB /* Debug */, - C0C01EB81E3911D50056E6CB /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 0867D690FE84028FC02AAC07 /* Project object */; -} diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 028f7fe..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj/xcshareddata/xcschemes/Cordova.xcscheme b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj/xcshareddata/xcschemes/Cordova.xcscheme deleted file mode 100644 index b6b4bb0..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj/xcshareddata/xcschemes/Cordova.xcscheme +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/CordovaLib_Prefix.pch b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/CordovaLib_Prefix.pch deleted file mode 100644 index 9545580..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/CordovaLib_Prefix.pch +++ /dev/null @@ -1,22 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#ifdef __OBJC__ - #import -#endif diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/VERSION b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/VERSION deleted file mode 100644 index ac14c3d..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/VERSION +++ /dev/null @@ -1 +0,0 @@ -5.1.1 diff --git a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/cordova.js b/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/cordova.js deleted file mode 100644 index 9813b23..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/CordovaLib/cordova.js +++ /dev/null @@ -1,2188 +0,0 @@ -// Platform: ios -// 9c79667cd175f51fd2edf2dc91ac8be98b89076a -/* - 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. -*/ -;(function() { -var PLATFORM_VERSION_BUILD_LABEL = '5.1.1'; -// file: src/scripts/require.js -var require; -var define; - -(function () { - var modules = {}; - // Stack of moduleIds currently being built. - var requireStack = []; - // Map of module ID -> index into requireStack of modules currently being built. - var inProgressModules = {}; - var SEPARATOR = '.'; - - function build (module) { - var factory = module.factory; - var localRequire = function (id) { - var resultantId = id; - // Its a relative path, so lop off the last portion and add the id (minus "./") - if (id.charAt(0) === '.') { - resultantId = module.id.slice(0, module.id.lastIndexOf(SEPARATOR)) + SEPARATOR + id.slice(2); - } - return require(resultantId); - }; - module.exports = {}; - delete module.factory; - factory(localRequire, module.exports, module); - return module.exports; - } - - require = function (id) { - if (!modules[id]) { - throw 'module ' + id + ' not found'; - } else if (id in inProgressModules) { - var cycle = requireStack.slice(inProgressModules[id]).join('->') + '->' + id; - throw 'Cycle in require graph: ' + cycle; - } - if (modules[id].factory) { - try { - inProgressModules[id] = requireStack.length; - requireStack.push(id); - return build(modules[id]); - } finally { - delete inProgressModules[id]; - requireStack.pop(); - } - } - return modules[id].exports; - }; - - define = function (id, factory) { - if (Object.prototype.hasOwnProperty.call(modules, id)) { - throw 'module ' + id + ' already defined'; - } - - modules[id] = { - id: id, - factory: factory - }; - }; - - define.remove = function (id) { - delete modules[id]; - }; - - define.moduleMap = modules; -})(); - -// Export for use in node -if (typeof module === 'object' && typeof require === 'function') { - module.exports.require = require; - module.exports.define = define; -} - -// file: src/cordova.js -define("cordova", function(require, exports, module) { - -// Workaround for Windows 10 in hosted environment case -// http://www.w3.org/html/wg/drafts/html/master/browsers.html#named-access-on-the-window-object -if (window.cordova && !(window.cordova instanceof HTMLElement)) { - throw new Error('cordova already defined'); -} - -var channel = require('cordova/channel'); -var platform = require('cordova/platform'); - -/** - * Intercept calls to addEventListener + removeEventListener and handle deviceready, - * resume, and pause events. - */ -var m_document_addEventListener = document.addEventListener; -var m_document_removeEventListener = document.removeEventListener; -var m_window_addEventListener = window.addEventListener; -var m_window_removeEventListener = window.removeEventListener; - -/** - * Houses custom event handlers to intercept on document + window event listeners. - */ -var documentEventHandlers = {}; -var windowEventHandlers = {}; - -document.addEventListener = function (evt, handler, capture) { - var e = evt.toLowerCase(); - if (typeof documentEventHandlers[e] !== 'undefined') { - documentEventHandlers[e].subscribe(handler); - } else { - m_document_addEventListener.call(document, evt, handler, capture); - } -}; - -window.addEventListener = function (evt, handler, capture) { - var e = evt.toLowerCase(); - if (typeof windowEventHandlers[e] !== 'undefined') { - windowEventHandlers[e].subscribe(handler); - } else { - m_window_addEventListener.call(window, evt, handler, capture); - } -}; - -document.removeEventListener = function (evt, handler, capture) { - var e = evt.toLowerCase(); - // If unsubscribing from an event that is handled by a plugin - if (typeof documentEventHandlers[e] !== 'undefined') { - documentEventHandlers[e].unsubscribe(handler); - } else { - m_document_removeEventListener.call(document, evt, handler, capture); - } -}; - -window.removeEventListener = function (evt, handler, capture) { - var e = evt.toLowerCase(); - // If unsubscribing from an event that is handled by a plugin - if (typeof windowEventHandlers[e] !== 'undefined') { - windowEventHandlers[e].unsubscribe(handler); - } else { - m_window_removeEventListener.call(window, evt, handler, capture); - } -}; - -function createEvent (type, data) { - var event = document.createEvent('Events'); - event.initEvent(type, false, false); - if (data) { - for (var i in data) { - if (data.hasOwnProperty(i)) { - event[i] = data[i]; - } - } - } - return event; -} - -var cordova = { - define: define, - require: require, - version: PLATFORM_VERSION_BUILD_LABEL, - platformVersion: PLATFORM_VERSION_BUILD_LABEL, - platformId: platform.id, - - /** - * Methods to add/remove your own addEventListener hijacking on document + window. - */ - addWindowEventHandler: function (event) { - return (windowEventHandlers[event] = channel.create(event)); - }, - addStickyDocumentEventHandler: function (event) { - return (documentEventHandlers[event] = channel.createSticky(event)); - }, - addDocumentEventHandler: function (event) { - return (documentEventHandlers[event] = channel.create(event)); - }, - removeWindowEventHandler: function (event) { - delete windowEventHandlers[event]; - }, - removeDocumentEventHandler: function (event) { - delete documentEventHandlers[event]; - }, - - /** - * Retrieve original event handlers that were replaced by Cordova - * - * @return object - */ - getOriginalHandlers: function () { - return { - document: { - addEventListener: m_document_addEventListener, - removeEventListener: m_document_removeEventListener - }, - window: { - addEventListener: m_window_addEventListener, - removeEventListener: m_window_removeEventListener - } - }; - }, - - /** - * Method to fire event from native code - * bNoDetach is required for events which cause an exception which needs to be caught in native code - */ - fireDocumentEvent: function (type, data, bNoDetach) { - var evt = createEvent(type, data); - if (typeof documentEventHandlers[type] !== 'undefined') { - if (bNoDetach) { - documentEventHandlers[type].fire(evt); - } else { - setTimeout(function () { - // Fire deviceready on listeners that were registered before cordova.js was loaded. - if (type === 'deviceready') { - document.dispatchEvent(evt); - } - documentEventHandlers[type].fire(evt); - }, 0); - } - } else { - document.dispatchEvent(evt); - } - }, - - fireWindowEvent: function (type, data) { - var evt = createEvent(type, data); - if (typeof windowEventHandlers[type] !== 'undefined') { - setTimeout(function () { - windowEventHandlers[type].fire(evt); - }, 0); - } else { - window.dispatchEvent(evt); - } - }, - - /** - * Plugin callback mechanism. - */ - // Randomize the starting callbackId to avoid collisions after refreshing or navigating. - // This way, it's very unlikely that any new callback would get the same callbackId as an old callback. - callbackId: Math.floor(Math.random() * 2000000000), - callbacks: {}, - callbackStatus: { - NO_RESULT: 0, - OK: 1, - CLASS_NOT_FOUND_EXCEPTION: 2, - ILLEGAL_ACCESS_EXCEPTION: 3, - INSTANTIATION_EXCEPTION: 4, - MALFORMED_URL_EXCEPTION: 5, - IO_EXCEPTION: 6, - INVALID_ACTION: 7, - JSON_EXCEPTION: 8, - ERROR: 9 - }, - - /** - * Called by native code when returning successful result from an action. - */ - callbackSuccess: function (callbackId, args) { - cordova.callbackFromNative(callbackId, true, args.status, [args.message], args.keepCallback); - }, - - /** - * Called by native code when returning error result from an action. - */ - callbackError: function (callbackId, args) { - // TODO: Deprecate callbackSuccess and callbackError in favour of callbackFromNative. - // Derive success from status. - cordova.callbackFromNative(callbackId, false, args.status, [args.message], args.keepCallback); - }, - - /** - * Called by native code when returning the result from an action. - */ - callbackFromNative: function (callbackId, isSuccess, status, args, keepCallback) { - try { - var callback = cordova.callbacks[callbackId]; - if (callback) { - if (isSuccess && status === cordova.callbackStatus.OK) { - callback.success && callback.success.apply(null, args); - } else if (!isSuccess) { - callback.fail && callback.fail.apply(null, args); - } - /* - else - Note, this case is intentionally not caught. - this can happen if isSuccess is true, but callbackStatus is NO_RESULT - which is used to remove a callback from the list without calling the callbacks - typically keepCallback is false in this case - */ - // Clear callback if not expecting any more results - if (!keepCallback) { - delete cordova.callbacks[callbackId]; - } - } - } catch (err) { - var msg = 'Error in ' + (isSuccess ? 'Success' : 'Error') + ' callbackId: ' + callbackId + ' : ' + err; - console && console.log && console.log(msg); - console && console.log && err.stack && console.log(err.stack); - cordova.fireWindowEvent('cordovacallbackerror', { 'message': msg }); - throw err; - } - }, - - addConstructor: function (func) { - channel.onCordovaReady.subscribe(function () { - try { - func(); - } catch (e) { - console.log('Failed to run constructor: ' + e); - } - }); - } -}; - -module.exports = cordova; - -}); - -// file: src/common/argscheck.js -define("cordova/argscheck", function(require, exports, module) { - -var utils = require('cordova/utils'); - -var moduleExports = module.exports; - -var typeMap = { - 'A': 'Array', - 'D': 'Date', - 'N': 'Number', - 'S': 'String', - 'F': 'Function', - 'O': 'Object' -}; - -function extractParamName (callee, argIndex) { - return (/\(\s*([^)]*?)\s*\)/).exec(callee)[1].split(/\s*,\s*/)[argIndex]; -} - -/** - * Checks the given arguments' types and throws if they are not as expected. - * - * `spec` is a string where each character stands for the required type of the - * argument at the same position. In other words: the character at `spec[i]` - * specifies the required type for `args[i]`. The characters in `spec` are the - * first letter of the required type's name. The supported types are: - * - * Array, Date, Number, String, Function, Object - * - * Lowercase characters specify arguments that must not be `null` or `undefined` - * while uppercase characters allow those values to be passed. - * - * Finally, `*` can be used to allow any type at the corresponding position. - * - * @example - * function foo (arr, opts) { - * // require `arr` to be an Array and `opts` an Object, null or undefined - * checkArgs('aO', 'my.package.foo', arguments); - * // ... - * } - * @param {String} spec - the type specification for `args` as described above - * @param {String} functionName - full name of the callee. - * Used in the error message - * @param {Array|arguments} args - the arguments to be checked against `spec` - * @param {Function} [opt_callee=args.callee] - the recipient of `args`. - * Used to extract parameter names for the error message - * @throws {TypeError} if args do not satisfy spec - */ -function checkArgs (spec, functionName, args, opt_callee) { - if (!moduleExports.enableChecks) { - return; - } - var errMsg = null; - var typeName; - for (var i = 0; i < spec.length; ++i) { - var c = spec.charAt(i); - var cUpper = c.toUpperCase(); - var arg = args[i]; - // Asterix means allow anything. - if (c === '*') { - continue; - } - typeName = utils.typeName(arg); - if ((arg === null || arg === undefined) && c === cUpper) { - continue; - } - if (typeName !== typeMap[cUpper]) { - errMsg = 'Expected ' + typeMap[cUpper]; - break; - } - } - if (errMsg) { - errMsg += ', but got ' + typeName + '.'; - errMsg = 'Wrong type for parameter "' + extractParamName(opt_callee || args.callee, i) + '" of ' + functionName + ': ' + errMsg; - // Don't log when running unit tests. - if (typeof jasmine === 'undefined') { - console.error(errMsg); - } - throw TypeError(errMsg); - } -} - -function getValue (value, defaultValue) { - return value === undefined ? defaultValue : value; -} - -moduleExports.checkArgs = checkArgs; -moduleExports.getValue = getValue; -moduleExports.enableChecks = true; - -}); - -// file: src/common/base64.js -define("cordova/base64", function(require, exports, module) { - -var base64 = exports; - -base64.fromArrayBuffer = function (arrayBuffer) { - var array = new Uint8Array(arrayBuffer); - return uint8ToBase64(array); -}; - -base64.toArrayBuffer = function (str) { - var decodedStr = atob(str); - var arrayBuffer = new ArrayBuffer(decodedStr.length); - var array = new Uint8Array(arrayBuffer); - for (var i = 0, len = decodedStr.length; i < len; i++) { - array[i] = decodedStr.charCodeAt(i); - } - return arrayBuffer; -}; - -// ------------------------------------------------------------------------------ - -/* This code is based on the performance tests at http://jsperf.com/b64tests - * This 12-bit-at-a-time algorithm was the best performing version on all - * platforms tested. - */ - -var b64_6bit = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; -var b64_12bit; - -var b64_12bitTable = function () { - b64_12bit = []; - for (var i = 0; i < 64; i++) { - for (var j = 0; j < 64; j++) { - b64_12bit[i * 64 + j] = b64_6bit[i] + b64_6bit[j]; - } - } - b64_12bitTable = function () { return b64_12bit; }; - return b64_12bit; -}; - -function uint8ToBase64 (rawData) { - var numBytes = rawData.byteLength; - var output = ''; - var segment; - var table = b64_12bitTable(); - for (var i = 0; i < numBytes - 2; i += 3) { - segment = (rawData[i] << 16) + (rawData[i + 1] << 8) + rawData[i + 2]; - output += table[segment >> 12]; - output += table[segment & 0xfff]; - } - if (numBytes - i === 2) { - segment = (rawData[i] << 16) + (rawData[i + 1] << 8); - output += table[segment >> 12]; - output += b64_6bit[(segment & 0xfff) >> 6]; - output += '='; - } else if (numBytes - i === 1) { - segment = (rawData[i] << 16); - output += table[segment >> 12]; - output += '=='; - } - return output; -} - -}); - -// file: src/common/builder.js -define("cordova/builder", function(require, exports, module) { - -var utils = require('cordova/utils'); - -function each (objects, func, context) { - for (var prop in objects) { - if (objects.hasOwnProperty(prop)) { - func.apply(context, [objects[prop], prop]); - } - } -} - -function clobber (obj, key, value) { - var needsProperty = false; - try { - obj[key] = value; - } catch (e) { - needsProperty = true; - } - // Getters can only be overridden by getters. - if (needsProperty || obj[key] !== value) { - utils.defineGetter(obj, key, function () { - return value; - }); - } -} - -function assignOrWrapInDeprecateGetter (obj, key, value, message) { - if (message) { - utils.defineGetter(obj, key, function () { - console.log(message); - delete obj[key]; - clobber(obj, key, value); - return value; - }); - } else { - clobber(obj, key, value); - } -} - -function include (parent, objects, clobber, merge) { - each(objects, function (obj, key) { - try { - var result = obj.path ? require(obj.path) : {}; - - if (clobber) { - // Clobber if it doesn't exist. - if (typeof parent[key] === 'undefined') { - assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated); - } else if (typeof obj.path !== 'undefined') { - // If merging, merge properties onto parent, otherwise, clobber. - if (merge) { - recursiveMerge(parent[key], result); - } else { - assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated); - } - } - result = parent[key]; - } else { - // Overwrite if not currently defined. - if (typeof parent[key] === 'undefined') { - assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated); - } else { - // Set result to what already exists, so we can build children into it if they exist. - result = parent[key]; - } - } - - if (obj.children) { - include(result, obj.children, clobber, merge); - } - } catch (e) { - utils.alert('Exception building Cordova JS globals: ' + e + ' for key "' + key + '"'); - } - }); -} - -/** - * Merge properties from one object onto another recursively. Properties from - * the src object will overwrite existing target property. - * - * @param target Object to merge properties into. - * @param src Object to merge properties from. - */ -function recursiveMerge (target, src) { - for (var prop in src) { - if (src.hasOwnProperty(prop)) { - if (target.prototype && target.prototype.constructor === target) { - // If the target object is a constructor override off prototype. - clobber(target.prototype, prop, src[prop]); - } else { - if (typeof src[prop] === 'object' && typeof target[prop] === 'object') { - recursiveMerge(target[prop], src[prop]); - } else { - clobber(target, prop, src[prop]); - } - } - } - } -} - -exports.buildIntoButDoNotClobber = function (objects, target) { - include(target, objects, false, false); -}; -exports.buildIntoAndClobber = function (objects, target) { - include(target, objects, true, false); -}; -exports.buildIntoAndMerge = function (objects, target) { - include(target, objects, true, true); -}; -exports.recursiveMerge = recursiveMerge; -exports.assignOrWrapInDeprecateGetter = assignOrWrapInDeprecateGetter; - -}); - -// file: src/common/channel.js -define("cordova/channel", function(require, exports, module) { - -var utils = require('cordova/utils'); -var nextGuid = 1; - -/** - * Custom pub-sub "channel" that can have functions subscribed to it - * This object is used to define and control firing of events for - * cordova initialization, as well as for custom events thereafter. - * - * The order of events during page load and Cordova startup is as follows: - * - * onDOMContentLoaded* Internal event that is received when the web page is loaded and parsed. - * onNativeReady* Internal event that indicates the Cordova native side is ready. - * onCordovaReady* Internal event fired when all Cordova JavaScript objects have been created. - * onDeviceReady* User event fired to indicate that Cordova is ready - * onResume User event fired to indicate a start/resume lifecycle event - * onPause User event fired to indicate a pause lifecycle event - * - * The events marked with an * are sticky. Once they have fired, they will stay in the fired state. - * All listeners that subscribe after the event is fired will be executed right away. - * - * The only Cordova events that user code should register for are: - * deviceready Cordova native code is initialized and Cordova APIs can be called from JavaScript - * pause App has moved to background - * resume App has returned to foreground - * - * Listeners can be registered as: - * document.addEventListener("deviceready", myDeviceReadyListener, false); - * document.addEventListener("resume", myResumeListener, false); - * document.addEventListener("pause", myPauseListener, false); - * - * The DOM lifecycle events should be used for saving and restoring state - * window.onload - * window.onunload - * - */ - -/** - * Channel - * @constructor - * @param type String the channel name - */ -var Channel = function (type, sticky) { - this.type = type; - // Map of guid -> function. - this.handlers = {}; - // 0 = Non-sticky, 1 = Sticky non-fired, 2 = Sticky fired. - this.state = sticky ? 1 : 0; - // Used in sticky mode to remember args passed to fire(). - this.fireArgs = null; - // Used by onHasSubscribersChange to know if there are any listeners. - this.numHandlers = 0; - // Function that is called when the first listener is subscribed, or when - // the last listener is unsubscribed. - this.onHasSubscribersChange = null; -}; -var channel = { - /** - * Calls the provided function only after all of the channels specified - * have been fired. All channels must be sticky channels. - */ - join: function (h, c) { - var len = c.length; - var i = len; - var f = function () { - if (!(--i)) h(); - }; - for (var j = 0; j < len; j++) { - if (c[j].state === 0) { - throw Error('Can only use join with sticky channels.'); - } - c[j].subscribe(f); - } - if (!len) h(); - }, - - create: function (type) { - return (channel[type] = new Channel(type, false)); - }, - createSticky: function (type) { - return (channel[type] = new Channel(type, true)); - }, - - /** - * cordova Channels that must fire before "deviceready" is fired. - */ - deviceReadyChannelsArray: [], - deviceReadyChannelsMap: {}, - - /** - * Indicate that a feature needs to be initialized before it is ready to be used. - * This holds up Cordova's "deviceready" event until the feature has been initialized - * and Cordova.initComplete(feature) is called. - * - * @param feature {String} The unique feature name - */ - waitForInitialization: function (feature) { - if (feature) { - var c = channel[feature] || this.createSticky(feature); - this.deviceReadyChannelsMap[feature] = c; - this.deviceReadyChannelsArray.push(c); - } - }, - - /** - * Indicate that initialization code has completed and the feature is ready to be used. - * - * @param feature {String} The unique feature name - */ - initializationComplete: function (feature) { - var c = this.deviceReadyChannelsMap[feature]; - if (c) { - c.fire(); - } - } -}; - -function checkSubscriptionArgument (argument) { - if (typeof argument !== 'function' && typeof argument.handleEvent !== 'function') { - throw new Error( - 'Must provide a function or an EventListener object ' + - 'implementing the handleEvent interface.' - ); - } -} - -/** - * Subscribes the given function to the channel. Any time that - * Channel.fire is called so too will the function. - * Optionally specify an execution context for the function - * and a guid that can be used to stop subscribing to the channel. - * Returns the guid. - */ -Channel.prototype.subscribe = function (eventListenerOrFunction, eventListener) { - checkSubscriptionArgument(eventListenerOrFunction); - var handleEvent, guid; - - if (eventListenerOrFunction && typeof eventListenerOrFunction === 'object') { - // Received an EventListener object implementing the handleEvent interface - handleEvent = eventListenerOrFunction.handleEvent; - eventListener = eventListenerOrFunction; - } else { - // Received a function to handle event - handleEvent = eventListenerOrFunction; - } - - if (this.state === 2) { - handleEvent.apply(eventListener || this, this.fireArgs); - return; - } - - guid = eventListenerOrFunction.observer_guid; - if (typeof eventListener === 'object') { - handleEvent = utils.close(eventListener, handleEvent); - } - - if (!guid) { - // First time any channel has seen this subscriber - guid = '' + nextGuid++; - } - handleEvent.observer_guid = guid; - eventListenerOrFunction.observer_guid = guid; - - // Don't add the same handler more than once. - if (!this.handlers[guid]) { - this.handlers[guid] = handleEvent; - this.numHandlers++; - if (this.numHandlers === 1) { - this.onHasSubscribersChange && this.onHasSubscribersChange(); - } - } -}; - -/** - * Unsubscribes the function with the given guid from the channel. - */ -Channel.prototype.unsubscribe = function (eventListenerOrFunction) { - checkSubscriptionArgument(eventListenerOrFunction); - var handleEvent, guid, handler; - - if (eventListenerOrFunction && typeof eventListenerOrFunction === 'object') { - // Received an EventListener object implementing the handleEvent interface - handleEvent = eventListenerOrFunction.handleEvent; - } else { - // Received a function to handle event - handleEvent = eventListenerOrFunction; - } - - guid = handleEvent.observer_guid; - handler = this.handlers[guid]; - if (handler) { - delete this.handlers[guid]; - this.numHandlers--; - if (this.numHandlers === 0) { - this.onHasSubscribersChange && this.onHasSubscribersChange(); - } - } -}; - -/** - * Calls all functions subscribed to this channel. - */ -Channel.prototype.fire = function (e) { - var fireArgs = Array.prototype.slice.call(arguments); - // Apply stickiness. - if (this.state === 1) { - this.state = 2; - this.fireArgs = fireArgs; - } - if (this.numHandlers) { - // Copy the values first so that it is safe to modify it from within - // callbacks. - var toCall = []; - for (var item in this.handlers) { - toCall.push(this.handlers[item]); - } - for (var i = 0; i < toCall.length; ++i) { - toCall[i].apply(this, fireArgs); - } - if (this.state === 2 && this.numHandlers) { - this.numHandlers = 0; - this.handlers = {}; - this.onHasSubscribersChange && this.onHasSubscribersChange(); - } - } -}; - -// defining them here so they are ready super fast! -// DOM event that is received when the web page is loaded and parsed. -channel.createSticky('onDOMContentLoaded'); - -// Event to indicate the Cordova native side is ready. -channel.createSticky('onNativeReady'); - -// Event to indicate that all Cordova JavaScript objects have been created -// and it's time to run plugin constructors. -channel.createSticky('onCordovaReady'); - -// Event to indicate that all automatically loaded JS plugins are loaded and ready. -// FIXME remove this -channel.createSticky('onPluginsReady'); - -// Event to indicate that Cordova is ready -channel.createSticky('onDeviceReady'); - -// Event to indicate a resume lifecycle event -channel.create('onResume'); - -// Event to indicate a pause lifecycle event -channel.create('onPause'); - -// Channels that must fire before "deviceready" is fired. -channel.waitForInitialization('onCordovaReady'); -channel.waitForInitialization('onDOMContentLoaded'); - -module.exports = channel; - -}); - -// file: ../cordova-ios/cordova-js-src/exec.js -define("cordova/exec", function(require, exports, module) { - -/* global require, module, atob, document */ - -/** - * Creates a gap bridge iframe used to notify the native code about queued - * commands. - */ -var cordova = require('cordova'); -var utils = require('cordova/utils'); -var base64 = require('cordova/base64'); -var execIframe; -var commandQueue = []; // Contains pending JS->Native messages. -var isInContextOfEvalJs = 0; -var failSafeTimerId = 0; - -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)); - }; - 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; -} - -function iOSExec () { - - 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: ' + - '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); - - var command = [callbackId, service, action, actionArgs]; - - // Stringify and queue the command. We stringify to command now to - // effectively clone the command arguments in case they are mutated before - // the command is executed. - commandQueue.push(JSON.stringify(command)); - - // If we're in the context of a stringByEvaluatingJavaScriptFromString call, - // then the queue will be flushed when it returns; no need for a poke. - // Also, if there is already a command in the queue, then we've already - // poked the native side, so there is no reason to do so again. - if (!isInContextOfEvalJs && commandQueue.length === 1) { - pokeNative(); - } -} - -// CB-10530 -function proxyChanged () { - var cexec = cordovaExec(); - - return (execProxy !== cexec && // proxy objects are different - iOSExec !== cexec // proxy object is not the current iOSExec - ); -} - -// CB-10106 -function handleBridgeChange () { - if (proxyChanged()) { - var commandString = commandQueue.shift(); - while (commandString) { - var command = JSON.parse(commandString); - var callbackId = command[0]; - var service = command[1]; - var action = command[2]; - var actionArgs = command[3]; - var callbacks = cordova.callbacks[callbackId] || {}; - - execProxy(callbacks.success, callbacks.fail, service, action, actionArgs); - - commandString = commandQueue.shift(); - } - return true; - } - - return false; -} - -function pokeNative () { - // CB-5488 - Don't attempt to create iframe before document.body is available. - if (!document.body) { - setTimeout(pokeNative); - return; - } - - // Check if they've removed it from the DOM, and put it back if so. - if (execIframe && execIframe.contentWindow) { - execIframe.contentWindow.location = 'gap://ready'; - } else { - execIframe = document.createElement('iframe'); - execIframe.style.display = 'none'; - execIframe.src = 'gap://ready'; - document.body.appendChild(execIframe); - } - // Use a timer to protect against iframe being unloaded during the poke (CB-7735). - // This makes the bridge ~ 7% slower, but works around the poke getting lost - // when the iframe is removed from the DOM. - // An onunload listener could be used in the case where the iframe has just been - // created, but since unload events fire only once, it doesn't work in the normal - // case of iframe reuse (where unload will have already fired due to the attempted - // navigation of the page). - failSafeTimerId = setTimeout(function () { - if (commandQueue.length) { - // CB-10106 - flush the queue on bridge change - if (!handleBridgeChange()) { - pokeNative(); - } - } - }, 50); // Making this > 0 improves performance (marginally) in the normal case (where it doesn't fire). -} - -iOSExec.nativeFetchMessages = function () { - // Stop listing for window detatch once native side confirms poke. - if (failSafeTimerId) { - clearTimeout(failSafeTimerId); - failSafeTimerId = 0; - } - // Each entry in commandQueue is a JSON string already. - if (!commandQueue.length) { - return ''; - } - var json = '[' + commandQueue.join(',') + ']'; - commandQueue.length = 0; - return json; -}; - -iOSExec.nativeCallback = function (callbackId, status, message, keepCallback, debug) { - return iOSExec.nativeEvalAndFetch(function () { - var success = status === 0 || status === 1; - var args = convertMessageToArgsNativeToJs(message); - function nc2 () { - cordova.callbackFromNative(callbackId, success, status, args, keepCallback); - } - setTimeout(nc2, 0); - }); -}; - -iOSExec.nativeEvalAndFetch = function (func) { - // This shouldn't be nested, but better to be safe. - isInContextOfEvalJs++; - try { - func(); - return iOSExec.nativeFetchMessages(); - } finally { - isInContextOfEvalJs--; - } -}; - -// 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; - -}); - -// file: src/common/exec/proxy.js -define("cordova/exec/proxy", function(require, exports, module) { - -// internal map of proxy function -var CommandProxyMap = {}; - -module.exports = { - - // example: cordova.commandProxy.add("Accelerometer",{getCurrentAcceleration: function(successCallback, errorCallback, options) {...},...); - add: function (id, proxyObj) { - console.log('adding proxy for ' + id); - CommandProxyMap[id] = proxyObj; - return proxyObj; - }, - - // cordova.commandProxy.remove("Accelerometer"); - remove: function (id) { - var proxy = CommandProxyMap[id]; - delete CommandProxyMap[id]; - CommandProxyMap[id] = null; - return proxy; - }, - - get: function (service, action) { - return (CommandProxyMap[service] ? CommandProxyMap[service][action] : null); - } -}; - -}); - -// file: src/common/init.js -define("cordova/init", function(require, exports, module) { - -var channel = require('cordova/channel'); -var cordova = require('cordova'); -var modulemapper = require('cordova/modulemapper'); -var platform = require('cordova/platform'); -var pluginloader = require('cordova/pluginloader'); -var utils = require('cordova/utils'); - -var platformInitChannelsArray = [channel.onNativeReady, channel.onPluginsReady]; - -function logUnfiredChannels (arr) { - for (var i = 0; i < arr.length; ++i) { - if (arr[i].state !== 2) { - console.log('Channel not fired: ' + arr[i].type); - } - } -} - -window.setTimeout(function () { - if (channel.onDeviceReady.state !== 2) { - console.log('deviceready has not fired after 5 seconds.'); - logUnfiredChannels(platformInitChannelsArray); - logUnfiredChannels(channel.deviceReadyChannelsArray); - } -}, 5000); - -// Replace navigator before any modules are required(), to ensure it happens as soon as possible. -// We replace it so that properties that can't be clobbered can instead be overridden. -function replaceNavigator (origNavigator) { - var CordovaNavigator = function () {}; - CordovaNavigator.prototype = origNavigator; - var newNavigator = new CordovaNavigator(); - // This work-around really only applies to new APIs that are newer than Function.bind. - // Without it, APIs such as getGamepads() break. - if (CordovaNavigator.bind) { - for (var key in origNavigator) { - if (typeof origNavigator[key] === 'function') { - newNavigator[key] = origNavigator[key].bind(origNavigator); - } else { - (function (k) { - utils.defineGetterSetter(newNavigator, key, function () { - return origNavigator[k]; - }); - })(key); - } - } - } - return newNavigator; -} - -if (window.navigator) { - window.navigator = replaceNavigator(window.navigator); -} - -if (!window.console) { - window.console = { - log: function () {} - }; -} -if (!window.console.warn) { - window.console.warn = function (msg) { - this.log('warn: ' + msg); - }; -} - -// Register pause, resume and deviceready channels as events on document. -channel.onPause = cordova.addDocumentEventHandler('pause'); -channel.onResume = cordova.addDocumentEventHandler('resume'); -channel.onActivated = cordova.addDocumentEventHandler('activated'); -channel.onDeviceReady = cordova.addStickyDocumentEventHandler('deviceready'); - -// Listen for DOMContentLoaded and notify our channel subscribers. -if (document.readyState === 'complete' || document.readyState === 'interactive') { - channel.onDOMContentLoaded.fire(); -} else { - document.addEventListener('DOMContentLoaded', function () { - channel.onDOMContentLoaded.fire(); - }, false); -} - -// _nativeReady is global variable that the native side can set -// to signify that the native code is ready. It is a global since -// it may be called before any cordova JS is ready. -if (window._nativeReady) { - channel.onNativeReady.fire(); -} - -modulemapper.clobbers('cordova', 'cordova'); -modulemapper.clobbers('cordova/exec', 'cordova.exec'); -modulemapper.clobbers('cordova/exec', 'Cordova.exec'); - -// Call the platform-specific initialization. -platform.bootstrap && platform.bootstrap(); - -// Wrap in a setTimeout to support the use-case of having plugin JS appended to cordova.js. -// The delay allows the attached modules to be defined before the plugin loader looks for them. -setTimeout(function () { - pluginloader.load(function () { - channel.onPluginsReady.fire(); - }); -}, 0); - -/** - * Create all cordova objects once native side is ready. - */ -channel.join(function () { - modulemapper.mapModules(window); - - platform.initialize && platform.initialize(); - - // Fire event to notify that all objects are created - channel.onCordovaReady.fire(); - - // Fire onDeviceReady event once page has fully loaded, all - // constructors have run and cordova info has been received from native - // side. - channel.join(function () { - require('cordova').fireDocumentEvent('deviceready'); - }, channel.deviceReadyChannelsArray); - -}, platformInitChannelsArray); - -}); - -// file: src/common/modulemapper.js -define("cordova/modulemapper", function(require, exports, module) { - -var builder = require('cordova/builder'); -var moduleMap = define.moduleMap; -var symbolList; -var deprecationMap; - -exports.reset = function () { - symbolList = []; - deprecationMap = {}; -}; - -function addEntry (strategy, moduleName, symbolPath, opt_deprecationMessage) { - if (!(moduleName in moduleMap)) { - throw new Error('Module ' + moduleName + ' does not exist.'); - } - symbolList.push(strategy, moduleName, symbolPath); - if (opt_deprecationMessage) { - deprecationMap[symbolPath] = opt_deprecationMessage; - } -} - -// Note: Android 2.3 does have Function.bind(). -exports.clobbers = function (moduleName, symbolPath, opt_deprecationMessage) { - addEntry('c', moduleName, symbolPath, opt_deprecationMessage); -}; - -exports.merges = function (moduleName, symbolPath, opt_deprecationMessage) { - addEntry('m', moduleName, symbolPath, opt_deprecationMessage); -}; - -exports.defaults = function (moduleName, symbolPath, opt_deprecationMessage) { - addEntry('d', moduleName, symbolPath, opt_deprecationMessage); -}; - -exports.runs = function (moduleName) { - addEntry('r', moduleName, null); -}; - -function prepareNamespace (symbolPath, context) { - if (!symbolPath) { - return context; - } - return symbolPath.split('.').reduce(function (cur, part) { - return (cur[part] = cur[part] || {}); - }, context); -} - -exports.mapModules = function (context) { - var origSymbols = {}; - context.CDV_origSymbols = origSymbols; - for (var i = 0, len = symbolList.length; i < len; i += 3) { - var strategy = symbolList[i]; - var moduleName = symbolList[i + 1]; - var module = require(moduleName); - // - if (strategy === 'r') { - continue; - } - var symbolPath = symbolList[i + 2]; - var lastDot = symbolPath.lastIndexOf('.'); - var namespace = symbolPath.substr(0, lastDot); - var lastName = symbolPath.substr(lastDot + 1); - - var deprecationMsg = symbolPath in deprecationMap ? 'Access made to deprecated symbol: ' + symbolPath + '. ' + deprecationMsg : null; - var parentObj = prepareNamespace(namespace, context); - var target = parentObj[lastName]; - - if (strategy === 'm' && target) { - builder.recursiveMerge(target, module); - } else if ((strategy === 'd' && !target) || (strategy !== 'd')) { - if (!(symbolPath in origSymbols)) { - origSymbols[symbolPath] = target; - } - builder.assignOrWrapInDeprecateGetter(parentObj, lastName, module, deprecationMsg); - } - } -}; - -exports.getOriginalSymbol = function (context, symbolPath) { - var origSymbols = context.CDV_origSymbols; - if (origSymbols && (symbolPath in origSymbols)) { - return origSymbols[symbolPath]; - } - var parts = symbolPath.split('.'); - var obj = context; - for (var i = 0; i < parts.length; ++i) { - obj = obj && obj[parts[i]]; - } - return obj; -}; - -exports.reset(); - -}); - -// file: ../cordova-ios/cordova-js-src/platform.js -define("cordova/platform", function(require, exports, module) { - -module.exports = { - id: 'ios', - bootstrap: function () { - // Attach the console polyfill that is iOS-only to window.console - // see the file under plugin/ios/console.js - require('cordova/modulemapper').clobbers('cordova/plugin/ios/console', 'window.console'); - - require('cordova/channel').onNativeReady.fire(); - } -}; - -}); - -// file: ../cordova-ios/cordova-js-src/plugin/ios/console.js -define("cordova/plugin/ios/console", function(require, exports, module) { - -// ------------------------------------------------------------------------------ - -var logger = require('cordova/plugin/ios/logger'); - -// ------------------------------------------------------------------------------ -// object that we're exporting -// ------------------------------------------------------------------------------ -var console = module.exports; - -// ------------------------------------------------------------------------------ -// copy of the original console object -// ------------------------------------------------------------------------------ -var WinConsole = window.console; - -// ------------------------------------------------------------------------------ -// whether to use the logger -// ------------------------------------------------------------------------------ -var UseLogger = false; - -// ------------------------------------------------------------------------------ -// Timers -// ------------------------------------------------------------------------------ -var Timers = {}; - -// ------------------------------------------------------------------------------ -// used for unimplemented methods -// ------------------------------------------------------------------------------ -function noop () {} - -// ------------------------------------------------------------------------------ -// used for unimplemented methods -// ------------------------------------------------------------------------------ -console.useLogger = function (value) { - if (arguments.length) UseLogger = !!value; - - if (UseLogger) { - if (logger.useConsole()) { - throw new Error('console and logger are too intertwingly'); - } - } - - return UseLogger; -}; - -// ------------------------------------------------------------------------------ -console.log = function () { - if (logger.useConsole()) return; - logger.log.apply(logger, [].slice.call(arguments)); -}; - -// ------------------------------------------------------------------------------ -console.error = function () { - if (logger.useConsole()) return; - logger.error.apply(logger, [].slice.call(arguments)); -}; - -// ------------------------------------------------------------------------------ -console.warn = function () { - if (logger.useConsole()) return; - logger.warn.apply(logger, [].slice.call(arguments)); -}; - -// ------------------------------------------------------------------------------ -console.info = function () { - if (logger.useConsole()) return; - logger.info.apply(logger, [].slice.call(arguments)); -}; - -// ------------------------------------------------------------------------------ -console.debug = function () { - if (logger.useConsole()) return; - logger.debug.apply(logger, [].slice.call(arguments)); -}; - -// ------------------------------------------------------------------------------ -console.assert = function (expression) { - if (expression) return; - - var message = logger.format.apply(logger.format, [].slice.call(arguments, 1)); - console.log('ASSERT: ' + message); -}; - -// ------------------------------------------------------------------------------ -console.clear = function () {}; - -// ------------------------------------------------------------------------------ -console.dir = function (object) { - console.log('%o', object); -}; - -// ------------------------------------------------------------------------------ -console.dirxml = function (node) { - console.log(node.innerHTML); -}; - -// ------------------------------------------------------------------------------ -console.trace = noop; - -// ------------------------------------------------------------------------------ -console.group = console.log; - -// ------------------------------------------------------------------------------ -console.groupCollapsed = console.log; - -// ------------------------------------------------------------------------------ -console.groupEnd = noop; - -// ------------------------------------------------------------------------------ -console.time = function (name) { - Timers[name] = new Date().valueOf(); -}; - -// ------------------------------------------------------------------------------ -console.timeEnd = function (name) { - var timeStart = Timers[name]; - if (!timeStart) { - console.warn('unknown timer: ' + name); - return; - } - - var timeElapsed = new Date().valueOf() - timeStart; - console.log(name + ': ' + timeElapsed + 'ms'); -}; - -// ------------------------------------------------------------------------------ -console.timeStamp = noop; - -// ------------------------------------------------------------------------------ -console.profile = noop; - -// ------------------------------------------------------------------------------ -console.profileEnd = noop; - -// ------------------------------------------------------------------------------ -console.count = noop; - -// ------------------------------------------------------------------------------ -console.exception = console.log; - -// ------------------------------------------------------------------------------ -console.table = function (data, columns) { - console.log('%o', data); -}; - -// ------------------------------------------------------------------------------ -// return a new function that calls both functions passed as args -// ------------------------------------------------------------------------------ -function wrappedOrigCall (orgFunc, newFunc) { - return function () { - var args = [].slice.call(arguments); - try { orgFunc.apply(WinConsole, args); } catch (e) {} - try { newFunc.apply(console, args); } catch (e) {} - }; -} - -// ------------------------------------------------------------------------------ -// For every function that exists in the original console object, that -// also exists in the new console object, wrap the new console method -// with one that calls both -// ------------------------------------------------------------------------------ -for (var key in console) { - if (typeof WinConsole[key] === 'function') { - console[key] = wrappedOrigCall(WinConsole[key], console[key]); - } -} - -}); - -// file: ../cordova-ios/cordova-js-src/plugin/ios/logger.js -define("cordova/plugin/ios/logger", function(require, exports, module) { - -// ------------------------------------------------------------------------------ -// The logger module exports the following properties/functions: -// -// LOG - constant for the level LOG -// ERROR - constant for the level ERROR -// WARN - constant for the level WARN -// INFO - constant for the level INFO -// DEBUG - constant for the level DEBUG -// logLevel() - returns current log level -// logLevel(value) - sets and returns a new log level -// useConsole() - returns whether logger is using console -// useConsole(value) - sets and returns whether logger is using console -// log(message,...) - logs a message at level LOG -// error(message,...) - logs a message at level ERROR -// warn(message,...) - logs a message at level WARN -// info(message,...) - logs a message at level INFO -// debug(message,...) - logs a message at level DEBUG -// logLevel(level,message,...) - logs a message specified level -// -// ------------------------------------------------------------------------------ - -var logger = exports; - -var exec = require('cordova/exec'); - -var UseConsole = false; -var UseLogger = true; -var Queued = []; -var DeviceReady = false; -var CurrentLevel; - -var originalConsole = console; - -/** - * Logging levels - */ - -var Levels = [ - 'LOG', - 'ERROR', - 'WARN', - 'INFO', - 'DEBUG' -]; - -/* - * add the logging levels to the logger object and - * to a separate levelsMap object for testing - */ - -var LevelsMap = {}; -for (var i = 0; i < Levels.length; i++) { - var level = Levels[i]; - LevelsMap[level] = i; - logger[level] = level; -} - -CurrentLevel = LevelsMap.WARN; - -/** - * Getter/Setter for the logging level - * - * Returns the current logging level. - * - * When a value is passed, sets the logging level to that value. - * The values should be one of the following constants: - * logger.LOG - * logger.ERROR - * logger.WARN - * logger.INFO - * logger.DEBUG - * - * The value used determines which messages get printed. The logging - * values above are in order, and only messages logged at the logging - * level or above will actually be displayed to the user. E.g., the - * default level is WARN, so only messages logged with LOG, ERROR, or - * WARN will be displayed; INFO and DEBUG messages will be ignored. - */ -logger.level = function (value) { - if (arguments.length) { - if (LevelsMap[value] === null) { - throw new Error('invalid logging level: ' + value); - } - CurrentLevel = LevelsMap[value]; - } - - return Levels[CurrentLevel]; -}; - -/** - * Getter/Setter for the useConsole functionality - * - * When useConsole is true, the logger will log via the - * browser 'console' object. - */ -logger.useConsole = function (value) { - if (arguments.length) UseConsole = !!value; - - if (UseConsole) { - if (typeof console === 'undefined') { - throw new Error('global console object is not defined'); - } - - if (typeof console.log !== 'function') { - throw new Error('global console object does not have a log function'); - } - - if (typeof console.useLogger === 'function') { - if (console.useLogger()) { - throw new Error('console and logger are too intertwingly'); - } - } - } - - return UseConsole; -}; - -/** - * Getter/Setter for the useLogger functionality - * - * When useLogger is true, the logger will log via the - * native Logger plugin. - */ -logger.useLogger = function (value) { - // Enforce boolean - if (arguments.length) UseLogger = !!value; - return UseLogger; -}; - -/** - * Logs a message at the LOG level. - * - * Parameters passed after message are used applied to - * the message with utils.format() - */ -logger.log = function (message) { logWithArgs('LOG', arguments); }; - -/** - * Logs a message at the ERROR level. - * - * Parameters passed after message are used applied to - * the message with utils.format() - */ -logger.error = function (message) { logWithArgs('ERROR', arguments); }; - -/** - * Logs a message at the WARN level. - * - * Parameters passed after message are used applied to - * the message with utils.format() - */ -logger.warn = function (message) { logWithArgs('WARN', arguments); }; - -/** - * Logs a message at the INFO level. - * - * Parameters passed after message are used applied to - * the message with utils.format() - */ -logger.info = function (message) { logWithArgs('INFO', arguments); }; - -/** - * Logs a message at the DEBUG level. - * - * Parameters passed after message are used applied to - * the message with utils.format() - */ -logger.debug = function (message) { logWithArgs('DEBUG', arguments); }; - -// log at the specified level with args -function logWithArgs (level, args) { - args = [level].concat([].slice.call(args)); - logger.logLevel.apply(logger, args); -} - -// return the correct formatString for an object -function formatStringForMessage (message) { - return (typeof message === 'string') ? '' : '%o'; -} - -/** - * Logs a message at the specified level. - * - * Parameters passed after message are used applied to - * the message with utils.format() - */ -logger.logLevel = function (level /* , ... */) { - // format the message with the parameters - var formatArgs = [].slice.call(arguments, 1); - var fmtString = formatStringForMessage(formatArgs[0]); - if (fmtString.length > 0) { - formatArgs.unshift(fmtString); // add formatString - } - - var message = logger.format.apply(logger.format, formatArgs); - - if (LevelsMap[level] === null) { - throw new Error('invalid logging level: ' + level); - } - - if (LevelsMap[level] > CurrentLevel) return; - - // queue the message if not yet at deviceready - if (!DeviceReady && !UseConsole) { - Queued.push([level, message]); - return; - } - - // Log using the native logger if that is enabled - if (UseLogger) { - exec(null, null, 'Console', 'logLevel', [level, message]); - } - - // Log using the console if that is enabled - if (UseConsole) { - // make sure console is not using logger - if (console.useLogger()) { - throw new Error('console and logger are too intertwingly'); - } - - // log to the console - switch (level) { - case logger.LOG: originalConsole.log(message); break; - case logger.ERROR: originalConsole.log('ERROR: ' + message); break; - case logger.WARN: originalConsole.log('WARN: ' + message); break; - case logger.INFO: originalConsole.log('INFO: ' + message); break; - case logger.DEBUG: originalConsole.log('DEBUG: ' + message); break; - } - } -}; - -/** - * Formats a string and arguments following it ala console.log() - * - * Any remaining arguments will be appended to the formatted string. - * - * for rationale, see FireBug's Console API: - * http://getfirebug.com/wiki/index.php/Console_API - */ -logger.format = function (formatString, args) { - return __format(arguments[0], [].slice.call(arguments, 1)).join(' '); -}; - -// ------------------------------------------------------------------------------ -/** - * Formats a string and arguments following it ala vsprintf() - * - * format chars: - * %j - format arg as JSON - * %o - format arg as JSON - * %c - format arg as '' - * %% - replace with '%' - * any other char following % will format it's - * arg via toString(). - * - * Returns an array containing the formatted string and any remaining - * arguments. - */ -function __format (formatString, args) { - if (formatString === null || formatString === undefined) return ['']; - if (arguments.length === 1) return [formatString.toString()]; - - if (typeof formatString !== 'string') { formatString = formatString.toString(); } - - var pattern = /(.*?)%(.)(.*)/; - var rest = formatString; - var result = []; - - while (args.length) { - var match = pattern.exec(rest); - if (!match) break; - - var arg = args.shift(); - rest = match[3]; - result.push(match[1]); - - if (match[2] === '%') { - result.push('%'); - args.unshift(arg); - continue; - } - - result.push(__formatted(arg, match[2])); - } - - result.push(rest); - - var remainingArgs = [].slice.call(args); - remainingArgs.unshift(result.join('')); - return remainingArgs; -} - -function __formatted (object, formatChar) { - - try { - switch (formatChar) { - case 'j': - case 'o': return JSON.stringify(object); - case 'c': return ''; - } - } catch (e) { - return 'error JSON.stringify()ing argument: ' + e; - } - - if ((object === null) || (object === undefined)) { - return Object.prototype.toString.call(object); - } - - return object.toString(); -} - -// ------------------------------------------------------------------------------ -// when deviceready fires, log queued messages -logger.__onDeviceReady = function () { - if (DeviceReady) return; - - DeviceReady = true; - - for (var i = 0; i < Queued.length; i++) { - var messageArgs = Queued[i]; - logger.logLevel(messageArgs[0], messageArgs[1]); - } - - Queued = null; -}; - -// add a deviceready event to log queued messages -document.addEventListener('deviceready', logger.__onDeviceReady, false); - -}); - -// file: src/common/pluginloader.js -define("cordova/pluginloader", function(require, exports, module) { - -var modulemapper = require('cordova/modulemapper'); - -// Helper function to inject a - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/project/www/js/index.js b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/project/www/js/index.js deleted file mode 100755 index f6d6793..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/project/www/js/index.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -var app = { - // Application Constructor - initialize: function () { - this.bindEvents(); - }, - // Bind Event Listeners - // - // Bind any events that are required on startup. Common events are: - // 'load', 'deviceready', 'offline', and 'online'. - bindEvents: function () { - document.addEventListener('deviceready', this.onDeviceReady, false); - }, - // deviceready Event Handler - // - // The scope of 'this' is the event. In order to call the 'receivedEvent' - // function, we must explicitly call 'app.receivedEvent(...);' - onDeviceReady: function () { - app.receivedEvent('deviceready'); - }, - // Update DOM on a Received Event - receivedEvent: function (id) { - var parentElement = document.getElementById(id); - var listeningElement = parentElement.querySelector('.listening'); - var receivedElement = parentElement.querySelector('.received'); - - listeningElement.setAttribute('style', 'display:none;'); - receivedElement.setAttribute('style', 'display:block;'); - - console.log('Received Event: ' + id); - } -}; - -app.initialize(); diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/Api.js b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/Api.js deleted file mode 100644 index e45b782..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/Api.js +++ /dev/null @@ -1,715 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -/* jslint node: true */ - -var fs = require('fs'); -var path = require('path'); -var unorm = require('unorm'); -var projectFile = require('./lib/projectFile'); -var check_reqs = require('./lib/check_reqs'); -var CordovaError = require('cordova-common').CordovaError; -var CordovaLogger = require('cordova-common').CordovaLogger; -var events = require('cordova-common').events; -var PluginManager = require('cordova-common').PluginManager; -var Q = require('q'); -var util = require('util'); -var xcode = require('xcode'); -var ConfigParser = require('cordova-common').ConfigParser; - -function setupEvents (externalEventEmitter) { - if (externalEventEmitter) { - // This will make the platform internal events visible outside - events.forwardEventsTo(externalEventEmitter); - } else { - // There is no logger if external emitter is not present, - // so attach a console logger - CordovaLogger.get().subscribe(events); - } -} - -/** - * Creates a new PlatformApi instance. - * - * @param {String} [platform] Platform name, used for backward compatibility - * w/ PlatformPoly (CordovaLib). - * @param {String} [platformRootDir] Platform root location, used for backward - * compatibility w/ PlatformPoly (CordovaLib). - * @param {EventEmitter} [events] An EventEmitter instance that will be used for - * logging purposes. If no EventEmitter provided, all events will be logged to - * console - */ -function Api (platform, platformRootDir, events) { - // 'platform' property is required as per PlatformApi spec - this.platform = platform || 'ios'; - this.root = platformRootDir || path.resolve(__dirname, '..'); - - setupEvents(events); - - var xcodeProjDir; - var xcodeCordovaProj; - - try { - - var xcodeProjDir_array = fs.readdirSync(this.root).filter(function (e) { return e.match(/\.xcodeproj$/i); }); - if (xcodeProjDir_array.length > 1) { - for (var x = 0; x < xcodeProjDir_array.length; x++) { - if (xcodeProjDir_array[x].substring(0, 2) === '._') { - xcodeProjDir_array.splice(x, 1); - } - } - } - xcodeProjDir = xcodeProjDir_array[0]; - - if (!xcodeProjDir) { - throw new CordovaError('The provided path "' + this.root + '" is not a Cordova iOS project.'); - } - - var cordovaProjName = xcodeProjDir.substring(xcodeProjDir.lastIndexOf(path.sep) + 1, xcodeProjDir.indexOf('.xcodeproj')); - xcodeCordovaProj = path.join(this.root, cordovaProjName); - } catch (e) { - throw new CordovaError('The provided path "' + this.root + '" is not a Cordova iOS project.'); - } - - this.locations = { - root: this.root, - www: path.join(this.root, 'www'), - platformWww: path.join(this.root, 'platform_www'), - configXml: path.join(xcodeCordovaProj, 'config.xml'), - defaultConfigXml: path.join(this.root, 'cordova/defaults.xml'), - pbxproj: path.join(this.root, xcodeProjDir, 'project.pbxproj'), - xcodeProjDir: path.join(this.root, xcodeProjDir), - xcodeCordovaProj: xcodeCordovaProj - }; -} - -/** - * Creates platform in a specified directory. - * - * @param {String} destination Destination directory, where install platform to - * @param {ConfigParser} [config] ConfigParser instance, used to retrieve - * project creation options, such as package id and project name. - * @param {Object} [options] An options object. The most common options are: - * @param {String} [options.customTemplate] A path to custom template, that - * should override the default one from platform. - * @param {Boolean} [options.link] Flag that indicates that platform's - * sources will be linked to installed platform instead of copying. - * @param {EventEmitter} [events] An EventEmitter instance that will be used for - * logging purposes. If no EventEmitter provided, all events will be logged to - * console - * - * @return {Promise} Promise either fulfilled with PlatformApi - * instance or rejected with CordovaError. - */ -Api.createPlatform = function (destination, config, options, events) { - setupEvents(events); - - // CB-6992 it is necessary to normalize characters - // because node and shell scripts handles unicode symbols differently - // We need to normalize the name to NFD form since iOS uses NFD unicode form - var name = unorm.nfd(config.name()); - var result; - try { - result = require('../../../lib/create') - .createProject(destination, config.getAttribute('ios-CFBundleIdentifier') || config.packageName(), name, options, config) - .then(function () { - // after platform is created we return Api instance based on new Api.js location - // This is required to correctly resolve paths in the future api calls - var PlatformApi = require(path.resolve(destination, 'cordova/Api')); - return new PlatformApi('ios', destination, events); - }); - } catch (e) { - events.emit('error', 'createPlatform is not callable from the iOS project API.'); - throw e; - } - return result; -}; - -/** - * Updates already installed platform. - * - * @param {String} destination Destination directory, where platform installed - * @param {Object} [options] An options object. The most common options are: - * @param {String} [options.customTemplate] A path to custom template, that - * should override the default one from platform. - * @param {Boolean} [options.link] Flag that indicates that platform's - * sources will be linked to installed platform instead of copying. - * @param {EventEmitter} [events] An EventEmitter instance that will be used for - * logging purposes. If no EventEmitter provided, all events will be logged to - * console - * - * @return {Promise} Promise either fulfilled with PlatformApi - * instance or rejected with CordovaError. - */ -Api.updatePlatform = function (destination, options, events) { - setupEvents(events); - - var result; - try { - result = require('../../../lib/create') - .updateProject(destination, options) - .then(function () { - var PlatformApi = require(path.resolve(destination, 'cordova/Api')); - return new PlatformApi('ios', destination, events); - }); - } catch (e) { - events.emit('error', 'updatePlatform is not callable from the iOS project API, you will need to do this manually.'); - throw e; - } - return result; -}; - -/** - * Gets a CordovaPlatform object, that represents the platform structure. - * - * @return {CordovaPlatform} A structure that contains the description of - * platform's file structure and other properties of platform. - */ -Api.prototype.getPlatformInfo = function () { - var result = {}; - result.locations = this.locations; - result.root = this.root; - result.name = this.platform; - result.version = require('./version'); - result.projectConfig = new ConfigParser(this.locations.configXml); - - return result; -}; - -/** - * Updates installed platform with provided www assets and new app - * configuration. This method is required for CLI workflow and will be called - * each time before build, so the changes, made to app configuration and www - * code, will be applied to platform. - * - * @param {CordovaProject} cordovaProject A CordovaProject instance, that defines a - * project structure and configuration, that should be applied to platform - * (contains project's www location and ConfigParser instance for project's - * config). - * - * @return {Promise} Return a promise either fulfilled, or rejected with - * CordovaError instance. - */ -Api.prototype.prepare = function (cordovaProject) { - cordovaProject.projectConfig = new ConfigParser(cordovaProject.locations.rootConfigXml || cordovaProject.projectConfig.path); - - return require('./lib/prepare').prepare.call(this, cordovaProject); -}; - -/** - * Installs a new plugin into platform. It doesn't resolves plugin dependencies. - * - * @param {PluginInfo} plugin A PluginInfo instance that represents plugin - * that will be installed. - * @param {Object} installOptions An options object. Possible options below: - * @param {Boolean} installOptions.link: Flag that specifies that plugin - * sources will be symlinked to app's directory instead of copying (if - * possible). - * @param {Object} installOptions.variables An object that represents - * variables that will be used to install plugin. See more details on plugin - * variables in documentation: - * https://cordova.apache.org/docs/en/4.0.0/plugin_ref_spec.md.html - * - * @return {Promise} Return a promise either fulfilled, or rejected with - * CordovaError instance. - */ -Api.prototype.addPlugin = function (plugin, installOptions) { - - var xcodeproj = projectFile.parse(this.locations); - var self = this; - - installOptions = installOptions || {}; - installOptions.variables = installOptions.variables || {}; - // Add PACKAGE_NAME variable into vars - if (!installOptions.variables.PACKAGE_NAME) { - installOptions.variables.PACKAGE_NAME = xcodeproj.getPackageName(); - } - - return PluginManager.get(self.platform, self.locations, xcodeproj) - .addPlugin(plugin, installOptions) - .then(function () { - if (plugin != null) { - var headerTags = plugin.getHeaderFiles(self.platform); - var bridgingHeaders = headerTags.filter(function (obj) { - return (obj.type === 'BridgingHeader'); - }); - if (bridgingHeaders.length > 0) { - var project_dir = self.locations.root; - var project_name = self.locations.xcodeCordovaProj.split('/').pop(); - var BridgingHeader = require('./lib/BridgingHeader').BridgingHeader; - var bridgingHeaderFile = new BridgingHeader(path.join(project_dir, project_name, 'Bridging-Header.h')); - events.emit('verbose', 'Adding Bridging-Headers since the plugin contained with type="BridgingHeader"'); - bridgingHeaders.forEach(function (obj) { - var bridgingHeaderPath = path.basename(obj.src); - bridgingHeaderFile.addHeader(plugin.id, bridgingHeaderPath); - }); - bridgingHeaderFile.write(); - } - } - }) - .then(function () { - if (plugin != null) { - var podSpecs = plugin.getPodSpecs ? plugin.getPodSpecs(self.platform) : []; - var frameworkTags = plugin.getFrameworks(self.platform); - var frameworkPods = frameworkTags.filter(function (obj) { - return (obj.type === 'podspec'); - }); - return self.addPodSpecs(plugin, podSpecs, frameworkPods); - } - }) - // CB-11022 return non-falsy value to indicate - // that there is no need to run prepare after - .thenResolve(true); -}; - -/** - * Removes an installed plugin from platform. - * - * Since method accepts PluginInfo instance as input parameter instead of plugin - * id, caller shoud take care of managing/storing PluginInfo instances for - * future uninstalls. - * - * @param {PluginInfo} plugin A PluginInfo instance that represents plugin - * that will be installed. - * - * @return {Promise} Return a promise either fulfilled, or rejected with - * CordovaError instance. - */ -Api.prototype.removePlugin = function (plugin, uninstallOptions) { - var xcodeproj = projectFile.parse(this.locations); - var self = this; - - return PluginManager.get(self.platform, self.locations, xcodeproj) - .removePlugin(plugin, uninstallOptions) - .then(function () { - if (plugin != null) { - var headerTags = plugin.getHeaderFiles(self.platform); - var bridgingHeaders = headerTags.filter(function (obj) { - return (obj.type === 'BridgingHeader'); - }); - if (bridgingHeaders.length > 0) { - var project_dir = self.locations.root; - var project_name = self.locations.xcodeCordovaProj.split('/').pop(); - var BridgingHeader = require('./lib/BridgingHeader').BridgingHeader; - var bridgingHeaderFile = new BridgingHeader(path.join(project_dir, project_name, 'Bridging-Header.h')); - events.emit('verbose', 'Removing Bridging-Headers since the plugin contained with type="BridgingHeader"'); - bridgingHeaders.forEach(function (obj) { - var bridgingHeaderPath = path.basename(obj.src); - bridgingHeaderFile.removeHeader(plugin.id, bridgingHeaderPath); - }); - bridgingHeaderFile.write(); - } - } - }) - .then(function () { - if (plugin != null) { - var podSpecs = plugin.getPodSpecs ? plugin.getPodSpecs(self.platform) : []; - var frameworkTags = plugin.getFrameworks(self.platform); - var frameworkPods = frameworkTags.filter(function (obj) { - return (obj.type === 'podspec'); - }); - return self.removePodSpecs(plugin, podSpecs, frameworkPods); - } - }) - // CB-11022 return non-falsy value to indicate - // that there is no need to run prepare after - .thenResolve(true); -}; - -/** - * adding CocoaPods libraries - * - * @param {PluginInfo} plugin A PluginInfo instance that represents plugin - * that will be installed. - * @param {Object} podSpecs: the return value of plugin.getPodSpecs(self.platform) - * @param {Object} frameworkPods: framework tags object with type === 'podspec' - * @return {Promise} Return a promise - */ - -Api.prototype.addPodSpecs = function (plugin, podSpecs, frameworkPods) { - var self = this; - - var project_dir = self.locations.root; - var project_name = self.locations.xcodeCordovaProj.split('/').pop(); - var minDeploymentTarget = self.getPlatformInfo().projectConfig.getPreference('deployment-target', 'ios'); - - var Podfile = require('./lib/Podfile').Podfile; - var PodsJson = require('./lib/PodsJson').PodsJson; - var podsjsonFile = new PodsJson(path.join(project_dir, PodsJson.FILENAME)); - var podfileFile = new Podfile(path.join(project_dir, Podfile.FILENAME), project_name, minDeploymentTarget); - - if (podSpecs.length) { - events.emit('verbose', 'Adding pods since the plugin contained '); - podSpecs.forEach(function (obj) { - // declarations - Object.keys(obj.declarations).forEach(function (key) { - if (obj.declarations[key] === 'true') { - var declaration = Podfile.proofDeclaration(key); - var podJson = { - declaration: declaration - }; - var val = podsjsonFile.getDeclaration(declaration); - if (val) { - podsjsonFile.incrementDeclaration(declaration); - } else { - podJson.count = 1; - podsjsonFile.setJsonDeclaration(declaration, podJson); - podfileFile.addDeclaration(podJson.declaration); - } - } - }); - // sources - Object.keys(obj.sources).forEach(function (key) { - var podJson = { - source: obj.sources[key].source - }; - var val = podsjsonFile.getSource(key); - if (val) { - podsjsonFile.incrementSource(key); - } else { - podJson.count = 1; - podsjsonFile.setJsonSource(key, podJson); - podfileFile.addSource(podJson.source); - } - }); - // libraries - Object.keys(obj.libraries).forEach(function (key) { - var podJson = Object.assign({}, obj.libraries[key]); - var val = podsjsonFile.getLibrary(key); - if (val) { - events.emit('warn', plugin.id + ' depends on ' + podJson.name + ', which may conflict with another plugin. ' + podJson.name + '@' + val.spec + ' is already installed and was not overwritten.'); - podsjsonFile.incrementLibrary(key); - } else { - podJson.count = 1; - podsjsonFile.setJsonLibrary(key, podJson); - podfileFile.addSpec(podJson.name, podJson); - } - }); - - }); - } - - if (frameworkPods.length) { - events.emit('warn', '"framework" tag with type "podspec" is deprecated and will be removed. Please use the "podspec" tag.'); - events.emit('verbose', 'Adding pods since the plugin contained (s) with type="podspec"'); - frameworkPods.forEach(function (obj) { - var podJson = { - name: obj.src, - type: obj.type, - spec: obj.spec - }; - - var val = podsjsonFile.getLibrary(podJson.name); - if (val) { // found - if (podJson.spec !== val.spec) { // exists, different spec, print warning - events.emit('warn', plugin.id + ' depends on ' + podJson.name + '@' + podJson.spec + ', which conflicts with another plugin. ' + podJson.name + '@' + val.spec + ' is already installed and was not overwritten.'); - } - // increment count, but don't add in Podfile because it already exists - podsjsonFile.incrementLibrary(podJson.name); - } else { // not found, write new - podJson.count = 1; - podsjsonFile.setJsonLibrary(podJson.name, podJson); - // add to Podfile - podfileFile.addSpec(podJson.name, podJson.spec); - } - }); - } - - if (podSpecs.length > 0 || frameworkPods.length > 0) { - // now that all the pods have been processed, write to pods.json - podsjsonFile.write(); - - // only write and pod install if the Podfile changed - if (podfileFile.isDirty()) { - podfileFile.write(); - events.emit('verbose', 'Running `pod install` (to install plugins)'); - projectFile.purgeProjectFileCache(self.locations.root); - - return podfileFile.install(check_reqs.check_cocoapods) - .then(function () { - return self.setSwiftVersionForCocoaPodsLibraries(podsjsonFile); - }); - } else { - events.emit('verbose', 'Podfile unchanged, skipping `pod install`'); - } - } - return Q.when(); -}; - -/** - * removing CocoaPods libraries - * - * @param {PluginInfo} plugin A PluginInfo instance that represents plugin - * that will be installed. - * @param {Object} podSpecs: the return value of plugin.getPodSpecs(self.platform) - * @param {Object} frameworkPods: framework tags object with type === 'podspec' - * @return {Promise} Return a promise - */ - -Api.prototype.removePodSpecs = function (plugin, podSpecs, frameworkPods) { - var self = this; - - var project_dir = self.locations.root; - var project_name = self.locations.xcodeCordovaProj.split('/').pop(); - - var Podfile = require('./lib/Podfile').Podfile; - var PodsJson = require('./lib/PodsJson').PodsJson; - var podsjsonFile = new PodsJson(path.join(project_dir, PodsJson.FILENAME)); - var podfileFile = new Podfile(path.join(project_dir, Podfile.FILENAME), project_name); - - if (podSpecs.length) { - events.emit('verbose', 'Adding pods since the plugin contained '); - podSpecs.forEach(function (obj) { - // declarations - Object.keys(obj.declarations).forEach(function (key) { - if (obj.declarations[key] === 'true') { - var declaration = Podfile.proofDeclaration(key); - var podJson = { - declaration: declaration - }; - var val = podsjsonFile.getDeclaration(declaration); - if (val) { - podsjsonFile.decrementDeclaration(declaration); - } else { - var message = util.format('plugin \"%s\" declaration \"%s\" does not seem to be in pods.json, nothing to remove. Will attempt to remove from Podfile.', plugin.id, podJson.declaration); /* eslint no-useless-escape : 0 */ - events.emit('verbose', message); - } - if (!val || val.count === 0) { - podfileFile.removeDeclaration(podJson.declaration); - } - } - }); - // sources - Object.keys(obj.sources).forEach(function (key) { - var podJson = { - source: obj.sources[key].source - }; - var val = podsjsonFile.getSource(key); - if (val) { - podsjsonFile.decrementSource(key); - } else { - var message = util.format('plugin \"%s\" source \"%s\" does not seem to be in pods.json, nothing to remove. Will attempt to remove from Podfile.', plugin.id, podJson.source); /* eslint no-useless-escape : 0 */ - events.emit('verbose', message); - } - if (!val || val.count === 0) { - podfileFile.removeSource(podJson.source); - } - }); - // libraries - Object.keys(obj.libraries).forEach(function (key) { - var podJson = Object.assign({}, obj.libraries[key]); - var val = podsjsonFile.getLibrary(key); - if (val) { - podsjsonFile.decrementLibrary(key); - } else { - var message = util.format('plugin \"%s\" podspec \"%s\" does not seem to be in pods.json, nothing to remove. Will attempt to remove from Podfile.', plugin.id, podJson.name); /* eslint no-useless-escape : 0 */ - events.emit('verbose', message); - } - if (!val || val.count === 0) { - podfileFile.removeSpec(podJson.name); - } - }); - - }); - } - - if (frameworkPods.length) { - events.emit('warn', '"framework" tag with type "podspec" is deprecated and will be removed. Please use the "podspec" tag.'); - events.emit('verbose', 'Adding pods since the plugin contained (s) with type=\"podspec\"'); /* eslint no-useless-escape : 0 */ - frameworkPods.forEach(function (obj) { - var podJson = { - name: obj.src, - type: obj.type, - spec: obj.spec - }; - - var val = podsjsonFile.getLibrary(podJson.name); - if (val) { // found, decrement count - podsjsonFile.decrementLibrary(podJson.name); - } else { // not found (perhaps a sync error) - var message = util.format('plugin \"%s\" podspec \"%s\" does not seem to be in pods.json, nothing to remove. Will attempt to remove from Podfile.', plugin.id, podJson.name); /* eslint no-useless-escape : 0 */ - events.emit('verbose', message); - } - - // always remove from the Podfile - podfileFile.removeSpec(podJson.name); - }); - } - - if (podSpecs.length > 0 || frameworkPods.length > 0) { - // now that all the pods have been processed, write to pods.json - podsjsonFile.write(); - - if (podfileFile.isDirty()) { - podfileFile.write(); - events.emit('verbose', 'Running `pod install` (to uninstall pods)'); - - return podfileFile.install(check_reqs.check_cocoapods) - .then(function () { - return self.setSwiftVersionForCocoaPodsLibraries(podsjsonFile); - }); - } else { - events.emit('verbose', 'Podfile unchanged, skipping `pod install`'); - } - } - return Q.when(); -}; - -/** - * set Swift Version for all CocoaPods libraries - * - * @param {PodsJson} podsjsonFile A PodsJson instance that represents pods.json - */ - -Api.prototype.setSwiftVersionForCocoaPodsLibraries = function (podsjsonFile) { - var self = this; - var __dirty = false; - return check_reqs.check_cocoapods().then(function (toolOptions) { - if (toolOptions.ignore) { - events.emit('verbose', '=== skip Swift Version Settings For Cocoapods Libraries'); - } else { - var podPbxPath = path.join(self.root, 'Pods', 'Pods.xcodeproj', 'project.pbxproj'); - var podXcodeproj = xcode.project(podPbxPath); - podXcodeproj.parseSync(); - var podTargets = podXcodeproj.pbxNativeTargetSection(); - var podConfigurationList = podXcodeproj.pbxXCConfigurationList(); - var podConfigs = podXcodeproj.pbxXCBuildConfigurationSection(); - - var libraries = podsjsonFile.getLibraries(); - Object.keys(libraries).forEach(function (key) { - var podJson = libraries[key]; - var name = podJson.name; - var swiftVersion = podJson['swift-version']; - if (swiftVersion) { - __dirty = true; - Object.keys(podTargets).filter(function (targetKey) { - return podTargets[targetKey].productName === name; - }).map(function (targetKey) { - return podTargets[targetKey].buildConfigurationList; - }).map(function (buildConfigurationListId) { - return podConfigurationList[buildConfigurationListId]; - }).map(function (buildConfigurationList) { - return buildConfigurationList.buildConfigurations; - }).reduce(function (acc, buildConfigurations) { - return acc.concat(buildConfigurations); - }, []).map(function (buildConfiguration) { - return buildConfiguration.value; - }).forEach(function (buildId) { - __dirty = true; - podConfigs[buildId].buildSettings['SWIFT_VERSION'] = swiftVersion; - }); - } - }); - if (__dirty) { - fs.writeFileSync(podPbxPath, podXcodeproj.writeSync(), 'utf-8'); - } - } - }); -}; - -/** - * Builds an application package for current platform. - * - * @param {Object} buildOptions A build options. This object's structure is - * highly depends on platform's specific. The most common options are: - * @param {Boolean} buildOptions.debug Indicates that packages should be - * built with debug configuration. This is set to true by default unless the - * 'release' option is not specified. - * @param {Boolean} buildOptions.release Indicates that packages should be - * built with release configuration. If not set to true, debug configuration - * will be used. - * @param {Boolean} buildOptions.device Specifies that built app is intended - * to run on device - * @param {Boolean} buildOptions.emulator: Specifies that built app is - * intended to run on emulator - * @param {String} buildOptions.target Specifies the device id that will be - * used to run built application. - * @param {Boolean} buildOptions.nobuild Indicates that this should be a - * dry-run call, so no build artifacts will be produced. - * @param {String[]} buildOptions.archs Specifies chip architectures which - * app packages should be built for. List of valid architectures is depends on - * platform. - * @param {String} buildOptions.buildConfig The path to build configuration - * file. The format of this file is depends on platform. - * @param {String[]} buildOptions.argv Raw array of command-line arguments, - * passed to `build` command. The purpose of this property is to pass a - * platform-specific arguments, and eventually let platform define own - * arguments processing logic. - * - * @return {Promise} Return a promise either fulfilled, or rejected with - * CordovaError instance. - */ -Api.prototype.build = function (buildOptions) { - var self = this; - return check_reqs.run() - .then(function () { - return require('./lib/build').run.call(self, buildOptions); - }); -}; - -/** - * Builds an application package for current platform and runs it on - * specified/default device. If no 'device'/'emulator'/'target' options are - * specified, then tries to run app on default device if connected, otherwise - * runs the app on emulator. - * - * @param {Object} runOptions An options object. The structure is the same - * as for build options. - * - * @return {Promise} A promise either fulfilled if package was built and ran - * successfully, or rejected with CordovaError. - */ -Api.prototype.run = function (runOptions) { - var self = this; - return check_reqs.run() - .then(function () { - return require('./lib/run').run.call(self, runOptions); - }); -}; - -/** - * Cleans out the build artifacts from platform's directory. - * - * @return {Promise} Return a promise either fulfilled, or rejected with - * CordovaError. - */ -Api.prototype.clean = function (cleanOptions) { - var self = this; - return check_reqs.run() - .then(function () { - return require('./lib/clean').run.call(self, cleanOptions); - }) - .then(function () { - return require('./lib/prepare').clean.call(self, cleanOptions); - }); -}; - -/** - * Performs a requirements check for current platform. Each platform defines its - * own set of requirements, which should be resolved before platform can be - * built successfully. - * - * @return {Promise} Promise, resolved with set of Requirement - * objects for current platform. - */ -Api.prototype.requirements = function () { - return check_reqs.check_all(); -}; - -module.exports = Api; diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/build b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/build deleted file mode 100755 index e795d13..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/build +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env node - -/* - 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 args = process.argv; -var Api = require('./Api'); -var nopt = require('nopt'); - -// Support basic help commands -if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) >= 0) { - require('./lib/build').help(); - process.exit(0); -} - -// Parse arguments -var buildOpts = nopt({ - 'verbose': Boolean, - 'silent': Boolean, - 'archs': String, - 'debug': Boolean, - 'release': Boolean, - 'device': Boolean, - 'emulator': Boolean, - 'codeSignIdentity': String, - 'codeSignResourceRules': String, - 'provisioningProfile': String, - 'automaticProvisioning': Boolean, - 'developmentTeam': String, - 'packageType': String, - 'buildConfig': String, - 'buildFlag': [String, Array], - 'noSign': Boolean -}, { '-r': '--release', 'd': '--verbose' }, args); - -// Make buildOptions compatible with PlatformApi build method spec -buildOpts.argv = buildOpts.argv.remain; - -require('./loggingHelper').adjustLoggerLevel(buildOpts); - -new Api().build(buildOpts).done(function () { - console.log('** BUILD SUCCEEDED **'); -}, function (err) { - var errorMessage = (err && err.stack) ? err.stack : err; - console.error(errorMessage); - process.exit(2); -}); diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/build-debug.xcconfig b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/build-debug.xcconfig deleted file mode 100644 index 7e7985b..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/build-debug.xcconfig +++ /dev/null @@ -1,32 +0,0 @@ -// -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -// - -// -// XCode Build settings for "Debug" Build Configuration. -// - -#include "build.xcconfig" - -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) DEBUG=1 - -#include "build-extras.xcconfig" - -// (CB-11792) -// @COCOAPODS_SILENCE_WARNINGS@ // -#include "../pods-debug.xcconfig" diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/build-extras.xcconfig b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/build-extras.xcconfig deleted file mode 100644 index 7e63111..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/build-extras.xcconfig +++ /dev/null @@ -1,22 +0,0 @@ -// -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -// - -// -// Auto-generated config file to override configuration files (build-release/build-debug). -// diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/build-release.xcconfig b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/build-release.xcconfig deleted file mode 100644 index 70b0f07..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/build-release.xcconfig +++ /dev/null @@ -1,33 +0,0 @@ -// -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -// - -// -// XCode Build settings for "Release" Build Configuration. -// - -#include "build.xcconfig" - -CODE_SIGN_IDENTITY = iPhone Distribution -CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Distribution - -#include "build-extras.xcconfig" - -// (CB-11792) -// @COCOAPODS_SILENCE_WARNINGS@ // -#include "../pods-release.xcconfig" diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/build.bat b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/build.bat deleted file mode 100644 index 2f97fcb..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/build.bat +++ /dev/null @@ -1,19 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License - -@ECHO OFF -ECHO WARN: The 'build' command is not available for cordova-ios on windows machines.>&2 diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/build.xcconfig b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/build.xcconfig deleted file mode 100644 index 3c8b930..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/build.xcconfig +++ /dev/null @@ -1,45 +0,0 @@ -// -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -// - -// -// XCode build settings shared by all Build Configurations. -// Settings are overridden by configuration-level .xcconfig file (build-release/build-debug). -// - -HEADER_SEARCH_PATHS = "$(TARGET_BUILD_DIR)/usr/local/lib/include" "$(OBJROOT)/UninstalledProducts/include" "$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include" "$(BUILT_PRODUCTS_DIR)" -OTHER_LDFLAGS = -ObjC - -// Type of signing identity used for codesigning, resolves to first match of given type. -// "iPhone Developer": Development builds (default, local only; iOS Development certificate) or "iPhone Distribution": Distribution builds (Adhoc/In-House/AppStore; iOS Distribution certificate) -CODE_SIGN_IDENTITY = iPhone Developer -CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Developer - -// (CB-9721) Set ENABLE_BITCODE to NO in build.xcconfig -ENABLE_BITCODE = NO - -// (CB-9719) Set CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES to YES in build.xcconfig -CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES - -// (CB-10072) -SWIFT_OBJC_BRIDGING_HEADER = $(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h - -// (CB-11854) -CODE_SIGN_ENTITLEMENTS = $(PROJECT_DIR)/$(PROJECT_NAME)/Entitlements-$(CONFIGURATION).plist - -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) WK_WEB_VIEW_ONLY=$(WK_WEB_VIEW_ONLY) diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/clean b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/clean deleted file mode 100755 index ccd4a56..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/clean +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env node - -/* - 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 Api = require('./Api'); -var nopt = require('nopt'); - -if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) >= 0) { - console.log('Cleans the project directory.'); - process.exit(0); -} - -// Do some basic argument parsing -var opts = nopt({ - 'verbose': Boolean, - 'silent': Boolean -}, { 'd': '--verbose' }); - -// Make buildOptions compatible with PlatformApi clean method spec -opts.argv = opts.argv.original; - -// Skip cleaning prepared files when not invoking via cordova CLI. -opts.noPrepare = true; - -require('./loggingHelper').adjustLoggerLevel(opts); - -new Api().clean(opts).done(function () { - console.log('** CLEAN SUCCEEDED **'); -}, function (err) { - console.error(err); - process.exit(2); -}); diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/clean.bat b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/clean.bat deleted file mode 100644 index 5830728..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/clean.bat +++ /dev/null @@ -1,19 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License - -@ECHO OFF -ECHO WARN: The 'clean' command is not available for cordova-ios on windows machines.>&2 diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/defaults.xml b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/defaults.xml deleted file mode 100644 index 77a0a0b..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/defaults.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/BridgingHeader.js b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/BridgingHeader.js deleted file mode 100644 index 319d3fe..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/BridgingHeader.js +++ /dev/null @@ -1,125 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ -'use strict'; - -var fs = require('fs'); -var CordovaError = require('cordova-common').CordovaError; - -function BridgingHeader (bridgingHeaderPath) { - this.path = bridgingHeaderPath; - this.bridgingHeaders = null; - if (!fs.existsSync(this.path)) { - throw new CordovaError('BridgingHeader.h is not found.'); - } - this.bridgingHeaders = this.__parseForBridgingHeader(fs.readFileSync(this.path, 'utf8')); -} - -BridgingHeader.prototype.addHeader = function (plugin_id, header_path) { - this.bridgingHeaders.push({ type: 'code', code: '#import "' + header_path + '"\n' }); -}; - -BridgingHeader.prototype.removeHeader = function (plugin_id, header_path) { - this.bridgingHeaders = this.bridgingHeaders.filter(function (line) { - if (this.found) { - return true; - } - if (line.type === 'code') { - var re = new RegExp('#import\\s+"' + preg_quote(header_path) + '"(\\s*|\\s.+)(\\n|$)'); - if (re.test(line.code)) { - this.found = true; - return false; - } - } - return true; - }, { found: false }); -}; - -BridgingHeader.prototype.write = function () { - var text = this.__stringifyForBridgingHeader(this.bridgingHeaders); - fs.writeFileSync(this.path, text, 'utf8'); -}; - -BridgingHeader.prototype.__stringifyForBridgingHeader = function (bridgingHeaders) { - return bridgingHeaders.map(function (obj) { - return obj.code; - }).join(''); -}; - -BridgingHeader.prototype.__parseForBridgingHeader = function (text) { - var i = 0; - var list = []; - var type = 'code'; - var start = 0; - while (i < text.length) { - switch (type) { - case 'comment': - if (i + 1 < text.length && text[i] === '*' && text[i + 1] === '/') { - i += 2; - list.push({ type: type, code: text.slice(start, i) }); - type = 'code'; - start = i; - } else { - i += 1; - } - break; - case 'line-comment': - if (i < text.length && text[i] === '\n') { - i += 1; - list.push({ type: type, code: text.slice(start, i) }); - type = 'code'; - start = i; - } else { - i += 1; - } - break; - case 'code': - default: - if (i + 1 < text.length && text[i] === '/' && text[i + 1] === '*') { // comment - if (start < i) { - list.push({ type: type, code: text.slice(start, i) }); - } - type = 'comment'; - start = i; - } else if (i + 1 < text.length && text[i] === '/' && text[i + 1] === '/') { // line comment - if (start < i) { - list.push({ type: type, code: text.slice(start, i) }); - } - type = 'line-comment'; - start = i; - } else if (i < text.length && text[i] === '\n') { - i += 1; - list.push({ type: type, code: text.slice(start, i) }); - start = i; - } else { - i += 1; - } - break; - } - } - if (start < i) { - list.push({ type: type, code: text.slice(start, i) }); - } - return list; -}; - -function preg_quote (str, delimiter) { - return (str + '').replace(new RegExp('[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\' + (delimiter || '') + '-]', 'g'), '\\$&'); -} - -module.exports.BridgingHeader = BridgingHeader; diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/Podfile.js b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/Podfile.js deleted file mode 100644 index 7106ff6..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/Podfile.js +++ /dev/null @@ -1,424 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ -'use strict'; - -var fs = require('fs'); -var path = require('path'); -var util = require('util'); -var events = require('cordova-common').events; -var Q = require('q'); -var superspawn = require('cordova-common').superspawn; -var CordovaError = require('cordova-common').CordovaError; - -Podfile.FILENAME = 'Podfile'; -Podfile.declarationRegexpMap = { - 'use_frameworks!': 'use[-_]frameworks!?', - 'inhibit_all_warnings!': 'inhibit[-_]all[-_]warnings!?' -}; - -function Podfile (podFilePath, projectName, minDeploymentTarget) { - this.declarationToken = '##INSERT_DECLARATION##'; - this.sourceToken = '##INSERT_SOURCE##'; - this.podToken = '##INSERT_POD##'; - - this.path = podFilePath; - this.projectName = projectName; - this.minDeploymentTarget = minDeploymentTarget || '10.0'; - this.contents = null; - this.sources = null; - this.declarations = null; - this.pods = null; - this.__dirty = false; - - // check whether it is named Podfile - var filename = this.path.split(path.sep).pop(); - if (filename !== Podfile.FILENAME) { - throw new CordovaError(util.format('Podfile: The file at %s is not `%s`.', this.path, Podfile.FILENAME)); - } - - if (!projectName) { - throw new CordovaError('Podfile: The projectName was not specified in the constructor.'); - } - - if (!fs.existsSync(this.path)) { - events.emit('verbose', util.format('Podfile: The file at %s does not exist.', this.path)); - events.emit('verbose', 'Creating new Podfile in platforms/ios'); - this.clear(); - this.write(); - } else { - events.emit('verbose', 'Podfile found in platforms/ios'); - // parse for pods - var fileText = fs.readFileSync(this.path, 'utf8'); - this.declarations = this.__parseForDeclarations(fileText); - this.sources = this.__parseForSources(fileText); - this.pods = this.__parseForPods(fileText); - } -} - -Podfile.prototype.__parseForDeclarations = function (text) { - // split by \n - var arr = text.split('\n'); - - // getting lines between "platform :ios, '10.0'"" and "target 'HelloCordova'" do - var declarationsPreRE = new RegExp('platform :ios,\\s+\'[^\']+\''); - var declarationsPostRE = new RegExp('target\\s+\'[^\']+\'\\s+do'); - var declarationRE = new RegExp('^\\s*[^#]'); - - return arr.reduce(function (acc, line) { - switch (acc.state) { - case 0: - if (declarationsPreRE.exec(line)) { - acc.state = 1; // Start to read - } - break; - case 1: - if (declarationsPostRE.exec(line)) { - acc.state = 2; // Finish to read - } else { - acc.lines.push(line); - } - break; - case 2: - default: - // do nothing; - } - return acc; - }, { state: 0, lines: [] }) - .lines - .filter(function (line) { - return declarationRE.exec(line); - }) - .reduce(function (obj, line) { - obj[line] = line; - return obj; - }, {}); -}; - -Podfile.prototype.__parseForSources = function (text) { - // split by \n - var arr = text.split('\n'); - - var sourceRE = new RegExp('source \'(.*)\''); - return arr.filter(function (line) { - var m = sourceRE.exec(line); - - return (m !== null); - }) - .reduce(function (obj, line) { - var m = sourceRE.exec(line); - if (m !== null) { - var source = m[1]; - obj[source] = source; - } - return obj; - }, {}); -}; - -Podfile.prototype.__parseForPods = function (text) { - // split by \n - var arr = text.split('\n'); - - // aim is to match (space insignificant around the comma, comma optional): - // pod 'Foobar', '1.2' - // pod 'Foobar', 'abc 123 1.2' - // pod 'PonyDebugger', :configurations => ['Debug', 'Beta'] - // var podRE = new RegExp('pod \'([^\']*)\'\\s*,?\\s*(.*)'); - var podRE = new RegExp('pod \'([^\']*)\'\\s*(?:,\\s*\'([^\']*)\'\\s*)?,?\\s*(.*)'); - - // only grab lines that don't have the pod spec' - return arr.filter(function (line) { - var m = podRE.exec(line); - - return (m !== null); - }) - .reduce(function (obj, line) { - var m = podRE.exec(line); - - if (m !== null) { - var podspec = { - name: m[1] - }; - if (m[2]) { - podspec.spec = m[2]; - } - if (m[3]) { - podspec.options = m[3]; - } - obj[m[1]] = podspec; // i.e pod 'Foo', '1.2' ==> { 'Foo' : '1.2'} - } - - return obj; - }, {}); -}; - -Podfile.prototype.escapeSingleQuotes = function (string) { - return string.replace('\'', '\\\''); -}; - -Podfile.prototype.getTemplate = function () { - // Escaping possible ' in the project name - var projectName = this.escapeSingleQuotes(this.projectName); - return util.format( - '# DO NOT MODIFY -- auto-generated by Apache Cordova\n' + - '%s\n' + - 'platform :ios, \'%s\'\n' + - '%s\n' + - 'target \'%s\' do\n' + - '\tproject \'%s.xcodeproj\'\n' + - '%s\n' + - 'end\n', - this.sourceToken, this.minDeploymentTarget, this.declarationToken, projectName, projectName, this.podToken); -}; - -Podfile.prototype.addSpec = function (name, spec) { - name = name || ''; - // optional - spec = spec; /* eslint no-self-assign : 0 */ - - if (!name.length) { // blank names are not allowed - throw new CordovaError('Podfile addSpec: name is not specified.'); - } - - if (typeof spec === 'string') { - if (spec.startsWith(':')) { - spec = { name: name, options: spec }; - } else { - spec = { name: name, spec: spec }; - } - } - - this.pods[name] = spec; - this.__dirty = true; - - events.emit('verbose', util.format('Added pod line for `%s`', name)); -}; - -Podfile.prototype.removeSpec = function (name) { - if (this.existsSpec(name)) { - delete this.pods[name]; - this.__dirty = true; - } - - events.emit('verbose', util.format('Removed pod line for `%s`', name)); -}; - -Podfile.prototype.getSpec = function (name) { - return this.pods[name]; -}; - -Podfile.prototype.existsSpec = function (name) { - return (name in this.pods); -}; - -Podfile.prototype.addSource = function (src) { - this.sources[src] = src; - this.__dirty = true; - - events.emit('verbose', util.format('Added source line for `%s`', src)); -}; - -Podfile.prototype.removeSource = function (src) { - if (this.existsSource(src)) { - delete this.sources[src]; - this.__dirty = true; - } - - events.emit('verbose', util.format('Removed source line for `%s`', src)); -}; - -Podfile.prototype.existsSource = function (src) { - return (src in this.sources); -}; - -Podfile.prototype.addDeclaration = function (declaration) { - this.declarations[declaration] = declaration; - this.__dirty = true; - - events.emit('verbose', util.format('Added declaration line for `%s`', declaration)); -}; - -Podfile.prototype.removeDeclaration = function (declaration) { - if (this.existsDeclaration(declaration)) { - delete this.declarations[declaration]; - this.__dirty = true; - } - - events.emit('verbose', util.format('Removed source line for `%s`', declaration)); -}; - -Podfile.proofDeclaration = function (declaration) { - var list = Object.keys(Podfile.declarationRegexpMap).filter(function (key) { - var regexp = new RegExp(Podfile.declarationRegexpMap[key]); - return regexp.test(declaration); - }); - if (list.length > 0) { - return list[0]; - } - return declaration; -}; - -Podfile.prototype.existsDeclaration = function (declaration) { - return (declaration in this.declarations); -}; - -Podfile.prototype.clear = function () { - this.sources = {}; - this.declarations = {}; - this.pods = {}; - this.__dirty = true; -}; - -Podfile.prototype.destroy = function () { - fs.unlinkSync(this.path); - events.emit('verbose', util.format('Deleted `%s`', this.path)); -}; - -Podfile.prototype.write = function () { - var text = this.getTemplate(); - var self = this; - - var podsString = - Object.keys(this.pods).map(function (key) { - var name = key; - var json = self.pods[key]; - - if (typeof json === 'string') { // compatibility for using framework tag. - var spec = json; - if (spec.length) { - if (spec.indexOf(':') === 0) { - // don't quote it, it's a specification (starts with ':') - return util.format('\tpod \'%s\', %s', name, spec); - } else { - // quote it, it's a version - return util.format('\tpod \'%s\', \'%s\'', name, spec); - } - } else { - return util.format('\tpod \'%s\'', name); - } - } else { - var list = ['\'' + name + '\'']; - if ('spec' in json && json.spec.length) { - list.push('\'' + json.spec + '\''); - } - - var options = ['tag', 'branch', 'commit', 'git', 'podspec'].filter(function (tag) { - return tag in json; - }).map(function (tag) { - return ':' + tag + ' => \'' + json[tag] + '\''; - }); - if ('configurations' in json) { - options.push(':configurations => [' + json['configurations'].split(',').map(function (conf) { return '\'' + conf.trim() + '\''; }).join(',') + ']'); - } - if ('options' in json) { - options = [json.options]; - } - if (options.length > 0) { - list.push(options.join(', ')); - } - return util.format('\tpod %s', list.join(', ')); - } - }).join('\n'); - - var sourcesString = - Object.keys(this.sources).map(function (key) { - var source = self.sources[key]; - return util.format('source \'%s\'', source); - }).join('\n'); - - var declarationString = - Object.keys(this.declarations).map(function (key) { - var declaration = self.declarations[key]; - return declaration; - }).join('\n'); - - text = text.replace(this.podToken, podsString) - .replace(this.sourceToken, sourcesString) - .replace(this.declarationToken, declarationString); - - fs.writeFileSync(this.path, text, 'utf8'); - this.__dirty = false; - - events.emit('verbose', 'Wrote to Podfile.'); -}; - -Podfile.prototype.isDirty = function () { - return this.__dirty; -}; - -Podfile.prototype.before_install = function (toolOptions) { - toolOptions = toolOptions || {}; - - // Template tokens in order: project name, project name, debug | release - var template = - '// DO NOT MODIFY -- auto-generated by Apache Cordova\n' + - '#include "Pods/Target Support Files/Pods-%s/Pods-%s.%s.xcconfig"'; - - var debugContents = util.format(template, this.projectName, this.projectName, 'debug'); - var releaseContents = util.format(template, this.projectName, this.projectName, 'release'); - - var debugConfigPath = path.join(this.path, '..', 'pods-debug.xcconfig'); - var releaseConfigPath = path.join(this.path, '..', 'pods-release.xcconfig'); - - fs.writeFileSync(debugConfigPath, debugContents, 'utf8'); - fs.writeFileSync(releaseConfigPath, releaseContents, 'utf8'); - - return Q.resolve(toolOptions); -}; - -Podfile.prototype.install = function (requirementsCheckerFunction) { - var opts = {}; - opts.cwd = path.join(this.path, '..'); // parent path of this Podfile - opts.stdio = 'pipe'; - opts.printCommand = true; - var first = true; - var self = this; - - if (!requirementsCheckerFunction) { - requirementsCheckerFunction = Q(); - } - - return requirementsCheckerFunction() - .then(function (toolOptions) { - return self.before_install(toolOptions); - }) - .then(function (toolOptions) { - if (toolOptions.ignore) { - events.emit('verbose', '==== pod install start ====\n'); - events.emit('verbose', toolOptions.ignoreMessage); - return Q.resolve(); - } else { - return superspawn.spawn('pod', ['install', '--verbose'], opts) - .progress(function (stdio) { - if (stdio.stderr) { console.error(stdio.stderr); } - if (stdio.stdout) { - if (first) { - events.emit('verbose', '==== pod install start ====\n'); - first = false; - } - events.emit('verbose', stdio.stdout); - } - }); - } - }) - .then(function () { // done - events.emit('verbose', '==== pod install end ====\n'); - }); -}; - -module.exports.Podfile = Podfile; diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/PodsJson.js b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/PodsJson.js deleted file mode 100644 index 25afbac..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/PodsJson.js +++ /dev/null @@ -1,209 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -var fs = require('fs'); -var path = require('path'); -var util = require('util'); -var events = require('cordova-common').events; -var CordovaError = require('cordova-common').CordovaError; - -PodsJson.FILENAME = 'pods.json'; -PodsJson.LIBRARY = 'libraries'; -PodsJson.SOURCE = 'sources'; -PodsJson.DECLARATION = 'declarations'; - -function PodsJson (podsJsonPath) { - this.path = podsJsonPath; - this.contents = null; - this.__dirty = false; - - var filename = this.path.split(path.sep).pop(); - if (filename !== PodsJson.FILENAME) { - throw new CordovaError(util.format('PodsJson: The file at %s is not `%s`.', this.path, PodsJson.FILENAME)); - } - - if (!fs.existsSync(this.path)) { - events.emit('verbose', util.format('pods.json: The file at %s does not exist.', this.path)); - events.emit('verbose', 'Creating new pods.json in platforms/ios'); - this.clear(); - this.write(); - } else { - events.emit('verbose', 'pods.json found in platforms/ios'); - // load contents - var contents = fs.readFileSync(this.path, 'utf8'); - this.contents = JSON.parse(contents); - } - this.__updateFormatIfNecessary(); -} - -PodsJson.prototype.__isOldFormat = function () { - if (this.contents !== null) { - if (this.contents.declarations === undefined || - this.contents.sources === undefined || - this.contents.libraries === undefined) { - return true; - } - } - return false; -}; - -PodsJson.prototype.__updateFormatIfNecessary = function () { - if (this.__isOldFormat()) { - this.contents = { - declarations: {}, - sources: {}, - libraries: this.contents - }; - this.__dirty = true; - events.emit('verbose', 'Update format of pods.json'); - } -}; - -PodsJson.prototype.getLibraries = function () { - return this.contents[PodsJson.LIBRARY]; -}; - -PodsJson.prototype.__get = function (kind, name) { - return this.contents[kind][name]; -}; - -PodsJson.prototype.getLibrary = function (name) { - return this.__get(PodsJson.LIBRARY, name); -}; - -PodsJson.prototype.getSource = function (name) { - return this.__get(PodsJson.SOURCE, name); -}; - -PodsJson.prototype.getDeclaration = function (name) { - return this.__get(PodsJson.DECLARATION, name); -}; - -PodsJson.prototype.__remove = function (kind, name) { - if (this.contents[kind][name]) { - delete this.contents[kind][name]; - this.__dirty = true; - events.emit('verbose', util.format('Remove from pods.json for `%s` - `%s`', name)); - } -}; - -PodsJson.prototype.removeLibrary = function (name) { - this.__remove(PodsJson.LIBRARY, name); -}; - -PodsJson.prototype.removeSource = function (name) { - this.__remove(PodsJson.SOURCE, name); -}; - -PodsJson.prototype.removeDeclaration = function (name) { - this.__remove(PodsJson.DECLARATION, name); -}; - -PodsJson.prototype.clear = function () { - this.contents = { - declarations: {}, - sources: {}, - libraries: {} - }; - this.__dirty = true; -}; - -PodsJson.prototype.destroy = function () { - fs.unlinkSync(this.path); - events.emit('verbose', util.format('Deleted `%s`', this.path)); -}; - -PodsJson.prototype.write = function () { - if (this.contents) { - fs.writeFileSync(this.path, JSON.stringify(this.contents, null, 4)); - this.__dirty = false; - events.emit('verbose', 'Wrote to pods.json.'); - } -}; - -PodsJson.prototype.__increment = function (kind, name) { - var val = this.__get(kind, name); - if (val) { - val.count++; - } -}; - -PodsJson.prototype.incrementLibrary = function (name) { - this.__increment(PodsJson.LIBRARY, name); -}; - -PodsJson.prototype.incrementSource = function (name) { - this.__increment(PodsJson.SOURCE, name); -}; - -PodsJson.prototype.incrementDeclaration = function (name) { - this.__increment(PodsJson.DECLARATION, name); -}; - -PodsJson.prototype.__decrement = function (kind, name) { - var val = this.__get(kind, name); - if (val) { - val.count--; - if (val.count <= 0) { - this.__remove(kind, name); - } - } -}; - -PodsJson.prototype.decrementLibrary = function (name) { - this.__decrement(PodsJson.LIBRARY, name); -}; - -PodsJson.prototype.decrementSource = function (name) { - this.__decrement(PodsJson.SOURCE, name); -}; - -PodsJson.prototype.decrementDeclaration = function (name) { - this.__decrement(PodsJson.DECLARATION, name); -}; - -PodsJson.prototype.__setJson = function (kind, name, json) { - this.contents[kind][name] = Object.assign({}, json); - this.__dirty = true; - events.emit('verbose', util.format('Set pods.json for `%s` - `%s`', kind, name)); -}; - -// sample json for library -// { name: "Eureka", spec: "4.2.0", "swift-version": "4.1", count: 1 } -PodsJson.prototype.setJsonLibrary = function (name, json) { - this.__setJson(PodsJson.LIBRARY, name, json); -}; - -// sample json for source -// { source: "https://github.com/brightcove/BrightcoveSpecs.git", count: 1 } -PodsJson.prototype.setJsonSource = function (name, json) { - this.__setJson(PodsJson.SOURCE, name, json); -}; - -// sample json for declaration -// { declaration: ""} -PodsJson.prototype.setJsonDeclaration = function (name, json) { - this.__setJson(PodsJson.DECLARATION, name, json); -}; - -PodsJson.prototype.isDirty = function () { - return this.__dirty; -}; - -module.exports.PodsJson = PodsJson; diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/build.js b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/build.js deleted file mode 100644 index f8d301d..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/build.js +++ /dev/null @@ -1,464 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -var Q = require('q'); -var path = require('path'); -var shell = require('shelljs'); -var superspawn = require('cordova-common').superspawn; -var fs = require('fs'); -var plist = require('plist'); -var util = require('util'); - -var check_reqs = require('./check_reqs'); -var projectFile = require('./projectFile'); - -var events = require('cordova-common').events; - -// These are regular expressions to detect if the user is changing any of the built-in xcodebuildArgs -/* eslint-disable no-useless-escape */ -var buildFlagMatchers = { - 'workspace': /^\-workspace\s*(.*)/, - 'scheme': /^\-scheme\s*(.*)/, - 'configuration': /^\-configuration\s*(.*)/, - 'sdk': /^\-sdk\s*(.*)/, - 'destination': /^\-destination\s*(.*)/, - 'archivePath': /^\-archivePath\s*(.*)/, - 'configuration_build_dir': /^(CONFIGURATION_BUILD_DIR=.*)/, - 'shared_precomps_dir': /^(SHARED_PRECOMPS_DIR=.*)/ -}; -/* eslint-enable no-useless-escape */ - -/** - * Creates a project object (see projectFile.js/parseProjectFile) from - * a project path and name - * - * @param {*} projectPath - * @param {*} projectName - */ -function createProjectObject (projectPath, projectName) { - var locations = { - root: projectPath, - pbxproj: path.join(projectPath, projectName + '.xcodeproj', 'project.pbxproj') - }; - - return projectFile.parse(locations); -} - -/** - * Gets the resolved bundle identifier from a project. - * Resolves the variable set in INFO.plist, if any (simple case) - * - * @param {*} projectObject - */ -function getBundleIdentifier (projectObject) { - var packageName = projectObject.getPackageName(); - var bundleIdentifier = packageName; - - var variables = packageName.match(/\$\((\w+)\)/); // match $(VARIABLE), if any - if (variables && variables.length >= 2) { - bundleIdentifier = projectObject.xcode.getBuildProperty(variables[1]); - } - - return bundleIdentifier; -} - -/** - * Returns a promise that resolves to the default simulator target; the logic here - * matches what `cordova emulate ios` does. - * - * The return object has two properties: `name` (the Xcode destination name), - * `identifier` (the simctl identifier), and `simIdentifier` (essentially the cordova emulate target) - * - * @return {Promise} - */ -function getDefaultSimulatorTarget () { - return require('./list-emulator-build-targets').run() - .then(function (emulators) { - var targetEmulator; - if (emulators.length > 0) { - targetEmulator = emulators[0]; - } - emulators.forEach(function (emulator) { - if (emulator.name.indexOf('iPhone') === 0) { - targetEmulator = emulator; - } - }); - return targetEmulator; - }); -} - -module.exports.run = function (buildOpts) { - var emulatorTarget = ''; - var projectPath = path.join(__dirname, '..', '..'); - var projectName = ''; - - buildOpts = buildOpts || {}; - - if (buildOpts.debug && buildOpts.release) { - return Q.reject('Cannot specify "debug" and "release" options together.'); - } - - if (buildOpts.device && buildOpts.emulator) { - return Q.reject('Cannot specify "device" and "emulator" options together.'); - } - - if (buildOpts.buildConfig) { - if (!fs.existsSync(buildOpts.buildConfig)) { - return Q.reject('Build config file does not exist: ' + buildOpts.buildConfig); - } - events.emit('log', 'Reading build config file: ' + path.resolve(buildOpts.buildConfig)); - var contents = fs.readFileSync(buildOpts.buildConfig, 'utf-8'); - var buildConfig = JSON.parse(contents.replace(/^\ufeff/, '')); // Remove BOM - if (buildConfig.ios) { - var buildType = buildOpts.release ? 'release' : 'debug'; - var config = buildConfig.ios[buildType]; - if (config) { - ['codeSignIdentity', 'codeSignResourceRules', 'provisioningProfile', 'developmentTeam', 'packageType', 'buildFlag', 'iCloudContainerEnvironment', 'automaticProvisioning'].forEach( - function (key) { - buildOpts[key] = buildOpts[key] || config[key]; - }); - } - } - } - - return require('./list-devices').run() - .then(function (devices) { - if (devices.length > 0 && !(buildOpts.emulator)) { - // we also explicitly set device flag in options as we pass - // those parameters to other api (build as an example) - buildOpts.device = true; - return check_reqs.check_ios_deploy(); - } - }).then(function () { - // CB-12287: Determine the device we should target when building for a simulator - if (!buildOpts.device) { - var newTarget = buildOpts.target || ''; - - if (newTarget) { - // only grab the device name, not the runtime specifier - newTarget = newTarget.split(',')[0]; - } - // a target was given to us, find the matching Xcode destination name - var promise = require('./list-emulator-build-targets').targetForSimIdentifier(newTarget); - return promise.then(function (theTarget) { - if (!theTarget) { - return getDefaultSimulatorTarget().then(function (defaultTarget) { - emulatorTarget = defaultTarget.name; - events.emit('warn', `No simulator found for "${newTarget}. Falling back to the default target.`); - events.emit('log', `Building for "${emulatorTarget}" Simulator (${defaultTarget.identifier}, ${defaultTarget.simIdentifier}).`); - return emulatorTarget; - }); - } else { - emulatorTarget = theTarget.name; - events.emit('log', `Building for "${emulatorTarget}" Simulator (${theTarget.identifier}, ${theTarget.simIdentifier}).`); - return emulatorTarget; - } - }); - } - }).then(function () { - return check_reqs.run(); - }).then(function () { - return findXCodeProjectIn(projectPath); - }).then(function (name) { - projectName = name; - var extraConfig = ''; - if (buildOpts.codeSignIdentity) { - extraConfig += 'CODE_SIGN_IDENTITY = ' + buildOpts.codeSignIdentity + '\n'; - extraConfig += 'CODE_SIGN_IDENTITY[sdk=iphoneos*] = ' + buildOpts.codeSignIdentity + '\n'; - } - if (buildOpts.codeSignResourceRules) { - extraConfig += 'CODE_SIGN_RESOURCE_RULES_PATH = ' + buildOpts.codeSignResourceRules + '\n'; - } - if (buildOpts.provisioningProfile) { - extraConfig += 'PROVISIONING_PROFILE = ' + buildOpts.provisioningProfile + '\n'; - } - if (buildOpts.developmentTeam) { - extraConfig += 'DEVELOPMENT_TEAM = ' + buildOpts.developmentTeam + '\n'; - } - - function writeCodeSignStyle (value) { - var project = createProjectObject(projectPath, projectName); - - events.emit('verbose', `Set CODE_SIGN_STYLE Build Property to ${value}.`); - project.xcode.updateBuildProperty('CODE_SIGN_STYLE', value); - events.emit('verbose', `Set ProvisioningStyle Target Attribute to ${value}.`); - project.xcode.addTargetAttribute('ProvisioningStyle', value); - - project.write(); - } - - if (buildOpts.provisioningProfile) { - events.emit('verbose', 'ProvisioningProfile build option set, changing project settings to Manual.'); - writeCodeSignStyle('Manual'); - } else if (buildOpts.automaticProvisioning) { - events.emit('verbose', 'ProvisioningProfile build option NOT set, changing project settings to Automatic.'); - writeCodeSignStyle('Automatic'); - } - - return Q.nfcall(fs.writeFile, path.join(__dirname, '..', 'build-extras.xcconfig'), extraConfig, 'utf-8'); - }).then(function () { - var configuration = buildOpts.release ? 'Release' : 'Debug'; - - events.emit('log', 'Building project: ' + path.join(projectPath, projectName + '.xcworkspace')); - events.emit('log', '\tConfiguration: ' + configuration); - events.emit('log', '\tPlatform: ' + (buildOpts.device ? 'device' : 'emulator')); - events.emit('log', '\tTarget: ' + emulatorTarget); - - var buildOutputDir = path.join(projectPath, 'build', (buildOpts.device ? 'device' : 'emulator')); - - // remove the build/device folder before building - shell.rm('-rf', buildOutputDir); - - var xcodebuildArgs = getXcodeBuildArgs(projectName, projectPath, configuration, buildOpts.device, buildOpts.buildFlag, emulatorTarget, buildOpts.automaticProvisioning); - return superspawn.spawn('xcodebuild', xcodebuildArgs, { cwd: projectPath, printCommand: true, stdio: 'inherit' }); - - }).then(function () { - if (!buildOpts.device || buildOpts.noSign) { - return; - } - - var project = createProjectObject(projectPath, projectName); - var bundleIdentifier = getBundleIdentifier(project); - var exportOptions = { 'compileBitcode': false, 'method': 'development' }; - - if (buildOpts.packageType) { - exportOptions.method = buildOpts.packageType; - } - - if (buildOpts.iCloudContainerEnvironment) { - exportOptions.iCloudContainerEnvironment = buildOpts.iCloudContainerEnvironment; - } - - if (buildOpts.developmentTeam) { - exportOptions.teamID = buildOpts.developmentTeam; - } - - if (buildOpts.provisioningProfile && bundleIdentifier) { - exportOptions.provisioningProfiles = { [ bundleIdentifier ]: String(buildOpts.provisioningProfile) }; - exportOptions.signingStyle = 'manual'; - } - - if (buildOpts.codeSignIdentity) { - exportOptions.signingCertificate = buildOpts.codeSignIdentity; - } - - var exportOptionsPlist = plist.build(exportOptions); - var exportOptionsPath = path.join(projectPath, 'exportOptions.plist'); - - var buildOutputDir = path.join(projectPath, 'build', 'device'); - - function checkSystemRuby () { - var ruby_cmd = shell.which('ruby'); - - if (ruby_cmd !== '/usr/bin/ruby') { - events.emit('warn', 'Non-system Ruby in use. This may cause packaging to fail.\n' + - 'If you use RVM, please run `rvm use system`.\n' + - 'If you use chruby, please run `chruby system`.'); - } - } - - function packageArchive () { - var xcodearchiveArgs = getXcodeArchiveArgs(projectName, projectPath, buildOutputDir, exportOptionsPath, buildOpts.automaticProvisioning); - return superspawn.spawn('xcodebuild', xcodearchiveArgs, { cwd: projectPath, printCommand: true, stdio: 'inherit' }); - } - - return Q.nfcall(fs.writeFile, exportOptionsPath, exportOptionsPlist, 'utf-8') - .then(checkSystemRuby) - .then(packageArchive); - }); -}; - -/** - * Searches for first XCode project in specified folder - * @param {String} projectPath Path where to search project - * @return {Promise} Promise either fulfilled with project name or rejected - */ -function findXCodeProjectIn (projectPath) { - // 'Searching for Xcode project in ' + projectPath); - var xcodeProjFiles = shell.ls(projectPath).filter(function (name) { - return path.extname(name) === '.xcodeproj'; - }); - - if (xcodeProjFiles.length === 0) { - return Q.reject('No Xcode project found in ' + projectPath); - } - if (xcodeProjFiles.length > 1) { - events.emit('warn', 'Found multiple .xcodeproj directories in \n' + - projectPath + '\nUsing first one'); - } - - var projectName = path.basename(xcodeProjFiles[0], '.xcodeproj'); - return Q.resolve(projectName); -} - -module.exports.findXCodeProjectIn = findXCodeProjectIn; - -/** - * Returns array of arguments for xcodebuild - * @param {String} projectName Name of xcode project - * @param {String} projectPath Path to project file. Will be used to set CWD for xcodebuild - * @param {String} configuration Configuration name: debug|release - * @param {Boolean} isDevice Flag that specify target for package (device/emulator) - * @param {Array} buildFlags - * @param {String} emulatorTarget Target for emulator (rather than default) - * @param {Boolean} autoProvisioning Whether to allow Xcode to automatically update provisioning - * @return {Array} Array of arguments that could be passed directly to spawn method - */ -function getXcodeBuildArgs (projectName, projectPath, configuration, isDevice, buildFlags, emulatorTarget, autoProvisioning) { - var xcodebuildArgs; - var options; - var buildActions; - var settings; - var customArgs = {}; - customArgs.otherFlags = []; - - if (buildFlags) { - if (typeof buildFlags === 'string' || buildFlags instanceof String) { - parseBuildFlag(buildFlags, customArgs); - } else { // buildFlags is an Array of strings - buildFlags.forEach(function (flag) { - parseBuildFlag(flag, customArgs); - }); - } - } - - if (isDevice) { - options = [ - '-workspace', customArgs.workspace || projectName + '.xcworkspace', - '-scheme', customArgs.scheme || projectName, - '-configuration', customArgs.configuration || configuration, - '-destination', customArgs.destination || 'generic/platform=iOS', - '-archivePath', customArgs.archivePath || projectName + '.xcarchive' - ]; - buildActions = [ 'archive' ]; - settings = [ - customArgs.configuration_build_dir || 'CONFIGURATION_BUILD_DIR=' + path.join(projectPath, 'build', 'device'), - customArgs.shared_precomps_dir || 'SHARED_PRECOMPS_DIR=' + path.join(projectPath, 'build', 'sharedpch') - ]; - // Add other matched flags to otherFlags to let xcodebuild present an appropriate error. - // This is preferable to just ignoring the flags that the user has passed in. - if (customArgs.sdk) { - customArgs.otherFlags = customArgs.otherFlags.concat(['-sdk', customArgs.sdk]); - } - - if (autoProvisioning) { - options = options.concat(['-allowProvisioningUpdates']); - } - } else { // emulator - options = [ - '-workspace', customArgs.project || projectName + '.xcworkspace', - '-scheme', customArgs.scheme || projectName, - '-configuration', customArgs.configuration || configuration, - '-sdk', customArgs.sdk || 'iphonesimulator', - '-destination', customArgs.destination || 'platform=iOS Simulator,name=' + emulatorTarget - ]; - buildActions = [ 'build' ]; - settings = [ - customArgs.configuration_build_dir || 'CONFIGURATION_BUILD_DIR=' + path.join(projectPath, 'build', 'emulator'), - customArgs.shared_precomps_dir || 'SHARED_PRECOMPS_DIR=' + path.join(projectPath, 'build', 'sharedpch') - ]; - // Add other matched flags to otherFlags to let xcodebuild present an appropriate error. - // This is preferable to just ignoring the flags that the user has passed in. - if (customArgs.archivePath) { - customArgs.otherFlags = customArgs.otherFlags.concat(['-archivePath', customArgs.archivePath]); - } - } - xcodebuildArgs = options.concat(buildActions).concat(settings).concat(customArgs.otherFlags); - return xcodebuildArgs; -} - -/** - * Returns array of arguments for xcodebuild - * @param {String} projectName Name of xcode project - * @param {String} projectPath Path to project file. Will be used to set CWD for xcodebuild - * @param {String} outputPath Output directory to contain the IPA - * @param {String} exportOptionsPath Path to the exportOptions.plist file - * @param {Boolean} autoProvisioning Whether to allow Xcode to automatically update provisioning - * @return {Array} Array of arguments that could be passed directly to spawn method - */ -function getXcodeArchiveArgs (projectName, projectPath, outputPath, exportOptionsPath, autoProvisioning) { - return [ - '-exportArchive', - '-archivePath', projectName + '.xcarchive', - '-exportOptionsPlist', exportOptionsPath, - '-exportPath', outputPath - ].concat(autoProvisioning ? ['-allowProvisioningUpdates'] : []); -} - -function parseBuildFlag (buildFlag, args) { - var matched; - for (var key in buildFlagMatchers) { - var found = buildFlag.match(buildFlagMatchers[key]); - if (found) { - matched = true; - // found[0] is the whole match, found[1] is the first match in parentheses. - args[key] = found[1]; - events.emit('warn', util.format('Overriding xcodebuildArg: %s', buildFlag)); - } - } - - if (!matched) { - // If the flag starts with a '-' then it is an xcodebuild built-in option or a - // user-defined setting. The regex makes sure that we don't split a user-defined - // setting that is wrapped in quotes. - /* eslint-disable no-useless-escape */ - if (buildFlag[0] === '-' && !buildFlag.match(/^.*=(\".*\")|(\'.*\')$/)) { - args.otherFlags = args.otherFlags.concat(buildFlag.split(' ')); - events.emit('warn', util.format('Adding xcodebuildArg: %s', buildFlag.split(' '))); - } else { - args.otherFlags.push(buildFlag); - events.emit('warn', util.format('Adding xcodebuildArg: %s', buildFlag)); - } - } -} - -// help/usage function -module.exports.help = function help () { - console.log(''); - console.log('Usage: build [--debug | --release] [--archs=\"\"]'); - console.log(' [--device | --simulator] [--codeSignIdentity=\"\"]'); - console.log(' [--codeSignResourceRules=\"\"]'); - console.log(' [--developmentTeam=\"\"]'); - console.log(' [--provisioningProfile=\"\"]'); - console.log(' --help : Displays this dialog.'); - console.log(' --debug : Builds project in debug mode. (Default)'); - console.log(' --release : Builds project in release mode.'); - console.log(' -r : Shortcut :: builds project in release mode.'); - /* eslint-enable no-useless-escape */ - // TODO: add support for building different archs - // console.log(" --archs : Builds project binaries for specific chip architectures (`anycpu`, `arm`, `x86`, `x64`)."); - console.log(' --device, --simulator'); - console.log(' : Specifies, what type of project to build'); - console.log(' --codeSignIdentity : Type of signing identity used for code signing.'); - console.log(' --codeSignResourceRules : Path to ResourceRules.plist.'); - console.log(' --developmentTeam : New for Xcode 8. The development team (Team ID)'); - console.log(' to use for code signing.'); - console.log(' --provisioningProfile : UUID of the profile.'); - console.log(' --device --noSign : Builds project without application signing.'); - console.log(''); - console.log('examples:'); - console.log(' build '); - console.log(' build --debug'); - console.log(' build --release'); - console.log(' build --codeSignIdentity="iPhone Distribution" --provisioningProfile="926c2bd6-8de9-4c2f-8407-1016d2d12954"'); - // TODO: add support for building different archs - // console.log(" build --release --archs=\"armv7\""); - console.log(''); - process.exit(0); -}; diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/check_reqs.js b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/check_reqs.js deleted file mode 100644 index f786fc4..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/check_reqs.js +++ /dev/null @@ -1,235 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -'use strict'; - -const Q = require('q'); -const shell = require('shelljs'); -const util = require('util'); -const versions = require('./versions'); - -const SUPPORTED_OS_PLATFORMS = [ 'darwin' ]; - -const XCODEBUILD_MIN_VERSION = '9.0.0'; -const XCODEBUILD_NOT_FOUND_MESSAGE = - 'Please install version ' + XCODEBUILD_MIN_VERSION + ' or greater from App Store'; - -const IOS_DEPLOY_MIN_VERSION = '1.9.2'; -const IOS_DEPLOY_NOT_FOUND_MESSAGE = - 'Please download, build and install version ' + IOS_DEPLOY_MIN_VERSION + ' or greater' + - ' from https://github.com/ios-control/ios-deploy into your path, or do \'npm install -g ios-deploy\''; - -const COCOAPODS_MIN_VERSION = '1.0.1'; -const COCOAPODS_NOT_FOUND_MESSAGE = - 'Please install version ' + COCOAPODS_MIN_VERSION + ' or greater from https://cocoapods.org/'; -const COCOAPODS_NOT_SYNCED_MESSAGE = - 'The CocoaPods repo has not been synced yet, this will take a long time (approximately 500MB as of Sept 2016). Please run `pod setup` first to sync the repo.'; -const COCOAPODS_SYNCED_MIN_SIZE = 475; // in megabytes -const COCOAPODS_SYNC_ERROR_MESSAGE = - 'The CocoaPods repo has been created, but there appears to be a sync error. The repo size should be at least ' + COCOAPODS_SYNCED_MIN_SIZE + '. Please run `pod setup --verbose` to sync the repo.'; -const COCOAPODS_REPO_NOT_FOUND_MESSAGE = 'The CocoaPods repo at ~/.cocoapods was not found.'; - -/** - * Checks if xcode util is available - * @return {Promise} Returns a promise either resolved with xcode version or rejected - */ -module.exports.run = module.exports.check_xcodebuild = function () { - return checkTool('xcodebuild', XCODEBUILD_MIN_VERSION, XCODEBUILD_NOT_FOUND_MESSAGE); -}; - -/** - * Checks if ios-deploy util is available - * @return {Promise} Returns a promise either resolved with ios-deploy version or rejected - */ -module.exports.check_ios_deploy = function () { - return checkTool('ios-deploy', IOS_DEPLOY_MIN_VERSION, IOS_DEPLOY_NOT_FOUND_MESSAGE); -}; - -module.exports.check_os = function () { - // Build iOS apps available for OSX platform only, so we reject on others platforms - return os_platform_is_supported() ? - Q.resolve(process.platform) : - Q.reject('Cordova tooling for iOS requires Apple macOS'); -}; - -function os_platform_is_supported () { - return (SUPPORTED_OS_PLATFORMS.indexOf(process.platform) !== -1); -} - -function check_cocoapod_tool (toolChecker) { - toolChecker = toolChecker || checkTool; - if (os_platform_is_supported()) { // CB-12856 - return toolChecker('pod', COCOAPODS_MIN_VERSION, COCOAPODS_NOT_FOUND_MESSAGE, 'CocoaPods'); - } else { - return Q.resolve({ - 'ignore': true, - 'ignoreMessage': `CocoaPods check and installation ignored on ${process.platform}` - }); - } -} - -/** - * Checks if cocoapods repo size is what is expected - * @return {Promise} Returns a promise either resolved or rejected - */ -module.exports.check_cocoapods_repo_size = function () { - return check_cocoapod_tool() - .then(function (toolOptions) { - // check size of ~/.cocoapods repo - let commandString = util.format('du -sh %s/.cocoapods', process.env.HOME); - let command = shell.exec(commandString, { silent: true }); - // command.output is e.g "750M path/to/.cocoapods", we just scan the number - let size = toolOptions.ignore ? 0 : parseFloat(command.output); - - if (toolOptions.ignore || command.code === 0) { // success, parse output - return Q.resolve(size, toolOptions); - } else { // error, perhaps not found - return Q.reject(util.format('%s (%s)', COCOAPODS_REPO_NOT_FOUND_MESSAGE, command.output)); - } - }) - .then(function (repoSize, toolOptions) { - if (toolOptions.ignore || COCOAPODS_SYNCED_MIN_SIZE <= repoSize) { // success, expected size - return Q.resolve(toolOptions); - } else { - return Q.reject(COCOAPODS_SYNC_ERROR_MESSAGE); - } - }); -}; - -/** - * Checks if cocoapods is available, and whether the repo is synced (because it takes a long time to download) - * @return {Promise} Returns a promise either resolved or rejected - */ -module.exports.check_cocoapods = function (toolChecker) { - return check_cocoapod_tool(toolChecker) - // check whether the cocoapods repo has been synced through `pod repo` command - // a value of '0 repos' means it hasn't been synced - .then(function (toolOptions) { - if (toolOptions.ignore) return toolOptions; - - // starting with 1.8.0 cocoapods now use cdn and we dont need to sync first - if (versions.compareVersions(toolOptions.version, '1.8.0') >= 0) { - return toolOptions; - } - - let code = shell.exec('pod repo | grep -e "^0 repos"', { silent: true }).code; - let repoIsSynced = (code !== 0); - - if (repoIsSynced) { - // return check_cocoapods_repo_size(); - // we could check the repo size above, but it takes too long. - return toolOptions; - } else { - return Promise.reject(COCOAPODS_NOT_SYNCED_MESSAGE); - } - }); -}; - -/** - * Checks if specific tool is available. - * @param {String} tool Tool name to check. Known tools are 'xcodebuild' and 'ios-deploy' - * @param {Number} minVersion Min allowed tool version. - * @param {String} message Message that will be used to reject promise. - * @param {String} toolFriendlyName Friendly name of the tool, to report to the user. Optional. - * @return {Promise} Returns a promise either resolved with tool version or rejected - */ -function checkTool (tool, minVersion, message, toolFriendlyName) { - toolFriendlyName = toolFriendlyName || tool; - - // Check whether tool command is available at all - let tool_command = shell.which(tool); - if (!tool_command) { - return Q.reject(toolFriendlyName + ' was not found. ' + (message || '')); - } - - // check if tool version is greater than specified one - return versions.get_tool_version(tool).then(function (version) { - version = version.trim(); - return versions.compareVersions(version, minVersion) >= 0 ? - Q.resolve({ 'version': version }) : - Q.reject('Cordova needs ' + toolFriendlyName + ' version ' + minVersion + - ' or greater, you have version ' + version + '. ' + (message || '')); - }); -} - -/** - * Object that represents one of requirements for current platform. - * @param {String} id The unique identifier for this requirements. - * @param {String} name The name of requirements. Human-readable field. - * @param {Boolean} isFatal Marks the requirement as fatal. If such requirement will fail - * next requirements' checks will be skipped. - */ -let Requirement = function (id, name, isFatal) { - this.id = id; - this.name = name; - this.installed = false; - this.metadata = {}; - this.isFatal = isFatal || false; -}; - -/** - * Methods that runs all checks one by one and returns a result of checks - * as an array of Requirement objects. This method intended to be used by cordova-lib check_reqs method - * - * @return Promise Array of requirements. Due to implementation, promise is always fulfilled. - */ -module.exports.check_all = function () { - - const requirements = [ - new Requirement('os', 'Apple macOS', true), - new Requirement('xcode', 'Xcode'), - new Requirement('ios-deploy', 'ios-deploy'), - new Requirement('CocoaPods', 'CocoaPods') - ]; - - let result = []; - let fatalIsHit = false; - - let checkFns = [ - module.exports.check_os, - module.exports.check_xcodebuild, - module.exports.check_ios_deploy, - module.exports.check_cocoapods - ]; - - // Then execute requirement checks one-by-one - return checkFns.reduce(function (promise, checkFn, idx) { - return promise.then(function () { - // If fatal requirement is failed, - // we don't need to check others - if (fatalIsHit) return Q(); - - let requirement = requirements[idx]; - return checkFn() - .then(function (version) { - requirement.installed = true; - requirement.metadata.version = version; - result.push(requirement); - }, function (err) { - if (requirement.isFatal) fatalIsHit = true; - requirement.metadata.reason = err; - result.push(requirement); - }); - }); - }, Q()) - .then(function () { - // When chain is completed, return requirements array to upstream API - return result; - }); -}; diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/clean.js b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/clean.js deleted file mode 100644 index e5c24a5..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/clean.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -var Q = require('q'); -var path = require('path'); -var shell = require('shelljs'); -var superspawn = require('cordova-common').superspawn; - -var projectPath = path.join(__dirname, '..', '..'); - -module.exports.run = function () { - var projectName = shell.ls(projectPath).filter(function (name) { - return path.extname(name) === '.xcodeproj'; - })[0]; - - if (!projectName) { - return Q.reject('No Xcode project found in ' + projectPath); - } - - return superspawn.spawn('xcodebuild', ['-project', projectName, '-configuration', 'Debug', '-alltargets', 'clean'], { cwd: projectPath, printCommand: true, stdio: 'inherit' }) - .then(function () { - return superspawn.spawn('xcodebuild', ['-project', projectName, '-configuration', 'Release', '-alltargets', 'clean'], { cwd: projectPath, printCommand: true, stdio: 'inherit' }); - }).then(function () { - return shell.rm('-rf', path.join(projectPath, 'build')); - }); -}; diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/list-devices b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/list-devices deleted file mode 100755 index 473ff5c..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/list-devices +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env node - -/* - 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 Q = require('q'); -var exec = require('child_process').exec; - -/** - * Gets list of connected iOS devices - * @return {Promise} Promise fulfilled with list of available iOS devices - */ -function listDevices () { - var commands = [ - Q.nfcall(exec, "ioreg -p IOUSB -l | sed -n -e '/iPad/,/USB Serial Number/p' | grep 'Serial Number' | awk -F\\\" '{print $4 \" iPad\"}'"), - Q.nfcall(exec, "ioreg -p IOUSB -l | sed -n -e '/iPhone/,/USB Serial Number/p' | grep 'Serial Number' | awk -F\\\" '{print $4 \" iPhone\"}'"), - Q.nfcall(exec, "ioreg -p IOUSB -l | sed -n -e '/iPod/,/USB Serial Number/p' | grep 'Serial Number' | awk -F\\\" '{print $4 \" iPod\"}'") - ]; - - // wrap al lexec calls into promises and wait until they're fullfilled - return Q.all(commands).then(function (results) { - var accumulator = []; - results.forEach(function (result) { - var devicefound; - // Each command promise resolves with array [stout, stderr], and we need stdout only - // Append stdout lines to accumulator - devicefound = result[0].trim().split('\n'); - if (devicefound && devicefound.length) { - devicefound.forEach(function (device) { - if (device) { - accumulator.push(device); - } - }); - } - }); - return accumulator; - }); -} - -exports.run = listDevices; - -// Check if module is started as separate script. -// If so, then invoke main method and print out results. -if (!module.parent) { - listDevices().then(function (devices) { - devices.forEach(function (device) { - console.log(device); - }); - }); -} diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/list-emulator-build-targets b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/list-emulator-build-targets deleted file mode 100755 index 25dfe72..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/list-emulator-build-targets +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/env node - -/* - 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 Q = require('q'); -var exec = require('child_process').exec; - -/** - * Returns a list of available simulator build targets of the form - * - * [ - * { name: , - * identifier: , - * simIdentifier: - * } - * ] - * - */ -function listEmulatorBuildTargets () { - return Q.nfcall(exec, 'xcrun simctl list --json') - .then(function (stdio) { - return JSON.parse(stdio[0]); - }) - .then(function (simInfo) { - var devices = simInfo.devices; - var deviceTypes = simInfo.devicetypes; - return deviceTypes.reduce(function (typeAcc, deviceType) { - if (!deviceType.name.match(/^[iPad|iPhone]/)) { - // ignore targets we don't support (like Apple Watch or Apple TV) - return typeAcc; - } - var availableDevices = Object.keys(devices).reduce(function (availAcc, deviceCategory) { - var availableDevicesInCategory = devices[deviceCategory]; - availableDevicesInCategory.forEach(function (device) { - if (device.name === deviceType.name || device.name === deviceType.name.replace(/-inch/g, ' inch')) { - // Check new flag isAvailable (XCode 10.1+) or legacy string availability (XCode 10 and lower) - if (device.isAvailable || (device.availability && device.availability.toLowerCase().indexOf('unavailable') < 0)) { - availAcc.push(device); - } - } - }); - return availAcc; - }, []); - // we only want device types that have at least one available device - // (regardless of OS); this filters things out like iPhone 4s, which - // is present in deviceTypes, but probably not available on the user's - // system. - if (availableDevices.length > 0) { - typeAcc.push(deviceType); - } - return typeAcc; - }, []); - }) - .then(function (filteredTargets) { - // the simIdentifier, or cordova emulate target name, is the very last part - // of identifier. - return filteredTargets.map(function (target) { - var identifierPieces = target.identifier.split('.'); - target.simIdentifier = identifierPieces[identifierPieces.length - 1]; - return target; - }); - }); -} - -exports.run = listEmulatorBuildTargets; - -/** - * Given a simIdentifier, return the matching target. - * - * @param {string} simIdentifier a target, like "iPhone-SE" - * @return {Object} the matching target, or undefined if no match - */ -exports.targetForSimIdentifier = function (simIdentifier) { - return listEmulatorBuildTargets() - .then(function (targets) { - return targets.reduce(function (acc, target) { - if (!acc && target.simIdentifier.toLowerCase() === simIdentifier.toLowerCase()) { - acc = target; - } - return acc; - }, undefined); - }); -}; - -// Check if module is started as separate script. -// If so, then invoke main method and print out results. -if (!module.parent) { - listEmulatorBuildTargets().then(function (targets) { - console.log(JSON.stringify(targets, null, 2)); - }); -} diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/list-emulator-images b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/list-emulator-images deleted file mode 100755 index 99557e2..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/list-emulator-images +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env node - -/* - 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 Q = require('q'); -var iossim = require('ios-sim'); - -/** - * Gets list of iOS devices available for simulation - * @return {Promise} Promise fulfilled with list of devices available for simulation - */ -function listEmulatorImages () { - return Q.resolve(iossim.getdevicetypes()); -} - -exports.run = listEmulatorImages; - -// Check if module is started as separate script. -// If so, then invoke main method and print out results. -if (!module.parent) { - listEmulatorImages().then(function (names) { - names.forEach(function (name) { - console.log(name); - }); - }); -} diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/list-started-emulators b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/list-started-emulators deleted file mode 100755 index 3626df8..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/list-started-emulators +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env node - -/* - 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 Q = require('q'); -var exec = require('child_process').exec; - -/** - * Gets list of running iOS simulators - * @return {Promise} Promise fulfilled with list of running iOS simulators - */ -function listStartedEmulators () { - // wrap exec call into promise - return Q.nfcall(exec, 'ps aux | grep -i "[i]OS Simulator"') - .then(function () { - return Q.nfcall(exec, 'defaults read com.apple.iphonesimulator "SimulateDevice"'); - }).then(function (stdio) { - return stdio[0].trim().split('\n'); - }); -} - -exports.run = listStartedEmulators; - -// Check if module is started as separate script. -// If so, then invoke main method and print out results. -if (!module.parent) { - listStartedEmulators().then(function (emulators) { - emulators.forEach(function (emulator) { - console.log(emulator); - }); - }); -} diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/plugman/pluginHandlers.js b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/plugman/pluginHandlers.js deleted file mode 100644 index bd9d853..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/plugman/pluginHandlers.js +++ /dev/null @@ -1,391 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ -'use strict'; -var fs = require('fs'); -var path = require('path'); -var shell = require('shelljs'); -var util = require('util'); -var events = require('cordova-common').events; -var CordovaError = require('cordova-common').CordovaError; - -// These frameworks are required by cordova-ios by default. We should never add/remove them. -var keep_these_frameworks = [ - 'MobileCoreServices.framework', - 'CoreGraphics.framework', - 'AssetsLibrary.framework' -]; - -var handlers = { - 'source-file': { - install: function (obj, plugin, project, options) { - installHelper('source-file', obj, plugin.dir, project.projectDir, plugin.id, options, project); - }, - uninstall: function (obj, plugin, project, options) { - uninstallHelper('source-file', obj, project.projectDir, plugin.id, options, project); - } - }, - 'header-file': { - install: function (obj, plugin, project, options) { - installHelper('header-file', obj, plugin.dir, project.projectDir, plugin.id, options, project); - }, - uninstall: function (obj, plugin, project, options) { - uninstallHelper('header-file', obj, project.projectDir, plugin.id, options, project); - } - }, - 'resource-file': { - install: function (obj, plugin, project, options) { - var src = obj.src; - var target = obj.target; - var srcFile = path.resolve(plugin.dir, src); - - if (!target) { - target = path.basename(src); - } - var destFile = path.resolve(project.resources_dir, target); - - if (!fs.existsSync(srcFile)) { - throw new CordovaError('Cannot find resource file "' + srcFile + '" for plugin ' + plugin.id + ' in iOS platform'); - } - if (fs.existsSync(destFile)) { - throw new CordovaError('File already exists at destination "' + destFile + '" for resource file specified by plugin ' + plugin.id + ' in iOS platform'); - } - project.xcode.addResourceFile(path.join('Resources', target)); - var link = !!(options && options.link); - copyFile(plugin.dir, src, project.projectDir, destFile, link); - }, - uninstall: function (obj, plugin, project, options) { - var src = obj.src; - var target = obj.target; - - if (!target) { - target = path.basename(src); - } - var destFile = path.resolve(project.resources_dir, target); - - project.xcode.removeResourceFile(path.join('Resources', target)); - shell.rm('-rf', destFile); - } - }, - 'framework': { // CB-5238 custom frameworks only - install: function (obj, plugin, project, options) { - var src = obj.src; - var custom = !!(obj.custom); // convert to boolean (if truthy/falsy) - var embed = !!(obj.embed); // convert to boolean (if truthy/falsy) - var link = !embed; // either link or embed can be true, but not both. the other has to be false - - if (!custom) { - var keepFrameworks = keep_these_frameworks; - - if (keepFrameworks.indexOf(src) < 0) { - if (obj.type === 'podspec') { - // podspec handled in Api.js - } else { - project.frameworks[src] = project.frameworks[src] || 0; - project.frameworks[src]++; - let opt = { customFramework: false, embed: false, link: true, weak: obj.weak }; - events.emit('verbose', util.format('Adding non-custom framework to project... %s -> %s', src, JSON.stringify(opt))); - project.xcode.addFramework(src, opt); - events.emit('verbose', util.format('Non-custom framework added to project. %s -> %s', src, JSON.stringify(opt))); - } - } - return; - } - var srcFile = path.resolve(plugin.dir, src); - var targetDir = path.resolve(project.plugins_dir, plugin.id, path.basename(src)); - if (!fs.existsSync(srcFile)) throw new CordovaError('Cannot find framework "' + srcFile + '" for plugin ' + plugin.id + ' in iOS platform'); - if (fs.existsSync(targetDir)) throw new CordovaError('Framework "' + targetDir + '" for plugin ' + plugin.id + ' already exists in iOS platform'); - var symlink = !!(options && options.link); - copyFile(plugin.dir, src, project.projectDir, targetDir, symlink); // frameworks are directories - // CB-10773 translate back slashes to forward on win32 - var project_relative = fixPathSep(path.relative(project.projectDir, targetDir)); - // CB-11233 create Embed Frameworks Build Phase if does not exist - var existsEmbedFrameworks = project.xcode.buildPhaseObject('PBXCopyFilesBuildPhase', 'Embed Frameworks'); - if (!existsEmbedFrameworks && embed) { - events.emit('verbose', '"Embed Frameworks" Build Phase (Embedded Binaries) does not exist, creating it.'); - project.xcode.addBuildPhase([], 'PBXCopyFilesBuildPhase', 'Embed Frameworks', null, 'frameworks'); - } - let opt = { customFramework: true, embed: embed, link: link, sign: true }; - events.emit('verbose', util.format('Adding custom framework to project... %s -> %s', src, JSON.stringify(opt))); - project.xcode.addFramework(project_relative, opt); - events.emit('verbose', util.format('Custom framework added to project. %s -> %s', src, JSON.stringify(opt))); - }, - uninstall: function (obj, plugin, project, options) { - var src = obj.src; - - if (!obj.custom) { // CB-9825 cocoapod integration for plugins - var keepFrameworks = keep_these_frameworks; - if (keepFrameworks.indexOf(src) < 0) { - if (obj.type !== 'podspec') { - // this should be refactored - project.frameworks[src] = project.frameworks[src] || 1; - project.frameworks[src]--; - if (project.frameworks[src] < 1) { - // Only remove non-custom framework from xcode project - // if there is no references remains - project.xcode.removeFramework(src); - delete project.frameworks[src]; - } - } - } - return; - } - - var targetDir = fixPathSep(path.resolve(project.plugins_dir, plugin.id, path.basename(src))); - var pbxFile = project.xcode.removeFramework(targetDir, { customFramework: true }); - if (pbxFile) { - project.xcode.removeFromPbxEmbedFrameworksBuildPhase(pbxFile); - } - shell.rm('-rf', targetDir); - } - }, - 'lib-file': { - install: function (obj, plugin, project, options) { - events.emit('verbose', ' install is not supported for iOS plugins'); - }, - uninstall: function (obj, plugin, project, options) { - events.emit('verbose', ' uninstall is not supported for iOS plugins'); - } - }, - 'asset': { - install: function (obj, plugin, project, options) { - if (!obj.src) { - throw new CordovaError(generateAttributeError('src', 'asset', plugin.id)); - } - if (!obj.target) { - throw new CordovaError(generateAttributeError('target', 'asset', plugin.id)); - } - - copyFile(plugin.dir, obj.src, project.www, obj.target); - if (options && options.usePlatformWww) copyFile(plugin.dir, obj.src, project.platformWww, obj.target); - }, - uninstall: function (obj, plugin, project, options) { - var target = obj.target; - - if (!target) { - throw new CordovaError(generateAttributeError('target', 'asset', plugin.id)); - } - - removeFile(project.www, target); - removeFileF(path.resolve(project.www, 'plugins', plugin.id)); - if (options && options.usePlatformWww) { - removeFile(project.platformWww, target); - removeFileF(path.resolve(project.platformWww, 'plugins', plugin.id)); - } - } - }, - 'js-module': { - install: function (obj, plugin, project, options) { - // Copy the plugin's files into the www directory. - var moduleSource = path.resolve(plugin.dir, obj.src); - var moduleName = plugin.id + '.' + (obj.name || path.basename(obj.src, path.extname(obj.src))); - - // Read in the file, prepend the cordova.define, and write it back out. - var scriptContent = fs.readFileSync(moduleSource, 'utf-8').replace(/^\ufeff/, ''); // Window BOM - if (moduleSource.match(/.*\.json$/)) { - scriptContent = 'module.exports = ' + scriptContent; - } - scriptContent = 'cordova.define("' + moduleName + '", function(require, exports, module) {\n' + scriptContent + '\n});\n'; - - var moduleDestination = path.resolve(project.www, 'plugins', plugin.id, obj.src); - shell.mkdir('-p', path.dirname(moduleDestination)); - fs.writeFileSync(moduleDestination, scriptContent, 'utf-8'); - if (options && options.usePlatformWww) { - var platformWwwDestination = path.resolve(project.platformWww, 'plugins', plugin.id, obj.src); - shell.mkdir('-p', path.dirname(platformWwwDestination)); - fs.writeFileSync(platformWwwDestination, scriptContent, 'utf-8'); - } - }, - uninstall: function (obj, plugin, project, options) { - var pluginRelativePath = path.join('plugins', plugin.id, obj.src); - removeFileAndParents(project.www, pluginRelativePath); - if (options && options.usePlatformWww) removeFileAndParents(project.platformWww, pluginRelativePath); - } - } -}; - -module.exports.getInstaller = function (type) { - if (handlers[type] && handlers[type].install) { - return handlers[type].install; - } - - events.emit('warn', '<' + type + '> is not supported for iOS plugins'); -}; - -module.exports.getUninstaller = function (type) { - if (handlers[type] && handlers[type].uninstall) { - return handlers[type].uninstall; - } - - events.emit('warn', '<' + type + '> is not supported for iOS plugins'); -}; - -function installHelper (type, obj, plugin_dir, project_dir, plugin_id, options, project) { - var srcFile = path.resolve(plugin_dir, obj.src); - var targetDir = path.resolve(project.plugins_dir, plugin_id, obj.targetDir || ''); - var destFile = path.join(targetDir, path.basename(obj.src)); - - var project_ref; - var link = !!(options && options.link); - if (link) { - var trueSrc = fs.realpathSync(srcFile); - // Create a symlink in the expected place, so that uninstall can use it. - if (options && options.force) { - copyFile(plugin_dir, trueSrc, project_dir, destFile, link); - } else { - copyNewFile(plugin_dir, trueSrc, project_dir, destFile, link); - } - // Xcode won't save changes to a file if there is a symlink involved. - // Make the Xcode reference the file directly. - // Note: Can't use path.join() here since it collapses 'Plugins/..', and xcode - // library special-cases Plugins/ prefix. - project_ref = 'Plugins/' + fixPathSep(path.relative(fs.realpathSync(project.plugins_dir), trueSrc)); - } else { - if (options && options.force) { - copyFile(plugin_dir, srcFile, project_dir, destFile, link); - } else { - copyNewFile(plugin_dir, srcFile, project_dir, destFile, link); - } - project_ref = 'Plugins/' + fixPathSep(path.relative(project.plugins_dir, destFile)); - } - - if (type === 'header-file') { - project.xcode.addHeaderFile(project_ref); - } else if (obj.framework) { - var opt = { weak: obj.weak }; - var project_relative = path.join(path.basename(project.xcode_path), project_ref); - project.xcode.addFramework(project_relative, opt); - project.xcode.addToLibrarySearchPaths({ path: project_ref }); - } else { - project.xcode.addSourceFile(project_ref, obj.compilerFlags ? { compilerFlags: obj.compilerFlags } : {}); - } -} - -function uninstallHelper (type, obj, project_dir, plugin_id, options, project) { - var targetDir = path.resolve(project.plugins_dir, plugin_id, obj.targetDir || ''); - var destFile = path.join(targetDir, path.basename(obj.src)); - - var project_ref; - var link = !!(options && options.link); - if (link) { - var trueSrc = fs.readlinkSync(destFile); - project_ref = 'Plugins/' + fixPathSep(path.relative(fs.realpathSync(project.plugins_dir), trueSrc)); - } else { - project_ref = 'Plugins/' + fixPathSep(path.relative(project.plugins_dir, destFile)); - } - - shell.rm('-rf', targetDir); - - if (type === 'header-file') { - project.xcode.removeHeaderFile(project_ref); - } else if (obj.framework) { - var project_relative = path.join(path.basename(project.xcode_path), project_ref); - project.xcode.removeFramework(project_relative); - project.xcode.removeFromLibrarySearchPaths({ path: project_ref }); - } else { - project.xcode.removeSourceFile(project_ref); - } -} - -var pathSepFix = new RegExp(path.sep.replace(/\\/, '\\\\'), 'g'); -function fixPathSep (file) { - return file.replace(pathSepFix, '/'); -} - -function copyFile (plugin_dir, src, project_dir, dest, link) { - src = path.resolve(plugin_dir, src); - if (!fs.existsSync(src)) throw new CordovaError('"' + src + '" not found!'); - - // check that src path is inside plugin directory - var real_path = fs.realpathSync(src); - var real_plugin_path = fs.realpathSync(plugin_dir); - if (real_path.indexOf(real_plugin_path) !== 0) { throw new CordovaError('File "' + src + '" is located outside the plugin directory "' + plugin_dir + '"'); } - - dest = path.resolve(project_dir, dest); - - // check that dest path is located in project directory - if (dest.indexOf(project_dir) !== 0) { throw new CordovaError('Destination "' + dest + '" for source file "' + src + '" is located outside the project'); } - - shell.mkdir('-p', path.dirname(dest)); - - if (link) { - linkFileOrDirTree(src, dest); - } else if (fs.statSync(src).isDirectory()) { - // XXX shelljs decides to create a directory when -R|-r is used which sucks. http://goo.gl/nbsjq - shell.cp('-Rf', path.join(src, '/*'), dest); - } else { - shell.cp('-f', src, dest); - } -} - -// Same as copy file but throws error if target exists -function copyNewFile (plugin_dir, src, project_dir, dest, link) { - var target_path = path.resolve(project_dir, dest); - if (fs.existsSync(target_path)) { throw new CordovaError('"' + target_path + '" already exists!'); } - - copyFile(plugin_dir, src, project_dir, dest, !!link); -} - -function linkFileOrDirTree (src, dest) { - if (fs.existsSync(dest)) { - shell.rm('-Rf', dest); - } - - if (fs.statSync(src).isDirectory()) { - shell.mkdir('-p', dest); - fs.readdirSync(src).forEach(function (entry) { - linkFileOrDirTree(path.join(src, entry), path.join(dest, entry)); - }); - } else { - fs.linkSync(src, dest); - } -} - -// checks if file exists and then deletes. Error if doesn't exist -function removeFile (project_dir, src) { - var file = path.resolve(project_dir, src); - shell.rm('-Rf', file); -} - -// deletes file/directory without checking -function removeFileF (file) { - shell.rm('-Rf', file); -} - -function removeFileAndParents (baseDir, destFile, stopper) { - stopper = stopper || '.'; - var file = path.resolve(baseDir, destFile); - if (!fs.existsSync(file)) return; - - removeFileF(file); - - // check if directory is empty - var curDir = path.dirname(file); - - while (curDir !== path.resolve(baseDir, stopper)) { - if (fs.existsSync(curDir) && fs.readdirSync(curDir).length === 0) { - fs.rmdirSync(curDir); - curDir = path.resolve(curDir, '..'); - } else { - // directory not empty...do nothing - break; - } - } -} - -function generateAttributeError (attribute, element, id) { - return 'Required attribute "' + attribute + '" not specified in <' + element + '> element from plugin: ' + id; -} diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/prepare.js b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/prepare.js deleted file mode 100644 index 16ffd4e..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/prepare.js +++ /dev/null @@ -1,1190 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -'use strict'; -var Q = require('q'); -var fs = require('fs'); -var path = require('path'); -var shell = require('shelljs'); -var unorm = require('unorm'); -var plist = require('plist'); -var URL = require('url'); -var events = require('cordova-common').events; -var xmlHelpers = require('cordova-common').xmlHelpers; -var ConfigParser = require('cordova-common').ConfigParser; -var CordovaError = require('cordova-common').CordovaError; -var PlatformJson = require('cordova-common').PlatformJson; -var PlatformMunger = require('cordova-common').ConfigChanges.PlatformMunger; -var PluginInfoProvider = require('cordova-common').PluginInfoProvider; -var FileUpdater = require('cordova-common').FileUpdater; -var projectFile = require('./projectFile'); -var xcode = require('xcode'); - -// launch storyboard and related constants -var LAUNCHIMAGE_BUILD_SETTING = 'ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME'; -var LAUNCHIMAGE_BUILD_SETTING_VALUE = 'LaunchImage'; -var UI_LAUNCH_STORYBOARD_NAME = 'UILaunchStoryboardName'; -var CDV_LAUNCH_STORYBOARD_NAME = 'CDVLaunchScreen'; -var IMAGESET_COMPACT_SIZE_CLASS = 'compact'; -var CDV_ANY_SIZE_CLASS = 'any'; - -module.exports.prepare = function (cordovaProject, options) { - var self = this; - - var platformJson = PlatformJson.load(this.locations.root, 'ios'); - var munger = new PlatformMunger('ios', this.locations.root, platformJson, new PluginInfoProvider()); - - this._config = updateConfigFile(cordovaProject.projectConfig, munger, this.locations); - - // Update own www dir with project's www assets and plugins' assets and js-files - return Q.when(updateWww(cordovaProject, this.locations)) - .then(function () { - // update project according to config.xml changes. - return updateProject(self._config, self.locations); - }) - .then(function () { - updateIcons(cordovaProject, self.locations); - updateSplashScreens(cordovaProject, self.locations); - updateLaunchStoryboardImages(cordovaProject, self.locations); - updateFileResources(cordovaProject, self.locations); - }) - .then(function () { - events.emit('verbose', 'Prepared iOS project successfully'); - }); -}; - -module.exports.clean = function (options) { - // A cordovaProject isn't passed into the clean() function, because it might have - // been called from the platform shell script rather than the CLI. Check for the - // noPrepare option passed in by the non-CLI clean script. If that's present, or if - // there's no config.xml found at the project root, then don't clean prepared files. - var projectRoot = path.resolve(this.root, '../..'); - var projectConfigFile = path.join(projectRoot, 'config.xml'); - if ((options && options.noPrepare) || !fs.existsSync(projectConfigFile) || - !fs.existsSync(this.locations.configXml)) { - return Q(); - } - - var projectConfig = new ConfigParser(this.locations.configXml); - - var self = this; - return Q().then(function () { - cleanWww(projectRoot, self.locations); - cleanIcons(projectRoot, projectConfig, self.locations); - cleanSplashScreens(projectRoot, projectConfig, self.locations); - cleanLaunchStoryboardImages(projectRoot, projectConfig, self.locations); - cleanFileResources(projectRoot, projectConfig, self.locations); - }); -}; - -/** - * Updates config files in project based on app's config.xml and config munge, - * generated by plugins. - * - * @param {ConfigParser} sourceConfig A project's configuration that will - * be merged into platform's config.xml - * @param {ConfigChanges} configMunger An initialized ConfigChanges instance - * for this platform. - * @param {Object} locations A map of locations for this platform - * - * @return {ConfigParser} An instance of ConfigParser, that - * represents current project's configuration. When returned, the - * configuration is already dumped to appropriate config.xml file. - */ -function updateConfigFile (sourceConfig, configMunger, locations) { - events.emit('verbose', 'Generating platform-specific config.xml from defaults for iOS at ' + locations.configXml); - - // First cleanup current config and merge project's one into own - // Overwrite platform config.xml with defaults.xml. - shell.cp('-f', locations.defaultConfigXml, locations.configXml); - - // Then apply config changes from global munge to all config files - // in project (including project's config) - configMunger.reapply_global_munge().save_all(); - - events.emit('verbose', 'Merging project\'s config.xml into platform-specific iOS config.xml'); - // Merge changes from app's config.xml into platform's one - var config = new ConfigParser(locations.configXml); - xmlHelpers.mergeXml(sourceConfig.doc.getroot(), - config.doc.getroot(), 'ios', /* clobber= */true); - - config.write(); - return config; -} - -/** - * Logs all file operations via the verbose event stream, indented. - */ -function logFileOp (message) { - events.emit('verbose', ' ' + message); -} - -/** - * Updates platform 'www' directory by replacing it with contents of - * 'platform_www' and app www. Also copies project's overrides' folder into - * the platform 'www' folder - * - * @param {Object} cordovaProject An object which describes cordova project. - * @param {boolean} destinations An object that contains destinations - * paths for www files. - */ -function updateWww (cordovaProject, destinations) { - var sourceDirs = [ - path.relative(cordovaProject.root, cordovaProject.locations.www), - path.relative(cordovaProject.root, destinations.platformWww) - ]; - - // If project contains 'merges' for our platform, use them as another overrides - var merges_path = path.join(cordovaProject.root, 'merges', 'ios'); - if (fs.existsSync(merges_path)) { - events.emit('verbose', 'Found "merges/ios" folder. Copying its contents into the iOS project.'); - sourceDirs.push(path.join('merges', 'ios')); - } - - var targetDir = path.relative(cordovaProject.root, destinations.www); - events.emit( - 'verbose', 'Merging and updating files from [' + sourceDirs.join(', ') + '] to ' + targetDir); - FileUpdater.mergeAndUpdateDir( - sourceDirs, targetDir, { rootDir: cordovaProject.root }, logFileOp); -} - -/** - * Cleans all files from the platform 'www' directory. - */ -function cleanWww (projectRoot, locations) { - var targetDir = path.relative(projectRoot, locations.www); - events.emit('verbose', 'Cleaning ' + targetDir); - - // No source paths are specified, so mergeAndUpdateDir() will clear the target directory. - FileUpdater.mergeAndUpdateDir( - [], targetDir, { rootDir: projectRoot, all: true }, logFileOp); -} - -/** - * Updates project structure and AndroidManifest according to project's configuration. - * - * @param {ConfigParser} platformConfig A project's configuration that will - * be used to update project - * @param {Object} locations A map of locations for this platform (In/Out) - */ -function updateProject (platformConfig, locations) { - - // CB-6992 it is necessary to normalize characters - // because node and shell scripts handles unicode symbols differently - // We need to normalize the name to NFD form since iOS uses NFD unicode form - var name = unorm.nfd(platformConfig.name()); - var version = platformConfig.version(); - var displayName = platformConfig.shortName && platformConfig.shortName(); - - var originalName = path.basename(locations.xcodeCordovaProj); - - // Update package id (bundle id) - var plistFile = path.join(locations.xcodeCordovaProj, originalName + '-Info.plist'); - var infoPlist = plist.parse(fs.readFileSync(plistFile, 'utf8')); - - // Update version (bundle version) - infoPlist['CFBundleShortVersionString'] = version; - var CFBundleVersion = platformConfig.getAttribute('ios-CFBundleVersion') || default_CFBundleVersion(version); - infoPlist['CFBundleVersion'] = CFBundleVersion; - - if (platformConfig.getAttribute('defaultlocale')) { - infoPlist['CFBundleDevelopmentRegion'] = platformConfig.getAttribute('defaultlocale'); - } - - if (displayName) { - infoPlist['CFBundleDisplayName'] = displayName; - } - - // replace Info.plist ATS entries according to and config.xml entries - var ats = writeATSEntries(platformConfig); - if (Object.keys(ats).length > 0) { - infoPlist['NSAppTransportSecurity'] = ats; - } else { - delete infoPlist['NSAppTransportSecurity']; - } - - handleOrientationSettings(platformConfig, infoPlist); - updateProjectPlistForLaunchStoryboard(platformConfig, infoPlist); - - /* eslint-disable no-tabs */ - // Write out the plist file with the same formatting as Xcode does - var info_contents = plist.build(infoPlist, { indent: '\t', offset: -1 }); - /* eslint-enable no-tabs */ - - info_contents = info_contents.replace(/[\s\r\n]*<\/string>/g, ''); - fs.writeFileSync(plistFile, info_contents, 'utf-8'); - events.emit('verbose', 'Wrote out iOS Bundle Version "' + version + '" to ' + plistFile); - - return handleBuildSettings(platformConfig, locations, infoPlist).then(function () { - if (name === originalName) { - events.emit('verbose', 'iOS Product Name has not changed (still "' + originalName + '")'); - return Q(); - } else { // CB-11712 was changed, we don't support it' - var errorString = - 'The product name change ( tag) in config.xml is not supported dynamically.\n' + - 'To change your product name, you have to remove, then add your ios platform again.\n' + - 'Make sure you save your plugins beforehand using `cordova plugin save`.\n' + - '\tcordova plugin save\n' + - '\tcordova platform rm ios\n' + - '\tcordova platform add ios\n' - ; - - return Q.reject(new CordovaError(errorString)); - } - }); -} - -function handleOrientationSettings (platformConfig, infoPlist) { - - switch (getOrientationValue(platformConfig)) { - case 'portrait': - infoPlist['UIInterfaceOrientation'] = [ 'UIInterfaceOrientationPortrait' ]; - infoPlist['UISupportedInterfaceOrientations'] = [ 'UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown' ]; - infoPlist['UISupportedInterfaceOrientations~ipad'] = [ 'UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown' ]; - break; - case 'landscape': - infoPlist['UIInterfaceOrientation'] = [ 'UIInterfaceOrientationLandscapeLeft' ]; - infoPlist['UISupportedInterfaceOrientations'] = [ 'UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight' ]; - infoPlist['UISupportedInterfaceOrientations~ipad'] = [ 'UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight' ]; - break; - case 'all': - infoPlist['UIInterfaceOrientation'] = [ 'UIInterfaceOrientationPortrait' ]; - infoPlist['UISupportedInterfaceOrientations'] = [ 'UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown', 'UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight' ]; - infoPlist['UISupportedInterfaceOrientations~ipad'] = [ 'UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown', 'UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight' ]; - break; - case 'default': - infoPlist['UISupportedInterfaceOrientations'] = [ 'UIInterfaceOrientationPortrait', 'UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight' ]; - infoPlist['UISupportedInterfaceOrientations~ipad'] = [ 'UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown', 'UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight' ]; - delete infoPlist['UIInterfaceOrientation']; - } -} - -function handleBuildSettings (platformConfig, locations, infoPlist) { - var pkg = platformConfig.getAttribute('ios-CFBundleIdentifier') || platformConfig.packageName(); - var targetDevice = parseTargetDevicePreference(platformConfig.getPreference('target-device', 'ios')); - var deploymentTarget = platformConfig.getPreference('deployment-target', 'ios'); - var needUpdatedBuildSettingsForLaunchStoryboard = checkIfBuildSettingsNeedUpdatedForLaunchStoryboard(platformConfig, infoPlist); - var swiftVersion = platformConfig.getPreference('SwiftVersion', 'ios'); - var wkWebViewOnly = platformConfig.getPreference('WKWebViewOnly'); - - var project; - - try { - project = projectFile.parse(locations); - } catch (err) { - return Q.reject(new CordovaError('Could not parse ' + locations.pbxproj + ': ' + err)); - } - - var origPkg = project.xcode.getBuildProperty('PRODUCT_BUNDLE_IDENTIFIER'); - - // no build settings provided and we don't need to update build settings for launch storyboards, - // then we don't need to parse and update .pbxproj file - if (origPkg === pkg && !targetDevice && !deploymentTarget && !needUpdatedBuildSettingsForLaunchStoryboard && !swiftVersion && !wkWebViewOnly) { - return Q(); - } - - if (origPkg !== pkg) { - events.emit('verbose', 'Set PRODUCT_BUNDLE_IDENTIFIER to ' + pkg + '.'); - project.xcode.updateBuildProperty('PRODUCT_BUNDLE_IDENTIFIER', pkg); - } - - if (targetDevice) { - events.emit('verbose', 'Set TARGETED_DEVICE_FAMILY to ' + targetDevice + '.'); - project.xcode.updateBuildProperty('TARGETED_DEVICE_FAMILY', targetDevice); - } - - if (deploymentTarget) { - events.emit('verbose', 'Set IPHONEOS_DEPLOYMENT_TARGET to "' + deploymentTarget + '".'); - project.xcode.updateBuildProperty('IPHONEOS_DEPLOYMENT_TARGET', deploymentTarget); - } - - if (swiftVersion) { - events.emit('verbose', 'Set SwiftVersion to "' + swiftVersion + '".'); - project.xcode.updateBuildProperty('SWIFT_VERSION', swiftVersion); - } - if (wkWebViewOnly) { - var wkwebviewValue = '1'; - if (wkWebViewOnly === 'true') { - events.emit('verbose', 'Set WK_WEB_VIEW_ONLY.'); - } else { - wkwebviewValue = '0'; - events.emit('verbose', 'Unset WK_WEB_VIEW_ONLY.'); - } - project.xcode.updateBuildProperty('WK_WEB_VIEW_ONLY', wkwebviewValue); - var cordovaLibXcodePath = path.join(locations.root, 'CordovaLib', 'CordovaLib.xcodeproj'); - var pbxPath = path.join(cordovaLibXcodePath, 'project.pbxproj'); - var xcodeproj = xcode.project(pbxPath); - xcodeproj.parseSync(); - xcodeproj.updateBuildProperty('WK_WEB_VIEW_ONLY', wkwebviewValue); - fs.writeFileSync(pbxPath, xcodeproj.writeSync()); - } - - updateBuildSettingsForLaunchStoryboard(project.xcode, platformConfig, infoPlist); - - project.write(); - - return Q(); -} - -function mapIconResources (icons, iconsDir) { - // See https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html - // for launch images sizes reference. - var platformIcons = [ - { dest: 'icon-20.png', width: 20, height: 20 }, - { dest: 'icon-20@2x.png', width: 40, height: 40 }, - { dest: 'icon-20@3x.png', width: 60, height: 60 }, - { dest: 'icon-40.png', width: 40, height: 40 }, - { dest: 'icon-40@2x.png', width: 80, height: 80 }, - { dest: 'icon-50.png', width: 50, height: 50 }, - { dest: 'icon-50@2x.png', width: 100, height: 100 }, - { dest: 'icon-60@2x.png', width: 120, height: 120 }, - { dest: 'icon-60@3x.png', width: 180, height: 180 }, - { dest: 'icon-72.png', width: 72, height: 72 }, - { dest: 'icon-72@2x.png', width: 144, height: 144 }, - { dest: 'icon-76.png', width: 76, height: 76 }, - { dest: 'icon-76@2x.png', width: 152, height: 152 }, - { dest: 'icon-83.5@2x.png', width: 167, height: 167 }, - { dest: 'icon-1024.png', width: 1024, height: 1024 }, - { dest: 'icon-29.png', width: 29, height: 29 }, - { dest: 'icon-29@2x.png', width: 58, height: 58 }, - { dest: 'icon-29@3x.png', width: 87, height: 87 }, - { dest: 'icon.png', width: 57, height: 57 }, - { dest: 'icon@2x.png', width: 114, height: 114 }, - { dest: 'icon-24@2x.png', width: 48, height: 48 }, - { dest: 'icon-27.5@2x.png', width: 55, height: 55 }, - { dest: 'icon-44@2x.png', width: 88, height: 88 }, - { dest: 'icon-86@2x.png', width: 172, height: 172 }, - { dest: 'icon-98@2x.png', width: 196, height: 196 } - ]; - - var pathMap = {}; - platformIcons.forEach(function (item) { - var icon = icons.getBySize(item.width, item.height) || icons.getDefault(); - if (icon) { - var target = path.join(iconsDir, item.dest); - pathMap[target] = icon.src; - } - }); - return pathMap; -} - -function getIconsDir (projectRoot, platformProjDir) { - var iconsDir; - var xcassetsExists = folderExists(path.join(projectRoot, platformProjDir, 'Images.xcassets/')); - - if (xcassetsExists) { - iconsDir = path.join(platformProjDir, 'Images.xcassets/AppIcon.appiconset/'); - } else { - iconsDir = path.join(platformProjDir, 'Resources/icons/'); - } - - return iconsDir; -} - -function updateIcons (cordovaProject, locations) { - var icons = cordovaProject.projectConfig.getIcons('ios'); - - if (icons.length === 0) { - events.emit('verbose', 'This app does not have icons defined'); - return; - } - - var platformProjDir = path.relative(cordovaProject.root, locations.xcodeCordovaProj); - var iconsDir = getIconsDir(cordovaProject.root, platformProjDir); - var resourceMap = mapIconResources(icons, iconsDir); - events.emit('verbose', 'Updating icons at ' + iconsDir); - FileUpdater.updatePaths( - resourceMap, { rootDir: cordovaProject.root }, logFileOp); -} - -function cleanIcons (projectRoot, projectConfig, locations) { - var icons = projectConfig.getIcons('ios'); - if (icons.length > 0) { - var platformProjDir = path.relative(projectRoot, locations.xcodeCordovaProj); - var iconsDir = getIconsDir(projectRoot, platformProjDir); - var resourceMap = mapIconResources(icons, iconsDir); - Object.keys(resourceMap).forEach(function (targetIconPath) { - resourceMap[targetIconPath] = null; - }); - events.emit('verbose', 'Cleaning icons at ' + iconsDir); - - // Source paths are removed from the map, so updatePaths() will delete the target files. - FileUpdater.updatePaths( - resourceMap, { rootDir: projectRoot, all: true }, logFileOp); - } -} - -function mapSplashScreenResources (splashScreens, splashScreensDir) { - var platformSplashScreens = [ - { dest: 'Default~iphone.png', width: 320, height: 480 }, - { dest: 'Default@2x~iphone.png', width: 640, height: 960 }, - { dest: 'Default-Portrait~ipad.png', width: 768, height: 1024 }, - { dest: 'Default-Portrait@2x~ipad.png', width: 1536, height: 2048 }, - { dest: 'Default-Landscape~ipad.png', width: 1024, height: 768 }, - { dest: 'Default-Landscape@2x~ipad.png', width: 2048, height: 1536 }, - { dest: 'Default-568h@2x~iphone.png', width: 640, height: 1136 }, - { dest: 'Default-667h.png', width: 750, height: 1334 }, - { dest: 'Default-736h.png', width: 1242, height: 2208 }, - { dest: 'Default-Landscape-736h.png', width: 2208, height: 1242 }, - { dest: 'Default-2436h.png', width: 1125, height: 2436 }, - { dest: 'Default-Landscape-2436h.png', width: 2436, height: 1125 } - ]; - - var pathMap = {}; - platformSplashScreens.forEach(function (item) { - var splash = splashScreens.getBySize(item.width, item.height); - if (splash) { - var target = path.join(splashScreensDir, item.dest); - pathMap[target] = splash.src; - } - }); - return pathMap; -} - -function getSplashScreensDir (projectRoot, platformProjDir) { - var splashScreensDir; - var xcassetsExists = folderExists(path.join(projectRoot, platformProjDir, 'Images.xcassets/')); - - if (xcassetsExists) { - splashScreensDir = path.join(platformProjDir, 'Images.xcassets/LaunchImage.launchimage/'); - } else { - splashScreensDir = path.join(platformProjDir, 'Resources/splash/'); - } - - return splashScreensDir; -} - -function updateSplashScreens (cordovaProject, locations) { - var splashScreens = cordovaProject.projectConfig.getSplashScreens('ios'); - - if (splashScreens.length === 0) { - events.emit('verbose', 'This app does not have splash screens defined'); - return; - } - - var platformProjDir = path.relative(cordovaProject.root, locations.xcodeCordovaProj); - var splashScreensDir = getSplashScreensDir(cordovaProject.root, platformProjDir); - var resourceMap = mapSplashScreenResources(splashScreens, splashScreensDir); - events.emit('verbose', 'Updating splash screens at ' + splashScreensDir); - FileUpdater.updatePaths( - resourceMap, { rootDir: cordovaProject.root }, logFileOp); -} - -function cleanSplashScreens (projectRoot, projectConfig, locations) { - var splashScreens = projectConfig.getSplashScreens('ios'); - if (splashScreens.length > 0) { - var platformProjDir = path.relative(projectRoot, locations.xcodeCordovaProj); - var splashScreensDir = getSplashScreensDir(projectRoot, platformProjDir); - var resourceMap = mapIconResources(splashScreens, splashScreensDir); - Object.keys(resourceMap).forEach(function (targetSplashPath) { - resourceMap[targetSplashPath] = null; - }); - events.emit('verbose', 'Cleaning splash screens at ' + splashScreensDir); - - // Source paths are removed from the map, so updatePaths() will delete the target files. - FileUpdater.updatePaths( - resourceMap, { rootDir: projectRoot, all: true }, logFileOp); - } -} - -function updateFileResources (cordovaProject, locations) { - const platformDir = path.relative(cordovaProject.root, locations.root); - const files = cordovaProject.projectConfig.getFileResources('ios'); - - const project = projectFile.parse(locations); - - // if there are resource-file elements in config.xml - if (files.length === 0) { - events.emit('verbose', 'This app does not have additional resource files defined'); - return; - } - - let resourceMap = {}; - files.forEach(function (res) { - let src = res.src; - let target = res.target; - - if (!target) { - target = src; - } - - let targetPath = path.join(project.resources_dir, target); - targetPath = path.relative(cordovaProject.root, targetPath); - - if (!fs.existsSync(targetPath)) { - project.xcode.addResourceFile(target); - } else { - events.emit('warn', 'Overwriting existing resource file at ' + targetPath); - } - - resourceMap[targetPath] = src; - }); - - events.emit('verbose', 'Updating resource files at ' + platformDir); - FileUpdater.updatePaths( - resourceMap, { rootDir: cordovaProject.root }, logFileOp); - - project.write(); -} - -function cleanFileResources (projectRoot, projectConfig, locations) { - const platformDir = path.relative(projectRoot, locations.root); - const files = projectConfig.getFileResources('ios', true); - if (files.length > 0) { - events.emit('verbose', 'Cleaning resource files at ' + platformDir); - - const project = projectFile.parse(locations); - - var resourceMap = {}; - files.forEach(function (res) { - let src = res.src; - let target = res.target; - - if (!target) { - target = src; - } - - let targetPath = path.join(project.resources_dir, target); - targetPath = path.relative(projectRoot, targetPath); - const resfile = path.join('Resources', path.basename(targetPath)); - project.xcode.removeResourceFile(resfile); - - resourceMap[targetPath] = null; - }); - - FileUpdater.updatePaths( - resourceMap, { rootDir: projectRoot, all: true }, logFileOp); - - project.write(); - } -} - -/** - * Returns an array of images for each possible idiom, scale, and size class. The images themselves are - * located in the platform's splash images by their pattern (@scale~idiom~sizesize). All possible - * combinations are returned, but not all will have a `filename` property. If the latter isn't present, - * the device won't attempt to load an image matching the same traits. If the filename is present, - * the device will try to load the image if it corresponds to the traits. - * - * The resulting return looks like this: - * - * [ - * { - * idiom: 'universal|ipad|iphone', - * scale: '1x|2x|3x', - * width: 'any|com', - * height: 'any|com', - * filename: undefined|'Default@scale~idiom~widthheight.png', - * src: undefined|'path/to/original/matched/image/from/splash/screens.png', - * target: undefined|'path/to/asset/library/Default@scale~idiom~widthheight.png' - * }, ... - * ] - * - * @param {Array} splashScreens splash screens as defined in config.xml for this platform - * @param {string} launchStoryboardImagesDir project-root/Images.xcassets/LaunchStoryboard.imageset/ - * @return {Array} - */ -function mapLaunchStoryboardContents (splashScreens, launchStoryboardImagesDir) { - var platformLaunchStoryboardImages = []; - var idioms = ['universal', 'ipad', 'iphone']; - var scalesForIdiom = { - universal: ['1x', '2x', '3x'], - ipad: ['1x', '2x'], - iphone: ['1x', '2x', '3x'] - }; - var sizes = ['com', 'any']; - - idioms.forEach(function (idiom) { - scalesForIdiom[idiom].forEach(function (scale) { - sizes.forEach(function (width) { - sizes.forEach(function (height) { - var item = { - idiom: idiom, - scale: scale, - width: width, - height: height - }; - - /* examples of the search pattern: - * scale ~ idiom ~ width height - * @2x ~ universal ~ any any - * @3x ~ iphone ~ com any - * @2x ~ ipad ~ com any - */ - var searchPattern = '@' + scale + '~' + idiom + '~' + width + height; - - /* because old node versions don't have Array.find, the below is - * functionally equivalent to this: - * var launchStoryboardImage = splashScreens.find(function(item) { - * return item.src.indexOf(searchPattern) >= 0; - * }); - */ - var launchStoryboardImage = splashScreens.reduce(function (p, c) { - return (c.src.indexOf(searchPattern) >= 0) ? c : p; - }, undefined); - - if (launchStoryboardImage) { - item.filename = 'Default' + searchPattern + '.png'; - item.src = launchStoryboardImage.src; - item.target = path.join(launchStoryboardImagesDir, item.filename); - } - - platformLaunchStoryboardImages.push(item); - }); - }); - }); - }); - return platformLaunchStoryboardImages; -} - -/** - * Returns a dictionary representing the source and destination paths for the launch storyboard images - * that need to be copied. - * - * The resulting return looks like this: - * - * { - * 'target-path': 'source-path', - * ... - * } - * - * @param {Array} splashScreens splash screens as defined in config.xml for this platform - * @param {string} launchStoryboardImagesDir project-root/Images.xcassets/LaunchStoryboard.imageset/ - * @return {Object} - */ -function mapLaunchStoryboardResources (splashScreens, launchStoryboardImagesDir) { - var platformLaunchStoryboardImages = mapLaunchStoryboardContents(splashScreens, launchStoryboardImagesDir); - var pathMap = {}; - platformLaunchStoryboardImages.forEach(function (item) { - if (item.target) { - pathMap[item.target] = item.src; - } - }); - return pathMap; -} - -/** - * Builds the object that represents the contents.json file for the LaunchStoryboard image set. - * - * The resulting return looks like this: - * - * { - * images: [ - * { - * idiom: 'universal|ipad|iphone', - * scale: '1x|2x|3x', - * width-class: undefined|'compact', - * height-class: undefined|'compact' - * }, ... - * ], - * info: { - * author: 'Xcode', - * version: 1 - * } - * } - * - * A bit of minor logic is used to map from the array of images returned from mapLaunchStoryboardContents - * to the format requried by Xcode. - * - * @param {Array} splashScreens splash screens as defined in config.xml for this platform - * @param {string} launchStoryboardImagesDir project-root/Images.xcassets/LaunchStoryboard.imageset/ - * @return {Object} - */ -function getLaunchStoryboardContentsJSON (splashScreens, launchStoryboardImagesDir) { - - var platformLaunchStoryboardImages = mapLaunchStoryboardContents(splashScreens, launchStoryboardImagesDir); - var contentsJSON = { - images: [], - info: { - author: 'Xcode', - version: 1 - } - }; - contentsJSON.images = platformLaunchStoryboardImages.map(function (item) { - var newItem = { - idiom: item.idiom, - scale: item.scale - }; - - // Xcode doesn't want any size class property if the class is "any" - // If our size class is "com", Xcode wants "compact". - if (item.width !== CDV_ANY_SIZE_CLASS) { - newItem['width-class'] = IMAGESET_COMPACT_SIZE_CLASS; - } - if (item.height !== CDV_ANY_SIZE_CLASS) { - newItem['height-class'] = IMAGESET_COMPACT_SIZE_CLASS; - } - - // Xcode doesn't want a filename property if there's no image for these traits - if (item.filename) { - newItem.filename = item.filename; - } - return newItem; - }); - return contentsJSON; -} - -/** - * Determines if the project's build settings may need to be updated for launch storyboard support - * - */ -function checkIfBuildSettingsNeedUpdatedForLaunchStoryboard (platformConfig, infoPlist) { - var hasLaunchStoryboardImages = platformHasLaunchStoryboardImages(platformConfig); - var hasLegacyLaunchImages = platformHasLegacyLaunchImages(platformConfig); - var currentLaunchStoryboard = infoPlist[UI_LAUNCH_STORYBOARD_NAME]; - - if (hasLaunchStoryboardImages && currentLaunchStoryboard === CDV_LAUNCH_STORYBOARD_NAME && !hasLegacyLaunchImages) { - // don't need legacy launch images if we are using our launch storyboard - // so we do need to update the project file - events.emit('verbose', 'Need to update build settings because project is using our launch storyboard.'); - return true; - } else if (hasLegacyLaunchImages && !currentLaunchStoryboard) { - // we do need to ensure legacy launch images are used if there's no launch storyboard present - // so we do need to update the project file - events.emit('verbose', 'Need to update build settings because project is using legacy launch images and no storyboard.'); - return true; - } - events.emit('verbose', 'No need to update build settings for launch storyboard support.'); - return false; -} - -function updateBuildSettingsForLaunchStoryboard (proj, platformConfig, infoPlist) { - var hasLaunchStoryboardImages = platformHasLaunchStoryboardImages(platformConfig); - var hasLegacyLaunchImages = platformHasLegacyLaunchImages(platformConfig); - var currentLaunchStoryboard = infoPlist[UI_LAUNCH_STORYBOARD_NAME]; - - if (hasLaunchStoryboardImages && currentLaunchStoryboard === CDV_LAUNCH_STORYBOARD_NAME && !hasLegacyLaunchImages) { - // don't need legacy launch images if we are using our launch storyboard - events.emit('verbose', 'Removed ' + LAUNCHIMAGE_BUILD_SETTING + ' because project is using our launch storyboard.'); - proj.removeBuildProperty(LAUNCHIMAGE_BUILD_SETTING); - } else if (hasLegacyLaunchImages && !currentLaunchStoryboard) { - // we do need to ensure legacy launch images are used if there's no launch storyboard present - events.emit('verbose', 'Set ' + LAUNCHIMAGE_BUILD_SETTING + ' to ' + LAUNCHIMAGE_BUILD_SETTING_VALUE + ' because project is using legacy launch images and no storyboard.'); - proj.updateBuildProperty(LAUNCHIMAGE_BUILD_SETTING, LAUNCHIMAGE_BUILD_SETTING_VALUE); - } else { - events.emit('verbose', 'Did not update build settings for launch storyboard support.'); - } -} - -function splashScreensHaveLaunchStoryboardImages (contentsJSON) { - /* do we have any launch images do we have for our launch storyboard? - * Again, for old Node versions, the below code is equivalent to this: - * return !!contentsJSON.images.find(function (item) { - * return item.filename !== undefined; - * }); - */ - return !!contentsJSON.images.reduce(function (p, c) { - return (c.filename !== undefined) ? c : p; - }, undefined); -} - -function platformHasLaunchStoryboardImages (platformConfig) { - var splashScreens = platformConfig.getSplashScreens('ios'); - var contentsJSON = getLaunchStoryboardContentsJSON(splashScreens, ''); // note: we don't need a file path here; we're just counting - return splashScreensHaveLaunchStoryboardImages(contentsJSON); -} - -function platformHasLegacyLaunchImages (platformConfig) { - var splashScreens = platformConfig.getSplashScreens('ios'); - return !!splashScreens.reduce(function (p, c) { - return (c.width !== undefined || c.height !== undefined) ? c : p; - }, undefined); -} - -/** - * Updates the project's plist based upon our launch storyboard images. If there are no images, then we should - * fall back to the regular launch images that might be supplied (that is, our app will be scaled on an iPad Pro), - * and if there are some images, we need to alter the UILaunchStoryboardName property to point to - * CDVLaunchScreen. - * - * There's some logic here to avoid overwriting changes the user might have made to their plist if they are using - * their own launch storyboard. - */ -function updateProjectPlistForLaunchStoryboard (platformConfig, infoPlist) { - var currentLaunchStoryboard = infoPlist[UI_LAUNCH_STORYBOARD_NAME]; - events.emit('verbose', 'Current launch storyboard ' + currentLaunchStoryboard); - - var hasLaunchStoryboardImages = platformHasLaunchStoryboardImages(platformConfig); - - if (hasLaunchStoryboardImages && !currentLaunchStoryboard) { - // only change the launch storyboard if we have images to use AND the current value is blank - // if it's not blank, we've either done this before, or the user has their own launch storyboard - events.emit('verbose', 'Changing info plist to use our launch storyboard'); - infoPlist[UI_LAUNCH_STORYBOARD_NAME] = CDV_LAUNCH_STORYBOARD_NAME; - return; - } - - if (!hasLaunchStoryboardImages && currentLaunchStoryboard === CDV_LAUNCH_STORYBOARD_NAME) { - // only revert to using the launch images if we have don't have any images for the launch storyboard - // but only clear it if current launch storyboard is our storyboard; the user might be using their - // own storyboard instead. - events.emit('verbose', 'Changing info plist to use legacy launch images'); - delete infoPlist[UI_LAUNCH_STORYBOARD_NAME]; - return; - } - events.emit('verbose', 'Not changing launch storyboard setting in info plist.'); -} - -/** - * Returns the directory for the Launch Storyboard image set, if image sets are being used. If they aren't - * being used, returns null. - * - * @param {string} projectRoot The project's root directory - * @param {string} platformProjDir The platform's project directory - */ -function getLaunchStoryboardImagesDir (projectRoot, platformProjDir) { - var launchStoryboardImagesDir; - var xcassetsExists = folderExists(path.join(projectRoot, platformProjDir, 'Images.xcassets/')); - - if (xcassetsExists) { - launchStoryboardImagesDir = path.join(platformProjDir, 'Images.xcassets/LaunchStoryboard.imageset/'); - } else { - // if we don't have a asset library for images, we can't do the storyboard. - launchStoryboardImagesDir = null; - } - - return launchStoryboardImagesDir; -} - -/** - * Update the images for the Launch Storyboard and updates the image set's contents.json file appropriately. - * - * @param {Object} cordovaProject The cordova project - * @param {Object} locations A dictionary containing useful location paths - */ -function updateLaunchStoryboardImages (cordovaProject, locations) { - var splashScreens = cordovaProject.projectConfig.getSplashScreens('ios'); - var platformProjDir = path.relative(cordovaProject.root, locations.xcodeCordovaProj); - var launchStoryboardImagesDir = getLaunchStoryboardImagesDir(cordovaProject.root, platformProjDir); - - if (launchStoryboardImagesDir) { - var resourceMap = mapLaunchStoryboardResources(splashScreens, launchStoryboardImagesDir); - var contentsJSON = getLaunchStoryboardContentsJSON(splashScreens, launchStoryboardImagesDir); - - events.emit('verbose', 'Updating launch storyboard images at ' + launchStoryboardImagesDir); - FileUpdater.updatePaths( - resourceMap, { rootDir: cordovaProject.root }, logFileOp); - - events.emit('verbose', 'Updating Storyboard image set contents.json'); - fs.writeFileSync(path.join(cordovaProject.root, launchStoryboardImagesDir, 'Contents.json'), - JSON.stringify(contentsJSON, null, 2)); - } -} - -/** - * Removes the images from the launch storyboard's image set and updates the image set's contents.json - * file appropriately. - * - * @param {string} projectRoot Path to the project root - * @param {Object} projectConfig The project's config.xml - * @param {Object} locations A dictionary containing useful location paths - */ -function cleanLaunchStoryboardImages (projectRoot, projectConfig, locations) { - var splashScreens = projectConfig.getSplashScreens('ios'); - var platformProjDir = path.relative(projectRoot, locations.xcodeCordovaProj); - var launchStoryboardImagesDir = getLaunchStoryboardImagesDir(projectRoot, platformProjDir); - if (launchStoryboardImagesDir) { - var resourceMap = mapLaunchStoryboardResources(splashScreens, launchStoryboardImagesDir); - var contentsJSON = getLaunchStoryboardContentsJSON(splashScreens, launchStoryboardImagesDir); - - Object.keys(resourceMap).forEach(function (targetPath) { - resourceMap[targetPath] = null; - }); - events.emit('verbose', 'Cleaning storyboard image set at ' + launchStoryboardImagesDir); - - // Source paths are removed from the map, so updatePaths() will delete the target files. - FileUpdater.updatePaths( - resourceMap, { rootDir: projectRoot, all: true }, logFileOp); - - // delete filename from contents.json - contentsJSON.images.forEach(function (image) { - image.filename = undefined; - }); - - events.emit('verbose', 'Updating Storyboard image set contents.json'); - fs.writeFileSync(path.join(projectRoot, launchStoryboardImagesDir, 'Contents.json'), - JSON.stringify(contentsJSON, null, 2)); - } -} - -/** - * Queries ConfigParser object for the orientation value. Warns if - * global preference value is not supported by platform. - * - * @param {Object} platformConfig ConfigParser object - * - * @return {String} Global/platform-specific orientation in lower-case - * (or empty string if both are undefined). - */ -function getOrientationValue (platformConfig) { - - var ORIENTATION_DEFAULT = 'default'; - - var orientation = platformConfig.getPreference('orientation'); - if (!orientation) { - return ''; - } - - orientation = orientation.toLowerCase(); - - // Check if the given global orientation is supported - if (['default', 'portrait', 'landscape', 'all'].indexOf(orientation) >= 0) { - return orientation; - } - - events.emit('warn', 'Unrecognized value for Orientation preference: ' + orientation + - '. Defaulting to value: ' + ORIENTATION_DEFAULT + '.'); - - return ORIENTATION_DEFAULT; -} - -/* - Parses all and entries and consolidates duplicates (for ATS). - Returns an object with a Hostname as the key, and the value an object with properties: - { - Hostname, // String - NSExceptionAllowsInsecureHTTPLoads, // boolean - NSIncludesSubdomains, // boolean - NSExceptionMinimumTLSVersion, // String - NSExceptionRequiresForwardSecrecy, // boolean - NSRequiresCertificateTransparency, // boolean - - // the three below _only_ show when the Hostname is '*' - // if any of the three are set, it disables setting NSAllowsArbitraryLoads - // (Apple already enforces this in ATS) - NSAllowsArbitraryLoadsInWebContent, // boolean (default: false) - NSAllowsLocalNetworking, // boolean (default: false) - NSAllowsArbitraryLoadsForMedia, // boolean (default:false) - - } -*/ -function processAccessAndAllowNavigationEntries (config) { - var accesses = config.getAccesses(); - var allow_navigations = config.getAllowNavigations(); - - return allow_navigations - // we concat allow_navigations and accesses, after processing accesses - .concat(accesses.map(function (obj) { - // map accesses to a common key interface using 'href', not origin - obj.href = obj.origin; - delete obj.origin; - return obj; - })) - // we reduce the array to an object with all the entries processed (key is Hostname) - .reduce(function (previousReturn, currentElement) { - var options = { - minimum_tls_version: currentElement.minimum_tls_version, - requires_forward_secrecy: currentElement.requires_forward_secrecy, - requires_certificate_transparency: currentElement.requires_certificate_transparency, - allows_arbitrary_loads_for_media: currentElement.allows_arbitrary_loads_in_media || currentElement.allows_arbitrary_loads_for_media, - allows_arbitrary_loads_in_web_content: currentElement.allows_arbitrary_loads_in_web_content, - allows_local_networking: currentElement.allows_local_networking - }; - var obj = parseWhitelistUrlForATS(currentElement.href, options); - - if (obj) { - // we 'union' duplicate entries - var item = previousReturn[obj.Hostname]; - if (!item) { - item = {}; - } - for (var o in obj) { - if (obj.hasOwnProperty(o)) { - item[o] = obj[o]; - } - } - previousReturn[obj.Hostname] = item; - } - return previousReturn; - }, {}); -} - -/* - Parses a URL and returns an object with these keys: - { - Hostname, // String - NSExceptionAllowsInsecureHTTPLoads, // boolean (default: false) - NSIncludesSubdomains, // boolean (default: false) - NSExceptionMinimumTLSVersion, // String (default: 'TLSv1.2') - NSExceptionRequiresForwardSecrecy, // boolean (default: true) - NSRequiresCertificateTransparency, // boolean (default: false) - - // the three below _only_ apply when the Hostname is '*' - // if any of the three are set, it disables setting NSAllowsArbitraryLoads - // (Apple already enforces this in ATS) - NSAllowsArbitraryLoadsInWebContent, // boolean (default: false) - NSAllowsLocalNetworking, // boolean (default: false) - NSAllowsArbitraryLoadsForMedia, // boolean (default:false) - } - - null is returned if the URL cannot be parsed, or is to be skipped for ATS. -*/ -function parseWhitelistUrlForATS (url, options) { - // @todo 'url.parse' was deprecated since v11.0.0. Use 'url.URL' constructor instead. - var href = URL.parse(url); // eslint-disable-line - var retObj = {}; - retObj.Hostname = href.hostname; - - // Guiding principle: we only set values in retObj if they are NOT the default - - if (url === '*') { - retObj.Hostname = '*'; - var val; - - val = (options.allows_arbitrary_loads_in_web_content === 'true'); - if (options.allows_arbitrary_loads_in_web_content && val) { // default is false - retObj.NSAllowsArbitraryLoadsInWebContent = true; - } - - val = (options.allows_arbitrary_loads_for_media === 'true'); - if (options.allows_arbitrary_loads_for_media && val) { // default is false - retObj.NSAllowsArbitraryLoadsForMedia = true; - } - - val = (options.allows_local_networking === 'true'); - if (options.allows_local_networking && val) { // default is false - retObj.NSAllowsLocalNetworking = true; - } - - return retObj; - } - - if (!retObj.Hostname) { - // check origin, if it allows subdomains (wildcard in hostname), we set NSIncludesSubdomains to YES. Default is NO - var subdomain1 = '/*.'; // wildcard in hostname - var subdomain2 = '*://*.'; // wildcard in hostname and protocol - var subdomain3 = '*://'; // wildcard in protocol only - if (!href.pathname) { - return null; - } else if (href.pathname.indexOf(subdomain1) === 0) { - retObj.NSIncludesSubdomains = true; - retObj.Hostname = href.pathname.substring(subdomain1.length); - } else if (href.pathname.indexOf(subdomain2) === 0) { - retObj.NSIncludesSubdomains = true; - retObj.Hostname = href.pathname.substring(subdomain2.length); - } else if (href.pathname.indexOf(subdomain3) === 0) { - retObj.Hostname = href.pathname.substring(subdomain3.length); - } else { - // Handling "scheme:*" case to avoid creating of a blank key in NSExceptionDomains. - return null; - } - } - - if (options.minimum_tls_version && options.minimum_tls_version !== 'TLSv1.2') { // default is TLSv1.2 - retObj.NSExceptionMinimumTLSVersion = options.minimum_tls_version; - } - - var rfs = (options.requires_forward_secrecy === 'true'); - if (options.requires_forward_secrecy && !rfs) { // default is true - retObj.NSExceptionRequiresForwardSecrecy = false; - } - - var rct = (options.requires_certificate_transparency === 'true'); - if (options.requires_certificate_transparency && rct) { // default is false - retObj.NSRequiresCertificateTransparency = true; - } - - // if the scheme is HTTP, we set NSExceptionAllowsInsecureHTTPLoads to YES. Default is NO - if (href.protocol === 'http:') { - retObj.NSExceptionAllowsInsecureHTTPLoads = true; - } else if (!href.protocol && href.pathname.indexOf('*:/') === 0) { // wilcard in protocol - retObj.NSExceptionAllowsInsecureHTTPLoads = true; - } - - return retObj; -} - -/* - App Transport Security (ATS) writer from and tags - in config.xml -*/ -function writeATSEntries (config) { - var pObj = processAccessAndAllowNavigationEntries(config); - - var ats = {}; - - for (var hostname in pObj) { - if (pObj.hasOwnProperty(hostname)) { - var entry = pObj[hostname]; - - // Guiding principle: we only set values if they are available - - if (hostname === '*') { - // always write this, for iOS 9, since in iOS 10 it will be overriden if - // any of the other three keys are written - ats['NSAllowsArbitraryLoads'] = true; - - // at least one of the overriding keys is present - if (entry.NSAllowsArbitraryLoadsInWebContent) { - ats['NSAllowsArbitraryLoadsInWebContent'] = true; - } - if (entry.NSAllowsArbitraryLoadsForMedia) { - ats['NSAllowsArbitraryLoadsForMedia'] = true; - } - if (entry.NSAllowsLocalNetworking) { - ats['NSAllowsLocalNetworking'] = true; - } - - continue; - } - - var exceptionDomain = {}; - - for (var key in entry) { - if (entry.hasOwnProperty(key) && key !== 'Hostname') { - exceptionDomain[key] = entry[key]; - } - } - - if (!ats['NSExceptionDomains']) { - ats['NSExceptionDomains'] = {}; - } - - ats['NSExceptionDomains'][hostname] = exceptionDomain; - } - } - - return ats; -} - -function folderExists (folderPath) { - try { - var stat = fs.statSync(folderPath); - return stat && stat.isDirectory(); - } catch (e) { - return false; - } -} - -// Construct a default value for CFBundleVersion as the version with any -// -rclabel stripped=. -function default_CFBundleVersion (version) { - return version.split('-')[0]; -} - -// Converts cordova specific representation of target device to XCode value -function parseTargetDevicePreference (value) { - if (!value) return null; - var map = { 'universal': '"1,2"', 'handset': '"1"', 'tablet': '"2"' }; - if (map[value.toLowerCase()]) { - return map[value.toLowerCase()]; - } - events.emit('warn', 'Unrecognized value for target-device preference: ' + value + '.'); - return null; -} diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/projectFile.js b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/projectFile.js deleted file mode 100644 index 8a3f7e5..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/projectFile.js +++ /dev/null @@ -1,134 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -var xcode = require('xcode'); -var plist = require('plist'); -var _ = require('underscore'); -var path = require('path'); -var fs = require('fs'); -var shell = require('shelljs'); - -var pluginHandlers = require('./plugman/pluginHandlers'); -var CordovaError = require('cordova-common').CordovaError; - -var cachedProjectFiles = {}; - -function parseProjectFile (locations) { - var project_dir = locations.root; - var pbxPath = locations.pbxproj; - - if (cachedProjectFiles[project_dir]) { - return cachedProjectFiles[project_dir]; - } - - var xcodeproj = xcode.project(pbxPath); - xcodeproj.parseSync(); - - var xcBuildConfiguration = xcodeproj.pbxXCBuildConfigurationSection(); - var plist_file_entry = _.find(xcBuildConfiguration, function (entry) { return entry.buildSettings && entry.buildSettings.INFOPLIST_FILE; }); - var plist_file = path.join(project_dir, plist_file_entry.buildSettings.INFOPLIST_FILE.replace(/^"(.*)"$/g, '$1').replace(/\\&/g, '&')); - var config_file = path.join(path.dirname(plist_file), 'config.xml'); - - if (!fs.existsSync(plist_file) || !fs.existsSync(config_file)) { - throw new CordovaError('Could not find *-Info.plist file, or config.xml file.'); - } - - var frameworks_file = path.join(project_dir, 'frameworks.json'); - var frameworks = {}; - try { - frameworks = require(frameworks_file); - } catch (e) { } - - var xcode_dir = path.dirname(plist_file); - var pluginsDir = path.resolve(xcode_dir, 'Plugins'); - var resourcesDir = path.resolve(xcode_dir, 'Resources'); - - cachedProjectFiles[project_dir] = { - plugins_dir: pluginsDir, - resources_dir: resourcesDir, - xcode: xcodeproj, - xcode_path: xcode_dir, - pbx: pbxPath, - projectDir: project_dir, - platformWww: path.join(project_dir, 'platform_www'), - www: path.join(project_dir, 'www'), - write: function () { - fs.writeFileSync(pbxPath, xcodeproj.writeSync()); - if (Object.keys(this.frameworks).length === 0) { - // If there is no framework references remain in the project, just remove this file - shell.rm('-rf', frameworks_file); - return; - } - fs.writeFileSync(frameworks_file, JSON.stringify(this.frameworks, null, 4)); - }, - getPackageName: function () { - return plist.parse(fs.readFileSync(plist_file, 'utf8')).CFBundleIdentifier; - }, - getInstaller: function (name) { - return pluginHandlers.getInstaller(name); - }, - getUninstaller: function (name) { - return pluginHandlers.getUninstaller(name); - }, - frameworks: frameworks - }; - return cachedProjectFiles[project_dir]; -} - -function purgeProjectFileCache (project_dir) { - delete cachedProjectFiles[project_dir]; -} - -module.exports = { - parse: parseProjectFile, - purgeProjectFileCache: purgeProjectFileCache -}; - -xcode.project.prototype.pbxEmbedFrameworksBuildPhaseObj = function (target) { - return this.buildPhaseObject('PBXCopyFilesBuildPhase', 'Embed Frameworks', target); -}; - -xcode.project.prototype.addToPbxEmbedFrameworksBuildPhase = function (file) { - var sources = this.pbxEmbedFrameworksBuildPhaseObj(file.target); - if (sources) { - sources.files.push(pbxBuildPhaseObj(file)); - } -}; -xcode.project.prototype.removeFromPbxEmbedFrameworksBuildPhase = function (file) { - var sources = this.pbxEmbedFrameworksBuildPhaseObj(file.target); - if (sources) { - sources.files = _.reject(sources.files, function (file) { - return file.comment === longComment(file); - }); - } -}; - -// special handlers to add frameworks to the 'Embed Frameworks' build phase, needed for custom frameworks -// see CB-9517. should probably be moved to node-xcode. -var util = require('util'); -function pbxBuildPhaseObj (file) { - var obj = Object.create(null); - obj.value = file.uuid; - obj.comment = longComment(file); - return obj; -} - -function longComment (file) { - return util.format('%s in %s', file.basename, file.group); -} diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/run.js b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/run.js deleted file mode 100644 index f21fee6..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/run.js +++ /dev/null @@ -1,263 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -var Q = require('q'); -var path = require('path'); -var build = require('./build'); -var shell = require('shelljs'); -var superspawn = require('cordova-common').superspawn; -var check_reqs = require('./check_reqs'); -var fs = require('fs-extra'); - -var events = require('cordova-common').events; - -var cordovaPath = path.join(__dirname, '..'); -var projectPath = path.join(__dirname, '..', '..'); - -module.exports.run = function (runOptions) { - - // Validate args - if (runOptions.device && runOptions.emulator) { - return Q.reject('Only one of "device"/"emulator" options should be specified'); - } - - // support for CB-8168 `cordova/run --list` - if (runOptions.list) { - if (runOptions.device) return module.exports.listDevices(); - if (runOptions.emulator) return module.exports.listEmulators(); - // if no --device or --emulator flag is specified, list both devices and emulators - return module.exports.listDevices().then(function () { - return module.exports.listEmulators(); - }); - } - - var useDevice = !!runOptions.device; - - return require('./list-devices').run() - .then(function (devices) { - if (devices.length > 0 && !(runOptions.emulator)) { - useDevice = true; - // we also explicitly set device flag in options as we pass - // those parameters to other api (build as an example) - runOptions.device = true; - return check_reqs.check_ios_deploy(); - } - }).then(function () { - if (!runOptions.nobuild) { - return build.run(runOptions); - } else { - return Q.resolve(); - } - }).then(function () { - return build.findXCodeProjectIn(projectPath); - }).then(function (projectName) { - var appPath = path.join(projectPath, 'build', 'emulator', projectName + '.app'); - var buildOutputDir = path.join(projectPath, 'build', 'device'); - - // select command to run and arguments depending whether - // we're running on device/emulator - if (useDevice) { - return module.exports.checkDeviceConnected() - .then(function () { - // Unpack IPA - var ipafile = path.join(buildOutputDir, projectName + '.ipa'); - - // unpack the existing platform/ios/build/device/appname.ipa (zipfile), will create a Payload folder - return superspawn.spawn('unzip', [ '-o', '-qq', ipafile ], { cwd: buildOutputDir, printCommand: true, stdio: 'inherit' }); - }) - .then(function () { - // Uncompress IPA (zip file) - var appFileInflated = path.join(buildOutputDir, 'Payload', projectName + '.app'); - var appFile = path.join(buildOutputDir, projectName + '.app'); - var payloadFolder = path.join(buildOutputDir, 'Payload'); - - // delete the existing platform/ios/build/device/appname.app - fs.removeSync(appFile); - // move the platform/ios/build/device/Payload/appname.app to parent - shell.mv('-f', appFileInflated, buildOutputDir); - // delete the platform/ios/build/device/Payload folder - shell.rm('-rf', payloadFolder); - - return null; - }) - .then(function () { - appPath = path.join(projectPath, 'build', 'device', projectName + '.app'); - var extraArgs = []; - if (runOptions.argv) { - // argv.slice(2) removes node and run.js, filterSupportedArgs removes the run.js args - extraArgs = module.exports.filterSupportedArgs(runOptions.argv.slice(2)); - } - return module.exports.deployToDevice(appPath, runOptions.target, extraArgs); - }, function () { - // if device connection check failed use emulator then - return module.exports.deployToSim(appPath, runOptions.target); - }); - } else { - return module.exports.deployToSim(appPath, runOptions.target); - } - }); -}; - -module.exports.filterSupportedArgs = filterSupportedArgs; -module.exports.checkDeviceConnected = checkDeviceConnected; -module.exports.deployToDevice = deployToDevice; -module.exports.deployToSim = deployToSim; -module.exports.startSim = startSim; -module.exports.listDevices = listDevices; -module.exports.listEmulators = listEmulators; - -/** - * Filters the args array and removes supported args for the 'run' command. - * - * @return {Array} array with unsupported args for the 'run' command - */ -function filterSupportedArgs (args) { - var filtered = []; - var sargs = ['--device', '--emulator', '--nobuild', '--list', '--target', '--debug', '--release']; - var re = new RegExp(sargs.join('|')); - - args.forEach(function (element) { - // supported args not found, we add - // we do a regex search because --target can be "--target=XXX" - if (element.search(re) === -1) { - filtered.push(element); - } - }, this); - - return filtered; -} - -/** - * Checks if any iOS device is connected - * @return {Promise} Fullfilled when any device is connected, rejected otherwise - */ -function checkDeviceConnected () { - return superspawn.spawn('ios-deploy', ['-c', '-t', '1'], { printCommand: true, stdio: 'inherit' }); -} - -/** - * Deploy specified app package to connected device - * using ios-deploy command - * @param {String} appPath Path to application package - * @return {Promise} Resolves when deploy succeeds otherwise rejects - */ -function deployToDevice (appPath, target, extraArgs) { - events.emit('log', 'Deploying to device'); - // Deploying to device... - if (target) { - return superspawn.spawn('ios-deploy', ['--justlaunch', '-d', '-b', appPath, '-i', target].concat(extraArgs), { printCommand: true, stdio: 'inherit' }); - } else { - return superspawn.spawn('ios-deploy', ['--justlaunch', '--no-wifi', '-d', '-b', appPath].concat(extraArgs), { printCommand: true, stdio: 'inherit' }); - } -} - -/** - * Deploy specified app package to ios-sim simulator - * @param {String} appPath Path to application package - * @param {String} target Target device type - * @return {Promise} Resolves when deploy succeeds otherwise rejects - */ -function deployToSim (appPath, target) { - events.emit('log', 'Deploying to simulator'); - if (!target) { - // Select target device for emulator - return require('./list-emulator-images').run() - .then(function (emulators) { - if (emulators.length > 0) { - target = emulators[0]; - } - emulators.forEach(function (emulator) { - if (emulator.indexOf('iPhone') === 0) { - target = emulator; - } - }); - events.emit('log', `No target specified for emulator. Deploying to "${target}" simulator.`); - return startSim(appPath, target); - }); - } else { - return startSim(appPath, target); - } -} - -function startSim (appPath, target) { - var logPath = path.join(cordovaPath, 'console.log'); - - return iossimLaunch(appPath, 'com.apple.CoreSimulator.SimDeviceType.' + target, logPath, '--exit'); -} - -function iossimLaunch (appPath, devicetypeid, log, exit) { - var f = path.resolve(path.dirname(require.resolve('ios-sim')), 'bin', 'ios-sim'); - var params = ['launch', appPath, '--devicetypeid', devicetypeid, '--log', log, exit]; - - return superspawn.spawn(f, params, { cwd: projectPath, printCommand: true }) - .progress(function (stdio) { - if (stdio.stderr) { - events.emit('error', `[ios-sim] ${stdio.stderr}`); - } - if (stdio.stdout) { - events.emit('log', `[ios-sim] ${stdio.stdout.trim()}`); - } - }) - .then(function (result) { - events.emit('log', 'Simulator successfully started via `ios-sim`.'); - }); -} - -function listDevices () { - return require('./list-devices').run() - .then(function (devices) { - events.emit('log', 'Available iOS Devices:'); - devices.forEach(function (device) { - events.emit('log', '\t' + device); - }); - }); -} - -function listEmulators () { - return require('./list-emulator-images').run() - .then(function (emulators) { - events.emit('log', 'Available iOS Simulators:'); - emulators.forEach(function (emulator) { - events.emit('log', '\t' + emulator); - }); - }); -} - -module.exports.help = function () { - console.log('\nUsage: run [ --device | [ --emulator [ --target= ] ] ] [ --debug | --release | --nobuild ]'); - // TODO: add support for building different archs - // console.log(" [ --archs=\"\" ] "); - console.log(' --device : Deploys and runs the project on the connected device.'); - console.log(' --emulator : Deploys and runs the project on an emulator.'); - console.log(' --target= : Deploys and runs the project on the specified target.'); - console.log(' --debug : Builds project in debug mode. (Passed down to build command, if necessary)'); - console.log(' --release : Builds project in release mode. (Passed down to build command, if necessary)'); - console.log(' --nobuild : Uses pre-built package, or errors if project is not built.'); - // TODO: add support for building different archs - // console.log(" --archs : Specific chip architectures (`anycpu`, `arm`, `x86`, `x64`)."); - console.log(''); - console.log('Examples:'); - console.log(' run'); - console.log(' run --device'); - console.log(' run --emulator --target=\"iPhone-6-Plus\"'); /* eslint no-useless-escape : 0 */ - console.log(' run --device --release'); - console.log(' run --emulator --debug'); - console.log(''); - process.exit(0); -}; diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/spawn.js b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/spawn.js deleted file mode 100644 index 321b04f..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/spawn.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -var Q = require('q'); -var proc = require('child_process'); - -/** - * Run specified command with arguments - * @param {String} cmd Command - * @param {Array} args Array of arguments that should be passed to command - * @param {String} opt_cwd Working directory for command - * @param {String} opt_verbosity Verbosity level for command stdout output, "verbose" by default - * @return {Promise} Promise either fullfilled or rejected with error code - * @deprecated Use `require('cordova-common').superspawn` instead. - */ -module.exports = function (cmd, args, opt_cwd) { - console.warn( - 'This function is deprecated, may be removed from a future release. ' + - "Use `require('cordova-common').superspawn` instead."); - var d = Q.defer(); - try { - var child = proc.spawn(cmd, args, { cwd: opt_cwd, stdio: 'inherit' }); - - child.on('exit', function (code) { - if (code) { - d.reject('Error code ' + code + ' for command: ' + cmd + ' with args: ' + args); - } else { - d.resolve(); - } - }); - } catch (e) { - d.reject(e); - } - return d.promise; -}; diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/start-emulator b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/start-emulator deleted file mode 100755 index 624335b..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/start-emulator +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash -# -# 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. -# -# Run the below to get the device targets: -# xcrun instruments -s - -set -e - - -DEFAULT_TARGET="iPhone 5s" -TARGET=${1:-$DEFAULT_TARGET} -LIB_PATH=$( cd "$( dirname "$0" )" && pwd -P) - -xcrun instruments -w "$TARGET" &> /dev/null \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/versions.js b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/versions.js deleted file mode 100755 index 828042f..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/lib/versions.js +++ /dev/null @@ -1,179 +0,0 @@ -#!/usr/bin/env node - -/* - 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 child_process = require('child_process'); -var Q = require('q'); -var semver = require('semver'); - -exports.get_apple_ios_version = function () { - var d = Q.defer(); - child_process.exec('xcodebuild -showsdks', function (error, stdout, stderr) { - if (error) { - d.reject(stderr); - } else { - d.resolve(stdout); - } - }); - - return d.promise.then(function (output) { - var regex = /[0-9]*\.[0-9]*/; - var versions = []; - var regexIOS = /^iOS \d+/; - output = output.split('\n'); - for (var i = 0; i < output.length; i++) { - if (output[i].trim().match(regexIOS)) { - versions[versions.length] = parseFloat(output[i].match(regex)[0]); - } - } - versions.sort(); - console.log(versions[0]); - return Q(); - }, function (stderr) { - return Q.reject(stderr); - }); -}; - -exports.get_apple_osx_version = function () { - var d = Q.defer(); - child_process.exec('xcodebuild -showsdks', function (error, stdout, stderr) { - if (error) { - d.reject(stderr); - } else { - d.resolve(stdout); - } - }); - - return d.promise.then(function (output) { - var regex = /[0-9]*\.[0-9]*/; - var versions = []; - var regexOSX = /^macOS \d+/; - output = output.split('\n'); - for (var i = 0; i < output.length; i++) { - if (output[i].trim().match(regexOSX)) { - versions[versions.length] = parseFloat(output[i].match(regex)[0]); - } - } - versions.sort(); - console.log(versions[0]); - return Q(); - }, function (stderr) { - return Q.reject(stderr); - }); -}; - -exports.get_apple_xcode_version = function () { - var d = Q.defer(); - child_process.exec('xcodebuild -version', function (error, stdout, stderr) { - var versionMatch = /Xcode (.*)/.exec(stdout); - if (error || !versionMatch) { - d.reject(stderr); - } else { - d.resolve(versionMatch[1]); - } - }); - return d.promise; -}; - -/** - * Gets ios-deploy util version - * @return {Promise} Promise that either resolved with ios-deploy version - * or rejected in case of error - */ -exports.get_ios_deploy_version = function () { - var d = Q.defer(); - child_process.exec('ios-deploy --version', function (error, stdout, stderr) { - if (error) { - d.reject(stderr); - } else { - d.resolve(stdout); - } - }); - return d.promise; -}; - -/** - * Gets pod (CocoaPods) util version - * @return {Promise} Promise that either resolved with pod version - * or rejected in case of error - */ -exports.get_cocoapods_version = function () { - var d = Q.defer(); - child_process.exec('pod --version', function (error, stdout, stderr) { - if (error) { - d.reject(stderr); - } else { - d.resolve(stdout); - } - }); - return d.promise; -}; - -/** - * Gets ios-sim util version - * @return {Promise} Promise that either resolved with ios-sim version - * or rejected in case of error - */ -exports.get_ios_sim_version = function () { - var d = Q.defer(); - child_process.exec('ios-sim --version', function (error, stdout, stderr) { - if (error) { - d.reject(stderr); - } else { - d.resolve(stdout); - } - }); - return d.promise; -}; - -/** - * Gets specific tool version - * @param {String} toolName Tool name to check. Known tools are 'xcodebuild', 'ios-sim' and 'ios-deploy' - * @return {Promise} Promise that either resolved with tool version - * or rejected in case of error - */ -exports.get_tool_version = function (toolName) { - switch (toolName) { - case 'xcodebuild': return exports.get_apple_xcode_version(); - case 'ios-sim': return exports.get_ios_sim_version(); - case 'ios-deploy': return exports.get_ios_deploy_version(); - case 'pod': return exports.get_cocoapods_version(); - default: return Q.reject(toolName + ' is not valid tool name. Valid names are: \'xcodebuild\', \'ios-sim\', \'ios-deploy\', and \'pod\''); - } -}; - -/** - * Compares two version strings that can be coerced to semver. - * - * @param {String} version1 Version to compare - * @param {String} version2 Another version to compare - * @return {Number} Negative number if first version is lower than the second, - * positive otherwise and 0 if versions are equal. - */ -exports.compareVersions = (...args) => { - const coerceToSemverIfInvalid = v => { - const semverVersion = semver.parse(v) || semver.coerce(v); - if (!semverVersion) throw new TypeError(`Invalid Version: ${v}`); - return semverVersion; - }; - - const semverVersions = args.map(coerceToSemverIfInvalid); - return semver.compare(...semverVersions); -}; diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/log b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/log deleted file mode 100755 index b235b09..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/log +++ /dev/null @@ -1,23 +0,0 @@ -#! /bin/sh -# -# 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. -# - -CORDOVA_PATH=$( cd "$( dirname "$0" )" && pwd -P) - -tail -f "$CORDOVA_PATH/console.log" diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/log.bat b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/log.bat deleted file mode 100644 index 4710e57..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/log.bat +++ /dev/null @@ -1,19 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License - -@ECHO OFF -ECHO WARN: The 'log' command is not available for cordova-ios on windows machines.>&2 diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/loggingHelper.js b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/loggingHelper.js deleted file mode 100644 index e353399..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/loggingHelper.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -var CordovaLogger = require('cordova-common').CordovaLogger; - -module.exports = { - adjustLoggerLevel: function (opts) { - if (opts.verbose || (Array.isArray(opts) && opts.indexOf('--verbose') !== -1)) { - CordovaLogger.get().setLevel('verbose'); - } else if (opts.silent || (Array.isArray(opts) && opts.indexOf('--silent') !== -1)) { - CordovaLogger.get().setLevel('error'); - } - } -}; diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/run b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/run deleted file mode 100755 index 81741c8..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/run +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env node - -/* - 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 args = process.argv; -var Api = require('./Api'); -var nopt = require('nopt'); - -// Handle help flag -if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) >= 0) { - require('./lib/run').help(); - process.exit(0); -} - -// Parse arguments (includes build params as well) -var opts = nopt({ - 'verbose': Boolean, - 'silent': Boolean, - 'debug': Boolean, - 'release': Boolean, - 'nobuild': Boolean, - 'archs': String, - 'list': Boolean, - 'device': Boolean, - 'emulator': Boolean, - 'target': String, - 'codeSignIdentity': String, - 'codeSignResourceRules': String, - 'provisioningProfile': String, - 'automaticProvisioning': Boolean, - 'buildConfig': String, - 'noSign': Boolean -}, { 'd': '--verbose' }, args); - -// Make options compatible with PlatformApi build method spec -opts.argv = opts.argv.remain; - -require('./loggingHelper').adjustLoggerLevel(opts); - -new Api().run(opts).done(function () { - console.log('** RUN SUCCEEDED **'); -}, function (err) { - var errorMessage = (err && err.stack) ? err.stack : err; - console.error(errorMessage); - process.exit(2); -}); diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/run.bat b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/run.bat deleted file mode 100644 index 8a3cad2..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/run.bat +++ /dev/null @@ -1,19 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License - -@ECHO OFF -ECHO WARN: The `run` is not available for cordova-ios on windows machines.>&2 diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/version b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/version deleted file mode 100755 index 8a81e66..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/version +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env node - -/* - 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. -*/ - -/* - - Returns the VERSION of CordovaLib used. - Note: it does not work if the --shared option was used to create the project. -*/ - -// Coho updates this line -var VERSION = '5.1.1'; - -module.exports.version = VERSION; - -if (!module.parent) { - console.log(VERSION); -} diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/version.bat b/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/version.bat deleted file mode 100644 index 84c86b4..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/templates/scripts/cordova/version.bat +++ /dev/null @@ -1,26 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. - -@ECHO OFF -SET script="%~dp0version" -IF EXIST %script% ( - node %script% %* -) ELSE ( - ECHO. - ECHO ERROR: Could not find 'version' script in 'cordova' folder, aborting...>&2 - EXIT /B 1 -) diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/test b/chabok-starter-cordova/node_modules/cordova-ios/bin/test deleted file mode 100755 index 3f7df13..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/test +++ /dev/null @@ -1,53 +0,0 @@ -#! /bin/sh - -# -# 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. -# - - - -# the two lines below are to get the current folder, and resolve symlinks -SCRIPT="$0" -# need this for relative symlinks -while [ -h "$SCRIPT" ] ; do - SCRIPT=`readlink "$SCRIPT"` -done - -BINDIR=$( cd "$( dirname "$SCRIPT" )" && pwd ) -TESTDIR=$BINDIR/mobile-spec-test - -echo "TESTDIR" $SCRIPT - -# get the latest mobile-spec -git clone git://github.com/apache/cordova-mobile-spec.git $BINDIR/mobile-spec - -# clobber test if it exists -if [ -e $TESTDIR ] -then - rm -rf $TESTDIR -fi - -# generate a working proj -$BINDIR/create $TESTDIR org.apache.cordova.test CordovaTest - -# kill the default app and replace it w/ mobile-spec -rm -rf $TESTDIR/www -mv $BINDIR/mobile-spec $TESTDIR/www - -# build it, launch it and start logging on stdout -$TESTDIR/cordova/debug && $TESTDIR/cordova/log diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/tests/autotest.coffee b/chabok-starter-cordova/node_modules/cordova-ios/bin/tests/autotest.coffee deleted file mode 100644 index da8abbe..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/tests/autotest.coffee +++ /dev/null @@ -1,24 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - - -exports['you are sane'] = (test) -> - test.expect 1 - test.ok true, "this assertion should always pass" - test.done() diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/tests/create.coffee b/chabok-starter-cordova/node_modules/cordova-ios/bin/tests/create.coffee deleted file mode 100644 index 12fe61e..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/tests/create.coffee +++ /dev/null @@ -1,34 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -util = require 'util' -exec = require('child_process').exec -path = require 'path' - -exports['default example project is generated'] = (test) -> - test.expect 1 - exec './bin/create', (error, stdout, stderr) -> - test.ok true, "this assertion should pass" unless error? - test.done() - -exports['default example project has a /phonegap folder'] = (test) -> - test.expect 1 - path.exists './example/phonegap', (exists) -> - test.ok exists, 'the other phonegap folder exists' - test.done() diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/tests/debug.coffee b/chabok-starter-cordova/node_modules/cordova-ios/bin/tests/debug.coffee deleted file mode 100644 index b72aa93..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/tests/debug.coffee +++ /dev/null @@ -1,18 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/tests/test.coffee b/chabok-starter-cordova/node_modules/cordova-ios/bin/tests/test.coffee deleted file mode 100644 index b72aa93..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/tests/test.coffee +++ /dev/null @@ -1,18 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/uncrustify.cfg b/chabok-starter-cordova/node_modules/cordova-ios/bin/uncrustify.cfg deleted file mode 100644 index 5d9a334..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/uncrustify.cfg +++ /dev/null @@ -1,1489 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Based off of https://gist.github.com/261662/ - -# -# General options -# - -# The type of line endings -newlines = lf # auto/lf/crlf/cr - -# The original size of tabs in the input -input_tab_size = 4 # number - -# The size of tabs in the output (only used if align_with_tabs=true) -output_tab_size = 4 # number - -# The ASCII value of the string escape char, usually 92 (\) or 94 (^). (Pawn) -string_escape_char = 92 # number - -# Alternate string escape char for Pawn. Only works right before the quote char. -string_escape_char2 = 0 # number - -# Allow interpreting '>=' and '>>=' as part of a template in 'void f(list>=val);'. -# If true (default), 'assert(x<0 && y>=3)' will be broken. -# Improvements to template detection may make this option obsolete. -tok_split_gte = false # false/true - -# Control what to do with the UTF-8 BOM (recommend 'remove') -utf8_bom = ignore # ignore/add/remove/force - -# If the file contains bytes with values between 128 and 255, but is not UTF-8, then output as UTF-8 -utf8_byte = false # false/true - -# Force the output encoding to UTF-8 -utf8_force = false # false/true - -# -# Indenting -# - -# The number of columns to indent per level. -# Usually 2, 3, 4, or 8. -indent_columns = 4 # number - -# The continuation indent. If non-zero, this overrides the indent of '(' and '=' continuation indents. -# For FreeBSD, this is set to 4. Negative value is absolute and not increased for each ( level -indent_continue = 4 # number - -# How to use tabs when indenting code -# 0=spaces only -# 1=indent with tabs to brace level, align with spaces -# 2=indent and align with tabs, using spaces when not on a tabstop -indent_with_tabs = 0 # number - -# Comments that are not a brace level are indented with tabs on a tabstop. -# Requires indent_with_tabs=2. If false, will use spaces. -indent_cmt_with_tabs = false # false/true - -# Whether to indent strings broken by '\' so that they line up -indent_align_string = false # false/true - -# The number of spaces to indent multi-line XML strings. -# Requires indent_align_string=True -indent_xml_string = 0 # number - -# Spaces to indent '{' from level -indent_brace = 0 # number - -# Whether braces are indented to the body level -indent_braces = false # false/true - -# Disabled indenting function braces if indent_braces is true -indent_braces_no_func = false # false/true - -# Disabled indenting class braces if indent_braces is true -indent_braces_no_class = false # false/true - -# Disabled indenting struct braces if indent_braces is true -indent_braces_no_struct = false # false/true - -# Indent based on the size of the brace parent, i.e. 'if' => 3 spaces, 'for' => 4 spaces, etc. -indent_brace_parent = false # false/true - -# Whether the 'namespace' body is indented -indent_namespace = false # false/true - -# The number of spaces to indent a namespace block -indent_namespace_level = 0 # number - -# If the body of the namespace is longer than this number, it won't be indented. -# Requires indent_namespace=true. Default=0 (no limit) -indent_namespace_limit = 0 # number - -# Whether the 'extern "C"' body is indented -indent_extern = false # false/true - -# Whether the 'class' body is indented -indent_class = true # false/true - -# Whether to indent the stuff after a leading class colon -indent_class_colon = true # false/true - -# Additional indenting for constructor initializer list -indent_ctor_init = 0 # number - -# False=treat 'else\nif' as 'else if' for indenting purposes -# True=indent the 'if' one level -indent_else_if = false # false/true - -# Amount to indent variable declarations after a open brace. neg=relative, pos=absolute -indent_var_def_blk = 0 # number - -# Indent continued variable declarations instead of aligning. -indent_var_def_cont = false # false/true - -# True: indent continued function call parameters one indent level -# False: align parameters under the open paren -indent_func_call_param = false # false/true - -# Same as indent_func_call_param, but for function defs -indent_func_def_param = false # false/true - -# Same as indent_func_call_param, but for function protos -indent_func_proto_param = false # false/true - -# Same as indent_func_call_param, but for class declarations -indent_func_class_param = false # false/true - -# Same as indent_func_call_param, but for class variable constructors -indent_func_ctor_var_param = false # false/true - -# Same as indent_func_call_param, but for templates -indent_template_param = false # false/true - -# Double the indent for indent_func_xxx_param options -indent_func_param_double = false # false/true - -# Indentation column for standalone 'const' function decl/proto qualifier -indent_func_const = 0 # number - -# Indentation column for standalone 'throw' function decl/proto qualifier -indent_func_throw = 0 # number - -# The number of spaces to indent a continued '->' or '.' -# Usually set to 0, 1, or indent_columns. -indent_member = 4 # number - -# Spaces to indent single line ('//') comments on lines before code -indent_sing_line_comments = 0 # number - -# If set, will indent trailing single line ('//') comments relative -# to the code instead of trying to keep the same absolute column -indent_relative_single_line_comments = false # false/true - -# Spaces to indent 'case' from 'switch' -# Usually 0 or indent_columns. -indent_switch_case = 4 # number - -# Spaces to shift the 'case' line, without affecting any other lines -# Usually 0. -indent_case_shift = 0 # number - -# Spaces to indent '{' from 'case'. -# By default, the brace will appear under the 'c' in case. -# Usually set to 0 or indent_columns. -indent_case_brace = 4 # number - -# Whether to indent comments found in first column -indent_col1_comment = true # false/true - -# How to indent goto labels -# >0 : absolute column where 1 is the leftmost column -# <=0 : subtract from brace indent -indent_label = 1 # number - -# Same as indent_label, but for access specifiers that are followed by a colon -indent_access_spec = 1 # number - -# Indent the code after an access specifier by one level. -# If set, this option forces 'indent_access_spec=0' -indent_access_spec_body = false # false/true - -# If an open paren is followed by a newline, indent the next line so that it lines up after the open paren (not recommended) -indent_paren_nl = false # false/true - -# Controls the indent of a close paren after a newline. -# 0: Indent to body level -# 1: Align under the open paren -# 2: Indent to the brace level -indent_paren_close = 0 # number - -# Controls the indent of a comma when inside a paren.If TRUE, aligns under the open paren -indent_comma_paren = false # false/true - -# Controls the indent of a BOOL operator when inside a paren.If TRUE, aligns under the open paren -indent_bool_paren = false # false/true - -# If 'indent_bool_paren' is true, controls the indent of the first expression. If TRUE, aligns the first expression to the following ones -indent_first_bool_expr = false # false/true - -# If an open square is followed by a newline, indent the next line so that it lines up after the open square (not recommended) -indent_square_nl = false # false/true - -# Don't change the relative indent of ESQL/C 'EXEC SQL' bodies -indent_preserve_sql = false # false/true - -# Align continued statements at the '='. Default=True -# If FALSE or the '=' is followed by a newline, the next line is indent one tab. -indent_align_assign = true # false/true - -# -# Spacing options -# - -# Add or remove space around arithmetic operator '+', '-', '/', '*', etc -sp_arith = force # ignore/add/remove/force - -# Add or remove space around assignment operator '=', '+=', etc -sp_assign = force # ignore/add/remove/force - -# Add or remove space around assignment operator '=' in a prototype -sp_assign_default = force # ignore/add/remove/force - -# Add or remove space before assignment operator '=', '+=', etc. Overrides sp_assign. -sp_before_assign = ignore # ignore/add/remove/force - -# Add or remove space after assignment operator '=', '+=', etc. Overrides sp_assign. -sp_after_assign = ignore # ignore/add/remove/force - -# Add or remove space around assignment '=' in enum -sp_enum_assign = force # ignore/add/remove/force - -# Add or remove space before assignment '=' in enum. Overrides sp_enum_assign. -sp_enum_before_assign = ignore # ignore/add/remove/force - -# Add or remove space after assignment '=' in enum. Overrides sp_enum_assign. -sp_enum_after_assign = ignore # ignore/add/remove/force - -# Add or remove space around preprocessor '##' concatenation operator. Default=Add -sp_pp_concat = ignore # ignore/add/remove/force - -# Add or remove space after preprocessor '#' stringify operator. Also affects the '#@' charizing operator. Default=Add -sp_pp_stringify = remove # ignore/add/remove/force - -# Add or remove space around boolean operators '&&' and '||' -sp_bool = force # ignore/add/remove/force - -# Add or remove space around compare operator '<', '>', '==', etc -sp_compare = force # ignore/add/remove/force - -# Add or remove space inside '(' and ')' -sp_inside_paren = remove # ignore/add/remove/force - -# Add or remove space between nested parens -sp_paren_paren = remove # ignore/add/remove/force - -# Whether to balance spaces inside nested parens -sp_balance_nested_parens = false # false/true - -# Add or remove space between ')' and '{' -sp_paren_brace = force # ignore/add/remove/force - -# Add or remove space before pointer star '*' -sp_before_ptr_star = remove # ignore/add/remove/force - -# Add or remove space before pointer star '*' that isn't followed by a variable name -# If set to 'ignore', sp_before_ptr_star is used instead. -sp_before_unnamed_ptr_star = ignore # ignore/add/remove/force - -# Add or remove space between pointer stars '*' -sp_between_ptr_star = remove # ignore/add/remove/force - -# Add or remove space after pointer star '*', if followed by a word. -sp_after_ptr_star = force # ignore/add/remove/force - -# Add or remove space after a pointer star '*', if followed by a func proto/def. -sp_after_ptr_star_func = remove # ignore/add/remove/force - -# Add or remove space before a pointer star '*', if followed by a func proto/def. -sp_before_ptr_star_func = force # ignore/add/remove/force - -# Add or remove space before a reference sign '&' -sp_before_byref = force # ignore/add/remove/force - -# Add or remove space before a reference sign '&' that isn't followed by a variable name -# If set to 'ignore', sp_before_byref is used instead. -sp_before_unnamed_byref = ignore # ignore/add/remove/force - -# Add or remove space after reference sign '&', if followed by a word. -sp_after_byref = remove # ignore/add/remove/force - -# Add or remove space after a reference sign '&', if followed by a func proto/def. -sp_after_byref_func = remove # ignore/add/remove/force - -# Add or remove space before a reference sign '&', if followed by a func proto/def. -sp_before_byref_func = force # ignore/add/remove/force - -# Add or remove space between type and word. Default=Force -sp_after_type = force # ignore/add/remove/force - -# Add or remove space in 'template <' vs 'template<'. -# If set to ignore, sp_before_angle is used. -sp_template_angle = force # ignore/add/remove/force - -# Add or remove space before '<>' -sp_before_angle = force # ignore/add/remove/force - -# Add or remove space inside '<' and '>' -sp_inside_angle = remove # ignore/add/remove/force - -# Add or remove space after '<>' -sp_after_angle = remove # ignore/add/remove/force - -# Add or remove space between '<>' and '(' as found in 'new List();' -sp_angle_paren = remove # ignore/add/remove/force - -# Add or remove space between '<>' and a word as in 'List m;' -sp_angle_word = force # ignore/add/remove/force - -# Add or remove space between '>' and '>' in '>>' (template stuff C++/C# only). Default=Add -sp_angle_shift = add # ignore/add/remove/force - -# Add or remove space before '(' of 'if', 'for', 'switch', and 'while' -sp_before_sparen = force # ignore/add/remove/force - -# Add or remove space inside if-condition '(' and ')' -sp_inside_sparen = remove # ignore/add/remove/force - -# Add or remove space before if-condition ')'. Overrides sp_inside_sparen. -sp_inside_sparen_close = ignore # ignore/add/remove/force - -# Add or remove space after ')' of 'if', 'for', 'switch', and 'while' -sp_after_sparen = force # ignore/add/remove/force - -# Add or remove space between ')' and '{' of 'if', 'for', 'switch', and 'while' -sp_sparen_brace = force # ignore/add/remove/force - -# Add or remove space between 'invariant' and '(' in the D language. -sp_invariant_paren = force # ignore/add/remove/force - -# Add or remove space after the ')' in 'invariant (C) c' in the D language. -sp_after_invariant_paren = force # ignore/add/remove/force - -# Add or remove space before empty statement ';' on 'if', 'for' and 'while' -sp_special_semi = force # ignore/add/remove/force - -# Add or remove space before ';'. Default=Remove -sp_before_semi = remove # ignore/add/remove/force - -# Add or remove space before ';' in non-empty 'for' statements -sp_before_semi_for = remove # ignore/add/remove/force - -# Add or remove space before a semicolon of an empty part of a for statement. -sp_before_semi_for_empty = remove # ignore/add/remove/force - -# Add or remove space after ';', except when followed by a comment. Default=Add -sp_after_semi = force # ignore/add/remove/force - -# Add or remove space after ';' in non-empty 'for' statements. Default=Force -sp_after_semi_for = force # ignore/add/remove/force - -# Add or remove space after the final semicolon of an empty part of a for statement: for ( ; ; ). -sp_after_semi_for_empty = force # ignore/add/remove/force - -# Add or remove space before '[' (except '[]') -sp_before_square = ignore # ignore/add/remove/force - -# Add or remove space before '[]' -sp_before_squares = remove # ignore/add/remove/force - -# Add or remove space inside a non-empty '[' and ']' -sp_inside_square = remove # ignore/add/remove/force - -# Add or remove space after ',' -sp_after_comma = force # ignore/add/remove/force - -# Add or remove space before ',' -sp_before_comma = remove # ignore/add/remove/force - -# Add or remove space between an open paren and comma: '(,' vs '( ,' -sp_paren_comma = force # ignore/add/remove/force - -# Add or remove space before the variadic '...' when preceded by a non-punctuator -sp_before_ellipsis = force # ignore/add/remove/force - -# Add or remove space after class ':' -sp_after_class_colon = force # ignore/add/remove/force - -# Add or remove space before class ':' -sp_before_class_colon = force # ignore/add/remove/force - -# Add or remove space before case ':'. Default=Remove -sp_before_case_colon = remove # ignore/add/remove/force - -# Add or remove space between 'operator' and operator sign -sp_after_operator = force # ignore/add/remove/force - -# Add or remove space between the operator symbol and the open paren, as in 'operator ++(' -sp_after_operator_sym = remove # ignore/add/remove/force - -# Add or remove space after C/D cast, i.e. 'cast(int)a' vs 'cast(int) a' or '(int)a' vs '(int) a' -sp_after_cast = remove # ignore/add/remove/force - -# Add or remove spaces inside cast parens -sp_inside_paren_cast = remove # ignore/add/remove/force - -# Add or remove space between the type and open paren in a C++ cast, i.e. 'int(exp)' vs 'int (exp)' -sp_cpp_cast_paren = remove # ignore/add/remove/force - -# Add or remove space between 'sizeof' and '(' -sp_sizeof_paren = remove # ignore/add/remove/force - -# Add or remove space after the tag keyword (Pawn) -sp_after_tag = ignore # ignore/add/remove/force - -# Add or remove space inside enum '{' and '}' -sp_inside_braces_enum = remove # ignore/add/remove/force - -# Add or remove space inside struct/union '{' and '}' -sp_inside_braces_struct = remove # ignore/add/remove/force - -# Add or remove space inside '{' and '}' -sp_inside_braces = remove # ignore/add/remove/force - -# Add or remove space inside '{}' -sp_inside_braces_empty = remove # ignore/add/remove/force - -# Add or remove space between return type and function name -# A minimum of 1 is forced except for pointer return types. -sp_type_func = remove # ignore/add/remove/force - -# Add or remove space between function name and '(' on function declaration -sp_func_proto_paren = remove # ignore/add/remove/force - -# Add or remove space between function name and '(' on function definition -sp_func_def_paren = remove # ignore/add/remove/force - -# Add or remove space inside empty function '()' -sp_inside_fparens = remove # ignore/add/remove/force - -# Add or remove space inside function '(' and ')' -sp_inside_fparen = remove # ignore/add/remove/force - -# Add or remove space between ']' and '(' when part of a function call. -sp_square_fparen = remove # ignore/add/remove/force - -# Add or remove space between ')' and '{' of function -sp_fparen_brace = force # ignore/add/remove/force - -# Add or remove space between function name and '(' on function calls -sp_func_call_paren = remove # ignore/add/remove/force - -# Add or remove space between function name and '()' on function calls without parameters. -# If set to 'ignore' (the default), sp_func_call_paren is used. -sp_func_call_paren_empty = remove # ignore/add/remove/force - -# Add or remove space between the user function name and '(' on function calls -# You need to set a keyword to be a user function, like this: 'set func_call_user _' in the config file. -sp_func_call_user_paren = remove # ignore/add/remove/force - -# Add or remove space between a constructor/destructor and the open paren -sp_func_class_paren = remove # ignore/add/remove/force - -# Add or remove space between 'return' and '(' -sp_return_paren = force # ignore/add/remove/force - -# Add or remove space between '__attribute__' and '(' -sp_attribute_paren = remove # ignore/add/remove/force - -# Add or remove space between 'defined' and '(' in '#if defined (FOO)' -sp_defined_paren = remove # ignore/add/remove/force - -# Add or remove space between 'throw' and '(' in 'throw (something)' -sp_throw_paren = remove # ignore/add/remove/force - -# Add or remove space between 'catch' and '(' in 'catch (something) { }' -# If set to ignore, sp_before_sparen is used. -sp_catch_paren = remove # ignore/add/remove/force - -# Add or remove space between 'version' and '(' in 'version (something) { }' (D language) -# If set to ignore, sp_before_sparen is used. -sp_version_paren = remove # ignore/add/remove/force - -# Add or remove space between 'scope' and '(' in 'scope (something) { }' (D language) -# If set to ignore, sp_before_sparen is used. -sp_scope_paren = remove # ignore/add/remove/force - -# Add or remove space between macro and value -sp_macro = remove # ignore/add/remove/force - -# Add or remove space between macro function ')' and value -sp_macro_func = remove # ignore/add/remove/force - -# Add or remove space between 'else' and '{' if on the same line -sp_else_brace = force # ignore/add/remove/force - -# Add or remove space between '}' and 'else' if on the same line -sp_brace_else = force # ignore/add/remove/force - -# Add or remove space between '}' and the name of a typedef on the same line -sp_brace_typedef = force # ignore/add/remove/force - -# Add or remove space between 'catch' and '{' if on the same line -sp_catch_brace = force # ignore/add/remove/force - -# Add or remove space between '}' and 'catch' if on the same line -sp_brace_catch = force # ignore/add/remove/force - -# Add or remove space between 'finally' and '{' if on the same line -sp_finally_brace = force # ignore/add/remove/force - -# Add or remove space between '}' and 'finally' if on the same line -sp_brace_finally = force # ignore/add/remove/force - -# Add or remove space between 'try' and '{' if on the same line -sp_try_brace = force # ignore/add/remove/force - -# Add or remove space between get/set and '{' if on the same line -sp_getset_brace = force # ignore/add/remove/force - -# Add or remove space before the '::' operator -sp_before_dc = remove # ignore/add/remove/force - -# Add or remove space after the '::' operator -sp_after_dc = remove # ignore/add/remove/force - -# Add or remove around the D named array initializer ':' operator -sp_d_array_colon = remove # ignore/add/remove/force - -# Add or remove space after the '!' (not) operator. Default=Remove -sp_not = remove # ignore/add/remove/force - -# Add or remove space after the '~' (invert) operator. Default=Remove -sp_inv = remove # ignore/add/remove/force - -# Add or remove space after the '&' (address-of) operator. Default=Remove -# This does not affect the spacing after a '&' that is part of a type. -sp_addr = remove # ignore/add/remove/force - -# Add or remove space around the '.' or '->' operators. Default=Remove -sp_member = remove # ignore/add/remove/force - -# Add or remove space after the '*' (dereference) operator. Default=Remove -# This does not affect the spacing after a '*' that is part of a type. -sp_deref = remove # ignore/add/remove/force - -# Add or remove space after '+' or '-', as in 'x = -5' or 'y = +7'. Default=Remove -sp_sign = remove # ignore/add/remove/force - -# Add or remove space before or after '++' and '--', as in '(--x)' or 'y++;'. Default=Remove -sp_incdec = remove # ignore/add/remove/force - -# Add or remove space before a backslash-newline at the end of a line. Default=Add -sp_before_nl_cont = force # ignore/add/remove/force - -# Add or remove space after the scope '+' or '-', as in '-(void) foo;' or '+(int) bar;' -sp_after_oc_scope = force # ignore/add/remove/force - -# Add or remove space after the colon in message specs -# '-(int) f:(int) x;' vs '-(int) f: (int) x;' -sp_after_oc_colon = remove # ignore/add/remove/force - -# Add or remove space before the colon in message specs -# '-(int) f: (int) x;' vs '-(int) f : (int) x;' -sp_before_oc_colon = remove # ignore/add/remove/force - -# Add or remove space after the colon in message specs -# '[object setValue:1];' vs '[object setValue: 1];' -sp_after_send_oc_colon = remove # ignore/add/remove/force - -# Add or remove space before the colon in message specs -# '[object setValue:1];' vs '[object setValue :1];' -sp_before_send_oc_colon = remove # ignore/add/remove/force - -# Add or remove space after the (type) in message specs -# '-(int)f: (int) x;' vs '-(int)f: (int)x;' -sp_after_oc_type = remove # ignore/add/remove/force - -# Add or remove space after the first (type) in message specs -# '-(int) f:(int)x;' vs '-(int)f:(int)x;' -sp_after_oc_return_type = remove # ignore/add/remove/force - -# Add or remove space between '@selector' and '(' -# '@selector(msgName)' vs '@selector (msgName)' -# Also applies to @protocol() constructs -sp_after_oc_at_sel = remove # ignore/add/remove/force - -# Add or remove space between '@selector(x)' and the following word -# '@selector(foo) a:' vs '@selector(foo)a:' -sp_after_oc_at_sel_parens = force # ignore/add/remove/force - -# Add or remove space inside '@selector' parens -# '@selector(foo)' vs '@selector( foo )' -# Also applies to @protocol() constructs -sp_inside_oc_at_sel_parens = remove # ignore/add/remove/force - -# Add or remove space before a block pointer caret -# '^int (int arg){...}' vs. ' ^int (int arg){...}' -sp_before_oc_block_caret = ignore # ignore/add/remove/force - -# Add or remove space after a block pointer caret -# '^int (int arg){...}' vs. '^ int (int arg){...}' -sp_after_oc_block_caret = ignore # ignore/add/remove/force - -# Add or remove space around the ':' in 'b ? t : f' -sp_cond_colon = add # ignore/add/remove/force - -# Add or remove space around the '?' in 'b ? t : f' -sp_cond_question = add # ignore/add/remove/force - -# Fix the spacing between 'case' and the label. Only 'ignore' and 'force' make sense here. -sp_case_label = ignore # ignore/add/remove/force - -# Control the space around the D '..' operator. -sp_range = ignore # ignore/add/remove/force - -# Control the space after the opening of a C++ comment '// A' vs '//A' -sp_cmt_cpp_start = add # ignore/add/remove/force - -# Controls the spaces between #else or #endif and a trailing comment -sp_endif_cmt = ignore # ignore/add/remove/force - -# Controls the spaces after 'new', 'delete', and 'delete[]' -sp_after_new = ignore # ignore/add/remove/force - -# Controls the spaces before a trailing or embedded comment -sp_before_tr_emb_cmt = ignore # ignore/add/remove/force - -# Number of spaces before a trailing or embedded comment -sp_num_before_tr_emb_cmt = 0 # number - -# -# Code alignment (not left column spaces/tabs) -# - -# Whether to keep non-indenting tabs -align_keep_tabs = false # false/true - -# Whether to use tabs for aligning -align_with_tabs = false # false/true - -# Whether to bump out to the next tab when aligning -align_on_tabstop = false # false/true - -# Whether to left-align numbers -align_number_left = false # false/true - -# Align variable definitions in prototypes and functions -align_func_params = true # false/true - -# Align parameters in single-line functions that have the same name. -# The function names must already be aligned with each other. -align_same_func_call_params = false # false/true - -# The span for aligning variable definitions (0=don't align) -align_var_def_span = 0 # number - -# How to align the star in variable definitions. -# 0=Part of the type 'void * foo;' -# 1=Part of the variable 'void *foo;' -# 2=Dangling 'void *foo;' -align_var_def_star_style = 1 # number - -# How to align the '&' in variable definitions. -# 0=Part of the type -# 1=Part of the variable -# 2=Dangling -align_var_def_amp_style = 2 # number - -# The threshold for aligning variable definitions (0=no limit) -align_var_def_thresh = 0 # number - -# The gap for aligning variable definitions -align_var_def_gap = 0 # number - -# Whether to align the colon in struct bit fields -align_var_def_colon = true # false/true - -# Whether to align any attribute after the variable name -align_var_def_attribute = false # false/true - -# Whether to align inline struct/enum/union variable definitions -align_var_def_inline = true # false/true - -# The span for aligning on '=' in assignments (0=don't align) -align_assign_span = 0 # number - -# The threshold for aligning on '=' in assignments (0=no limit) -align_assign_thresh = 12 # number - -# The span for aligning on '=' in enums (0=don't align) -align_enum_equ_span = 16 # number - -# The threshold for aligning on '=' in enums (0=no limit) -align_enum_equ_thresh = 0 # number - -# The span for aligning struct/union (0=don't align) -align_var_struct_span = 99 # number - -# The threshold for aligning struct/union member definitions (0=no limit) -align_var_struct_thresh = 0 # number - -# The gap for aligning struct/union member definitions -align_var_struct_gap = 0 # number - -# The span for aligning struct initializer values (0=don't align) -align_struct_init_span = 3 # number - -# The minimum space between the type and the synonym of a typedef -align_typedef_gap = 1 # number - -# The span for aligning single-line typedefs (0=don't align) -align_typedef_span = 5 # number - -# How to align typedef'd functions with other typedefs -# 0: Don't mix them at all -# 1: align the open paren with the types -# 2: align the function type name with the other type names -align_typedef_func = 2 # number - -# Controls the positioning of the '*' in typedefs. Just try it. -# 0: Align on typedef type, ignore '*' -# 1: The '*' is part of type name: typedef int *pint; -# 2: The '*' is part of the type, but dangling: typedef int *pint; -align_typedef_star_style = 2 # number - -# Controls the positioning of the '&' in typedefs. Just try it. -# 0: Align on typedef type, ignore '&' -# 1: The '&' is part of type name: typedef int &pint; -# 2: The '&' is part of the type, but dangling: typedef int &pint; -align_typedef_amp_style = 2 # number - -# The span for aligning comments that end lines (0=don't align) -align_right_cmt_span = 0 # number - -# If aligning comments, mix with comments after '}' and #endif with less than 3 spaces before the comment -align_right_cmt_mix = false # false/true - -# If a trailing comment is more than this number of columns away from the text it follows, -# it will qualify for being aligned. This has to be > 0 to do anything. -align_right_cmt_gap = 0 # number - -# Align trailing comment at or beyond column N; 'pulls in' comments as a bonus side effect (0=ignore) -align_right_cmt_at_col = 0 # number - -# The span for aligning function prototypes (0=don't align) -align_func_proto_span = 0 # number - -# Minimum gap between the return type and the function name. -align_func_proto_gap = 1 # number - -# Align function protos on the 'operator' keyword instead of what follows -align_on_operator = false # false/true - -# Whether to mix aligning prototype and variable declarations. -# If true, align_var_def_XXX options are used instead of align_func_proto_XXX options. -align_mix_var_proto = true # false/true - -# Align single-line functions with function prototypes, uses align_func_proto_span -align_single_line_func = false # false/true - -# Aligning the open brace of single-line functions. -# Requires align_single_line_func=true, uses align_func_proto_span -align_single_line_brace = false # false/true - -# Gap for align_single_line_brace. -align_single_line_brace_gap = 0 # number - -# The span for aligning ObjC msg spec (0=don't align) -align_oc_msg_spec_span = 0 # number - -# Whether to align macros wrapped with a backslash and a newline. -# This will not work right if the macro contains a multi-line comment. -align_nl_cont = true # false/true - -# # Align macro functions and variables together -# align_pp_define_together = false # false/true - -# The minimum space between label and value of a preprocessor define -align_pp_define_gap = 1 # number - -# The span for aligning on '#define' bodies (0=don't align) -align_pp_define_span = 0 # number - -# Align lines that start with '<<' with previous '<<'. Default=true -align_left_shift = true # false/true - -# Span for aligning parameters in an Obj-C message call on the ':' (0=don't align) -align_oc_msg_colon_span = 1 # number - -# Aligning parameters in an Obj-C '+' or '-' declaration on the ':' -align_oc_decl_colon = true # false/true - -# -# Newline adding and removing options -# - -# Whether to collapse empty blocks between '{' and '}' -nl_collapse_empty_body = true # false/true - -# Don't split one-line braced assignments - 'foo_t f = { 1, 2 };' -nl_assign_leave_one_liners = false # false/true - -# Don't split one-line braced statements inside a class xx { } body -nl_class_leave_one_liners = false # false/true - -# Don't split one-line enums: 'enum foo { BAR = 15 };' -nl_enum_leave_one_liners = false # false/true - -# Don't split one-line get or set functions -nl_getset_leave_one_liners = false # false/true - -# Don't split one-line function definitions - 'int foo() { return 0; }' -nl_func_leave_one_liners = false # false/true - -# Don't split one-line if/else statements - 'if(a) b++;' -nl_if_leave_one_liners = false # false/true - -# Add or remove newlines at the start of the file -nl_start_of_file = remove # ignore/add/remove/force - -# The number of newlines at the start of the file (only used if nl_start_of_file is 'add' or 'force' -nl_start_of_file_min = 0 # number - -# Add or remove newline at the end of the file -nl_end_of_file = force # ignore/add/remove/force - -# The number of newlines at the end of the file (only used if nl_end_of_file is 'add' or 'force') -nl_end_of_file_min = 1 # number - -# Add or remove newline between '=' and '{' -nl_assign_brace = ignore # ignore/add/remove/force - -# Add or remove newline between '=' and '[' (D only) -nl_assign_square = ignore # ignore/add/remove/force - -# Add or remove newline after '= [' (D only). Will also affect the newline before the ']' -nl_after_square_assign = ignore # ignore/add/remove/force - -# The number of blank lines after a block of variable definitions at the top of a function body -# 0 = No change (default) -nl_func_var_def_blk = 1 # number - -# The number of newlines before a block of typedefs -# 0 = No change (default) -# nl_typedef_blk_start = 0 # number - -# The number of newlines after a block of typedefs -# 0 = No change (default) -# nl_typedef_blk_end = 0 # number - -# The maximum consecutive newlines within a block of typedefs -# 0 = No change (default) -# nl_typedef_blk_in = 0 # number - -# The number of newlines before a block of variable definitions not at the top of a function body -# 0 = No change (default) -# nl_var_def_blk_start = 0 # number - -# The number of newlines after a block of variable definitions not at the top of a function body -# 0 = No change (default) -# nl_var_def_blk_end = 0 # number - -# The maximum consecutive newlines within a block of variable definitions -# 0 = No change (default) -# nl_var_def_blk_in = 0 # number - -# Add or remove newline between a function call's ')' and '{', as in: -# list_for_each(item, &list) { } -nl_fcall_brace = remove # ignore/add/remove/force - -# Add or remove newline between 'enum' and '{' -nl_enum_brace = remove # ignore/add/remove/force - -# Add or remove newline between 'struct and '{' -nl_struct_brace = remove # ignore/add/remove/force - -# Add or remove newline between 'union' and '{' -nl_union_brace = remove # ignore/add/remove/force - -# Add or remove newline between 'if' and '{' -nl_if_brace = remove # ignore/add/remove/force - -# Add or remove newline between '}' and 'else' -nl_brace_else = remove # ignore/add/remove/force - -# Add or remove newline between 'else if' and '{' -# If set to ignore, nl_if_brace is used instead -nl_elseif_brace = remove # ignore/add/remove/force - -# Add or remove newline between 'else' and '{' -nl_else_brace = remove # ignore/add/remove/force - -# Add or remove newline between 'else' and 'if' -nl_else_if = remove # ignore/add/remove/force - -# Add or remove newline between '}' and 'finally' -nl_brace_finally = ignore # ignore/add/remove/force - -# Add or remove newline between 'finally' and '{' -nl_finally_brace = ignore # ignore/add/remove/force - -# Add or remove newline between 'try' and '{' -nl_try_brace = ignore # ignore/add/remove/force - -# Add or remove newline between get/set and '{' -nl_getset_brace = ignore # ignore/add/remove/force - -# Add or remove newline between 'for' and '{' -nl_for_brace = remove # ignore/add/remove/force - -# Add or remove newline between 'catch' and '{' -nl_catch_brace = ignore # ignore/add/remove/force - -# Add or remove newline between '}' and 'catch' -nl_brace_catch = ignore # ignore/add/remove/force - -# Add or remove newline between 'while' and '{' -nl_while_brace = remove # ignore/add/remove/force - -# Add or remove newline between 'using' and '{' -nl_using_brace = ignore # ignore/add/remove/force - -# Add or remove newline between two open or close braces. -# Due to general newline/brace handling, REMOVE may not work. -nl_brace_brace = ignore # ignore/add/remove/force - -# Add or remove newline between 'do' and '{' -nl_do_brace = remove # ignore/add/remove/force - -# Add or remove newline between '}' and 'while' of 'do' statement -nl_brace_while = remove # ignore/add/remove/force - -# Add or remove newline between 'switch' and '{' -nl_switch_brace = remove # ignore/add/remove/force - -# Add a newline between ')' and '{' if the ')' is on a different line than the if/for/etc. -# Overrides nl_for_brace, nl_if_brace, nl_switch_brace, nl_while_switch, and nl_catch_brace. -nl_multi_line_cond = false # false/true - -# Force a newline in a define after the macro name for multi-line defines. -nl_multi_line_define = false # false/true - -# Whether to put a newline before 'case' statement -nl_before_case = true # false/true - -# Add or remove newline between ')' and 'throw' -nl_before_throw = ignore # ignore/add/remove/force - -# Whether to put a newline after 'case' statement -nl_after_case = true # false/true - -# Add or remove a newline between a case ':' and '{'. Overrides nl_after_case. -nl_case_colon_brace = ignore # ignore/add/remove/force - -# Newline between namespace and { -nl_namespace_brace = ignore # ignore/add/remove/force - -# Add or remove newline between 'template<>' and whatever follows. -nl_template_class = ignore # ignore/add/remove/force - -# Add or remove newline between 'class' and '{' -nl_class_brace = ignore # ignore/add/remove/force - -# Add or remove newline after each ',' in the constructor member initialization -nl_class_init_args = ignore # ignore/add/remove/force - -# Add or remove newline between return type and function name in a function definition -nl_func_type_name = ignore # ignore/add/remove/force - -# Add or remove newline between return type and function name inside a class {} -# Uses nl_func_type_name or nl_func_proto_type_name if set to ignore. -nl_func_type_name_class = ignore # ignore/add/remove/force - -# Add or remove newline between function scope and name in a definition -# Controls the newline after '::' in 'void A::f() { }' -nl_func_scope_name = ignore # ignore/add/remove/force - -# Add or remove newline between return type and function name in a prototype -nl_func_proto_type_name = ignore # ignore/add/remove/force - -# Add or remove newline between a function name and the opening '(' -nl_func_paren = ignore # ignore/add/remove/force - -# Add or remove newline between a function name and the opening '(' in the definition -nl_func_def_paren = ignore # ignore/add/remove/force - -# Add or remove newline after '(' in a function declaration -nl_func_decl_start = ignore # ignore/add/remove/force - -# Add or remove newline after '(' in a function definition -nl_func_def_start = ignore # ignore/add/remove/force - -# Overrides nl_func_decl_start when there is only one parameter. -nl_func_decl_start_single = ignore # ignore/add/remove/force - -# Overrides nl_func_def_start when there is only one parameter. -nl_func_def_start_single = ignore # ignore/add/remove/force - -# Add or remove newline after each ',' in a function declaration -nl_func_decl_args = ignore # ignore/add/remove/force - -# Add or remove newline after each ',' in a function definition -nl_func_def_args = ignore # ignore/add/remove/force - -# Add or remove newline before the ')' in a function declaration -nl_func_decl_end = ignore # ignore/add/remove/force - -# Add or remove newline before the ')' in a function definition -nl_func_def_end = ignore # ignore/add/remove/force - -# Overrides nl_func_decl_end when there is only one parameter. -nl_func_decl_end_single = ignore # ignore/add/remove/force - -# Overrides nl_func_def_end when there is only one parameter. -nl_func_def_end_single = ignore # ignore/add/remove/force - -# Add or remove newline between '()' in a function declaration. -nl_func_decl_empty = ignore # ignore/add/remove/force - -# Add or remove newline between '()' in a function definition. -nl_func_def_empty = ignore # ignore/add/remove/force - -# Add or remove newline between function signature and '{' -nl_fdef_brace = force # ignore/add/remove/force - -# Whether to put a newline after 'return' statement -nl_after_return = true # false/true - -# Add or remove a newline between the return keyword and return expression. -nl_return_expr = ignore # ignore/add/remove/force - -# Whether to put a newline after semicolons, except in 'for' statements -nl_after_semicolon = false # false/true - -# Whether to put a newline after brace open. -# This also adds a newline before the matching brace close. -nl_after_brace_open = false # false/true - -# If nl_after_brace_open and nl_after_brace_open_cmt are true, a newline is -# placed between the open brace and a trailing single-line comment. -nl_after_brace_open_cmt = false # false/true - -# Whether to put a newline after a virtual brace open with a non-empty body. -# These occur in un-braced if/while/do/for statement bodies. -nl_after_vbrace_open = false # false/true - -# Whether to put a newline after a virtual brace open with an empty body. -# These occur in un-braced if/while/do/for statement bodies. -nl_after_vbrace_open_empty = false # false/true - -# Whether to put a newline after a brace close. -# Does not apply if followed by a necessary ';'. -nl_after_brace_close = false # false/true - -# Whether to put a newline after a virtual brace close. -# Would add a newline before return in: 'if (foo) a++; return;' -nl_after_vbrace_close = false # false/true - -# Whether to alter newlines in '#define' macros -nl_define_macro = true # false/true - -# Whether to not put blanks after '#ifxx', '#elxx', or before '#endif' -nl_squeeze_ifdef = true # false/true - -# Add or remove blank line before 'if' -nl_before_if = ignore # ignore/add/remove/force - -# Add or remove blank line after 'if' statement -nl_after_if = ignore # ignore/add/remove/force - -# Add or remove blank line before 'for' -nl_before_for = force # ignore/add/remove/force - -# Add or remove blank line after 'for' statement -nl_after_for = force # ignore/add/remove/force - -# Add or remove blank line before 'while' -nl_before_while = force # ignore/add/remove/force - -# Add or remove blank line after 'while' statement -nl_after_while = force # ignore/add/remove/force - -# Add or remove blank line before 'switch' -nl_before_switch = ignore # ignore/add/remove/force - -# Add or remove blank line after 'switch' statement -nl_after_switch = ignore # ignore/add/remove/force - -# Add or remove blank line before 'do' -nl_before_do = ignore # ignore/add/remove/force - -# Add or remove blank line after 'do/while' statement -nl_after_do = ignore # ignore/add/remove/force - -# Whether to double-space commented-entries in struct/enum -nl_ds_struct_enum_cmt = false # false/true - -# Whether to double-space before the close brace of a struct/union/enum -# (lower priority than 'eat_blanks_before_close_brace') -nl_ds_struct_enum_close_brace = false # false/true - -# Add or remove a newline around a class colon. -# Related to pos_class_colon, nl_class_init_args, and pos_comma. -nl_class_colon = ignore # ignore/add/remove/force - -# Change simple unbraced if statements into a one-liner -# 'if(b)\n i++;' => 'if(b) i++;' -nl_create_if_one_liner = false # false/true - -# Change simple unbraced for statements into a one-liner -# 'for (i=0;i<5;i++)\n foo(i);' => 'for (i=0;i<5;i++) foo(i);' -nl_create_for_one_liner = false # false/true - -# Change simple unbraced while statements into a one-liner -# 'while (i<5)\n foo(i++);' => 'while (i<5) foo(i++);' -nl_create_while_one_liner = false # false/true - -# -# Positioning options -# - -# The position of arithmetic operators in wrapped expressions -pos_arith = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force - -# The position of assignment in wrapped expressions. -# Do not affect '=' followed by '{' -pos_assign = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force - -# The position of boolean operators in wrapped expressions -pos_bool = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force - -# The position of comparison operators in wrapped expressions -pos_compare = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force - -# The position of conditional (b ? t : f) operators in wrapped expressions -pos_conditional = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force - -# The position of the comma in wrapped expressions -pos_comma = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force - -# The position of the comma in the constructor initialization list -pos_class_comma = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force - -# The position of colons between constructor and member initialization -pos_class_colon = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force - -# -# Line Splitting options -# - -# Try to limit code width to N number of columns -code_width = 0 # number - -# Whether to fully split long 'for' statements at semi-colons -ls_for_split_full = false # false/true - -# Whether to fully split long function protos/calls at commas -ls_func_split_full = true # false/true - -# Whether to split lines as close to code_width as possible and ignore some groupings -# ls_code_width = false # false/true - -# -# Blank line options -# - -# The maximum consecutive newlines -nl_max = 2 # number - -# The number of newlines after a function prototype, if followed by another function prototype -nl_after_func_proto = 2 # number - -# The number of newlines after a function prototype, if not followed by another function prototype -nl_after_func_proto_group = 2 # number - -# The number of newlines after '}' of a multi-line function body -nl_after_func_body = 2 # number - -# The number of newlines after '}' of a multi-line function body in a class declaration -nl_after_func_body_class = 0 # number - -# The number of newlines after '}' of a single line function body -nl_after_func_body_one_liner = 2 # number - -# The minimum number of newlines before a multi-line comment. -# Doesn't apply if after a brace open or another multi-line comment. -nl_before_block_comment = 2 # number - -# The minimum number of newlines before a single-line C comment. -# Doesn't apply if after a brace open or other single-line C comments. -nl_before_c_comment = 1 # number - -# The minimum number of newlines before a CPP comment. -# Doesn't apply if after a brace open or other CPP comments. -nl_before_cpp_comment = 1 # number - -# Whether to force a newline after a multi-line comment. -nl_after_multiline_comment = false # false/true - -# The number of newlines after '}' or ';' of a struct/enum/union definition -nl_after_struct = 0 # number - -# The number of newlines after '}' or ';' of a class definition -nl_after_class = 0 # number - -# The number of newlines before a 'private:', 'public:', 'protected:', 'signals:', or 'slots:' label. -# Will not change the newline count if after a brace open. -# 0 = No change. -nl_before_access_spec = 0 # number - -# The number of newlines after a 'private:', 'public:', 'protected:', 'signals:', or 'slots:' label. -# 0 = No change. -nl_after_access_spec = 0 # number - -# The number of newlines between a function def and the function comment. -# 0 = No change. -nl_comment_func_def = 1 # number - -# The number of newlines after a try-catch-finally block that isn't followed by a brace close. -# 0 = No change. -nl_after_try_catch_finally = 2 # number - -# The number of newlines before and after a property, indexer or event decl. -# 0 = No change. -nl_around_cs_property = 0 # number - -# The number of newlines between the get/set/add/remove handlers in C#. -# 0 = No change. -nl_between_get_set = 0 # number - -# Add or remove newline between C# property and the '{' -nl_property_brace = ignore # ignore/add/remove/force - -# Whether to remove blank lines after '{' -eat_blanks_after_open_brace = true # false/true - -# Whether to remove blank lines before '}' -eat_blanks_before_close_brace = true # false/true - -# How aggressively to remove extra newlines not in preproc. -# 0: No change -# 1: Remove most newlines not handled by other config -# 2: Remove all newlines and reformat completely by config -# nl_remove_extra_newlines = 0 # number - -# -# Code modifying options (non-whitespace) -# - -# Add or remove braces on single-line 'do' statement -mod_full_brace_do = add # ignore/add/remove/force - -# Add or remove braces on single-line 'for' statement -mod_full_brace_for = add # ignore/add/remove/force - -# Add or remove braces on single-line function definitions. (Pawn) -mod_full_brace_function = ignore # ignore/add/remove/force - -# Add or remove braces on single-line 'if' statement. Will not remove the braces if they contain an 'else'. -mod_full_brace_if = add # ignore/add/remove/force - -# Make all if/elseif/else statements in a chain be braced or not. Overrides mod_full_brace_if. -# If any must be braced, they are all braced. If all can be unbraced, then the braces are removed. -mod_full_brace_if_chain = false # false/true - -# Don't remove braces around statements that span N newlines -mod_full_brace_nl = 0 # number - -# Add or remove braces on single-line 'while' statement -mod_full_brace_while = add # ignore/add/remove/force - -# Add or remove braces on single-line 'using ()' statement -mod_full_brace_using = ignore # ignore/add/remove/force - -# Add or remove unnecessary paren on 'return' statement -mod_paren_on_return = remove # ignore/add/remove/force - -# Whether to change optional semicolons to real semicolons -mod_pawn_semicolon = false # false/true - -# Add parens on 'while' and 'if' statement around bools -mod_full_paren_if_bool = true # false/true - -# Whether to remove superfluous semicolons -mod_remove_extra_semicolon = true # false/true - -# If a function body exceeds the specified number of newlines and doesn't have a comment after -# the close brace, a comment will be added. -mod_add_long_function_closebrace_comment = 0 # number - -# If a switch body exceeds the specified number of newlines and doesn't have a comment after -# the close brace, a comment will be added. -mod_add_long_switch_closebrace_comment = 0 # number - -# If an #ifdef body exceeds the specified number of newlines and doesn't have a comment after -# the #endif, a comment will be added. -mod_add_long_ifdef_endif_comment = 20 # number - -# If an #ifdef or #else body exceeds the specified number of newlines and doesn't have a comment after -# the #else, a comment will be added. -mod_add_long_ifdef_else_comment = 0 # number - -# If TRUE, will sort consecutive single-line 'import' statements [Java, D] -mod_sort_import = false # false/true - -# If TRUE, will sort consecutive single-line 'using' statements [C#] -mod_sort_using = false # false/true - -# If TRUE, will sort consecutive single-line '#include' statements [C/C++] and '#import' statements [Obj-C] -# This is generally a bad idea, as it may break your code. -mod_sort_include = false # false/true - -# If TRUE, it will move a 'break' that appears after a fully braced 'case' before the close brace. -mod_move_case_break = false # false/true - -# Will add or remove the braces around a fully braced case statement. -# Will only remove the braces if there are no variable declarations in the block. -mod_case_brace = ignore # ignore/add/remove/force - -# If TRUE, it will remove a void 'return;' that appears as the last statement in a function. -mod_remove_empty_return = true # false/true - -# -# Comment modifications -# - -# Try to wrap comments at cmt_width columns -cmt_width = 0 # number - -# Set the comment reflow mode (default: 0) -# 0: no reflowing (apart from the line wrapping due to cmt_width) -# 1: no touching at all -# 2: full reflow -cmt_reflow_mode = 0 # number - -# If false, disable all multi-line comment changes, including cmt_width. keyword substitution, and leading chars. -# Default is true. -cmt_indent_multi = false # false/true - -# Whether to group c-comments that look like they are in a block -cmt_c_group = false # false/true - -# Whether to put an empty '/*' on the first line of the combined c-comment -cmt_c_nl_start = false # false/true - -# Whether to put a newline before the closing '*/' of the combined c-comment -cmt_c_nl_end = true # false/true - -# Whether to group cpp-comments that look like they are in a block -cmt_cpp_group = false # false/true - -# Whether to put an empty '/*' on the first line of the combined cpp-comment -cmt_cpp_nl_start = false # false/true - -# Whether to put a newline before the closing '*/' of the combined cpp-comment -cmt_cpp_nl_end = true # false/true - -# Whether to change cpp-comments into c-comments -cmt_cpp_to_c = false # false/true - -# Whether to put a star on subsequent comment lines -cmt_star_cont = true # false/true - -# The number of spaces to insert at the start of subsequent comment lines -cmt_sp_before_star_cont = 0 # number - -# The number of spaces to insert after the star on subsequent comment lines -cmt_sp_after_star_cont = 2 # number - -# For multi-line comments with a '*' lead, remove leading spaces if the first and last lines of -# the comment are the same length. Default=True -cmt_multi_check_last = true # false/true - -# The filename that contains text to insert at the head of a file if the file doesn't start with a C/C++ comment. -# Will substitute $(filename) with the current file's name. -cmt_insert_file_header = "" # string - -# The filename that contains text to insert at the end of a file if the file doesn't end with a C/C++ comment. -# Will substitute $(filename) with the current file's name. -cmt_insert_file_footer = "" # string - -# The filename that contains text to insert before a function implementation if the function isn't preceded with a C/C++ comment. -# Will substitute $(function) with the function name and $(javaparam) with the javadoc @param and @return stuff. -# Will also substitute $(fclass) with the class name: void CFoo::Bar() { ... } -cmt_insert_func_header = "" # string - -# The filename that contains text to insert before a class if the class isn't preceded with a C/C++ comment. -# Will substitute $(class) with the class name. -cmt_insert_class_header = "" # string - -# The filename that contains text to insert before a Obj-C message specification if the method isn't preceded with a C/C++ comment. -# Will substitute $(message) with the function name and $(javaparam) with the javadoc @param and @return stuff. -cmt_insert_oc_msg_header = "" # string - -# If a preprocessor is encountered when stepping backwards from a function name, then -# this option decides whether the comment should be inserted. -# Affects cmt_insert_oc_msg_header, cmt_insert_func_header and cmt_insert_class_header. -cmt_insert_before_preproc = false # false/true - -# -# Preprocessor options -# - -# Control indent of preprocessors inside #if blocks at brace level 0 -pp_indent = add # ignore/add/remove/force - -# Whether to indent #if/#else/#endif at the brace level (true) or from column 1 (false) -pp_indent_at_level = false # false/true - -# If pp_indent_at_level=false, specifies the number of columns to indent per level. Default=1. -pp_indent_count = 4 # number - -# Add or remove space after # based on pp_level of #if blocks -pp_space = remove # ignore/add/remove/force - -# Sets the number of spaces added with pp_space -pp_space_count = 0 # number - -# The indent for #region and #endregion in C# and '#pragma region' in C/C++ -pp_indent_region = 0 # number - -# Whether to indent the code between #region and #endregion -pp_region_indent_code = false # false/true - -# If pp_indent_at_level=true, sets the indent for #if, #else, and #endif when not at file-level -pp_indent_if = 1 # number - -# Control whether to indent the code between #if, #else and #endif when not at file-level -pp_if_indent_code = true # false/true - -# Whether to indent '#define' at the brace level (true) or from column 1 (false) -pp_define_at_level = false # false/true - -# You can force a token to be a type with the 'type' option. -# Example: -# type myfoo1 myfoo2 -# -# You can create custom macro-based indentation using macro-open, -# macro-else and macro-close. -# Example: -# macro-open BEGIN_TEMPLATE_MESSAGE_MAP -# macro-open BEGIN_MESSAGE_MAP -# macro-close END_MESSAGE_MAP -# -# You can assign any keyword to any type with the set option. -# set func_call_user _ N_ -# -# The full syntax description of all custom definition config entries -# is shown below: -# -# define custom tokens as: -# - embed whitespace in token using '' escape character, or -# put token in quotes -# - these: ' " and ` are recognized as quote delimiters -# -# type token1 token2 token3 ... -# ^ optionally specify multiple tokens on a single line -# define def_token output_token -# ^ output_token is optional, then NULL is assumed -# macro-open token -# macro-close token -# macro-else token -# set id token1 token2 ... -# ^ optionally specify multiple tokens on a single line -# ^ id is one of the names in token_enum.h sans the CT_ prefix, -# e.g. PP_PRAGMA -# -# all tokens are separated by any mix of ',' commas, '=' equal signs -# and whitespace (space, tab) -# -set FUNC_CALL_USER theObject -set FUNC_CALL_USER theValue diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/uncrustify.sh b/chabok-starter-cordova/node_modules/cordova-ios/bin/uncrustify.sh deleted file mode 100755 index 2c37fb6..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/uncrustify.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/bash - -# 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. -# - -SCRIPT_PATH=$(dirname $0) -CONFIG="$SCRIPT_PATH/uncrustify.cfg" -EXE="$SCRIPT_PATH/../node_modules/.bin/uncrustify" - -function Usage() { - echo "Formats code using uncrustify." - echo "Usage: bin/uncrustify.sh --changed # Runs on changed (staged or not) files" - echo " bin/uncrustify.sh --staged # Runs on staged files" - echo " bin/uncrustify.sh --all # Runs on all source files under the current directory" - echo " bin/uncrustify.sh --check-file file # Returns 1 if the given file requires changes, 0 otherwise." - echo " bin/uncrustify.sh files # Runs on the given files" - exit 1 -} - -function VerifyEnv() { - if ! which "$EXE" > /dev/null; then - echo "uncrustify binary not found in the cordova-ios repo." - echo "In the repo root, install via npm: npm install" - exit 1 - fi -} - -function FilterFileList() { -#-name "*.[hm]" | grep -v "JSONKit" -#| grep "\.h\|\.m" - for f in "$@"; do - # Filter out deleted files. - [[ ! -e "$f" ]] && continue - # Filter out non .h & .m files. - [[ "$f" != *.[hm] ]] && continue - # Filter out Third-party sources. - [[ "$f" == *JSONKit* ]] && continue - echo $f - done -} - -function FilterAndRun() { - files=$(FilterFileList "$@") - - if [[ -z "$files" ]]; then - echo No files to uncrustify. - exit 2 - else - echo "$files" | xargs uncrustify -l OC --no-backup -c "$CONFIG" - fi -} - -if [[ "$1" = "--changed" ]]; then - VerifyEnv - files=$(git status --porcelain | sed s:...::) - FilterAndRun $files -elif [[ "$1" = "--staged" ]]; then - VerifyEnv - files=$(git diff --cached --name-only) - FilterAndRun $files -elif [[ "$1" = "--all" ]]; then - VerifyEnv - files=$(find .) - FilterAndRun $files -elif [[ "$1" = "--check-file" ]]; then - "$EXE" -q -l OC -c "$CONFIG" -f "$2" | cmp --quiet - "$2" -elif [[ "$1" = "--filter" ]]; then - FilterFileList "$@" -elif [[ "$1" = -* ]]; then - Usage -else - VerifyEnv - FilterAndRun "$@" -fi diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/update b/chabok-starter-cordova/node_modules/cordova-ios/bin/update deleted file mode 100755 index 704ab1f..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/update +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env node - -/* - 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 path = require('path'); -var Api = require('./templates/scripts/cordova/Api'); -var args = require('nopt')({ - 'link': Boolean, - 'shared': Boolean, // alias for --link - 'help': Boolean -}, { 'd': '--verbose' }); - -if (args.help || args.argv.remain.length === 0) { - console.log('Usage: ' + path.relative(process.cwd(), path.join(__dirname, 'update')) + ' [--link]'); - process.exit(0); -} - -require('./templates/scripts/cordova/loggingHelper').adjustLoggerLevel(args); - -Api.updatePlatform(args.argv.remain[0], { link: (args.link || args.shared) }).done(); diff --git a/chabok-starter-cordova/node_modules/cordova-ios/bin/update.bat b/chabok-starter-cordova/node_modules/cordova-ios/bin/update.bat deleted file mode 100644 index 48c451a..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/bin/update.bat +++ /dev/null @@ -1,26 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. - -@ECHO OFF -SET script="%~dp0update" -IF EXIST %script% ( - node %script% %* -) ELSE ( - ECHO. - ECHO ERROR: Could not find 'update' script in 'bin' folder, aborting...>&2 - EXIT /B 1 -) diff --git a/chabok-starter-cordova/node_modules/cordova-ios/cordova-js-src/.eslintrc.yml b/chabok-starter-cordova/node_modules/cordova-ios/cordova-js-src/.eslintrc.yml deleted file mode 100644 index e3d49d8..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/cordova-js-src/.eslintrc.yml +++ /dev/null @@ -1,4 +0,0 @@ -env: - node: false - commonjs: true - browser: true diff --git a/chabok-starter-cordova/node_modules/cordova-ios/cordova-js-src/exec.js b/chabok-starter-cordova/node_modules/cordova-ios/cordova-js-src/exec.js deleted file mode 100644 index e7f6ce1..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/cordova-js-src/exec.js +++ /dev/null @@ -1,262 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -/* global require, module, atob, document */ - -/** - * Creates a gap bridge iframe used to notify the native code about queued - * commands. - */ -var cordova = require('cordova'); -var utils = require('cordova/utils'); -var base64 = require('cordova/base64'); -var execIframe; -var commandQueue = []; // Contains pending JS->Native messages. -var isInContextOfEvalJs = 0; -var failSafeTimerId = 0; - -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)); - }; - 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; -} - -function iOSExec () { - - 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: ' + - '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); - - var command = [callbackId, service, action, actionArgs]; - - // Stringify and queue the command. We stringify to command now to - // effectively clone the command arguments in case they are mutated before - // the command is executed. - commandQueue.push(JSON.stringify(command)); - - // If we're in the context of a stringByEvaluatingJavaScriptFromString call, - // then the queue will be flushed when it returns; no need for a poke. - // Also, if there is already a command in the queue, then we've already - // poked the native side, so there is no reason to do so again. - if (!isInContextOfEvalJs && commandQueue.length === 1) { - pokeNative(); - } -} - -// CB-10530 -function proxyChanged () { - var cexec = cordovaExec(); - - return (execProxy !== cexec && // proxy objects are different - iOSExec !== cexec // proxy object is not the current iOSExec - ); -} - -// CB-10106 -function handleBridgeChange () { - if (proxyChanged()) { - var commandString = commandQueue.shift(); - while (commandString) { - var command = JSON.parse(commandString); - var callbackId = command[0]; - var service = command[1]; - var action = command[2]; - var actionArgs = command[3]; - var callbacks = cordova.callbacks[callbackId] || {}; - - execProxy(callbacks.success, callbacks.fail, service, action, actionArgs); - - commandString = commandQueue.shift(); - } - return true; - } - - return false; -} - -function pokeNative () { - // CB-5488 - Don't attempt to create iframe before document.body is available. - if (!document.body) { - setTimeout(pokeNative); - return; - } - - // Check if they've removed it from the DOM, and put it back if so. - if (execIframe && execIframe.contentWindow) { - execIframe.contentWindow.location = 'gap://ready'; - } else { - execIframe = document.createElement('iframe'); - execIframe.style.display = 'none'; - execIframe.src = 'gap://ready'; - document.body.appendChild(execIframe); - } - // Use a timer to protect against iframe being unloaded during the poke (CB-7735). - // This makes the bridge ~ 7% slower, but works around the poke getting lost - // when the iframe is removed from the DOM. - // An onunload listener could be used in the case where the iframe has just been - // created, but since unload events fire only once, it doesn't work in the normal - // case of iframe reuse (where unload will have already fired due to the attempted - // navigation of the page). - failSafeTimerId = setTimeout(function () { - if (commandQueue.length) { - // CB-10106 - flush the queue on bridge change - if (!handleBridgeChange()) { - pokeNative(); - } - } - }, 50); // Making this > 0 improves performance (marginally) in the normal case (where it doesn't fire). -} - -iOSExec.nativeFetchMessages = function () { - // Stop listing for window detatch once native side confirms poke. - if (failSafeTimerId) { - clearTimeout(failSafeTimerId); - failSafeTimerId = 0; - } - // Each entry in commandQueue is a JSON string already. - if (!commandQueue.length) { - return ''; - } - var json = '[' + commandQueue.join(',') + ']'; - commandQueue.length = 0; - return json; -}; - -iOSExec.nativeCallback = function (callbackId, status, message, keepCallback, debug) { - return iOSExec.nativeEvalAndFetch(function () { - var success = status === 0 || status === 1; - var args = convertMessageToArgsNativeToJs(message); - function nc2 () { - cordova.callbackFromNative(callbackId, success, status, args, keepCallback); - } - setTimeout(nc2, 0); - }); -}; - -iOSExec.nativeEvalAndFetch = function (func) { - // This shouldn't be nested, but better to be safe. - isInContextOfEvalJs++; - try { - func(); - return iOSExec.nativeFetchMessages(); - } finally { - isInContextOfEvalJs--; - } -}; - -// 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; diff --git a/chabok-starter-cordova/node_modules/cordova-ios/cordova-js-src/platform.js b/chabok-starter-cordova/node_modules/cordova-ios/cordova-js-src/platform.js deleted file mode 100644 index 2345fa5..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/cordova-js-src/platform.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -module.exports = { - id: 'ios', - bootstrap: function () { - // Attach the console polyfill that is iOS-only to window.console - // see the file under plugin/ios/console.js - require('cordova/modulemapper').clobbers('cordova/plugin/ios/console', 'window.console'); - - require('cordova/channel').onNativeReady.fire(); - } -}; diff --git a/chabok-starter-cordova/node_modules/cordova-ios/cordova-js-src/plugin/ios/console.js b/chabok-starter-cordova/node_modules/cordova-ios/cordova-js-src/plugin/ios/console.js deleted file mode 100644 index 0a4820e..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/cordova-js-src/plugin/ios/console.js +++ /dev/null @@ -1,186 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -// ------------------------------------------------------------------------------ - -var logger = require('cordova/plugin/ios/logger'); - -// ------------------------------------------------------------------------------ -// object that we're exporting -// ------------------------------------------------------------------------------ -var console = module.exports; - -// ------------------------------------------------------------------------------ -// copy of the original console object -// ------------------------------------------------------------------------------ -var WinConsole = window.console; - -// ------------------------------------------------------------------------------ -// whether to use the logger -// ------------------------------------------------------------------------------ -var UseLogger = false; - -// ------------------------------------------------------------------------------ -// Timers -// ------------------------------------------------------------------------------ -var Timers = {}; - -// ------------------------------------------------------------------------------ -// used for unimplemented methods -// ------------------------------------------------------------------------------ -function noop () {} - -// ------------------------------------------------------------------------------ -// used for unimplemented methods -// ------------------------------------------------------------------------------ -console.useLogger = function (value) { - if (arguments.length) UseLogger = !!value; - - if (UseLogger) { - if (logger.useConsole()) { - throw new Error('console and logger are too intertwingly'); - } - } - - return UseLogger; -}; - -// ------------------------------------------------------------------------------ -console.log = function () { - if (logger.useConsole()) return; - logger.log.apply(logger, [].slice.call(arguments)); -}; - -// ------------------------------------------------------------------------------ -console.error = function () { - if (logger.useConsole()) return; - logger.error.apply(logger, [].slice.call(arguments)); -}; - -// ------------------------------------------------------------------------------ -console.warn = function () { - if (logger.useConsole()) return; - logger.warn.apply(logger, [].slice.call(arguments)); -}; - -// ------------------------------------------------------------------------------ -console.info = function () { - if (logger.useConsole()) return; - logger.info.apply(logger, [].slice.call(arguments)); -}; - -// ------------------------------------------------------------------------------ -console.debug = function () { - if (logger.useConsole()) return; - logger.debug.apply(logger, [].slice.call(arguments)); -}; - -// ------------------------------------------------------------------------------ -console.assert = function (expression) { - if (expression) return; - - var message = logger.format.apply(logger.format, [].slice.call(arguments, 1)); - console.log('ASSERT: ' + message); -}; - -// ------------------------------------------------------------------------------ -console.clear = function () {}; - -// ------------------------------------------------------------------------------ -console.dir = function (object) { - console.log('%o', object); -}; - -// ------------------------------------------------------------------------------ -console.dirxml = function (node) { - console.log(node.innerHTML); -}; - -// ------------------------------------------------------------------------------ -console.trace = noop; - -// ------------------------------------------------------------------------------ -console.group = console.log; - -// ------------------------------------------------------------------------------ -console.groupCollapsed = console.log; - -// ------------------------------------------------------------------------------ -console.groupEnd = noop; - -// ------------------------------------------------------------------------------ -console.time = function (name) { - Timers[name] = new Date().valueOf(); -}; - -// ------------------------------------------------------------------------------ -console.timeEnd = function (name) { - var timeStart = Timers[name]; - if (!timeStart) { - console.warn('unknown timer: ' + name); - return; - } - - var timeElapsed = new Date().valueOf() - timeStart; - console.log(name + ': ' + timeElapsed + 'ms'); -}; - -// ------------------------------------------------------------------------------ -console.timeStamp = noop; - -// ------------------------------------------------------------------------------ -console.profile = noop; - -// ------------------------------------------------------------------------------ -console.profileEnd = noop; - -// ------------------------------------------------------------------------------ -console.count = noop; - -// ------------------------------------------------------------------------------ -console.exception = console.log; - -// ------------------------------------------------------------------------------ -console.table = function (data, columns) { - console.log('%o', data); -}; - -// ------------------------------------------------------------------------------ -// return a new function that calls both functions passed as args -// ------------------------------------------------------------------------------ -function wrappedOrigCall (orgFunc, newFunc) { - return function () { - var args = [].slice.call(arguments); - try { orgFunc.apply(WinConsole, args); } catch (e) {} - try { newFunc.apply(console, args); } catch (e) {} - }; -} - -// ------------------------------------------------------------------------------ -// For every function that exists in the original console object, that -// also exists in the new console object, wrap the new console method -// with one that calls both -// ------------------------------------------------------------------------------ -for (var key in console) { - if (typeof WinConsole[key] === 'function') { - console[key] = wrappedOrigCall(WinConsole[key], console[key]); - } -} diff --git a/chabok-starter-cordova/node_modules/cordova-ios/cordova-js-src/plugin/ios/logger.js b/chabok-starter-cordova/node_modules/cordova-ios/cordova-js-src/plugin/ios/logger.js deleted file mode 100644 index 7dc82e3..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/cordova-js-src/plugin/ios/logger.js +++ /dev/null @@ -1,349 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -// ------------------------------------------------------------------------------ -// The logger module exports the following properties/functions: -// -// LOG - constant for the level LOG -// ERROR - constant for the level ERROR -// WARN - constant for the level WARN -// INFO - constant for the level INFO -// DEBUG - constant for the level DEBUG -// logLevel() - returns current log level -// logLevel(value) - sets and returns a new log level -// useConsole() - returns whether logger is using console -// useConsole(value) - sets and returns whether logger is using console -// log(message,...) - logs a message at level LOG -// error(message,...) - logs a message at level ERROR -// warn(message,...) - logs a message at level WARN -// info(message,...) - logs a message at level INFO -// debug(message,...) - logs a message at level DEBUG -// logLevel(level,message,...) - logs a message specified level -// -// ------------------------------------------------------------------------------ - -var logger = exports; - -var exec = require('cordova/exec'); - -var UseConsole = false; -var UseLogger = true; -var Queued = []; -var DeviceReady = false; -var CurrentLevel; - -var originalConsole = console; - -/** - * Logging levels - */ - -var Levels = [ - 'LOG', - 'ERROR', - 'WARN', - 'INFO', - 'DEBUG' -]; - -/* - * add the logging levels to the logger object and - * to a separate levelsMap object for testing - */ - -var LevelsMap = {}; -for (var i = 0; i < Levels.length; i++) { - var level = Levels[i]; - LevelsMap[level] = i; - logger[level] = level; -} - -CurrentLevel = LevelsMap.WARN; - -/** - * Getter/Setter for the logging level - * - * Returns the current logging level. - * - * When a value is passed, sets the logging level to that value. - * The values should be one of the following constants: - * logger.LOG - * logger.ERROR - * logger.WARN - * logger.INFO - * logger.DEBUG - * - * The value used determines which messages get printed. The logging - * values above are in order, and only messages logged at the logging - * level or above will actually be displayed to the user. E.g., the - * default level is WARN, so only messages logged with LOG, ERROR, or - * WARN will be displayed; INFO and DEBUG messages will be ignored. - */ -logger.level = function (value) { - if (arguments.length) { - if (LevelsMap[value] === null) { - throw new Error('invalid logging level: ' + value); - } - CurrentLevel = LevelsMap[value]; - } - - return Levels[CurrentLevel]; -}; - -/** - * Getter/Setter for the useConsole functionality - * - * When useConsole is true, the logger will log via the - * browser 'console' object. - */ -logger.useConsole = function (value) { - if (arguments.length) UseConsole = !!value; - - if (UseConsole) { - if (typeof console === 'undefined') { - throw new Error('global console object is not defined'); - } - - if (typeof console.log !== 'function') { - throw new Error('global console object does not have a log function'); - } - - if (typeof console.useLogger === 'function') { - if (console.useLogger()) { - throw new Error('console and logger are too intertwingly'); - } - } - } - - return UseConsole; -}; - -/** - * Getter/Setter for the useLogger functionality - * - * When useLogger is true, the logger will log via the - * native Logger plugin. - */ -logger.useLogger = function (value) { - // Enforce boolean - if (arguments.length) UseLogger = !!value; - return UseLogger; -}; - -/** - * Logs a message at the LOG level. - * - * Parameters passed after message are used applied to - * the message with utils.format() - */ -logger.log = function (message) { logWithArgs('LOG', arguments); }; - -/** - * Logs a message at the ERROR level. - * - * Parameters passed after message are used applied to - * the message with utils.format() - */ -logger.error = function (message) { logWithArgs('ERROR', arguments); }; - -/** - * Logs a message at the WARN level. - * - * Parameters passed after message are used applied to - * the message with utils.format() - */ -logger.warn = function (message) { logWithArgs('WARN', arguments); }; - -/** - * Logs a message at the INFO level. - * - * Parameters passed after message are used applied to - * the message with utils.format() - */ -logger.info = function (message) { logWithArgs('INFO', arguments); }; - -/** - * Logs a message at the DEBUG level. - * - * Parameters passed after message are used applied to - * the message with utils.format() - */ -logger.debug = function (message) { logWithArgs('DEBUG', arguments); }; - -// log at the specified level with args -function logWithArgs (level, args) { - args = [level].concat([].slice.call(args)); - logger.logLevel.apply(logger, args); -} - -// return the correct formatString for an object -function formatStringForMessage (message) { - return (typeof message === 'string') ? '' : '%o'; -} - -/** - * Logs a message at the specified level. - * - * Parameters passed after message are used applied to - * the message with utils.format() - */ -logger.logLevel = function (level /* , ... */) { - // format the message with the parameters - var formatArgs = [].slice.call(arguments, 1); - var fmtString = formatStringForMessage(formatArgs[0]); - if (fmtString.length > 0) { - formatArgs.unshift(fmtString); // add formatString - } - - var message = logger.format.apply(logger.format, formatArgs); - - if (LevelsMap[level] === null) { - throw new Error('invalid logging level: ' + level); - } - - if (LevelsMap[level] > CurrentLevel) return; - - // queue the message if not yet at deviceready - if (!DeviceReady && !UseConsole) { - Queued.push([level, message]); - return; - } - - // Log using the native logger if that is enabled - if (UseLogger) { - exec(null, null, 'Console', 'logLevel', [level, message]); - } - - // Log using the console if that is enabled - if (UseConsole) { - // make sure console is not using logger - if (console.useLogger()) { - throw new Error('console and logger are too intertwingly'); - } - - // log to the console - switch (level) { - case logger.LOG: originalConsole.log(message); break; - case logger.ERROR: originalConsole.log('ERROR: ' + message); break; - case logger.WARN: originalConsole.log('WARN: ' + message); break; - case logger.INFO: originalConsole.log('INFO: ' + message); break; - case logger.DEBUG: originalConsole.log('DEBUG: ' + message); break; - } - } -}; - -/** - * Formats a string and arguments following it ala console.log() - * - * Any remaining arguments will be appended to the formatted string. - * - * for rationale, see FireBug's Console API: - * http://getfirebug.com/wiki/index.php/Console_API - */ -logger.format = function (formatString, args) { - return __format(arguments[0], [].slice.call(arguments, 1)).join(' '); -}; - -// ------------------------------------------------------------------------------ -/** - * Formats a string and arguments following it ala vsprintf() - * - * format chars: - * %j - format arg as JSON - * %o - format arg as JSON - * %c - format arg as '' - * %% - replace with '%' - * any other char following % will format it's - * arg via toString(). - * - * Returns an array containing the formatted string and any remaining - * arguments. - */ -function __format (formatString, args) { - if (formatString === null || formatString === undefined) return ['']; - if (arguments.length === 1) return [formatString.toString()]; - - if (typeof formatString !== 'string') { formatString = formatString.toString(); } - - var pattern = /(.*?)%(.)(.*)/; - var rest = formatString; - var result = []; - - while (args.length) { - var match = pattern.exec(rest); - if (!match) break; - - var arg = args.shift(); - rest = match[3]; - result.push(match[1]); - - if (match[2] === '%') { - result.push('%'); - args.unshift(arg); - continue; - } - - result.push(__formatted(arg, match[2])); - } - - result.push(rest); - - var remainingArgs = [].slice.call(args); - remainingArgs.unshift(result.join('')); - return remainingArgs; -} - -function __formatted (object, formatChar) { - - try { - switch (formatChar) { - case 'j': - case 'o': return JSON.stringify(object); - case 'c': return ''; - } - } catch (e) { - return 'error JSON.stringify()ing argument: ' + e; - } - - if ((object === null) || (object === undefined)) { - return Object.prototype.toString.call(object); - } - - return object.toString(); -} - -// ------------------------------------------------------------------------------ -// when deviceready fires, log queued messages -logger.__onDeviceReady = function () { - if (DeviceReady) return; - - DeviceReady = true; - - for (var i = 0; i < Queued.length; i++) { - var messageArgs = Queued[i]; - logger.logLevel(messageArgs[0], messageArgs[1]); - } - - Queued = null; -}; - -// add a deviceready event to log queued messages -document.addEventListener('deviceready', logger.__onDeviceReady, false); diff --git a/chabok-starter-cordova/node_modules/cordova-ios/guides/API changes in 4.0.md b/chabok-starter-cordova/node_modules/cordova-ios/guides/API changes in 4.0.md deleted file mode 100644 index e18357a..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/guides/API changes in 4.0.md +++ /dev/null @@ -1,329 +0,0 @@ - - -# API Changes in cordova-ios-4.0 - -* CDVViewController.h (_updated_) -* CDVPlugin.h (_updated_) -* CDVPluginResult.h (_updated_) -* NSData+Base64.h (_removed_) -* CDVAppDelegate.h (_new_) -* CDVJSON.h (_removed_) -* CDVJSON\_private.h (_removed_) -* CDVWebViewEngineProtocol.h (_new_) -* CDVURLRequestFilter.h (_new_) -* NSDictionary+CordovaPreferences.h (_new_) -* CDVWebViewDelegate.h (_removed_) -* NSDictionary+Extensions.h (_removed_) -* NSArray+Comparisons.h (_removed_) -* CDVHandleOpenURL.h (_removed_) -* CDVLocalStorage.h (_removed_) -* UIDevice+Extensions.h (_removed_) -* CDVShared.h (_removed_) -* CDVDebug.h (_removed_) -* Conditional Compilation - -- - - - -## CDVViewController.h (_updated_) - - -### Removed: - -Methods: - - + (NSDictionary*)getBundlePlist:(NSString*) - + (NSString*)applicationDocumentsDirectory - - (void)javascriptAlert:(NSString*) - - (void)printMultitaskingInfo - - createGapView - - (BOOL)URLisAllowed:(NSURL*)url - -Properties: - - @property BOOL loadFromString - -### Added: - -Properties: - - @property id webViewEngine - @property NSInteger* userAgentLockToken - -### Modified: - -Methods: - - - (UIView*)newCordovaViewWithFrame:(CGRect)bounds - -Properties: - - @property UIView* webView - -### Upgrade Notes: - -The `webView` property is a `UIView` now, to take into account the different type of WebView engines that might be installed. - -To test and cast the `webView` property to `UIWebView`: - - if ([self.webView isKindOfClass:[UIWebView class]) { - // call a UIWebView specific method here, for example - [((UIWebView*)self.webView) goBack]; - } - -- - - - -## CDVPlugin.h (_updated_) - -### Removed: - -Methods: - - - (CDVPlugin*)initWithWebView:(UIWebView*) - - (NSString*)writeJavascript:(NSString*) - - (NSString*)success:(CDVPluginResult*) callbackId:(NSString*) - - (NSString*)error:(CDVPluginResult*) callbackId:(NSString*) - -Properties: - - @property CDVWhitelist* whitelist - -### Added: - -Methods: - - - (NSURL*)errorURL; - - (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*) navigationType:(UIWebViewNavigationType) - -Properties: - - @property id webViewEngine - - -### Deprecated: - - const CDVLocalNotification - const CDVRemoteNotification - const CDVRemoteNotificationError - -These constants were unfortunately not removed in 4.0, but will be removed in 5.0. Local and remote push notification functionality was removed in the core in 4.0. - -### Modified: - - @property UIView* webView - - -### Optional: - -Methods: - - - (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*) navigationType:(UIWebViewNavigationType) - -### Upgrade Notes: - -Put your initialization code from `initWithWebView` into `pluginInitialize`. `pluginInitialize` is backwards-compatible, it has been there since cordova-ios-2.x. - -For example, if you have this: - - - (CDVPlugin*) initWithWebView:(UIWebView*)webView { - self = [super initWithWebView:webView]; - if (self) { - // Initialization code here - } - return self; - } - - Move your initialization code to: - - - (void) pluginInitialize { - // Initialization code here - } - -- - - - -## CDVPluginResult.h (_updated_) - -### Added: - -Methods: - - + (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsNSInteger:(NSInteger)theMessage; - + (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsNSUInteger:(NSUInteger)theMessage; - - -- - - - -## NSData+Base64.h (_removed_) - -This class has been removed. - -### Removed: - -Methods: - - + (NSData*)dataFromBase64String:(NSString*)aString CDV_DEPRECATED(3.8 .0, "Use cdv_dataFromBase64String"); - - (NSString*)base64EncodedString CDV_DEPRECATED(3.8 .0, "Use [NSData cdv_base64EncodedString]"); - + (NSData*)cdv_dataFromBase64String:(NSString*)aString; - - (NSString*)cdv_base64EncodedString; - -### Upgrade Notes: - -Plugin authors are encouraged to use the (iOS 7+) base64 encoding and decoding methods available in [NSData](https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSData_Class/) instead. - - // Decode a Base64 encoded string - NSData* data = [[NSData alloc] initWithBase64EncodedString:encodedString options:0] - - // Encode a string to Base64 - NSString* encodedString = [data base64EncodedStringWithOptions:0]; - -- - - - -## CDVAppDelegate.h (_new_) - -This class is new. The default template's `AppDelegate` class inherits from this now for you to override. - -### Upgrade Notes: - -Apps that add code in the default template's old `AppDelegate.m` should add the appropriate function override in the new `AppDelegate.m`. Don't forget to call the superclass' implementation as well in your override. - -- - - - -## CDVJSON.h (_removed_) - -These Objective-C Categories have been **removed**. - -### Upgrade Notes: - -To convert from an NSArray/NSDictionary object to a JSON string: - - id object; // this is the NSArray/NSDictionary to convert from - NSError* error = nil; - NSString* jsonString = nil; - NSData* jsonData = [NSJSONSerialization dataWithJSONObject:object - options:NSJSONWritingPrettyPrinted - error:&error]; - - if (error == nil) { - jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; - } - -To convert from an NSString to an NSArray/NSDictionary object: - - NSString* jsonString; // this is the JSON to convert from - NSError* error = nil; - id object = [NSJSONSerialization JSONObjectWithData:[jsonString dataUsingEncoding:NSUTF8StringEncoding] - options:NSJSONReadingMutableContainers - error:&error]; - - if (error != nil) { - NSLog(@"NSString can't be converted to an NSArray/NSDictionary error: %@", [error localizedDescription]); - } - -- - - - -## CDVJSON\_private.h (_removed_) - -These Objective-C Categories have been **removed** from the public API, and is private to CordovaLib. - -- - - - -## CDVWebViewEngineProtocol.h (_new_) - -This is new in cordova-ios-4.0. An Objective-C protocol for plugins to implement, if they want to be an alternative WebView engine. - -- - - - -## NSDictionary+CordovaPreferences.h (_new_) - -This is new in cordova-ios-4.0. An Objective-C Category helper for NSDictionary to get/set preferences. - -- - - - -## CDVWebViewDelegate.h (_removed_) - -This protocol has been **removed** from the public API, and is part of a private plugin to CordovaLib (CDVUIWebViewEngine). - -- - - - -## NSDictionary+Extensions.h (_removed_) - -This Objective-C Category has been **removed**. - -- - - - -## NSArray+Comparisons.h (_removed_) - -This Objective-C category has been **removed**. - -### Upgrade Notes: - -The Objective-C Category method was used as a helper for the `arguments` property of a `CDVInvokedURLCommand` object. Use the `argumentAtIndex` [methods provided](https://github.com/apache/cordova-ios/blob/master/CordovaLib/Classes/Public/CDVInvokedUrlCommand.h) in the `CDVInvokedURLCommand` object instead. - -- - - - -## CDVHandleOpenURL.h (_removed_) - -This plugin has been **removed** from the public API, and is now private to CordovaLib. - -- - - - -## CDVLocalStorage.h (_removed_) - -This plugin has been **removed** from the public API, and is now private to CordovaLib. - -- - - - -## UIDevice+Extensions.h (_removed_) - -This implementation has been **removed** and is part of the core plugin `cordova-plugin-device`. - -- - - - -## CDVShared.h (_removed_) - -This legacy header has been **removed**; it was for core plugin compatibility that has been not been needed [since the Aug 2014 core plugin release](https://cordova.apache.org/news/2014/08/11/plugins-release.html). - -- - - - -## CDVDebug.h (_removed_) - -This file has been **removed** from the public API, and is private to CordovaLib. - -- - - - -## Conditional Compilation - -You can conditionally compile code based on the cordova-ios platform version that is installed. This might be for API calls that have no backwards-compatible equivalents. - - // this import below must be declared first - #import - - #ifdef __CORDOVA_4_0_0 - // Execute/declare code on cordova-ios-4.x or newer - #else - // Execute/declare code for cordova-ios versions *less than* 4.x - #endif - - OR - - #ifndef __CORDOVA_4_0_0 - // Execute/declare code for cordova-ios versions *less than* 4.x - #endif diff --git a/chabok-starter-cordova/node_modules/cordova-ios/guides/Cordova Custom URL Scheme Handling.md b/chabok-starter-cordova/node_modules/cordova-ios/guides/Cordova Custom URL Scheme Handling.md deleted file mode 100644 index 03c114f..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/guides/Cordova Custom URL Scheme Handling.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Cordova Custom URL Scheme Handling # - -For an iOS app, you can add a URL Scheme handler in your app's Info.plist so that your app launches when another iOS app (like Mobile Safari) launches a URL with your custom scheme. - -1. Register your custom scheme in your app's Info.plist: the instructions are [here](http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/AdvancedAppTricks/AdvancedAppTricks.html#//apple_ref/doc/uid/TP40007072-CH7-SW21) -2. In your JavaScript, add a global function **handleOpenURL** which just takes one parameter, which will be a string containing the URL that was launched. Add your code to parse and handle the URL in that global function. This function will be called always if your app was launched from the custom scheme. - - function handleOpenURL(url) { - // TODO: parse the url, and do something - } - - -**IMPORTANT NOTE:** - -You **cannot** launch any interactive features like alerts in the **handleOpenURL** code, if you do, your app will hang. Similarly, you should not call any Cordova APIs in there, unless you wrap it first in a setTimeout call, with a timeout value of zero: - - function handleOpenURL(url) { - // TODO: parse the url, and do something - setTimeout(function() { - // TODO: call some Cordova API here - }, 0); - } diff --git a/chabok-starter-cordova/node_modules/cordova-ios/guides/Setting Delegates, Preferences and Script Message Handlers in the WebView.md b/chabok-starter-cordova/node_modules/cordova-ios/guides/Setting Delegates, Preferences and Script Message Handlers in the WebView.md deleted file mode 100644 index 61e0fd8..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/guides/Setting Delegates, Preferences and Script Message Handlers in the WebView.md +++ /dev/null @@ -1,72 +0,0 @@ - - -# Setting Delegates, Preferences and Script Message Handlers in the WebView - -In cordova-ios-4.0, you would set the delegates of the webview through the `webViewEngine` property of a `CDVPlugin` or your `CDVViewController` subclass. - -There are constants in the [`CDVWebViewEngineProtocol`](https://github.com/apache/cordova-ios/blob/master/CordovaLib/Classes/Public/CDVWebViewEngineProtocol.h#L22-L26) (which a webview-engine implements) that you can use to set the delegates and preferences. These values are the constants to be used when setting delegates or preferences in the UIWebView (default in cordova-ios-4.0) or the WKWebView (through installing the [cordova-plugin-wkwebview-engine](https://github.com/apache/cordova-plugin-wkwebview-engine) plugin). You can set one additional thing in the WKWebView, [script message handlers](https://developer.apple.com/library/ios/documentation/WebKit/Reference/WKScriptMessageHandler_Ref/). - -For example, to set the `UIWebViewDelegate` in your plugin code: - -``` -// your UIWebViewDelegate implementation reference -id< UIWebViewDelegate > myUIWebViewDelegate; - -// set it -[self.webViewEngine updateWithInfo:@{ - kCDVWebViewEngineUIWebViewDelegate : myUIWebViewDelegate -}] -``` - -For example, to set the webview preferences in your plugin code: - -``` -// put the preferences in a dictionary -NSDictionary* preferences = @{ - @"EnableViewPortScale" : @YES, - @"AllowInlineMediaPlayback" : @NO -}; - -[self.webViewEngine updateWithInfo:@{ - kCDVWebViewEngineWebViewPreferences : preferences -}] -``` -If you are using the [cordova-plugin-wkwebview-engine](https://github.com/apache/cordova-plugin-wkwebview-engine) plugin, you can add a [script message handler](https://developer.apple.com/library/ios/documentation/WebKit/Reference/WKScriptMessageHandler_Ref/): -``` -// your WKScriptMessageHandler implementation references -id< WKScriptMessageHandler > foo; -id< WKScriptMessageHandler > bar; - -// put the handlers in a dictionary -NSDictionary* scriptMessageHandlers = @{ - @"foo" : foo, - @"bar" : bar -}; - -[self.webViewEngine updateWithInfo:@{ - kCDVWebViewEngineScriptMessageHandlers : scriptMessageHandlers -}] -``` - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/hooks/pre-commit b/chabok-starter-cordova/node_modules/cordova-ios/hooks/pre-commit deleted file mode 100755 index bcff748..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/hooks/pre-commit +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash - -# 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. -# - -PATH=$PATH:/usr/local/bin:/usr/local/sbin - -# Redirect output to stderr. -exec 1>&2 -test $SKIP_UNCRUSTIFY && exit 0 - -RET=0 -files=$(bin/uncrustify.sh --filter $(git diff --cached --name-only)) -MSGS= -for file in $files; do - if ! bin/uncrustify.sh --check-file $file; then - MSGS="$MSGS - bin/uncrustify.sh \"$file\" && git add \"$file\"" - RET=1 - fi -done - -if [[ $RET = 1 ]]; then - echo "Commit aborted because style fix-ups are required." - echo "Please run:$MSGS" - echo "Alternatively, run \"$PWD/bin/uncrustify.sh --staged\" and then re-stage affected files." -fi - -exit $RET - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/node_modules/.bin/semver b/chabok-starter-cordova/node_modules/cordova-ios/node_modules/.bin/semver deleted file mode 120000 index 5aaadf4..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/node_modules/.bin/semver +++ /dev/null @@ -1 +0,0 @@ -../semver/bin/semver.js \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/cordova-ios/node_modules/semver/CHANGELOG.md b/chabok-starter-cordova/node_modules/cordova-ios/node_modules/semver/CHANGELOG.md deleted file mode 100644 index f567dd3..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/node_modules/semver/CHANGELOG.md +++ /dev/null @@ -1,70 +0,0 @@ -# changes log - -## 6.2.0 - -* Coerce numbers to strings when passed to semver.coerce() -* Add `rtl` option to coerce from right to left - -## 6.1.3 - -* Handle X-ranges properly in includePrerelease mode - -## 6.1.2 - -* Do not throw when testing invalid version strings - -## 6.1.1 - -* Add options support for semver.coerce() -* Handle undefined version passed to Range.test - -## 6.1.0 - -* Add semver.compareBuild function -* Support `*` in semver.intersects - -## 6.0 - -* Fix `intersects` logic. - - This is technically a bug fix, but since it is also a change to behavior - that may require users updating their code, it is marked as a major - version increment. - -## 5.7 - -* Add `minVersion` method - -## 5.6 - -* Move boolean `loose` param to an options object, with - backwards-compatibility protection. -* Add ability to opt out of special prerelease version handling with - the `includePrerelease` option flag. - -## 5.5 - -* Add version coercion capabilities - -## 5.4 - -* Add intersection checking - -## 5.3 - -* Add `minSatisfying` method - -## 5.2 - -* Add `prerelease(v)` that returns prerelease components - -## 5.1 - -* Add Backus-Naur for ranges -* Remove excessively cute inspection methods - -## 5.0 - -* Remove AMD/Browserified build artifacts -* Fix ltr and gtr when using the `*` range -* Fix for range `*` with a prerelease identifier diff --git a/chabok-starter-cordova/node_modules/cordova-ios/node_modules/semver/LICENSE b/chabok-starter-cordova/node_modules/cordova-ios/node_modules/semver/LICENSE deleted file mode 100644 index 19129e3..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/node_modules/semver/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/chabok-starter-cordova/node_modules/cordova-ios/node_modules/semver/README.md b/chabok-starter-cordova/node_modules/cordova-ios/node_modules/semver/README.md deleted file mode 100644 index 2293a14..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/node_modules/semver/README.md +++ /dev/null @@ -1,443 +0,0 @@ -semver(1) -- The semantic versioner for npm -=========================================== - -## Install - -```bash -npm install semver -```` - -## Usage - -As a node module: - -```js -const semver = require('semver') - -semver.valid('1.2.3') // '1.2.3' -semver.valid('a.b.c') // null -semver.clean(' =v1.2.3 ') // '1.2.3' -semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true -semver.gt('1.2.3', '9.8.7') // false -semver.lt('1.2.3', '9.8.7') // true -semver.minVersion('>=1.0.0') // '1.0.0' -semver.valid(semver.coerce('v2')) // '2.0.0' -semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7' -``` - -As a command-line utility: - -``` -$ semver -h - -A JavaScript implementation of the https://semver.org/ specification -Copyright Isaac Z. Schlueter - -Usage: semver [options] [ [...]] -Prints valid versions sorted by SemVer precedence - -Options: --r --range - Print versions that match the specified range. - --i --increment [] - Increment a version by the specified level. Level can - be one of: major, minor, patch, premajor, preminor, - prepatch, or prerelease. Default level is 'patch'. - Only one version may be specified. - ---preid - Identifier to be used to prefix premajor, preminor, - prepatch or prerelease version increments. - --l --loose - Interpret versions and ranges loosely - --p --include-prerelease - Always include prerelease versions in range matching - --c --coerce - Coerce a string into SemVer if possible - (does not imply --loose) - ---rtl - Coerce version strings right to left - ---ltr - Coerce version strings left to right (default) - -Program exits successfully if any valid version satisfies -all supplied ranges, and prints all satisfying versions. - -If no satisfying versions are found, then exits failure. - -Versions are printed in ascending order, so supplying -multiple versions to the utility will just sort them. -``` - -## Versions - -A "version" is described by the `v2.0.0` specification found at -. - -A leading `"="` or `"v"` character is stripped off and ignored. - -## Ranges - -A `version range` is a set of `comparators` which specify versions -that satisfy the range. - -A `comparator` is composed of an `operator` and a `version`. The set -of primitive `operators` is: - -* `<` Less than -* `<=` Less than or equal to -* `>` Greater than -* `>=` Greater than or equal to -* `=` Equal. If no operator is specified, then equality is assumed, - so this operator is optional, but MAY be included. - -For example, the comparator `>=1.2.7` would match the versions -`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` -or `1.1.0`. - -Comparators can be joined by whitespace to form a `comparator set`, -which is satisfied by the **intersection** of all of the comparators -it includes. - -A range is composed of one or more comparator sets, joined by `||`. A -version matches a range if and only if every comparator in at least -one of the `||`-separated comparator sets is satisfied by the version. - -For example, the range `>=1.2.7 <1.3.0` would match the versions -`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, -or `1.1.0`. - -The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, -`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. - -### Prerelease Tags - -If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then -it will only be allowed to satisfy comparator sets if at least one -comparator with the same `[major, minor, patch]` tuple also has a -prerelease tag. - -For example, the range `>1.2.3-alpha.3` would be allowed to match the -version `1.2.3-alpha.7`, but it would *not* be satisfied by -`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater -than" `1.2.3-alpha.3` according to the SemVer sort rules. The version -range only accepts prerelease tags on the `1.2.3` version. The -version `3.4.5` *would* satisfy the range, because it does not have a -prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. - -The purpose for this behavior is twofold. First, prerelease versions -frequently are updated very quickly, and contain many breaking changes -that are (by the author's design) not yet fit for public consumption. -Therefore, by default, they are excluded from range matching -semantics. - -Second, a user who has opted into using a prerelease version has -clearly indicated the intent to use *that specific* set of -alpha/beta/rc versions. By including a prerelease tag in the range, -the user is indicating that they are aware of the risk. However, it -is still not appropriate to assume that they have opted into taking a -similar risk on the *next* set of prerelease versions. - -Note that this behavior can be suppressed (treating all prerelease -versions as if they were normal versions, for the purpose of range -matching) by setting the `includePrerelease` flag on the options -object to any -[functions](https://github.com/npm/node-semver#functions) that do -range matching. - -#### Prerelease Identifiers - -The method `.inc` takes an additional `identifier` string argument that -will append the value of the string as a prerelease identifier: - -```javascript -semver.inc('1.2.3', 'prerelease', 'beta') -// '1.2.4-beta.0' -``` - -command-line example: - -```bash -$ semver 1.2.3 -i prerelease --preid beta -1.2.4-beta.0 -``` - -Which then can be used to increment further: - -```bash -$ semver 1.2.4-beta.0 -i prerelease -1.2.4-beta.1 -``` - -### Advanced Range Syntax - -Advanced range syntax desugars to primitive comparators in -deterministic ways. - -Advanced ranges may be combined in the same way as primitive -comparators using white space or `||`. - -#### Hyphen Ranges `X.Y.Z - A.B.C` - -Specifies an inclusive set. - -* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` - -If a partial version is provided as the first version in the inclusive -range, then the missing pieces are replaced with zeroes. - -* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` - -If a partial version is provided as the second version in the -inclusive range, then all versions that start with the supplied parts -of the tuple are accepted, but nothing that would be greater than the -provided tuple parts. - -* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0` -* `1.2.3 - 2` := `>=1.2.3 <3.0.0` - -#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` - -Any of `X`, `x`, or `*` may be used to "stand in" for one of the -numeric values in the `[major, minor, patch]` tuple. - -* `*` := `>=0.0.0` (Any version satisfies) -* `1.x` := `>=1.0.0 <2.0.0` (Matching major version) -* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions) - -A partial version range is treated as an X-Range, so the special -character is in fact optional. - -* `""` (empty string) := `*` := `>=0.0.0` -* `1` := `1.x.x` := `>=1.0.0 <2.0.0` -* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0` - -#### Tilde Ranges `~1.2.3` `~1.2` `~1` - -Allows patch-level changes if a minor version is specified on the -comparator. Allows minor-level changes if not. - -* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0` -* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`) -* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`) -* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0` -* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`) -* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`) -* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in - the `1.2.3` version will be allowed, if they are greater than or - equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but - `1.2.4-beta.2` would not, because it is a prerelease of a - different `[major, minor, patch]` tuple. - -#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` - -Allows changes that do not modify the left-most non-zero element in the -`[major, minor, patch]` tuple. In other words, this allows patch and -minor updates for versions `1.0.0` and above, patch updates for -versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. - -Many authors treat a `0.x` version as if the `x` were the major -"breaking-change" indicator. - -Caret ranges are ideal when an author may make breaking changes -between `0.2.4` and `0.3.0` releases, which is a common practice. -However, it presumes that there will *not* be breaking changes between -`0.2.4` and `0.2.5`. It allows for changes that are presumed to be -additive (but non-breaking), according to commonly observed practices. - -* `^1.2.3` := `>=1.2.3 <2.0.0` -* `^0.2.3` := `>=0.2.3 <0.3.0` -* `^0.0.3` := `>=0.0.3 <0.0.4` -* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in - the `1.2.3` version will be allowed, if they are greater than or - equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but - `1.2.4-beta.2` would not, because it is a prerelease of a - different `[major, minor, patch]` tuple. -* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the - `0.0.3` version *only* will be allowed, if they are greater than or - equal to `beta`. So, `0.0.3-pr.2` would be allowed. - -When parsing caret ranges, a missing `patch` value desugars to the -number `0`, but will allow flexibility within that value, even if the -major and minor versions are both `0`. - -* `^1.2.x` := `>=1.2.0 <2.0.0` -* `^0.0.x` := `>=0.0.0 <0.1.0` -* `^0.0` := `>=0.0.0 <0.1.0` - -A missing `minor` and `patch` values will desugar to zero, but also -allow flexibility within those values, even if the major version is -zero. - -* `^1.x` := `>=1.0.0 <2.0.0` -* `^0.x` := `>=0.0.0 <1.0.0` - -### Range Grammar - -Putting all this together, here is a Backus-Naur grammar for ranges, -for the benefit of parser authors: - -```bnf -range-set ::= range ( logical-or range ) * -logical-or ::= ( ' ' ) * '||' ( ' ' ) * -range ::= hyphen | simple ( ' ' simple ) * | '' -hyphen ::= partial ' - ' partial -simple ::= primitive | partial | tilde | caret -primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial -partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? -xr ::= 'x' | 'X' | '*' | nr -nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * -tilde ::= '~' partial -caret ::= '^' partial -qualifier ::= ( '-' pre )? ( '+' build )? -pre ::= parts -build ::= parts -parts ::= part ( '.' part ) * -part ::= nr | [-0-9A-Za-z]+ -``` - -## Functions - -All methods and classes take a final `options` object argument. All -options in this object are `false` by default. The options supported -are: - -- `loose` Be more forgiving about not-quite-valid semver strings. - (Any resulting output will always be 100% strict compliant, of - course.) For backwards compatibility reasons, if the `options` - argument is a boolean value instead of an object, it is interpreted - to be the `loose` param. -- `includePrerelease` Set to suppress the [default - behavior](https://github.com/npm/node-semver#prerelease-tags) of - excluding prerelease tagged versions from ranges unless they are - explicitly opted into. - -Strict-mode Comparators and Ranges will be strict about the SemVer -strings that they parse. - -* `valid(v)`: Return the parsed version, or null if it's not valid. -* `inc(v, release)`: Return the version incremented by the release - type (`major`, `premajor`, `minor`, `preminor`, `patch`, - `prepatch`, or `prerelease`), or null if it's not valid - * `premajor` in one call will bump the version up to the next major - version and down to a prerelease of that major version. - `preminor`, and `prepatch` work the same way. - * If called from a non-prerelease version, the `prerelease` will work the - same as `prepatch`. It increments the patch version, then makes a - prerelease. If the input version is already a prerelease it simply - increments it. -* `prerelease(v)`: Returns an array of prerelease components, or null - if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` -* `major(v)`: Return the major version number. -* `minor(v)`: Return the minor version number. -* `patch(v)`: Return the patch version number. -* `intersects(r1, r2, loose)`: Return true if the two supplied ranges - or comparators intersect. -* `parse(v)`: Attempt to parse a string as a semantic version, returning either - a `SemVer` object or `null`. - -### Comparison - -* `gt(v1, v2)`: `v1 > v2` -* `gte(v1, v2)`: `v1 >= v2` -* `lt(v1, v2)`: `v1 < v2` -* `lte(v1, v2)`: `v1 <= v2` -* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent, - even if they're not the exact same string. You already know how to - compare strings. -* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`. -* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call - the corresponding function above. `"==="` and `"!=="` do simple - string comparison, but are included for completeness. Throws if an - invalid comparison string is provided. -* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if - `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. -* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions - in descending order when passed to `Array.sort()`. -* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions - are equal. Sorts in ascending order if passed to `Array.sort()`. - `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. -* `diff(v1, v2)`: Returns difference between two versions by the release type - (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), - or null if the versions are the same. - -### Comparators - -* `intersects(comparator)`: Return true if the comparators intersect - -### Ranges - -* `validRange(range)`: Return the valid range or null if it's not valid -* `satisfies(version, range)`: Return true if the version satisfies the - range. -* `maxSatisfying(versions, range)`: Return the highest version in the list - that satisfies the range, or `null` if none of them do. -* `minSatisfying(versions, range)`: Return the lowest version in the list - that satisfies the range, or `null` if none of them do. -* `minVersion(range)`: Return the lowest version that can possibly match - the given range. -* `gtr(version, range)`: Return `true` if version is greater than all the - versions possible in the range. -* `ltr(version, range)`: Return `true` if version is less than all the - versions possible in the range. -* `outside(version, range, hilo)`: Return true if the version is outside - the bounds of the range in either the high or low direction. The - `hilo` argument must be either the string `'>'` or `'<'`. (This is - the function called by `gtr` and `ltr`.) -* `intersects(range)`: Return true if any of the ranges comparators intersect - -Note that, since ranges may be non-contiguous, a version might not be -greater than a range, less than a range, *or* satisfy a range! For -example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9` -until `2.0.0`, so the version `1.2.10` would not be greater than the -range (because `2.0.1` satisfies, which is higher), nor less than the -range (since `1.2.8` satisfies, which is lower), and it also does not -satisfy the range. - -If you want to know if a version satisfies or does not satisfy a -range, use the `satisfies(version, range)` function. - -### Coercion - -* `coerce(version, options)`: Coerces a string to semver if possible - -This aims to provide a very forgiving translation of a non-semver string to -semver. It looks for the first digit in a string, and consumes all -remaining characters which satisfy at least a partial semver (e.g., `1`, -`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer -versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All -surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes -`3.4.0`). Only text which lacks digits will fail coercion (`version one` -is not valid). The maximum length for any semver component considered for -coercion is 16 characters; longer components will be ignored -(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any -semver component is `Integer.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value -components are invalid (`9999999999999999.4.7.4` is likely invalid). - -If the `options.rtl` flag is set, then `coerce` will return the right-most -coercible tuple that does not share an ending index with a longer coercible -tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not -`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of -any other overlapping SemVer tuple. - -### Clean - -* `clean(version)`: Clean a string to be a valid semver if possible - -This will return a cleaned and trimmed semver version. If the provided version is not valid a null will be returned. This does not work for ranges. - -ex. -* `s.clean(' = v 2.1.5foo')`: `null` -* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'` -* `s.clean(' = v 2.1.5-foo')`: `null` -* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'` -* `s.clean('=v2.1.5')`: `'2.1.5'` -* `s.clean(' =v2.1.5')`: `2.1.5` -* `s.clean(' 2.1.5 ')`: `'2.1.5'` -* `s.clean('~1.0.0')`: `null` diff --git a/chabok-starter-cordova/node_modules/cordova-ios/node_modules/semver/bin/semver.js b/chabok-starter-cordova/node_modules/cordova-ios/node_modules/semver/bin/semver.js deleted file mode 100755 index 666034a..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/node_modules/semver/bin/semver.js +++ /dev/null @@ -1,174 +0,0 @@ -#!/usr/bin/env node -// Standalone semver comparison program. -// Exits successfully and prints matching version(s) if -// any supplied version is valid and passes all tests. - -var argv = process.argv.slice(2) - -var versions = [] - -var range = [] - -var inc = null - -var version = require('../package.json').version - -var loose = false - -var includePrerelease = false - -var coerce = false - -var rtl = false - -var identifier - -var semver = require('../semver') - -var reverse = false - -var options = {} - -main() - -function main () { - if (!argv.length) return help() - while (argv.length) { - var a = argv.shift() - var indexOfEqualSign = a.indexOf('=') - if (indexOfEqualSign !== -1) { - a = a.slice(0, indexOfEqualSign) - argv.unshift(a.slice(indexOfEqualSign + 1)) - } - switch (a) { - case '-rv': case '-rev': case '--rev': case '--reverse': - reverse = true - break - case '-l': case '--loose': - loose = true - break - case '-p': case '--include-prerelease': - includePrerelease = true - break - case '-v': case '--version': - versions.push(argv.shift()) - break - case '-i': case '--inc': case '--increment': - switch (argv[0]) { - case 'major': case 'minor': case 'patch': case 'prerelease': - case 'premajor': case 'preminor': case 'prepatch': - inc = argv.shift() - break - default: - inc = 'patch' - break - } - break - case '--preid': - identifier = argv.shift() - break - case '-r': case '--range': - range.push(argv.shift()) - break - case '-c': case '--coerce': - coerce = true - break - case '--rtl': - rtl = true - break - case '--ltr': - rtl = false - break - case '-h': case '--help': case '-?': - return help() - default: - versions.push(a) - break - } - } - - var options = { loose: loose, includePrerelease: includePrerelease, rtl: rtl } - - versions = versions.map(function (v) { - return coerce ? (semver.coerce(v, options) || { version: v }).version : v - }).filter(function (v) { - return semver.valid(v) - }) - if (!versions.length) return fail() - if (inc && (versions.length !== 1 || range.length)) { return failInc() } - - for (var i = 0, l = range.length; i < l; i++) { - versions = versions.filter(function (v) { - return semver.satisfies(v, range[i], options) - }) - if (!versions.length) return fail() - } - return success(versions) -} - -function failInc () { - console.error('--inc can only be used on a single version with no range') - fail() -} - -function fail () { process.exit(1) } - -function success () { - var compare = reverse ? 'rcompare' : 'compare' - versions.sort(function (a, b) { - return semver[compare](a, b, options) - }).map(function (v) { - return semver.clean(v, options) - }).map(function (v) { - return inc ? semver.inc(v, inc, options, identifier) : v - }).forEach(function (v, i, _) { console.log(v) }) -} - -function help () { - console.log(['SemVer ' + version, - '', - 'A JavaScript implementation of the https://semver.org/ specification', - 'Copyright Isaac Z. Schlueter', - '', - 'Usage: semver [options] [ [...]]', - 'Prints valid versions sorted by SemVer precedence', - '', - 'Options:', - '-r --range ', - ' Print versions that match the specified range.', - '', - '-i --increment []', - ' Increment a version by the specified level. Level can', - ' be one of: major, minor, patch, premajor, preminor,', - " prepatch, or prerelease. Default level is 'patch'.", - ' Only one version may be specified.', - '', - '--preid ', - ' Identifier to be used to prefix premajor, preminor,', - ' prepatch or prerelease version increments.', - '', - '-l --loose', - ' Interpret versions and ranges loosely', - '', - '-p --include-prerelease', - ' Always include prerelease versions in range matching', - '', - '-c --coerce', - ' Coerce a string into SemVer if possible', - ' (does not imply --loose)', - '', - '--rtl', - ' Coerce version strings right to left', - '', - '--ltr', - ' Coerce version strings left to right (default)', - '', - 'Program exits successfully if any valid version satisfies', - 'all supplied ranges, and prints all satisfying versions.', - '', - 'If no satisfying versions are found, then exits failure.', - '', - 'Versions are printed in ascending order, so supplying', - 'multiple versions to the utility will just sort them.' - ].join('\n')) -} diff --git a/chabok-starter-cordova/node_modules/cordova-ios/node_modules/semver/package.json b/chabok-starter-cordova/node_modules/cordova-ios/node_modules/semver/package.json deleted file mode 100644 index d4b4c4b..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/node_modules/semver/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "_from": "semver@^6.3.0", - "_id": "semver@6.3.0", - "_inBundle": false, - "_integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "_location": "/cordova-ios/semver", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "semver@^6.3.0", - "name": "semver", - "escapedName": "semver", - "rawSpec": "^6.3.0", - "saveSpec": null, - "fetchSpec": "^6.3.0" - }, - "_requiredBy": [ - "/cordova-ios" - ], - "_resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "_shasum": "ee0a64c8af5e8ceea67687b133761e1becbd1d3d", - "_spec": "semver@^6.3.0", - "_where": "/Users/farbod/Documents/Github/chabok/chabok-starter-cordova/chabok-starter-cordova/node_modules/cordova-ios", - "bin": { - "semver": "./bin/semver.js" - }, - "bugs": { - "url": "https://github.com/npm/node-semver/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "The semantic version parser used by npm.", - "devDependencies": { - "tap": "^14.3.1" - }, - "files": [ - "bin", - "range.bnf", - "semver.js" - ], - "homepage": "https://github.com/npm/node-semver#readme", - "license": "ISC", - "main": "semver.js", - "name": "semver", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/node-semver.git" - }, - "scripts": { - "postpublish": "git push origin --follow-tags", - "postversion": "npm publish", - "preversion": "npm test", - "test": "tap" - }, - "tap": { - "check-coverage": true - }, - "version": "6.3.0" -} diff --git a/chabok-starter-cordova/node_modules/cordova-ios/node_modules/semver/range.bnf b/chabok-starter-cordova/node_modules/cordova-ios/node_modules/semver/range.bnf deleted file mode 100644 index d4c6ae0..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/node_modules/semver/range.bnf +++ /dev/null @@ -1,16 +0,0 @@ -range-set ::= range ( logical-or range ) * -logical-or ::= ( ' ' ) * '||' ( ' ' ) * -range ::= hyphen | simple ( ' ' simple ) * | '' -hyphen ::= partial ' - ' partial -simple ::= primitive | partial | tilde | caret -primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial -partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? -xr ::= 'x' | 'X' | '*' | nr -nr ::= '0' | [1-9] ( [0-9] ) * -tilde ::= '~' partial -caret ::= '^' partial -qualifier ::= ( '-' pre )? ( '+' build )? -pre ::= parts -build ::= parts -parts ::= part ( '.' part ) * -part ::= nr | [-0-9A-Za-z]+ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/node_modules/semver/semver.js b/chabok-starter-cordova/node_modules/cordova-ios/node_modules/semver/semver.js deleted file mode 100644 index 636fa43..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/node_modules/semver/semver.js +++ /dev/null @@ -1,1596 +0,0 @@ -exports = module.exports = SemVer - -var debug -/* istanbul ignore next */ -if (typeof process === 'object' && - process.env && - process.env.NODE_DEBUG && - /\bsemver\b/i.test(process.env.NODE_DEBUG)) { - debug = function () { - var args = Array.prototype.slice.call(arguments, 0) - args.unshift('SEMVER') - console.log.apply(console, args) - } -} else { - debug = function () {} -} - -// Note: this is the semver.org version of the spec that it implements -// Not necessarily the package version of this code. -exports.SEMVER_SPEC_VERSION = '2.0.0' - -var MAX_LENGTH = 256 -var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || - /* istanbul ignore next */ 9007199254740991 - -// Max safe segment length for coercion. -var MAX_SAFE_COMPONENT_LENGTH = 16 - -// The actual regexps go on exports.re -var re = exports.re = [] -var src = exports.src = [] -var t = exports.tokens = {} -var R = 0 - -function tok (n) { - t[n] = R++ -} - -// The following Regular Expressions can be used for tokenizing, -// validating, and parsing SemVer version strings. - -// ## Numeric Identifier -// A single `0`, or a non-zero digit followed by zero or more digits. - -tok('NUMERICIDENTIFIER') -src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*' -tok('NUMERICIDENTIFIERLOOSE') -src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+' - -// ## Non-numeric Identifier -// Zero or more digits, followed by a letter or hyphen, and then zero or -// more letters, digits, or hyphens. - -tok('NONNUMERICIDENTIFIER') -src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*' - -// ## Main Version -// Three dot-separated numeric identifiers. - -tok('MAINVERSION') -src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + - '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + - '(' + src[t.NUMERICIDENTIFIER] + ')' - -tok('MAINVERSIONLOOSE') -src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')' - -// ## Pre-release Version Identifier -// A numeric identifier, or a non-numeric identifier. - -tok('PRERELEASEIDENTIFIER') -src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] + - '|' + src[t.NONNUMERICIDENTIFIER] + ')' - -tok('PRERELEASEIDENTIFIERLOOSE') -src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] + - '|' + src[t.NONNUMERICIDENTIFIER] + ')' - -// ## Pre-release Version -// Hyphen, followed by one or more dot-separated pre-release version -// identifiers. - -tok('PRERELEASE') -src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] + - '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))' - -tok('PRERELEASELOOSE') -src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] + - '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))' - -// ## Build Metadata Identifier -// Any combination of digits, letters, or hyphens. - -tok('BUILDIDENTIFIER') -src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+' - -// ## Build Metadata -// Plus sign, followed by one or more period-separated build metadata -// identifiers. - -tok('BUILD') -src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] + - '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))' - -// ## Full Version String -// A main version, followed optionally by a pre-release version and -// build metadata. - -// Note that the only major, minor, patch, and pre-release sections of -// the version string are capturing groups. The build metadata is not a -// capturing group, because it should not ever be used in version -// comparison. - -tok('FULL') -tok('FULLPLAIN') -src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] + - src[t.PRERELEASE] + '?' + - src[t.BUILD] + '?' - -src[t.FULL] = '^' + src[t.FULLPLAIN] + '$' - -// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. -// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty -// common in the npm registry. -tok('LOOSEPLAIN') -src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] + - src[t.PRERELEASELOOSE] + '?' + - src[t.BUILD] + '?' - -tok('LOOSE') -src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$' - -tok('GTLT') -src[t.GTLT] = '((?:<|>)?=?)' - -// Something like "2.*" or "1.2.x". -// Note that "x.x" is a valid xRange identifer, meaning "any version" -// Only the first item is strictly required. -tok('XRANGEIDENTIFIERLOOSE') -src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*' -tok('XRANGEIDENTIFIER') -src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*' - -tok('XRANGEPLAIN') -src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + - '(?:' + src[t.PRERELEASE] + ')?' + - src[t.BUILD] + '?' + - ')?)?' - -tok('XRANGEPLAINLOOSE') -src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + - '(?:' + src[t.PRERELEASELOOSE] + ')?' + - src[t.BUILD] + '?' + - ')?)?' - -tok('XRANGE') -src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$' -tok('XRANGELOOSE') -src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$' - -// Coercion. -// Extract anything that could conceivably be a part of a valid semver -tok('COERCE') -src[t.COERCE] = '(^|[^\\d])' + - '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + - '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + - '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + - '(?:$|[^\\d])' -tok('COERCERTL') -re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g') - -// Tilde ranges. -// Meaning is "reasonably at or greater than" -tok('LONETILDE') -src[t.LONETILDE] = '(?:~>?)' - -tok('TILDETRIM') -src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+' -re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g') -var tildeTrimReplace = '$1~' - -tok('TILDE') -src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$' -tok('TILDELOOSE') -src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$' - -// Caret ranges. -// Meaning is "at least and backwards compatible with" -tok('LONECARET') -src[t.LONECARET] = '(?:\\^)' - -tok('CARETTRIM') -src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+' -re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g') -var caretTrimReplace = '$1^' - -tok('CARET') -src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$' -tok('CARETLOOSE') -src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$' - -// A simple gt/lt/eq thing, or just "" to indicate "any version" -tok('COMPARATORLOOSE') -src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$' -tok('COMPARATOR') -src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$' - -// An expression to strip any whitespace between the gtlt and the thing -// it modifies, so that `> 1.2.3` ==> `>1.2.3` -tok('COMPARATORTRIM') -src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] + - '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')' - -// this one has to use the /g flag -re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g') -var comparatorTrimReplace = '$1$2$3' - -// Something like `1.2.3 - 1.2.4` -// Note that these all use the loose form, because they'll be -// checked against either the strict or loose comparator form -// later. -tok('HYPHENRANGE') -src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' + - '\\s+-\\s+' + - '(' + src[t.XRANGEPLAIN] + ')' + - '\\s*$' - -tok('HYPHENRANGELOOSE') -src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' + - '\\s+-\\s+' + - '(' + src[t.XRANGEPLAINLOOSE] + ')' + - '\\s*$' - -// Star ranges basically just allow anything at all. -tok('STAR') -src[t.STAR] = '(<|>)?=?\\s*\\*' - -// Compile to actual regexp objects. -// All are flag-free, unless they were created above with a flag. -for (var i = 0; i < R; i++) { - debug(i, src[i]) - if (!re[i]) { - re[i] = new RegExp(src[i]) - } -} - -exports.parse = parse -function parse (version, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } - - if (version instanceof SemVer) { - return version - } - - if (typeof version !== 'string') { - return null - } - - if (version.length > MAX_LENGTH) { - return null - } - - var r = options.loose ? re[t.LOOSE] : re[t.FULL] - if (!r.test(version)) { - return null - } - - try { - return new SemVer(version, options) - } catch (er) { - return null - } -} - -exports.valid = valid -function valid (version, options) { - var v = parse(version, options) - return v ? v.version : null -} - -exports.clean = clean -function clean (version, options) { - var s = parse(version.trim().replace(/^[=v]+/, ''), options) - return s ? s.version : null -} - -exports.SemVer = SemVer - -function SemVer (version, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } - if (version instanceof SemVer) { - if (version.loose === options.loose) { - return version - } else { - version = version.version - } - } else if (typeof version !== 'string') { - throw new TypeError('Invalid Version: ' + version) - } - - if (version.length > MAX_LENGTH) { - throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') - } - - if (!(this instanceof SemVer)) { - return new SemVer(version, options) - } - - debug('SemVer', version, options) - this.options = options - this.loose = !!options.loose - - var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) - - if (!m) { - throw new TypeError('Invalid Version: ' + version) - } - - this.raw = version - - // these are actually numbers - this.major = +m[1] - this.minor = +m[2] - this.patch = +m[3] - - if (this.major > MAX_SAFE_INTEGER || this.major < 0) { - throw new TypeError('Invalid major version') - } - - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError('Invalid minor version') - } - - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError('Invalid patch version') - } - - // numberify any prerelease numeric ids - if (!m[4]) { - this.prerelease = [] - } else { - this.prerelease = m[4].split('.').map(function (id) { - if (/^[0-9]+$/.test(id)) { - var num = +id - if (num >= 0 && num < MAX_SAFE_INTEGER) { - return num - } - } - return id - }) - } - - this.build = m[5] ? m[5].split('.') : [] - this.format() -} - -SemVer.prototype.format = function () { - this.version = this.major + '.' + this.minor + '.' + this.patch - if (this.prerelease.length) { - this.version += '-' + this.prerelease.join('.') - } - return this.version -} - -SemVer.prototype.toString = function () { - return this.version -} - -SemVer.prototype.compare = function (other) { - debug('SemVer.compare', this.version, this.options, other) - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - return this.compareMain(other) || this.comparePre(other) -} - -SemVer.prototype.compareMain = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - return compareIdentifiers(this.major, other.major) || - compareIdentifiers(this.minor, other.minor) || - compareIdentifiers(this.patch, other.patch) -} - -SemVer.prototype.comparePre = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - // NOT having a prerelease is > having one - if (this.prerelease.length && !other.prerelease.length) { - return -1 - } else if (!this.prerelease.length && other.prerelease.length) { - return 1 - } else if (!this.prerelease.length && !other.prerelease.length) { - return 0 - } - - var i = 0 - do { - var a = this.prerelease[i] - var b = other.prerelease[i] - debug('prerelease compare', i, a, b) - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) - } - } while (++i) -} - -SemVer.prototype.compareBuild = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - var i = 0 - do { - var a = this.build[i] - var b = other.build[i] - debug('prerelease compare', i, a, b) - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) - } - } while (++i) -} - -// preminor will bump the version up to the next minor release, and immediately -// down to pre-release. premajor and prepatch work the same way. -SemVer.prototype.inc = function (release, identifier) { - switch (release) { - case 'premajor': - this.prerelease.length = 0 - this.patch = 0 - this.minor = 0 - this.major++ - this.inc('pre', identifier) - break - case 'preminor': - this.prerelease.length = 0 - this.patch = 0 - this.minor++ - this.inc('pre', identifier) - break - case 'prepatch': - // If this is already a prerelease, it will bump to the next version - // drop any prereleases that might already exist, since they are not - // relevant at this point. - this.prerelease.length = 0 - this.inc('patch', identifier) - this.inc('pre', identifier) - break - // If the input is a non-prerelease version, this acts the same as - // prepatch. - case 'prerelease': - if (this.prerelease.length === 0) { - this.inc('patch', identifier) - } - this.inc('pre', identifier) - break - - case 'major': - // If this is a pre-major version, bump up to the same major version. - // Otherwise increment major. - // 1.0.0-5 bumps to 1.0.0 - // 1.1.0 bumps to 2.0.0 - if (this.minor !== 0 || - this.patch !== 0 || - this.prerelease.length === 0) { - this.major++ - } - this.minor = 0 - this.patch = 0 - this.prerelease = [] - break - case 'minor': - // If this is a pre-minor version, bump up to the same minor version. - // Otherwise increment minor. - // 1.2.0-5 bumps to 1.2.0 - // 1.2.1 bumps to 1.3.0 - if (this.patch !== 0 || this.prerelease.length === 0) { - this.minor++ - } - this.patch = 0 - this.prerelease = [] - break - case 'patch': - // If this is not a pre-release version, it will increment the patch. - // If it is a pre-release it will bump up to the same patch version. - // 1.2.0-5 patches to 1.2.0 - // 1.2.0 patches to 1.2.1 - if (this.prerelease.length === 0) { - this.patch++ - } - this.prerelease = [] - break - // This probably shouldn't be used publicly. - // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. - case 'pre': - if (this.prerelease.length === 0) { - this.prerelease = [0] - } else { - var i = this.prerelease.length - while (--i >= 0) { - if (typeof this.prerelease[i] === 'number') { - this.prerelease[i]++ - i = -2 - } - } - if (i === -1) { - // didn't increment anything - this.prerelease.push(0) - } - } - if (identifier) { - // 1.2.0-beta.1 bumps to 1.2.0-beta.2, - // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 - if (this.prerelease[0] === identifier) { - if (isNaN(this.prerelease[1])) { - this.prerelease = [identifier, 0] - } - } else { - this.prerelease = [identifier, 0] - } - } - break - - default: - throw new Error('invalid increment argument: ' + release) - } - this.format() - this.raw = this.version - return this -} - -exports.inc = inc -function inc (version, release, loose, identifier) { - if (typeof (loose) === 'string') { - identifier = loose - loose = undefined - } - - try { - return new SemVer(version, loose).inc(release, identifier).version - } catch (er) { - return null - } -} - -exports.diff = diff -function diff (version1, version2) { - if (eq(version1, version2)) { - return null - } else { - var v1 = parse(version1) - var v2 = parse(version2) - var prefix = '' - if (v1.prerelease.length || v2.prerelease.length) { - prefix = 'pre' - var defaultResult = 'prerelease' - } - for (var key in v1) { - if (key === 'major' || key === 'minor' || key === 'patch') { - if (v1[key] !== v2[key]) { - return prefix + key - } - } - } - return defaultResult // may be undefined - } -} - -exports.compareIdentifiers = compareIdentifiers - -var numeric = /^[0-9]+$/ -function compareIdentifiers (a, b) { - var anum = numeric.test(a) - var bnum = numeric.test(b) - - if (anum && bnum) { - a = +a - b = +b - } - - return a === b ? 0 - : (anum && !bnum) ? -1 - : (bnum && !anum) ? 1 - : a < b ? -1 - : 1 -} - -exports.rcompareIdentifiers = rcompareIdentifiers -function rcompareIdentifiers (a, b) { - return compareIdentifiers(b, a) -} - -exports.major = major -function major (a, loose) { - return new SemVer(a, loose).major -} - -exports.minor = minor -function minor (a, loose) { - return new SemVer(a, loose).minor -} - -exports.patch = patch -function patch (a, loose) { - return new SemVer(a, loose).patch -} - -exports.compare = compare -function compare (a, b, loose) { - return new SemVer(a, loose).compare(new SemVer(b, loose)) -} - -exports.compareLoose = compareLoose -function compareLoose (a, b) { - return compare(a, b, true) -} - -exports.compareBuild = compareBuild -function compareBuild (a, b, loose) { - var versionA = new SemVer(a, loose) - var versionB = new SemVer(b, loose) - return versionA.compare(versionB) || versionA.compareBuild(versionB) -} - -exports.rcompare = rcompare -function rcompare (a, b, loose) { - return compare(b, a, loose) -} - -exports.sort = sort -function sort (list, loose) { - return list.sort(function (a, b) { - return exports.compareBuild(a, b, loose) - }) -} - -exports.rsort = rsort -function rsort (list, loose) { - return list.sort(function (a, b) { - return exports.compareBuild(b, a, loose) - }) -} - -exports.gt = gt -function gt (a, b, loose) { - return compare(a, b, loose) > 0 -} - -exports.lt = lt -function lt (a, b, loose) { - return compare(a, b, loose) < 0 -} - -exports.eq = eq -function eq (a, b, loose) { - return compare(a, b, loose) === 0 -} - -exports.neq = neq -function neq (a, b, loose) { - return compare(a, b, loose) !== 0 -} - -exports.gte = gte -function gte (a, b, loose) { - return compare(a, b, loose) >= 0 -} - -exports.lte = lte -function lte (a, b, loose) { - return compare(a, b, loose) <= 0 -} - -exports.cmp = cmp -function cmp (a, op, b, loose) { - switch (op) { - case '===': - if (typeof a === 'object') - a = a.version - if (typeof b === 'object') - b = b.version - return a === b - - case '!==': - if (typeof a === 'object') - a = a.version - if (typeof b === 'object') - b = b.version - return a !== b - - case '': - case '=': - case '==': - return eq(a, b, loose) - - case '!=': - return neq(a, b, loose) - - case '>': - return gt(a, b, loose) - - case '>=': - return gte(a, b, loose) - - case '<': - return lt(a, b, loose) - - case '<=': - return lte(a, b, loose) - - default: - throw new TypeError('Invalid operator: ' + op) - } -} - -exports.Comparator = Comparator -function Comparator (comp, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } - - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp - } else { - comp = comp.value - } - } - - if (!(this instanceof Comparator)) { - return new Comparator(comp, options) - } - - debug('comparator', comp, options) - this.options = options - this.loose = !!options.loose - this.parse(comp) - - if (this.semver === ANY) { - this.value = '' - } else { - this.value = this.operator + this.semver.version - } - - debug('comp', this) -} - -var ANY = {} -Comparator.prototype.parse = function (comp) { - var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] - var m = comp.match(r) - - if (!m) { - throw new TypeError('Invalid comparator: ' + comp) - } - - this.operator = m[1] !== undefined ? m[1] : '' - if (this.operator === '=') { - this.operator = '' - } - - // if it literally is just '>' or '' then allow anything. - if (!m[2]) { - this.semver = ANY - } else { - this.semver = new SemVer(m[2], this.options.loose) - } -} - -Comparator.prototype.toString = function () { - return this.value -} - -Comparator.prototype.test = function (version) { - debug('Comparator.test', version, this.options.loose) - - if (this.semver === ANY || version === ANY) { - return true - } - - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options) - } catch (er) { - return false - } - } - - return cmp(version, this.operator, this.semver, this.options) -} - -Comparator.prototype.intersects = function (comp, options) { - if (!(comp instanceof Comparator)) { - throw new TypeError('a Comparator is required') - } - - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } - - var rangeTmp - - if (this.operator === '') { - if (this.value === '') { - return true - } - rangeTmp = new Range(comp.value, options) - return satisfies(this.value, rangeTmp, options) - } else if (comp.operator === '') { - if (comp.value === '') { - return true - } - rangeTmp = new Range(this.value, options) - return satisfies(comp.semver, rangeTmp, options) - } - - var sameDirectionIncreasing = - (this.operator === '>=' || this.operator === '>') && - (comp.operator === '>=' || comp.operator === '>') - var sameDirectionDecreasing = - (this.operator === '<=' || this.operator === '<') && - (comp.operator === '<=' || comp.operator === '<') - var sameSemVer = this.semver.version === comp.semver.version - var differentDirectionsInclusive = - (this.operator === '>=' || this.operator === '<=') && - (comp.operator === '>=' || comp.operator === '<=') - var oppositeDirectionsLessThan = - cmp(this.semver, '<', comp.semver, options) && - ((this.operator === '>=' || this.operator === '>') && - (comp.operator === '<=' || comp.operator === '<')) - var oppositeDirectionsGreaterThan = - cmp(this.semver, '>', comp.semver, options) && - ((this.operator === '<=' || this.operator === '<') && - (comp.operator === '>=' || comp.operator === '>')) - - return sameDirectionIncreasing || sameDirectionDecreasing || - (sameSemVer && differentDirectionsInclusive) || - oppositeDirectionsLessThan || oppositeDirectionsGreaterThan -} - -exports.Range = Range -function Range (range, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } - - if (range instanceof Range) { - if (range.loose === !!options.loose && - range.includePrerelease === !!options.includePrerelease) { - return range - } else { - return new Range(range.raw, options) - } - } - - if (range instanceof Comparator) { - return new Range(range.value, options) - } - - if (!(this instanceof Range)) { - return new Range(range, options) - } - - this.options = options - this.loose = !!options.loose - this.includePrerelease = !!options.includePrerelease - - // First, split based on boolean or || - this.raw = range - this.set = range.split(/\s*\|\|\s*/).map(function (range) { - return this.parseRange(range.trim()) - }, this).filter(function (c) { - // throw out any that are not relevant for whatever reason - return c.length - }) - - if (!this.set.length) { - throw new TypeError('Invalid SemVer Range: ' + range) - } - - this.format() -} - -Range.prototype.format = function () { - this.range = this.set.map(function (comps) { - return comps.join(' ').trim() - }).join('||').trim() - return this.range -} - -Range.prototype.toString = function () { - return this.range -} - -Range.prototype.parseRange = function (range) { - var loose = this.options.loose - range = range.trim() - // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] - range = range.replace(hr, hyphenReplace) - debug('hyphen replace', range) - // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) - debug('comparator trim', range, re[t.COMPARATORTRIM]) - - // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[t.TILDETRIM], tildeTrimReplace) - - // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[t.CARETTRIM], caretTrimReplace) - - // normalize spaces - range = range.split(/\s+/).join(' ') - - // At this point, the range is completely trimmed and - // ready to be split into comparators. - - var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] - var set = range.split(' ').map(function (comp) { - return parseComparator(comp, this.options) - }, this).join(' ').split(/\s+/) - if (this.options.loose) { - // in loose mode, throw out any that are not valid comparators - set = set.filter(function (comp) { - return !!comp.match(compRe) - }) - } - set = set.map(function (comp) { - return new Comparator(comp, this.options) - }, this) - - return set -} - -Range.prototype.intersects = function (range, options) { - if (!(range instanceof Range)) { - throw new TypeError('a Range is required') - } - - return this.set.some(function (thisComparators) { - return ( - isSatisfiable(thisComparators, options) && - range.set.some(function (rangeComparators) { - return ( - isSatisfiable(rangeComparators, options) && - thisComparators.every(function (thisComparator) { - return rangeComparators.every(function (rangeComparator) { - return thisComparator.intersects(rangeComparator, options) - }) - }) - ) - }) - ) - }) -} - -// take a set of comparators and determine whether there -// exists a version which can satisfy it -function isSatisfiable (comparators, options) { - var result = true - var remainingComparators = comparators.slice() - var testComparator = remainingComparators.pop() - - while (result && remainingComparators.length) { - result = remainingComparators.every(function (otherComparator) { - return testComparator.intersects(otherComparator, options) - }) - - testComparator = remainingComparators.pop() - } - - return result -} - -// Mostly just for testing and legacy API reasons -exports.toComparators = toComparators -function toComparators (range, options) { - return new Range(range, options).set.map(function (comp) { - return comp.map(function (c) { - return c.value - }).join(' ').trim().split(' ') - }) -} - -// comprised of xranges, tildes, stars, and gtlt's at this point. -// already replaced the hyphen ranges -// turn into a set of JUST comparators. -function parseComparator (comp, options) { - debug('comp', comp, options) - comp = replaceCarets(comp, options) - debug('caret', comp) - comp = replaceTildes(comp, options) - debug('tildes', comp) - comp = replaceXRanges(comp, options) - debug('xrange', comp) - comp = replaceStars(comp, options) - debug('stars', comp) - return comp -} - -function isX (id) { - return !id || id.toLowerCase() === 'x' || id === '*' -} - -// ~, ~> --> * (any, kinda silly) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 -function replaceTildes (comp, options) { - return comp.trim().split(/\s+/).map(function (comp) { - return replaceTilde(comp, options) - }).join(' ') -} - -function replaceTilde (comp, options) { - var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] - return comp.replace(r, function (_, M, m, p, pr) { - debug('tilde', comp, _, M, m, p, pr) - var ret - - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' - } else if (isX(p)) { - // ~1.2 == >=1.2.0 <1.3.0 - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' - } else if (pr) { - debug('replaceTilde pr', pr) - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + M + '.' + (+m + 1) + '.0' - } else { - // ~1.2.3 == >=1.2.3 <1.3.0 - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0' - } - - debug('tilde return', ret) - return ret - }) -} - -// ^ --> * (any, kinda silly) -// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 -// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 -// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 -// ^1.2.3 --> >=1.2.3 <2.0.0 -// ^1.2.0 --> >=1.2.0 <2.0.0 -function replaceCarets (comp, options) { - return comp.trim().split(/\s+/).map(function (comp) { - return replaceCaret(comp, options) - }).join(' ') -} - -function replaceCaret (comp, options) { - debug('caret', comp, options) - var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] - return comp.replace(r, function (_, M, m, p, pr) { - debug('caret', comp, _, M, m, p, pr) - var ret - - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' - } else if (isX(p)) { - if (M === '0') { - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' - } else { - ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0' - } - } else if (pr) { - debug('replaceCaret pr', pr) - if (M === '0') { - if (m === '0') { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + M + '.' + m + '.' + (+p + 1) - } else { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + M + '.' + (+m + 1) + '.0' - } - } else { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + (+M + 1) + '.0.0' - } - } else { - debug('no pr') - if (M === '0') { - if (m === '0') { - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + m + '.' + (+p + 1) - } else { - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0' - } - } else { - ret = '>=' + M + '.' + m + '.' + p + - ' <' + (+M + 1) + '.0.0' - } - } - - debug('caret return', ret) - return ret - }) -} - -function replaceXRanges (comp, options) { - debug('replaceXRanges', comp, options) - return comp.split(/\s+/).map(function (comp) { - return replaceXRange(comp, options) - }).join(' ') -} - -function replaceXRange (comp, options) { - comp = comp.trim() - var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] - return comp.replace(r, function (ret, gtlt, M, m, p, pr) { - debug('xRange', comp, ret, gtlt, M, m, p, pr) - var xM = isX(M) - var xm = xM || isX(m) - var xp = xm || isX(p) - var anyX = xp - - if (gtlt === '=' && anyX) { - gtlt = '' - } - - // if we're including prereleases in the match, then we need - // to fix this to -0, the lowest possible prerelease value - pr = options.includePrerelease ? '-0' : '' - - if (xM) { - if (gtlt === '>' || gtlt === '<') { - // nothing is allowed - ret = '<0.0.0-0' - } else { - // nothing is forbidden - ret = '*' - } - } else if (gtlt && anyX) { - // we know patch is an x, because we have any x at all. - // replace X with 0 - if (xm) { - m = 0 - } - p = 0 - - if (gtlt === '>') { - // >1 => >=2.0.0 - // >1.2 => >=1.3.0 - // >1.2.3 => >= 1.2.4 - gtlt = '>=' - if (xm) { - M = +M + 1 - m = 0 - p = 0 - } else { - m = +m + 1 - p = 0 - } - } else if (gtlt === '<=') { - // <=0.7.x is actually <0.8.0, since any 0.7.x should - // pass. Similarly, <=7.x is actually <8.0.0, etc. - gtlt = '<' - if (xm) { - M = +M + 1 - } else { - m = +m + 1 - } - } - - ret = gtlt + M + '.' + m + '.' + p + pr - } else if (xm) { - ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr - } else if (xp) { - ret = '>=' + M + '.' + m + '.0' + pr + - ' <' + M + '.' + (+m + 1) + '.0' + pr - } - - debug('xRange return', ret) - - return ret - }) -} - -// Because * is AND-ed with everything else in the comparator, -// and '' means "any version", just remove the *s entirely. -function replaceStars (comp, options) { - debug('replaceStars', comp, options) - // Looseness is ignored here. star is always as loose as it gets! - return comp.trim().replace(re[t.STAR], '') -} - -// This function is passed to string.replace(re[t.HYPHENRANGE]) -// M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0 <3.5.0 -function hyphenReplace ($0, - from, fM, fm, fp, fpr, fb, - to, tM, tm, tp, tpr, tb) { - if (isX(fM)) { - from = '' - } else if (isX(fm)) { - from = '>=' + fM + '.0.0' - } else if (isX(fp)) { - from = '>=' + fM + '.' + fm + '.0' - } else { - from = '>=' + from - } - - if (isX(tM)) { - to = '' - } else if (isX(tm)) { - to = '<' + (+tM + 1) + '.0.0' - } else if (isX(tp)) { - to = '<' + tM + '.' + (+tm + 1) + '.0' - } else if (tpr) { - to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr - } else { - to = '<=' + to - } - - return (from + ' ' + to).trim() -} - -// if ANY of the sets match ALL of its comparators, then pass -Range.prototype.test = function (version) { - if (!version) { - return false - } - - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options) - } catch (er) { - return false - } - } - - for (var i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version, this.options)) { - return true - } - } - return false -} - -function testSet (set, version, options) { - for (var i = 0; i < set.length; i++) { - if (!set[i].test(version)) { - return false - } - } - - if (version.prerelease.length && !options.includePrerelease) { - // Find the set of versions that are allowed to have prereleases - // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 - // That should allow `1.2.3-pr.2` to pass. - // However, `1.2.4-alpha.notready` should NOT be allowed, - // even though it's within the range set by the comparators. - for (i = 0; i < set.length; i++) { - debug(set[i].semver) - if (set[i].semver === ANY) { - continue - } - - if (set[i].semver.prerelease.length > 0) { - var allowed = set[i].semver - if (allowed.major === version.major && - allowed.minor === version.minor && - allowed.patch === version.patch) { - return true - } - } - } - - // Version has a -pre, but it's not one of the ones we like. - return false - } - - return true -} - -exports.satisfies = satisfies -function satisfies (version, range, options) { - try { - range = new Range(range, options) - } catch (er) { - return false - } - return range.test(version) -} - -exports.maxSatisfying = maxSatisfying -function maxSatisfying (versions, range, options) { - var max = null - var maxSV = null - try { - var rangeObj = new Range(range, options) - } catch (er) { - return null - } - versions.forEach(function (v) { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!max || maxSV.compare(v) === -1) { - // compare(max, v, true) - max = v - maxSV = new SemVer(max, options) - } - } - }) - return max -} - -exports.minSatisfying = minSatisfying -function minSatisfying (versions, range, options) { - var min = null - var minSV = null - try { - var rangeObj = new Range(range, options) - } catch (er) { - return null - } - versions.forEach(function (v) { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!min || minSV.compare(v) === 1) { - // compare(min, v, true) - min = v - minSV = new SemVer(min, options) - } - } - }) - return min -} - -exports.minVersion = minVersion -function minVersion (range, loose) { - range = new Range(range, loose) - - var minver = new SemVer('0.0.0') - if (range.test(minver)) { - return minver - } - - minver = new SemVer('0.0.0-0') - if (range.test(minver)) { - return minver - } - - minver = null - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i] - - comparators.forEach(function (comparator) { - // Clone to avoid manipulating the comparator's semver object. - var compver = new SemVer(comparator.semver.version) - switch (comparator.operator) { - case '>': - if (compver.prerelease.length === 0) { - compver.patch++ - } else { - compver.prerelease.push(0) - } - compver.raw = compver.format() - /* fallthrough */ - case '': - case '>=': - if (!minver || gt(minver, compver)) { - minver = compver - } - break - case '<': - case '<=': - /* Ignore maximum versions */ - break - /* istanbul ignore next */ - default: - throw new Error('Unexpected operation: ' + comparator.operator) - } - }) - } - - if (minver && range.test(minver)) { - return minver - } - - return null -} - -exports.validRange = validRange -function validRange (range, options) { - try { - // Return '*' instead of '' so that truthiness works. - // This will throw if it's invalid anyway - return new Range(range, options).range || '*' - } catch (er) { - return null - } -} - -// Determine if version is less than all the versions possible in the range -exports.ltr = ltr -function ltr (version, range, options) { - return outside(version, range, '<', options) -} - -// Determine if version is greater than all the versions possible in the range. -exports.gtr = gtr -function gtr (version, range, options) { - return outside(version, range, '>', options) -} - -exports.outside = outside -function outside (version, range, hilo, options) { - version = new SemVer(version, options) - range = new Range(range, options) - - var gtfn, ltefn, ltfn, comp, ecomp - switch (hilo) { - case '>': - gtfn = gt - ltefn = lte - ltfn = lt - comp = '>' - ecomp = '>=' - break - case '<': - gtfn = lt - ltefn = gte - ltfn = gt - comp = '<' - ecomp = '<=' - break - default: - throw new TypeError('Must provide a hilo val of "<" or ">"') - } - - // If it satisifes the range it is not outside - if (satisfies(version, range, options)) { - return false - } - - // From now on, variable terms are as if we're in "gtr" mode. - // but note that everything is flipped for the "ltr" function. - - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i] - - var high = null - var low = null - - comparators.forEach(function (comparator) { - if (comparator.semver === ANY) { - comparator = new Comparator('>=0.0.0') - } - high = high || comparator - low = low || comparator - if (gtfn(comparator.semver, high.semver, options)) { - high = comparator - } else if (ltfn(comparator.semver, low.semver, options)) { - low = comparator - } - }) - - // If the edge version comparator has a operator then our version - // isn't outside it - if (high.operator === comp || high.operator === ecomp) { - return false - } - - // If the lowest version comparator has an operator and our version - // is less than it then it isn't higher than the range - if ((!low.operator || low.operator === comp) && - ltefn(version, low.semver)) { - return false - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false - } - } - return true -} - -exports.prerelease = prerelease -function prerelease (version, options) { - var parsed = parse(version, options) - return (parsed && parsed.prerelease.length) ? parsed.prerelease : null -} - -exports.intersects = intersects -function intersects (r1, r2, options) { - r1 = new Range(r1, options) - r2 = new Range(r2, options) - return r1.intersects(r2) -} - -exports.coerce = coerce -function coerce (version, options) { - if (version instanceof SemVer) { - return version - } - - if (typeof version === 'number') { - version = String(version) - } - - if (typeof version !== 'string') { - return null - } - - options = options || {} - - var match = null - if (!options.rtl) { - match = version.match(re[t.COERCE]) - } else { - // Find the right-most coercible string that does not share - // a terminus with a more left-ward coercible string. - // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' - // - // Walk through the string checking with a /g regexp - // Manually set the index so as to pick up overlapping matches. - // Stop when we get a match that ends at the string end, since no - // coercible string can be more right-ward without the same terminus. - var next - while ((next = re[t.COERCERTL].exec(version)) && - (!match || match.index + match[0].length !== version.length) - ) { - if (!match || - next.index + next[0].length !== match.index + match[0].length) { - match = next - } - re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length - } - // leave it in a clean state - re[t.COERCERTL].lastIndex = -1 - } - - if (match === null) { - return null - } - - return parse(match[2] + - '.' + (match[3] || '0') + - '.' + (match[4] || '0'), options) -} diff --git a/chabok-starter-cordova/node_modules/cordova-ios/package.json b/chabok-starter-cordova/node_modules/cordova-ios/package.json deleted file mode 100644 index f88cbbb..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/package.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "_from": "cordova-ios@^5.0.0", - "_id": "cordova-ios@5.1.1", - "_inBundle": false, - "_integrity": "sha512-asZMCj44JMe/PMrDIRC97GStPCH+GpaMNVe8hdmu8WWXJzMzRNRRJ339YYU89jitWf9ZKMdyBgrnSnQi5bJ/ZQ==", - "_location": "/cordova-ios", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "cordova-ios@^5.0.0", - "name": "cordova-ios", - "escapedName": "cordova-ios", - "rawSpec": "^5.0.0", - "saveSpec": null, - "fetchSpec": "^5.0.0" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/cordova-ios/-/cordova-ios-5.1.1.tgz", - "_shasum": "31b8a8e5a45bc604e46dab60fa25faf50543356f", - "_spec": "cordova-ios@^5.0.0", - "_where": "/Users/farbod/Documents/Github/chabok/chabok-starter-cordova/chabok-starter-cordova", - "author": { - "name": "Apache Software Foundation" - }, - "bugs": { - "url": "https://github.com/apache/cordova-ios/issues" - }, - "bundleDependencies": false, - "dependencies": { - "cordova-common": "^3.1.0", - "ios-sim": "^8.0.1", - "nopt": "^4.0.1", - "plist": "^3.0.1", - "q": "^1.5.1", - "semver": "^6.3.0", - "shelljs": "^0.5.3", - "unorm": "^1.4.1", - "xcode": "^2.0.0", - "xml-escape": "^1.1.0" - }, - "deprecated": false, - "description": "cordova-ios release", - "devDependencies": { - "eslint": "^5.12.0", - "eslint-config-semistandard": "^13.0.0", - "eslint-config-standard": "^12.0.0", - "eslint-plugin-import": "^2.14.0", - "eslint-plugin-node": "^8.0.1", - "eslint-plugin-promise": "^4.0.1", - "eslint-plugin-standard": "^4.0.0", - "jasmine": "^3.4.0", - "nyc": "^14.0.0", - "rewire": "^4.0.1", - "tmp": "^0.1.0" - }, - "engines": { - "node": ">=6" - }, - "homepage": "https://github.com/apache/cordova-ios#readme", - "keywords": [ - "ios", - "cordova", - "apache", - "ecosystem:cordova", - "cordova:platform" - ], - "license": "Apache-2.0", - "main": "bin/templates/scripts/cordova/Api.js", - "name": "cordova-ios", - "nyc": { - "include": [ - "bin/templates/scripts/**" - ], - "reporter": [ - "lcov", - "text" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/apache/cordova-ios.git" - }, - "scripts": { - "cover": "nyc jasmine --config=tests/spec/coverage.json", - "e2e-tests": "jasmine tests/spec/create.spec.js", - "eslint": "eslint . \"bin/**/!(*.*)\"", - "objc-tests": "npm run objc-tests-lib && npm run objc-tests-framework", - "objc-tests-framework": "npm run xcodebuild -- -scheme CordovaFrameworkApp", - "objc-tests-lib": "npm run xcodebuild -- -scheme CordovaLibTests", - "posttest": "npm run eslint", - "preobjc-tests": "tests/scripts/killsim.js", - "test": "npm run unit-tests && npm run test:component && npm run objc-tests && npm run e2e-tests", - "test:component": "jasmine --config=tests/spec/component.json", - "unit-tests": "jasmine --config=tests/spec/unit.json", - "xcodebuild": "xcodebuild -quiet test -workspace tests/cordova-ios.xcworkspace -destination \"platform=iOS Simulator,name=iPhone 8\" CONFIGURATION_BUILD_DIR=\"`mktemp -d 2>/dev/null || mktemp -d -t 'cordova-ios'`\"" - }, - "version": "5.1.1" -} diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVBase64Tests.m b/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVBase64Tests.m deleted file mode 100644 index d4647f5..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVBase64Tests.m +++ /dev/null @@ -1,62 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import - -@interface CDVBase64Tests : XCTestCase -@end - -@implementation CDVBase64Tests - -- (void)setUp -{ - [super setUp]; - - // setup code here -} - -- (void)tearDown -{ - // Tear-down code here. - - [super tearDown]; -} - -- (void)testBase64Encode -{ - NSString* decodedString = @"abcdefghijklmnopqrstuvwxyz1234567890!@#$%^&"; - NSData* decodedData = [decodedString dataUsingEncoding:NSUTF8StringEncoding]; - - NSString* expectedEncodedString = @"YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXoxMjM0NTY3ODkwIUAjJCVeJg=="; - NSString* actualEncodedString = [decodedData base64EncodedStringWithOptions:0]; - - XCTAssertTrue([expectedEncodedString isEqualToString:actualEncodedString]); -} - -- (void)testBase64Decode -{ - NSString* encodedString = @"YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXoxMjM0NTY3ODkwIUAjJCVeJg=="; - NSString* decodedString = @"abcdefghijklmnopqrstuvwxyz1234567890!@#$%^&"; - NSData* encodedData = [decodedString dataUsingEncoding:NSUTF8StringEncoding]; - NSData* decodedData = [[NSData alloc] initWithBase64EncodedString:encodedString options:0]; - - XCTAssertTrue([encodedData isEqualToData:decodedData]); -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVCommandDelegateTests.m b/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVCommandDelegateTests.m deleted file mode 100644 index 85768a9..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVCommandDelegateTests.m +++ /dev/null @@ -1,57 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import -#import - -@interface CDVCommandDelegateTests : XCTestCase - -@end - -@interface CDVCommandDelegateImpl () - -// expose private interface -- (BOOL)isValidCallbackId:(NSString*)callbackId; - -@end - -@implementation CDVCommandDelegateTests - -- (void)setUp -{ - [super setUp]; - // Put setup code here. This method is called before the invocation of each test method in the class. -} - -- (void)tearDown -{ - // Put teardown code here. This method is called after the invocation of each test method in the class. - [super tearDown]; -} - -- (void)testNullCallbackId -{ - CDVCommandDelegateImpl* impl = [[CDVCommandDelegateImpl alloc] initWithViewController:nil]; - - NSString* callbackId = nil; - - XCTAssertFalse([impl isValidCallbackId:callbackId], @"A nil callbackId should be not valid"); -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVFakeFileManager.h b/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVFakeFileManager.h deleted file mode 100644 index f9300a0..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVFakeFileManager.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import - -typedef BOOL (^ CDVFileExistsBlock)(NSString*); - -// Used in place of an NSFileManager for unit tests. It implements only those functions -// which are required by the tests that use it. -@interface CDVFakeFileManager : NSObject { - @private - CDVFileExistsBlock _fileExistsBlock; -} - -- (id)initWithFileExistsBlock:(CDVFileExistsBlock)fileExistsBlock; -+ (id)managerWithFileExistsBlock:(CDVFileExistsBlock)fileExistsBlock; - -- (BOOL)fileExistsAtPath:(NSString*)path; -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVFakeFileManager.m b/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVFakeFileManager.m deleted file mode 100644 index 50ecd43..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVFakeFileManager.m +++ /dev/null @@ -1,43 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "CDVFakeFileManager.h" - -@implementation CDVFakeFileManager - -- (id)initWithFileExistsBlock:(CDVFileExistsBlock)fileExistsBlock -{ - self = [super init]; - if (self != nil) { - _fileExistsBlock = [fileExistsBlock copy]; - } - return self; -} - -+ (id)managerWithFileExistsBlock:(CDVFileExistsBlock)fileExistsBlock -{ - return [[CDVFakeFileManager alloc] initWithFileExistsBlock:fileExistsBlock]; -} - -- (BOOL)fileExistsAtPath:(NSString*)path -{ - return _fileExistsBlock(path); -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVInvokedUrlCommandTests.m b/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVInvokedUrlCommandTests.m deleted file mode 100644 index 424ad1c..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVInvokedUrlCommandTests.m +++ /dev/null @@ -1,51 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import - -#import - -@interface CDVInvokedUrlCommandTests : XCTestCase -@end - -@implementation CDVInvokedUrlCommandTests - -- (void)testInitWithNoArgs -{ - NSArray* jsonArr = [NSArray arrayWithObjects:@"callbackId", @"className", @"methodName", [NSArray array], nil]; - CDVInvokedUrlCommand* command = [CDVInvokedUrlCommand commandFromJson:jsonArr]; - - XCTAssertEqual(@"callbackId", command.callbackId); - XCTAssertEqual(@"className", command.className); - XCTAssertEqual(@"methodName", command.methodName); - XCTAssertEqual([NSArray array], command.arguments); -} - -- (void)testArgumentAtIndex -{ - NSArray* jsonArr = [NSArray arrayWithObjects:[NSNull null], @"className", @"methodName", [NSArray array], nil]; - CDVInvokedUrlCommand* command = [CDVInvokedUrlCommand commandFromJson:jsonArr]; - - XCTAssertNil([command argumentAtIndex:0], @"NSNull to nil"); - XCTAssertNil([command argumentAtIndex:100], @"Invalid index to nil"); - XCTAssertEqual(@"default", [command argumentAtIndex:0 withDefault:@"default"], @"NSNull to default"); - XCTAssertEqual(@"default", [command argumentAtIndex:100 withDefault:@"default"], @"Invalid index to default"); -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVLocalStorageTests.m b/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVLocalStorageTests.m deleted file mode 100644 index 3a95f88..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVLocalStorageTests.m +++ /dev/null @@ -1,146 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import - -#import "CDVLocalStorage.h" -#import "CDVWebViewTest.h" -#import "CDVFakeFileManager.h" -#import "ViewController.h" - -@interface CDVLocalStorageTests : CDVWebViewTest - // Deletes LocalStorage files from disk. -- (void)deleteOriginals:(BOOL)originals backups:(BOOL)backups; -// Returns the CDVLocalStorage instance from the plugins dict. -- (CDVLocalStorage*)localStorage; -@end - -@implementation CDVLocalStorageTests - -- (void)setUp -{ - [super setUp]; - // Clear these on setUp as well in case they were left around. - [self deleteOriginals:YES backups:YES]; -} - -- (void)tearDown -{ - // Don't leave any localStorage files around. - [self deleteOriginals:YES backups:YES]; - [super tearDown]; -} - -- (CDVLocalStorage*)localStorage -{ - return [self pluginInstance:@"LocalStorage"]; -} - -- (void)deleteOriginals:(BOOL)originals backups:(BOOL)backups -{ - NSFileManager* fileManager = [NSFileManager defaultManager]; - - for (CDVBackupInfo* info in [self localStorage].backupInfo) { - if (originals) { - [fileManager removeItemAtPath:info.original error:nil]; - } - if (backups) { - [fileManager removeItemAtPath:info.backup error:nil]; - } - } -} - -- (void)disabled_testBackupAndRestore -{ - CDVLocalStorage* localStorage = [self localStorage]; - - [self waitForConditionName:@"shouldBackup" block:^{ - [self evalJs:@"localStorage.setItem('foo', 'bar')"]; - return [localStorage shouldBackup]; - }]; - [localStorage backup:[CDVInvokedUrlCommand new]]; - XCTAssertFalse([localStorage shouldBackup], @"Should have backed up."); - - // It would be nice to be able to test that the restore functionality - // alters what localStorage.getItem('foo') returns, but it seems as though - // the WebView maintains an in-memory cache of what's in LocalStorage even - // after we delete the underlying files and recreate the view. - - // Instead, we just test the file copying logic. - [self deleteOriginals:YES backups:NO]; - XCTAssertTrue([localStorage shouldRestore], @"Should restore after deleting originals"); - [localStorage restore:[CDVInvokedUrlCommand new]]; - XCTAssertFalse([localStorage shouldRestore], @"Restore did not complete successfully"); -} - -- (void)testVerifyAndFixDatabaseLocations_noChangeRequired -{ - NSString* const kBundlePath = @"/bpath"; - id fakeFileManager = [CDVFakeFileManager managerWithFileExistsBlock:^(NSString* path) { - XCTFail(@"fileExists called."); - return NO; - }]; - NSMutableDictionary* appPlistDict = [NSMutableDictionary dictionaryWithObjectsAndKeys: - @"/bpath/foo", @"WebKitLocalStorageDatabasePathPreferenceKey", - @"/bpath/foo", @"WebDatabaseDirectory", - nil]; - BOOL modified = [CDVLocalStorage __verifyAndFixDatabaseLocationsWithAppPlistDict:appPlistDict - bundlePath:kBundlePath - fileManager:fakeFileManager]; - - XCTAssertFalse(modified, @"Should not have applied fix."); -} - -- (void)testVerifyAndFixDatabaseLocations_changeRequired1 -{ - NSString* const kBundlePath = @"/bpath"; - id fakeFileManager = [CDVFakeFileManager managerWithFileExistsBlock:^(NSString* path) { - return YES; - }]; - NSMutableDictionary* appPlistDict = [NSMutableDictionary dictionaryWithObjectsAndKeys: - @"/foo", @"WebKitLocalStorageDatabasePathPreferenceKey", - nil]; - BOOL modified = [CDVLocalStorage __verifyAndFixDatabaseLocationsWithAppPlistDict:appPlistDict - bundlePath:kBundlePath - fileManager:fakeFileManager]; - - XCTAssertTrue(modified, @"Should have applied fix."); - NSString* newPath = [appPlistDict objectForKey:@"WebKitLocalStorageDatabasePathPreferenceKey"]; - XCTAssertTrue([@"/bpath/Library/Caches" isEqualToString:newPath]); -} - -- (void)testVerifyAndFixDatabaseLocations_changeRequired2 -{ - NSString* const kBundlePath = @"/bpath"; - id fakeFileManager = [CDVFakeFileManager managerWithFileExistsBlock:^(NSString* path) { - return NO; - }]; - NSMutableDictionary* appPlistDict = [NSMutableDictionary dictionaryWithObjectsAndKeys: - @"/foo", @"WebDatabaseDirectory", - nil]; - BOOL modified = [CDVLocalStorage __verifyAndFixDatabaseLocationsWithAppPlistDict:appPlistDict - bundlePath:kBundlePath - fileManager:fakeFileManager]; - - XCTAssertTrue(modified, @"Should have applied fix."); - NSString* newPath = [appPlistDict objectForKey:@"WebDatabaseDirectory"]; - XCTAssertTrue([@"/bpath/Library/WebKit" isEqualToString:newPath]); -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVPluginResultJSONSerializationTests.m b/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVPluginResultJSONSerializationTests.m deleted file mode 100644 index dacb196..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVPluginResultJSONSerializationTests.m +++ /dev/null @@ -1,160 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import -#import - -#import -#import "CDVJSON_private.h" - -@interface CDVPluginResultJSONSerializationTests : XCTestCase -@end - -@implementation CDVPluginResultJSONSerializationTests - -- (void)testSerializingMessageAsInt -{ - int val = 5; - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:val]; - - XCTAssertTrue([[NSNumber numberWithInt:val] isEqual:[[result argumentsAsJSON] cdv_JSONFragment]]); -} - -- (void)testSerializingMessageAsNSNumber -{ - NSInteger val = 5; - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsNSInteger:val]; - - XCTAssertTrue([[NSNumber numberWithInteger:val] isEqual:[[result argumentsAsJSON] cdv_JSONFragment]]); -} - -- (void)testSerializingMessageAsNSUNumber -{ - NSUInteger val = 5; - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsNSUInteger:val]; - - XCTAssertTrue([[NSNumber numberWithUnsignedInteger:val] isEqual:[[result argumentsAsJSON] cdv_JSONFragment]]); -} - -- (void)testSerializingMessageAsDouble -{ - double val = 5.5; - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDouble:val]; - - XCTAssertTrue([[NSNumber numberWithDouble:val] isEqual:[[result argumentsAsJSON] cdv_JSONFragment]]); -} - -- (void)testSerializingMessageAsBool -{ - BOOL val = YES; - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:val]; - - XCTAssertTrue([[NSNumber numberWithBool:val] isEqual:[[result argumentsAsJSON] cdv_JSONFragment]]); -} - -- (void)testSerializingMessageAsArray -{ - NSArray* testValues = [NSArray arrayWithObjects: - [NSNull null], - @"string", - [NSNumber numberWithInt:5], - [NSNumber numberWithDouble:5.5], - [NSNumber numberWithBool:true], - nil]; - - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray:testValues]; - NSArray* arr = [[result argumentsAsJSON] cdv_JSONObject]; - - XCTAssertTrue([arr isKindOfClass:[NSArray class]]); - XCTAssertTrue([testValues count] == [arr count]); - - for (NSInteger i = 0; i < [testValues count]; i++) { - XCTAssertTrue([[testValues objectAtIndex:i] isEqual:[arr objectAtIndex:i]]); - } -} - -- (void)__testDictionary:(NSDictionary*)dictA withDictionary:(NSDictionary*)dictB -{ - XCTAssertTrue([dictA isKindOfClass:[NSDictionary class]]); - XCTAssertTrue([dictB isKindOfClass:[NSDictionary class]]); - - XCTAssertTrue([[dictA allKeys] count] == [[dictB allKeys] count]); - - for (NSInteger i = 0; i < [dictA count]; i++) { - id keyA = [[dictA allKeys] objectAtIndex:i]; - id objA = [dictA objectForKey:keyA]; - id objB = [dictB objectForKey:keyA]; - - XCTAssertTrue([[dictB allKeys] containsObject:keyA]); // key exists - if ([objA isKindOfClass:[NSDictionary class]]) { - [self __testDictionary:objA withDictionary:objB]; - } else { - XCTAssertTrue([objA isEqual:objB]); // key's value equality - } - } -} - -- (void)testSerializingMessageAsDictionary -{ - NSMutableDictionary* testValues = [NSMutableDictionary dictionaryWithObjectsAndKeys: - [NSNull null], @"nullItem", - @"string", @"stringItem", - [NSNumber numberWithInt:5], @"intItem", - [NSNumber numberWithDouble:5.5], @"doubleItem", - [NSNumber numberWithBool:true], @"boolItem", - nil]; - - NSDictionary* nestedDict = [testValues copy]; - - [testValues setValue:nestedDict forKey:@"nestedDict"]; - - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:testValues]; - NSDictionary* dic = [[result argumentsAsJSON] cdv_JSONObject]; - - [self __testDictionary:testValues withDictionary:dic]; -} - -- (void)testSerializingMessageAsErrorCode -{ - NSMutableDictionary* testValues = [NSMutableDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithInt:1], @"code", - nil]; - - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageToErrorObject:1]; - - [self __testDictionary:testValues withDictionary:[[result argumentsAsJSON] cdv_JSONObject]]; -} - -- (void)testSerializingMessageAsStringContainingQuotes -{ - NSString* quotedString = @"\"quoted\""; - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:quotedString]; - - XCTAssertTrue([quotedString isEqualToString:[[result argumentsAsJSON] cdv_JSONFragment]]); -} - -- (void)testSerializingMessageAsStringThatIsNil -{ - NSString* nilString = nil; - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:nilString]; - - XCTAssertTrue([[NSNull null] isEqual:[[result argumentsAsJSON] cdv_JSONFragment]]); -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVStartPageTests.m b/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVStartPageTests.m deleted file mode 100644 index 5f72d88..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVStartPageTests.m +++ /dev/null @@ -1,127 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import - -#import "CDVWebViewTest.h" -#import -#import "AppDelegate.h" - -@interface CDVStartPageTestViewController : UIViewController -@property (strong, nonatomic) CDVViewController* vc1; -@property (strong, nonatomic) CDVViewController* vc2; -@end - -@implementation CDVStartPageTestViewController -@synthesize vc1 = _vc1, vc2 = _vc2; - -- (void)loadView -{ - _vc1 = [[CDVViewController alloc] init]; - _vc1.wwwFolderName = @"www"; - _vc1.startPage = @"index.html"; - [self addChildViewController:_vc1]; - - _vc2 = [[CDVViewController alloc] init]; - _vc2.wwwFolderName = @"www"; - _vc2.startPage = @"index.html?delta=true"; - [self addChildViewController:_vc2]; - - CGRect applicationFrame = [[UIScreen mainScreen] applicationFrame]; - UIView* contentView = [[UIView alloc] initWithFrame:applicationFrame]; - - CGRect sub1, sub2; - CGRectDivide(applicationFrame, &sub1, &sub2, applicationFrame.size.height / 2, CGRectMinYEdge); - [_vc1.view setBounds:sub1]; - [_vc2.view setBounds:sub2]; - - [contentView addSubview:_vc1.view]; - [contentView addSubview:_vc2.view]; - - self.view = contentView; -} - -@end - -@interface CDVStartPageTest : CDVWebViewTest -@end - -@implementation CDVStartPageTest - -- (void)setUp -{ - [super setUp]; -} - -- (void)tearDown -{ - [super tearDown]; -} - -- (void)testParametersInStartPage -{ - XCTestExpectation* expectation1 = [self expectationWithDescription:@"href should point to index.html"]; - - XCTestExpectation* expectation2 = [self expectationWithDescription:@"href should point to index.html?delta=true"]; - - CDVStartPageTestViewController* rootVc = [[CDVStartPageTestViewController alloc] init]; - - self.appDelegate.window.rootViewController = rootVc; - - id vc1WebViewEngine = rootVc.vc1.webViewEngine; - id vc2WebViewEngine = rootVc.vc2.webViewEngine; - - NSString* geHREF = @"window.location.href"; - [self waitForConditionName:@"getting href" block:^{ - NSURL* vc1URL = vc1WebViewEngine.URL; - NSURL* vc2URL = vc2WebViewEngine.URL; - - return - (BOOL)( - (vc1URL != nil && ![[vc1URL absoluteString] isEqualToString:@"about:blank"] && ![[vc1URL absoluteString] isEqualToString:@""]) && - (vc2URL != nil && ![[vc2URL absoluteString] isEqualToString:@"about:blank"] && ![[vc2URL absoluteString] isEqualToString:@""]) - ); - }]; - - [vc1WebViewEngine evaluateJavaScript:geHREF completionHandler:^(NSString* href, NSError* error) { - if (error) { - NSLog(@"error is: %@", error); - } else { - XCTAssertTrue([href hasSuffix:@"index.html"], @"href should point to index.html"); - [expectation1 fulfill]; - } - }]; - - [vc2WebViewEngine evaluateJavaScript:geHREF completionHandler:^(NSString* href, NSError* error) { - if (error) { - NSLog(@"error is: %@", error); - } else { - XCTAssertTrue([href hasSuffix:@"index.html?delta=true"], @"href should point to index.html?delta=true"); - [expectation2 fulfill]; - } - }]; - - [self waitForExpectationsWithTimeout:5.0 handler:^(NSError* error) { - if (error) { - XCTFail(@"Expectation Failed with error: %@", error); - } - }]; -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVUserAgentTest.m b/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVUserAgentTest.m deleted file mode 100644 index d97ae47..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVUserAgentTest.m +++ /dev/null @@ -1,181 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import - -#import "CDVWebViewTest.h" -#import -#import -#import "AppDelegate.h" - -@interface CDVUserAgentTestViewController : UIViewController -@property (nonatomic) CDVViewController* vc1; -@property (nonatomic) CDVViewController* vc2; -@end - -@implementation CDVUserAgentTestViewController -@synthesize vc1 = _vc1, vc2 = _vc2; - -- (id)init -{ - self = [super init]; - if (self) { - _vc1 = [[CDVViewController alloc] init]; - _vc2 = [[CDVViewController alloc] init]; - } - return self; -} - -- (void)loadView -{ - _vc1.wwwFolderName = @"www"; - _vc1.startPage = @"index.html"; - [self addChildViewController:_vc1]; - - _vc2.wwwFolderName = @"www"; - _vc2.startPage = @"index.html"; - [self addChildViewController:_vc2]; - - CGRect applicationFrame = [[UIScreen mainScreen] applicationFrame]; - UIView* contentView = [[UIView alloc] initWithFrame:applicationFrame]; - - CGRect sub1, sub2; - CGRectDivide(applicationFrame, &sub1, &sub2, applicationFrame.size.height / 2, CGRectMinYEdge); - [_vc1.view setBounds:sub1]; - [_vc2.view setBounds:sub2]; - - [contentView addSubview:_vc1.view]; - [contentView addSubview:_vc2.view]; - - self.view = contentView; -} - -@end - -@interface CDVUserAgentTest : CDVWebViewTest -@end - -@implementation CDVUserAgentTest - -- (void)setUp -{ - [super setUp]; -} - -- (void)tearDown -{ - [super tearDown]; -} - -- (void)testDefaultUserAgent -{ - CDVUserAgentTestViewController* rootVc = [[CDVUserAgentTestViewController alloc] init]; - - self.appDelegate.window.rootViewController = rootVc; - - // These tests only work on a UIWebView, which is the default web engine - - UIWebView* vc1WebView = (UIWebView*)rootVc.vc1.webView; - UIWebView* vc2WebView = (UIWebView*)rootVc.vc2.webView; - - // sanity check - if (![vc1WebView isKindOfClass:[UIWebView class]] && ![vc2WebView isKindOfClass:[UIWebView class]]) { - return; - } - - NSString* getWebUserAgent = @"navigator.userAgent"; - [self waitForConditionName:@"getting user-agents" block:^BOOL { - return vc1WebView.request != nil && vc2WebView.request != nil; - }]; - NSString* webUserAgent = [vc1WebView stringByEvaluatingJavaScriptFromString:getWebUserAgent]; - NSString* cordovaUserAgent = rootVc.vc1.userAgent; - - XCTAssertTrue([cordovaUserAgent hasPrefix:webUserAgent], @"Default Cordova user agent should be based on navigator.userAgent."); -} - -- (void)testMultipleViews -{ - CDVUserAgentTestViewController* rootVc = [[CDVUserAgentTestViewController alloc] init]; - - self.appDelegate.window.rootViewController = rootVc; - - UIWebView* vc1WebView = (UIWebView*)rootVc.vc1.webView; - UIWebView* vc2WebView = (UIWebView*)rootVc.vc2.webView; - - // sanity check - if (![vc1WebView isKindOfClass:[UIWebView class]] && ![vc2WebView isKindOfClass:[UIWebView class]]) { - return; - } - - NSString* getUserAgentCode = @"navigator.userAgent"; - [self waitForConditionName:@"getting user-agents" block:^BOOL { - return vc1WebView.request != nil && vc2WebView.request != nil; - }]; - NSString* ua1 = [vc1WebView stringByEvaluatingJavaScriptFromString:getUserAgentCode]; - NSString* ua2 = [vc2WebView stringByEvaluatingJavaScriptFromString:getUserAgentCode]; - - XCTAssertTrue([ua1 isEqual:ua2], @"User-Agents should be different."); -} - -- (void)testBaseUserAgent -{ - CDVUserAgentTestViewController* rootVc = [[CDVUserAgentTestViewController alloc] init]; - - rootVc.vc1.baseUserAgent = @"A different baseline user agent 1"; - rootVc.vc2.baseUserAgent = @"A different baseline user agent 2"; - - self.appDelegate.window.rootViewController = rootVc; - - UIWebView* vc1WebView = (UIWebView*)rootVc.vc1.webView; - UIWebView* vc2WebView = (UIWebView*)rootVc.vc2.webView; - - // sanity check - if (![vc1WebView isKindOfClass:[UIWebView class]] && ![vc2WebView isKindOfClass:[UIWebView class]]) { - return; - } - - [self waitForConditionName:@"getting user-agents" block:^BOOL { - return vc1WebView.request != nil && vc2WebView.request != nil; - }]; - NSString* cordovaUserAgent1 = rootVc.vc1.userAgent; - NSString* cordovaUserAgent2 = rootVc.vc2.userAgent; - - XCTAssertTrue([cordovaUserAgent1 hasPrefix:rootVc.vc1.baseUserAgent], @"Cordova user agent should be based on base user agent."); - XCTAssertTrue([cordovaUserAgent2 hasPrefix:rootVc.vc2.baseUserAgent], @"Cordova user agent should be based on base user agent."); -} - -- (void)testUserAgentReleaseLock -{ - __block NSInteger myLockToken; - - [CDVUserAgentUtil acquireLock:^(NSInteger lockToken) { - myLockToken = lockToken; - [CDVUserAgentUtil releaseLock:&myLockToken]; - - NSInteger nullInteger = 0; - // test releasing NULL token - [CDVUserAgentUtil releaseLock:&nullInteger]; - NSInteger* ni = nil; - // test releasing nil object - [CDVUserAgentUtil releaseLock:ni]; - }]; -} - - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVViewControllerTest.m b/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVViewControllerTest.m deleted file mode 100644 index 9e13a88..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVViewControllerTest.m +++ /dev/null @@ -1,123 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import -#import - -#define CDVViewControllerTestSettingKey @"test_cdvconfigfile" -#define CDVViewControllerTestSettingValueDefault @"config.xml" -#define CDVViewControllerTestSettingValueCustom @"config-custom.xml" - -@interface CDVViewControllerTest : XCTestCase - -@end - -@interface CDVViewController () - -// expose private interface -- (bool)checkAndReinitViewUrl; -- (bool)isUrlEmpty:(NSURL*)url; - -@end - -@implementation CDVViewControllerTest - --(CDVViewController*)viewController{ - CDVViewController* viewController = [CDVViewController new]; - return viewController; -} - --(void)doTestInitWithConfigFile:(NSString*)configFile expectedSettingValue:(NSString*)value{ - // Create a CDVViewController - CDVViewController* viewController = [self viewController]; - if(configFile){ - // Set custom config file - viewController.configFile = configFile; - }else{ - // Do not specify config file ==> fallback to default config.xml - } - - // Trigger -viewDidLoad - [viewController view]; - - // Assert that the proper file was actually loaded, checking the value of a test setting it must contain - NSString* settingValue = [viewController.settings objectForKey:CDVViewControllerTestSettingKey]; - XCTAssertEqualObjects(settingValue, value); -} - --(void)testInitWithDefaultConfigFile{ - [self doTestInitWithConfigFile:nil expectedSettingValue:CDVViewControllerTestSettingValueDefault]; -} - --(void)testInitWithCustomConfigFileAbsolutePath{ - NSString* configFileAbsolutePath = [[NSBundle mainBundle] pathForResource:@"config-custom" ofType:@"xml"]; - [self doTestInitWithConfigFile:configFileAbsolutePath expectedSettingValue:CDVViewControllerTestSettingValueCustom]; -} - --(void)testInitWithCustomConfigFileRelativePath{ - NSString* configFileRelativePath = @"config-custom.xml"; - [self doTestInitWithConfigFile:configFileRelativePath expectedSettingValue:CDVViewControllerTestSettingValueCustom]; -} - --(void)testColorFromColorString{ - CDVViewController* viewController = [self viewController]; - - // Comparison values: #FFAABB and #99FFAABB - UIColor* referenceColor = [UIColor colorWithRed:255.0/255.0 green:170.0/255.0 blue:187.0/255.0 alpha:1.0]; - UIColor* referenceColorAlpha = [UIColor colorWithRed:255.0/255.0 green:170.0/255.0 blue:187.0/255.0 alpha:0.6]; - - // Valid values - XCTAssertTrue([[viewController colorFromColorString:@"#FAB"] isEqual:referenceColor]); - XCTAssertTrue([[viewController colorFromColorString:@"#FFAABB"] isEqual:referenceColor]); - XCTAssertTrue([[viewController colorFromColorString:@"0xFFAABB"] isEqual:referenceColor]); - XCTAssertTrue([[viewController colorFromColorString:@"#99FFAABB"] isEqual:referenceColorAlpha]); - XCTAssertTrue([[viewController colorFromColorString:@"0x99FFAABB"] isEqual:referenceColorAlpha]); - - // Invalid values - XCTAssertNil([viewController colorFromColorString:nil]); - XCTAssertNil([viewController colorFromColorString:@"black"]); - XCTAssertNil([viewController colorFromColorString:@"0xFAB"]); - XCTAssertNil([viewController colorFromColorString:@"#1234"]); - XCTAssertNil([viewController colorFromColorString:@"#12345"]); - XCTAssertNil([viewController colorFromColorString:@"#1234567"]); - XCTAssertNil([viewController colorFromColorString:@"#NOTHEX"]); -} - --(void)testIsUrlEmpty{ - CDVViewController* viewController = [self viewController]; - XCTAssertTrue([viewController isUrlEmpty:(id)[NSNull null]]); - XCTAssertTrue([viewController isUrlEmpty:nil]); - XCTAssertTrue([viewController isUrlEmpty:[NSURL URLWithString:@""]]); - XCTAssertTrue([viewController isUrlEmpty:[NSURL URLWithString:@"about:blank"]]); -} - --(void)testIfItLoadsAppUrlIfCurrentViewIsBlank{ - CDVViewController* viewController = [self viewController]; - - NSString* appUrl = @"about:blank"; - NSString* html = @""; - [viewController.webViewEngine loadHTMLString:html baseURL:[NSURL URLWithString:appUrl]]; - XCTAssertFalse([viewController checkAndReinitViewUrl]); - - appUrl = @"https://cordova.apache.org"; - viewController.startPage = appUrl; - [viewController.webViewEngine loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:appUrl]]]; - XCTAssertTrue([viewController checkAndReinitViewUrl]); -} - -@end - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVWebViewDelegateTests.m b/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVWebViewDelegateTests.m deleted file mode 100644 index 55b8ecf..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVWebViewDelegateTests.m +++ /dev/null @@ -1,161 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import - -#import - -@interface CDVWebViewDelegate2 : CDVUIWebViewDelegate {} - -- (void)setState:(NSInteger)state; -- (NSInteger)state; - -@end - -@implementation CDVWebViewDelegate2 - -- (void)setState:(NSInteger)state -{ - _state = state; -} - -- (NSInteger)state -{ - return _state; -} - -@end - -@interface CDVUIWebViewDelegate () - -// expose private interface -- (BOOL)shouldLoadRequest:(NSURLRequest*)request; - --(BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType; - -@end - -@interface CDVWebViewDelegateTests : XCTestCase -@end - -@implementation CDVWebViewDelegateTests - -- (void)setUp -{ - [super setUp]; -} - -- (void)tearDown -{ - [super tearDown]; -} - -- (void)testShouldLoadRequestWithStateWaitForStart -{ - NSInteger initialState = 1; // STATE_WAITING_FOR_LOAD_START; - NSInteger expectedState = 0; // STATE_IDLE; - - CDVWebViewDelegate2* wvd = [[CDVWebViewDelegate2 alloc] initWithDelegate:nil]; // not really testing delegate handling - wvd.state = initialState; - - // Testing a top-level navigation - [wvd webView:[UIWebView new] shouldStartLoadWithRequest:nil navigationType:UIWebViewNavigationTypeLinkClicked]; - - XCTAssertTrue(wvd.state == expectedState, @"If the navigation started with state STATE_WAITING_FOR_LOAD_START then it must fail and the state should be STATE_IDLE"); -} - - -- (void)testFailLoadStateCancelled -{ - NSInteger initialState = 1; // STATE_WAITING_FOR_LOAD_START; - NSInteger expectedState = 5; // STATE_CANCELLED; - NSError* errorCancelled = [NSError errorWithDomain:NSCocoaErrorDomain code:NSURLErrorCancelled userInfo:nil]; - - CDVWebViewDelegate2* wvd = [[CDVWebViewDelegate2 alloc] initWithDelegate:nil]; // not really testing delegate handling - - wvd.state = initialState; - [wvd webView:[UIWebView new] didFailLoadWithError:errorCancelled]; - - XCTAssertTrue(wvd.state == expectedState, @"If the load error was through an iframe redirect (NSURLErrorCancelled), the state should be STATE_CANCELLED"); -} - -- (void)testShouldLoadRequest -{ - CDVUIWebViewDelegate* wvd = [[CDVUIWebViewDelegate alloc] initWithDelegate:nil]; // not really testing delegate handling - - NSURLRequest* mailtoUrl = [NSURLRequest requestWithURL:[NSURL URLWithString:@"mailto:dev@cordova.apache.org"]]; - NSURLRequest* telUrl = [NSURLRequest requestWithURL:[NSURL URLWithString:@"tel:12345"]]; - NSURLRequest* plainUrl = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://apache.org"]]; - NSURLRequest* dataUrl = [NSURLRequest requestWithURL:[NSURL URLWithString:@"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="]]; - NSURLRequest* blobUrl = [NSURLRequest requestWithURL:[NSURL URLWithString:@"blob:d3958f5c-0777-0845-9dcf-2cb28783acaf"]]; - - - XCTAssertTrue([wvd shouldLoadRequest:mailtoUrl], @"mailto urls should be allowed"); - XCTAssertTrue([wvd shouldLoadRequest:telUrl], @"tel urls should be allowed"); - // as long as this is in the whitelist it should pass - XCTAssertTrue([wvd shouldLoadRequest:plainUrl], @"http urls should be allowed"); - - XCTAssertTrue([wvd shouldLoadRequest:dataUrl], @"data urls should be allowed"); - XCTAssertTrue([wvd shouldLoadRequest:blobUrl], @"blob urls should be allowed"); -} - -- (void)testFragmentIdentifiersWithHttpUrl -{ - [self doTestFragmentIdentifiersWithBaseUrl:@"http://cordova.apache.org" fragment:@"myfragment"]; -} - -- (void)testFragmentIdentifiersWithFileUrl -{ - [self doTestFragmentIdentifiersWithBaseUrl:@"file:///var/mobile/GASGEQGQsdga3313/www/index.html" fragment:@"myfragment"]; -} - -- (void)testFragmentIdentifiersWithFileUrlAndMalformedFragment -{ - [self doTestFragmentIdentifiersWithBaseUrl:@"file:///var/mobile/GASGEQGQsdga3313/www/index.html" fragment:@"/var/mobile/GASGEQGQsdga3313/www/index.html"]; -} - -- (void)doTestFragmentIdentifiersWithBaseUrl:(NSString*)baseUrl fragment:(NSString*)fragment -{ - CDVUIWebViewDelegate* wvd = [[CDVUIWebViewDelegate alloc] initWithDelegate:nil]; // not really testing delegate handling - - NSString* originalUrlString = baseUrl; - NSURL* originalUrl = [NSURL URLWithString:originalUrlString]; - NSURL* originalUrlWithFragmentOnly = [NSURL URLWithString:[NSString stringWithFormat:@"%@#%@", originalUrlString, fragment]]; - NSURL* originalUrlWithFragmentOnlyNoIdentifier = [NSURL URLWithString:[NSString stringWithFormat:@"%@#", originalUrlString]]; - NSURL* originalUrlWithQueryParamsAndFragment = [NSURL URLWithString:[NSString stringWithFormat:@"%@?foo=bar#%@", originalUrlString, fragment]]; - - NSURLRequest* originalRequest = [NSURLRequest requestWithURL:originalUrl]; - NSURLRequest* originalRequestWithFragmentOnly = [NSURLRequest requestWithURL:originalUrlWithFragmentOnly]; - NSURLRequest* originalRequestWithFragmentOnlyNoIdentifier = [NSURLRequest requestWithURL:originalUrlWithFragmentOnlyNoIdentifier]; - NSURLRequest* originalRequestWithQueryParamsAndFragment = [NSURLRequest requestWithURL:originalUrlWithQueryParamsAndFragment]; - NSURLRequest* notOriginalRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://httpd.apache.org"]]; - - XCTAssertTrue([wvd request:originalRequest isEqualToRequestAfterStrippingFragments:originalRequest], @"originalRequest should be a be equal to originalRequest after stripping fragments"); - XCTAssertTrue([wvd request:originalRequestWithFragmentOnly isEqualToRequestAfterStrippingFragments:originalRequest], @"originalRequestWithFragment should be equal to originalRequest after stripping fragment"); - XCTAssertTrue([wvd request:originalRequestWithFragmentOnlyNoIdentifier isEqualToRequestAfterStrippingFragments:originalRequest], @"originalRequestWithFragmentNoIdentifier should be equal to originalRequest after stripping fragment"); - XCTAssertFalse([wvd request:originalRequestWithQueryParamsAndFragment isEqualToRequestAfterStrippingFragments:originalRequest], @"originalRequestWithQueryParamsAndFragment should not be equal to originalRequest after stripping fragment"); - XCTAssertFalse([wvd request:notOriginalRequest isEqualToRequestAfterStrippingFragments:originalRequest], @"notOriginalRequest should not be equal to originalRequest after stripping fragment"); - - // equality tests - XCTAssertTrue([wvd request:originalRequestWithFragmentOnly isEqualToRequestAfterStrippingFragments:originalRequestWithFragmentOnly], @"originalRequestWithFragment should be a equal to itself after stripping fragments"); - XCTAssertTrue([wvd request:originalRequestWithFragmentOnlyNoIdentifier isEqualToRequestAfterStrippingFragments:originalRequestWithFragmentOnlyNoIdentifier], @"originalRequestWithFragmentNoIdentifier should be a equal to itself after stripping fragments"); - XCTAssertTrue([wvd request:originalRequestWithQueryParamsAndFragment isEqualToRequestAfterStrippingFragments:originalRequestWithQueryParamsAndFragment], @"originalRequestWithQueryParamsAndFragment should be equal to itself after stripping fragments"); -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVWebViewTest.h b/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVWebViewTest.h deleted file mode 100644 index e11b825..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVWebViewTest.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import -#import - -@class AppDelegate; -@class CDVViewController; - -@interface CDVWebViewTest : XCTestCase - -@property (nonatomic, strong) UIWebView* webView; - -- (AppDelegate*)appDelegate; -- (CDVViewController*)viewController; -- (UIWebView*)webView; - -// Returns the already registered plugin object for the given class. -- (id)pluginInstance:(NSString*)pluginName; -// Destroys the existing webview and creates a new one. -- (void)reloadWebView; -// Runs the run loop until the given block returns true, or until a timeout -// occurs. -- (void)waitForConditionName:(NSString*)conditionName block:(BOOL (^)())block; -// Convenience function for stringByEvaluatingJavaScriptFromString. -- (NSString*)evalJs:(NSString*)code; -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVWebViewTest.m b/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVWebViewTest.m deleted file mode 100644 index 02513c1..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVWebViewTest.m +++ /dev/null @@ -1,122 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "CDVWebViewTest.h" - -#import "AppDelegate.h" -#import "ViewController.h" - -@interface CDVWebViewTest () -// Runs the run loop until the webview has finished loading. -- (void)waitForPageLoad; -@end - -@implementation CDVWebViewTest - -@synthesize webView; - -- (void)setUp -{ - [super setUp]; - // Stop tests on the first failed assertion. Having the test stop on the - // first exception makes it much easier to identify the source of the error. - // On iOS < 5 there is a bug in SenTestingKit where the exception is - // uncaught and the app crashes upon a failed STAssert (oh well). - // [self raiseAfterFailure]; -} - -- (void)tearDown -{ - // Enforce that the view controller is released between tests to ensure - // tests don't affect each other. - [self.appDelegate destroyViewController]; - [super tearDown]; -} - -- (AppDelegate*)appDelegate -{ - return [[UIApplication sharedApplication] delegate]; -} - -- (CDVViewController*)viewController -{ - // Lazily create the view controller so that tests that do not require it - // are not slowed down by it. - if (self.appDelegate.viewController == nil) { - [self.appDelegate createViewController]; - // Things break if tearDown is called before the page has finished - // loading (a JS error happens and an alert pops up), so enforce a wait - // here. - [self waitForPageLoad]; - } - XCTAssertNotNil(self.appDelegate.viewController, @"createViewController failed"); - return self.appDelegate.viewController; -} - -- (UIWebView*)webView -{ - return (UIWebView*)self.viewController.webView; -} - -- (id)pluginInstance:(NSString*)pluginName -{ - id ret = [self.viewController getCommandInstance:pluginName]; - - XCTAssertNotNil(ret, @"Missing plugin %@", pluginName); - return ret; -} - -- (void)reloadWebView -{ - [self.appDelegate destroyViewController]; - [self.appDelegate createViewController]; -} - -- (void)waitForConditionName:(NSString*)conditionName block:(BOOL (^)())block -{ - // Number of seconds to wait for a condition to become true before giving up. - const NSTimeInterval kConditionTimeout = 5.0; - // Useful when debugging so that it does not timeout after one loop. - const int kMinIterations = 4; - - NSDate* startTime = [NSDate date]; - int i = 0; - - while (!block()) { - [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; - NSTimeInterval elapsed = -[startTime timeIntervalSinceNow]; - XCTAssertTrue(i < kMinIterations || elapsed < kConditionTimeout, - @"Timed out waiting for condition %@", conditionName); - ++i; - } -} - -- (void)waitForPageLoad -{ - [self waitForConditionName:@"PageLoad" block:^{ - return [@"true" isEqualToString:[self evalJs:@"window.pageIsLoaded"]]; - }]; -} - -- (NSString*)evalJs:(NSString*)code -{ - return [self.webView stringByEvaluatingJavaScriptFromString:code]; -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVWhitelistTests.m b/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVWhitelistTests.m deleted file mode 100644 index 5d50aaa..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CDVWhitelistTests.m +++ /dev/null @@ -1,332 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import - -#import -#import "CDVIntentAndNavigationFilter.h" - -@interface CDVWhitelistTests : XCTestCase -@end - -@implementation CDVWhitelistTests - -- (void)setUp -{ - [super setUp]; - - // setup code here -} - -- (void)tearDown -{ - // Tear-down code here. - - [super tearDown]; -} - -- (void)testAllowedSchemes -{ - NSArray* allowedHosts = [NSArray arrayWithObjects: - @"*.apache.org", - nil]; - - CDVWhitelist* whitelist = [[CDVWhitelist alloc] initWithArray:allowedHosts]; - - XCTAssertTrue([whitelist schemeIsAllowed:@"http"]); - XCTAssertTrue([whitelist schemeIsAllowed:@"https"]); - XCTAssertTrue([whitelist schemeIsAllowed:@"ftp"]); - XCTAssertTrue([whitelist schemeIsAllowed:@"ftps"]); - XCTAssertFalse([whitelist schemeIsAllowed:@"gopher"]); -} - -- (void)testSubdomainWildcard -{ - NSArray* allowedHosts = [NSArray arrayWithObjects: - @"*.apache.org", - nil]; - - CDVWhitelist* whitelist = [[CDVWhitelist alloc] initWithArray:allowedHosts]; - - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://build.apache.org"]]); - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://apache.org"]]); - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://sub1.sub0.build.apache.org"]]); - XCTAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://apache.org.ca"]]); -} - -- (void)testCatchallWildcardOnly -{ - NSArray* allowedHosts = [NSArray arrayWithObjects: - @"*", - nil]; - - CDVWhitelist* whitelist = [[CDVWhitelist alloc] initWithArray:allowedHosts]; - - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://apache.org"]]); - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"https://build.apache.prg"]]); - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"ftp://MyDangerousSite.org"]]); - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"ftps://apache.org.SuspiciousSite.com"]]); - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"gopher://apache.org"]]); -} - -- (void)testURISchemesNotFollowedByDoubleSlashes -{ - NSArray* allowedHosts = [NSArray arrayWithObjects: - @"tel:*", - @"sms:*", - nil]; - - CDVWhitelist* whitelist = [[CDVWhitelist alloc] initWithArray:allowedHosts]; - - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"tel:1234567890"]]); - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"sms:1234567890"]]); -} - -- (void)testCatchallWildcardByProto -{ - NSArray* allowedHosts = [NSArray arrayWithObjects: - @"http://*", - @"https://*", - @"ftp://*", - @"ftps://*", - nil]; - - CDVWhitelist* whitelist = [[CDVWhitelist alloc] initWithArray:allowedHosts]; - - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://apache.org"]]); - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"https://build.apache.prg"]]); - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"ftp://MyDangerousSite.org"]]); - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"ftps://apache.org.SuspiciousSite.com"]]); - XCTAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"gopher://apache.org"]]); -} - -- (void)testExactMatch -{ - NSArray* allowedHosts = [NSArray arrayWithObjects: - @"www.apache.org", - nil]; - - CDVWhitelist* whitelist = [[CDVWhitelist alloc] initWithArray:allowedHosts]; - - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://www.apache.org"]]); - XCTAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://build.apache.org"]]); - XCTAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://apache.org"]]); -} - -- (void)testNoMatchInQueryParam -{ - NSArray* allowedHosts = [NSArray arrayWithObjects: - @"www.apache.org", - nil]; - - CDVWhitelist* whitelist = [[CDVWhitelist alloc] initWithArray:allowedHosts]; - - XCTAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"www.malicious-site.org?url=http://www.apache.org"]]); - XCTAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"www.malicious-site.org?url=www.apache.org"]]); -} - -- (void)testIpExactMatch -{ - NSArray* allowedHosts = [NSArray arrayWithObjects: - @"192.168.1.1", - @"192.168.2.1", - nil]; - - CDVWhitelist* whitelist = [[CDVWhitelist alloc] initWithArray:allowedHosts]; - - XCTAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://apache.org"]]); - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://192.168.1.1"]]); - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://192.168.2.1"]]); - XCTAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://192.168.3.1"]]); -} - -- (void)testIpWildcardMatch -{ - NSArray* allowedHosts = [NSArray arrayWithObjects: - @"192.168.1.*", - @"192.168.2.*", - nil]; - - CDVWhitelist* whitelist = [[CDVWhitelist alloc] initWithArray:allowedHosts]; - - XCTAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://apache.org"]]); - - // Ever since Cordova 3.1, whitelist wildcards are simplified, only "*" and "*.apache.org" (subdomain example) are allowed. Therefore the next four tests should fail - XCTAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://192.168.1.1"]]); - XCTAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://192.168.1.2"]]); - XCTAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://192.168.2.1"]]); - XCTAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://192.168.2.2"]]); - - XCTAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://192.168.3.1"]]); -} - -- (void)testHostnameExtraction -{ - NSArray* allowedHosts = [NSArray arrayWithObjects: - @"http://apache.org/", - @"http://apache.org/foo/bar?x=y", - @"ftp://apache.org/foo/bar?x=y", - @"ftps://apache.org/foo/bar?x=y", - @"http://apache.*/foo/bar?x=y", - nil]; - - CDVWhitelist* whitelist = [[CDVWhitelist alloc] initWithArray:allowedHosts]; - - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://apache.org/"]]); - XCTAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://google.com/"]]); -} - -- (void)testWhitelistRejectionString -{ - NSArray* allowedHosts = [NSArray arrayWithObject:@"http://www.yahoo.com/"]; // Doesn't matter in this test. - CDVWhitelist* whitelist = [[CDVWhitelist alloc] initWithArray:allowedHosts]; - - NSURL* testUrl = [NSURL URLWithString:@"http://www/google.com"]; - NSString* errorString = [whitelist errorStringForURL:testUrl]; - NSString* expectedErrorString = [NSString stringWithFormat:kCDVDefaultWhitelistRejectionString, [testUrl absoluteString]]; - - XCTAssertTrue([expectedErrorString isEqualToString:errorString], @"Default error string has an unexpected value."); - - whitelist.whitelistRejectionFormatString = @"Hey, '%@' is, like, bogus man!"; - errorString = [whitelist errorStringForURL:testUrl]; - expectedErrorString = [NSString stringWithFormat:whitelist.whitelistRejectionFormatString, [testUrl absoluteString]]; - XCTAssertTrue([expectedErrorString isEqualToString:errorString], @"Customized whitelist rejection string has unexpected value."); -} - -- (void)testSpecificProtocol -{ - NSArray* allowedHosts = [NSArray arrayWithObjects: - @"http://www.apache.org", - @"cordova://www.google.com", - nil]; - - CDVWhitelist* whitelist = [[CDVWhitelist alloc] initWithArray:allowedHosts]; - - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://www.apache.org"]]); - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"cordova://www.google.com"]]); - XCTAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"cordova://www.apache.org"]]); - XCTAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://www.google.com"]]); -} - -- (void)testWildcardPlusOtherUrls -{ - // test for https://issues.apache.org/jira/browse/CB-3394 - - NSArray* allowedHosts = [NSArray arrayWithObjects: - @"*", - @"cordova.apache.org", - nil]; - - CDVWhitelist* whitelist = [[CDVWhitelist alloc] initWithArray:allowedHosts]; - - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://*.apache.org"]]); - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"https://www.google.com"]]); - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"ftp://cordova.apache.org"]]); - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://cordova.apache.org"]]); - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"https://cordova.apache.org"]]); -} - -- (void)testWildcardScheme -{ - NSArray* allowedHosts = [NSArray arrayWithObjects: - @"*://*.test.com", - nil]; - - CDVWhitelist* whitelist = [[CDVWhitelist alloc] initWithArray:allowedHosts]; - - XCTAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://apache.org"]]); - XCTAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"gopher://testtt.com"]]); - - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"gopher://test.com"]]); - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://test.com"]]); - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://my.test.com"]]); - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"https://test.com"]]); - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"https://my.test.com"]]); - - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://test.com/my/path"]]); - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://my.test.com/my/path"]]); - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"https://test.com/my/path"]]); - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"https://my.test.com/my/path"]]); - - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"gopher://test.com#foo"]]); - XCTAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"#foo"]]); -} - -- (void)testCredentials -{ - NSArray* allowedHosts = [NSArray arrayWithObjects: - @"http://*.apache.org", - @"http://www.google.com", - nil]; - - CDVWhitelist* whitelist = [[CDVWhitelist alloc] initWithArray:allowedHosts]; - - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://user:pass@www.apache.org"]]); - XCTAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://user:pass@www.google.com"]]); -} - -- (void)testAllowIntentsAndNavigations -{ - NSArray* allowIntents = @[ @"https://*" ]; - NSArray* allowNavigations = @[ @"https://*.apache.org" ]; - - CDVWhitelist* intentsWhitelist = [[CDVWhitelist alloc] initWithArray:allowIntents]; - CDVWhitelist* navigationsWhitelist = [[CDVWhitelist alloc] initWithArray:allowNavigations]; - - // Test allow-navigation superceding allow-intent - XCTAssertEqual([CDVIntentAndNavigationFilter filterUrl:[NSURL URLWithString:@"https://apache.org/foo.html"] intentsWhitelist:intentsWhitelist navigationsWhitelist:navigationsWhitelist], CDVIntentAndNavigationFilterValueNavigationAllowed); - // Test wildcard https as allow-intent - XCTAssertEqual([CDVIntentAndNavigationFilter filterUrl:[NSURL URLWithString:@"https://google.com"] intentsWhitelist:intentsWhitelist navigationsWhitelist:navigationsWhitelist], CDVIntentAndNavigationFilterValueIntentAllowed); - // Test http (not allowed in either) - XCTAssertEqual([CDVIntentAndNavigationFilter filterUrl:[NSURL URLWithString:@"http://google.com"] intentsWhitelist:intentsWhitelist navigationsWhitelist:navigationsWhitelist], CDVIntentAndNavigationFilterValueNoneAllowed); - - - NSURL* telUrl = [NSURL URLWithString:@"tel:5555555"]; - NSMutableURLRequest* telRequest = [NSMutableURLRequest requestWithURL:telUrl]; - telRequest.mainDocumentURL = telUrl; - - // mainDocumentURL and URL are the same in the NSURLRequest - // Only UIWebViewNavigationTypeLinkClicked and UIWebViewNavigationTypeOther should return YES - XCTAssertTrue([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeLinkClicked]); - XCTAssertTrue([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeOther]); - XCTAssertFalse([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeReload]); - XCTAssertFalse([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeBackForward]); - XCTAssertFalse([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeFormSubmitted]); - XCTAssertFalse([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeFormResubmitted]); - - telRequest.mainDocumentURL = nil; - // mainDocumentURL and URL are not the same in the NSURLRequest - // Only UIWebViewNavigationTypeLinkClicked should return YES - XCTAssertTrue([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeLinkClicked]); - XCTAssertFalse([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeOther]); - XCTAssertFalse([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeReload]); - XCTAssertFalse([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeBackForward]); - XCTAssertFalse([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeFormSubmitted]); - XCTAssertFalse([CDVIntentAndNavigationFilter shouldOpenURLRequest:telRequest navigationType:UIWebViewNavigationTypeFormResubmitted]); - - NSURLRequest* request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://apache.org"]]; - // Only CDVIntentAndNavigationFilterValueNavigationAllowed should return YES - // navigationType doesn't matter - XCTAssertTrue([CDVIntentAndNavigationFilter shouldOverrideLoadWithRequest:request navigationType:UIWebViewNavigationTypeOther filterValue:CDVIntentAndNavigationFilterValueNavigationAllowed]); - XCTAssertFalse([CDVIntentAndNavigationFilter shouldOverrideLoadWithRequest:request navigationType:UIWebViewNavigationTypeOther filterValue:CDVIntentAndNavigationFilterValueIntentAllowed]); - XCTAssertFalse([CDVIntentAndNavigationFilter shouldOverrideLoadWithRequest:request navigationType:UIWebViewNavigationTypeOther filterValue:CDVIntentAndNavigationFilterValueNoneAllowed]); -} - - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibApp/AppDelegate.h b/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibApp/AppDelegate.h deleted file mode 100644 index c815f20..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibApp/AppDelegate.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import -#import - -@class ViewController; - -@interface AppDelegate : CDVAppDelegate - -- (void)createViewController; -- (void)destroyViewController; - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibApp/AppDelegate.m b/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibApp/AppDelegate.m deleted file mode 100644 index 5b26110..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibApp/AppDelegate.m +++ /dev/null @@ -1,56 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "AppDelegate.h" - -#import "ViewController.h" - -@implementation AppDelegate - -- (void)createViewController -{ - NSAssert(!self.viewController, @"ViewController already created."); - - self.viewController = [[ViewController alloc] init]; - self.viewController.wwwFolderName = @"www"; - self.viewController.startPage = @"index.html"; - - // NOTE: To customize the view's frame size (which defaults to full screen), override - // [self.viewController viewWillAppear:] in your view controller. - - self.window.rootViewController = self.viewController; -} - -- (void)destroyViewController -{ - self.viewController = nil; -} - -- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions -{ - BOOL retVal = [super application:application didFinishLaunchingWithOptions:launchOptions]; - // Create the main view on start-up only when not running unit tests. - if (!NSClassFromString(@"CDVWebViewTest")) { - [self createViewController]; - } - - return retVal; -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibApp/Bridging-Header.h b/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibApp/Bridging-Header.h deleted file mode 100644 index 5d8abc9..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibApp/Bridging-Header.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ -// -// Bridging-Header.h -// __PROJECT_NAME__ -// -// Created by ___FULLUSERNAME___ on ___DATE___. -// Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved. -// -// -// Use this file to import your target's public headers that you would like to expose to Swift. -// - -#import diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibApp/CordovaLibApp-Info.plist b/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibApp/CordovaLibApp-Info.plist deleted file mode 100644 index 6c21097..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibApp/CordovaLibApp-Info.plist +++ /dev/null @@ -1,45 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleDisplayName - ${PRODUCT_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - org.apache.cordova.cordovalibapptests.${PRODUCT_NAME:rfc1034identifier} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - LSRequiresIPhoneOS - - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibApp/ViewController.h b/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibApp/ViewController.h deleted file mode 100644 index 841d1e8..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibApp/ViewController.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import -#import - -@interface ViewController : CDVViewController - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibApp/ViewController.m b/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibApp/ViewController.m deleted file mode 100644 index 7de6791..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibApp/ViewController.m +++ /dev/null @@ -1,53 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "ViewController.h" - -@interface ViewController () - -@end - -@implementation ViewController - -- (void)viewWillAppear:(BOOL)animated -{ - // View defaults to full size. If you want to customize the view's size, or its subviews (e.g. webView), - // you can do so here. - - [super viewWillAppear:animated]; -} - -- (void)viewDidLoad -{ - [super viewDidLoad]; - // Do any additional setup after loading the view, typically from a nib. -} - -- (void)viewDidUnload -{ - [super viewDidUnload]; - // Release any retained subviews of the main view. -} - -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation -{ - return [super shouldAutorotateToInterfaceOrientation:interfaceOrientation]; -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibApp/config.xml b/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibApp/config.xml deleted file mode 100644 index 5b930fc..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibApp/config.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - Hello Cordova - - - A sample Apache Cordova application that responds to the deviceready event. - - - - Apache Cordova Team - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibApp/en.lproj/InfoPlist.strings b/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibApp/en.lproj/InfoPlist.strings deleted file mode 100644 index 01d5c8c..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibApp/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,20 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ -/* Localized versions of Info.plist keys */ - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibApp/main.m b/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibApp/main.m deleted file mode 100644 index 120ac53..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibApp/main.m +++ /dev/null @@ -1,29 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import - -#import "AppDelegate.h" - -int main(int argc, char* argv[]) -{ - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibApp/www/index.html b/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibApp/www/index.html deleted file mode 100644 index 7f8bc5a..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibApp/www/index.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - -

Hey, it's Cordova!

-
    -
  1. Check your console log for any white-list rejection errors.
  2. -
  3. Add your allowed hosts in config.xml as access tags and set the origin attribute. (wildcards OK, don't enter the URL scheme)
  4. -
- - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibTests-Info.plist b/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibTests-Info.plist deleted file mode 100644 index a57a78d..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibTests-Info.plist +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - org.apache.cordova.${PRODUCT_NAME:rfc1034identifier} - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibTests.xcodeproj/project.pbxproj b/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibTests.xcodeproj/project.pbxproj deleted file mode 100644 index fb6f059..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/CordovaLibTests.xcodeproj/project.pbxproj +++ /dev/null @@ -1,900 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 3006BCEA1D1A859B0035385C /* libCordova.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3006BCE91D1A859B0035385C /* libCordova.a */; }; - 3035621714104C34006C2D43 /* CDVWhitelistTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 30356213141049E1006C2D43 /* CDVWhitelistTests.m */; }; - 303A4072152124BB00182201 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 303A4070152124BB00182201 /* InfoPlist.strings */; }; - 303A4074152124BB00182201 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 303A4073152124BB00182201 /* main.m */; }; - 303A4078152124BB00182201 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 303A4077152124BB00182201 /* AppDelegate.m */; }; - 303A407B152124BB00182201 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 303A407A152124BB00182201 /* ViewController.m */; }; - 30610C9219AD9B95000B3781 /* CDVCommandDelegateTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 30610C9119AD9B95000B3781 /* CDVCommandDelegateTests.m */; }; - 3062D1AE151D4D9D000D9128 /* CDVLocalStorageTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3062D1AD151D4D9D000D9128 /* CDVLocalStorageTests.m */; }; - 30B342F515224B360070E6A5 /* CDVWebViewTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 30B342F415224B360070E6A5 /* CDVWebViewTest.m */; }; - 30D1B08C15A2B36D0060C291 /* CDVBase64Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 30D1B08B15A2B36D0060C291 /* CDVBase64Tests.m */; }; - 30F8AE1D152129DA006625B3 /* www in Resources */ = {isa = PBXBuildFile; fileRef = 30F8AE1C152129DA006625B3 /* www */; }; - 5C4C91761C2ACE450055AFC3 /* CDVViewControllerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C4C91751C2ACE450055AFC3 /* CDVViewControllerTest.m */; }; - 5C4C917B1C2AD44E0055AFC3 /* config-custom.xml in Resources */ = {isa = PBXBuildFile; fileRef = 5C4C91771C2ACF130055AFC3 /* config-custom.xml */; }; - 686357B5141002F200DF4CF2 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 686357B3141002F200DF4CF2 /* InfoPlist.strings */; }; - 686357BA141002F200DF4CF2 /* CDVPluginResultJSONSerializationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 686357B9141002F200DF4CF2 /* CDVPluginResultJSONSerializationTests.m */; }; - 7E91406017711D88002C6A3F /* CDVWebViewDelegateTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E91405F17711D88002C6A3F /* CDVWebViewDelegateTests.m */; }; - 7EF33BD71911ABA20048544E /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7EF33BD61911ABA20048544E /* Default-568h@2x.png */; }; - C0FA7C9B1E4BB6420077B045 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 303A4073152124BB00182201 /* main.m */; }; - C0FA7C9C1E4BB6420077B045 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 303A4077152124BB00182201 /* AppDelegate.m */; }; - C0FA7C9D1E4BB6420077B045 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 303A407A152124BB00182201 /* ViewController.m */; }; - C0FA7CA11E4BB6420077B045 /* config.xml in Resources */ = {isa = PBXBuildFile; fileRef = F8EB14D0165FFD3200616F39 /* config.xml */; }; - C0FA7CA21E4BB6420077B045 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7EF33BD61911ABA20048544E /* Default-568h@2x.png */; }; - C0FA7CA31E4BB6420077B045 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 303A4070152124BB00182201 /* InfoPlist.strings */; }; - C0FA7CA41E4BB6420077B045 /* www in Resources */ = {isa = PBXBuildFile; fileRef = 30F8AE1C152129DA006625B3 /* www */; }; - C0FA7CA51E4BB6420077B045 /* config-custom.xml in Resources */ = {isa = PBXBuildFile; fileRef = 5C4C91771C2ACF130055AFC3 /* config-custom.xml */; }; - C0FA7CB51E4BBBBE0077B045 /* CDVWhitelistTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 30356213141049E1006C2D43 /* CDVWhitelistTests.m */; }; - C0FA7CB61E4BBBBE0077B045 /* CDVPluginResultJSONSerializationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 686357B9141002F200DF4CF2 /* CDVPluginResultJSONSerializationTests.m */; }; - C0FA7CB71E4BBBBE0077B045 /* CDVLocalStorageTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3062D1AD151D4D9D000D9128 /* CDVLocalStorageTests.m */; }; - C0FA7CB81E4BBBBE0077B045 /* CDVWebViewTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 30B342F415224B360070E6A5 /* CDVWebViewTest.m */; }; - C0FA7CB91E4BBBBE0077B045 /* CDVBase64Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 30D1B08B15A2B36D0060C291 /* CDVBase64Tests.m */; }; - C0FA7CBA1E4BBBBE0077B045 /* CDVFakeFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = EBA3554515A731F100F4DE24 /* CDVFakeFileManager.m */; }; - C0FA7CBB1E4BBBBE0077B045 /* CDVViewControllerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C4C91751C2ACE450055AFC3 /* CDVViewControllerTest.m */; }; - C0FA7CBC1E4BBBBE0077B045 /* CDVInvokedUrlCommandTests.m in Sources */ = {isa = PBXBuildFile; fileRef = EB89634915FE66EA00E12277 /* CDVInvokedUrlCommandTests.m */; }; - C0FA7CBD1E4BBBBE0077B045 /* CDVUserAgentTest.m in Sources */ = {isa = PBXBuildFile; fileRef = EB96677116ADBCF500D86CDF /* CDVUserAgentTest.m */; }; - C0FA7CBE1E4BBBBE0077B045 /* CDVWebViewDelegateTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E91405F17711D88002C6A3F /* CDVWebViewDelegateTests.m */; }; - C0FA7CBF1E4BBBBE0077B045 /* CDVCommandDelegateTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 30610C9119AD9B95000B3781 /* CDVCommandDelegateTests.m */; }; - C0FA7CC01E4BBBBE0077B045 /* CDVStartPageTests.m in Sources */ = {isa = PBXBuildFile; fileRef = EBA7F20417962CCD001A0CE6 /* CDVStartPageTests.m */; }; - C0FA7CC31E4BBBBE0077B045 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 686357B3141002F200DF4CF2 /* InfoPlist.strings */; }; - C0FA7CCE1E4BBE400077B045 /* Cordova.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0FA7CAC1E4BB6B30077B045 /* Cordova.framework */; }; - C0FA7CDB1E4BC4FE0077B045 /* Cordova.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0FA7CAC1E4BB6B30077B045 /* Cordova.framework */; }; - C0FA7CDD1E4BC5020077B045 /* Cordova.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C0FA7CAC1E4BB6B30077B045 /* Cordova.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - EB89634A15FE66EA00E12277 /* CDVInvokedUrlCommandTests.m in Sources */ = {isa = PBXBuildFile; fileRef = EB89634915FE66EA00E12277 /* CDVInvokedUrlCommandTests.m */; }; - EB96677216ADBCF500D86CDF /* CDVUserAgentTest.m in Sources */ = {isa = PBXBuildFile; fileRef = EB96677116ADBCF500D86CDF /* CDVUserAgentTest.m */; }; - EBA3554615A731F100F4DE24 /* CDVFakeFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = EBA3554515A731F100F4DE24 /* CDVFakeFileManager.m */; }; - EBA7F20517962CCD001A0CE6 /* CDVStartPageTests.m in Sources */ = {isa = PBXBuildFile; fileRef = EBA7F20417962CCD001A0CE6 /* CDVStartPageTests.m */; }; - F8EB14D1165FFD3200616F39 /* config.xml in Resources */ = {isa = PBXBuildFile; fileRef = F8EB14D0165FFD3200616F39 /* config.xml */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 30F8AE3215212F07006625B3 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 303A4067152124BB00182201; - remoteInfo = CordovaLibApp; - }; - C0FA7CCC1E4BBD870077B045 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = C0FA7C991E4BB6420077B045; - remoteInfo = CordovaFrameworkApp; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - C0FA7CDE1E4BC5020077B045 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - C0FA7CDD1E4BC5020077B045 /* Cordova.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 1; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 3006BCE91D1A859B0035385C /* libCordova.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libCordova.a; path = "../Debug-iphonesimulator/libCordova.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 30356213141049E1006C2D43 /* CDVWhitelistTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVWhitelistTests.m; sourceTree = ""; }; - 303A4068152124BB00182201 /* CordovaLibApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CordovaLibApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 303A406F152124BB00182201 /* CordovaLibApp-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "CordovaLibApp-Info.plist"; sourceTree = ""; }; - 303A4071152124BB00182201 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - 303A4073152124BB00182201 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 303A4076152124BB00182201 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 303A4077152124BB00182201 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 303A4079152124BB00182201 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; - 303A407A152124BB00182201 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; - 30610C9119AD9B95000B3781 /* CDVCommandDelegateTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVCommandDelegateTests.m; sourceTree = ""; }; - 3062D1AD151D4D9D000D9128 /* CDVLocalStorageTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVLocalStorageTests.m; sourceTree = ""; }; - 30B342F415224B360070E6A5 /* CDVWebViewTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVWebViewTest.m; sourceTree = ""; }; - 30D1B08B15A2B36D0060C291 /* CDVBase64Tests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVBase64Tests.m; sourceTree = ""; }; - 30F8AE1C152129DA006625B3 /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; path = www; sourceTree = ""; }; - 5C4C91751C2ACE450055AFC3 /* CDVViewControllerTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVViewControllerTest.m; sourceTree = ""; }; - 5C4C91771C2ACF130055AFC3 /* config-custom.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "config-custom.xml"; sourceTree = ""; }; - 686357A9141002F100DF4CF2 /* CordovaLibTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CordovaLibTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 686357B2141002F200DF4CF2 /* CordovaLibTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CordovaLibTests-Info.plist"; sourceTree = ""; }; - 686357B4141002F200DF4CF2 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - 686357B9141002F200DF4CF2 /* CDVPluginResultJSONSerializationTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CDVPluginResultJSONSerializationTests.m; sourceTree = ""; }; - 7E91405F17711D88002C6A3F /* CDVWebViewDelegateTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVWebViewDelegateTests.m; sourceTree = ""; }; - 7EF33BD61911ABA20048544E /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; - C0FA7CAA1E4BB6420077B045 /* CordovaFrameworkApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CordovaFrameworkApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; - C0FA7CAC1E4BB6B30077B045 /* Cordova.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cordova.framework; path = "../Debug-iphonesimulator/Cordova.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; - C0FA7CC71E4BBBBE0077B045 /* CordovaFrameworkTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CordovaFrameworkTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - EB89634915FE66EA00E12277 /* CDVInvokedUrlCommandTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVInvokedUrlCommandTests.m; sourceTree = ""; }; - EB96677116ADBCF500D86CDF /* CDVUserAgentTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVUserAgentTest.m; sourceTree = ""; }; - EBA3550F15A5F18900F4DE24 /* CDVWebViewTest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDVWebViewTest.h; sourceTree = ""; }; - EBA3554415A731F100F4DE24 /* CDVFakeFileManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVFakeFileManager.h; sourceTree = ""; }; - EBA3554515A731F100F4DE24 /* CDVFakeFileManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVFakeFileManager.m; sourceTree = ""; }; - EBA7F20417962CCD001A0CE6 /* CDVStartPageTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVStartPageTests.m; sourceTree = ""; }; - ED33DF2A687741AEAF9F8254 /* Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Bridging-Header.h"; sourceTree = ""; }; - F8EB14D0165FFD3200616F39 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = CordovaLibApp/config.xml; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 303A4065152124BB00182201 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 3006BCEA1D1A859B0035385C /* libCordova.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 686357A5141002F100DF4CF2 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - C0FA7C9E1E4BB6420077B045 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - C0FA7CDB1E4BC4FE0077B045 /* Cordova.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - C0FA7CC11E4BBBBE0077B045 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - C0FA7CCE1E4BBE400077B045 /* Cordova.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 034768DFFF38A50411DB9C8B /* Products */ = { - isa = PBXGroup; - children = ( - 686357A9141002F100DF4CF2 /* CordovaLibTests.xctest */, - 303A4068152124BB00182201 /* CordovaLibApp.app */, - C0FA7CAA1E4BB6420077B045 /* CordovaFrameworkApp.app */, - C0FA7CC71E4BBBBE0077B045 /* CordovaFrameworkTests.xctest */, - ); - name = Products; - sourceTree = CORDOVALIB; - }; - 0867D691FE84028FC02AAC07 /* CordovaLib */ = { - isa = PBXGroup; - children = ( - 7EF33BD61911ABA20048544E /* Default-568h@2x.png */, - F8EB14D0165FFD3200616F39 /* config.xml */, - 5C4C91771C2ACF130055AFC3 /* config-custom.xml */, - EB3B34F4161B585D003DBE7D /* CordovaLibTests */, - 303A406D152124BB00182201 /* CordovaLibApp */, - 0867D69AFE84028FC02AAC07 /* Frameworks */, - 034768DFFF38A50411DB9C8B /* Products */, - ); - name = CordovaLib; - sourceTree = ""; - }; - 0867D69AFE84028FC02AAC07 /* Frameworks */ = { - isa = PBXGroup; - children = ( - C0FA7CAC1E4BB6B30077B045 /* Cordova.framework */, - 3006BCE91D1A859B0035385C /* libCordova.a */, - ); - name = Frameworks; - sourceTree = ""; - }; - 303A406D152124BB00182201 /* CordovaLibApp */ = { - isa = PBXGroup; - children = ( - 30F8AE1C152129DA006625B3 /* www */, - 303A4076152124BB00182201 /* AppDelegate.h */, - 303A4077152124BB00182201 /* AppDelegate.m */, - 303A4079152124BB00182201 /* ViewController.h */, - 303A407A152124BB00182201 /* ViewController.m */, - 303A406E152124BB00182201 /* Supporting Files */, - ); - path = CordovaLibApp; - sourceTree = ""; - }; - 303A406E152124BB00182201 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 303A406F152124BB00182201 /* CordovaLibApp-Info.plist */, - 303A4070152124BB00182201 /* InfoPlist.strings */, - 303A4073152124BB00182201 /* main.m */, - ED33DF2A687741AEAF9F8254 /* Bridging-Header.h */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 686357B1141002F200DF4CF2 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 686357B2141002F200DF4CF2 /* CordovaLibTests-Info.plist */, - 686357B3141002F200DF4CF2 /* InfoPlist.strings */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - EB3B34F4161B585D003DBE7D /* CordovaLibTests */ = { - isa = PBXGroup; - children = ( - 30D1B08B15A2B36D0060C291 /* CDVBase64Tests.m */, - 30610C9119AD9B95000B3781 /* CDVCommandDelegateTests.m */, - EBA3554415A731F100F4DE24 /* CDVFakeFileManager.h */, - EBA3554515A731F100F4DE24 /* CDVFakeFileManager.m */, - EB89634915FE66EA00E12277 /* CDVInvokedUrlCommandTests.m */, - 3062D1AD151D4D9D000D9128 /* CDVLocalStorageTests.m */, - 686357B9141002F200DF4CF2 /* CDVPluginResultJSONSerializationTests.m */, - EBA7F20417962CCD001A0CE6 /* CDVStartPageTests.m */, - EB96677116ADBCF500D86CDF /* CDVUserAgentTest.m */, - 5C4C91751C2ACE450055AFC3 /* CDVViewControllerTest.m */, - 7E91405F17711D88002C6A3F /* CDVWebViewDelegateTests.m */, - EBA3550F15A5F18900F4DE24 /* CDVWebViewTest.h */, - 30B342F415224B360070E6A5 /* CDVWebViewTest.m */, - 30356213141049E1006C2D43 /* CDVWhitelistTests.m */, - 686357B1141002F200DF4CF2 /* Supporting Files */, - ); - name = CordovaLibTests; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 303A4067152124BB00182201 /* CordovaLibApp */ = { - isa = PBXNativeTarget; - buildConfigurationList = 303A4082152124BB00182201 /* Build configuration list for PBXNativeTarget "CordovaLibApp" */; - buildPhases = ( - 303A4064152124BB00182201 /* Sources */, - 303A4065152124BB00182201 /* Frameworks */, - 303A4066152124BB00182201 /* Resources */, - 30F8AE1615212883006625B3 /* Copy cordova.js into www directory */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = CordovaLibApp; - productName = CordovaLibApp; - productReference = 303A4068152124BB00182201 /* CordovaLibApp.app */; - productType = "com.apple.product-type.application"; - }; - 686357A8141002F100DF4CF2 /* CordovaLibTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 686357BD141002F200DF4CF2 /* Build configuration list for PBXNativeTarget "CordovaLibTests" */; - buildPhases = ( - 686357A4141002F100DF4CF2 /* Sources */, - 686357A5141002F100DF4CF2 /* Frameworks */, - 686357A6141002F100DF4CF2 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 30F8AE3315212F07006625B3 /* PBXTargetDependency */, - ); - name = CordovaLibTests; - productName = CordovaLibTests; - productReference = 686357A9141002F100DF4CF2 /* CordovaLibTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - C0FA7C991E4BB6420077B045 /* CordovaFrameworkApp */ = { - isa = PBXNativeTarget; - buildConfigurationList = C0FA7CA71E4BB6420077B045 /* Build configuration list for PBXNativeTarget "CordovaFrameworkApp" */; - buildPhases = ( - C0FA7C9A1E4BB6420077B045 /* Sources */, - C0FA7C9E1E4BB6420077B045 /* Frameworks */, - C0FA7CA01E4BB6420077B045 /* Resources */, - C0FA7CA61E4BB6420077B045 /* Copy cordova.js into www directory */, - C0FA7CDE1E4BC5020077B045 /* Embed Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = CordovaFrameworkApp; - productName = CordovaLibApp; - productReference = C0FA7CAA1E4BB6420077B045 /* CordovaFrameworkApp.app */; - productType = "com.apple.product-type.application"; - }; - C0FA7CB11E4BBBBE0077B045 /* CordovaFrameworkTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = C0FA7CC41E4BBBBE0077B045 /* Build configuration list for PBXNativeTarget "CordovaFrameworkTests" */; - buildPhases = ( - C0FA7CB41E4BBBBE0077B045 /* Sources */, - C0FA7CC11E4BBBBE0077B045 /* Frameworks */, - C0FA7CC21E4BBBBE0077B045 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - C0FA7CCD1E4BBD870077B045 /* PBXTargetDependency */, - ); - name = CordovaFrameworkTests; - productName = CordovaLibTests; - productReference = C0FA7CC71E4BBBBE0077B045 /* CordovaFrameworkTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 0867D690FE84028FC02AAC07 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0600; - TargetAttributes = { - C0FA7CB11E4BBBBE0077B045 = { - TestTargetID = C0FA7C991E4BB6420077B045; - }; - }; - }; - buildConfigurationList = 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "CordovaLibTests" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - English, - Japanese, - French, - German, - en, - ); - mainGroup = 0867D691FE84028FC02AAC07 /* CordovaLib */; - productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 686357A8141002F100DF4CF2 /* CordovaLibTests */, - 303A4067152124BB00182201 /* CordovaLibApp */, - C0FA7C991E4BB6420077B045 /* CordovaFrameworkApp */, - C0FA7CB11E4BBBBE0077B045 /* CordovaFrameworkTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 303A4066152124BB00182201 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - F8EB14D1165FFD3200616F39 /* config.xml in Resources */, - 7EF33BD71911ABA20048544E /* Default-568h@2x.png in Resources */, - 303A4072152124BB00182201 /* InfoPlist.strings in Resources */, - 30F8AE1D152129DA006625B3 /* www in Resources */, - 5C4C917B1C2AD44E0055AFC3 /* config-custom.xml in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 686357A6141002F100DF4CF2 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 686357B5141002F200DF4CF2 /* InfoPlist.strings in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - C0FA7CA01E4BB6420077B045 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - C0FA7CA11E4BB6420077B045 /* config.xml in Resources */, - C0FA7CA21E4BB6420077B045 /* Default-568h@2x.png in Resources */, - C0FA7CA31E4BB6420077B045 /* InfoPlist.strings in Resources */, - C0FA7CA41E4BB6420077B045 /* www in Resources */, - C0FA7CA51E4BB6420077B045 /* config-custom.xml in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - C0FA7CC21E4BBBBE0077B045 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - C0FA7CC31E4BBBBE0077B045 /* InfoPlist.strings in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 30F8AE1615212883006625B3 /* Copy cordova.js into www directory */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "", - ); - name = "Copy cordova.js into www directory"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "cp ../../CordovaLib/cordova.js \"$BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME/www/cordova.js\""; - showEnvVarsInLog = 0; - }; - C0FA7CA61E4BB6420077B045 /* Copy cordova.js into www directory */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "", - ); - name = "Copy cordova.js into www directory"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "cp ../../CordovaLib/cordova.js \"$BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME/www/cordova.js\""; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 303A4064152124BB00182201 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 303A4074152124BB00182201 /* main.m in Sources */, - 303A4078152124BB00182201 /* AppDelegate.m in Sources */, - 303A407B152124BB00182201 /* ViewController.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 686357A4141002F100DF4CF2 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 3035621714104C34006C2D43 /* CDVWhitelistTests.m in Sources */, - 686357BA141002F200DF4CF2 /* CDVPluginResultJSONSerializationTests.m in Sources */, - 3062D1AE151D4D9D000D9128 /* CDVLocalStorageTests.m in Sources */, - 30B342F515224B360070E6A5 /* CDVWebViewTest.m in Sources */, - 30D1B08C15A2B36D0060C291 /* CDVBase64Tests.m in Sources */, - EBA3554615A731F100F4DE24 /* CDVFakeFileManager.m in Sources */, - 5C4C91761C2ACE450055AFC3 /* CDVViewControllerTest.m in Sources */, - EB89634A15FE66EA00E12277 /* CDVInvokedUrlCommandTests.m in Sources */, - EB96677216ADBCF500D86CDF /* CDVUserAgentTest.m in Sources */, - 7E91406017711D88002C6A3F /* CDVWebViewDelegateTests.m in Sources */, - 30610C9219AD9B95000B3781 /* CDVCommandDelegateTests.m in Sources */, - EBA7F20517962CCD001A0CE6 /* CDVStartPageTests.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - C0FA7C9A1E4BB6420077B045 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - C0FA7C9B1E4BB6420077B045 /* main.m in Sources */, - C0FA7C9C1E4BB6420077B045 /* AppDelegate.m in Sources */, - C0FA7C9D1E4BB6420077B045 /* ViewController.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - C0FA7CB41E4BBBBE0077B045 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - C0FA7CB51E4BBBBE0077B045 /* CDVWhitelistTests.m in Sources */, - C0FA7CB61E4BBBBE0077B045 /* CDVPluginResultJSONSerializationTests.m in Sources */, - C0FA7CB71E4BBBBE0077B045 /* CDVLocalStorageTests.m in Sources */, - C0FA7CB81E4BBBBE0077B045 /* CDVWebViewTest.m in Sources */, - C0FA7CB91E4BBBBE0077B045 /* CDVBase64Tests.m in Sources */, - C0FA7CBA1E4BBBBE0077B045 /* CDVFakeFileManager.m in Sources */, - C0FA7CBB1E4BBBBE0077B045 /* CDVViewControllerTest.m in Sources */, - C0FA7CBC1E4BBBBE0077B045 /* CDVInvokedUrlCommandTests.m in Sources */, - C0FA7CBD1E4BBBBE0077B045 /* CDVUserAgentTest.m in Sources */, - C0FA7CBE1E4BBBBE0077B045 /* CDVWebViewDelegateTests.m in Sources */, - C0FA7CBF1E4BBBBE0077B045 /* CDVCommandDelegateTests.m in Sources */, - C0FA7CC01E4BBBBE0077B045 /* CDVStartPageTests.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 30F8AE3315212F07006625B3 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 303A4067152124BB00182201 /* CordovaLibApp */; - targetProxy = 30F8AE3215212F07006625B3 /* PBXContainerItemProxy */; - }; - C0FA7CCD1E4BBD870077B045 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = C0FA7C991E4BB6420077B045 /* CordovaFrameworkApp */; - targetProxy = C0FA7CCC1E4BBD870077B045 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 303A4070152124BB00182201 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 303A4071152124BB00182201 /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; - 686357B3141002F200DF4CF2 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 686357B4141002F200DF4CF2 /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 1DEB922308733DC00010E9CD /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ENABLE_MODULES = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ""; - GCC_THUMB_SUPPORT = NO; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - 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; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; - ONLY_ACTIVE_ARCH = YES; - OTHER_CFLAGS = "-DDEBUG"; - OTHER_LDFLAGS = ( - "-all_load", - "-ObjC", - ); - PUBLIC_HEADERS_FOLDER_PATH = include/Cordova; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_OBJC_BRIDGING_HEADER = "__PROJECT_NAME__/Bridging-Header.h"; - TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "Classes/** \"${BUILT_PRODUCTS_DIR}\""; - }; - name = Debug; - }; - 1DEB922408733DC00010E9CD /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ENABLE_MODULES = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_PREPROCESSOR_DEFINITIONS = ""; - GCC_THUMB_SUPPORT = NO; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - 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; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; - ONLY_ACTIVE_ARCH = NO; - OTHER_LDFLAGS = ( - "-all_load", - "-ObjC", - ); - PUBLIC_HEADERS_FOLDER_PATH = include/Cordova; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_OBJC_BRIDGING_HEADER = "__PROJECT_NAME__/Bridging-Header.h"; - TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "Classes/** \"${BUILT_PRODUCTS_DIR}\""; - }; - name = Release; - }; - 303A4083152124BB00182201 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - HEADER_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = "CordovaLibApp/CordovaLibApp-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LIBRARY_SEARCH_PATHS = "$(inherited)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../CordovaLib/Classes/Private/**"; - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - 303A4084152124BB00182201 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_SYMBOLS_PRIVATE_EXTERN = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - HEADER_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = "CordovaLibApp/CordovaLibApp-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LIBRARY_SEARCH_PATHS = "$(inherited)"; - OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../CordovaLib/Classes/Private/**"; - VALIDATE_PRODUCT = YES; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; - 686357BB141002F200DF4CF2 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/CordovaLibApp.app/CordovaLibApp"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_THUMB_SUPPORT = NO; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - HEADER_SEARCH_PATHS = ( - "$(inherited)", - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, - "$(BUILT_PRODUCTS_DIR)/usr/local/include", - "$(BUILT_PRODUCTS_DIR)/include/Cordova/**", - ); - INFOPLIST_FILE = "CordovaLibTests-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = ( - "-all_load", - "-ObjC", - ); - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUNDLE_LOADER)"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../CordovaLib/Classes/Private/**"; - }; - name = Debug; - }; - 686357BC141002F200DF4CF2 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/CordovaLibApp.app/CordovaLibApp"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_THUMB_SUPPORT = NO; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - HEADER_SEARCH_PATHS = ( - "$(inherited)", - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, - "$(BUILT_PRODUCTS_DIR)/usr/local/include", - "$(BUILT_PRODUCTS_DIR)/include/Cordova/**", - ); - INFOPLIST_FILE = "CordovaLibTests-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - ONLY_ACTIVE_ARCH = NO; - OTHER_LDFLAGS = ( - "-all_load", - "-ObjC", - ); - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUNDLE_LOADER)"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../CordovaLib/Classes/Private/**"; - }; - name = Release; - }; - C0FA7CA81E4BB6420077B045 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - HEADER_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = "$(SRCROOT)/CordovaLibApp/CordovaLibApp-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = "$(inherited)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../CordovaLib/Classes/Private/**"; - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - C0FA7CA91E4BB6420077B045 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_SYMBOLS_PRIVATE_EXTERN = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - HEADER_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = "$(SRCROOT)/CordovaLibApp/CordovaLibApp-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = "$(inherited)"; - OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../CordovaLib/Classes/Private/**"; - VALIDATE_PRODUCT = YES; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; - C0FA7CC51E4BBBBE0077B045 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - BUNDLE_LOADER = "$(TEST_HOST)"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_PREPROCESSOR_DEFINITIONS = DEBUG; - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_THUMB_SUPPORT = NO; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - HEADER_SEARCH_PATHS = ( - "$(inherited)", - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, - "$(BUILT_PRODUCTS_DIR)/usr/local/include", - "$(BUILT_PRODUCTS_DIR)/include/Cordova/**", - ); - INFOPLIST_FILE = "CordovaLibTests-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = ( - "-all_load", - "-ObjC", - ); - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CordovaFrameworkApp.app/CordovaFrameworkApp"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../CordovaLib/Classes/Private/**"; - }; - name = Debug; - }; - C0FA7CC61E4BBBBE0077B045 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - BUNDLE_LOADER = "$(TEST_HOST)"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_THUMB_SUPPORT = NO; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - HEADER_SEARCH_PATHS = ( - "$(inherited)", - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, - "$(BUILT_PRODUCTS_DIR)/usr/local/include", - "$(BUILT_PRODUCTS_DIR)/include/Cordova/**", - ); - INFOPLIST_FILE = "CordovaLibTests-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - ONLY_ACTIVE_ARCH = NO; - OTHER_LDFLAGS = ( - "-all_load", - "-ObjC", - ); - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CordovaFrameworkApp.app/CordovaFrameworkApp"; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../CordovaLib/Classes/Private/**"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "CordovaLibTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1DEB922308733DC00010E9CD /* Debug */, - 1DEB922408733DC00010E9CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 303A4082152124BB00182201 /* Build configuration list for PBXNativeTarget "CordovaLibApp" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 303A4083152124BB00182201 /* Debug */, - 303A4084152124BB00182201 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 686357BD141002F200DF4CF2 /* Build configuration list for PBXNativeTarget "CordovaLibTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 686357BB141002F200DF4CF2 /* Debug */, - 686357BC141002F200DF4CF2 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C0FA7CA71E4BB6420077B045 /* Build configuration list for PBXNativeTarget "CordovaFrameworkApp" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C0FA7CA81E4BB6420077B045 /* Debug */, - C0FA7CA91E4BB6420077B045 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C0FA7CC41E4BBBBE0077B045 /* Build configuration list for PBXNativeTarget "CordovaFrameworkTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C0FA7CC51E4BBBBE0077B045 /* Debug */, - C0FA7CC61E4BBBBE0077B045 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 0867D690FE84028FC02AAC07 /* Project object */; -} diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/Default-568h@2x.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/Default-568h@2x.png deleted file mode 100644 index 0891b7a..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/Default-568h@2x.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/config-custom.xml b/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/config-custom.xml deleted file mode 100644 index 18cf6a4..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/config-custom.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/en.lproj/InfoPlist.strings b/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/en.lproj/InfoPlist.strings deleted file mode 100644 index 01d5c8c..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/CordovaLibTests/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,20 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ -/* Localized versions of Info.plist keys */ - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/cordova-ios.xcworkspace/contents.xcworkspacedata b/chabok-starter-cordova/node_modules/cordova-ios/tests/cordova-ios.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 369ca40..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/cordova-ios.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/cordova-ios.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/chabok-starter-cordova/node_modules/cordova-ios/tests/cordova-ios.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index a7c3738..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/cordova-ios.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/cordova-ios.xcworkspace/xcshareddata/cordova-ios.xccheckout b/chabok-starter-cordova/node_modules/cordova-ios/tests/cordova-ios.xcworkspace/xcshareddata/cordova-ios.xccheckout deleted file mode 100644 index df6d866..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/cordova-ios.xcworkspace/xcshareddata/cordova-ios.xccheckout +++ /dev/null @@ -1,41 +0,0 @@ - - - - - IDESourceControlProjectFavoriteDictionaryKey - - IDESourceControlProjectIdentifier - 98C9766F-4C4F-444E-8FA9-C08C9A9BD59C - IDESourceControlProjectName - cordova-ios - IDESourceControlProjectOriginsDictionary - - BCEF5DF91F385AC4047CEAF9627D88E4C774D4FA - https://git-wip-us.apache.org/repos/asf/cordova-ios.git - - IDESourceControlProjectPath - tests/cordova-ios.xcworkspace - IDESourceControlProjectRelativeInstallPathDictionary - - BCEF5DF91F385AC4047CEAF9627D88E4C774D4FA - ../.. - - IDESourceControlProjectURL - https://git-wip-us.apache.org/repos/asf/cordova-ios.git - IDESourceControlProjectVersion - 111 - IDESourceControlProjectWCCIdentifier - BCEF5DF91F385AC4047CEAF9627D88E4C774D4FA - IDESourceControlProjectWCConfigurations - - - IDESourceControlRepositoryExtensionIdentifierKey - public.vcs.git - IDESourceControlWCCIdentifierKey - BCEF5DF91F385AC4047CEAF9627D88E4C774D4FA - IDESourceControlWCCName - cordova-ios - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/cordova-ios.xcworkspace/xcshareddata/xcschemes/CordovaFrameworkApp.xcscheme b/chabok-starter-cordova/node_modules/cordova-ios/tests/cordova-ios.xcworkspace/xcshareddata/xcschemes/CordovaFrameworkApp.xcscheme deleted file mode 100644 index b12b3e7..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/cordova-ios.xcworkspace/xcshareddata/xcschemes/CordovaFrameworkApp.xcscheme +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/cordova-ios.xcworkspace/xcshareddata/xcschemes/CordovaLib.xcscheme b/chabok-starter-cordova/node_modules/cordova-ios/tests/cordova-ios.xcworkspace/xcshareddata/xcschemes/CordovaLib.xcscheme deleted file mode 100644 index 9371655..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/cordova-ios.xcworkspace/xcshareddata/xcschemes/CordovaLib.xcscheme +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/cordova-ios.xcworkspace/xcshareddata/xcschemes/CordovaLibApp.xcscheme b/chabok-starter-cordova/node_modules/cordova-ios/tests/cordova-ios.xcworkspace/xcshareddata/xcschemes/CordovaLibApp.xcscheme deleted file mode 100644 index de2d31c..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/cordova-ios.xcworkspace/xcshareddata/xcschemes/CordovaLibApp.xcscheme +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/cordova-ios.xcworkspace/xcshareddata/xcschemes/CordovaLibTests.xcscheme b/chabok-starter-cordova/node_modules/cordova-ios/tests/cordova-ios.xcworkspace/xcshareddata/xcschemes/CordovaLibTests.xcscheme deleted file mode 100644 index a619d86..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/cordova-ios.xcworkspace/xcshareddata/xcschemes/CordovaLibTests.xcscheme +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/scripts/killsim.js b/chabok-starter-cordova/node_modules/cordova-ios/tests/scripts/killsim.js deleted file mode 100755 index 531b5e9..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/scripts/killsim.js +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env node - -/* - 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 shell = require('shelljs'); - -function killSimulator (processName) { - var result; - var return_code = 0; - // check iOS Simulator if running - var command = 'pgrep -x "' + processName + '" > /dev/null'; - return_code = shell.exec(command).code; - - // if iOS Simulator is running, kill it - if (return_code === 0) { // found - shell.echo('iOS Simulator is running as ("' + processName + '"), we\'re going to kill it.'); - result = shell.exec('killall "' + processName + '"'); - if (result.code !== 0) { - shell.echo('Failed to kill process: ' + processName); - } else { - shell.echo('Process was killed: ' + processName); - } - } -} - -killSimulator('iOS Simulator'); // XCode 6 -killSimulator('Simulator'); // XCode 7 diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/.eslintrc.yml b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/.eslintrc.yml deleted file mode 100644 index 6afba65..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/.eslintrc.yml +++ /dev/null @@ -1,2 +0,0 @@ -env: - jasmine: true \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/component.json b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/component.json deleted file mode 100644 index d8a708a..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/component.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "spec_dir": "tests/spec", - "spec_files": [ - "component/**/*[sS]pec.js" - ], - "stopSpecOnExpectationFailure": false, - "random": false -} diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/component/versions.spec.js b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/component/versions.spec.js deleted file mode 100644 index 9f10f63..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/component/versions.spec.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -var rewire = require('rewire'); -var versions = rewire('../../../bin/templates/scripts/cordova/lib/versions'); - -// These tests can not run on windows. -if (process.platform === 'darwin') { - describe('versions', function () { - describe('get_tool_version method', () => { - it('should not have found tool by name.', () => { - return versions.get_tool_version('unknown').then( - () => fail('expected promise rejection'), - error => expect(error).toContain('is not valid tool name') - ); - }); - - it('should find xcodebuild version.', () => { - return versions.get_tool_version('xcodebuild').then((version) => { - expect(version).not.toBe(undefined); - }); - }); - - it('should find ios-sim version.', () => { - return versions.get_tool_version('ios-sim').then((version) => { - expect(version).not.toBe(undefined); - }); - }); - - it('should find ios-deploy version.', () => { - return versions.get_tool_version('ios-deploy').then((version) => { - expect(version).not.toBe(undefined); - }); - }); - - it('should find pod version.', () => { - return versions.get_tool_version('pod').then((version) => { - expect(version).not.toBe(undefined); - }); - }); - }); - }); -} diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/coverage.json b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/coverage.json deleted file mode 100644 index 2ec72bbf..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/coverage.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "spec_dir": "tests/spec", - "spec_files": [ - "unit/**/*[sS]pec.js", - "component/**/*[sS]pec.js" - ], - "stopSpecOnExpectationFailure": false, - "random": false -} diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/create.spec.js b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/create.spec.js deleted file mode 100644 index dbb04f8..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/create.spec.js +++ /dev/null @@ -1,110 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -var shell = require('shelljs'); -var spec = __dirname; -var path = require('path'); -var util = require('util'); - -var cordova_bin = path.join(spec, '../..', 'bin'); -var tmp = require('tmp').dirSync().name; - -function createAndBuild (projectname, projectid) { - var return_code = 0; - var command; - - // remove existing folder - command = path.join(tmp, projectname); - shell.rm('-rf', command); - - // create the project - command = util.format('"%s/create" "%s/%s" %s "%s"', cordova_bin, tmp, projectname, projectid, projectname); - shell.echo(command); - return_code = shell.exec(command).code; - expect(return_code).toBe(0); - - // build the project - command = util.format('"%s/cordova/build" --emulator', path.join(tmp, projectname)); - shell.echo(command); - return_code = shell.exec(command, { silent: true }).code; - expect(return_code).toBe(0); - - // clean-up - command = path.join(tmp, projectname); - shell.rm('-rf', command); -} - -describe('create', function () { - - it('Test#001 : create project with ascii name, no spaces', function () { - var projectname = 'testcreate'; - var projectid = 'com.test.app1'; - - createAndBuild(projectname, projectid); - }); - - it('Test#002 : create project with ascii name, and spaces', function () { - var projectname = 'test create'; - var projectid = 'com.test.app2'; - - createAndBuild(projectname, projectid); - }); - - it('Test#003 : create project with unicode name, no spaces', function () { - var projectname = '応応応応用用用用'; - var projectid = 'com.test.app3'; - - createAndBuild(projectname, projectid); - }); - - it('Test#004 : create project with unicode name 2, no spaces', function () { - var projectname = 'إثرا'; - var projectid = 'com.test.app3.2'; - - createAndBuild(projectname, projectid); - }); - - it('Test#005 : create project with unicode name, and spaces', function () { - var projectname = '応応応応 用用用用'; - var projectid = 'com.test.app4'; - - createAndBuild(projectname, projectid); - }); - - it('Test#006 : create project with ascii+unicode name, no spaces', function () { - var projectname = '応応応応hello用用用用'; - var projectid = 'com.test.app5'; - - createAndBuild(projectname, projectid); - }); - - it('Test#007 : create project with ascii+unicode name, and spaces', function () { - var projectname = '応応応応 hello 用用用用'; - var projectid = 'com.test.app6'; - - createAndBuild(projectname, projectid); - }); - - it('Test#008 : create project with ascii name, and spaces, ampersand(&)', function () { - var projectname = 'hello & world'; - var projectid = 'com.test.app7'; - - createAndBuild(projectname, projectid); - }); -}); diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit.json b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit.json deleted file mode 100644 index b95d161..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "spec_dir": "tests/spec", - "spec_files": [ - "unit/**/*[sS]pec.js" - ], - "stopSpecOnExpectationFailure": false, - "random": false -} diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/Api.spec.js b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/Api.spec.js deleted file mode 100644 index 227f427..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/Api.spec.js +++ /dev/null @@ -1,602 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -var path = require('path'); -var fs = require('fs'); -const EventEmitter = require('events'); -var PluginManager = require('cordova-common').PluginManager; -var Api = require('../../../bin/templates/scripts/cordova/Api'); -var check_reqs = require('../../../bin/templates/scripts/cordova/lib/check_reqs'); - -// The lib/run module pulls in ios-sim, which has a hard requirement that it -// be run on a Mac OS - simply requiring the module is enough to trigger the -// environment checks. These checks will blow up on Windows + Linux. -// So, conditionally pull in the module, and conditionally test the `run` -// method (more below). -var run_mod; -if (process.platform === 'darwin') { - run_mod = require('../../../bin/templates/scripts/cordova/lib/run'); -} - -var projectFile = require('../../../bin/templates/scripts/cordova/lib/projectFile'); -var BridgingHeader_mod = require('../../../bin/templates/scripts/cordova/lib/BridgingHeader.js'); -var Podfile_mod = require('../../../bin/templates/scripts/cordova/lib/Podfile'); -var PodsJson_mod = require('../../../bin/templates/scripts/cordova/lib/PodsJson'); -var Q = require('q'); -var FIXTURES = path.join(__dirname, 'fixtures'); -var iosProjectFixture = path.join(FIXTURES, 'ios-config-xml'); - -function compareListWithoutOrder (list1, list2) { - expect(list1.sort()).toEqual(list2.sort()); -} - -describe('Platform Api', function () { - - describe('constructor', function () { - it('Test 001 : should throw if provided directory does not contain an xcodeproj file', function () { - expect(() => - new Api('ios', path.join(FIXTURES, '..'), new EventEmitter()) - ).toThrow(); - }); - it('Test 002 : should create an instance with path, pbxproj, xcodeproj, originalName and cordovaproj properties', function () { - expect(function () { - var p = new Api('ios', iosProjectFixture, new EventEmitter()); - expect(p.locations.root).toEqual(iosProjectFixture); - expect(p.locations.pbxproj).toEqual(path.join(iosProjectFixture, 'SampleApp.xcodeproj', 'project.pbxproj')); - expect(p.locations.xcodeProjDir).toEqual(path.join(iosProjectFixture, 'SampleApp.xcodeproj')); - expect(p.locations.www).toEqual(path.join(iosProjectFixture, 'www')); - expect(p.locations.configXml).toEqual(path.join(iosProjectFixture, 'SampleApp', 'config.xml')); - }).not.toThrow(); - }); - }); - - describe('.prototype', function () { - var api, events; - var projectRoot = iosProjectFixture; - beforeEach(function () { - events = new EventEmitter(); - api = new Api('ios', projectRoot, events); - spyOn(fs, 'readdirSync').and.returnValue([api.locations.xcodeProjDir]); - spyOn(projectFile, 'parse').and.returnValue({ - getPackageName: function () { return 'ios.cordova.io'; } - }); - }); - - // See the comment at the top of this file, in the list of requires, - // for information on why we conditionall run this test. - // tl;dr run_mod requires the ios-sim module, which requires mac OS. - if (process.platform === 'darwin') { - describe('run', function () { - beforeEach(function () { - spyOn(check_reqs, 'run').and.returnValue(Q.resolve()); - }); - it('should call into lib/run module', function () { - spyOn(run_mod, 'run'); - return api.run().then(function () { - expect(run_mod.run).toHaveBeenCalled(); - }); - }); - }); - } - - describe('addPlugin', function () { - var my_plugin = { - getHeaderFiles: function () { return []; }, - getFrameworks: function () { return []; }, - getPodSpecs: function () { return []; } - }; - beforeEach(function () { - spyOn(PluginManager, 'get').and.returnValue({ - addPlugin: function () { return Q(); } - }); - spyOn(BridgingHeader_mod, 'BridgingHeader'); - spyOn(Podfile_mod, 'Podfile'); - spyOn(PodsJson_mod, 'PodsJson'); - }); - it('should assign a package name to plugin variables if one is not explicitly provided via options', function () { - var opts = {}; - return api.addPlugin(my_plugin, opts) - .then(() => expect(opts.variables.PACKAGE_NAME).toEqual('ios.cordova.io')); - }); - describe('with header-file of `BridgingHeader` type', function () { - var bridgingHeader_mock; - var my_bridgingHeader_json = { - type: 'BridgingHeader', - src: 'bridgingHeaderSource!' - }; - beforeEach(function () { - bridgingHeader_mock = jasmine.createSpyObj('bridgingHeader mock', ['addHeader', 'write']); - spyOn(my_plugin, 'getFrameworks').and.returnValue([]); - spyOn(my_plugin, 'getHeaderFiles').and.returnValue([my_bridgingHeader_json]); - BridgingHeader_mod.BridgingHeader.and.callFake(function () { - return bridgingHeader_mock; - }); - }); - it('should add BridgingHeader', function () { - return api.addPlugin(my_plugin) - .then(function () { - expect(bridgingHeader_mock.addHeader).toHaveBeenCalledWith(my_plugin.id, 'bridgingHeaderSource!'); - expect(bridgingHeader_mock.write).toHaveBeenCalled(); - }); - }); - }); - describe('adding pods since the plugin contained ', function () { - var podsjson_mock; - var podfile_mock; - var my_pod_json = { - declarations: { - 'use-frameworks': 'true', - 'inhibit_all_warnings!': 'true' - }, - sources: { - 'https://github.com/sample/SampleSpecs.git': { source: 'https://github.com/sample/SampleSpecs.git' }, - 'https://github.com/CocoaPods/Specs.git': { source: 'https://github.com/CocoaPods/Specs.git' } - }, - libraries: { - 'AFNetworking': { - name: 'AFNetworking', - spec: '~> 3.2' - }, - 'Eureka': { - name: 'Eureka', - spec: '4.0', - 'swift-version': '4.1' - }, - 'HogeLib': { - name: 'HogeLib', - git: 'https://github.com/hoge/HogewLib.git', - branch: 'develop' - } - } - }; - beforeEach(function () { - podsjson_mock = jasmine.createSpyObj('podsjson mock', ['getLibrary', 'getSource', 'getDeclaration', - 'incrementLibrary', 'incrementSource', 'incrementDeclaration', 'write', - 'setJsonLibrary', 'setJsonSource', 'setJsonDeclaration']); - podfile_mock = jasmine.createSpyObj('podfile mock', ['isDirty', 'addSpec', 'addSource', 'addDeclaration', 'write', 'install']); - spyOn(my_plugin, 'getFrameworks').and.returnValue([]); - spyOn(my_plugin, 'getPodSpecs').and.returnValue([my_pod_json]); - PodsJson_mod.PodsJson.and.callFake(function () { - return podsjson_mock; - }); - Podfile_mod.Podfile.and.callFake(function () { - return podfile_mock; - }); - }); - it('on a new declaration, it should add a new json to declarations', function () { - return api.addPlugin(my_plugin) - .then(function () { - expect(podsjson_mock.getDeclaration.calls.count()).toEqual(2); - compareListWithoutOrder(podsjson_mock.getDeclaration.calls.allArgs(), [['use_frameworks!'], ['inhibit_all_warnings!']]); - expect(podsjson_mock.setJsonDeclaration.calls.count()).toEqual(2); - compareListWithoutOrder(podsjson_mock.setJsonDeclaration.calls.allArgs(), - [['use_frameworks!', { declaration: 'use_frameworks!', count: 1 }], ['inhibit_all_warnings!', { declaration: 'inhibit_all_warnings!', count: 1 }]]); - expect(podfile_mock.addDeclaration.calls.count()).toEqual(2); - compareListWithoutOrder(podfile_mock.addDeclaration.calls.allArgs(), [['use_frameworks!'], ['inhibit_all_warnings!']]); - }); - }); - it('should increment count in declarations if already exists', function () { - podsjson_mock.getDeclaration.and.callFake(function (declaration) { - if (declaration === 'use_frameworks!') { - return { declaration: 'use_frameworks!', count: 1 }; - } - return null; - }); - return api.addPlugin(my_plugin) - .then(function () { - expect(podsjson_mock.getDeclaration.calls.count()).toEqual(2); - compareListWithoutOrder(podsjson_mock.getDeclaration.calls.allArgs(), [['use_frameworks!'], ['inhibit_all_warnings!']]); - expect(podsjson_mock.incrementDeclaration).toHaveBeenCalledWith('use_frameworks!'); - expect(podsjson_mock.setJsonDeclaration.calls.count()).toEqual(1); - compareListWithoutOrder(podsjson_mock.setJsonDeclaration.calls.allArgs(), [['inhibit_all_warnings!', { declaration: 'inhibit_all_warnings!', count: 1 }]]); - expect(podfile_mock.addDeclaration.calls.count()).toEqual(1); - compareListWithoutOrder(podfile_mock.addDeclaration.calls.allArgs(), [['inhibit_all_warnings!']]); - }); - }); - it('on a new source, it should add a new json to sources', function () { - return api.addPlugin(my_plugin) - .then(function () { - expect(podsjson_mock.getSource.calls.count()).toEqual(2); - compareListWithoutOrder(podsjson_mock.getSource.calls.allArgs(), [['https://github.com/sample/SampleSpecs.git'], ['https://github.com/CocoaPods/Specs.git']]); - expect(podsjson_mock.setJsonSource.calls.count()).toEqual(2); - compareListWithoutOrder(podsjson_mock.setJsonSource.calls.allArgs(), [ - ['https://github.com/sample/SampleSpecs.git', { source: 'https://github.com/sample/SampleSpecs.git', count: 1 }], - ['https://github.com/CocoaPods/Specs.git', { source: 'https://github.com/CocoaPods/Specs.git', count: 1 }] - ]); - expect(podfile_mock.addSource.calls.count()).toEqual(2); - compareListWithoutOrder(podfile_mock.addSource.calls.allArgs(), [['https://github.com/sample/SampleSpecs.git'], ['https://github.com/CocoaPods/Specs.git']]); - }); - }); - it('should increment count in sources if already exists', function () { - podsjson_mock.getSource.and.callFake(function (source) { - if (source === 'https://github.com/CocoaPods/Specs.git') { - return { source: 'https://github.com/CocoaPods/Specs.git', count: 1 }; - } - return null; - }); - return api.addPlugin(my_plugin) - .then(function () { - expect(podsjson_mock.getSource.calls.count()).toEqual(2); - compareListWithoutOrder(podsjson_mock.getSource.calls.allArgs(), [['https://github.com/sample/SampleSpecs.git'], ['https://github.com/CocoaPods/Specs.git']]); - expect(podsjson_mock.incrementSource).toHaveBeenCalledWith('https://github.com/CocoaPods/Specs.git'); - expect(podsjson_mock.setJsonSource.calls.count()).toEqual(1); - compareListWithoutOrder(podsjson_mock.setJsonSource.calls.allArgs(), [['https://github.com/sample/SampleSpecs.git', { source: 'https://github.com/sample/SampleSpecs.git', count: 1 }]]); - expect(podfile_mock.addSource.calls.count()).toEqual(1); - compareListWithoutOrder(podfile_mock.addSource.calls.allArgs(), [['https://github.com/sample/SampleSpecs.git']]); - }); - }); - it('on a new library, it should add a new json to library', function () { - return api.addPlugin(my_plugin) - .then(function () { - expect(podsjson_mock.getLibrary.calls.count()).toEqual(3); - compareListWithoutOrder(podsjson_mock.getLibrary.calls.allArgs(), [ - ['AFNetworking'], - ['Eureka'], - ['HogeLib'] - ]); - expect(podsjson_mock.setJsonLibrary.calls.count()).toEqual(3); - compareListWithoutOrder(podsjson_mock.setJsonLibrary.calls.allArgs(), [ - ['AFNetworking', { name: 'AFNetworking', spec: '~> 3.2', count: 1 }], - ['Eureka', { name: 'Eureka', spec: '4.0', 'swift-version': '4.1', count: 1 }], - ['HogeLib', { name: 'HogeLib', git: 'https://github.com/hoge/HogewLib.git', branch: 'develop', count: 1 }] - ]); - expect(podfile_mock.addSpec.calls.count()).toEqual(3); - compareListWithoutOrder(podfile_mock.addSpec.calls.allArgs(), [ - ['AFNetworking', { name: 'AFNetworking', spec: '~> 3.2', count: 1 }], - ['Eureka', { name: 'Eureka', spec: '4.0', 'swift-version': '4.1', count: 1 }], - ['HogeLib', { name: 'HogeLib', git: 'https://github.com/hoge/HogewLib.git', branch: 'develop', count: 1 }] - ]); - }); - }); - it('should increment count in libraries if already exists', function () { - podsjson_mock.getLibrary.and.callFake(function (library) { - if (library === 'AFNetworking') { - return { name: 'AFNetworking', spec: '~> 3.2', count: 1 }; - } - return null; - }); - return api.addPlugin(my_plugin) - .then(function () { - expect(podsjson_mock.getLibrary.calls.count()).toEqual(3); - compareListWithoutOrder(podsjson_mock.getLibrary.calls.allArgs(), [ - ['AFNetworking'], - ['Eureka'], - ['HogeLib'] - ]); - expect(podsjson_mock.incrementLibrary).toHaveBeenCalledWith('AFNetworking'); - expect(podsjson_mock.setJsonLibrary.calls.count()).toEqual(2); - compareListWithoutOrder(podsjson_mock.setJsonLibrary.calls.allArgs(), [ - ['Eureka', { name: 'Eureka', spec: '4.0', 'swift-version': '4.1', count: 1 }], - ['HogeLib', { name: 'HogeLib', git: 'https://github.com/hoge/HogewLib.git', branch: 'develop', count: 1 }] - ]); - expect(podfile_mock.addSpec.calls.count()).toEqual(2); - compareListWithoutOrder(podfile_mock.addSpec.calls.allArgs(), [ - ['Eureka', { name: 'Eureka', spec: '4.0', 'swift-version': '4.1', count: 1 }], - ['HogeLib', { name: 'HogeLib', git: 'https://github.com/hoge/HogewLib.git', branch: 'develop', count: 1 }] - ]); - }); - }); - }); - describe('with frameworks of `podspec` type', function () { - var podsjson_mock; - var podfile_mock; - var my_pod_json = { - type: 'podspec', - src: 'podsource!', - spec: 'podspec!' - }; - beforeEach(function () { - podsjson_mock = jasmine.createSpyObj('podsjson mock', ['getLibrary', 'incrementLibrary', 'write', 'setJsonLibrary']); - podfile_mock = jasmine.createSpyObj('podfile mock', ['isDirty', 'addSpec', 'write', 'install']); - spyOn(my_plugin, 'getFrameworks').and.returnValue([my_pod_json]); - PodsJson_mod.PodsJson.and.callFake(function () { - return podsjson_mock; - }); - Podfile_mod.Podfile.and.callFake(function () { - return podfile_mock; - }); - }); - // TODO: a little help with clearly labeling / describing the tests below? :( - it('should warn if Pods JSON contains name/src but differs in spec', function () { - podsjson_mock.getLibrary.and.returnValue({ - spec: 'something different from ' + my_pod_json.spec - }); - spyOn(events, 'emit'); - return api.addPlugin(my_plugin) - .then(function () { - expect(events.emit).toHaveBeenCalledWith('warn', jasmine.stringMatching(/which conflicts with another plugin/g)); - }); - }); - it('should increment Pods JSON file if pod name/src already exists in file', function () { - podsjson_mock.getLibrary.and.returnValue({ - spec: my_pod_json.spec - }); - return api.addPlugin(my_plugin) - .then(function () { - expect(podsjson_mock.incrementLibrary).toHaveBeenCalledWith('podsource!'); - }); - }); - it('on a new framework/pod name/src/key, it should add a new json to podsjson and add a new spec to podfile', function () { - return api.addPlugin(my_plugin) - .then(function () { - expect(podsjson_mock.setJsonLibrary).toHaveBeenCalledWith(my_pod_json.src, jasmine.any(Object)); - expect(podfile_mock.addSpec).toHaveBeenCalledWith(my_pod_json.src, my_pod_json.spec); - }); - }); - it('should write out podfile and install if podfile was changed', function () { - podfile_mock.isDirty.and.returnValue(true); - podfile_mock.install.and.returnValue({ then: function () { } }); - return api.addPlugin(my_plugin) - .then(function () { - expect(podfile_mock.write).toHaveBeenCalled(); - expect(podfile_mock.install).toHaveBeenCalled(); - }); - }); - it('if two frameworks with the same name are added, should honour the spec of the first-installed plugin', function () { - podsjson_mock.getLibrary.and.returnValue({ - spec: 'something different from ' + my_pod_json.spec - }); - return api.addPlugin(my_plugin) - .then(function () { - // Increment will non-destructively set the spec to keep it as it was... - expect(podsjson_mock.incrementLibrary).toHaveBeenCalledWith(my_pod_json.src); - // ...whereas setJson would overwrite it completely. - expect(podsjson_mock.setJsonLibrary).not.toHaveBeenCalled(); - }); - }); - }); - }); - describe('removePlugin', function () { - var my_plugin = { - getHeaderFiles: function () { return []; }, - getFrameworks: function () {}, - getPodSpecs: function () { return []; } - }; - beforeEach(function () { - spyOn(PluginManager, 'get').and.returnValue({ - removePlugin: function () { return Q(); } - }); - spyOn(Podfile_mod, 'Podfile'); - spyOn(PodsJson_mod, 'PodsJson'); - }); - describe('removing pods since the plugin contained ', function () { - var podsjson_mock; - var podfile_mock; - var my_pod_json = { - declarations: { - 'use-frameworks': 'true', - 'inhibit_all_warnings!': 'true' - }, - sources: { - 'https://github.com/sample/SampleSpecs.git': { source: 'https://github.com/sample/SampleSpecs.git' }, - 'https://github.com/CocoaPods/Specs.git': { source: 'https://github.com/CocoaPods/Specs.git' } - }, - libraries: { - 'AFNetworking': { - name: 'AFNetworking', - spec: '~> 3.2' - }, - 'Eureka': { - name: 'Eureka', - spec: '4.0', - 'swift-version': '4.1' - }, - 'HogeLib': { - name: 'HogeLib', - git: 'https://github.com/hoge/HogewLib.git', - branch: 'develop' - } - } - }; - beforeEach(function () { - podsjson_mock = jasmine.createSpyObj('podsjson mock', ['getLibrary', 'getSource', 'getDeclaration', - 'decrementLibrary', 'decrementSource', 'decrementDeclaration', 'write', - 'setJsonLibrary', 'setJsonSource', 'setJsonDeclaration']); - podfile_mock = jasmine.createSpyObj('podfile mock', ['isDirty', 'removeSpec', 'removeSource', 'removeDeclaration', 'write', 'install']); - spyOn(my_plugin, 'getFrameworks').and.returnValue([]); - spyOn(my_plugin, 'getPodSpecs').and.returnValue([my_pod_json]); - PodsJson_mod.PodsJson.and.callFake(function () { - return podsjson_mock; - }); - Podfile_mod.Podfile.and.callFake(function () { - return podfile_mock; - }); - }); - it('on a last declaration, it should remove a json from declarations', function () { - var json1 = { declaration: 'use_frameworks!', count: 1 }; - var json2 = { declaration: 'inhibit_all_warnings!', count: 1 }; - podsjson_mock.getDeclaration.and.callFake(function (declaration) { - if (declaration === 'use_frameworks!') { - return json1; - } else if (declaration === 'inhibit_all_warnings!') { - return json2; - } - return null; - }); - podsjson_mock.decrementDeclaration.and.callFake(function (declaration) { - if (declaration === 'use_frameworks!') { - json1.count--; - } else if (declaration === 'inhibit_all_warnings!') { - json2.count--; - } - }); - return api.removePlugin(my_plugin) - .then(function () { - expect(podsjson_mock.getDeclaration.calls.count()).toEqual(2); - compareListWithoutOrder(podsjson_mock.getDeclaration.calls.allArgs(), [['use_frameworks!'], ['inhibit_all_warnings!']]); - expect(podsjson_mock.decrementDeclaration.calls.count()).toEqual(2); - compareListWithoutOrder(podsjson_mock.decrementDeclaration.calls.allArgs(), [['use_frameworks!'], ['inhibit_all_warnings!']]); - expect(podfile_mock.removeDeclaration.calls.count()).toEqual(2); - compareListWithoutOrder(podfile_mock.removeDeclaration.calls.allArgs(), [['use_frameworks!'], ['inhibit_all_warnings!']]); - }); - }); - it('should decrement count in declarations and does not remove if count > 1', function () { - var json1 = { declaration: 'use_frameworks!', count: 2 }; - var json2 = { declaration: 'inhibit_all_warnings!', count: 1 }; - podsjson_mock.getDeclaration.and.callFake(function (declaration) { - if (declaration === 'use_frameworks!') { - return json1; - } else if (declaration === 'inhibit_all_warnings!') { - return json2; - } - return null; - }); - podsjson_mock.decrementDeclaration.and.callFake(function (declaration) { - if (declaration === 'use_frameworks!') { - json1.count--; - } else if (declaration === 'inhibit_all_warnings!') { - json2.count--; - } - }); - return api.removePlugin(my_plugin) - .then(function () { - expect(podsjson_mock.getDeclaration.calls.count()).toEqual(2); - compareListWithoutOrder(podsjson_mock.getDeclaration.calls.allArgs(), [['use_frameworks!'], ['inhibit_all_warnings!']]); - expect(podsjson_mock.decrementDeclaration.calls.count()).toEqual(2); - compareListWithoutOrder(podsjson_mock.decrementDeclaration.calls.allArgs(), [['use_frameworks!'], ['inhibit_all_warnings!']]); - expect(podfile_mock.removeDeclaration.calls.count()).toEqual(1); - compareListWithoutOrder(podfile_mock.removeDeclaration.calls.allArgs(), [['inhibit_all_warnings!']]); - }); - }); - it('on a last source, it should remove a json from sources', function () { - var json1 = { source: 'https://github.com/sample/SampleSpecs.git', count: 1 }; - var json2 = { source: 'https://github.com/CocoaPods/Specs.git', count: 1 }; - podsjson_mock.getSource.and.callFake(function (source) { - if (source === 'https://github.com/sample/SampleSpecs.git') { - return json1; - } else if (source === 'https://github.com/CocoaPods/Specs.git') { - return json2; - } - return null; - }); - podsjson_mock.decrementSource.and.callFake(function (source) { - if (source === 'https://github.com/sample/SampleSpecs.git') { - json1.count--; - } else if (source === 'https://github.com/CocoaPods/Specs.git') { - json2.count--; - } - }); - return api.removePlugin(my_plugin) - .then(function () { - expect(podsjson_mock.getSource.calls.count()).toEqual(2); - compareListWithoutOrder(podsjson_mock.getSource.calls.allArgs(), [['https://github.com/sample/SampleSpecs.git'], ['https://github.com/CocoaPods/Specs.git']]); - expect(podsjson_mock.decrementSource.calls.count()).toEqual(2); - compareListWithoutOrder(podsjson_mock.decrementSource.calls.allArgs(), [['https://github.com/sample/SampleSpecs.git'], ['https://github.com/CocoaPods/Specs.git']]); - expect(podfile_mock.removeSource.calls.count()).toEqual(2); - compareListWithoutOrder(podfile_mock.removeSource.calls.allArgs(), [['https://github.com/sample/SampleSpecs.git'], ['https://github.com/CocoaPods/Specs.git']]); - }); - }); - it('should decrement count in sources and does not remove if count > 1', function () { - var json1 = { source: 'https://github.com/sample/SampleSpecs.git', count: 2 }; - var json2 = { source: 'https://github.com/CocoaPods/Specs.git', count: 1 }; - podsjson_mock.getSource.and.callFake(function (source) { - if (source === 'https://github.com/sample/SampleSpecs.git') { - return json1; - } else if (source === 'https://github.com/CocoaPods/Specs.git') { - return json2; - } - return null; - }); - podsjson_mock.decrementSource.and.callFake(function (source) { - if (source === 'https://github.com/sample/SampleSpecs.git') { - json1.count--; - } else if (source === 'https://github.com/CocoaPods/Specs.git') { - json2.count--; - } - }); - return api.removePlugin(my_plugin) - .then(function () { - expect(podsjson_mock.getSource.calls.count()).toEqual(2); - compareListWithoutOrder(podsjson_mock.getSource.calls.allArgs(), [['https://github.com/sample/SampleSpecs.git'], ['https://github.com/CocoaPods/Specs.git']]); - expect(podsjson_mock.decrementSource.calls.count()).toEqual(2); - compareListWithoutOrder(podsjson_mock.decrementSource.calls.allArgs(), [['https://github.com/sample/SampleSpecs.git'], ['https://github.com/CocoaPods/Specs.git']]); - expect(podfile_mock.removeSource.calls.count()).toEqual(1); - compareListWithoutOrder(podfile_mock.removeSource.calls.allArgs(), [['https://github.com/CocoaPods/Specs.git']]); - }); - }); - it('on a last library, it should remove a json from libraries', function () { - var json1 = Object.assign({}, my_pod_json.libraries['AFNetworking'], { count: 1 }); - var json2 = Object.assign({}, my_pod_json.libraries['Eureka'], { count: 1 }); - var json3 = Object.assign({}, my_pod_json.libraries['HogeLib'], { count: 1 }); - podsjson_mock.getLibrary.and.callFake(function (name) { - if (name === json1.name) { - return json1; - } else if (name === json2.name) { - return json2; - } else if (name === json3.name) { - return json3; - } - return null; - }); - podsjson_mock.decrementLibrary.and.callFake(function (name) { - if (name === json1.name) { - json1.count--; - } else if (name === json2.name) { - json2.count--; - } else if (name === json3.name) { - json3.count--; - } - }); - return api.removePlugin(my_plugin) - .then(function () { - expect(podsjson_mock.getLibrary.calls.count()).toEqual(3); - compareListWithoutOrder(podsjson_mock.getLibrary.calls.allArgs(), [[json1.name], [json2.name], [json3.name]]); - expect(podsjson_mock.decrementLibrary.calls.count()).toEqual(3); - compareListWithoutOrder(podsjson_mock.decrementLibrary.calls.allArgs(), [[json1.name], [json2.name], [json3.name]]); - expect(podfile_mock.removeSpec.calls.count()).toEqual(3); - compareListWithoutOrder(podfile_mock.removeSpec.calls.allArgs(), [[json1.name], [json2.name], [json3.name]]); - }); - }); - it('should decrement count in libraries and does not remove if count > 1', function () { - var json1 = Object.assign({}, my_pod_json.libraries['AFNetworking'], { count: 2 }); - var json2 = Object.assign({}, my_pod_json.libraries['Eureka'], { count: 1 }); - var json3 = Object.assign({}, my_pod_json.libraries['HogeLib'], { count: 1 }); - podsjson_mock.getLibrary.and.callFake(function (name) { - if (name === json1.name) { - return json1; - } else if (name === json2.name) { - return json2; - } else if (name === json3.name) { - return json3; - } - return null; - }); - podsjson_mock.decrementLibrary.and.callFake(function (name) { - if (name === json1.name) { - json1.count--; - } else if (name === json2.name) { - json2.count--; - } else if (name === json3.name) { - json3.count--; - } - }); - return api.removePlugin(my_plugin) - .then(function () { - expect(podsjson_mock.getLibrary.calls.count()).toEqual(3); - compareListWithoutOrder(podsjson_mock.getLibrary.calls.allArgs(), [[json1.name], [json2.name], [json3.name]]); - expect(podsjson_mock.decrementLibrary.calls.count()).toEqual(3); - compareListWithoutOrder(podsjson_mock.decrementLibrary.calls.allArgs(), [[json1.name], [json2.name], [json3.name]]); - expect(podfile_mock.removeSpec.calls.count()).toEqual(2); - compareListWithoutOrder(podfile_mock.removeSpec.calls.allArgs(), [[json2.name], [json3.name]]); - }); - }); - }); - }); - }); -}); diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/BridgingHeader.spec.js b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/BridgingHeader.spec.js deleted file mode 100644 index f28bcb8..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/BridgingHeader.spec.js +++ /dev/null @@ -1,130 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -var fs = require('fs'); -var path = require('path'); - -var BridgingHeader = require(path.resolve(path.join(__dirname, '..', '..', '..', 'bin', 'templates', 'scripts', 'cordova', 'lib', 'BridgingHeader.js'))).BridgingHeader; -var fixtureBridgingHeader = fs.readFileSync(path.resolve(__dirname, 'fixtures', 'test-Bridging-Header.h'), 'utf-8'); - -describe('unit tests for BridgingHeader module', function () { - var existsSyncSpy; - var readFileSyncSpy; - var writeFileSyncSpy; - var dummy_path = 'dummy_path'; - var dummy_plugin = { id: 'dummy_plugin', header_path: 'dummy_header_path' }; - var dummy_plugin2 = { id: 'dummy_plugin2', header_path: 'dummy_header_path2' }; - var headerImportText = function (header_path) { return '#import "' + header_path + '"'; }; - - beforeEach(function () { - existsSyncSpy = spyOn(fs, 'existsSync'); - readFileSyncSpy = spyOn(fs, 'readFileSync'); - writeFileSyncSpy = spyOn(fs, 'writeFileSync'); - }); - it('Test#001 : should error if BridgingHeader file does not exist', function () { - existsSyncSpy.and.returnValue(false); - expect(function () { - var _ = new BridgingHeader(fixtureBridgingHeader); - expect(_).not.toEqual(null); // To avoid ESLINT error "Do not use 'new' for side effects" - }).toThrow(); - }); - it('Test#002 : load BridgingHeader file', function () { - existsSyncSpy.and.returnValue(true); - readFileSyncSpy.and.returnValue(fixtureBridgingHeader); - - var bridgingHeader = new BridgingHeader(dummy_path); - expect(bridgingHeader.path).toEqual(dummy_path); - expect(bridgingHeader).not.toEqual(null); - }); - it('Test#003 : add and remove a BridgingHeader', function () { - var result_json = null; - var text_list = null; - var bridgingHeaderFileContent = fixtureBridgingHeader; - existsSyncSpy.and.returnValue(true); - readFileSyncSpy.and.callFake(function (read_path, charset) { - return bridgingHeaderFileContent; - }); - writeFileSyncSpy.and.callFake(function (write_path, text, charset) { - result_json = { write_path: write_path, text: text, charset: charset }; - }); - - var bridgingHeader = new BridgingHeader(dummy_path); - bridgingHeader.addHeader(dummy_plugin.id, dummy_plugin.header_path); - bridgingHeader.write(); - expect(result_json).not.toEqual(null); - expect(result_json.write_path).toEqual(dummy_path); - expect(result_json.text).not.toEqual(null); - expect(result_json.charset).toEqual('utf8'); - text_list = result_json.text.split('\n'); - expect(text_list.filter(function (line) { return line === headerImportText(dummy_plugin.header_path); }).length).toEqual(1); - - bridgingHeader = new BridgingHeader(dummy_path); - bridgingHeader.removeHeader(dummy_plugin.id, dummy_plugin.header_path); - bridgingHeader.write(); - expect(result_json).not.toEqual(null); - expect(result_json.write_path).toEqual(dummy_path); - expect(result_json.text).not.toEqual(null); - expect(result_json.charset).toEqual('utf8'); - text_list = result_json.text.split('\n'); - expect(text_list.filter(function (line) { return line === headerImportText(dummy_plugin.header_path); }).length).toEqual(0); - }); - it('Test#004 : add and remove two BridgingHeaders', function () { - var result_json = null; - var text_list = null; - var bridgingHeaderFileContent = fixtureBridgingHeader; - existsSyncSpy.and.returnValue(true); - readFileSyncSpy.and.callFake(function (read_path, charset) { - return bridgingHeaderFileContent; - }); - writeFileSyncSpy.and.callFake(function (write_path, text, charset) { - bridgingHeaderFileContent = text; - result_json = { write_path: write_path, text: text, charset: charset }; - }); - - var bridgingHeader = new BridgingHeader(dummy_path); - bridgingHeader.addHeader(dummy_plugin.id, dummy_plugin.header_path); - bridgingHeader.write(); - - bridgingHeader = new BridgingHeader(dummy_path); - bridgingHeader.addHeader(dummy_plugin2.id, dummy_plugin2.header_path); - bridgingHeader.write(); - - text_list = result_json.text.split('\n'); - expect(text_list.filter(function (line) { return line === headerImportText(dummy_plugin.header_path); }).length).toEqual(1); - expect(text_list.filter(function (line) { return line === headerImportText(dummy_plugin2.header_path); }).length).toEqual(1); - - bridgingHeader = new BridgingHeader(dummy_path); - bridgingHeader.removeHeader(dummy_plugin.id, dummy_plugin.header_path); - bridgingHeader.write(); - - text_list = result_json.text.split('\n'); - expect(text_list.filter(function (line) { return line === headerImportText(dummy_plugin.header_path); }).length).toEqual(0); - expect(text_list.filter(function (line) { return line === headerImportText(dummy_plugin2.header_path); }).length).toEqual(1); - - bridgingHeader = new BridgingHeader(dummy_path); - bridgingHeader.removeHeader(dummy_plugin2.id, dummy_plugin2.header_path); - bridgingHeader.write(); - - text_list = result_json.text.split('\n'); - expect(text_list.filter(function (line) { return line === headerImportText(dummy_plugin.header_path); }).length).toEqual(0); - expect(text_list.filter(function (line) { return line === headerImportText(dummy_plugin2.header_path); }).length).toEqual(0); - - }); - -}); diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/Plugman/common.spec.js b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/Plugman/common.spec.js deleted file mode 100644 index 5608c51..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/Plugman/common.spec.js +++ /dev/null @@ -1,181 +0,0 @@ -/* - * - * - * 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. - * -*/ - -var fs = require('fs'); -var path = require('path'); -var osenv = require('os'); -var shell = require('shelljs'); -var rewire = require('rewire'); - -var common = rewire('../../../../bin/templates/scripts/cordova/lib/plugman/pluginHandlers'); - -var test_dir = path.join(osenv.tmpdir(), 'test_plugman'); -var project_dir = path.join(test_dir, 'project'); -var src = path.join(project_dir, 'src'); -var dest = path.join(project_dir, 'dest'); -var srcDirTree = path.join(src, 'one', 'two', 'three'); -var srcFile = path.join(srcDirTree, 'test.java'); -var symlink_file = path.join(srcDirTree, 'symlink'); -var non_plugin_file = path.join(osenv.tmpdir(), 'non_plugin_file'); - -var copyFile = common.__get__('copyFile'); -var copyNewFile = common.__get__('copyNewFile'); -var removeFileAndParents = common.__get__('removeFileAndParents'); - -describe('common handler routines', function () { - - describe('copyFile', function () { - it('Test 001 : should throw if source path not found', function () { - shell.rm('-rf', test_dir); - expect(function () { copyFile(test_dir, src, project_dir, dest); }) - .toThrow(new Error('"' + src + '" not found!')); - }); - - it('Test 002 : should throw if src not in plugin directory', function () { - shell.mkdir('-p', project_dir); - fs.writeFileSync(non_plugin_file, 'contents', 'utf-8'); - var outside_file = '../non_plugin_file'; - expect(function () { copyFile(test_dir, outside_file, project_dir, dest); }) - .toThrow(new Error('File "' + path.resolve(test_dir, outside_file) + '" is located outside the plugin directory "' + test_dir + '"')); - shell.rm('-rf', test_dir); - }); - - it('Test 003 : should allow symlink src, if inside plugin', function () { - shell.mkdir('-p', srcDirTree); - fs.writeFileSync(srcFile, 'contents', 'utf-8'); - - // This will fail on windows if not admin - ignore the error in that case. - if (ignoreEPERMonWin32(srcFile, symlink_file)) { - return; - } - - copyFile(test_dir, symlink_file, project_dir, dest); - shell.rm('-rf', project_dir); - }); - - it('Test 004 : should throw if symlink is linked to a file outside the plugin', function () { - shell.mkdir('-p', srcDirTree); - fs.writeFileSync(non_plugin_file, 'contents', 'utf-8'); - - // This will fail on windows if not admin - ignore the error in that case. - if (ignoreEPERMonWin32(non_plugin_file, symlink_file)) { - return; - } - - expect(function () { copyFile(test_dir, symlink_file, project_dir, dest); }) - .toThrow(new Error('File "' + path.resolve(test_dir, symlink_file) + '" is located outside the plugin directory "' + test_dir + '"')); - shell.rm('-rf', project_dir); - }); - - it('Test 005 : should throw if dest is outside the project directory', function () { - shell.mkdir('-p', srcDirTree); - fs.writeFileSync(srcFile, 'contents', 'utf-8'); - expect(function () { copyFile(test_dir, srcFile, project_dir, non_plugin_file); }) - .toThrow(new Error('Destination "' + path.resolve(project_dir, non_plugin_file) + '" for source file "' + path.resolve(test_dir, srcFile) + '" is located outside the project')); - shell.rm('-rf', project_dir); - }); - - it('Test 006 : should call mkdir -p on target path', function () { - shell.mkdir('-p', srcDirTree); - fs.writeFileSync(srcFile, 'contents', 'utf-8'); - - var s = spyOn(shell, 'mkdir').and.callThrough(); - var resolvedDest = path.resolve(project_dir, dest); - - copyFile(test_dir, srcFile, project_dir, dest); - - expect(s).toHaveBeenCalled(); - expect(s).toHaveBeenCalledWith('-p', path.dirname(resolvedDest)); - shell.rm('-rf', project_dir); - }); - - it('Test 007 : should call cp source/dest paths', function () { - shell.mkdir('-p', srcDirTree); - fs.writeFileSync(srcFile, 'contents', 'utf-8'); - - var s = spyOn(shell, 'cp').and.callThrough(); - var resolvedDest = path.resolve(project_dir, dest); - - copyFile(test_dir, srcFile, project_dir, dest); - - expect(s).toHaveBeenCalled(); - expect(s).toHaveBeenCalledWith('-f', srcFile, resolvedDest); - - shell.rm('-rf', project_dir); - }); - - }); - - describe('copyNewFile', function () { - it('Test 008 : should throw if target path exists', function () { - shell.mkdir('-p', dest); - expect(function () { copyNewFile(test_dir, src, project_dir, dest); }) - .toThrow(new Error('"' + dest + '" already exists!')); - shell.rm('-rf', dest); - }); - - }); - - describe('deleteJava', function () { - it('Test 009 : should call fs.unlinkSync on the provided paths', function () { - shell.mkdir('-p', srcDirTree); - fs.writeFileSync(srcFile, 'contents', 'utf-8'); - - var s = spyOn(fs, 'unlinkSync').and.callThrough(); - removeFileAndParents(project_dir, srcFile); - expect(s).toHaveBeenCalled(); - expect(s).toHaveBeenCalledWith(path.resolve(project_dir, srcFile)); - - shell.rm('-rf', srcDirTree); - }); - - it('Test 010 : should delete empty directories after removing source code in path hierarchy', function () { - shell.mkdir('-p', srcDirTree); - fs.writeFileSync(srcFile, 'contents', 'utf-8'); - - removeFileAndParents(project_dir, srcFile); - expect(fs.existsSync(srcFile)).not.toBe(true); - expect(fs.existsSync(srcDirTree)).not.toBe(true); - expect(fs.existsSync(path.join(src, 'one'))).not.toBe(true); - - shell.rm('-rf', srcDirTree); - }); - - it('Test 011 : should delete the top-level src directory if all plugins added were removed', function () { - shell.mkdir('-p', srcDirTree); - fs.writeFileSync(srcFile, 'contents', 'utf-8'); - - removeFileAndParents(project_dir, srcFile); - expect(fs.existsSync(src)).toBe(false); - - shell.rm('-rf', srcDirTree); - }); - }); -}); - -function ignoreEPERMonWin32 (symlink_src, symlink_dest) { - try { - fs.symlinkSync(symlink_src, symlink_dest); - } catch (e) { - if (process.platform === 'win32' && e.message.indexOf('Error: EPERM, operation not permitted' > -1)) { - return true; - } - throw e; - } - return false; -} diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/Plugman/pluginHandler.spec.js b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/Plugman/pluginHandler.spec.js deleted file mode 100644 index cdcc22c..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/Plugman/pluginHandler.spec.js +++ /dev/null @@ -1,566 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -var os = require('os'); -var fs = require('fs'); -var path = require('path'); -var rewire = require('rewire'); -var shell = require('shelljs'); -const EventEmitter = require('events'); - -var PluginInfo = require('cordova-common').PluginInfo; -var Api = require('../../../../bin/templates/scripts/cordova/Api'); -var projectFile = require('../../../../bin/templates/scripts/cordova/lib/projectFile'); -var pluginHandlers = rewire('../../../../bin/templates/scripts/cordova/lib/plugman/pluginHandlers'); - -var temp = path.join(os.tmpdir(), 'plugman'); - -var FIXTURES = path.join(__dirname, '../fixtures'); -var iosProject = path.join(FIXTURES, 'ios-config-xml', '*'); -var faultyplugin = path.join(FIXTURES, 'org.test.plugins.faultyplugin'); -var dummyplugin = path.join(FIXTURES, 'org.test.plugins.dummyplugin'); -var weblessplugin = path.join(FIXTURES, 'org.test.plugins.weblessplugin'); - -var dummyPluginInfo = new PluginInfo(dummyplugin); -var dummy_id = dummyPluginInfo.id; -var valid_source = dummyPluginInfo.getSourceFiles('ios'); -var valid_headers = dummyPluginInfo.getHeaderFiles('ios'); -var valid_resources = dummyPluginInfo.getResourceFiles('ios'); -var valid_custom_frameworks = dummyPluginInfo.getFrameworks('ios').filter(function (f) { return f.custom; }); -var valid_embeddable_custom_frameworks = dummyPluginInfo.getFrameworks('ios').filter(function (f) { return f.custom && f.embed; }); -var valid_weak_frameworks = dummyPluginInfo.getFrameworks('ios').filter(function (f) { return !(f.custom) && f.weak; }); - -var faultyPluginInfo = new PluginInfo(faultyplugin); -var invalid_source = faultyPluginInfo.getSourceFiles('ios'); -var invalid_headers = faultyPluginInfo.getHeaderFiles('ios'); -var invalid_resources = faultyPluginInfo.getResourceFiles('ios'); -var invalid_custom_frameworks = faultyPluginInfo.getFrameworks('ios').filter(function (f) { return f.custom; }); - -var weblessPluginInfo = new PluginInfo(weblessplugin); - -function copyArray (arr) { - return Array.prototype.slice.call(arr, 0); -} - -function slashJoin () { - // In some places we need to use forward slash instead of path.join(). - // See CB-7311. - return Array.prototype.join.call(arguments, '/'); -} - -describe('ios plugin handler', function () { - var dummyProject; - - beforeEach(function () { - shell.cp('-rf', iosProject, temp); - projectFile.purgeProjectFileCache(temp); - - dummyProject = projectFile.parse({ - root: temp, - pbxproj: path.join(temp, 'SampleApp.xcodeproj/project.pbxproj') - }); - }); - - afterEach(function () { - shell.rm('-rf', temp); - }); - - describe('installation', function () { - - describe('of elements', function () { - var install = pluginHandlers.getInstaller('source-file'); - - beforeEach(function () { - spyOn(dummyProject.xcode, 'addSourceFile'); - }); - - it('Test 001 : should throw if source-file src cannot be found', function () { - var source = copyArray(invalid_source); - expect(function () { - install(source[1], faultyPluginInfo, dummyProject); - }).toThrow(); - }); - it('Test 002 : should throw if source-file target already exists', function () { - var source = copyArray(valid_source); - var target = path.join(temp, 'SampleApp', 'Plugins', dummy_id, 'DummyPluginCommand.m'); - shell.mkdir('-p', path.dirname(target)); - fs.writeFileSync(target, 'some bs', 'utf-8'); - expect(function () { - install(source[0], dummyPluginInfo, dummyProject); - }).toThrow(); - }); - it('Test 003 : should call into xcodeproj\'s addSourceFile appropriately when element has no target-dir', function () { - var source = copyArray(valid_source).filter(function (s) { return s.targetDir === undefined; }); - install(source[0], dummyPluginInfo, dummyProject); - expect(dummyProject.xcode.addSourceFile) - .toHaveBeenCalledWith(slashJoin('Plugins', dummy_id, 'DummyPluginCommand.m'), {}); - }); - it('Test 004 : should call into xcodeproj\'s addSourceFile appropriately when element has a target-dir', function () { - var source = copyArray(valid_source).filter(function (s) { return s.targetDir !== undefined; }); - install(source[0], dummyPluginInfo, dummyProject); - expect(dummyProject.xcode.addSourceFile) - .toHaveBeenCalledWith(slashJoin('Plugins', dummy_id, 'targetDir', 'TargetDirTest.m'), {}); - }); - it('Test 005 : should cp the file to the right target location when element has no target-dir', function () { - var source = copyArray(valid_source).filter(function (s) { return s.targetDir === undefined; }); - var spy = spyOn(shell, 'cp'); - install(source[0], dummyPluginInfo, dummyProject); - expect(spy).toHaveBeenCalledWith('-f', path.join(dummyplugin, 'src', 'ios', 'DummyPluginCommand.m'), path.join(temp, 'SampleApp', 'Plugins', dummy_id, 'DummyPluginCommand.m')); - }); - it('Test 006 : should cp the file to the right target location when element has a target-dir', function () { - var source = copyArray(valid_source).filter(function (s) { return s.targetDir !== undefined; }); - var spy = spyOn(shell, 'cp'); - install(source[0], dummyPluginInfo, dummyProject); - expect(spy).toHaveBeenCalledWith('-f', path.join(dummyplugin, 'src', 'ios', 'TargetDirTest.m'), path.join(temp, 'SampleApp', 'Plugins', dummy_id, 'targetDir', 'TargetDirTest.m')); - }); - it('Test 007 : should call into xcodeproj\'s addFramework appropriately when element has framework=true set', function () { - var source = copyArray(valid_source).filter(function (s) { return s.framework; }); - spyOn(dummyProject.xcode, 'addFramework'); - install(source[0], dummyPluginInfo, dummyProject); - expect(dummyProject.xcode.addFramework) - .toHaveBeenCalledWith(path.join('SampleApp', 'Plugins', dummy_id, 'SourceWithFramework.m'), { weak: false }); - }); - }); - - describe('of elements', function () { - var install = pluginHandlers.getInstaller('header-file'); - - beforeEach(function () { - spyOn(dummyProject.xcode, 'addHeaderFile'); - }); - - it('Test 008 : should throw if header-file src cannot be found', function () { - var headers = copyArray(invalid_headers); - expect(function () { - install(headers[1], faultyPluginInfo, dummyProject); - }).toThrow(); - }); - it('Test 009 : should throw if header-file target already exists', function () { - var headers = copyArray(valid_headers); - var target = path.join(temp, 'SampleApp', 'Plugins', dummy_id, 'DummyPluginCommand.h'); - shell.mkdir('-p', path.dirname(target)); - fs.writeFileSync(target, 'some bs', 'utf-8'); - expect(function () { - install(headers[0], dummyPluginInfo, dummyProject); - }).toThrow(); - }); - it('Test 010 : should call into xcodeproj\'s addHeaderFile appropriately when element has no target-dir', function () { - var headers = copyArray(valid_headers).filter(function (s) { return s.targetDir === undefined; }); - install(headers[0], dummyPluginInfo, dummyProject); - expect(dummyProject.xcode.addHeaderFile) - .toHaveBeenCalledWith(slashJoin('Plugins', dummy_id, 'DummyPluginCommand.h')); - }); - it('Test 011 : should call into xcodeproj\'s addHeaderFile appropriately when element a target-dir', function () { - var headers = copyArray(valid_headers).filter(function (s) { return s.targetDir !== undefined; }); - install(headers[0], dummyPluginInfo, dummyProject); - expect(dummyProject.xcode.addHeaderFile) - .toHaveBeenCalledWith(slashJoin('Plugins', dummy_id, 'targetDir', 'TargetDirTest.h')); - }); - it('Test 012 : should cp the file to the right target location when element has no target-dir', function () { - var headers = copyArray(valid_headers).filter(function (s) { return s.targetDir === undefined; }); - var spy = spyOn(shell, 'cp'); - install(headers[0], dummyPluginInfo, dummyProject); - expect(spy).toHaveBeenCalledWith('-f', path.join(dummyplugin, 'src', 'ios', 'DummyPluginCommand.h'), path.join(temp, 'SampleApp', 'Plugins', dummy_id, 'DummyPluginCommand.h')); - }); - it('Test 013 : should cp the file to the right target location when element has a target-dir', function () { - var headers = copyArray(valid_headers).filter(function (s) { return s.targetDir !== undefined; }); - var spy = spyOn(shell, 'cp'); - install(headers[0], dummyPluginInfo, dummyProject); - expect(spy).toHaveBeenCalledWith('-f', path.join(dummyplugin, 'src', 'ios', 'TargetDirTest.h'), path.join(temp, 'SampleApp', 'Plugins', dummy_id, 'targetDir', 'TargetDirTest.h')); - }); - }); - - describe('of elements', function () { - var install = pluginHandlers.getInstaller('resource-file'); - - beforeEach(function () { - spyOn(dummyProject.xcode, 'addResourceFile'); - }); - - it('Test 014 : should throw if resource-file src cannot be found', function () { - var resources = copyArray(invalid_resources); - expect(function () { - install(resources[0], faultyPluginInfo, dummyProject); - }).toThrow(new Error('Cannot find resource file "' + path.resolve(faultyplugin, 'src/ios/IDontExist.bundle') + '" for plugin ' + faultyPluginInfo.id + ' in iOS platform')); - }); - it('Test 015 : should throw if resource-file target already exists', function () { - var resources = copyArray(valid_resources); - var target = path.join(temp, 'SampleApp', 'Resources', 'DummyPlugin.bundle'); - shell.mkdir('-p', path.dirname(target)); - fs.writeFileSync(target, 'some bs', 'utf-8'); - expect(function () { - install(resources[0], dummyPluginInfo, dummyProject); - }).toThrow(new Error('File already exists at destination "' + target + '" for resource file specified by plugin ' + dummyPluginInfo.id + ' in iOS platform')); - }); - it('Test 016 : should call into xcodeproj\'s addResourceFile', function () { - var resources = copyArray(valid_resources); - install(resources[0], dummyPluginInfo, dummyProject); - expect(dummyProject.xcode.addResourceFile) - .toHaveBeenCalledWith(path.join('Resources', 'DummyPlugin.bundle')); - }); - it('Test 017 : should cp the file to the right target location', function () { - var resources = copyArray(valid_resources); - var spy = spyOn(shell, 'cp'); - install(resources[0], dummyPluginInfo, dummyProject); - expect(spy).toHaveBeenCalledWith('-f', path.join(dummyplugin, 'src', 'ios', 'DummyPlugin.bundle'), path.join(temp, 'SampleApp', 'Resources', 'DummyPlugin.bundle')); - }); - - it('Test 018 : should link files to the right target location', function () { - var resources = copyArray(valid_resources); - var spy = spyOn(fs, 'linkSync'); - install(resources[0], dummyPluginInfo, dummyProject, { link: true }); - var src_bundle = path.join(dummyplugin, 'src', 'ios', 'DummyPlugin.bundle'); - var dest_bundle = path.join(temp, 'SampleApp/Resources/DummyPlugin.bundle'); - expect(spy).toHaveBeenCalledWith(src_bundle, dest_bundle); - }); - }); - - describe('of elements', function () { - - var install = pluginHandlers.getInstaller('framework'); - beforeEach(function () { - spyOn(dummyProject.xcode, 'addFramework'); - }); - - it('Test 019 : should call into xcodeproj\'s addFramework', function () { - var frameworks = copyArray(valid_custom_frameworks); - install(frameworks[0], dummyPluginInfo, dummyProject); - expect(dummyProject.xcode.addFramework) - .toHaveBeenCalledWith('SampleApp/Plugins/org.test.plugins.dummyplugin/Custom.framework', { customFramework: true, embed: false, link: true, sign: true }); - - frameworks = copyArray(valid_embeddable_custom_frameworks); - install(frameworks[0], dummyPluginInfo, dummyProject); - expect(dummyProject.xcode.addFramework) - .toHaveBeenCalledWith('SampleApp/Plugins/org.test.plugins.dummyplugin/CustomEmbeddable.framework', { customFramework: true, embed: true, link: false, sign: true }); - - frameworks = copyArray(valid_weak_frameworks); - install(frameworks[0], dummyPluginInfo, dummyProject); - expect(dummyProject.xcode.addFramework) - .toHaveBeenCalledWith('src/ios/libsqlite3.dylib', { customFramework: false, embed: false, link: true, weak: true }); - }); - - // TODO: Add more tests to cover the cases: - // * framework with weak attribute - // * framework that shouldn't be added/removed - - describe('with custom="true" attribute', function () { - it('Test 020 : should throw if framework src cannot be found', function () { - var frameworks = copyArray(invalid_custom_frameworks); - expect(function () { - install(frameworks[0], faultyPluginInfo, dummyProject); - }).toThrow(new Error('Cannot find framework "' + path.resolve(faultyplugin, 'src/ios/NonExistantCustomFramework.framework') + '" for plugin ' + faultyPluginInfo.id + ' in iOS platform')); - }); - it('Test 021 : should throw if framework target already exists', function () { - var frameworks = copyArray(valid_custom_frameworks); - var target = path.join(temp, 'SampleApp/Plugins/org.test.plugins.dummyplugin/Custom.framework'); - shell.mkdir('-p', target); - expect(function () { - install(frameworks[0], dummyPluginInfo, dummyProject); - }).toThrow(new Error('Framework "' + target + '" for plugin ' + dummyPluginInfo.id + ' already exists in iOS platform')); - }); - it('Test 022 : should cp the file to the right target location', function () { - var frameworks = copyArray(valid_custom_frameworks); - var spy = spyOn(shell, 'cp'); - install(frameworks[0], dummyPluginInfo, dummyProject); - expect(spy).toHaveBeenCalledWith('-Rf', path.join(dummyplugin, 'src', 'ios', 'Custom.framework', '*'), - path.join(temp, 'SampleApp/Plugins/org.test.plugins.dummyplugin/Custom.framework')); - }); - - it('Test 023 : should deep symlink files to the right target location', function () { - var frameworks = copyArray(valid_custom_frameworks); - var spy = spyOn(fs, 'linkSync'); - install(frameworks[0], dummyPluginInfo, dummyProject, { link: true }); - var src_binlib = path.join(dummyplugin, 'src', 'ios', 'Custom.framework', 'somebinlib'); - var dest_binlib = path.join(temp, 'SampleApp/Plugins/org.test.plugins.dummyplugin/Custom.framework/somebinlib'); - expect(spy).toHaveBeenCalledWith(src_binlib, dest_binlib); - }); - }); - }); - - describe('of elements', function () { - var jsModule = { src: 'www/dummyplugin.js' }; - var install = pluginHandlers.getInstaller('js-module'); - var wwwDest, platformWwwDest; - - beforeEach(function () { - spyOn(fs, 'writeFileSync'); - wwwDest = path.resolve(dummyProject.www, 'plugins', dummyPluginInfo.id, jsModule.src); - platformWwwDest = path.resolve(dummyProject.platformWww, 'plugins', dummyPluginInfo.id, jsModule.src); - }); - - it('Test 024 : should put module to both www and platform_www when options.usePlatformWww flag is specified', function () { - install(jsModule, dummyPluginInfo, dummyProject, { usePlatformWww: true }); - expect(fs.writeFileSync).toHaveBeenCalledWith(wwwDest, jasmine.any(String), 'utf-8'); - expect(fs.writeFileSync).toHaveBeenCalledWith(platformWwwDest, jasmine.any(String), 'utf-8'); - }); - - it('Test 025 : should put module to www only when options.usePlatformWww flag is not specified', function () { - install(jsModule, dummyPluginInfo, dummyProject); - expect(fs.writeFileSync).toHaveBeenCalledWith(wwwDest, jasmine.any(String), 'utf-8'); - expect(fs.writeFileSync).not.toHaveBeenCalledWith(platformWwwDest, jasmine.any(String), 'utf-8'); - }); - }); - - describe('of elements', function () { - var asset = { src: 'www/dummyplugin.js', target: 'foo/dummy.js' }; - var install = pluginHandlers.getInstaller('asset'); - /* eslint-disable no-unused-vars */ - var wwwDest; - var platformWwwDest; - /* eslint-enable no-unused-vars */ - - beforeEach(function () { - spyOn(shell, 'cp'); - wwwDest = path.resolve(dummyProject.www, asset.target); - platformWwwDest = path.resolve(dummyProject.platformWww, asset.target); - }); - - it('Test 026 : should put asset to both www and platform_www when options.usePlatformWww flag is specified', function () { - install(asset, dummyPluginInfo, dummyProject, { usePlatformWww: true }); - expect(shell.cp).toHaveBeenCalledWith('-f', path.resolve(dummyPluginInfo.dir, asset.src), path.resolve(dummyProject.www, asset.target)); - expect(shell.cp).toHaveBeenCalledWith('-f', path.resolve(dummyPluginInfo.dir, asset.src), path.resolve(dummyProject.platformWww, asset.target)); - }); - - it('Test 027 : should put asset to www only when options.usePlatformWww flag is not specified', function () { - install(asset, dummyPluginInfo, dummyProject); - expect(shell.cp).toHaveBeenCalledWith('-f', path.resolve(dummyPluginInfo.dir, asset.src), path.resolve(dummyProject.www, asset.target)); - expect(shell.cp).not.toHaveBeenCalledWith(path.resolve(dummyPluginInfo.dir, asset.src), path.resolve(dummyProject.platformWww, asset.target)); - }); - }); - - it('Test 028 : of two plugins should apply xcode file changes from both', function () { - var api = new Api('ios', temp, new EventEmitter()); - - return api.addPlugin(dummyPluginInfo) - .then(function () { - return api.addPlugin(weblessPluginInfo); - }) - .then(function () { - var xcode = projectFile.parse({ - root: temp, - pbxproj: path.join(temp, 'SampleApp.xcodeproj/project.pbxproj') - }).xcode; - - // from org.test.plugins.dummyplugin - expect(xcode.hasFile(slashJoin('DummyPlugin.bundle'))).toEqual(jasmine.any(Object)); - expect(xcode.hasFile(slashJoin('org.test.plugins.dummyplugin', 'DummyPluginCommand.h'))).toEqual(jasmine.any(Object)); - expect(xcode.hasFile(slashJoin('org.test.plugins.dummyplugin', 'DummyPluginCommand.m'))).toEqual(jasmine.any(Object)); - expect(xcode.hasFile(slashJoin('org.test.plugins.dummyplugin', 'targetDir', 'TargetDirTest.h'))).toEqual(jasmine.any(Object)); - expect(xcode.hasFile(slashJoin('org.test.plugins.dummyplugin', 'targetDir', 'TargetDirTest.m'))).toEqual(jasmine.any(Object)); - expect(xcode.hasFile('usr/lib/libsqlite3.dylib')).toEqual(jasmine.any(Object)); - expect(xcode.hasFile(slashJoin('SampleApp', 'Plugins', 'org.test.plugins.dummyplugin', 'Custom.framework'))).toEqual(jasmine.any(Object)); - // from org.test.plugins.weblessplugin - expect(xcode.hasFile(slashJoin('WeblessPluginViewController.xib'))).toEqual(jasmine.any(Object)); - expect(xcode.hasFile(slashJoin('org.test.plugins.weblessplugin', 'WeblessPluginCommand.h'))).toEqual(jasmine.any(Object)); - expect(xcode.hasFile(slashJoin('org.test.plugins.weblessplugin', 'WeblessPluginCommand.m'))).toEqual(jasmine.any(Object)); - expect(xcode.hasFile('usr/lib/libsqlite3.dylib')).toEqual(jasmine.any(Object)); - }); - }); - }); - - describe('uninstallation', function () { - describe('of elements', function () { - var uninstall = pluginHandlers.getUninstaller('source-file'); - beforeEach(function () { - spyOn(dummyProject.xcode, 'removeSourceFile'); - spyOn(dummyProject.xcode, 'removeFramework'); - }); - - it('Test 029 : should call into xcodeproj\'s removeSourceFile appropriately when element has no target-dir', function () { - var source = copyArray(valid_source).filter(function (s) { return s.targetDir === undefined; }); - uninstall(source[0], dummyPluginInfo, dummyProject); - expect(dummyProject.xcode.removeSourceFile).toHaveBeenCalledWith(slashJoin('Plugins', dummy_id, 'DummyPluginCommand.m')); - }); - it('Test 030 : should call into xcodeproj\'s removeSourceFile appropriately when element a target-dir', function () { - var source = copyArray(valid_source).filter(function (s) { return s.targetDir !== undefined; }); - uninstall(source[0], dummyPluginInfo, dummyProject); - expect(dummyProject.xcode.removeSourceFile).toHaveBeenCalledWith(slashJoin('Plugins', dummy_id, 'targetDir', 'TargetDirTest.m')); - }); - it('Test 031 : should rm the file from the right target location when element has no target-dir', function () { - var source = copyArray(valid_source).filter(function (s) { return s.targetDir === undefined; }); - var spy = spyOn(shell, 'rm'); - uninstall(source[0], dummyPluginInfo, dummyProject); - expect(spy).toHaveBeenCalledWith('-rf', path.join(temp, 'SampleApp', 'Plugins', dummy_id)); - }); - it('Test 032 : should rm the file from the right target location when element has a target-dir', function () { - var source = copyArray(valid_source).filter(function (s) { return s.targetDir !== undefined; }); - var spy = spyOn(shell, 'rm'); - uninstall(source[0], dummyPluginInfo, dummyProject); - expect(spy).toHaveBeenCalledWith('-rf', path.join(temp, 'SampleApp', 'Plugins', dummy_id, 'targetDir')); - }); - it('Test 033 : should call into xcodeproj\'s removeFramework appropriately when element framework=true set', function () { - var source = copyArray(valid_source).filter(function (s) { return s.framework; }); - uninstall(source[0], dummyPluginInfo, dummyProject); - expect(dummyProject.xcode.removeFramework).toHaveBeenCalledWith(path.join('SampleApp', 'Plugins', dummy_id, 'SourceWithFramework.m')); - }); - }); - - describe('of elements', function () { - var uninstall = pluginHandlers.getUninstaller('header-file'); - beforeEach(function () { - spyOn(dummyProject.xcode, 'removeHeaderFile'); - }); - - it('Test 034 : should call into xcodeproj\'s removeHeaderFile appropriately when element has no target-dir', function () { - var headers = copyArray(valid_headers).filter(function (s) { return s.targetDir === undefined; }); - uninstall(headers[0], dummyPluginInfo, dummyProject); - expect(dummyProject.xcode.removeHeaderFile).toHaveBeenCalledWith(slashJoin('Plugins', dummy_id, 'DummyPluginCommand.h')); - }); - it('Test 035 : should call into xcodeproj\'s removeHeaderFile appropriately when element a target-dir', function () { - var headers = copyArray(valid_headers).filter(function (s) { return s.targetDir !== undefined; }); - uninstall(headers[0], dummyPluginInfo, dummyProject); - expect(dummyProject.xcode.removeHeaderFile).toHaveBeenCalledWith(slashJoin('Plugins', dummy_id, 'targetDir', 'TargetDirTest.h')); - }); - it('Test 036 : should rm the file from the right target location', function () { - var headers = copyArray(valid_headers).filter(function (s) { return s.targetDir !== undefined; }); - var spy = spyOn(shell, 'rm'); - uninstall(headers[0], dummyPluginInfo, dummyProject); - expect(spy).toHaveBeenCalledWith('-rf', path.join(temp, 'SampleApp', 'Plugins', dummy_id, 'targetDir')); - }); - }); - - describe('of elements', function () { - var uninstall = pluginHandlers.getUninstaller('resource-file'); - beforeEach(function () { - spyOn(dummyProject.xcode, 'removeResourceFile'); - }); - - it('Test 037 : should call into xcodeproj\'s removeResourceFile', function () { - var resources = copyArray(valid_resources); - uninstall(resources[0], dummyPluginInfo, dummyProject); - expect(dummyProject.xcode.removeResourceFile).toHaveBeenCalledWith(path.join('Resources', 'DummyPlugin.bundle')); - }); - it('Test 038 : should rm the file from the right target location', function () { - var resources = copyArray(valid_resources); - var spy = spyOn(shell, 'rm'); - uninstall(resources[0], dummyPluginInfo, dummyProject); - expect(spy).toHaveBeenCalledWith('-rf', path.join(temp, 'SampleApp', 'Resources', 'DummyPlugin.bundle')); - }); - }); - - describe('of elements', function () { - var uninstall = pluginHandlers.getUninstaller('framework'); - beforeEach(function () { - spyOn(dummyProject.xcode, 'removeFramework'); - }); - - var frameworkPath = path.join(temp, 'SampleApp/Plugins/org.test.plugins.dummyplugin/Custom.framework').replace(/\\/g, '/'); - - it('Test 039 : should call into xcodeproj\'s removeFramework', function () { - var frameworks = copyArray(valid_custom_frameworks); - uninstall(frameworks[0], dummyPluginInfo, dummyProject); - expect(dummyProject.xcode.removeFramework).toHaveBeenCalledWith(frameworkPath, { customFramework: true }); - }); - - // TODO: Add more tests to cover the cases: - // * framework with weak attribute - // * framework that shouldn't be added/removed - - describe('with custom="true" attribute', function () { - it('Test 040 : should rm the file from the right target location', function () { - var frameworks = copyArray(valid_custom_frameworks); - var spy = spyOn(shell, 'rm'); - uninstall(frameworks[0], dummyPluginInfo, dummyProject); - expect(spy).toHaveBeenCalledWith('-rf', frameworkPath); - }); - }); - - describe('without custom="true" attribute ', function () { - - it('Test 041 : should decrease framework counter after uninstallation', function () { - var install = pluginHandlers.getInstaller('framework'); - var dummyNonCustomFrameworks = dummyPluginInfo.getFrameworks('ios').filter(function (f) { - return !f.custom; - }); - var dummyFramework = dummyNonCustomFrameworks[0]; - install(dummyFramework, dummyPluginInfo, dummyProject); - install(dummyFramework, dummyPluginInfo, dummyProject); - var frameworkName = Object.keys(dummyProject.frameworks)[0]; - expect(dummyProject.frameworks[frameworkName]).toEqual(2); - uninstall(dummyFramework, dummyPluginInfo, dummyProject); - expect(dummyProject.frameworks[frameworkName]).toEqual(1); - uninstall(dummyFramework, dummyPluginInfo, dummyProject); - expect(dummyProject.frameworks[frameworkName]).not.toBeDefined(); - }); - }); - }); - - describe('of elements', function () { - var jsModule = { src: 'www/dummyPlugin.js' }; - var uninstall = pluginHandlers.getUninstaller('js-module'); - var wwwDest, platformWwwDest; - - beforeEach(function () { - wwwDest = path.resolve(dummyProject.www, 'plugins', dummyPluginInfo.id, jsModule.src); - platformWwwDest = path.resolve(dummyProject.platformWww, 'plugins', dummyPluginInfo.id, jsModule.src); - - spyOn(shell, 'rm'); - - var existsSyncOrig = fs.existsSync; - spyOn(fs, 'existsSync').and.callFake(function (file) { - if ([wwwDest, platformWwwDest].indexOf(file) >= 0) return true; - return existsSyncOrig.call(fs, file); - }); - }); - - it('Test 042 : should put module to both www and platform_www when options.usePlatformWww flag is specified', function () { - uninstall(jsModule, dummyPluginInfo, dummyProject, { usePlatformWww: true }); - expect(shell.rm).toHaveBeenCalledWith(jasmine.any(String), wwwDest); - expect(shell.rm).toHaveBeenCalledWith(jasmine.any(String), platformWwwDest); - }); - - it('Test 043 : should put module to www only when options.usePlatformWww flag is not specified', function () { - uninstall(jsModule, dummyPluginInfo, dummyProject); - expect(shell.rm).toHaveBeenCalledWith(jasmine.any(String), wwwDest); - expect(shell.rm).not.toHaveBeenCalledWith(jasmine.any(String), platformWwwDest); - }); - }); - - describe('of elements', function () { - var asset = { src: 'www/dummyPlugin.js', target: 'foo/dummy.js' }; - var uninstall = pluginHandlers.getUninstaller('asset'); - var wwwDest, platformWwwDest; - - beforeEach(function () { - wwwDest = path.resolve(dummyProject.www, asset.target); - platformWwwDest = path.resolve(dummyProject.platformWww, asset.target); - - spyOn(shell, 'rm'); - - var existsSyncOrig = fs.existsSync; - spyOn(fs, 'existsSync').and.callFake(function (file) { - if ([wwwDest, platformWwwDest].indexOf(file) >= 0) return true; - return existsSyncOrig.call(fs, file); - }); - }); - - it('Test 044 : should put module to both www and platform_www when options.usePlatformWww flag is specified', function () { - uninstall(asset, dummyPluginInfo, dummyProject, { usePlatformWww: true }); - expect(shell.rm).toHaveBeenCalledWith(jasmine.any(String), wwwDest); - expect(shell.rm).toHaveBeenCalledWith(jasmine.any(String), platformWwwDest); - }); - - it('Test 045 : should put module to www only when options.usePlatformWww flag is not specified', function () { - uninstall(asset, dummyPluginInfo, dummyProject); - expect(shell.rm).toHaveBeenCalledWith(jasmine.any(String), wwwDest); - expect(shell.rm).not.toHaveBeenCalledWith(jasmine.any(String), platformWwwDest); - }); - }); - }); -}); diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/Podfile.spec.js b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/Podfile.spec.js deleted file mode 100644 index 9618c39..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/Podfile.spec.js +++ /dev/null @@ -1,166 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -var path = require('path'); -var util = require('util'); -var fs = require('fs'); -var CordovaError = require('cordova-common').CordovaError; - -var PROJECT_NAME = 'testProj'; -var Podfile = require(path.resolve(path.join(__dirname, '..', '..', '..', 'bin', 'templates', 'scripts', 'cordova', 'lib', 'Podfile.js'))).Podfile; -var fixturePodfile = path.resolve(__dirname, 'fixtures', PROJECT_NAME, 'platforms', 'ios', 'Podfile'); -var fixturePodXcconfigDebug = path.resolve(__dirname, 'fixtures', PROJECT_NAME, 'platforms', 'ios', 'pods-debug.xcconfig'); -var fixturePodXcconfigRelease = path.resolve(__dirname, 'fixtures', PROJECT_NAME, 'platforms', 'ios', 'pods-release.xcconfig'); - -// tests are nested in a describe to ensure clean up happens after all unit tests are run -describe('unit tests for Podfile module', function () { - var podfile = new Podfile(fixturePodfile, PROJECT_NAME); - - describe('tests', function () { - - it('Test 001 : throws CordovaError when the path filename is not named Podfile', function () { - var dummyPath = 'NotAPodfile'; - expect(function () { - new Podfile(dummyPath); /* eslint no-new : 0 */ - }).toThrow(new CordovaError(util.format('Podfile: The file at %s is not `%s`.', dummyPath, Podfile.FILENAME))); - }); - - it('Test 002 : throws CordovaError when no projectName provided when creating a Podfile', function () { - expect(function () { - new Podfile(fixturePodfile); /* eslint no-new : 0 */ - }).toThrow(new CordovaError('Podfile: The projectName was not specified in the constructor.')); - }); - - it('Test 003 : throws CordovaError when no pod name provided when adding a spec', function () { - expect(function () { - podfile.addSpec(null); - }).toThrow(new CordovaError('Podfile addSpec: name is not specified.')); - }); - - it('Test 004 : adds the spec', function () { - expect(podfile.existsSpec('Foo')).toBe(false); - podfile.addSpec('Foo', '1.0'); - expect(podfile.existsSpec('Foo')).toBe(true); - }); - - it('Test 005 : removes the spec', function () { - podfile.addSpec('Baz', '3.0'); - expect(podfile.existsSpec('Baz')).toBe(true); - podfile.removeSpec('Baz'); - expect(podfile.existsSpec('Baz')).toBe(false); - }); - - it('Test 006 : clears all specs', function () { - podfile.addSpec('Bar', '2.0'); - podfile.clear(); - - expect(podfile.existsSpec('Foo')).toBe(false); - expect(podfile.existsSpec('Bar')).toBe(false); - }); - - it('Test 007 : isDirty tests', function () { - podfile.addSpec('Foo', '1.0'); - expect(podfile.isDirty()).toBe(true); - - podfile.write(); - expect(podfile.isDirty()).toBe(false); - - podfile.removeSpec('Foo'); - expect(podfile.isDirty()).toBe(true); - - podfile.clear(); - expect(podfile.isDirty()).toBe(true); - - podfile.write(); - expect(podfile.isDirty()).toBe(false); - }); - - it('Test 008 : writes specs to the Podfile', function () { - podfile.clear(); - - podfile.addSpec('Foo', '1.0'); - podfile.addSpec('Bar', '2.0'); - podfile.addSpec('Baz', '3.0'); - podfile.addSpec('Foo-Baz', '4.0'); - podfile.addSpec('Foo~Baz@!%@!%!', '5.0'); - podfile.addSpec('Bla', ':configurations => [\'Debug\', \'Beta\']'); - podfile.addSpec('Bla2', { 'configurations': 'Debug,Release' }); - podfile.addSpec('Bla3', { 'configurations': 'Debug, Release' }); - - podfile.write(); - - // verify by reading it back in a new Podfile - var newPodfile = new Podfile(fixturePodfile, PROJECT_NAME + '2'); - expect(newPodfile.existsSpec('Foo')).toBe(true); - expect(newPodfile.existsSpec('Bar')).toBe(true); - expect(newPodfile.existsSpec('Baz')).toBe(true); - expect(newPodfile.existsSpec('Foo-Baz')).toBe(true); - expect(newPodfile.existsSpec('Foo~Baz@!%@!%!')).toBe(true); - expect(newPodfile.existsSpec('Bla')).toBe(true); - - expect(newPodfile.getSpec('Foo')).toEqual(podfile.getSpec('Foo')); - expect(newPodfile.getSpec('Bar')).toEqual(podfile.getSpec('Bar')); - expect(newPodfile.getSpec('Baz')).toEqual(podfile.getSpec('Baz')); - expect(newPodfile.getSpec('Foo-Baz')).toEqual(podfile.getSpec('Foo-Baz')); - expect(newPodfile.getSpec('Foo~Baz@!%@!%!')).toEqual(podfile.getSpec('Foo~Baz@!%@!%!')); - expect(newPodfile.getSpec('Bla')).toEqual(podfile.getSpec('Bla')); - expect(newPodfile.getSpec('Bla2').options).toEqual(':configurations => [\'Debug\',\'Release\']'); - expect(newPodfile.getSpec('Bla3').options).toEqual(':configurations => [\'Debug\',\'Release\']'); - }); - - it('Test 009 : runs before_install to install xcconfig paths', function () { - podfile.before_install(); - - // Template tokens in order: project name, project name, debug | release - var template = - '// DO NOT MODIFY -- auto-generated by Apache Cordova\n' + - '#include "Pods/Target Support Files/Pods-%s/Pods-%s.%s.xcconfig"'; - - var expectedDebugContents = util.format(template, PROJECT_NAME, PROJECT_NAME, 'debug'); - var expectedReleaseContents = util.format(template, PROJECT_NAME, PROJECT_NAME, 'release'); - - var actualDebugContents = fs.readFileSync(fixturePodXcconfigDebug, 'utf8'); - var actualReleaseContents = fs.readFileSync(fixturePodXcconfigRelease, 'utf8'); - - expect(actualDebugContents).toBe(expectedDebugContents); - expect(actualReleaseContents).toBe(expectedReleaseContents); - }); - - it('Test 010 : escapes single quotes in project name when writing a Podfile', function () { - podfile.before_install(); - - var projectName = 'This project\'s name'; - - var expectedProjectName = 'This project\\\'s name'; - var actualProjectName = podfile.escapeSingleQuotes(projectName); - - expect(actualProjectName).toBe(expectedProjectName); - }); - - }); - - it('Test 011 : tear down', function () { - podfile.destroy(); - - var text = '// DO NOT MODIFY -- auto-generated by Apache Cordova\n'; - - fs.writeFileSync(fixturePodXcconfigDebug, text, 'utf8'); - fs.writeFileSync(fixturePodXcconfigRelease, text, 'utf8'); - }); -}); diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/PodsJson.spec.js b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/PodsJson.spec.js deleted file mode 100644 index 5667a41..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/PodsJson.spec.js +++ /dev/null @@ -1,254 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -var fs = require('fs'); -var path = require('path'); -var util = require('util'); -var CordovaError = require('cordova-common').CordovaError; - -var PodsJson = require(path.resolve(path.join(__dirname, '..', '..', '..', 'bin', 'templates', 'scripts', 'cordova', 'lib', 'PodsJson.js'))).PodsJson; -var fixturePodsJson = path.resolve(__dirname, 'fixtures', 'testProj', 'platforms', 'ios', 'pods.json'); - -// tests are nested in a describe to ensure clean up happens after all unit tests are run -describe('unit tests for Podfile module', function () { - var podsjson = null; - beforeEach(function () { - podsjson = new PodsJson(fixturePodsJson); - }); - afterEach(function () { - podsjson.destroy(); - }); - - describe('tests', function () { - - it('Test 001 : throws CordovaError when the path filename is not named pods.json', function () { - var dummyPath = 'NotPodsJson'; - expect(function () { - new PodsJson(dummyPath); /* eslint no-new : 0 */ - }).toThrow(new CordovaError(util.format('PodsJson: The file at %s is not `%s`.', dummyPath, PodsJson.FILENAME))); - }); - - it('Test 002 : setsJson and gets pod test', function () { - var val0 = { - name: 'Foo', - type: 'podspec', - spec: '1.0', - count: 1 - }; - podsjson.setJsonLibrary(val0.name, val0); - var val1 = podsjson.getLibrary(val0.name); - - expect(val1).toBeTruthy(); - expect(val1.name).toEqual(val0.name); - expect(val1.type).toEqual(val0.type); - expect(val1.spec).toEqual(val0.spec); - expect(val1.count).toEqual(val0.count); - }); - - it('Test 003 : setsJson and remove pod test', function () { - var val0 = { - name: 'Bar', - type: 'podspec', - spec: '2.0', - count: 2 - }; - podsjson.setJsonLibrary(val0.name, val0); - var val1 = podsjson.getLibrary(val0.name); - - expect(val1).toBeTruthy(); - expect(val1.name).toEqual(val0.name); - expect(val1.type).toEqual(val0.type); - expect(val1.spec).toEqual(val0.spec); - expect(val1.count).toEqual(val0.count); - - podsjson.removeLibrary(val0.name); - val1 = podsjson.getLibrary(val0.name); - expect(val1).toBeFalsy(); - }); - - it('Test 004 : clears all pods', function () { - var val0 = { - name: 'Baz', - type: 'podspec', - spec: '3.0', - count: 3 - }; - podsjson.setJsonLibrary(val0.name, val0); - podsjson.clear(); - - expect(podsjson.getLibrary(val0.name)).toBeFalsy(); - expect(podsjson.getLibrary('Foo')).toBeFalsy(); - expect(podsjson.getLibrary('Bar')).toBeFalsy(); - }); - - it('Test 005 : isDirty tests', function () { - var val0 = { - name: 'Foo', - type: 'podspec', - spec: '1.0', - count: 1 - }; - - podsjson.setJsonLibrary(val0.name, val0); - expect(podsjson.isDirty()).toBe(true); - - podsjson.write(); - expect(podsjson.isDirty()).toBe(false); - - podsjson.removeLibrary(val0.name); - expect(podsjson.isDirty()).toBe(true); - - podsjson.clear(); - expect(podsjson.isDirty()).toBe(true); - - podsjson.write(); - expect(podsjson.isDirty()).toBe(false); - }); - - it('Test 006 : increment and decrement count test', function () { - var val0 = { - name: 'Bla', - type: 'podspec', - spec: '4.0', - count: 4 - }; - - podsjson.setJsonLibrary(val0.name, val0); - expect(podsjson.getLibrary(val0.name).count).toBe(4); - - podsjson.incrementLibrary(val0.name); - expect(podsjson.getLibrary(val0.name).count).toBe(5); - - podsjson.decrementLibrary(val0.name); - expect(podsjson.getLibrary(val0.name).count).toBe(4); - podsjson.decrementLibrary(val0.name); - expect(podsjson.getLibrary(val0.name).count).toBe(3); - podsjson.decrementLibrary(val0.name); - expect(podsjson.getLibrary(val0.name).count).toBe(2); - podsjson.decrementLibrary(val0.name); - expect(podsjson.getLibrary(val0.name).count).toBe(1); - - // this next decrement takes it down to zero, where the pod will just be removed - podsjson.decrementLibrary(val0.name); - expect(podsjson.getLibrary(val0.name)).toBeFalsy(); - }); - - it('Test 007 : writes pods to the pods.json', function () { - podsjson.clear(); - - var vals = { - 'Foo': { name: 'Foo', type: 'podspec', spec: '1.0', count: 1 }, - 'Bar': { name: 'Bar', type: 'podspec', spec: '2.0', count: 2 }, - 'Baz': { name: 'Baz', type: 'podspec', spec: '3.0', count: 3 } - }; - - podsjson.setJsonLibrary('Foo', vals.Foo); - podsjson.setJsonLibrary('Bar', vals.Bar); - podsjson.setJsonLibrary('Baz', vals.Baz); - - podsjson.write(); - - // verify by reading it back in a new PodsJson - var newPodsJson = new PodsJson(fixturePodsJson); - expect(newPodsJson.getLibrary('Foo')).toBeTruthy(); - expect(newPodsJson.getLibrary('Bar')).toBeTruthy(); - expect(newPodsJson.getLibrary('Baz')).toBeTruthy(); - - function podEqual (a, b) { - return ( - a.name === b.name && - a.type === b.type && - a.spec === b.spec && - a.count === b.count - ); - } - - expect(podEqual(podsjson.getLibrary('Foo'), newPodsJson.getLibrary('Foo'))).toBe(true); - expect(podEqual(podsjson.getLibrary('Bar'), newPodsJson.getLibrary('Bar'))).toBe(true); - expect(podEqual(podsjson.getLibrary('Baz'), newPodsJson.getLibrary('Baz'))).toBe(true); - }); - - it('Test 008 : setJson, get, increment, decrement, remove and write for Declaration', function () { - var result = null; - var writeFileSyncSpy = spyOn(fs, 'writeFileSync'); - writeFileSyncSpy.and.callFake(function (filepath, data, encode) { - result = data; - }); - var json = { - declaration: 'use_frameworks!', - count: 1 - }; - var json2 = { - declaration: 'inhibit_all_warnings!', - count: 2 - }; - podsjson.setJsonDeclaration(json.declaration, json); - expect(podsjson.getDeclaration(json.declaration)).not.toBe(json); - expect(podsjson.getDeclaration(json.declaration)).toEqual(json); - podsjson.incrementDeclaration(json.declaration); - expect(podsjson.getDeclaration(json.declaration).count).toEqual(2); - podsjson.decrementDeclaration(json.declaration); - expect(podsjson.getDeclaration(json.declaration).count).toEqual(1); - podsjson.setJsonDeclaration(json2.declaration, json2); - expect(podsjson.getDeclaration(json.declaration)).toEqual(json); - expect(podsjson.getDeclaration(json2.declaration)).toEqual(json2); - podsjson.removeDeclaration(json.declaration); - expect(podsjson.getDeclaration(json.declaration)).toBeUndefined(); - podsjson.write(); - expect(writeFileSyncSpy).toHaveBeenCalled(); - expect(JSON.parse(result).declarations[json2.declaration]).toEqual(json2); - }); - - it('Test 009 : setJson, get, increment, decrement, remove and write for Source', function () { - var result = null; - var writeFileSyncSpy = spyOn(fs, 'writeFileSync'); - writeFileSyncSpy.and.callFake(function (filepath, data, encode) { - result = data; - }); - var json = { - source: 'https://github.com/brightcove/BrightcoveSpecs.git', - count: 1 - }; - var json2 = { - source: 'https://github.com/CocoaPods/Specs.git', - count: 2 - }; - podsjson.setJsonSource(json.source, json); - expect(podsjson.getSource(json.source)).not.toBe(json); - expect(podsjson.getSource(json.source)).toEqual(json); - podsjson.incrementSource(json.source); - expect(podsjson.getSource(json.source).count).toEqual(2); - podsjson.decrementSource(json.source); - expect(podsjson.getSource(json.source).count).toEqual(1); - podsjson.setJsonSource(json2.source, json2); - expect(podsjson.getSource(json.source)).toEqual(json); - expect(podsjson.getSource(json2.source)).toEqual(json2); - podsjson.removeSource(json.source); - expect(podsjson.getSource(json.source)).toBeUndefined(); - podsjson.write(); - expect(writeFileSyncSpy).toHaveBeenCalled(); - expect(JSON.parse(result).sources[json2.source]).toEqual(json2); - }); - - }); - - // it('Test 008 : tear down', function () { - // podsjson.destroy(); - // }); -}); diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/build.spec.js b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/build.spec.js deleted file mode 100644 index dcac7dc..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/build.spec.js +++ /dev/null @@ -1,477 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -var path = require('path'); -var rewire = require('rewire'); -var build = rewire('../../../bin/templates/scripts/cordova/lib/build'); - -describe('build', function () { - let emitSpy; - var testProjectPath = path.join('/test', 'project', 'path'); - - beforeEach(function () { - // Events spy - emitSpy = jasmine.createSpy('emitSpy'); - build.__set__('events', { - emit: emitSpy - }); - }); - - describe('getXcodeBuildArgs method', function () { - - var getXcodeBuildArgs = build.__get__('getXcodeBuildArgs'); - build.__set__('__dirname', path.join('/test', 'dir')); - - it('should generate appropriate args if a single buildFlag is passed in', function () { - var isDevice = true; - var buildFlags = ''; - - var args = getXcodeBuildArgs('TestProjectName', testProjectPath, 'TestConfiguration', isDevice, buildFlags); - expect(args).toEqual([ - '-workspace', - 'TestProjectName.xcworkspace', - '-scheme', - 'TestProjectName', - '-configuration', - 'TestConfiguration', - '-destination', - 'generic/platform=iOS', - '-archivePath', - 'TestProjectName.xcarchive', - 'archive', - 'CONFIGURATION_BUILD_DIR=' + path.join(testProjectPath, 'build', 'device'), - 'SHARED_PRECOMPS_DIR=' + path.join(testProjectPath, 'build', 'sharedpch') - ]); - expect(args.length).toEqual(13); - }); - - it('should generate appropriate args if buildFlags are passed in', function () { - var isDevice = true; - var buildFlags = [ - '-workspace TestWorkspaceFlag', - '-scheme TestSchemeFlag', - '-configuration TestConfigurationFlag', - '-destination TestDestinationFlag', - '-archivePath TestArchivePathFlag', - 'CONFIGURATION_BUILD_DIR=TestConfigBuildDirFlag', - 'SHARED_PRECOMPS_DIR=TestSharedPrecompsDirFlag' - ]; - - var args = getXcodeBuildArgs('TestProjectName', testProjectPath, 'TestConfiguration', isDevice, buildFlags); - expect(args).toEqual([ - '-workspace', - 'TestWorkspaceFlag', - '-scheme', - 'TestSchemeFlag', - '-configuration', - 'TestConfigurationFlag', - '-destination', - 'TestDestinationFlag', - '-archivePath', - 'TestArchivePathFlag', - 'archive', - 'CONFIGURATION_BUILD_DIR=TestConfigBuildDirFlag', - 'SHARED_PRECOMPS_DIR=TestSharedPrecompsDirFlag' - ]); - expect(args.length).toEqual(13); - }); - - it('should generate appropriate args for device', function () { - var isDevice = true; - var args = getXcodeBuildArgs('TestProjectName', testProjectPath, 'TestConfiguration', isDevice, null); - expect(args).toEqual([ - '-workspace', - 'TestProjectName.xcworkspace', - '-scheme', - 'TestProjectName', - '-configuration', - 'TestConfiguration', - '-destination', - 'generic/platform=iOS', - '-archivePath', - 'TestProjectName.xcarchive', - 'archive', - 'CONFIGURATION_BUILD_DIR=' + path.join(testProjectPath, 'build', 'device'), - 'SHARED_PRECOMPS_DIR=' + path.join(testProjectPath, 'build', 'sharedpch') - ]); - expect(args.length).toEqual(13); - }); - - it('should generate appropriate args for simulator', function () { - var isDevice = false; - var args = getXcodeBuildArgs('TestProjectName', testProjectPath, 'TestConfiguration', isDevice, null, 'iPhone 5s'); - expect(args).toEqual([ - '-workspace', - 'TestProjectName.xcworkspace', - '-scheme', - 'TestProjectName', - '-configuration', - 'TestConfiguration', - '-sdk', - 'iphonesimulator', - '-destination', - 'platform=iOS Simulator,name=iPhone 5s', - 'build', - 'CONFIGURATION_BUILD_DIR=' + path.join(testProjectPath, 'build', 'emulator'), - 'SHARED_PRECOMPS_DIR=' + path.join(testProjectPath, 'build', 'sharedpch') - ]); - expect(args.length).toEqual(13); - }); - - it('should add matched flags that are not overriding for device', function () { - var isDevice = true; - var buildFlags = '-sdk TestSdkFlag'; - - var args = getXcodeBuildArgs('TestProjectName', testProjectPath, 'TestConfiguration', isDevice, buildFlags); - expect(args).toEqual([ - '-workspace', - 'TestProjectName.xcworkspace', - '-scheme', - 'TestProjectName', - '-configuration', - 'TestConfiguration', - '-destination', - 'generic/platform=iOS', - '-archivePath', - 'TestProjectName.xcarchive', - 'archive', - 'CONFIGURATION_BUILD_DIR=' + path.join(testProjectPath, 'build', 'device'), - 'SHARED_PRECOMPS_DIR=' + path.join(testProjectPath, 'build', 'sharedpch'), - '-sdk', - 'TestSdkFlag' - ]); - expect(args.length).toEqual(15); - }); - - it('should add matched flags that are not overriding for simulator', function () { - var isDevice = false; - var buildFlags = '-archivePath TestArchivePathFlag'; - - var args = getXcodeBuildArgs('TestProjectName', testProjectPath, 'TestConfiguration', isDevice, buildFlags, 'iPhone 5s'); - expect(args).toEqual([ - '-workspace', - 'TestProjectName.xcworkspace', - '-scheme', - 'TestProjectName', - '-configuration', - 'TestConfiguration', - '-sdk', - 'iphonesimulator', - '-destination', - 'platform=iOS Simulator,name=iPhone 5s', - 'build', - 'CONFIGURATION_BUILD_DIR=' + path.join(testProjectPath, 'build', 'emulator'), - 'SHARED_PRECOMPS_DIR=' + path.join(testProjectPath, 'build', 'sharedpch'), - '-archivePath', - 'TestArchivePathFlag' - ]); - expect(args.length).toEqual(15); - }); - - it('should generate appropriate args for automatic provisioning', function () { - var isDevice = true; - var args = getXcodeBuildArgs('TestProjectName', testProjectPath, 'TestConfiguration', isDevice, null, null, true); - expect(args).toEqual([ - '-workspace', - 'TestProjectName.xcworkspace', - '-scheme', - 'TestProjectName', - '-configuration', - 'TestConfiguration', - '-destination', - 'generic/platform=iOS', - '-archivePath', - 'TestProjectName.xcarchive', - '-allowProvisioningUpdates', - 'archive', - 'CONFIGURATION_BUILD_DIR=' + path.join(testProjectPath, 'build', 'device'), - 'SHARED_PRECOMPS_DIR=' + path.join(testProjectPath, 'build', 'sharedpch') - ]); - expect(args.length).toEqual(14); - }); - }); - - describe('getXcodeArchiveArgs method', function () { - - var getXcodeArchiveArgs = build.__get__('getXcodeArchiveArgs'); - - it('should generate the appropriate arguments', function () { - var archiveArgs = getXcodeArchiveArgs('TestProjectName', testProjectPath, '/test/output/path', '/test/export/options/path'); - expect(archiveArgs[0]).toEqual('-exportArchive'); - expect(archiveArgs[1]).toEqual('-archivePath'); - expect(archiveArgs[2]).toEqual('TestProjectName.xcarchive'); - expect(archiveArgs[3]).toEqual('-exportOptionsPlist'); - expect(archiveArgs[4]).toEqual('/test/export/options/path'); - expect(archiveArgs[5]).toEqual('-exportPath'); - expect(archiveArgs[6]).toEqual('/test/output/path'); - expect(archiveArgs.length).toEqual(7); - }); - - it('should generate the appropriate arguments for automatic provisioning', function () { - var archiveArgs = getXcodeArchiveArgs('TestProjectName', testProjectPath, '/test/output/path', '/test/export/options/path', true); - expect(archiveArgs[0]).toEqual('-exportArchive'); - expect(archiveArgs[1]).toEqual('-archivePath'); - expect(archiveArgs[2]).toEqual('TestProjectName.xcarchive'); - expect(archiveArgs[3]).toEqual('-exportOptionsPlist'); - expect(archiveArgs[4]).toEqual('/test/export/options/path'); - expect(archiveArgs[5]).toEqual('-exportPath'); - expect(archiveArgs[6]).toEqual('/test/output/path'); - expect(archiveArgs[7]).toEqual('-allowProvisioningUpdates'); - expect(archiveArgs.length).toEqual(8); - }); - }); - - describe('parseBuildFlag method', function () { - - var parseBuildFlag = build.__get__('parseBuildFlag'); - - it('should detect a workspace change', function () { - var buildFlag = '-workspace MyTestWorkspace'; - var args = { 'otherFlags': [] }; - parseBuildFlag(buildFlag, args); - expect(args.workspace).toEqual('MyTestWorkspace'); - expect(args.otherFlags.length).toEqual(0); - }); - it('should detect a scheme change', function () { - var buildFlag = '-scheme MyTestScheme'; - var args = { 'otherFlags': [] }; - parseBuildFlag(buildFlag, args); - expect(args.scheme).toEqual('MyTestScheme'); - expect(args.otherFlags.length).toEqual(0); - }); - it('should detect a configuration change', function () { - var buildFlag = '-configuration MyTestConfiguration'; - var args = { 'otherFlags': [] }; - parseBuildFlag(buildFlag, args); - expect(args.configuration).toEqual('MyTestConfiguration'); - expect(args.otherFlags.length).toEqual(0); - }); - it('should detect an sdk change', function () { - var buildFlag = '-sdk NotARealSDK'; - var args = { 'otherFlags': [] }; - parseBuildFlag(buildFlag, args); - expect(args.sdk).toEqual('NotARealSDK'); - expect(args.otherFlags.length).toEqual(0); - }); - it('should detect a destination change', function () { - var buildFlag = '-destination MyTestDestination'; - var args = { 'otherFlags': [] }; - parseBuildFlag(buildFlag, args); - expect(args.destination).toEqual('MyTestDestination'); - expect(args.otherFlags.length).toEqual(0); - }); - it('should detect an archivePath change', function () { - var buildFlag = '-archivePath MyTestArchivePath'; - var args = { 'otherFlags': [] }; - parseBuildFlag(buildFlag, args); - expect(args.archivePath).toEqual('MyTestArchivePath'); - expect(args.otherFlags.length).toEqual(0); - }); - it('should detect a configuration_build_dir change', function () { - var buildFlag = 'CONFIGURATION_BUILD_DIR=/path/to/fake/config/build/dir'; - var args = { 'otherFlags': [] }; - parseBuildFlag(buildFlag, args); - expect(args.configuration_build_dir).toEqual('CONFIGURATION_BUILD_DIR=/path/to/fake/config/build/dir'); - expect(args.otherFlags.length).toEqual(0); - }); - it('should detect a shared_precomps_dir change', function () { - var buildFlag = 'SHARED_PRECOMPS_DIR=/path/to/fake/shared/precomps/dir'; - var args = { 'otherFlags': [] }; - parseBuildFlag(buildFlag, args); - expect(args.shared_precomps_dir).toEqual('SHARED_PRECOMPS_DIR=/path/to/fake/shared/precomps/dir'); - expect(args.otherFlags.length).toEqual(0); - }); - it('should parse arbitrary build settings', function () { - var buildFlag = 'MY_ARBITRARY_BUILD_SETTING=ValueOfArbitraryBuildSetting'; - var args = { 'otherFlags': [] }; - parseBuildFlag(buildFlag, args); - expect(args.otherFlags[0]).toEqual('MY_ARBITRARY_BUILD_SETTING=ValueOfArbitraryBuildSetting'); - expect(args.otherFlags.length).toEqual(1); - }); - it('should parse userdefaults', function () { - var buildFlag = '-myuserdefault=TestUserDefaultValue'; - var args = { 'otherFlags': [] }; - parseBuildFlag(buildFlag, args); - expect(args.otherFlags[0]).toEqual('-myuserdefault=TestUserDefaultValue'); - expect(args.otherFlags.length).toEqual(1); - }); - it('should parse settings with a space', function () { - var buildFlag = '-anotherxcodebuildsetting withASpace'; - var args = { 'otherFlags': [] }; - parseBuildFlag(buildFlag, args); - expect(args.otherFlags[0]).toEqual('-anotherxcodebuildsetting'); - expect(args.otherFlags[1]).toEqual('withASpace'); - expect(args.otherFlags.length).toEqual(2); - }); - }); - - describe('help method', () => { - it('should log a bunch of options', () => { - spyOn(console, 'log'); - spyOn(process, 'exit'); - - build.help(); - expect(console.log).toHaveBeenCalledWith(jasmine.stringMatching(/^Usage:/)); - }); - }); - - describe('run method', () => { - let rejectSpy; - - beforeEach(() => { - rejectSpy = jasmine.createSpy('reject'); - - build.__set__('Q', { - reject: rejectSpy - }); - }); - - it('should not accept debug and release options together', () => { - build.run({ - debug: true, - release: true - }); - - expect(rejectSpy).toHaveBeenCalledWith('Cannot specify "debug" and "release" options together.'); - }); - - it('should not accept device and emulator options together', () => { - build.run({ - device: true, - emulator: true - }); - - expect(rejectSpy).toHaveBeenCalledWith('Cannot specify "device" and "emulator" options together.'); - }); - - it('should reject when build config file missing', () => { - const existsSyncSpy = jasmine.createSpy('existsSync').and.returnValue(false); - build.__set__('fs', { - existsSync: existsSyncSpy - }); - - build.run({ - buildConfig: './some/config/path' - }); - - expect(rejectSpy).toHaveBeenCalledWith(jasmine.stringMatching(/^Build config file does not exist:/)); - }); - }); - - describe('getDefaultSimulatorTarget method', () => { - it('should find iPhone X as the default simulator target.', () => { - const mockedEmulators = [{ - name: 'iPhone 7', - identifier: 'com.apple.CoreSimulator.SimDeviceType.iPhone-7', - simIdentifier: 'iPhone-7' - }, - { - name: 'iPhone 8', - identifier: 'com.apple.CoreSimulator.SimDeviceType.iPhone-8', - simIdentifier: 'iPhone-8' - }, - { - name: 'iPhone X', - identifier: 'com.apple.CoreSimulator.SimDeviceType.iPhone-X', - simIdentifier: 'iPhone-X' - }]; - - // This method will require a module that supports the run method. - build.__set__('require', () => { - return { - run: () => Promise.resolve(mockedEmulators) - }; - }); - - const getDefaultSimulatorTarget = build.__get__('getDefaultSimulatorTarget'); - - return getDefaultSimulatorTarget().then(actual => { - expect(actual).toEqual({ - name: 'iPhone X', - identifier: 'com.apple.CoreSimulator.SimDeviceType.iPhone-X', - simIdentifier: 'iPhone-X' - }); - }); - }); - }); - - describe('findXCodeProjectIn method', () => { - let findXCodeProjectIn; - let shellLsSpy; - let rejectSpy; - let resolveSpy; - const fakePath = '/path/foobar'; - - beforeEach(() => { - findXCodeProjectIn = build.__get__('findXCodeProjectIn'); - - // Shell Spy - shellLsSpy = jasmine.createSpy('shellLsSpy'); - build.__set__('shell', { - ls: shellLsSpy - }); - - // Q Spy - rejectSpy = jasmine.createSpy('rejectSpy'); - resolveSpy = jasmine.createSpy('resolveSpy'); - build.__set__('Q', { - reject: rejectSpy, - resolve: resolveSpy - }); - }); - - it('should find not find Xcode project', () => { - shellLsSpy.and.returnValue(['README.md']); - - findXCodeProjectIn(fakePath); - - expect(rejectSpy).toHaveBeenCalledWith('No Xcode project found in ' + fakePath); - }); - - it('should emit finding multiple Xcode projects', () => { - shellLsSpy.and.returnValue(['Test1.xcodeproj', 'Test2.xcodeproj']); - - findXCodeProjectIn(fakePath); - - // Emit - let actualEmit = emitSpy.calls.argsFor(0)[1]; - expect(emitSpy).toHaveBeenCalled(); - expect(actualEmit).toContain('Found multiple .xcodeproj directories in'); - - // Resolve - let actualResolve = resolveSpy.calls.argsFor(0)[0]; - expect(resolveSpy).toHaveBeenCalled(); - expect(actualResolve).toContain('Test1'); - }); - - it('should detect and return only one projects', () => { - shellLsSpy.and.returnValue(['Test1.xcodeproj']); - - findXCodeProjectIn(fakePath); - - // Emit - expect(emitSpy).not.toHaveBeenCalled(); - - // Resolve - let actualResolve = resolveSpy.calls.argsFor(0)[0]; - expect(resolveSpy).toHaveBeenCalled(); - expect(actualResolve).toContain('Test1'); - }); - }); -}); diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/dummyProj/config.xml b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/dummyProj/config.xml deleted file mode 100644 index 0841237..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/dummyProj/config.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - SampleApp - - A sample Apache Cordova application that responds to the deviceready event. - - - Apache Cordova Team - - - - - - - - - - - - - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/dummyProj/platforms/.gitkeep b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/dummyProj/platforms/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/dummyProj/www/.gitkeep b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/dummyProj/www/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/CordovaLib/CordovaLib.xcodeproj/project.pbxproj b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/CordovaLib/CordovaLib.xcodeproj/project.pbxproj deleted file mode 100644 index 5964c8d..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/CordovaLib/CordovaLib.xcodeproj/project.pbxproj +++ /dev/null @@ -1,771 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 30193A501AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 30193A4E1AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.m */; }; - 30193A511AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 30193A4F1AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.h */; }; - 3093E2231B16D6A3003F381A /* CDVIntentAndNavigationFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3093E2211B16D6A3003F381A /* CDVIntentAndNavigationFilter.h */; }; - 3093E2241B16D6A3003F381A /* CDVIntentAndNavigationFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 3093E2221B16D6A3003F381A /* CDVIntentAndNavigationFilter.m */; }; - 7E7F69B61ABA35D8007546F4 /* CDVLocalStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CFB1AB9028C008C4574 /* CDVLocalStorage.h */; }; - 7E7F69B81ABA368F007546F4 /* CDVUIWebViewEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D001AB9028C008C4574 /* CDVUIWebViewEngine.h */; }; - 7E7F69B91ABA3692007546F4 /* CDVHandleOpenURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF81AB9028C008C4574 /* CDVHandleOpenURL.h */; }; - 7ED95D021AB9028C008C4574 /* CDVDebug.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF21AB9028C008C4574 /* CDVDebug.h */; }; - 7ED95D031AB9028C008C4574 /* CDVJSON_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF31AB9028C008C4574 /* CDVJSON_private.h */; }; - 7ED95D041AB9028C008C4574 /* CDVJSON_private.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CF41AB9028C008C4574 /* CDVJSON_private.m */; }; - 7ED95D051AB9028C008C4574 /* CDVPlugin+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF51AB9028C008C4574 /* CDVPlugin+Private.h */; }; - 7ED95D071AB9028C008C4574 /* CDVHandleOpenURL.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CF91AB9028C008C4574 /* CDVHandleOpenURL.m */; }; - 7ED95D091AB9028C008C4574 /* CDVLocalStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CFC1AB9028C008C4574 /* CDVLocalStorage.m */; }; - 7ED95D0A1AB9028C008C4574 /* CDVUIWebViewDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CFE1AB9028C008C4574 /* CDVUIWebViewDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D0B1AB9028C008C4574 /* CDVUIWebViewDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CFF1AB9028C008C4574 /* CDVUIWebViewDelegate.m */; }; - 7ED95D0D1AB9028C008C4574 /* CDVUIWebViewEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D011AB9028C008C4574 /* CDVUIWebViewEngine.m */; }; - 7ED95D351AB9029B008C4574 /* CDV.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D0F1AB9029B008C4574 /* CDV.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D361AB9029B008C4574 /* CDVAppDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D101AB9029B008C4574 /* CDVAppDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D371AB9029B008C4574 /* CDVAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D111AB9029B008C4574 /* CDVAppDelegate.m */; }; - 7ED95D381AB9029B008C4574 /* CDVAvailability.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D121AB9029B008C4574 /* CDVAvailability.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D391AB9029B008C4574 /* CDVAvailabilityDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D131AB9029B008C4574 /* CDVAvailabilityDeprecated.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D3A1AB9029B008C4574 /* CDVCommandDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D141AB9029B008C4574 /* CDVCommandDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D3B1AB9029B008C4574 /* CDVCommandDelegateImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D151AB9029B008C4574 /* CDVCommandDelegateImpl.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D3C1AB9029B008C4574 /* CDVCommandDelegateImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D161AB9029B008C4574 /* CDVCommandDelegateImpl.m */; }; - 7ED95D3D1AB9029B008C4574 /* CDVCommandQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D171AB9029B008C4574 /* CDVCommandQueue.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D3E1AB9029B008C4574 /* CDVCommandQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D181AB9029B008C4574 /* CDVCommandQueue.m */; }; - 7ED95D3F1AB9029B008C4574 /* CDVConfigParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D191AB9029B008C4574 /* CDVConfigParser.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D401AB9029B008C4574 /* CDVConfigParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D1A1AB9029B008C4574 /* CDVConfigParser.m */; }; - 7ED95D411AB9029B008C4574 /* CDVInvokedUrlCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D1B1AB9029B008C4574 /* CDVInvokedUrlCommand.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D421AB9029B008C4574 /* CDVInvokedUrlCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D1C1AB9029B008C4574 /* CDVInvokedUrlCommand.m */; }; - 7ED95D431AB9029B008C4574 /* CDVPlugin+Resources.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D1D1AB9029B008C4574 /* CDVPlugin+Resources.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D441AB9029B008C4574 /* CDVPlugin+Resources.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D1E1AB9029B008C4574 /* CDVPlugin+Resources.m */; }; - 7ED95D451AB9029B008C4574 /* CDVPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D1F1AB9029B008C4574 /* CDVPlugin.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D461AB9029B008C4574 /* CDVPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D201AB9029B008C4574 /* CDVPlugin.m */; }; - 7ED95D471AB9029B008C4574 /* CDVPluginResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D211AB9029B008C4574 /* CDVPluginResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D481AB9029B008C4574 /* CDVPluginResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D221AB9029B008C4574 /* CDVPluginResult.m */; }; - 7ED95D491AB9029B008C4574 /* CDVScreenOrientationDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D231AB9029B008C4574 /* CDVScreenOrientationDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D4A1AB9029B008C4574 /* CDVTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D241AB9029B008C4574 /* CDVTimer.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D4B1AB9029B008C4574 /* CDVTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D251AB9029B008C4574 /* CDVTimer.m */; }; - 7ED95D4C1AB9029B008C4574 /* CDVURLProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D261AB9029B008C4574 /* CDVURLProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D4D1AB9029B008C4574 /* CDVURLProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D271AB9029B008C4574 /* CDVURLProtocol.m */; }; - 7ED95D4E1AB9029B008C4574 /* CDVUserAgentUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D281AB9029B008C4574 /* CDVUserAgentUtil.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D4F1AB9029B008C4574 /* CDVUserAgentUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D291AB9029B008C4574 /* CDVUserAgentUtil.m */; }; - 7ED95D501AB9029B008C4574 /* CDVViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2A1AB9029B008C4574 /* CDVViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D511AB9029B008C4574 /* CDVViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D2B1AB9029B008C4574 /* CDVViewController.m */; }; - 7ED95D521AB9029B008C4574 /* CDVWebViewEngineProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2C1AB9029B008C4574 /* CDVWebViewEngineProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D531AB9029B008C4574 /* CDVWhitelist.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2D1AB9029B008C4574 /* CDVWhitelist.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D541AB9029B008C4574 /* CDVWhitelist.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D2E1AB9029B008C4574 /* CDVWhitelist.m */; }; - 7ED95D571AB9029B008C4574 /* NSDictionary+CordovaPreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D311AB9029B008C4574 /* NSDictionary+CordovaPreferences.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D581AB9029B008C4574 /* NSDictionary+CordovaPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D321AB9029B008C4574 /* NSDictionary+CordovaPreferences.m */; }; - 7ED95D591AB9029B008C4574 /* NSMutableArray+QueueAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D331AB9029B008C4574 /* NSMutableArray+QueueAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7ED95D5A1AB9029B008C4574 /* NSMutableArray+QueueAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D341AB9029B008C4574 /* NSMutableArray+QueueAdditions.m */; }; - A3B082D41BB15CEA00D8DC35 /* CDVGestureHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = A3B082D21BB15CEA00D8DC35 /* CDVGestureHandler.h */; }; - A3B082D51BB15CEA00D8DC35 /* CDVGestureHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = A3B082D31BB15CEA00D8DC35 /* CDVGestureHandler.m */; }; - C0C01EB61E3911D50056E6CB /* Cordova.h in Headers */ = {isa = PBXBuildFile; fileRef = C0C01EB41E3911D50056E6CB /* Cordova.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01EBA1E39120F0056E6CB /* libCordova.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 68A32D7114102E1C006B237C /* libCordova.a */; }; - C0C01EBB1E39131A0056E6CB /* CDV.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D0F1AB9029B008C4574 /* CDV.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01EBC1E39131A0056E6CB /* CDVAppDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D101AB9029B008C4574 /* CDVAppDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01EBD1E39131A0056E6CB /* CDVAvailability.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D121AB9029B008C4574 /* CDVAvailability.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01EBE1E39131A0056E6CB /* CDVAvailabilityDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D131AB9029B008C4574 /* CDVAvailabilityDeprecated.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01EBF1E39131A0056E6CB /* CDVCommandDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D141AB9029B008C4574 /* CDVCommandDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01EC01E39131A0056E6CB /* CDVCommandDelegateImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D151AB9029B008C4574 /* CDVCommandDelegateImpl.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01EC11E39131A0056E6CB /* CDVCommandQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D171AB9029B008C4574 /* CDVCommandQueue.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01EC21E39131A0056E6CB /* CDVConfigParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D191AB9029B008C4574 /* CDVConfigParser.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01EC31E39131A0056E6CB /* CDVInvokedUrlCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D1B1AB9029B008C4574 /* CDVInvokedUrlCommand.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01EC41E39131A0056E6CB /* CDVPlugin+Resources.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D1D1AB9029B008C4574 /* CDVPlugin+Resources.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01EC51E39131A0056E6CB /* CDVPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D1F1AB9029B008C4574 /* CDVPlugin.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01EC61E39131A0056E6CB /* CDVPluginResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D211AB9029B008C4574 /* CDVPluginResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01EC71E39131A0056E6CB /* CDVScreenOrientationDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D231AB9029B008C4574 /* CDVScreenOrientationDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01EC81E39131A0056E6CB /* CDVTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D241AB9029B008C4574 /* CDVTimer.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01EC91E39131A0056E6CB /* CDVURLProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D261AB9029B008C4574 /* CDVURLProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01ECA1E39131A0056E6CB /* CDVUserAgentUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D281AB9029B008C4574 /* CDVUserAgentUtil.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01ECB1E39131A0056E6CB /* CDVViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2A1AB9029B008C4574 /* CDVViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01ECC1E39131A0056E6CB /* CDVWebViewEngineProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2C1AB9029B008C4574 /* CDVWebViewEngineProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01ECD1E39131A0056E6CB /* CDVWhitelist.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2D1AB9029B008C4574 /* CDVWhitelist.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01ECE1E39131A0056E6CB /* NSDictionary+CordovaPreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D311AB9029B008C4574 /* NSDictionary+CordovaPreferences.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01ECF1E39131A0056E6CB /* NSMutableArray+QueueAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D331AB9029B008C4574 /* NSMutableArray+QueueAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C0C01ED01E3913610056E6CB /* CDVUIWebViewDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CFE1AB9028C008C4574 /* CDVUIWebViewDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - C0C01ED11E39137C0056E6CB /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = D2AAC07D0554694100DB518D; - remoteInfo = CordovaLib; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 30193A4E1AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVUIWebViewNavigationDelegate.m; sourceTree = ""; }; - 30193A4F1AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVUIWebViewNavigationDelegate.h; sourceTree = ""; }; - 30325A0B136B343700982B63 /* VERSION */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VERSION; sourceTree = ""; }; - 3093E2211B16D6A3003F381A /* CDVIntentAndNavigationFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVIntentAndNavigationFilter.h; sourceTree = ""; }; - 3093E2221B16D6A3003F381A /* CDVIntentAndNavigationFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVIntentAndNavigationFilter.m; sourceTree = ""; }; - 68A32D7114102E1C006B237C /* libCordova.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCordova.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 7ED95CF21AB9028C008C4574 /* CDVDebug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVDebug.h; sourceTree = ""; }; - 7ED95CF31AB9028C008C4574 /* CDVJSON_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVJSON_private.h; sourceTree = ""; }; - 7ED95CF41AB9028C008C4574 /* CDVJSON_private.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVJSON_private.m; sourceTree = ""; }; - 7ED95CF51AB9028C008C4574 /* CDVPlugin+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CDVPlugin+Private.h"; sourceTree = ""; }; - 7ED95CF81AB9028C008C4574 /* CDVHandleOpenURL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVHandleOpenURL.h; sourceTree = ""; }; - 7ED95CF91AB9028C008C4574 /* CDVHandleOpenURL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVHandleOpenURL.m; sourceTree = ""; }; - 7ED95CFB1AB9028C008C4574 /* CDVLocalStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVLocalStorage.h; sourceTree = ""; }; - 7ED95CFC1AB9028C008C4574 /* CDVLocalStorage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVLocalStorage.m; sourceTree = ""; }; - 7ED95CFE1AB9028C008C4574 /* CDVUIWebViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVUIWebViewDelegate.h; sourceTree = ""; }; - 7ED95CFF1AB9028C008C4574 /* CDVUIWebViewDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVUIWebViewDelegate.m; sourceTree = ""; }; - 7ED95D001AB9028C008C4574 /* CDVUIWebViewEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVUIWebViewEngine.h; sourceTree = ""; }; - 7ED95D011AB9028C008C4574 /* CDVUIWebViewEngine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVUIWebViewEngine.m; sourceTree = ""; }; - 7ED95D0F1AB9029B008C4574 /* CDV.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDV.h; sourceTree = ""; }; - 7ED95D101AB9029B008C4574 /* CDVAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVAppDelegate.h; sourceTree = ""; }; - 7ED95D111AB9029B008C4574 /* CDVAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVAppDelegate.m; sourceTree = ""; }; - 7ED95D121AB9029B008C4574 /* CDVAvailability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVAvailability.h; sourceTree = ""; }; - 7ED95D131AB9029B008C4574 /* CDVAvailabilityDeprecated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVAvailabilityDeprecated.h; sourceTree = ""; }; - 7ED95D141AB9029B008C4574 /* CDVCommandDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVCommandDelegate.h; sourceTree = ""; }; - 7ED95D151AB9029B008C4574 /* CDVCommandDelegateImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVCommandDelegateImpl.h; sourceTree = ""; }; - 7ED95D161AB9029B008C4574 /* CDVCommandDelegateImpl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVCommandDelegateImpl.m; sourceTree = ""; }; - 7ED95D171AB9029B008C4574 /* CDVCommandQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVCommandQueue.h; sourceTree = ""; }; - 7ED95D181AB9029B008C4574 /* CDVCommandQueue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVCommandQueue.m; sourceTree = ""; }; - 7ED95D191AB9029B008C4574 /* CDVConfigParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVConfigParser.h; sourceTree = ""; }; - 7ED95D1A1AB9029B008C4574 /* CDVConfigParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVConfigParser.m; sourceTree = ""; }; - 7ED95D1B1AB9029B008C4574 /* CDVInvokedUrlCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVInvokedUrlCommand.h; sourceTree = ""; }; - 7ED95D1C1AB9029B008C4574 /* CDVInvokedUrlCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVInvokedUrlCommand.m; sourceTree = ""; }; - 7ED95D1D1AB9029B008C4574 /* CDVPlugin+Resources.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CDVPlugin+Resources.h"; sourceTree = ""; }; - 7ED95D1E1AB9029B008C4574 /* CDVPlugin+Resources.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CDVPlugin+Resources.m"; sourceTree = ""; }; - 7ED95D1F1AB9029B008C4574 /* CDVPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVPlugin.h; sourceTree = ""; }; - 7ED95D201AB9029B008C4574 /* CDVPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVPlugin.m; sourceTree = ""; }; - 7ED95D211AB9029B008C4574 /* CDVPluginResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVPluginResult.h; sourceTree = ""; }; - 7ED95D221AB9029B008C4574 /* CDVPluginResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVPluginResult.m; sourceTree = ""; }; - 7ED95D231AB9029B008C4574 /* CDVScreenOrientationDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVScreenOrientationDelegate.h; sourceTree = ""; }; - 7ED95D241AB9029B008C4574 /* CDVTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVTimer.h; sourceTree = ""; }; - 7ED95D251AB9029B008C4574 /* CDVTimer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVTimer.m; sourceTree = ""; }; - 7ED95D261AB9029B008C4574 /* CDVURLProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVURLProtocol.h; sourceTree = ""; }; - 7ED95D271AB9029B008C4574 /* CDVURLProtocol.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVURLProtocol.m; sourceTree = ""; }; - 7ED95D281AB9029B008C4574 /* CDVUserAgentUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVUserAgentUtil.h; sourceTree = ""; }; - 7ED95D291AB9029B008C4574 /* CDVUserAgentUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVUserAgentUtil.m; sourceTree = ""; }; - 7ED95D2A1AB9029B008C4574 /* CDVViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVViewController.h; sourceTree = ""; }; - 7ED95D2B1AB9029B008C4574 /* CDVViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVViewController.m; sourceTree = ""; }; - 7ED95D2C1AB9029B008C4574 /* CDVWebViewEngineProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVWebViewEngineProtocol.h; sourceTree = ""; }; - 7ED95D2D1AB9029B008C4574 /* CDVWhitelist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVWhitelist.h; sourceTree = ""; }; - 7ED95D2E1AB9029B008C4574 /* CDVWhitelist.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVWhitelist.m; sourceTree = ""; }; - 7ED95D311AB9029B008C4574 /* NSDictionary+CordovaPreferences.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+CordovaPreferences.h"; sourceTree = ""; }; - 7ED95D321AB9029B008C4574 /* NSDictionary+CordovaPreferences.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+CordovaPreferences.m"; sourceTree = ""; }; - 7ED95D331AB9029B008C4574 /* NSMutableArray+QueueAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableArray+QueueAdditions.h"; sourceTree = ""; }; - 7ED95D341AB9029B008C4574 /* NSMutableArray+QueueAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMutableArray+QueueAdditions.m"; sourceTree = ""; }; - A3B082D21BB15CEA00D8DC35 /* CDVGestureHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVGestureHandler.h; sourceTree = ""; }; - A3B082D31BB15CEA00D8DC35 /* CDVGestureHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVGestureHandler.m; sourceTree = ""; }; - AA747D9E0F9514B9006C5449 /* CordovaLib_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CordovaLib_Prefix.pch; sourceTree = SOURCE_ROOT; }; - C0C01EB21E3911D50056E6CB /* Cordova.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Cordova.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - C0C01EB41E3911D50056E6CB /* Cordova.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Cordova.h; sourceTree = ""; }; - C0C01EB51E3911D50056E6CB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - C0C01EAE1E3911D50056E6CB /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - C0C01EBA1E39120F0056E6CB /* libCordova.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D2AAC07C0554694100DB518D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 034768DFFF38A50411DB9C8B /* Products */ = { - isa = PBXGroup; - children = ( - 68A32D7114102E1C006B237C /* libCordova.a */, - C0C01EB21E3911D50056E6CB /* Cordova.framework */, - ); - name = Products; - sourceTree = CORDOVALIB; - }; - 0867D691FE84028FC02AAC07 /* CordovaLib */ = { - isa = PBXGroup; - children = ( - 7ED95D0E1AB9029B008C4574 /* Public */, - 7ED95CF11AB9028C008C4574 /* Private */, - C0C01EB31E3911D50056E6CB /* Cordova */, - 034768DFFF38A50411DB9C8B /* Products */, - 30325A0B136B343700982B63 /* VERSION */, - ); - name = CordovaLib; - sourceTree = ""; - }; - 3093E2201B16D6A3003F381A /* CDVIntentAndNavigationFilter */ = { - isa = PBXGroup; - children = ( - 3093E2211B16D6A3003F381A /* CDVIntentAndNavigationFilter.h */, - 3093E2221B16D6A3003F381A /* CDVIntentAndNavigationFilter.m */, - ); - path = CDVIntentAndNavigationFilter; - sourceTree = ""; - }; - 7ED95CF11AB9028C008C4574 /* Private */ = { - isa = PBXGroup; - children = ( - AA747D9E0F9514B9006C5449 /* CordovaLib_Prefix.pch */, - 7ED95CF21AB9028C008C4574 /* CDVDebug.h */, - 7ED95CF31AB9028C008C4574 /* CDVJSON_private.h */, - 7ED95CF41AB9028C008C4574 /* CDVJSON_private.m */, - 7ED95CF51AB9028C008C4574 /* CDVPlugin+Private.h */, - 7ED95CF61AB9028C008C4574 /* Plugins */, - ); - name = Private; - path = Classes/Private; - sourceTree = ""; - }; - 7ED95CF61AB9028C008C4574 /* Plugins */ = { - isa = PBXGroup; - children = ( - A3B082D11BB15CEA00D8DC35 /* CDVGestureHandler */, - 3093E2201B16D6A3003F381A /* CDVIntentAndNavigationFilter */, - 7ED95CF71AB9028C008C4574 /* CDVHandleOpenURL */, - 7ED95CFA1AB9028C008C4574 /* CDVLocalStorage */, - 7ED95CFD1AB9028C008C4574 /* CDVUIWebViewEngine */, - ); - path = Plugins; - sourceTree = ""; - }; - 7ED95CF71AB9028C008C4574 /* CDVHandleOpenURL */ = { - isa = PBXGroup; - children = ( - 7ED95CF81AB9028C008C4574 /* CDVHandleOpenURL.h */, - 7ED95CF91AB9028C008C4574 /* CDVHandleOpenURL.m */, - ); - path = CDVHandleOpenURL; - sourceTree = ""; - }; - 7ED95CFA1AB9028C008C4574 /* CDVLocalStorage */ = { - isa = PBXGroup; - children = ( - 7ED95CFB1AB9028C008C4574 /* CDVLocalStorage.h */, - 7ED95CFC1AB9028C008C4574 /* CDVLocalStorage.m */, - ); - path = CDVLocalStorage; - sourceTree = ""; - }; - 7ED95CFD1AB9028C008C4574 /* CDVUIWebViewEngine */ = { - isa = PBXGroup; - children = ( - 30193A4E1AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.m */, - 30193A4F1AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.h */, - 7ED95CFE1AB9028C008C4574 /* CDVUIWebViewDelegate.h */, - 7ED95CFF1AB9028C008C4574 /* CDVUIWebViewDelegate.m */, - 7ED95D001AB9028C008C4574 /* CDVUIWebViewEngine.h */, - 7ED95D011AB9028C008C4574 /* CDVUIWebViewEngine.m */, - ); - path = CDVUIWebViewEngine; - sourceTree = ""; - }; - 7ED95D0E1AB9029B008C4574 /* Public */ = { - isa = PBXGroup; - children = ( - 7ED95D0F1AB9029B008C4574 /* CDV.h */, - 7ED95D101AB9029B008C4574 /* CDVAppDelegate.h */, - 7ED95D111AB9029B008C4574 /* CDVAppDelegate.m */, - 7ED95D121AB9029B008C4574 /* CDVAvailability.h */, - 7ED95D131AB9029B008C4574 /* CDVAvailabilityDeprecated.h */, - 7ED95D141AB9029B008C4574 /* CDVCommandDelegate.h */, - 7ED95D151AB9029B008C4574 /* CDVCommandDelegateImpl.h */, - 7ED95D161AB9029B008C4574 /* CDVCommandDelegateImpl.m */, - 7ED95D171AB9029B008C4574 /* CDVCommandQueue.h */, - 7ED95D181AB9029B008C4574 /* CDVCommandQueue.m */, - 7ED95D191AB9029B008C4574 /* CDVConfigParser.h */, - 7ED95D1A1AB9029B008C4574 /* CDVConfigParser.m */, - 7ED95D1B1AB9029B008C4574 /* CDVInvokedUrlCommand.h */, - 7ED95D1C1AB9029B008C4574 /* CDVInvokedUrlCommand.m */, - 7ED95D1D1AB9029B008C4574 /* CDVPlugin+Resources.h */, - 7ED95D1E1AB9029B008C4574 /* CDVPlugin+Resources.m */, - 7ED95D1F1AB9029B008C4574 /* CDVPlugin.h */, - 7ED95D201AB9029B008C4574 /* CDVPlugin.m */, - 7ED95D211AB9029B008C4574 /* CDVPluginResult.h */, - 7ED95D221AB9029B008C4574 /* CDVPluginResult.m */, - 7ED95D231AB9029B008C4574 /* CDVScreenOrientationDelegate.h */, - 7ED95D241AB9029B008C4574 /* CDVTimer.h */, - 7ED95D251AB9029B008C4574 /* CDVTimer.m */, - 7ED95D261AB9029B008C4574 /* CDVURLProtocol.h */, - 7ED95D271AB9029B008C4574 /* CDVURLProtocol.m */, - 7ED95D281AB9029B008C4574 /* CDVUserAgentUtil.h */, - 7ED95D291AB9029B008C4574 /* CDVUserAgentUtil.m */, - 7ED95D2A1AB9029B008C4574 /* CDVViewController.h */, - 7ED95D2B1AB9029B008C4574 /* CDVViewController.m */, - 7ED95D2C1AB9029B008C4574 /* CDVWebViewEngineProtocol.h */, - 7ED95D2D1AB9029B008C4574 /* CDVWhitelist.h */, - 7ED95D2E1AB9029B008C4574 /* CDVWhitelist.m */, - 7ED95D311AB9029B008C4574 /* NSDictionary+CordovaPreferences.h */, - 7ED95D321AB9029B008C4574 /* NSDictionary+CordovaPreferences.m */, - 7ED95D331AB9029B008C4574 /* NSMutableArray+QueueAdditions.h */, - 7ED95D341AB9029B008C4574 /* NSMutableArray+QueueAdditions.m */, - ); - name = Public; - path = Classes/Public; - sourceTree = ""; - }; - A3B082D11BB15CEA00D8DC35 /* CDVGestureHandler */ = { - isa = PBXGroup; - children = ( - A3B082D21BB15CEA00D8DC35 /* CDVGestureHandler.h */, - A3B082D31BB15CEA00D8DC35 /* CDVGestureHandler.m */, - ); - path = CDVGestureHandler; - sourceTree = ""; - }; - C0C01EB31E3911D50056E6CB /* Cordova */ = { - isa = PBXGroup; - children = ( - C0C01EB41E3911D50056E6CB /* Cordova.h */, - C0C01EB51E3911D50056E6CB /* Info.plist */, - ); - path = Cordova; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - C0C01EAF1E3911D50056E6CB /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - C0C01EC11E39131A0056E6CB /* CDVCommandQueue.h in Headers */, - C0C01EC51E39131A0056E6CB /* CDVPlugin.h in Headers */, - C0C01ECF1E39131A0056E6CB /* NSMutableArray+QueueAdditions.h in Headers */, - C0C01EC21E39131A0056E6CB /* CDVConfigParser.h in Headers */, - C0C01EC81E39131A0056E6CB /* CDVTimer.h in Headers */, - C0C01EBB1E39131A0056E6CB /* CDV.h in Headers */, - C0C01ECE1E39131A0056E6CB /* NSDictionary+CordovaPreferences.h in Headers */, - C0C01EB61E3911D50056E6CB /* Cordova.h in Headers */, - C0C01EC41E39131A0056E6CB /* CDVPlugin+Resources.h in Headers */, - C0C01EBE1E39131A0056E6CB /* CDVAvailabilityDeprecated.h in Headers */, - C0C01EC91E39131A0056E6CB /* CDVURLProtocol.h in Headers */, - C0C01EBF1E39131A0056E6CB /* CDVCommandDelegate.h in Headers */, - C0C01ECD1E39131A0056E6CB /* CDVWhitelist.h in Headers */, - C0C01ED01E3913610056E6CB /* CDVUIWebViewDelegate.h in Headers */, - C0C01ECA1E39131A0056E6CB /* CDVUserAgentUtil.h in Headers */, - C0C01EBC1E39131A0056E6CB /* CDVAppDelegate.h in Headers */, - C0C01EBD1E39131A0056E6CB /* CDVAvailability.h in Headers */, - C0C01ECB1E39131A0056E6CB /* CDVViewController.h in Headers */, - C0C01ECC1E39131A0056E6CB /* CDVWebViewEngineProtocol.h in Headers */, - C0C01EC01E39131A0056E6CB /* CDVCommandDelegateImpl.h in Headers */, - C0C01EC31E39131A0056E6CB /* CDVInvokedUrlCommand.h in Headers */, - C0C01EC71E39131A0056E6CB /* CDVScreenOrientationDelegate.h in Headers */, - C0C01EC61E39131A0056E6CB /* CDVPluginResult.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D2AAC07A0554694100DB518D /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 7ED95D521AB9029B008C4574 /* CDVWebViewEngineProtocol.h in Headers */, - 7ED95D491AB9029B008C4574 /* CDVScreenOrientationDelegate.h in Headers */, - 7ED95D351AB9029B008C4574 /* CDV.h in Headers */, - A3B082D41BB15CEA00D8DC35 /* CDVGestureHandler.h in Headers */, - 7ED95D3B1AB9029B008C4574 /* CDVCommandDelegateImpl.h in Headers */, - 7ED95D3D1AB9029B008C4574 /* CDVCommandQueue.h in Headers */, - 7ED95D531AB9029B008C4574 /* CDVWhitelist.h in Headers */, - 7ED95D361AB9029B008C4574 /* CDVAppDelegate.h in Headers */, - 7ED95D431AB9029B008C4574 /* CDVPlugin+Resources.h in Headers */, - 7ED95D381AB9029B008C4574 /* CDVAvailability.h in Headers */, - 7ED95D0A1AB9028C008C4574 /* CDVUIWebViewDelegate.h in Headers */, - 7ED95D471AB9029B008C4574 /* CDVPluginResult.h in Headers */, - 7ED95D591AB9029B008C4574 /* NSMutableArray+QueueAdditions.h in Headers */, - 7ED95D411AB9029B008C4574 /* CDVInvokedUrlCommand.h in Headers */, - 7ED95D571AB9029B008C4574 /* NSDictionary+CordovaPreferences.h in Headers */, - 7ED95D451AB9029B008C4574 /* CDVPlugin.h in Headers */, - 7ED95D4C1AB9029B008C4574 /* CDVURLProtocol.h in Headers */, - 7ED95D3A1AB9029B008C4574 /* CDVCommandDelegate.h in Headers */, - 7ED95D391AB9029B008C4574 /* CDVAvailabilityDeprecated.h in Headers */, - 7ED95D4E1AB9029B008C4574 /* CDVUserAgentUtil.h in Headers */, - 7ED95D4A1AB9029B008C4574 /* CDVTimer.h in Headers */, - 7ED95D3F1AB9029B008C4574 /* CDVConfigParser.h in Headers */, - 7ED95D501AB9029B008C4574 /* CDVViewController.h in Headers */, - 7ED95D031AB9028C008C4574 /* CDVJSON_private.h in Headers */, - 7ED95D021AB9028C008C4574 /* CDVDebug.h in Headers */, - 7ED95D051AB9028C008C4574 /* CDVPlugin+Private.h in Headers */, - 7E7F69B61ABA35D8007546F4 /* CDVLocalStorage.h in Headers */, - 3093E2231B16D6A3003F381A /* CDVIntentAndNavigationFilter.h in Headers */, - 7E7F69B81ABA368F007546F4 /* CDVUIWebViewEngine.h in Headers */, - 7E7F69B91ABA3692007546F4 /* CDVHandleOpenURL.h in Headers */, - 30193A511AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - C0C01EB11E3911D50056E6CB /* Cordova */ = { - isa = PBXNativeTarget; - buildConfigurationList = C0C01EB91E3911D50056E6CB /* Build configuration list for PBXNativeTarget "Cordova" */; - buildPhases = ( - C0C01EAD1E3911D50056E6CB /* Sources */, - C0C01EAE1E3911D50056E6CB /* Frameworks */, - C0C01EAF1E3911D50056E6CB /* Headers */, - C0C01EB01E3911D50056E6CB /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - C0C01ED21E39137C0056E6CB /* PBXTargetDependency */, - ); - name = Cordova; - productName = Cordova; - productReference = C0C01EB21E3911D50056E6CB /* Cordova.framework */; - productType = "com.apple.product-type.framework"; - }; - D2AAC07D0554694100DB518D /* CordovaLib */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "CordovaLib" */; - buildPhases = ( - D2AAC07A0554694100DB518D /* Headers */, - D2AAC07B0554694100DB518D /* Sources */, - D2AAC07C0554694100DB518D /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = CordovaLib; - productName = CordovaLib; - productReference = 68A32D7114102E1C006B237C /* libCordova.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 0867D690FE84028FC02AAC07 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0720; - TargetAttributes = { - C0C01EB11E3911D50056E6CB = { - CreatedOnToolsVersion = 8.2; - ProvisioningStyle = Automatic; - }; - }; - }; - buildConfigurationList = 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "CordovaLib" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - English, - Japanese, - French, - German, - en, - ); - mainGroup = 0867D691FE84028FC02AAC07 /* CordovaLib */; - productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - D2AAC07D0554694100DB518D /* CordovaLib */, - C0C01EB11E3911D50056E6CB /* Cordova */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - C0C01EB01E3911D50056E6CB /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - C0C01EAD1E3911D50056E6CB /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D2AAC07B0554694100DB518D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 7ED95D511AB9029B008C4574 /* CDVViewController.m in Sources */, - 7ED95D581AB9029B008C4574 /* NSDictionary+CordovaPreferences.m in Sources */, - 7ED95D371AB9029B008C4574 /* CDVAppDelegate.m in Sources */, - 7ED95D0B1AB9028C008C4574 /* CDVUIWebViewDelegate.m in Sources */, - 7ED95D3C1AB9029B008C4574 /* CDVCommandDelegateImpl.m in Sources */, - 7ED95D041AB9028C008C4574 /* CDVJSON_private.m in Sources */, - 7ED95D541AB9029B008C4574 /* CDVWhitelist.m in Sources */, - 7ED95D421AB9029B008C4574 /* CDVInvokedUrlCommand.m in Sources */, - 7ED95D4B1AB9029B008C4574 /* CDVTimer.m in Sources */, - 7ED95D4F1AB9029B008C4574 /* CDVUserAgentUtil.m in Sources */, - 7ED95D401AB9029B008C4574 /* CDVConfigParser.m in Sources */, - A3B082D51BB15CEA00D8DC35 /* CDVGestureHandler.m in Sources */, - 7ED95D071AB9028C008C4574 /* CDVHandleOpenURL.m in Sources */, - 30193A501AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.m in Sources */, - 7ED95D5A1AB9029B008C4574 /* NSMutableArray+QueueAdditions.m in Sources */, - 7ED95D3E1AB9029B008C4574 /* CDVCommandQueue.m in Sources */, - 7ED95D481AB9029B008C4574 /* CDVPluginResult.m in Sources */, - 7ED95D441AB9029B008C4574 /* CDVPlugin+Resources.m in Sources */, - 7ED95D4D1AB9029B008C4574 /* CDVURLProtocol.m in Sources */, - 7ED95D0D1AB9028C008C4574 /* CDVUIWebViewEngine.m in Sources */, - 7ED95D461AB9029B008C4574 /* CDVPlugin.m in Sources */, - 7ED95D091AB9028C008C4574 /* CDVLocalStorage.m in Sources */, - 3093E2241B16D6A3003F381A /* CDVIntentAndNavigationFilter.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - C0C01ED21E39137C0056E6CB /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = D2AAC07D0554694100DB518D /* CordovaLib */; - targetProxy = C0C01ED11E39137C0056E6CB /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 1DEB921F08733DC00010E9CD /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - COPY_PHASE_STRIP = NO; - DSTROOT = "/tmp/$(PROJECT_NAME).dst"; - GCC_DYNAMIC_NO_PIC = NO; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = CordovaLib_Prefix.pch; - GCC_PREPROCESSOR_DEFINITIONS = ""; - GCC_THUMB_SUPPORT = NO; - GCC_VERSION = ""; - INSTALL_PATH = /usr/local/lib; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - PRODUCT_NAME = Cordova; - PUBLIC_HEADERS_FOLDER_PATH = include/Cordova; - SKIP_INSTALL = YES; - }; - name = Debug; - }; - 1DEB922008733DC00010E9CD /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - DSTROOT = "/tmp/$(PROJECT_NAME).dst"; - GCC_MODEL_TUNING = G5; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = CordovaLib_Prefix.pch; - GCC_PREPROCESSOR_DEFINITIONS = ""; - GCC_THUMB_SUPPORT = NO; - GCC_VERSION = ""; - INSTALL_PATH = /usr/local/lib; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - PRODUCT_NAME = Cordova; - PUBLIC_HEADERS_FOLDER_PATH = include/Cordova; - SKIP_INSTALL = YES; - }; - name = Release; - }; - 1DEB922308733DC00010E9CD /* 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_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ""; - GCC_THUMB_SUPPORT = NO; - GCC_VERSION = ""; - 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; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - ONLY_ACTIVE_ARCH = YES; - OTHER_CFLAGS = "-DDEBUG"; - PUBLIC_HEADERS_FOLDER_PATH = include/Cordova; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = ""; - }; - name = Debug; - }; - 1DEB922408733DC00010E9CD /* 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_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_PREPROCESSOR_DEFINITIONS = ""; - GCC_THUMB_SUPPORT = NO; - GCC_VERSION = ""; - 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; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - ONLY_ACTIVE_ARCH = NO; - PUBLIC_HEADERS_FOLDER_PATH = include/Cordova; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; - C0C01EB71E3911D50056E6CB /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD)"; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - INFOPLIST_FILE = Cordova/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = "-all_load"; - PRODUCT_BUNDLE_IDENTIFIER = org.apache.cordova.Cordova; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Headers"; - SKIP_INSTALL = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - C0C01EB81E3911D50056E6CB /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD)"; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - INFOPLIST_FILE = Cordova/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = "-all_load"; - PRODUCT_BUNDLE_IDENTIFIER = org.apache.cordova.Cordova; - PRODUCT_NAME = "$(TARGET_NAME)"; - PUBLIC_HEADERS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Headers"; - SKIP_INSTALL = YES; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "CordovaLib" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1DEB921F08733DC00010E9CD /* Debug */, - 1DEB922008733DC00010E9CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "CordovaLib" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1DEB922308733DC00010E9CD /* Debug */, - 1DEB922408733DC00010E9CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C0C01EB91E3911D50056E6CB /* Build configuration list for PBXNativeTarget "Cordova" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C0C01EB71E3911D50056E6CB /* Debug */, - C0C01EB81E3911D50056E6CB /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 0867D690FE84028FC02AAC07 /* Project object */; -} diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/CordovaLib/VERSION b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/CordovaLib/VERSION deleted file mode 100644 index 1545d96..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/CordovaLib/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.5.0 diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp.xcodeproj/project.orig.pbxproj b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp.xcodeproj/project.orig.pbxproj deleted file mode 100755 index 3b67dae..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp.xcodeproj/project.orig.pbxproj +++ /dev/null @@ -1,409 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { -/* Begin PBXBuildFile section */ - 0207DA581B56EA530066E2B4 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0207DA571B56EA530066E2B4 /* Images.xcassets */; }; - 1D3623260D0F684500981E51 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* AppDelegate.m */; }; - 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; - 301BF552109A68D80062928A /* libCordova.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 301BF535109A57CC0062928A /* libCordova.a */; }; - 302D95F114D2391D003F00A1 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 302D95EF14D2391D003F00A1 /* MainViewController.m */; }; - 302D95F214D2391D003F00A1 /* MainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 302D95F014D2391D003F00A1 /* MainViewController.xib */; }; - 3047A5121AB8059700498E2A /* build-debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 3047A50F1AB8059700498E2A /* build-debug.xcconfig */; }; - 3047A5131AB8059700498E2A /* build-release.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 3047A5101AB8059700498E2A /* build-release.xcconfig */; }; - 3047A5141AB8059700498E2A /* build.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 3047A5111AB8059700498E2A /* build.xcconfig */; }; - 6AFF5BF91D6E424B00AB3073 /* CDVLaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6AFF5BF81D6E424B00AB3073 /* CDVLaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 301BF534109A57CC0062928A /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = D2AAC07E0554694100DB518D; - remoteInfo = CordovaLib; - }; - 301BF550109A68C00062928A /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = D2AAC07D0554694100DB518D; - remoteInfo = CordovaLib; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 0207DA571B56EA530066E2B4 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = "ChildApp/Images.xcassets"; sourceTree = SOURCE_ROOT; }; - 1D3623240D0F684500981E51 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 1D3623250D0F684500981E51 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 1D6058910D05DD3D006BFB54 /* ChildApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ChildApp.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = CordovaLib/CordovaLib.xcodeproj; sourceTree = ""; }; - 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 = ""; }; - 302D95EF14D2391D003F00A1 /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = ""; }; - 302D95F014D2391D003F00A1 /* MainViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainViewController.xib; sourceTree = ""; }; - 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; }; - 32CA4F630368D1EE00C91783 /* ChildApp-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ChildApp-Prefix.pch"; sourceTree = ""; }; - 6AFF5BF81D6E424B00AB3073 /* CDVLaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = CDVLaunchScreen.storyboard; path = "ChildApp/CDVLaunchScreen.storyboard"; sourceTree = SOURCE_ROOT; }; - 8D1107310486CEB800E47090 /* ChildApp-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "ChildApp-Info.plist"; path = "ChildApp/ChildApp-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = SOURCE_ROOT; }; - EB87FDF31871DA8E0020F90C /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; name = www; path = ../../www; sourceTree = ""; }; - EB87FDF41871DAF40020F90C /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = ../../config.xml; sourceTree = ""; }; - F840E1F0165FE0F500CFE078 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = "ChildApp/config.xml"; sourceTree = ""; }; - ED33DF2A687741AEAF9F8254 /* Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "Bridging-Header.h"; path = "Bridging-Header.h"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 301BF552109A68D80062928A /* libCordova.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 080E96DDFE201D6D7F000001 /* Classes */ = { - isa = PBXGroup; - children = ( - 302D95EE14D2391D003F00A1 /* MainViewController.h */, - 302D95EF14D2391D003F00A1 /* MainViewController.m */, - 302D95F014D2391D003F00A1 /* MainViewController.xib */, - 1D3623240D0F684500981E51 /* AppDelegate.h */, - 1D3623250D0F684500981E51 /* AppDelegate.m */, - ); - name = Classes; - path = "ChildApp/Classes"; - sourceTree = SOURCE_ROOT; - }; - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 1D6058910D05DD3D006BFB54 /* ChildApp.app */, - ); - name = Products; - sourceTree = ""; - }; - 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { - isa = PBXGroup; - children = ( - EB87FDF41871DAF40020F90C /* config.xml */, - EB87FDF31871DA8E0020F90C /* www */, - EB87FDF11871DA420020F90C /* Staging */, - 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */, - 080E96DDFE201D6D7F000001 /* Classes */, - 307C750510C5A3420062BCA9 /* Plugins */, - 29B97315FDCFA39411CA2CEA /* Other Sources */, - 29B97317FDCFA39411CA2CEA /* Resources */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 19C28FACFE9D520D11CA2CBB /* Products */, - ); - name = CustomTemplate; - sourceTree = ""; - }; - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - 32CA4F630368D1EE00C91783 /* ChildApp-Prefix.pch */, - 29B97316FDCFA39411CA2CEA /* main.m */, - ED33DF2A687741AEAF9F8254 /* Bridging-Header.h */, - ); - name = "Other Sources"; - path = "ChildApp"; - sourceTree = ""; - }; - 29B97317FDCFA39411CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - 0207DA571B56EA530066E2B4 /* Images.xcassets */, - 3047A50E1AB8057F00498E2A /* config */, - 8D1107310486CEB800E47090 /* ChildApp-Info.plist */, - 6AFF5BF81D6E424B00AB3073 /* CDVLaunchScreen.storyboard */, - ); - name = Resources; - path = "ChildApp/Resources"; - sourceTree = ""; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - ); - name = Frameworks; - sourceTree = ""; - }; - 301BF52E109A57CC0062928A /* Products */ = { - isa = PBXGroup; - children = ( - 301BF535109A57CC0062928A /* libCordova.a */, - ); - name = Products; - sourceTree = ""; - }; - 3047A50E1AB8057F00498E2A /* config */ = { - isa = PBXGroup; - children = ( - 3047A50F1AB8059700498E2A /* build-debug.xcconfig */, - 3047A5101AB8059700498E2A /* build-release.xcconfig */, - 3047A5111AB8059700498E2A /* build.xcconfig */, - ); - name = config; - sourceTree = ""; - }; - 307C750510C5A3420062BCA9 /* Plugins */ = { - isa = PBXGroup; - children = ( - ); - name = Plugins; - path = "ChildApp/Plugins"; - sourceTree = SOURCE_ROOT; - }; - EB87FDF11871DA420020F90C /* Staging */ = { - isa = PBXGroup; - children = ( - F840E1F0165FE0F500CFE078 /* config.xml */, - 301BF56E109A69640062928A /* www */, - ); - name = Staging; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 1D6058900D05DD3D006BFB54 /* ChildApp */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "ChildApp" */; - buildPhases = ( - 304B58A110DAC018002A0835 /* Copy www directory */, - 1D60588D0D05DD3D006BFB54 /* Resources */, - 1D60588E0D05DD3D006BFB54 /* Sources */, - 1D60588F0D05DD3D006BFB54 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - 301BF551109A68C00062928A /* PBXTargetDependency */, - ); - name = "ChildApp"; - productName = "ChildApp"; - productReference = 1D6058910D05DD3D006BFB54 /* ChildApp.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 510; - }; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "__NON-CLI__" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 1; - mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; - projectDirPath = ""; - projectReferences = ( - { - ProductGroup = 301BF52E109A57CC0062928A /* Products */; - ProjectRef = 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */; - }, - ); - projectRoot = ""; - targets = ( - 1D6058900D05DD3D006BFB54 /* ChildApp */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXReferenceProxy section */ - 301BF535109A57CC0062928A /* libCordova.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libCordova.a; - remoteRef = 301BF534109A57CC0062928A /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - -/* Begin PBXResourcesBuildPhase section */ - 1D60588D0D05DD3D006BFB54 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 302D95F214D2391D003F00A1 /* MainViewController.xib in Resources */, - 0207DA581B56EA530066E2B4 /* Images.xcassets in Resources */, - 6AFF5BF91D6E424B00AB3073 /* CDVLaunchScreen.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 304B58A110DAC018002A0835 /* Copy www directory */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Copy www directory"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"$SRCROOT/ChildApp/Scripts/copy-www-build-step.sh\""; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 1D60588E0D05DD3D006BFB54 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1D60589B0D05DD56006BFB54 /* main.m in Sources */, - 1D3623260D0F684500981E51 /* AppDelegate.m in Sources */, - 302D95F114D2391D003F00A1 /* MainViewController.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 301BF551109A68C00062928A /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = CordovaLib; - targetProxy = 301BF550109A68C00062928A /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 1D6058940D05DD3E006BFB54 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 3047A50F1AB8059700498E2A /* build-debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "ChildApp/ChildApp-Prefix.pch"; - GCC_THUMB_SUPPORT = NO; - GCC_VERSION = ""; - INFOPLIST_FILE = "ChildApp/ChildApp-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; - TARGETED_DEVICE_FAMILY = "1,2"; - PRODUCT_NAME = "ChildApp"; - }; - name = Debug; - }; - 1D6058950D05DD3E006BFB54 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 3047A5101AB8059700498E2A /* build-release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - COPY_PHASE_STRIP = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "ChildApp/ChildApp-Prefix.pch"; - GCC_THUMB_SUPPORT = NO; - GCC_VERSION = ""; - INFOPLIST_FILE = "ChildApp/ChildApp-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; - TARGETED_DEVICE_FAMILY = "1,2"; - PRODUCT_NAME = "ChildApp"; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 3047A5111AB8059700498E2A /* build.xcconfig */; - buildSettings = { - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_THUMB_SUPPORT = NO; - GCC_VERSION = ""; - 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; - SDKROOT = iphoneos; - SKIP_INSTALL = NO; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 3047A5111AB8059700498E2A /* build.xcconfig */; - buildSettings = { - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_THUMB_SUPPORT = NO; - GCC_VERSION = ""; - 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; - SDKROOT = iphoneos; - SKIP_INSTALL = NO; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "ChildApp" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1D6058940D05DD3E006BFB54 /* Debug */, - 1D6058950D05DD3E006BFB54 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "__NON-CLI__" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp.xcodeproj/project.pbxproj b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp.xcodeproj/project.pbxproj deleted file mode 100755 index 84afac6..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp.xcodeproj/project.pbxproj +++ /dev/null @@ -1,460 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { -/* Begin PBXBuildFile section */ - 0207DA581B56EA530066E2B4 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0207DA571B56EA530066E2B4 /* Images.xcassets */; }; - 1D3623260D0F684500981E51 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* AppDelegate.m */; }; - 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; - 301BF552109A68D80062928A /* libCordova.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 301BF535109A57CC0062928A /* libCordova.a */; settings = {ATTRIBUTES = (Required, ); }; }; - 302D95F114D2391D003F00A1 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 302D95EF14D2391D003F00A1 /* MainViewController.m */; }; - 302D95F214D2391D003F00A1 /* MainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 302D95F014D2391D003F00A1 /* MainViewController.xib */; }; - 3047A5121AB8059700498E2A /* build-debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 3047A50F1AB8059700498E2A /* build-debug.xcconfig */; }; - 3047A5131AB8059700498E2A /* build-release.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 3047A5101AB8059700498E2A /* build-release.xcconfig */; }; - 3047A5141AB8059700498E2A /* build.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 3047A5111AB8059700498E2A /* build.xcconfig */; }; - 6AFF5BF91D6E424B00AB3073 /* CDVLaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6AFF5BF81D6E424B00AB3073 /* CDVLaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 301BF534109A57CC0062928A /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = D2AAC07E0554694100DB518D; - remoteInfo = CordovaLib; - }; - 301BF550109A68C00062928A /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = D2AAC07D0554694100DB518D; - remoteInfo = CordovaLib; - }; - 907D8123214C687600058A10 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = C0C01EB21E3911D50056E6CB; - remoteInfo = Cordova; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 0207DA571B56EA530066E2B4 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = "SampleApp/Images.xcassets"; sourceTree = SOURCE_ROOT; }; - 1D3623240D0F684500981E51 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 1D3623250D0F684500981E51 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 1D6058910D05DD3D006BFB54 /* SampleApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SampleApp.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = CordovaLib/CordovaLib.xcodeproj; sourceTree = ""; }; - 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 = ""; }; - 302D95EF14D2391D003F00A1 /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = ""; }; - 302D95F014D2391D003F00A1 /* MainViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainViewController.xib; sourceTree = ""; }; - 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; }; - 32CA4F630368D1EE00C91783 /* SampleApp-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "SampleApp-Prefix.pch"; sourceTree = ""; }; - 6AFF5BF81D6E424B00AB3073 /* CDVLaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = CDVLaunchScreen.storyboard; path = "SampleApp/CDVLaunchScreen.storyboard"; sourceTree = SOURCE_ROOT; }; - 8D1107310486CEB800E47090 /* SampleApp-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "SampleApp-Info.plist"; path = "SampleApp/SampleApp-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = SOURCE_ROOT; }; - EB87FDF31871DA8E0020F90C /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; name = www; path = ../../www; sourceTree = ""; }; - EB87FDF41871DAF40020F90C /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = ../../config.xml; sourceTree = ""; }; - ED33DF2A687741AEAF9F8254 /* Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "Bridging-Header.h"; path = "Bridging-Header.h"; sourceTree = ""; }; - F840E1F0165FE0F500CFE078 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = "SampleApp/config.xml"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 301BF552109A68D80062928A /* libCordova.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 080E96DDFE201D6D7F000001 /* Classes */ = { - isa = PBXGroup; - children = ( - 302D95EE14D2391D003F00A1 /* MainViewController.h */, - 302D95EF14D2391D003F00A1 /* MainViewController.m */, - 302D95F014D2391D003F00A1 /* MainViewController.xib */, - 1D3623240D0F684500981E51 /* AppDelegate.h */, - 1D3623250D0F684500981E51 /* AppDelegate.m */, - ); - name = Classes; - path = "SampleApp/Classes"; - sourceTree = SOURCE_ROOT; - }; - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 1D6058910D05DD3D006BFB54 /* SampleApp.app */, - ); - name = Products; - sourceTree = ""; - }; - 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { - isa = PBXGroup; - children = ( - EB87FDF41871DAF40020F90C /* config.xml */, - EB87FDF31871DA8E0020F90C /* www */, - EB87FDF11871DA420020F90C /* Staging */, - 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */, - 080E96DDFE201D6D7F000001 /* Classes */, - 307C750510C5A3420062BCA9 /* Plugins */, - 29B97315FDCFA39411CA2CEA /* Other Sources */, - 29B97317FDCFA39411CA2CEA /* Resources */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 19C28FACFE9D520D11CA2CBB /* Products */, - ); - name = CustomTemplate; - sourceTree = ""; - }; - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - 32CA4F630368D1EE00C91783 /* SampleApp-Prefix.pch */, - 29B97316FDCFA39411CA2CEA /* main.m */, - ED33DF2A687741AEAF9F8254 /* Bridging-Header.h */, - ); - name = "Other Sources"; - path = "SampleApp"; - sourceTree = ""; - }; - 29B97317FDCFA39411CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - 0207DA571B56EA530066E2B4 /* Images.xcassets */, - 3047A50E1AB8057F00498E2A /* config */, - 8D1107310486CEB800E47090 /* SampleApp-Info.plist */, - 6AFF5BF81D6E424B00AB3073 /* CDVLaunchScreen.storyboard */, - ); - name = Resources; - path = "SampleApp/Resources"; - sourceTree = ""; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - ); - name = Frameworks; - sourceTree = ""; - }; - 301BF52E109A57CC0062928A /* Products */ = { - isa = PBXGroup; - children = ( - 301BF535109A57CC0062928A /* libCordova.a */, - 907D8124214C687600058A10 /* Cordova.framework */, - ); - name = Products; - sourceTree = ""; - }; - 3047A50E1AB8057F00498E2A /* config */ = { - isa = PBXGroup; - children = ( - 3047A50F1AB8059700498E2A /* build-debug.xcconfig */, - 3047A5101AB8059700498E2A /* build-release.xcconfig */, - 3047A5111AB8059700498E2A /* build.xcconfig */, - ); - name = config; - sourceTree = ""; - }; - 307C750510C5A3420062BCA9 /* Plugins */ = { - isa = PBXGroup; - children = ( - ); - name = Plugins; - path = "SampleApp/Plugins"; - sourceTree = SOURCE_ROOT; - }; - EB87FDF11871DA420020F90C /* Staging */ = { - isa = PBXGroup; - children = ( - F840E1F0165FE0F500CFE078 /* config.xml */, - 301BF56E109A69640062928A /* www */, - ); - name = Staging; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 1D6058900D05DD3D006BFB54 /* SampleApp */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "SampleApp" */; - buildPhases = ( - 304B58A110DAC018002A0835 /* Copy www directory */, - 1D60588D0D05DD3D006BFB54 /* Resources */, - 1D60588E0D05DD3D006BFB54 /* Sources */, - 1D60588F0D05DD3D006BFB54 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - 301BF551109A68C00062928A /* PBXTargetDependency */, - ); - name = "SampleApp"; - productName = "SampleApp"; - productReference = 1D6058910D05DD3D006BFB54 /* SampleApp.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0510; - TargetAttributes = { - 1D6058900D05DD3D006BFB54 = { - ProvisioningStyle = Automatic; - }; - }; - }; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "__NON-CLI__" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 1; - mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; - projectDirPath = ""; - projectReferences = ( - { - ProductGroup = 301BF52E109A57CC0062928A /* Products */; - ProjectRef = 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */; - }, - ); - projectRoot = ""; - targets = ( - 1D6058900D05DD3D006BFB54 /* SampleApp */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXReferenceProxy section */ - 301BF535109A57CC0062928A /* libCordova.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libCordova.a; - remoteRef = 301BF534109A57CC0062928A /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 907D8124214C687600058A10 /* Cordova.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Cordova.framework; - remoteRef = 907D8123214C687600058A10 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - -/* Begin PBXResourcesBuildPhase section */ - 1D60588D0D05DD3D006BFB54 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 302D95F214D2391D003F00A1 /* MainViewController.xib in Resources */, - 0207DA581B56EA530066E2B4 /* Images.xcassets in Resources */, - 6AFF5BF91D6E424B00AB3073 /* CDVLaunchScreen.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 304B58A110DAC018002A0835 /* Copy www directory */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Copy www directory"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"$SRCROOT/SampleApp/Scripts/copy-www-build-step.sh\""; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 1D60588E0D05DD3D006BFB54 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1D60589B0D05DD56006BFB54 /* main.m in Sources */, - 1D3623260D0F684500981E51 /* AppDelegate.m in Sources */, - 302D95F114D2391D003F00A1 /* MainViewController.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 301BF551109A68C00062928A /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = CordovaLib; - targetProxy = 301BF550109A68C00062928A /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 1D6058940D05DD3E006BFB54 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 3047A50F1AB8059700498E2A /* build-debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "SampleApp/SampleApp-Prefix.pch"; - GCC_THUMB_SUPPORT = NO; - GCC_VERSION = ""; - INFOPLIST_FILE = "SampleApp/SampleApp-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.example.friendstring"; - PRODUCT_NAME = "SampleApp"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 1D6058950D05DD3E006BFB54 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 3047A5101AB8059700498E2A /* build-release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - COPY_PHASE_STRIP = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "SampleApp/SampleApp-Prefix.pch"; - GCC_THUMB_SUPPORT = NO; - GCC_VERSION = ""; - INFOPLIST_FILE = "SampleApp/SampleApp-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.example.friendstring"; - PRODUCT_NAME = "SampleApp"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 3047A5111AB8059700498E2A /* build.xcconfig */; - buildSettings = { - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = 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_C_LANGUAGE_STANDARD = c99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_THUMB_SUPPORT = NO; - GCC_VERSION = ""; - 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; - SDKROOT = iphoneos; - SKIP_INSTALL = NO; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 3047A5111AB8059700498E2A /* build.xcconfig */; - buildSettings = { - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_THUMB_SUPPORT = NO; - GCC_VERSION = ""; - 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; - SDKROOT = iphoneos; - SKIP_INSTALL = NO; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "SampleApp" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1D6058940D05DD3E006BFB54 /* Debug */, - 1D6058950D05DD3E006BFB54 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SampleApp" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Bridging-Header.h b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Bridging-Header.h deleted file mode 100644 index 5d8abc9..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Bridging-Header.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ -// -// Bridging-Header.h -// __PROJECT_NAME__ -// -// Created by ___FULLUSERNAME___ on ___DATE___. -// Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved. -// -// -// Use this file to import your target's public headers that you would like to expose to Swift. -// - -#import diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/CDVLaunchScreen.storyboard b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/CDVLaunchScreen.storyboard deleted file mode 100644 index 51cdcf6..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/CDVLaunchScreen.storyboard +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Classes/AppDelegate.h b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Classes/AppDelegate.h deleted file mode 100644 index 4ba7c6b..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Classes/AppDelegate.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -// -// AppDelegate.h -// SampleApp -// -// Created by ___FULLUSERNAME___ on ___DATE___. -// Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved. -// - -#import -#import - -@interface AppDelegate : CDVAppDelegate {} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Classes/AppDelegate.m b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Classes/AppDelegate.m deleted file mode 100644 index 7599921..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Classes/AppDelegate.m +++ /dev/null @@ -1,39 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -// -// AppDelegate.m -// SampleApp -// -// Created by ___FULLUSERNAME___ on ___DATE___. -// Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved. -// - -#import "AppDelegate.h" -#import "MainViewController.h" - -@implementation AppDelegate - -- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions -{ - self.viewController = [[MainViewController alloc] init]; - return [super application:application didFinishLaunchingWithOptions:launchOptions]; -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Classes/MainViewController.h b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Classes/MainViewController.h deleted file mode 100644 index a9a269d..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Classes/MainViewController.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -// -// MainViewController.h -// SampleApp -// -// Created by ___FULLUSERNAME___ on ___DATE___. -// Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved. -// - -#import -#import -#import - -@interface MainViewController : CDVViewController - -@end - -@interface MainCommandDelegate : CDVCommandDelegateImpl -@end - -@interface MainCommandQueue : CDVCommandQueue -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Classes/MainViewController.m b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Classes/MainViewController.m deleted file mode 100644 index a7d7034..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Classes/MainViewController.m +++ /dev/null @@ -1,148 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -// -// MainViewController.h -// SampleApp -// -// Created by ___FULLUSERNAME___ on ___DATE___. -// Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved. -// - -#import "MainViewController.h" - -@implementation MainViewController - -- (id)initWithNibName:(NSString*)nibNameOrNil bundle:(NSBundle*)nibBundleOrNil -{ - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - if (self) { - // Uncomment to override the CDVCommandDelegateImpl used - // _commandDelegate = [[MainCommandDelegate alloc] initWithViewController:self]; - // Uncomment to override the CDVCommandQueue used - // _commandQueue = [[MainCommandQueue alloc] initWithViewController:self]; - } - return self; -} - -- (id)init -{ - self = [super init]; - if (self) { - // Uncomment to override the CDVCommandDelegateImpl used - // _commandDelegate = [[MainCommandDelegate alloc] initWithViewController:self]; - // Uncomment to override the CDVCommandQueue used - // _commandQueue = [[MainCommandQueue alloc] initWithViewController:self]; - } - return self; -} - -- (void)didReceiveMemoryWarning -{ - // Releases the view if it doesn't have a superview. - [super didReceiveMemoryWarning]; - - // Release any cached data, images, etc that aren't in use. -} - -#pragma mark View lifecycle - -- (void)viewWillAppear:(BOOL)animated -{ - // View defaults to full size. If you want to customize the view's size, or its subviews (e.g. webView), - // you can do so here. - - [super viewWillAppear:animated]; -} - -- (void)viewDidLoad -{ - [super viewDidLoad]; - // Do any additional setup after loading the view from its nib. -} - -- (void)viewDidUnload -{ - [super viewDidUnload]; - // Release any retained subviews of the main view. - // e.g. self.myOutlet = nil; -} - -/* Comment out the block below to over-ride */ - -/* -- (UIWebView*) newCordovaViewWithFrame:(CGRect)bounds -{ - return[super newCordovaViewWithFrame:bounds]; -} - -// CB-12098 -#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000 -- (NSUInteger)supportedInterfaceOrientations -#else -- (UIInterfaceOrientationMask)supportedInterfaceOrientations -#endif -{ - return [super supportedInterfaceOrientations]; -} - -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation -{ - return [super shouldAutorotateToInterfaceOrientation:interfaceOrientation]; -} - -- (BOOL)shouldAutorotate -{ - return [super shouldAutorotate]; -} -*/ - -@end - -@implementation MainCommandDelegate - -/* To override the methods, uncomment the line in the init function(s) - in MainViewController.m - */ - -#pragma mark CDVCommandDelegate implementation - -- (id)getCommandInstance:(NSString*)className -{ - return [super getCommandInstance:className]; -} - -- (NSString*)pathForResource:(NSString*)resourcepath -{ - return [super pathForResource:resourcepath]; -} - -@end - -@implementation MainCommandQueue - -/* To override, uncomment the line in the init function(s) - in MainViewController.m - */ -- (BOOL)execute:(CDVInvokedUrlCommand*)command -{ - return [super execute:command]; -} - -@end diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Classes/MainViewController.xib b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Classes/MainViewController.xib deleted file mode 100644 index e45d65c..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Classes/MainViewController.xib +++ /dev/null @@ -1,138 +0,0 @@ - - - - - 1280 - 11C25 - 1919 - 1138.11 - 566.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 916 - - - IBProxyObject - IBUIView - - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - PluginDependencyRecalculationVersion - - - - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 274 - {{0, 20}, {320, 460}} - - - - 3 - MQA - - 2 - - - - IBCocoaTouchFramework - - - - - - - view - - - - 3 - - - - - - 0 - - - - - - 1 - - - - - -1 - - - File's Owner - - - -2 - - - - - - - MainViewController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - - - 3 - - - - - MainViewController - UIViewController - - IBProjectSource - ./Classes/MainViewController.h - - - - - 0 - IBCocoaTouchFramework - YES - 3 - 916 - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Entitlements-Debug.plist b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Entitlements-Debug.plist deleted file mode 100644 index 1ed4ae5..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Entitlements-Debug.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Entitlements-Release.plist b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Entitlements-Release.plist deleted file mode 100644 index 1ed4ae5..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Entitlements-Release.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/Contents.json b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d19e65f..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,182 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "29x29", - "filename" : "icon-small.png", - "scale" : "1x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "filename" : "icon-small@2x.png", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "filename" : "icon-small@3x.png", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "filename" : "icon-40@2x.png", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "filename" : "icon-60@2x.png", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "57x57", - "filename" : "icon.png", - "scale" : "1x" - }, - { - "idiom" : "iphone", - "size" : "57x57", - "filename" : "icon@2x.png", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "filename" : "icon-60@2x.png", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "filename" : "icon-60@3x.png", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "filename" : "icon-small.png", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "filename" : "icon-small@2x.png", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "filename" : "icon-40.png", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "filename" : "icon-40@2x.png", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "50x50", - "filename" : "icon-50.png", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "50x50", - "filename" : "icon-50@2x.png", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "72x72", - "filename" : "icon-72.png", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "72x72", - "filename" : "icon-72@2x.png", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "filename" : "icon-76.png", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "filename" : "icon-76@2x.png", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "filename" : "icon-83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "24x24", - "idiom" : "watch", - "scale" : "2x", - "role" : "notificationCenter", - "subtype" : "38mm" - }, - { - "size" : "27.5x27.5", - "idiom" : "watch", - "scale" : "2x", - "role" : "notificationCenter", - "subtype" : "42mm" - }, - { - "size" : "29x29", - "idiom" : "watch", - "role" : "companionSettings", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "watch", - "role" : "companionSettings", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "watch", - "scale" : "2x", - "role" : "appLauncher", - "subtype" : "38mm" - }, - { - "size" : "44x44", - "idiom" : "watch", - "scale" : "2x", - "role" : "longLook", - "subtype" : "42mm" - }, - { - "size" : "86x86", - "idiom" : "watch", - "scale" : "2x", - "role" : "quickLook", - "subtype" : "38mm" - }, - { - "size" : "98x98", - "idiom" : "watch", - "scale" : "2x", - "role" : "quickLook", - "subtype" : "42mm" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-40.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-40.png deleted file mode 100644 index e865adb..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-40.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-40@2x.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-40@2x.png deleted file mode 100644 index 6d07dce..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-40@2x.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-50.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-50.png deleted file mode 100644 index 98a9d96..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-50.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-50@2x.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-50@2x.png deleted file mode 100644 index bac693f..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-50@2x.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-60@2x.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-60@2x.png deleted file mode 100644 index 955af36..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-60@2x.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-60@3x.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-60@3x.png deleted file mode 100644 index e126891..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-60@3x.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-72.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-72.png deleted file mode 100644 index 8c6e5df..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-72.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-72@2x.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-72@2x.png deleted file mode 100644 index dd819da..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-72@2x.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-76.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-76.png deleted file mode 100644 index 63afe7f..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-76.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-76@2x.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-76@2x.png deleted file mode 100644 index 4cff29a..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-76@2x.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-83.5@2x.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-83.5@2x.png deleted file mode 100644 index 3c1a011..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-83.5@2x.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-small.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-small.png deleted file mode 100644 index 0ea1c42..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-small.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-small@2x.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-small@2x.png deleted file mode 100644 index 2c72038..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-small@2x.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-small@3x.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-small@3x.png deleted file mode 100644 index 5c37dfc..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon-small@3x.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon.png deleted file mode 100644 index b2571a7..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon@2x.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon@2x.png deleted file mode 100644 index d75098f..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/AppIcon.appiconset/icon@2x.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/Contents.json b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/Contents.json deleted file mode 100644 index da4a164..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Contents.json b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Contents.json deleted file mode 100644 index 175f378..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Contents.json +++ /dev/null @@ -1,156 +0,0 @@ -{ - "images" : [ - { - "extent" : "full-screen", - "idiom" : "iphone", - "subtype" : "736h", - "filename" : "Default-736h.png", - "minimum-system-version" : "8.0", - "orientation" : "portrait", - "scale" : "3x" - }, - { - "extent" : "full-screen", - "idiom" : "iphone", - "subtype" : "736h", - "filename" : "Default-Landscape-736h.png", - "minimum-system-version" : "8.0", - "orientation" : "landscape", - "scale" : "3x" - }, - { - "extent" : "full-screen", - "idiom" : "iphone", - "subtype" : "667h", - "filename" : "Default-667h.png", - "minimum-system-version" : "8.0", - "orientation" : "portrait", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "filename" : "Default@2x~iphone.png", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "extent" : "full-screen", - "idiom" : "iphone", - "subtype" : "retina4", - "filename" : "Default-568h@2x~iphone.png", - "minimum-system-version" : "7.0", - "orientation" : "portrait", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "filename" : "Default-Portrait~ipad.png", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "1x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "filename" : "Default-Landscape~ipad.png", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "1x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "filename" : "Default-Portrait@2x~ipad.png", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "filename" : "Default-Landscape@2x~ipad.png", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "filename" : "Default~iphone.png", - "extent" : "full-screen", - "scale" : "1x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "filename" : "Default@2x~iphone.png", - "extent" : "full-screen", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "filename" : "Default-568h@2x~iphone.png", - "extent" : "full-screen", - "subtype" : "retina4", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "extent" : "to-status-bar", - "scale" : "1x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "filename" : "Default-Portrait~ipad.png", - "extent" : "full-screen", - "scale" : "1x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "extent" : "to-status-bar", - "scale" : "1x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "extent" : "full-screen", - "scale" : "1x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "extent" : "to-status-bar", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "filename" : "Default-Portrait@2x~ipad.png", - "extent" : "full-screen", - "scale" : "2x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "extent" : "to-status-bar", - "scale" : "2x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "extent" : "full-screen", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Default-568h@2x~iphone.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Default-568h@2x~iphone.png deleted file mode 100644 index 10ed683..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Default-568h@2x~iphone.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Default-667h.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Default-667h.png deleted file mode 100644 index d9bcf61..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Default-667h.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Default-736h.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Default-736h.png deleted file mode 100644 index 1fcef22..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Default-736h.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h.png deleted file mode 100644 index eae0792..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Default-Landscape@2x~ipad.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Default-Landscape@2x~ipad.png deleted file mode 100644 index 1fc8c7d..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Default-Landscape@2x~ipad.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Default-Landscape~ipad.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Default-Landscape~ipad.png deleted file mode 100644 index 58ea2fb..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Default-Landscape~ipad.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x~ipad.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x~ipad.png deleted file mode 100644 index 1570b37..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x~ipad.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Default-Portrait~ipad.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Default-Portrait~ipad.png deleted file mode 100644 index 223e75d..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Default-Portrait~ipad.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Default@2x~iphone.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Default@2x~iphone.png deleted file mode 100644 index 0098dc7..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Default@2x~iphone.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Default~iphone.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Default~iphone.png deleted file mode 100644 index 42b8fde..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchImage.launchimage/Default~iphone.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchStoryboard.imageset/Contents.json b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchStoryboard.imageset/Contents.json deleted file mode 100644 index 621019d..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Images.xcassets/LaunchStoryboard.imageset/Contents.json +++ /dev/null @@ -1,168 +0,0 @@ -{ - "images": [ - { - "idiom": "universal", - "scale": "1x", - "width-class": "compact", - "height-class": "compact" - }, - { - "idiom": "universal", - "scale": "1x", - "width-class": "compact" - }, - { - "idiom": "universal", - "scale": "1x", - "height-class": "compact" - }, - { - "idiom": "universal", - "scale": "1x" - }, - { - "idiom": "universal", - "scale": "2x", - "width-class": "compact", - "height-class": "compact" - }, - { - "idiom": "universal", - "scale": "2x", - "width-class": "compact" - }, - { - "idiom": "universal", - "scale": "2x", - "height-class": "compact" - }, - { - "idiom": "universal", - "scale": "2x" - }, - { - "idiom": "universal", - "scale": "3x", - "width-class": "compact", - "height-class": "compact" - }, - { - "idiom": "universal", - "scale": "3x", - "width-class": "compact" - }, - { - "idiom": "universal", - "scale": "3x", - "height-class": "compact" - }, - { - "idiom": "universal", - "scale": "3x" - }, - { - "idiom": "ipad", - "scale": "1x", - "width-class": "compact", - "height-class": "compact" - }, - { - "idiom": "ipad", - "scale": "1x", - "width-class": "compact" - }, - { - "idiom": "ipad", - "scale": "1x", - "height-class": "compact" - }, - { - "idiom": "ipad", - "scale": "1x" - }, - { - "idiom": "ipad", - "scale": "2x", - "width-class": "compact", - "height-class": "compact" - }, - { - "idiom": "ipad", - "scale": "2x", - "width-class": "compact" - }, - { - "idiom": "ipad", - "scale": "2x", - "height-class": "compact" - }, - { - "idiom": "ipad", - "scale": "2x" - }, - { - "idiom": "iphone", - "scale": "1x", - "width-class": "compact", - "height-class": "compact" - }, - { - "idiom": "iphone", - "scale": "1x", - "width-class": "compact" - }, - { - "idiom": "iphone", - "scale": "1x", - "height-class": "compact" - }, - { - "idiom": "iphone", - "scale": "1x" - }, - { - "idiom": "iphone", - "scale": "2x", - "width-class": "compact", - "height-class": "compact" - }, - { - "idiom": "iphone", - "scale": "2x", - "width-class": "compact" - }, - { - "idiom": "iphone", - "scale": "2x", - "height-class": "compact" - }, - { - "idiom": "iphone", - "scale": "2x" - }, - { - "idiom": "iphone", - "scale": "3x", - "width-class": "compact", - "height-class": "compact" - }, - { - "idiom": "iphone", - "scale": "3x", - "width-class": "compact" - }, - { - "idiom": "iphone", - "scale": "3x", - "height-class": "compact" - }, - { - "idiom": "iphone", - "scale": "3x" - } - ], - "info": { - "author": "Xcode", - "version": 1 - } -} \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Plugins/README b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Plugins/README deleted file mode 100644 index 87df09f..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Plugins/README +++ /dev/null @@ -1,20 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -Put the .h and .m files of your plugin here. The .js files of your plugin belong in the www folder. diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/SampleApp-Info.plist b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/SampleApp-Info.plist deleted file mode 100644 index 612eeaa..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/SampleApp-Info.plist +++ /dev/null @@ -1,56 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleDisplayName - ${PRODUCT_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIcons - - CFBundleIcons~ipad - - CFBundleIdentifier - com.example.friendstring - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0.0 - LSRequiresIPhoneOS - - NSMainNibFile - - NSMainNibFile~ipad - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeRight - - UIRequiresFullScreen - - NSAppTransportSecurity - - NSAllowsArbitraryLoads - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/SampleApp-Prefix.pch b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/SampleApp-Prefix.pch deleted file mode 100644 index fda69c6..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/SampleApp-Prefix.pch +++ /dev/null @@ -1,26 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ -// -// Prefix header for all source files of the 'SampleApp' target in the 'SampleApp' project -// - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Scripts/copy-www-build-step.sh b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Scripts/copy-www-build-step.sh deleted file mode 100755 index ba0a1b4..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/Scripts/copy-www-build-step.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/sh -# -# 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. -# -# -# This script copies the www directory into the Xcode project. -# -# This script should not be called directly. -# It is called as a build step from Xcode. - -SRC_DIR="www" -DST_DIR="$BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME" -DST_DIR_WWW="$DST_DIR/www" -COPY_HIDDEN= -ORIG_IFS=$IFS -IFS=$(echo -en "\n\b") - -if [[ -z "$BUILT_PRODUCTS_DIR" ]]; then - echo "The script is meant to be run as an Xcode build step and relies on env variables set by Xcode." - exit 1 -fi - -if [[ ! -e "$SRC_DIR" ]]; then - echo "error: Path does not exist: $SRC_DIR" - exit 2 -fi - -rm -rf "$DST_DIR_WWW" - -# Copy www dir recursively -CODE= -if [[ -n $COPY_HIDDEN ]]; then - rsync -Lra "$SRC_DIR" "$DST_DIR" - CODE=$? -else - rsync -Lra --exclude="- .*" "$SRC_DIR" "$DST_DIR" - CODE=$? -fi - -if [ $CODE -ne 0 ]; then - echo "error: Error occurred on copying www. Code $CODE" - exit 3 -fi - -# Copy the config.xml file. -cp -f "${PROJECT_FILE_PATH%.xcodeproj}/config.xml" "$DST_DIR" - -IFS=$ORIG_IFS diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/config.xml b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/config.xml deleted file mode 100755 index b235271..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/config.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - SampleApp - - A sample Apache Cordova application that responds to the deviceready event. - - - Apache Cordova Team - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/main.m b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/main.m deleted file mode 100644 index 8255ef3..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/SampleApp/main.m +++ /dev/null @@ -1,35 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ -// -// main.m -// SampleApp -// -// Created by ___FULLUSERNAME___ on ___DATE___. -// Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved. -// - -#import - -int main(int argc, char* argv[]) -{ - @autoreleasepool { - int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate"); - return retVal; - } -} diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/platform_www/.gitkeep b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/platform_www/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/www/.gitkeep b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/ios-config-xml/www/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/configs/legacy-only.xml b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/configs/legacy-only.xml deleted file mode 100644 index 2917aac..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/configs/legacy-only.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - Hello Cordova - - A sample Apache Cordova application that responds to the deviceready event. - - - Apache Cordova Team - - - - - - - - - - - - - - - - - - - - - - - - - -   - \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/configs/modern-and-legacy.xml b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/configs/modern-and-legacy.xml deleted file mode 100644 index 1bf60ae..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/configs/modern-and-legacy.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - Hello Cordova - - A sample Apache Cordova application that responds to the deviceready event. - - - Apache Cordova Team - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   - \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/configs/modern-only.xml b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/configs/modern-only.xml deleted file mode 100644 index 5548897..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/configs/modern-only.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - Hello Cordova - - A sample Apache Cordova application that responds to the deviceready event. - - - Apache Cordova Team - - - - - - - - - - - - - - - - - - - - - -   - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/configs/none.xml b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/configs/none.xml deleted file mode 100644 index 1dc7487..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/configs/none.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - Hello Cordova - - A sample Apache Cordova application that responds to the deviceready event. - - - Apache Cordova Team - - - - - - - - - - - - - - -   - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/contents-json/empty.js b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/contents-json/empty.js deleted file mode 100644 index 627bc39..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/contents-json/empty.js +++ /dev/null @@ -1,135 +0,0 @@ -module.exports = { - 'images': [{ - 'idiom': 'universal', - 'scale': '1x', - 'width-class': 'compact', - 'height-class': 'compact' - }, { - 'idiom': 'universal', - 'scale': '1x', - 'width-class': 'compact' - }, { - 'idiom': 'universal', - 'scale': '1x', - 'height-class': 'compact' - }, { - 'idiom': 'universal', - 'scale': '1x' - }, { - 'idiom': 'universal', - 'scale': '2x', - 'width-class': 'compact', - 'height-class': 'compact' - }, { - 'idiom': 'universal', - 'scale': '2x', - 'width-class': 'compact' - }, { - 'idiom': 'universal', - 'scale': '2x', - 'height-class': 'compact' - }, { - 'idiom': 'universal', - 'scale': '2x' - }, { - 'idiom': 'universal', - 'scale': '3x', - 'width-class': 'compact', - 'height-class': 'compact' - }, { - 'idiom': 'universal', - 'scale': '3x', - 'width-class': 'compact' - }, { - 'idiom': 'universal', - 'scale': '3x', - 'height-class': 'compact' - }, { - 'idiom': 'universal', - 'scale': '3x' - }, { - 'idiom': 'ipad', - 'scale': '1x', - 'width-class': 'compact', - 'height-class': 'compact' - }, { - 'idiom': 'ipad', - 'scale': '1x', - 'width-class': 'compact' - }, { - 'idiom': 'ipad', - 'scale': '1x', - 'height-class': 'compact' - }, { - 'idiom': 'ipad', - 'scale': '1x' - }, { - 'idiom': 'ipad', - 'scale': '2x', - 'width-class': 'compact', - 'height-class': 'compact' - }, { - 'idiom': 'ipad', - 'scale': '2x', - 'width-class': 'compact' - }, { - 'idiom': 'ipad', - 'scale': '2x', - 'height-class': 'compact' - }, { - 'idiom': 'ipad', - 'scale': '2x' - }, { - 'idiom': 'iphone', - 'scale': '1x', - 'width-class': 'compact', - 'height-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '1x', - 'width-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '1x', - 'height-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '1x' - }, { - 'idiom': 'iphone', - 'scale': '2x', - 'width-class': 'compact', - 'height-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '2x', - 'width-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '2x', - 'height-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '2x' - }, { - 'idiom': 'iphone', - 'scale': '3x', - 'width-class': 'compact', - 'height-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '3x', - 'width-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '3x', - 'height-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '3x' - }], - 'info': { - 'author': 'Xcode', - 'version': 1 - } -}; diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/contents-json/single-2xanyany.js b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/contents-json/single-2xanyany.js deleted file mode 100644 index 9485e81..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/contents-json/single-2xanyany.js +++ /dev/null @@ -1,136 +0,0 @@ -module.exports = { - 'images': [{ - 'idiom': 'universal', - 'scale': '1x', - 'width-class': 'compact', - 'height-class': 'compact' - }, { - 'idiom': 'universal', - 'scale': '1x', - 'width-class': 'compact' - }, { - 'idiom': 'universal', - 'scale': '1x', - 'height-class': 'compact' - }, { - 'idiom': 'universal', - 'scale': '1x' - }, { - 'idiom': 'universal', - 'scale': '2x', - 'width-class': 'compact', - 'height-class': 'compact' - }, { - 'idiom': 'universal', - 'scale': '2x', - 'width-class': 'compact' - }, { - 'idiom': 'universal', - 'scale': '2x', - 'height-class': 'compact' - }, { - 'idiom': 'universal', - 'scale': '2x', - 'filename': 'Default@2x~universal~anyany.png' - }, { - 'idiom': 'universal', - 'scale': '3x', - 'width-class': 'compact', - 'height-class': 'compact' - }, { - 'idiom': 'universal', - 'scale': '3x', - 'width-class': 'compact' - }, { - 'idiom': 'universal', - 'scale': '3x', - 'height-class': 'compact' - }, { - 'idiom': 'universal', - 'scale': '3x' - }, { - 'idiom': 'ipad', - 'scale': '1x', - 'width-class': 'compact', - 'height-class': 'compact' - }, { - 'idiom': 'ipad', - 'scale': '1x', - 'width-class': 'compact' - }, { - 'idiom': 'ipad', - 'scale': '1x', - 'height-class': 'compact' - }, { - 'idiom': 'ipad', - 'scale': '1x' - }, { - 'idiom': 'ipad', - 'scale': '2x', - 'width-class': 'compact', - 'height-class': 'compact' - }, { - 'idiom': 'ipad', - 'scale': '2x', - 'width-class': 'compact' - }, { - 'idiom': 'ipad', - 'scale': '2x', - 'height-class': 'compact' - }, { - 'idiom': 'ipad', - 'scale': '2x' - }, { - 'idiom': 'iphone', - 'scale': '1x', - 'width-class': 'compact', - 'height-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '1x', - 'width-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '1x', - 'height-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '1x' - }, { - 'idiom': 'iphone', - 'scale': '2x', - 'width-class': 'compact', - 'height-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '2x', - 'width-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '2x', - 'height-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '2x' - }, { - 'idiom': 'iphone', - 'scale': '3x', - 'width-class': 'compact', - 'height-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '3x', - 'width-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '3x', - 'height-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '3x' - }], - 'info': { - 'author': 'Xcode', - 'version': 1 - } -}; diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/contents-json/typical-universal.js b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/contents-json/typical-universal.js deleted file mode 100644 index 3a9b96b..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/contents-json/typical-universal.js +++ /dev/null @@ -1,141 +0,0 @@ -module.exports = { - 'images': [{ - 'idiom': 'universal', - 'scale': '1x', - 'width-class': 'compact', - 'height-class': 'compact' - }, { - 'idiom': 'universal', - 'scale': '1x', - 'width-class': 'compact' - }, { - 'idiom': 'universal', - 'scale': '1x', - 'height-class': 'compact' - }, { - 'idiom': 'universal', - 'scale': '1x' - }, { - 'idiom': 'universal', - 'scale': '2x', - 'width-class': 'compact', - 'height-class': 'compact', - 'filename': 'Default@2x~universal~comcom.png' - }, { - 'idiom': 'universal', - 'scale': '2x', - 'width-class': 'compact', - 'filename': 'Default@2x~universal~comany.png' - }, { - 'idiom': 'universal', - 'scale': '2x', - 'height-class': 'compact' - }, { - 'idiom': 'universal', - 'scale': '2x', - 'filename': 'Default@2x~universal~anyany.png' - }, { - 'idiom': 'universal', - 'scale': '3x', - 'width-class': 'compact', - 'height-class': 'compact' - }, { - 'idiom': 'universal', - 'scale': '3x', - 'width-class': 'compact', - 'filename': 'Default@3x~universal~comany.png' - }, { - 'idiom': 'universal', - 'scale': '3x', - 'height-class': 'compact', - 'filename': 'Default@3x~universal~anycom.png' - }, { - 'idiom': 'universal', - 'scale': '3x', - 'filename': 'Default@3x~universal~anyany.png' - }, { - 'idiom': 'ipad', - 'scale': '1x', - 'width-class': 'compact', - 'height-class': 'compact' - }, { - 'idiom': 'ipad', - 'scale': '1x', - 'width-class': 'compact' - }, { - 'idiom': 'ipad', - 'scale': '1x', - 'height-class': 'compact' - }, { - 'idiom': 'ipad', - 'scale': '1x' - }, { - 'idiom': 'ipad', - 'scale': '2x', - 'width-class': 'compact', - 'height-class': 'compact' - }, { - 'idiom': 'ipad', - 'scale': '2x', - 'width-class': 'compact' - }, { - 'idiom': 'ipad', - 'scale': '2x', - 'height-class': 'compact' - }, { - 'idiom': 'ipad', - 'scale': '2x' - }, { - 'idiom': 'iphone', - 'scale': '1x', - 'width-class': 'compact', - 'height-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '1x', - 'width-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '1x', - 'height-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '1x' - }, { - 'idiom': 'iphone', - 'scale': '2x', - 'width-class': 'compact', - 'height-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '2x', - 'width-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '2x', - 'height-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '2x' - }, { - 'idiom': 'iphone', - 'scale': '3x', - 'width-class': 'compact', - 'height-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '3x', - 'width-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '3x', - 'height-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '3x' - }], - 'info': { - 'author': 'Xcode', - 'version': 1 - } -}; diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/contents-json/varied-device.js b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/contents-json/varied-device.js deleted file mode 100644 index 6f1e27a..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/contents-json/varied-device.js +++ /dev/null @@ -1,144 +0,0 @@ -module.exports = { - 'images': [{ - 'idiom': 'universal', - 'scale': '1x', - 'width-class': 'compact', - 'height-class': 'compact' - }, { - 'idiom': 'universal', - 'scale': '1x', - 'width-class': 'compact' - }, { - 'idiom': 'universal', - 'scale': '1x', - 'height-class': 'compact' - }, { - 'idiom': 'universal', - 'scale': '1x' - }, { - 'idiom': 'universal', - 'scale': '2x', - 'width-class': 'compact', - 'height-class': 'compact', - 'filename': 'Default@2x~universal~comcom.png' - }, { - 'idiom': 'universal', - 'scale': '2x', - 'width-class': 'compact', - 'filename': 'Default@2x~universal~comany.png' - }, { - 'idiom': 'universal', - 'scale': '2x', - 'height-class': 'compact' - }, { - 'idiom': 'universal', - 'scale': '2x', - 'filename': 'Default@2x~universal~anyany.png' - }, { - 'idiom': 'universal', - 'scale': '3x', - 'width-class': 'compact', - 'height-class': 'compact' - }, { - 'idiom': 'universal', - 'scale': '3x', - 'width-class': 'compact' - }, { - 'idiom': 'universal', - 'scale': '3x', - 'height-class': 'compact' - }, { - 'idiom': 'universal', - 'scale': '3x' - }, { - 'idiom': 'ipad', - 'scale': '1x', - 'width-class': 'compact', - 'height-class': 'compact' - }, { - 'idiom': 'ipad', - 'scale': '1x', - 'width-class': 'compact' - }, { - 'idiom': 'ipad', - 'scale': '1x', - 'height-class': 'compact' - }, { - 'idiom': 'ipad', - 'scale': '1x' - }, { - 'idiom': 'ipad', - 'scale': '2x', - 'width-class': 'compact', - 'height-class': 'compact', - 'filename': 'Default@2x~ipad~comcom.png' - }, { - 'idiom': 'ipad', - 'scale': '2x', - 'width-class': 'compact', - 'filename': 'Default@2x~ipad~comany.png' - }, { - 'idiom': 'ipad', - 'scale': '2x', - 'height-class': 'compact' - }, { - 'idiom': 'ipad', - 'scale': '2x', - 'filename': 'Default@2x~ipad~anyany.png' - }, { - 'idiom': 'iphone', - 'scale': '1x', - 'width-class': 'compact', - 'height-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '1x', - 'width-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '1x', - 'height-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '1x' - }, { - 'idiom': 'iphone', - 'scale': '2x', - 'width-class': 'compact', - 'height-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '2x', - 'width-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '2x', - 'height-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '2x' - }, { - 'idiom': 'iphone', - 'scale': '3x', - 'width-class': 'compact', - 'height-class': 'compact' - }, { - 'idiom': 'iphone', - 'scale': '3x', - 'width-class': 'compact', - 'filename': 'Default@3x~iphone~comany.png' - }, { - 'idiom': 'iphone', - 'scale': '3x', - 'height-class': 'compact', - 'filename': 'Default@3x~iphone~anycom.png' - }, { - 'idiom': 'iphone', - 'scale': '3x', - 'filename': 'Default@3x~iphone~anyany.png' - }], - 'info': { - 'author': 'Xcode', - 'version': 1 - } -}; diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/contents-map/empty-map.js b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/contents-map/empty-map.js deleted file mode 100644 index a81c5b6..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/contents-map/empty-map.js +++ /dev/null @@ -1,194 +0,0 @@ -module.exports = [ - { - 'idiom': 'universal', - 'scale': '1x', - 'width': 'com', - 'height': 'com' - }, - { - 'idiom': 'universal', - 'scale': '1x', - 'width': 'com', - 'height': 'any' - }, - { - 'idiom': 'universal', - 'scale': '1x', - 'width': 'any', - 'height': 'com' - }, - { - 'idiom': 'universal', - 'scale': '1x', - 'width': 'any', - 'height': 'any' - }, - { - 'idiom': 'universal', - 'scale': '2x', - 'width': 'com', - 'height': 'com' - }, - { - 'idiom': 'universal', - 'scale': '2x', - 'width': 'com', - 'height': 'any' - }, - { - 'idiom': 'universal', - 'scale': '2x', - 'width': 'any', - 'height': 'com' - }, - { - 'idiom': 'universal', - 'scale': '2x', - 'width': 'any', - 'height': 'any' - }, - { - 'idiom': 'universal', - 'scale': '3x', - 'width': 'com', - 'height': 'com' - }, - { - 'idiom': 'universal', - 'scale': '3x', - 'width': 'com', - 'height': 'any' - }, - { - 'idiom': 'universal', - 'scale': '3x', - 'width': 'any', - 'height': 'com' - }, - { - 'idiom': 'universal', - 'scale': '3x', - 'width': 'any', - 'height': 'any' - }, - { - 'idiom': 'ipad', - 'scale': '1x', - 'width': 'com', - 'height': 'com' - }, - { - 'idiom': 'ipad', - 'scale': '1x', - 'width': 'com', - 'height': 'any' - }, - { - 'idiom': 'ipad', - 'scale': '1x', - 'width': 'any', - 'height': 'com' - }, - { - 'idiom': 'ipad', - 'scale': '1x', - 'width': 'any', - 'height': 'any' - }, - { - 'idiom': 'ipad', - 'scale': '2x', - 'width': 'com', - 'height': 'com' - }, - { - 'idiom': 'ipad', - 'scale': '2x', - 'width': 'com', - 'height': 'any' - }, - { - 'idiom': 'ipad', - 'scale': '2x', - 'width': 'any', - 'height': 'com' - }, - { - 'idiom': 'ipad', - 'scale': '2x', - 'width': 'any', - 'height': 'any' - }, - { - 'idiom': 'iphone', - 'scale': '1x', - 'width': 'com', - 'height': 'com' - }, - { - 'idiom': 'iphone', - 'scale': '1x', - 'width': 'com', - 'height': 'any' - }, - { - 'idiom': 'iphone', - 'scale': '1x', - 'width': 'any', - 'height': 'com' - }, - { - 'idiom': 'iphone', - 'scale': '1x', - 'width': 'any', - 'height': 'any' - }, - { - 'idiom': 'iphone', - 'scale': '2x', - 'width': 'com', - 'height': 'com' - }, - { - 'idiom': 'iphone', - 'scale': '2x', - 'width': 'com', - 'height': 'any' - }, - { - 'idiom': 'iphone', - 'scale': '2x', - 'width': 'any', - 'height': 'com' - }, - { - 'idiom': 'iphone', - 'scale': '2x', - 'width': 'any', - 'height': 'any' - }, - { - 'idiom': 'iphone', - 'scale': '3x', - 'width': 'com', - 'height': 'com' - }, - { - 'idiom': 'iphone', - 'scale': '3x', - 'width': 'com', - 'height': 'any' - }, - { - 'idiom': 'iphone', - 'scale': '3x', - 'width': 'any', - 'height': 'com' - }, - { - 'idiom': 'iphone', - 'scale': '3x', - 'width': 'any', - 'height': 'any' - } -]; diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/contents-map/single-2xanyany-map.js b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/contents-map/single-2xanyany-map.js deleted file mode 100644 index 54d98b5..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/contents-map/single-2xanyany-map.js +++ /dev/null @@ -1,197 +0,0 @@ -module.exports = [ - { - 'idiom': 'universal', - 'scale': '1x', - 'width': 'com', - 'height': 'com' - }, - { - 'idiom': 'universal', - 'scale': '1x', - 'width': 'com', - 'height': 'any' - }, - { - 'idiom': 'universal', - 'scale': '1x', - 'width': 'any', - 'height': 'com' - }, - { - 'idiom': 'universal', - 'scale': '1x', - 'width': 'any', - 'height': 'any' - }, - { - 'idiom': 'universal', - 'scale': '2x', - 'width': 'com', - 'height': 'com' - }, - { - 'idiom': 'universal', - 'scale': '2x', - 'width': 'com', - 'height': 'any' - }, - { - 'idiom': 'universal', - 'scale': '2x', - 'width': 'any', - 'height': 'com' - }, - { - 'idiom': 'universal', - 'scale': '2x', - 'width': 'any', - 'height': 'any', - 'filename': 'Default@2x~universal~anyany.png', - 'src': 'res/splash/ios/Default@2x~universal~anyany.png', - 'target': 'Default@2x~universal~anyany.png' - }, - { - 'idiom': 'universal', - 'scale': '3x', - 'width': 'com', - 'height': 'com' - }, - { - 'idiom': 'universal', - 'scale': '3x', - 'width': 'com', - 'height': 'any' - }, - { - 'idiom': 'universal', - 'scale': '3x', - 'width': 'any', - 'height': 'com' - }, - { - 'idiom': 'universal', - 'scale': '3x', - 'width': 'any', - 'height': 'any' - }, - { - 'idiom': 'ipad', - 'scale': '1x', - 'width': 'com', - 'height': 'com' - }, - { - 'idiom': 'ipad', - 'scale': '1x', - 'width': 'com', - 'height': 'any' - }, - { - 'idiom': 'ipad', - 'scale': '1x', - 'width': 'any', - 'height': 'com' - }, - { - 'idiom': 'ipad', - 'scale': '1x', - 'width': 'any', - 'height': 'any' - }, - { - 'idiom': 'ipad', - 'scale': '2x', - 'width': 'com', - 'height': 'com' - }, - { - 'idiom': 'ipad', - 'scale': '2x', - 'width': 'com', - 'height': 'any' - }, - { - 'idiom': 'ipad', - 'scale': '2x', - 'width': 'any', - 'height': 'com' - }, - { - 'idiom': 'ipad', - 'scale': '2x', - 'width': 'any', - 'height': 'any' - }, - { - 'idiom': 'iphone', - 'scale': '1x', - 'width': 'com', - 'height': 'com' - }, - { - 'idiom': 'iphone', - 'scale': '1x', - 'width': 'com', - 'height': 'any' - }, - { - 'idiom': 'iphone', - 'scale': '1x', - 'width': 'any', - 'height': 'com' - }, - { - 'idiom': 'iphone', - 'scale': '1x', - 'width': 'any', - 'height': 'any' - }, - { - 'idiom': 'iphone', - 'scale': '2x', - 'width': 'com', - 'height': 'com' - }, - { - 'idiom': 'iphone', - 'scale': '2x', - 'width': 'com', - 'height': 'any' - }, - { - 'idiom': 'iphone', - 'scale': '2x', - 'width': 'any', - 'height': 'com' - }, - { - 'idiom': 'iphone', - 'scale': '2x', - 'width': 'any', - 'height': 'any' - }, - { - 'idiom': 'iphone', - 'scale': '3x', - 'width': 'com', - 'height': 'com' - }, - { - 'idiom': 'iphone', - 'scale': '3x', - 'width': 'com', - 'height': 'any' - }, - { - 'idiom': 'iphone', - 'scale': '3x', - 'width': 'any', - 'height': 'com' - }, - { - 'idiom': 'iphone', - 'scale': '3x', - 'width': 'any', - 'height': 'any' - } -]; diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/contents-map/typical-universal-map.js b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/contents-map/typical-universal-map.js deleted file mode 100644 index e571a09..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/contents-map/typical-universal-map.js +++ /dev/null @@ -1,212 +0,0 @@ -module.exports = [ - { - 'idiom': 'universal', - 'scale': '1x', - 'width': 'com', - 'height': 'com' - }, - { - 'idiom': 'universal', - 'scale': '1x', - 'width': 'com', - 'height': 'any' - }, - { - 'idiom': 'universal', - 'scale': '1x', - 'width': 'any', - 'height': 'com' - }, - { - 'idiom': 'universal', - 'scale': '1x', - 'width': 'any', - 'height': 'any' - }, - { - 'idiom': 'universal', - 'scale': '2x', - 'width': 'com', - 'height': 'com', - 'filename': 'Default@2x~universal~comcom.png', - 'src': 'res/splash/ios/Default@2x~universal~comcom.png', - 'target': 'Default@2x~universal~comcom.png' - }, - { - 'idiom': 'universal', - 'scale': '2x', - 'width': 'com', - 'height': 'any', - 'filename': 'Default@2x~universal~comany.png', - 'src': 'res/splash/ios/Default@2x~universal~comany.png', - 'target': 'Default@2x~universal~comany.png' - }, - { - 'idiom': 'universal', - 'scale': '2x', - 'width': 'any', - 'height': 'com' - }, - { - 'idiom': 'universal', - 'scale': '2x', - 'width': 'any', - 'height': 'any', - 'filename': 'Default@2x~universal~anyany.png', - 'src': 'res/splash/ios/Default@2x~universal~anyany.png', - 'target': 'Default@2x~universal~anyany.png' - }, - { - 'idiom': 'universal', - 'scale': '3x', - 'width': 'com', - 'height': 'com' - }, - { - 'idiom': 'universal', - 'scale': '3x', - 'width': 'com', - 'height': 'any', - 'filename': 'Default@3x~universal~comany.png', - 'src': 'res/splash/ios/Default@3x~universal~comany.png', - 'target': 'Default@3x~universal~comany.png' - }, - { - 'idiom': 'universal', - 'scale': '3x', - 'width': 'any', - 'height': 'com', - 'filename': 'Default@3x~universal~anycom.png', - 'src': 'res/splash/ios/Default@3x~universal~anycom.png', - 'target': 'Default@3x~universal~anycom.png' - }, - { - 'idiom': 'universal', - 'scale': '3x', - 'width': 'any', - 'height': 'any', - 'filename': 'Default@3x~universal~anyany.png', - 'src': 'res/splash/ios/Default@3x~universal~anyany.png', - 'target': 'Default@3x~universal~anyany.png' - }, - { - 'idiom': 'ipad', - 'scale': '1x', - 'width': 'com', - 'height': 'com' - }, - { - 'idiom': 'ipad', - 'scale': '1x', - 'width': 'com', - 'height': 'any' - }, - { - 'idiom': 'ipad', - 'scale': '1x', - 'width': 'any', - 'height': 'com' - }, - { - 'idiom': 'ipad', - 'scale': '1x', - 'width': 'any', - 'height': 'any' - }, - { - 'idiom': 'ipad', - 'scale': '2x', - 'width': 'com', - 'height': 'com' - }, - { - 'idiom': 'ipad', - 'scale': '2x', - 'width': 'com', - 'height': 'any' - }, - { - 'idiom': 'ipad', - 'scale': '2x', - 'width': 'any', - 'height': 'com' - }, - { - 'idiom': 'ipad', - 'scale': '2x', - 'width': 'any', - 'height': 'any' - }, - { - 'idiom': 'iphone', - 'scale': '1x', - 'width': 'com', - 'height': 'com' - }, - { - 'idiom': 'iphone', - 'scale': '1x', - 'width': 'com', - 'height': 'any' - }, - { - 'idiom': 'iphone', - 'scale': '1x', - 'width': 'any', - 'height': 'com' - }, - { - 'idiom': 'iphone', - 'scale': '1x', - 'width': 'any', - 'height': 'any' - }, - { - 'idiom': 'iphone', - 'scale': '2x', - 'width': 'com', - 'height': 'com' - }, - { - 'idiom': 'iphone', - 'scale': '2x', - 'width': 'com', - 'height': 'any' - }, - { - 'idiom': 'iphone', - 'scale': '2x', - 'width': 'any', - 'height': 'com' - }, - { - 'idiom': 'iphone', - 'scale': '2x', - 'width': 'any', - 'height': 'any' - }, - { - 'idiom': 'iphone', - 'scale': '3x', - 'width': 'com', - 'height': 'com' - }, - { - 'idiom': 'iphone', - 'scale': '3x', - 'width': 'com', - 'height': 'any' - }, - { - 'idiom': 'iphone', - 'scale': '3x', - 'width': 'any', - 'height': 'com' - }, - { - 'idiom': 'iphone', - 'scale': '3x', - 'width': 'any', - 'height': 'any' - } -]; diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/contents-map/varied-device-map.js b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/contents-map/varied-device-map.js deleted file mode 100644 index b9480fc..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/contents-map/varied-device-map.js +++ /dev/null @@ -1,221 +0,0 @@ -module.exports = [ - { - 'idiom': 'universal', - 'scale': '1x', - 'width': 'com', - 'height': 'com' - }, - { - 'idiom': 'universal', - 'scale': '1x', - 'width': 'com', - 'height': 'any' - }, - { - 'idiom': 'universal', - 'scale': '1x', - 'width': 'any', - 'height': 'com' - }, - { - 'idiom': 'universal', - 'scale': '1x', - 'width': 'any', - 'height': 'any' - }, - { - 'idiom': 'universal', - 'scale': '2x', - 'width': 'com', - 'height': 'com', - 'filename': 'Default@2x~universal~comcom.png', - 'src': 'res/splash/ios/Default@2x~universal~comcom.png', - 'target': 'Default@2x~universal~comcom.png' - }, - { - 'idiom': 'universal', - 'scale': '2x', - 'width': 'com', - 'height': 'any', - 'filename': 'Default@2x~universal~comany.png', - 'src': 'res/splash/ios/Default@2x~universal~comany.png', - 'target': 'Default@2x~universal~comany.png' - }, - { - 'idiom': 'universal', - 'scale': '2x', - 'width': 'any', - 'height': 'com' - }, - { - 'idiom': 'universal', - 'scale': '2x', - 'width': 'any', - 'height': 'any', - 'filename': 'Default@2x~universal~anyany.png', - 'src': 'res/splash/ios/Default@2x~universal~anyany.png', - 'target': 'Default@2x~universal~anyany.png' - }, - { - 'idiom': 'universal', - 'scale': '3x', - 'width': 'com', - 'height': 'com' - }, - { - 'idiom': 'universal', - 'scale': '3x', - 'width': 'com', - 'height': 'any' - }, - { - 'idiom': 'universal', - 'scale': '3x', - 'width': 'any', - 'height': 'com' - }, - { - 'idiom': 'universal', - 'scale': '3x', - 'width': 'any', - 'height': 'any' - }, - { - 'idiom': 'ipad', - 'scale': '1x', - 'width': 'com', - 'height': 'com' - }, - { - 'idiom': 'ipad', - 'scale': '1x', - 'width': 'com', - 'height': 'any' - }, - { - 'idiom': 'ipad', - 'scale': '1x', - 'width': 'any', - 'height': 'com' - }, - { - 'idiom': 'ipad', - 'scale': '1x', - 'width': 'any', - 'height': 'any' - }, - { - 'idiom': 'ipad', - 'scale': '2x', - 'width': 'com', - 'height': 'com', - 'filename': 'Default@2x~ipad~comcom.png', - 'src': 'res/splash/ios/Default@2x~ipad~comcom.png', - 'target': 'Default@2x~ipad~comcom.png' - }, - { - 'idiom': 'ipad', - 'scale': '2x', - 'width': 'com', - 'height': 'any', - 'filename': 'Default@2x~ipad~comany.png', - 'src': 'res/splash/ios/Default@2x~ipad~comany.png', - 'target': 'Default@2x~ipad~comany.png' - }, - { - 'idiom': 'ipad', - 'scale': '2x', - 'width': 'any', - 'height': 'com' - }, - { - 'idiom': 'ipad', - 'scale': '2x', - 'width': 'any', - 'height': 'any', - 'filename': 'Default@2x~ipad~anyany.png', - 'src': 'res/splash/ios/Default@2x~ipad~anyany.png', - 'target': 'Default@2x~ipad~anyany.png' - }, - { - 'idiom': 'iphone', - 'scale': '1x', - 'width': 'com', - 'height': 'com' - }, - { - 'idiom': 'iphone', - 'scale': '1x', - 'width': 'com', - 'height': 'any' - }, - { - 'idiom': 'iphone', - 'scale': '1x', - 'width': 'any', - 'height': 'com' - }, - { - 'idiom': 'iphone', - 'scale': '1x', - 'width': 'any', - 'height': 'any' - }, - { - 'idiom': 'iphone', - 'scale': '2x', - 'width': 'com', - 'height': 'com' - }, - { - 'idiom': 'iphone', - 'scale': '2x', - 'width': 'com', - 'height': 'any' - }, - { - 'idiom': 'iphone', - 'scale': '2x', - 'width': 'any', - 'height': 'com' - }, - { - 'idiom': 'iphone', - 'scale': '2x', - 'width': 'any', - 'height': 'any' - }, - { - 'idiom': 'iphone', - 'scale': '3x', - 'width': 'com', - 'height': 'com' - }, - { - 'idiom': 'iphone', - 'scale': '3x', - 'width': 'com', - 'height': 'any', - 'filename': 'Default@3x~iphone~comany.png', - 'src': 'res/splash/ios/Default@3x~iphone~comany.png', - 'target': 'Default@3x~iphone~comany.png' - }, - { - 'idiom': 'iphone', - 'scale': '3x', - 'width': 'any', - 'height': 'com', - 'filename': 'Default@3x~iphone~anycom.png', - 'src': 'res/splash/ios/Default@3x~iphone~anycom.png', - 'target': 'Default@3x~iphone~anycom.png' - }, - { - 'idiom': 'iphone', - 'scale': '3x', - 'width': 'any', - 'height': 'any', - 'filename': 'Default@3x~iphone~anyany.png', - 'src': 'res/splash/ios/Default@3x~iphone~anyany.png', - 'target': 'Default@3x~iphone~anyany.png' - } -]; diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/res/screen/ios/Default@2x~universal~anyany.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/res/screen/ios/Default@2x~universal~anyany.png deleted file mode 100644 index 1c647af..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/res/screen/ios/Default@2x~universal~anyany.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/res/screen/ios/Default@2x~universal~comany.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/res/screen/ios/Default@2x~universal~comany.png deleted file mode 100644 index 11ceaee..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/res/screen/ios/Default@2x~universal~comany.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/res/screen/ios/Default@2x~universal~comcom.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/res/screen/ios/Default@2x~universal~comcom.png deleted file mode 100644 index 8927308..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/res/screen/ios/Default@2x~universal~comcom.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/res/screen/ios/Default@3x~universal~anyany.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/res/screen/ios/Default@3x~universal~anyany.png deleted file mode 100644 index 21adbc0..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/res/screen/ios/Default@3x~universal~anyany.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/res/screen/ios/Default@3x~universal~anycom.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/res/screen/ios/Default@3x~universal~anycom.png deleted file mode 100644 index 72b7250..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/res/screen/ios/Default@3x~universal~anycom.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/res/screen/ios/Default@3x~universal~comany.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/res/screen/ios/Default@3x~universal~comany.png deleted file mode 100644 index 3c2693f..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/launch-storyboard-support/res/screen/ios/Default@3x~universal~comany.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/plugin.xml b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/plugin.xml deleted file mode 100644 index 308f856..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/plugin.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - dummyplugin - - my description - Jackson Badman - dummy,plugin - BSD - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/Custom.framework/someFheader.h b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/Custom.framework/someFheader.h deleted file mode 100644 index fc09fe4..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/Custom.framework/someFheader.h +++ /dev/null @@ -1 +0,0 @@ -./org.test.plugins.dummyplugin/src/ios/Custom.framework/someFheader.h diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/Custom.framework/somebinlib b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/Custom.framework/somebinlib deleted file mode 100644 index 9e93c21..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/Custom.framework/somebinlib +++ /dev/null @@ -1 +0,0 @@ -./org.test.plugins.dummyplugin/src/ios/Custom.framework/somebinlib diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/CustomEmbeddable.framework/someFheader.h b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/CustomEmbeddable.framework/someFheader.h deleted file mode 100644 index 8614cf9..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/CustomEmbeddable.framework/someFheader.h +++ /dev/null @@ -1 +0,0 @@ -./org.test.plugins.dummyplugin/src/ios/CustomEmbeddable.framework/someFheader.h diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/CustomEmbeddable.framework/somebinlib b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/CustomEmbeddable.framework/somebinlib deleted file mode 100644 index f004e1e..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/CustomEmbeddable.framework/somebinlib +++ /dev/null @@ -1 +0,0 @@ -./org.test.plugins.dummyplugin/src/ios/CustomEmbeddable.framework/somebinlib diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/DummyPlugin.bundle b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/DummyPlugin.bundle deleted file mode 100644 index 70cd334..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/DummyPlugin.bundle +++ /dev/null @@ -1 +0,0 @@ -./org.test.plugins.dummyplugin/src/ios/DummyPlugin.bundle diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/DummyPluginCommand.h b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/DummyPluginCommand.h deleted file mode 100644 index 2d8fb01..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/DummyPluginCommand.h +++ /dev/null @@ -1 +0,0 @@ -./org.test.plugins.dummyplugin/src/ios/DummyPluginCommand.h diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/DummyPluginCommand.m b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/DummyPluginCommand.m deleted file mode 100644 index 51cd929..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/DummyPluginCommand.m +++ /dev/null @@ -1 +0,0 @@ -./org.test.plugins.dummyplugin/src/ios/DummyPluginCommand.m diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/SourceWithFramework.m b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/SourceWithFramework.m deleted file mode 100644 index de7b1d7..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/SourceWithFramework.m +++ /dev/null @@ -1 +0,0 @@ -./org.test.plugins.dummyplugin/src/ios/SourceWithFramework.m diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/TargetDirTest.h b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/TargetDirTest.h deleted file mode 100644 index a83006f..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/TargetDirTest.h +++ /dev/null @@ -1 +0,0 @@ -./org.test.plugins.dummyplugin/src/ios/TargetDirTest.h diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/TargetDirTest.m b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/TargetDirTest.m deleted file mode 100644 index 95f2620..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/TargetDirTest.m +++ /dev/null @@ -1 +0,0 @@ -./org.test.plugins.dummyplugin/src/ios/TargetDirTest.m diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/libsqlite3.dylib b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/libsqlite3.dylib deleted file mode 100644 index fd3be07..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/src/ios/libsqlite3.dylib +++ /dev/null @@ -1 +0,0 @@ -./org.test.plugins.dummyplugin/src/ios/libsqlite3.dylib diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/www/dummyplugin.js b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/www/dummyplugin.js deleted file mode 100644 index deba887..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/www/dummyplugin.js +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -org.test.plugins.dummyplugin/www/dummyplugin.js diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/www/dummyplugin/image.jpg b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/www/dummyplugin/image.jpg deleted file mode 100644 index 219c78a..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.dummyplugin/www/dummyplugin/image.jpg +++ /dev/null @@ -1 +0,0 @@ -./org.test.plugins.dummyplugin/www/dummyplugin/image.jpg diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.faultyplugin/plugin.xml b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.faultyplugin/plugin.xml deleted file mode 100644 index 6e8a4d7..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.faultyplugin/plugin.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - Faulty Plugin - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.faultyplugin/src/ios/FaultyPlugin.h b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.faultyplugin/src/ios/FaultyPlugin.h deleted file mode 100644 index bf9cf91..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.faultyplugin/src/ios/FaultyPlugin.h +++ /dev/null @@ -1 +0,0 @@ -./org.test.plugins.faultyplugin/src/ios/org.test.plugins.faultyplugin.h diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.faultyplugin/src/ios/FaultyPlugin.m b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.faultyplugin/src/ios/FaultyPlugin.m deleted file mode 100644 index a8971cd..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.faultyplugin/src/ios/FaultyPlugin.m +++ /dev/null @@ -1 +0,0 @@ -./org.test.plugins.faultyplugin/src/ios/org.test.plugins.faultyplugin.m diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/plugin.xml b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/plugin.xml deleted file mode 100644 index 0f3cfac..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/plugin.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - Webless Plugin - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/arrow_left.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/arrow_left.png deleted file mode 100644 index 28daba3..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/arrow_left.png +++ /dev/null @@ -1 +0,0 @@ -./org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/arrow_left.png diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/arrow_left@2x.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/arrow_left@2x.png deleted file mode 100644 index 7da870b..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/arrow_left@2x.png +++ /dev/null @@ -1 +0,0 @@ -./org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/arrow_left@2x.png diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/arrow_right.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/arrow_right.png deleted file mode 100644 index 31ae8e3..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/arrow_right.png +++ /dev/null @@ -1 +0,0 @@ -./org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/arrow_right.png diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/arrow_right@2x.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/arrow_right@2x.png deleted file mode 100644 index 8e11f04..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/arrow_right@2x.png +++ /dev/null @@ -1 +0,0 @@ -./org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/arrow_right@2x.png diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/but_refresh.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/but_refresh.png deleted file mode 100644 index 15947aa..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/but_refresh.png +++ /dev/null @@ -1 +0,0 @@ -./org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/but_refresh.png diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/but_refresh@2x.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/but_refresh@2x.png deleted file mode 100644 index f6cb35b..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/but_refresh@2x.png +++ /dev/null @@ -1 +0,0 @@ -./org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/but_refresh@2x.png diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/compass.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/compass.png deleted file mode 100644 index 4386959..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/compass.png +++ /dev/null @@ -1 +0,0 @@ -./org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/compass.png diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/compass@2x.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/compass@2x.png deleted file mode 100644 index 73148c6..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/compass@2x.png +++ /dev/null @@ -1 +0,0 @@ -./org.test.plugins.weblessplugin/src/ios/WeblessPlugin.bundle/compass@2x.png diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPluginCommand.h b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPluginCommand.h deleted file mode 100644 index 57cbdb9..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPluginCommand.h +++ /dev/null @@ -1 +0,0 @@ -./org.test.plugins.weblessplugin/src/ios/WeblessPluginCommand.h diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPluginCommand.m b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPluginCommand.m deleted file mode 100644 index 097f7f8..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPluginCommand.m +++ /dev/null @@ -1 +0,0 @@ -./org.test.plugins.weblessplugin/src/ios/WeblessPluginCommand.m diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPluginViewController.h b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPluginViewController.h deleted file mode 100644 index f052697..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPluginViewController.h +++ /dev/null @@ -1 +0,0 @@ -./org.test.plugins.weblessplugin/src/ios/WeblessPluginViewController.h diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPluginViewController.m b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPluginViewController.m deleted file mode 100644 index bbaf3af..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPluginViewController.m +++ /dev/null @@ -1 +0,0 @@ -./org.test.plugins.weblessplugin/src/ios/WeblessPluginViewController.m diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPluginViewController.xib b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPluginViewController.xib deleted file mode 100644 index 97e3629..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/org.test.plugins.weblessplugin/src/ios/WeblessPluginViewController.xib +++ /dev/null @@ -1 +0,0 @@ -./org.test.plugins.weblessplugin/src/ios/WeblessPluginViewController.xib diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/resource-file-support/config.xml b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/resource-file-support/config.xml deleted file mode 100644 index d49965a..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/resource-file-support/config.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - Hello Cordova - - A sample Apache Cordova application that responds to the deviceready event. - - - Apache Cordova Team - - - - - - - - - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/resource-file-support/image-1234.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/resource-file-support/image-1234.png deleted file mode 100644 index 6a357be..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/resource-file-support/image-1234.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/resource-file-support/image-5678.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/resource-file-support/image-5678.png deleted file mode 100644 index c9465f3..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/resource-file-support/image-5678.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/resource-file-support/image-8888.png b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/resource-file-support/image-8888.png deleted file mode 100644 index e2ec214..0000000 Binary files a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/resource-file-support/image-8888.png and /dev/null differ diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/sample-cocoapod-plugin-no-spec-overlapping-dependency/plugin.xml b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/sample-cocoapod-plugin-no-spec-overlapping-dependency/plugin.xml deleted file mode 100644 index 25eb367..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/sample-cocoapod-plugin-no-spec-overlapping-dependency/plugin.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - Test Plugin - - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/sample-cocoapod-plugin-no-spec-overlapping-dependency/www/test.js b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/sample-cocoapod-plugin-no-spec-overlapping-dependency/www/test.js deleted file mode 100644 index e69de29..0000000 diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/sample-cordova-plugin-with-spec/plugin.xml b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/sample-cordova-plugin-with-spec/plugin.xml deleted file mode 100644 index 0d8bf9a..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/sample-cordova-plugin-with-spec/plugin.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - Test Plugin - - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/sample-cordova-plugin-with-spec/www/test.js b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/sample-cordova-plugin-with-spec/www/test.js deleted file mode 100644 index e69de29..0000000 diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/test-Bridging-Header.h b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/test-Bridging-Header.h deleted file mode 100644 index 9c9c87c..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/test-Bridging-Header.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ -// -// Bridging-Header.h -// __PROJECT_NAME__ -// -// Created by ___FULLUSERNAME___ on ___DATE___. -// Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved. -// -// -// Use this file to import your target's public headers that you would like to expose to Swift. -// - -#import -#import "CDVSwift22Object.h" -#import "CDVSwift2Object.h" diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/test-config-2.xml b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/test-config-2.xml deleted file mode 100644 index 1dc7487..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/test-config-2.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - Hello Cordova - - A sample Apache Cordova application that responds to the deviceready event. - - - Apache Cordova Team - - - - - - - - - - - - - - -   - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/test-config-3.xml b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/test-config-3.xml deleted file mode 100644 index 9bea9d6..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/test-config-3.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - Hello Cordova - - A sample Apache Cordova application that responds to the deviceready event. - - - Apache Cordova Team - - - - - - - - - - - - - - - -   - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/test-config.xml b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/test-config.xml deleted file mode 100644 index bb2d4f0..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/test-config.xml +++ /dev/null @@ -1,155 +0,0 @@ - - - Hello Cordova - - A sample Apache Cordova application that responds to the deviceready event. - - - Apache Cordova Team - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/testProj/platforms/ios/.npmignore b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/testProj/platforms/ios/.npmignore deleted file mode 100644 index 86d0cb2..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/fixtures/testProj/platforms/ios/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore \ No newline at end of file diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/lib/check_reqs.spec.js b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/lib/check_reqs.spec.js deleted file mode 100644 index c93e365..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/lib/check_reqs.spec.js +++ /dev/null @@ -1,113 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -const rewire = require('rewire'); -const shell = require('shelljs'); -const versions = require('../../../../bin/templates/scripts/cordova/lib/versions'); - -describe('check_reqs', function () { - let checkReqs; - beforeEach(() => { - checkReqs = rewire('../../../../bin/templates/scripts/cordova/lib/check_reqs'); - }); - - describe('checkTool method', () => { - let checkTool; - - beforeEach(() => { - checkTool = checkReqs.__get__('checkTool'); - - spyOn(shell, 'which').and.returnValue('/bin/node'); - spyOn(versions, 'get_tool_version').and.returnValue(Promise.resolve('1.0.0')); - }); - - it('should not have found tool.', () => { - shell.which.and.returnValue(false); - - return checkTool('node', '1.0.0').then( - () => fail('Expected promise to be rejected'), - reason => expect(reason).toContain('node was not found.') - ); - }); - - it('should throw error because version is not following semver-notated.', () => { - return checkTool('node', 'a.b.c').then( - () => fail('Expected promise to be rejected'), - err => expect(err).toEqual(new TypeError('Invalid Version: a.b.c')) - ); - }); - - it('should resolve passing back tool version.', () => { - return checkTool('node', '1.0.0').then(result => { - expect(result).toEqual({ version: '1.0.0' }); - }); - }); - - it('should reject because tool does not meet minimum requirement.', () => { - return checkTool('node', '1.0.1').then( - () => fail('Expected promise to be rejected'), - reason => expect(reason).toContain('version 1.0.1 or greater, you have version 1.0.0') - ); - }); - }); - - describe('check_cocoapods method', () => { - let toolsChecker; - beforeEach(() => { - toolsChecker = jasmine.createSpy('toolsChecker') - .and.returnValue(Promise.resolve({ version: '1.2.3' })); - }); - - it('should resolve when on an unsupported platform', () => { - checkReqs.__set__({ - os_platform_is_supported: () => false - }); - - return checkReqs.check_cocoapods(toolsChecker).then(toolOptions => { - expect(toolsChecker).not.toHaveBeenCalled(); - expect(toolOptions.ignore).toBeDefined(); - expect(toolOptions.ignoreMessage).toBeDefined(); - }); - }); - - it('should resolve when toolsChecker resolves', () => { - checkReqs.__set__({ - os_platform_is_supported: () => true - }); - spyOn(shell, 'exec').and.returnValue({ code: 1 }); - - return checkReqs.check_cocoapods(toolsChecker).then(() => { - expect(shell.exec).toHaveBeenCalled(); - }); - }); - - it('should reject when toolsChecker rejects', () => { - checkReqs.__set__({ - os_platform_is_supported: () => true - }); - const testError = new Error(); - toolsChecker.and.callFake(() => Promise.reject(testError)); - - return checkReqs.check_cocoapods(toolsChecker).then( - () => fail('Expected promise to be rejected'), - err => expect(err).toBe(testError) - ); - }); - }); -}); diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/lib/list-devices.spec.js b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/lib/list-devices.spec.js deleted file mode 100644 index 8e7981d..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/lib/list-devices.spec.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -var list_devices = require('../../../../bin/templates/scripts/cordova/lib/list-devices'); -var Q = require('q'); - -describe('cordova/lib/list-devices', function () { - describe('run method', function () { - beforeEach(function () { - spyOn(Q, 'all').and.returnValue(Q.resolve([])); - spyOn(Q, 'nfcall'); - }); - it('should invoke proper system calls to retrieve connected devices', function () { - return list_devices.run() - .then(() => { - expect(Q.nfcall).toHaveBeenCalledWith(jasmine.any(Function), jasmine.stringMatching(/ioreg.*iPad/g)); - expect(Q.nfcall).toHaveBeenCalledWith(jasmine.any(Function), jasmine.stringMatching(/ioreg.*iPod/g)); - expect(Q.nfcall).toHaveBeenCalledWith(jasmine.any(Function), jasmine.stringMatching(/ioreg.*iPhone/g)); - }); - }); - it('should trim and split standard output and return as array', function () { - Q.all.and.returnValue(Q.resolve([[' this is\nmy sweet\nstdout\n ']])); - return list_devices.run() - .then(function (results) { - expect(results).toContain('this is'); - expect(results).toContain('my sweet'); - expect(results).toContain('stdout'); - }); - }); - }); -}); diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/lib/list-emulator-images.spec.js b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/lib/list-emulator-images.spec.js deleted file mode 100644 index 2936512..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/lib/list-emulator-images.spec.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -// Requiring ios-sim below has some side effects, mainly, -// it ends up requiring the specific macOS environment bits that -// allow for interacting with iOS Simulators. On Windows+Linux we are -// bound to not-have-that. -if (process.platform === 'darwin') { - var list_emus = require('../../../../bin/templates/scripts/cordova/lib/list-emulator-images'); - var iossim = require('ios-sim'); - - describe('cordova/lib/list-emulator-images', function () { - describe('run method', function () { - beforeEach(function () { - spyOn(iossim, 'getdevicetypes'); - }); - it('should delegate to the ios-sim getdevicetypes method', function () { - list_emus.run(); - expect(iossim.getdevicetypes).toHaveBeenCalled(); - }); - }); - }); -} diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/lib/run.spec.js b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/lib/run.spec.js deleted file mode 100644 index bb65fb2..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/lib/run.spec.js +++ /dev/null @@ -1,57 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -// Requiring lib/run below has some side effects, mainly, -// it ends up pulling in the ios-sim module and requiring the specific macOS -// environment bits that allow for interacting with iOS Simulators. On -// Windows+Linux we are bound to not-have-that. -if (process.platform === 'darwin') { - var run = require('../../../../bin/templates/scripts/cordova/lib/run'); - var Q = require('q'); - - describe('cordova/lib/run', function () { - describe('--list option', function () { - var deferred; - beforeEach(function () { - deferred = Q.defer(); - deferred.resolve(); - spyOn(run, 'listDevices').and.returnValue(deferred.promise); - spyOn(run, 'listEmulators').and.returnValue(deferred.promise); - }); - it('should delegate to listDevices method if `options.device` specified', function () { - return run.run({ list: true, device: true }).then(() => { - expect(run.listDevices).toHaveBeenCalled(); - expect(run.listEmulators).not.toHaveBeenCalled(); - }); - }); - it('should delegate to listEmulators method if `options.device` specified', function () { - return run.run({ list: true, emulator: true }).then(() => { - expect(run.listDevices).not.toHaveBeenCalled(); - expect(run.listEmulators).toHaveBeenCalled(); - }); - }); - it('should delegate to both listEmulators and listDevices methods if neither `options.device` nor `options.emulator` are specified', () => { - return run.run({ list: true }).then(() => { - expect(run.listDevices).toHaveBeenCalled(); - expect(run.listEmulators).toHaveBeenCalled(); - }); - }); - }); - }); -} diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/prepare.spec.js b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/prepare.spec.js deleted file mode 100644 index 6f05245..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/prepare.spec.js +++ /dev/null @@ -1,1776 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -'use strict'; -var fs = require('fs'); -var fse = require('fs-extra'); - -const EventEmitter = require('events'); -var os = require('os'); -var path = require('path'); -var shell = require('shelljs'); -var plist = require('plist'); -var xcode = require('xcode'); -var rewire = require('rewire'); -var prepare = rewire('../../../bin/templates/scripts/cordova/lib/prepare'); -var projectFile = require('../../../bin/templates/scripts/cordova/lib/projectFile'); -var FileUpdater = require('cordova-common').FileUpdater; - -var FIXTURES = path.join(__dirname, 'fixtures'); - -var iosProjectFixture = path.join(FIXTURES, 'ios-config-xml'); -var iosProject = path.join(os.tmpdir(), 'prepare'); -var iosPlatform = path.join(iosProject, 'platforms/ios'); - -shell.config.silent = true; - -var ConfigParser = require('cordova-common').ConfigParser; - -describe('prepare', function () { - var p, Api; - beforeEach(function () { - Api = rewire('../../../bin/templates/scripts/cordova/Api'); - - shell.mkdir('-p', iosPlatform); - shell.cp('-rf', iosProjectFixture + '/*', iosPlatform); - p = new Api('ios', iosPlatform, new EventEmitter()); - }); - - afterEach(function () { - shell.rm('-rf', path.join(__dirname, 'some')); - }); - - describe('launch storyboard feature (CB-9762)', function () { - function makeSplashScreenEntry (src, width, height) { - return { - src: src, - width: width, - height: height - }; - } - - var noLaunchStoryboardImages = []; - - var singleLaunchStoryboardImage = [makeSplashScreenEntry('res/splash/ios/Default@2x~universal~anyany.png')]; - - var singleLaunchStoryboardImageWithLegacyLaunchImage = [ - makeSplashScreenEntry('res/splash/ios/Default@2x~universal~anyany.png'), - makeSplashScreenEntry('res/splash/ios/another-image.png', 1024, 768) - ]; - - var typicalLaunchStoryboardImages = [ - makeSplashScreenEntry('res/splash/ios/Default@2x~universal~anyany.png'), - makeSplashScreenEntry('res/splash/ios/Default@2x~universal~comany.png'), - makeSplashScreenEntry('res/splash/ios/Default@2x~universal~comcom.png'), - makeSplashScreenEntry('res/splash/ios/Default@3x~universal~anyany.png'), - makeSplashScreenEntry('res/splash/ios/Default@3x~universal~anycom.png'), - makeSplashScreenEntry('res/splash/ios/Default@3x~universal~comany.png') - ]; - - var multiDeviceLaunchStoryboardImages = [ - makeSplashScreenEntry('res/splash/ios/Default@2x~ipad~anyany.png'), - makeSplashScreenEntry('res/splash/ios/Default@2x~ipad~comany.png'), - makeSplashScreenEntry('res/splash/ios/Default@2x~ipad~comcom.png'), - makeSplashScreenEntry('res/splash/ios/Default@2x~universal~anyany.png'), - makeSplashScreenEntry('res/splash/ios/Default@2x~universal~comany.png'), - makeSplashScreenEntry('res/splash/ios/Default@2x~universal~comcom.png'), - makeSplashScreenEntry('res/splash/ios/Default@3x~iphone~anyany.png'), - makeSplashScreenEntry('res/splash/ios/Default@3x~iphone~anycom.png'), - makeSplashScreenEntry('res/splash/ios/Default@3x~iphone~comany.png') - ]; - - describe('#mapLaunchStoryboardContents', function () { - var mapLaunchStoryboardContents = prepare.__get__('mapLaunchStoryboardContents'); - - it('should return an array with no mapped storyboard images', function () { - var result = mapLaunchStoryboardContents(noLaunchStoryboardImages, ''); - expect(result).toBeDefined(); - expect(result).toEqual(require('./fixtures/launch-storyboard-support/contents-map/empty-map')); - }); - - it('should return an array with one mapped storyboard image', function () { - var result = mapLaunchStoryboardContents(singleLaunchStoryboardImage, ''); - expect(result).toBeDefined(); - expect(result).toEqual(require('./fixtures/launch-storyboard-support/contents-map/single-2xanyany-map')); - }); - - it('should return an array with one mapped storyboard image, even with legacy images', function () { - var result = mapLaunchStoryboardContents(singleLaunchStoryboardImageWithLegacyLaunchImage, ''); - expect(result).toBeDefined(); - expect(result).toEqual(require('./fixtures/launch-storyboard-support/contents-map/single-2xanyany-map')); - }); - - it('should return an array with several mapped storyboard images', function () { - var result = mapLaunchStoryboardContents(typicalLaunchStoryboardImages, ''); - expect(result).toBeDefined(); - expect(result).toEqual(require('./fixtures/launch-storyboard-support/contents-map/typical-universal-map')); - }); - - it('should return an array with several mapped storyboard images across device classes', function () { - var result = mapLaunchStoryboardContents(multiDeviceLaunchStoryboardImages, ''); - expect(result).toBeDefined(); - expect(result).toEqual(require('./fixtures/launch-storyboard-support/contents-map/varied-device-map')); - }); - }); - - describe('#mapLaunchStoryboardResources', function () { - var mapLaunchStoryboardResources = prepare.__get__('mapLaunchStoryboardResources'); - - it('should return an empty object with no mapped storyboard images', function () { - var result = mapLaunchStoryboardResources(noLaunchStoryboardImages, ''); - expect(result).toBeDefined(); - expect(result).toEqual({}); - }); - - it('should return an object with one mapped storyboard image', function () { - var result = mapLaunchStoryboardResources(singleLaunchStoryboardImage, ''); - expect(result).toBeDefined(); - expect(result).toEqual({ - 'Default@2x~universal~anyany.png': 'res/splash/ios/Default@2x~universal~anyany.png' - }); - }); - - it('should return an object with one mapped storyboard image, even with legacy images', function () { - var result = mapLaunchStoryboardResources(singleLaunchStoryboardImageWithLegacyLaunchImage, ''); - expect(result).toBeDefined(); - expect(result).toEqual({ - 'Default@2x~universal~anyany.png': 'res/splash/ios/Default@2x~universal~anyany.png' - }); - }); - - it('should return an object with several mapped storyboard images', function () { - var result = mapLaunchStoryboardResources(typicalLaunchStoryboardImages, ''); - expect(result).toBeDefined(); - expect(result).toEqual({ - 'Default@2x~universal~anyany.png': 'res/splash/ios/Default@2x~universal~anyany.png', - 'Default@2x~universal~comany.png': 'res/splash/ios/Default@2x~universal~comany.png', - 'Default@2x~universal~comcom.png': 'res/splash/ios/Default@2x~universal~comcom.png', - 'Default@3x~universal~anyany.png': 'res/splash/ios/Default@3x~universal~anyany.png', - 'Default@3x~universal~anycom.png': 'res/splash/ios/Default@3x~universal~anycom.png', - 'Default@3x~universal~comany.png': 'res/splash/ios/Default@3x~universal~comany.png' - }); - }); - - it('should return an object with several mapped storyboard images across device classes', function () { - var result = mapLaunchStoryboardResources(multiDeviceLaunchStoryboardImages, ''); - expect(result).toBeDefined(); - expect(result).toEqual({ - 'Default@2x~universal~anyany.png': 'res/splash/ios/Default@2x~universal~anyany.png', - 'Default@2x~universal~comany.png': 'res/splash/ios/Default@2x~universal~comany.png', - 'Default@2x~universal~comcom.png': 'res/splash/ios/Default@2x~universal~comcom.png', - 'Default@2x~ipad~anyany.png': 'res/splash/ios/Default@2x~ipad~anyany.png', - 'Default@2x~ipad~comany.png': 'res/splash/ios/Default@2x~ipad~comany.png', - 'Default@2x~ipad~comcom.png': 'res/splash/ios/Default@2x~ipad~comcom.png', - 'Default@3x~iphone~anyany.png': 'res/splash/ios/Default@3x~iphone~anyany.png', - 'Default@3x~iphone~anycom.png': 'res/splash/ios/Default@3x~iphone~anycom.png', - 'Default@3x~iphone~comany.png': 'res/splash/ios/Default@3x~iphone~comany.png' - }); - }); - }); - - describe('#getLaunchStoryboardContentsJSON', function () { - var getLaunchStoryboardContentsJSON = prepare.__get__('getLaunchStoryboardContentsJSON'); - - it('should return contents.json with no mapped storyboard images', function () { - var result = getLaunchStoryboardContentsJSON(noLaunchStoryboardImages, ''); - expect(result).toBeDefined(); - expect(result).toEqual(require('./fixtures/launch-storyboard-support/contents-json/empty')); - }); - - it('should return contents.json with one mapped storyboard image', function () { - var result = getLaunchStoryboardContentsJSON(singleLaunchStoryboardImage, ''); - expect(result).toBeDefined(); - expect(result).toEqual(require('./fixtures/launch-storyboard-support/contents-json/single-2xanyany')); - }); - - it('should return contents.json with one mapped storyboard image, even with legacy images', function () { - var result = getLaunchStoryboardContentsJSON(singleLaunchStoryboardImageWithLegacyLaunchImage, ''); - expect(result).toBeDefined(); - expect(result).toEqual(require('./fixtures/launch-storyboard-support/contents-json/single-2xanyany')); - }); - - it('should return contents.json with several mapped storyboard images', function () { - var result = getLaunchStoryboardContentsJSON(typicalLaunchStoryboardImages, ''); - expect(result).toBeDefined(); - expect(result).toEqual(require('./fixtures/launch-storyboard-support/contents-json/typical-universal')); - }); - - it('should return contents.json with several mapped storyboard images across device classes', function () { - var result = getLaunchStoryboardContentsJSON(multiDeviceLaunchStoryboardImages, ''); - expect(result).toBeDefined(); - expect(result).toEqual(require('./fixtures/launch-storyboard-support/contents-json/varied-device')); - }); - }); - - describe('#getLaunchStoryboardImagesDir', function () { - var getLaunchStoryboardImagesDir = prepare.__get__('getLaunchStoryboardImagesDir'); - var projectRoot = iosProject; - - it('should find the Images.xcassets file in a project with an asset catalog', function () { - var platformProjDir = path.join('platforms', 'ios', 'SampleApp'); - var assetCatalogPath = path.join(iosProject, platformProjDir, 'Images.xcassets'); - var expectedPath = path.join(platformProjDir, 'Images.xcassets', 'LaunchStoryboard.imageset/'); - - var fileExists = shell.test('-e', assetCatalogPath); - expect(fileExists).toEqual(true); - - var returnPath = getLaunchStoryboardImagesDir(projectRoot, platformProjDir); - expect(returnPath).toEqual(expectedPath); - }); - - it('should NOT find the Images.xcassets file in a project with no asset catalog', function () { - var platformProjDir = path.join('platforms', 'ios', 'SamplerApp'); - var assetCatalogPath = path.join(iosProject, platformProjDir, 'Images.xcassets'); - - var fileExists = shell.test('-e', assetCatalogPath); - expect(fileExists).toEqual(false); - - var returnPath = getLaunchStoryboardImagesDir(projectRoot, platformProjDir); - expect(returnPath).toBeNull(); - }); - }); - - describe('#platformHasLaunchStoryboardImages', function () { - var platformHasLaunchStoryboardImages = prepare.__get__('platformHasLaunchStoryboardImages'); - var cfgs = ['none', 'legacy-only', 'modern-only', 'modern-and-legacy'].reduce(function (p, c) { - p[c] = new ConfigParser(path.join(FIXTURES, 'launch-storyboard-support', 'configs', c + '.xml')); - return p; - }, {}); - - it('should be false with no launch images', function () { - expect(platformHasLaunchStoryboardImages(cfgs.none)).toEqual(false); - }); - it('should be false with only legacy images', function () { - expect(platformHasLaunchStoryboardImages(cfgs['legacy-only'])).toEqual(false); - }); - it('should be true with typical launch storyboard images', function () { - expect(platformHasLaunchStoryboardImages(cfgs['modern-only'])).toEqual(true); - }); - it('should be true with typical and legacy launch storyboard images', function () { - expect(platformHasLaunchStoryboardImages(cfgs['modern-and-legacy'])).toEqual(true); - }); - }); - - describe('#platformHasLegacyLaunchImages', function () { - var platformHasLegacyLaunchImages = prepare.__get__('platformHasLegacyLaunchImages'); - var cfgs = ['none', 'legacy-only', 'modern-only', 'modern-and-legacy'].reduce(function (p, c) { - p[c] = new ConfigParser(path.join(FIXTURES, 'launch-storyboard-support', 'configs', c + '.xml')); - return p; - }, {}); - - it('should be false with no launch images', function () { - expect(platformHasLegacyLaunchImages(cfgs.none)).toEqual(false); - }); - it('should be true with only legacy images', function () { - expect(platformHasLegacyLaunchImages(cfgs['legacy-only'])).toEqual(true); - }); - it('should be false with typical launch storyboard images', function () { - expect(platformHasLegacyLaunchImages(cfgs['modern-only'])).toEqual(false); - }); - it('should be true with typical and legacy launch storyboard images', function () { - expect(platformHasLegacyLaunchImages(cfgs['modern-and-legacy'])).toEqual(true); - }); - - }); - - describe('#updateProjectPlistForLaunchStoryboard', function () { - var updateProjectPlistForLaunchStoryboard = prepare.__get__('updateProjectPlistForLaunchStoryboard'); - var plistFile = path.join(iosPlatform, 'SampleApp', 'SampleApp-Info.plist'); - var cfgs; - it('setup', function () { - cfgs = ['none', 'legacy-only', 'modern-only', 'modern-and-legacy'].reduce(function (p, c) { - p[c] = { - config: new ConfigParser(path.join(FIXTURES, 'launch-storyboard-support', 'configs', c + '.xml')), - plist: plist.parse(fs.readFileSync(plistFile, 'utf8')) - }; - return p; - }, {}); - }); - - it('should not change the info plist when no launch images are supplied', function () { - var plist = cfgs.none.plist; - updateProjectPlistForLaunchStoryboard(cfgs.none.config, plist); - expect(plist.UILaunchStoryboardName).toBeUndefined(); - }); - it('should not change the info plist when only legacy launch images are supplied', function () { - var plist = cfgs['legacy-only'].plist; - updateProjectPlistForLaunchStoryboard(cfgs['legacy-only'].config, plist); - expect(plist.UILaunchStoryboardName).toBeUndefined(); - }); - it('should change the info plist when only modern launch images are supplied', function () { - var plist = cfgs['modern-only'].plist; - updateProjectPlistForLaunchStoryboard(cfgs['modern-only'].config, plist); - expect(plist.UILaunchStoryboardName).toEqual('CDVLaunchScreen'); - }); - it('should change the info plist when both legacy and modern launch images are supplied', function () { - var plist = cfgs['modern-and-legacy'].plist; - updateProjectPlistForLaunchStoryboard(cfgs['modern-and-legacy'].config, plist); - expect(plist.UILaunchStoryboardName).toEqual('CDVLaunchScreen'); - }); - it('should remove the setting when no launch images are supplied but storyboard setting configured', function () { - var plist = cfgs.none.plist; - plist.UILaunchStoryboardName = 'CDVLaunchScreen'; - updateProjectPlistForLaunchStoryboard(cfgs.none.config, plist); - expect(plist.UILaunchStoryboardName).toBeUndefined(); - }); - it('should remove the setting when only legacy images are supplied but storyboard setting configured', function () { - var plist = cfgs['legacy-only'].plist; - plist.UILaunchStoryboardName = 'CDVLaunchScreen'; - updateProjectPlistForLaunchStoryboard(cfgs['legacy-only'].config, plist); - expect(plist.UILaunchStoryboardName).toBeUndefined(); - }); - it('should maintain the launch storyboard setting over multiple calls when modern images supplied', function () { - var plist = cfgs['modern-only'].plist; - delete plist.UILaunchStoryboardName; - updateProjectPlistForLaunchStoryboard(cfgs['modern-and-legacy'].config, plist); - expect(plist.UILaunchStoryboardName).toEqual('CDVLaunchScreen'); - updateProjectPlistForLaunchStoryboard(cfgs['modern-and-legacy'].config, plist); - expect(plist.UILaunchStoryboardName).toEqual('CDVLaunchScreen'); - }); - it('should not attempt to override launch storyboard setting if not set to our storyboard', function () { - var plist = cfgs['modern-and-legacy'].plist; - plist.UILaunchStoryboardName = 'AnotherStoryboard'; - updateProjectPlistForLaunchStoryboard(cfgs['modern-and-legacy'].config, plist); - expect(plist.UILaunchStoryboardName).toEqual('AnotherStoryboard'); - }); - - }); - - describe('#updateLaunchStoryboardImages', function () { - var getLaunchStoryboardImagesDir = prepare.__get__('getLaunchStoryboardImagesDir'); - var updateLaunchStoryboardImages = prepare.__get__('updateLaunchStoryboardImages'); - var logFileOp = prepare.__get__('logFileOp'); - - it('should clean storyboard launch images and update contents.json', function () { - // spy! - var updatePaths = spyOn(FileUpdater, 'updatePaths'); - - // get appropriate paths - var projectRoot = iosProject; - var platformProjDir = path.join('platforms', 'ios', 'SampleApp'); - var storyboardImagesDir = getLaunchStoryboardImagesDir(projectRoot, platformProjDir); - - // create a suitable mock project for our method - var project = { - root: iosProject, - locations: p.locations, - projectConfig: new ConfigParser(path.join(FIXTURES, 'launch-storyboard-support', 'configs', 'modern-only.xml')) - }; - - // copy the splash screen fixtures to the iOS project - shell.cp('-rf', path.join(FIXTURES, 'launch-storyboard-support', 'res'), iosProject); - - // copy splash screens and update Contents.json - updateLaunchStoryboardImages(project, p.locations); - - // verify that updatePaths was called as we expect - var expectedResourceMap = { - 'Default@2x~universal~comcom.png': 'res/screen/ios/Default@2x~universal~comcom.png', - 'Default@2x~universal~comany.png': 'res/screen/ios/Default@2x~universal~comany.png', - 'Default@2x~universal~anyany.png': 'res/screen/ios/Default@2x~universal~anyany.png', - 'Default@3x~universal~comany.png': 'res/screen/ios/Default@3x~universal~comany.png', - 'Default@3x~universal~anycom.png': 'res/screen/ios/Default@3x~universal~anycom.png', - 'Default@3x~universal~anyany.png': 'res/screen/ios/Default@3x~universal~anyany.png' }; - // update keys with path to storyboardImagesDir - for (var k in expectedResourceMap) { - if (expectedResourceMap.hasOwnProperty(k)) { - expectedResourceMap[storyboardImagesDir + k] = expectedResourceMap[k]; - delete expectedResourceMap[k]; - } - } - expect(updatePaths).toHaveBeenCalledWith(expectedResourceMap, { - rootDir: project.root - }, logFileOp - ); - - // verify that that Contents.json is as we expect - var result = JSON.parse(fs.readFileSync(path.join(project.root, storyboardImagesDir, 'Contents.json'))); - expect(result).toEqual(require('./fixtures/launch-storyboard-support/contents-json/typical-universal')); - }); - }); - - describe('#cleanLaunchStoryboardImages', function () { - var getLaunchStoryboardImagesDir = prepare.__get__('getLaunchStoryboardImagesDir'); - var updateLaunchStoryboardImages = prepare.__get__('updateLaunchStoryboardImages'); - var cleanLaunchStoryboardImages = prepare.__get__('cleanLaunchStoryboardImages'); - var logFileOp = prepare.__get__('logFileOp'); - - it('should move launch images and update contents.json', function () { - - var projectRoot = iosProject; - var platformProjDir = path.join('platforms', 'ios', 'SampleApp'); - var storyboardImagesDir = getLaunchStoryboardImagesDir(projectRoot, platformProjDir); - var project = { - root: iosProject, - locations: p.locations, - projectConfig: new ConfigParser(path.join(FIXTURES, 'launch-storyboard-support', 'configs', 'modern-only.xml')) - }; - - shell.cp('-rf', path.join(FIXTURES, 'launch-storyboard-support', 'res'), iosProject); - updateLaunchStoryboardImages(project, p.locations); - - // now, clean the images - var updatePaths = spyOn(FileUpdater, 'updatePaths'); - cleanLaunchStoryboardImages(projectRoot, project.projectConfig, p.locations); - - // verify that updatePaths was called as we expect - var expectedResourceMap = { - 'Default@2x~universal~comcom.png': null, - 'Default@2x~universal~comany.png': null, - 'Default@2x~universal~anyany.png': null, - 'Default@3x~universal~comany.png': null, - 'Default@3x~universal~anycom.png': null, - 'Default@3x~universal~anyany.png': null }; - // update keys with path to storyboardImagesDir - for (var k in expectedResourceMap) { - if (expectedResourceMap.hasOwnProperty(k)) { - expectedResourceMap[storyboardImagesDir + k] = null; - delete expectedResourceMap[k]; - } - } - expect(updatePaths).toHaveBeenCalledWith(expectedResourceMap, { - rootDir: project.root, - all: true - }, logFileOp - ); - - // verify that that Contents.json is as we expect - var result = JSON.parse(fs.readFileSync(path.join(project.root, storyboardImagesDir, 'Contents.json'))); - expect(result).toEqual(require('./fixtures/launch-storyboard-support/contents-json/empty')); - }); - }); - - describe('#checkIfBuildSettingsNeedUpdatedForLaunchStoryboard', function () { - var checkIfBuildSettingsNeedUpdatedForLaunchStoryboard = prepare.__get__('checkIfBuildSettingsNeedUpdatedForLaunchStoryboard'); - var updateProjectPlistForLaunchStoryboard = prepare.__get__('updateProjectPlistForLaunchStoryboard'); - var plistFile = path.join(iosPlatform, 'SampleApp', 'SampleApp-Info.plist'); - var cfgs; - it('setup', function () { - cfgs = ['none', 'legacy-only', 'modern-only', 'modern-and-legacy'].reduce(function (p, c) { - p[c] = { - config: new ConfigParser(path.join(FIXTURES, 'launch-storyboard-support', 'configs', c + '.xml')), - plist: plist.parse(fs.readFileSync(plistFile, 'utf8')) - }; - return p; - }, {}); - }); - - it('should return false with no launch images', function () { - var cfg = cfgs.none; - updateProjectPlistForLaunchStoryboard(cfg.config, cfg.plist); - expect(checkIfBuildSettingsNeedUpdatedForLaunchStoryboard(cfg.config, cfg.plist)).toEqual(false); - }); - it('should return true with only legacy images', function () { - // why? because legacy images require Xcode to compile launch image assets - // and we may have previously removed that setting - var cfg = cfgs['legacy-only']; - updateProjectPlistForLaunchStoryboard(cfg.config, cfg.plist); - expect(checkIfBuildSettingsNeedUpdatedForLaunchStoryboard(cfg.config, cfg.plist)).toEqual(true); - }); - it('should return true with only storyboard images', function () { - var cfg = cfgs['modern-only']; - updateProjectPlistForLaunchStoryboard(cfg.config, cfg.plist); - expect(checkIfBuildSettingsNeedUpdatedForLaunchStoryboard(cfg.config, cfg.plist)).toEqual(true); - }); - it('should return false with storyboard and legacy images', function () { - // why? because we assume that the build settings will still build the asset catalog - // the user has specified both legacy and modern images, so why question it? - var cfg = cfgs['modern-and-legacy']; - updateProjectPlistForLaunchStoryboard(cfg.config, cfg.plist); - expect(checkIfBuildSettingsNeedUpdatedForLaunchStoryboard(cfg.config, cfg.plist)).toEqual(false); - }); - - }); - - describe('#updateBuildSettingsForLaunchStoryboard', function () { - var updateBuildSettingsForLaunchStoryboard = prepare.__get__('updateBuildSettingsForLaunchStoryboard'); - var updateProjectPlistForLaunchStoryboard = prepare.__get__('updateProjectPlistForLaunchStoryboard'); - var plistFile = path.join(iosPlatform, 'SampleApp', 'SampleApp-Info.plist'); - var cfgs; - it('setup', function () { - cfgs = ['legacy-only', 'modern-only'].reduce(function (p, c) { - p[c] = { - config: new ConfigParser(path.join(FIXTURES, 'launch-storyboard-support', 'configs', c + '.xml')), - plist: plist.parse(fs.readFileSync(plistFile, 'utf8')) - }; - return p; - }, {}); - }); - - it('should update build property with only legacy images', function () { - var cfg = cfgs['legacy-only']; - var proj = new xcode.project(p.locations.pbxproj); /* eslint new-cap : 0 */ - proj.parseSync(); - updateProjectPlistForLaunchStoryboard(cfg.config, cfg.plist); - updateBuildSettingsForLaunchStoryboard(proj, cfg.config, cfg.plist); - expect(proj.getBuildProperty('ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME')).toEqual('LaunchImage'); - }); - it('should remove build property with only storyboard images', function () { - var cfg = cfgs['modern-only']; - var proj = new xcode.project(p.locations.pbxproj); /* eslint new-cap : 0 */ - proj.parseSync(); - // set a value for our asset catalog to make sure it really goes away - proj.updateBuildProperty('ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME', 'LaunchImage'); - updateProjectPlistForLaunchStoryboard(cfg.config, cfg.plist); - updateBuildSettingsForLaunchStoryboard(proj, cfg.config, cfg.plist); - expect(proj.getBuildProperty('ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME')).toBeUndefined(); - }); - }); - - }); - - describe('updateProject method', function () { - /* eslint-disable no-unused-vars */ - var mv; - var update_name; - /* eslint-enable no-unused-vars */ - var xcOrig = xcode.project; - var writeFileSyncSpy; - let cfg, cfg2, cfg3; - - var updateProject = prepare.__get__('updateProject'); - - beforeEach(function () { - // Create real config objects before mocking out everything. - cfg = new ConfigParser(path.join(FIXTURES, 'test-config.xml')); - cfg2 = new ConfigParser(path.join(FIXTURES, 'test-config-2.xml')); - cfg3 = new ConfigParser(path.join(FIXTURES, 'test-config-3.xml')); - - mv = spyOn(shell, 'mv'); - writeFileSyncSpy = spyOn(fs, 'writeFileSync'); - - spyOn(plist, 'parse').and.returnValue({}); - spyOn(plist, 'build').and.returnValue(''); - spyOn(xcode, 'project').and.callFake(function (pbxproj) { - - var xc = new xcOrig(pbxproj); /* eslint new-cap : 0 */ - update_name = spyOn(xc, 'updateProductName').and.callThrough(); - return xc; - }); - cfg.name = function () { return 'SampleApp'; }; // this is to match p's original project name (based on .xcodeproj) - cfg.packageName = function () { return 'testpkg'; }; - cfg.version = function () { return 'one point oh'; }; - - spyOn(cfg, 'getPreference'); - }); - - it('should resolve', function () { - // the original name here will be `SampleApp` (based on the xcodeproj basename) from p - cfg2.name = function () { return 'SampleApp'; }; // new config does *not* have a name change - return updateProject(cfg2, p.locations); // since the name has not changed it *should not* error - }); - - it('should reject when the app name has changed', function () { - // the original name here will be `SampleApp` (based on the xcodeproj basename) from p - cfg2.name = function () { return 'NotSampleApp'; }; // new config has name change - return updateProject(cfg2, p.locations).then( // since the name has changed it *should* error - () => fail('Expected promise to be rejected'), - err => expect(err).toEqual(jasmine.any(Error)) - ); - }); - - it('should write target-device preference', function () { - cfg2.name = function () { return 'SampleApp'; }; // new config does *not* have a name change - writeFileSyncSpy.and.callThrough(); - - return updateProject(cfg2, p.locations).then(() => { - var xcode = require('xcode'); - var proj = new xcode.project(p.locations.pbxproj); /* eslint new-cap : 0 */ - proj.parseSync(); - var prop = proj.getBuildProperty('TARGETED_DEVICE_FAMILY'); - expect(prop).toEqual('"1"'); // 1 is handset - }); - }); - it('should write deployment-target preference', function () { - cfg2.name = function () { return 'SampleApp'; }; // new config does *not* have a name change - writeFileSyncSpy.and.callThrough(); - - return updateProject(cfg2, p.locations).then(() => { - var xcode = require('xcode'); - var proj = new xcode.project(p.locations.pbxproj); /* eslint new-cap : 0 */ - proj.parseSync(); - var prop = proj.getBuildProperty('IPHONEOS_DEPLOYMENT_TARGET'); - expect(prop).toEqual('8.0'); - }); - }); - it('should write SwiftVersion preference (4.1)', function () { - cfg3.name = function () { return 'SampleApp'; }; // new config does *not* have a name change - writeFileSyncSpy.and.callThrough(); - return updateProject(cfg3, p.locations).then(() => { - var xcode = require('xcode'); - var proj = new xcode.project(p.locations.pbxproj); /* eslint new-cap : 0 */ - proj.parseSync(); - var prop = proj.getBuildProperty('SWIFT_VERSION'); - expect(prop).toEqual('4.1'); - }); - }); - it('should write SwiftVersion preference (3.3)', function () { - cfg3.name = function () { return 'SampleApp'; }; // new config does *not* have a name change - var pref = cfg3.doc.findall('platform[@name=\'ios\']/preference').filter(function (elem) { - return elem.attrib.name.toLowerCase() === 'swiftversion'; - })[0]; - pref.attrib.value = '3.3'; - writeFileSyncSpy.and.callThrough(); - return updateProject(cfg3, p.locations).then(() => { - var xcode = require('xcode'); - var proj = new xcode.project(p.locations.pbxproj); /* eslint new-cap : 0 */ - proj.parseSync(); - var prop = proj.getBuildProperty('SWIFT_VERSION'); - expect(prop).toEqual('3.3'); - }); - }); - - it('Test#002 : should write out the app id to info plist as CFBundleIdentifier', function () { - var orig = cfg.getAttribute; - cfg.getAttribute = function (name) { - if (name === 'ios-CFBundleIdentifier') { - return null; - } - return orig.call(this, name); - }; - writeFileSyncSpy.and.callThrough(); - - return updateProject(cfg, p.locations).then(() => { - var xcode = require('xcode'); - var proj = new xcode.project(p.locations.pbxproj); /* eslint new-cap : 0 */ - proj.parseSync(); - var prop = proj.getBuildProperty('PRODUCT_BUNDLE_IDENTIFIER'); - expect(prop).toEqual('testpkg'); - }); - }); - it('Test#003 : should write out the app id to info plist as CFBundleIdentifier with ios-CFBundleIdentifier', function () { - var orig = cfg.getAttribute; - cfg.getAttribute = function (name) { - if (name === 'ios-CFBundleIdentifier') { - return 'testpkg_ios'; - } - return orig.call(this, name); - }; - - writeFileSyncSpy.and.callThrough(); - - return updateProject(cfg, p.locations).then(() => { - var xcode = require('xcode'); - var proj = new xcode.project(p.locations.pbxproj); /* eslint new-cap : 0 */ - proj.parseSync(); - var prop = proj.getBuildProperty('PRODUCT_BUNDLE_IDENTIFIER'); - expect(prop).toEqual('testpkg_ios'); - }); - }); - it('Test#004 : should write out the app version to info plist as CFBundleVersion', function () { - return updateProject(cfg, p.locations).then(() => { - expect(plist.build.calls.mostRecent().args[0].CFBundleShortVersionString).toEqual('one point oh'); - }); - }); - it('Test#005 : should write out the orientation preference value', function () { - cfg.getPreference.and.callThrough(); - return updateProject(cfg, p.locations).then(() => { - expect(plist.build.calls.mostRecent().args[0].UISupportedInterfaceOrientations).toEqual([ 'UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown' ]); - expect(plist.build.calls.mostRecent().args[0]['UISupportedInterfaceOrientations~ipad']).toEqual([ 'UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown' ]); - expect(plist.build.calls.mostRecent().args[0].UIInterfaceOrientation).toEqual([ 'UIInterfaceOrientationPortrait' ]); - }); - }); - it('Test#006 : should handle no orientation', function () { - cfg.getPreference.and.returnValue(''); - return updateProject(cfg, p.locations).then(() => { - expect(plist.build.calls.mostRecent().args[0].UISupportedInterfaceOrientations).toBeUndefined(); - expect(plist.build.calls.mostRecent().args[0]['UISupportedInterfaceOrientations~ipad']).toBeUndefined(); - expect(plist.build.calls.mostRecent().args[0].UIInterfaceOrientation).toBeUndefined(); - }); - }); - it('Test#007 : should handle default orientation', function () { - cfg.getPreference.and.returnValue('default'); - return updateProject(cfg, p.locations).then(() => { - expect(plist.build.calls.mostRecent().args[0].UISupportedInterfaceOrientations).toEqual([ 'UIInterfaceOrientationPortrait', 'UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight' ]); - expect(plist.build.calls.mostRecent().args[0]['UISupportedInterfaceOrientations~ipad']).toEqual([ 'UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown', 'UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight' ]); - expect(plist.build.calls.mostRecent().args[0].UIInterfaceOrientation).toBeUndefined(); - }); - }); - it('Test#008 : should handle portrait orientation', function () { - cfg.getPreference.and.returnValue('portrait'); - return updateProject(cfg, p.locations).then(() => { - expect(plist.build.calls.mostRecent().args[0].UISupportedInterfaceOrientations).toEqual([ 'UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown' ]); - expect(plist.build.calls.mostRecent().args[0].UIInterfaceOrientation).toEqual([ 'UIInterfaceOrientationPortrait' ]); - }); - }); - it('Test#009 : should handle landscape orientation', function () { - cfg.getPreference.and.returnValue('landscape'); - return updateProject(cfg, p.locations).then(() => { - expect(plist.build.calls.mostRecent().args[0].UISupportedInterfaceOrientations).toEqual([ 'UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight' ]); - expect(plist.build.calls.mostRecent().args[0].UIInterfaceOrientation).toEqual([ 'UIInterfaceOrientationLandscapeLeft' ]); - }); - }); - it('Test#010 : should handle all orientation on ios', function () { - cfg.getPreference.and.returnValue('all'); - return updateProject(cfg, p.locations).then(() => { - expect(plist.build.calls.mostRecent().args[0].UISupportedInterfaceOrientations).toEqual([ 'UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown', 'UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight' ]); - expect(plist.build.calls.mostRecent().args[0].UIInterfaceOrientation).toEqual([ 'UIInterfaceOrientationPortrait' ]); - }); - }); - it('Test#011 : should handle custom orientation', function () { - cfg.getPreference.and.returnValue('some-custom-orientation'); - return updateProject(cfg, p.locations).then(() => { - expect(plist.build.calls.mostRecent().args[0].UISupportedInterfaceOrientations).toEqual([ 'UIInterfaceOrientationPortrait', 'UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight' ]); - expect(plist.build.calls.mostRecent().args[0]['UISupportedInterfaceOrientations~ipad']).toEqual([ 'UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown', 'UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight' ]); - expect(plist.build.calls.mostRecent().args[0].UIInterfaceOrientation).toBeUndefined(); - }); - }); - - /// // App Transport Security Tests ///////////////////////////// - // NOTE: if an ATS value is equal to "null", it means that it was not written, - // thus it will use the default (check the default for the key). - // This is to prevent the Info.plist to be too verbose. - it('Test#012 : - should handle wildcard', function () { - return updateProject(cfg, p.locations).then(() => { - var ats = plist.build.calls.mostRecent().args[0].NSAppTransportSecurity; - expect(ats.NSAllowsArbitraryLoads).toEqual(true); - expect(ats.NSAllowsArbitraryLoadsInWebContent).toEqual(undefined); - expect(ats.NSAllowsArbitraryLoadsInMedia).toEqual(undefined); // DEPRECATED - expect(ats.NSAllowsArbitraryLoadsForMedia).toEqual(undefined); - expect(ats.NSAllowsLocalNetworking).toEqual(undefined); - }); - }); - - it(' - should handle wildcard, with NSAllowsArbitraryLoadsInWebContent', function () { - - const origReadFile = fse.readFileSync; - var readFile = spyOn(fse, 'readFileSync'); - var configXml = 'SampleApp' + - '' + - ''; - - readFile.and.callFake(function (...args) { - if (args[0] === 'fake/path') { - return configXml; - } - return origReadFile(...args); - }); - - var my_config = new ConfigParser('fake/path'); - - return updateProject(my_config, p.locations).then(() => { - var ats = plist.build.calls.mostRecent().args[0].NSAppTransportSecurity; - expect(ats.NSAllowsArbitraryLoads).toEqual(true); - expect(ats.NSAllowsArbitraryLoadsInWebContent).toEqual(true); - expect(ats.NSAllowsArbitraryLoadsInMedia).toEqual(undefined); // DEPRECATED - expect(ats.NSAllowsArbitraryLoadsForMedia).toEqual(undefined); - expect(ats.NSAllowsLocalNetworking).toEqual(undefined); - }); - }); - - it(' - should handle wildcard, with NSAllowsArbitraryLoadsForMedia set (fixed allows-arbitrary-loads-for-media)', function () { - - const origReadFile = fse.readFileSync; - var readFile = spyOn(fse, 'readFileSync'); - var configXml = 'SampleApp' + - '' + - ''; - - readFile.and.callFake(function (...args) { - if (args[0] === 'fake/path') { - return configXml; - } - return origReadFile(...args); - }); - - var my_config = new ConfigParser('fake/path'); - return updateProject(my_config, p.locations).then(() => { - var ats = plist.build.calls.mostRecent().args[0].NSAppTransportSecurity; - expect(ats.NSAllowsArbitraryLoads).toEqual(true); - expect(ats.NSAllowsArbitraryLoadsInWebContent).toEqual(undefined); - expect(ats.NSAllowsArbitraryLoadsInMedia).toEqual(undefined); // DEPRECATED - expect(ats.NSAllowsArbitraryLoadsForMedia).toEqual(true); - expect(ats.NSAllowsLocalNetworking).toEqual(undefined); - }); - }); - - it(' - should handle wildcard, with NSAllowsArbitraryLoadsForMedia not set (fixed allows-arbitrary-loads-for-media)', function () { - - const origReadFile = fse.readFileSync; - var readFile = spyOn(fse, 'readFileSync'); - var configXml = 'SampleApp' + - '' + - ''; - - readFile.and.callFake(function (...args) { - if (args[0] === 'fake/path') { - return configXml; - } - return origReadFile(...args); - }); - - var my_config = new ConfigParser('fake/path'); - return updateProject(my_config, p.locations).then(() => { - var ats = plist.build.calls.mostRecent().args[0].NSAppTransportSecurity; - expect(ats.NSAllowsArbitraryLoads).toEqual(true); - expect(ats.NSAllowsArbitraryLoadsInWebContent).toEqual(undefined); - expect(ats.NSAllowsArbitraryLoadsInMedia).toEqual(undefined); // DEPRECATED - expect(ats.NSAllowsArbitraryLoadsForMedia).toEqual(undefined); - expect(ats.NSAllowsLocalNetworking).toEqual(undefined); - }); - }); - - it(' - should handle wildcard, with NSAllowsArbitraryLoadsForMedia set (deprecated allows-arbitrary-loads-in-media)', function () { - - const origReadFile = fse.readFileSync; - var readFile = spyOn(fse, 'readFileSync'); - var configXml = 'SampleApp' + - '' + - ''; - - readFile.and.callFake(function (...args) { - if (args[0] === 'fake/path') { - return configXml; - } - return origReadFile(...args); - }); - - var my_config = new ConfigParser('fake/path'); - return updateProject(my_config, p.locations).then(() => { - var ats = plist.build.calls.mostRecent().args[0].NSAppTransportSecurity; - expect(ats.NSAllowsArbitraryLoads).toEqual(true); - expect(ats.NSAllowsArbitraryLoadsInWebContent).toEqual(undefined); - expect(ats.NSAllowsArbitraryLoadsInMedia).toEqual(undefined); // DEPRECATED - expect(ats.NSAllowsArbitraryLoadsForMedia).toEqual(true); - expect(ats.NSAllowsLocalNetworking).toEqual(undefined); - }); - }); - - it(' - should handle wildcard, with NSAllowsArbitraryLoadsForMedia not set (deprecated allows-arbitrary-loads-in-media)', function () { - - const origReadFile = fse.readFileSync; - var readFile = spyOn(fse, 'readFileSync'); - var configXml = 'SampleApp' + - '' + - ''; - - readFile.and.callFake(function (...args) { - if (args[0] === 'fake/path') { - return configXml; - } - return origReadFile(...args); - }); - - var my_config = new ConfigParser('fake/path'); - return updateProject(my_config, p.locations).then(() => { - var ats = plist.build.calls.mostRecent().args[0].NSAppTransportSecurity; - expect(ats.NSAllowsArbitraryLoads).toEqual(true); - expect(ats.NSAllowsArbitraryLoadsInWebContent).toEqual(undefined); - expect(ats.NSAllowsArbitraryLoadsInMedia).toEqual(undefined); // DEPRECATED - expect(ats.NSAllowsArbitraryLoadsForMedia).toEqual(undefined); - expect(ats.NSAllowsLocalNetworking).toEqual(undefined); - }); - }); - - it(' - should handle wildcard, with NSAllowsLocalNetworking', function () { - - const origReadFile = fse.readFileSync; - var readFile = spyOn(fse, 'readFileSync'); - var configXml = 'SampleApp' + - '' + - ''; - - readFile.and.callFake(function (...args) { - if (args[0] === 'fake/path') { - return configXml; - } - return origReadFile(...args); - }); - - var my_config = new ConfigParser('fake/path'); - - return updateProject(my_config, p.locations).then(() => { - var ats = plist.build.calls.mostRecent().args[0].NSAppTransportSecurity; - expect(ats.NSAllowsArbitraryLoads).toEqual(true); - expect(ats.NSAllowsArbitraryLoadsInWebContent).toEqual(undefined); - expect(ats.NSAllowsArbitraryLoadsInMedia).toEqual(undefined); // DEPRECATED - expect(ats.NSAllowsArbitraryLoadsForMedia).toEqual(undefined); - expect(ats.NSAllowsLocalNetworking).toEqual(true); - }); - }); - - it(' - should handle wildcard, with NSAllowsArbitraryLoadsInWebContent, NSAllowsArbitraryLoadsForMedia, NSAllowsLocalNetworking', function () { - - const origReadFile = fse.readFileSync; - var readFile = spyOn(fse, 'readFileSync'); - var configXml = 'SampleApp' + - '' + - ''; - - readFile.and.callFake(function (...args) { - if (args[0] === 'fake/path') { - return configXml; - } - return origReadFile(...args); - }); - - var my_config = new ConfigParser('fake/path'); - - return updateProject(my_config, p.locations).then(() => { - var ats = plist.build.calls.mostRecent().args[0].NSAppTransportSecurity; - expect(ats.NSAllowsArbitraryLoads).toEqual(true); - expect(ats.NSAllowsArbitraryLoadsInWebContent).toEqual(true); - expect(ats.NSAllowsArbitraryLoadsInMedia).toEqual(undefined); // DEPRECATED - expect(ats.NSAllowsArbitraryLoadsForMedia).toEqual(true); - expect(ats.NSAllowsLocalNetworking).toEqual(true); - }); - }); - it(' - sanity check - no wildcard but has NSAllowsArbitraryLoadsInWebContent, NSAllowsArbitraryLoadsForMedia, NSAllowsLocalNetworking', function () { - - const origReadFile = fse.readFileSync; - var readFile = spyOn(fse, 'readFileSync'); - var configXml = 'SampleApp' + - '' + - ''; - - readFile.and.callFake(function (...args) { - if (args[0] === 'fake/path') { - return configXml; - } - return origReadFile(...args); - }); - - var my_config = new ConfigParser('fake/path'); - - return updateProject(my_config, p.locations).then(() => { - var ats = plist.build.calls.mostRecent().args[0].NSAppTransportSecurity; - expect(ats.NSAllowsArbitraryLoads).toEqual(undefined); - expect(ats.NSAllowsArbitraryLoadsInWebContent).toEqual(undefined); - expect(ats.NSAllowsArbitraryLoadsInMedia).toEqual(undefined); // DEPRECATED - expect(ats.NSAllowsArbitraryLoadsForMedia).toEqual(undefined); - expect(ats.NSAllowsLocalNetworking).toEqual(undefined); - }); - }); - - it('Test#13 : - https, subdomain wildcard', function () { - return updateProject(cfg, p.locations).then(() => { - var ats = plist.build.calls.mostRecent().args[0].NSAppTransportSecurity; - var exceptionDomains = ats.NSExceptionDomains; - var d; - - expect(exceptionDomains).toBeTruthy(); - - d = exceptionDomains['server01.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(true); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server02.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(true); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server02-1.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(true); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - - d = exceptionDomains['server02-2.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(true); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - - d = exceptionDomains['server03.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(true); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server04.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(true); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server04-1.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(true); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - - d = exceptionDomains['server04-2.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(true); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - }); - }); - - it('Test#014 : - http, no wildcard', function () { - return updateProject(cfg, p.locations).then(() => { - var ats = plist.build.calls.mostRecent().args[0].NSAppTransportSecurity; - var exceptionDomains = ats.NSExceptionDomains; - var d; - - expect(exceptionDomains).toBeTruthy(); - - d = exceptionDomains['server05.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server06.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server06-1.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - - d = exceptionDomains['server06-2.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - - d = exceptionDomains['server07.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server08.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server08-1.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - - d = exceptionDomains['server08-2.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - - }); - }); - it('Test#015 : - https, no wildcard', function () { - return updateProject(cfg, p.locations).then(() => { - var ats = plist.build.calls.mostRecent().args[0].NSAppTransportSecurity; - var exceptionDomains = ats.NSExceptionDomains; - var d; - - expect(exceptionDomains).toBeTruthy(); - - d = exceptionDomains['server09.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server10.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server10-1.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - - d = exceptionDomains['server10-2.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - - d = exceptionDomains['server11.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server12.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server12-1.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - - d = exceptionDomains['server12-2.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - }); - }); - /// /////////////////////////////////////////////// - it('Test#016 : , - http and https, no clobber', function () { - // original name here is 'SampleApp' based on p - // we are not testing a name change here, but testing a new config being used (name change test is above) - // so we set it to the name expected - cfg2.name = function () { return 'SampleApp'; }; // new config does *not* have a name change - - return updateProject(cfg2, p.locations).then(() => { - var ats = plist.build.calls.mostRecent().args[0].NSAppTransportSecurity; - var exceptionDomains = ats.NSExceptionDomains; - var d; - - expect(exceptionDomains).toBeTruthy(); - - d = exceptionDomains['apache.org']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(true); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - }); - }); - /// /////////////////////////////////////////////// - - it(' - should handle wildcard', function () { - - const origReadFile = fse.readFileSync; - var readFile = spyOn(fse, 'readFileSync'); - var configXml = 'SampleApp' + - '' + - ''; - - readFile.and.callFake(function (...args) { - if (args[0] === 'fake/path') { - return configXml; - } - return origReadFile(...args); - }); - - var my_config = new ConfigParser('fake/path'); - - return updateProject(my_config, p.locations).then(() => { - var ats = plist.build.calls.mostRecent().args[0].NSAppTransportSecurity; - expect(ats.NSAllowsArbitraryLoads).toEqual(true); - expect(ats.NSAllowsArbitraryLoadsInWebContent).toEqual(undefined); - expect(ats.NSAllowsArbitraryLoadsInMedia).toEqual(undefined); // DEPRECATED - expect(ats.NSAllowsArbitraryLoadsForMedia).toEqual(undefined); - expect(ats.NSAllowsLocalNetworking).toEqual(undefined); - }); - }); - - it(' - sanity check - no wildcard but has NSAllowsArbitraryLoadsInWebContent, NSAllowsArbitraryLoadsForMedia, NSAllowsLocalNetworking', function () { - - const origReadFile = fse.readFileSync; - var readFile = spyOn(fse, 'readFileSync'); - var configXml = 'SampleApp' + - '' + - ''; - - readFile.and.callFake(function (...args) { - if (args[0] === 'fake/path') { - return configXml; - } - return origReadFile(...args); - }); - - var my_config = new ConfigParser('fake/path'); - - return updateProject(my_config, p.locations).then(() => { - var ats = plist.build.calls.mostRecent().args[0].NSAppTransportSecurity; - expect(ats.NSAllowsArbitraryLoads).toEqual(undefined); - expect(ats.NSAllowsArbitraryLoadsInWebContent).toEqual(undefined); - expect(ats.NSAllowsArbitraryLoadsInMedia).toEqual(undefined); // DEPRECATED - expect(ats.NSAllowsArbitraryLoadsForMedia).toEqual(undefined); - expect(ats.NSAllowsLocalNetworking).toEqual(undefined); - }); - }); - - it(' - https, subdomain wildcard', function () { - return updateProject(cfg, p.locations).then(() => { - var ats = plist.build.calls.mostRecent().args[0].NSAppTransportSecurity; - var exceptionDomains = ats.NSExceptionDomains; - var d; - - expect(exceptionDomains).toBeTruthy(); - - d = exceptionDomains['server21.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(true); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server22.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(true); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server22-1.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(true); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - - d = exceptionDomains['server22-2.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(true); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - - d = exceptionDomains['server23.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(true); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server24.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(true); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server24-1.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(true); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - - d = exceptionDomains['server24-2.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(true); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - }); - }); - - it(' - http, no wildcard', function () { - return updateProject(cfg, p.locations).then(() => { - var ats = plist.build.calls.mostRecent().args[0].NSAppTransportSecurity; - var exceptionDomains = ats.NSExceptionDomains; - var d; - - expect(exceptionDomains).toBeTruthy(); - - d = exceptionDomains['server25.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server26.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server26-1.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - - d = exceptionDomains['server26-2.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - - d = exceptionDomains['server27.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server28.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server28-1.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - - d = exceptionDomains['server28-2.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - - }); - }); - - it(' - https, no wildcard', function () { - return updateProject(cfg, p.locations).then(() => { - var ats = plist.build.calls.mostRecent().args[0].NSAppTransportSecurity; - var exceptionDomains = ats.NSExceptionDomains; - var d; - - expect(exceptionDomains).toBeTruthy(); - - d = exceptionDomains['server29.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server30.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server30-1.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - - d = exceptionDomains['server30-2.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - - d = exceptionDomains['server31.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server32.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server32-1.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - - d = exceptionDomains['server32-2.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(undefined); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - }); - }); - - it('Test#017 : - wildcard scheme, wildcard subdomain', function () { - return updateProject(cfg, p.locations).then(() => { - var ats = plist.build.calls.mostRecent().args[0].NSAppTransportSecurity; - var exceptionDomains = ats.NSExceptionDomains; - var d; - - expect(exceptionDomains).toBeTruthy(); - - d = exceptionDomains['server33.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(true); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server34.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(true); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server34-1.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(true); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - - d = exceptionDomains['server34-2.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(true); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - - d = exceptionDomains['server35.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(true); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server36.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(true); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server36-1.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(true); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - - d = exceptionDomains['server36-2.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(true); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - - }); - }); - it('Test#018 : - wildcard scheme, no subdomain', function () { - return updateProject(cfg, p.locations).then(() => { - var ats = plist.build.calls.mostRecent().args[0].NSAppTransportSecurity; - var exceptionDomains = ats.NSExceptionDomains; - var d; - - expect(exceptionDomains).toBeTruthy(); - - d = exceptionDomains['server37.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server38.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server38-1.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - - d = exceptionDomains['server38-2.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual(undefined); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - - d = exceptionDomains['server39.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server40.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(undefined); - - d = exceptionDomains['server40-1.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(undefined); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - - d = exceptionDomains['server40-2.com']; - expect(d).toBeTruthy(); - expect(d.NSIncludesSubdomains).toEqual(undefined); - expect(d.NSExceptionAllowsInsecureHTTPLoads).toEqual(true); - expect(d.NSExceptionMinimumTLSVersion).toEqual('TLSv1.1'); - expect(d.NSExceptionRequiresForwardSecrecy).toEqual(false); - expect(d.NSRequiresCertificateTransparency).toEqual(true); - - }); - }); - it('Test#019 : - should ignore wildcards like data:*, https:*, https://*', function () { - return updateProject(cfg, p.locations).then(() => { - var ats = plist.build.calls.mostRecent().args[0].NSAppTransportSecurity; - var exceptionDomains = ats.NSExceptionDomains; - expect(exceptionDomains['']).toBeUndefined(); - expect(exceptionDomains['null']).toBeUndefined(); - expect(exceptionDomains['undefined']).toBeUndefined(); - }); - }); - it('Test#020 : - should write out the display name to info plist as CFBundleDisplayName', function () { - cfg.shortName = function () { return 'MyApp'; }; - return updateProject(cfg, p.locations).then(() => { - expect(plist.build.calls.mostRecent().args[0].CFBundleDisplayName).toEqual('MyApp'); - }); - }); - }); - - describe(' tests', function () { - // image-8888.png target attribute is missing in config.xml as a test - const images = [ - { - 'src': 'image-5678.png', - 'target': 'image-5678.png' - }, - { - 'src': 'image-1234.png', - 'target': path.join('images', 'image-3456.png') - }, - { - 'src': 'image-8888.png', - 'target': 'image-8888.png' - } - ]; - const projectRoot = path.join(FIXTURES, 'resource-file-support'); - const updateFileResources = prepare.__get__('updateFileResources'); - const cleanFileResources = prepare.__get__('cleanFileResources'); - const cfgResourceFiles = new ConfigParser(path.join(FIXTURES, 'resource-file-support', 'config.xml')); - - function findImageFileRef (pbxproj, imageFileName) { - const buildfiles = pbxproj.pbxBuildFileSection(); - return Object.keys(buildfiles).filter(function (uuid) { - var filename = buildfiles[uuid].fileRef_comment; - return (filename === imageFileName); - }); - } - - function findResourcesBuildPhaseRef (pbxproj, ref) { - const resBuildPhase = pbxproj.buildPhaseObject('PBXResourcesBuildPhase', 'Resources'); - let resBuildPhaseFileRefs = []; - if (resBuildPhase) { - resBuildPhaseFileRefs = resBuildPhase.files.filter(function (item) { - return item.value === ref; - }); - } - - return resBuildPhaseFileRefs; - } - - it(' prepare - copy', function () { - const cordovaProject = { - root: projectRoot, - projectConfig: cfgResourceFiles, - locations: { - plugins: path.join(projectRoot, 'plugins'), - www: path.join(projectRoot, 'www') - } - }; - - updateFileResources(cordovaProject, p.locations); - // try multiple times (3 in total) - updateFileResources(cordovaProject, p.locations); - updateFileResources(cordovaProject, p.locations); - - const project = projectFile.parse(p.locations); - - // for the 3 total file references attempted to be added above, - // it should only have one file reference after the fact - for (let image of images) { - // check whether the file is copied to the target location - let copiedImageFile = path.join(project.resources_dir, image.target); - expect(fs.existsSync(copiedImageFile)).toEqual(true); - - // find PBXBuildFile file reference - let imagefileRefs = findImageFileRef(project.xcode, path.basename(image.target)); - expect(imagefileRefs.length).toEqual(1); - // find file reference in PBXResourcesBuildPhase - let resBuildPhaseFileRefs = findResourcesBuildPhaseRef(project.xcode, imagefileRefs[0]); - expect(resBuildPhaseFileRefs.length).toEqual(1); - } - }); - - it(' clean - remove', function () { - cleanFileResources(projectRoot, cfgResourceFiles, p.locations); - const project = projectFile.parse(p.locations); - - for (let image of images) { - // check whether the file is removed from the target location - let copiedImageFile = path.join(project.resources_dir, image.target); - expect(fs.existsSync(copiedImageFile)).toEqual(false); - - // find PBXBuildFile file reference - let imagefileRefs = findImageFileRef(project.xcode, path.basename(image.target)); - expect(imagefileRefs.length).toEqual(0); - // find file reference in PBXResourcesBuildPhase - let resBuildPhaseFileRefs = findResourcesBuildPhaseRef(project.xcode, imagefileRefs[0]); - expect(resBuildPhaseFileRefs.length).toEqual(0); - } - }); - }); - - describe('updateWww method', function () { - var updateWww = prepare.__get__('updateWww'); - var logFileOp = prepare.__get__('logFileOp'); - - beforeEach(function () { - spyOn(FileUpdater, 'mergeAndUpdateDir').and.returnValue(true); - }); - - var project = { - root: iosProject, - locations: { www: path.join(iosProject, 'www') } - }; - - it('Test#021 : should update project-level www and with platform agnostic www and merges', function () { - var merges_path = path.join(project.root, 'merges', 'ios'); - shell.mkdir('-p', merges_path); - updateWww(project, p.locations); - expect(FileUpdater.mergeAndUpdateDir).toHaveBeenCalledWith( - [ 'www', path.join('platforms', 'ios', 'platform_www'), path.join('merges', 'ios') ], - path.join('platforms', 'ios', 'www'), - { rootDir: iosProject }, - logFileOp); - }); - it('Test#022 : should skip merges if merges directory does not exist', function () { - var merges_path = path.join(project.root, 'merges', 'ios'); - shell.rm('-rf', merges_path); - updateWww(project, p.locations); - expect(FileUpdater.mergeAndUpdateDir).toHaveBeenCalledWith( - [ 'www', path.join('platforms', 'ios', 'platform_www') ], - path.join('platforms', 'ios', 'www'), - { rootDir: iosProject }, - logFileOp); - }); - }); -}); diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/preparePlatform.spec.js b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/preparePlatform.spec.js deleted file mode 100644 index 47a60f4..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/preparePlatform.spec.js +++ /dev/null @@ -1,99 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -var path = require('path'); -var fs = require('fs'); -var shell = require('shelljs'); -var EventEmitter = require('events').EventEmitter; -var ConfigParser = require('cordova-common').ConfigParser; -var PluginInfo = require('cordova-common').PluginInfo; -var Api = require('../../../bin/templates/scripts/cordova/Api'); - -var FIXTURES = path.join(__dirname, 'fixtures'); -var DUMMY_PLUGIN = 'org.test.plugins.dummyplugin'; - -var iosProjectFixture = path.join(FIXTURES, 'ios-config-xml'); -var iosProject = path.join(FIXTURES, 'dummyProj'); -var iosPlatform = path.join(iosProject, 'platforms/ios'); -var dummyPlugin = path.join(FIXTURES, DUMMY_PLUGIN); - -shell.config.silent = true; - -describe('prepare after plugin add', function () { - var api; - beforeEach(function () { - shell.mkdir('-p', iosPlatform); - shell.cp('-rf', iosProjectFixture + '/*', iosPlatform); - api = new Api('ios', iosPlatform, new EventEmitter()); - - jasmine.addMatchers({ - 'toBeInstalledIn': function () { - return { - compare: function (actual, expected) { - var result = {}; - var content; - try { - content = fs.readFileSync(path.join(expected, 'ios.json')); - var cfg = JSON.parse(content); - result.pass = Object.keys(cfg.installed_plugins).indexOf(actual) > -1; - } catch (e) { - result.pass = false; - } - - if (result.pass) { - result.message = 'Expected ' + actual + ' to be installed in ' + expected + '.'; - } else { - result.message = 'Expected ' + actual + ' to not be installed in ' + expected + '.'; - } - return result; - } - }; - } - }); - }); - - afterEach(function () { - shell.rm('-rf', iosPlatform); - }); - - it('Test 001 : should not overwrite plugin metadata added by "addPlugin"', function () { - var project = { - root: iosProject, - projectConfig: new ConfigParser(path.join(iosProject, 'config.xml')), - locations: { - plugins: path.join(iosProject, 'plugins'), - www: path.join(iosProject, 'www') - } - }; - - return api.prepare(project, {}) - .then(function () { - expect(fs.existsSync(path.join(iosPlatform, 'ios.json'))).toBe(true); - expect(DUMMY_PLUGIN).not.toBeInstalledIn(iosProject); - return api.addPlugin(new PluginInfo(dummyPlugin), {}); - }) - .then(function () { - expect(DUMMY_PLUGIN).toBeInstalledIn(iosPlatform); - return api.prepare(project, {}); - }) - .then(function () { - expect(DUMMY_PLUGIN).toBeInstalledIn(iosPlatform); - }); - }); -}); diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/projectFile.spec.js b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/projectFile.spec.js deleted file mode 100644 index 2b0f351..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/projectFile.spec.js +++ /dev/null @@ -1,83 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -var os = require('os'); -var path = require('path'); -var shell = require('shelljs'); -var projectFile = require('../../../bin/templates/scripts/cordova/lib/projectFile'); - -var iosProject = path.join(os.tmpdir(), 'plugman/projectFile'); -var iosProjectFixture = path.join(__dirname, 'fixtures/ios-config-xml/*'); - -var locations = { - root: iosProject, - pbxproj: path.join(iosProject, 'SampleApp.xcodeproj/project.pbxproj') -}; - -describe('projectFile', function () { - beforeEach(function () { - shell.cp('-rf', iosProjectFixture, iosProject); - }); - - afterEach(function () { - shell.rm('-rf', iosProject); - }); - - describe('parse method', function () { - it('Test#001 : should throw if project is not an xcode project', function () { - shell.rm('-rf', path.join(iosProject, 'SampleApp', 'SampleApp.xcodeproj')); - expect(function () { projectFile.parse(); }).toThrow(); - }); - it('Test#002 : should throw if project does not contain an appropriate config.xml file', function () { - shell.rm(path.join(iosProject, 'SampleApp', 'config.xml')); - expect(function () { projectFile.parse(locations); }) - .toThrow(new Error('Could not find *-Info.plist file, or config.xml file.')); - }); - it('Test#003 : should throw if project does not contain an appropriate -Info.plist file', function () { - shell.rm(path.join(iosProject, 'SampleApp', 'SampleApp-Info.plist')); - expect(function () { projectFile.parse(locations); }) - .toThrow(new Error('Could not find *-Info.plist file, or config.xml file.')); - }); - it('Test#004 : should return right directory when multiple .plist files are present', function () { - // Create a folder named A with config.xml and .plist files in it - var pathToFolderA = path.join(iosProject, 'A'); - shell.mkdir(pathToFolderA); - shell.cp('-rf', path.join(iosProject, 'SampleApp/*'), pathToFolderA); - - var parsedProjectFile = projectFile.parse(locations); - var pluginsDir = parsedProjectFile.plugins_dir; - var resourcesDir = parsedProjectFile.resources_dir; - var xcodePath = parsedProjectFile.xcode_path; - - var pluginsDirParent = path.dirname(pluginsDir); - var resourcesDirParent = path.dirname(resourcesDir); - var sampleAppDir = path.join(iosProject, 'SampleApp'); - - expect(pluginsDirParent).toEqual(sampleAppDir); - expect(resourcesDirParent).toEqual(sampleAppDir); - expect(xcodePath).toEqual(sampleAppDir); - }); - }); - - describe('other methods', function () { - it('Test#005 : getPackageName method should return the CFBundleIdentifier from the project\'s Info.plist file', function () { - expect(projectFile.parse(locations).getPackageName()).toEqual('com.example.friendstring'); - }); - }); -}); diff --git a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/versions.spec.js b/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/versions.spec.js deleted file mode 100644 index 7168749..0000000 --- a/chabok-starter-cordova/node_modules/cordova-ios/tests/spec/unit/versions.spec.js +++ /dev/null @@ -1,80 +0,0 @@ -/** - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -var semver = require('semver'); -var versions = require('../../../bin/templates/scripts/cordova/lib/versions'); - -// These tests can not run on windows. -if (process.platform === 'darwin') { - describe('versions', function () { - beforeEach(() => { - spyOn(console, 'log'); - }); - - describe('get_apple_ios_version method', () => { - it('should have found ios version.', () => { - return versions.get_apple_ios_version().then(() => { - expect(console.log).not.toHaveBeenCalledWith(undefined); - }); - }); - }); - - describe('get_apple_osx_version method', () => { - it('should have found osx version.', () => { - return versions.get_apple_osx_version().then(() => { - expect(console.log).not.toHaveBeenCalledWith(undefined); - }); - }); - }); - }); -} - -describe('versions', () => { - describe('compareVersions method', () => { - it('calls semver.compare, given valid semver', () => { - const testVersions = ['1.0.0', '1.1.0']; - spyOn(semver, 'compare'); - - versions.compareVersions(...testVersions); - expect(semver.compare).toHaveBeenCalledWith( - ...testVersions.map(version => - jasmine.objectContaining({ version }) - ) - ); - }); - - it('handles pre-release identifiers', () => { - expect( - versions.compareVersions('1.0.0-rc.0', '1.0.0') - ).toBe(-1); - }); - - it('handles non-semver versions', () => { - expect( - versions.compareVersions('10.1', '10') - ).toBe(1); - }); - - it('does not handle pre-release identifiers on non-semver versions', () => { - expect( - versions.compareVersions('10.1-beta.1', '10.1') - ).toBe(0); - }); - }); -}); diff --git a/chabok-starter-cordova/node_modules/cordova-plugin-whitelist/.github/PULL_REQUEST_TEMPLATE.md b/chabok-starter-cordova/node_modules/cordova-plugin-whitelist/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 91582f4..0000000 --- a/chabok-starter-cordova/node_modules/cordova-plugin-whitelist/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,22 +0,0 @@ - - -### Platforms affected - - -### What does this PR do? - - -### What testing has been done on this change? - - -### Checklist -- [ ] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database -- [ ] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected. -- [ ] Added automated test coverage as appropriate for this change. diff --git a/chabok-starter-cordova/node_modules/cordova-plugin-whitelist/CONTRIBUTING.md b/chabok-starter-cordova/node_modules/cordova-plugin-whitelist/CONTRIBUTING.md deleted file mode 100644 index 7de4c64..0000000 --- a/chabok-starter-cordova/node_modules/cordova-plugin-whitelist/CONTRIBUTING.md +++ /dev/null @@ -1,37 +0,0 @@ - - -# Contributing to Apache Cordova - -Anyone can contribute to Cordova. And we need your contributions. - -There are multiple ways to contribute: report bugs, improve the docs, and -contribute code. - -For instructions on this, start with the -[contribution overview](http://cordova.apache.org/contribute/). - -The details are explained there, but the important items are: - - Sign and submit an Apache ICLA (Contributor License Agreement). - - Have a Jira issue open that corresponds to your contribution. - - Run the tests so your patch doesn't break existing functionality. - -We look forward to your contributions! diff --git a/chabok-starter-cordova/node_modules/cordova-plugin-whitelist/LICENSE b/chabok-starter-cordova/node_modules/cordova-plugin-whitelist/LICENSE deleted file mode 100644 index 7a4a3ea..0000000 --- a/chabok-starter-cordova/node_modules/cordova-plugin-whitelist/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - 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 diff --git a/chabok-starter-cordova/node_modules/cordova-plugin-whitelist/NOTICE b/chabok-starter-cordova/node_modules/cordova-plugin-whitelist/NOTICE deleted file mode 100644 index 8ec56a5..0000000 --- a/chabok-starter-cordova/node_modules/cordova-plugin-whitelist/NOTICE +++ /dev/null @@ -1,5 +0,0 @@ -Apache Cordova -Copyright 2012 The Apache Software Foundation - -This product includes software developed at -The Apache Software Foundation (http://www.apache.org/). diff --git a/chabok-starter-cordova/node_modules/cordova-plugin-whitelist/README.md b/chabok-starter-cordova/node_modules/cordova-plugin-whitelist/README.md deleted file mode 100644 index e19d230..0000000 --- a/chabok-starter-cordova/node_modules/cordova-plugin-whitelist/README.md +++ /dev/null @@ -1,163 +0,0 @@ ---- -title: Whitelist -description: Whitelist external content accessible by your app. ---- - - -# cordova-plugin-whitelist - -This plugin implements a whitelist policy for navigating the application webview on Cordova 4.0 - -:warning: Report issues on the [Apache Cordova issue tracker](https://issues.apache.org/jira/issues/?jql=project%20%3D%20CB%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20AND%20resolution%20%3D%20Unresolved%20AND%20component%20%3D%20%22Plugin%20Whitelist%22%20ORDER%20BY%20priority%20DESC%2C%20summary%20ASC%2C%20updatedDate%20DESC) - -## Installation - -You can install whitelist plugin with Cordova CLI, from npm: - -``` -$ cordova plugin add cordova-plugin-whitelist -$ cordova prepare -``` - -## Supported Cordova Platforms - -* Android 4.0.0 or above - -## Navigation Whitelist -Controls which URLs the WebView itself can be navigated to. Applies to -top-level navigations only. - -Quirks: on Android it also applies to iframes for non-http(s) schemes. - -By default, navigations only to `file://` URLs, are allowed. To allow others URLs, you must add `` tags to your `config.xml`: - - - - - - - - - - - - - - - -## Intent Whitelist -Controls which URLs the app is allowed to ask the system to open. -By default, no external URLs are allowed. - -On Android, this equates to sending an intent of type BROWSEABLE. - -This whitelist does not apply to plugins, only hyperlinks and calls to `window.open()`. - -In `config.xml`, add `` tags, like this: - - - - - - - - - - - - - - - - - - - - - - - -## Network Request Whitelist -Controls which network requests (images, XHRs, etc) are allowed to be made (via cordova native hooks). - -Note: We suggest you use a Content Security Policy (see below), which is more secure. This whitelist is mostly historical for webviews which do not support CSP. - -In `config.xml`, add `` tags, like this: - - - - - - - - - - - - - - - - - -Without any `` tags, only requests to `file://` URLs are allowed. However, the default Cordova application includes `` by default. - - -Note: Whitelist cannot block network redirects from a whitelisted remote website (i.e. http or https) to a non-whitelisted website. Use CSP rules to mitigate redirects to non-whitelisted websites for webviews that support CSP. - -Quirk: Android also allows requests to https://ssl.gstatic.com/accessibility/javascript/android/ by default, since this is required for TalkBack to function properly. - -### Content Security Policy -Controls which network requests (images, XHRs, etc) are allowed to be made (via webview directly). - -On Android and iOS, the network request whitelist (see above) is not able to filter all types of requests (e.g. `