yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] Ghostbustersin:
Hi,

I'm getting the same error while recompiling through APK Manager,

I've upgraded to latest SDK 3.2 r13 still m getting the errors. I've latest java jdk1.6.0_26 installed as well. Adb n aapt are also in path variables and i can run adb from anywhere. Still m getting these errors.

What m I doing wrong?
[G1 Android Development] akachay:
3. Java/adb are in your path

can someone show me how step 3 is done plz. everytime i start the script.bat, i get the message adb not found. so i can't do any modding, i believe step 3 is the reason. feel free to shine some light my way thanks.
[G1 Android Development] roscoenr:
http://www.java.com/en/download/help/path.xml basically the same for adb
[G1 Android Development] dreamsforgotten:
Is the framework already modded like from a rom or theme?
[G1 Android Development] Ghostbustersin:
No the file i'm using is from stock source. I'm modifying a single line in /res/values.
[G1 Android Development] Madala_ZA:
So, do you have the Android SDK installed? And Java? If no, then pls install these first. If yes, then search this thread for "environment variables". You just need to add them to your path. If you're using Windows, this is done using environment variables and adding it to your path. It's really easy. Here's something I posted about 6 pages back:

Here is the excerpt of the Android SDK from my path: C:\Program Files\Android\android-sdk\platform-tools\;C:\Program Files\Android\android-sdk\

Here's my java path for you to reference: C:\Program Files\Java\jdk1.6.0_26\bin;C:\Program Files\Java\

These may be different for you, depending on what you called your SDK and java installation.
[G1 Android Development] akachay:
i got it to work. do you know how i can go about changing the phone png on cm7 rom? phone and contact png are the two i needed that is not changing at all.
[G1 Android Development] roscoenr:
no i do not I use sense
[G1 Android Development] -viperboy-:
When I do batch optimize, it stops periodically and asks if whatever_app/res is a file name or directory. Why does this happen? It makes batch jobs take forever cause it won't run by itself. I searched and didn't find anything.
[G1 Android Development] k0sh:
can any one tell me what is wrong ?

suddenly the appmanager wont work and given me this

java version "1.6.0_16"

Java(TM) SE Runtime Environment (build 1.6.0_16-b01)

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

.apk) was unexpected at this time.
[G1 Android Development] TheMuffStuff:
My apk manager was working fine yesterday, now all of a sudden as soon as I open the script it closes. =/
[G1 Android Development] itsmejson:
I'm stuck w/ "adb not found"

I'm on win7 64bit and android sdk was installed in:

C:\Program Files (x86)\Android\android-sdk\tools

C:\Program Files (x86)\Android\android-sdk

how do I set the path correctly? I've read through this

but still unable to get it working.

https://www.java.com/en/download/help/path.xml
[G1 Android Development] Madala_ZA:
On Win7 here's how you get to environmental variables to set path: click start >> right-click "computer" >> properties >> "advanced system settings" >> "environment variables" >> on the bottom block scroll down to "path" >> click "edit"

Put your adb path in.. here is the excerpt of the Android SDK from my path: C:\Program Files\Android\android-sdk\platform-tools\;C:\Program Files\Android\android-sdk\
[G1 Android Development] Madala_ZA:
end adb process and try it again, it should work then.

to end adb process: CTRL+SHIFT+ESC >> select "processes" tab >> select "adb" >> click "end process"
[G1 Android Development] itsmejson:
awesome! that did it :)

- turns out it was my user error...

- i was pointing to ...\tools not ...\platform-tools
[G1 Android Development] Madala_ZA:
haha awesome! glad you sorted ;)
[G1 Android Development] Chris95X8:
Hey, when I try to compile an app, it says that I must set a project to work on. I select option 22 and it requires the number of the app??? What number??? Where can i find this?
[G1 Android Development] Madala_ZA:
what does the error in the log file say..?
[G1 Android Development] roscoenr:
place the apk in the place-apk-here-for-modding folder then run the script if you still have to chose an apk press 22 then a list of the apks in the place-apk-here-for-modding folder will show up find the one you want and type the number that is before it
[G1 Android Development] Chris95X8:
I've decompiled the apk, it appeared as a folder (which ends with .apk) in the Projects folder. I made some changes in it, now how do I make it an apk again?

That's where I'm stuck. Maybe I'm missing something obvious:confused:
[G1 Android Development] tommytomatoe:
In the main menu there should be an option to recompile. Press the option.
[G1 Android Development] Chris95X8:
Yes, I know. I select that and it says I must select a project to work on (option 22)

There are two decompiled .apks in the project folder but when I select option 22, it asks for the number of the app, but what number? Is there supposed to be a list or something below that?
[G1 Android Development] $omator:
its suposed to be the apk number file that you decompiled and edited
[G1 Android Development] Chris95X8:
Maybe I should tell everything that happened to clear this up.

First, I put a theme apk in the "put apk here for modding" folder.

I decompiled it and it appeared as a folder in the projects folder.

I made some icon changes in that folder and I want to make it an apk again.

Now, how do I do this?
[G1 Android Development] tommytomatoe:
Just a heads up...if you just change images no need to decompile. Just use 7zip and take out the res folder of the apk. Swap images. Place new res folder back. Much much easier. :-) i dont have windows so I can't help you with apkmanager specifically sorry.
[G1 Android Development] maddoggin:
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 3
at java.lang.String.charAt(Unknown Source)
at brut.androlib.res.xml.ResXmlEncoders.findNonPositionalSubstitutions(ResXmlEncoders.java:165)
at brut.androlib.res.xml.ResXmlEncoders.hasMultipleNonPositionalSubstitutions(ResXmlEncoders.java:138)
at brut.androlib.res.data.value.ResStringValue.serializeExtraXmlAttrs(ResStringValue.java:63)
at brut.androlib.res.data.value.ResScalarValue.serializeToResValuesXml(ResScalarValue.java:65)
at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResources.java:264)
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:137)
at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:93)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:98)
at brut.apktool.Main.cmdDecode(Main.java:120)
at brut.apktool.Main.main(Main.java:57)[CODE]

getting this when trying to decompile the new market!any ideas?
[G1 Android Development] ecsnead69:
Evernote?

I am working with the latest Evernote app (free) and I am able to decompile just fine, but when I compile (with no changes), I get this error log..

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

|Sun 07/24/2011 -- 13:12:33.07|

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

--2011-07-24 13:12:33-- http://dl.dropbox.com/u/14513610/apkver.txt

Resolving dl.dropbox.com... 50.17.233.29

Connecting to dl.dropbox.com|50.17.233.29|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 31 [text/plain]

Saving to: `apkver.txt'

0K 100% 995K=0s

2011-07-24 13:12:33 (995 KB/s) - `apkver.txt' saved [31/31]

A subdirectory or file projects already exists.

A subdirectory or file place-apk-here-for-modding already exists.

A subdirectory or file place-ogg-here already exists.

A subdirectory or file place-apk-here-to-batch-optimize already exists.

A subdirectory or file place-apk-here-for-signing already exists.

A subdirectory or file projects already exists.

java version "1.6.0_25"

Java(TM) SE Runtime Environment (build 1.6.0_25-b06)

Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, mixed mode)

Could Not Find D:\Android Theme\Apk Manager 5.0\place-apk-here-for-modding\../place-apk-here-for-modding/signedevernote.apk

Could Not Find D:\Android Theme\Apk Manager 5.0\place-apk-here-for-modding\../place-apk-here-for-modding/unsignedevernote.apk

I: Baksmaling...

I: Loading resource table...

I: Loaded.

I: Loading resource table from file: C:\Users\Eric\apktool\framework\1.apk

I: Loaded.

I: Decoding file-resources...

I: Decoding values*/* XMLs...

I: Done.

I: Copying assets and libs...

I: Checking whether sources has changed...

I: Smaling...

Exception in thread "main" java.lang.NullPointerException

at org.jf.util.PathUtil.getRelativeFile(PathUtil.java:44)

at org.jf.smali.smaliFlexLexer.getSourceName(smaliFlexLexer.java:2569)

at org.jf.smali.smaliFlexLexer.getErrorHeader(smaliFlexLexer.java:2661)

at org.jf.smali.smaliFlexLexer.nextToken(smaliFlexLexer.java:2530)

at org.antlr.runtime.CommonTokenStream.fillBuffer(CommonTokenStream.java:119)

at org.antlr.runtime.CommonTokenStream.LT(CommonTokenStream.java:238)

at org.jf.smali.smaliParser.smali_file(smaliParser.java:430)

at brut.androlib.mod.SmaliMod.assembleSmaliFile(SmaliMod.java:71)

at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:43)

at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:33)

at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:64)

at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:48)

at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:35)

at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:222)

at brut.androlib.Androlib.buildSources(Androlib.java:179)

at brut.androlib.Androlib.build(Androlib.java:170)

at brut.androlib.Androlib.build(Androlib.java:154)

at brut.apktool.Main.cmdBuild(Main.java:174)

at brut.apktool.Main.main(Main.java:59)

Thanks for any help!
[G1 Android Development] -viperboy-:
Can anyone help me with this? I'd love to be able to do a batch job without it stopping for this.
[G1 Android Development] v4nelle:
On advanced tasks,there are not options to zipalign and optimize the pngs of apk...

there is no need of these after editing the code of an apk?

sorry for my english
[G1 Android Development] roscoenr:
option 15

-----------

Other Stuff

-----------

15 Batch Optimize Apk (inside place-apk-here-to-batch-optimize only)
[G1 Android Development] xTFGx:
where does my signed apk end up?
[G1 Android Development] TheNewGuy:
I am still working on these .9.png's...and I have two questions.

1) how to figure out where/how much border is required for the .9.png to behave as intended...it seems that if I place a border in the wrong way..such as simply covering all four sides...it will not display correctly..so how do I know how to make the border? Is the least number of pixels always best? And how do I know what sides need a border?

2) I am still having the most trouble with trying to use my themed/modded .9.png's to work in my source for my rom. I would like to add in my theme to my source before I compile. So that I don't need apk_manager.... I thought that if I could get it to compile with apk_manager then it would compile the rom correctly...but it does not seem that easy...

Does anyone know how to achieve this? What steps do I need to do? What is the best/easiest way to do this?

Thanks for your help.
[G1 Android Development] dully79:
The borders are as follows

- bottom and right control where the text is drawn.

- top and left control what is stretched

All this is defined by the pixels you draw on the image.

Click the check boxes in draw9patch tool and enlarge the image and you'll get an idea of what it will look like.

Hope this helps.:)
[G1 Android Development] TheNewGuy:
Thank you! that info does help a lot!

If you can, could you show me how you would place the border on this .9.png?

is the little plus sign considered text?
[G1 Android Development] dully79:
Is that image btn_plus or btn_zoom from framework-res?
[G1 Android Development] TheNewGuy:
Sorry...It is btn_zoom_up_selected..from framework-res
[G1 Android Development] dully79:
Then the plus sign is part of the image and shouldn't really be stretched or it might look a bit crazy. The downside to your btn is it has a pattern on it, .9's hate patterns with a vengeance. I've had to scrap loads of projects in the past coz of this. I'll fire up my draw 9 tool and have a little look.
[G1 Android Development] CleveRuse:
Can anyone help me change the color of the text for my status_bar-items (dropdown) on android 2.3.3 GB? I wanna change it to white. I can't get UOT Kitchen to load my ROM (Synergy - ThunderBolt)

I read somewhere that I wanted 'status_bar_tracking.xml', so being that i don't know how to change that, I found a couple themes (for EVO 4G cuz I'm told its virtually identical to the TB) that had a clear bg w/ a white text, then copied n pasted that file to replace mine, but using that file from either one of those themes breaks my statusbar (disappears). I've successfully used other images from these themes but this one breaks it every time.

If someone can walk me thru editing this file, that'd be great but I can prolly find info on editing xml's myself. I more so, just need a push in the right direction. Am I even close to changing the text? Is that really the file I need?

Like I said, I'll take all the help I can get, but if someone can merely confirm that I'm on the right path, that'd prolly be sufficient.

Tnx in advance.

Edit: I've avoided editing xml's b4 cuz I believe I need to decompile, n the last time I decompiled, afterwards I wasn't able to re-compile (like I chose the option in APK Mgr and nothing happened) I'm on Linux (Imma try WINE next) if it makes a difference
[G1 Android Development] dully79:
Goto item 3

http://xdaforums.com/showthread.php?t=831715

hope this helps.:)
[G1 Android Development] dully79:
@TheNewGuy,

If you place these in your draw9patch tool you will the difference between the images.

The "btn_zoom_up_selected_full.9.png" will stretch the image out and distort it. The "btn_zoom_up_selected.9.png" will stretch the surrounding of the image keeping it the same size, hope that makes sense:confused:
[G1 Android Development] CleveRuse:
Thnx ...LOL, now if I can just make Sense of it. (lame pun intented)

Actually tommyT sent me some help too. I'm just beginning to look at now.

I love u guys, :) Thnx again!
[G1 Android Development] TheNewGuy:
Thanks again! I think i see the difference. Did you need to add the lines on the right and bottom(the ones for text, right?) because of the texture like you mentioned?

and if I understand right than this one would work...
[G1 Android Development] dully79:
Your welcome.

Yes, if you don't add the lines the text will over run the image into the plus sign, although I've never seen the the btn_zoom_*** images with any text on them.

That looks fine what you've done. Just give it run on your device to see how it looks in the real world.
[G1 Android Development] KOala888:
i've got a problem

I have pulled framework-res.apk from rom, decopiled it, compiled, pushed back and then my phone bootloops

So i can't theme, because it doesn't boot even it i don't change anything.

i have done fresh install of rom, wpidet it, nothing helped.

i use samsung spica with cm7 if it matters

please help
[G1 Android Development] dully79:
That's happened to me last year, I think???? I got it back by flashing a different rom, then flashed back to the previous.????

Sorry I'm not much help it was a while ago.:(
[G1 Android Development] KOala888:
it didn't help

i have even flashed a stock 2.1, rooted, applied cm7 and it still bootloops if i change framework
[G1 Android Development] tommytomatoe:
What are you doing to framework?
[G1 Android Development] chriscsh:
i try to modify the stock calendar.apk

when i modify the xml file in the apk/res/layout

it will crashed and can't launch the app ???

i try some other and have this problem too :confused:

anyone can help :(
[G1 Android Development] KOala888:
it bootloops even if i only decompile and compile it without changes....
[G1 Android Development] k0sh:
U cant flash the framework u compiled "unsignedframework"

The only thing u should do is

Grab the "res" file and resource from the framework and delete it from the original framework and then copy those 2files from unsignedframework to the old one

And guess what , no more bootloops :p
[G1 Android Development] KOala888:
seems to work, BIG THANKS DUDE :D
[G1 Android Development] suprano:
im getting adb not recognized as internal or external command.anything im missing?
[G1 Android Development] $omator:
ya, path =)
[G1 Android Development] CleveRuse:
Man....can someone help me recompile apks? I don't understand. I'm on Linux if it helps. I've also tried 'android-utility'. In both instances, after I decompile and edit its like that's all the further I can go. Android-Utility says "cant find a valid project" and APK Mgr ....well, when I choose to compile nothing happens.

What is the exact process u guys do to recompile apks?
[G1 Android Development] TheNewGuy:
Open apk_manager...

Select "22"

Select the # corresponding to the apk you want to work with

Select "9" to decompile

Select "22"

Select the # corresponding to the apk you want to work with

Select "11"

When it pauses and asks if it is a system app..answer the question..and the next question..(for framework-res.apk I answer "y" to both questions)..

You should see it doing stuff on the screen..

Then when it pauses again..READ THE MESSAGE IT DISPLAYS.

Then....READ IT AGAIN!!!!!

then do what it says..delete the stuff you edited from the newly created "keep" folder..and leave everything you didn't touch..if you edited ANY .xml then you need to delete the resources.arsc also....

Then return to the script and press enter..

It should finish and generate a file in the "place-apk-here-for-modding" folder named "unsigned_yourappname.apk"

*note*

Notice I didn't say anything about editing before compiling...that's because you should always make sure that apk_manager can recompile it "as is"...because for example..

Many themed framework-res.apk have edited .9.png in them..and apk_manager will be able to decompile but not recompile them untill you fix there borders with draw9patch..but that's another whole thing (I'm messing with that right now) :)

So that way if you have probs after editing then you know it was your fault..haha.

*note2* I have not had as much luck using apk_manager with linux as I have had with windows...so you might want to try it on both if you can...

Hope this helps.
[G1 Android Development] CleveRuse:
U prolly already know this but .9s r super easy. For most u just draw a perfect '+' over top. One dot in the middle on top, n one dot in middle on the left. Sometimes if the image has shading, especially if long ways down the middle (like a line dividing dark n light) its better to draw a 'tic-tac-toe', two dots at the top, two on the left. I think the space in the middle that's created by the intersecting lines defines the part that will NOT be stretched. (could be wrong bout that)

And for the text placement, it'll default to android settings I believe so not really necessary but just two dots on the right, n two on the bottom. Make both sets even, and far enough apart to define where the text should fit. Obviously the bottom is for length, n side (right) for height.

Like I said, u prolly already know, but could help someone else ......and thnx by the way.
[G1 Android Development] CleveRuse:
Ok I fixed it but that above should say for the + sign one dot in middle top, n one dot middle LEFT (not right)

N those r "prolly"s not "prologue" or "propounded", LOL. .....and I thought that "divide" looked wrong, ;)
[G1 Android Development] rockypr:
Im getting this error while trying to decompile an HTC Sense 3 Theme APK

If someone could help me.
[G1 Android Development] suprano:
can anyone help me set path for this on my laptop. im on windows 7. please? thanks.
[G1 Android Development] akachay:
i have tried to change the phone icon of the phone.apk from cm7 without any success. can someone point me in the right direction? thanks. btw, i'm doing the exact same step to change browser.apk and sms.apk but can't change either phone.apk nor contact.apk.
[G1 Android Development] akachay:
http://geekswithblogs.net/renso/archive/2009/10/21/how-to-set-the-windows-path-in-windows-7.aspx
[G1 Android Development] tommytomatoe:
Use 7zip. Take out the res folder from the apk. Replace desired icon. Place res folder back into apk. No need to decompile if you are simply swapping pngs. Then adb push back to system/app.
[G1 Android Development] akachay:
since i don't know adb push&pull. i use root explorer>went into system/app copy the phone.apk to my computer>open phone.apk with 7zip>goto res (hdpi)>replace ic_launcher_phone.png>close 7zip>copy phone.apk to sdcard>use root explorer (mount)paste it over orignial phone.apk in system/app. am i doing it right?

my result was a forced close, i reboot my phone. the "phone" icon remain the same and i have no network connection.
[G1 Android Development] $omator:
delete phone odex and maybe clear dalvik cache
[G1 Android Development] tommytomatoe:
Root explorer works great but you need to see permissions. I think the phone has rw-r--r-- permissions. See it by long pressing on app. You also need to remember to mount as r/w

Anytime you "install" an app like this reboot and wipe dalvik and cache.

Also...if you on cm7 there are no odex files. And you should never delete odex files if you have not deodexed prior or are replacing it. Without odex app won't work.

I would suggest trying to learn adb and install the sdk Android
[G1 Android Development] $omator:
for permissions i would suggest cwm/advanced/fix permissions not root explorer

but if the copied app contains dex file in it it will work

it works for phone apk and a lot of others mate
[G1 Android Development] tommytomatoe:
If he is modifying an apk with dex file inside it...there should not be an odex file outside it also. That's what is meant by "deodexed prior". Especially if he is Modding on a stock cm7 install tthere are no odex.

The fix permissions sscript is a good tool for multiple fixes but when you just place one apk or move one binary root explorer permissions setter works like a charm. :-)
[G1 Android Development] suprano:
thanks mate :)
[G1 Android Development] akachay:
thanks guys!!!

i cleared dalvik cache but still no network signal. it was late so i nandroid and go to bed. thanks for the inputs. i'll try again when i have time.

UPDATE:

1) adb pull /system/app Phone.apk phone.apk > open apk with winrar > replace ic_launcher_phone.png > close winrar

2) adb remount

3) adb push Phone.apk /system/app/Phone.apk

4) adb reboot

nothing happen. still stock phone.png. anything i missed or is cm7 need to be done differently??? any help would be much appriciated.
[G1 Android Development] lippol94:
Is there anyway to get an updated Apk manager for linux? (4.9)

Thanks mate! :)
[G1 Android Development] |ErosizeD|:
I'm having the following problems to compile an apk...

Compiles the apk but not the smali ( modified ) files, just the original ( not modified )

and i dont know why... i get this error when starts.

i dont know what is happenning...
[G1 Android Development] empiire:
So I'm editing framework-res.apk, to add the CRT animation. The tool decompiles fine and lets me edit with Notepad++ just fine, but when I go to recompile the apk and select the option to recompile it literally doesn't do a thing.

EDIT: Nevermind, now I'm getting another error. I hit 9 to decompile, and it says

Please make your decision:9
Please Select A Project To Work On <Option #22>
Press any key to continue...

Then when I hit any key it just goes back to

Please make your decision

And nothing happens. Can anyone explain what I'm doing wrong? What happened above is from a clean start.

EDIT 2: Woooowww, nevermind, I got it. I'm retarded. I forgot to assign it as the project. :D