Hi guys,,
Today's tutorial will make us able to create new tab in settings menu by which we could control our ROM CSC features by toggles..
This tutorial will be divided into 2 main sections:
Section #1: Creating new tab in settings menu (ROM CSC features controller)
Section #2: Creating toggle listener in apk that contains the csc feature that we want to control
So let's start..
First download the resources from attachment bellow.
- Decompile SecSettings.apk
- Navigate to res\xml folder and open settings_headers.xml and add this line wherever you want the new tab to appear in your settings menu later on:
- Still in the same res\xml folder, paste csc_settings.xml there from resources file.
- Navigate to res\drawable-xhdpi folder and paste ic_csc_controller.png from resource file there.
- Navigate to res\values folder and open ids.xml file and add this line at the end:
- Navigate to res\values folder and open strings.xml and add these lines:
- Now you need to compile SecSettings.apk to create new ids in public.xml file..
- Now decompile the new SecSettings.apk, and go to res\values folder and open public.xml and locate this line:
Remember that id, we will use it later.
- Now go to smali\com\android\settings folder and paste the folder romhack there from resource file.
- Now open the new folder romhack, and open CscSettings.smali
- Search for the method ".method public onCreate(Landroid/os/Bundle;)V" and change the id here to the one in public.xml before:
That's all for SecSettings.apk, compile and push to your phone and test it.. You should have extra tab with several check boxes inside but still not functioned yet..
Now we need to add check box listeners for each csc feature in different apks...
Today's tutorial will make us able to create new tab in settings menu by which we could control our ROM CSC features by toggles..
This tutorial will be divided into 2 main sections:
Section #1: Creating new tab in settings menu (ROM CSC features controller)
Section #2: Creating toggle listener in apk that contains the csc feature that we want to control
So let's start..
<< Section #1: Creating new tab in settings menu (ROM CSC features controller) >>
First download the resources from attachment bellow.
- Decompile SecSettings.apk
- Navigate to res\xml folder and open settings_headers.xml and add this line wherever you want the new tab to appear in your settings menu later on:
Code:
<header android:icon="@drawable/ic_csc_controller" android:id="@id/csc_control" android:title="@string/csc_features_controller" android:fragment="com.android.settings.romhack.CscSettings" />
- Navigate to res\drawable-xhdpi folder and paste ic_csc_controller.png from resource file there.
- Navigate to res\values folder and open ids.xml file and add this line at the end:
Code:
<item type="id" name="csc_control">false</item>
Code:
<string name="csc_features_controller">ROM CSC features controller</string>
<string name="how_csc_use">Tip:</string>
<string name="how_csc_use_summary">After you made your choices, you may need to restart your device in order to load some csc features changes</string>
<string name="glory_twlauncher">GloryROM TW Launcher CSC Features</string>
<string name="twlauncher_tilt">Transition tilt effect</string>
<string name="twlauncher_page_rotation">Home screens looping</string>
<string name="twlauncher_edit_mode">Home screen edit menu</string>
<string name="glory_twcontacts">GloryROM TW Contacts CSC Features</string>
<string name="twcontacts_photo">Contacts photos</string>
<string name="twcontacts_contacts_call_btn">Contacts list call buttons</string>
<string name="twcontacts_logs_call_btn">Logs list call buttons</string>
<string name="glory_twbrowser">GloryROM TW Browser CSC Features</string>
<string name="twbrowser_exit_option">Exit browser option</string>
<string name="twbrowser_exit_prompt">Exit prompt</string>
<string name="twbrowser_home_menu">Home page option</string>
<string name="glory_twsettings">GloryROM TW Settings CSC Features</string>
<string name="twsettings_call_msg_blk">Call/message block menu</string>
<string name="twsettings_data_reset_password">Factory data reset password</string>
<string name="twsettings_update_menu">Software update menu</string>
<string name="csc_off">Disabled</string>
<string name="csc_on">Enabled</string>
- Now decompile the new SecSettings.apk, and go to res\values folder and open public.xml and locate this line:
Code:
<public type="xml" name="csc_settings" id="[B][COLOR="Red"]0x7f07008e[/COLOR][/B]" />
- Now go to smali\com\android\settings folder and paste the folder romhack there from resource file.
- Now open the new folder romhack, and open CscSettings.smali
- Search for the method ".method public onCreate(Landroid/os/Bundle;)V" and change the id here to the one in public.xml before:
Code:
const v1, [B][COLOR="Red"]0x7f07008e[/COLOR][/B]
That's all for SecSettings.apk, compile and push to your phone and test it.. You should have extra tab with several check boxes inside but still not functioned yet..
Now we need to add check box listeners for each csc feature in different apks...
N.B:
I have put several comments on CscSettings.smali, so you could extend your csc list in future just by following the comments in the smali and add new values in csc_settings.xml and strings.xml