Apktool
Apktool copied to clipboard
[BUG] Duplicated xmlns:android attribute
trafficstars
Information
- Apktool Version (
apktool -version) - Apktool 2.6.0 - Operating System (Mac, Linux, Windows) - Windows 10
- APK From? (Playstore, ROM, Other) - Playstore
Stacktrace/Logcat
PS R:\> java -jar R:\apktool_2.6.0.jar d "R:\Slime Hunter _ Wild Impact_5.0.4_apkcombo.com.apk"
I: Using Apktool 2.6.0 on Slime Hunter _ Wild Impact_5.0.4_apkcombo.com.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\x\AppData\Local\apktool\framework\1.apk
I: Regular manifest package...
[Fatal Error] :5:61: Attribute "xmlns:android" was already specified for element "manifest".
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Baksmaling classes2.dex...
I: Baksmaling classes3.dex...
I: Baksmaling classes4.dex...
I: Baksmaling assets/audience_network.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
I: Copying META-INF/services directory
PS R:\> java -jar R:\apktool_2.6.0.jar b "R:\Slime Hunter _ Wild Impact_5.0.4_apkcombo.com"
I: Using Apktool 2.6.0
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether sources has changed...
I: Smaling smali_assets folder into assets.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 sources has changed...
I: Smaling smali_classes4 folder into classes4.dex...
[Fatal Error] :5:61: Attribute "xmlns:android" was already specified for element "manifest".
I: Checking whether resources has changed...
I: Building resources...
W: R:\Slime Hunter _ Wild Impact_5.0.4_apkcombo.com\AndroidManifest.xml:5: error: Error parsing XML: duplicate attribute
W:
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\x\AppData\Local\Temp\brut_util_Jar_46741419153469335912758414005722969781.tmp, p, --forced-package-id, 127, --min-sdk-version, 21, --target-sdk-version, 29, --version-code, 2021091601, --version-name, 5.0.4, --no-version-vectors, -F, C:\Users\x\AppData\Local\Temp\APKTOOL781941691269769731.tmp, -e, C:\Users\x\AppData\Local\Temp\APKTOOL1436051173160732781.tmp, -0, arsc, -I, C:\Users\x\AppData\Local\apktool\framework\1.apk, -S, R:\Slime Hunter _ Wild Impact_5.0.4_apkcombo.com\res, -M, R:\Slime Hunter _ Wild Impact_5.0.4_apkcombo.com\AndroidManifest.xml]
PS R:\> java -jar R:\apktool_2.6.0.jar b "R:\Slime Hunter _ Wild Impact_5.0.4_apkcombo.com"
Steps to Reproduce
java -jar apktool_2.6.0.jar djava -jar apktool_2.6.0.jar b
Frameworks
N/A
APK
https://apkcombo.com/apk-downloader/?package=com.abiss.roem&device=default&arches=armeabi-v7a&sdkInt=default&format=apk&dpi=480&lang=en
Questions to ask before submission
- Have you tried
apktool d,apktool bwithout changing anything? Yes - Are you using the latest apktool version? Yes
Note
It doesnt happen on apktool 2.5.0, no duplicate and the attribute looks cleaner
@eladkarako same error if i use aapt2. removing duplicated attributes solved the problem
sep. 30, 2021 8:45:55 PM java.util.logging.LogManager$RootLogger log
WARNING: R:\Slime Hunter - Wild Impact_5.1.0_apkcombo.com\res\raw\ayp_youtube_player.html: note: compiling file.
sep. 30, 2021 8:45:55 PM java.util.logging.LogManager$RootLogger log
WARNING: R:\Slime Hunter - Wild Impact_5.1.0_apkcombo.com\res\raw\hive_config.xml: note: compiling file.
sep. 30, 2021 8:45:55 PM java.util.logging.LogManager$RootLogger log
WARNING: R:\Slime Hunter - Wild Impact_5.1.0_apkcombo.com\res\raw\hive_error_embed.html: note: compiling file.
sep. 30, 2021 8:45:55 PM java.util.logging.LogManager$RootLogger log
WARNING: R:\Slime Hunter - Wild Impact_5.1.0_apkcombo.com\res\raw\hive_error_embed_v2.html: note: compiling file.
sep. 30, 2021 8:45:55 PM java.util.logging.LogManager$RootLogger log
WARNING: R:\Slime Hunter - Wild Impact_5.1.0_apkcombo.com\res\raw\push_sound_name.wav: note: compiling file.
sep. 30, 2021 8:45:56 PM java.util.logging.LogManager$RootLogger log
WARNING: R:\Slime Hunter - Wild Impact_5.1.0_apkcombo.com\res\xml\appsflyer_backup_rules.xml: note: compiling XML.
sep. 30, 2021 8:45:56 PM java.util.logging.LogManager$RootLogger log
WARNING: R:\Slime Hunter - Wild Impact_5.1.0_apkcombo.com\res\xml\provider_paths.xml: note: compiling XML.
sep. 30, 2021 8:45:56 PM java.util.logging.LogManager$RootLogger log
WARNING: R:\Slime Hunter - Wild Impact_5.1.0_apkcombo.com\res\xml\vungle_backup_rule.xml: note: compiling XML.
sep. 30, 2021 8:45:56 PM brut.androlib.res.AndrolibResources aapt2Package
FINE: aapt2 compile command ran:
sep. 30, 2021 8:45:56 PM brut.androlib.res.AndrolibResources aapt2Package
FINE: [C:\Users\xxx\AppData\Local\Temp\brut_util_Jar_78901777999062258684520052149857996655.tmp, compile, --dir, R:\Slime Hunter - Wild Impact_5.1.0_apkcombo.com\res, --legacy, -o, R:\Slime Hunter - Wild Impact_5.1.0_apkcombo.com\build\resources.zip, -v]
sep. 30, 2021 8:45:56 PM java.util.logging.LogManager$RootLogger log
WARNING: R:\Slime Hunter - Wild Impact_5.1.0_apkcombo.com\AndroidManifest.xml:5: error: duplicate attribute.
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\xxx\AppData\Local\Temp\brut_util_Jar_78901777999062258684520052149857996655.tmp, link, -o, C:\Users\xxx\AppData\Local\Temp\APKTOOL3441697848475676666.tmp, --package-id, 127, --min-sdk-version, 21, --target-sdk-version, 30, --version-code, 2021092701, --version-name, 5.1.0, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, -e, C:\Users\xxx\AppData\Local\Temp\APKTOOL3630543143387202285.tmp, -0, arsc, -I, C:\Users\xxx\AppData\Local\apktool\framework\1.apk, --manifest, R:\Slime Hunter - Wild Impact_5.1.0_apkcombo.com\AndroidManifest.xml, -v, R:\Slime Hunter - Wild Impact_5.1.0_apkcombo.com\build\resources.zip]
Even aapt2/aapt reports the duplicate. So this must be a form of obfuscation/trickery.
➜ 2664 aapt2 d xmltree 2664.apk --file AndroidManifest.xml | more
N: android=http://schemas.android.com/apk/res/android (line=4294967295)
N: amazon=http://schemas.amazon.com/apk/res/android (line=4294967295)
N: android=http://schemas.android.com/apk/res/android (line=4294967295)
➜ 2664 aapt d xmltree 2664.apk AndroidManifest.xml | more
N: android=http://schemas.android.com/apk/res/android
N: amazon=http://schemas.amazon.com/apk/res/android
N: android=http://schemas.android.com/apk/res/android
E: manifest (line=2)
I'll have to test out patch that records the value of the namespace and skips an entry if it already exists.
➜ 2664 apktool d 2664.apk -f -s
I: Using Apktool 2.8.2-22eb80-SNAPSHOT on 2664.apk
I: Loading resource table...
I: Decoding file-resources...
I: Loading resource table from file: /home/ibotpeaches/.local/share/apktool/framework/1.apk
I: Decoding values */* XMLs...
I: Decoding AndroidManifest.xml with resources...
I: Regular manifest package...
I: Copying raw classes.dex file...
I: Copying raw classes2.dex file...
I: Copying raw classes3.dex file...
I: Copying raw classes4.dex file...
I: Copying raw classes5.dex file...
I: Copying raw assets/.betefu.dex file...
I: Copying raw assets/audience_network.dex file...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
I: Copying META-INF/services directory
➜ 2664 apktool b 2664
I: Using Apktool 2.8.2-22eb80-SNAPSHOT
I: Copying 2664 classes.dex file...
I: Copying 2664 classes2.dex file...
I: Copying 2664 classes3.dex file...
I: Copying 2664 classes5.dex file...
I: Copying 2664 classes4.dex file...
I: Checking whether resources has changed...
I: Building resources...
I: Copying libs... (/lib)
I: Copying libs... (/kotlin)
I: Copying libs... (/META-INF/services)
I: Building apk file...
I: Copying unknown files/dir...
I: Built apk into: 2664/dist/2664.apk
➜ 2664
PR above. This will close on merge of that.