Settings App add-on

Deckoz2302

Senior Member
Dec 3, 2012
904
1,714
0
Raleigh
Ported Tablet UI to 4.1.1. From Galaxy Tab 7 & Note 10.1... Im trying to figure out how to inject the .smali files or create an apk hook to show the settings menu for quicklauncer settings that is implemented on the galaxy 7 to be able to change the quicklaunch icon(none/screenshot/appdrawer/camera/search)



I have decompiled the settings.apk from the Tab 7 and these are the .smali files

https://www.dropbox.com/sh/pgpkd9yti70df64/TcAcNwqC7j

The SystemUI.apk and android.service.jar have been changed already and are working. I just need a little direction on how to create a settings app add on...

Here is the thread. And this is how it sits as of now...
http://forum.xda-developers.com/showthread.php?t=2065644







Just trying to add a hook into settings for quicklaunch settings to be able to change the screenshot button.

Also has anyone been able to implement Lidroid/wanam toggles for a tablet before. I used a base that had it implemented for the phone side. However even with searching I have been unable to find a touchwiz based tablet with custom toggles. Sorry If this is the wrong place. I'm still new to this site so please move if I am incorrect for posting here
 
Last edited:

mithun46

Senior Member
Oct 28, 2012
1,275
1,979
0
▒▅|▆|█|▆|▅▒
Integrating application in settings menu

This really handy one.. so take care!!:confused:
In this tutorial, we will add USB-Mode program to Settings menu as an example

On your PC
1) Decompile SecSettings.apk.
2) Decompile the program that you want to add to settings menu (USB-Mode)
3) Go to \res\drawable-xhdpi folder and add icon for your program that you want to add (you can take it from decompiled wanted program (USBMode folder).



4) Go to \res\values folder and open strings.xml by NotePad++ and add these lines just before </resources> for your program
Code:
    <string name="gloryromaddons">GloryROM Addons</string>
    <string name="usbswitcher_text">USB mode switcher</string>
Here change “gloryromaddons” with any thing you want to show as a header in the Settings menu. “usbswitcher_text” is your wanted program
5) Go to \res\xml folder and open settings_headers.xml by NotePad++ and add these lines (the place you put these lines will be the place where added program will be displayed in Settings menu)
Code:
<header android:title="@string/gloryromaddons" />
    <header android:icon="@drawable/usbswitcher" android:title="@string/usbswitcher_text">
        <intent android:targetPackage="in.zatta.USB_switch" android:action="android.intent.action.MAIN" android:targetClass="in.zatta.USB_switch.USB_switcherActivity" />
    </header>
The first line reflect the header title in settings menu (So gloryromaddons will be seen as “GloryROM Addons” in the phone, see strings.xml that we edited and you will figure it out!!)

The 2nd line is for added program:
  • android:[email protected]/name of icon you put in drawable-xhdpi folder (here we put usbswitcher as the icon name inside drawable-xhdpi)
  • android:[email protected]/name of string put for added program in strings.xml (here we put usbswitcher_text as in strings.xml)

The 3rd line is the functionality and is the most difficult one:
  • android:targetPackage=package of wanted program inside its own AndroidManifest.xml (here it is “in.zatta.USB_switch”)
  • android:action=first action of wanted program inside its own AndroidManifest.xml (here it is “android.intent.action.MAIN”)



  • androidtargetClass= android:targetPackage.Activity (we have android:targetPackage from previous step but we need also .Activity how to get it??) This is the tricky one so do the following:
On your phone:
install the program you want to add (USB mode switcher) and ADW launcher from Google play and make ADW launcher as your phone launcher. Find a blank area on your homescreen(s), long press, then select custom shortcut --> pick your activity --> activities --> browse down until you find USB switcher app and expand with the arrow on the left of USB switcher, you will see several activities (some may have only one). The first one in the list is usually its opening class; it is in between the ( )'s. In this example it is .USB_switcherActivity



Go back to your PC:
So now androidtargetClass= android:targetPackage.Activity will be:
androidtargetClass= in.zatta.USB_switch.USB_switcherActivity

6) Now compile SecSettings and push it to your phone.


Additional step:
If you want to hide this app from applications drawer do the followings:
1) Decompile your desired app (here USB-Mode.apk)
2) Go to AndroidManifest.xml file and open it by NotePad++
3) Delete this line :
Code:
<category android:name="android.intent.category.LAUNCHER" />
4) Compile your app as non system apk and sign it then push it to your phone

Results example:

 

TonyTrollsten

Senior Member
Feb 3, 2013
206
28
0
Respect
THANKS

I'm capable of reading
Will you just read that worng
Hah again xD

---------- Post added at 07:14 AM ---------- Previous post was at 07:02 AM ----------

I'm capable of reading
Will you just read that worng
Hah again xD