Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,779,159 Members 45,741 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 432
Posts: 995
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 6 Users Say Thank You to hnkotnis For This Useful Post: [ Click to Expand ]
 
burak144
Old
#2  
burak144's Avatar
Senior Member
Thanks Meter 288
Posts: 1,033
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: Moto G XT1033 Dual SIM
ROM: crDroid Build 12
KERNEL: Stock crDroid Kernel

My work for Galaxy Mini/Pop Plus:


 
hnkotnis
Old
(Last edited by hnkotnis; 9th November 2013 at 05:31 AM.)
#3  
hnkotnis's Avatar
Senior Member - OP
Thanks Meter 432
Posts: 995
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 2373
Posts: 4,401
Join Date: Jul 2012
Location: London
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 432
Posts: 995
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.
 
shadman0
Old
#6  
Account currently disabled
Thanks Meter 117
Posts: 348
Join Date: Nov 2013
Location: Delhi
i cannot find android:targetPackage android:action etc
 
marcussmith2626
Old
#7  
marcussmith2626's Avatar
Recognized Contributor
Thanks Meter 2373
Posts: 4,401
Join Date: Jul 2012
Location: London
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  
Account currently disabled
Thanks Meter 117
Posts: 348
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 432
Posts: 995
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--)
 
shadman0
Old
#10  
Account currently disabled
Thanks Meter 117
Posts: 348
Join Date: Nov 2013
Location: Delhi
Same problem

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Make a Pre-Rooted Stock Sony ROMs in Just Few Clicks

Many usersdon’t see any particular reason to change out the stock firmware … more

Add Timestamps to Xposed Installer Logs with… Xposed!

If talking about the most interesting projects in the last few years, we must … more

Secrecy Goes Open Source, Assures File Encryption

As some of you may remember, a while back we spoke about Secrecy, an effective file … more

[APK] Google News and Weather Gets Material Design Makeover, Minor Maps Updates

Although Google has somewhat gotten out of the habit of their … more