[MOD] Add top number row to Swype

Search This thread

ozkaya

Senior Member
Mar 22, 2006
637
299
Hello guys,

Since I use a Samsung device, I'm used to the extra number row on top of the keyboard so I modded Swype to have that extra row. However since Swype is to be purchased and not distributed, I'll only tell here how to do it for your legally purchased copy. And this is a bit complicated and for advanced users and you need to be rooted. You also need Root Explorer. Here we go:

1- First buy/download Swype from Google Play.
2- Go to /mnt/asec/com.nuance.swype.dtc-1 folder, copy pkg.apk to your sdcard, rename it to com.nuance.swype.dtc-1.apk.(keep a backup of this file at all times)
3- Go to /mnt/asec/com.nuance.swype.dtc-1/lib folder copy the files (libnmsp_speex.so and libswypecore.so) to your sdcard.
4- Using apktool (I used version 1.52) decompile com.nuance.swype.dtc-1.apk.,
5- Go to decompiled folder\res\xml folder. kbd file pertaining to your language is to be edited, I edit kbd_qwerty.xml for English using Notepad++.
6- Check the attached kbd_qwerty.xml in portrait folder and notice the extra row section I added to the top. You can in fact add secondary characters to numbers or customize the keyboard completely, rearrange letters, add symbols etc.
7- Once done, save the file and go to decompiled folder\res\xml-land folder and edit the landscape for the layout, kbd_qwerty.xml file, notice the attached file in landscape folder.
8- Once done, save the file and go to decompiled folder\res\values folder and edit the dimens.xml file. Here I raise the height of the keyboard and height of the key to 270dip and 54dip respectively, check the top rows of the attached dimens.xml. Also increase the keyboard height for landscape (if you want) by changing the dimens.xml under res\values-land folder.
9- Once done, recompile the folder with apktool, go to decompiled folder\dist folder and copy the apk here to a different folder and rename it to temp.apk.zip
10- Open temp.apk.zip with 7z/winrar and copy the resources.arsc and kbd_qwerty.xml files from res\xml and res\xml-land folders to your PC(obviously keep the 2 files in seperate folders not to overwrite)
11- Then, rename the original apk from step 2 to com.nuance.swype.dtc-1.apk.zip , open with winrar and first delete resources.arsc file, then drag the resources.arsc file from step 10 to the archive, it will be added. Staying in winrar, go to res\xml folder and replace the file with kbd_qwerty.xml from step 10 (the portrait version). Do the same with res\xml-land folder and the landcape file.
12- Once finished rename the file back to com.nuance.swype.dtc-1.apk, don't sign it, don't delete META-INF folder, leave it as it is.
13- Now, on your phone, uninstall Swype. Reinstall it from the apk file on Step 2. Go to /data/app-lib/com.nuance.swype.dtc-1 folder and move the 2 files (libnmsp_speex.so and libswypecore.so) to system/lib folder. You have to mount the System R/W from Root Explorer on this step. Fix the permissions so these 2 files have the same permissions with other files there. If you can't find these files just use the ones from Step 3.
14- Once done, copy com.nuance.swype.dtc-1.apk from Step 12 to /system/app and fix the permissions so that it has the same permissions as other files there.
15- Then delete the com.nuance.swype.dtc-1.apk from /data/app/ folder. Restart your phone.

This should be it if you followed it exactly, tracing and Dragon voice dictation also works. While you're doing all this work (takes 10 minutes by the way), you might also consider changing how Swype looks (theming) and changing many other things like swype thickness, colors etc. Please note that this is for advanced and rooted users and please don't ask me to give you the modded apk, you have to do it on your legally bought version. You might consider doing backups just in case anything goes wrong. Have fun.
And a quick tip: if you swype from swype icon to symbol key(123), arrow keyboard opens up.

You can also add arrow keys by copying arrow keys from kbd_edit.xml, check the 2nd screenshot.

Please hit the thanks button if you think this is useful.
 

Attachments

  • 001.jpg
    001.jpg
    29.5 KB · Views: 9,779
  • template.zip
    3 KB · Views: 1,251
  • 002.png
    002.png
    112.8 KB · Views: 6,660
Last edited:

darwinwin

Senior Member
Jul 15, 2012
263
71
Beirut
Can you please update this tutorial to 4.3 ? I couldn't find the files in the mentioned paths. . I'm on stock rooted 4.3 on gt9500

Sent from my GT-I9500 using XDA Premium 4 mobile app
 

ozkaya

Senior Member
Mar 22, 2006
637
299
Can you please update this tutorial to 4.3 ? I couldn't find the files in the mentioned paths. . I'm on stock rooted 4.3 on gt9500

Sent from my GT-I9500 using XDA Premium 4 mobile app

It works same for me on 4.3 stock rooted i9500, maybe you could do a file search to find the necessary folder. Here is another screenshot with the updated Swype(1.6.2.22328), where I made number buttons smaller like original Samsung Keyboard and hide the suggestions bar to save space.
 

Attachments

  • 002.png
    002.png
    141.3 KB · Views: 2,366

PhilDX

Senior Member
Oct 17, 2010
728
362
NJ
Hello guys...
9- Once done, recompile the folder with apktool, go to decompiled folder\dist folder and copy the apk here to a different folder and rename it to temp.apk.zip
....

using the current play store version (1.6.3.22544), i decompiled com.nuance.swype.dtc-1.apk (/mnt/asec/com.nuance.swype.dtc-1/pkg.apk) using APKTool 1.52. i made no changes and attempted to recompile without success.

the first error displayed by apktool is:
"C:\Users\Phil\apktool\com.nuance.swype.dtc-1\res\values\arrays.xml:545: error: Found tag dimen-array where item is expected"

i do use APKTool successfully to mod other apps so i am familiar with the process.

QUESTION: what frameworks file are you using when making your mods? are you using a TW ROM frameworks? that's the only other variable i can think of...


EDIT: well, i just tried using TW framework too without success
 
Last edited:

ozkaya

Senior Member
Mar 22, 2006
637
299
using the current play store version (1.6.3.22544), i decompiled com.nuance.swype.dtc-1.apk (/mnt/asec/com.nuance.swype.dtc-1/pkg.apk) using APKTool 1.52. i made no changes and attempted to recompile without success.

the first error displayed by apktool is:
"C:\Users\Phil\apktool\com.nuance.swype.dtc-1\res\values\arrays.xml:545: error: Found tag dimen-array where item is expected"

i do use APKTool successfully to mod other apps so i am familiar with the process.

QUESTION: what frameworks file are you using when making your mods? are you using a TW ROM frameworks? that's the only other variable i can think of...


EXIT: well, i just tried using TW framework too without success

Latest version of Swype has incompatible tags with Apktool. What you do is go to all the lines that give error and change them to <string-array>. Then it compiles.
 
Last edited:

thumm138

Member
Jun 24, 2012
39
6
I've been going nuts trying to edit swype for a week now and still can't seem to get it to work. All I want to do is change the suggested word color and maybe a few other minor color related things. I assumed just changing the color codes in /res/values/styles.xml that seemed to pertain to the holo theme would work but I can't ever get the app to install. Not even sure where to begin to ask for help on this one but if anyone has any advice I'd greatly appreciate it.
 

TeknoGodz

Senior Member
Jun 9, 2012
248
85
Tampa
Ok I've tried this a hundred times following all the steps completely and it just wont work.

Once I go to install the final apk it always tries to install then sais App Not Installed.
 

ozkaya

Senior Member
Mar 22, 2006
637
299
Ok I've tried this a hundred times following all the steps completely and it just wont work.

Once I go to install the final apk it always tries to install then sais App Not Installed.

You don't install the final apk, in fact you can't since the certificate is no longer valid. You copy the final apk in place as in Step 14.
 

poczynek

Senior Member
Jul 10, 2012
1,892
787
Sydney
I would love this! I have used Swype for years but I would love a number row. To be honest I have no idea how to follow those instructions! I have a rooted phone - what can I do?
 

mr.BeBoT

Member
Jan 6, 2008
29
1
Am I right in concluding that you can't use TB to backup and restore the finished product and this will have to be done manually? I did this on my rooted Note 3 and I keep going back to my stock image because I don't want to have to keep doing the steps when I flash a new ROM or ROM update.

Would I maybe just have to do steps 12 onward every time?
 

ozkaya

Senior Member
Mar 22, 2006
637
299
Am I right in concluding that you can't use TB to backup and restore the finished product and this will have to be done manually? I did this on my rooted Note 3 and I keep going back to my stock image because I don't want to have to keep doing the steps when I flash a new ROM or ROM update.

Would I maybe just have to do steps 12 onward every time?

When you install a new ROM, you install original Swype from apk file then you move the lib files to /system/lib, copy the modded apk to /system/app and delete original apk from /data/app folder. So it is 4 steps once you have the modded apk ready, should take no more than 5 minutes.
 
Last edited:

ozkaya

Senior Member
Mar 22, 2006
637
299
I've been going nuts trying to edit swype for a week now and still can't seem to get it to work. All I want to do is change the suggested word color and maybe a few other minor color related things. I assumed just changing the color codes in /res/values/styles.xml that seemed to pertain to the holo theme would work but I can't ever get the app to install. Not even sure where to begin to ask for help on this one but if anyone has any advice I'd greatly appreciate it.

This is similar. Please go through the steps, you don't (can't) install the modded apk, you move it in place.
 
  • Like
Reactions: notmyepic

thumm138

Member
Jun 24, 2012
39
6
This is similar. Please go through the steps, you don't (can't) install the modded apk, you move it in place.

Yeah I realized that after I posted and still nothing. I'm no programmer but I've never NOT been able to change a few things and recompile. Not sure how just changing a few color codes is causing such a problem. Shame such a nice keyboard has such little customization and few themes. Don't get me wrong I like orange but it really doesn't mesh at all with the rest of the UI. Thanks for the reply though.
 

TeknoGodz

Senior Member
Jun 9, 2012
248
85
Tampa
This is similar. Please go through the steps, you don't (can't) install the modded apk, you move it in place.

I did all that and it changed the height of the keyboard, but didn't add any additional number row.

kdb_qwerty or whatever it's called is the default that comes up when you install it, right? Becuase I tried again and specifically made sure to use this one and it just wont give me the extra row, just the height.
 

ozkaya

Senior Member
Mar 22, 2006
637
299
I did all that and it changed the height of the keyboard, but didn't add any additional number row.

kdb_qwerty or whatever it's called is the default that comes up when you install it, right? Becuase I tried again and specifically made sure to use this one and it just wont give me the extra row, just the height.

It depends on your system language. Try kbd_qwerty_panlatin.xml.
 
  • Like
Reactions: notmyepic

Top Liked Posts

  • There are no posts matching your filters.
  • 35
    Hello guys,

    Since I use a Samsung device, I'm used to the extra number row on top of the keyboard so I modded Swype to have that extra row. However since Swype is to be purchased and not distributed, I'll only tell here how to do it for your legally purchased copy. And this is a bit complicated and for advanced users and you need to be rooted. You also need Root Explorer. Here we go:

    1- First buy/download Swype from Google Play.
    2- Go to /mnt/asec/com.nuance.swype.dtc-1 folder, copy pkg.apk to your sdcard, rename it to com.nuance.swype.dtc-1.apk.(keep a backup of this file at all times)
    3- Go to /mnt/asec/com.nuance.swype.dtc-1/lib folder copy the files (libnmsp_speex.so and libswypecore.so) to your sdcard.
    4- Using apktool (I used version 1.52) decompile com.nuance.swype.dtc-1.apk.,
    5- Go to decompiled folder\res\xml folder. kbd file pertaining to your language is to be edited, I edit kbd_qwerty.xml for English using Notepad++.
    6- Check the attached kbd_qwerty.xml in portrait folder and notice the extra row section I added to the top. You can in fact add secondary characters to numbers or customize the keyboard completely, rearrange letters, add symbols etc.
    7- Once done, save the file and go to decompiled folder\res\xml-land folder and edit the landscape for the layout, kbd_qwerty.xml file, notice the attached file in landscape folder.
    8- Once done, save the file and go to decompiled folder\res\values folder and edit the dimens.xml file. Here I raise the height of the keyboard and height of the key to 270dip and 54dip respectively, check the top rows of the attached dimens.xml. Also increase the keyboard height for landscape (if you want) by changing the dimens.xml under res\values-land folder.
    9- Once done, recompile the folder with apktool, go to decompiled folder\dist folder and copy the apk here to a different folder and rename it to temp.apk.zip
    10- Open temp.apk.zip with 7z/winrar and copy the resources.arsc and kbd_qwerty.xml files from res\xml and res\xml-land folders to your PC(obviously keep the 2 files in seperate folders not to overwrite)
    11- Then, rename the original apk from step 2 to com.nuance.swype.dtc-1.apk.zip , open with winrar and first delete resources.arsc file, then drag the resources.arsc file from step 10 to the archive, it will be added. Staying in winrar, go to res\xml folder and replace the file with kbd_qwerty.xml from step 10 (the portrait version). Do the same with res\xml-land folder and the landcape file.
    12- Once finished rename the file back to com.nuance.swype.dtc-1.apk, don't sign it, don't delete META-INF folder, leave it as it is.
    13- Now, on your phone, uninstall Swype. Reinstall it from the apk file on Step 2. Go to /data/app-lib/com.nuance.swype.dtc-1 folder and move the 2 files (libnmsp_speex.so and libswypecore.so) to system/lib folder. You have to mount the System R/W from Root Explorer on this step. Fix the permissions so these 2 files have the same permissions with other files there. If you can't find these files just use the ones from Step 3.
    14- Once done, copy com.nuance.swype.dtc-1.apk from Step 12 to /system/app and fix the permissions so that it has the same permissions as other files there.
    15- Then delete the com.nuance.swype.dtc-1.apk from /data/app/ folder. Restart your phone.

    This should be it if you followed it exactly, tracing and Dragon voice dictation also works. While you're doing all this work (takes 10 minutes by the way), you might also consider changing how Swype looks (theming) and changing many other things like swype thickness, colors etc. Please note that this is for advanced and rooted users and please don't ask me to give you the modded apk, you have to do it on your legally bought version. You might consider doing backups just in case anything goes wrong. Have fun.
    And a quick tip: if you swype from swype icon to symbol key(123), arrow keyboard opens up.

    You can also add arrow keys by copying arrow keys from kbd_edit.xml, check the 2nd screenshot.

    Please hit the thanks button if you think this is useful.
    8
    Ok i've lost a lot of time but i've achivied something. I've create an Xposed Module that does all the work described in the first post. It edits the two xmls ('kbd_qwerty_panlatin' and 'kbd_qwerty_panlatin_sym') adding a row number to the first (and the 'left-right' key). It also change the keyboard and keys dimensions (same size of first post). You don't need anymore to do that horrible work, edit apk and similar... ;)

    You can test it, module's thread is here: http://forum.xda-developers.com/xposed/modules/app-swype-row-t3297733
    6
    Hi, just a really basic question, how to enable display of alternative characters? Iv'e checked the examples, included in my xml the alt, but still nothing :(
    Thanks in advance!

    Swype has chosen to hide the secondary key characters on some of the themes (enabling them can be a little distracting on some themes). the secondary keys are disabled by setting the color of the secondary character label to "transparent". to enable the secondary characters, you need to change the color to something of your liking.

    Here is an example for enabling the secondary characters on the material dark theme and setting the color to hex code #ffb8b8b8:

    Open /res/values/styles.xml and scroll down to the section for material dark theme.
    Code:
    <style name="Swype.materialdark" parent="@style/Swype">

    scroll down and find these entries:
    Code:
    <item name="defaultAltTextColor">@color/transparent</item>
    and
    Code:
    <item name="defaultAltTextColorSpace">@color/transparent</item>
    change them to something like this:
    Code:
    <item name="defaultAltTextColor">@color/grey_lighter</item>
    and
    Code:
    <item name="defaultAltTextColorSpace">@color/grey_lighter</item>

    you can set the color to any of the predefined colors in /res/values/colors.xml (grey_lighter = #ffb8b8b8), or you can replace the "@color/transparent" string with any hex code you want (e.g., #ffffffff for white).

    note that you probably only need to change the color of the first entry, "defaultAltTextColor", but i changed both because i didn't feel like experimenting to see which one actually does it.
    5
    Swype update!

    new samep_Swype2.0.2.2000200.39828-template.zip for apk compile

    Changes:
    carried over theme changes from previous template 1.1 rev on last Swype update- thanks to @Puddies
    added cents symbol as #2 alt. symbol
    added ^ as #6 alt. symbol
    Swype stability update- whatever that is
    extra Halloween Themes were already in the Theme store prior to update?
    fa0f8de224ed0832af82504d77d7eed3.jpg

    Note: refer to post 198 for quick reference.
    4
    I was hoping somebody could point me in the right direction.
    I can decompile, edit the files and recompile without issue, but when trying to install swype I keep getting an error message saying that swype crashed.
    I followed the instructions as they are posted in the first post and Ive also tried making the adjustments that PhilDx suggested in post number 68 about creating the same folder structure in the system folder but still no luck. Any help will be greatly appreciated, thanks in advance.

    All you can do is to exactly follow the OP. It's easy to make a mistake due to the hurry or not reading exactly. Anyway I will try to make some light:

    1- Uninstall swype and reinstall it from Play store. Since you are on lollipop you can take the apk from the folder data/app/com.nuance.swype.dtc-1. Copy the folder including the subfolders ( lib/arm and the two *.so files) and paste it somewhere in your pc.
    2- Take the "base.apk" from inside the folder in the point (1) and make a backup copy of this one (because you will need it afterwards). So now you have two copies of it. Let's say the Copy "A" and the Copy "B", perfectly identical.
    Leave the Copy A as is and decompile the Copy B. Make your edits etc etc and then recompile it.
    Now the Copy B is different from Copy A, right?
    3- Take the Copy B just recompiled and copy it into a different folder , let's say a new folder called TEMP.
    4- Rename the Copy B "base.apk" in "temp.apk.zip". PEASE NOTE: CHANGE THE FILE EXTENSION INTO ZIP!!!
    5- Open the Copy B(.ZIP) with WinRar or 7zip (don't uncompress) and extract the files resources.arsc and all the edited *xml and/or *.png files into the folder TEMP. Close the WinRar window.
    6- Now take the Copy A and rename it into "com.nuance.swype.dtc-1.apk.zip". NOTE: CHANGE THE EXTENSION INTO ZIP!!!
    7- Open it with WinRar or 7zip(don't uncompress) and delete the file resources.arsc. Then drag into the Winrar window the file resources.arsc taken from the TEMP folder previously extracted. It will be added. Then drag and drop from TEMP folder each png or xml file in their respective folders into the WinRar window. Close the WinRar window.
    8- Rename the Copy A (com.nuance.swype.dtc-1.apk.zip) into "com.nuance.swype.dtc-1.apk". NOTE: we removed the .zip extension so the file is back to the APK extension.
    9- Copy the Copy A somewhere into the SDCard of your device
    10- Now using your file manager copy the whole folder com.nuance.swype.dtc-1 (including the subfolders) from data/app to system/app. So you will have the structure like this: system/app/com.nuance.swype.dtc-1. Inside you will have a folder called "lib" and a file "base.apk".
    11- Delete the file "base.apk" then copy the file Copy A (com.nuance.swype.dtc-1.apk) taken from your SDCard to system/app. Change the permissions for every folders and files, including the folder com.nuance.swype.dtc-1 and its subfolders (lib/arm) and the files *so. The folders need permissions 755 (rwxr-xr-x) and the files 644 (rw-r--r--).
    12- Delete the folder data/app/com.nuance.swype.dtc-1. Reboot the device.

    THAT'S ALL!
    Feel free to ask, If I can be of any help.

    Just a tip or two:
    If you edit images with 9patch (with the extension *.9.png) be sure to drag into the file CopyA the recompiled ones. I mean that you will have to recompile the CopyB, then extract them from this one (because now are compiled) together with resources.arsc and the xml files. Pay attention to edit these images, if you're not sure how to do it make a search :)

    If you edit some xml file from inside the foder res/values you will not find the same file or folder into the recompiled CopyB file. Don't worry, it's OK!! LOL

    Good Luck ;)
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone