[Guide] Hacks and mods: Three tutorials for modifying your x10 OS aesthetically

gavriel18

Senior Member
Nov 26, 2007
453
3
0
Ottawa
Updated: July 24/2010 Go to the X10 Theme repo for a listing of uploaded themes.

Thanks to everyone that is helping out and contributing. I also apologize if I rip anything off. If I do please post it and I will definitely correct it.

The usual disclaimer goes with this... Use at your own risk and backup your system before making any changes. You know what to do if you run into problems :)

I think this is important...

Links for various stuff:
framework-res.apk
/system/app/ folder
startup show (boot animation)
Mms.apk
Phonebook.apk

apps2sd-work in progress?
http://forum.xda-developers.com/showthread.php?p=7037044#post7037044


Many visual aspects of the os and system apps can be changed and surprisingly easily. By default when opening an apk you should look around the res-drawable folders for the pngs to edit. If you have noticed, there are some png's that look like xxx.9.png. To modify these files easily, remove the 9 from the filename and open with your preferred editor. When you are done editing the files save them, open the command prompt and type draw9patch. This should open a window with an arrow in it. Drag your file there and I'm pretty sure it goes into the same folder. That's it.


If you are using a mac use betterzip and take a look here.
You can also use root explorer (I havent tried this myself)

Step 1:
Connect phone to pc, enable usb debugging and open adb. Type:
adb pull /system/framework/framework-res.apk framework-res.apk
That will pull your framework-res.apk to whatever folder is displaying in your command line.
Step 2:
Find the framework-res.apk on your hard drive, right click and open with 7zip.
Step 3:
Use png's here or create your own and dump into the appropriate folder within framework-res.apk.
Step 4:
When you are done editing the files open up adb and type the following command:
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
adb push framework-res.apk /sdcard/framework-res.apk
adb shell dd if=/sdcard/framework-res.apk of=/system/framework/framework-res.apk

That will put the new framework-res.apk on your phone. It should automatically reboot (if not reboot it) and your changes should be applied!
When running the script above you can replace framework-res.apk with whatever you want. For example, Timescape.apk
Remember, it is CASE sensitive I made this problem many times)

If you would like to pull an entire folder put a slash at the end of the last word. For example, adb pull /system/etc /etc"/" (no " in actual script :p)

Courtesy of corruptfate is the steps to modify the startupshow (post #207)

step 1: open adb shell
step 2: type "adb shell"
step 3: type "su"
step 4: type "mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system"
step 5: type "mkdir system/etc/semc/startupshow"
step 6: exit and redo step 1 - 4
step 7: type "mkdir system/etc/semc/startupshow/default"
step 8: exit and open command prompt again, this time type "ddms"
step 9: look for the default folder in system > etc > semc > startupshow > default
step 10: push the images into that folder


Possible reasons your phone won't boot after modifications:
images anren't stored properly, right format, right size etc.
unpacked apk improperly, use 7zip, it doesn't mess anything up
you signed the package before pushing it- unless you know what you're doing follow the directions to a tee and you should be fine
pushed the package to the wrong directory, /system/framework-res.apk XX, /system/framework/framework-res.apk
I'm sure many other reasons, these were the only ones I encountered

How to get past boot screen:
Use backup framework-res.apk and push that one to your phone. Remember to place that one where the modified one is.

To see if adb sees your phone type adb devices, if a serial number pops up try pushing your original, if not...
Flash your phone again from scratch :( . Sorry, I don't know any better way yet.

Please post your themes and download themes from the X10 theme repo
 
Last edited:
  • Like
Reactions: KingCifer

gavriel18

Senior Member
Nov 26, 2007
453
3
0
Ottawa
The basics:

http://forum.xda-developers.com/showthread.php?t=502010
http://developer.android.com/index.html
http://developer.android.com/guide/developing/device.html

Some Links:

Notification background color
Status bar clock color
Notification font color
Notification bar shortcuts
Edit 9.png's
Install mobile defense as system app through terminal (I haven't tried this yet)
Resigning apps
http://forum.xda-developers.com/showthread.php?t=549109
http://androidforums.com/developer-101/8665-how-signing-roms.html This is the one I have been using. I just noticed its for roms :eek:
http://code.google.com/p/android-apktool/ Figured it out but no need for it as of yet

How to modify notification background colors

Some of the files; not sure which is the top band displaying carrier(semc_avctivity_title.9.png??):
statusbar_background.png
status_bar_background.png
status_bar_close_on.9.png
status_bar_header_background.9.png
status_bar_item_background_normal.9.png

They should be in res/drawable-240dpi. Once you find them open them and modify as you wish. Once completed save your changes.

Getting FLAC working, I was wrong, mixed up file folders. Apparently meridian pioneer works. Havent gotten a chance to test for sure yet. I am now trying to manually add flac support to mediascape
 
Last edited:

gavriel18

Senior Member
Nov 26, 2007
453
3
0
Ottawa
Second tutorial: Busting open apks so you can edit xml's!!

So has anyone tried opening up an xml file on their phone to edit only to find incoherent coding. Well I have. So I have stumbled upon a tool called apktool. The tool somehow breaks down the apk into readable xml files. I haven't gotten so far as to test out an edited xml because I wanted to post this so I don't forget how to do it.

1. follow instructions on installing apktool. Unzip the files into your android-sdk-windows/tools folder
2. Put a copy of your framework-res.apk into the same tools folder
3. from command type: java -jar apktool.jar if framework-res.apk
4. Put whatever apk you want to edit into tools folder and type this: java -jar apktool.jar d xxx.apk
5. Look in your tools folder and voila there will be a folder named with whatever apk you worked with.

Third tutorial: Use smali/baksmali to edit services.jar and services.odex

1. follow instructions on downloading and installing smali/baksmali
2. pull these files from your phone and place them into the same folder as smali (should be android-sdk-windows\tools):
code.odex
ext.odex
framework.odex
android.policy.odex
There may be other ones needed that Im missing so if you find this out please let me know

3. place the odex you want to modify into the same folder (android-sdk-windows\tools)
4. from the command line type java -jar baksmali-1.2.3.jar -x services.odex
your pc will work a little bit and when its finished will just show your directory again.
5. minimize that screen and go into the folder you put everything in there should be an out folder. Open it up and all the files to edit will be there!

I haven't recompiled yet but when I do Ill finish this tutorial.


COMMON PROBLEMS:

These are some problems I ran into because I am a noob. I figure it may help a couple people out :)
1.unable to access apktool.jar/baksmali-1.2.3.jar
Im pretty sure you are in the wrong directory
from the command line type: cd C:\whatever\directory\leadsto\android-sdk-windows\tools\the.jarfileyouaretryingtoaccess

2....
 
Last edited:

gavriel18

Senior Member
Nov 26, 2007
453
3
0
Ottawa
Modification requests:

Custom boot screens-- find your startupshow folder=== SOLVED
custom response to invalid password ;)
Ad hoc support
Disable slide lock
App drawer categorization=== THERE'S AN APP
map hardkeys
 
Last edited:

gavriel18

Senior Member
Nov 26, 2007
453
3
0
Ottawa
I was able to replace framework-res while the phone was running, but now the phone wont boot.. good thing I made a backup of the original one :p
Thats where I'm stuck too. Did you resign the package after modifying it? Im going to try that in a bit.

Does anyone know of a good n00b guide to emulating our phone in eclipse?

@microkiwi can you post how it went?
 
Last edited:

mikrokiwi

Senior Member
Mar 22, 2010
65
28
48
I did make some new icons in PS, but unfortunately I wasn't able to boot the phone after pushing my new files to it :(
I also tried to sign it with the autosign (testsign.java) application but no luck...
 

gavriel18

Senior Member
Nov 26, 2007
453
3
0
Ottawa
I did make some new icons in PS, but unfortunately I wasn't able to boot the phone after pushing my new files to it :(
I also tried to sign it with the autosign (testsign.java) application but no luck...
Cool thanks, hey have you seen an app called metamorph? I just noticed it right now but it seems like stericson automated and simplified the process. Heres a link

http://forum.xda-developers.com/showthread.php?t=591329
 

mikrokiwi

Senior Member
Mar 22, 2010
65
28
48
Yes, I have made a metamorph theme now and everything seems fine, the theme shows up and I can apply it and everything.
But after reboot the phone is still using the old icons :(
 

pietropizzi

Senior Member
Aug 3, 2008
283
62
0
Vienna
Yes, I have made a metamorph theme now and everything seems fine, the theme shows up and I can apply it and everything.
But after reboot the phone is still using the old icons :(
Could you please upload the theme, I'd like to learn how theming works. In the AndroidThemes thread I found only themes for custom roms. THX !
 

troyjamz

Senior Member
Oct 7, 2009
273
19
0
Stockholm
Yes, I have made a metamorph theme now and everything seems fine, the theme shows up and I can apply it and everything.
But after reboot the phone is still using the old icons :(
Could you please post the .png files from the framework pull? I would like to change the colors and then try to replace them with files in a theme that I found that might work with our phone. The only issue is the resolution of the theme that I had in mind. If this works then we can all make custom themes for our X10 using that theme as a template. Not sure if it will work, but I would like to try. :D
 

mikrokiwi

Senior Member
Mar 22, 2010
65
28
48
Could you please upload the theme, I'd like to learn how theming works. In the AndroidThemes thread I found only themes for custom roms. THX !
Unfortunately it does not work at the moment, but when I get it to work I will upload it for everyone to use ;)

Could you please post the .png files from the framework pull? I would like to change the colors and then try to replace them with files in a theme that I found that might work with our phone. The only issue is the resolution of the theme that I had in mind. If this works then we can all make custom themes for our X10 using that theme as a template. Not sure if it will work, but I would like to try. :D
http://www.mediafire.com/file/kkmhmnyhgyw/framework-res.apk open it with 7zip :)
 

gavriel18

Senior Member
Nov 26, 2007
453
3
0
Ottawa
@microkiwi Thanks for the upload, do you mind if I post that link in the first post?

@brut.all Does it work the same way as autosign? I followed the instructions properly on installing it but when I try to open it a command line pops up for a second (too fast for me to read) and then closes. Am I missing something?

Also do you know if framework-res.apk needs special signing? I'm just trying to figure out why the phone gets stuck at boot after pushing the modified apk.

@pietropizzi I have made one as well it doesn't work but I'll upload it right away. Check out the metamorph thread for some tutorials on theming. It is surprisingly easy.
 

gavriel18

Senior Member
Nov 26, 2007
453
3
0
Ottawa
Cool ,I'm going to try it tonight. Mind if I add it to the list at the top?

BTW did anyone know mediascape supports wav audio :D Swwweeeeeetttt
 
Last edited: