Code Monkey home page Code Monkey logo

apk-parser's People

Contributors

9re avatar androiddeveloperlb avatar asssssssssssssss avatar furniel avatar hsiafan avatar johnjohndoe avatar ne-lexa avatar paulo-raca avatar phillab avatar sorccu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

apk-parser's Issues

Bug: "ParserException: Unexpected chunk Type: 0x206"

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:

framework-res.zip

Bug: Unable to fetch app-names (labels) of some apps properly

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

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

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

Bug: Unable to fetch app icons of some apps properly

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 :

apks.zip

For SettingsGoogle.apk:

SettingsGoogle.zip

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":

base.zip

base2.zip

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"

apks.zip

SystemUIGoogle.zip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.