[Sprint Samsung Galaxy Note II] lickarock:
Have you ever opened up a .smali and just starting bawling your eyes out? Of course you have - .smali code is a mess. Even with software that provides syntax highlighting, its nothing but CONST_V4 for at least eight million lines. The goal of this tut is NOT to produce editable source code. That is why "source" in the title is in quotes. What this can help with though, is translating .smali into a .java file, which is easier to read. You can then track down what you are trying to edit in the .java file, then have a better idea of where and what you are editing in the .smali file.

Lets get a few things straight right now before we begin to play

This TUT assumes you already know how to decompile a .apk and extract a .dex file​

Read THE WHOLE POST. There will be a wall of shame for questions asked answered here.

It is illegal to decompile TW source code, try to edit it, and recompile it as though it was your own.

You will most certainly fail if you attempt to recompile this code. It is NOT true Java source, but is the decompiler's best guess at what it might be.

IF by some MIRACLE of whatever god you pray to allows the "source code" to compile, you WILL experience bugs.

I AM IN NO WAY, SHAPE, OR FORM responsible for what you do with this Tutorial. If you manage to in some way damage your phone, or if you get into legal trouble doing this, I WILL POINT AND LAUGH AT YOU, and that is the end of the conversation.

Dogs are better than cats - I can speak with authority on this - I own one of each, and love them both. But dogs rule and cats drool.

I am not a developer. This is a set of tools I use because quite frankly, I am no coder yet. It makes my life easier trying to track things down, and I figured I might as well share this with everyone.

I did not create the tools in this Tut. I found them and put them to good use. The original location of every file is linked in this post.

Now for the main event​

You will need a specific set of tools. I am posting links to the tools here so you may read more about them, HOWEVER, at the bottom of this post I will have a zipped up toolkit that has all of it included. The tools are:

dex2jar

Java Decompiler

Notepad++

Some Common Sense

We will be using SystemUI.apk for this specific tutorial. That doesn't really matter at all, as this should work with any .apk.

Step 1 : Extract your .dex file:

Step 2: Using dex2jar, convert your .dex file into a .jar file. To do this, simply drag your .dex over:

You have now created your .jar file.

Step 3: Now, drag the .jar over to your jar decompiler:

This is what the result should look like:

Now, if you wanted to stop at this step, you absolutely can. From here, you can manually poke around inside the java files to find what you are looking for. BUT, that is not what I am here for. I am here to make your lives EVEN EASIER. Go get yourself a taco, and meet me here after the break.

Break time's over. Back to work!

Step 4: We now need to extract the .java files from this program. To do so, go to file/save all sources:

I would recommend saving that file as the name of the .apk you are working with:

Step 5: Extract that zip file you just created to its own archive, and then crack open the archive. You can now view your .java files in NotePad++. Here is the same file presented side by side; one is .smali, the other is .java. You can clearly see how things line up, and how much easier it is track things down in the smali:

Now for the final step to, and to bring it all home. Notepad++ has an incredible feature called Find In Files. So, lets say you are trying to find the color of a certain piece of text that is only declared in smali (or, ya know, whatever else it is you may wish to be screwing with), you can use find in files to select a folder, and then search for code:

I hope this has helped you; if it has, give that little thanks button a click. I also hope you have a good sense of humor about cats and dogs, and that you know how to enjoy a taco.

And now for the toolkit. By clicking show content you agree that you have read through both this and the Q&A, and that you agree to go on the Wall of Shame if you force my hand.

SmaliToJavaTutToolkit

PEACE!!!

This document may come in handy: