[Samsung Galaxy S II Plus] panda00:
Hello everyone, here, I'll be writing a few guides on how to setup some XML/SMALI mods to aid people on ROM/MOD development. I will try to make everything as simple as possible. However, there will be different difficulty levels for each tutorial, which are [VERY EASY, EASY, MODERATE, HARD, VERY HARD]

GRAB YOUR TOOLS

​

Below is a list of essential programs or tools for any sort of modding, which also applies to the guides below.

APKTOOL

Here's how to setup apktool and use it

Notepad++

7zip

Brain

GUIDES

​

ADD MORE TOGGLES TO THE NAVIGATION PANEL

Difficulty level: [EASY]

Special thanks to @MalekoUK

​

Decompile SystemUI.apk

Go to \res\values\arrays.xml (Open using Notepad++)

You will see a list similar to this:

<string-array name="QuickSettingButtonAttribute">
<item>Wifi</item>
<item>Location</item>
<item>SilentMode</item>
<item>AutoRotate</item>
<item>Bluetooth</item>
<item>MobileData</item>
<item>DormantMode</item>
<item>PowerSaving</item>
<item>Sync</item>
</string-array>

This represents the order in which the toggles are placed in the navigation panel.

You can add a toggle for a few stuff which Samsung have disabled by default, here are the available toggles that can be added:

<item>AirplaneMode</item> - Airplane mode
<item>DoNotDisturb</item> - Disable/enable notifications toggle
<item>DrivingMode</item> - Driving mode
<item>NfcP2p</item> - NFC
<item>SBeam</item> - S Beam
<item>SmartStay</item> - Smart Stay

So if for example we add Smart Stay, just after Power Saving, the new code portion will look like this:

<string-array name="QuickSettingButtonAttribute">
<item>Wifi</item>
<item>Location</item>
<item>SilentMode</item>
<item>AutoRotate</item>
<item>Bluetooth</item>
<item>MobileData</item>
<item>DormantMode</item>
<item>PowerSaving</item>
[B][COLOR=Red] <item>SmartStay</item>[/COLOR][/B]
<item>Sync</item>
</string-array>

Save and recompile the APK

HOW TO CHANGE THE TOGGLE LABELS (TEXT UNDER TOGGLES)

This is an additional step and you may or may not do it. It is recommended for one weirdly named toggle though, the NFC one, so this is the one we'll be renaming.

Navigate to \res\values\strings.xml (Open using Notepad++)

Use CTRL+F to bring up the search box and enter quickpanel_nfc_text... You will see this line of code:

<string name="quickpanel_nfc_text">"R/W
P2P"</string>

Change it to:

<string name="quickpanel_nfc_text">"NFC"</string>

Save and recompile the APK.

INCREASE LOCKSCREEN SHORTCUTS NUMBER TO 4

Difficulty level: [VERY EASY]

Special thanks to @majdinj

Decompile SecSettings.apk

Navigate to \smali\com\android\settings\lockscreenshortcut\LockscreenShortcutSettings.smali

Look for this code

# direct methods
.method static constructor <clinit>()V
.locals 2

.prologue
const/4 v1, 0x0

.line 79
const/4 v0, 0x3

Change it to this

# direct methods
.method static constructor <clinit>()V
.locals 2

.prologue
const/4 v1, 0x0

.line 79
const/4 v0, 0x2

Save the file and decompile SecSettings.apk

ENABLE SMART ROTATION

Difficulty level: [VERY EASY]

Special thanks to @majdinj again :)

Decompile SecSettings.apk

Navigate to \smali\com\android\settings\DisplaySettings.smali

Search for this code portion:

invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;

move-result-object v10

iget-object v11, p0, Lcom/android/settings/DisplaySettings;->mSmartRotation:Landroid/preference/CheckBoxPreference;

invoke-virtual {v10, v11}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z

Delete the 4 lines.

Save the file and recompile SecSettings.apk

More to come... :)

​