yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] santiemanuel:
Microsoft Windows [Versión 6.1.7600]

Copyright (c) 2009 Microsoft Corporation. Reservados todos los derechos.

C:\Users\santiago>cd c:/android/tools

c:\android\tools>apktool b framework-res

W: Could not find sources

I: Checking whether resources has changed...

I: Building resources...

c:\android\tools\framework-res\res\values\public.xml:3044: error: Public symbol

drawable/stat_sys_battery_100 declared here is not defined.

c:\android\tools\framework-res\res\values\public.xml:3046: error: Public symbol

drawable/stat_sys_battery_40 declared here is not defined.

c:\android\tools\framework-res\res\values\public.xml:3047: error: Public symbol

drawable/stat_sys_battery_60 declared here is not defined.

c:\android\tools\framework-res\res\values\public.xml:3048: error: Public symbol

drawable/stat_sys_battery_80 declared here is not defined.

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

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

p\APKTOOL1578774602493780273.tmp, -x, -0, arsc, -S, c:\android\tools\framework-r

es\res, -M, c:\android\tools\framework-res\AndroidManifest.xml, c:\android\tools

\framework-res\9patch]

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\santiago\AppData\Local\Temp\APKTOOL1578774602493780273.tmp, -x, -0, arsc, -

S, c:\android\tools\framework-res\res, -M, c:\android\tools\framework-res\Androi

dManifest.xml, c:\android\tools\framework-res\9patch]

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

... 7 more

c:\android\tools>

Public.xml has declared old battery pngs, The modified stat_sys_battery.xml has from 0 to 25
[G1 Android Development] Brut.all:
Wait a second... this error above is thrown for files unmodified by you (I mean: "apktool d", "apktool b" and bang!)? If so, then it's apktool bug - post original framework-res.apk and I will look into it. If no, then I don't really know, what you have changed exactly, what you have screwed up ;-)
[G1 Android Development] santiemanuel:
See, original status_sys_battery.xml

<item android:drawable="@drawable/stat_sys_battery_0" android:maxLevel="4" />

for 20 40 60 80 and 100, this variables are declared in public.xml

Modified has from "@drawable/stat_sys_battery_0" to "@drawable/stat_sys_battery_25"

The apktool is the latest with my resources.arsc inserted on it.

Do you need my original framework?
[G1 Android Development] okolowicz:
After editing (but prior to recompiling) an apk I got from the Market, is there something I can remove to prevent updates in the Marketplace from showing up?
[G1 Android Development] olearyp:
I believe that those are based on the package name, so I would try modifying that.
[G1 Android Development] Brut.all:
AFAIK application installed other way than through the Market isn't updated by it. So it would be harder to let them be updated, I think you will get what you want for free ;-)

EDIT:

But if you uninstall and install app using adb, then maybe (I don't know) Market won't notice that and it will think that modded application was installed through Market. If so, you could try to uninstall original app using Market, not adb.
[G1 Android Development] Exculpo:
I'm back with another issue :P

Changed a few things in the code, some png's and xml's in chompSMS and when I built it back and tried it on my phone I got nasty graphic bugs in the app.. Seems like I'm getting MDPI graphics instead of HDPI somehow.

I tried several things to sort it out but came up empty, so I tried to just do a plain -decode and then right back to a build without changing anything and I get the same result so it wasn't because of any of my changes, no .9.png's were changed or anything.

Using the latest apktool on XP 32..

Can anyone help me out with this one?

Thanks.

This is the output:
[G1 Android Development] Brut.all:
This isn't MDPI, but lack of 9patch data in images. Do you edit original apk or maybe one, which was built by apktool earlier?
[G1 Android Development] canadiancow:
When I test Nav Launcher, I sometimes completely remove it (normal application installation process, not ADB). I then install a new test version using ADB. The Market will still try to update it. However, it was signed with the proper key, which may have something to do with it.
[G1 Android Development] Exculpo:
ahh, suspected it might had something to do with those obnoxius .9graphics.

You are ofcourse right, the file I'm editing isn't the Beta as it should be, but some previously edited version. Works just fine when building the actual Beta ;)

Thanks for the enlightenment!
[G1 Android Development] donghungx:
hi, I've tried to decode one akp file, after that I reBuild it (dont change anything) and try to install it, it not work. I just want to change resources.arsc file but it to hard. :)

It is just small app.

Can you help me?

himp3.com/music.apk (i can't post link sorry)
[G1 Android Development] Daneshm90:
Did u sign it ? If you're new to this whole process then use the script (Apk Manager) attached to my signature. Once ur comfortable with the process then u can start doing things on ur own :D
[G1 Android Development] donghungx:
Damn it, You are god, my idol lol. Many thanks
[G1 Android Development] Roladriz:
I was using this tool about a month ago, I extracted the files, put aapt.exe, apktool.bat, apktool.jar, and mgwz.dll all in my C:\Windows along with the .apk. Now I have fallen behind with updates and I am trying to get the tool to work again but the commands I used in the past aren't working. I did java -jar apktool.jar d GenieWidget.apk GenieWidget.apk -decoded ... all from my C:\Windows dir... and now those commands aren't working. Any help would be appreciated..Windows 7x 64..Thank you

p.s. sorry for the n00bness
[G1 Android Development] Daneshm90:
Theres an easier way ;) Use "Apk Manager" from my signature. Its just an interface for apk editing and incorporates apktool.
[G1 Android Development] Roladriz:
I will try it out thank you.
[G1 Android Development] dully79:
could not decode file

Kind people.

I have downloaded and unpacked both the windows apktool install and the apktool1.3.1 files to my windows directory as instructed.

I have also ran the command "apktool if C:\com.htc.resources.apk"+ "apktool if C:\framework-res.apk".

When i type "apktool d WHATEVER APK", i get messages telling me "could not decode file "WHATEVER.9.png"

Then i get the same messages when i "apktool b" even if i have'nt edited anything.

I have managed to run apktool d+b on apk's containing no .9.png's which makes me think it's a .9.png issue.

I've tried a few of the work-a-rounds posted earlier on with no luck.:confused:

I'm sorry if this is a noob question but i've googled and looked for the past 2 days and cannot find any solution, any help would be greatly appreciated.:)
[G1 Android Development] Daneshm90:
Can u post the apk ur trying to decode ? That will prolly help.
[G1 Android Development] dully79:
Sorry.

The apk is "WF clock widget" or "org.fagod.wfc_widget.apk"

http://hotfile.com/dl/52471168/3266c38/org.fagod.wfc_widget.apk.html

Im only wanting to change the text on the home screen from white to black but i think the file i need to edit is in the values folder.

Thanks
[G1 Android Development] Daneshm90:
I just tried and and get no such errors. I am however not using That "if...." stuff. Im just using apk manager n it decompiles/compiles back fine w/o errors.
[G1 Android Development] dully79:
I've tried with and without installing the frameworks and tried using your apk manager also and i always get the same error when decompiling, and when compileng i get a list of of errors all saying-

"Public symbol drawable/******* declared here is not defined"

Think im gunna try and set it up on my other ****ty desktop and see if it works.

Thanks so far.
[G1 Android Development] bmfc187:
is it possible to compile com.htc.resources.apk using apktool? i successfully de-odexed the odex file, them recompiled into classes.dex and put in the apk and used apktool to decompile...all worked fine. i have made an edit to one .xml file in res/drawable, and want to build back into .apk form, but when i do:

apktool b com.htc.resources

it says

I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...

but it never does anything...the cursor will sit and blink for hours if i let it...longest ive let it go is about 20-30 minutes...

will it just not build the htc framework, or am i just doing something wrong?

-BMFC
[G1 Android Development] Daneshm90:
Can u post the apk ur trying to edit ? ill give it a shot and see if i face similar issues.
[G1 Android Development] bmfc187:
here it is...im just making one change to one .xml file (res/drawable/common_list_bg.xml) and then trying to recompile, but it just hangs at "building resources"...

-BMFC
[G1 Android Development] Daneshm90:
Nvm, i see it now ;) Will get back to u.
[G1 Android Development] Daneshm90:
Ok i think its a memory issue. Works if i do this :

java -Xmx512m -jar apktool.jar b <w/e>
[G1 Android Development] bmfc187:
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathNotExist: apktool.yml

at brut.androlib.Androlib.readMetaFile(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.directory.PathNotExist: apktool.yml

at brut.directory.AbstractDirectory.getFileInput(Unknown Source)

... 5 more

bmfc@bmfc-laptop:~/Desktop/smali$

-BMFC
[G1 Android Development] Daneshm90:
Do this, download apk manager from my signature. Then open the Script.bat in a text editor, replace the line java -jar apktool with java -Xmx512m -jar apktool

Then run the script and follow through. I did that and it compiles back fine.
[G1 Android Development] bmfc187:
first off i am trying to do this on my ubuntu laptop...i do have apkmanager on my vista desktop, and i copied the apk over to that machine and ran it thru and i got the same errors before and after i added the -Xmx512m to the script...i couldnt find a way to copy text out of my command prompt, or to take a screenshot...i think it might have been complaining about not finding aapt in the specified path? but i see aapt.exe in the folder \apk-manager\other...

the last thing it says is "The system cannot find the specified path" and i see a bunch of errors that have

brut.common.exception: could not exec command: [aapt, p, -F, <paths to what looks like temp files>]

i dunno what im doing wrong...

-BMFC
[G1 Android Development] Daneshm90:
I dunno man. Heres a video showing it. Wait for it to be processed, i just uploaded it ;)

[YOUTUBE]<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/90pQcgu01CA&hl=en_US&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/90pQcgu01CA&hl=en_US&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>[/YOUTUBE]
[G1 Android Development] bmfc187:
from the looks of your video i dont have the newest version of apk-manager. downloading new version now...

-BMFC
[G1 Android Development] bmfc187:
it worked!!! thanks alot!

-BMFC
[G1 Android Development] Daneshm90:
Yay :D Btw thanks for this, ill be adding an option like this in next version.
[G1 Android Development] bmfc187:
option like what? confused...lol

-BMFC
[G1 Android Development] Daneshm90:
Well there are some apks, that when decompiling/compiling require a larger heap-space, larger than the default 64mb. So i added an option to set a custom heap space size to avoid such situations in the future. Its specially a notable issue when signing update.zip's. If the update.zip is really large like 100mb, then ull get a out of heap-space error.
[G1 Android Development] bmfc187:
i see...ill have to pay more attention to keeping it up-to-date! thanks for your help!

-BMFC
[G1 Android Development] bmfc187:
@daneshm90, i downloaded the linux version for my ubuntu laptop and tried the same thing and got the same errors, i even added the -Xmx512m to the script and still it errors out...i see that the windows version is at 4.6 and the linux version is only at 4.3 could that have anything to do with it? i mean does the 4.3 mean that its not as current or is it on a different timeline than the windows version?

-BMFC
[G1 Android Development] Daneshm90:
Hmm i dont think the version of my script matters as much as the version of apktool, try downloading the latest apk tool and place it in the out folder or w/e and then try the -Xmx512m in the script.
[G1 Android Development] ivarson_swe:
Thought I'd try to rebuild either you Maps, switching back to having the same appname as Google Maps or rebuild CarHomeGoogle to use your Maps/navi.

But when building i get

Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, /tmp/APKTOOL7556335984888668846.tmp, -I, /home/j0e/apktool/framework/1.apk, -S, /media/lagring/apps/android-sdk-windows-1.5_r3/brutmaps14/res, -M, /media/lagring/apps/android-sdk-windows-1.5_r3/brutmaps14/AndroidManifest.xml]

I get this when I rebuild both apps, without even editing them?

What am I missing?
[G1 Android Development] Brut.all:
Do you have "aapt" command in your PATH? I think there should be another error message above or below that one.
[G1 Android Development] ivarson_swe:
You're right. I'll fix that, thanks for the (Very) quick answer
[G1 Android Development] dully79:
Set up JDK,JRE,SDK and everything else required, on my other desktop and on my laptop running ubuntu 10.4 and i'm still getting the exact same errors.:confused:

Any ideas?
[G1 Android Development] enragedpaza:
Can't figure out what is going wrong. Any help, would be appreciated

C:\Androidsdk\tools>java -jar apktool.jar b kb.apk

Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathN

otExist: apktool.yml

at brut.androlib.Androlib.readMetaFile(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.directory.PathNotExist: apktool.yml

at brut.directory.AbstractDirectory.getFileInput(Unknown Source)

........5 more
[G1 Android Development] zach.xtr:
Just noticed you had the ".apk" - for building you leave this off as you are referencing a folder that contains all the decomepiled apk files. Once the command is complete you will have a dist folder with the built apk that must be signed before install.
[G1 Android Development] Daneshm90:
enragedpaza

Can u try this with apk manager (its in my signature) ? I think ur trying to decompile something with shared resources, what exactly are u trying to edit ?
[G1 Android Development] enragedpaza:
I'm trying to mod a couple things. The one I posted is the Droid x keyboard that someone fixed to work with the Evo. The other I am trying to mod is HelixLauncher2. I feel like I might be missing something.
[G1 Android Development] Daneshm90:
K for droidx keyboard, i ported it from scratch using apk manager so u shud have no issues there. As for helix launcher, u shudnt have any issues there either cuz its not a propietary apk, its based of launcher source.
[G1 Android Development] dully79:
I take it no-one knows or they just dont want to help??!!!
[G1 Android Development] enragedpaza:
Ok I will look into it. Thank you for the help, and appreciate your guys hard work. :D
[G1 Android Development] Daneshm90:
Im sorry i dont recall wht ur trying to edit :confused:

If u trying to edit something that has a dependency, for eg a proprietary app such as Rosie.apk, then u need to use the "if" command.

U can also try apk manager if ur on windows, since v4.8 has the ability to ask for dependee apks and checks whether the one u gave is the correct one or not.
[G1 Android Development] dully79:
I have also just tried apkmanager 4.8 and it flashes the same errors before reverting to the default option screen. And if i try it with the ROM dependencies it tells me it's not a dependee
[G1 Android Development] enragedpaza:
Your program is nice Daneshm90, but what about the ability to edit xmls? They are still compiled.

EDIT: sorry must fall under number 9 lol my mistake.
[G1 Android Development] Daneshm90:
K gimme a min, ill try and see wht u were doing wrong once i tackle that apk.
[G1 Android Development] Daneshm90:
Not if u select "Decompile (Option 9)" That uses apktool.
[G1 Android Development] Daneshm90:
Ok ur definitely doing something wrong. I had no problems. Downloaded ur apk, place it in modding folder. Ran and selected option 9, then option 14 and it works like a charm on my phone. Can u post the log.txt from apk manager ? im talkin from start to finish.
[G1 Android Development] enragedpaza:
Yeah I edited my post to show that I made the mistake of speaking to soon.

Like a kid on christmas, I over looked the card with 100 in it. The shiny truck just looked to good. lol Thank you
[G1 Android Development] dully79:
On a side note, your 4.8 still says 4.7 at the top of the default option screen
[G1 Android Development] Daneshm90:
Ok, is ur sdk up-2-date ? Im not sure wht takes preference between having something in the folder ur working from / whts in ur path. So try this, remove the tools folder from ur $path on ur machine, or just rename aapt to something else so it doesnt pick it up from their and is forced to pick it up from the "other" folder.

Also thanks for noticing the version #.
[G1 Android Development] dully79:
I updated my SDK on thursday, and i just tried moving the aapt out of the path but it didnt work.

I might uninstall the SDK, then try a fresh install tomorrow, suppose it's worth a shot.

Thanks for your help so far daneshm.;)

Edit: tried a fresh install of SDK and still get the same error
[G1 Android Development] MrNameless:
i got this error when compiling:

Please make your decision: 13

I: Checking whether sources has changed...

I: Smaling...

Exception in thread "main" brut.androlib.AndrolibException: Unknown file type: ../out/smali/.DS_Store

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)

Warning: cannot find file '../place-apk-here-for-modding/repackaged-unsigned.apk'
[G1 Android Development] canadiancow:
It's because you're using a Mac. But maybe it should only look for .smali files anyway...
[G1 Android Development] Brut.all:
http://code.google.com/p/android-apktool/issues/detail?id=77

Thanks for issue report.
[G1 Android Development] Rotordroid:
Decompile/Recompile Droid framework-res.apk

Can the Moto Droid framework-res.apk be decompiled, modified, then recompiled using apktool? The reason I ask is because the start and end file sizes are significantly different even with no modifications.

My Process:

Extract resources

apktool if framework-res.apk myROM

To decompile

apktool d framework-res.apk framework

To recompile (from within the framework folder, created above)

apktool b

original filesize: 2.2MB

recomplied: 4.3MB with NO changes

What am I missing???

Thanks
[G1 Android Development] Daneshm90:
Hmm u didnt get any "can't decode resources" while u were decompiling it ?

Also can u post the apk u're trying to decode ? i'll give it a shot and see if i get the same results.
[G1 Android Development] Rotordroid:
I attached my file. It is from a froyo 2.2 build

Here's my terminal:

mike@ubuntu:~$ cd apkmanager/

mike@ubuntu:~/apkmanager$ cd place-apk-here-for-modding/

mike@ubuntu:~/apkmanager/place-apk-here-for-modding$ apktool d framework-res.apk

I: Loading resource table...

I: Decoding resources...

I: Copying assets and libs...

mike@ubuntu:~/apkmanager/place-apk-here-for-modding$ cd framework-res/

mike@ubuntu:~/apkmanager/place-apk-here-for-modding/framework-res$ apktool b

W: Could not find sources

I: Checking whether resources has changed...

I: Building resources...

I: Building apk file...

mike@ubuntu:~/apkmanager/place-apk-here-for-modding/framework-res$
[G1 Android Development] Daneshm90:
Yeah i get the same thing. Weird thing is, if i use a folder compare software, the recompiled vs original apks when extracted, their folders have no mismatches in terms of the content inside them. So perhaps motorola is applying sometype of compression which we're breaking by extracting/rezipping. But yea, interested in how Brut answers this one :D

Edit: Ah so i ran the "Optimize images" in apk manager and walla, my recompiled apk stands at 2.61mb which is 0.12mb smaller than original :D
[G1 Android Development] raidzero:
Same thing on Windows with aapt from 2.2 SDK, same framework file in fact. Using apktool v 1.3.1. The resources.arsc gets massively changed when hex-compared to the original
[G1 Android Development] Rotordroid:
So decompile, optimized, recompile ??
[G1 Android Development] Daneshm90:
Yea thts wht i did.

Question is, apktool im assuming doesnt *decompress* png's i think, cuz im pretty sure if i apply the same compression to the original apk, it'll drop in size as well. Thats why im interested to see wht Brut, says :D
[G1 Android Development] Rotordroid:
I will try it. So far with just decopile then recompile with no changes, then adb push to /system/framework, the phone bootloops....I'll keep ya posted

EDIT: Even with reduced size it still bootloops when pushed back unchanged
[G1 Android Development] Daneshm90:
Oh k, then compressing wont solve bootloops.

Hmm... i was helping this themer earlier, when he tried to decode framework-res.apk he got a couple could not decode .9png (like 4 of them). All he was doing was editing a few xmls, so what i told him was

Decompile, ignore the errors.

Make ur changes

Compile, ignore the errors

Now take from the compiled xml only the xmls u made changes to and place those inside the original apk. Thats it and his works fine.

Don't know to what extent u wanna change the apk but that might help a little.
[G1 Android Development] raidzero:
for me, I need to change resources.arsc. I have to make several edits in styles.xml.
[G1 Android Development] Daneshm90:
Ah, i see. What does the log look like when u bootloop with ur recompiled w/o changes framework-res.apk ?
[G1 Android Development] raidzero:
How do I get the log? I am a noob
[G1 Android Development] Daneshm90:
U have adb i assume ? Just do adb logcat.
[G1 Android Development] raidzero:
so let it bootloop and then go into recovery and get the log?
[G1 Android Development] Daneshm90:
Nope, the moment u turn on ur phone.

Go in a console on ur pc and type "adb logcat"

U shud see a bunch of stuff as ur phone starts to bootup, then just paste that on a site like pastebin.com
[G1 Android Development] raidzero:
http://pastebin.com/1V9SYYEv

have fun! it looped several times while it was capturing