iBotPeaches / Apktool

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

[BUG] Cannot recompile SettingsGoogle.apk #2987

Closed thecrybaby closed 1 year ago

thecrybaby commented 1 year ago

Information

  1. Apktool Version (apktool -version) - 2.7.0
  2. Operating System (Mac, Linux, Windows) - Linux
  3. APK From? (Playstore, ROM, Other) - Stock sunfish TQ1A.230105.001 ROM

Stacktrace/Logcat

I: Using Apktool 2.7.0
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes2 folder into classes2.dex...
I: Checking whether resources has changed...
I: Building resources...
W: res/raw/G953-00932-01-F.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00932-01-F.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00932-01-F.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00932-02-D.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00932-02-D.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00932-02-D.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00932-03-F.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00932-03-F.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00932-03-F.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00932-04-D.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00932-04-D.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00932-04-D.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-01-F.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-01-F.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-01-F.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-02-F.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-02-F.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-02-F.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-03-H.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-03-H.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-03-H.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-04-G.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-04-G.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-04-G.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-05-H.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-05-H.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-05-H.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-07-H.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-07-H.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-07-H.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-08-G.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-08-G.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-08-G.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-09-H.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-09-H.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-09-H.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-10-J.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-10-J.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-10-J.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00934-01-E.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00934-01-E.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00934-01-E.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00935-01-E.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00935-01-E.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00935-01-E.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00936-01-D.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00936-01-D.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00936-01-D.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-01155-01-E.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-01155-01-E.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-01155-01-E.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: /home/tcb/cs/google/SettingsGoogle/./res/values/styles.xml:6996: error: Resource entry Theme.Settings already has bag item android:navigationBarColor.
W: /home/tcb/cs/google/SettingsGoogle/./res/values/styles.xml:6995: Originally defined here.
W: 
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_24851723468136969784532053709410996373.tmp, p, --forced-package-id, 127, --min-sdk-version, 33, --target-sdk-version, 33, --version-code, 33, --version-name, 13, --no-version-vectors, -F, /tmp/APKTOOL14723953478836397338.tmp, -e, /tmp/APKTOOL12786095574917836384.tmp, -0, arsc, -I, /home/tcb/.local/share/apktool/framework/1.apk, -S, /home/tcb/cs/google/SettingsGoogle/./res, -M, /home/tcb/cs/google/SettingsGoogle/./AndroidManifest.xml]

After fixing the duplicate resource I recompiled and following output was received

I: Using Apktool 2.7.0
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
W: res/raw/G953-00932-01-F.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00932-01-F.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00932-01-F.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00932-02-D.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00932-02-D.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00932-02-D.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00932-03-F.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00932-03-F.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00932-03-F.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00932-04-D.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00932-04-D.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00932-04-D.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-01-F.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-01-F.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-01-F.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-02-F.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-02-F.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-02-F.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-03-H.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-03-H.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-03-H.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-04-G.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-04-G.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-04-G.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-05-H.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-05-H.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-05-H.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-07-H.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-07-H.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-07-H.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-08-G.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-08-G.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-08-G.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-09-H.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-09-H.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-09-H.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-10-J.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-10-J.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00933-10-J.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00934-01-E.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00934-01-E.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00934-01-E.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00935-01-E.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00935-01-E.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00935-01-E.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00936-01-D.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00936-01-D.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-00936-01-D.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-01155-01-E.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-01155-01-E.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
W: res/raw/G953-01155-01-E.html: Invalid file name: must contain only [a-zA-Z0-9$_.]
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_62508026338060336121741697329761391567.tmp, p, --forced-package-id, 127, --min-sdk-version, 33, --target-sdk-version, 33, --version-code, 33, --version-name, 13, --no-version-vectors, -F, /tmp/APKTOOL4596216619373182751.tmp, -e, /tmp/APKTOOL4688414085807042683.tmp, -0, arsc, -I, /home/tcb/.local/share/apktool/framework/1.apk, -S, /home/tcb/cs/google/SettingsGoogle/./res, -M, /home/tcb/cs/google/SettingsGoogle/./AndroidManifest.xml]

Steps to Reproduce

  1. apktool d SettingsGoogle.apk
  2. apktool b

Frameworks

If this APK is from an OEM ROM (Samsung, HTC, LG). Please attach framework files (.apks that live in /system/framework or /system/priv-app)

APK

If this APK can be freely shared, please upload/attach a link to it.

Questions to ask before submission

  1. Have you tried apktool d, apktool b without changing anything? - Yes
  2. If you are trying to install a modified apk, did you resign it? - N/A
  3. Are you using the latest apktool version? - Yes
iBotPeaches commented 1 year ago

Guess the hyphen isn't in the validator of allowed chars. May you trying use aapt2? --use-aapt2

thecrybaby commented 1 year ago

Guess the hyphen isn't in the validator of allowed chars. May you trying use aapt2? --use-aapt2

Yes, tried --use-aapt2 and building worked. Thanks