cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-7371) [Android] App crashes after phone language change
Date Fri, 22 Aug 2014 21:20:11 GMT

    [ https://issues.apache.org/jira/browse/CB-7371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14107503#comment-14107503
] 

ASF GitHub Bot commented on CB-7371:
------------------------------------

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 <martin.c.glez.glez@gmail.com>
Date:   2014-08-22T21:04:25Z

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

----


> [Android] App crashes after phone language change
> -------------------------------------------------
>
>                 Key: CB-7371
>                 URL: https://issues.apache.org/jira/browse/CB-7371
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 3.5.0
>         Environment: 4.2.2 (Jelly-Bean)
> 4.4.2 (KitKat)
>            Reporter: Martin Gonzalez
>            Assignee: Martin Gonzalez
>              Labels: android, crash
>             Fix For: 3.6.0
>
>
> After switching device language on android, the app will fails to reload scenario:
> 1. Create new app 
> 2. open it and exit with the home button
> 3.Switch device language to or any other
> 4. Resume the app
> Expected result :
> the app should run
> Actual result:
> app crashes on first load
> Log:
> 07-28 16:24:10.018: D/CordovaActivity(25402): CordovaActivity.onDestroy()
> 07-28 16:24:10.028: D/CordovaWebView(25402): >>> loadUrlNow()
> 07-28 16:24:10.038: I/CordovaLog(25402): Changing log level to DEBUG(3)
> 07-28 16:24:10.038: I/CordovaLog(25402): Found start page location: cdvtests/index.html
> 07-28 16:24:10.038: D/CordovaActivity(25402): CordovaActivity.onCreate()
> 07-28 16:24:10.048: D/CordovaActivity(25402): CordovaActivity.init()
> 07-28 16:24:10.058: D/CordovaWebView(25402): >>> loadUrl(file:///android_asset/www/cdvtests/index.html)
> 07-28 16:24:10.068: D/CordovaWebView(25402): >>> loadUrlNow()
> 07-28 16:24:10.068: I/CordovaLog(25402): Found start page location: cdvtests/index.html
> 07-28 16:24:10.068: D/CordovaActivity(25402): Resuming the App
> 07-28 16:24:10.068: D/CordovaActivity(25402): CB-3064: The errorUrl is null
> 07-28 16:24:10.078: D/CordovaWebViewClient(25402): onPageStarted(about:blank)
> 07-28 16:24:10.078: D/CordovaActivity(25402): onMessage(onPageStarted,about:blank)
> 07-28 16:24:10.078: D/CordovaWebViewClient(25402): onPageFinished(about:blank)
> 07-28 16:24:10.078: D/CordovaActivity(25402): onMessage(onPageFinished,about:blank)
> 07-28 16:24:10.078: D/CordovaActivity(25402): onMessage(exit,null)
> 07-28 16:24:10.088: D/CordovaWebViewClient(25402): onPageStarted(file:///android_asset/www/cdvtests/index.html)
> 07-28 16:24:10.088: D/CordovaActivity(25402): onMessage(onPageStarted,file:///android_asset/www/cdvtests/index.html)
> 07-28 16:24:10.108: D/CordovaActivity(25402): Paused the application!
> 07-28 16:24:10.108: D/CordovaWebView(25402): Handle the pause
> 07-28 16:24:10.148: D/CordovaActivity(25402): CordovaActivity.onDestroy()
> 07-28 16:24:10.148: D/CordovaWebView(25402): >>> loadUrlNow()
> 07-28 16:24:10.158: D/CordovaWebViewClient(25402): onPageFinished(file:///android_asset/www/cdvtests/index.html)
> 07-28 16:24:10.158: D/CordovaActivity(25402): onMessage(onPageFinished,file:///android_asset/www/cdvtests/index.html)
> 07-28 16:24:10.168: D/CordovaWebViewClient(25402): onPageStarted(about:blank)
> 07-28 16:24:10.168: D/CordovaActivity(25402): onMessage(onPageStarted,about:blank)
> 07-28 16:24:10.188: D/CordovaWebViewClient(25402): onPageFinished(about:blank)
> 07-28 16:24:10.188: D/CordovaActivity(25402): onMessage(onPageFinished,about:blank)
> 07-28 16:24:10.188: D/CordovaActivity(25402): onMessage(exit,null)
> 07-28 16:24:12.168: D/CordovaActivity(25402): onMessage(spinner,stop)
> 07-28 16:24:12.188: D/CordovaActivity(25402): onMessage(spinner,stop)



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message