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

BrutException: could not exec #47

Closed
tfbecker opened this issue Mar 15, 2021 · 2 comments
Closed

BrutException: could not exec #47

tfbecker opened this issue Mar 15, 2021 · 2 comments
Labels
apktool Issues caused by or related to Apktool

Comments

@tfbecker
Copy link

tfbecker commented Mar 15, 2021

First of all - Thank you for this amazing tool! It works flawlessly on two apps I already tried.
The third one runs into an issue. Would you be able to help here / point me into the right direction (looking into issues in the apk tool library you built this tool on) ?

Log1:

I: Using Apktool 2.5.0
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\\AppData\Local\Temp\apk-mitm-e0aca39ecedcc4a02dfbff425e785cac\decode\res\drawable-nodpi\placeholder.png: error: failed to read PNG signature: file does not start with PNG signature.
W: C:\Users\\AppData\Local\Temp\apk-mitm-e0aca39ecedcc4a02dfbff425e785cac\decode\res\drawable-nodpi\placeholder.png: error: file failed to compile.
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\\AppData\Local\Temp\brut_util_Jar_12710325543597105796928253852732964286.tmp, compile, --dir, C:\Users\\AppData\Local\Temp\apk-mitm-e0aca39ecedcc4a02dfbff425e785cac\decode\res, --legacy, -o, C:\Users\\AppData\Local\Temp\apk-mitm-e0aca39ecedcc4a02dfbff425e785cac\decode\build\resources.zip]

Log2:

I: Using Apktool 2.5.0
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
W: libpng error: Not a PNG file
W: ERROR: Failure processing PNG image C:\Users\\AppData\Local\Temp\apk-mitm-e0aca39ecedcc4a02dfbff425e785cac\decode\res\drawable-nodpi\placeholder.png
W: C:\Users\\AppData\Local\Temp\apk-mitm-e0aca39ecedcc4a02dfbff425e785cac\decode\res\values\styles.xml:318: error: Resource entry AppTheme already has bag item colorPrimary.
W: C:\Users\\AppData\Local\Temp\apk-mitm-e0aca39ecedcc4a02dfbff425e785cac\decode\res\values\styles.xml:317: Originally defined here.
W: 
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\\AppData\Local\Temp\brut_util_Jar_2081721367269981148661765789156865749.tmp, p, --forced-package-id, 127, --min-sdk-version, 23, --target-sdk-version, 30, --version-code, 113, --version-name, 11.3, --no-version-vectors, -F, C:\Users\\AppData\Local\Temp\APKTOOL8040330427725333163.tmp, -e, C:\Users\\AppData\Local\Temp\APKTOOL5450990596732677343.tmp, -0, arsc, -I, C:\Users\\AppData\Local\Temp\apk-mitm-e0aca39ecedcc4a02dfbff425e785cac\framework\1.apk, -S, C:\Users\\AppData\Local\Temp\apk-mitm-e0aca39ecedcc4a02dfbff425e785cac\decode\res, -M, C:\Users\\AppData\Local\Temp\apk-mitm-e0aca39ecedcc4a02dfbff425e785cac\decode\AndroidManifest.xml]

Log3:

I: Using Apktool 2.5.0 on _11_3.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\AppData\Local\Temp\apk-mitm-e0aca39ecedcc4a02dfbff425e785cac\framework\1.apk
I: Regular manifest package...
I: Decoding file-resources...
W: Cant find 9patch chunk in file: "drawable-xhdpi-v4/com_facebook_tooltip_blue_background.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-mdpi-v4/common_google_signin_btn_icon_dark_normal_background.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-mdpi-v4/common_google_signin_btn_icon_light_normal_background.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-mdpi-v4/com_facebook_tooltip_black_background.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-mdpi-v4/common_google_signin_btn_text_light_normal_background.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi-v4/common_google_signin_btn_text_light_normal_background.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xhdpi-v4/common_google_signin_btn_icon_dark_normal_background.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xxhdpi-v4/common_google_signin_btn_icon_light_normal_background.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xxhdpi-v4/common_google_signin_btn_text_light_normal_background.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xhdpi-v4/common_google_signin_btn_icon_light_normal_background.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xxhdpi-v4/common_google_signin_btn_icon_dark_normal_background.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-mdpi-v4/com_facebook_tooltip_blue_background.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xxhdpi-v4/common_google_signin_btn_text_dark_normal_background.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi-v4/com_facebook_tooltip_black_background.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi-v4/common_google_signin_btn_icon_light_normal_background.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xhdpi-v4/common_google_signin_btn_text_dark_normal_background.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi-v4/common_google_signin_btn_icon_dark_normal_background.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi-v4/common_google_signin_btn_text_dark_normal_background.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-mdpi-v4/common_google_signin_btn_text_dark_normal_background.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi-v4/com_facebook_tooltip_blue_background.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xhdpi-v4/com_facebook_tooltip_black_background.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xhdpi-v4/common_google_signin_btn_text_light_normal_background.9.png". Renaming it to *.png.
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
I: Copying META-INF/services directory
@shroudedcode
Copy link
Owner

First of all - Thank you for this amazing tool! It works flawlessly on two apps I already tried.

Thanks! 😄

Would you be able to help here / point me into the right direction (looking into issues in the apk tool library you built this tool on) ?

In case any of these errors are actually the result of a bug, then it would definitely be in Apktool as the only things apk-mitm is concerned with are files that have to do with certificate pinning in some way. But this might also be the fault of the app developer since there's not much Apktool can do when an APK contains files that are invalid in some way.

Regarding your logs: 99% of the problems you run into with Apktool result in a brut.common.BrutException, so you can basically ignore that part, it doesn't hold any meaning. Instead, look at the W: lines before that. You might think they're just warnings, but they often contain the reason a command failed.

From your logs, these are the most relevant lines:

W: ...\decode\res\drawable-nodpi\placeholder.png: error: failed to read PNG signature: file does not start with PNG signature.
W: ...\decode\res\drawable-nodpi\placeholder.png: error: file failed to compile.
W: libpng error: Not a PNG file
W: ERROR: Failure processing PNG image C:\Users\\AppData\Local\Temp\apk-mitm-e0aca39ecedcc4a02dfbff425e785cac\decode\res\drawable-nodpi\placeholder.png
W: ...\decode\res\values\styles.xml:318: error: Resource entry AppTheme already has bag item colorPrimary.
W: ...\decode\res\values\styles.xml:317: Originally defined here.
W: Cant find 9patch chunk in file: "drawable-xhdpi-v4/com_facebook_tooltip_blue_background.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-mdpi-v4/common_google_signin_btn_icon_dark_normal_background.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-mdpi-v4/common_google_signin_btn_icon_light_normal_background.9.png". Renaming it to *.png.
...

You can try searching Apktool's issues for these messages, maybe you'll find a way to fix these errors. Note that you can always make manual changes to an APK (preferably with APKLab) get it to re-encode successfully.

@shroudedcode shroudedcode added the apktool Issues caused by or related to Apktool label Mar 16, 2021
@shroudedcode
Copy link
Owner

Closing this because none of the errors seem to be caused by apk-mitm itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apktool Issues caused by or related to Apktool
Projects
None yet
Development

No branches or pull requests

2 participants