mirror of
https://github.com/apache/cordova-android.git
synced 2026-05-30 00:00:04 +08:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9768e73882 | |||
| db2a498d76 | |||
| b0e205a781 | |||
| 8f54290eec | |||
| 6760d0378a | |||
| f4b1d09407 | |||
| 029d1561dc | |||
| 06660383e1 | |||
| f28738fe6d | |||
| 5981023a4c | |||
| 89f9ac1957 | |||
| 09e1c00fb8 |
@@ -20,6 +20,29 @@
|
|||||||
-->
|
-->
|
||||||
## Release Notes for Cordova (Android) ##
|
## Release Notes for Cordova (Android) ##
|
||||||
|
|
||||||
|
|
||||||
|
### 3.4.0 (Feb 2014) ###
|
||||||
|
|
||||||
|
37 commits from 10 authors. Highlights include:
|
||||||
|
|
||||||
|
* Security Fix for Android 4.2.1 and lower (disabling addJavascriptInterface as a bridge option)
|
||||||
|
* CB-5793 Make ant work-around work on windows.
|
||||||
|
* CB-5793 Don't clean before build and change output directory to ant-build to avoid conflicts with Eclipse.
|
||||||
|
* CB-4910 Fix CLI's eclipse project template not working on windows due to "*" in the virtual folder name.
|
||||||
|
* CB-5803 Fix cordova/emulate on windows.
|
||||||
|
* CB-5801 exec->spawn in build to make sure compile errors are shown.
|
||||||
|
* CB-5799 Update version of OkHTTP to 1.3
|
||||||
|
* Remove package.json within bin/ since we never intend to ship bin/ as an npm module
|
||||||
|
* CB-4910 Update CLI project template to point to config.xml at the root now that it's not in www/ by default.
|
||||||
|
* Silence excessive logging from scroll events
|
||||||
|
* CB-5504: Adding onDestroy to app plugin to deregister telephonyReceiver
|
||||||
|
* CB-5715 Add Eclipse .project file to create template.
|
||||||
|
* CB-5447 Removed android:debuggable=“true” from project template.
|
||||||
|
* CB-5714 Fix of android build when too big output stops build with error due to buffer overflow.
|
||||||
|
* Fix incorrect MIME type for .js files loaded through CordovaResourceAPI.
|
||||||
|
* Remove 2 X console.log from exec.js
|
||||||
|
* CB-5592 Set MIME type for openExternal when scheme is file:
|
||||||
|
|
||||||
### 3.3.0 (Dec 2013) ###
|
### 3.3.0 (Dec 2013) ###
|
||||||
|
|
||||||
41 commits from 11 authors. Highlights include:
|
41 commits from 11 authors. Highlights include:
|
||||||
|
|||||||
+22
-4
@@ -165,17 +165,23 @@ exports.createProject = function(project_path, package_name, project_name, proje
|
|||||||
// copy project template
|
// copy project template
|
||||||
shell.cp('-r', path.join(project_template_dir, 'assets'), project_path);
|
shell.cp('-r', path.join(project_template_dir, 'assets'), project_path);
|
||||||
shell.cp('-r', path.join(project_template_dir, 'res'), project_path);
|
shell.cp('-r', path.join(project_template_dir, 'res'), project_path);
|
||||||
|
shell.cp('-r', path.join(ROOT, 'framework', 'res', 'xml'), path.join(project_path, 'res'));
|
||||||
|
|
||||||
// Manually create directories that would be empty within the template (since git doesn't track directories).
|
// Manually create directories that would be empty within the template (since git doesn't track directories).
|
||||||
shell.mkdir(path.join(project_path, 'libs'));
|
shell.mkdir(path.join(project_path, 'libs'));
|
||||||
|
|
||||||
// Add in the proper eclipse project file.
|
// Add in the proper eclipse project file.
|
||||||
if (use_cli_template) {
|
if (use_cli_template) {
|
||||||
|
var note = 'To show `assets/www` or `res/xml/config.xml`, go to:\n' +
|
||||||
|
' Project -> Properties -> Resource -> Resource Filters\n' +
|
||||||
|
'And delete the exclusion filter.\n';
|
||||||
shell.cp(path.join(project_template_dir, 'eclipse-project-CLI'), path.join(project_path, '.project'));
|
shell.cp(path.join(project_template_dir, 'eclipse-project-CLI'), path.join(project_path, '.project'));
|
||||||
|
fs.writeFileSync(path.join(project_path, 'assets', '_where-is-www.txt'), note);
|
||||||
} else {
|
} else {
|
||||||
shell.cp(path.join(project_template_dir, 'eclipse-project'), path.join(project_path, '.project'));
|
shell.cp(path.join(project_template_dir, 'eclipse-project'), path.join(project_path, '.project'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy cordova.js, cordova.jar and res/xml
|
// copy cordova.js, cordova.jar
|
||||||
shell.cp('-r', path.join(ROOT, 'framework', 'res', 'xml'), path.join(project_path, 'res'));
|
|
||||||
copyJsAndLibrary(project_path, use_shared_project, safe_activity_name);
|
copyJsAndLibrary(project_path, use_shared_project, safe_activity_name);
|
||||||
|
|
||||||
// interpolate the activity name and package
|
// interpolate the activity name and package
|
||||||
@@ -202,24 +208,36 @@ exports.createProject = function(project_path, package_name, project_name, proje
|
|||||||
|
|
||||||
// Attribute removed in Cordova 4.4 (CB-5447).
|
// Attribute removed in Cordova 4.4 (CB-5447).
|
||||||
function removeDebuggableFromManifest(projectPath) {
|
function removeDebuggableFromManifest(projectPath) {
|
||||||
var manifestPath = path.join(projectPath, 'AndroidManifest.xml');
|
var manifestPath = path.join(projectPath, 'AndroidManifest.xml');
|
||||||
shell.sed('-i', /\s*android:debuggable="true"/, '', manifestPath);
|
shell.sed('-i', /\s*android:debuggable="true"/, '', manifestPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function extractProjectNameFromManifest(projectPath) {
|
||||||
|
var manifestPath = path.join(projectPath, 'AndroidManifest.xml');
|
||||||
|
var manifestData = fs.readFileSync(manifestPath, 'utf8');
|
||||||
|
var m = /<activity[\s\S]*?android:name\s*=\s*"(.*?)"/i.exec(manifestData);
|
||||||
|
if (!m) {
|
||||||
|
throw new Error('Could not find activity name in ' + manifestPath);
|
||||||
|
}
|
||||||
|
return m[1];
|
||||||
|
}
|
||||||
|
|
||||||
// Returns a promise.
|
// Returns a promise.
|
||||||
exports.updateProject = function(projectPath) {
|
exports.updateProject = function(projectPath) {
|
||||||
var version = fs.readFileSync(path.join(ROOT, 'VERSION'), 'utf-8').trim();
|
var version = fs.readFileSync(path.join(ROOT, 'VERSION'), 'utf-8').trim();
|
||||||
// Check that requirements are met and proper targets are installed
|
// Check that requirements are met and proper targets are installed
|
||||||
return check_reqs.run()
|
return check_reqs.run()
|
||||||
.then(function() {
|
.then(function() {
|
||||||
|
var projectName = extractProjectNameFromManifest(projectPath);
|
||||||
var target_api = check_reqs.get_target();
|
var target_api = check_reqs.get_target();
|
||||||
copyJsAndLibrary(projectPath, false, null);
|
copyJsAndLibrary(projectPath, false, projectName);
|
||||||
copyScripts(projectPath);
|
copyScripts(projectPath);
|
||||||
copyAntRules(projectPath);
|
copyAntRules(projectPath);
|
||||||
removeDebuggableFromManifest(projectPath);
|
removeDebuggableFromManifest(projectPath);
|
||||||
return runAndroidUpdate(projectPath, target_api, false)
|
return runAndroidUpdate(projectPath, target_api, false)
|
||||||
.then(function() {
|
.then(function() {
|
||||||
console.log('Android project is now at version ' + version);
|
console.log('Android project is now at version ' + version);
|
||||||
|
console.log('If you updated from a pre-3.2.0 version and use an IDE, we now require that you import the "CordovaLib" library project.');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -20,6 +20,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Coho updates this line:
|
// Coho updates this line:
|
||||||
var VERSION = "3.4.0-dev";
|
var VERSION = "3.4.0";
|
||||||
|
|
||||||
console.log(VERSION);
|
console.log(VERSION);
|
||||||
|
|||||||
@@ -13,5 +13,9 @@
|
|||||||
</path>
|
</path>
|
||||||
<echo message="Set jars path to: ${toString:project.all.jars.path}"/>
|
<echo message="Set jars path to: ${toString:project.all.jars.path}"/>
|
||||||
</target>
|
</target>
|
||||||
|
<target name="-post-build">
|
||||||
|
<move file="ant-build/AndroidManifest.xml" tofile="ant-build/AndroidManifest.cordova.xml" failonerror="false" overwrite="true" />
|
||||||
|
<move file="CordovaLib/ant-build/AndroidManifest.xml" tofile="CordovaLib/ant-build/AndroidManifest.cordova.xml" failonerror="false" overwrite="true" />
|
||||||
|
</target>
|
||||||
</project>
|
</project>
|
||||||
|
|
||||||
|
|||||||
@@ -32,36 +32,40 @@
|
|||||||
</natures>
|
</natures>
|
||||||
<linkedResources>
|
<linkedResources>
|
||||||
<link>
|
<link>
|
||||||
<name>-- Cordova Project --</name>
|
<name>config.xml</name>
|
||||||
<type>2</type>
|
|
||||||
<locationURI>virtual:/virtual</locationURI>
|
|
||||||
</link>
|
|
||||||
<link>
|
|
||||||
<name>-- Cordova Project --/config.xml</name>
|
|
||||||
<type>1</type>
|
<type>1</type>
|
||||||
<locationURI>$%7BPARENT-2-PROJECT_LOC%7D/config.xml</locationURI>
|
<locationURI>$%7BPARENT-2-PROJECT_LOC%7D/config.xml</locationURI>
|
||||||
</link>
|
</link>
|
||||||
<link>
|
<link>
|
||||||
<name>-- Cordova Project --/www</name>
|
<name>www</name>
|
||||||
<type>2</type>
|
<type>2</type>
|
||||||
<locationURI>$%7BPARENT-2-PROJECT_LOC%7D/www</locationURI>
|
<locationURI>$%7BPARENT-2-PROJECT_LOC%7D/www</locationURI>
|
||||||
</link>
|
</link>
|
||||||
<link>
|
<link>
|
||||||
<name>-- Cordova Project --/merges</name>
|
<name>merges</name>
|
||||||
<type>2</type>
|
<type>2</type>
|
||||||
<locationURI>$%7BPARENT-2-PROJECT_LOC%7D/merges</locationURI>
|
<locationURI>$%7BPARENT-2-PROJECT_LOC%7D/merges</locationURI>
|
||||||
</link>
|
</link>
|
||||||
</linkedResources>
|
</linkedResources>
|
||||||
<filteredResources>
|
<filteredResources>
|
||||||
<filter>
|
<filter>
|
||||||
<id>1388696068187</id>
|
<id>1390880034107</id>
|
||||||
<name></name>
|
<name></name>
|
||||||
<type>10</type>
|
<type>30</type>
|
||||||
<matcher>
|
<matcher>
|
||||||
<id>org.eclipse.ui.ide.multiFilter</id>
|
<id>org.eclipse.ui.ide.multiFilter</id>
|
||||||
<arguments>1.0-name-matches-false-true-CordovaLib|platform_www|cordova</arguments>
|
<arguments>1.0-projectRelativePath-matches-false-true-^(build.xml|ant-gen|ant-build|custom_rules.xml|CordovaLib|platform_www|cordova)</arguments>
|
||||||
</matcher>
|
</matcher>
|
||||||
</filter>
|
</filter>
|
||||||
</filteredResources>
|
<filter>
|
||||||
|
<id>1390880034108</id>
|
||||||
|
<name></name>
|
||||||
|
<type>30</type>
|
||||||
|
<matcher>
|
||||||
|
<id>org.eclipse.ui.ide.multiFilter</id>
|
||||||
|
<arguments>1.0-projectRelativePath-matches-false-true-^(assets/www|res/xml/config.xml)</arguments>
|
||||||
|
</matcher>
|
||||||
|
</filter>
|
||||||
|
</filteredResources>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
|
|
||||||
|
|||||||
Vendored
+32
-28
@@ -1,5 +1,5 @@
|
|||||||
// Platform: android
|
// Platform: android
|
||||||
// 3.3.0-dev-c9de1bc
|
// 3.4.0
|
||||||
/*
|
/*
|
||||||
Licensed to the Apache Software Foundation (ASF) under one
|
Licensed to the Apache Software Foundation (ASF) under one
|
||||||
or more contributor license agreements. See the NOTICE file
|
or more contributor license agreements. See the NOTICE file
|
||||||
@@ -19,8 +19,8 @@
|
|||||||
under the License.
|
under the License.
|
||||||
*/
|
*/
|
||||||
;(function() {
|
;(function() {
|
||||||
var CORDOVA_JS_BUILD_LABEL = '3.3.0-dev-c9de1bc';
|
var CORDOVA_JS_BUILD_LABEL = '3.4.0';
|
||||||
// file: lib/scripts/require.js
|
// file: src/scripts/require.js
|
||||||
|
|
||||||
/*jshint -W079 */
|
/*jshint -W079 */
|
||||||
/*jshint -W020 */
|
/*jshint -W020 */
|
||||||
@@ -34,7 +34,7 @@ var require,
|
|||||||
requireStack = [],
|
requireStack = [],
|
||||||
// Map of module ID -> index into requireStack of modules currently being built.
|
// Map of module ID -> index into requireStack of modules currently being built.
|
||||||
inProgressModules = {},
|
inProgressModules = {},
|
||||||
SEPERATOR = ".";
|
SEPARATOR = ".";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ var require,
|
|||||||
var resultantId = id;
|
var resultantId = id;
|
||||||
//Its a relative path, so lop off the last portion and add the id (minus "./")
|
//Its a relative path, so lop off the last portion and add the id (minus "./")
|
||||||
if (id.charAt(0) === ".") {
|
if (id.charAt(0) === ".") {
|
||||||
resultantId = module.id.slice(0, module.id.lastIndexOf(SEPERATOR)) + SEPERATOR + id.slice(2);
|
resultantId = module.id.slice(0, module.id.lastIndexOf(SEPARATOR)) + SEPARATOR + id.slice(2);
|
||||||
}
|
}
|
||||||
return require(resultantId);
|
return require(resultantId);
|
||||||
};
|
};
|
||||||
@@ -98,7 +98,7 @@ if (typeof module === "object" && typeof require === "function") {
|
|||||||
module.exports.define = define;
|
module.exports.define = define;
|
||||||
}
|
}
|
||||||
|
|
||||||
// file: lib/cordova.js
|
// file: src/cordova.js
|
||||||
define("cordova", function(require, exports, module) {
|
define("cordova", function(require, exports, module) {
|
||||||
|
|
||||||
|
|
||||||
@@ -316,7 +316,7 @@ module.exports = cordova;
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// file: lib/android/android/nativeapiprovider.js
|
// file: src/android/android/nativeapiprovider.js
|
||||||
define("cordova/android/nativeapiprovider", function(require, exports, module) {
|
define("cordova/android/nativeapiprovider", function(require, exports, module) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -339,7 +339,7 @@ module.exports = {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// file: lib/android/android/promptbasednativeapi.js
|
// file: src/android/android/promptbasednativeapi.js
|
||||||
define("cordova/android/promptbasednativeapi", function(require, exports, module) {
|
define("cordova/android/promptbasednativeapi", function(require, exports, module) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -361,7 +361,7 @@ module.exports = {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// file: lib/common/argscheck.js
|
// file: src/common/argscheck.js
|
||||||
define("cordova/argscheck", function(require, exports, module) {
|
define("cordova/argscheck", function(require, exports, module) {
|
||||||
|
|
||||||
var exec = require('cordova/exec');
|
var exec = require('cordova/exec');
|
||||||
@@ -427,7 +427,7 @@ moduleExports.enableChecks = true;
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// file: lib/common/base64.js
|
// file: src/common/base64.js
|
||||||
define("cordova/base64", function(require, exports, module) {
|
define("cordova/base64", function(require, exports, module) {
|
||||||
|
|
||||||
var base64 = exports;
|
var base64 = exports;
|
||||||
@@ -483,7 +483,7 @@ function uint8ToBase64(rawData) {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// file: lib/common/builder.js
|
// file: src/common/builder.js
|
||||||
define("cordova/builder", function(require, exports, module) {
|
define("cordova/builder", function(require, exports, module) {
|
||||||
|
|
||||||
var utils = require('cordova/utils');
|
var utils = require('cordova/utils');
|
||||||
@@ -552,7 +552,7 @@ function include(parent, objects, clobber, merge) {
|
|||||||
include(result, obj.children, clobber, merge);
|
include(result, obj.children, clobber, merge);
|
||||||
}
|
}
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
utils.alert('Exception building cordova JS globals: ' + e + ' for key "' + key + '"');
|
utils.alert('Exception building Cordova JS globals: ' + e + ' for key "' + key + '"');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -596,7 +596,7 @@ exports.replaceHookForTesting = function() {};
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// file: lib/common/channel.js
|
// file: src/common/channel.js
|
||||||
define("cordova/channel", function(require, exports, module) {
|
define("cordova/channel", function(require, exports, module) {
|
||||||
|
|
||||||
var utils = require('cordova/utils'),
|
var utils = require('cordova/utils'),
|
||||||
@@ -837,7 +837,7 @@ module.exports = channel;
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// file: lib/android/exec.js
|
// file: src/android/exec.js
|
||||||
define("cordova/exec", function(require, exports, module) {
|
define("cordova/exec", function(require, exports, module) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1074,7 +1074,7 @@ module.exports = androidExec;
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// file: lib/common/exec/proxy.js
|
// file: src/common/exec/proxy.js
|
||||||
define("cordova/exec/proxy", function(require, exports, module) {
|
define("cordova/exec/proxy", function(require, exports, module) {
|
||||||
|
|
||||||
|
|
||||||
@@ -1104,7 +1104,7 @@ module.exports = {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
// file: lib/common/init.js
|
// file: src/common/init.js
|
||||||
define("cordova/init", function(require, exports, module) {
|
define("cordova/init", function(require, exports, module) {
|
||||||
|
|
||||||
var channel = require('cordova/channel');
|
var channel = require('cordova/channel');
|
||||||
@@ -1218,7 +1218,7 @@ channel.join(function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// file: lib/common/modulemapper.js
|
// file: src/common/modulemapper.js
|
||||||
define("cordova/modulemapper", function(require, exports, module) {
|
define("cordova/modulemapper", function(require, exports, module) {
|
||||||
|
|
||||||
var builder = require('cordova/builder'),
|
var builder = require('cordova/builder'),
|
||||||
@@ -1319,7 +1319,7 @@ exports.reset();
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// file: lib/android/platform.js
|
// file: src/android/platform.js
|
||||||
define("cordova/platform", function(require, exports, module) {
|
define("cordova/platform", function(require, exports, module) {
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
@@ -1360,7 +1360,7 @@ module.exports = {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// file: lib/android/plugin/android/app.js
|
// file: src/android/plugin/android/app.js
|
||||||
define("cordova/plugin/android/app", function(require, exports, module) {
|
define("cordova/plugin/android/app", function(require, exports, module) {
|
||||||
|
|
||||||
var exec = require('cordova/exec');
|
var exec = require('cordova/exec');
|
||||||
@@ -1437,10 +1437,11 @@ module.exports = {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// file: lib/common/pluginloader.js
|
// file: src/common/pluginloader.js
|
||||||
define("cordova/pluginloader", function(require, exports, module) {
|
define("cordova/pluginloader", function(require, exports, module) {
|
||||||
|
|
||||||
var modulemapper = require('cordova/modulemapper');
|
var modulemapper = require('cordova/modulemapper');
|
||||||
|
var urlutil = require('cordova/urlutil');
|
||||||
|
|
||||||
// Helper function to inject a <script> tag.
|
// Helper function to inject a <script> tag.
|
||||||
function injectScript(url, onload, onerror) {
|
function injectScript(url, onload, onerror) {
|
||||||
@@ -1509,11 +1510,14 @@ function handlePluginsObject(path, moduleList, finishPluginLoading) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function injectPluginScript(pathPrefix, finishPluginLoading) {
|
function injectPluginScript(pathPrefix, finishPluginLoading) {
|
||||||
injectScript(pathPrefix + 'cordova_plugins.js', function(){
|
var pluginPath = pathPrefix + 'cordova_plugins.js';
|
||||||
|
|
||||||
|
injectScript(pluginPath, function() {
|
||||||
try {
|
try {
|
||||||
var moduleList = require("cordova/plugin_list");
|
var moduleList = require("cordova/plugin_list");
|
||||||
handlePluginsObject(pathPrefix, moduleList, finishPluginLoading);
|
handlePluginsObject(pathPrefix, moduleList, finishPluginLoading);
|
||||||
} catch (e) {
|
}
|
||||||
|
catch (e) {
|
||||||
// Error loading cordova_plugins.js, file not found or something
|
// Error loading cordova_plugins.js, file not found or something
|
||||||
// this is an acceptable error, pre-3.0.0, so we just move on.
|
// this is an acceptable error, pre-3.0.0, so we just move on.
|
||||||
finishPluginLoading();
|
finishPluginLoading();
|
||||||
@@ -1550,24 +1554,24 @@ exports.load = function(callback) {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// file: lib/common/urlutil.js
|
// file: src/common/urlutil.js
|
||||||
define("cordova/urlutil", function(require, exports, module) {
|
define("cordova/urlutil", function(require, exports, module) {
|
||||||
|
|
||||||
var urlutil = exports;
|
|
||||||
var anchorEl = document.createElement('a');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For already absolute URLs, returns what is passed in.
|
* For already absolute URLs, returns what is passed in.
|
||||||
* For relative URLs, converts them to absolute ones.
|
* For relative URLs, converts them to absolute ones.
|
||||||
*/
|
*/
|
||||||
urlutil.makeAbsolute = function(url) {
|
exports.makeAbsolute = function makeAbsolute(url) {
|
||||||
|
var anchorEl = document.createElement('a');
|
||||||
anchorEl.href = url;
|
anchorEl.href = url;
|
||||||
return anchorEl.href;
|
return anchorEl.href;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// file: lib/common/utils.js
|
// file: src/common/utils.js
|
||||||
define("cordova/utils", function(require, exports, module) {
|
define("cordova/utils", function(require, exports, module) {
|
||||||
|
|
||||||
var utils = exports;
|
var utils = exports;
|
||||||
@@ -1738,7 +1742,7 @@ function UUIDcreatePart(length) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
window.cordova = require('cordova');
|
window.cordova = require('cordova');
|
||||||
// file: lib/scripts/bootstrap.js
|
// file: src/scripts/bootstrap.js
|
||||||
|
|
||||||
require('cordova/init');
|
require('cordova/init');
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ import android.widget.FrameLayout;
|
|||||||
public class CordovaWebView extends WebView {
|
public class CordovaWebView extends WebView {
|
||||||
|
|
||||||
public static final String TAG = "CordovaWebView";
|
public static final String TAG = "CordovaWebView";
|
||||||
public static final String CORDOVA_VERSION = "3.4.0-dev";
|
public static final String CORDOVA_VERSION = "3.4.0";
|
||||||
|
|
||||||
private ArrayList<Integer> keyDownCodes = new ArrayList<Integer>();
|
private ArrayList<Integer> keyDownCodes = new ArrayList<Integer>();
|
||||||
private ArrayList<Integer> keyUpCodes = new ArrayList<Integer>();
|
private ArrayList<Integer> keyUpCodes = new ArrayList<Integer>();
|
||||||
@@ -361,18 +361,13 @@ public class CordovaWebView extends WebView {
|
|||||||
|
|
||||||
private void exposeJsInterface() {
|
private void exposeJsInterface() {
|
||||||
int SDK_INT = Build.VERSION.SDK_INT;
|
int SDK_INT = Build.VERSION.SDK_INT;
|
||||||
boolean isHoneycomb = (SDK_INT >= Build.VERSION_CODES.HONEYCOMB && SDK_INT <= Build.VERSION_CODES.HONEYCOMB_MR2);
|
if ((SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1)) {
|
||||||
if (isHoneycomb || (SDK_INT < Build.VERSION_CODES.GINGERBREAD)) {
|
|
||||||
Log.i(TAG, "Disabled addJavascriptInterface() bridge since Android version is old.");
|
Log.i(TAG, "Disabled addJavascriptInterface() bridge since Android version is old.");
|
||||||
// Bug being that Java Strings do not get converted to JS strings automatically.
|
// Bug being that Java Strings do not get converted to JS strings automatically.
|
||||||
// This isn't hard to work-around on the JS side, but it's easier to just
|
// This isn't hard to work-around on the JS side, but it's easier to just
|
||||||
// use the prompt bridge instead.
|
// use the prompt bridge instead.
|
||||||
return;
|
return;
|
||||||
} else if (SDK_INT < Build.VERSION_CODES.HONEYCOMB && Build.MANUFACTURER.equals("unknown")) {
|
}
|
||||||
// addJavascriptInterface crashes on the 2.3 emulator.
|
|
||||||
Log.i(TAG, "Disabled addJavascriptInterface() bridge callback due to a bug on the 2.3 emulator");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.addJavascriptInterface(exposedJsApi, "_cordovaNative");
|
this.addJavascriptInterface(exposedJsApi, "_cordovaNative");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -445,17 +440,22 @@ public class CordovaWebView extends WebView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void loadUrlIntoView(final String url) {
|
||||||
|
loadUrlIntoView(url, true);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load the url into the webview.
|
* Load the url into the webview.
|
||||||
*
|
*
|
||||||
* @param url
|
* @param url
|
||||||
*/
|
*/
|
||||||
public void loadUrlIntoView(final String url) {
|
public void loadUrlIntoView(final String url, boolean recreatePlugins) {
|
||||||
LOG.d(TAG, ">>> loadUrl(" + url + ")");
|
LOG.d(TAG, ">>> loadUrl(" + url + ")");
|
||||||
|
|
||||||
this.url = url;
|
if (recreatePlugins) {
|
||||||
this.pluginManager.init();
|
this.url = url;
|
||||||
|
this.pluginManager.init();
|
||||||
|
}
|
||||||
|
|
||||||
// Create a timeout timer for loadUrl
|
// Create a timeout timer for loadUrl
|
||||||
final CordovaWebView me = this;
|
final CordovaWebView me = this;
|
||||||
|
|||||||
Reference in New Issue
Block a user