[Android] RainbowLaw:
Hello buddies..

From the concept SHARING IS CARING, I am going to share some mods specifically on SecSettings.apk that I stumbled across and share it with you in one thread

Keep in mind that most of them are not mine but from the community so actual credits are to be given to the owners. So please let me know if you have any modding that I didn't mention

So let's start!!

Needed tools:

1) Apktool or others that do the job

2) Notepad++ program from here

3) The patience and a willing partner! sorry no link for that:p

Adding Custom image + Onclick Functionality

Credits to [MENTION=4782403]iamareebjamal[/MENTION]

Decomplie SecSettings.apk using Apktool

Download the SettingsSource.zip

Extract contents of SettingsSource.zip to respective folders in SecSettings.apk

Open res/xml/device_info_settings.xml

Add this just a line above the first Preference tag

<PreferenceCategory android:layout="@layout/areebisawesome" android:key="blah" android:title="" />

Now go to res/drawable

There, you'll see cosmic.png Change it to any png of size 320x200 You can change this size description in res/layout/areebisawesome.xml

Recompile

Onclick Functionality

Credits to [MENTION=4767403]abhi922[/MENTION]

Open res/layout/areebisawesome.xml

Add the blue code to the XML

<?xml version="1.0" encoding="utf-8"?>
<ImageView android:layout_gravity="center" android:paddingBottom="6.0dip" [COLOR="Blue"]android:clickable="true"[/COLOR] android:layout_width="fill_parent" android:layout_height="400.0px" [COLOR="blue"]android:src="@drawable/about"[/COLOR] android:scaleType="fitXY"
xmlns:android="http://schemas.android.com/apk/res/android" />

What I've Done ????

Added android:clickable="true" ------> to make our layout clickable

Added android:src="@drawable/about" ------> it is a xml not a picture/png...[it will replace our images on click ]

Create new file about.xml at drawable folder

Add this code to it

<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/about2" />
<item android:state_selected="true" android:drawable="@drawable/about2" />
<item android:drawable="@drawable/about1" />
</selector>

Now add about1.png as first

unpressed

picture

And about2.png as

pressed

picture...

Recomplie

Adding About ROM new information

Decompile SecSettings.apk

Open /res/xml/device_info_settings.xml

In device_info_settings.xml, go to the end and add these lines before </PreferenceScreen> line

<PreferenceCategory android:title="@string/rom_info" android:key="dummy_key">
<Preference android:title="@string/rom_name" android:key="rom_name" android:summary="@string/rom_name_details" style="?android:preferenceInformationStyle" />
<Preference android:title="@string/rom_ver" android:key="rom_ver" android:summary="@string/rom_ver_details" style="?android:preferenceInformationStyle" />
<Preference android:title="@string/rom_date" android:key="rom_date" android:summary="@string/rom_date_details" style="?android:preferenceInformationStyle" />
<Preference android:title="@string/rom_developer" android:key="rom_developer" android:summary="@string/rom_developer_name" style="?android:preferenceInformationStyle" />
<Preference android:title="@string/dev_thanks" android:key="dev_thanks" android:summary="@string/dev_thanks_name" style="?android:preferenceInformationStyle" />
</PreferenceCategory>

Then open res/values/strings.xml & add the following lines

<string name="rom_info">[COLOR="Sienna"]About Rom[/COLOR]</string>
<string name="rom_name">[COLOR="Sienna"]Rom name[/COLOR]</string>
<string name="rom_name_details">[COLOR="Sienna"][ROM Name][/COLOR]</string>
<string name="rom_ver">[COLOR="Sienna"]Rom version[/COLOR]</string>
<string name="rom_ver_details">[COLOR="Sienna"]vx.x[/COLOR]</string>
<string name="rom_date">[COLOR="Sienna"]Release date[/COLOR]</string>
<string name="rom_date_details">[COLOR="Sienna"]month-year[/COLOR]</string>
<string name="rom_developer">[COLOR="Sienna"]Rom developer[/COLOR]</string>
<string name="rom_developer_name">[COLOR="Sienna"][your name] - xda.developers.com[/COLOR]</string>
<string name="dev_thanks">[COLOR="Sienna"]Thanks to[/COLOR]</string>
<string name="dev_thanks_name">[COLOR="Sienna"]Everyone for the support[/COLOR]</string>

You can add or remove fields in device_info_settings.xml and strings.xml as you like

Recompile

Integrating application

Decompile SecSettings.apk.

Decompile the program that you want to add to settings menu (in this example will take chainfire's SuperSU app)

Go to res\drawable-xhdpi folder and add icon for your program that you want to add (you can take it from decompiled program in res/mipmap-xhdpi.

Go to res\values folder and open strings.xml by NotePad++ and add these lines just before </resources> for your program

<string name="romaddons">ROM Addons</string>
<string name="superuser_text">Superuser</string>

Go to \res\xml folder and open settings_headers.xml by NotePad++ and add the blue lines

<header android:icon="@drawable/ic_settings_accessibility" android:id="@id/accessibility_settings" android:title="@string/accessibility_settings" android:fragment="com.android.settings.AccessibilitySettings" />
[COLOR="Blue"] <string name="romaddons">ROM Addons</string>
<header android:icon="@drawable/ic_settings_superuser" android:title="@string/superuser_text">
<intent android:targetPackage="eu.chainfire.supersu" android:action="android.intent.action.MAIN" android:targetClass="eu.chainfire.supersu.MainActivity" />
</header>[/COLOR]
<header android:icon="@drawable/ic_settings_development" android:id="@id/development_settings" android:title="@string/development_settings_title" android:fragment="com.android.settings.DevelopmentSettings" />

Then install the program you want to add on your phone

Extra step is to remove this line in AndroidManifest.xml in your decompiled SuperSU app so to disappear from the launcher

<category android:name="android.intent.category.LAUNCHER" />

Adding other apps

Sample down here for learning

<header android:icon="@drawable/ic_settings_xxxx" android:title="@string/xxxx_text">
<intent android:targetPackage="" android:action="" android:targetClass="" />
</header>

"android:icon="@drawable/ic_settings_xxxx"" : name of icon you put in drawable-xhdpi folder if you want it to be empty the add

this

to drawable and empty_icon as the name of the icon

"android:title="@string/xxxx_text"" : name of string put for added program in strings.xml

"android:targetPackage=""" : package of wanted program inside its own AndroidManifest.xml

"android:action=""" : first action of wanted program inside its own AndroidManifest.xml

"android:targetClass=""" : class of the wanted package inside its own AndroidManifest.xml to start with in this case its .MainActivity

Settings menu extra hidden options

Credits to [MENTION=2312076]tkari4[/MENTION]

Baksmali SecSettings.apk

Open com\android\settings\Settings.smali

Look for these lines and delete them:

invoke-interface {p1, v0}, Ljava/util/List;->remove(Ljava/lang/Object;)Z

goto/16 :goto_23

Note that some FC so head to the forum or download SettingsSmali.rar to see what works or not

Adding TorchLight Option

Credits to [MENTION=2715818]Stavr0s91i[/MENTION]

Decompile SecSettings.apk

Goto res/xml/display_settings.xml

Apply Changes Below (Blue)

<PreferenceCategory android:title="@string/tts_general_section_title" android:key="general" />
<PreferenceScreen android:title="@string/wallpaper" android:key="wallpaper" android:fragment="com.android.settings.WallpaperSettings" />
<PreferenceScreen android:title="@string/led_indicator_settings" android:key="led_indicator_settings" android:fragment="com.android.settings.LedIndicatorSettings" />
[COLOR="Blue"]<PreferenceScreen android:title="Torchlight" android:key="torchlight" android:fragment="com.android.settings.torchlight.TorchlightSettings" />[/COLOR]
<PreferenceScreen android:title="@string/notification_panel_title" android:key="notification_panel_edit" android:fragment="com.android.settings.NotificationPanelMenu" />
<CheckBoxPreference android:title="@string/multi_window_title" android:key="key_multi_window" android:summary="@string/multi_window_summary" android:widgetLayout="@touchwiz:layout/preference_widget_twcheckbox" />
<SwitchPreferenceScreen android:title="@string/page_buddy" android:key="contextualpage_settings" android:summary="@string/page_buddy_summary" android:fragment="com.android.settings.ContextualPageSettings" />

Compile SecSettings.apk!

Setting up a custom settings tab

Credits to [MENTION=2910757]Didact74[/MENTION]

Download Smali.zip

Place it in smali/com/android/settings

Navigate to res/xml/settings_headers.xml

Add this line of code anywhere you want it

<header android:icon="@drawable/ic_settings_romcontrol" android:id="@id/new_tab" android:title="@string/rom_control" android:fragment="com.android.settings.NewTab" />

android:icon="@drawable/ic_settings_romcontrol = The icon you see in the tab and the location that icon is stored

android:id="@id/new_tab" = Android ID thats stored in res/values/ids

android:title="@string/rom_control" = The title the new tab is given located in res/values/strings

android:fragment="com.android.settings.NewTab" = points to the smali that controls this tab

Create your own icon.png (size 50 x 50) and drop it in res/drawable-xhdpi

Navigate to res/values/strings.xml & add this line of code before </resources>

<string name="rom_control">Rom Control</string>
<string name="rom_addons">Rom Addons</string>

Create an XML file with the name "new_tab.xml"

Navigate to res/values/ids.xml & add this line of code before </resources>

<item type="id" name="new_tab">false</item>

Example:

<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:title="@string/rom_addons"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
<!-- Place your settings here -->
</PreferenceScreen>

You will need to add the necessary lines to res/strings found in the XML if would add any others

Recompile the decompile to generate ids in public.xml

Find this line in res/values/public.xml

<public type="xml" name="new_tab" id="0x7fxxxxxx" />

Take your unique id and change it in NewTab.smali from

const v1, [COLOR="Red"]0x7f070082[/COLOR]

To

const v1, [COLOR="Blue"]0x7fxxxxxx[/COLOR]

Then change

invoke-virtual {p0, v1}, Lcom/android/settings/[COLOR="Red"]didact/RomSettings[/COLOR];->addPreferencesFromResource(I)V

To

invoke-virtual {p0, v1}, Lcom/android/settings/[COLOR="Blue"]NewTab[/COLOR];->addPreferencesFromResource(I)V

Done :good:

Switch to Light theme

Decompile the SecSettings.apk

Go to "res/values/" folder and open the file "styles.xml" with Notepad++

Click "Replace" or press "Ctrl+H"

In the "Find What :" box enter "DeviceDefault" and hit next

In the "Replace with: " box enter "DeviceDefault.Light"

Make sure only "wrap around" box is checked

Then press replace all

Compile SecSettings.apk

Permanent "Official" Device Status

This one is explained very well by [MENTION=4381049]0tt0m@n[/MENTION] in this post. Make sure to hit Thanks button for him

Owner Profile in About Device

Credits to [MENTION=4986903]Deckoz2302[/MENTION], [MENTION=4620325]b16h22[/MENTION] and [MENTION=5186263]nightwalker[/MENTION]

Download the zip and extract it Owner_Profile_Mod.zip

Decompile SecSettings.apk

Go to res/values/ids.xml... add these:

<item type="id" name="image">false</item>
<item type="id" name="owner">false</item>
<item type="id" name="linear_layout">false</item>
<item type="id" name="profile_pic">false</item>
<item type="id" name="layout1">false</item>
<item type="id" name="change_picture_text">false</item>
<item type="id" name="photo_picker">false</item>
<item type="id" name="linear_layout1">false</item>
<item type="id" name="layout2">false</item>
<item type="id" name="name_field">false</item>
<item type="id" name="name_edit">false</item>
<item type="id" name="profile">false</item>
<item type="id" name="profile_name">false</item>
<item type="id" name="ic_qs_default_user">false</item>

Next go to res/values/strings.xml.. add these:

<string name="change_pic">Change profile picture</string>
<string name="profile_pic">SET PROFILE PICTURE</string>
<string name="profile_name">CHANGE PROFILE NAME</string>

Now find the files you extracted and put the com folder in correct directory..

SecSetting/smali/com/blac

Now put the files from the res folder in correct directories..

res/layout/lacourb.xml

res/layout/profile_info.xml

res/drawable-hdpi/ (is where the png files go)

res/drawables/done.xml

res/drawable/pick_profile_picture.xml

Forgot to include it so add ic_qs_default_user to res/drawable/xhdpi

Now go to where you want to have the option of changing the Profile Picture and Name. Maybe display_settings.xml it doesn't matter so put it where you want it.

<PreferenceScreen android:title="Owner Profile Picture">
<intent android:targetPackage="com.android.settings" android:action="android.intent.action.MAIN" android:targetClass="com.blac.Profile" />
</PreferenceScreen>

XML's will vary too depending on which one you pick so you need adjust the tag in the beginning of the line and the end of line depending on what it is calling. Example: <PreferenceScreen></PreferenceScreen> OR <headers></headers> so visualize the layout of the xml

Now go to res/xml/device_info_settings.xml and add:

<PreferenceCategory android:title="Device Info" />
<PreferenceScreen android:fragment="[COLOR="Orange"]com.android.settings.deckoz.RomControl.General[/COLOR]" android:focusable="false" android:layout="@layout/lacourb" android:key="profile_pic" />

Pay special attention to the line in ORANGE. This line defines where it takes you when the image is clicked when in About Device. So you would NOT add the same directory as mine because you won't have it. But you DO need to define this because if DO NOT it will FC

So say you want it to be under Users in SecSettings/General/Users.. you would add it like this:

<PreferenceCategory android:title="Device Info" />
<PreferenceScreen android:fragment="[COLOR="Orange"]com.android.settings.UserSettings[/COLOR]" android:focusable="false" android:layout="@layout/lacourb" android:key="profile_pic" />

So now when you click the picture in About Device it will bring you to this directory in SecSettings. So you'll end up in SecSettings/General/Users

Now open your AndroidManifest.xml. At the bottom add these lines:

<activity android:label="@string/change_pic" android:name="com.blac.Profile">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
</intent-filter>
</activity>

Okay now compile your SecSettings..Then grab the newly compiled one and decompile it.. Make sure you keep the AndroidManifest.xml because you changed it..

Now go to the MY public.xml you downloaded and extracted and then open YOUR res/values/public.xml open it and keep it open..You need to have these open to compare ids..

Open your smali folder you added: com/blac/

You need to find all the ids in the smali and change them to match yours.. for example open com/blac/Profile.smali.. Search 0x7f0401ee

Under my public.xml this id: 0x7f0401ee is for "profile_info".. Yours will NOT be the same.. SO you need to search each id in the smali and then in MY public.xml, you downloaded, then search yours and changed the id's...

NOTE: Be free to changed whatever you want..directories, names of xml etc...

Adding 5 icons shortcut on lockscreen

Credits to [MENTION=3153524]Mirko ddd[/MENTION]

Decompile SecSettings.apk and navigate to:

smali\com\android\settings\lockscreenshortcut\LockScreenShortcutSettings.smali

Search for the method ".method static constructor <clinit>()V"

Add the blue code in change of the red code

.method static constructor <clinit>()V
.registers 2

.prologue
const/4 v1, 0x0

.line 79
[COLOR="Blue"] const/4 v0, 0x5[/COLOR]
[COLOR="Red"] const/4 v0, 0x3[/COLOR]
sput v0, Lcom/android/settings/lockscreenshortcut/LockScreenShortcutSettings;->MAX_SHORTCUT_ICON:I

.line 80
sput v1, Lcom/android/settings/lockscreenshortcut/LockScreenShortcutSettings;->DEFAULT_CURSOR_WIDTH:I

.line 81
sput v1, Lcom/android/settings/lockscreenshortcut/LockScreenShortcutSettings;->ICON_5_CURSOR_WIDTH:I

return-void
.end method

Now we need to set the right icon width for the icons, if not the fifth icon won t be showed

Decompile framework-res.apk

Navigate to res\values-hdpi\dimens.xml

Edit these 2 strings with following values

<dimen name="keyguard_lockscreen_application_shortcut_icon_width">52.0dip</dimen>
<dimen name="keyguard_lockscreen_application_shortcut_icon_height">50.0dip</dimen>

Recompile and push both apks with 0644 permissions