Open
Description
I'm trying to recompile Facebook Messenger using apktool
but I keep getting errors in the resource building step. It mainly keeps complaining about resources ending with 2
or 2s
(e.g., color2
, color2s
, drawable2
, layout2
, ..etc.).
I tried deleting the files causing the errors but I keep getting more and more that I had to delete almost everything and yet it's still complaining.
Note: I need to edit some resources so using the --no-res
option won't work for me.
Information
- Apktool Version: 2.9.0
- Java Version: 21.0.1
- Operating System: Windows 11
- APK From: Play Store & APK Mirror
Stacktrace
Initial stacktrace...
> apktool b -f --use-aapt2 -o .\messenger_patched.apk .\messenger-v310.0.0.20.117-armeabi-v7a\
I: Using Apktool 2.9.0
I: Smaling smali folder into classes.dex...
I: Smaling smali_assets folder into assets.dex...
I: Smaling smali_classes2 folder into classes2.dex...
I: Smaling smali_classes3 folder into classes3.dex...
I: Smaling smali_classes4 folder into classes4.dex...
I: Smaling smali_classes5 folder into classes5.dex...
I: Smaling smali_classes6 folder into classes6.dex...
I: Smaling smali_classes7 folder into classes7.dex...
I: Building resources...
W: error: invalid file path 'D:\Android\custom-scripts\data\.\messenger-v310.0.0.20.117-armeabi-v7a\res\color2\APKTOOL_DUMMYVAL_0x7f150002.xml'.
W: error: invalid file path 'D:\Android\custom-scripts\data\.\messenger-v310.0.0.20.117-armeabi-v7a\res\color2\APKTOOL_DUMMYVAL_0x7f150003.xml'.
W: error: invalid file path 'D:\Android\custom-scripts\data\.\messenger-v310.0.0.20.117-armeabi-v7a\res\color2\APKTOOL_DUMMYVAL_0x7f150006.xml'.
W: error: invalid file path 'D:\Android\custom-scripts\data\.\messenger-v310.0.0.20.117-armeabi-v7a\res\color2\APKTOOL_DUMMYVAL_0x7f150007.xml'.
W: error: invalid file path 'D:\Android\custom-scripts\data\.\messenger-v310.0.0.20.117-armeabi-v7a\res\color2\APKTOOL_DUMMYVAL_0x7f150008.xml'.
W: error: invalid file path 'D:\Android\custom-scripts\data\.\messenger-v310.0.0.20.117-armeabi-v7a\res\color2\APKTOOL_DUMMYVAL_0x7f150009.xml'.
W: error: invalid file path 'D:\Android\custom-scripts\data\.\messenger-v310.0.0.20.117-armeabi-v7a\res\color2\APKTOOL_DUMMYVAL_0x7f15000a.xml'.
W: error: invalid file path 'D:\Android\custom-scripts\data\.\messenger-v310.0.0.20.117-armeabi-v7a\res\color2\APKTOOL_DUMMYVAL_0x7f15000b.xml'.
W: error: invalid file path 'D:\Android\custom-scripts\data\.\messenger-v310.0.0.20.117-armeabi-v7a\res\color2\APKTOOL_DUMMYVAL_0x7f15000c.xml'.
W: error: invalid file path 'D:\Android\custom-scripts\data\.\messenger-v310.0.0.20.117-armeabi-v7a\res\color2\APKTOOL_DUMMYVAL_0x7f15000f.xml'.
W: error: invalid file path 'D:\Android\custom-scripts\data\.\messenger-v310.0.0.20.117-armeabi-v7a\res\color2\APKTOOL_DUMMYVAL_0x7f150010.xml'.
W: error: invalid file path 'D:\Android\custom-scripts\data\.\messenger-v310.0.0.20.117-armeabi-v7a\res\color2\APKTOOL_DUMMYVAL_0x7f15006a.xml'.
W: error: invalid file path 'D:\Android\custom-scripts\data\.\messenger-v310.0.0.20.117-armeabi-v7a\res\color2\APKTOOL_DUMMYVAL_0x7f15006b.xml'.
W: error: invalid file path 'D:\Android\custom-scripts\data\.\messenger-v310.0.0.20.117-armeabi-v7a\res\color2\APKTOOL_DUMMYVAL_0x7f1500a3.xml'.
W: error: invalid file path 'D:\Android\custom-scripts\data\.\messenger-v310.0.0.20.117-armeabi-v7a\res\color2\APKTOOL_DUMMYVAL_0x7f1500b0.xml'.
W: error: invalid file path 'D:\Android\custom-scripts\data\.\messenger-v310.0.0.20.117-armeabi-v7a\res\color2\APKTOOL_DUMMYVAL_0x7f1500b8.xml'.
W: error: invalid file path 'D:\Android\custom-scripts\data\.\messenger-v310.0.0.20.117-armeabi-v7a\res\color2\APKTOOL_DUMMYVAL_0x7f1500bf.xml'.
W: error: invalid file path 'D:\Android\custom-scripts\data\.\messenger-v310.0.0.20.117-armeabi-v7a\res\color2\APKTOOL_DUMMYVAL_0x7f1500d0.xml'.
W: error: invalid file path 'D:\Android\custom-scripts\data\.\messenger-v310.0.0.20.117-armeabi-v7a\res\color2\APKTOOL_DUMMYVAL_0x7f1500d8.xml'.
W: error: invalid file path 'D:\Android\custom-scripts\data\.\messenger-v310.0.0.20.117-armeabi-v7a\res\color2\APKTOOL_DUMMYVAL_0x7f1500dd.xml'.
brut.androlib.exceptions.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\ombazara\AppData\Local\Temp\brut_util_Jar_87401739205512981675733392342153724296.tmp, compile, --dir, D:\Android\custom-scripts\data\.\messenger-v310.0.0.20.117-armeabi-v7a\res, --legacy, -o, D:\Android\custom-scripts\data\.\messenger-v310.0.0.20.117-armeabi-v7a\build\resources.zip]
Steps to Reproduce
Just try decompiling then compiling back the APK and you will get these errors.
apktool d -f --use-aapt2 <apk-path>
apktool b -f --use-aapt2 <apk-deassembled-path>
APK
I tried various versions of Facebook Messenger and I get the same errors in all of them. Here is an example APK.
Questions to ask before submission
- Have you tried
apktool d
,apktool b
without changing anything? YES - Are you using the latest apktool version? YES