yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] :
I clearly have no idea what I'm doing with this. Can someone point me in the right direction?

When I place my modded .apk's (with the correct names for when they're in the data/app folder) in the "place-apk-here-for-signing" folder and open the script, I first get the error: "Adb was not found, you will not be able to manipulate the files on your phone Press any key to continue"

I press the key to continue, because the files are already modified and have been placed into the "place-apk-here-for-signing" folder.

After that I select option 16 Sign an apk. There are 4 total apk's in the folder for batch signing. I see the apk file names scroll up from the bottom of the cmd prompt window, then the window flashes and goes back to the main options screen.

I tried to install them on my phone (after uninstalling respective apps) and I get an "Application not installed" message. The method I used to install them was placing them on my SDCard and then using Root Explorer to copy them over to the data/app folder, then installing from there.

I'm in desperate need of help here, haha.

Here's my log from the last batch I ran:

I'm really sorry if this has been asked a million times before but I've searched and come up empty handed. I'd like to get this process down so that I can start theming widgets and apps and get my community share on!

Thanks, really.
[G1 Android Development] ilangoadigal:
I don't know if I'm the only one, but I the problems people might be having are derived from APK Manager can't deal with with both PNG and XML changes in recompiling. The only way I've been able to change both PNGs and XMLs is by first changing the XMLs, recompiling, then editing the PNGs on the recompiled apk.
[G1 Android Development] adeptus:
Please help!

I just do the following:

- start script

- press 9 to decompile framework-res.apk

- do not make any changes!

- press 11 to compile it back

- press YES (or NO, its simple) for the "Is this is a system apk?"

- exit

Results:

original framework-rers.apk is about 2.8 Mb size, compiled apk is less than 1.5 Mb, and device with compiled framework-res still freeze at bootanimation...

Whats wrong?
[G1 Android Development] floepie:
What's the error in the log after decompiling? Do you have any of those "bad" patch-9 files I referred to earlier?
[G1 Android Development] adeptus:
No errors. No "ghost" .9 png`s.
[G1 Android Development] zhelloz:
someone give me link to download APK Manager 4.8 (not 4.9)?

Thanks so much!
[G1 Android Development] djstaid:
Just found this after working with the apktool for the morning... can't get either to compile for some reason. I have even tried registering tons of apk's for framework reasons. getting super frustrated..

All I want to change at this point is an xml for the Contacts.apk to make the dialer background transparent. I am running Enom's ROM 2.13.2 if that makes a difference. I have attached my log. I have been trying to figure this out for a few hours and I am getting ready to just pack it in at this point. Trying to theme is becoming a pain!

I appreciate any help or tips.
[G1 Android Development] floepie:
^^ I posted the solution to your problem on the previous page:

http://xdaforums.com/showpost.php?p=8782005&postcount=656

Just follow it and all will be well. Don't forget to delete both the XML you modified in the 'keep' folder in addition to the resources file.
[G1 Android Development] dilirum:
I have been searching. I've skimmed through a lot of this thread and can't find it. I've googled and can't find an answer - just people who had similar problems then reposted and say "nevermind I fixed it" which really isn't help to someone searching.

I've got Android SDK and I've got Java installed running on Win7. Do I need to run apk_manager_4.9 from a specific location in order to get this to work right?

Every time I run the script.bat I get "Java was not found, you will not be able to sign apks or use apktool. Press any key to continue . . . "

Obviously it won't work... but if I try to do sign an apk anyway I get

"Java is not recognized as an internal or external command, operable program or batch file."

which is to be expected at this point I guess, after the first error.

I know this is probably incredibly noobish but if anybody can point me in the right direction I'd appreciate it! I'm probably missing something obvious.
[G1 Android Development] djstaid:
Awesome I will try this as soon as I get home. Thank you!

**edit**

It worked like a charm!! thanks so much
[G1 Android Development] KBanause:
I just extracted the Linux Version but Script.sh tells me it can not find aapt.

What IS aapt and does anybody know which package I have to install using Ubuntu?

I found it myself.

$android_sdk_directory/platforms/android-$x/tools/aapt
[G1 Android Development] floomat:
Hey

first:

Really good tool!

thanks for sharing it, helps me out really often :)

but i got a problem with decompiling some apks.

they cant be decompiled and i got errors.

a sample apk and the log is attached.

hope you can help me :)
[G1 Android Development] rori~:
I always edit (9.)png's , xml.files and compile all.. no probs here.

Sent from my Nexus One
[G1 Android Development] floepie:
Is it a working app? Do have the original unmodified APK? Maybe I could try it if you have the original with mods...
[G1 Android Development] Zoldborso:
I'm having recompiling problems also. The linux version is not as good as the windows one.

These problems are on kubuntu. When I compile, it gives lots of errors, and I just can't find out what's the problem.
[G1 Android Development] sdjensen:
I am getting this message when I start this brilliant program. Is it just because my phone is not connected to the computer?

"Adb was not found, you will not be able to manipulate the files on your phone"
[G1 Android Development] KBanause:
it means you don't have the adb.exe in the directory where you are running Script.bat
[G1 Android Development] fifthstreetjammer:
Ok this seems like an awesome tool but i get this same error message everytime i try to run the script. "java not found, you will not be able to sign apks or use apktool" now i see the op reply about adding something to the path in enviornment variables but i have no idea what that means. this is what my path variable says

"%CommonProgramFiles%\Microsoft Shared\Windows Live;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\10.0\DLLShared\;C:\Program Files (x86)\Common Files\Teleca Shared;C:\Program Files (x86)\QuickTime\QTSystem\"

that is foreign language to me so anyone willing to help id appreciate it. I been trying all day to edit some dang apk so i can start offering some sick things for the community and i am striking out.:cool:
[G1 Android Development] floepie:
FWIW, I don't have anything relating to JAVA in that path either, and mine works just fine. In my system environment variables list, I do have an entry as follows:

Variable name: QTJAVA

Variable value: C:\Program Files\Java\jre6\lib\ext\QTJava.zip

Also for JAVA exention I have:

Variable name: PATHEXT

Variable value: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
[G1 Android Development] wailok:
hello im trying to mod an apk file, does anyone know what it means when the log file says:

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)

Lockscreen was unexpected at this time.

im trying to mod my lockscreen.

thanks in advance!
[G1 Android Development] flyboyzeya:
Can someone please tell me how i can change my app icon. im a noob
[G1 Android Development] floomat:
Thats the app i pulled from my device.

so i think its working correctly :D

it is unmodified, just renamed it to sort my folders.sorry!

would be great if someone could help me :)
[G1 Android Development] PzykoSkillz:
I'm having the same problem as you, lol. I don't know what it means either.
[G1 Android Development] techmik67:
Originally Posted by fifthstreetjammer Ok this seems like an awesome tool but i get this same error message everytime i try to run the script. "java not found, you will not be able to sign apks or use apktool" now i see the op reply about adding something to the path in enviornment variables but i have no idea what that means. this is what my path variable says

"%CommonProgramFiles%\Microsoft Shared\Windows Live;%SystemRoot%\system32;%SystemRoot%;%SystemRoo t%\System32\Wbem;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\10.0\DLLShared\;C:\Program Files (x86)\Common Files\Teleca Shared;C:\Program Files (x86)\QuickTime\QTSystem\"

that is foreign language to me so anyone willing to help id appreciate it. I been trying all day to edit some dang apk so i can start offering some sick things for the community and i am striking out.

They are path statements. Google that term. =)

c:\directory\directory\

then you add another by separating with semicolon ;

The directory where JAVA is, is not in your path statement. So.... navigate to the /java directory. I believe inside is a BIN directory, in which all the tools are (java, javac, etc)

THE COMPLETE PATH is what you would add to your existing path statements

so, so have: %CommonProgramFiles%\Microsoft Shared\Windows Live;%SystemRoot%\system32;%SystemRoot%;%SystemRoo t%\System32\Wbem;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\10.0\DLLShared\;C:\Program Files (x86)\Common Files\Teleca Shared;C:\Program Files (x86)\QuickTime\QTSystem\

at the end, ADD a semicolon then the path to /java/bin or /jdk/bin
[G1 Android Development] PzykoSkillz:
Thanks. I figured it out. I was missing the ;
[G1 Android Development] fifthstreetjammer:
yea it took a little research but i figured it out, thanks, java working, halfway done with my first theme, these tools are awesome
[G1 Android Development] quertiy:
Hello, here's my problem (it's the first time trying to edit apks).

I'm trying to edit the fancy widget apk.

1. I'm copying the apk (967KB) to "place-apk-here-for-modding"

2. I'm running script.bat

3. Option 22, selecting the apk

4. Option 9 for decompiling

5. Option 14 for compiling signing installing (without modifying anything to the decompiled apk)

After that I get a signed APK that's 847 KB in size (the original one is 967). I install it after uninstalling the original apk, it installs well but the widget won't load.

So, where is my mistake and shouldn't the compiled apk have the same size?

Here is the apk: http://dl.dropbox.com/u/12632761/com.anddoes.fancywidget-2.apk
[G1 Android Development] -viperboy-:
I am new to this and I am trying to figure out something... when APK Manager extracts the .apk and I go into Projects and look through that .apk, anytime I open up an .xml I get an error and I can never edit it. How can I open that .xml and edit it without borking it?? I'm assuming there is a way to make it human readable and than put it back into a format Android understands, no?

Thanks in advance and what a WONDERFUL tool you have made!
[G1 Android Development] KBanause:
You have to decompile the apk to be able to make changes. Then you must compile it again.
[G1 Android Development] quertiy:
so, my problem is only mine??!
[G1 Android Development] bakadestiny:
hey how can i delet folders under the project folider.

because there is an empty folder inside, but i cant delete it.

I tried in the script mode, delete this project's folder, clean folders/files, clean all project, none of it works...

Also i tried to delete it manually, but it says its protected, so i tried to untick the read only box, but it still doesnt work. So how can i delete the empty folder(folders, because there is another blank folder under the folder)
[G1 Android Development] crazyg0od33:
Whenever I am trying to sign an apk,i get a parsing error when I go to install it...what does that mean and what should I do?
[G1 Android Development] nukedukem:
Can someone help me with my PATH? I've been using Apk Manager on XP for a while, but I'm moving all my android dev tools to a new Ubuntu 10.10 virtual machine. I can't seem to be able to add the correct PATH in my ~/.bashrc file.

I've unzipped ApkManager to the following folder:

~/Android/apk_manager_linux_4.7

I tried adding the /other folder to my PATH but ApkManger doesn't recognize it. I'm not very code savvy, so some help would be appreciated. This is the PATH I have added to the end of my ~/.bashrc file:

export PATH=${PATH}:/home/ryan/Android/SDK/tools/:/home/ryan/Android/apk_manager_linux_4.7/other:/home/ryan/Android/dev/bin

EDIT: Fixed it.
[G1 Android Development] quertiy:
does this forum have no support whatsoever?
[G1 Android Development] raven_raven:
APK is smaller because of optimization. Are you compiling it properly (I mean when script asks you whether you want to create keep folder and something to delete there to reduce # of mistakes)?
[G1 Android Development] crazyg0od33:
Who are you referring to?
[G1 Android Development] thunderteaser:
What about a 4.9 GNU/Linux version? There's no changelog so I don't know if 4.7 (latest version) is fine.
[G1 Android Development] ssakuma:
i tried and found these.

files are almost same size and content in each archive, except classes.dex

original - 163,396 bytes

re-compiled - 163,384 bytes

the reason that apk file size is different, is compression ratio, as raven wrote.

you can check this via Explzh tool or something. ;)

the reason that widget doesn't work, may be classes.dex is something wrong.

you will able to check this compare each smali files via WinMerge or something you like, but i don't check this. by replacing original's classes.dex file into re-compiled one and sign again. :rolleyes:

this is all i can do for you, i am not an android developer.
[G1 Android Development] ocuj:
I have exactly the same problem as quertiy. Unfortunatly replacing the classes.dex doesn't work for me. I can't load a widget when I decompile, recompile, sign and install (without making any adjustments). Does this work for you in 4.9? I never used an older version, so it never worked for me.
[G1 Android Development] KBanause:
If you are using apktool.jar then try to get version 1.3.1. I had problems with the latest version (1.3.2).

Even the developers recommend to downgrade.
[G1 Android Development] ocuj:
I have no clue if I use apktool.jar. I'm using Apk manager. Does Apk manager use apktool.jar? I do have Apktool.jar btw. It's in the tools\other folder. How can I check which version it is? Thanks for the reply.
[G1 Android Development] NilsP:
Yes it does use apktool for de-compiling and compiling.

If you enter option 23 it will tell you all your versions right at the top.
[G1 Android Development] ocuj:
First of all, thanks for the help. It's much appreciated.

So, I checked, and I had version 1.3.2. So I downloaded 1.3.1. (the jar and the windows files), and put them in tools\other, where the others were. Apkmanager still says I'm on 1.3.2. Am I doing something wrong?
[G1 Android Development] Daneshm90:
It doesn't actually check the version ;)

I just echo'd it there, it was for me/users to know the versions of different components when downloading apk manager.

Cool idea for next version. I'll have something like

echo Apktool version is :

java -jar apktool.jar -v (just assuming thts the command lol, not at a pc)
[G1 Android Development] KBanause:
lol, it's hardencoded in the Script.bat :)

Version 1.3.1 should be exactly 1237206 bytes in size. Version 1.3.2 ist 1343302 bytes in size.
[G1 Android Development] ocuj:
Hehe, that's explained it. But unfortunately it didn't work. I decompiled, compiled, signed an installed again, but still no working widget. Weird.
[G1 Android Development] Daneshm90:
Can you please re-explain your issue.

Also do this :

Delete log.txt

Do w/e

Send me the new log.txt

Thanks
[G1 Android Development] ocuj:
My issue is this. I have an unaltered apk, in my situation it's tajm. I want to translate the language to my native language. But I test it first before altering it. It installs perfectly. Then I decompile the apk, I compile the new apk (nothing altered, this is my 2nd test), I sign it, and I install it. This apk installs fine, gives me the options when I want to load the widget, but the widget itself doesn't load.

I'm sorry, i have no idea what you mean with the log.txt. After years of being a windows pro, I'm an Android noob now. I try to catch on fast, but I still have to learn a lot.

Thanks a lot for you're reply.
[G1 Android Development] Daneshm90:
Ok log.txt you'll find in apk manager's main folder

Also can you get logcollector from market and then do this :

1. Load the widget

2. Once it fails

3. Load logcollector send it to ur own email

4. Then copy/paste the log here.

It's important to see why its not working.
[G1 Android Development] ssakuma:
hi, OP.

i have re-compiled FancyWdget.apk without modification, and installed.

when i put the widget, widget loading error happened, and i have got error messages from ddms as below.

11-10 09:07:00.931: WARN/AppWidgetHostView(164): android.view.InflateException: You must specifiy a valid layout reference. The layout ID @layout/digital_clock is not valid.

(deleted)

11-10 09:07:01.071: WARN/AppWidgetHostView(164): android.view.InflateException: You must specifiy a valid layout reference. The layout ID @layout/digital_clock is not valid.

(deleted)

i think this is a decompile or compile problem with some layout xml file(s). i have had the same problem with GenieWidget.

it seems that "include" tag in xml file is not re-compiled correctly.

my workaroud to this, open the compliled xml file with hex-editor and fix it to original one (in this case, to point @7F030004, not @layout/digital_clock). AXMLPrinter2 may help you to do this.;)

edit

i put the two files, original and re-compiled, of res/layout/new_home_widget.xml, which are both converted to human readable ones via AXMLPrinter2.

compare "include" tag part, you will see what is wrong.

res/layout/old_home_widget.xml is also have a problem as above.

i hope this helps. :rolleyes:
[G1 Android Development] akuma6099:
Thanks

Just wanted to say thanks for developing APK Manager and keeping up on it. I've always enjoyed the reverse engineering side of life and this is a swiss army tool for APK modders. First victim was Tower Raiders. Decompiled fine. Adjusted my resource values(money) in XML's, adjusted compression and heap, recompile and sign. Nothing to it. Almost too easy:D Now I'm decimating all with my fleet of upgraded cannons and miniguns. Time for the next victim. peace.
[G1 Android Development] Neuz:
Same problem here.

Any suggest?
[G1 Android Development] Daneshm90:
You guys need to give me

A. The log.txt that apk manager spits out

B. Adb log from your phone when you try to run the application/widget

Thanks
[G1 Android Development] Neuz:
Here the logs :)
[G1 Android Development] Daneshm90:
Ok so i assume you're not modifying anything.

Also what app is it ?

I can't look through log w/o it.

Thnx
[G1 Android Development] Neuz:
Ye, ive not mod nothing.

App is Tajm (clock widget app)

Only pull from phone (directly download from the market and is full funct), put in place-apk-here-for-modding folder, option 9.

Unistall app from phone, option 14.

When i try to launch widget, its say "Error from widget loading".

Sry for my bad engl, im italian :)
[G1 Android Development] Daneshm90:
Ok seems its having a lot of layout issues.

Do me a favour, im on the road so can't try it out (will when i get home)

Once u decompile/recompile w/o changes. Say "Y" to system app. Say "Y" to system app

Now delete everything aside from resources.arsc and the res folder. Let me know if that works.

Edit : And sign the apk after and install
[G1 Android Development] Neuz:
It Works! w/o mod.

Now i try to mod :)
[G1 Android Development] Neuz:
Mmmm now problem is:

i mod in res/value/array files to change language.

When i recompile app and install into phone, app is not change...

ive control app, and there is no change of array.xml!!!!

Is a know problem?Or just mine?
[G1 Android Development] Daneshm90:
Nope its because ur deleting the res/resources.arsc which means ur modifications are lost.

Ok try this :

Make your changes

Then in the keep folder, delete the resources.arsc and only delete the xml you modified.

Then sign and install
[G1 Android Development] Neuz:
Don't work :(
[G1 Android Development] Daneshm90:
So you still get that widget error ?
[G1 Android Development] Neuz:
No, no widget error..only not modify applied...

Rly dunno why!
[G1 Android Development] Daneshm90:
K i'll get back to you. When i get home.

Just upload the modified xml you want implemented. I'll figure it out and let u know

L8r
[G1 Android Development] Neuz:
Love u

/res/value/
[G1 Android Development] Daneshm90:
Here u go :

So thing was, it wasn't decompiling/compiling the xml's properly for some reason and wasn't complaining about it either, except android was.

So solution was :

1. Decompile

2. Make changes

3. Compile (say yes to system)(yes to keep folder)

4. Delete resources.arsc

5. Sign

6. Install

Enjoy.
[G1 Android Development] xguntherc:
i installed apk manager, jcreator and the jdk 1.6 22 developer kit.

when i start the script it says Java was not found, you will not be able to edit or sign apk's and all that other stuff. and then any key to continue. I tried anyways to decompile an apk but it fails and I get an error. I've installed Jcreator and the JDK. what else do I need for this to work? Any help would be much appreciated!
[G1 Android Development] Daneshm90:
is java in ur path?

google it
[G1 Android Development] xguntherc:
I did google it. Java is mentioned twice in there.. let me look again

k got it.. added to PATH.. For anyone's future reference, you need to edit PATH in variables and add java in there.
[G1 Android Development] Daneshm90:
The bin folder of java needs to be in the path. Try tht
[G1 Android Development] ssakuma:
i agree with this solution in case of adding locale resouces (such as /res/values-*).

since there is no reason to use re-compiled xml files.

but, sometimes i make mod on /res/layout/*.xml files for the purpose of changing text-color, re-arranging view posions, etc. then, they are compiled and used in apk.

from my experiences, if the modded xml file contains "include" tag, widget fails to load the resource (and shows "loading error").

as i wrote in my previous post (#709), there is a workaround for this. hex edit. :D

so, i am not in a hurry, but i hope this will be fixed someday.

i love this tool, especially generating 9-patched image feature. thanks OP. ;)
[G1 Android Development] Daneshm90:
Yea i didnt spend time finding out what causes this but seems you did. I hope ur research comes in handy for others until brut.all patches it.

As for others, im sorry that support from me hasnt been prominent, but i have school + work to blame for. I squeeze xda/android here n there though ;)

As for updates, hopefully when school ends i'll try n update most if not all of my scripts, you guys have been providing awesome feedback / suggestions.
[G1 Android Development] Neuz:
Ive done this steps.

Im a little bit stupid i think..

- I put my apk in place-apk-here-for-modding

- open script.bat

- option 9 (decompile)

- go to folder projects

- modify my xml file

- go to script.bat window

- option 11 (compile)

- say yes for forst and second option

- go to folder project

- enter in my project folder name

- enter in build/apk

- delete resources.arsc file

- go to script.bat windows

- option 12 (sign)

- option 13 (install app)

and this is..

but there is no change in my f***ing installed app!

Im retard? :confused:
[G1 Android Development] Daneshm90:
Wht do u mean by those bolded steps ? :S

You have to delete resources.arsc from the keep folder.
[G1 Android Development] Neuz:
Ok solved.

For some strange reason, my windows 7 don't allow permission to script for making keep folder.

Moved apk folder in HD root and well done!

Thanks Daneshm90 !!