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] Facebook: expected element name 'view' and not 'View' #3512

Closed
ddxv opened this issue Feb 6, 2024 · 6 comments · Fixed by #3513
Closed

[BUG] Facebook: expected element name 'view' and not 'View' #3512

ddxv opened this issue Feb 6, 2024 · 6 comments · Fixed by #3513
Milestone

Comments

@ddxv
Copy link

ddxv commented Feb 6, 2024

Information

  1. Apktool Version (apktool -version) -2.9.3
  2. Operating System (Mac, Linux, Windows) - Ubuntu 23.10 / 22.04
  3. APK From? (Playstore, ROM, Other) - https://apkpure.net/facebook/com.facebook.katana/download 450.0.0.2.110
  4. Java Version (java --version) -
Ubuntu 23.10
openjdk 17.0.9 2023-10-17
OpenJDK Runtime Environment (build 17.0.9+9-Ubuntu-123.10)
OpenJDK 64-Bit Server VM (build 17.0.9+9-Ubuntu-123.10, mixed mode, sharing)
Ubuntu 22.04
openjdk 11.0.21 2023-10-17
OpenJDK Runtime Environment (build 11.0.21+9-post-Ubuntu-0ubuntu122.04)
OpenJDK 64-Bit Server VM (build 11.0.21+9-post-Ubuntu-0ubuntu122.04, mixed mode, sharing)

Stacktrace/Logcat

I: Loading resource table from file: /home/james/.local/share/apktool/framework/1.apk
Exception in thread "main" java.lang.IllegalArgumentException: expected element name 'view' and not 'View'
        at org.xmlpull.renamed.MXSerializer.endTag(MXSerializer.java:708)
        at org.xmlpull.v1.wrapper.classic.XmlSerializerDelegate.endTag(XmlSerializerDelegate.java:124)
        at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.event(StaticXmlSerializerWrapper.java:215)
        at brut.androlib.res.decoder.XmlPullStreamDecoder$1.event(XmlPullStreamDecoder.java:78)
        at brut.androlib.res.decoder.XmlPullStreamDecoder.decode(XmlPullStreamDecoder.java:137)
        at brut.androlib.res.decoder.ResStreamDecoderContainer.decode(ResStreamDecoderContainer.java:28)
        at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:153)
        at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:133)
        at brut.androlib.res.ResourcesDecoder.decodeResources(ResourcesDecoder.java:172)
        at brut.androlib.ApkDecoder.decode(ApkDecoder.java:104)
        at brut.apktool.Main.cmdDecode(Main.java:217)
        at brut.apktool.Main.main(Main.java:92)

Steps to Reproduce

  1. apktool d com.facebook.katana
@iBotPeaches
Copy link
Owner

Interesting. I don't think we can safely lower all tags, so we could probably normalize or relax the check on MXSerializer.

@iBotPeaches
Copy link
Owner

Of course it wouldn't be that easy. I thought this was just a case difference, but that leads to a new error.

Exception in thread "main" java.lang.IllegalArgumentException: expected element name 'view' and not 'ViewStub'

@iBotPeaches
Copy link
Owner

Started a draft. Looks like Facebook has grown from just style.2 type naming.

W: invalid resource directory name: /media/ibotpeaches/AOSP/Apktool/3512/3512/res raw.2
W: invalid resource directory name: /media/ibotpeaches/AOSP/Apktool/3512/3512/res drawable.4-xhdpi
W: invalid resource directory name: /media/ibotpeaches/AOSP/Apktool/3512/3512/res drawable.5-mdpi
W: invalid resource directory name: /media/ibotpeaches/AOSP/Apktool/3512/3512/res navigation
W: invalid resource directory name: /media/ibotpeaches/AOSP/Apktool/3512/3512/res drawable.3
W: invalid resource directory name: /media/ibotpeaches/AOSP/Apktool/3512/3512/res drawable.2-xxhdpi
W: invalid resource directory name: /media/ibotpeaches/AOSP/Apktool/3512/3512/res layout.2

@iBotPeaches
Copy link
Owner

Is your goal here only disassembly? Can't promise any success with rebuild, but the patch I have now at least disassembles properly.

@ddxv
Copy link
Author

ddxv commented Feb 12, 2024

@iBotPeaches Thanks for the help. Yes, ultimately I am only disassembling to get the final AndroidManifest.xml and for a pretty low level need, so no worries if this turned out to be more than it seemed. I just wanted to report the issue if it helps.

@iBotPeaches
Copy link
Owner

Sounds good - I'll merge something shortly to repair disassembly.

➜  3512 apktool d 3512.apk -f -s
I: Using Apktool v2.9.2-21-b5c44028-SNAPSHOT on 3512.apk with 8 thread(s).
I: Copying raw classes.dex file...
I: Copying raw classes10.dex file...
I: Copying raw classes11.dex file...
I: Copying raw classes12.dex file...
I: Copying raw classes13.dex file...
I: Copying raw classes14.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 classes6.dex file...
I: Copying raw classes7.dex file...
I: Copying raw classes8.dex file...
I: Copying raw classes9.dex file...
I: Loading resource table...
W: End of chunk hit. Skipping remaining entries (4027) in type: attr
W: End of chunk hit. Skipping remaining entries (10236) in type: id
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 assets and libs...
I: Copying unknown files...
I: Copying original files...
➜  3512 

@iBotPeaches iBotPeaches added this to the v2.10.0 milestone Feb 13, 2024
iBotPeaches added a commit that referenced this issue Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants