AndroidDeveloperLB / apk-parser

BSD 2-Clause "Simplified" License
26 stars 11 forks source link

Bug: unable to get app version code for some rare cases #4

Closed AndroidDeveloperLB closed 2 years ago

AndroidDeveloperLB commented 2 years ago

This is what I get from the sample on Vivo V23:

apk version code is different for "com.android.mms.service" on /system/priv-app/MmsService_T1/MmsService_T1.apk : correct one is: 0 vs found: null isSystemApp?true apk version code is different for "com.vivo.entitlement" on /system/app/Entitlement/Entitlement.apk : correct one is: 0 vs found: null isSystemApp?true apk version code is different for "com.vivo.omacp" on /system/priv-app/Omacp/Omacp.apk : correct one is: 0 vs found: null isSystemApp?true apk version code is different for "com.android.systemui" on /system/priv-app/SystemUI/SystemUI.apk : correct one is: 0 vs found: null isSystemApp?true

APKs:

apks.zip

For SystemUI.apk, it became quite large, so I had to split it. Rename "SystemUI.zip" to "SystemUI.zip.001" and "SystemUI2.zip" to "SystemUI.zip.002", and "SystemUI3.zip" to "SystemUI.zip.003" : SystemUI.zip SystemUI2.zip SystemUI3.zip

AndroidDeveloperLB commented 2 years ago

Checking on an online decompiler (here: http://www.javadecompilers.com/ ), I think the "android:versionCode" is just missing, which means it should probably be treated as the default one: 0.

AndroidDeveloperLB commented 2 years ago

Fixed by adding a check for it being null or not, and having a default value for it.