yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] tommytomatoe:
Second error happens cause the first one happened. It did not decompile correctly, thus, it will not build correctly.

You need to decompile the apk with framework-res.apk installed.
[G1 Android Development] Pons:
I figured as much about the two errors being linked. I'm currently trying http://xdaforums.com/showthread.php?p=6599859#post6599859 but there isn't a com.htc.resources.apk in CM7, so I'm going to see if I can pull it out of the stock ROM.

Edit:

So I tried this, did steps 1-5, on step 6 where it says replace, there was not a com.htc.resources.apk file in brut/androlib/ so I just placed it in there. Now when I try to decompile the same app, it gives:

Please make your decision: 9

Apktool v1.3.1 - a tool for reengineering Android apk files
Copyright 2010 Ryszard Wiśniewski <brut.alll@gmail.com>
Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)

Usage: apktool [-v|--verbose] COMMAND [...]

COMMANDs are:

d[ecode] [OPTS] <file.apk> [<dir>]
Decode <file.apk> to <dir>.

OPTS:

-s, --no-src
Do not decode sources.
-r, --no-res
Do not decode resources.
-d, --debug
Decode in debug mode. Check project page for more info.
-f, --force
Force delete destination directory.
-t <tag>, --frame-tag <tag>
Try to use framework files tagged by <tag>.

b[uild] [OPTS] [<app_path>] [<out_file>]
Build an apk from already decoded application located in <app_path>.

It will automatically detect, whether files was changed and perform
needed steps only.

If you omit <app_path> then current directory will be used.
If you omit <out_file> then <app_path>/dist/<name_of_original.apk>
will be used.

OPTS:

-f, --force-all
Skip changes detection and build all files.
-d, --debug
Build in debug mode. Check project page for more info.

if|install-framework <framework.apk> [<tag>]
Install framework file to your system.

For additional info, see: http://code.google.com/p/android-apktool/

and exits to the main menu.
[G1 Android Development] ZeuBug:
The same for me... :(

I try to recompile some apks from SGS2, after modding some xml files, on some proprietary rom apks it's working (twframework-res.apk dependency) but others as TouchWizCalendar.apk, not working because depend both twframework-res.apk and framework-res.apk. Lot of errors when recompiling...

So, thanks for your great work Brut.all!
[G1 Android Development] Mjuksel:
Can someone help me out on this?

Log is attached
[G1 Android Development] Pons:
Still not working after I tried your suggestion, but it could quite possibly be *gasp* my fault. Not sure how, though. Here is what I did based on http://code.google.com/p/android-apktool/wiki/FrameworkFiles :

So I tried this method (of course substituting framework-res.apk at your suggestion), and I got this:

user@computer ~/apkmanager $ apktool if framework-res.apk
I: Framework installed to: /home/user/apktool/framework/1.apk

The thing that gets me is it installs as a 1.apk, instead of a 2.apk, (yes, there was a 1.apk there already, I checked, so it overwrote it) Oh well, on to decompiling!

Please make your decision: 9

I: Baksmaling...
I: Loading resource table...
W: Skipping "android" package group
I: Decoding resources...
I: Loading resource table from file: /home/user/apktool/framework/1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=id, value=0x01020227
Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec: 0x01020227
at brut.androlib.res.data.ResPackage.getResSpec(Unknown Source)
at brut.androlib.res.data.ResTable.getResSpec(Unknown Source)
at brut.androlib.res.data.ResTable.getResSpec(Unknown Source)
at brut.androlib.res.data.value.ResReferenceValue.getReferent(Unknown Source)
at brut.androlib.res.data.value.ResReferenceValue.toResXmlFormat(Unknown Source)
at brut.androlib.res.data.value.ResAttr.convertToResXmlFormat(Unknown Source)
at brut.androlib.res.decoder.ResAttrDecoder.decode(Unknown Source)
at brut.androlib.res.decoder.AXmlResourceParser.getAttributeValue(Unknown Source)
at org.xmlpull.v1.wrapper.classic.XmlPullParserDelegate.getAttributeValue(Unknown Source)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.writeStartTag(Unknown Source)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.event(Unknown Source)
at brut.androlib.res.decoder.XmlPullStreamDecoder.decode(Unknown Source)
at brut.androlib.res.decoder.ResStreamDecoderContainer.decode(Unknown Source)
at brut.androlib.res.decoder.ResFileDecoder.decode(Unknown Source)
at brut.androlib.res.decoder.ResFileDecoder.decode(Unknown Source)
at brut.androlib.res.AndrolibResources.decode(Unknown Source)
at brut.androlib.Androlib.decodeResourcesFull(Unknown Source)
at brut.androlib.ApkDecoder.decode(Unknown Source)
at brut.apktool.Main.cmdDecode(Unknown Source)
at brut.apktool.Main.main(Unknown Source)

Edit: Alright, I got it to work. For some reason, I had to go into Script.sh and add the path to apktool.jar. Like so, from

java -jar apktool.jar d ../place-apk-here-for-modding/*.apk "../out"

to

java -jar /usr/local/bin/apktool.jar d ../place-apk-here-for-modding/*.apk "../out"

Edit edit: It's still not working right, but I don't think it's me this time. I pulled and decompiled an apk, made some changes to a smali file, and recompiled the apk. Since I like to double check my work, I took my new apk and decompiled it again. I then checked the original I saved and to the one I just decompiled, and there were changes, close to my changes, that I had not made. A couple of lines deleted, and even a line moved. Any thoughts?
[G1 Android Development] amiperetz@gmail.com:
how can i fix that?:
[G1 Android Development] tommytomatoe:
Your apk did not decompile correctly
[G1 Android Development] amiperetz@gmail.com:
thanks about the response.

the decompile run ok without errors and ifinishd to edit the xml file but when i try to compile igot this error in the log.

the file is launcher2.apk (MIUI) if its help.
[G1 Android Development] ThunderOKC:
Now this download link work. The other one was broken. Hope this actually does the trick. *prays*
[G1 Android Development] Hare4:
I am getting adb not found... can anybody help me with this?
[G1 Android Development] Madala_ZA:
So, it is probably one of two things:

1. Have you installed the Android SDK? And if you have...

2. Is it in your path ? (so that you can use adb from anywhere)

I'm almost certain one of the above is not in place.

Sent from an alternate reality using my Desire HD on XDA Premium app
[G1 Android Development] Hare4:
I did install the sdk. I made a path to both Java and adb, but I am not sure if they are both right. Could you help me? My adb path is C:\sdk\platform-tools\adb.exe and the java is named PATH and valued at:

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\Sy stem32\Wbem;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Common Files\Roxio Shared\10.0\DLLShared\;C:\Program Files\QuickTime\QTSystem\;%SYSTEMROOT%\System32\Wi ndowsPowerShell\v1.0\;C:\Program Files (x86)\Java\jre6\bin;
[G1 Android Development] Madala_ZA:
Ok, looks like you copied your path here from environmental variables? If this is so, then I notice 2 potential errors:

You don't have Android SDK in your path, as an example here is the excerpt of the SDK from my path: C:\Program Files\Android\android-sdk\platform-tools\;C:\Program Files\Android\android-sdk\

Your java path is not correctly notated ie, it has (x86) after "program files". Here's my java path for you to reference: C:\Program Files\Java\jdk1.6.0_26\bin;C:\Program Files\Java\

Of course, your paths may be different than mine, but I'd like you to take note of the actual notation, and to confirm that the SDK is actually in your path because it looks like it's not..
[G1 Android Development] Hare4:
I fixed the path, but now, how do I install the framework?
[G1 Android Development] CleveRuse:
Can someone explain Wut exactly the "compile" n " decompile" option is good for. Like, wit exactly does it do? When ever I modd APK's, whether just a small user app, or something like /framework.res, I just extract, modd, sometimes optimize, zip, sign, push ...or install. Am I missing something? Everything goes where it should when I'm done.
[G1 Android Development] CleveRuse:
If u still get an error after "adb push...", try:

adb remount

Then:

adb push framework....
[G1 Android Development] Pons:
You're modding the images. To do code editing, such as in the classes.dex, you need to decompile, make your changes, then compile to save them. Just decompile an apk, and look in the new out folder. You'll see.
[G1 Android Development] CleveRuse:
oh, ok, cool... thnx man.
[G1 Android Development] CleveRuse:
Can someone please help me with this? I'm on linux. I've got everything running I believe. I put all applicable files from the "other" folder with the script.sh file so I can "chmod" all at once....just more convenient, doesn't seem to make a difference. But after I run the script, I'm asked if I want to clean out current projects. If I hit "yes", it does wut u would expect....removes my projects. If I hit "no", my apk files remain in "place here for modding" but I don't see a "22" option, or any other option for that matter, to actually choose a project for modding. I'm sure it's something simple, but I just don't see it. Wut am I doing wrong?

Edit: also, just noticed I don't have an "out" folder....or an "in" folder. Not sure about an "in", but I'm sure I had an "out" folder before. Any ideas? Why does it keep asking me if I want to clean out projects? Why not prompt me to CHOOSE a project? So CONFUSED! God I miss Windows sometimes.
[G1 Android Development] CleveRuse:
Apparently I can only place imbibe at a time?......can we please please please get an update for Linux.

Or is there atleast a way to obviate the constant need to "chmod" b4 running script? A way to give default permissions to the applicable files?
[G1 Android Development] dreamsforgotten:
I use ubuntu primarily but I boot into win xp just for apk manager. Installing frameworks doesn't always work, there are less options, put simply the linux version isn't close to the windows version and only gets worse the more your trying to do.
[G1 Android Development] CleveRuse:
yeah, ....sigh, thats exactly what I would have long since done.... If I had the option, lol. I need to get to a PC with a CD drive so I can configure Windows to boot from flash. I got so fed up one day that I removed windows conpletely, not realizing how difficult it'd be to clean-install without a CD drive. Oh well, one at a time will have to do for now. Now if I could just get ImageMagick to run without errors saying; "mogrify: no decode delegate for this image format.....blah, blah, blah...." uhhh What?
[G1 Android Development] CleveRuse:
Oh, that last part wasn't a question for here, just frustrated....besides I figured it out...well maybe not, lol
[G1 Android Development] flex96:
hey guys very nice tool but i have problem

i can't decomplie the settings.apk from my x10 mini pro

some ideas????
[G1 Android Development] dreamsforgotten:
It might rely on the framework res.apk as a dependency use the recompile option with a dependency then place the framework res at your c drive and type the path in
[G1 Android Development] flex96:
yes i know and i tried this before i post

but it don't work

the framework is not the right rescoure
[G1 Android Development] fezzy102:
please help

this is the log it is giving me i have no clue as what to do.
[G1 Android Development] Pons:
That is you not having the framework for your ROM installed. Install it, and you should be good.
[G1 Android Development] ready5:
Errors

Im going nuts.. I can not for the life of me get systemui.apk to decompile with out errors on apk manager....

I pulled framework-res.apk fine and have that installed on the computer... Its annoying because all i need to do is get to a smali script to disable location and package this mod up.. BUT I CANT!

error:

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

|Fri 07/01/2011 -- 19:47:43.59|

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

java version "1.6.0_25"

Java(TM) SE Runtime Environment (build 1.6.0_25-b06)

Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, mixed mode)

I: Framework installed to: C:\Users\JREED271\apktool\framework\2.apk

I: Baksmaling...

I: Loading resource table...

I: Decoding resources...

I: Loading resource table from file: C:\Users\JREED271\apktool\framework\1.apk

W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x010300a3

I: Loading resource table from file: C:\Users\JREED271\apktool\framework\2.apk

Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec: 0x010300a3

at brut.androlib.res.data.ResPackage.getResSpec(Unkno wn Source)

at brut.androlib.res.data.ResTable.getResSpec(Unknown Source)

at brut.androlib.res.data.ResTable.getResSpec(Unknown Source)

at brut.androlib.res.data.value.ResReferenceValue.get Referent(Unknown Source)

at brut.androlib.res.data.value.ResReferenceValue.toR esXmlFormat(Unknown Source)

at brut.androlib.res.data.value.ResAttr.convertToResX mlFormat(Unknown Source)

at brut.androlib.res.decoder.ResAttrDecoder.decode(Un known Source)

at brut.androlib.res.decoder.AXmlResourceParser.getAt tributeValue(Unknown Source)

at org.xmlpull.v1.wrapper.classic.XmlPullParserDelega te.getAttributeValue(Unknown Source)

at org.xmlpull.v1.wrapper.classic.StaticXmlSerializer Wrapper.writeStartTag(Unknown Source)

at org.xmlpull.v1.wrapper.classic.StaticXmlSerializer Wrapper.event(Unknown Source)

at brut.androlib.res.decoder.XmlPullStreamDecoder.dec ode(Unknown Source)

at brut.androlib.res.decoder.ResStreamDecoderContaine r.decode(Unknown Source)

at brut.androlib.res.decoder.ResFileDecoder.decode(Un known Source)

at brut.androlib.res.AndrolibResources.decode(Unknown Source)

at brut.androlib.Androlib.decodeResourcesFull(Unknown Source)

at brut.androlib.ApkDecoder.decode(Unknown Source)

at brut.apktool.Main.cmdDecode(Unknown Source)

at brut.apktool.Main.main(Unknown Source)

Anyone?
[G1 Android Development] Roladriz:
Maybe try and go here C:\Users\JREED271\apktool\framework\1.apk

Copy and save that 1.apk and put it somewhere safe if you have been working from it for recent projects.

Next ....open the 1.apk in C:\Users\JREED271\apktool\framework\1.apk and replace the resources.arsc with the one that is in the apk you are trying to decompile. I've had to do this numerous times with Settings.apk as well as Contacts.apk.
[G1 Android Development] 7JS14:
I am having the same problem "adb not found" and still don't know hot to fix it (still at noob stage). :confused:

I have the Android SDK at C:\android-sdk. I followed the previous post about the environment variables... so right now I have a 'Variable name' for adb at C:\android-sdk\platform-tools\adb.exe. How do I figure out what my 'Variable value' is and what does it mean? Is there anything else I'm missing?

Any help would be great! :)
[G1 Android Development] klquicksall:
An easy but dirty way to use adb is to put yout script.bat in the platform tools folder where you see adb and then click on the script and the adb not in path error shouldn't show up.
[G1 Android Development] 7JS14:
Wow, thanks! :D That was so simple I would have never thought of it, ahahaha~
[G1 Android Development] Joe31:
Hello everyone!

I have a problem...

I good like to add my language (hungarian) to Motorla Defy Rom! (froyo 2.2)

1. I installed framework-res.apk, blur-res.apk, moto-res.apk

2. decomplied example: blurdial.apk, it is working

3. I did not modify it, recomplied, it is working

4. adding values-hu directory then recomplied it is not working (error)

"apk_manager_4.9\other\..\projects\BlurDialer.apk\res\values-hu\arrays.xml:4: error: Error parsing XML: not well-formed (invalid token)".........

Where is the problem?

Thanks for help!!!
[G1 Android Development] yanuricasper:
Sorry for noob question & sorry for my English,

I have compile settings.apk (samsung I9000), every thing is done (no error), but when I pushed on system/app, the application doesn't work. (the original settings.apk is 4,7KB, but after compiled just 2.3KB).

Help me please!
[G1 Android Development] tommytomatoe:
Try this method out.

Take ORIGINAL apk.

Open it in 7z or similar program.

Take out MetaInf (folder) and AndroidManifest.xml (file)

Now, open the modded apk made by apkmanager in 7z or similar program

Place those files into the new apk.

Push back to phone.

If your edits and mods were good, then your apk will work.

That is the general rule for working with system apps because often they need to retain their original signatures because they share a common one with other apps.

For data apks, the easiest thing is to resign it using testsign.jar

Settings.apk is a system app.
[G1 Android Development] yanuricasper:
Many thanks for your fast answer, I will try it
[G1 Android Development] yanuricasper:
Yes, it's worked Thanks, but the apps doesn't change, maybe i think before i have change the AndroidManifest.xml.

my question is how the procedure if i have edit AndroidManifest.xml? thanks before
[G1 Android Development] tommytomatoe:
If you've modified the manifest, then only replace the meta inf folder.

Out of curiousity, what did you change in the manifest?
[G1 Android Development] yanuricasper:
I have tried only MetaInf Folder, but it doesn't work.

In manifest i add style (on application raw & some activity) i mean i want to make settings.apk look transparent :D but unfortunately never luck
[G1 Android Development] tommytomatoe:
Oh....I am almost 100% sure that's not in the manifest. :-) You will want to play around in the other xml code found in res folder after you decompile the apk.
[G1 Android Development] dreamsforgotten:
Definitely not in the manifest, some XML some smali
[G1 Android Development] yanuricasper:
Thanks man, i try to find it
[G1 Android Development] dansta34:
can anyone please on this thread help me out if they no of what xml and what line i have to edit to get the app drawer in this picture to expand all the way up to the status bar

http://img405.imageshack.us/img405/8237/snap20110704114954.png
[G1 Android Development] microweb10:
Thanks!

Im sorry I can't click on thanks yet, I didn't post 10 posts yet, I'm a bit shy :P
[G1 Android Development] Jwtiyar:
i installed android sdk ,

but give me this error

cutiyar@cutiyar-Probook:~/Desktop/android-sdk-linux_x86/platform-tools/apk_manager_linux_4.7$ ./Script.sh
The program adb is missing or is not in your PATH,
please install it or fix your PATH variable
The program sox is missing or is not in your PATH,
please install it or fix your PATH variable
cutiyar@cutiyar-Probook:~/Desktop/android-sdk-linux_x86/platform-tools/apk_manager_linux_4.7$

i dont know what to do?

and the folders are not created yet.
[G1 Android Development] c010:
hi, i am trying to decompile framework-res.apk but i am facing this errors. wonder anybody here can lend me a hand.

java version "1.5.0_12"

Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_12-b04)

Java HotSpot(TM) Client VM (build 1.5.0_12-b04, mixed mode, sharing)

Could Not Find D:\APK\place-apk-here-for-modding\../place-apk-here-for-modding/signedframework-res.apk

Could Not Find D:\APK\place-apk-here-for-modding\../place-apk-here-for-modding/unsignedframework-res.apk

java.lang.UnsupportedClassVersionError: Bad version number in .class file

at java.lang.ClassLoader.defineClass1(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] yanuricasper:
maybe you must update the sdk manager, or have you input the path of adb on system properties
[G1 Android Development] Madala_ZA:
I posted this one page back. You don't have Android SDK in your path, as an example here is the excerpt of the SDK from my path: C:\Program Files\Android\android-sdk\platform-tools\;C:\Program Files\Android\android-sdk\

So, yours may be different. But you must point to the directory where adb.exe is. This should sort you out. If you don't know how to access environment variables then here's how you get there on Windows 7: Start>Right-click "Computer">properties>Advanced system settings (on left-hand-side)>Environment Variables>scroll down to path>edit
[G1 Android Development] MongooseHelix:
I think you are going to want to use option 10 to decompile SystemUI.apk with dependencies. You'll be asked for the apk containing the ROM-specific resources which will be /system/framework/framework-res.apk for you. So have that file on you computer before running option 10...you could use option 0 to adb pull it from your phone if you want. This way the resources in SystemUI.apk should be decompiled properly.
[G1 Android Development] Dunc001:
OK, so showing my utter noobishness again, to use the adb pull function I am guessing I need to be in fastboot and connected by cable to my PC right? Or can I just use Root Explorer to copy my framework-res.apk to SD and then FTP it to my PC?

EDIT - OK, so in the meantime I have used Root Explorer to get framework-res.apk onto my PC, however when I drag it into the script window as instructed it says 'Sorry thats not the dependee apk, try again'. The only other file in the zip I am using to work from is services.jar but that gives me the same message. Any suggestions?
[G1 Android Development] Jwtiyar:
but iam downloaded the SDK and iam work with it for a year.

thanks ,but iam using Linux .
[G1 Android Development] LordXeth:
Hello,

can anyone help me or give a tip xml edit what I need in order Lense Style Lockscreen the date and time of the font color can change in setting?

I am looking for scho all the time but found nothing ....

see picture

mfg
[G1 Android Development] Pons:
Not sure where your sdk is, but mine is in my home directory. If yours is not, find out where it is and change :~/androidsdk/tools and :~/androidsdk/platform-tools to match up with yours:

Open up a terminal and type

cd ~
gedit .bashrc

paste this in the top

#AndroidDev PATH
export PATH=${PATH}:~/androidsdk/tools
export PATH=${PATH}:~/androidsdk/platform-tools

Save, exit, and restart.

And install sox before you restart. Not sure which version of linux you have, so I can't help you there. This guide is pretty good with getting a dev environment setup, if yours is not already.

Guide to compiling (covers cm7)
[G1 Android Development] TheNewGuy:
I have searched thru this thread a bit and found some info on my question but it is not "clicking" in my mind yet....I am trying to compile a framework-res.apk.

I have successfully decompiled, edited the xml, added dependent .png and recompiled.... I have successfully added all the themed/modded .png to my projects forlder and recompiled. So I now have a framework-res.apk that has almost my complete theme.....EXCEPT....if I add a single modded(not stock) .9.png to the projects folder and try to recompile...it gives me an error.....

Also, I can "inject" the modded .9.png into the framework-res.apk using winrar after I compile, and the framework-res.apk will appear to function correctly when used in the ROM...

So....what is the deal with .9.png? what are they? what makes them so different from the regular .png? and how do I get apk_manager to recompile properly when using a non-stock .9.png? What is the trick?

Thanks for your time,

I really appreciate any help, any one can provide.