You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 overrode openAssetFile in XAPKProvider to throw a FileNotFoundException if the version data wasn't sent over the XAPKProvider yet. When the XAPKReader runs, it populates that data and then runs openAssetFile via the webView's openForRead.
You'll find a number of other improvements:
It should accept separate main and patch file versions now. (not tested)
It should allow you to ignore the file size checks with some boolean switches.
The public key data and the text data are all loaded in programmatically from the xml file. No need for .R file linkage.
I included the needed Android SDK libraries, already compiled.
The text was updated successfully, but these errors were encountered:
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)
Since there are ever only two possible files, it will just get a directory listing and do some simple pattern matching -- no version specification needed.
The patch file now properly works -- it will have precedence any file in the main file. You do have to recompile/update the apk in order for changes to take effect, since the plugin only runs at that point. I had to modify a number of Android SDK library files for this to the point of where adding modified versions to the library made more sense.
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:
The text was updated successfully, but these errors were encountered: