重打包资源报错解决

来源:互联网 发布:c语言求1到n阶乘的和 编辑:程序博客网 时间:2024/05/17 03:11

遇到的APK可以正常反编译,打包时会出现如下错误:

I: Using Apktool 2.1.1I: Checking whether sources has changed...I: Smaling smali folder into classes.dex...I: Checking whether resources has changed...I: Building resources...W: libpng error: Not a PNG fileW: ERROR: Failure processing PNG image res/drawable-hdpi-v4/btn_main_1_1.pngW: libpng error: Not a PNG fileW: ERROR: Failure processing PNG image res/drawable-xhdpi-v4/btn_main_1_1.pngW: libpng error: Not a PNG fileW: ERROR: Failure processing PNG image res/drawable-hdpi-v4/btn_main_1_2.pngW: libpng error: Not a PNG fileW: ERROR: Failure processing PNG image res/drawable-xhdpi-v4/btn_main_1_2.pngW: libpng error: Not a PNG fileW: ERROR: Failure processing PNG image res/drawable-hdpi-v4/btn_main_1_3.pngW: libpng error: Not a PNG fileW: ERROR: Failure processing PNG image res/drawable-xhdpi-v4/btn_main_1_3.pngW: libpng error: Not a PNG fileW: ERROR: Failure processing PNG image res/drawable-hdpi-v4/btn_main_1_4.pngW: libpng error: Not a PNG file

查看文件格式:


原来并不是png文件,将后缀名改为exif后便可重打包运行。


由于涉及到的png文件比较多,用下面这个命令可以批量修改:

grep "\.png" log.txt | awk '{fileName=substr($7,0,length($7)-3);system("mv "$7" "fileName".exif")}'


2 0