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

[BUG] Errors while building Facebook Messenger #3436

Open
OmarBazaraa opened this issue Nov 23, 2023 · 3 comments
Open

[BUG] Errors while building Facebook Messenger #3436

OmarBazaraa opened this issue Nov 23, 2023 · 3 comments
Labels

Comments

@OmarBazaraa
Copy link

OmarBazaraa commented Nov 23, 2023

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.

  1. apktool d -f --use-aapt2 <apk-path>
  2. 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
@OmarBazaraa OmarBazaraa changed the title [BUG] Errors while building resources [BUG] Errors while building Facebook Messenger Nov 23, 2023
@GotKiCry
Copy link

GotKiCry commented Dec 1, 2023

this may can help #1719
try rename color2 to color

@iBotPeaches
Copy link
Owner

Not positive on path forward on this. So to be blunt - it may sit for quite a while. We adjusted disassembly process to just handle the "2" part of the types. So now of course on the build end - that is causing an issue.

If we go forward with renaming them back to non-plural, then that might have to occur during disassembly.

@gringobratan
Copy link

Not positive on path forward on this. So to be blunt - it may sit for quite a while. We adjusted disassembly process to just handle the "2" part of the types. So now of course on the build end - that is causing an issue.

If we go forward with renaming them back to non-plural, then that might have to occur during disassembly.

Hello, is that planning to be fixed in upcoming months? Or not really important right now? I'm also trying to recompile some Meta apps so I can bypass SSL pinning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants