yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] reekotubbs:
I'm sorry if there was some misunderstanding, but I did say I did the rename part, I found it in the thread http://xdaforums.com/showthread.php?t=725870

in particular where it says to

"this command changes all occurances of htc/fm to htc/modradio in your xml and .java files.

find ./ -type f | xargs perl -pi -e 's/htc\/fm/htc\/modradio/g'

this command changes all occurances of htc.fm to htc.modradio

find ./ -type f | xargs perl -pi -e 's/htc.fm/htc.modradio/g'"

except, instead of htc/fm to htc/modradio, I changed apps/googlevoice to apps/mikemoewill

and instead of htc.fm to htc.modradio, I changed apps.googlevoice to apps.mikemoewill.

I followed those directions to a T and this is what cause the errors to look that way.

Again, I was not attempting to leave anything out, but this is what happens when I attempt to rename the all occurrences of apps/googlevoice and apps.googlevoice. If there is something that I am missing please let me know.

I was also having this issue when I was using cygwin in windows, when I tried to rename the code I ran into these errors, then I used notepad++ which in normal mode only looked for apps.googlevoice not any apps?googlevoice.
[G1 Android Development] Brut.all:
Ahh, sorry. But I didn't test commands from that thread. Also I've written that changing package name is tricky, so these instructions may not work for every apk file.

And hmm... is Google Voice installed on some devices as a system app? I'm surprised so many people want to change package names of their apps. I thought this is quite exotic need.
[G1 Android Development] reekotubbs:
If you have you own set of commands I would appreciate it if you could give me some insight.

Google voice is not a system app, I've done it with previous version of the google voice, but the current one has that file with the identical name that is causing the issue. I know this is a need of mine and that's because I have multiple google voice accounts and need to install the app twice so that I can use both simultaneously.

I appreciate your help and time.
[G1 Android Development] riverajuan:
Hi to every one in this great site,

I don't have a lot of experience with Ubuntu, however i do have it install using a virtual box under windows xp.

I am really interested in learning the process to modified apks I have experience with some other languages, but none with linux. Can someone show some light as to where to start or get some info guide me alone the way?

One last question. Can I use this under windows and if is possible where do I start?

Thanks in advance

BTW I do have sdk 2.1 installed
[G1 Android Development] Brut.all:
Apktool is multi-platform - it works nearly the same on Windows and linux.

http://code.google.com/p/android-apktool/

There is an "Installation for noobs:" section there ;-)
[G1 Android Development] djmcnz:
Anybody Else?

Has anybody else reported the following problem? I've searched this thread and read the last 60 odd posts but no joy.

Adding 2.apk and/or populating apktool.jar/brut/androlib/ does not seem to work.

From the CyanogenMod wallpapers apk in CM6...

Decoding E:\Android\APKTool\com.cyanogenmod.cmwallpapers.apk...

31-Aug-2010 19:12:40 brut.androlib.Androlib decodeSourcesSmali
INFO: Baksmaling...
31-Aug-2010 19:12:41 brut.androlib.res.AndrolibResources loadMainPkg
INFO: Loading resource table...
Exception in thread "main" brut.androlib.err.UndefinedResObject: config: [DEFAULT]
at brut.androlib.res.data.ResPackage.getConfig(Unknown Source)
at brut.androlib.res.decoder.ARSCDecoder.addMissingResSpecs(Unknown Source)
at brut.androlib.res.decoder.ARSCDecoder.readType(Unknown Source)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(Unknown Source)
at brut.androlib.res.decoder.ARSCDecoder.readTable(Unknown Source)
at brut.androlib.res.decoder.ARSCDecoder.decode(Unknown Source)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(Unknown Source)
at brut.androlib.res.AndrolibResources.loadMainPkg(Unknown Source)
at brut.androlib.res.AndrolibResources.getResTable(Unknown Source)
at brut.androlib.Androlib.getResTable(Unknown Source)
at brut.androlib.ApkDecoder.getResTable(Unknown Source)
at brut.androlib.ApkDecoder.decode(Unknown Source)
at brut.apktool.Main.cmdDecode(Unknown Source)
at brut.apktool.Main.main(Unknown Source)

No output file(s) generated

Cleaning up...

Complete [with errors]

Press any key to continue . . .
[G1 Android Development] kevdog:
In the recompiled apk (specifically framework-res.apk), what's the deal with all the -v4 folders in /res? I've read others saying you can delete these possibly? Is this true?
[G1 Android Development] Brut.all:
Yeah, in most situations you could remove these -v4. Apktool will do this in next version. See for more info:

http://code.google.com/p/android-apktool/issues/detail?id=85
[G1 Android Development] Brut.all:
Hmm...

$ apktool1.3.1 d CMWallpapers.apk
I: Baksmaling...
I: Loading resource table...
I: Decoding resources...
I: Loading resource table from file: /home/brutall/apktool/framework/1.apk
I: Copying assets and libs...
$

I pulled this file from CM6-DS build. Could you upload your apk?

Anyway, this is a bug of apktool. Thanks for report, will be fixed soon :-)
[G1 Android Development] djmcnz:
Sure... here it is from the N1 Stable release...
[G1 Android Development] husq510:
thats probably why Im not able to set breakpoint to .smali ?
[G1 Android Development] Brut.all:
You should be able to decode it using v1.3.2 :-) Thanks for your report.
[G1 Android Development] djmcnz:
Tested. Verified. Love your work.

A few burgers on their way to you. For this release and all the previous ones!

Thank you.
[G1 Android Development] pendo:
yes....I really owe that beer in person some day sir but this will have to do for now...

Cheers, and thanks for all of your help!
[G1 Android Development] blakestiffler:
can someone tell me why my framework wont recompile properly here is what i typed and the error i got
[G1 Android Development] Brut.all:
Did you placed aapt tool in a path (e.g. Windows dir)?
[G1 Android Development] blakestiffler:
im on a mac so i didnt think i had to do that. If so how do i do that?
[G1 Android Development] Brut.all:
Just read first page of project site.
[G1 Android Development] blakestiffler:
Download apktool-install-macos-* file

Download apktool-* file

Unpack both to /usr/local/bin directory (you must have root permissions)

Im not really sure how to do this. Im a bit of a newb

update: Nevermind i got it. Thanks for the help
[G1 Android Development] blakestiffler:
now im having trouble signing it

update: nevermind i figured that out too :)
[G1 Android Development] blakestiffler:
can anyone help me with this please? i cant get through a single step without a problem
[G1 Android Development] kevdog:
Any chance -- ever -- of getting this app to run on the phone itself?
[G1 Android Development] Brut.all:
Hmm... I'm not sure what do you want to do. Why do you use 7za?

Also it's much better to copy & paste contents of a terminal - instead of posting a printscreen of it :-)

http://groups.google.com/group/apktool/browse_thread/thread/952c51ed1b2ff0f2
[G1 Android Development] cauli:
Didn't someone else ask about your source code a few weeks ago? IIRC they mentioned wanting to port some of its features to the device platform. It was probably in this thread & my estimate of the timescale could easily be way off.
[G1 Android Development] Brut.all:
https://code.google.com/p/android-apktool/wiki/FAQ

There are answers to both sources and running on a device questions.
[G1 Android Development] pendo:
I can try to help, I'm pretty new as well, but have been running through the paces pretty hard (at least trying to) lately.

Here's how I did it:

1)enable viewing of hidden folders/files. One easy way to do this is by installing Secrets preference pane. Really handy tool to do all sorts of custom stuff. Of course there's a terminal command as well: defaults write com.apple.finder AppleShowAllFiles TRUE

You will have to restart Finder (either select relaunch with Preferences or hold option+click for a second or two and you'll see a relaunch option)

2)unpack both files from the apktool page into the now visible usr/local/bin directory.

3)turn off hidden folders if you want by either going back into the preferences pane or just type the same command above in terminal, but substitute FALSE. Once again restart finder.

As annoying as it is to see them all the time, I usually leave my hidden files viewable to help remind me to clean up those damn .DS_Store

There aren't many options when running apktool, and I find myself 90% of the time just using the d and b commands. With his recent upgrades to apktool, you shouldn't have too much trouble.
[G1 Android Development] snapa55:
I'm a total noob. What java do I need for Windows 7? I downloaded JRE for Devs w/ Netbeans, but I can't get apktool working.
[G1 Android Development] Brut.all:
You need Java6. I won't help you if you won't tell me what problem do you have exactly.
[G1 Android Development] snapa55:
Well I guess I don't know where to start. Do I just try to run apktool in cmd, or does it have to be a specific folder?
[G1 Android Development] djmcnz:
http://www.java.com/en/download/index.jsp
[G1 Android Development] snapa55:
I'm getting:
[G1 Android Development] djmcnz:
Click yes and see what happens.

java.exe is not in your command path... you need to fix that.

http://www.java.com/en/download/help/path.xml
[G1 Android Development] snapa55:
Got it now, thanks!
[G1 Android Development] XlAfbk:
rebuild apk crashs

I'm trying to mod an app (replace some image to make it fit better into my custom UI) but the rebuild app crashs, even if I don't make any changes but just rebuild it.

The app in question is com.noinnion.android.greader.reader (Free)

What I did:

apktool d com.noinnion.android.greader.reader.apk

apktool b com.noinnion.android.greader.reader com.noinnion.android.greader.reader_rebuild.apk

sign the apk

adb install com.noinnion.android.greader.reader_rebuild.apk

Then I start the app and enter my google login info. That's when it crashs.

Any ideas?
[G1 Android Development] Brut.all:
Look into logcat.
[G1 Android Development] snapa55:
So I'm trying to change the text on my Latitude widget to be white using metamorph. I think I've pinpointed the correct file, it's sytles.xml in /values

But when I rebuild, there is no /values folder. What am I missing?
[G1 Android Development] Brut.all:
All values*/* files are stored in binary form in resources.arsc file.
[G1 Android Development] snapa55:
Ah thanks Brut. Do you think the app needs to be signed before I exact the resources.arsc? The widget doesn't want to load after I've made my changes.
[G1 Android Development] xtort1417:
I am having trouble getting apktools to work. I *was* trying to edit some .9.pngs however after having edited app force close everytime I tried to run it, I got suspicious and tried just decoding the app, and then building it with no changes at all to see happened. I end up with an apk about 10k smaller than the original, and it will not start. This is with no modifications at all, just an apktool d and then an apktool b on the decode directory. Any help/thoughts? does the tool still not work with all apps? Thanks
[G1 Android Development] Brut.all:
What do you get in logcat?
[G1 Android Development] xtort1417:
ill let you know, I deleted and reinstalled original app. Give me a couple of minutes
[G1 Android Development] xtort1417:
ok here we go:
[G1 Android Development] Brut.all:
Hmm.. how did you installed it? Normally: adb install?
[G1 Android Development] xtort1417:
For the modified one, I did an adb push...

Just tried adb install... looks like I am getting a signing error:

Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]

So, great! Now the only problem is I have still not found a single thread on any site discussing an easy/simple way to sign an app on Mac OSX :(
[G1 Android Development] shoey-n:
Copy META-INF from original apk into your modified one
[G1 Android Development] kevdog:
Anyone with any idea how to totally uninstall GV and install a signed compiled version to /system/app? I can't seem to uninstall the market version totally despite everything I delete.
[G1 Android Development] pendo:
What have you tried in regards to uninstalling? When you are deleting, are you making sure to get the entries in data/data, and data/dalvik-cache ? Also, there are the asset entries in vending....
[G1 Android Development] kevdog:
I deleted everything in /data/app, /system/app, cleared davlik-cache, and then some entries in /data/system/packages.xml -- section specifically referencing GV. Anything else I need to delete -- obviously something is still left behind.
[G1 Android Development] pendo:
There's also the entry in /data/data/com.android.google.apps.googlevoice

Then I don't know if this one really makes a difference, but there's an entry in /data/data/com.android.vending/databases/assets.db That's a list of all your market apps and their install/uninstall times, signatures, etc.

The first one I mentioned for sure needs to come out. I'm not as knowledgable as some on here so there may be more, but I know of those off the top of my head..
[G1 Android Development] SirBrass:
I'm trying to decompile the framework-res.apk (doing phimuskapsi's notification color change mod), and following his instructions to the letter, but translated from windoze-speak to osx terminal commands. Everything has gone peachy until step 3.2:

$ apktool d -f -t working/framework-res.apk ../framework-decoded

I'm getting the following error:

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:114)
at java.util.zip.ZipFile.<init>(ZipFile.java:131)
... 7 more

What am I doing wrong and how do I fix it? I've got work to do still before work tomorrow, but this minor issue with my phone is driving me to distraction. A PM'd response would be fine as well (as that response may come while I'm at work and thus not checking XDA).

I'm fairly new to hacking the phone, but I'm no n00b when it comes to computers.... just new to linux/unix command line commands and syntax (I used to be fairly comfortable with dos, however, but I run a mac at home now).

Edit: I AM trying to decompile a deodexed version of the leaked 2.2 for the Droid X with a black notifications bar, if that sheds light on anything
[G1 Android Development] kevdog:
Ahh, thanks for pointing out the database file. I noticed this is in sqlite format. Anyway to "decrypt" the contents of this file, or am I safe just deleting the line where googlevoice is mentioned. I'm assuming the long numbers mentioned after the respective apps are each individual's app's signature??
[G1 Android Development] djmcnz:
You shouldn't need to manually delete anything there.

try:

pm uninstall com.android.google.apps.googlevoice

And then delete any remaining files in /data/app/..., /data/data/... and/or /system/app/...
[G1 Android Development] kevdog:
Did that -- didn't work!! Trying to install googlevoice.apk that I compiled with apktool it still said Failure and mentioned another version installed. What am I missing?
[G1 Android Development] djmcnz:
Depends on a number of things, including what the androidmainfest.xml says... remove any references to shared uids in there. Although this should be necessary for a market app.

I assume you're using the Market version?

Try pushing it to a fresh rom install, what happens then?
[G1 Android Development] canadiancow:
I found a legal and extremely helpful use for apktool today.

I had spent about 30 minutes doing some custom XML drawables to replace some other crap in an app. After I had verified it was working on my device, I deleted the old crap, and was about to check everything in to SVN, when I realize I had actually deleted the new drawables :(

Luckily, I had them on my device, so I pulled the APK, and extracted them with apktool. I know there are other ways to get resources out of an APK, but it wouldn't have been worth spending 30 minutes to try something that might not work, when I could have just redone them from scratch.

Thanks brut :)
[G1 Android Development] SirBrass:
Can anyone answer my question as to what's going wrong that I posted above. i properly installed apktool in /usr/local/bin, and yet I get this error. Java is up to date in OSX. I'm not getting an error saying java commands are unknown so I don't think its a path issue. I figure there's GOT to be something I'm forgetting here, I just can't figure out WHAT. Seriously, any help would be appreciated here.
[G1 Android Development] pendo:
yeah, I didn't think that would make a difference.

What about a2sd? What flavor of that are you running? I'm not an a2sd expert by any means, but is it possible that it's hiding on a ext partition somewhere? I'm not sure how you'd go about checking that.
[G1 Android Development] Brut.all:
Your path to apk file is wrong or it's broken/isn't a valid zip file.
[G1 Android Development] SirBrass:
I guess I could try pulling the framework-res.apk file again and see if that works.
[G1 Android Development] djmcnz:
There was a typo in my code:

pm uninstall com.android.google.apps.googlevoice

should be:

pm uninstall com.[COLOR="Red"]google.android[/COLOR].apps.googlevoice

But perhaps just try:

pm path com.google.android.apps.googlevoice

That will tell you where it is.
[G1 Android Development] Shagman68:
I have googled and read crap for a week. I am gonna ask, cause I have exhausted search and am not willing to spend another week reading and trying more stuff. All I want to do is edit stat-battery....xml in my framework-res.apk file. I keep getting this stupid error when I try to Build the apk...
[G1 Android Development] Brut.all:
I don't really know, where did you searched, but Google finds hundreds of results: http://www.google.com/search?q=the+requested+operation+requires+elevation . Seems problem is related to administrator privileges. I think you should not try to build it in Windows dir, cause it's write-protected.
[G1 Android Development] pendo:
is aapt in your path?
[G1 Android Development] Shagman68:
When I get home from work tonight I'll try moving it to C:/projects and create a new path to that and give it a go again. Thanks for the tip, I was about to just start drinking heavily instead.

Sent from my Vibrant using the XDA app.
[G1 Android Development] he_stheone64:
Hi Brut - after decompiling and compiling tons of apks with your great tool the first time I have an apk, that does not even recompile if I change nothing (did that for testing, after it failed the first few times).

I tried both apkmanager and directly with apktool. All other apps work - is this maybe related that I pulled the app fro data/app-private and there are additional dependencies in the zip in data/app? The apk was desktop visualizer and I needed to change the layout to fix a bug, the dev left for his 1x2 widget paddings.

Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce

ption: could not exec command: [aapt, p, -F, C:\Users\meier\AppData\Local\Temp

\APKTOOL711666031386668468.tmp, -I, C:\Users\meier\apktool\framework\1.apk, -S

, C:\Apk_Manager_4.8\other\..\out\res, -M, C:\Apk_Manager_4.8\other\..\out\Andro

idManifest.xml]

at brut.androlib.res.AndrolibResources.aaptPackage(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)

Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\U

sers\niesing\AppData\Local\Temp\APKTOOL711666031386668468.tmp, -I, C:\Users\nies

ing\apktool\framework\1.apk, -S, C:\Apk_Manager_4.8\other\..\out\res, -M, C:\Apk

_Manager_4.8\other\..\out\AndroidManifest.xml]

at brut.util.OS.exec(Unknown Source)

... 7 more
[G1 Android Development] Brut.all:
Real error should be somewhere above/below. Appt always throws errors if it fails.
[G1 Android Development] Jbazt_katuforzs:
is it possible for me to edit operamini.apk's server using this tool?
[G1 Android Development] mr_sarge:
don't know if you had time to take my attanchments before the forum crash so theyre they are again.

Thanks !
[G1 Android Development] cauli:
apktool problem with xml?

Crash? You're kidding? :( <checks for news> That was one of my longest posts here yesterday :eek:

Ok, a summary:

I'm trying to mod System Info Widget. First step, decode & rebuild without any changes. The procedure doesn't seem to produce any errors. The resulting apk installs & runs. All works fine bar one aspect: widget text colours are screwed; they should be a theme dependent colour (black or white), but instead they're a default mid grey. Log cat attached covering the creation of a widget & changing of its current theme. There's nothing obvious in it to me, but I'm new to this.

Next step, try to narrow down the problem. End result: from the rebuilt apk copy the single file res\layout-port\widget_1_4_theme4.xml into the original apk. When pushed to /system/app/ it runs fine. However if I create the 1x4 widget & change to theme 4 (eclair, icons only), once again the text colour goes screwy & falls back to mid grey. The intended colours are defined in res\values\styles.xml & referenced in the widget_<x>_<y>_theme<n>.xml files. Somehow this dereferencing is failing.

Any ideas?

[Edit:] I can't resist fiddling. I noticed in the problem xml files the vanishing styles are referenced thus:

<TextView android:id="@id/item1_text" android:layout_width="wrap_content" android:layout_height="wrap_content" style="\@style/TextTheme4" />

I don't know if this is syntactically correct, however the \ in style="\@style/TextTheme4" looks out of place. Stripping these, lo & behold, seems to fix the problem. I need a little more testing to be sure, but it looks good.

This leaves a few questions. Should these chars not be in the original source? Indeed, are they? Why do they present a problem, but only if the binary xml is converted to text & then back to binary? My guess is that they are legit but not necessary. Further, that they are correctly decoded to text by 'apktool d' but that the xml parsing done by 'apktool b' is broken slightly. Just guesswork though. Typical, 50/50 & I guess wrong. I give myself 7/10 for effort & 2/10 for results.

Any comments? BTW I'm trying to teach myself about this stuff, so any explanations or pointers to android docs etc would be most appreciated :)
[G1 Android Development] mytharak:
Have you tried taking the original and the rebuilt binary xml files and comparing them in a hex editor? I have my suspicions...
[G1 Android Development] stalvatero:
Hey!!!!!!

What happened to all posts between 17th and 24th September????

There were also my posts....