yeriomin / YalpStore

Download apks from Google Play Store
GNU General Public License v2.0
2.39k stars 259 forks source link

Delta apk's on update? #200

Closed haroon-ali closed 7 years ago

haroon-ali commented 7 years ago

Hi, I noticed recently that Google Play doesn't send "full apk" on the update. But it sends a "delta" apk. Actually it's very useful for updating large packages. I could update ~ 100MB with 18MB download.

Could you please investigate this and implement it on yalp store?

akoyaxd commented 7 years ago

I'm no dev, but I'm really sure, that this won't be possible, without proprietary Google stuff. But would be a nice to have, if possible anyway.

yeriomin commented 7 years ago

That would be interesting to implement, but I haven't found a way to do it yet.

It is possible to download the deltas, but they cannot be directly installed by the android package manager. They are applied to the original apk existing in the system, and then the patched apk is used to install the update. The patching process is done in the Play Store app, which is not open source.

The only public article by Google about deltas' usage in Play Store I've found is this. It mentions the bsdiff algorithm, which has sources available, but its implementation does not consider downloaded deltas as valid patches. Neither does xdelta. Judging by size of the deltas I've seen, some kind of xdelta is used.

I'd appreciate some input. Any information about the specific algorithm used in Play Store is welcome.

haroon-ali commented 7 years ago

Some reverse engineering on Play store won't help?

nagayev commented 7 years ago

@haroon-ali interesting commit: https://github.com/yeriomin/play-store-api/commit/02cafaa2fb9c3760372cec8262dfb435b4f3fd0e

yeriomin commented 7 years ago

@haroon-ali Yes, it will help. It can help with anything. But you don't see denuvo-protected games cracked on the first day, do you? I'm not saying Play Store is as well protected as a denuvo game (its only obfuscated), but it will still take time. Also, reverse-engineering is a very general term.

yeriomin commented 7 years ago

@marat1995 Yep, like I said, they can be downloaded, but I don't know how to apply them yet.

yeriomin commented 7 years ago

Found a paper on the subject.

Delta Encoding Based Methods to Reduce the Size.pdf

yeriomin commented 7 years ago

First two patch formats are gdiff and gzipped gdiff.

Don't know the third one yet, but it shouldn't be a problem. Gzipped gdiff is usually not a lot bigger than patch format 3.

yeriomin commented 6 years ago

Patch format 3 is BSDiff.