Fixed: Missing Attribute & isDummy Mode #4039
Closed
+17
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixed: Missing Attributes / namespace / Format etc.
Info
OS:
Termux ( Android )used aapt2 Binary - https://github.com/Maximoff/binaries/blob/main/bin/arm64-v8a/sdk35/aapt2
aapt2 version:
Android Asset Packaging Tool (aapt) 2.19-R.20584df_1 (build by tilks 20241028)Apktool version:
apktool-v2.12.1-33-0df4f393-SNAPSHOTAPK INFO ( OBFUSCATE )
PACKAGE NAME -
com.musixmatch.android.lyrify ( 8.1.4 )( Tested ✅ )ORPACKAGE NAME -
com.orange.mobinilandme( Tested ✅ )ORPACKAGE NAME -
com.kaliranaapp.edu( Tested ✅ )Successfully Decompile with some warning, But error in Recompile
Recompile
Conclusion
if OBF attribute is integer mean startwith digit then show
error: not well-formed (invalid token). According to ChatGPT XML attribute names must not begin with a number (digit).When we use the
--res-resolve-mode dummyflag, we will need First commit. We will use this becauseaapt2never accept attribute names that start with a digit.First Change
Added prefix if type="attr" & name startwith a digit ( attr_id ) - commit - 9f3fd2d
Second Change
The second change that needs to be made is that currently, if
isDummyis true in Apktool, adds the line<item type="attr" name="APKTOOL_DUMMY_0x7f04000e">@null</item>toattrs.xml. However, this line is written incorrectly, which is causing the error:W: /data/data/com.termux/files/home/M/res/values/styles.xml:4: error: resource attr/APKTOOL_DUMMY_0x7f040010 (aka com.musixmatch.android.lyrify:attr/APKTOOL_DUMMY_0x7f040010) not found.As you can see in the screenshot, theAPKTOOL_DUMMY_0x7f040010attribute is defined inattrs.xml, but the error still shows because it's written in the wrong format. These lines should be written like this:<attr name="APKTOOL_DUMMY_0x7f04000f">@null</attr>fixed attr dummy entries commit - dd13dad