yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] dully79:
This is how i got it running on linux-

(Some of the changes i made was for ease of use typing in the terminal).

1-Download, create a folder in your sdk called "am" and extract into it.

2-Goto the the "sdk/am" folder and rename "Script.sh" to "script.sh".

3-Go into the "other" folder, right click on one file at a time, goto "permissions" in the new window and check the execute box.(do this with all the files)

4-To add the path to your folder open up a terminal and type in -

sudo su

PATH=$PATH:/THE PATH TO YOUR "SCRIPT.SH"

(for me this looks like the following)

PATH=$PATH:/sdk/am/other/

5-export PATH

6-LOOK AT POST #792!!!! for "sox"

7-Type into the terminal "cd PATH TO YOUR SCRIPT.SH"

8-Type "./script.sh"

9-You should have a running Apk-manager.

To make this PATH permanent do the following-

1-Goto your your home folder and show hidden files.

2-Find ".bashrc" and open with gedit.

3-At the the top of the ".bashrc" file it should have the following-

#AndroidDev PATH

export PATH=${PATH}:/home/<YOUR USERNAME!!>/sdk/tools

add this underneath

export PATH=${PATH}:/home/<YOUR USERNAME!!>/sdk/am/other

4-Save the file and reboot.

5-Type "$PATH" into the terminal and your new PATH should show or type in "apktool" and it should run.

This is what works for me,

hope this helps.:)
[G1 Android Development] Devildog8791:
Excellent!! I'll give it a shot when I get home from work tonight. Thanks for the help. I'll let you know how it turns out.

Edit: Okay I tried it out tonight and this is what I got.

devildog8791@Tims-PC ~ $ sudo su

Tims-PC devildog8791 # PATH=$PATH:/sdk/am/

Tims-PC devildog8791 # export PATH

Tims-PC devildog8791 # cd sdk/am/

Tims-PC am # ./script.sh

The program optipng is missing or is not in your PATH,

please install it or fix your PATH variable

The program 7za is missing or is not in your PATH,

please install it or fix your PATH variable

The program adb is missing or is not in your PATH,

please install it or fix your PATH variable

Tims-PC am #
[G1 Android Development] dully79:
Try-

PATH=$PATH:/sdk/am

export PATH

Then type "$PATH" into your terminal, it should run a list of your environment variables including sdk/am.

If your still having the same issue google how to set path environment, im away from my ubuntu machine for a week.:(
[G1 Android Development] jbrew78:
Ok, Ive searched through the thread but haven't seen exactly what I'm looking for. My problem is this. I'm trying to change the clock color on the status bar. Found a thread saying which xml files to look for. The status_bar_expanded.xml I believe is the one that has the font color for time. I edit the color, save the file and recompile. Everything seems to go fine, but when I put the framework-res.apk back in the rom and load it onto the phone I get boot loop. I'm starting with the original, unedited framework-res. I can change font colors in status_bar.xml and status_bar_latest_event.xml with no problems booting. Anyone got any ideas?
[G1 Android Development] theimpaler747:
Use a Hex editor, edit the XML, and then simply push that file and flash the new framework.
[G1 Android Development] Daneshm90:
There's lot of missing information in your post.

How are you putting the file back on your phone ?

Are you restoring the manifest and digest from the original apk ?

Only then can we assist you.
[G1 Android Development] jbrew78:
I'm using the htc kitchen to build a rom. I use the apk manager to decompile and recompile after changes then put the framework-res.apk into the working folder and build the rom. Then I flash the rom through recovery. I just got it to boot with the black status bar, but clock is still black. This attempt I decompiled, made the font color changes, recompiled, then set project to the new file, extracted and copied the file I edited, set project back to original framework-res, copied the edited file in, zipped, and then put the framework-res back into my working folder. This is just one of many ways I have tried to make this work...

EDIT: The text when I pull down the status bar is now white also. So it would appear the file I edited isn't what I need to edit to change the clock color or there is another file somewhere that also needs to be edited to change the clock color. If anyone here has successfully changed the clock color, please pm me and let know how you did it. Looks like my problem is not with the apk manager...
[G1 Android Development] Daneshm90:
Ok try this :

Decompile

Make changes

Compile

Say yes to system

go in keep folder and delete only the files u modified

Finish off.

Then push that to your phone. No signing nothing.
[G1 Android Development] 5haddex:
Can someone tell me where I can get the ADB program from as this is the only error I am getting "The program adb is missing or is not in your PATH,".

HELP !
[G1 Android Development] dully79:
Have you heard of Google?
[G1 Android Development] 5haddex:
Have you heard of answering questions rather than posting stupid replies?

nm Ill ask elsewhere
[G1 Android Development] dully79:
ask a stupid question you get a stupid answer!

If you type your command error into Google and hit search I guarantee you'll get a solution
[G1 Android Development] theimpaler747:
Let's keep it friendly please

Sent from my hero running froyo... take that Sprint!
[G1 Android Development] Devildog8791:
I'm having problems downloading the Linux version. Is the file being updated?
[G1 Android Development] sparksco:
I had problems with this as well, I really wanted to try this out and I can't dowload it. We need a mirror like mediafire or something :(

Edit: Here's the direct link for the linux version: http://rapidshare.com/#!download|225tl2|417753157|apk_manager_linux_4.7.zip|6278
[G1 Android Development] Devildog8791:
I tried that link and I got the same error message:

/tmp/nfH7ZQcB.bin.part could not be saved, because the source file could not be read.

Try again later, or contact the server administrator.

Thanks for trying to help me though.
[G1 Android Development] DaGunn:
I assume you installed the latest SDK. Go into your platform-tools folder and you will find adb and two other files that start with adbWin. Copy those three files into you C:\windows\system32\ folder and you should be good to go.

HTH
[G1 Android Development] sparksco:
I'll post a mirror
[G1 Android Development] Devildog8791:
I'm still having problems. I got it to recognize adb and optipng, but no dice on 7za.

Edit: Okay, I think I have it figured out. I had to go into Synaptic Package Manager and reinstall optipng and that fixed my issue with optipng. I then went back in there and reinstalled p7zip and then installed p7zip-full. I don't know if I had to have both of those installed, but I was able to get the GUI to come up and I have all of the folders that I need in the "am" folder.

Thanks for the help you gave me, dully79.
[G1 Android Development] Devildog8791:
I finally got it to download. I think I used the Megaload link.
[G1 Android Development] sparksco:
Ok, well here's a mirror for anyone else http://www.mediafire.com/?1qx0cez1eghdzcp
[G1 Android Development] sparksco:
What do we do for this with linux? I'm getting the same error
[G1 Android Development] DaGunn:
I have not used linux for many years, but I would add the folder that contains adb to my path.
[G1 Android Development] sinichi21:
hi im having same problem can u please tell me what to do i have tried to copy the 3 adb files on system32 but now im getting "adbwinapi.dll is missing from your computer. try reinstalling the program to fix this problem" Im getting stuck here i have the said adwinapi.dll in the system32 folder and still its saying its missing. im running windows 7 64bit
[G1 Android Development] zain3ie:
hi.. i have trouble when i try to modding with apk manager 4.9

- ok first i copy the apk file to place-apk-here-for-modding

- i open the sript.bat

- i choose #22 and select the apk file

- i choose #1 (extract apk)

- and then the sript window is close by self (???)

in the log.txt, it display this:

java version "1.6.0_22"

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

Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing)

Player was unexpected at this time

any solution?
[G1 Android Development] ecsnead69:
Smali edits with 4.9???

I am having trouble compiling after a smali edit or any edit made in the "values" folder after decompiling.... If I compile and select "y" to keep other files, the keep folder does not have the values or smali folders to delete the files I changed... if I select "n" then push, the app goes into /system but the icon is not present in the app drawer and the app won't work???

Anybody know what file I need to delete or the correct way to accomplish what I am trying to do?

Thanks!
[G1 Android Development] Daneshm90:
values is part of resources.arsc

smali is part of classes.dex

I need to know more to help you, like what app is it.
[G1 Android Development] DaGunn:
Suggestion

1st I want to state that this is a very time saving utility.

But, by reading this entire thread, it is more confusing than it is definitive. As the scripts were changed the posts for usage changed and conflicted with prior posts regarding usage.

It would be very helpful if you would post the present version's written step-by-step instructions for modifying framework-res.apk and other .apks. What are the specific steps (by number) when using APK Manager 4.9 to modify/add .xml files and/or .pngs.
[G1 Android Development] Daneshm90:
In general i wrote this script to guide the user, even one who is new to the scene.

Refer to Link

I just gathered solutions to common problems ppl seem to be having.

How to decompile framework-res ?

Put in "place for modding" folder

Run script. Press 22 to choose ur apk

Press 9/10 depending on aosp/htc sense/moto/samsung

Make ur changes

Recompile, choose yes to system, preferably say yes to "keep" folder.

Go in the keep folder, delete everything u did modify and continue with script. U'll find ur apk in the same folder u put it with a diff filename.

Hope that helps.
[G1 Android Development] DaGunn:
Again, I am only attempting to be helpful here. The script instructs to go in to the keep folder and delete everything that I DID MODIFY and continue with the script.
[G1 Android Development] Daneshm90:
Oops, my mistake. Yes the script speaks the truth :p
[G1 Android Development] floomat:
ive tried to decompile a apk from a rom someone made.

i got the error log attached..View attachment logcontacts.apk.txt

what happened there?

i easily can decompile other apks from that rom but at some i get this error log :(

i attached the apk too.View attachment Contacts.apk

hope someone can help me i really want to edit those apks!

greetings
[G1 Android Development] Daneshm90:
Now im guessing this is a themed non-aosp rom ?
[G1 Android Development] floomat:
probably a bit themed but not that apks. they are original and unedited

its a cm6-based rom. so is it aosp or not? :)
[G1 Android Development] Daneshm90:
Well if its themed, then the errors make sense.

Cuz it looks like it cannot decode certain attributes.

For eg, if u take cm 6 framework-res u can decompile/recompile w/o errors.
[G1 Android Development] floomat:
the cm6 frameworks-res is themed in this rom but i can decompile it without problems.

the apks are themed i asked the dev again and he said they are :(

im really confused now :D

is there a way to decompile them without these errors anyway?
[G1 Android Development] floomat:
i took the unthemed ones by the default cm6.1-final for hero and it doesnt decompile too and gives back the same error log as happened on the themed one...so whats the problem? :)
[G1 Android Development] Mich2Ga:
Thanks, will learn this... Good Post
[G1 Android Development] LordXeth:
Hey Guys,

So who is now the new Android SDK has installed R08 on his computer and of course the Java JDK has to put in the Windows system PATH variable the right!

So wirds richtig Eingestellt! Submitted really is!

Java: dafür werden 2 Variablen gesetzt, nicht nur eine! Java variables are set for 2, not just one!

1x Name der Variablen: JAVA_HOME 1x Variable Name: JAVA_HOME

Wert der Variablen: C:\Program Files\Java\jdk1.6.0_22 Variable value: C: \ Program Files \ Java \ jdk1.6.0_22

1x Name der Variablen: PATH 1x Variable Name: PATH

Wert der Variablen: C:\Program Files\Java\jdk1.6.0_22\bin Variable value: C: \ Program Files \ Java \ jdk1.6.0_22 \ bin

Android-SDK: dafür wird eine Variablen gesetzt, aber für 3 Verzeichnisse! Android SDK: it will set a variable, but for 3 folders!

1x Name der Variablen: PATH 1x Variable Name: PATH

Wert der Variablen: C:\android_SDK\tools;C:\android_SDK\platform-tools;C:\android_SDK\platforms\android-8\tools Variable value: C: \ android_SDK \ tools C: \ android_SDK \ platform-tools C: \ android_SDK \ platforms \ android-8 \ tools

Da heißt für Android-SDK & Java Variable PATH wird nur ein Eintrag erstellt! This makes it possible for Android SDK & Java PATH entry is only created!

Das ganze sieht dann so aus! The whole looks like this!

Variablen: PATH Variables: PATH

Wert der Variablen: C:\android_SDK\tools;C:\android_SDK\platform-tools;C:\android_SDK\platforms\android-8\tools;C:\Program Files\Java\jdk1.6.0_22\bin Variable value: C: \ android_SDK \ tools C: \ android_SDK \ platform-tools C: \ android_SDK \ platforms \ android-8 \ tools C: \ Program Files \ Java \ jdk1.6.0_22 \ bin

hier noch ein Screen damit sich keine Fehler einschleichen^^ here's a screen so that no errors creep ^ ^

if you all genaus Sun set up, can also re ect recompile the framework-the res.apk Nightly & CM `s Stable with ApkManager 8.4 & 4.9. pp pp

ohne diese Werte hab ihr kein Erfolg, da die SDK einen neuen Aufbau bekommen hat! without these values you have no success because the SDK has a new construction!

It`s work 100%

mfg LordSeth
[G1 Android Development] velenoso84:
Hello, sorry for my English

I want to change the framework of the Galaxy S. Decompile the file, but when I edit a png, I get the following errors.

Using apk Manager 4.9 e ApkTool 1.3.1 on Windows Seven64Bit

Helpme

Ps: you can help me here? http://xdaforums.com/showthread.php?p=9830735#post9830735
[G1 Android Development] Daneshm90:
My best guess is its happening because you're using a themed framework-res or when u decompiled you did not use the "11" option and drag the tw-framework into the script.
[G1 Android Development] velenoso84:
nothing, does not work either way.

If you decompile / recompile works fine without touching anything

If you decompile / compile a framework already changed (good) I get errors

What is the problem? I'm going crazy
[G1 Android Development] Devildog8791:
Okay, dully79, I hope you are still hanging around in here. I am trying to use APK Manager for the first time in Linux since I installed it. I got to the menu okay and wanted to decompile an apk file and got this error:

Please make your decision: 9

cd: 305: can't cd to other

Exception in thread "main" brut.androlib.AndrolibException: brut.directory.DirectoryException: java.util.zip.ZipException: error in opening zip file

at brut.androlib.ApkDecoder.hasSources(Unknown Source)

at brut.androlib.ApkDecoder.decode(Unknown Source)

at brut.apktool.Main.cmdDecode(Unknown Source)

at brut.apktool.Main.main(Unknown Source)

Caused by: brut.directory.DirectoryException: java.util.zip.ZipException: error in opening zip file

at brut.directory.ZipRODirectory.<init>(Unknown Source)

at brut.directory.ZipRODirectory.<init>(Unknown Source)

at brut.androlib.res.util.ExtFile.getDirectory(Unknown Source)

... 4 more

Caused by: java.util.zip.ZipException: error in opening zip file

at java.util.zip.ZipFile.open(Native Method)

at java.util.zip.ZipFile.<init>(ZipFile.java:131)

at java.util.zip.ZipFile.<init>(ZipFile.java:148)

... 7 more

I set the path to my sdk/am folder. Do you know what I need to do to correct this error? It looks like it wants to try ad find the "other" folder, but I renamed it like you instructed me to in post 801. Do I need to rename it back to "other"?
[G1 Android Development] dully79:
@DevilDog,

**** sorry mate i forgot to add a valuable bit of info!!!.

Go into your "am" folder and create a new one called "other", then chuck everything in except your "script.sh".

I've also updated the original post-

http://xdaforums.com/showpost.php?p=9617614&postcount=801

I guarantee this will work or your money back!!!:D
[G1 Android Development] Devildog8791:
Reading this tutorial has got me confused now. You say to put everything in the other folder except for the script.sh, but your path to it includes the other folder. Also, I am using Linux Mint 10 and there is no .bashrc file in my home folder (I did show hidden folders).
[G1 Android Development] specialex:
hi Daneshm90, thx for the tool

i modified framework-res.apk (unthemed deodexed), but when i set compression level to 9, my phone kept vibrating and got many FC's.

then when i set compression level to 0, it work like a charm, but the size of apk is a bit bigger.

i already tried to set compression level to 1-8, still got vibrating and FC

any tips?

sorry if this been asked before
[G1 Android Development] dully79:
@Devildog, Here's your money $$$$

The PATH to sdk/am/other allows the computer to recognise and execute the tools inside (adb,aapt,7za,etc) when its called for by the script.

You will "cd sdk/am/" to run the script. The command below is taken from "script.sh", it temporarily tells it to go into "other" and execute the program "7za"-

cd other

7za ***blah blah***

You Could go in to the script and edit out all the "cd other" commands and keep everything in the 1 folder, but thats a bit too much work:D

For editing your ".bashrc", i dont your allowed to link outside forums so i'll PM you the link for adding PATH variables.

Hope this helps.:)
[G1 Android Development] amroush_1800:
Here is a small and time-saver tool to decompile to smali and Java source codes http://xdaforums.com/showthread.php?p=9823756
[G1 Android Development] vosszaa:
I already add JAVA into Path and I can type "java -version" in cmd which gives me the java version fine and everything but I still got "Java was not found, you will not be able to sign apks bla bla bla" when I try to run the bat script.

Any solution?
[G1 Android Development] mrvirginia:
hey guys, i'm having trouble re-compiling an apk. it starts compiling, but the says error. below is a link to my log. any help would be greatly appreciated.

http://androgynous.org/log.txt
[G1 Android Development] Daneshm90:
More info required.

What apk, themed apk ? proprietary rom's apk ?....etc

Apk Manager's path, eg C:\......
[G1 Android Development] DaGunn:
I downgraded the version of APKtool that you provided with this package and everything works great!

You have created an excellent tool, thank you sir!
[G1 Android Development] mrvirginia:
framework-res.apk. just trying to edit one line in one xml file haha. been trying to figure this out for hours.

apk managers path is

C:\Users\mrvirginia\Desktop\apk_manage

edit: and yes, it's a themed framework-res apk
[G1 Android Development] Daneshm90:
Ok well try and edit the stock apk of that rom. Aka not themed and see if the problem persists.

Also check out the "Got problems" section i added to op. That should help most ppl.
[G1 Android Development] mrvirginia:
awww man lol i guess i should read entire posts before attempting to use things. thanks for the quick help. the issue is because it's themed. a stock one re-compiled with no hitches. guess i have more work to do!

thanks again
[G1 Android Development] vosszaa:
I search the whole thread and google, still no solution, help plz?
[G1 Android Development] dully79:
An easy solution (windows) would be to download stericsons autosign tool from this site.

Set it up and you can sign any zip or apk by right clicking it.
[G1 Android Development] Retrokid223:
i having some problems compiling apk's in linux. im using a stock fascinate framwork.. here's the pastie.. http://pastie.org/1387598
[G1 Android Development] ~CR7~:
Noob here... im having trouble signing a apk.. it says i dont have java installed in my computer, but i do have it installed.. I went to my computer and edited the path already but when i open the script.bat, i get the same error.. what am i doing wrong...?
[G1 Android Development] da1duc:
Can this be used to sign any application to gain system privileges? I.e. taking the signature from an existing systems applications and using it to sign another app?

Has anyone done this?

Thanks,

D
[G1 Android Development] Mekrel:
Thanks for the excellent script.

I currently maintain a custom HTC Desire ROM, with the aim being to be as close as stock as possible.

However, I'm finding that some users with bad blocks can't fit the ROM on their phone due to the extra Busybox, Bash and AP2SD files.

I could delete a few applications from System, but I wish to have the ROM remain as close to stock as possible, so I'm looking at optimising the .apks.

However, I'm confused by some of the posts in the thread and wish to clarify:

Can you optimise the applications in /system and sign them, even though the ROM ISN'T deodexed? Do I use the 11 option to sign /system applications?

Can you optimise framework-res.apk and sign even though it ISN'T deodexed? Again, which option do I use?

Basically, I'm confused about when you say propriety (Sense etc) applications - because as far as I'm aware, the applications in /system are a mix of:

HTC Applications

Google Applications

3rd Party

Like I said, I've read the thread - but just want to ask for clarification :)
[G1 Android Development] Daneshm90:
You can optimize/zipalign but dont sign.
[G1 Android Development] tilt4life2:
I editing LPP according to this thread: http://xdaforums.com/showthread.php?t=783427&page=75

Here is what I did:

1. Place LPP.apk into the "modding" folder

2. Decompiled

3. Went into "projects" folder

4. Made edits

Now what should I do next?

This is what I did, but when I installed, the program force closes:

5. Went back to Script and chose option 14 compile/sign/install

6. went to phone but force closes

thanks for the help.

I was able to get around this by using 4.8. But hopeful someone can explain how to fix 4.9 problem because that one is easier to use.