VTS Project Workflow

The following tutorial is to demonstrate VTS project workflow. It will give you an example of how to setup your solutions, your projects, and even a few examples of what you can do with VTS.


Selecting a new Project/Solution

  • After opening VTS – click on File in the upper left corner > click on New Project.  You will then need to select the type of project in the pop up menu.
      1. Select Apk-Project to work an entire app, including the res folder (drawable folders, values, layouts, etc.) smali folder and AndroidManifest.xml.
      2. Select Jar-Project to edit a jar file, such as services.jar, androidpolicy.jar, etc.
      3. Select M10-Project to decode m10 images and data.
  • Once you select one – highlight the appropriate project type and at the bottom of the pop up you will be prompted to enter a project name.  This will be the solution that will hold the file you import.  For example – If you are importing a system/app such as SystemUI.apk, you may want to name your solution “System Apps“.  That way you can keep any future system apps in the same solution folder.  Once you name it, you will see the solution named folder in the left side solution explorer.
  • Now to import your project – click on File in the uper left corner.  You have the option of NEW and EXISTING projects.  Select NEW, a pop up will come up. In the left side of the pop up select the  IMPORT tab.  You can now type or browse for the path of the file you want to import. This will decompile and import your project to the Solution.

    import file

  • Editing the imported file – now that your file is imported and decompiled, you will see the folders within the imported apk - res, smali, AndroidManifest.xml (assets if applicable). Now you can edit any of the files contained in those folders, such as res-drawable images, values, layouts, xmls and anything within smali folders.
    Import structure

Example of editing XML files

  • This is an example and may not be the same for all devices – Remove the status bar clock within the layout/status_bar.xml .  Open the res folder under the apk you imported.  Open the drawable folder. Within you will find status_bar.xml.  Double click to open the xml and find android:id=”@id/clock” .  Add android:visibility=”gone” one space after @id/clock.  By doing this, the status bar clock will be removed.
    XML beforeXML after

Example of editing drawable images

  • Re-coloring an image within res/drawable-xhdpi –  Open the res folder under the apk you imported.  Open the drawable-xhdpi folder.  You will see all images in a list in the solution explorer on the left.  Right click anywhere in the list of images and click “Open in explorer“.  This will open all the images in an explorer window for easy view and export to your choice of image editor.  Edit the image with your editor and save it.  It will save right back to the explorer window.  You can close out the explorer window or edit more images in the same manner.
    Image example1Images editing

Example of editing smali files

  • This will be a very simple edit to remove rotation toggle option in extended quick settings – Open smali folder, then the follow folders: com, android, systemui, status bar, preference.  Within the preference folder find QuickSettings.smali and double-click to open it.  Easiest way to find rotation is to do a quick search. On the top tool bar you will see the quick search box.  Type “rotation” in the text field then hit enter.  This will find the first instance of rotation and will pop up a search box.  In the pop up you will see “Find next“. This button will jump to the next instance of rotation every time you click the “Find next” button.  In this case, I know that the second instance is where my edit is. (see screenshot) You will see if-nez v3, :cond_3c8 above the instance of rotation and this is where my edit will be.  I will change “nez” in the highlighted line to “eqz” to disable rotation toggle, from showing in my extended quicksettings.
    Smali beforeSmali after

Closing

You may have noticed I haven’t mentioned anything about saving all the edits in the above tutorial.  This is probably an overlooked feature that I find very useful. When you are done editing the apk, right click on SystemUI in the solution explorer and select “build file”.  This will prompt you to save all the changes that you have made.  If multiple edits were made, it will prompt you several times. To save them click OK.  Once the file is built you can right click on SystemUI and select “push to device”, or you can select “open in windows explorer”.

You will find your final apk in the “binary” folder already signed and zip aligned.

This is just a small example of some of the things you can do using this powerful studio of integrated tools.  Please take advantage of the other tutorials provided in this section, as there are countless other useful functions built into the Virtuous Ten Studio.