5,605,250 Members 39,522 Now Online
XDA Developers Android and Mobile Development Forum

[GUIDE] How to add extra option in settings.apk

Tip us?
 
hnkotnis
Old
(Last edited by hnkotnis; 12th November 2013 at 07:55 AM.) Reason: Types rw-r-r instead of rw-r--r--.
#1  
hnkotnis's Avatar
Senior Member - OP
Thanks Meter 346
Posts: 897
Join Date: Jul 2013
Location: Sangli, Maharashtra, India, Asia, Earth, Solar System, Milky Way Galaxy, Local Galaxy Group,Universe
Info 2 [GUIDE] How to add extra option in settings.apk

EXTRA APPLICATION OPTION IN SETTINGS MENU

This is my first thread, so please ignore my errors.
We have seen custom ROMs having some extra options in settings. This is a guide of adding these options.
This guide is for Galaxy y, but also can work for devices with similar settings.apk (like Ace, duos etc.)

Prerequisites:-
1) A rooted phone (I can't strech how important this is :D)
2) Backup your orginal settings.apk
3) Basic knowledge of decompiling and recompiling.

Procedure:-
1)Decompile settings.apk and apk of the app you want to put. (I am decompiling Proximity Actions)
2) Go to decompiled app folder and open AndroidManifest.xml. Note Package and Target Class. (Marked with red circle Attachment # 1)

3) Open decompiled folder of settings. Go to /res/values/strings.xml. Open with Notepad++.
Enter code <string name="prxt_ctrl">Proximity Control</string> in the end before /resources>. You can edit red coloured text to anything which you want to appear in settings. You can also give any string name, but remember it.
4) You need an icon to put in settings(You can get it from that decompiled app). Resize it to 24x24 pixels (FOR GALAXY Y ONLY)
5) Put that icon in settings/res/drawable-Idpi with any name(remember it). I have given name ic_settings_prxt
6) Go to settings/res/xml/settings.xml. Open with Notepad++
7) Add code <com.android.settings.IconPreferenceScreen android:title="@string/prxt_ctrl" settings:icon="@drawable/ic_settings_prxt">
<intent android:targetPackage="novum.inceptum.proximity" android:action="android.intent.action.MAIN" android:targetClass="novum.inceptum.proximity.PA_A ctivity" />
</com.android.settings.IconPreferenceScreen>


Here string is used from step 3. Use icon from step 4. Package and targetClass from step 2.

8) Save and compile Settings.apk and complete formalities of recompiling.
9) Push Settings.apk to /system/app and set permissions to rw-r--r--.
10) Enjoy



PRESS THANKS IF HELPED. I REALLY NEED IT.
The Following 5 Users Say Thank You to hnkotnis For This Useful Post: [ Click to Expand ]
 
burak144
Old
#2  
burak144's Avatar
Senior Member
Thanks Meter 265
Posts: 935
Join Date: Dec 2012
Location: Bingol/Turkey
there is a similar thread. plz search before post. mods plz close this thread.

Galaxy Pop Plus'ımdan Tapatalk 2 ile gönderildi.
PHONE: Galaxy Mini/Pop Plus GT-S5570I
ROM: bieltv.3's CyanogeMod 7.2
KERNEL:Cyanus 1.9
SCRIPT:Fly-On Mod v4.0 Beta 4

My port roms for Galaxy Mini/Pop Plus:
GT-Xperia U(Xperia Taste)
Remix v2(S3 Themed)
Remix Plus+ v2.5(Better S3 Themed)
MIUI 2.4.20 GB
Hyperion 8 Golden Master Final
Lenox Evolution V2

My own blog for Galaxy Pop Plus Click Here!
Note: This blog is in Turkish so tranlate it.

Sözler incidir, bazen incitir...
 
hnkotnis
Old
(Last edited by hnkotnis; 9th November 2013 at 05:31 AM.)
#3  
hnkotnis's Avatar
Senior Member - OP
Thanks Meter 346
Posts: 897
Join Date: Jul 2013
Location: Sangli, Maharashtra, India, Asia, Earth, Solar System, Milky Way Galaxy, Local Galaxy Group,Universe
That guide you are talking about by PinapleOwl is different method. It is just how to add extra ACTIVITY with smali editing. Here you dont have to edit smali. Please note the difference before comment. Also this has detailed screenshots for noobs.

Sent from my GT-S5360 using xda-app
Using CWM........Busybox Commands........No I use my hands
 
marcussmith2626
Old
#4  
marcussmith2626's Avatar
Recognized Contributor
Thanks Meter 1737
Posts: 3,401
Join Date: Jul 2012
Location: London

 
DONATE TO ME
Think the thread being referred to is
http://forum.xda-developers.com/show....php?t=2341389

Which has more options such as sub directory

Anyway it's a clear guide for anyone who needs simple directions

My Work And Threads For Galaxy Y GT-S5360


My PM is not a Question & Answer thread - Dont treat it as such!
 
hnkotnis
Old
#5  
hnkotnis's Avatar
Senior Member - OP
Thanks Meter 346
Posts: 897
Join Date: Jul 2013
Location: Sangli, Maharashtra, India, Asia, Earth, Solar System, Milky Way Galaxy, Local Galaxy Group,Universe
Quote:
Originally Posted by marcussmith2626 View Post
Think the thread being referred to is
http://forum.xda-developers.com/show....php?t=2341389

Which has more options such as sub directory

Anyway it's a clear guide for anyone who needs simple directions
No. That guide has different Settings structure. It is for Xperia Arc where menus are classified by category.
In our Galaxy y, we don't have settings_header.xml.

Indeed both guides are similar, but I think a set of simple instructions would be helpful, so I have written this thing.
 
marcussmith2626
Old
#7  
marcussmith2626's Avatar
Recognized Contributor
Thanks Meter 1737
Posts: 3,401
Join Date: Jul 2012
Location: London

 
DONATE TO ME
Quote:
Originally Posted by shadman0 View Post
i cannot find android:targetPackage android:action etc
its the name of the apk in its manifest - decompile the target apk and look

My Work And Threads For Galaxy Y GT-S5360


My PM is not a Question & Answer thread - Dont treat it as such!
 
shadman0
Old
#8  
shadman0's Avatar
Senior Member
Thanks Meter 69
Posts: 266
Join Date: Nov 2013
Location: Delhi
Thumbs up I have Problem

Quote:
Originally Posted by marcussmith2626 View Post
its the name of the apk in its manifest - decompile the target apk and look
Marcussmith2626 I have Build The App And Sign App After I have Place System/app and givr it permissions r w r r after reboot The Settings is Not Come in Launcher
 
hnkotnis
Old
#9  
hnkotnis's Avatar
Senior Member - OP
Thanks Meter 346
Posts: 897
Join Date: Jul 2013
Location: Sangli, Maharashtra, India, Asia, Earth, Solar System, Milky Way Galaxy, Local Galaxy Group,Universe
Quote:
Originally Posted by shadman0 View Post
Marcussmith2626 I have Build The App And Sign App After I have Place System/app and givr it permissions r w r r after reboot The Settings is Not Come in Launcher
If you have not edited Manifest of your SETTINGS APP (IMPORTANT), then you don't have to sign that APK. Just open both apks (newly compiled and original) in 7zip 7zip ONLY (Right click on apk ====> 7zip ====> Open archive)

Then drag META-INF of original apk to compiled apk and push to /system/app and change permission to 644 (rw-r--r--)
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


TRENDING IN THEMER...