[HOW TO] Theme ALL keyboards without FCs! [A guide for beginners]

Search This thread

rompnit

Senior Member
Aug 24, 2008
3,249
20,624
Granger, IN
Theming a keyboard may be common knowledge to some of the amazing Devs here. But to a noob like me, it took some research and time to get it working without breaking the original signature (That's the trick!). I searched the forum and it doesn't look like anyone has posted a "How To" on theming a keyboard, so I thought I'd share my experience with you all.
**Some of these steps may seem elementary, but I tried to explain everything in layman's terms so even a beginner can theme a keyboard.


// Before you get started:
You must have a working environment setup. Check out QBKing77's awesome video "How to install the android-sdk" to get that going.http://xdaforums.com/showthread.php?t=1614922

Make sure you also have installed:
// This method has worked with every keyboard that I have encountered so far. I will use 'LatinIME.apk' for reference, as that is the stock ICS keyboard. //

WARNING.. DO NOT POST DISTRIBUTION LINKS TO ANY MODDED 'Swype.apk'. XDA HAS A STANDING ORDER FROM NUANCE (MAKERS OF SWYPE), THAT DOES NOT ALLOW SUCH LINKS TO BE POSTED.

1) To start make sure you have a working copy of your keyboard apk; grab it out of a ROM, download it, or use a file manager with root access (like Root Explorer) to copy it to your SD card then to your computer.
**I would suggest dropping the keyboard apk into a folder on the desktop, seperate from anything else, and making a backup of the original so that you have a spare copy.

2) Using 7zip extract the 'res\drawable-xhdpi' folder into the folder you created. This folder will contain the pngs that control some of the keys, outlined in red on this pic:
Screenshot_edit.png


Color these pngs to match using your favorite editor and save (bucket fill with Paint.Net is a breeze!)

3) Now that your pngs are themed.. Within the folder that you created containing your apk, hold down shift and right click. Select "Open Command Window Here" to fire up command prompt.

4) Next to decompile the keyboard apk with apktool (again using 'LatinIME.apk' for reference, but the apk may be of a different name; SamsungIME.apk, HTC_IME.apk, etc.).
Type this command:
Code:
apktool d LatinIME.apk
When it's done, you will see a folder with the apk name appear, within the folder you created. Click into it and you should see at minimun a 'res' folder and a 'smali' folder.

5) Navigate to 'res\values' folder. Depending on the keyboard you are working on, the xml controlling the remaining key colors will be contained in the 'colors.xml' or 'styles.xml' file. Open with Notepad++, and change the color codes as needed. Save and close.

6) Go back to the root of the folder containing your apk, and fire up command prompt (if it's not still open). Now it's time to build using this command (again using 'LatinIME.apk' for reference, but the apk may be of a different name; SamsungIME.apk, HTC_IME.apk, etc.)
Code:
apktool b LatinIME

7) When it's done building, you should have 4 folders minimum now (res, smali, build, dist) and it's time for the key to success. Navigate into the 'dist' folder and you will see the "Built" apk. Open it with 7zip, and extract the 'resources.arsc' file to your folder. Close 7zip.

8) Now it's time to pull it all together. Navigate back to the ORIGINAL keyboard apk, and open with 7zip.
Copy (you can drag and drop with 7zip) the 'resources.arsc' that you extracted from your "Built" apk, into the "ORIGINAL" apk overwriting the file. Then with 7zip still open and the apk loaded, navigate (within 7zip) into the 'res\drawable-xhdpi' folder where you should see the list of unthemed pngs. Simply drop your edited pngs into this folder. Close 7zip and you're done here!

9) Finally, take your "ORIGINAL" but themed apk, and push it back the 'system\app' folder on your phone.
Fix permissions to 'rw-r--r--' (only check everything under 'read' and Owner under 'write')
Reboot, and bask in the glory of your new themed keyboard! ;)
**Alternatively, grab my empty zip installer here: http://d-h.st/oKG to flash in recovery. You must drop your themed apk into the system\app folder of the zip and save. Also, the zip already contains the 'LatinImeDictionaryPack.apk'

:D Please hit THANKS if I helped!! And please keep this thread alive! :D
 
Last edited:

dazednconfused

Inactive Recognized Developer
Jan 21, 2011
7,089
22,313
Charleston, WV
twitter.com
Nice,

Now, we need a simple guide on how to theme Jelly Bean...all of it :mad::mad:... :eek::eek::eek:(tapping foot patiently)

Thanks!

:D:D:D

Themed the same just new xml and some new images. I got everything to decompile and recompile, just some of the xml's have changed.

---------- Post added at 09:41 PM ---------- Previous post was at 09:39 PM ----------

Thanks rompnit. I can there a whole Rom but always have issues with the keyboard. I'll try this tomorrow night.
 

shehroze3

Senior Member
Oct 18, 2011
594
232
Katy
Sorry i'm a nub but does the apktool jar file have to be in the same folder as android-sdk?
 

rompnit

Senior Member
Aug 24, 2008
3,249
20,624
Granger, IN
Sorry i'm a nub but does the apktool jar file have to be in the same folder as android-sdk?
I actually created a folder 'C:\apktool' where I dropped everything, then added that folder to the Path system variable; same method as you would add the SDK. Otherwise, drop it into the 'platform-tools' folder within the android-sdk. When configured properly, you should be able to open command prompt in any directory, simply type 'apktool' and see a list of commands.
 

shehroze3

Senior Member
Oct 18, 2011
594
232
Katy
I actually created a folder 'C:\apktool' where I dropped everything, then added that folder to the Path system variable; same method as you would add the SDK. Otherwise, drop it into the 'platform-tools' folder within the android-sdk. When configured properly, you should be able to open command prompt in any directory, simply type 'apktool' and see a list of commands.

ok i did what u said and put the apktool jar file into the platform-tool folder, but when i type apktool in cmd prompt nothing happens.
 

Naddict

Senior Member
Nov 23, 2011
8,510
13,862
28.2S, 92.1W
time for dazed and rompnit to collaborate. maybe a simple guide for us wannabees...:p

recompiling never works for me, I read somewhere about empty folders being my problem...oh well, I can use 7zip though! and notepad+...:D:D
 

shehroze3

Senior Member
Oct 18, 2011
594
232
Katy
ok i got it to work. All i had to do was rename apktool_1.5.0 to apktool. I'm a noob, i know, try not to laugh to hard lmao
 

taihard

Senior Member
Jul 28, 2010
268
58
Does this method work for both Odex and De-Odex ROMs??? I am currently on an Odex rom. Thanks!!
 

rompnit

Senior Member
Aug 24, 2008
3,249
20,624
Granger, IN
Does this method work for both Odex and De-Odex ROMs??? I am currently on an Odex rom. Thanks!!
This method will not work on .odex keyboard apk's, at least to my knowledge but I've always run deodexed ROMS. However, check to see if the keyboard apk you are working with even contains an odex file; a lot of them do not. If it does, you could always grab the apk off the web, mod it, and install it after removing the original files.
 

calebsb

Senior Member
Dec 10, 2012
2,293
3,686
spokompton
Hey Rompnit. Ok, I was having trouble getting apktool to run on my computer. That's what I was talking about on morphology :p anyway, so I was trying to learn how to theme an app and somehow was lead to morphology and got all caught up over there. Lol. But ya, I'm gonna have to crap clean my laptop to use this. Thanks. See ya over there

Sent from my Insanely Morphed S3 LI3 ktoonsez747 (196-2106) TW FreeGs3 2.0.0
 

gruesomewolf

Senior Member
Jan 30, 2011
4,428
8,515
Mocksville, NC
This method will not work on .odex keyboard apk's, at least to my knowledge but I've always run deodexed ROMS. However, check to see if the keyboard apk you are working with even contains an odex file; a lot of them do not. If it does, you could always grab the apk off the web, mod it, and install it after removing the original files.

This method WILL in fact work on odexed keyboards. Theming for an odex base is no different then a de-odexed base. You are not making any smali adjustments here so nothing that concerns the odex, thus it will not be affected.

Sent from my SPH-L710 using xda app-developers app
 

sazonotl5

New member
Jul 29, 2012
4
0
Hey do you know if this process will work with keyboards from the market like SwiftKey 3? The themeson there are so boring need new colors lol
 

Top Liked Posts

  • There are no posts matching your filters.
  • 54
    Theming a keyboard may be common knowledge to some of the amazing Devs here. But to a noob like me, it took some research and time to get it working without breaking the original signature (That's the trick!). I searched the forum and it doesn't look like anyone has posted a "How To" on theming a keyboard, so I thought I'd share my experience with you all.
    **Some of these steps may seem elementary, but I tried to explain everything in layman's terms so even a beginner can theme a keyboard.


    // Before you get started:
    You must have a working environment setup. Check out QBKing77's awesome video "How to install the android-sdk" to get that going.http://xdaforums.com/showthread.php?t=1614922

    Make sure you also have installed:
    // This method has worked with every keyboard that I have encountered so far. I will use 'LatinIME.apk' for reference, as that is the stock ICS keyboard. //

    WARNING.. DO NOT POST DISTRIBUTION LINKS TO ANY MODDED 'Swype.apk'. XDA HAS A STANDING ORDER FROM NUANCE (MAKERS OF SWYPE), THAT DOES NOT ALLOW SUCH LINKS TO BE POSTED.

    1) To start make sure you have a working copy of your keyboard apk; grab it out of a ROM, download it, or use a file manager with root access (like Root Explorer) to copy it to your SD card then to your computer.
    **I would suggest dropping the keyboard apk into a folder on the desktop, seperate from anything else, and making a backup of the original so that you have a spare copy.

    2) Using 7zip extract the 'res\drawable-xhdpi' folder into the folder you created. This folder will contain the pngs that control some of the keys, outlined in red on this pic:
    Screenshot_edit.png


    Color these pngs to match using your favorite editor and save (bucket fill with Paint.Net is a breeze!)

    3) Now that your pngs are themed.. Within the folder that you created containing your apk, hold down shift and right click. Select "Open Command Window Here" to fire up command prompt.

    4) Next to decompile the keyboard apk with apktool (again using 'LatinIME.apk' for reference, but the apk may be of a different name; SamsungIME.apk, HTC_IME.apk, etc.).
    Type this command:
    Code:
    apktool d LatinIME.apk
    When it's done, you will see a folder with the apk name appear, within the folder you created. Click into it and you should see at minimun a 'res' folder and a 'smali' folder.

    5) Navigate to 'res\values' folder. Depending on the keyboard you are working on, the xml controlling the remaining key colors will be contained in the 'colors.xml' or 'styles.xml' file. Open with Notepad++, and change the color codes as needed. Save and close.

    6) Go back to the root of the folder containing your apk, and fire up command prompt (if it's not still open). Now it's time to build using this command (again using 'LatinIME.apk' for reference, but the apk may be of a different name; SamsungIME.apk, HTC_IME.apk, etc.)
    Code:
    apktool b LatinIME

    7) When it's done building, you should have 4 folders minimum now (res, smali, build, dist) and it's time for the key to success. Navigate into the 'dist' folder and you will see the "Built" apk. Open it with 7zip, and extract the 'resources.arsc' file to your folder. Close 7zip.

    8) Now it's time to pull it all together. Navigate back to the ORIGINAL keyboard apk, and open with 7zip.
    Copy (you can drag and drop with 7zip) the 'resources.arsc' that you extracted from your "Built" apk, into the "ORIGINAL" apk overwriting the file. Then with 7zip still open and the apk loaded, navigate (within 7zip) into the 'res\drawable-xhdpi' folder where you should see the list of unthemed pngs. Simply drop your edited pngs into this folder. Close 7zip and you're done here!

    9) Finally, take your "ORIGINAL" but themed apk, and push it back the 'system\app' folder on your phone.
    Fix permissions to 'rw-r--r--' (only check everything under 'read' and Owner under 'write')
    Reboot, and bask in the glory of your new themed keyboard! ;)
    **Alternatively, grab my empty zip installer here: http://d-h.st/oKG to flash in recovery. You must drop your themed apk into the system\app folder of the zip and save. Also, the zip already contains the 'LatinImeDictionaryPack.apk'

    :D Please hit THANKS if I helped!! And please keep this thread alive! :D
    3
    I can't even recompile just after editing images... I give up on the Google keyboard. The note 2 keyboard is light years better....

    Thebe@r'$ G@L@XY

    Don't decompile/recompile. Its my understanding that its not neccasary unless your editing xml's. Use 7 zip to pull the images, edit them then put them back into the signed, original apk also with 7zip. If somehow you loose the Sig. You can use a lot of different things to sign them. I used signapktic from the play store. Awesome app.

    Sent from a Shaftamle Galaxy S4
    "Thanks Button" is always appreciated!
    http://mycolorscreen.com/Shaftamle/
    3
    Two questions. 1) Do the apk files need to be signed to be installed as system/user app. Does it need to be signed when used in the flash able zip? 2) How to change the color of the gesture trail? Thanks

    Sent from a Shaftamle Galaxy S4
    "Thanks Button" is always appreciated!
    http://mycolorscreen.com/Shaftamle/

    1) No because you are actually moving files into the original apk w/o breaking the sig
    2) What keyboard? It varies.. ;)

    Sent from my SPH-L710 using xda app-developers app
    3
    I wish I could tell you but I ran into the same issues. I only modded the keyboards res-xhdpi images. No XML edit as of yet. I will keep you posted if I figure something else out.

    Sent from a Shaftamle Galaxy S4
    "Thanks Button" is always appreciated!
    http://mycolorscreen.com/Shaftamle/
    3
    I think the program is called xUltimate. Search xda for it, because I don't have a link handy. That's what I use to edit the .9png. You can decompile the keyboard and pull the decompiled images to the xUltimate program. Make your changes and it will compile them if there are no errors. Then you can move the compiled .9png back into the original apk. Hopefully that helps a little.

    Sent from my Wicked SGS3.

    That is exactly what I use. I could not locate the link either. But thanks for posting the name. I just could not remember it for the life of me.:thumbup:

    Sent from a Shaftamle Galaxy S4
    "Thanks Button" is always appreciated!
    http://mycolorscreen.com/Shaftamle/