NoMore201 / googleplay-api

Google Play Unofficial Python API
Other
412 stars 208 forks source link

Add support for bundled apks #108

Closed kar closed 4 years ago

kar commented 4 years ago

They will be available under 'splits' key in result.

K900 commented 4 years ago

Can confirm this works perfectly for downloading split APKs.

jr3074 commented 4 years ago

waiting for the release

jr3074 commented 4 years ago

Btw, can you share how to get splited apk and how to install it to our devices? @kar

rscmendes commented 4 years ago

Btw, can you share how to get splited apk and how to install it to our devices? @kar

This is what worked for me:

To get the splits you can do something like:

app_data = gplay_server.download(app_id)
with open(app_path, 'wb') as f:
    for chunk in app_data.get('file').get('data'):
        f.write(chunk)
splits = app_data.get('splits')
if splits:
    for split in splits:
        split_path = Path(app_path.parent).joinpath(app_path.stem + '.' + split.get('name') + '.split' + app_path.suffix)
        with open(split_path, 'wb') as f:
            for chunk in split.get('file').get('data'):
            f.write(chunk)

To install an app with splits you would do something like: adb install-multiple app.apk app.split1name.split.apk app.split2name.apk ... Make sure you install all splits along with the main app or you will get an error.