Open agamemnus opened 10 years ago
It sounds interesting. I will take a look on your fork when I would have the time. It will probably inspire me to improve my own plugin. :)
Well, it's not a fork... I forgot to add the link. Adding it to the first post now.
I made some more changes. All you have to do now is to add the public key and change the content provider in the AndroidManifest.xml file and in the xapkreader.xml file. (or in plugins/android.json)
Hi moust, psyon. I took some of your base code concepts and made a new plugin.
https://github.com/agamemnus/cordova-plugin-xapkreader
It's almost entirely automated. You just need to modify the XML data and the provider's android:authorities string (in android.json, if rebuilding), and that's it. There's no need to modify any of the java files.
It just uses the content provider URI, no functions.
One big technical problem I had to overcome is getting the version (and other) data into the file reader before it was read. As you probably know, the file reader is run by the content provider before the
XAPKReader
has a chance to do anything. To solve that, I overrodeopenAssetFile
inXAPKProvider
to throw aFileNotFoundException
if the version data wasn't sent over theXAPKProvider
yet. When theXAPKReader
runs, it populates that data and then runsopenAssetFile
via the webView'sopenForRead
.You'll find a number of other improvements: