-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Unable to fetch app-names (labels) of some apps properly #3
Comments
Another example, originated from Vivo V23: apk label is different for "com.mediatek.ims" on /system/priv-app/ImsService/ImsService.apk : correct one is: "com.mediatek.ims.ImsApp" vs found: "com.mediatek.ims" isSystemApp?true |
Another example, from Samsung Galaxy A32: apk label is different for "com.android.stk" on /system/app/Stk/Stk.apk : correct one is: "SIM Toolkit" vs found: "SIM toolkit" isSystemApp?true APKs: |
More examples, this time including apps that are not built-in: apk label is different for "com.unicell.pangoandroid" on /data/app/~~1tUbh_pu1ADTMAVluBDmOg==/com.unicell.pangoandroid-uvBuwCw2W_yUsg5wwe9D1Q==/base.apk : correct one is: "Pango" vs found: "פנגו" isSystemApp?false Attached for some: |
I ran into a related issue where the original apk-parser could no longer consume apk files from an A15 aosp build. I was able to fork/patch the library: msdhedhi/apk-parser@6104ca5 |
@msdhedhi Interesting. Very appreciate it that you've contacted me here and offer this. |
I tried the apks in "labels.zip". The manifest for OemRilService.apk does not have a "android:label" attribute so the label is being returned as null. |
Those libraries are quite common on Android, and Kotlin is becoming more and more popular. Besides, creating a release version using Proguard, a lot would be removed anyway if not used. I had created the sample to have some tests on the current device, too, to check for weird issues. Such a thing helps to find possible issues on the repository in parsing APKs, from actual scenarios. Is it the only thing you've fixed? |
@msdhedhi I tried to add your changes to mine (was hard but I think I got it). Still got 36 errors of label fetching. About "GoogleExtShared.apk", seems it's not installed anymore on my device, but it's installed on Android emulator, and indeed it got "Android Shared Library" as label, so you made the detection better indeed. About "PlayAutoInstallConfig.apk", sadly the app isn't installed anymore and I can't install it on my device, but I can on the emulator. I wanted now to compare before&after , on my device and on emulator. Device (Pixel 6, Android 15): Emulator (API 34 - Android 14): So again an improvement in label detection. http://www.javadecompilers.com/apk OnDevicePersonalizationGoogle.zip Please test on a real device against all APK files of the OS. This way you could find issues as I've found. |
Some fixes to fetch app label. Some based on: msdhedhi/apk-parser@6104ca5 #3 (comment) https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-15.0.0_r5/libs/androidfw/include/androidfw/ResourceTypes.h https://android.googlesource.com/platform/frameworks/base/+/a1f2bce0e56185d8a3ddbbb75cf9daacdcb5a3d2%5E%21/libs/androidfw/include/androidfw/ResourceTypes.h
@msdhedhi Here are many more APK files that got the app label wrong. Sometimes it's just by a single letter for some reason (upper-case vs lower-case) : Another one is a bit big, so here is a link to it: |
@AndroidDeveloperLB I am attaching the app manifest for OnDevicePersonalizationGoogle.apk. It has no label |
@msdhedhi Yes, for OnDevicePersonalizationGoogle, I've updated my repository to handle this, so that it will fetch the packageName&app-class in this case. However, as I wrote, there are still many weird cases it doesn't return the same names. Sometimes by just a single letter change for some reason. You should consider using Android stuff. It offers many more features this way. Also this way we can test better, as it was quite hard for me to patch my code based on your changes, manually... |
Running the sample, I've found this app that it failed to get its app-name (label) properly :
apk label is different for "com.google.android.networkstack.permissionconfig" on /system/priv-app/NetworkPermissionConfigGoogle/NetworkPermissionConfigGoogle.apk : correct one is: "com.android.server.NetworkPermissionConfig" vs found: "com.google.android.networkstack.permissionconfig"isSystemApp?true
This might be related:
hsiafan/apk-parser#123
hsiafan/apk-parser#99
Attached the problematic APK:
NetworkPermissionConfigGoogle.zip
EDIT: another case:
apk label is different for "com.google.android.gms" on /product/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk : correct one is: "Google Play services" vs found: "resourceId:0x7f1a0033"
It became quite large, so I had to split it. Rename "PrebuiltGmsCore.zip" to "PrebuiltGmsCore.zip.001" and "PrebuiltGmsCore2.zip" to "PrebuiltGmsCore.zip.002" , and "PrebuiltGmsCore3.zip" to "PrebuiltGmsCore.zip.003"
PrebuiltGmsCore.zip
PrebuiltGmsCore2.zip
PrebuiltGmsCore3.zip
The text was updated successfully, but these errors were encountered: