You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/05/06 06:17:01 UTC

[GitHub] [cordova-docs] NiklasMerz opened a new pull request #1172: doc(android): document `AndroidInsecureFileModeEnabled`

NiklasMerz opened a new pull request #1172:
URL: https://github.com/apache/cordova-docs/pull/1172


   <!--
   Please make sure the checklist boxes are all checked before submitting the PR. The checklist is intended as a quick reference, for complete details please see our Contributor Guidelines:
   
   http://cordova.apache.org/contribute/contribute_guidelines.html
   
   Thanks!
   -->
   
   ### Platforms affected
   Android
   
   
   ### Motivation and Context
   <!-- Why is this change required? What problem does it solve? -->
   <!-- If it fixes an open issue, please link to the issue here. -->
   
   Document https://github.com/apache/cordova-android/pull/1222
   
   ### Description
   <!-- Describe your changes in detail -->
   
   Document setting and add warning from https://developer.android.com/reference/android/webkit/WebSettings#setAllowUniversalAccessFromFileURLs(boolean)
   
   ### Testing
   <!-- Please describe in detail how you tested your changes. -->
   
   
   
   ### Checklist
   
   - [ ] I've run the tests to see all new and existing tests pass
   - [ ] I added automated test coverage as appropriate for this change
   - [ ] Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`)
   - [ ] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
   - [ ] I've updated the documentation if necessary
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [cordova-docs] jcesarmobile commented on pull request #1172: doc(android): document `AndroidInsecureFileModeEnabled`

Posted by GitBox <gi...@apache.org>.
jcesarmobile commented on pull request #1172:
URL: https://github.com/apache/cordova-docs/pull/1172#issuecomment-833381794


   I've fixed the merge conflicts after merging my PR that removed the AndroidX preference.
   I edited right before you commented, so you probably didn't see, can you add the preference to the examples section too?
   
   If you don't want to go into detail about the data loss in this PR it's ok, but it should still be about **loading** from file instead of **accessing** file urls, because it's not the same thing.
   If you load from file url, you obviously need to access file urls, but you might still want to load from https and access file urls (i.e. take a picture from the camera and assign it to a img tag) and can wrongly enable this preference to do so.
   
   BTW, that example made me think, do we have some helper like on iOS to convert file urls like the one you get from camera to https urls? would the assets loader be able to load those urls somehow?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [cordova-docs] NiklasMerz commented on pull request #1172: doc(android): document `AndroidInsecureFileModeEnabled`

Posted by GitBox <gi...@apache.org>.
NiklasMerz commented on pull request #1172:
URL: https://github.com/apache/cordova-docs/pull/1172#issuecomment-833416829


   > I've fixed the merge conflicts after merging my PR that removed the AndroidX preference.
   > I edited right before you commented, so you probably didn't see, can you add the preference to the examples section too?
   
   Done
   
   > If you don't want to go into detail about the data loss in this PR it's ok, but it should still be about **loading** from file instead of **accessing** file urls, because it's not the same thing.
   
   I changed the wording and found the right page to describe that. Maybe others can jump in and help to improve it.
    
   > If you load from file url, you obviously need to access file urls, but you might still want to load from https and access file urls (i.e. take a picture from the camera and assign it to a img tag) and can wrongly enable this preference to do so.
   > 
   > BTW, that example made me think, do we have some helper like on iOS to convert file urls like the one you get from camera to https urls? would the assets loader be able to load those urls somehow?
   
   TBH I don't really what happens with camera and other files. Maybe it still works? I need to test it out.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [cordova-docs] erisu merged pull request #1172: doc(android): document `AndroidInsecureFileModeEnabled`

Posted by GitBox <gi...@apache.org>.
erisu merged pull request #1172:
URL: https://github.com/apache/cordova-docs/pull/1172


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [cordova-docs] NiklasMerz commented on pull request #1172: doc(android): document `AndroidInsecureFileModeEnabled`

Posted by GitBox <gi...@apache.org>.
NiklasMerz commented on pull request #1172:
URL: https://github.com/apache/cordova-docs/pull/1172#issuecomment-833300777


   I am not sure if this description of all config.xml preferences is the right place for that. 
   
   Maybe [here](https://cordova.apache.org/docs/en/10.x/guide/platforms/android/index.html) on the general Android page? Of course we need it in the announce post.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [cordova-docs] NiklasMerz commented on a change in pull request #1172: doc(android): document `AndroidInsecureFileModeEnabled`

Posted by GitBox <gi...@apache.org>.
NiklasMerz commented on a change in pull request #1172:
URL: https://github.com/apache/cordova-docs/pull/1172#discussion_r627296953



##########
File path: www/docs/en/dev/guide/platforms/android/upgrade.md
##########
@@ -27,6 +27,30 @@ Most of these instructions apply to projects created with an older set
 of command-line tools that precede the `cordova` CLI utility. See [The Command-Line Interface](../../cli/index.html) for information how to update the
 version of the CLI.
 
+## Upgrading to 10.x.x
+
+The best way to upgrade to 10.X.X is to simply remove the Android platform from
+your project and re-add it with the new version. For example,
+
+```bash
+cordova platform remove android
+cordova platform add android@10.X.X
+```
+
+If you use the above method, be aware that any changes you made to the android
+platform folder will be lost (editing the contents of this folder is
+discouraged).
+
+### Breaking changes
+
+Version 10.0.0 introduces a signinificant change how URLs are loaded within the app.
+Prior versions load the apps web files like `index.html` via the file protocol.
+Which means the app starts with the URL `file:///android_asset/www/index.html`. Loading `file:///` URLs is considered insecure
+and [Android has deprecated support](https://developer.android.com/reference/android/webkit/WebSettings#setAllowUniversalAccessFromFileURLs(boolean)).
+Cordova Android 10.0.0 now uses an Android API called `WebViewAssetLoader` to load web content via the HTTP(S) scheme (`https://localhost`) by default.
+Therefore the app now starts with the URL `https://localhost/` instead of `file:///android_asset/www/index.html`. Because this is a new origin you might encouter data loss and you need to migrate your web data (Localstorage, IndexedDB etc).

Review comment:
       We could add more information around migration and data loss once we have a good suggestion?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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