Skip to content

Comments

Escape '&' characters inside of data values in AndroidManifest.xml#3839

Closed
alexandre-eliot wants to merge 1 commit intoiBotPeaches:masterfrom
alexandre-eliot:fix/ampersand-in-data-value
Closed

Escape '&' characters inside of data values in AndroidManifest.xml#3839
alexandre-eliot wants to merge 1 commit intoiBotPeaches:masterfrom
alexandre-eliot:fix/ampersand-in-data-value

Conversation

@alexandre-eliot
Copy link

This will escape '&' characters inside of data values in the reconstitution of AndroidManifest.xml

I had an issue rebuilding an Apk because of an ampersand inside of a data value.

The error :

I: Checking whether sources has changed...
[Fatal Error] :314:135: The reference to entity "number_of_minutes" must end with the ';' delimiter.
I: Checking whether resources has changed...
I: Building resources...
W: %LOCALAPPDATA%\Temp\apk-mitm-63b54e009617e555baadc87b8c93e678\decode\AndroidManifest.xml:314: error: not well-formed (invalid token).

The problematic AndroidManifest.xml

<intent-filter>
    <action android:name="android.intent.action.VIEW"/>
    <category android:name="android.intent.category.DEFAULT"/>
    <category android:name="android.intent.category.BROWSABLE"/>
    <data android:path="/set-up-sleep-timer-duration-hours-and-minutes?number_of_hours={number_of_hours}&number_of_minutes={number_of_minutes}"/>
</intent-filter>

After escaping the character manually there were no issue rebuilding the Apk.

@alexandre-eliot alexandre-eliot closed this by deleting the head repository Apr 9, 2025
@iBotPeaches
Copy link
Owner

Thanks. Looks like we escaped the value from string pool, but forgot about resource table one.

@alexandre-eliot
Copy link
Author

alexandre-eliot commented Apr 9, 2025

Sorry, I should have mentioned, I didn't test it myself. It seems like the issue is here somewhere but it would need further testing to ensure this is a proper fix. ( This is why I deleted my branch )

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

Successfully merging this pull request may close these issues.

2 participants