yashsingh1/xdaforums huggingface dataset:
[Android Software Development] murad052:
Thank you for reply

i didn't sign the game. i think thats why its didnt work. i will try tomorrow then i will update my post.. Great work.. Thanks
[Android Software Development] gu5t3r:
You don't need to sign system apk's (when I think better you shouldn't)

If you sing it with test certificate you need to uninstall original first but you can backup data with Titanium Backup and restore after installing.

As extra info says it's easier to patch Rom with Lucky Patcher not to verify signatures, then you don't need to uninstall original ones and you can update trough Play Store. (and you should not sign apks if you patched rom with Lucky Patcher)

Nope, because odexed rom's don't have dex in jar. They have odex outside, along jar. It's a bit harder to remove debug info from odex and is phone specific. You need whole /system/framework directory and then put new dex in jar and then use dexopt-wrapper to get odex. And even then, you need to copy signature from original file using dd.

Look at V6_SuperCharger thread for manual guide on reassembling services.odex, same procedure can be applied on all odex files.

I think I explained everything in help and extra help...

Never got an error of that type, it's error probably that file is missing, try putting GOptimize in root of Hard Disk, maybe your system has limit on file length...
[Android Software Development] bsimpson1:
As long as 9 patch images are decompiled before optimization so that the black pixels around the edges are present, then recompiled, wouldn't it be possible to optimize 9 patch images as well?
[Android Software Development] gu5t3r:
Yes, but soon smali v2 final should come out and then probably apktool v2 as current v1.5.2 cant decompile much resources...

When apktool v2 is released i will give it a try =)
[Android Software Development] octolith:
Thank you for the quick answer, I'll do as you say!
[Android Software Development] swift2989:
[MENTION=4665716]gu5t3r[/MENTION]

I need help running this bro cause i have tried many ways with no results... and i mean running the bash script itself
[Android Software Development] himanshu.khanna:
request

can u please give me a command which works with all apps and optimize them efficiently.
[Android Software Development] ct_moi:
Can you explain a bit more, can't help without any information.

---------- Post added at 12:00 PM ---------- Previous post was at 11:57 AM ----------

It depends of many things, version of android and what you want, for the moment I optpimizing a rom for a cink five (similar mmx A116) running german t5 cygnus (4.2.1).

My optimisation line is:

goptimize -m4 -zb -j75 -a0 -d5 -b17 -l5 -k2 *.apk
[Android Software Development] himanshu.khanna:
but

m running android 4.1.1 stock rom and my resources.arsc is about 1400 KB and my classes.dex is about 6262 KB please tell me what value should i give for -a and -d option so that it is recompressed to work fast and efficiently.?
[Android Software Development] ct_moi:
I'm just end user but best should run -a0 and -d5 also add -b16

I making one much thing here before running GOptimizer, I decompile with apktool and delete unneeded language, like that resources.arsc is much lighter.
[Android Software Development] himanshu.khanna:
what should be optimized value for -l and -r how to decide it?
[Android Software Development] ct_moi:
I'm using -l5 as lib are just decompress when you install an apk I think, about -r I don't use it, but help on OP will give you more information.
[Android Software Development] himanshu.khanna:
help...

what should be optimized value for -l and -r how to decide it and also how to decide values for -a and -d w.r.t. resources.arsc and classes.dex please help.
[Android Software Development] gu5t3r:
I compiled apktool v2beta4 manually and disassembled resources.arsc to get proper 9.png's.

Even I saved 111kB on FaceBook v3.7 9.png's AAPT (AndroidAssetPackagingTool) makes them big again when processing them...

So, final saved size is 3kB and not worth the trouble.

I remembered later I tried this once before, but wanted to be sure, so no luck in 9.png's =(
[Android Software Development] gu5t3r:
This is question equivalent to "My car won't start, what should I do?"

Extract, double click ManualGo.cmd, enter goptimize -he and read...

Well, I would not use -r until next version as in current recompression is based on list of files types which I figured is not always the same in all APK's.

Next release will have smart recompression i.e. files that were uncompressed in original apk will stay uncompressed in recompressed one as some files are left uncompressed with reason for faster access...

I always use -l5 and -d5 which is equivalent to -lfb64 and -dfb64 if you read extra help. Highest compression would be -lfb258 -dfb258 but that is just time wasting if you compare apk's difference is minimal (<5kB)...

Correct, libs and dex file are extracted only at install (or at dalvik-cache wipe) and never accessed again from apk.

I also use -d5 -l5

-d5 -l5 -a0

-r doesn't give much on most apk's as main difference is in lib and dex size

resources.arsc should be always left uncompressed
[Android Software Development] himanshu.khanna:
if u can plz tell me that from next version what value of -r is optimum to use? plz buddy tell
[Android Software Development] swift2989:
Sorry guys that was late last night and I should have been more descriptive. I need help running the script itself. I installed cygwin and everything but I try running manualgo.cmd and I see a cmd window open for like half a second and that's it

Team Kernelizers

Use this link: https://copy.com?r=7PeCci when you signup to copy.com so we can both get 5GB free!
[Android Software Development] Madaditya:
1.it isnt mandatory to use all the commands/arguemnts available

2.if u dont know what compression levels would be optimum keep them untouched(dont include -r option) or use 0,that'll play safe wid ua Ram and cpu but wont save lot of space

3.Use default options if confused,open bin/.GOptimize add a '-t' there if playing with Non-system apps and Optimize through Goptimize.cmd!

Kill adb.exe from task manager(ctrl+alt+del) or better restart ua pc And Try again?

And try keeping goptimizer folder at drive i.e eg C:/goptimizer

Make sure you Define Java path in bin/.JavaPAth

Or juz read the help file :D

Hope it helps
[Android Software Development] himanshu.khanna:
ya its a non system app. just tell me is this option good to compress an apk?

goptimize -m8 -zb -j85 -a1 -d5 -b16 -s2 -l5 -t *.apk;
[Android Software Development] gu5t3r:
-r4 (same as -rfb32)

You don't need to install cygwin, you already have required CyqWin modules in zip file... Put apk's in PlaceApksHere and run GOptimize.cmd or ManualGO.cmd with double click of mouse...

-m affects only speed of processing pngs (if you have CPU with 4 cores use -m4, if you have CPU with 8 cores use -m8)

-zb gives maximum savings on PNG's (-m required)

-j75 gives maximum savings on JPG's

you should always have resources uncompressed i.e. -a0

-d5 is ok

-b[1-17] you need to specify API Level of your rom; Here is the list: http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels

-s[1,2] use -s1 or don't specify -s option to use smali v1.4.2 for removing debug info from classes.dex as it creates smaller dex files than v2 beta

I reported bug to smali developer yesterday and is fixed and will be available in next release

Also, in next release process will be automated, if it can remove debug info it will remove it with smali v1.4.2, if it fails it will try with v2 and after v2 it will try v1 again to see if dex file can be reduced in size...

smali v2 can disassemble some dex files v1 can't but then v1 makes smaller dex files

I next release you will only need to specify -s1 or -s2 if you would want to force only one smali version

-l5 is ok

-t you should NOT sign system apk's
[Android Software Development] gu5t3r:
I don't recommend using -r option until next release, especially on games...

As I mentioned above, next release will have better method for recompressing APK files. It will leave uncompressed files from original apk uncompressed which is the best way...
[Android Software Development] bsimpson1:
I see. Thanks for looking into it
[Android Software Development] swift2989:
that was very simple haha thank you bro
[Android Software Development] gu5t3r:
As we are talking of disassembling resources.arsc, [MENTION=303041]ct_moi[/MENTION] has a very good idea that works;

removing all languages you don't need from resources.arsc XD

I removed all languages from FaceBook's resources.arsc except my Croatian and default English and size of resources.arsc dropped from 7508kB to 1324kB XD =)

Assembled apk back installed and it works =)

When apktool v2 is released it will be a nice feature =)
[Android Software Development] Madaditya:
Wow thats a cool idea!

So this' pretty close to being a 'Self aware' script:thumbup::D:beer:

I have also seen Rom dev's removing unnecessary drawables-*dpi folder

Eg if i have a hdpi device remove mdpi and xdpi drawables' folders!

Should give a try? That'll save us a lot!
[Android Software Development] himanshu.khanna:
thanks, bt still have doubts

i have htc desire x android v 4.1.1 its dual core so as u explained so well i guess is this the right code then.. "goptimize -m2 -zb -j75 -a0 -d5 -b16 -s1 -l5 -t" and -r4 from next release.. right?
[Android Software Development] anazhd:
:) Don't know which apk to start with. But imma keep this on watch as this is really useful :)
[Android Software Development] gu5t3r:
This was mentioned before and it's not easy because if hdpi does not have required png APP falls back to mdpi and etc..

You can't just remove folders...

And I don't have time for playing with that now....

DOH

CPU Cores on PC, it's multithreading option, -m2 runs 2 parallel tasks when optimizing png's, -m4 runs 4 parallel tasks when optimizing png's...

Apk will not differ, it's to speed up png optimizing on multicore PC CPU

XD
[Android Software Development] himanshu.khanna:
Okk except that the code m using is it optimized well? I posted code in above post
[Android Software Development] 4Freedom:
hei man?

why after install an apk optimized by your software ask me root access????

is this a virus?
[Android Software Development] gu5t3r:
You didn't get a clue from above post that you should use:

goptimize -m4 -zb -j85 -a0 -d5 -b16 -s2 -l5 -t *.apk;

for normal apks and

goptimize -m4 -zb -j85 -a0 -d5 -b16 -s2 -l5 *.apk;

for system apks?
[Android Software Development] 4Freedom:
i have got a low device an L5

1 core 800mhz

400 mb ram

2 gb sdcard/memory

320*480 screen

which options must i write in manual go?
[Android Software Development] gu5t3r:
change -j85 to -j75 and choose -b option by API Level of your rom....
[Android Software Development] 4Freedom:
i will try it for games not system app ;)

can you give me the string that i should write on cmd

thanks
[Android Software Development] gu5t3r:
Changelog: 2013-09-30 v1.25

Introduced Smart Recompression, read extra help.

Improved removing debug info, no -s option needed unless you want to strictly force smali v1 or v2

Reduced passes when recompressing from 16 to 11, difference is less <1kB on 16MB apk but now recompressing is faster...
[Android Software Development] himanshu.khanna:
please help am using this "goptimize -m2 -zb -j75 -a0 -d5 -b16 -l5 -R+ -t" on non system app on new version but command never executes. please point out my mistake
[Android Software Development] gu5t3r:
goptimize -m2 -zb -j75 -a0 -d5 -b16 -l5 -R+ -t *.apk

You need to specify apk name or linux wildcard *.apk which means all apk's in directory
[Android Software Development] himanshu.khanna:
I did that and also I tried running same command by editing it in .goptimize file and placed apk in specified folder still it doesn't work.. do i need to specify -r value with -R+ to run the command?
[Android Software Development] gu5t3r:
Yes, that is why it refuses to run, you didn't specified -r

-r is required for -R as -R only affects -r

overlooked that...
[Android Software Development] himanshu.khanna:
Yea I figured dat. But can u plz now suggest me an optimized value for -r?
[Android Software Development] gu5t3r:
-r4
[Android Software Development] akuila:
By using this : goptimize -m8 -j85 -a0 -d5 -l5 -zb -k1 -b17 *.apk;

giving me something like this images (attached)
[Android Software Development] himanshu.khanna:
error

i am using this command "goptimize -m2 -zb -j75 -a1 -d5 -b16 -l5 -t" in v1.25 and i think its not signing the non system apps with -t option coz none of them are getting installed. i used same command in v1.24 but it worked and apps got installed. i want to use the new -R features but i cant coz its not signing the apps with -t. please look into it
[Android Software Development] gu5t3r:
Changelog: 2013-10-01 v1.26

Fixed -t i.e. signing not working in v1.25
[Android Software Development] himanshu.khanna:
smooth lyk butter

tested v1.26 and everything is working butter smooth.. :good:
[Android Software Development] ct_moi:
Results of optimization N7000

Hi,

Here's the result of my optimization on a N7000.

I run on 3 differents rom, apps unused for me deleted, but the 3 rom with the same sys app and preload app.

I've running GOptimizer on sys app, preload app and framework (apk & jar files)

1 - Stock

2 - Language clean - delete unneed lib - Gotptimize: -zb -j75 -a0 -d5 -b16 -l5 -r0 -R+ -k2

3 - Language clean - delete unneed lib - Goptimize: -zb -j75 -a0 -d5 -b16 -l5 -k2

As I don't know app to test reactivity on apps, I've make the test with boot benchmark

https://play.google.com/store/apps/details?id=vog.com.aiv&hl=en

Protocol of test is the same for the 3 rom, the test with boot benchmark have been made 5 times on each rom.

Here's the average boot time for each rom:

1: 16.26 s

2: 15.83 s

3: 15.39 s
[Android Software Development] gu5t3r:
GOptimize v1.27 BETA 5

For anyone who want's to test new feature, Cleaning up resources of unneeded languages.

Use goptimize -e- *.apk to clean all languages except english which is always kept or

use goptimize -e ?? to keep language with two character ?? language code or

use goptimize -e "?? ?? ??" or goptimize -e '?? ?? ??' to specify multiple languages to be kept.

Multiple language codes need to be separated by space and wapped in quotes or single qoutes.

Example: goptimize -e 'hr de' -j75 -m4 -zb -d5 -b15 -l5 -k2 *.apk; for all optimizations.

Example: goptimize -e 'hr de' *.apk; for only cleaning resources of unneeded languages but keeping Croatian and Deutsch/German

For cleaning resources of system apk you need to create directory "framework" in apk location and put in framework-res.apk and SemcGenericUxpRes.apk or whatever apk's you have in /system/framework/

If your apks are in /PlaceApksHere then you need to create /PlaceApksHere/framework. For normal apks you need to remove it...

If script detects frameworks it will inform you by "Setting up frameworks".

Put in root of drive for maximum compatibility because ApkTool uses a lot of directory depth.

Known language codes list:

af am ar be bg bn ca cs da de el en es et fa fi fr gu hi hr hu id in it iw ja kn ko lt lv ml mr ms nb nl pa pl pt ro ru sk sl sr sv ta te th tl tr uk vi zh zu

MiniCygwin_GOptimize_v1.27b6.part1.rar

MiniCygwin_GOptimize_v1.27b6.part2.rar

Archives are RAR5 format and require WinRar 5.

Edit: Java 1.7 required

Edit2: Updated to beta 6, script was not accepting -e- to remove all option
[Android Software Development] himanshu.khanna:
can't extract

i downloaded both links but cannot extract them it shows error archive is unknown format or corrupted. i used winrar and 7zip both.
[Android Software Development] ct_moi:
Extraction is ok here, try last winrar as I just install winrar this morning to extract.
[Android Software Development] gu5t3r:
You need WinRar 5...
[Android Software Development] himanshu.khanna:
thanks

i used the command goptimize -e- -t *.apk and goptimize -e- *.apk it did all the process smoothly. but it was a non system app and i guess -t option is not working coz its not installing the app. please see to it.
[Android Software Development] gu5t3r:
You will need to be more specific.

Did you manage to use -e- in beta 5 or beta 6?

Which app did you tried?
[Android Software Development] gu5t3r:
Did you removed original app before installing?

You can't install app signed with test certificate over original one...
[Android Software Development] himanshu.khanna:
beta 6

i used it in beta 6. and the app was Open Mic+ from today xda portal.

---------- Post added at 06:50 PM ---------- Previous post was at 06:37 PM ----------

no luck.. i uninstalled the app but no luck. earlier when i compressed and signed some apps dey were installed over the earlier app successfully.

---------- Post added at 07:09 PM ---------- Previous post was at 06:50 PM ----------

i dont knw what was the issue. but i restarted my device and now its installed... sorry 4 d trouble
[Android Software Development] gu5t3r:
Probably they were modded versions and already signed with test certificate...

DOH :p
[Android Software Development] ct_moi:
Battery life

Hi,

It's since the 27 than the rom above is on the N7000 of my wife and I can just say than battery life has never be like that.

She don't used so much phone during working day but never be like that before.

Sync:

4 web site widget every 2 hours

email every 15mn

Calendar

Dropbox

Gps locator (Life360)

Backup sms

Lost 30% in little more than 11h.

With all mods phone is faster and battery much improve as classes.dex are clean

, resources.arsc lighter due to all unneeded extra langs deleted, so less battery to make the same things.

We often say here in France "The energy that is cheap is that we do not consume"

So it's the same with the rom with the data that's we don't have to read.
[Android Software Development] Dilesh Perera:
i get error msg Java not properly configured!! i have java 1.7 and Goptimize folder in C:

any idea to fix it?

edit - still the same after i edit java path file to read as C:\Program Files\Java\jre7\bin
[Android Software Development] gu5t3r:
Can you open windows CMD and

"C:\Program Files\Java\jre7\bin\java" -version
[Android Software Development] Dilesh Perera:
i can go upto C:\Program Files\Java\jre7\bin\

there's no Dir called java inside bin. but java.exe is there :)

edit - attached pic for ur ref
[Android Software Development] gu5t3r:
In ManualGO run

echo "[$(cat /bin/.JavaPATH)]"
[Android Software Development] Dilesh Perera:
thanks friend. its running now:)

do i have to do it every time ??
[Android Software Development] gu5t3r:
That line is just a check, it shouldn't fix anything...

I just wanted to see if you have extra spaces after or before the java path...

If it works now it means it already worked before you just didn't restarted ManualGO to update settings...
[Android Software Development] Dilesh Perera:
thanks again. its working now . im currently doing with some non system apps. i will report u once i install them :)
[Android Software Development] Titioz:
I have too this error with v1.26 and -b option :

[E] Removing debugging info FAILED: Java not properly configured

In ManualGO, I have this :

Titioz@DELL-TITIOZ /PlaceApksHere

$ cygpath "C:\Program Files (x86)\Java\jre7\bin"

/cygdrive/c/Program Files (x86)/Java/jre7/bin

Titioz@DELL-TITIOZ /PlaceApksHere

$ "/cygdrive/c/Program Files (x86)/Java/jre7/bin/java" -version

java version "1.7.0_40"

Java(TM) SE Runtime Environment (build 1.7.0_40-b43)

Java HotSpot(TM) Client VM (build 24.0-b56, mixed mode, sharing)

Titioz@DELL-TITIOZ /PlaceApksHere

$ echo "[$(cat /bin/.JavaPATH)]"

["C:\Program Files (x86)\Java\jre7\bin"]

I don't find where is the problem, any idea ?

Titioz
[Android Software Development] gu5t3r:
Can you do:

smali -v

and

baksmali -v

and paste output...
[Android Software Development] Titioz:
Titioz@DELL-TITIOZ /PlaceApksHere

$ smali -v

/bin/smali: line 2: java: command not found

Titioz@DELL-TITIOZ /PlaceApksHere

$ baksmali -v

/bin/baksmali: line 2: java: command not found

I make change in .ManuelGO, it seems there is a problem with cygpath :

JavaPATH="$(cat /bin/.JavaPATH 2>/dev/null | sed -ne 1p 2>/dev/null)"

if [ "$JavaPATH" ]; then

echo 1-$JavaPATH

JavaPATH="$(cygpath "$JavaPATH" 2>/dev/null)"

echo 2-$JavaPATH

JavaPATH="/cygdrive/c/Program Files (x86)/Java/jre7/bin"

echo 3-$JavaPATH

if [ -d "$JavaPATH" ]; then

export PATH="$PATH:$JavaPATH"

java -version > /dev/null 2>&1;

if [ ${?} -ne 0 ] || [ ! "$(java -version 2>&1 | grep 'java version')" ]; then

echo -e "\n[E] Java not properly configured\n";

fi

fi

fi

and now it's works :

1-"C:\Program Files (x86)\Java\jre7\bin"

2-"C:/Program Files (x86)/Java/jre7/bin"

3-/cygdrive/c/Program Files (x86)/Java/jre7/bin

Titioz@DELL-TITIOZ /PlaceApksHere

$ cygpath "C:\Program Files (x86)\Java\jre7\bin"

/cygdrive/c/Program Files (x86)/Java/jre7/bin

Titioz@DELL-TITIOZ /PlaceApksHere

$ smali -v

smali 1.4.2 (http://smali.googlecode.com)

Copyright (C) 2010 Ben Gruver (JesusFreke@JesusFreke.com)

BSD license (http://www.opensource.org/licenses/bsd-license.php)

Titioz@DELL-TITIOZ /PlaceApksHere

$

I don't knwo why cygpath works manualy and not in the script.

Titioz
[Android Software Development] gu5t3r:
Can't really tell what causes the problem but it works for most people, 93 downloads and only 2 people like problems with these.

Try replacing

JavaPATH="$(cygpath "$JavaPATH" 2>/dev/null)"

with

JavaPATH="$(cygpath -ua "$JavaPATH" 2>/dev/null)"

See if it helps....
[Android Software Development] Titioz:
it still doesn't work.

Finally in file .JavaPATH, I replace

"C:\Program Files (x86)\Java\jre7\bin"

by

C:\Program Files (x86)\Java\jre7\bin

without quote

And now it's work with original .ManualGO

Thanks for your help
[Android Software Development] gu5t3r:
It shouldn't have quotes in first place XD
[Android Software Development] gu5t3r:
Future versions will avoid quotes when reading Java path from /bin/.JavaPATH
[Android Software Development] gu5t3r:
Updated to Beta 9;

Fixed "Attempting to assemble APK : Failed!" on some apk's. It's due to undetectable required languages until error occurs.

Script will skip quotes when reading Java path...

Lot's of Cleaning languages code optimizations...

English is no longer kept by default...

MiniCygwin_GOptimize_v1.27b9.part1.rar

MiniCygwin_GOptimize_v1.27b9.part2.rar
[Android Software Development] iyunusp:
What is the different between part 1 and part 2? Or these files split to 2 part, if these true, how to merge these file?

Sorry for bad english
[Android Software Development] gu5t3r:
It's all explained...
[Android Software Development] ct_moi:
Hi,

Just try 1.27b9 and it's ok for the 3 apk (test on phone) which I listed to you.

Will start again testing as I've finish to optimize rom on my daily phone.

Thanks again for great work.
[Android Software Development] Titioz:
I test 1.27b9 with option "-m4 -j0 -a0 -d5 -b17 -l5 -e fr -k2" and I have some errors.

Several apk doesn't install after optimizing with this script

=> I get this error :

Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]

and this in logcat :

20:49:14.018 Error PackageParser 396 Package com.google.android.street has no certificates at entry res/drawable-hdpi/dialog_divider_horizontal_light.9.png; ignoring!

for example :

- Street-View-18102-v1.8.1.2.apk

some folder are rename between original and optimizing apk :

res/drawable-160dpi to res/drawable-mdpi

res/drawable-240dpi to res/drawable-hdpi

- Widgetsoid-135-v4.2.7.1.apk

some png with .9.png are rename :

res/drawable-hdpi/appwidget_black_press_c.9.png to res/drawable-hdpi/appwidget_black_press_c.png

res/drawable-hdpi/appwidget_black_press_l.9.png to res/drawable-hdpi/appwidget_black_press_l.png

res/drawable-hdpi/appwidget_black_press_r.9.png to res/drawable-hdpi/appwidget_black_press_r.png

Titioz

PS : Sorry for my english, I hope everything is clear

Edit :

It seems to be an apktool problem
[Android Software Development] himanshu.khanna:
buddy i guess these are not system apps. so u need to add -t at end in order to sign app with test certificate. try adding -t and then install. let me knw if issue still exists..