[
https://issues.apache.org/jira/browse/CB-9132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14583844#comment-14583844
]
ASF GitHub Bot commented on CB-9132:
------------------------------------
Github user agamemnus commented on the pull request:
https://github.com/apache/cordova-plugin-whitelist/pull/6#issuecomment-111581796
``cdvfile://`` is a protocol used in Cordova for accessing saved files:
https://github.com/apache/cordova-plugin-file.
Regarding ``content://``, a little back-story which should help explain.
Google Play has a 50 megabyte apk size upload limit. To go beyond that it uses
an expansion file system which allows up to (I think) 2 gigabytes of extra
storage. The expansion files are typically downloaded to and stored in
``Phone/Android/obb`` as zip files with 0 compression ("STORE"). To access the
files Google recommends using a content provider
(http://developer.android.com/guide/topics/providers/content-providers.html).
(A content provider is used for a few more things, as well...)
I made a comprehensive plugin for using these expansion files here:
https://github.com/agamemnus/cordova-plugin-xapkreader/. It links to and makes
use of 2 Android libraries made by Google called ``play_apk_expansion`` and
``play_licensing``. A number of people wanted to use Cordova 5, but the plugin
doesn't work with 5 because ant support is not supported or broken.
Unfortunately, Gradle support is somewhat broken as well as I describe in
https://issues.apache.org/jira/browse/CB-9132.
Even going past the Gradle issues, the whitelist requirement in Cordova 5
means that by default ``content://`` files (the method used to access files in
the zip file) are not usable. There are two fixes to this -- patching the
whitelist plugin, or adding content:// in the CSP tag.
P.S.: Even with this whitelist plugin patch, I am having issues loading JPG
files (but not other types of files) using the ``content://`` protocol (my
Chrome debugger claims that ``content://`` protocol is unrecognized), but this
may be a Chromium or Crosswalk issue.
> Bad copy using <framework> tag.
> -------------------------------
>
> Key: CB-9132
> URL: https://issues.apache.org/jira/browse/CB-9132
> Project: Apache Cordova
> Issue Type: Bug
> Components: CordovaLib
> Affects Versions: 5.0.0
> Environment: Windows 7, git-scm.
> Reporter: Michael Romanovsky
> Priority: Critical
>
> (I have been reading that Intel has a bug report ready, but I can't wait and
> I don't know if they forgot about it or possibly died.)
> My plugin uses the Google downloader_library and play_licensing_library. The
> project.properties file links to the downloader_library, which itself links
> to the play_licensing library. So here's the deal -- Cordova 5 blew up my
> plugin in some way:
> https://github.com/agamemnus/cordova-plugin-xapkreader/issues/22
> The purported fix suggested by Intel was to use Gradle -- add a
> build-extras.gradle file to one spot, and add two framework tags (for the two
> libraries I am using) to plugin.xml:
> <framework
> src="android-sdk/extras/google/play_apk_expansion/downloader_library"
> custom="false"/>
> <framework src="android-sdk/extras/google/play_licensing/library"
> custom="false" />
> ... then in play_apk_expansion/downloader_library, I have a file like this:
> dependencies {
> debugCompile project(path: '..:..:play_licensing:library',configuration:
> "debug")
> releaseCompile project(path: '..:..:play_licensing:library',configuration:
> "release")
> }
> Okay, cool, but there are two problems, one of which is DEFINITELY a Cordova
> bug:
> 1) Using custom="false" gives me lots of problems. I get errors that say that
> the project isn't a gradle library and none of the linking works. How do I
> fix this? I don't want to use custom="true".
> 2) Using custom="true" doesn't give me those problems, but the files are
> incorrectly copied to my /platforms/android directory.
> They are copied to:
> /platforms/android/com.flyingsoftgames.xapkreader/free-downloader_library
> /platforms/android/com.flyingsoftgames.xapkreader/free-library
> There seem to be two bugs here:
> A) Only the last directory is added. ("downloader_library" and "library").
> B) The last part of my PROJECTNAME is prefixed. This is NON-IDEAL (to put it
> lightly) for a plugin!!! (my project name has spaces, so the code decided to
> use the last word following a space... otherwise it uses the whole project
> name).
> Finally, I'm unable to do relative pathing. I had to do this in
> build-extras.gradle:
> ':com.flyingsoftgames.xapkreader:play_licensing:library'
> ...instead of this:
> '..:..:play_licensing:library'
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]