yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] RocknSteve:
So I changed the images I wanted to in Handcent's apk and compiled it without errors. Put the modified apk on my phone, uninstalled the original Handcent, and the installed the modified one. The install was "successful" however the application does not work. I noticed that when I go to "Manage Applications" it is not listed as "Handcent SMS" but instead "com.handcent.nextsms". What did I do wrong?

Thanks again!
[G1 Android Development] feefeeboomboom:
help, i guess?

so i have this installed on my c:/ part. when i try to run any of the cmds i get java errors. i have jdk ee update 22 installed on c:/ aswell. windows 7, any help would be awesome lol?

i had it working on vista 32bit no problem..
[G1 Android Development] HewGBalls:
The linux version which is 4.7 does not prompt you for system app when you compile.

Please make your decision: 10

W: Could not find sources

I: Checking whether resources has changed...

I: Building apk file...

it then creates repackaged-unsigned.apk in place-apk-here-for-modding folder

do i now Extract apk delete the resource then Zip Apk and push it to phone or replace the resource file from the original apk and then zip and push it?
[G1 Android Development] HewGBalls:
i think i have figured out a way to make it work..

decompile

edit the xml files

compile

take a copy of the compiled xml files

extract the original apk

paste the xml files

zip and choose system app

push this to phone and no longer bootloops

Would this be right?
[G1 Android Development] Daneshm90:
Same as

Compile -> yes to system app -> yes to keep folder -> delete edited xmls and resources.arsc
[G1 Android Development] HewGBalls:
NO its not the same because there is no option for "yes to system app" or "yes to keep folder"

choosing compile just builds the apk as i said before.

I am using the linux version!
[G1 Android Development] Daneshm90:
Oh ok. My bad.

But yea what you said is equivalent to keep method in windows version
[G1 Android Development] mindnumbinglyfun:
how could i get my clear lockscreen/clockless lockscreen without edited the xml files? my goal is not to spend money on a custom lockscreen app.
[G1 Android Development] fernando sor:
The lockscreen is an image. The clock is another matter
[G1 Android Development] kaushu400:
APK editor for MAC

is there any apk editor available for Mac??
[G1 Android Development] mrvirginia:
hello again guys. have a quick question regarding compiling an apk...

i'm trying to compile the SpareParts.apk. this would be considered a system apk, correct? the file within this apk that i'm modifying is a strings.xml file, which is located within the values folder. when i compile, and the batch script asks you to delete stuff you've modified within the "keep" folder, there is no values folder for me to go into so i can delete that strings.xml file. i've tried deleting the resources.arsc and the entire res folder and i've also tried deleting just the resources.arsc. each time, when i go into spare parts and select battery history or battery information, i get a FC with the message "The application Spare Parts (process com.android.spare_parts) has stopped unexpectedly. Please try again."

does anyone know what i'm doing wrong? thanks for any help
[G1 Android Development] Daneshm90:
Two things, an app is only a system app if it resides on the /system partition. Any app can be a system app if it resides there.

Secondly, yes the values folder is part of resources.arsc

So spareparts if its on system partition, u should be able to simply :

1. Decompile w/o dependency

2. Modify

3. Compile (yes to system app, yes to more than signature)

4. Delete resources.arsc

5. Push file back to your phone
[G1 Android Development] mrvirginia:
okay, thanks. that's exactly what i've done numerous times and still get a FC with that process :(

any ideas as to why that might be happening? i'm not modifying anything drastic. just the title of the app lol

edit: nvm. it's the app itself. ROM dev added a few things and they messed it up. it FC's without my tweaks. thanks again!
[G1 Android Development] RogerPodacter:
i hope this hasnt been answered before, but does this script/app allow us to actually get into the classes and activities source code of apk's, or only the xml and resource items? just curious how deep we could go into an apk with this...

thx and awesome stuff!
[G1 Android Development] androidman1:
Can someone please help me?

Hi everyone, Can someone please help

My Path includes c:\android-sdk-windows\platform-tools

is that correct?

I made an app with appinventor, and in order to upload to the android marketplace I need to basically add a version number and name to my androidmanifest.xml. So I decompile the apk successfully, edit the androidmanifest.xml, but when I go to try and recompile (using option 14) it always says 'an error has occured' and it goes back to the main menu...

How do I know if my app is a system app or not?

Below is my log:

java version "1.6.0_23"
Java(TM) SE Runtime Environment (build 1.6.0_23-b05)
Java HotSpot(TM) Client VM (build 19.0-b09, mixed mode, sharing)
I: Checking whether sources has changed...
I: Smaling...
Exception in thread "main" java.lang.NullPointerException
at org.jf.util.PathUtil.getRelativeFile(Unknown Source)
at org.jf.smali.smaliFlexLexer.getSourceName(Unknown Source)
at org.jf.smali.smaliFlexLexer.getErrorHeader(Unknown Source)
at org.jf.smali.smaliFlexLexer.nextToken(Unknown Source)
at org.antlr.runtime.CommonTokenStream.fillBuffer(Unknown Source)
at org.antlr.runtime.CommonTokenStream.LT(Unknown Source)
at org.jf.smali.smaliParser.smali_file(Unknown Source)
at brut.androlib.mod.SmaliMod.assembleSmaliFile(Unknown Source)
at brut.androlib.src.DexFileBuilder.addSmaliFile(Unknown Source)
at brut.androlib.src.DexFileBuilder.addSmaliFile(Unknown Source)
at brut.androlib.src.SmaliBuilder.buildFile(Unknown Source)
at brut.androlib.src.SmaliBuilder.build(Unknown Source)
at brut.androlib.src.SmaliBuilder.build(Unknown Source)
at brut.androlib.Androlib.buildSourcesSmali(Unknown Source)
at brut.androlib.Androlib.buildSources(Unknown Source)
at brut.androlib.Androlib.build(Unknown Source)
at brut.androlib.Androlib.build(Unknown Source)
at brut.apktool.Main.cmdBuild(Unknown Source)
at brut.apktool.Main.main(Unknown Source)

Thanks,

Androidman1
[G1 Android Development] fernando sor:
When you decompile there is a smali folder
[G1 Android Development] pepi74:
After I decompile app in one smali file Iv got this

Landroid/graphics/Color;->argb(IIII)I

in original java code it is value argb (255,32,32,32)

How to change value in smali file and make recompiled app to work
[G1 Android Development] fernando sor:
What color is it in hex?
[G1 Android Development] RocknSteve:
I don't mean to promote my own post (which is ironically exactly what I'm doing) but I'm still having this issue and was hoping someone could still help.

Thanks!
[G1 Android Development] {davros}:
anyone get this or know why i am getting this?? ubuntu 10.4

Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(ClassLoader.java:620)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)

at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)

at java.net.URLClassLoader.access$100(URLClassLoader.java:56)

at java.net.URLClassLoader$1.run(URLClassLoader.java:195)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)

at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
[G1 Android Development] KaTTeR:
Whats wrong... Im running on Win7 64bit

extract and zip APK works fine... but sign APK doesnt work :-(

I added the Path to Java... look here

%CommonProgramFiles%\Microsoft Shared\Windows Live;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Common Files\GIS\Tools;C:\Program Files (x86)\QuickTime\QTSystem\;%SystemRoot%;C:\Program Files (x86)\Android\android-sdk-windows\platform-tools;C:\Program Files (x86)\Android\android-sdk-windows\tools;C:\Program Files (x86)\Java\jre6\bin

Here the ERROR LOG:

|10.01.2011 -- 11:33:56,73|

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

java version "1.6.0_23"

Java(TM) SE Runtime Environment (build 1.6.0_23-b05)

Java HotSpot(TM) 64-Bit Server VM (build 19.0-b09, mixed mode)

Das System kann den angegebenen Pfad nicht finden.

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

at java.util.Arrays.copyOf(Unknown Source)

at java.io.ByteArrayOutputStream.write(Unknown Source)

at java.util.zip.DeflaterOutputStream.deflate(Unknown Source)

at java.util.zip.ZipOutputStream.closeEntry(Unknown Source)

at java.util.zip.ZipOutputStream.putNextEntry(Unknown Source)

at java.util.jar.JarOutputStream.putNextEntry(Unknown Source)

at com.android.signapk.SignApk.copyFiles(SignApk.java:401)

at com.android.signapk.SignApk.main(SignApk.java:473)
[G1 Android Development] Jumba:
Hi

I am trying to adjust styles.xml in my framework-res.apk but at the decompiling stage it converts the folders named e.g. "drawable-hdpi-v4" to "drawable-hdpi" and as a result the recompiled framework doesn't work. I even tried this on a straight uncompiled-compiled-signed .apk and no go.

Any tips on how to make this work?
[G1 Android Development] nuggyunlimited:
After running the script it says adb not found I don't know how to use adb but how do i get it to find adb in my sdk platform tools adb is present. I wanted to push my framework-res.apk to my phone because when I try to do it with root explorer my phone force close and isn't functional anymore that leads me to doing nand restores. Any help would be appreciated.

By the way I'm running Windows 7 64
[G1 Android Development] dully79:
After recompiling, open up your new zip, select the files you want and drag and drop them into your old zip.

You need to enter the path under environment variables, here's how-

http://www.google.co.uk/search?hl=e...ronment+variables&spell=1&fp=de610b7113b09eab

or get stericsons autosign tool and that will automate the process for you.

Hope this helps.:)

Daneshm, how about adding an option in your tool to set the path for adb, there seems to be a lot of people with this problem, just a suggestion.

And i finally remembered to give you a thumbs up.
[G1 Android Development] deny_winarto:
I'm getting the same problem, what exactly do i have to put in the environment variables?

I'm using this tutorial

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

Then i put the environment variables in C:\android-sdk-windows\platform-tools

What am i doing wrong?

Thanks
[G1 Android Development] xkape:
If you have updated your sdk to version 8 then all you are missing is at the end put a \adb

if you have not updated your sdk then instead of platform-tools, make it tools\adb
[G1 Android Development] xkape:
What's with the apk_manager_4.9(2) ? My guess is that (2) is screwing you up.

Also, I am guessing here that you are trying to edit the buttons for the GB keyboard.... those .9.pngs can be edited and used without guides. It will stretch out your spacebar a little bit but other than that, it looks fine. So, what I would do (and this is just me, no one else) is edit the candidate preview and keyboard_popup xmls to match your color scheme. Then recompile. Edit your images with GIMP or something and then use 7zip to stick them into your modified LatinIME.
[G1 Android Development] mindnumbinglyfun:
sorry maybe i should explain a little more.

the (2) is from a second copy i accidentally downloaded. i unzipped the contents to that folder on the desktop and copied over all my adb and other essential tools to that folder (i do know what im doing there and the errors are the same as they were when the apk manager was in platform-tools, so this isnt the issue).

i am not trying to edit any pictures, but only the color of the suggested text. i have received guidance from a dev who had done this to a GB KB already, so my editing isnt flawed.

it seems i get these types of errors when i try to recompile any themed or edited in any way content. if i take a brand new, works perfectly copy of say a themed market, keyboard, anything, and decompile it, i can not recompile it even if i havent edited anything. ive tested this with many apks and it seems that most likely this is only happening with themed apks. unthemed, stock apks seem to recompile.
[G1 Android Development] xkape:
ok that I can tell you why. The themed apps usually (almost always) have some .9.png files that were edited but the guides were not put back on. When this happens, apk manager disapproves..lol

Either stick to the stock unthemed apks OR.. put stock images in the themed apk, decompile, edit, recompile and then use 7zip to stick the themed images back in.
[G1 Android Development] fernando sor:
it is pretty easy to change color in a gbread keyboard with hxd. And I agree most apps dont recompile because of images
[G1 Android Development] manup456:
This is the error I keep getting when compiling the app http://pastebin.com/Y9vCujkD if anyone can help thanks.
[G1 Android Development] thunderteaser:
Your Apk Manager for GNU/Linux is simply great, I just can't live without it anymore! :)

Are you considering a version upgrade since it's stuck to 4.3? I would love to see new features as Windows users already do!
[G1 Android Development] woodhouse:
STK

I tried this tool and I think it's fantastic.

But, in your opinion, can I sign (or something else..) a system-package (like Stk.apk - SIM toolkit) in order to use it on a stock official ROM that not includes it?

I have HTC Magic/MyTouch3G with Froyo official update, and I need Stk.apk without to change my official ROM...

Thanks

S.
[G1 Android Development] fernando sor:
is your syntax correct in your xml edits?
[G1 Android Development] Paul627g:
Modifying framework.apk questions

I'm sure some of this has been posted in some form.

I'm a noob to modifying .apks. I have some basic knowledge of working with them and have a few questions.

I recently did a battery mod, changed the Sprint branding on lockscreen and changed the default wallpaper. There are other little mods I would like to do but I need some problems resolved before moving on.

1.) No matter what I try I can't get a working flashable zip. I take my unsignedframework-res.apk and rename it to framework-res.apk and insert it into a working flashable zip I used from another theme/app. When I go to flash it in ClockWorkMod v3.0.0.5 it says (bad) installation. Please note, I have changed my flash zip to include a working script change to be EXT4/Edify ready. The script works, I've used it many times.

2.) For the most part the framework runs great when I push it to my phone except I'm getting some Market app FC's. Facebook/K9 Email/Dolphin Browser... The rest seem to be running good. All system apps seem to work fine, no FC's.

I'm using framework-res.apk pulled from ACS DK28 Froyo Stock deodexed. I saw many people refer to this as a good framework to use and I decompiled/recompiled before using and no errors. If anyone could please provide a step by step of taking the unsignedframework-res.apk and placing it into a flashable to clear up any improper techniques I maybe using that would be excellent! Any solutions/help to my problems would be much appreciated.
[G1 Android Development] {davros}:
now this? newest Script.sh v5

davros@slaptop:~/apkmanager$ ./Script.sh

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

please install it or fix your PATH variable

thats gotta be a simple thing i'm over looking but i've been coding roms all day i my head is melting
[G1 Android Development] nathanpc:
We need this for Mac... Someone could port it please? :)
[G1 Android Development] gflam:
I can not get this to work on ubuntu 10.10

I downloaded it and placed it at this path /android/platform-tools

I opened terminal then do the following commands

cd /android/platform-tools/apk_manager (i renamed the folder)

i then type

./Script.sh

it comes up witht the prompt to clear out the existing projects i tell it y and hit enter

i then place an unedited apk in the place-apk-here-for-modding folder

i type 9 then enter to decompile

In the out folder the resources.arsc file is missing and all of the folders such as drawable-hdpi have been renamed to -v4 (on the end)

If i try to recompile with out making changes i get

W: no resources found

and then it goes through the rest of the motions

For whatever reason it's not decompiling the resources.arsc right and i've tried a thousand times with stock apps of all sorts what's wrong?
[G1 Android Development] rom-g:
Hi Daneshm90

Yesterday I found a little bug in your script (windows version). It caused me big troubles when decompiling a system APK on a proprietary ROM (script option : 10)

Windows XP users are mostly concerned.

When drag/droping the dependee APK, you will always obtain the same response : "Sorry, that's not the dependee apk, try again", even if it's the good dependee APK

I checked the log file, and found this :

The script is trying to execute a command called " and ____". :confused:

I supposed that was related to the spaces includes in userprofile variable : "documents and settings"

So i checked the script.bat and found this little mistake at the line 460 :

if NOT EXIST %userprofile%\apktool\framework\2.apk (

should be

if NOT EXIST [COLOR=Red][B][SIZE=5]"[/SIZE][/B][/COLOR]%userprofile%\apktool\framework\2.apk[B][COLOR=Red][SIZE=5]"[/SIZE][/COLOR][/B] (

I tested this little fix, and it's now fully OK on Windows XP ;)

I hope u'll find my post helpfull => I used your script for a while and it's one of the best stuff i found here at XDA :D

Cheers
[G1 Android Development] sparksco:
Just got mine working on Ubuntu 10.10 and it's working great. Now I just need to figure out this how to sign system apps thing out. Not really sure why the program ask you when you zip it if it wants you to zip to a system app or a normal app, when it does not let you sign the system apps.
[G1 Android Development] gflam:
Little help with how you got it working in 10.10?

I added this line to my bashrc by doing sudo gedit .bashrc then put this as the last line

export PATH=${PATH}:/android/tools:/android/platform-tools

Installed all the packages in the sdk

Unzipped the apk manager in my /android/platform-tools folder

And i run it by doing

cd /android/platform-tools/apk_manager

./Script.sh

i clear the folders with y

then place my apk in the place-apk-here-for-modding folder but when i select 9 to decompile and i go to the out folder the resources.arsc file is missing and the folders all have the -v4 at the end

if i go to recompile i get resources not found someone please help
[G1 Android Development] fernando sor:
Can you post it? Thats been driving me crazy
[G1 Android Development] gflam:
O and i did chmod 755 for every file in the other folder as well as the Script.sh this is driving me nuts what's wrong?
[G1 Android Development] {davros}:
ya hey thats great, how bout letting the rest of us in on how ya did it?
[G1 Android Development] dully79:
I posted a guide a few pages back how I got it running on 10.10
[G1 Android Development] TrueBlue_Drew:
It sounds like you might need to install/register the framework resources for the device you are working on. I had to do this for windows. Apk Manager relies on Apk Tool. Here is a link to read about it and to explain how to do it. I am not sure if this has been incorperated into the latest options for Apk Manager as I have had it running for a while and dont even know what version I am running but I just did it manualy. Hope this helps.
[G1 Android Development] gflam:
Post #801 for those looking so you don't have to go through a million pages like i did :D

Going to set mine up exactly as yours is hopefully that works if not i guess i'll try the suggestion above
[G1 Android Development] TrueBlue_Drew:
What apk are you working with? It really sounds like you have it running ok, it just cant rebuild it because it doesnt have the framework resource table to do so. I think the -v4 thing is normal because I have noticed that on some things but still works great.
[G1 Android Development] gflam:
I'm working with the framework-res.apk from my rom Sourcery

I just deleted the sdk folder i had and reinstalled the entire sdk as well apk manager as post 801 installed it. I then also didn't have other folder of the apk manager in my path which was basically my only change and it seems to now work so i guess the main problem was that.

So for those trying to get this to work add the other folder to your path.

I just did a decompile and recompile of my sourcery framework but it was a different theme than the one i was using and i installed through an update zip and it installed fine and seems to be working perfect! Going to try with an xml edit and i'll let you know thanks for the help
[G1 Android Development] gflam:
Made an xml edit and recompiled pushed through adb in recovery rebooted and my xml edit showed so it's working all good in 10.10 if someone needs help with it let me know and i'll give you my set up although i think it was just that i didn't have the other folder in my path
[G1 Android Development] {davros}:
lol thx as i started at page 1 .... lol
[G1 Android Development] gflam:
Lol that would have taken a long time ha i just went backwards since he said a few pages back it only took me a little while love ctrl f :)

Let me know if you need any help with it by the way this is what i did to get mine working for those that may have the same problem

I went to my home folder and did ctrl h to show hidden folders

Then go to the .bashrc file and open it with gedit and i went to the bottom and added these lines

#AndroidDev PATH

export PATH=${PATH}:/home/george/sdk/tools

export PATH=${PATH}:/home/george/sdk/platform-tools

export PATH=${PATH}:/home/george/sdk/am/other

(change george to your username) or the path to how yours is i saved that and it worked fine i just needed the last

export PATH=${PATH}:/home/george/sdk/am/other

line added to make it work and i made the name changes as well they don't matter just easier in terminal (apk_manager_linux_4.7 renamed to am and the sdk folder renamed to sdk)

I'll continue to check here and help anyone that needs help with it
[G1 Android Development] ezio84:
Great tool! Works fine on Win7 x64 Ultimate.

Thank you very much!! :)
[G1 Android Development] rom-g:
Yes of course => HERE
[G1 Android Development] Staxxthedan:
Needed this for skinning. Thanks
[G1 Android Development] fernando sor:
Thanks ! nice work tracking that down
[G1 Android Development] Scuttle:
So, I thought I'd start modding my phone by swapping out the battery icons...

I used apk-manager (4.9) to download framework-res.apk

I unpacked it using option 1

I swapped out the png-files, didn't touch anything else.

I used option 3 to "Zip APK" as a system apk

I did _not_ sign it, as it is a system-file

I ran option 5, Zipalign

Ths resulted in a file called "unsignedframework-res.apk", which I used option 8 to push to my phone

After this I rebooted the phone (adb reboot)

At this point I end up in what seems to be an endlessreboot of some sort. I have the bootup-animation, and the phone buzzes once about every 30 seconds, but no working phone...

ADB works, so I replace framework-res.apk with the original one and reboots, everything starts up just fine.

What am I missing here? :P
[G1 Android Development] {davros}:
so it looks like java 5 is no go for apktool but..... java 6 works great now to figure out these new commands.....

:rolleyes:

l/