You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by martincgg <gi...@git.apache.org> on 2014/08/22 23:18:52 UTC

[GitHub] cordova-android pull request: [CB-7371 -Android] Fixed: app crash ...

GitHub user martincgg opened a pull request:

    https://github.com/apache/cordova-android/pull/116

    [CB-7371 -Android] Fixed: app crash after phone language change

    
    The main reason of this behavior is the config.xml, origin="" tag, specifies access to all kind of resources on the network and makes the whiteList object on the WhiteList class a null object, indicating that when origin="", there's no whiteList, all is allowed.
    
    When it tries to resume the application it checks:
    if (url.startsWith("file://") || url.startsWith("javascript:") || whitelist.isUrlWhiteListed(url))
    This condition passes and triggers the load for 'about:blank'
    The condition passes because, whitelist.isUrlWhiteListed(url) statement returns true.
    When the origin="*" is processed by the WhiteList class, it sets a null to the whiteList object, which it should contain the access to resources allowed, however when whitelist.isUrlWhiteListed(url) it returns a true if the whiteList object is null, therefore the condition passes and continues to the loadurl method on webClient, stopping the application, because of the 'about:blank' url.
    
    Adding another condition along with that statement for when whiteList = null, but url= about:blank, in that way it won't be able to load the url.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/martincgg/cordova-android CB-7371

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-android/pull/116.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #116
    
----
commit f3e9d46e533d7915876c09c6f95afcea7d842323
Author: Martin Gonzalez <ma...@gmail.com>
Date:   2014-08-22T21:04:25Z

    [CB-7371 -Android] Fixed: app crash after phone language change

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cordova-android pull request: [CB-7371][Android] Fixed: app crash ...

Posted by martincgg <gi...@git.apache.org>.
Github user martincgg closed the pull request at:

    https://github.com/apache/cordova-android/pull/116


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-android pull request: [CB-7371][Android] Fixed: app crash ...

Posted by agrieve <gi...@git.apache.org>.
Github user agrieve commented on a diff in the pull request:

    https://github.com/apache/cordova-android/pull/116#discussion_r18542810
  
    --- Diff: framework/src/org/apache/cordova/CordovaWebView.java ---
    @@ -427,7 +427,7 @@ void loadUrlNow(String url) {
             if (LOG.isLoggable(LOG.DEBUG) && !url.startsWith("javascript:")) {
                 LOG.d(TAG, ">>> loadUrlNow()");
             }
    -        if (url.startsWith("file://") || url.startsWith("javascript:") || whitelist.isUrlWhiteListed(url)) {
    +        if (url.startsWith("file://") || url.startsWith("javascript:") || (whitelist.isUrlWhiteListed(url) && !url.equals("about:blank"))) {
    --- End diff --
    
    I think this needs a comment to explain exactly when about:blank happens. Can this be fixed further up the callstack?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-android pull request: [CB-7371][Android] Fixed: app crash ...

Posted by Cadey <gi...@git.apache.org>.
Github user Cadey commented on the pull request:

    https://github.com/apache/cordova-android/pull/116#issuecomment-98520109
  
    Hi guys, I just grabbed cordova 5.0.0 and the issues of the app crashing is still present - unfortunately im not in a position to put any debugging info at the moment but wanted to let you know its still happening with some configs.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-android pull request: [CB-7371][Android] Fixed: app crash ...

Posted by martincgg <gi...@git.apache.org>.
Github user martincgg commented on a diff in the pull request:

    https://github.com/apache/cordova-android/pull/116#discussion_r18543665
  
    --- Diff: framework/src/org/apache/cordova/CordovaWebView.java ---
    @@ -427,7 +427,7 @@ void loadUrlNow(String url) {
             if (LOG.isLoggable(LOG.DEBUG) && !url.startsWith("javascript:")) {
                 LOG.d(TAG, ">>> loadUrlNow()");
             }
    -        if (url.startsWith("file://") || url.startsWith("javascript:") || whitelist.isUrlWhiteListed(url)) {
    +        if (url.startsWith("file://") || url.startsWith("javascript:") || (whitelist.isUrlWhiteListed(url) && !url.equals("about:blank"))) {
    --- End diff --
    
    Hi Andrew, I closed the JIRA item, but forgot to close this PR, this problem fixed indirectly on master.
    Thanks for the review anyway.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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