You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by na...@apache.org on 2014/11/07 19:58:02 UTC

[1/4] cordova-amazon-fireos git commit: gradle: Allow absolute paths to keystore files

Repository: cordova-amazon-fireos
Updated Branches:
  refs/heads/master 39afa074e -> 95d806703


gradle: Allow absolute paths to keystore files


Project: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/commit/900db964
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/900db964
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/900db964

Branch: refs/heads/master
Commit: 900db964a67ad7715d0aa7eb08891ef1f52da6e0
Parents: 39afa07
Author: Andrew Grieve <ag...@chromium.org>
Authored: Tue Oct 21 12:43:30 2014 -0400
Committer: Ajitha <aj...@amazon.com>
Committed: Wed Oct 29 17:05:00 2014 +0530

----------------------------------------------------------------------
 bin/templates/project/build.gradle | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/900db964/bin/templates/project/build.gradle
----------------------------------------------------------------------
diff --git a/bin/templates/project/build.gradle b/bin/templates/project/build.gradle
index 2e4d5cb..974a19f 100644
--- a/bin/templates/project/build.gradle
+++ b/bin/templates/project/build.gradle
@@ -180,14 +180,21 @@ def ensureValueExists(filePath, props, key) {
 
 def addSigningProps(propsFilePath, signingConfig) {
     def propsFile = file(propsFilePath)
+    def props = new Properties()
     propsFile.withReader { reader ->
-        def props = new Properties()
         props.load(reader)
-        signingConfig.keyAlias = ensureValueExists(propsFilePath, props, 'keyAlias')
-        signingConfig.keyPassword = props.get('keyPassword')
-        signingConfig.storeFile = RelativePath.parse(true, ensureValueExists(propsFilePath, props, 'storeFile')).getFile(propsFile.getParentFile())
-        signingConfig.storePassword = props.get('storePassword')
     }
+    def storeFile = new File(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 = ensureValueExists(propsFilePath, props, 'keyAlias')
+    signingConfig.keyPassword = props.get('keyPassword')
+    signingConfig.storeFile = storeFile
+    signingConfig.storePassword = props.get('storePassword')
 }
 
 if (file('build-extras.gradle').exists()) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[4/4] cordova-amazon-fireos git commit: CB-7758: Allow content-url-hosted pages to access the bridge

Posted by na...@apache.org.
CB-7758: Allow content-url-hosted pages to access the bridge

This allows e.g. jsHybugger to create pages with access to Cordova APIs.
We restrict access to content provider URLs which are at subdomains of the application itself, ie, begin with "content://com.your.package.id."


Project: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/commit/95d80670
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/95d80670
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/95d80670

Branch: refs/heads/master
Commit: 95d8067036686d6d07a4d7793cbc8f9ff8a68fc4
Parents: e99f977
Author: Ian Clelland <ic...@chromium.org>
Authored: Mon Oct 27 15:26:38 2014 -0400
Committer: Ajitha <aj...@amazon.com>
Committed: Wed Oct 29 17:06:16 2014 +0530

----------------------------------------------------------------------
 framework/src/org/apache/cordova/CordovaBridge.java  | 10 +++++++---
 framework/src/org/apache/cordova/CordovaWebView.java |  2 +-
 2 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/95d80670/framework/src/org/apache/cordova/CordovaBridge.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaBridge.java b/framework/src/org/apache/cordova/CordovaBridge.java
index c3f10f3..f3e48b6 100644
--- a/framework/src/org/apache/cordova/CordovaBridge.java
+++ b/framework/src/org/apache/cordova/CordovaBridge.java
@@ -37,12 +37,14 @@ public class CordovaBridge {
     private NativeToJsMessageQueue jsMessageQueue;
     private volatile int expectedBridgeSecret = -1; // written by UI thread, read by JS thread.
     private String loadedUrl;
+    private String appContentUrlPrefix;
 
-    public CordovaBridge(PluginManager pluginManager, NativeToJsMessageQueue jsMessageQueue) {
+    public CordovaBridge(PluginManager pluginManager, NativeToJsMessageQueue jsMessageQueue, String packageName) {
         this.pluginManager = pluginManager;
         this.jsMessageQueue = jsMessageQueue;
+        this.appContentUrlPrefix = "content://" + packageName + ".";
     }
-    
+
     public String jsExec(int bridgeSecret, String service, String action, String callbackId, String arguments) throws JSONException, IllegalAccessException {
         if (!verifySecret("exec()", bridgeSecret)) {
             return null;
@@ -165,7 +167,9 @@ public class CordovaBridge {
             // Protect against random iframes being able to talk through the bridge.
             // Trust only file URLs and the start URL's domain.
             // The extra origin.startsWith("http") is to protect against iframes with data: having "" as origin.
-            if (origin.startsWith("file:") || (origin.startsWith("http") && loadedUrl.startsWith(origin))) {
+            if (origin.startsWith("file:") ||
+                origin.startsWith(this.appContentUrlPrefix) ||
+                (origin.startsWith("http") && loadedUrl.startsWith(origin))) {
                 // Enable the bridge
                 int bridgeMode = Integer.parseInt(defaultValue.substring(9));
                 jsMessageQueue.setBridgeMode(bridgeMode);

http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/95d80670/framework/src/org/apache/cordova/CordovaWebView.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaWebView.java b/framework/src/org/apache/cordova/CordovaWebView.java
index c2749db..57011c7 100755
--- a/framework/src/org/apache/cordova/CordovaWebView.java
+++ b/framework/src/org/apache/cordova/CordovaWebView.java
@@ -217,7 +217,7 @@ public class CordovaWebView extends AmazonWebView {
         super.setWebViewClient(webViewClient);
 
         pluginManager = new PluginManager(this, this.cordova, pluginEntries);
-        bridge = new CordovaBridge(pluginManager, new NativeToJsMessageQueue(this, cordova));
+        bridge = new CordovaBridge(pluginManager, new NativeToJsMessageQueue(this, cordova), this.cordova.getActivity().getPackageName());
         resourceApi = new CordovaResourceApi(this.getContext(), pluginManager);
 
         pluginManager.addService("App", "org.apache.cordova.App");


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[3/4] cordova-amazon-fireos git commit: CB-7726 fix typo in gitignore: ant-built -> ant-build

Posted by na...@apache.org.
CB-7726 fix typo in gitignore: ant-built -> ant-build

github: close #131


Project: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/commit/e99f977f
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/e99f977f
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/e99f977f

Branch: refs/heads/master
Commit: e99f977f68ac75fd42a85384d5ae080b2fcd66d6
Parents: 0367d93
Author: Chris Alfano <ch...@jarv.us>
Authored: Mon Oct 27 11:51:28 2014 -0400
Committer: Ajitha <aj...@amazon.com>
Committed: Wed Oct 29 17:05:57 2014 +0530

----------------------------------------------------------------------
 bin/templates/project/gitignore | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/e99f977f/bin/templates/project/gitignore
----------------------------------------------------------------------
diff --git a/bin/templates/project/gitignore b/bin/templates/project/gitignore
index a1c8ff7..6e52445 100644
--- a/bin/templates/project/gitignore
+++ b/bin/templates/project/gitignore
@@ -5,7 +5,7 @@ local.properties
 /gradlew.bat
 /gradle
 # Ant builds
-ant-built
+ant-build
 ant-gen
 # Eclipse builds
 gen


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[2/4] cordova-amazon-fireos git commit: gradle: Allow storeType to be set (allows using .p12 files)

Posted by na...@apache.org.
gradle: Allow storeType to be set (allows using .p12 files)


Project: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/commit/0367d93b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/0367d93b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/0367d93b

Branch: refs/heads/master
Commit: 0367d93b9df156c137116fa03b3be1051b559aa6
Parents: 900db96
Author: Andrew Grieve <ag...@chromium.org>
Authored: Tue Oct 21 12:59:34 2014 -0400
Committer: Ajitha <aj...@amazon.com>
Committed: Wed Oct 29 17:05:34 2014 +0530

----------------------------------------------------------------------
 bin/templates/project/build.gradle | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/0367d93b/bin/templates/project/build.gradle
----------------------------------------------------------------------
diff --git a/bin/templates/project/build.gradle b/bin/templates/project/build.gradle
index 974a19f..b62a258 100644
--- a/bin/templates/project/build.gradle
+++ b/bin/templates/project/build.gradle
@@ -195,6 +195,16 @@ def addSigningProps(propsFilePath, signingConfig) {
     signingConfig.keyPassword = props.get('keyPassword')
     signingConfig.storeFile = storeFile
     signingConfig.storePassword = props.get('storePassword')
+    def storeType = props.get('storeType')
+    if (!storeType) {
+        def filename = storeFile.getName().toLowerCase();
+        if (filename.endsWith('.p12') || filename.endsWith('.pfx')) {
+            storeType = 'pkcs12'
+        }
+    }
+    if (storeType) {
+        signingConfig.storeType = storeType
+    }
 }
 
 if (file('build-extras.gradle').exists()) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org