[Q] Changing Default Launcher in CM7 source - Android Q&A, Help & Troubleshooting

I am trying to change the default launcher in CM7 to something such as Launcher7.
I tried to remove both the Launcher2 folder as well as ADWLauncher folder and add the Launcher7 source in /packages/apps but CM7 during build seems to add ADW back into the build so that when I flash it to my device, ADW is still default and installed.
Any advice? Is there some xml file or makefile which seems to set or be referencing ADW?
This is all for my Nexus One btw.

If you delete the launchers that are located in system/app om the ROM ZIP and put the apk of the launcher you want in system/app then it should work fine. I always do that for myself, replacing ADW for Launcher Pro,

Yeah I got it now after a fresh build. Apparently, I was messing with the package names and performing custom modifications and I didnt roll back the changes so when I tried building, it caused all kinds of problems. *facepalm*
Additionally, The changes I am making are all in source, not after ROM compilation so for me the changes were in /packages/apps not /system/app. I am trying not to edit the ROM after building as a good learning experience and its a cleaner solution too.
Smh, Thanks for the reply though. Appreciate it.

If you add in another launcher(also add it to PRODUCT_PACKAGES in device), you'll get a prompt on boot, and you may be able to edit default settings via overlay to use some other launcher as default

and what must be done inorder to add the launcher pro(any launcher) preferences to the settings, like we have the adw settings in the default android settings!!!! Please help...

To change it from source just change PRODUCT_PACKAGES (in common.mk) for AdwLauncher to your launcher name.
https://github.com/CyanogenMod/android_vendor_cyanogen/blob/gingerbread/products/common.mk
To find your product name from your own launcher from source just look for your local package name in Android.mk.
example for Adw:
https://github.com/CyanogenMod/android_packages_apps_ADWLauncher/blob/gingerbread/Android.mk
To add a custom launcher in Settings.apk
https://github.com/CyanogenMod/andr...rbread/src/com/android/settings/Settings.java
line 76 in that file change "com.android.launcher.Launcher" to whatever main activity is there for your new launcher.
also in settings.xml
Code:
<!-- Launcher -->
<com.android.settings.IconPreferenceScreen
settings:icon="@drawable/ic_settings_launcher"
android:title="@string/launcher_settings_title"
android:key="launcher_settings">
<intent
android:action="android.intent.action.MAIN"
android:targetPackage="com.android.launcher"
android:targetClass="com.android.launcher.MyLauncherSettings" />
</com.android.settings.IconPreferenceScreen>
Change the "android:targetClass="com.android.launcher.MyLauncherSettings" to your settings class on the launcher. After you compile you should now have a customer launcher available in settings.

lithid-cm said:
To change it from source just change PRODUCT_PACKAGES (in common.mk) for AdwLauncher to your launcher name.
https://github.com/CyanogenMod/android_vendor_cyanogen/blob/gingerbread/products/common.mk
To find your product name from your own launcher from source just look for your local package name in Android.mk.
example for Adw:
https://github.com/CyanogenMod/android_packages_apps_ADWLauncher/blob/gingerbread/Android.mk
To add a custom launcher in Settings.apk
https://github.com/CyanogenMod/andr...rbread/src/com/android/settings/Settings.java
line 76 in that file change "com.android.launcher.Launcher" to whatever main activity is there for your new launcher.
also in settings.xml
Code:
<!-- Launcher -->
<com.android.settings.IconPreferenceScreen
settings:icon="@drawable/ic_settings_launcher"
android:title="@string/launcher_settings_title"
android:key="launcher_settings">
<intent
android:action="android.intent.action.MAIN"
android:targetPackage="com.android.launcher"
android:targetClass="com.android.launcher.MyLauncherSettings" />
</com.android.settings.IconPreferenceScreen>
Change the "android:targetClass="com.android.launcher.MyLauncherSettings" to your settings class on the launcher. After you compile you should now have a customer launcher available in settings.
Click to expand...
Click to collapse
Can you tell me where is the PRODUCT_PACKAGE
thank you ~

Related

/system/customize/MNS/default.xml

Code:
<set name="plenty">
[B] [U]<!--4b7f5274-5658-4f5a-bcba-10167ab5d89f-->[/U][/B]
<item name="package">com.htc.calendar</item>
<item name="class">com.htc.calendar.LaunchActivity</item>
<item name="screen">2</item>
<item name="x">3</item>
<item name="y">2</item>
<item name="itemtype">0</item>
</set>
At the risk of sounding like a complete noob, what is that bolded/underlined part in the snippet above?
I'm editing the default widgets/shortcuts for my latest release of ZenEXP - something I haven't done previously - and the ones I add do not work, probably because they don't include that snippet above.. so, on top of needing to know what that is, how do I find it or create it for widgets/shortcuts I want to add to the default.xml?
TIA!
Also looking to understand default "config" settings
I echo the same questions posted by .mak and have been trying to find wich of the default.xml files are used in the defaul screen layouts...
Basically I am looking to understand the file tree structure and WHERE each of the important "config" files are located, WHAT they control, and WHEN they are read by the applications... Dr. Google has not been able to provide me with much (e.g. I am searching on things like: "android /system/customize/default.xml file use"); so I was hoping someone could point me in the right direction.
I have found that the /system/customize/CID/default.xml has the settings for the setup wizard...
Thanks!
zach.xtr said:
I echo the same questions posted by .mak and have been trying to find wich of the default.xml files are used in the defaul screen layouts...
Basically I am looking to understand the file tree structure and WHERE each of the important "config" files are located, WHAT they control, and WHEN they are read by the applications... Dr. Google has not been able to provide me with much (e.g. I am searching on things like: "android /system/customize/default.xml file use"); so I was hoping someone could point me in the right direction.
I have found that the /system/customize/CID/default.xml has the settings for the setup wizard...
Thanks!
Click to expand...
Click to collapse
I've, since posting this, found that default settings for homescreen layout, browser, mms and a few other things is in /system/customize/MNS/default.xml
.mak said:
I've, since posting this, found that default settings for homescreen layout, browser, mms and a few other things is in /system/customize/MNS/default.xml
Click to expand...
Click to collapse
I have tried modifying these and it did not change the settings when I first flash... is there something more that I must do? I am using Ivans official ROM as base and have removed the rosi (sense home screen) and want to default shortcut, widgets, etc on the native Launcher app...
Thanks!
zach.xtr said:
I have tried modifying these and it did not change the settings when I first flash... is there something more that I must do? I am using Ivans official ROM as base and have removed the rosi (sense home screen) and want to default shortcut, widgets, etc on the native Launcher app...
Thanks!
Click to expand...
Click to collapse
I am having the same issue. If anyone knows private message me.
try editing the launcher module in the \customize\MNS\default.xml. you have to note though that depending on the ROM you are modifying the launcher.apk file may need to be changed. a great example to use is the JacHeroSki2.7.4. once you go to the above file you're most likely to find the file you need to make changes to.
If you want to change a native's launcher default settings , you have to modify default_workspace.xml, every launcher has it. (cfr. Launcher Pro, ADW Launcher,..)

[Q] Change default values in settings for android rom

Hi Everyone!
I'm starting to make my own android roms and i was wondering if it was possible to change the default android settings you get when you flash a rom. For example, when you first boot, animations are already turned on and orientation is turned off (unchecked) by default.
I've got an .apk manager so i've had a feeble attempt at going through .xml files in the decompiled Settings.apk. "res/xml/sound_and_display_settings.xml" had the most potential but i couldn't see any "enable/disable" options.
Thanks to Everyone in advance. Any feedback is welcome, even if it's not the answer- it could still help!
Uuuuuuuuupppppppppppp?
Bump.
Bump.
bit of a delay with replying here but if you are still interested, you can use apk manager to unpack and decode the settings app, then go into the xml directory that appears (there will be quite a few but you just want the one called xml) and edit the xml files. Settings are there for you to tweak
Even i asked same question and no reply till now...
May be there are no devs left on xda or they ignore q/a section or ignore our questions because they don't know it or maybe they don't even read it as they think we are noob and they are god of Android development...
Damn..
Sent from my GT-S7500 using xda premium
If you are building from sources, then you can overlay these files :
Code:
packages/apps/Settings/res/values/strings.xml
frameworks/base/core/res/res/values/config.xml
These contains most default settings values afaik, hope it helps.
Good luck
How would I go about creating an overlay in the source please?
Little-Boy-Lost said:
How would I go about creating an overlay in the source please?
Click to expand...
Click to collapse
Here overlay means "change the values".
Here's an example, let's say you want to disable screen rotation by default.This is a sample from cm10's framework/base/core/res/res/values/config.xml :
Code:
<!-- If this is true, key chords can be used to take a screenshot on the device. -->
<bool name="config_enableScreenshotChord">true</bool>
<!-- If true, the screen can be rotated via the accelerometer in all 4
rotations as the default behavior. -->
<bool name="config_allowAllRotations">true</bool>
<!-- If true, the direction rotation is applied to get to an application's requested
orientation is reversed. Normally, the model is that landscape is
clockwise from portrait; thus on a portrait device an app requesting
landscape will cause a clockwise rotation, and on a landscape device an
app requesting portrait will cause a counter-clockwise rotation. Setting
true here reverses that logic. -->
<bool name="config_reverseDefaultRotation">false</bool>
<!-- The number of degrees to rotate the display when the keyboard is open.
A value of -1 means no change in orientation by default. -->
<integer name="config_lidOpenRotation">-1</integer>
So you're going to change this line's value to false :
Code:
<!-- If true, the screen can be rotated via the accelerometer in all 4
rotations as the default behavior. -->
<bool name="config_allowAllRotations">true</bool>
Like this :
Code:
<!-- If true, the screen can be rotated via the accelerometer in all 4
rotations as the default behavior. -->
<bool name="config_allowAllRotations">false</bool>
Then, when you will compile the sources, rotation will be enabled in all 4 ways by default in the resulting rom.
Thank
So I create framework/base/core/res/res/values/config.xml in the device overlay folder and it will change settings during build?
I tried altering some settings by modifying the original files and it didn't seem to have any effect. Maybe I needed the overlay version instead
Is the theme changer in there to so I can change the theme to the one I want in the rom..??
---------- Post added at 01:27 PM ---------- Previous post was at 01:22 PM ----------
Androguide.fr said:
Here overlay means "change the values".
Here's an example, let's say you want to disable screen rotation by default.This is a sample from cm10's framework/base/core/res/res/values/config.xml :
Code:
<!-- If this is true, key chords can be used to take a screenshot on the device. -->
<bool name="config_enableScreenshotChord">true</bool>
<!-- If true, the screen can be rotated via the accelerometer in all 4
rotations as the default behavior. -->
<bool name="config_allowAllRotations">true</bool>
<!-- If true, the direction rotation is applied to get to an application's requested
orientation is reversed. Normally, the model is that landscape is
clockwise from portrait; thus on a portrait device an app requesting
landscape will cause a clockwise rotation, and on a landscape device an
app requesting portrait will cause a counter-clockwise rotation. Setting
true here reverses that logic. -->
<bool name="config_reverseDefaultRotation">false</bool>
<!-- The number of degrees to rotate the display when the keyboard is open.
A value of -1 means no change in orientation by default. -->
<integer name="config_lidOpenRotation">-1</integer>
So you're going to change this line's value to false :
Code:
<!-- If true, the screen can be rotated via the accelerometer in all 4
rotations as the default behavior. -->
<bool name="config_allowAllRotations">true</bool>
Like this :
Code:
<!-- If true, the screen can be rotated via the accelerometer in all 4
rotations as the default behavior. -->
<bool name="config_allowAllRotations">false</bool>
Then, when you will compile the sources, rotation will be enabled in all 4 ways by default in the resulting rom.
Click to expand...
Click to collapse
When you unzip the apk file how do you zip it back up does it need a special app to do it with..?
What is the best editor to edit the xml file or any other file in the rom...how about Notepad++..?
Can someone please answer this ASAP..?
spannernick said:
What is the best editor to edit the xml file or any other file in the rom...how about Notepad++..?
Can someone please answer this ASAP..?
Click to expand...
Click to collapse
Note pad++ is the best
~~~~~~~~~~~~~~~~~~~~~
Samsung galaxy s2
Rom: Jedi knight 6
kernel: Jedi kernel 2
~~~~~~~~~~~~~~~~~~~~~
And you thought celebrities weren't smart! =P
spannernick said:
Is the theme changer in there to so I can change the theme to the one I want in the rom..??
When you unzip the apk file how do you zip it back up does it need a special app to do it with..?
Click to expand...
Click to collapse
You can edit the build.prop file and change the default theme chooser theme value it's one of the properties toward the bottom of the build.prop file. Make sure to copy the theme chooser theme apk you want to be default in the ROM's /system/app folder. You need to use an apk decompiler such as apktool to (http://code.google.com/p/android-apktool/) decompile the apk file, then after you make the changes you want to make recompile the apk using the same program you used to decompile the apk. If it's not a system app you will need to sign it with "Zip Signer" it works with apk files to (https://www.dropbox.com/s/mldk52ba1u1o6ty/zip signer.apk). If it is a system app I would recommend looking at this guide http://forum.xda-developers.com/showpost.php?p=24986373&postcount=9. Let me know if you still have questions .
Sent from my SCH-I535 using xda premium
shimp208 said:
You can edit the build.prop file and change the default theme chooser theme value it's one of the properties toward the bottom of the build.prop file. Make sure to copy the theme chooser theme apk you want to be default in the ROM's /system/app folder. You need to use an apk decompiler such as apktool to (http://code.google.com/p/android-apktool/) decompile the apk file, then after you make the changes you want to make recompile the apk using the same program you used to decompile the apk. If it's not a system app you will need to sign it with "Zip Signer" it works with apk files to (https://www.dropbox.com/s/mldk52ba1u1o6ty/zip signer.apk). If it is a system app I would recommend looking at this guide http://forum.xda-developers.com/showpost.php?p=24986373&postcount=9. Let me know if you still have questions .
Sent from my SCH-I535 using xda premium
Click to expand...
Click to collapse
I have looked in the build.prop file and I can't see anything about changing the theme,Do I need to add the line..?
spannernick said:
I have looked in the build.prop file and I can't see anything about changing the theme,Do I need to add the line..?
Click to expand...
Click to collapse
On older versions of Cyanogenmod there used to be these lines in the build.prop:
Code:
persist.sys.themeId=Cyanbread
persist.sys.themePackageName=com.tmobile.theme.Cyanbread
Where persist.sys.themeId is the name of the theme you want to set as default, and persist.sys.themePackageName is the package name of the theme you want to set as default. You could try adding those lines to the build.prop and see what happens, if that doesn't work you could always extract the image's from the theme chooser theme you want to use and then decompile the framework-res.apk and systemui.apk and replace the images in those two apk files with the ones from the theme chooser theme you want to use, then replace the modified framework-res.apk and systemui.apk files with the default framework-res.apk and systemui.apk files in the ROM. Now when the user uses your ROM for the first time they will see the modified theme you wanted rather then the previous default theme.
Can you copy the settings from your phone,after you changed them the way you want them(on cm10)..?
BUMP....???
spannernick said:
Can you copy the settings from your phone,after you changed them the way you want them(on cm10)..?
Click to expand...
Click to collapse
I have only done this on CM7 for CM10 you can try adding these lines on CM10 on CM7 here is what I changed in the build.prop:
From:
Code:
persist.sys.themeId=Cyanbread
persist.sys.themePackageName=com.tmobile.theme.Cyanbread
To:
Code:
persist.sys.themeId=Androidian
persist.sys.themePackageName=com.tmobile.theme.Androidian
Then I made sure that the Androidian.apk file was located in the system\app folder. This should work for CM10 as long as the lines "persist.sys.themeId=" and "persist.sys.themePackageName=" are added to the build.prop.

[REQ] multi-theme-pack ThemeChooser.apk

I have been trying to find a way to make ThemeChooser.apk accept multi-theme-packs.
If I add more <THEME> tags into the Androidmanifest.xml then ThemeChooser will read eact of them and show them as seperete themes :good:
Example
Code:
<theme
pluto:themeId="gold"
pluto:styleId="@style/Gold"
pluto:name="@string/theme_name_gold"
pluto:preview="@drawable/preview_gold"
pluto:author="@string/author"
pluto:copyright="@string/copyright"
pluto:wallpaperImage="@drawable/wallpaper_gold"
pluto:styleName="@string/style_appearance_name_gold"
>
[COLOR="Gray"]<meta-data
android:name="com.tmobile.theme.redirections"
android:resource="@xml/redirections_gold"
/>[/COLOR]
</theme>
<theme
pluto:themeId="ruby"
pluto:styleId="@style/Ruby"
pluto:name="@string/theme_name_ruby"
pluto:preview="@drawable/preview_ruby"
pluto:author="@string/author"
pluto:copyright="@string/copyright"
pluto:wallpaperImage="@drawable/wallpaper_ruby"
pluto:styleName="@string/style_appearance_name_ruby"
>
[COLOR="Gray"]<meta-data
android:name="com.tmobile.theme.redirections"
android:resource="@xml/redirections_ruby"
/>[/COLOR]
</theme>
The meta-data tag is not being read or used by ThemeChooser.apk.
It will always just use redirections.xml and not redirections_gold.xml.
This video shows how it looks in ThemeChooser
If we could only get ThemeChooser.apk to use one of the pluto-statements to pick a redirection-XML (other that redirections.xml) it would be possible to combine more themes into one APK.
I see alot of cool possibilities like movie-themes, where most PNGs are the same but for eact main caractor it has different bacgkround or text-colors.
I have decompiled ThemeChooser.apk and read every line in all files.... not a clue how to fix it or make it possible.
If we all put our minds togeather this could be done. :victory:

[Guide] [Mod] How to make any gingerbread or cm7/cm9 status bar transparent

How to make any gingerbread or cm7/cm9 status bar transparent
Check my signature for all my statusbars including pre-made stock cm7/cm9 and Aosp statusbars and guides​
There's three ways to make the statusbar bar Transparent and I'll post them all
One way works with any gingerbread rom (deodex & rooted) and one with cyanogen 7
I have not tried it on ics or jelly bean but you can try (for people who stumble across this thread who are not galaxy y users)
Please dont ask for support unless you are using a custom rom on galaxy y
Any other phones please goto your own phone forum for support
You also need a launcher that is capable of transparency
Adw works but you need to disable wallpaper hack in settings
holo launcher works
any other launcher if it doesn't work look in it's settings & try & disable wallpaper hack or manage internally
Method one for non cm (Stock Deodex Rom)
You need apk tool installed - if you don't know how to use it see my guide here
http://forum.xda-developers.com/showthread.php?t=2206938
Once you have decompiled SystemUI.apk using apk tool goto res/layout Open status_bar.xml in notepad
Find the following line
Code:
<com.android.systemui.statusbar.StatusBarView android:orientation="vertical" [COLOR="Red"]android:background="#ff000000"[/COLOR] android:focusable="true" android:descendantFocusability="afterDescendants"
Notice the part highlighted in red android:background is normally a hexadecimal value or it could be a drawable value
either way change the red part to the following
Code:
<com.android.systemui.statusbar.StatusBarView android:orientation="vertical" [COLOR="Red"]android:background="@drawable/nameofpng" [/COLOR]android:focusable="true" android:descendantFocusability="afterDescendants"
Notice that android:background is now a drawable value
Change nameofpng to the name of your transparent background image (just the name - do not include the file extension .png)
place this image with the same name as the drawable value in res/drawable-ldpi
(of course other devices might be in mdpi or hdpi)
Recompile and sign apk
Put in a flashable zip and flash with system mounted
You can download and use the pngs in the attachment (for ldpi like galaxy y) or create your own
To create a transparent status bar image just take a non Transparent one and edit it in a photo application to make it Transparent (make sure image dimensions stay the same and is for your phone resolution)
Method two for cm7
Note you will need apk tool installed and notepad++ installed
Download the patcher tool by Z25 in attachment
Unzip the contents to a folder
Place your SystemUI.apk and framework-res.apk in files_to_patch
Run patcher.bat
Select status bar tweaks and enable only transparent status bar
Edit the smali file as described in the text file that pops up
Select option build and sign
Select option to create zip files
You now have a zip file called patch.zip
unzip this and take out the SystemUI.apk - we will save this for later
Now we have to either make our own transparent theme or you can download a theme from the playstore for theme chooser that already contains status bar transparency
If you are downloading a theme from the playstore skip the part "To create your own theme" and go straight to the part "final steps"
To create your own theme
Goto uot kitchen http://uot.dakra.lt/kitchen
Take cyanbread.apk from the app folder of your cm7 rom & place on pc (or any other Theme Chooser Theme you wish to make transparent)
Rename it to what you want to call theme
Upload it to kitchen (under cm7 theme in file upload)
In status bar tweaks set background transparency to around 70% Transparent and any other settings you need like carrier or footer - don't forget to generate preview once done
Make sure you have selected ldpi in statusbar tweak settings and ldpi/mdpi for theme chooser preview in file upload (other devices may vary) and in file upload change update binary to galaxy
Then goto summary section
If everything is green create the theme
If not make sure you have clicked generate preview on status bar tweaks
Kitchen will then create theme for you
Download the zip file from kitchen and unzip it
Take out your theme apk
Final Steps
Sign both your theme apk and SystemUI.apk that you saved from earlier with a platform key using zipsigner (playstore)
Put both apks in a flashable zip and flash in cwm with system mounted
(note if you are using a theme from the playstore just do this for SystemUI.apk)
Once the phone has booted goto
ADWLauncher
System Preference
Disable Wallpaper Hack (untick the box)
Your status bar is now transparent
Method three for cm9
Once you have decompiled SystemUI.apk with apktool
Goto smali/com/android/systemui/statusbar/StatusBar.smali
Find the following line
Code:
invoke-direct/range {v11 .. v16}, Landroid/view/WindowManager$LayoutParams;-><init>(IIIII)V
Above this line change
Code:
const/16 v16, 0x4
To the following
Code:
const/16 v16, -0x3
Now in notepad++ open the following
res/values/drawables.xml
Find the following line
Code:
<item type="drawable" name="status_bar_background">#ff000000</item>
Change the hex value to the hex value of the colour/transparency you want
For example
Completely transparent:
Code:
<item type="drawable" name="status_bar_background">#00FFFFFF</item>
70% transparent
Code:
<item type="drawable" name="status_bar_background">#b3000000</item>
50% transparent:
Code:
<item type="drawable" name="status_bar_background">#7f000000</item>
Recompile
Sign with a platform key using zipsigner (playstore)
Put in a flashable zip and flash in cwm with system mounted
What is the name for the png to put in drawable-ldpi?
Re: [Guide] [Mod] How to make any gingerbread or cm7 status bar transparent
remo1995 said:
What is the name for the png to put in drawable-ldpi?
Click to expand...
Click to collapse
You can rename it to ur own like
Jst open statusbar.xml in layout folder and on 2nd line u will find an attribute android;background change the file u want to add next to drawable/xx folder and put that file in ur drawable ldpi folder
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Reporting from incomplete blue theme
Status-paused
framework-working
remo1995 said:
What is the name for the png to put in drawable-ldpi?
Click to expand...
Click to collapse
Name it the name of the @drawable value
In my example it's nameofpng
Re: [Guide] [Mod] How to make any gingerbread or cm7 status bar transparent
Great guide :thumbup:
Sent from my GT-S5360 using xda app-developers app
Thank you, but when I go to recompile the file gives me error
remo1995 said:
Thank you, but when I go to recompile the file gives me error
Click to expand...
Click to collapse
what rom are you using?
decompile then recompile the apk without making any changes - if it compiles correctly you know you have edited the xml file wrong or not placed the corresponding png in the drawable folder
if it still gives errors without you making changes then either you are using apk tool wrong or the apk has other errors from the orig source
marcussmith2626 said:
what rom are you using?
decompile then recompile the apk without making any changes - if it compiles correctly you know you have edited the xml file wrong or not placed the corresponding png in the drawable folder
if it still gives errors without you making changes then either you are using apk tool wrong or the apk has other errors from the orig source
Click to expand...
Click to collapse
I use the cod rom and I'm trying to change the systemUI of marinalin85, the bar s3 style android 4.2.2
remo1995 said:
I use the cod rom and I'm trying to change the systemUI of marinalin85, the bar s3 style android 4.2.2
Click to expand...
Click to collapse
No reason why it shouldn't work - make sure you have loaded SystemUI.apk and framework-res.apk into apktool using the apktool if command
Make sure all your apk tool commands are correct I'll post a guide on it soon
marcussmith2626 said:
No reason why it shouldn't work - make sure you have loaded SystemUI.apk and framework-res.apk into apktool using the apktool if command
Make sure all your apk tool commands are correct I'll post a guide on it soon
Click to expand...
Click to collapse
to compile and decompile it does! the file does not work gives me forced closure! I made you those passages
Apk tool guide added see http://forum.xda-developers.com/showthread.php?t=2206938
remo1995 said:
to compile and decompile it does! the file does not work gives me forced closure! I made you those passages
Click to expand...
Click to collapse
Follow my apk tool guide I just posted - I can assure you if you follow all my guides correctly and Fully you will not get force closes - I have made many status bars using this method
Decompile my SystemUI.apk from my status bar thread so you can compare the line for the statusbar background in status_bar.xml with yours
If you get errors when you decompile the apk it means the apk was wrongly compiled to begin with and apk tool can't decompile it correctly - you will need to correct any errors that are in the original apk before you can recompile
how can i make launcher compatible with transparency like TW launcher?
Sent from my GT-S5360 using Tapatalk 2
iMaker said:
how can i make launcher compatible with transparency like TW launcher?
Sent from my GT-S5360 using Tapatalk 2
Click to expand...
Click to collapse
Some launchers do not support transparency
if it doesn't work and there is no option to disable wallpaper hack or manage internally in the launcher settings or something similar you will need to use a different launcher if you want transparency
even in go launcher it still wont have transparency
Sent from my GT-S5360 using Tapatalk 2
iMaker said:
even in go launcher it still wont have transparency
Sent from my GT-S5360 using Tapatalk 2
Click to expand...
Click to collapse
I don't think go launcher supports transparency
launchers that definitely do are
holo launcher
adw launcher (disable wallpaper hack in settings)
Added a zip of the full and semi transparent png images for people to use themselves with the guide
off topic question sir, how did you move the jellybean clock and date above toggle bar?
joelquerty said:
off topic question sir, how did you move the jellybean clock and date above toggle bar?
Click to expand...
Click to collapse
By placing <com.android.systemui.statusbar.policy.DigitalClock with the corresponding ids and smali files under the relative layout in status_bar_expanded.xml above the line for toggles
marcussmith2626 said:
By placing <com.android.systemui.statusbar.policy.DigitalClock with the corresponding ids and smali files under the relative layout in status_bar_expanded.xml above the line for toggles
Click to expand...
Click to collapse
can you plzz give me the link of tutorial. i searched in google and xda but i could'nt find it... thank you

[Tutorial] How to add any App/Option in Settings.apk

This Guide will help you to add any application/options to Settings.apk. Well earlier My friend @sandy7 published a guide on how to add various options in Settings. So this extended guide will provide you the necessary knowledge on how to get resources about any app which needed to be added in Settings to include it as an option.
Requirements:
Any Tool that can Decompile & Recompile with it's requirements
Notepad++
1. How to add options/apps in main/general settings :
To add an app in Settings we need some resources of the app. This resources can be found by decompiling the app which we want to add & look for those in AndroidManifest.xml
Now, to add an app we need this resources to be added:
*android:targetPackage - the unique & original package name of the app
*android:action - the On click event of an app & it finds the activity of the app
*android:targetClass - the class which is called on calling Onclick action which opens the app when it is clicked
*android:title - the entry of the app in header & also in strings.xml
*android:icon - the icon which will be displayed for the app entry
Notes: android:targetClass, android:targetPackage & android:action can be found in AndroidManifest of the app. For some apps android:targetClass is not given directly. So it should be searched to find. I will tell you how to do that. android:title & android:icon can be written as per user.
As I explained a bit about the resources I will now move onto the main guide. I will take an app from playstore named "Rom Toolbox" as example & describe the ongoing process
i. 1st we need to decompile the Rom toolbox app & find the resources in AndroidManifest.xml
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
as we can see from the picture that I marked the android:targetPackage & android:targetClass. The target package is easy to find. Sometimes target class is also given directly. If it's not given directly like this app we will find it by searching for it in the lines which starts with <activity. Now if there's more than one activity search for the activity that matches with the target package to some extent. & one more thing I should make you clear about. In some apps you will find android:targetClass will just be a one word phrase. Like if we take Serajr's SystemUI Preference as example you will see that android:targetClass is ".SystemUIPreferencesActivity". In those cases we need to add the whole android:targetPackage before targetClass. For Serajr's SystemUI preference the android:targetPackage="com.serajr.systemui.preferences". So the android:targetClass="com.serajr.systemui.preferences.SystemUIPreferencesActivity".
So here for Rom Toolbox app we find
Code:
android:targetPackage="com.jrummy.liberty.toolbox"
android:targetClass="com.jrummy.apps.rom.toolbox.RomToolboxActivity"
android:action="android.intent.action.MAIN"
android:action doesn't always needed to be found, you can always use "android.intent.action.MAIN" as the on click event
ii. Now decompile Settings.xml & go to res\xml & open settings_header.xml with notepad++. Now chose a place where you want to make the entry. If we want to add the app under advanced settings then we need to create a header 1st. We also need to create an android:title & android:icon entry for the app. So this will be the entry in settings_header
Code:
</header>
<header android:title="@string/header_category_advanced" />
<header android:icon="@drawable/ic_settings_rom" android:title="@string/rom_toolbox">
<intent android:targetPackage="com.jrummy.liberty.toolbox" android:action="android.intent.action.MAIN" android:targetClass="com.jrummy.apps.rom.toolbox.RomToolboxActivity" />
The 1st header is for the advanced settings header. We need to make an entry of the same name in strings.xml.
The 2nd header is for the app & icon. We need to write the exact entry as title in strings.xml like I wrote "rom_toolbox". You can write anything as title just make sure it matches the app itself so that you can find it easily. So the settings_header will look like this
Now save it
iii. Now go to res\values & open strings.xml. We need to create two strings here. One for the advanced settings & another for the app. We already chose the string name for header as "header_category_advanced" & "rom_toolbox" for the Rom Toolbox app. So the entries in strings.xml will be
Code:
<string name="header_category_advanced">ADVANCED SETTINGS</string>
<string name="rom_toolbox">ROM Toolbox</string>
You can write anything where I wrote "ADVANCED SETTINGS" & "ROM Toolbox" It depends on you what you would like to see in settings as header.
So the strings.xml should be like this
Now save it.
iv. Now we need to place a png for the app in drawable folder with the name "ic_settings_rom" as it is given in the header of android:icon. Depending on your settings you either should have drawable hdpi or drawable mdpi folder. On my case I have drawable hdpi folder. 1st we need to look at the resolutions of the pngs which starts with ic_settings name. Well generally for drawable hdpi it is 48x48 & for drawable mdpi it is 32x32. So we need to resize the png in any of this resolutions depending on our drawable folder. You can take the png from the original app & resize it. In my case I resized it in 48x48 & placed it in drawable-hdpi folder.
v. Now you are ready to recompile again. Then try your newly modified settings. I will post a screenshot of mine
2. How to add options/apps in sub settings for example in display settings :
Here I will take On-screen-buttons app for an example in the ongoing process. We will add it in display_settings. Now, we need an extra resource called android:key when we want to add any app in sub settings. android:key is the keystore when the app is extracted using any app tool when created by the developer. As we cannot find the original android:key of the app, we will enter a value as android:key & give it's reference in the ids.xml
i. 1st decompile the On screen button app & search for resources in AndroidManifest.xml.
So we find android:targetPackage="cn.kyle.gn.NavBar" & as only one line here starts with <activity it is really easy to find android:targetClass="cn.kyle.gn.NavBar.GnNavBarActivity". android:action="com.android.intent.MAIN" even if it is not written in the manifest.
Now we need to make android:title which can be anything,we just need to refer it into strings.xml, android:key can be anything, we need to refer it in ids.xml & another entry is optional here which is android:summary which is the sub-header of the app. I give you my example what I have written as values of those resources
Code:
android:title="navienable_title"
android:key="on_screen"
android:summary="on_screen_summary"
Now as we fixed every resource & their values we will put the entry in res\xml in display_settings.xml. The entry will look like this
Code:
<PreferenceScreen android:title="@string/navienable_title" android:key="on_screen" android:summary="@string/on_screen_summary">
<intent android:targetPackage="cn.kyle.gn.NavBar" android:action="android.intent.action.MAIN" android:targetClass="cn.kyle.gn.NavBar.GnNavBarActivity" />
</PreferenceScreen>
The display_settings will look like this
Now save it
ii. Now go to res/values & open strings.xml. We need to make two entries here. One for the android:title="@string/navienable_title" & another for the android:summary="@string/on_screen_summary". Now we make the entries
Code:
<string name="navienable_title">On-Screen-Buttons</string>
<string name="on_screen_summary">Enable/Disable On-Screen-Buttons</string>
as I said before you can write anything inside >......</string> it depends on you what text you would like to be seen
The screenshot from strings.xml
Now save it.
iii. Now go to res\values\ids.xml & open it. We need to make an entry for the entry we made in display_settings as android:key. So the entry will be with the same value
Code:
<item type="id" name="on_screen">false</item>
So the ids.xml should be like this
Save it & recompile your edited Settings.apk. Here is a screenshot of the Settings I edited
2. How to add headers in Settings/about to display Developer Name & Rom Name :
i. Decompile Settings.apk & go to res\xml & open device_info_settings.xml. Now choose a place where you want to show your Rom Name & Developer name. The entries you need here are similar with the one's that already exist in the xml. So you can copy one line of entry & press enter then paste it & you can edit it to make the new entries. We need android:title & android:summary which will be shown in strings.xml. We need android:key which you can keep same as android:title to eliminate difficulties, but we don't need an entry in ids.xml this time as it is not an app for which we are making the entry for. Last of all we need a style entry which will be the same as others. So I will write my Rom name & developer name under Kernel_version entry here. The entries will be
Code:
<Preference android:title="@string/rom_header" android:key="rom_header" android:summary="@string/rom_name" style="?android:preferenceInformationStyle" />
<Preference android:title="@string/author_header" android:key="author_header" android:summary="@string/author_name" style="?android:preferenceInformationStyle" />
The device_info_settings.xml will look like this
Now save it.
ii. Now go to res\values\strings.xml to make the entries here. We need two entries for the Rom Name, one is for "@string/rom_header" & another for "@string/rom_name". Same we need for Devloper name, one entry for "@string/author_header" & another for "@string/author_name". So the entries will be
Code:
<string name="rom_header">Rom Name</string>
<string name="rom_name">X Rom</string>
<string name="author_header">Developed By</string>
<string name="author_name">Saqib Nazm</string>
I give my Rom name as "X Rom" for example. You can type anything as you like on rom_name & author_name
The strings.xml should look like this
Now save it & recompile. Enjoy your freshly made new Settings.apk. Here is a screenshot about how it looks
.........................................................................................................................................
At the end I want to say, I will try to explain it more by adding more examples so that you can add anything. Kindly give me credits for my work If it helps you in anyway possible. Like I am gonna give credits to those respective people for whom I could share this guide to you.
Credits:
Neroyoung - for always helping me & clearing my ideas
jerrytan93 - for helping me alot whenever I need him
gagan.u20 - for always saving me if I get stuck somewhere
singh_dd93 - for giving me a clear idea on some resources
sandy7 - who doesn't know his thread from where everyone can learn
Nice one.. now everyone can start to develop their own ROM..
jerrytan93 said:
Nice one.. now everyone can start to develop their own ROM..
Click to expand...
Click to collapse
hehe thanks man & your help is highly appreciated :good:
@saqib nazm
i think u should add this also
after adding an app to settings u dont want that app to show up on launcher ..
so u can hide it by editing Androidmanifest.xml
by delete the red marked line
Code:
<activity android:label="@string/app_name" android:name=".GalleryActivity" android:taskAffinity="android.task.pictures" android:configChanges="keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
[B][COLOR="red"]<category android:name="android.intent.category.LAUNCHER" />[/COLOR][/B]
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
sandy7 said:
@saqib nazm
i think u should add this also
after adding an app to settings u dont want that app to show up on launcher ..
so u can hide it by editing Androidmanifest.xml
by delete the red marked line
Code:
<activity android:label="@string/app_name" android:name=".GalleryActivity" android:taskAffinity="android.task.pictures" android:configChanges="keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
[B][COLOR="red"]<category android:name="android.intent.category.LAUNCHER" />[/COLOR][/B]
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
Click to expand...
Click to collapse
yeah sure I wanted to,but then thought it doesn't work for every app.like it gives fc on 1st case then if applied later it works Now as you wrote it in the 1st page I think I don't need to add it OP anymore if you change the title of your post :angel:
saqib nazm said:
yeah sure I wanted to,but then thought it doesn't work for every app.like it gives fc on 1st case then if applied later it works Now as you wrote it in the 1st page I think I don't need to add it OP anymore if you change the title of your post :angel:
Click to expand...
Click to collapse
It works for every app.
Just set it for the main activity from
Code:
<activity android:label="@string/app_name" android:name=".GalleryActivity" android:taskAffinity="android.task.pictures" android:configChanges="keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
to
Code:
<activity android:label="@string/app_name" android:name=".GalleryActivity" android:taskAffinity="android.task.pictures" android:configChanges="keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
cheers,
jan+
jader13254 said:
It works for every app.
Just set it for the main activity from
cheers,
jan+
Click to expand...
Click to collapse
thanks jader :good: I didn't know that. So it's good to know that now from you
awesomeness.. people like you make people like us who are learning easy to understand things.. thanks bro..
Sent from my HTC Explorer A310e using xda app-developers app
Nice tutor m8 ! Thanx 4 ur aW£s0m€ work !!
Sent from my E15i using xda premium
how would i?
saqib nazm
Click to expand...
Click to collapse
how would i Add a another menu Below the Development menu , because i do want to Add a Credits menu
ps is it posible to add a rom control menu with the sony white balance app, navigation bar, font changer or/and a dpi changer
Envious_Data said:
how would i Add a another menu Below the Development menu , because i do want to Add a Credits menu
ps is it posible to add a rom control menu with the sony white balance app, navigation bar, font changer or/and a dpi changer
Click to expand...
Click to collapse
so you want to add a credit option in settings?& when you click on it what do you want it to do? sony white balance is not yet ported perfectly to our devices & also there is no font changer in our phone (or is it an app?) how to add dpi changer is given in other thread by sandy7.
I am trying to remove some items from settings on my Zelly Cream ROM. Now, I have deleted relevant info from settings_headers.xml and strings.xml, but, when I try to compile with apktool, it gives me an error (see attachment)
I wonder if you could help me. Thank you for your guide.
here
saqib nazm said:
so you want to add a credit option in settings?& when you click on it what do you want it to do? sony white balance is not yet ported perfectly to our devices & also there is no font changer in our phone (or is it an app?) how to add dpi changer is given in other thread by sandy7.
Click to expand...
Click to collapse
Credits > open up just like About Device menu
ROM controll > list of Things , dpi changer etc
other info > i dont mind apps that dont show up, so a dpi chaneger app that opens when clicked for example
important info > i admit i am still learning this
masteriori said:
I am trying to remove some items from settings on my Zelly Cream ROM. Now, I have deleted relevant info from settings_headers.xml and strings.xml, but, when I try to compile with apktool, it gives me an error (see attachment)
I wonder if you could help me. Thank you for your guide.
Click to expand...
Click to collapse
I think you need to update your aapt
Envious_Data said:
Credits > open up just like About Device menu
ROM controll > list of Things , dpi changer etc
other info > i dont mind apps that dont show up, so a dpi chaneger app that opens when clicked for example
important info > i admit i am still learning this
Click to expand...
Click to collapse
if you want to open a credits menu when clicking on it you need to write a whole new .xml file in the xml folder. & about the other rom control thing,you can just give your header & add the apps you want to add. Like the way is shown in the tutorial. Again if you want to open a sub menu when clicking on Rom control that will contain list of things like dpi changer you need to write a new xml file. So if you are willing to take so much let me know I will try to guide you though I haven't yet tried myself that way
saqib nazm said:
I think you need to update your aapt
Click to expand...
Click to collapse
What is an aapt? I don't have the SDK installed,using just apktool which I have been able to decompile APKs with. Also, I have been able to compile APKs using the same setup.
Thanks for your help
masteriori said:
What is an aapt? I don't have the SDK installed,using just apktool which I have been able to decompile APKs with. Also, I have been able to compile APKs using the same setup.
Thanks for your help
Click to expand...
Click to collapse
try with apk multi tool. & make sure you install the proper framework files first
example
could you give me a simplified example with coloured codes
red=changable
ps thank you
Envious_Data said:
could you give me a simplified example with coloured codes
red=changable
ps thank you
Click to expand...
Click to collapse
I will give you a conceptual idea about what I mean in some days,but I have to prepare that for you 1st.please be patient for some days as I am a bit busy with a rom update & everyday life.
Does it work to remove some items from settings??? I`m interested in it, too!
I´m a newbie so sorry for my stupid question:
What do i need exactly for using the apk multi-tool ? Which steps i have to make before i can adjust my settings ...
Thank you for help and patience with a newbie ...:good:
Hi, I want to ask about making sub menu. For example make power management menu, sub menu are battery, cpu control. How ?
Sent from my LT25i using xda premium

Categories

Resources