轉換ipa文件中png的方法


環境:

  • 使用Mac系統(不管是真機還是虛擬機)
  • 安裝Xcode
腳本:
depng.sh
#!/bin/sh

# create the sub folder decoded
if [ ! -d ./decoded ]
then
	echo "create sub folder decoded"
	mkdir ./decoded
fi

# decode all the png images in current folder
for i in *.png; do
	if [ ! -f ./decoded/${i} ]
	then
		echo "${i} => decoded"
		/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush -revert-iphone-optimizations ${i} decoded/${i}
	fi
done

使用:

  • depng.sh放到PATH目錄下,如/usr/local/bin
  • 到ipa的解壓目錄下,執行depng.sh即可。

補充:
pngcrush是一個open source的項目,


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章