androidxmliconsaapt

Extract Android application icon using aapt


I need to extract the application icon in a APK file. I'm using aapt to know the icon location inside the APK file. I'm running aapt dump badging com.example.app.apk: this command returns me:

(...)
application-icon-120:'res/drawable-anydpi-v26/ic_launcher.xml'
application-icon-160:'res/drawable-anydpi-v26/ic_launcher.xml'
application-icon-240:'res/drawable-anydpi-v26/ic_launcher.xml'
application-icon-320:'res/drawable-anydpi-v26/ic_launcher.xml'
application-icon-480:'res/drawable-anydpi-v26/ic_launcher.xml'
application-icon-640:'res/drawable-anydpi-v26/ic_launcher.xml'
application-icon-65534:'res/drawable-anydpi-v26/ic_launcher.xml'
(...)

but as you can see it returns me the location of an XML file which in some way is encrypted. I know this XML file has the real path for the PNG file icon, but I don't know how can I get that real path (or how can I decrypt the XML and then parse it).

Is there any way to get the real path for an application icon inside a APK file with a XML pointing to other location?

Thanks!


Solution

  • Check out this project,

    https://github.com/iBotPeaches/Apktool

    It can be used to unarchive an APK, including the assets.

    apktool d <your>.apk