[HTC EVO 3D] tommytomatoe:
well said mi amore.

I don't think.you will be able to swap the reference from m10 to a resource. Reason is the why the source renders the m10 images. You will have to modify a bit more code to successfully switch. But.good progress :-)

An android app is written in java. During the compile process, the source (be it through the android build or the ADT) is ran through a process that translate the native java bytecode into dalvik executable with a tool called dx. This is what's known as the classes.dex file. This is a format that the dalvik vm can understand and execute.

Now, when you use apktool to decompile (better put as dissemble) an apk, the classes.dex gets dissembled into a folder called smali, where the classes are now called .smali files and are in a language that most people hate. The actual language is based off of jasmin, so to.better understand smali read the structure of jasmin. This process stems from the tool baksmali.jar written by jesusfreke. When you build the apk, the smali folder gets assembled into classes.dex using the tool smali.jar. Apktool has both built-in.

Alternatively, you can just use smali and baksmali if all.you intend to do is modify smali files. The advantages of doing so are pretty obvious I think. First, using baksmali.jar you have multiple debug and output options and flags, such as registers or locals. Second, if there are errors in your smali, smali.jar is generally more helpful on the actual error on build time then apktool.jar. One more advantage I find is that you don't need to waste time decoding xml if you don't need to modify them.

Here is a very basic workflow that i follow. Btw these commands are even faster when.you put them into scripts like I do to speed up your process. See you want to edit Rosie.apk:

baksmali -l Rosie.apk -o Rosie-dex

<edit here>

smali Rosie-dex -o classes.dex

aapt r Rosie.apk classes.dex
aapt a Rosie.apk classes.dex
adb remount
adb push Rosie.apk /system/app
adb push Rosie.apk /system/app

That method will utilize the original packaging instead of a new one that is made by apktool. So you don't even deal with signatures. The android sdk is required for some of those commands.

But say you want to modify both smali and xml...here is what i do.

I still.use baksmali and smali for the smali part and just use apktool d -s to decode apk. It skips the smali part if it exists.

And as for signatures, read my next comment:

While it used to be a good idea to preserve the signature, once i found the hack to disable signature verification this process is no longer necessary. Also, some of the system apps these days won't take even with the original Sig and.you need to resign. And resigning.is super necessary anyways if you plan to install the app somewhere besides system/app.

Signing.made easy:

Use keygen to create a keystore. Google will show you how.

Name.this file .keystore"

Place it in your $HOME directory or your user directory on windows.

Now you can sign away like.this:

jarsigner Rosie.apk ALIAS

ALIAS is equal to the value you gave the key when you creates one.

That's it! Super fast and easy.

So to modify my workflow above, this is what i actually do:

My Rosie is odex so the classes.dex does not exist inside the apk to begin with.

apktool d Rosie.apk

baksmali -x Rosie.odex (command is actually more complicates but that is deodexing it)

Edit stuff.

apktool b Rosie Rosie.apk

smali out -o classes.dex

aapt a Rosie.apk classes.dex

jarsigner -storepass MYPASSWORD Rosie.apk cert (my alias)

Works every time :-)

If anyone is interested in this script let me know. It is a simple bash script that does all of these commands at once.