Apktool
                                
                                
                                
                                    Apktool copied to clipboard
                            
                            
                            
                        [BUG] Apktool not/improperly handling namespaces in xml files
Information
- Apktool Version (
apktool -version) - v2.6.1 (latest) - Operating System (Mac, Linux, Windows) - Windows
 - APK From? (Playstore, ROM, Other) - Playstore
 
Stacktrace/Logcat
Below are the logs when running the command apktool d file.apk --only-main-classes , there's already this warning Could not decode attr value, using undecoded value instead: ns=android, name=resource, value=0x7d020000
I: Using Apktool 2.6.1 on com.netflix.mediaclient_8.23.0_build_12_40200.apk
I: Loading resource table...
I: Decoding Shared Library (com.netflix.mediaclient.partnermodule), pkgId: 125
I: Decoding Shared Library (com.netflix.mediaclient.partnermodule), pkgId: 125
W: Skipping package group: com.netflix.mediaclient.partnermodule
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\imenp\AppData\Local\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=resource, value=0x7d020000
I: Regular manifest package...
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 classes5.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
I: Copying META-INF/services directory
Steps to Reproduce
apktool d file.apk --only-main-classes
APK
If this APK can be freely shared, please upload/attach a link to it. The APK can be downloaded from APKMirror using this link
Questions to ask before submission
- Have you tried 
apktool d,apktool bwithout changing anything? - Yes, apktool fails to rebuild because of the broken xml resources - Are you using the latest apktool version? - Yes
 
Problem
Right after decompiling the .APK, resources, especially layouts, are missing the namespace in front of each attribute.
For example, instead of having android:layout_width or android:layout_height, there's only layout_width or layout_height, without the appropriate namespace.
Here's an example right after decompilation:
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.FitWindowsLinearLayout orientation="vertical" id="@id/2131427389" fitsSystemWindows="true" layout_width="fill_parent" layout_height="fill_parent"
  xmlns:android="http://schemas.android.com/apk/res/android">
    <androidx.appcompat.widget.ViewStubCompat id="@id/2131427403" layout="@layout/2131623940" inflatedId="@id/2131427402" layout_width="fill_parent" layout_height="wrap_content" />
    <include layout="@layout/2131623956" />
</androidx.appcompat.widget.FitWindowsLinearLayout>
In the example I mentioned, the only defined namespace in that file is android so manually adding android: can fix the issue.
However, in some files there are custom namespaces such as app, in that case it is a bit of a problem to know where and when to replace with android: or app:.
I don't know exactly if this problem is related to the warning mentioned in the logs earlier but right now I am clueless as to why this is happening with this apk file.