Skip to content
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] Error parsing XML when manifest contains & #2799

Closed
inech opened this issue Apr 15, 2022 · 1 comment
Closed

[BUG] Error parsing XML when manifest contains & #2799

inech opened this issue Apr 15, 2022 · 1 comment

Comments

@inech
Copy link

inech commented Apr 15, 2022

Information

  1. Apktool Version (apktool -version) - 2.6.1
  2. Operating System (Mac, Linux, Windows) - Linux
  3. APK From? (Playstore, ROM, Other) - Other

Error

 ✔ Checking prerequisities
  ✔ Decoding APK file
  ✔ Applying patches
  ❯ Encoding patched APK file
    ↓ Encoding using AAPT2 [skipped]
      → Failed, falling back to AAPT...
    ✖ Encoding using AAPT [fallback]
      → I: Building resources...
    Signing patched APK file

   Failed!  An error occurred:

I: Using Apktool 2.6.1
I: Checking whether sources has changed...
I: Checking whether sources has changed...
[Fatal Error] :40:252: The entity name must immediately follow the '&' in the entity reference.
I: Checking whether resources has changed...
I: Building resources...
W: <tmp_dir>/decode/AndroidManifest.xml:40: error: Error parsing XML: not well-formed (invalid token)

ApplicationManifest.xml snippet:

<application android:allowBackup="false" android:appComponentFactory="androidx.core.app.CoreComponentFactory" android:extractNativeLibs="true" android:fullBackupOnly="false" android:icon="@mipmap/ic_launcher" android:label="A & B" android:name="..." android:networkSecurityConfig="@xml/nsc_mitm">

When manifest contains & (ampersand) e.g. android:label="A & B" there is an error during encoding.

@iBotPeaches
Copy link
Owner

Not sure this is an issue. A manifest cannot have an & that is clearly an invalid XML character. If its escaped - it works and I wrote a test that confirms Apktool handles this properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants