diff --git a/VERSION b/VERSION index 437459cd9..e70b4523a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.5.0 +2.6.0 diff --git a/lib/cordova-android/VERSION b/lib/cordova-android/VERSION index f47de8544..e70b4523a 100644 --- a/lib/cordova-android/VERSION +++ b/lib/cordova-android/VERSION @@ -1 +1 @@ -2.6.0rc1 +2.6.0 diff --git a/lib/cordova-android/bin/templates/cordova/appinfo.jar b/lib/cordova-android/bin/templates/cordova/appinfo.jar index 7f8ac6095..390bb6db3 100644 Binary files a/lib/cordova-android/bin/templates/cordova/appinfo.jar and b/lib/cordova-android/bin/templates/cordova/appinfo.jar differ diff --git a/lib/cordova-android/bin/templates/project/assets/www/index.html b/lib/cordova-android/bin/templates/project/assets/www/index.html index 5596f621f..4d39cf382 100644 --- a/lib/cordova-android/bin/templates/project/assets/www/index.html +++ b/lib/cordova-android/bin/templates/project/assets/www/index.html @@ -19,7 +19,7 @@ --> - + @@ -33,7 +33,7 @@

Apache Cordova

Device is Ready

- + + diff --git a/lib/cordova-android/framework/src/org/apache/cordova/CameraLauncher.java b/lib/cordova-android/framework/src/org/apache/cordova/CameraLauncher.java index 947382868..22a9b948c 100755 --- a/lib/cordova-android/framework/src/org/apache/cordova/CameraLauncher.java +++ b/lib/cordova-android/framework/src/org/apache/cordova/CameraLauncher.java @@ -312,10 +312,12 @@ public void onActivityResult(int requestCode, int resultCode, Intent intent) { // If sending filename back else if (destType == FILE_URI || destType == NATIVE_URI) { - if (!this.saveToPhotoAlbum) { - uri = Uri.fromFile(new File(DirectoryManager.getTempDirectoryPath(this.cordova.getActivity()), System.currentTimeMillis() + ".jpg")); + if (this.saveToPhotoAlbum) { + Uri inputUri = getUriFromMediaStore(); + //Just because we have a media URI doesn't mean we have a real file, we need to make it + uri = Uri.fromFile(new File(FileHelper.getRealPath(inputUri, this.cordova))); } else { - uri = getUriFromMediaStore(); + uri = Uri.fromFile(new File(DirectoryManager.getTempDirectoryPath(this.cordova.getActivity()), System.currentTimeMillis() + ".jpg")); } if (uri == null) { @@ -444,7 +446,7 @@ else if (destType == FILE_URI || destType == NATIVE_URI) { ExifHelper exif = new ExifHelper(); try { if (this.encodingType == JPEG) { - exif.createInFile(resizePath); + exif.createInFile(FileHelper.getRealPath(uri, this.cordova)); exif.readExifData(); rotate = exif.getOrientation(); } @@ -458,7 +460,7 @@ else if (destType == FILE_URI || destType == NATIVE_URI) { // Restore exif data to file if (this.encodingType == JPEG) { - exif.createOutFile(FileHelper.getRealPath(uri, this.cordova)); + exif.createOutFile(resizePath); exif.writeExifData(); } diff --git a/lib/cordova-android/framework/src/org/apache/cordova/Device.java b/lib/cordova-android/framework/src/org/apache/cordova/Device.java index ad399f029..0f828a1b0 100644 --- a/lib/cordova-android/framework/src/org/apache/cordova/Device.java +++ b/lib/cordova-android/framework/src/org/apache/cordova/Device.java @@ -38,7 +38,7 @@ Licensed to the Apache Software Foundation (ASF) under one public class Device extends CordovaPlugin { public static final String TAG = "Device"; - public static String cordovaVersion = "2.6.0rc1"; // Cordova version + public static String cordovaVersion = "2.6.0"; // Cordova version public static String platform = "Android"; // Device OS public static String uuid; // Device UUID diff --git a/lib/cordova-android/framework/src/org/apache/cordova/InAppBrowser.java b/lib/cordova-android/framework/src/org/apache/cordova/InAppBrowser.java index 48e27c604..0d5d4965d 100644 --- a/lib/cordova-android/framework/src/org/apache/cordova/InAppBrowser.java +++ b/lib/cordova-android/framework/src/org/apache/cordova/InAppBrowser.java @@ -151,6 +151,21 @@ else if (action.equals("close")) { pluginResult.setKeepCallback(false); this.callbackContext.sendPluginResult(pluginResult); } + else if (action.equals("injectScriptCode")) { + String source = args.getString(0); + + org.json.JSONArray jsonEsc = new org.json.JSONArray(); + jsonEsc.put(source); + String jsonRepr = jsonEsc.toString(); + String jsonSourceString = jsonRepr.substring(1, jsonRepr.length()-1); + String scriptEnclosure = "(function(d){var c=d.createElement('script');c.type='text/javascript';c.innerText=" + + jsonSourceString + + ";d.getElementsByTagName('head')[0].appendChild(c);})(document)"; + this.inAppWebView.loadUrl("javascript:" + scriptEnclosure); + + PluginResult pluginResult = new PluginResult(PluginResult.Status.OK); + this.callbackContext.sendPluginResult(pluginResult); + } else { status = PluginResult.Status.INVALID_ACTION; } @@ -445,7 +460,7 @@ public void onClick(View v) { //Toggle whether this is enabled or not! Bundle appSettings = cordova.getActivity().getIntent().getExtras(); - boolean enableDatabase = appSettings.getBoolean("InAppBrowserStorageEnabled", true); + boolean enableDatabase = appSettings == null ? true : appSettings.getBoolean("InAppBrowserStorageEnabled", true); if(enableDatabase) { String databasePath = cordova.getActivity().getApplicationContext().getDir("inAppBrowserDB", Context.MODE_PRIVATE).getPath(); diff --git a/lib/cordova-android/framework/src/org/apache/cordova/api/PluginManager.java b/lib/cordova-android/framework/src/org/apache/cordova/api/PluginManager.java index 337ef129f..774b21c3d 100755 --- a/lib/cordova-android/framework/src/org/apache/cordova/api/PluginManager.java +++ b/lib/cordova-android/framework/src/org/apache/cordova/api/PluginManager.java @@ -30,6 +30,7 @@ Licensed to the Apache Software Foundation (ASF) under one import android.content.Intent; import android.content.res.XmlResourceParser; +import android.util.Log; import android.webkit.WebResourceResponse; /** @@ -213,6 +214,7 @@ public void startupPlugins() { public boolean exec(String service, String action, String callbackId, String rawArgs) { CordovaPlugin plugin = this.getPlugin(service); if (plugin == null) { + Log.d(TAG, "exec() call to unknown plugin: " + service); PluginResult cr = new PluginResult(PluginResult.Status.CLASS_NOT_FOUND_EXCEPTION); app.sendPluginResult(cr, callbackId); return true; diff --git a/lib/cordova-android/test/res/xml/cordova.xml b/lib/cordova-android/test/res/xml/cordova.xml deleted file mode 100755 index 4aebda4e8..000000000 --- a/lib/cordova-android/test/res/xml/cordova.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/lib/cordova-android/test/res/xml/plugins.xml b/lib/cordova-android/test/res/xml/plugins.xml deleted file mode 100644 index 17074ef6d..000000000 --- a/lib/cordova-android/test/res/xml/plugins.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/cordova-blackberry/VERSION b/lib/cordova-blackberry/VERSION index 437459cd9..e70b4523a 100644 --- a/lib/cordova-blackberry/VERSION +++ b/lib/cordova-blackberry/VERSION @@ -1 +1 @@ -2.5.0 +2.6.0 diff --git a/lib/cordova-blackberry/bin/templates/project/www/VERSION b/lib/cordova-blackberry/bin/templates/project/www/VERSION index 437459cd9..e70b4523a 100644 --- a/lib/cordova-blackberry/bin/templates/project/www/VERSION +++ b/lib/cordova-blackberry/bin/templates/project/www/VERSION @@ -1 +1 @@ -2.5.0 +2.6.0 diff --git a/lib/cordova-blackberry/bin/templates/project/www/index.html b/lib/cordova-blackberry/bin/templates/project/www/index.html index 6b53abc9e..4d39cf382 100644 --- a/lib/cordova-blackberry/bin/templates/project/www/index.html +++ b/lib/cordova-blackberry/bin/templates/project/www/index.html @@ -33,7 +33,7 @@

Apache Cordova

Device is Ready

- +