Application consists of Simple Activity with 2 fields.
The Overflow Menu has option to check for Update.
Check For Update - The API call which checks for newer version of app. Input - current verison of app Output - Information about new version of same app if available.
If newer version of app is available patch file (.bin) is downloaded to Downloads directory.
bsdiff generates the delta file or patch file for the given old file and new file, the generated file then later can be used to update old binaries to new one.
bspatch is to patch the old files using the patch/delta file generated by bsdiff.
So, bspatch is present in client side (Android App).
bspatch takes 3 inputs.
- Patch file which was downloaded.
- Old APK file path.
- New APK file path.
bspatch builds new APK from old APK and patch file and writes to new APK.
Once new APK is build Application starts packager manager which installs new APK.
You can find the server code here -> Genesis Server
Well, If the app is not managed by playstore all updates for the app should be maintained seperately. So, for every new version downloaded and installing completely new APK consumes lot of bandwitch and time. So using this bsdiff/bspatch algorithm only patch file (delta) is downloaded and patched at client side.