diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1594d125..f7dbcaba 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,24 @@ + + # Contributing to Apache Cordova Anyone can contribute to Cordova. And we need your contributions. diff --git a/README.md b/README.md old mode 100755 new mode 100644 diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 09b3d5d6..d8e467b2 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -20,6 +20,40 @@ --> ## Release Notes for Cordova (Android) ## +### 3.5.0 (May 2014) ### + +* OkHttp has broken headers. Updating for ASF compliance. +* Revert accidentally removed lines from NOTICE +* CB-6552: added top level package.json +* CB-6491 add CONTRIBUTING.md +* CB-6543 Fix cordova/run failure when no custom_rules.xml available +* defaults.xml: Add AndroidLaunchMode preference +* Add JavaDoc for CordovaResourceApi +* CB-6388: Handle binary data correctly in LOAD_URL bridge +* Fix 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 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 Apply KitKat content URI fix to all content URIs +* CB-5398 Work-around for KitKat content: URLs not rendering in tags +* CB-5908: add splascreen images to template +* 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 Don't create on CordovaActivity name +* CB-5917 Add a loadUrlIntoView overload that doesn't recreate plugins. +* Use thread pool for load timeout. +* CB-5715 For CLI, hide assets/www and res/xml/config.xml by default +* CB-5793 ant builds: Rename AndroidManifest during -post-build to avoid Eclipse detecting ant-build/ +* CB-5889 Make update script find project name instead of using "null" for CordovaLib +* 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: diff --git a/bin/templates/cordova/defaults.xml b/bin/templates/cordova/defaults.xml index 25a878ba..1654c136 100644 --- a/bin/templates/cordova/defaults.xml +++ b/bin/templates/cordova/defaults.xml @@ -23,7 +23,6 @@ - diff --git a/bin/templates/cordova/lib/run.js b/bin/templates/cordova/lib/run.js index dd679016..da8fc607 100644 --- a/bin/templates/cordova/lib/run.js +++ b/bin/templates/cordova/lib/run.js @@ -125,8 +125,8 @@ var path = require('path'), }); } -module.exports.help = function() { - console.log('Usage: ' + path.relative(process.cwd(), args[0]) + ' [options]'); +module.exports.help = function(args) { + console.log('Usage: ' + path.relative(process.cwd(), args[1]) + ' [options]'); console.log('Build options :'); console.log(' --debug : Builds project in debug mode'); console.log(' --release : Builds project in release mode'); diff --git a/bin/templates/cordova/run b/bin/templates/cordova/run index d4e2c6cb..8c6fe38c 100755 --- a/bin/templates/cordova/run +++ b/bin/templates/cordova/run @@ -26,7 +26,7 @@ var run = require('./lib/run'), // Support basic help commands if (args[2] == '--help' || args[2] == '/?' || args[2] == '-h' || args[2] == 'help' || args[2] == '-help' || args[2] == '/help') { - run.help(); + run.help(args); } else { reqs.run().done(function() { return run.run(args); diff --git a/bin/templates/project/AndroidManifest.xml b/bin/templates/project/AndroidManifest.xml index decb9712..9f1c4e40 100644 --- a/bin/templates/project/AndroidManifest.xml +++ b/bin/templates/project/AndroidManifest.xml @@ -34,10 +34,12 @@ - - + @@ -45,4 +47,4 @@ - + diff --git a/bin/templates/project/res/values/strings.xml b/bin/templates/project/res/values/strings.xml index e8ed749d..bb049db3 100644 --- a/bin/templates/project/res/values/strings.xml +++ b/bin/templates/project/res/values/strings.xml @@ -1,4 +1,9 @@ + __NAME__ + + @string/app_name + + @string/launcher_name diff --git a/framework/src/com/squareup/okhttp/internal/spdy/ErrorCode.java b/framework/src/com/squareup/okhttp/internal/spdy/ErrorCode.java index d3a32e11..9394b69d 100755 --- a/framework/src/com/squareup/okhttp/internal/spdy/ErrorCode.java +++ b/framework/src/com/squareup/okhttp/internal/spdy/ErrorCode.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2012 Square, Inc. + * + * 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. + */ + package com.squareup.okhttp.internal.spdy; public enum ErrorCode { diff --git a/framework/src/com/squareup/okhttp/internal/spdy/Hpack.java b/framework/src/com/squareup/okhttp/internal/spdy/Hpack.java index c3ca8f11..9eaeebd7 100755 --- a/framework/src/com/squareup/okhttp/internal/spdy/Hpack.java +++ b/framework/src/com/squareup/okhttp/internal/spdy/Hpack.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2012 Square, Inc. + * + * 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. + */ + package com.squareup.okhttp.internal.spdy; import java.io.DataInputStream; diff --git a/framework/src/com/squareup/okhttp/internal/spdy/NameValueBlockReader.java b/framework/src/com/squareup/okhttp/internal/spdy/NameValueBlockReader.java index b95d0138..b731a6d3 100755 --- a/framework/src/com/squareup/okhttp/internal/spdy/NameValueBlockReader.java +++ b/framework/src/com/squareup/okhttp/internal/spdy/NameValueBlockReader.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2012 Square, Inc. + * + * 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. + */ + package com.squareup.okhttp.internal.spdy; import com.squareup.okhttp.internal.Util; diff --git a/framework/src/org/apache/cordova/CordovaResourceApi.java b/framework/src/org/apache/cordova/CordovaResourceApi.java index ff2c5c51..c31e222c 100644 --- a/framework/src/org/apache/cordova/CordovaResourceApi.java +++ b/framework/src/org/apache/cordova/CordovaResourceApi.java @@ -106,6 +106,7 @@ public class CordovaResourceApi { return threadCheckingEnabled; } + public static int getUriType(Uri uri) { assertNonRelative(uri); String scheme = uri.getScheme(); @@ -199,6 +200,8 @@ public class CordovaResourceApi { return null; } + + //This already exists private String getMimeTypeFromPath(String path) { String extension = path; int lastDot = extension.lastIndexOf('.'); @@ -217,7 +220,7 @@ public class CordovaResourceApi { } /** - * Opens a stream to the givne URI, also providing the MIME type & length. + * Opens a stream to the given URI, also providing the MIME type & length. * @return Never returns null. * @throws Throws an InvalidArgumentException for relative URIs. Relative URIs should be * resolved before being passed into this function. @@ -229,7 +232,7 @@ public class CordovaResourceApi { } /** - * Opens a stream to the givne URI, also providing the MIME type & length. + * Opens a stream to the given URI, also providing the MIME type & length. * @return Never returns null. * @throws Throws an InvalidArgumentException for relative URIs. Relative URIs should be * resolved before being passed into this function. diff --git a/framework/src/org/apache/cordova/CordovaWebView.java b/framework/src/org/apache/cordova/CordovaWebView.java index 9ff1e5a8..6f3240a5 100644 --- a/framework/src/org/apache/cordova/CordovaWebView.java +++ b/framework/src/org/apache/cordova/CordovaWebView.java @@ -72,6 +72,30 @@ public interface CordovaWebView { void addJavascript(String statement); + /** + * Send JavaScript statement back to JavaScript. + * (This is a convenience method) + * + * @param statement + * Deprecated (https://issues.apache.org/jira/browse/CB-6851) + * Instead of executing snippets of JS, you should use the exec bridge + * to create a Java->JS communication channel. + * To do this: + * 1. Within plugin.xml (to have your JS run before deviceready): + * + * 2. Within your .js (call exec on start-up): + * require('cordova/channel').onCordovaReady.subscribe(function() { + * require('cordova/exec')(win, null, 'Plugin', 'method', []); + * function win(message) { + * ... process message from java here ... + * } + * }); + * 3. Within your .java: + * PluginResult dataResult = new PluginResult(PluginResult.Status.OK, CODE); + * dataResult.setKeepCallback(true); + * savedCallbackContext.sendPluginResult(dataResult); + */ + @Deprecated void sendJavascript(String statememt); CordovaChromeClient getWebChromeClient(); diff --git a/test/assets/www/cordova_plugins.js b/test/assets/www/cordova_plugins.js index fbe1f445..ecad9f6d 100644 --- a/test/assets/www/cordova_plugins.js +++ b/test/assets/www/cordova_plugins.js @@ -1,3 +1,22 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT 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.define('cordova/plugin_list', function(require, exports, module) { -module.exports = [] -}); \ No newline at end of file + module.exports = []; +}); diff --git a/test/res/xml/config.xml b/test/res/xml/config.xml index d4fd635c..76172cbf 100644 --- a/test/res/xml/config.xml +++ b/test/res/xml/config.xml @@ -1,4 +1,22 @@ + Hello Cordova