androiddeveloperlb / apk-parser Goto Github PK
View Code? Open in Web Editor NEWLicense: BSD 2-Clause "Simplified" License
License: BSD 2-Clause "Simplified" License
I got this on the sample on Pixel 6 with Android 12.1 beta 3 :
can't parse apk for "android" in: "/system/framework/framework-res.apk" - exception:net.dongliu.apk.parser.exception.ParserException: Unexpected chunk Type: 0x206 isSystemApp?true
There are some similar issues on the original repository that were fixed:
https://github.com/hsiafan/apk-parser/issues?q=Unexpected+chunk+Type
Meaning:
hsiafan/apk-parser#52
hsiafan/apk-parser#54
hsiafan/apk-parser#40
hsiafan/apk-parser#49
hsiafan/apk-parser#66
hsiafan/apk-parser#89
hsiafan/apk-parser#111
It seems the original author told me to ignore some chunk types, such as 0x0204 :
hsiafan/apk-parser#96 (comment)
And that it was ignored by treating it in ChunkType class, treating it as NullHeader in ResourceTableParser class.
The proper solution might be related to looking here:
https://android.googlesource.com/platform/frameworks/base/+/master/libs/androidfw/include/androidfw/ResourceTypes.h
Of course, we could ignore this too. I just hope it won't cause an issue.
Attached the sample APK that is problematic, giving this error:
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
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:
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
Running the sample, I've found these apps that it failed to get their app-icons:
can't get app icon for "com.google.android.flipendo" in: "/system_ext/app/Flipendo/Flipendo.apk" isSystemApp?true
can't get app icon for "com.google.android.permissioncontroller" in: "/apex/com.android.permission/priv-app/GooglePermissionController@M_2022_05/GooglePermissionController.apk" isSystemApp?true
can't get app icon for "com.google.android.packageinstaller" in: "/system/priv-app/GooglePackageInstaller/GooglePackageInstaller.apk" isSystemApp?true
can't get app icon for "com.google.android.gms" in: "/data/app/~~GwZpIzS5WIcv3titJUfL1Q==/com.google.android.gms-lBioJwnNFoNoiZOfntH9wQ==/base.apk" isSystemApp?true
can't get app icon for "com.android.settings" in: "/system_ext/priv-app/SettingsGoogle/SettingsGoogle.apk" isSystemApp?true
can't get app icon for "com.android.bluetooth" in: "/system/app/Bluetooth/Bluetooth.apk" isSystemApp?true
Might be related:
hsiafan/apk-parser#132
hsiafan/apk-parser#113
hsiafan/apk-parser#108
Attached some of these problematic APK files :
For SettingsGoogle.apk:
For base.apk , it became quite large, so I had to split it. Rename "base.zip" to "base.zip.001" and "base2.zip" to "base.zip.002":
EDIT:
more cases:
can't get app icon for "com.google.pixel.exo" in: "/system_ext/app/Exo/Exo.apk"
can't get app icon for "com.android.bips" in: "/system/priv-app/BuiltInPrintService/BuiltInPrintService.apk"
can't get app icon for "com.android.systemui" in: "/system_ext/priv-app/SystemUIGoogle/SystemUIGoogle.apk"
can't get app icon for "com.android.traceur" in: "/system/app/Traceur/Traceur.apk"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.