iBotPeaches / Apktool

A tool for reverse engineering Android apk files

Home Page:https://apktool.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Unable to parse '&' in AndroidManifest.xml

ext4xfs opened this issue · comments

Information

  1. Apktool Version (apktool -version) - 2.9.3
  2. Operating System (Mac, Linux, Windows) - Linux
  3. APK From? (Playstore, ROM, Other) - apkpure
  4. Java Version (java --version) - openjdk 21.0.2

Stacktrace/Logcat

[Fatal Error] :260:66: The entity name must immediately follow the '&' in the entity reference.

Or for AAPT

AndroidManifest.xml:260: error: not well-formed (invalid token).

Steps to Reproduce

  1. I am utilizing apk-mitm, however it's clear that the AndroidManifest.xml has an ampersand in the xml that apktool is unable to parse

Frameworks

If this APK is from an OEM ROM (Samsung, HTC, LG). Please attach framework files
(.apks that live in /system/framework or /system/priv-app)

NA

APK

If this APK can be freely shared, please upload/attach a link to it.

https://apkpure.com/myhyundai-with-bluelink/com.stationdm.bluelink/versions

Questions to ask before submission

  1. Have you tried apktool d, apktool b without changing anything? yes, but I'm not familiar with apktool in general
  2. If you are trying to install a modified apk, did you resign it?
  3. Are you using the latest apktool version? yes
        <receiver android:exported="true" android:label="Remote & Car Finder" android:name="com.stationdm.bluelink.kotlin.ui.widget.Remote4X1Widget">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
                <action android:name="com.stationdm.bluelink.widget.UPDATE_ALL"/>
                <action android:name="com.stationdm.bluelink.widget.UPDATE_LOGOUT"/>
            </intent-filter>
            <meta-data android:name="android.appwidget.provider" android:resource="@xml/remote4_x1_widget_info"/>
        </receiver>
        <receiver android:exported="true" android:label="Remote & POI Search" android:name="com.stationdm.bluelink.kotlin.ui.widget.Remote4X2Widget">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
                <action android:name="com.stationdm.bluelink.widget.UPDATE_ALL"/>
                <action android:name="com.stationdm.bluelink.widget.UPDATE_LOGOUT"/>
            </intent-filter>
            <meta-data android:name="android.appwidget.provider" android:resource="@xml/remote4_x2_widget_info"/>
        </receiver>
➜  3554 apktool b 3554
I: Using Apktool v2.9.2-27-5422bd70-SNAPSHOT with 8 thread(s).
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes2 folder into classes2.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes3 folder into classes3.dex...
I: Checking whether resources has changed...
I: Building resources...
I: Copying libs... (/kotlin)
I: Copying libs... (/META-INF/services)
I: Building apk file...
I: Copying unknown files/dir...
I: Built apk into: 3554/dist/3554.apk
➜  3554 

Using a basic disassemble/assemble with your sample - I could not replicate. I am running a 2.10.x build though, so its possible this was fixed or simply not reproducible.

        <receiver android:exported="true" android:label="Remote &amp; Car Finder" android:name="com.stationdm.bluelink.kotlin.ui.widget.Remote4X1Widget">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
                <action android:name="com.stationdm.bluelink.widget.UPDATE_ALL"/>