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

Avoid duplicated XML attrs #2112

Merged
merged 1 commit into from
Feb 27, 2024
Merged

Avoid duplicated XML attrs #2112

merged 1 commit into from
Feb 27, 2024

Conversation

bagipro
Copy link
Collaborator

@bagipro bagipro commented Feb 27, 2024

Hey!

I noticed that some very obfuscated apps contain duplicated XML attributes in resources. That's why parsing of such XML documents fails.

I didn't check how Android internally handles such cases, but the code in PR only dumps only the first entry

@skylot
Copy link
Owner

skylot commented Feb 27, 2024

@bagipro looks good, thanks!
Although, it will be nice if you share link to app to test this issue 🙂

@skylot skylot merged commit 278e3c2 into master Feb 27, 2024
5 checks passed
@skylot skylot deleted the avoid_duplicated_xml_attrs branch February 27, 2024 18:49
@bagipro
Copy link
Collaborator Author

bagipro commented Feb 27, 2024

Hey @skylot,

Do you want me to share it here? You can download the com.ss.android.ugc.trill app with the 33.4.1 version (https://apkcombo.com/tiktok-asia/com.ss.android.ugc.trill/download/phone-33.4.1-apk). If you open the res/layout/q6.xml. You will observe the following XML:

<p003X.C87522XaW layout_width="match_parent" layout_height="match_parent" fillViewport="true" layout_height="match_parent" layout_width="match parent">

@skylot
Copy link
Owner

skylot commented Feb 27, 2024

@bagipro thank you for the sample 👍
It is really helpful sometimes to be able to check old samples for regressions, also I plan to start adding tests for resources decoder, maybe I will start with this one 🤣

@bagipro
Copy link
Collaborator Author

bagipro commented Feb 27, 2024

Great, but there's also another bug :) You can use the same sample to reproduce it because all attributes miss the android: namespace prefix. I've reported this bug to Apktool (in case they find a solution and they did iBotPeaches/Apktool#2420), but I still didn't have enough of time to move it to Jadx :(

@skylot
Copy link
Owner

skylot commented Feb 27, 2024

Oh. Ok, I will check this. I will make a new issue for that.

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