Modding Starter Guide for Android

This guide will teach you how to get started modding (**hacking**) the *Smash Hit* files for Android in the simplest way possible. If you do not have access to a PC, then you will want to read the Modding Starter Guide for Android without PC.

## Software

### Windows

#### APK Editing Tool

On Windows, you should just get APK Editor Studio. It's what we'll be using here, and that makes it very simple as it combines all of our tools and adds a user interface for everything. One thing you will need, however, is to make sure that APK signing and Optimization are working properly. Without these working, your APK will build but fail to start or install.

#### Text Editor

On Windows, notepad is usually not enough. Install Notepad++. Later in this guide, we call it the Text Editor, so when we say that, just know it means Notepad++.

### Linux

APK Editor Studio is available for Linux as well, but other tools are also more accessible. If you would like to use apktool, jarsigner/apksigner, zipalign, and adb from the terminal, then you can, but we won't document that.

## Prepare

Now that we have all the software we need, let's download other things we might need and do things to get the one-time setup out of the way.

### *Smash Hit* APK

You will need to obtain a *Smash Hit* APK file somehow. The fastest and safest way is to just download it from APKMirror or APKPure, but if you want to use anything earlier than the multiplayer game modes update (pre-1.4.0), you'll need to find another site to download from.

### Android Device

On your Android device, you will need to open the developer options and enable ADB debugging. You can find tutorials online.

## Modding

### Checkpoint Files

First, let's start off with modding a checkpoint file.

1. Open the APK in APK Editor Studio. If you installed it on Windows, you can just double click the APK file and it should open in APK Editor Studio.
2. From the menu, click **Open Contents**.
3. Go into the **assets** folder, and then the **levels** folder.
4. Open your text editor, then drag and drop the file **night.xml. (Checkpoint 1)** into the editor window. The file should open.
5. Let's make the first and last rooms longer, as well as remove the middle stage. First, copy and paste the line that has the room with type ***night/part1*** **(Moving Glass Columns, stationary glass blocks)** into a new line just under it. Now, change the first line to where it says **end="false"** instead of **end="true"**. Save your progress by hitting Ctrl+S.
6. On the second line that says ***night/part1***, change start="true" to start="false".
7. Delete the lines that say ***night/part2***. That's the room with the **DNA strands**, and we want to delete it.
8. Next, copy the line that says ***night/part3*** **(swinging glass slabs)** to one under it, then change the start and end values so the one at the very beginning has a start but no end, and the one at the end has an end but no start.
9. Save the file again. (Ctrl+S)
10. Close out of your editor.
11. On the device that you wish to test, uninstall *Smash Hit*. **Warning: This will permanently delete your progress if you don't have premium.**
12. On the APK Editor Studio window, click the save icon in the top bar, then plug your device into your computer and click the install button . Select the first option under the list and click the **install** button. Your modded APK will now be installed on your device!
13. Test your mod. Did it work?

### Room Files

Room files (found in assets/rooms/[internal checkpoint name]/) use Lua scripts. You can edit these files in the same way that you did the last, but you must understand some basic programming concepts.

Tip: Lua (http://www.lua.org/) is the scripting language that Smash Hit uses, with added extras to make it work for Smash Hit.

### Other Files

To edit other files, you need to know how to edit them. If they can't be opened in a Text Editor, then they're not able to be edited (yet).

## What to Read Next

* It is advised to read some of the room code. (If you need extra commentary, we're working on taking each room file and adding extra commentary to it.)
* Edit the Order of Rooms
* Basics of a Room
* Change a Power-up in a Segment
* Change an Object in a Segment
* How the Menu Works
* Creating a Segment without a Level Editor
* Using mgGet and mgSet