Comments (8)
Brief Update. I have now tested the feasibility with a simple prototype.
Looks good. I can already install simple XAPK apps including the OBB data. For the app-data, the permission for external storage is requested during the installation.
It will take me some more time to clean up the code. I'll keep you updated.
from cordova-plugin-apkupdater.
Thanks for the suggestion. I will check if this is possible. So far I have no experience with XAPK.
from cordova-plugin-apkupdater.
Hi, thank you for the response. I did check the contents of an xapk file, it seems to be a zip file with xapk extension.
This is the directory structure of contents inside the sample xapk file for com.tencent.ig:
Android/obb/com.tencent.ig/main.15527.com.tencent.ig.obb
com.tencent.ig.apk
icon.png
manifest.json
It's like following the same concept of your https://github.com/kolbasa/apk-update but with a different structure and extension, renaming the .xapk file extension to .zip makes it compatible for decompression using zip tools.
I think google play is using this to install apps with large OBB/Data files.
You can also download the sample zip file here, I removed the contents of .apk and .obb files so the sample zip will be smaller: https://dropmb.com/UBrP4
I already tried implementing this feature by modifying your plugin but the code became really messed up since I don't have professional experience with java.
from cordova-plugin-apkupdater.
I've taken a look at it now. Here are two examples I looked at:
https://gist.github.com/kolbasa/f1ca877247d655a3b3eab55e62280891
https://gist.github.com/kolbasa/ae4bfab90f099a9890472f0f9a593eb1
I can manage that. There is only one more step: copy the OBB data to the appropriate place.
The only thing that irritates me a bit. I can't find any official documentation about the format of the manifest.json
.
For example, there is the property xapk_version
. Are there other versions? And where are they documented?
from cordova-plugin-apkupdater.
You're right, I also didn't find any official documentation.
XAPK seems to be private for google play use only but I did find a site that explains what is xapk_version: https://openxapkfile.net/manifest.html
In that site, the example manifest format is using 1 and it's different from the xapk_version: 2 that we have in our examples, it seems that it is used to identify the format of the manifest file and based on latest xapk file I downloaded from google play, the latest version of xapk manifest format is 2.
from cordova-plugin-apkupdater.
Great! If you need more information, just ask me, I'll do the research.
from cordova-plugin-apkupdater.
Unfortunately, it always takes quite a bit of time to get a feature ready. It's just a small open source project.
On this branch you can see the progress:
cordova plugin add https://github.com/kolbasa/cordova-plugin-apkupdater#xapk-support
To install OBB data, you now also need the write permission for external storage.
It looks like this:
await ApkUpdater.openInstallSetting(); // true,false (the plugin is now waiting for confirmation here)
await ApkUpdater.requestExternalStorageAuthorization(); // true,false
After both permissions have been granted, the app will restart itself.
Now you can install .xapk
files:
For my tests I use this game, but should also work with much larger installation files.
await ApkUpdater.download(
'http://10.0.2.2:3101/update/update.xapk',
{
onDownloadProgress: function(e) {
console.log("Downloading: " + e.progress + "%");
}
}
);
await ApkUpdater.install(
{
onUnzipProgress: function(e) {
console.log("Extracting: " + e.progress + "%");
}
}
);
Now I have to test it properly and include the changes in the documentation. This will take some time again :)
from cordova-plugin-apkupdater.
XAPK support is now in the 3.0.0 plugin version.
from cordova-plugin-apkupdater.
Related Issues (20)
- failed to parse package HOT 6
- Kiosk Mode + plugin apkUpdater V2.0.2 HOT 9
- Getting error after downloading apk - Download directory is empty HOT 5
- isDeviceRooted not working correctly HOT 5
- Cannot update versioning HOT 4
- Authorization headers always sent HOT 3
- Issue with Progress percentage ,it is always returns 0 HOT 2
- Set device owner for Android TV HOT 3
- support for ionic 5 HOT 1
- is it possible to update an application without user intervention/without using root? HOT 38
- Downloading fails with "No valid update found in download directory" HOT 2
- Cannot read properties of undefined (reading 'getInstalledVersion') HOT 7
- Plugin not working with ionic's capacitor HOT 6
- Got an "Invalid page file" error with capacitor project HOT 4
- Couldn't find meta-data for provider with authority org.app.app.apkupdater.provider HOT 12
- Great, thank you for your work. I solved it
- Cordova error HOT 3
- Trust anchor for certification path not found HOT 4
- Allow custom headers or at least Bearer authentication HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-plugin-apkupdater.