GOptimize v1.44 (BASH script for CYGWIN)
Help and Extra Help:
[+] Download: https://www.mediafire.com/folder/a2z9fpcr4131a
ApkTool: https://www.mediafire.com/folder/7vv4unj5diiu2
Smali (Baksmali): https://www.mediafire.com/folder/p4b4d31bzcuj0
...is a tool for optimizing PNG's (and JPG's) in Android Applications and recompressing its files.
Help and Extra Help:
Code:
$ goptimize -he
#####################[ GOptimize v1.44 ]########################
---------------------------------------------------------------#
usage: goptimize [options] *.apk #
################################################################
GOptimize optimizes APK's with various tools .:. gu5t3r@XDA #
################################################################
OPTIONS: #
-h Show Help #
-he Show Help + Extra Help (also accepts -hh) #
-p Optimize PNG's #
-9 Optimize 9-patch (*.9.png) PNG's while optimizing PNG's #
-m [1-16] Multi-Threaded PNG optimization; forces -p #
-zz Use ZopfliPNG instead PNGout (More info in Extra Help) #
-zo Use both PngOut + ZopfliPNG for max PNG compression #
-q Convert PNG's to 8-bit with PngQuant with minimum #
required quality [0-100]; -q0 to force conversion #
-j Optimize JPG's with jpegoptim; [0] or [75-100] #
-e [-|??] Clean resources of unneeded languages #
-a Recompress resources.arsc with CL[0-6] #
-d Recompress classes.dex with CL[0-6] #
-b Remove debug info from classes.dex for API[1-21] with #
baksmali/smali; -d[0-6] required; -d5 recommended #
-s [1,2] Force smali v1 or v2 when removing debug info #
-l Recompress libraries with CL[0-6] #
-r Recompress APK with CL[0-6] #
-R [+,-] Smart Recompression modes, read extra help... #
-k Keep only libraries for architecture: 1 armeabi #
2 armeabi-v7a #
3 mips #
4 mipso32 #
5 x86 #
-t Sign APK with Android test certificate #
################################################################
Extra Help #
---------------------------------------------------------------#
PNG Optimization: #
PNG optimization is lossless and tools used for it are: #
TruePNG, PngOut, ZopfliPNG and DeflOpt. #
#
ZopfliPNG (-z option info): #
[z] Use ZopfliPNG instead PngOut for better compression #
and saving few more kBs at cost of ~20% longer process. #
[o|b] Use both PngOut + ZopfliPNG for max compression #
at cost of extra ~20 longer process compared to [z] #
#
Converting PNG's to 8-bit with PngQuant (-q option) #
Converts PNG's to 8-bit with minimum required quality #
[0-100]. If quality of converted png is lower than #
minimum set threshold original png will be preserved. #
-q0 to force conversion; -q100 will skip almost all png #
Advanced MIN-MAX thresholds can be used [0-100]-[85-100] #
PngQuant defaults are -q 45-85; if max threshold not #
specified it is set to 100. #
#
JPG's optimization with jpegoptim #
[0] is lossless optimization and recommended. #
It does not recompress jpg's, it just strips all #
unnecessary info and optimizes huffman coding. #
[75-100] optimizes and recompresses jpg's. Level 95 is #
recommended, it will recompress unnecessary big ones #
and do lossless optimization on other jpg's. #
#
Cleaning resources of unneeded languages with ApkTool v2: #
[-] Remove all unneeded lang. from resources #
[??] Keep language with ?? language code #
You can keep multiple languages: -e 'hr en de fr' #
[-Ei] Addon option, example "-e 'hr' -Ei" will try #
to remove strings that are not required from #
required languages except the ones you're keeping. #
Result: even smaller 'resuorces.arsc'. #
If you're cleaning system apps you need to put framework #
files (framework-res.apk, etc...) in framework directory #
where apk is located, usually: "PlaceApksHere\framework" #
#
Compression Levels: #
Script always uses 10 passes for compression which #
guarantees maximum compression and does not impact #
decompression time. Script CL differ in fast bytes. #
CL(1) <=> 4 fb CL(4) <=> 32 fb #
CL(2) <=> 8 fb CL(5) <=> 64 fb #
CL(3) <=> 16 fb CL(6) <=> 128 fb #
You can also enter custom fast bytes number to be used #
for compression by entering fb[3-258] instead CL. #
Examples: -afb3 -dfb69 -lfb132 -rfb258 #
#
APK Recompression (-r option): #
As of v1.25 script uses Smart Recompressing i.e. it #
will leave files uncompressed in GOptimized apk that #
were uncompressed in original apk which is the best way #
for recompressing. #
-R+ Script will use Smart Recompression plus it will #
never compress file formats from below list even if #
they were compressed in original apk. #
-R- Script will disable Smart Recompress and store #
file formats uncompressed only if they are on below #
list. #
Following Android Asset Packaging Tool rules following #
list of file formats: #
"jpg jpeg jpe jfif png gif wav mp2 mp3 ogg aac mpg #
mpeg mid midi smf jet rtttl imy xmf mp4 m4a m4v 3gp #
3gp 3gpp 3g2 3gpp2 amr awb wma wmv zip lzma xz 7z lua #
pxp resS gltxt geo apf zi_" #
should never be compressed as they are already #
compressed formats or don't compress well. #
Most developers use this file formats for databases and #
compressing them would result with application errors. #
#
APK signing with Android test certificate #
Non system apk's and apk's you want to install after #
goptimization are needed to be signed. You need Java #
configured for signing. #
Alternative is to patch rom (core.jar) with #
Lucky Patcher not to verify signatures. #
#
Configure Java: #
To use -b or -e feature you need to enter java bin path #
in bin\.JavaPATH file which is usually #
"C:\Program Files\Java\jre[version number]\bin" #
#
GOptimize.cmd Default Options: #
You can edit GOptimize.cmd default options in #
bin\.DefaultGO file. GOptimize.cmd default options are: #
"goptimize -p -q50 -j0 -a0 -d6 -l6 *.apk;" #
################################################################
[+] Download: https://www.mediafire.com/folder/a2z9fpcr4131a
Last edited: