Skip to content

[FEAT] XAPK Support - Support Resource Decompilation in XAPK | @null in XML Resources When Decompiling XAPK Base APK #3806

@sipsuru

Description

@sipsuru

Information

  1. Apktool Version (apktool -version) - 2.11.0 | 2.11.0-7-f5c226b5-SNAPSHOT
  2. Operating System (Mac, Linux, Windows) - Windows
  3. APK From? (Playstore, ROM, Other) - Other [ApkCombo / ApkPure - XAPK]
  4. Java Version (java --version) - 23.0.1 | 2024-10-15

ADB Stacktrace/Logcat

adb: failed to finalize session
Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl1887994749.tmp/base.apk (at Binary XML file line #645): <meta-data> requires an android:value or android:resource attribute]

Steps to Reproduce

  1. Download xapk and extract apks inside.
  2. Decompile wp.wattpad.apk with apktool d wp.wattpad.apk
  3. Delete original wp.wattpad.apk
  4. Recompile without modifications with apktool b -o wp.wattpad.apk
  5. Sign all apks (in current directory) with: sign.py
  6. [Tried with & without this step]; Align all apks (in current directory) with: align.py
  7. Install all apks with adb install-multiple app1.apk app2.apk ... OR
    Create a zip folder containing all the apks, icon.png, manifest.json

Frameworks

Not from a framework

APK

https://apkcombo.app/wattpad/wp.wattpad/download/phone-10.95.0-apk

Questions to ask before submission

  1. Have you tried apktool d, apktool b without changing anything? - Yes
  2. If you are trying to install a modified apk, did you resign it? - Yes
  3. Are you using the latest apktool version? - Yes

Update: I don't get any error (or warning) when decompiling or recompiling. So I've included adb's logcat here.

Additional Information

Not a issue with the original xapk itself. I could successfully install the original xapk (and with adb too).

When the wp.wattpad.apk (base apk) is decompiled, it contains a lot of @null values, like

<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@null"/>
<service android:foregroundServiceType="shortService" android:icon="@null" android:name="wp.wattpad.migration.MigrationService"/>

and in many more. (This's from AndroidManifest.xml)

There're apks for multiple resolutions: config.hdpi.apk, config.ldpi.apk, config.mdpi.apk, config.tvdpi.apk, config.xhdpi.apk, config.xxhdpi.apk, config.xxhdpi.apk, so could it be that apktool replaces original resources with @null as they're not available in the base apk?

Furthermore, the target Android version seemed to be 15, which's more interesting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions