Have the option to copy www content to a R/W dir and use R/W dir instead for root
Closed this issue · 2 comments
Feature Request
Motivation Behind Feature
The motivation behind this , is to be able to have the root writable so updating the app www from itself is possible.
It allows dev to make smaller modifications without the hassle of submitting the app for review again.
Also great if you have "live" bugs.
Feature Description
- package app as usual
- have a flag in config.xml
- on first run, if flag is found and the content hasn't been copied yet , create/copy www to a R/W folder
- set new root of webview to the new folder
Then from the app, one can check for a new version on his remote server and download/update the R/W folder.
Might be more gracious as a plugin but I don't think it can be done yet.
Alternatives or Workarounds
Workaround for us right now is storing downloaded content in localStorage but is limited to HTML
Not only this is potentially a huge security risk having executable code in a writable area.
It's also against app store terms of service breaking section 2.5.2 on iOS and Google's Device and Network Abuse policy.
iOS:
Apps should be self-contained in their bundles, and may not read or write data outside the designated container area, nor may they download, install, or execute code which introduces or changes features or functionality of the app, including other apps.
Android/Google Play Store:
An app distributed via Google Play may not modify, replace, or update itself using any method other than Google Play's update mechanism.
Generally speaking, if you're bypassing the review process, then the terms of service are being broken and Apache Cordova can't facilitate a feature which encourages that behavior.
In-app updates is mostly restricted to non-executable code updates such as data files.
For other platforms (e.g. Electron) it might be possible but someone more knowledgeable will need to chip in. I'd still really be concern of having application code writable (defeats code signing features for example).
I know easily updating webview assets is desirable for development, in which case the cordova serve
should be sufficient. it provides a webserver hosting the platform specific JS files as well as your web assets and your <content src>
config can be set accordingly to the platform's index.html that you're working on.
Thanks for your reply @breautek
One can only dream iOS review process be fast and fair. I will close this.