Apktool icon indicating copy to clipboard operation
Apktool copied to clipboard

assert fail when build a 9-patch png file.

Open eriklu opened this issue 7 years ago • 1 comments

Information

  1. Apktool Version (apktool -version) - 2.40
  2. Operating System (Mac, Linux, Windows) - win10
  3. APK From? (Playstore, ROM, Other) - playstore

Stacktrace/Logcat

W: Program: C:\Users\Erik\AppData\Local\Temp\brut_util_Jar_10176546015605450442.tmp W: File: E:\test\aapt\aapt-3-master\aapt-v24\src\Images.cpp, Line 811 W: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 3)): [C:\Users\Erik\AppData\Local\Temp\brut_util_Jar_10176546015605450442.tmp, p, --forced-package-id, 127, --min-sdk-version, 16, --target-sdk-version, 28, --version-code, 815, --version-name, 3.37.0, --no-version-vectors, -F, C:\Users\Erik\AppData\Local\Temp\APKTOOL11594291946795145807.tmp, -0, arsc, -0, res/drawable/var_bg_black.9.png, -0, res/drawable/var_bg_panel_side_shadow.9.png, -0, res/drawable/var_bg_white.9.png, -0, res/drawable-mdpi-v4/abc_ab_share_pack_mtrl_alpha.9.png, -0, png, -0, ........

I build a aapt.exe use the code from https://github.com/iBotPeaches/platform_frameworks_base . I build sucess after I comment the line checkNinePatchSerialization(&imageInfo.info9Patch, unknowns[p_index].data); at line 1253 in file Images.cpp

My aapt version code base: https://github.com/eriklu/aapt-apktool_v28

the 9-patch file looks normal in android studio. var_bg_black 9

I changed the exp

Include stacktrace here

Steps to Reproduce

  1. apktool

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. Locus Map has a free version can be download from play studio or amazon . The download url is:https://www.locusmap.eu/download/

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? build fail
  3. Are you using the latest apktool version? Yes

eriklu avatar Jun 06 '19 11:06 eriklu

I patched the aapt.exe straightly, and it is built successful. I think I have done something wrong when I built aapt.exe from source. I have a biginer with compiling android source code. Maybe misused or ingored a important DEFINE. I don't know.

eriklu avatar Jun 17 '19 01:06 eriklu