yashsingh1/xdaforums huggingface dataset:
[HTC One S] omar_g:
Thanks for the reply invasion2.

I turned the phone off from bootloader, but now I cant get it to turn on at all, even after hours on charge. Can anyone help or suggest what might work?
[HTC One S] k1llacanon:
Hold down power ull see the soft capactive buttonns flash when they stop let go of power and then power on like normal to get into bootloader
[Android Q&A, Help & Troubleshooting] evol4g:
There is now a new person taking over the apktool project, his name is ibotpeaches.. His apktool works with every android version up to date.. This thread will now be a basic guide on how to use apktool :)

iBotPeaches' APKTOOL THREAD

What I do is create a folder to work in and call it for example:

Code:

c:\apktools

1) Take the apktool.jar from ibot's OP and the modded aapt he provided and place them in the folder.

2) You will need to pull the framework-res.apk from the rom you are working on. Copy it to c:\apktools.

4) Open a command window and navigate to your apktool folder

cd c:\apktools

5) We now need to install the framework and type the following:

java -jar apktool.jar if framework-res.apk

If you are decompiling any framework other that AOSP ie: sense, touchwiz, ect you will have to install the framework and systemui.apk for them as well, ie: for miui it's framework-miui-res.apk

You only need to do this once, unless you are working on a different Rom, then you will need to copy the framework-res.apk from that Rom and run the above command again.

6) We can now decompile framework-res with apktool

java -jar apktool.jar d framework-res.apk (here you can add the folder you'd like to have your extracted apk save to)

it will create a folder by the name of the .apk or .jar by default but say you wanted it just to go to a folder called "frameres" (just to be a lil more convienent while typing your command would look like this

java -jar apktool.jar d framework-res.apk frameres

the d option stands for decompile and you will now see a folder under c:\apktools\frameres (in my case, yours will be whatever your output folder's name is). Here is all the output and can make any changes you want, and then can recompile. I would test to make sure you can recompile before making a lot of changes though.

6) We will now compile framework-res.apk

java -jar apktool.jar b frameres NEWframework-res.apk

I always put something different in the new apk name for instance i always put NEWapk.apk some people use numbers like apk1.apk ect.. whatever you feel is comfortable for you.. But once you enter the command it will take a few minutes and it should complete without any errors.

7) Once it is done compiling you will need to go to c:\apktools\ and you will now see your new framework-res.apk in my case titled "NEWframework-res.apk"

IMPORTANT LAST STEP

Once you recompile the apk you're going to wanna use 7-zip to open both the original UNMODDED apk and the newly compiled apk

you wanna copy the META-INF folder and the AndroidManifest.xml from the ORIGINAL into the NEWLY compiled apk otherwise your apk won't work

Just remember to copy any apk you want to decompile right into the root of c:\apktools, run the decompile command and it will create a folder of the output that has the same of the apk file.
[Android Q&A, Help & Troubleshooting] alteredlikeness:
Thanks for sharing and posting this! (I know there are similar threads scattered all over, but it's nice to see it fresh again). I am still on GB, but eagerly awaiting the update for ICS... Moto & AT&T - not quite a dynamic duo unfortunately...

And just to clarify a few things - what about the oem framework files, like moto/blur, touchwiz, etc..? I believe some apks require those to also be installed with apktool... and I've also read somewhere to install SystemUI.apk as well.. not sure if they are needed, but it doesn't hurt.

And at the end you mention for any xml edits to just copy the resources.arsc over to the old apk - but I think that is only for xml edits in the /values folders, that's what gets tucked in to the resources.arsc - one would still need to copy the edited and compiled xml from any other folder (like layout, anim, etc..), along with any other res changes...

Again, this is just my understanding, and I have my own ways that work well for me so far... and thanks for taking the time to put this thread together. Maybe it will serve as a sort of question and answer thread on the subject, as I have also seen many having troubles/questions..

Sent from my phone's mind
[Android Q&A, Help & Troubleshooting] dreamer94:
Okay fully got it but download link is broken can anyone share it with us if he has?

Regards
[Android Q&A, Help & Troubleshooting] blazingwolf:
It's working fine for me. :)
[Android Q&A, Help & Troubleshooting] evol4g:
Yes your right for htc , Motorola, touchwiz and some others you do have to install the appropriate frameworks and in those cases systemui as well but most of them do not have 4.0.4 if I'm not mistaken.. I know HTC is on 4.0.3 but that's all I can truly account for.. but about copying resources.arsc is only if you made XML edits in the values folders, it does state that if other changes were made you'd have to copy those as well.. I will clarify that better thanks for pointing that out
[Android Q&A, Help & Troubleshooting] alteredlikeness:
Yea, Moto & Verizon just started last weekend - my buddy with a RAZR got the 4.0.4 update. I had a chance to do a system dump right away, then I decompiled the homescreen.apk just to take a look (I installed all 4 .apks in to apktool as I listed above for his system).

But, after I decompiled homescreen.apk I noticed that there were broken 9patch files already!! Before I even touched it. And that obviously messes up the compiling process - so I had to correct 6 or so broken .9.pngs - broken by Moto or Verizon, I can only assume - and after I repaired them everything compiled normally..

Just a heads-up that the "professional" devs mess up things also - and broken .9.pngs are often the cause for compiling errors..
[Android Q&A, Help & Troubleshooting] Ticklefish:
Well, this is very handy. :-)

I'd thought I'd chip in and say that resources.arsc often needs to be compressed at the right rate as well. If it's not at 'store', in other words if the file in the apk is smaller than normal, the app might not work correctly.
[Android Q&A, Help & Troubleshooting] a-id:
Thanks for the useful information! Here is an archive of batch files that simplify the process. Enough to drag needed file or folder with mouse at appropriate batch file:

apktool-if.cmd - installation of framework-res, SystemUI, etc.

apktool-d-1.4.2.cmd - decompiling with apktool.jar.1.4.2.

apktool-d-1.4.3.cmd - decompiling with apktool.jar.1.4.3.

apktool-b.cmd - building.

Correct version of apktool is selected automatically.

Link: ApkTools-ICS-Simple.rar
[Android Q&A, Help & Troubleshooting] myn:
Thanks for sharing this info. I know a lot of people have been frustrated lately getting apks to properly decode and rebuild in ICS.

I took your great instructions and refined them a bit to reduce the workflow, having to rename the apktool.jar between decoding and building. You can download what I am using here.

First register framework-res by placing the framework-res.apk from your rom into the extracted apktool zip directory, then execute 0-FRAMEWORK-IF.BAT:

C:\Test\Test1.4.2-1.4.3>0-FRAMEWORK-IF.bat
I: Framework installed to: C:\Users\Derek\apktool\framework\1.apk

Next decode the apk, 1-DECODE.BAT SystemUI.apk . A new output sub-directory will automatically be created based on the apk name (SystemUI.apk_out):

C:\Test\Test1.4.2-1.4.3>apktool-1.4.2.bat d SystemUI.apk ./SystemUI.apk_out
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Loading resource table from file: C:\Users\Derek\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...

Make your edits and build. 2-BUILD.BAT SystemUI.apk:

C:\Test\Test1.4.2-1.4.3>2-BUILD.bat SystemUI.apk

C:\Test\Test1.4.2-1.4.3>apktool-1.4.3.bat b -f -d SystemUI.apk_out
I: Smaling...
I: Building resources...
I: Building apk file...

Download zip package
[Android Q&A, Help & Troubleshooting] myn:
Awesome! Looks like we had the same idea in mind!
[Android Q&A, Help & Troubleshooting] a-id:
It's not my merit, I just edited files a bit... :)
[Android Q&A, Help & Troubleshooting] evol4g:
Awesome thank you guys both, seriously the lack of support for the editing of 4.0.4 apks was really limiting the possibilities of ics, nice to see support from you guys
[Android Q&A, Help & Troubleshooting] Ticklefish:
Apktool and ICS haven't been friends for ages..but there's a new version out now. Head here:

http://xdaforums.com/showthread.php?p=28366939#post28366939

:-)

This is designed to work with most ICS files. Some Sense files don't decompile properly but that's something HTC have done. That's nothing we can do about it.
[Android Q&A, Help & Troubleshooting] evol4g:
Well that link doesn't work
[Android Q&A, Help & Troubleshooting] Ticklefish:
Yeah, the app didn't copy/paste correctly. I've updated the post.
[Android Q&A, Help & Troubleshooting] cristeaflorin2000:
Decompile Contacts.apk

I am trying o decompile any of the contacts.apk, logsprovider.apk or mms.apk to figure out a way to remove the SMS from call logs...anyone with an ideea how to accomplish this mission?

I have SGS2 with the new ICS 4.0.4 , XXLQ5
[Android Q&A, Help & Troubleshooting] da-pharoah:
nice! thanks for redoing guide a guide like this!

---------- Post added at 12:41 AM ---------- Previous post was at 12:38 AM ----------

your going to need to provide more info about your setup... custom rom or stock rom? and have you google'd this question yet?

edit:

ive found this app, will it work for you?

Call Log & SMS Clear
[Android Q&A, Help & Troubleshooting] flowish:
hmmm .. this is work for ICS 4.0.3 sir ??
[Android Q&A, Help & Troubleshooting] Peteragent5:
Hmmmm using my easyapktool and decompiling & recompiling for ICS seems fine. I'm using the modded apktool from wanam...
[Android Q&A, Help & Troubleshooting] cristeaflorin2000:
Not working for odexed ROMS

That ROM is fully stock and, ofcourse, odexed.It is rooted...i have google it for more than a week and tried all methods but nothing worked.That application u mentioned is doing the job(maybe) but manually.What i want is to find a method to remove from start the sms from call log, without any other further action.

I moved from that ROM to this one :WanamLite ICS UHLPS V12.2 Android 4.0.3 Stable Blue ICS & Stock Themed ...deodexed and he replaced the default option "View by - All logs" with "View by - All calls".Still not what I was looking for but is better than the stock.
[Android Q&A, Help & Troubleshooting] ssojyeti2:
I really suck at apktool. I followed the instructions exactly (I think) and framework-res got errors when recompiling.

I got a bunch of public.xml errors. I also got errors when installing framework for com.htc.resources.apk. I wonder what I'm doing wrong that apktool always fails:confused:
[Android Q&A, Help & Troubleshooting] Ticklefish:
What errors are you getting?
[Android Q&A, Help & Troubleshooting] chubbzlou:
Thanks guys this is usefull.
[Android Q&A, Help & Troubleshooting] Epic.:
PLEASE HELP ME!!!!!

I own an HTC Incredible S running Android Revolution HD 3.00 for Incredible S. I followed the the tutorial word for word. It decompiled successfully although i got some flag errors which i read in a different thread to ignore. So i went ahead and made my changes (I just need to replace the battery icons in drawable-hdpi). So next to recompile, i closed the CMD, renamed apktool.jar to apktool.jar.1.4.2 then i renamed 1.4.3 to apktool.jar. Next i opened up CMD, directed to C:\Apktools and I pasted this command

C:\apktools>java -jar apktool.jar b framework-res

But then all i got was this

W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
C:\apktools\framework-res\res\values\anims.xml:3: error: Found tag anim where it
em is expected
C:\apktools\framework-res\res\values\public.xml:6587: error: Public symbol anim/
htc_ime_decelerate_interpolator 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\guru\AppData\Local\Temp\AP
KTOOL6745987474743567202.tmp, -x, -S, C:\apktools\framework-res\res, -M, C:\apkt
ools\framework-res\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:193)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)
at brut.androlib.Androlib.buildResources(Androlib.java:248)
at brut.androlib.Androlib.build(Androlib.java:171)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\U
sers\guru\AppData\Local\Temp\APKTOOL6745987474743567202.tmp, -x, -S, C:\apktools
\framework-res\res, -M, C:\apktools\framework-res\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:191)
... 6 more

Please help me!!!!!!!
[Android Q&A, Help & Troubleshooting] alteredlikeness:
You might have some broken .9.png (9patch) files... check the top of that error log.. or go and look for dummy .9.png files in your drawable folders - they will have a normal .png copy with the same name. It's a common error.. followed by a lot of public.xml errors messages. And, it's usually caused by people editing or moving 9patch files without decompiling (or with disregard for the 1 pixel borders, which must remain black (#000000))..

You do not need to decompile to change the battery icon images or any other normal .png or .jpeg... just unzip, or easier yet, drag and drop with 7-zip.
[Android Q&A, Help & Troubleshooting] ssojyeti2:
Actually no. First time I tried this, I edited a line in the bools.xml of framework-res, and got public.xml errors relating directly to the lines affected by my edit. Second time, I just decompiled the apk, made no edits whatsoever, tried recompiling and got more public.xml errors (but different ones). Not sure what I'm doing wrong, and apkmanager usually gets the job done for me, but I've been wanting to get apktool working but haven't been able to. Oh well. I think I'll try doing it on Linux...
[Android Q&A, Help & Troubleshooting] Ticklefish:
Are you on ICS or JB? If so, that could be the issue. Apktool isn't currently 100% compatible with any Android about 4.0.
[Android Q&A, Help & Troubleshooting] Alunduyn:
Hey guys, great guide, just some problems.

I decompiled LatinIME.apk from my ROM, changed strings.xml files in res/values ( just reordered smilies ), and then recompiled. Result apk was just 5mb, and original was about 12mb. I guess it is normal, and I have to move the modified files to the new apk (resources.arasc in my case). Sorry if you already said it, sorry if it is really obvious, but how can I make changes inside an apk? I tried decompiling it again without decompiling sources and resources, changing resources.arasc and then recompiling, but resulting is still half size. I can't extract everything from the apk because after that 7zip can't compress in apk. I read somewhere that apks are zip files renamed ( true? ), but if I recompress everything in a zip, which options should I choose for the resulting zip?

Many thanks.
[Android Q&A, Help & Troubleshooting] Ticklefish:
Apk's are just zips with a different name. Use 7zip to open an apk and you'll see what I mean.

I'm guessing that your resources.arsc is compressed in your new apk but not in the original. Try opening the two files and seeing what compression ratio resources.arsc is stored at. If it's not the same, then there's your issue.
[Android Q&A, Help & Troubleshooting] Alunduyn:
Ok I've extracted the original apk, I've changed resources.arsc, and then I recompressed in a zip without compression, I renamed in .apk and tried to install on my phone. I'm quite sure installing it isn't just enough, but I get a "Parse Error", it doesn't even show an Application name.

What could I have done wrong? Thanks a lot for your help
[Android Q&A, Help & Troubleshooting] Ticklefish:
Are you actually decompiling and recompiling the app?

Can you tell me the exact process you're doing? Then I can see what's going on and sort it out for you. :-)
[Android Q&A, Help & Troubleshooting] tonyp:
I'm doing pretty much the same thing.

One suggestion to OP (and anyone here ofc):

If you don't want to rename constantly you can just rename the jars differently.

I renamed v 1.4.2 to apktool2.jar and 1.4.3 to apktool3.jar.

Then the commands look like this for example:

java -jar apktool[B]2[/B].jar if framework-res.apk
java -jar apktool[B]2[/B].jar d framework-res.apk
java -jar apktool[B]3[/B].jar b framework-res
[Android Q&A, Help & Troubleshooting] Alunduyn:
Ok, sorry.

- I decompiled my apk ( LatinIME.apk , 12MB )

- I made my changes ( res/values/strings.xml )

- I recompiled my apk ( LatinIME2.apk , 5MB )

- I extracted from latinIME2.apk ( 5MB ) resources.arsc

- I extracted everything from LatinIME.apk ( 12MB )

- I replaced resources.arsc in the folder where I extracted LatinIME.apk ( 12MB ) with the resources.arsc from LatinIME2.apk ( 5MB )

- I compressed the folder in LatinIME3.zip ( no compression 13MB )

- I renamed LatinIME3.zip in LatinIME3.apk

- I moved to phone LatinIME3.apk and renamed to LatinIME.zip

- I tried to install it

I tried to be as clear as possible, many thanks for your help :)
[Android Q&A, Help & Troubleshooting] Ticklefish:
Ah, I see what's happened here. You've almost got the right method there..but not exactly. You're removing the signature from the app and that's essentially why it won't run.

Once you've recompiled, extract resources.arsc from the new app. Make a copy of the old app and use 7zip to insert resources.arsc into the copy at a 'Store' compression rate.

That will ensure it's still signed correctly and it should run correctly. Oh, and you will still need to make certain the permissions are correct.

If you try Tickle My Android, it will do most of this for you. ;-)
[Android Q&A, Help & Troubleshooting] Alunduyn:
Holy Crap! I did it! It was so easy and I didn't realized!

I just had to rename LatinIME.apk to LatinIME.zip and THEN copy inside resources.arasc!

Many Many Many thanks to you Tickefish, you're great! :D

Edit : Oh, probably I shoulded just hit the Thanks button... Sorry, I was so happy :)
[Android Q&A, Help & Troubleshooting] Ticklefish:
Anytime. :D
[Android Q&A, Help & Troubleshooting] F.West98:
I can't compile framework-res from Jelly Bean. It's showing errors:

W: Could not find sources

I: Checking whether resources has changed...

I: Building resources...

C:\apktools\framework-res\res\values\ctags.tmp:1: error: Error parsing XML: not well-formed (invalid token)

Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Floris\AppData\Local\Temp\APKTOOL8207198292374404674.tmp, -x, -S, C:\apktools\framework-res\res, -M, C:\apktools\framework-res\AndroidManifest.xml]

at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:193)

at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)

at brut.androlib.Androlib.buildResources(Androlib.java:248)

at brut.androlib.Androlib.build(Androlib.java:171)

at brut.androlib.Androlib.build(Androlib.java:154)

at brut.apktool.Main.cmdBuild(Main.java:182)

at brut.apktool.Main.main(Main.java:67)

Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Floris\AppData\Local\Temp\APKTOOL8207198292374404674.tmp, -x, -S, C:\apktools\framework-res\res, -M, C:\apktools\framework-res\AndroidManifest.xml]

at brut.util.OS.exec(OS.java:83)

at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav

a:191)

... 6 more

What's wrong?
[Android Q&A, Help & Troubleshooting] Ticklefish:
According to the error messages, there's a problem with ctags.tmp in the values directory. I'd take a look at that first.
[Android Q&A, Help & Troubleshooting] F.West98:
Ah, that's it. F*ck you Notepad++

---------- Post added at 11:04 PM ---------- Previous post was at 10:44 PM ----------

The changed XML has no effect.

Steps:

Decompile framework-res.apk

Change XML

Compile framework-res

Copy resources.arsc to old apk

Flash in zip

Nothing
[Android Q&A, Help & Troubleshooting] Ticklefish:
What effect did you want? What changes did you make?
[Android Q&A, Help & Troubleshooting] F.West98:
I changed SystemUI.apk to animate the battery icon
[Android Q&A, Help & Troubleshooting] Ticklefish:
Well, it could be a few different things but I think it's because you didn't copy the new res folder into your old apk file. You've got the new xml but no new images to go with it.
[Android Q&A, Help & Troubleshooting] F.West98:
I copied the images, but not the compiled xml's ;)

It works :)
[Android Q&A, Help & Troubleshooting] Ticklefish:
Cool. :cool:
[Android Q&A, Help & Troubleshooting] danieldmm:
Trying to decompile latest Samsung ROM Deodexed XWLPM 4.0.4 and i got error, any news about this? I me trying decompile SystemUI.apk...

Cheers
[Android Q&A, Help & Troubleshooting] evol4g:
You installed the framework-res.apk and twframework-res.apk?
[Android Q&A, Help & Troubleshooting] evol4g:
Okay man I'll explain this to you the best I can without being harsh... first and foremost I can tell you really aren't ready to decompile or recompile apks yet.. you can't just download and go and expect to enter some commands and presto! You have to read and research how to properly use apktool... look at the commands you entered...

C:\apktools>apktool b browser

^builds an apk out of the output folder for the apk

C:\apktools>apktool d Browser

^does nothing

C:\apktools>apktool d Browser.apk

^this would be how you'd decompile an apk

But first of all your commands are allll wrong

Your framework files are the framework apks for your rom

Aosp

-framework-res.apk

Miui

-framework-miui-res.apk

-framework-res.apk

Touchwiz

-twframework-res.apk

-framework-res.apk

I don't remember sense...I think I have it in the op

And your commands should look more like this

java -jar if framework-res.apk

java -jar apktool.jar d Browser.apk browser

java -jar apktool.jar b browser Browser.apk

If you get any errors that you can't find the answer to by doing a Google search then come back and I'll be more willing to help you... but actually search.. before you go posting crazy questions like this ask yourself "did I really search and learn how to use everything the right way?"
[Android Q&A, Help & Troubleshooting] Avilove.Cullen:
But why it says to install framework.apk..

How can i install an .apk :(
[Android Q&A, Help & Troubleshooting] evol4g:
Re read the post you quoted.......... I just literally broke everything down for you..
[Android Q&A, Help & Troubleshooting] evol4g:
http://lmgtfy.com/?q=how+to+use+apktool

That might help since you are having troubles doin it yourself
[Android Q&A, Help & Troubleshooting] Avilove.Cullen:
Sorry i still cant understand how to install framework.

I want to decompile settings.apk so how can i install framework?

I had came across 100 apk decompiling/compiling tools but cant get through it :(
[Android Q&A, Help & Troubleshooting] evol4g:
Use that link... its simply user error on your behalf :/
[Android Q&A, Help & Troubleshooting] Avilove.Cullen:
I will try once again.

But i am pretty sure that i will not get through it :(
[Android Q&A, Help & Troubleshooting] evol4g:
Idk why I just gave you step by step instructions and I even broke down what those commands you were inputting before do which were wrong anyway and I showed you the right way to do it... if you still can't do it what makes you think you could actually make any changes to the apk? No offense or anything..
[Android Q&A, Help & Troubleshooting] Avilove.Cullen:
I am scared of Command prompt :( .. It always gives me error.. :(
[Android Q&A, Help & Troubleshooting] Avilove.Cullen:
Last question ..

Can you give me a step by step process?

Please dont mind :)