[Q] Changing Settings menu options - Android Q&A, Help & Troubleshooting

I'm running a Galaxy Nexus, and the ROM I'm currently on has a Perfomance option in the Settings Menu, which gives control of the kernel and stuff. However, I'd rather use TricksterMod, and I would like to be able to launch TricksterMod from Settings instead of the Performance app.
So far, I've decompiled my Settings.apk, and looked through the files, and I'm not sure what to change.
I have to change \settings\res\xml\settings_headers.xml, correct? Specifically,
Code:
header android:icon="@drawable/ic_settings_performance" android:id="@id/performance_settings" android:title="@string/performance_settings_title" android:fragment="com.android.settings.performance.PerformanceSettings" />
I would also have to change \settings\res\values\strings.xml, specifically, the string referenced by "@string/performance_settings_title" so that I can have the correct name, correct?
And similarly, settings\res\drawable, for the icon.
The big question is, what do I replace with for "com.android.settings.performance.PerformanceSettings"? Do I need to move TricksterMod somewhere specific, or what would I reference? \data\app\com.bigeyes0x0.trickstermod-1.apk?
After making all these changes, I'd simply recompile and push the Settings.apk back without signing, correct? Have I missed any steps?

Firnagzen said:
The big question is, what do I replace with for "com.android.settings.performance.PerformanceSettings"? Do I need to move TricksterMod somewhere specific, or what would I reference? \data\app\com.bigeyes0x0.trickstermod-1.apk?
Click to expand...
Click to collapse
That's what I would try BUT would just be that, to try, seems like you have everything else covered.

Hm. Well, that didn't work.
I successfully made the edits, recompiled, and pushed the file in place of the old Settings.apk.
The Settings app immediately disappeared, and trying to install it (selecting the .apk with a file manager) didn't work; it simply gave me an 'App failed to install'.
Any suggestions as to what I might have done wrongly?

Anyone?

Related

Edited HtcDialer.apk, logcat SIGNATURE error and apk won't run

Modding a 2.1 Sense UI rom (Hero Based.... but more of a hybrid)
Hey, I've edited the AndroidManifest.xml of the HtcDialer.apk, repackaged, sign and first tried to adb push it to my phone - didn't work, tried adb install - parser error, so I repackaged the entire update.zip and reflashed - still didn't work.
Logcat shows this:
Package com.android.htcdialer has no signatures that match those in shared user android.uid.shared; ignoring!
Click to expand...
Click to collapse
I tried popping into recovery and running "fix apk uid errors" but it still throws the same logcat and the dialer won't open.
How do I fix this?
EDIT: I've got this problem, facebook sync and camera/video to fix, then I'll be releasing the fastest SenseUI rom you guys have EVER seen. No joke.
OK, I'm grasping at straws here - so I've also tried, through ADB, completely uninstalling it and rm'ing any traces, then I tried to adb install it and it still won't work, I get an ADB error:
INSTALL_FAILED_UPDATE_INCOMPATIBLE
But everything should be deleted! It shouldn't matter that the old and new signatures don't match, its an entirely fresh install!
I've also noticed that when I adb pu****, I get a list of the HTC apps that share that uid.shared - and at one point they all said "uid=10011" - now they all say "uid=10010". I'm trying to fix this back to he original to see if this is part of the problem, but I can't find this anywhere in the androidmanifest.xml for any off these apps (like contacts, phone, etc).
I know HTC has this shared id stuff for all of their apps, but there must be an easy way to update JUSt an androidmanifest.xml file with a single line to give it vibrate permission. Is there any way I can resign the modified .apk AS Htc?
I have a similar problem (probably the same), does anyone know anything that might help?
Take what was edited and open the original apk with 7zip just drag the edited files in the 7zip window it will ask if you want to add the files, click yes then close out 7zip now pack it up in a update.zip and sign.......Do not sign the apk leave the original signature in there.
Flash adn that should take care of it.

Define Widgets in Custom ROMS

Hi guys,
how can i define which widgets are placed on the screen after flash with a new custom rom directly in the rom without manual work after flash ?
Greats Hawkeye
I have been wondering the same thing. I intentionally removed everything except a couple of widgets from my home screen and dug around /data to see what I could come up with.
"/data/system/appwidgets.xml" looks promising:
Code:
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<gs>
<p pkg="com.android.protips" cl="com.android.protips.ProtipWidget" />
<p pkg="com.android.settings" cl="com.android.settings.widget.SettingsAppWidgetProvider" />
<h pkg="com.android.launcher" id="400" />
<g id="5" h="0" p="1" />
<g id="6" h="0" p="0" />
</gs>
"id=5" and "id=6" may be the order of when the widgets were added to my home screen. I did this just after a wipe and restore, so these very well could have been the 5th and 6th widgets I added.
"h=0" could be my main home screen.
"p=0" and "p=1" could be the order of how the widgets are displayed. power is above protips.
Can anybody verify what I'm reading in this XML file is correct?
Could it be as simple as including this file? I'll have to give it a try in a little while. I'm about to do some remodeling in my kitchen. I'm going to install the latest nightly of ubuntu 10.10 to see if it works better with my wifi card.
Were you able to figure it out yet? I have not had any time lately to mess around with my phone at all. I'll try to see what I can do out over the weekend.
I have been wondering this since I started cooking! I have searched high and low and not found nada..
One side note: if you open your rom and look in /system/customize/cid, you can look through those xml files, and depending on your carrier/rom setup, you can set things like what footprints shows, and define the stock flashed home background, lock background, and browser favorites
Awesome info. I'll have to take a look at those files.
I added "/data/system/appwidgets.xml" to a rom and it just made my boot animatin go on forever. Maybe I did something wrong, I'm not sure. I was modifying a CM6 rom, so I altered my updater-script to copy the file to /data. I dig up my code and paste it later, but if anyone has the best way to include files in /data for update-script or updater-script, feel free to post it.
I have not been customizing any roms in awhile, did anybody successfully set the default widgets yet?
Look here:
1) /system/customize/MNS/default.xml (Sense ROMs)
2) inside Launcher.apk - res/xml/default_workspace.xml (AOSP ROMs)
Launcher2.apk seems to be setup the same. You might want to use something like APK Manager to decompile the apk, so you can edit the xml. Or, I believe you can use a hex editor although I have not tried that yet. TinyHexer is a good one for Windows.
Awesome, thanks for the info. I'll have to give it a try soon.
DieHappy said:
Awesome, thanks for the info. I'll have to give it a try soon.
Click to expand...
Click to collapse
gnarlyc said:
Look here:
1) /system/customize/MNS/default.xml (Sense ROMs)
2) inside Launcher.apk - res/xml/default_workspace.xml (AOSP ROMs)
Launcher2.apk seems to be setup the same. You might want to use something like APK Manager to decompile the apk, so you can edit the xml. Or, I believe you can use a hex editor although I have not tried that yet. TinyHexer is a good one for Windows.
Click to expand...
Click to collapse
the default.xml is not compiled by default, so you can just use notepad to edit it.
I have tried editing it but without much success.
hexskrew said:
the default.xml is not compiled by default, so you can just use notepad to edit it.
I have tried editing it but without much success.
Click to expand...
Click to collapse
Hmm. Ok. Must be that some are and some aren't. I just opened up a Launcher2.apk from Froyo AOSP, and the default_workspace.xml is compiled. And I looked at a Launcher.apk from a mostly AOSP Eclair build. It's compiled too. If you find them that aren't, it should be easier to work with.
Interested to know we can make it work?
FYI, the various data in the appwidgets.xml are as follows:
The <p/> tags are for listing which widget is using which package/class already installed... Order is important as it is referenced from the <g /> tags.
The <h/> tags lists all launcher installed, its package name and id. It seems custom launchers loaded from market have all an id of 400!
The <g/> tags are the actual widgets already added to a launcher/home screen,
it's ID is the dev ID used by apps, unique on a single device
the h= attribute is the launcher reference (0, 1, ...) from the <h/> tags above.
the p= attribute is the package ref (0, 1, ...) from the <p/> tags above.
That file is updated when an launcher/home screen app calls many Android API methods, including those:
allocateAppWidgetId() to get a new dev ID as mentioned above and link future <g> tags to an existing <h> tag.
The h tag is ALWAYS a reference to the package having called this method! No way to get a widget ID from another app for a particular launcher!
bindAppWidgetId(int appWidgetId, ComponentName provider) to link the <g> tag along with the <p> tag
Even tried ADW Launcher and its home-screen backup/restore but it fails to restore anything!? What a crap!
I personnally use 'System Tuner' which actually restores home screens, except the widgets! Is Titanium Backup able to restore home screens widget?
I've been messing around with the appwidgets.xml file manually to restore a widget... Unfortunately nothing worked.
Did anyone found more info on the subject?
Titanium Backup not restore widget......
Any news editing xml????
Merry Xmas everyone! I finally got this to work with ADW.Launcher.
After setting up my widgets, icons, and ADW settings, I copied a couple of the files from "/data/data/org.adw.launcher" into a backup dir, and used an init.d script to replace the default files. The script deletes itself to make sure it only runs on the very first boot.
I had to experiment forever to get the right sleep time. This script needs to sleep for 45 seconds minimum in order to let ADW finish before it can swap the files. If you are using this with another launcher, you might need to change the sleep time.
Code:
#!/sbin/busybox sh
# THE SCRIPT MUST WAIT A MIN OF 45 SECONDS OR ELSE IT WILL NOT WORK
sleep 45
if [ -d "/data/data/org.adw.launcher-backup/" ]; then
# RESTORE WIDGETS AND ICONS
rm "/data/data/org.adw.launcher/databases/launcher.db-wal"
cp "/data/data/org.adw.launcher-backup/databases/launcher.db-wal" "/data/data/org.adw.launcher/databases/launcher.db-wal"
# RESTORE ADW SETTINGS
rm "/data/data/org.adw.launcher/shared_prefs/launcher.preferences.almostnexus.xml"
cp "/data/data/org.adw.launcher-backup/shared_prefs/launcher.preferences.almostnexus.xml" "/data/data/org.adw.launcher/shared_prefs/launcher.preferences.almostnexus.xml"
# RESTART LAUNCHER
killall android.process.acore
# DELETE THIS SCRIPT TO MAKE SURE IT DOESN'T RUN AGAIN
rm /system/etc/init.d/98adwreset
fi
DieHappy said:
Merry Xmas everyone! I finally got this to work with ADW.Launcher.
After setting up my widgets, icons, and ADW settings, I copied a couple of the files from "/data/data/org.adw.launcher" into a backup dir, and used an init.d script to replace the default files. The script deletes itself to make sure it only runs on the very first boot.
I had to experiment forever to get the right sleep time. This script needs to sleep for 45 seconds minimum in order to let ADW finish before it can swap the files. If you are using this with another launcher, you might need to change the sleep time.
Click to expand...
Click to collapse
Great finding! I'll try to integrate that into System Tuner asap! That would be awesome to have a way to restore launchers setup. All I managed so far is to restore a launcher's icons, without widget, but with that might be able to restore the widgets too
I have not tested this out yet, but I'm pretty sure you can rename "/sdcard/adw_settings.xml" to "/data/data/org.adw.launcher-backup/launcher.preferences.almostnexus.xml" if you are using the ADW.Launcher settings backup.restore.
Likewise with renaming "/sdcard/adw_launcher.db" to "/data/data/org.adw.launcher-backup/launcher.db-wal". This file has an extension of .db-wal, but it is most likely the exact same file. I will have to test this out sometime to make sure.
I also wanted to point out that you only want to copy "launcher.preferences.almostnexus.xml" and "launcher.db-wal". Don't just delete /data/data/org.adw.launcher and replace the entire directory with your backup. If you do this it will just force close and probably delete the directory and recreate it again.
Does anyone else know what files to backup and restore from other launchers?
---------- Post added at 12:16 AM ---------- Previous post was at 12:08 AM ----------
3c said:
Great finding! I'll try to integrate that into System Tuner asap! That would be awesome to have a way to restore launchers setup. All I managed so far is to restore a launcher's icons, without widget, but with that might be able to restore the widgets too
Click to expand...
Click to collapse
If the widgets didn't come with the rom, you would have your program backup and restore the .apk files too. Fancy Widgets didn't seem to work right on a custom rom I was messing around with, I think because when ADW reset it knew where to place Fancy Widgets which had not yet run so it wasn't functional yet. Perhaps backing up this widgets /data/dir might do the trick, but I'm not sure.
ADW appears to delete and re-create the "/data/data/org.adw.launcher" dir if it exists when the program runs for the first time. This is the reason why I had to sleep for 45 seconds before replacing the files and restarting the launcher. If this is how all programs/widgets work, then using my method probably won't work on the settings for those files because they won't run automatically like the launcher does.
scripts/check_binaries: line 12: clear: command not found
scripts/check_binaries: line 12: clear: command not found
why do i get this error please help me ...
i have been searchin about all post but i did not find any answer tenkss ...
Just decompile the launcher's APK and edit the default_homescreen.XML (it will have a different filename for different launchers). Recompile and sign. Done
Sent from my GT-I9100 using xda premium

Theming Guide Help.. These are the things I dont see How-Tos for.. plus some thoughts

This guide will assume the basics (image editing, apk manager setup, adb, etc..) are understood. Minus 9png's, I will go over that. The point is to have a base here for discussion on how to edit things properly. If anyone has something to add, please do.
OK, lets start with something that caught me off guard when switching to a phone with blur... there are certain apps that have dependencies. You have to set those dependencies up. The easiest way to do this is, from whatever ROM you are running, open the zip up with 7zip. Also open up your APK Manager and go into the "other" folder. From your ROM grab framework-res.apk, blur-res.apk, moto-res.apk, settings.apk and systemUI.apk and copy them into the "other" folder. Once there, open up a command prompt. change directories until you are in the "other" folder. Once there do this for each item. apktool d framework-res.apk and hit enter. Then, apktool if framework-res.apk. Do that for the rest.
9pngs.. Everyones afraid... they are a walk in the park. 1 extra step and its done. Decompile your apk, Edit it to your liking and save it. Open it up with draw9patch and add the guides back in and save it. The right and the bottom just make a big ass black line from one side of the image to the other (most of the time). The left and top side require a little fine tuning. Basic rule is to stick a dot in "the middle". Over on the right, see if it looks right. If it doesn't, adjust it. Once done, save it. Recompile and you are done. If using apk manager 4.9 or newer, make sure you delete the images you edited in the keep folder.
Editing xmls....
You are going to be editing xmls to either change background color or text color. Heres a general rule that will help... open the xml in notepad++ and hit ctrl +f. search for android:background .... you can change whatevers there to a hex color. like, if you wanted a dark red.. #ffbc1010. if changing text colors, do a search for android:textColor. Do the same thing with searching and changing.
Some edits will be found in the values folder... this would either take place in Colors.xml, drawables.xml or styles.xml
As I have found, some xmls just dont have a call to a bacground or text color so.. you just have to make one yourself. I always stick those in right after the androidrientation stuff. For example, you want a red background and nowhere in the xml can you find a spot to change it. No worries.. add this... android:background="#ffbc1010" . Good to go.
Some apks wont decompile with apk manager 5.01. You get an out of bounds error. Use apk manager 4.9 for those.. it will open them.
If you try to install an app and something doesnt work.. 1 minor thing, even though the rest does work.. do not try to install another re-edit until you have gone back to a fully functional version. Otherwise, none of your new edits will take hold even if they are correct. (Learned that one the hard way)
Remember, trial and error siis the Android Way!!!
Lastly, I leave you with this... each app has its own "fun-ness" to it. If you are ever stuck and need help, please feel free to ask. I can't do magic.. like looking at Sense... cause I dont have it.. but if you are running GB stock, Blur or its just an app for any phone.. please ask. I will answer, even if I dont know the answer and we have to work together to figure it out.
This is my contribution to XDA. Let's keep progression moving forward. I want to see more themers and more options!!!!
EDIT:
NEW INOFRMATION
I copied this over from my how to on DF... The links are probably still good (I just updated them) but just make sure you are getting the latest version... I wrote the how-to in January.
Since I see a lot of people trying to figure out how to get into theming and such, might as well share my knowledge...
I would also like to thank Devildog8791 and say that he went thru and added a lot to this via PM (which I then pasted here). He also made it a lot more detailed and easier to follow along for everyone.
Things you will need:
-APK Manager located here. It is the one from post #226. It uses apktool version 1.3.1 instead of the newest one, 1.3.2. The new version has some bugs that have not been worked out yet.
-Android SDK located here. There are two different files for Windows: a zip file and an .exe file. I downloaded the zip file, but you can try the .exe file.
-7zip located here. Make sure you pick the right installation for your setup (32-bit or 64-bit)
-Java JDK located here. Make sure you pick the right installation for your setup (32-bit or 64-bit)
Before I begin, please keep in mind that this is just how I did it. Maybe it's perfect, maybe its wrong, BUT... it worked for me.
NOTE: PLEASE READ THIS
Unless you are going to be pushing apks to your phone or pulling them directly from the phone, you do NOT need to bother with steps 3-6 and 9-11. You also only need to add the Java stuff to your Environment Variables.
OK here is how I set all this up and in the order that I did it.
1) Install the Java JDK. You probably don't need to, but I rebooted after the installation was complete.
2) Install 7zip.
3) Extract the android SDK file and move the extracted folder to the root of the C: drive. I renamed the folder "androidsdk", but you can rename it whatever you want. On my computer, the SDK is at C:/androidsdk (whatever you name this and anything in its filepath, make sure there are NO SPACES).
4) Go into your sdk folder and run "SDK Manager".
5) When the "Android SDK and AVD Manager" screen opens up, select "Available packages". Select the packages you want to install and click on "Install Selected". If the "Choose Packages to Install" screen comes up automatically, then select "Accept All" and click "Install". This will take a few minutes. Go ahead and get a drink and stretch your legs.
6) When your packages get done downloading and installing, close the "Installing Archives" and the "Android SDK and AVD Manager" screens.
7) Extract the APK Manager zip file and move the extracted folder to your user file. Mine is located at C:\Users\Tim\apk_manager_4.9.
8) Now you need to set your environment variables. To do this, click on "Start" and then right click on "Computer". Left Click "Properties" and in the left pane you will see "Advanced system settings". Click on that and it will open up a new window called "System Properties". Click on "Environment Variables" at the bottom of the screen.
9) Now that you are in the Environment Variables screen, you want to look at the top part of the screen first. Under "User variables for <your name here>", click on "New...".
10) In the "Variable name" section, type in ADB.
11) In the "Variable Value" section, type in C:\androidsdk\platform-tools\adb.
12) Now go to the bottom part of the screen and find "Path" on the left side under "Variable".
13) Double-click that "Path" section and it will bring up the edit screen.
14) Go to the end of the "Variable value" section and add the following: ;C:\Program Files\Java\jre6\bin;C:\Program Files\Java\jdk1.6.0_23\bin;C:\androidsdk;C:\androi dsdk\platform-tools;C:\androidsdk\tools. Verify that the bin file locations for java are in the same place as indicated here. They should be the same, but check it to be safe. Also, don't forget to change the name to whatever you named your sdk folder. One last thing is to make sure you have a semi-colon in between each path as indicated.
15) Click "OK" when done and close all the windows.
16) Reboot your computer.
Now that you have your environment variables set, you should be good to go to use APK Manager. One thing that you might have to do is set up your adb drivers for your phone. I have a Droid Incredible and I went to this site to get mine set up. If you have a Motorola Droid 1 (which most on this site do), then it should set up with the proper drivers when you plug it in the computer. My wife has a Droid 1 and that is what happened for me.
So, now you have 7zip, SDK, Java and APK Manager installed, setup and ready to use. Fantasmagorical!
Great, now, what the hell do you do with it...lol
1) You decide on an apk file (let's choose phone.apk) to use. You can grab it from the stock ROM your using, pull it off your phone, whatever...
2) Now that it is on your computer, move it into the APK Manager's "place-apk-here-for-modding" folder.
3) Run the script.bat and select option 22. Then choose the apk (project) you want to work with.
4) Now select option 9 to decompile the apk.
5) Once that's done select option 11 to recompile the apk. If it asks you if it's a system app (y/n) then you are in business. If it says there is an error, it is most likely that the apk has some .9.png images without guides. If this occurs, grab the stock images and stick them in by using 7zip and choose "open archive".
6) OK, so it works fine, now what? Just choose "N" and when it's done, go to the "place-apk-here-for-modding" folder and delete the "unsignedphone.apk" file.
7) Now go back to the script and choose option 9 to decompile again.
8) Once it's decompiled, navigate to the "projects" folder and go into the phone.apk folder.
9) Make all your xml edits.
10) Now, go back to the script and choose option 11. Choose "Y" and then choose "Y" again.
11) Now, go into the "KEEP" folder and delete the resources.arsc file and also delete every single xml you edited. Then go back to the script and "press any button to continue".
12) Once that is done, you are done. Go into the "place-apk-here-for-modding" folder and you will see an unsignedphone.apk file.
13) Put it in an update.zip that you can install to your phone and then rename it to phone.apk.
14) If you are wanting to now stick your own images in, use 7zip and select "open archive" and then drag your images into the proper folders.
15) Close 7zip and select "yes" to the box that pops up.
16) Now you are ready. Move the zip file to your phone, reboot into recovery and install it.
Going to add something blur related here. AK Manager 4.9 will give you errors recompiling phone, contacts and dialer. To fix it, go into the decompiled apk and open apktool.yml with notepad++ or similar. You will see 3 lines.. -1, -3 and -2. Put them in order.. -1, -2 and -3. Good to go.
Very nice thanks for this
Sent from my DROID X2 using Tapatalk
No problem. Get out there and make some good stuff!!
Hey thanks for the guide. I have a lot of programming experience but I am fairly new to android.
With that said, you state that: "This guide will assume the basics (image editing, apk manager setup, adb, etc..) are understood."
Is there a page were this things are explained, I have the image editing down, but have no idea about the apk manager,adb,etc...
I found this and I was wondering if this is the apk manager:
http://forum.xda-developers.com/showthread.php?t=1227179
Thanks, and sorry if this sounds too noobish.
Yes, that is apk manager. I would use 4.9 though because 5.01 will give you a lot of "out of bounds" errors when decompiling. 4.9 wont. And the apps work.
There is also another thread here on XDA .. So you want to make a theme.. or something like that.
I also wrote a How-To on installing java, apk, adb and setting all of your environment variables. That is in the "Team Inversion Conversion" area on droidforums.net.
Edit: Added the how to to the original post.
Question
So i wanted to theme and started reading guides on xda and came to the conclusion that it was a lengthy process requiring knowledge of may different programs, most of which was over my head. Just recently i started digging into roms wanting to change the lockscreen background and incall backgrounds. using 7z i located the lockscreen background file at system\framework\framework-res.apk\res\drawable-hdpi\zz_moto_gradient_bg2.png I then copied the file out and opened it and using paint, changed the image to a different one and then pushed the modified file back into the zip and then flashed the rom. I was very happy to end up with this
.
My question is, not using apk manager or apktool or a command prompt or any of the methods that ive read, am i doing something wrong? Will editing roms in this method run me into problems? Or is it just a noobish approach that actually works?
afm1118... There is absolutely nothing wrong with the way you are doing things. Just make sure you don't mess with any 9pngs. if you edit those with your method, it will break the signature. The image would still work but the guides would be gone. When I first started learning to theme, I didn't understand what a guide was. So, heres my explanation... look at your keyboard... in landscape mode, the buttons are bigger than they are in normal view. guided 9s will make the images stretch perfectly to fit the required dimensions. unguided 9pngs will just take the actual image and make it bigger. Kind of like if you went into an image editor and re scaled a 40x40 pixel image to 100x100 pixels. It would still be there but it would be a little distorted.
Yeah i just stay away from the 9pngs because i dont understand them and just know not to touch. You definitely helped me understand them better tho. What i dont understand is the need to use apk manager, or what recompiling/decompiling is. Like just using 7z i modified phone.apk in the same fashion i did the lockscreen, changing the incall background. Im guessing apk manager is necessary for editing xml. I really want to understand all this.
afm1118 said:
Yeah i just stay away from the 9pngs because i dont understand them and just know not to touch. You definitely helped me understand them better tho. What i dont understand is the need to use apk manager, or what recompiling/decompiling is. Like just using 7z i modified phone.apk in the same fashion i did the lockscreen, changing the incall background. Im guessing apk manager is necessary for editing xml. I really want to understand all this.
Click to expand...
Click to collapse
I dont do .9 pngs and I still create alot of themes, dont be scared to theme cuz u cant do .9.
TheMuffStuff said:
I dont do .9 pngs and I still create alot of themes, dont be scared to theme cuz u cant do .9.
Click to expand...
Click to collapse
Im not scared of um, i just thought i would figure them out when i wanted to change one. but so far,with nitros rom and with muffstuff xkape and funkencools themes along with uot kitchen ive been very happy. The themes are great, im looking forward to whats next.
afm1118 said:
Yeah i just stay away from the 9pngs because i dont understand them and just know not to touch. You definitely helped me understand them better tho. What i dont understand is the need to use apk manager, or what recompiling/decompiling is. Like just using 7z i modified phone.apk in the same fashion i did the lockscreen, changing the incall background. Im guessing apk manager is necessary for editing xml. I really want to understand all this.
Click to expand...
Click to collapse
TheMuffStuff said:
I dont do .9 pngs and I still create alot of themes, dont be scared to theme cuz u cant do .9.
Click to expand...
Click to collapse
.9s are integral to theming....cheating them and not doing them arent an execuse
Nitsuj. Instead of bringing negativity into the thread, try being useful. This is a help section not a your doing it wrong thread. If you would like to discuss it further pm me.
Sent from my Nexus S using XDA App
Nexus S.. Ha.. Editing the build.prop har further reaches than I thought.
Anyway, yes, editing an xml requires decompiling and recompiling... or does it? Not so fast. You can use a Hex editor to edit those colors but, I have no clue. I never went that route.
I guess the easiest way to think about apks that are compiled or decompiled is like this... lets say you have a game.. Football.exe on your computer. you click it, it opens. Now, to save space, you zip it up and its now in a zip file called Football.zip. You click it, it does NOT open. The OS cant read a zip file as an executable file.
You open a compiled xml, can't read it. you open a decompiled xml.. its all right there in plain English. Why would you want to edit an xml? Many reasons. I am going to give you an example right here...
This is the decompiled progress-horizontal.xml from the framework. It controls the color of the bar when you are dwnlading an ap, adjusting the ringer or media volume, etc..
<?xml version="1.0" encoding="UTF-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@id/background">
<shape>
<corners android:radius="0.0dip" />
<gradient android:startColor="#ffdfdfdf" android:endColor="#ffdfdfdf" android:angle="270.0" android:centerY="0.75" android:centerColor="#ff000000" />
</shape>
</item>
<item android:id="@id/secondaryProgress">
<clip>
<shape>
<corners android:radius="0.0dip" />
<gradient android:startColor="#ff000000" android:endColor="#ffbf0d0d" android:angle="270.0" android:centerY="0.75" android:centerColor="#ffbf0d0d" />
</shape>
</clip>
</item>
<item android:id="@id/progress">
<clip>
<shape>
<corners android:radius="0.0dip" />
<gradient android:startColor="#ffbf0d0d" android:endColor="#ffbf0d0d" android:angle="270.0" android:centerY="0.75" android:centerColor="#ff000000" />
</shape>
</clip>
</item>
</layer-list>
Im not going to go look at a hex chart but I think this is from when I was making an orange theme the other day. You can see there are 9 hex codes for color. You can edit those and make the progress bar have a different background and color. If I remember correctly, the first 3 control the background and the other 6 control the color of the bar. Play around and experiment til you see one you like. you can also add in transparencies and such to get fading and whatnot. like #80dfdfdf instead of #ffdfdfdf.
Some xmls wont be as clear cut.. it mught say something like android:background="@drawable/status_bar_bg"
This still can be changed. You can actually add something to a folder..image, color, etc.. but you also need to make an xml for it too. (I think, never done it).
You can make it point at a different item or, you can just give it a hex color.
ok so with the lockscreen i did, i could have done it two different ways. i could have changed the xml to target a different file or what i did, modify the image file itself. its just like html or any programing, its been a while.
correct man. Deciding which way to go is key. some of those images show up all over the place. In each instance just have to decide if its better to point it something else or just change what its pointing to looks like.
When I first themed ShapeWriter(back when I hadn't even heard of a .9) I got into a whole new mess with .smali, turns out that's where the tracer color was defined. You could never edit smali without decompiling first, although for theming its rare to have to.
Once you start theming you start learning little things here and there. And usually if your theming, it's cause your trying to do what no ones done yet; so most of what your going to learn is from a LOT of trial and error.
I'm not good at writing guides or anything but anyone can feel free to ask in my thread or pm me if you have some specific questions, etc..
Sent from my DROID X2 using XDA App
Also just thought I'd add: things may seem confusing sometimes but so would basic algebra if it hadn't been etched into your brain already.
Sent from my DROID X2 using XDA App
I was wondering is someone could explain to me a little better as to how to make a flashable zip.
I wanted to change the background image of the dialer, but when I have a finished apk I dont know hot to make it flashable.
Thanks
Electroniko said:
I was wondering is someone could explain to me a little better as to how to make a flashable zip.
I wanted to change the background image of the dialer, but when I have a finished apk I dont know hot to make it flashable.
Thanks
Click to expand...
Click to collapse
Well I could get pretty indepth but if you just want one that works you could borrow mine or probably anyone else's and change it for your needs(deleting my files adding yours).
without getting into the actually scripting the basics are:
A script that tells you what files/dir go where(among other things) and the files.
Usually it will just unpack everything in the zip to the "root" of your system partition. So if you were to use my zip i would keep my dir's and just delete the actual files.
basically if you want to put a file in "/system/framework/" on your phone you would put the file in "/system/framework/" in the zip.
also a note if you use mine; it will only copy to the system partition and not sd or sd-ext. even with that it should fit your needs.
Hope that all helps

[Q] (Solved?) Change DEFAULT Homepage on Cooked Rom

Ok, got a bit of a problem here... I need to change the default homepage of the browser in a Rom I'm cooking... that means the homepage you get after a full factory reset, not that you set in the menu.... Please don't tell me how to set it in the browser menu....
A bit of background... I'm using a leaked Rom to build from. It was leaked from a Tracfone "LG-L95G" which is identical in every way to the LG-P999 aka T-Mobile G2X. Everything is working 100%. The only problem left from the "porting" is removing Tracfone as the default browser homepage.
This has turned out to be harder than I expected.
What I have done:
Browser.apk - the xml lists Google as the homepage. The word "tracfone" appears NOWHERE in the entire structure of the decompiled xml or values or even in the smali code.
SystemUI & framework-res - I've seen suggestions the homepage hides here. Can't find anything suggesting a setting to "tracfone"
flexdb - I really thought I had it kicked here. /system/etc/flex.db listed m.tracfone.com as the homepage for T-Mobile US. I changed all occurrences here to about:blank. I have also tried simply copying the flex.db from a P999 itself. Ie, removed ALL references to tracfone service and made it identical to a P999 in every way.
Ran grep -R tracfone * on the entire ROM.
Dug through tons of files by hand looking for any clue.
Unfortunately, even with all of that, do a wipe, open the browser, and you GET M.TRACFONE.COM again!
The word "tracfone" does not appear in build.prop, it does not appear in any init scripts, not even in the kernel scripts! Yet it comes back like Christine...
Does anyone have a clue where I could look next? Or failing that, even some way from an init.d script that I can overwrite the setting myself?
EDIT
Okay, I hate giving myself clues like this, but maybe this will help others (if I'm on the right track)...
Instead of doing a grep on the ROM from my PC, pre-install, I decided to actually hit up the RUNNING copy... so from adb into a Bash prompt on the phone itself, I ran a grep -r tracfone * and got the following result:
Code:
data/data/com.android.browser/databases/browser.db:Web page not availablehttp://m.tracfone.com/
data/data/com.android.browser/shared_prefs/com.android.browser_preferences.xml:<string name="homepage">http://m.tracfone.com</string>
data/data/com.lge.providers.flex/databases/flex.db:M77BRW_SETTINGDB_CURRENT_HOME_URL_Ihttp://m.tracfone.comhttp://m.tracfone.comI#
data/data/com.lge.providers.flex/databases/flex.db:=77BRW_SETTINGDB_HOME_URL_Ihttp://m.tracfone.comhttp://m.tracfone.como"
data/data/com.lge.providers.flex/databases/flex.db:=;;DATACOM_ACCOUNT_MMSC_0_Ihttp://mms.tracfone.comhttp://[email protected]
data/data/com.lge.providers.flex/databases/flex.db:;%%DATACOM_ACCOUNT_APN_0_Iwap.tracfonewap.tracfone:?
data/data/com.lge.providers.flex/databases/flex.db:M77BRW_SETTINGDB_CURRENT_HOME_URL_Ihttp://m.tracfone.comhttp://m.tracfone.comI
data/data/com.lge.providers.flex/databases/flex.db:=77BRW_SETTINGDB_HOME_URL_Ihttp://m.tracfone.comhttp://m.tracfone.como
data/data/com.lge.providers.flex/databases/flex.db:=;;DATACOM_ACCOUNT_MMSC_0_Ihttp://mms.tracfone.comhttp://mms.tracfone.com6%
data/data/com.lge.providers.flex/databases/flex.db:;%%DATACOM_ACCOUNT_APN_0_Iwap.tracfonewap.tracfone:$
Which is very odd.... considering that is NOT the content of the actual flex.db that was flashed to the phone. That leads to 1 question: Why isn't the phone respecting the flex.db? I've noticed other edits to the file (such as bookmarks) do not apply either. So it is being ignored at somepoint. FlexProvider.apk maybe? Or is something in the ROM still identifying the phone to T-Mobile as an MVNO device and they're pushing out an OTA flex update?
EDIT 2:
AHA! There's a flex.db *INSIDE* the FlexProvider.apk file! So it *IS* ignoring the one placed in /system/etc/flex/! Editing this should solve it - but I'm going to test test test to make sure.
lotherius said:
Ok, got a bit of a problem here... I need to change the default homepage of the browser in a Rom I'm cooking... that means the homepage you get after a full factory reset, not that you set in the menu.... Please don't tell me how to set it in the browser menu....
Click to expand...
Click to collapse
firstly to say interesting question!!
but I think it it not possible to change programmatically default homepage
this is a system app so will be signed by your provider let us suppose you find homepage location in code (could by result of a script parsing) by modifying source of that apk package how to solve signature problem ?!
if in .db file ...this file is created after flashing as a result of script parsing
not framework-res.apk better browser-res.apk if you have one
ruscan.calin said:
firstly to say interesting question!!
but I think it it not possible to change programmatically default homepage
this is a system app so will be signed by your provider let us suppose you find homepage location in code (could by result of a script parsing) by modifying source of that apk package how to solve signature problem ?!
if in .db file ...this file is created after flashing as a result of script parsing
not framework-res.apk better browser-res.apk if you have one
Click to expand...
Click to collapse
man use a ... editor...I can show you for fifty bucks
I was just curious about this tricky change (from your post) so thinking about Google motto don't be bad finally I have found but should recognize that I am bad at this time
here is solution
Actually, you can use an sqlite editor to change the values in the flex.db file... the problem I was having in the OP is that on an LG phone (maybe others?) the flex.db file is ignored and the one inside FlexProvider is used instead, so you have to edit both. You can add new locales the same way. No need to use a hex editor, as that would be much more difficult.
lotherius said:
Actually, you can use an sqlite editor to change the values in the flex.db file... the problem I was having in the OP is that on an LG phone (maybe others?) the flex.db file is ignored and the one inside FlexProvider is used instead, so you have to edit both. You can add new locales the same way. No need to use a hex editor, as that would be much more difficult.
Click to expand...
Click to collapse
maybe you are right regarding your phone... but also I prepare a custom rom for Alcatel ot-908 also to change default homepage was a problem for me but I did and simply works !

[Q] Change a system setting missing from the UI directly?

I have a Lenovo S939 (Android 4.2.2, rooted) and the setting to change the default notification sound is missing. Is there a good app that can be used to browse all system settings and make changes directly (something like regedit in Windows)? Or can this setting be changed in the file system by editing some preferences file? If so, how can I find it?
James Bond 007 said:
I have a Lenovo S939 (Android 4.2.2, rooted) and the setting to change the default notification sound is missing. Is there a good app that can be used to browse all system settings and make changes directly (something like regedit in Windows)? Or can this setting be changed in the file system by editing some preferences file? If so, how can I find it?
Click to expand...
Click to collapse
No settings to change that? That's crazy...I've worked on 100s of phones and have never seen that... But the build.prop found in /system typically has the "code" that points to which file to use for the default sounds.
Thanks, checked the file and found this line: ro.config.notification_sound=HeavenNearby.ogg
If changed, will this be picked up on reboot?
James Bond 007 said:
Thanks, checked the file and found this line: ro.config.notification_sound=HeavenNearby.ogg
If changed, will this be picked up on reboot?
Click to expand...
Click to collapse
Yes. Make sure to make a backup of your build.prop first and that the permissions are still 0644 before you reboot or you'll have to restore the entire phone.
I have changed it to another sound file in the same directory and rebooted, but the sound stayed the same, unfortunately.
Edit: I have "fixed" it by copying the desired sound file over the default one.

Categories

Resources