Setting up your first project

Let’s jump straight in and get you started on your first project.  For those of you familiar working with IDEs VTS will be a breeze.  For those of you new to it all the first thing to understand is the principle of working with Solutions and Projects.  

In a second we’ll be creating your first project and it will all make a bit more sense, however understanding the terminology before you start will be helpful.  
Essentially you create individual Projects grouped within Solutions – think of a Solution as a folder containing one or more individual Projects.  

For example you might have one Solution per ROM you are working on, containing all your various projects for that ROM or maybe a Solution for a particular mod which required projects for several different APKs and jars.  

However you choose to structure your work with VTS it all starts with creating your first project, so here’s how you go about it:

  1. Select File (top left of screen) and click on New Project
  2. In the Create new project window the first thing you need to do is enter a solution name.
    VTS NewProjectVTS SolutionName

  3. If you like you can also enter a project name for the first file you are going to import into your new solution.  If you don’t enter anything in here the project name will automatically be the name of the .apk or .jar file that you are importing.  

    TOP TIP – If you are creating a Solution for a particular mod and will be creating the mod for several ROMs or devices it is a good idea to use project names to identify the file/ROM/device, for example framework-res_ViperX_2.7, so you don’t lose track of which project is which!

  4. Down the left side of the Create new project window you will see several tabs (these vary depending on the type of project you are creating – see Choosing the correct project type )
    For your first project we’ll stick with an Apk project.  So make sure Apk Project is selected and click on the ApkTool tab.  
    You should already have set your default ApkTool version in VTS Settings, and have imported the framework files from the ROM(s) you are planning to work with.  
    Make sure the ApkTool path is pointing to the version you want to use to decompile your APK and then in the Framework tag dropdown select the correct Framework tag.
    VTS APKToolTab

  5. Now click on the Smali tab and select the correct Android version for the ROM you are working with
  6. If you are decompiling a proprietary HTC apk and want to edit the decompiled m10 files and/or images then click on the M10 Engine tab, check the box beside ‘Use M10 tools…‘ and select the appropriate Sense version from the dropdown.  If you are not working with HTC APKs then you can ignore this tab.
    VTS SmaliTabVTS M10Tab

  7. Click on the Import tab and hit the browse (…) button to the right of the path field.  
    You now have two options for selecting your APK.  You can select a file from your PC by clicking the browse button beside the Local File path field and using Windows Explorer selecting your APK.

    Alternatively if you have your phone connected to your PC, VTS can pull the file directly from your device.  
    To do this select the down arrow next to ‘Remote file‘.  VTS will then scan your device for system files (/system/app/ and /system/framework/) and user APKs (/data/app/).
    You can then expand System, Framework or User and select your APK.  VTS will then pull the chosen file from your device ready for decompiling.
    VTS ImportTab

  8. If required VTS can also reverse engineer the smali in classes.dex back to Java source code (useful if you want to understand better what is going on in the smali code, but no use if you don’t understand Java…)
    If you require this option just check the box beside ‘Generate Java Code‘ on the Import tab (Depending on the apk/jar generating java sources might take up to ten minutes or more).
    VTS GenerateJava

  9. For now we can ignore the Build tab (the default options are good for pretty much everything you’ll be doing anyway) so now we’re ready to create the project.
    Click OK, and VTS will do the rest!  You can watch what is going on in the Tasks panel.  

    Once VTS has finished decompiling (how long this takes depends entirely on the size of the APK, whether or not you asked for m10 or Java, etc) you will see ‘Task Complete’ in the Tasks panel, and your new Solution containing your first project should now be visible in the Solution Explorer.
    VTS TaskFinishedbVTS SolutionExplorer

Let the games begin!