Coder Social home page Coder Social logo

Comments (8)

kolbasa avatar kolbasa commented on July 27, 2024 1

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.

kolbasa avatar kolbasa commented on July 27, 2024

Thanks for the suggestion. I will check if this is possible. So far I have no experience with XAPK.

from cordova-plugin-apkupdater.

noriellecruz avatar noriellecruz commented on July 27, 2024

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.

kolbasa avatar kolbasa commented on July 27, 2024

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.

noriellecruz avatar noriellecruz commented on July 27, 2024

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.

noriellecruz avatar noriellecruz commented on July 27, 2024

Great! If you need more information, just ask me, I'll do the research.

from cordova-plugin-apkupdater.

kolbasa avatar kolbasa commented on July 27, 2024

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 + "%");
        }
    }
);

Download

Now I have to test it properly and include the changes in the documentation. This will take some time again :)

from cordova-plugin-apkupdater.

kolbasa avatar kolbasa commented on July 27, 2024

XAPK support is now in the 3.0.0 plugin version.

from cordova-plugin-apkupdater.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.