Is it possible to achieve locally (using adb
or other ways) what Google Play is doing in "Smart app updates" ?
What I want to do is to create a binary diff on the PC (using some command line tools) and then deploy the diff to simulator/device using Android tools (adb, shell, etc).
I am aware of
https://android.stackexchange.com/questions/36421/what-is-the-applypatch-tool-and-how-does-one-use-it
which doesn't provide any info about HOW to actually create and apply patches, just WHAT adb shell applypatch
is.
I tried to take a quick look at the C++ Android implementation code here which does the patching: https://android.googlesource.com/platform/bootable/recovery/+/master/applypatch/main.cpp#167
So far I created a binary diff using bsdiff, which apparently uses same algorithm with what Google Play and Android is using. But I don't know how to actually apply the patch.
EDIT: To clarify, here's a good example:
- I have
com.appv1.apk
on my PC and also installed on the device/emulator. - I have
com.appv2.apk
on my PC. - Using
bsdiff
I create the binary diff betweencom.appv1.apk
andcom.appv2.apk
called let's saydiff.bin
Now, what is the actual adb
command I need to run to deploy diff.bin
on the device/emulator such that after deploying the diff, com.appv1.apk
on the device/emulator becomes com.appv2.apk
?
applypatch/main.cpp
already. besides the usage print out code it contains a more detailed description of all optional parameters in the comments. what is your exact problem? – Seiberadb
or some other way on the PC. it's not about worrying about it. what are "DEX files" ? – Ternicom.appv1.apk
andcom.appv2.apk
– Terni