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.
Many people asks for how to move apps to SD. I tested it on my ICS MIUI ROM. so thought to share here.....
Its too simple, just need to change one word to enable it
Requirement :-
1. Apktool
2. Settings.apk
Click to expand...
Click to collapse
Steps:-
1. Decompile settings.apk
2. Go to res>values>bools.xml
Search for below line :
Code:
<bool name="disable_move_to_sd">true</bool>
Change it to :
Code:
<bool name="disable_move_to_sd">false</bool>
3. Now compile settings.apk
Click to expand...
Click to collapse
I'm trying to reduce the statusbar height to 0 pixels, hence hiding it without loosing the notification features.
I am using CM 10.1 nightly ROM.
Up to now I have done this:
1) decompiled framework-res.apk with apktool
2) opened with Notepad \res\values\dimens.xml
3) modified these values to 0
<dimen name="status_bar_height">0.0dip</dimen>
<dimen name="navigation_bar_height">0.0dip</dimen>
<dimen name="navigation_bar_height_landscape">0.0dip</dimen>
<dimen name="navigation_bar_width">0.0dip</dimen>4) build the new framework-res.apk with apktool
5) copied the new file over the old one
6) rebooted... rebooted... rebooted...
As you might understend, after the mod my phone got stuck rebooting.
Could anyone point me to the correct way of modding framework-res.apk?
Thanks!
Giocarro said:
I'm trying to reduce the statusbar height to 0 pixels, hence hiding it without loosing the notification features.
I am using CM 10.1 nightly ROM.
Up to now I have done this:
1) decompiled framework-res.apk with apktool
2) opened with Notepad \res\values\dimens.xml
3) modified these values to 0
<dimen name="status_bar_height">0.0dip</dimen>
<dimen name="navigation_bar_height">0.0dip</dimen>
<dimen name="navigation_bar_height_landscape">0.0dip</dimen>
<dimen name="navigation_bar_width">0.0dip</dimen>4) build the new framework-res.apk with apktool
5) copied the new file over the old one
6) rebooted... rebooted... rebooted...
As you might understend, after the mod my phone got stuck rebooting.
Could anyone point me to the correct way of modding framework-res.apk?
Thanks!
Click to expand...
Click to collapse
i dont think this would work as the text and content containers would be looking for a workspace which wasnt there. are you looking to loose the statusbar completely and only have the pulldouwn notifications or are you just looking to simply make it trasnparent?
I am looking for a way to hide the statusbar because I want it replaced by LMT Launcher.
Now I just got the problem solved following this advice.
Thanks!
Giocarro said:
I am looking for a way to hide the statusbar because I want it replaced by LMT Launcher.
Now I just got the problem solved following this advice.
Thanks!
Click to expand...
Click to collapse
No worries, just for note in the future, you can hide the Status bar by adding a simple code to the android manifest for the systemui
(this means if you ever want it back its just 1 line to delete rather than messing with dimens)
Could you please elaborate your suggestion? Sounds definitely better than mine!
Giocarro said:
Could you please elaborate your suggestion? Sounds definitely better than mine!
Click to expand...
Click to collapse
Of course, decompile the systemui.apk form your rom open up the android manifest and add something similar to the below line under activities in the android manifest. it will automatically hide the statusbar.
If you want the statusar back again just remove this line
<activity android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"/>
Here is a little tutorial on how to get smaller onscreen navigation buttons... i was formely using On Screen Button Enabler App by Soheil_rf but tha buttons re too big for my liking so i explore here on xda & get solution.
Tools Needed:-
- Framework-res.apk from yur ROM
- Notepad++
- Apktool but yhu can also use ApkManager
Steps:::::::::::::::::::::::::::::
1. Copy yur framework-res.apk to Apktool folder
2. Install yur framework-res.apk for de/recompiling....
Code:
apktool if framework-res.apk
3. Decompile tha apk
4. Goto folder framework-res/res/values, Open bools.xml with Notepad++ & edit den save; change from false to true
Code:
<bool name="config_showNavigationBar">true</bool>
5. Goto folder framework-res/res/values, Open dimens.xml with Notepad++ & edit den save; i change tha Height & Width values
Code:
<dimen name="navigation_bar_height">35.0dip</dimen>
<dimen name="navigation_bar_width">32.0dip</dimen>
6. Recompile tha edited decompiled framework-res.apk
7. Voila & Flash.......:highfive::highfive::highfive:
Update:::::::::::
VRTheme mod added... just flash & enjoy, no need for editing!!! it should work for all Xperia P CM9/STOCK ROMs.
- On Screen Button (OSB)
- Auto-Rotation for Lockscreen
- Navigation bar pngs for SystemUI incase its not present in yur SystemUI....
Optional;
* check yur SystemUI.apk for tha files in Nav_bar.zip, if present den yhu dnt need it but if not copy all tha pngs to your SystemUI.apk [res/drawable-hdpi folder]
* i attach a flashable zip for yhu guys...... hope yhu guys dnt mind!:silly:
Hope tha tutorial is helpful......
Thanks:-
Evilsto
Abhinav2
XDA
Me
How to Enable Lockscreen Rotation
Additional.....
Steps:::::::::::::::::::::::::::::
1. Copy yur framework-res.apk to Apktool folder
2. Install yur framework-res.apk for de/recompiling....
Code:
apktool if framework-res.apk
3. Decompile tha apk
4. Goto folder framework-res/res/values, Open bools.xml with Notepad++ & edit den save; change from false to true
Code:
<bool name="config_enableLockScreenRotation">true</bool>
change from true to false
Code:
<bool name="lockscreen_isPortrait">false</bool>
5. Recompile tha edited decompiled framework-res.apk
6. Voila & Flash.......:highfive::highfive::highfive:
Thanks:-
Sandy
Me
thank you very much
Mtakween said:
thank you very much
Click to expand...
Click to collapse
thanks a ton buddy.........
Good work man :good:
Keep going
Best Regards,
AJ
alokbina is now Abhinav2
Abhinav2 said:
Good work man :good:
Keep going
Best Regards,
AJ
alokbina is now Abhinav2
Click to expand...
Click to collapse
thanks for helping & posting motivational comments!
Godbless...:highfive::good:
Just a correction....Well you included the bools.xml and dimens.xml within the vrTheme but not all roms will have same bools.xml and dimens.xml which may conflict with their framework...so just leave the vrTheme empty with the correct file structure and tell them how to add bools.xml and dimens.xml in it
Best Regards,
AJ
Abhinav2 said:
Just a correction....Well you included the bools.xml and dimens.xml within the vrTheme but not all roms will have same bools.xml and dimens.xml which may conflict with their framework...so just leave the vrTheme empty with the correct file structure and tell them how to add bools.xml and dimens.xml in it
Best Regards,
AJ
Click to expand...
Click to collapse
Okies brov..... but i guess it will work on all CM9 roms for Xperia P!
Nice work brov!!
But many devs already know this(me)!
Anyways Good for freshers......
Sent from my Xperia P using XDA-premium
sadiq23 said:
Nice work brov!!
But many devs already know this(me)!
Anyways Good for freshers......
Sent from my Xperia P using XDA-premium
Click to expand...
Click to collapse
i know but just for new members brov......
Would you mind doing The same for XU?
Strike_Riku said:
Would you mind doing The same for XU?
Click to expand...
Click to collapse
post yur framework file den i ll make it brov..... if yhu can get framework-res.apk from stock & cm9!!!
thanks!
Decompile framework-res.apk and open res/values/bools.xml
Change the value of
Code:
<bool name="config_showNavigationBar">false</bool>
to true.
Recompile framework-res.apk
Decompile SystemUI_ZTE.apk. Copy all the images (attached) to the res/drawable-xxxhdpi-v4 folder. Say yes to overwrite.
Recompile SystemUI_ZTE.
Is there anyway someone can make this flash able.
victorythagr8 said:
Is there anyway someone can make this flash able.
Click to expand...
Click to collapse
Not possible because the framework-res and SystemUI apks are different for each ROM and build.