iBotPeaches / Apktool

A tool for reverse engineering Android apk files
https://apktool.org/
Apache License 2.0
19.79k stars 3.56k forks source link

[BUG] Can't recompile YouTube 1.6.21 #3553

Open mrkrabs206 opened 5 months ago

mrkrabs206 commented 5 months ago

Information

  1. Apktool Version (apktool -version) - 2.9.3
  2. Operating System (Mac, Linux, Windows) - Windows 10 (Version 22H2, OS Build 19045.42039)
  3. APK From? (Playstore, ROM, Other) - APKMirror.com
  4. Java Version (java --version) - 21.0.2

Stacktrace/Logcat

C:\Users\Z\Downloads>java -jar C:\Users\Z\Downloads\apktool_2.9.3.jar d C:\Users\Z\Downloads\1.6.21youtube.apk
I: Using Apktool 2.9.3 on 1.6.21youtube.apk
I: Loading resource table...
W: Skipping package group: android
I: Decoding file-resources...
I: Loading resource table from file: C:\Users\Z\AppData\Local\apktool\framework\1.apk
I: Decoding values */* XMLs...
I: Decoding AndroidManifest.xml with resources...
I: Regular manifest package...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...

C:\Users\Z\Downloads\1.6.21youtube>java -jar C:\Users\Z\Downloads\apktool_2.9.3.jar b C:\Users\Z\Downloads\1.6.21youtube
I: Using Apktool 2.9.3
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
W: C:\Users\Z\Downloads\1.6.21youtube\res\values\attrs.xml:9: error: invalid value for type 'attr'. Expected a reference.
W: C:\Users\Z\Downloads\1.6.21youtube\res\values\attrs.xml:10: error: invalid value for type 'attr'. Expected a reference.
W: C:\Users\Z\Downloads\1.6.21youtube\res\values\attrs.xml:11: error: invalid value for type 'attr'. Expected a reference.
W: C:\Users\Z\Downloads\1.6.21youtube\res\values\attrs.xml:12: error: invalid value for type 'attr'. Expected a reference.
W: C:\Users\Z\Downloads\1.6.21youtube\res\values\attrs.xml:13: error: invalid value for type 'attr'. Expected a reference.
W: C:\Users\Z\Downloads\1.6.21youtube\res\values\attrs.xml:14: error: invalid value for type 'attr'. Expected a reference.
W: C:\Users\Z\Downloads\1.6.21youtube\res\values\attrs.xml:15: error: invalid value for type 'attr'. Expected a reference.
W: C:\Users\Z\Downloads\1.6.21youtube\res\values\attrs.xml: error: file failed to compile.
brut.androlib.exceptions.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\Z\AppData\Local\Temp\brut_util_Jar_31748610698093171515207734452244682453.tmp, compile, --dir, C:\Users\Z\Downloads\1.6.21youtube\res, --legacy, -o, C:\Users\Z\Downloads\1.6.21youtube\build\resources.zip]

Steps to Reproduce

  1. java -jar C:\Users\Z\Downloads\apktool_2.9.3.jar d C:\Users\Z\Downloads\1.6.21youtube.apk
  2. java -jar C:\Users\Z\Downloads\apktool_2.9.3.jar b C:\Users\Z\Downloads\1.6.21youtube

APK

https://www.apkmirror.com/apk/google-inc/youtube/youtube-1-6-21-release/

Questions to ask before submission

  1. Have you tried apktool d, apktool b without changing anything? Yes
  2. Are you using the latest apktool version? Yes

Image(s) containing the log

ap1f ap2f

iBotPeaches commented 5 months ago

Yeah this is going to be interesting to solve. aapt2 is clearly squashing the reference into a literal value and including it at build time to cut space/time.

When Apktool disassembles - it only sees the plaintext literal, but the type was expecting a reference.

gohoski commented 1 month ago

any updates? have the same issue

mrkrabs206 commented 1 month ago

any updates? have the same issue

No it was 4months ago