Explanation of filetypes

Android binary files (*.apk, *.jar) contain a bunch of different files. This tutorial aims at explaining the most commonly used file types and their meaning to android themers and developers.
VTS has extensive support for all these file types and helps you working with them.


*.smali

A *.smali is a file generated by the tool “baksmali”, it allows us to view and modify the source code for various parts of the android system.
Essentially when looking at smali we’re looking at the contents of the dex file inside an *.apk or *.jar, which is originally written in java.
The “dex” is Android’s dalvik VM implementation of the java code in an apk or *.jar

*.png

There are a few variations of png files in HTC Sense: *.png, *.9.png and *.r.9.png.
This image type supports rgb, indexed, and greyscale formats, and an alpha channel (for transparency).
.9.png file is an image that can stretch it’s contents in the OS – i.e. a png that is 100×20 but can fill an area 300×20 using Android’s draw9patch program.
On the other hand .r.9.png is a “repeating” .9.png and was created by HTC. ApkTool decompiles these into .9.png so they can be modified as .9.pngs.
It is recommended that you compare using 7zip the original .r.9.pngs to your decompiled .9.pngs, as the decompilation distorts the contained image, and the png fill needs to be fixed.
Also, make sure before you edit any png, that they are in rgb format not index or greyscale, this will reduce visual errors.

*.jpg

A .jpg file is another type of image, only it doesn’t have 9patch in it, and normally won’t handle transparency.
Somehow in apks from newer HTC Sense, these images have transparency. Up until now these couldn’t be modified successfully without graphical issues. There are a couple of workarounds to get past this issue. However, coming soon we will be able to modify them.

*COMING SOON* – Thanks to VTS these special .jpg files in HTC Sense will be accessible! How this works is when you decompile an apk using VTS, it will change these special .jpg files into .png, allowing us to access the aplha channel.

*.xml

Extensible markup language, or xml for short, is plain text data which can control some parts of how the OS displays various things such as layout on the screen, colors for images and text, and the sources for these.
In many .xml files it is possible to redirect where an image or another resource comes from. For example:

android:background=”@android/name_of_file” – pulls from framework-res.apk.
android:background=”@com.htc:drawable/name_of file” – pulls from com.htc.resources.apk.
android:background=”@drawable/name_of_file” – pulls from the .apk you are currently working in.

*.m10

This file type was invented by HTC and contains an almost endless amount of data that controls parts of the UI. .m10 files can also contain images which are used by the HTC Sense apps ( Homescreen, Lockscreen, Widgets, etc.)
When we edit m10 data, technically we are not editing the m10 directly, as we only see the contained data in decompiled format (see below – *.x10).

*.x10

VTS is the only software that can decompile (and recompile) .m10 files into a readable and editable format. This format is called x10 ( m10 + xml = x10).
As you can guess, the x10 format is based on xml and is therefore very easy to edit.
Within the x10 is where much of the customization to HTC Sense can occur.
The other m10 related tutorials cover much of this in detail.