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] ERROR: no input files when compiling framework-res.apk #3645

Closed bluedragon-cairo closed 1 month ago

bluedragon-cairo commented 1 month ago

Information

  1. Apktool Version (apktool -version) - 2.3.4 and 2.9.3 (latest)
  2. Operating System (Mac, Linux, Windows) - Windows XP SP3 x86
  3. APK From? (Playstore, ROM, Other) - Galaxy Note 2 Android 4.4.2 (SHV-E250S) /system/framework
  4. Java Version (java --version) - JDK 1.8.0 (Java 8)

Stacktrace/Logcat

On Apktool 2.9.3 (latest):

D:\platform-tools\apktool>java -jar apktool_2.9.3.jar b framework-res --use-aapt2
32 bit support is deprecated. Apktool will not support 32bit on v3.0.0.
I: Using Apktool 2.9.3
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
brut.androlib.exceptions.AndrolibException: brut.common.BrutException: could not exec: [D:\Profiles\BLUE_D~1\LOCALS~1\Temp\brut_util_Jar_52968963172390795162008120720075738417.tmp, compile, --dir, D:\platform-tools\apktool\framework-res\res, --legacy, -o, D:\platform-tools\apktool\framework-res\build\resources.zip]

On Apktool 2.3.4:

D:\platform-tools\apktool>java -jar apktool_2.3.4.jar b framework-res
I: Using Apktool 2.3.4
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
W: ERROR: no input files
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [D:\Profiles\BLUE_D~1\LOCALS~1\Temp\brut_util_Jar_4959129993232323710.tmp, p, --forced-package-id, 1, --min-sdk-version, 19, --target-sdk-version, 19, --version-code, 19, --version-name, 4.4.2-E250SKSUKOH4, --no-version-vectors, -F, D:\Profiles\BLUE_D~1\LOCALS~1\Temp\APKTOOL5450422631429577031.tmp, -x, -0, ...

Steps to Reproduce

  1. java -jar apktool_2.3.4.jar b framework-res

Frameworks

I'm compiling the framework itself

Questions to ask before submission

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

--use-aapt2 doesn't fix the issue (read in issue #2777 )

bluedragon-cairo commented 1 month ago

brut_util_Jar_4959129993232323710.tmp in temp directory doesn't seem to be created

iBotPeaches commented 1 month ago

Could you attach the framework file? I want to see the source vs framework setup.

bluedragon-cairo commented 1 month ago

[framework-res.zip]

bluedragon-cairo commented 1 month ago

I just want to edit single XML file: res/values/bools.xml and resources.arsc editors out there all don't just work

bluedragon-cairo commented 1 month ago

Apktool 1.4.6 gave me useful error messages:

D:\platform-tools\apktool\framework-res\res\values\strings.xml:1780: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?

D:\platform-tools\apktool\framework-res\res\values\strings.xml:1780: error: Unexpected end tag item

D:\platform-tools\apktool\framework-res\res\values\strings.xml:1796: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?

D:\platform-tools\apktool\framework-res\res\values\strings.xml:1796: error: Unexpected end tag string

So I changed strings.xml:

<string name="wifi_msg_HS20_connected_title_format" formatted="false">%s @ %s</string>

to

<string name="wifi_msg_HS20_connected_title_format">%1$s @ %2$s</string>

and

<string name="wifi_p2p_enter_pin_dialog_message" formatted="false">Enter the PIN and tap Connect within %d seconds to connect to %2$s.</string>

to

<string name="wifi_p2p_enter_pin_dialog_message">Enter the PIN and tap Connect within %1$d seconds to connect to %2$s.</string>

Now it's working and compiling without problems. I don't know why the latest version of apktool didn't show what file was the problem.