yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] Daneshm90:
Wierd, u on linux ? Could it be a platform issue ?

I got the same error as the previous user, upon decompiling (2 .9 pngs which it converted to .pngs) and upon rebuilding a bunch of public.xml mismatches followed by tht apktool error.
[G1 Android Development] Brut.all:
Yeah, I got 9.png warnings, but this is ok. What is the exact error thrown by aapt during building? Apktool's stacktrace is useless in this case.
[G1 Android Development] shinobi_uk:
Never mind found a copy on rapidshare :-)

Strangely it works perfectly for me now?! With 4.9 if I changed any 9.pngs i would get FC's on everything almost, and i found that the progress bar had been replaced by a warped version of the spinner. None of these things happen when using the exact same files with v4.8.

I can send logs/debug if you need OP
[G1 Android Development] kmilof:
hey suddenly the program stop woking , at the beginning says

"adb was not found, you will not be able to manipulate the files on your phone"

weird thing is, that adb is working :S i have the andriod sdk. just yesterday i was working with it, now it doesnt work, any tips?

ty!
[G1 Android Development] kmilof:
nvm, i accidentally renamed the folder of the sdk tools, now is working.
[G1 Android Development] kevdog:
Quick question -- can you replace a .png file with a .9.png file -- and vice versa -- without any consequences?
[G1 Android Development] TheDrizzle89:
'adb' is not recognized as an internal or external command

When I try to push/pull from my device in your script I get the 'adb' is not recognized. Here is your script log

java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b07)
Java HotSpot(TM) Client VM (build 17.0-b17, mixed mode, sharing)
'adb' is not recognized as an internal or external command,
operable program or batch file.
'adb' is not recognized as an internal or external command,
operable program or batch file.

I've been all over looking for why this error is happening. My path is:

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\QuickTime\QTSystem\;c:\Program Files\Microsoft SQL Server\90\Tools\binn\c:\Program Files\android-sdk-windows\android-sdk-windows\tools

I checked spelling of the path and everything. I never actually changed my path, the sdk must have done that for me, but it's right.

Also, I run adb devices and can see my device. I can push/pull stuff from it, just not in your script. Any thoughts?

**EDIT: Sorry, forgot the ';' before adding the sdk to the path. I guess you shouldn't let Android change your path for you. Thanks for the awesome script!
[G1 Android Development] Brut.all:
In decoded application - yes.
[G1 Android Development] Rydah:
would somebody please port this to mac?
[G1 Android Development] wisnia99:
Java not found

Hi guys, This maybe a noob question.

And yes im Noob to this :)

All i want to do is to change some background graphics for widget that i use

I installed everything Java and the SDK is installed in C:\AndroidSDK folder

when i start the Script.bat it says that "Java was not found, you will not be able to sing apks or use apktool

Press any key to continue. . .

What am I doing wrong?
[G1 Android Development] Daneshm90:
Make sure java is in ur PATH.

Refer to Link
[G1 Android Development] Daneshm90:
Hey,

Is it a themed apk ?

Thanks
[G1 Android Development] Toisan:
Ehm, yes, think so?

But it was already themed, want only change a .xml in value folder, but on settings.apk the same error...?

Thanks
[G1 Android Development] Brut.all:
@Toisan

And is this apk from Samsung or SE phone? I think you have to install framework file.

EDIT:

@Daneshm90

Still I think there should be no problem to modify most of themed apks.
[G1 Android Development] Toisan:
OK, the whole story:

Its all about this nice Rom: Link

Its of a Dev team from China, so most is English/china language ;)

Than a part and me of a German Forum translatet the .xml files into German, now i tried to replaced the old English files with the new German parts

the Files are in teh Apk in /res/value/string.xml and to get them i have to decompile the apk, change and compile it back

so now i read in the help if Apk-Modder that modded apk´s are not supportet, but i cant get the Original files of the apk´s cause all is from China...?

u understand my Problem, or do u now an nother way to get the files i need out the apk´s?

Hope all is ok to understand it :)

Thanks
[G1 Android Development] Daneshm90:
Hmm k. Toisan then i guess do wht Brut says, decompile with dependency option but provide the framework-res from their rom.

Also Brut on a side note, do u want me to put a disclaimer of sorts for ppl telling them to post any issues related to "ApkTool" on ur thread ? Let me know if going back/forth between ur/this thread is becoming a hassle. Thnx
[G1 Android Development] Brut.all:
@Toisan

Just read this: https://code.google.com/p/android-apktool/wiki/FrameworkFiles

I have installed a framework file from this ROM and then I was able to decode contacts.apk:

brutall@brutall-laptop:/media/var/dls/miui-desire-0.9.17/system/app$ apktool d Contacts.apk
I: Loading resource table...
W: Skipping "android" package group
I: Loaded.
I: Loading resource table from file: /home/brutall/apktool/framework/1.apk
I: Loaded.
I: Decoding file-resources...
W: Could not decode attr value, using undecoded value instead: ns=android, name=background, value=0x010803ce
W: Could not decode attr value, using undecoded value instead: ns=android, name=background, value=0x010803ce
W: Could not decode attr value, using undecoded value instead: ns=android, name=src, value=0x01080382
I: Decoding values*/* XMLs...
I: Done.
Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec: 0x010803ce
at brut.androlib.res.data.ResPackage.getResSpec(Unknown Source)
at brut.androlib.res.data.ResTable.getResSpec(Unknown Source)
at brut.androlib.res.data.ResTable.getResSpec(Unknown Source)
at brut.androlib.res.data.value.ResReferenceValue.getReferent(Unknown Source)
at brut.androlib.res.data.value.ResReferenceValue.toResXmlFormat(Unknown Source)
at brut.androlib.res.data.value.ResAttr.convertToResXmlFormat(Unknown Source)
at brut.androlib.res.decoder.ResAttrDecoder.decode(Unknown Source)
at brut.androlib.res.decoder.AXmlResourceParser.getAttributeValue(Unknown Source)
at org.xmlpull.v1.wrapper.classic.XmlPullParserDelegate.getAttributeValue(Unknown Source)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.writeStartTag(Unknown Source)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.event(Unknown Source)
at brut.androlib.res.decoder.XmlPullStreamDecoder.decode(Unknown Source)
at brut.androlib.res.decoder.ResStreamDecoderContainer.decode(Unknown Source)
at brut.androlib.res.decoder.ResFileDecoder.decode(Unknown Source)
at brut.androlib.res.decoder.ResFileDecoder.decode(Unknown Source)
at brut.androlib.res.AndrolibResources.decode(Unknown Source)
at brut.androlib.Androlib.decodeResourcesFull(Unknown Source)
at brut.androlib.ApkDecoder.decode(Unknown Source)
at brut.apktool.Main.cmdDecode(Unknown Source)
at brut.apktool.Main.main(Unknown Source)

brutall@brutall-laptop:/media/var/dls/miui-desire-0.9.17/system/app$ apktool if ../framework/framework-res.apk miui
I: Framework installed to: /home/brutall/apktool/framework/1-miui.apk

brutall@brutall-laptop:/media/var/dls/miui-desire-0.9.17/system/app$ apktool d -f -t miui Contacts.apk
I: Loading resource table...
W: Skipping "android" package group
I: Loaded.
I: Loading resource table from file: /home/brutall/apktool/framework/1-miui.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...

I don't know, how to do this in ApkManager, but I think it works similarly.
[G1 Android Development] Toisan:
Oh, u mean that i take option 10 in ur tool, put the path to the framework-res.apk in and than it works?

Thanks!
[G1 Android Development] Daneshm90:
Hey man, im tryin to get ur script workin but i keep getting

danesh@danesh-laptop:~/Desktop/Apk Manager$ ./Script.sh

./Script.sh: 5: function: not found

Where do you want adb to pull the apk from?

Example of input : /system/app/launcher.apk

Imma look into this, im not an expert in bash scripting though lol :(

I was also thinking of adding something like this to where u script first starts

if [ -f other/setup.sh ]
then
sh ./other/setup.sh
rm other/setup.sh
fi

and inside setup.sh i would have

#!/bin/sh
sudo mv other/apktool.jar /usr/local/bin/
sudo mv other/apktool /usr/local/bin/
sudo mv other/aapt /usr/local/bin/
sudo chmod 755 /usr/local/bin/apktool

So this will make it so the user doesnt have to have apktool setup. I also included 7za,optipng into the other folder so essentially this is almost a replica of the windows version.
[G1 Android Development] farmatito:
Worls here. Have to test it on more strict shells than bash but will do it tomorrow as I'm going to be now.

This should not be necessary. You can add this line:

# Start
export PATH=$PATH:$PWD/other

to add the "other" dir to the PATH variable so copying around is needed.

Will send a improved version as soon as my little spare time permits it.

Enjoy.
[G1 Android Development] farmatito:
A fast workaround for this is to change the first line to:

#! /bin/bash

as your shell (dash?) seems not to support functions.

Enjoy.
[G1 Android Development] Daneshm90:
Hey thnx. making it #! /bin/bash made it work.

Im experimenting with the script some more. Will add the export PATH=$PATH:$PWD/other line in there. Thanks n sorry if i sound noobish lol cuz technically in the linux world i am :(
[G1 Android Development] farmatito:
New version 0.3:

Changelog:
# v 0.1 Initial version
# v 0.2 add "other" dir to PATH
# v 0.3 remove function bashism

Enjoy. :D
[G1 Android Development] Daneshm90:
Hmm now with 0.3 im getting

export: 251: Manager/other: bad variable name

Whereas with previous version if i added export PATH=$PATH:$PWD/other and put a space in tht first bin/bash line it works fine.
[G1 Android Development] Daneshm90:
Ok, so i tested the script a lot and it seems to hold fine, ive added optipng,signapk,7za in the other folder. Its in the main post.
[G1 Android Development] farmatito:
This are the spaces in "Apk Manager 4.0" :D
[G1 Android Development] farmatito:
Attached V0.4:

# v 0.1 Initial version

# v 0.2 add "other" dir to PATH

# v 0.3 remove "function" bashism

# v 0.4 remove more bashisms

I've checked it with bash, dash and ksh shells and

with dirs with and without spaces.

If you experience problems please tell me

what shell you are using so that i can reproduce

and fix it (e.g. what your /bin/sh links to, use ls -la to see it).

BTW.: in a old optimization script i used ogg file size reduction

if you are interested we can add this feature.
[G1 Android Development] oMszKikiIzWavyo:
So I Edited The Appropriate XML And Ad Height, But The Apk Wont Sign. When I Go To 4, It Deletes The Repackaged-unsigned.apk And Also When I Go To 3, And Then Press 2 It Says The System Cannot Find The Specified File.
[G1 Android Development] Daneshm90:
Ah i see, thnx for that. Ill repackage ur 0.4 and include in the OP. As for ogg, its up to you/users to be honest, if people show interest then sure why not.

I was wondering if u cud also do a linux port of recovery changer ? at the time i had a lot of linux users wanting this done. However if its too much work then forget about it.

The script is almost like a step-to-step guide. So steps MUST be done in order :) So in order to xml edit you MUST have used option 9, then u edit the xml, then either do options 10,11,12 or just do option 13 which does all those steps for u :) Make sure you uninstall the current version of the app you have installed.
[G1 Android Development] farmatito:
I just would like to keep windows and linux versions consistent with same menus and submenus. There would be also gif optimization :D ....

This is the snippet of code that i used for you as inspiration,

If you decide to add it i will to.

# Try to optimize png files.
# Needs optipng
infile=`ls $a | grep '\.png$'`
if [ -n "$infile" ] ; then
optipng -q -o 7 $a
fi
# Try to optimize a ogg files.
# Needs sox
infile=`ls $a | grep '\.ogg$'`
if [ -n "$infile" ] ; then
sox $a -C 0 temp.ogg
if [ -e temp.ogg ] ; then
rm $a
mv temp.ogg $a
fi
fi
#Try to optimize a gif files.
# Needs ImageMagick.
infile=`ls $a | grep '\.gif$'`
if [ -n "$infile" ] ; then
convert $a -fuzz 5% -layers Optimize temp.gif
if [ -e temp.gif ] ; then
rm $a
mv temp.gif $a
fi
fi

Potentially I could. The problem is time, the apk manager port was possible

just because I had one day off but this happens rarely. :D

Have you a link to the recovery changer?

Enjoy.
[G1 Android Development] Daneshm90:
Hmm, im confused as to the usage of gif files, are they used in android ? Regardless i think considering the g1's space limitation i think compressing ogg would be a valid option. The recovery changer link is in my signature. Im guessing there is a windows version of sox ? if so i will add the option.

Yup nvm there is a windows version of sox, cool so ill implement it as well.
[G1 Android Development] Daneshm90:
So im thinking ogg compression would be best implemented the same way as batch apk compression ? so a folder called "place-ogg-here" and the script batch compress the ogg in there using

sox filename.ogg -C 0 temp.ogg

Also why not make the compression -1 instead of 0 ? any side affects ?
[G1 Android Development] farmatito:
Most of the animated images in android are gif but there are just a few,

most are png. So we can skip gif optimization for now...
[G1 Android Development] farmatito:
SoX can decode all types of Ogg Vorbis files, and can encode at
different compression levels/qualities given as a number from -1
(highest compression/lowest quality) to 10 (lowest compression,
highest quality). By default the encoding quality level is 3
(which gives an encoded rate of approx. 112kbps), but this can
be changed using the -C option (see above) with a number from -1
to 10; fractional numbers (e.g. 3.6) are also allowed.

I remember correctly -C -1 sounds bad, -C 0 was acceptable :D
[G1 Android Development] Daneshm90:
Ah i c, thnx so ill keep it at 0 :)
[G1 Android Development] Daneshm90:
K so this is wht i put in my batch

:ogg
cd other
mkdir temp
FOR %%F IN ("../place-ogg-here/*.ogg") DO sox "../place-ogg-here/%%F" -C 0 "temp\%%F"
cd ..
MOVE other\temp\* place-ogg-here
rmdir /S /Q other\temp
goto restart

Whenever u get the linux version ready let me know, btw brut.all released 1.3.1 of apktool.jar so gotta include that as well in mine/ur release. Quick question, in linux is there no way to double click to run a shell script ? i mean i see the "run in terminal" option but that always has issues and returns errors.
[G1 Android Development] farmatito:
Ok, what is the menu entry for :ogg?

I suspect that's the spaces in dir name....

You could create a launcher icon for the script and specify there to run it in a terminal and eventually the working dir.

How to do this depends mostly on which desktop environment you are running (KDE, Gnome, Xfce, LXde ...).
[G1 Android Development] Daneshm90:
Ah i see.

Heres wht i have for the menu option

echo 16 Batch optimize ogg files (inside place-ogg-here only)
[G1 Android Development] Brut.all:
No problem for me, I read both threads :-) And people usually don't know, what is the problem, so they can't know, where to post their issues.
[G1 Android Development] Daneshm90:
Ok Cool. Yea didn't think of it that way lol.
[G1 Android Development] sombionix:
Hey, thanks again for your help. Couple more questions still in regards to the Vibrant.

So we've already figured out that I have to use an unedited version of the framework-res and twframwork-res. Now I'm stuck on something else.

The touchwiz30launcher.apk will not decompile without tossing errors. Similar errors to the ones I was receiving with the framework files. I am using a deodexed, unedited .apk. Also, is there any reason I can't decompile settingsprovider.apk correctly. Every time I decompile, under the res folder, I only get the drawable folder. No values, no xml of any kind.
[G1 Android Development] Daneshm90:
Hey

try decompiling with dependencies option. When asked drag twframework into the window n press enter.
[G1 Android Development] sombionix:
Put touchwiz30launcher.apk in modding folder, decompiled with dependencies, dropped twframwork.apk in window when asked, started to decompile then threw out an error.

EDIT: I figured out the TouchWiz30Launcher.apk. Got it all edited. Thanks! Your advice worked. But now I'm still stumped with the SettingsProvider.apk.
[G1 Android Development] eViL D::
I: Baksmaling...
I: Loading resource table...
W: Skipping "android" package group
I: Decoding resources...
I: Loading resource table from file: C:\Users\dz\apktool\framework\1.apk
I: Loading resource table from file: C:\Users\dz\apktool\framework\2.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=textColor, value=0x0207002b
W: Could not decode attr value, using undecoded value instead: ns=android, name=textColor, value=0x0207003c
W: Could not decode attr value, using undecoded value instead: ns=android, name=text, value=0x020a00e3
W: Could not decode attr value, using undecoded value instead: ns=android, name=text, value=0x020a0190
Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec: 0x0207002b
at brut.androlib.res.data.ResPackage.getResSpec(Unknown Source)
at brut.androlib.res.data.ResTable.getResSpec(Unknown Source)
at brut.androlib.res.data.ResTable.getResSpec(Unknown Source)
at brut.androlib.res.data.value.ResReferenceValue.getReferent(Unknown Source)
at brut.androlib.res.data.value.ResReferenceValue.toResXmlFormat(Unknown Source)
at brut.androlib.res.data.value.ResAttr.convertToResXmlFormat(Unknown Source)
at brut.androlib.res.decoder.ResAttrDecoder.decode(Unknown Source)
at brut.androlib.res.decoder.AXmlResourceParser.getAttributeValue(Unknown Source)
at org.xmlpull.v1.wrapper.classic.XmlPullParserDelegate.getAttributeValue(Unknown Source)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.writeStartTag(Unknown Source)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.event(Unknown Source)
at brut.androlib.res.decoder.XmlPullStreamDecoder.decode(Unknown Source)
at brut.androlib.res.decoder.ResStreamDecoderContainer.decode(Unknown Source)
at brut.androlib.res.decoder.ResFileDecoder.decode(Unknown Source)
at brut.androlib.res.decoder.ResFileDecoder.decode(Unknown Source)
at brut.androlib.res.AndrolibResources.decode(Unknown Source)
at brut.androlib.Androlib.decodeResourcesFull(Unknown Source)
at brut.androlib.ApkDecoder.decode(Unknown Source)
at brut.apktool.Main.cmdDecode(Unknown Source)
at brut.apktool.Main.main(Unknown Source)

I'm getting this error decompiling phone.apk for desire hd. I've tried with and w/o dependencies. Any ideas?
[G1 Android Development] CUKIO34:
anytime i open apk manager it says"Adb was not found, you will not be able to manipulate the files on your phone

Press any key to continue . . ."

my log says

--------------------------------------------------------------------------

|Tue 09/28/2010 -- 19:06:24.50|

--------------------------------------------------------------------------

java version "1.6.0_17"

Java(TM) SE Runtime Environment (build 1.6.0_17-b04)

Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)

'adb' is not recognized as an internal or external command,

operable program or batch file.

what do i got to do to get adb to function properly?
[G1 Android Development] techmik67:
Do you have the android sdk? if so, add the address to the adroid-sdk/tools in your path statement. If not, Download android sdk from http://www.megaupload.com/?d=A5JXON6T and use that.
[G1 Android Development] CUKIO34:
yea i got android sdk

C:\android-sdk-windows

is the adb only nesarry if you got the phone hooked up to the computer? cause i didnt, for some reason i was thinking that apk manager wasnt working properly but it seems to be working i just didnt have my phone connected so adb wasnt running.

im tring to edit a theme. the theme comes in a update.zip with multiple apks inside of the the update.zip. So if i extract all the apks into apk manager and edit what i need to edit. How do i combine all the apks back to the signed update.zip?
[G1 Android Development] tom_codon:
hi Daneshm90 !

i trying decompile yahoo messenger app and rebuild again (not change anything yet, just for try ), it's always give me smaller apk than original , and when install to device , it can not run , i have no idea why

step by step :

1. type 22, select apk want to be decompile

2. type 9 for decompile

3. type 11 rebuild it

4. type 12 sign and final 13 for install to device

please help me check it.

Thanks :)

here is original file :
[G1 Android Development] steveocarr:
Java Not Found

Noobie here.

I get the Java not found error on startup. I followed the link to the Java site where a solution is stated, but I'm still having issues with it not recognizing Java.

What CLASS file do I need to direct it to for my PATH?

Any help is appreciated. Thanks
[G1 Android Development] Daneshm90:
Refer a few posts back, i showed what to do to another user, it'll come in handy for u as well.
[G1 Android Development] steveocarr:
I read that post, and followed the link to the Java site, but am still having trouble with it. I don't know which CLASS file in the Java program files to direct it to. As it stands it's currently directing to: .;C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip
[G1 Android Development] Daneshm90:
It should be pointing to the bin directory.

Example :

C:\Program Files (x86)\Java\jre6\bin
[G1 Android Development] ilangoadigal:
fixed. nothing to see here
[G1 Android Development] steveocarr:
So I've put my apk in the place-apk-here-for-modding folder and when I try to decompile it I get the "please select a project to work on" return.

If I put a folder in the project's folder it won't select it.

What do I need to do to decompile an apk?
[G1 Android Development] Daneshm90:
Press 22 and select the apk u want to work on.

If u have only 1 apk in the "modding" folder it'll autoselect that.
[G1 Android Development] ilangoadigal:
I was able to zip my apk, sign it and zipalign it, but it won't install on my phone (problem parsing package). Any ideas about why this might be happening?
[G1 Android Development] steveocarr:
I can't seem to get my phone to show up when I run adb devices in the command prompt. When I plug my phone in though it shows in the device manager.

Can't seem to figure this out.
[G1 Android Development] floepie:
Great app, thank you!

Just a quick question for ya: I would like to modify a few loose XMLs already in the compiled format. I'm looking for a shorthand way of converting them back and forth from decompiled to compiled format *outside* of an APK in order to edit them and for use with Metamorph. Can your app do that?

Right now, I must take an APK (doesn't matter which one), extract it, insert the compiled XML, re-zip the APK, then decompile it in order to read the XML.

Thanks.
[G1 Android Development] elecga:
Is there a list of apps that shouldn't be zipaligned? I'm assuming everything including system apk's can be png optimized but I read that some apps dont like zipalignment (keyboards, settings).

I did a test and ran a batch on a bunch of 3rd party and system apks. I did both optipng and za and the only one that seemed to give an error was Swype. Framework and all other system apks seemed to be running fine but I didn't get a chance to test much, so some of them may have had problems.

So is there a list anywhere of apks not to optipng or za? or does anyone know off the top of their head which ones are a no-go?
[G1 Android Development] ykkfive:
dono if it has been reported. i have just found a bug in the windows version (linux version not checked). if the apk filename contain a space , the bat will quit, with part of the filename in the error log. must be missings quotes for the filename
[G1 Android Development] davdavo:
Please add feature to zip align and deodex rom.

Thanx for the killer tool. :)