Bug in APK Expansion Zip Library for Android, patch not working

static String[] getAPKExpansionFiles(Context ctx, int mainVersion, int patchVersion) {
String packageName = ctx.getPackageName();
Vector < String > ret = new Vector < String > ();
if (Environment.getExternalStorageState().equals(
Environment.MEDIA_MOUNTED)) {
// Build the full path to the app's expansion files
File root = Environment.getExternalStorageDirectory();
String path = Build.VERSION.SDK_INT >= 23 ? EXP_PATH_API_23 : EXP_PATH;
File expPath = new File(root.toString() + path + packageName);

So if you looks at line where constructed strPatchPath you will see that instead of patchVersion it uses mainVersion. So if you are using this library, dont forget to change it to patchVersion.

Don’t forget to checkout my new Android App for removing stress: http://goo.gl/Iz8r5u

--

--

Machine Learning and Computer Vision Researcher. Founder LearnML.Today

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Andrey Nikishaev

Andrey Nikishaev

Machine Learning and Computer Vision Researcher. Founder LearnML.Today