yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] sneaky_zekey:
thats ok,i went ahead and booted up in my windows 7 and installed apk manager there but when i go to compile the modded apk i get error saying to check the log.

would you like me to attach the log.txt. its pretty big
[G1 Android Development] chancellorr:
I'm pretty new to Linux and I keep getting this error:

Chmod: command not found

Any suggestions?
[G1 Android Development] Daneshm90:
Did u just do a decompile/recompile or change something? if so wht did u change ? yea post it, it'd b better if u post the last segment of the log which is relevant.
[G1 Android Development] Daneshm90:
im just as new lol. Google that error n see wht they say ;)
[G1 Android Development] chancellorr:
I did but couldn't figure it out. I'll just use the Windows version in VirtualBox. Lol.
[G1 Android Development] cauli:
What distro were you using? Maybe non root users on it don't have access to chmod or it's just not on your PATH. Search / for chmod: erm...

find / -iname chmod

If you find it, invoke it via the full path or add the parent dir to PATH

Try su to root & repeat

Find someone who's less blind than we are ;)
[G1 Android Development] chancellorr:
I'm using Ubuntu 10.04
[G1 Android Development] sneaky_zekey:
first attempt i made some edits,couldnt compile it,so i closed it,reopened it,choosed y to cleay workplace,then simply did decompile,then turn around and compiled it. i think its not finding one of the dependenties to compile it.

the poster above me,just to be clear you cd to the apk manager,then to cd to other and ran chmod 755 app name, lower c, in your post you have Chmod, to the OP i think i shortened the log to much,let me know if you need more info.
[G1 Android Development] luniz7:
Needs to be chmod not Chmod

Linux is case sensitive....

If that still doesn't work try sudo chmod +x filename.here
[G1 Android Development] blakestiffler:
im sorry if this was already answered somewhere but im getting an error everytime i try to decompile. I got all my paths set correctly and i dont understand the error

Could Not Find C:\Documents and Settings\ksnider\My Documents\Apk_Manager_4.8\place-apk-here-for-modding\../place-apk-here-for-modding/repackaged.apk

Could Not Find C:\Documents and Settings\ksnider\My Documents\Apk_Manager_4.8\place-apk-here-for-modding\../place-apk-here-for-modding/repackaged-signed.apk

Could Not Find C:\Documents and Settings\ksnider\My Documents\Apk_Manager_4.8\place-apk-here-for-modding\../place-apk-here-for-modding/repackaged-unsigned.apk

The system cannot find the file specified.

java.lang.UnsupportedClassVersionError: brut/apktool/Main (Unsupported major.minor version 50.0)

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

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.access$100(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

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

at java.net.URLClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClassInternal(Unknown Source)

Exception in thread "main"
[G1 Android Development] Daneshm90:
Did u place the apk in the modding folder?
[G1 Android Development] blakestiffler:
yes i pulled it from the device and it was automatically put in the modding folder
[G1 Android Development] Daneshm90:
Wierd, i dunno why its not finding the apk. Try this :

1 - Try relocating the folder to somewhere else on ur pc. So extract apk manager somewhere like c:\apkmanager and see if that resolves it.

2 - Try renaming the apk inside the modding folder to anything other than wht it is.
[G1 Android Development] sneaky_zekey:
did anyone check out my situation and the log txt i attached,lol
[G1 Android Development] cauli:
Hmm, iirc Ubuntu doesn't have a root user by default - if you need root access sudo is the way - so that shouldn't be the issue. If you like, post a link to the script you're trying to run & I'll take a look, but my knowledge of shell scripting/linux isn't much better than most around here. A case of the blind leading the blind I'm afraid. What line/s were throwing up the error?
[G1 Android Development] Daneshm90:
Sorry lol, skimmed over it. Emm wht are u trying to edit ? and how are you editing it ? That log doesn't help me diagnose it :(
[G1 Android Development] sneaky_zekey:
all i did was placed framework-res.apk in the modding folder and choosed 9 to decompile it,that part works fine,i made no edits,just turned around and choose option 11 (i think) to compile it but it throws the error to check the log, im doing this in windows 7(i gave up on doing it in ubuntu error adb not install or in path)how much of the log you need. ill place some of it here

C:\android\tools\other\..\out\res\values\public.xml:3271: error: Public symbol drawable/title_bar_portrait declared here is not defined.

C:\android\tools\other\..\out\res\values\public.xml:3272: error: Public symbol drawable/title_bar_shadow declared here is not defined.

C:\android\tools\other\..\out\res\values\public.xml:2689: error: Public symbol drawable/title_bar_tall declared here is not defined.

C:\android\tools\other\..\out\res\values\public.xml:2677: error: Public symbol drawable/toast_frame declared here is not defined.
[G1 Android Development] Daneshm90:
Ok, i'll try to explain this to the best of my knowledge.

If ur using a themed framework-res.apk or any apk in that matter, wht u or the themer probably did was open the apk, modify the .9 png inside and zip it up. They did not rebuild the resources.arsc which contains the information about the .9 pngs needed in order for apktool to properly decode them. Hence when u decompile with apktool it complains that it cudn't decode file.

So here are your options, to modify framework-res (code wise) get the stock framework-res, make w/e changes u want, then put ur themed images on top.
[G1 Android Development] sneaky_zekey:
ahh, that makes perfect since, thank you for your time and efforts on the script and helping users like me who are late to the game.
[G1 Android Development] tnpapadakos:
so this is probably more of a fireworks/photoshop question, but when i mod an apk cause i want to change some pngs, like colorize a png or change a png, why does my modded png balloon to a huge size compared to the original, ie., how do you change a color of a png without changing the final size of the png?

this has happened to me even when all i did was change the hue of an icon, i did nothing else, it already was in color and all i do is change the hue...size of png goes from like 350kb to like 1,250,00 kb

any ideas?
[G1 Android Development] Daneshm90:
Change the color bit-depth. In photoshop go

file -> save for media/devices -> then choose png-8.
[G1 Android Development] tnpapadakos:
NICE

thats one thing i did not try, thanx bro, worked like a charm

any ideas on fonts? same deal there, the ones i try to take from my pc are huge, the ones on the phone, not huge, very small
[G1 Android Development] Raadius:
Downloading now!
[G1 Android Development] junkdruggler:
I cant even get started with this...

ADB was not found, you will not be able to manipulate the files...

what did I do wrong?
[G1 Android Development] Daneshm90:
Is adb in ur path ?

Go start -> run -> cmd and type adb

Do u see "not found" ????

if u do, then google setting up adb.
[G1 Android Development] junkdruggler:
Adb is set up and I can see my device...
[G1 Android Development] Daneshm90:
Ok then ignore it.
[G1 Android Development] junkdruggler:
I'll try that after I get back home...
[G1 Android Development] sneaky_zekey:
has anyone gotten this to work on linux (ubuntu) it works just fine in windows, lol im getting tired of having to reboot into windows just to run the apk manager, i make my edits in ubuntu by navigatiing to my windows directory(shared folders) but in order to compile, decompile, sign etc... i have to be in windows.

in linux when i hit 9 to decompile it doesnt do anything,no out folder or anything. if i try the all in one thing,i get adb not in path but i know adb is,cause if i open terminal and type adb i get the list of option,adb remount etc.....
[G1 Android Development] ranwej:
Please help me with compile Rosie.apk. Decompile was without problem, but now when i want to compile it, i received this error:

The system cannot find the path specified.
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
Exception in thread "main" brut.androlib.err.CantFindFrameworkResException
at brut.androlib.res.AndrolibResources.getFrameworkApk(Unknown Source)
at brut.androlib.Androlib.parseUsesFramework(Unknown Source)
at brut.androlib.Androlib.buildResourcesFull(Unknown Source)
at brut.androlib.Androlib.buildResources(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)

I tried to compile unchanged decompiled source.
[G1 Android Development] Daneshm90:
When decompiling, select the "with dependencies" option and drag com.HTC.framework into the script when its asks.
[G1 Android Development] Rolandx:
Hello. I wanted to replace some icons on a theme and almost succeeded entirely.

But I stumbled on the following problem:

the default theme has only 5 battery charge steps and what I imported has 20steps. And obviously if I use the default xml, wrong icons appear.

I decompiled the framework-res with apkmanager, modified the xml I needed and when I tried to compile back I received some errors, errors that occur every time I try to compile, no matter what framework-res, modified or not.

Any help please? I attached the log file, removed some of it because size was too large, but if you look at it, I only removed stuff that was the same, only different filenames.

edit: I also tried to decompile with dependencies, but dunno where to take com.htc.resources from :/

i also downloaded latest apkmanager, 4.8, but when i run it, it says 4.7 :)

(its my first attempt at modifying anything regarding apks btw)

Cheers
[G1 Android Development] Daneshm90:
Are u decompiling a themed framework-res ? u cannot since the original themer must not've recompiled the arsc file, hence while decompiling it cannot find resources.

Take stock framework-res, decompile, make ur changes, recompile.
[G1 Android Development] Rolandx:
stock framework-res, from where? stock framework-res of my ROM? As I said, Im quite new and dont know too much either :(
[G1 Android Development] Daneshm90:
Well wht rom is it ? if its one that compiled from aosp then its fine, if its however one of those "themed" roms then no.

But yea u need an original unthemed framework-res for ur firmware.
[G1 Android Development] Rolandx:
OpenDesire. It worked, I've done it, thanks a lot man, u made this first timer happy :)
[G1 Android Development] MapleBacon:
I'm stumped :( I've been trying to edit a single image in this apk using various methods for days and still haven't successfully done so. Here is my log. Please help me out someone.

-Extracted apk

-Replaced a single image in the out folder

-Option 7 to zip, sign, and install apk all at once.
[G1 Android Development] Daneshm90:
Are u placing the apk in the right folder ?

Seems it cannot find the apk.
[G1 Android Development] MapleBacon:
I started by placing the apk in the modding folder and then extracting with option 1. Then, I replaced an image in the out folder. After, I chose the option to zip, sign, and install all at once and thats what I get.
[G1 Android Development] Daneshm90:
I just did the same thing and it works fine.

Can u choose the step by step options instead of all-in-one. After each step can u check log to see which one gives u an error.
[G1 Android Development] MapleBacon:
I freshly unpacked apkmanager from the zip file just to start fresh. I placed the apk in the place-apk-here-for-modding folder and then extracted. I checked the log after and this is what I got. Despite the errors, an out folder was still generated with all the files and folders in it.
[G1 Android Development] MapleBacon:
Could it be the space in my directory APK Editing? I'll rename and try.

Edit: nope
[G1 Android Development] igor_anta:
So after a gazillion tries with a few system apps I still have no success:(

I'm modifying Setting, Contacts and Phone, before I found this app I just zipped them with the store compression method and they worked.

Here I tried many compression levels and nothing good happens. I follow steps 1-3 (on step 3 i use 1-system) then move the apk to the batch optimize folder and do zipalign.

Is there something I'm doing wrong or is it simply that these apps have to be compressed with store or 0 in this case?

The apps works great with "normal" apps and I have to say kudos on your works. Great job mate :D
[G1 Android Development] appelflap:
Applause

Ok, this is really, really great stuff. Thanks Maestro! I will definitely return with some questions and/or requests if you don't mind :)

[YOUTUBE]IxAKFlpdcfc[/YOUTUBE]
[G1 Android Development] Daneshm90:
Well u don't have to move the apk, the script gives u the option to zip-align right there. Fyi, don't zipalign Settings.apk, it doesn't like it ;)
[G1 Android Development] igor_anta:
Well it doesn't zipalign if i keep it in the default folder (...moding). And I didn't even try to zipalign at first, just extract, optimize, zip, choose system and than try to push it to the phone but no luck.

It does this for the 3 apps I mentioned. And it sucks cause after theming if I use 0 compression they are more than twice the size they were before (same when I did this with WinRar, only store worked) :(

There has to be a compression that works, just not sure which one it is :) Cheers!
[G1 Android Development] Daneshm90:
K can u elaborate on "but no luck"

Do u get fc ? Can u do adb logcat and see wht the reason for the fc are ?

Fyi, any compression should work. Thats not the cause of ur problem, something else is. Can u also post ur log.txt ? Thnx
[G1 Android Development] igor_anta:
Sorry for being vague :( i'll explain all the steps now.

I'm theming a lot of my system apps and I noticed that the sizes are quite bigger after i repack them using store in WinRar.

I found out about you program and used to unpack theme and compress all of the apps, and aside from the 3 that I mentioned (Phone, Settings and Contacts) all the others work (Vending, Mms, Music, Calendar, FileMenager, GenieWidget).

For all of the apps I use the same steps:

1.Put the apk in the place-apk-here-for-modding folder.

2.Extract, optimize, zip (steps 1 through 3, using the system option for zipping)

3.Put the apps in a update.zip and push them to my phone.

So the three apps that don't work get all messed up, FC on open, the icons are the system android icons so it obviously doesn't recognize them, phone unusable cause of the Phone.apk.

If i do everything the same but repack these three apps with store compression in WinRar they work :S

I'll post the log for Contacts.apk in a minute.

Thanks for everything, again aside from these problematic apps what you've done is amazing.
[G1 Android Development] igor_anta:
Here's my log.txt. To be honest I don't quite understand it :D
[G1 Android Development] tseidel:
ok so this may be me just making a ss of myself but i cant decompile an apk

the log file gives

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

|Mon 08/09/2010 -- 10:34:06.04|

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

The system cannot find the file specified.

The system cannot find the path specified.

The system cannot find the file specified.

The system cannot find the file specified.

The system cannot find the path specified.

java version "1.6.0_20"

Java(TM) SE Runtime Environment (build 1.6.0_20-b02)

Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)

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

operable program or batch file.

The system cannot find the path specified.

The system cannot find the path specified.

The system cannot find the path specified.

The system cannot find the path specified.

The system cannot find the file specified.

Unable to access jarfile apktool.jar

could someone please help me with this ?
[G1 Android Development] Daneshm90:
For both of u, it seems it cannot find certain files. For igor its zipalign and for tseidel its apktool hence u can't decompile. Can u check the "other" folder and see if the files are present. Also try extracting apk manager to a different location, im wondering if its a windows security issue. Are u on vista/xp/7 ?

Im on 7 and i can perform all the tasks.
[G1 Android Development] igor_anta:
They are. I'm on Windows 7 64-bit by the way.

The thing is that it works for all the other apps. I don't zipalign any of them, just steps 1, 2, 3. Same for the ones causing me problems. And it's always the same choices since they're all system apps.
[G1 Android Development] Daneshm90:
K can u do this. Follow the same procedure as u did for the other system apps. Just try it on one of them so say Contacts.apk

Once done, go start -> cmd -> adb logcat

Now adb push the apk to ur phone and see what it complains about in the log. It should give u a clue as to why it force-closes.
[G1 Android Development] igor_anta:
Never used logcat so please explain a bit. I opened logcat in DDMS and pushed the file in cmd. The file got pushed I got a truckload of FC's but logcat is empty :S How do i do this?
[G1 Android Development] Daneshm90:
Oh

go start -> cmd -> adb logcat

u shud see a bunch of text but then it'll stop scrolling.

Now push ur modified apk and u'll see it scroll some more. I need the new bit
[G1 Android Development] igor_anta:
So I have a problem with logcat then :( I enter the full path to my android-sdk-windows\tools directory right?

Enter adb logcat and it just stops there, does nothing and i can't do anything in this window. Maybe something should be enabled first? I do have access to adb push and other commands as well, it's just this one that seems to choke.
[G1 Android Development] Daneshm90:
Hmm wierd. Anyway can u do this through apk manager :

1. Insert original Contacts.apk

2. Extract

3. Zip (Choose System)

4. Select push to /system

Does the app give u fc ?
[G1 Android Development] igor_anta:
Cant's adb push through APK Manager. Log says:

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

The system cannot find the path specified.

I guess it's something with me. I follow the 3 steps and after that I get Contacts.apk and repackaged-unsigned.apk in the ... modding folder. Then just press 8, write /system/app/Contacts.apk, is this correct?

If so I will try to do something with logcat cause it's a problem on my end obviously. Thanks.
[G1 Android Development] Daneshm90:
Well normally if u go start -> cmd -> adb

do u see 'adb' not found ? if so u need adb in ur path. Google it ;)

But yes ur modified apk if its system should be repackaged-unsigned.apk
[G1 Android Development] igor_anta:
OK, now it does adb push (it was added to my system path, but it was all wrong). But again it's the same, pushed it through APK Manager and FC's all the way. Logcat is till being a d*%k :D
[G1 Android Development] Daneshm90:
Lol, k download this from the market, and send it to my email that i'll pm u on xda.

Link
[G1 Android Development] igor_anta:
Downloaded, this is all I get:

Log Collector version: 1.1.0

Device model: Pulse

Firmware version: 2.1-update1

Kernel version: 2.6.29-perf

huawei@huawei-desktop )

#3 PREEMPT Thu Jul 1 01:06:13 HKT 2010

Build number: FLB-Mod 1.3

No other data, I also pushed an apk that doesn't cause FC's in order to try this immediately after but still the same. It seems my phone dislikes logs? :)
[G1 Android Development] Daneshm90:
Wow tht is just wierd lol. Has it always been like this ? Rom specific problems ?
[G1 Android Development] igor_anta:
Like I said, never needed a log before. I'll be back here once I figure this out, don't you worry :) Cheers!
[G1 Android Development] tseidel:
ok i will try unzipping it somewhere else i have windows xp but i dont have a folder labeled "other" where would it be ?
[G1 Android Development] Daneshm90:
Theres ur problem. It shud be in the zip u download. In the same directory as the script and folders like "place-apk-here-for-modding".
[G1 Android Development] tseidel:
Sorry thanks for the help i guess my first download was curropted or something because i just redownloaded it and its in there .
[G1 Android Development] Daneshm90:
Np, hope everything works out.
[G1 Android Development] tseidel:
now aparently i have to download the latest framework resources ?
[G1 Android Development] Daneshm90:
Lol wht are u trying to edit and apk manager is saying that ?
[G1 Android Development] tseidel:
phone.apk basically im following a guide to add the roam only option and its not very detailed obviously
[G1 Android Development] Daneshm90:
Wait wht is telling u to "update framework resources" ???
[G1 Android Development] tseidel:
Cant't find framework resources for package of id 2 You must install proper framework files , see project website for more info

error blah blah check log
[G1 Android Development] igor_anta:
I'm baaaack :D I finally fixed that damn log issue, it seems logger was disabled by the phone kernel by default :S

So PM me your mail to send the log or should i just post it here?
[G1 Android Development] Daneshm90:
Cool. just post it here.
[G1 Android Development] Daneshm90:
oh k. Choose the second decompiling option and drag in any other apks in the framework folder of ur rom. After dragging press enter n see if apk manager complains.
[G1 Android Development] igor_anta:
Here it is, chaos.
[G1 Android Development] Daneshm90:
K seems ur not modifying stock android files ?

When ur decompiling Contacts, check apk manager's log and see if it complains about missing resources. Cuz the log u posted is complaining about that.
[G1 Android Development] MapleBacon:
Hey danesh, can you check this out? I don't want to repost it.

http://xdaforums.com/showpost.php?p=7572993&postcount=335

I don't understand why it says it can't find anything. I even downloaded the android sdk again, java, and the apk manager zip. Is there some other prerequisites to use this? Some other tools I am suppose to have before hand or something? Eclipse? I'm on Windows XP Service Pack 3. I'm also the administrator on the PC.

Also, these are the different java programs I have installed as displayed by the Add or Remove Programs applet in control panel: Java DB 10.5.30, Java(TM) 6 Update 21, and Java(TM) SE Development Kit 6 Update 21. I don't use them normally, I just downloaded them to use some of these various apk signing tools I've tried.

Thanks in advance.
[G1 Android Development] Daneshm90:
Honestly, the standard java u get from java.com is enough to sign apk's and use apktool. It seems as if it doesn't find the "other" folder on xp systems. I have a winxp machine at work, i'll give it a shot and see if i face these issues.
[G1 Android Development] igor_anta:
The only thing it says is:

Could Not Find C:\APK Menager\place-apk-here-for-modding\../place-apk-here-for-modding/repackaged.apk

Could Not Find C:\APK Menager\place-apk-here-for-modding\../place-apk-here-for-modding/repackaged-signed.apk

Could Not Find C:\APK Menager\place-apk-here-for-modding\../place-apk-here-for-modding/repackaged-unsigned.apk

The system cannot find the file specified.

And this is for evey app I put there after I press 1 for extract, after that no messages. The Contacts.apk is a Huawei app, the manufacturers, and is a bit different from the stock one, but Phone and Settings are stock. So, what do you think? Also if I select 0 compression level they work, just to add :) Cheers!