# [HOW TO] Make Swype Work on the TouchPad (updated for ICS with more info)



## yarly

Swype does not work out of the box, but some small hacks in smali will make it work okay (though not really made for the size of the TouchPad). Since Swype does not like people redistributing their app, I cannot post it on here. However, for anyone with the ability and patience, this is how you get it to work:

*ICS screens:*
http://desmond.image....png&res=medium
http://desmond.image....png&res=medium

*Gingerbread screen shot:*
http://img31.imagesh...18507235338.png

1) download the apktool  (I recommend getting the helpers for it so you do not have to run it with java directly)
2) decompile your Swype installer you had from your phone or you downloaded from swype.com with your touchpad browser with apktool (it's in /data/app)



Code:


apktool d /path/to/your/swype/installer/name_of_your_swype_app.apk

3) look for the file in the smali directory (installer/smali/com/swype/android/installer) called InstallerService.smali and then open it in a text editor of your choice.

4) In that file, find the following lines under the method .method public doDownloadList(ZIZ)I and comment them out like so by putting a # in front of them like so:



Code:


#invoke-virtual {v8}, Landroid/view/Display;->getWidth()I<br />
#move-result v2<br />
#invoke-virtual {v8}, Landroid/view/Display;->getHeight()I<br />
#move-result v3

5) Add the following right below those lines (the # part and after are just a comment for your own info):

*For android 2.3 (gingerbread):*


Code:


const/16 v2, 0x400 #hex for 1024px screen width<br />
const/16 v3, 0x258 #hex for 600px screen height

*For android 4.0.x (ICS):*


Code:


const/16 v2, 0x500 #hex for 1280px screen width<br />
const/16 v3, 0x2D0 #hex for 720px screen height

6) recompile the apk with apktool (it will show up under the "dist" directory within the root of the top directory that initially was created when you decompiled)



Code:


apktool b /path/to/the/decompiled/swype/folder

and sign it with signapk or something else that works. More information on how to use signapk can be found here as well or over here at the community android wiki.

*How to sign it with signapk:*

The link with more info on signapk includes a link to a copy of signapk with keys already made. You can use those or more preferred would be generating your own private keys with openssl doing the steps below. If you already have keys made, you can skip the steps about openssl and go right to the part about signapk itself.

*On windows:*

You need either cygwin with OpenSSL or a seperate openSSL package and install it.

After you get openSSL, you need to create a certificate to sign the apk. Either open cmd.exe or cygwin (cygwin is a port of many linux tools for windows) and type the following:



Code:


<br />
openssl genrsa -out key.pem 1024<br />
openssl req -new -key key.pem -out request.pem<br />
<br />
openssl x509 -req -days 9999 -in request.pem -signkey key.pem -out certificate.pem<br />
openssl pkcs8 -topk8 -outform DER -in key.pem -inform PEM -out key.pk8 -nocrypt<br />

Put the files created by the above commands as well as your apk into the Java install directory on your system (see the next line) ↓↓↓

Stick your recompiled apk in the directory you have Java installed (on windows that would be under* program files/jdk1.x.x_x/bin*, where x is some version).

Run the following command from the bin directory in java in cmd.exe or cygwin (where Swype-Installer-2.apk is the name of your unsigned apk):



Code:


java -jar signapk.jar certificate.pem key.pk8 Swype-Installer-2.apk Swype-Installer-2-1280x720-signed.apk

*On Linux / OSX:*

Linux and OSX come with openssl (or you can find it as a linux package for your distro) so you don't need to do much other than make sure java is installed. Just run the same four commands in the terminal:



Code:


<br />
openssl genrsa -out key.pem 1024<br />
openssl req -new -key key.pem -out request.pem<br />
<br />
openssl x509 -req -days 9999 -in request.pem -signkey key.pem -out certificate.pem<br />
openssl pkcs8 -topk8 -outform DER -in key.pem -inform PEM -out key.pk8 -nocrypt<br />

Then put the files it creates along with the unsigned apk file in some directory together and then go to that directory in the terminal and run the following:



Code:


java -jar signapk.jar certificate.pem key.pk8 Swype-Installer-2.apk Swype-Installer-2-1280x720-signed.apk

--------------------------------------------------------------------------------------------------------------------------

If all goes well, it should be signed and ready to stick on your touchpad. You can delete or archive the one named "Swype-Installer-2.apk" as it's the unsigned one. The other (Swype-Installer-2-1280x720-signed.apk) you will stick on your touchpad and install.

7) stick it on your touchpad and run it.

8) no more *****ing about "invalid device size" and it works 

NOTE: do not bother trying to make it 1280x800 or 1280x720 on Android 2.3, it wont work, since it thinks you are running honeycomb or ICS and obviously you are not. Smaller sizes that are supported by swype will work, but with mixed results (trying 800x480 removes the language button and makes it a bit smaller so you can swype easier).

*EDIT:*

Just for reference, here's the chart for sizes that will work http://beta.swype.co...roid/supported/
View attachment 4213
(swype has not updated the chart for ICS though)

*UPDATE:* updated to support ICS and gives more details on how to do the tutorial.

ICS screens:


----------



## yarly

If a mod chimes in and says it's okay to post the apk itself for the installer, I'll do so.


----------



## junkdruggler

Swipe has made it clear that they don't want distribution of their property.. 
They have given lots of leeway for the development community as a whole, considering we have pretty much put their keyboard on every device possible.. They have also asked if we make something for a device not initially supported to not post the app as a whole..
I don't think there would really be a way to post it without it considered wares..
Has anyone tried the swipe installer to see if they have a free beta available?


----------



## yarly

junkdruggler said:


> Swipe has made it clear that they don't want distribution of their property..
> They have given lots of leeway for the development community as a whole, considering we have pretty much put their keyboard on every device possible.. They have also asked if we make something for a device not initially supported to not post the app as a whole..
> I don't think there would really be a way to post it without it considered wares..
> Has anyone tried the swipe installer to see if they have a free beta available?


Tried the swype installer? I'm pretty sure it would be hard to install swype and post the fix I did above without trying the installer 

Their beta has always been free, just not always open to everyone.


----------



## ricez

How well does it work on such a large device? Isn't a regular IME easier to use?


----------



## yarly

ricez said:


> How well does it work on such a large device? Isn't a regular IME easier to use?


 Subjective questions. Easier to use is always an opinion. It's okay in portrait mode. Not as great in Landscape because it blocks the entire screen like on the phone. I'd go about retheming/resizing it and make a patch for people, but I already have my hands full helping trying to port MIUI on the HTC Thunderbolt.


----------



## junkdruggler

Im currently using flexT9 and it works great.. i also have thumb keyboard but the tp is kinda weird to hold and type with it..


----------



## Snow02

junkdruggler said:


> Im currently using flexT9 and it works great.. i also have thumb keyboard but the tp is kinda weird to hold and type with it..


I like thumb keyboard because you can quickly switch between split, normal, and one handed keyboards. And you can completely customize the sizes.


----------



## yarly

Hey guys, I know you all love your particular keyboards, but could we keep it on topic (those that have issues with applying the patch or those that have experience after trying swype or other swype questions)?

Feel free to create a swype alternatives thread.


----------



## Kayone

I tried the Free Swype Beta from their website but I got that invalid screen size error. I haven't tried modifying the apk at all.


----------



## Snow02

yarly said:


> Hey guys, I know you all love your particular keyboards, but could we keep it on topic (those that have issues with applying the patch or those that have experience after trying swype or other swype questions)?
> 
> Feel free to create a swype alternatives thread.


You have a screenshot? I pulled the apk from my phone and didn't like the size. Is this any better?


----------



## yarly

Snow02 said:


> You have a screenshot? I pulled the apk from my phone and didn't like the size. Is this any better?


I can post one in a bit.


----------



## nsfw

SlideIT works for me. Don't know if thats considered a good keyboard or not.


----------



## joshts0

Heres a screenshot of the 1024x600...


----------



## hyperfire21

how did u install that 1280 x 800? it gives us invalid error and fails the install.


----------



## joshts0

hyperfire21 said:


> how did u install that 1280 x 800? it gives us invalid error and fails the install.


I'm an idiot... I didn't save the file before I recompiled it hahahah... thats the default size listed in the OP  I corrected my post. Hey theres a screenshot for some people ...


----------



## lambcurry15

const/16 v2, 0x400 #hex for 1280px screen width
const/16 v3, 0x258 #hex for 800px screen height

works on mine.. but looks exactly the same as the picture above.


----------



## joshts0

lambcurry15 said:


> const/16 v2, 0x400 #hex for 1280px screen width
> const/16 v3, 0x258 #hex for 800px screen height
> 
> works on mine.. but looks exactly the same as the picture above.


I did that too once don't worry  You only modified the comment... the comment is saying, the 0x400 is hex for ......


----------



## yarly

joshts0 said:


> I did that too once don't worry  You only modified the comment... the comment is saying, the 0x400 is hex for ......


I guess I should have noted that was a comment, lol. Smali reads in all integers/floats/etc in hex so I just put it there there so it would make sense why it was being added.

If you do set the screen size to 1280, it will "work" as in it will install and you'll see a keyboard, but it won't actually do anything functional than be a popup graphic when you press on a textbox


----------



## _ThaNerd_

What about people without an Android phone? Maybe share the custom apk somehow...


----------



## angellsl

_ThaNerd_ said:


> What about people without an Android phone? Maybe share the custom apk somehow...


You can register an account Swype beta and get an installer


----------



## yarly

_ThaNerd_ said:


> What about people without an Android phone? Maybe share the custom apk somehow...


Can't post a public link, would be breaking the forum rules.


----------



## angellsl

Why there is no Chinese support? T there is on my hd2


----------



## yarly

angellsl said:


> Why there is no Chinese support? T there is on my hd2


Pretty sure swype has chinese support listed in the installer under all languages.


----------



## angellsl

yarly said:


> Pretty sure swype has chinese support listed in the installer under all languages.


actually, there is no chinese in the all languages, but there should be a separate chinese swype package, which is missing from the installer


----------



## yarly

angellsl said:


> actually, there is no chinese in the all languages, but there should be a separate chinese swype package, which is missing from the installer


hmm. idk then. maybe the version on your phone was made for your phone (came with it that is)?


----------



## whistler

having decompilation issues with apktool, something related to multiple resources!


----------



## yarly

whistler said:


> having decompilation issues with apktool, something related to multiple resources!


Just realized you posted here as well, but I replied to your question on xda since I happened to be looking there first.

Copied from there:

Dunno why you would get that. I used the latest apktool version and ran (on linux):

./apktool.sh d Swype-Installer.apk

and

./apktool.sh b Swype-Installer-Directory/

Maybe you're missing the Java JDK or using a version that may not work. I was using the 32bit version of the Java6 jdk.


----------



## t0asty

I was able to decompile and modify the files without any problems on OSX, but I'm getting a number of Java exceptions when I try and recompile. Anyone else see anything similar? Any ideas?


----------



## fergusonkw

When I go through the install (after unpacking, modifying and repacking/signing) I get an error during install stating "Application not installed". Can anyone shed some light on whether this might be a repacking issue or a signature issue. As I didn't get any errors during repacking, I'm leaning towards a signature error but I have no idea to be perfectly honest.


----------



## angellsl

fergusonkw said:


> When I go through the install (after unpacking, modifying and repacking/signing) I get an error during install stating "Application not installed". Can anyone shed some light on whether this might be a repacking issue or a signature issue. As I didn't get any errors during repacking, I'm leaning towards a signature error but I have no idea to be perfectly honest.


It has to be signed. Please check the readme file for how to sign. Also remove the previous ly installed Swype


----------



## fergusonkw

angellsl said:


> It has to be signed. Please check the readme file for how to sign. Also remove the previous ly installed Swype


Appears as though it had to do with the previous install still being present. Once I removed all traces of the old version and used my signed version it worked without issue - Thank You.


----------



## daonei

nsfw said:


> SlideIT works for me. Don't know if thats considered a good keyboard or not.


So you installed SlideIT on your CM7 Touchpad? How is it? Any reviews? Can you use it in both portrait and landscape mode?

Thanks!


----------



## yarly

fergusonkw said:


> When I go through the install (after unpacking, modifying and repacking/signing) I get an error during install stating "Application not installed". Can anyone shed some light on whether this might be a repacking issue or a signature issue. As I didn't get any errors during repacking, I'm leaning towards a signature error but I have no idea to be perfectly honest.


http://www.londatiga.net/it/how-to-sign-apk-zip-files/


----------



## HarpingOn

I've decompiled the swype installer, made the changes, but after the beta login, it still says the device has an unsupported resolution.

Perhaps swype have changed something in the latest installer such that hacking the swype installer like this no longer works (and yes, I did check I'd saved the modified files, and re-signed).

Any other solutions? SlideIT is carp compared with Swype and I love Swype on my CM7 Galaxy S.

Perhaps we need the Swype folks to produce a 1024x768 version.

Would the game resolution hack work do you think? Expanding the bar to take up the extra pixels? Hm.


----------



## Redflea

daonei said:


> So you installed SlideIT on your CM7 Touchpad? How is it? Any reviews? Can you use it in both portrait and landscape mode?
> 
> Thanks!


It's usable but it's not Swype....

Sent from my Galaxy Nexus using Tapatalk


----------



## yarly

HarpingOn said:


> I've decompiled the swype installer, made the changes, but after the beta login, it still says the device has an unsupported resolution.
> 
> Perhaps swype have changed something in the latest installer such that hacking the swype installer like this no longer works (and yes, I did check I'd saved the modified files, and re-signed).
> 
> Any other solutions? SlideIT is carp compared with Swype and I love Swype on my CM7 Galaxy S.
> 
> Perhaps we need the Swype folks to produce a 1024x768 version.
> 
> Would the game resolution hack work do you think? Expanding the bar to take up the extra pixels? Hm.


It still works, you just must have uploaded the wrong one or something else with awry.


----------



## HarpingOn

Thank you for the update. I will retry the whole thing using a Linux machine instead of windows. Might make something different happen. Cheers


----------



## yarly

HarpingOn said:


> Thank you for the update. I will retry the whole thing using a Linux machine instead of windows. Might make something different happen. Cheers


Yeah, it was a couple weeks ago when i did the fix and installed it again, but nothing has changed as far as making it work.


----------



## Sebianoti

yarly said:


> Yeah, it was a couple weeks ago when i did the fix and installed it again, but nothing has changed as far as making it work.


 i'm such a noob i have no god damn clue what to do, everything i tried has failed, why can't someone just upload it somewhere and PM it to me?


----------



## PsychoEddie

No. Something in the latest version of swype itself has changed. The mod above only allows the installer to be installed and run. When the installer downloads the latest swype and tries to install it a new unsupported. Screen resolution error appears.


----------



## yarly

PsychoEddie said:


> No. Something in the latest version of swype itself has changed. The mod above only allows the installer to be installed and run. When the installer downloads the latest swype and tries to install it a new unsupported. Screen resolution error appears.


It works if you do the mod as instructed. I'm using it as we speak, lol.


----------



## csrow

I just copied Swype from my wvga(800 x 480) phone. It's working fine and does update to the latest version with the Dragon dictate.

The only negative is that in landscape format, the entry box takes over the whole screen most of the time.Otherwise, it's working great.

Sent from my Touchpad using Tapatalk


----------



## PsychoEddie

I uninstalled the existing swype installer and cleared the application data, then reinstalled the exact same installer that i'd been using. it worked this time. swype is up and running.


----------



## thumper300zx

Sweet! Glad I found the thread...

I struggled a bit following directions







but finally got it installed.

On step: "Recompile the apk with apktool and sign it with signapk (google it) or something else that works."

Directions from here: http://www.ipmart-fo...p/t-527168.html

a.) Download Attached "SignApk.rar";
b.) Unrar "SignApk.rar" to any folder (for example C:\);
c.) _*Copy your apk to be signed to SignApk dir*_;
d.) Open command Prompt and go to SignApk dir;
e.) Type the following command:
java -jar signapk.jar certificate.pem key.pk8 your-app.apk _*your-signed-app.apk*_

It will create a new copy (which is why you specify a new name). Then copy to device, install, login to Swype, and it should let you download now!


----------



## HarpingOn

I repeated all the steps I did under windows, using an Ubuntu 10.04 LTS box, and lo. It worked.

Maybe I did something wrong, or made a mis-step somewhere under Windows, but happy now that Swype works. How did I live with SlideIT for so long. <3 Swype.

It even works in landscape mode nicely. They (Swype) really should make a 1024x768 version, as it appears (to me) to have no issues.

Thanks for the thread guys, it does work.


----------



## slugshot

unfortunately I cannot download any further input languages, which seems to be a problem in combination with ISC.

There is a modified version for GalaxyNexus with all language packes inside, which installs fine and works in portrait mode, but not correct in landscape mode. Any suggestions which file to edit to get it working?

https://plus.google.com/108096915458146487046/posts/RbaqP3E9yba


----------



## yarly

Won't be messing with ICS on the touchpad until it gets more stable so really don't know how to fix it at the moment. Probably an issue with the resolution being too large though so something in the xml layout files and images.


----------



## slugshot

I was able to fix it on my own. If someone is interested in Swype with all languages (but without dragon voice search) decompile the apk from here with apktool. Edit the following file:

..\assets\files\display0_SwypeScreen.ini

change ScreenHeightLS, ScreenWithLS and ScreenwithPS like follows:


Code:


<br />
ScreenHeightLS = 300<br />
ScreenWidthLS = 1024<br />
ScreenWidthPT = 768<br />

delete the following folders:

.\res/values-sw540dp
.\res/values-sw600dp
.\res/values-sw800dp

Recompile and sign. Happy installing!

BR
Andy


----------



## yarly

Glad to hear you were able to figure it out


----------



## dny238

Here's what I did, forgive me if this is now a repeat.

adb pull /data/app/com.swype.android.installer-2.apk swype_installer.apk
adb uninstall com.swype.android.installer
apktool d swype_installer.apk swype2
vi ./swype2/smali/com/swype/android/installer/InstallerService.smali
--edit the file as detailed at the first post--apktool b swype2 swype_installer2.apk
keytool -genkey -v -keystore swype2.keystore -alias swype2 -keyalg RSA -keysize 2048 -validity 10000
jarsigner -verbose -keystore swype2.keystore swype_installer2.apk swype2
../tools/zipalign -v 4 swype_installer2.apk swype_installer2_signed.apk
adb install swype_installer


----------



## michaeldcoates

slugshot said:


> I was able to fix it on my own. If someone is interested in Swype with all languages (but without dragon voice search) decompile the apk from here with apktool. Edit the following file:
> 
> ..\assets\files\display0_SwypeScreen.ini
> 
> change ScreenHeightLS, ScreenWithLS and ScreenwithPS like follows:
> 
> 
> Code:
> 
> 
> <br />
> ScreenHeightLS = 300<br />
> ScreenWidthLS = 1024<br />
> ScreenWidthPT = 768<br />
> 
> delete the following folders:
> 
> .\res/values-sw540dp
> .\res/values-sw600dp
> .\res/values-sw800dp
> 
> Recompile and sign. Happy installing!
> 
> BR
> Andy


Hi Andy, thanks for this, however when I decompile (convert to zip, open folder) I don't see any of the values folders you mentioned to delete. I can edit the .ini file and rezip, change to apk in get info (I'm on a mac) and resign using the testsign dropper program. I'm probably doing a lot wrong here but I'm a total noob to this so any help you can offer would be appreciated.

Many thanks
Michael


----------



## slugshot

HI Michael, what do you mean by "convert to zip"? When I decompile the apk a folder will be created. I used this one.
During recompiling the apk I got an error because of the 3 mentioned folders. So I decided to remove them.
If you don´t experience recompilation errors, there is no need to remove the folders. You said you resigned the package, so were you able to install it?

BR
Andy


----------



## michaeldcoates

slugshot said:


> HI Michael, what do you mean by "convert to zip"? When I decompile the apk a folder will be created. I used this one.
> During recompiling the apk I got an error because of the 3 mentioned folders. So I decided to remove them.
> If you don´t experience recompilation errors, there is no need to remove the folders. You said you resigned the package, so were you able to install it?
> 
> BR
> Andy


Well an apk is essentially a zipped up folder and I read that if you rename it from apk to zip then you can unzip it and retrieve that folder. It seemed to work ok. I rezipped the folder, renamed it apk in get info on the mac and signed it off. I didn't see the 3 folders at all, but I did the ini file and edited that in text wrangler. It didn't work at all, I got a parsing error when I tried to install it.


----------



## yarly

You have to use apktool to both decompile and rebuild it. Can't just zip and unzip. It's like a Java jar file. That is, it's not exactly just a "zip," but compiled code and other information built in an ordered directory layout that is then compressed in a zip container.

The only thing it has in common with a zip file is that both are compressed containers that tend to uncompress (but not compile/decompile) fine with unzipping tools.

You basically did the program equivalent to removing the shrink wrap from a physical item, opening it up and taking apart the items and then wrapping the box in shrink wrap again with the items inside in their taken apart state. You need to put the items back in their original state for it to work once again.


----------



## cokewins

slugshot said:


> I was able to fix it on my own. If someone is interested in Swype with all languages (but without dragon voice search) decompile the apk from here with apktool. Edit the following file:
> 
> ..\assets\files\display0_SwypeScreen.ini
> 
> change ScreenHeightLS, ScreenWithLS and ScreenwithPS like follows:
> 
> 
> Code:
> 
> 
> <br />
> ScreenHeightLS = 300<br />
> ScreenWidthLS = 1024<br />
> ScreenWidthPT = 768<br />
> 
> delete the following folders:
> 
> .\res/values-sw540dp
> .\res/values-sw600dp
> .\res/values-sw800dp
> 
> Recompile and sign. Happy installing!
> 
> BR
> Andy


I did this and it works fine with one caveat. Whichever orientation I open the keyboard on first will 'stick'. If it's the portrait mode, when I rotate to landscape the keyboard is still portrait size and does not fill the screen. If I start in landscape, when I rotate, the keyboard is still in landscape size and overflows the width.

Any ideas?


----------



## DashingGentleman

Hi guys,

I've got the Honeycomb multilanguage version of Swype (3.9.86.27849) working on CM9.

It works right out of the box, except throwing an error message about the resolution being unsupported every now and again.
To get rid of it, I decompiled the apk and edited the /smali/swype/android/inputmethod/SwypeInputMethod.smali file, commenting out all the code under the ".method private showWrongScreenSizeMsg" function except the final "return-void".

Now, I have a problem similar to the above poster. The keyboard does not resize properly with rotation changes until another keyboard is toggled on and swype re-enabled. Also, the full-width landscape mode keyboard is borked - writing works but most the function buttons are mapped wrong.

I tried forcing a resolution to swype manually by editing the ScreenDefinitions.smali as described in the first post but it doesn't help (feeding a fake resolution like 1280x800 or 1024x600 breaks things and the real resolution kind of works but doesn't fix the rotation issue).

I think the problem may have to do with the way ICS reports orientation changes or the resolution reporting itself. Seems like it should be fixable with a small code edit, but I have no experience whatsoever with smali and haven't figured it out yet. Any ideas?

EDIT: Here is a screenshot


----------



## mrvanity

Hi guys.
I've managed to sort out this error message and the misteken orientation on switching problem

Decompile classex.dex and open* \com\swype\android\inputmethod\SwypeInputMethod.smali*
Find the following:



Code:


<br />
	.line 1263<br />
	.local v0, [URL=screenDef:Lcom/swype/android/inputmethod/ScreenDefinition]screenDef:Lcom/swype/android/inputmethod/ScreenDefinition[/URL];<br />
	invoke-virtual {v0}, Lcom/swype/android/inputmethod/ScreenDefinition;->getType()Lcom/swype/android/inputmethod/ScreenType;<br />
<br />
	move-result-object v1<br />
<br />
	sget-object v2, Lcom/swype/android/inputmethod/ScreenType;->UNKNOWN:Lcom/swype/android/inputmethod/ScreenType;<br />
<br />
	if-ne v1, v2, :cond_18<br />
<br />
	.line 1266<br />
	iget-object v0, p0, Lcom/swype/android/inputmethod/SwypeInputMethod;->currentScreenDef:Lcom/swype/android/inputmethod/ScreenDefinition;<br />
<br />
	.line 1268<br />
	invoke-direct {p0, v0}, Lcom/swype/android/inputmethod/SwypeInputMethod;->showWrongScreenSizeMsg(Lcom/swype/android/inputmethod/ScreenDefinition;)V<br />
<br />
	.line 1275<br />
	:cond_17<br />
	:goto_17<br />
	return-void<br />
<br />
	.line 1270<br />
	:cond_18<br />
	iget-object v1, p0, Lcom/swype/android/inputmethod/SwypeInputMethod;->currentScreenDef:Lcom/swype/android/inputmethod/ScreenDefinition;<br />
<br />
	invoke-virtual {v1}, Lcom/swype/android/inputmethod/ScreenDefinition;->getOrientation()I<br />
<br />
	move-result v1<br />
<br />
	invoke-virtual {v0}, Lcom/swype/android/inputmethod/ScreenDefinition;->getOrientation()I<br />
<br />
	move-result v2<br />
<br />
	if-eq v1, v2, :cond_17

(around line 11050)

You can see that it compares v1 and v2 (it checks if the resolution is officially supported)


Code:


	if-ne v1, v2, :cond_18

and if they are equal we get the wrong screen size message


Code:


<br />
>showWrongScreenSizeMsg<br />

and continues to goto_17

*else* it continues to cond_18

You can see in cond_18 that it checks for orientation *and then* continues to goto_17

So what do we need to do? We need to make the program think our resolution is officially supported (with other words force it to go to cond_18)

This can be easilly made by changing


Code:


<br />
if-ne v1, v2, :cond_18<br />

to


Code:


<br />
if-eq v1, v2, :cond_18<br />

or even better to


Code:


<br />
if-nez v1, :cond_18<br />

To understand what the opcodes are doing, check


Code:


http://pallergabor.uw.hu/androidblog/dalvik_opcodes.html

Recompile classes.dex and you are good to go!

P.S. Don't forget to alter your *display0_SwypeScreen.ini* to


Code:


<br />
NumberKeyboardNameLS = Numbers-LS<br />
EditKeyboardNameLS = Edit-LS<br />
MainKeyboardNameLS = Qwerty-LS<br />
ScreenHeightLS = 300<br />
ScreenWidthLS = 1024<br />
ScreenDimensionLS = _XGA<br />
NumberKeyboardNamePT = Numbers-PT<br />
EditKeyboardNamePT = Edit-PT<br />
MainKeyboardNamePT = Qwerty-PT<br />
ScreenHeightPT = 320<br />
ScreenWidthPT = 768<br />
ScreenDimensionPT = _XGA<br />

_The version i used is 3.26.92.35548_


----------



## oswade

mrvanity, you sir are my hero!









I did the above mod with Honeycomb Swype 3.9.86.27849 as DashingGentleman mentioned (I like this one, the white colours are better suited to our screen since we have ips not amoled, plus the screen resizing/moving option is pretty cool!).

Working perfect, no screen size errors or orientation bugs!!


----------



## minist

is anyone able to post the honeycomb version mentioned? unedited of course!


----------



## DashingGentleman

mrvanity, that is excellent! Though I have tried to replicate your method on the slightly different code of v 3.9 and I'm still not getting correct orientation switching.



oswade said:


> mrvanity, you sir are my hero!
> 
> 
> 
> 
> 
> 
> 
> 
> 
> I did the above mod with Honeycomb Swype 3.9.86.27849 as DashingGentleman mentioned (I like this one, the white colours are better suited to our screen since we have ips not amoled, plus the screen resizing/moving option is pretty cool!).
> 
> Working perfect, no screen size errors or orientation bugs!!


Could you share your code changes, oswade? I am trying to edit line 1211 in a way analogous to mrvanity's method but it seems not to fix the rotation...

Have you edited display0_SwypeScreen.ini like mrvanity recommends? I find it makes the keyboard spaz out and not display correctly. Any advice appreciated.

EDIT: Please ignore the above. I realised I have not uncommented the original resolution fetching code and it was causing things to fail. I can confirm everything works fine now!

The only mod needed is changing .line1211 in /smali/com/android/swype/inputmethod/SwypeInputMethod.smali like this:



Code:


if-nez v1, :cond_1 #CHANGED FROM if-ne v1, v2, :cond_1

display0_SwypeScreen.ini should be:



Code:


<br />
NumberKeyboardNameLS = Numbers-LS<br />
EditKeyboardNameLS = Edit-LS<br />
MainKeyboardNameLS = Qwerty-LS<br />
ScreenHeightLS = 350<br />
ScreenWidthLS = 1024<br />
ScreenDimensionLS = _WXGA<br />
NumberKeyboardNamePT = Numbers-PT<br />
EditKeyboardNamePT = Edit-PT<br />
MainKeyboardNamePT = Qwerty-PT<br />
ScreenHeightPT = 290<br />
ScreenWidthPT = 768<br />
ScreenDimensionPT = _WXGA

This way both orientations display just fine. You may be able to tweak the height values a bit, but the bove works.

minist, have you googled or searched filestube for the file? That's how I got mine. I hesitate to post it here since Swype seems to frown upon sharing of their files.


----------



## MrPuddington

DashingGentleman said:


> Have you edited display0_SwypeScreen.ini like mrvanity recommends? I find it makes the keyboard spaz out and not display correctly. Any advice appreciated.


Same here. I edited the resolution condition away, and then edited the ini file to match the TouchPad resolution. I think swype works, but the keyboard is invisible - not very useful. So what exactly do I have to do for ICS? I am getting more and more annoyed with slideit - it just does not cut it for me.


----------



## mrvanity

Guys consider using a newer version of Swype.
I remind that i am using version _3.26.92.35548_ with success.

I've quickly tried the mod in 3.9.86.27849 and it didn't work (i get the invisible effect as well)
I'll try it again tomoroow..


----------



## DashingGentleman

Guys, please see my edited post above - I was being a spaz and it works now!

mrvanity - as far as I know the version you are using does not have the toggle to make the keyboard smaller and drag it around, which is very useful indeed - swyping across 10" of screen is a bit silly. Please correct me if I'm wrong.
The version I'm using seems to be the latest honeycomb version which allows a wide selection of languages (I need Polish).

And thanks again for finding the solution to our rotation and error message woes!

EDIT:
More findings. If you edit display1_SwypeScreen.ini you can change the size of the mini keyboard. I would like it to be a bit smaller - matching the size of swype on a 4-5" phone. Adjusting the values to approximately 3/4 the initial size (220/429) works perfectly as far as functionality is concerned, but the right side drag-handle is positioned wrong - it is drawn as if the keyboard was still the original width. It seems this offset is either hard-coded somewhere or my changes break the code which assembles the various images together. I might play around some more later.

EDIT2:
OK, got it. It seems the code for drawing the "handles" on the mini keyboard references the sizes of the drawable image files. I simply batch resized all the keyboard layout images (/assets/keyboards/display1_* files, excluding a couple of icon/glow images) to 429x218 pixels and changed the lines in the display1_SwypeScreen.ini file to match (ScreenHeightLS = 218, ScreenWidthLS = 429 etc...) For me, the smaller mini keyboard is still accurate and faster to use.


----------



## mrvanity

The invisible keyboard problem was due to the value _XGA in the display0_SwypeScreen.ini
The resolutions tha Swype can "recognize" are stored in  /com/android/swype/inputmethod/ScreenType.smali
While the value _XGA exists in newer versions , it's not there in v.3.9.86.27849
Changing from _XGA to _WXGA did the trick.
@DashingGentleman. You are right. In the newer versions the resize button doesn't exist. (i didn't knew this feature at all) It is quite handy actually 

P.S. I dont mind the keyboard being full size. It was the lack of a beautiful greek ICS keyboard that urged me into digging into Swype
I've already modded 3.26.92.35548 for my smartphone so i had it handy








Great findings there


----------



## minist

I did find it after some googling, thank you dashing!

I've used v.3.9.86.27849, has anyone tried using the image files from the 3.26.92.35548 apk?  Much prefer the darker colours myself.


----------



## oswade

Ah yes, i forgot to say that i edited the ini exactly as mrvanity did, except for the wxga bit which i left in. Lol!

Figured since its intended only for the wxga screen, better not to change it. My intuition paid off .

Thanks for the tip about display1 ini, i might play around a bit to see what works good.

Also, the keyboard (fullsize) seems slightly blurry in portrait mode. I wonder if the dpi is causing this, or the keyboard images...


----------



## izeltokatl

You don't have to hack Swype to get it to work. Just go grab the galaxy nexus Swype from Droid Life. They posted the file for the nexus months ago. I used it on my rezound. And just by chance used it on my new touchpad.works awesome. No mods necessary.

Sent from my GT-i9100 using Tapatalk


----------



## minist

I think that version of swype you mention has been edited by someone, and it was distributed to the annoyance of the Swype team! Apparently they have an ICS version coming out soon though, interesting to see if that works.


----------



## Rakeesh

Don't suppose somebody who has this working perfectly on CM9 on the touchpad could post a diff patch for the downloader/installer and another diff patch for the downloaded apk?


----------



## tekrhino

izeltokatl said:


> You don't have to hack Swype to get it to work. Just go grab the galaxy nexus Swype from Droid Life. They posted the file for the nexus months ago. I used it on my rezound. And just by chance used it on my new touchpad.works awesome. No mods necessary.
> 
> Sent from my GT-i9100 using Tapatalk


Thanks for the tip but all those links are now dead. A Google search led me to a site called Wuala
and was able to dl the apk there. I got Swype working on my TP now, thanks again.


----------



## mistermojorizin

i tried the galaxy nexus swype, it only worked in portrait but not landscape. Tried the version 3. 26 swype and it worked in landscape but not portrait. So I used these instructions, which were very helpful, don't get me wrong, but were kinda hard to follow. So here's what I did, with a little more detail. If you like it, add it to the OP, if not, it's here.

1) we are looking for the file called "swype-installer.apk" - it is in the download folder of the SD card after going to this site https://beta.swype.com/android/get/ on an android device and loging in with your beta credentials. "swype-installer.apk" is not the swype installer. It is the installer of the swype installer. swype installer file looks like swype_3.26.92.apk. that file installs swype. that is why the first direction was confusing. Anyway, get swype-installer.apk on your computer.

2) download apktool. Which actually means download 2 files. APK tool and apktool-install-windows. They are 2 zip files, unzip them into the same directory you have your swype-installer.apk in. this was another point of confusion, because i downloaded apktool per instructions and unzipped it and it was useless without downloaading the helper files.

3) go into dos promp by typing cmd under the search in your start menu. use th e dos command cd to get to the directory you have your apktool and apktool helpers and the swype-installer.apk.

4) type in apktool d swype-installer.apk at the dos prompt. this should create a directory called swype-installer. in windows, go down to swype-installer\smali\com\swype\android\installer . this directory has a bunch of files that look the same. you need to carefully find InstallerService.smali.

5) double click the file, windows will ask you what program to open it with. i chose notepad.

6) in notepad search for the exact strings that in the op that you have to change, there are many similar looking strings. the ones you want are about half way through the file, and are all next to eachother. I used the search capability of notepad to find them quickly.

7) SAVE the file after editing it. and close it.

8) your dos prompt should still be opened to the directory where you have your apktool. type in "apktool b swype-installer" - swype-intaller is the directory that will be built into an APK. and the new apk will be place inside that same directory in a subdirectory called dist. So mine was in swype-installer\dist

9) almost done. you have to sign your new apk. you have to download SignApk . It was a little hard finding it, ended up getting it from mediafire. The file was SignApk.rar . Extract it and it creates a directory called SignApk with a readme file in it.

10) In your dos promp, switch to the SignApk directory. In windows drag and drop your new APK file into that same directory as well. Now in dos type: signapk.jar testkey.x509.pem testkey.pk8 swype-installer.apk swype-installer-signed.apk . Half of this command was given in the sined apk readme file. Just had to plug in the name of the input and output files. So now it creates a file called swype-installer-signed.apk and this file will be in your signapk directory.

11) get the file over to your touchpad and install it (make sure that allow files to be installed from unkown sources is checked in settings). this file is not the swype installer. it installs the swype installer. then you have to run the swype installer, login with your beta credentials and download the file that will install swype.

hope that helped someone, because it was really hard to figure all the details out. but i did learn a bunch. so that's always good.


----------



## viper3two

mistermojorizin said:


> 1) we are looking for the file called "swype-installer.apk" - it is in the download folder of the SD card after going to this site https://beta.swype.com/android/get/ on an android device and loging in...........
> 
> hope that helped someone, because it was really hard to figure all the details out. but i did learn a bunch. so that's always good.


THANK YOU! Worked a treat here. Easy to follow instructions. Good job.


----------



## mistermojorizin

viper3two said:


> THANK YOU! Worked a treat here. Easy to follow instructions. Good job.


thanks for the feedback good to know it made sense to someone else


----------



## dudemaaan

Apparently there's a new beta released. Has anyone tried it? I'm using the 3.9 with resizable keyboard, but even though it has a higher version number than the latest betas, the betas are newer versions and seem more accurate. I really like having a resizable keyboard though, any idea if the latest beta is resizable?


----------



## dudemaaan

If anyone locates Swype v3.26.92.38303 (latest for ics) as an external download could you pm it to me so I can modify it.

I switched back to the previous beta version of Swype from 3.9. Even though I really like the resizable keyboard it's just not near as accurate as the latest betas.


----------



## Nick99EXB

I modified the installer according to the instructions above and in the OP. Installed great. The only bug I have seen is that the word prediction area that automatically appears above the keyboard does not appear in landscape mode. It is probably hidden under the keyboard or something. I can live with it. Thanks again.


----------



## dudemaaan

Nick99EXB said:


> I modified the installer according to the instructions above and in the OP. Installed great. The only bug I have seen is that the word prediction area that automatically appears above the keyboard does not appear in landscape mode. It is probably hidden under the keyboard or something. I can live with it. Thanks again.


Ha I didn't even pay attention to the first post. I've been decompiling the individual app (downloaded 3rd party) and modifying it to fit.
Will try the other method now thanks for posting


----------



## oswade

dudemaaan said:


> Apparently there's a new beta released. Has anyone tried it? I'm using the 3.9 with resizable keyboard, but even though it has a higher version number than the latest betas, the betas are newer versions and seem more accurate. I really like having a resizable keyboard though, any idea if the latest beta is resizable?


The version numbering is confusing but, I believe 3.26 is higher and newer than 3.9. think of it as 26 not 2.


----------



## dudemaaan

Worked perfect. Now on the latest Swype. Just wondering why they ditched the smaller key board in the latter versions


----------



## jamesg

What a pain just to setup...I adjusted the signed-apk for resolution 1024x768. Ended up giving me the same BS about screen size error when installed. So I manually installed the actual swype .apk, initially the keyboard in portrait was misalligned. However opening the swype installer for a second time, I did not get the error, and finally hitting finish did it. Now it occupies correct amount of space in portrat and landscape (no blank space like the OP screenshot). Designed for ICS and all.


----------



## minist

jamesg said:


> What a pain just to setup...I adjusted the signed-apk for resolution 1024x768. Ended up giving me the same BS about screen size error when installed. So I manually installed the actual swype .apk, initially the keyboard in portrait was misalligned. However opening the swype installer for a second time, I did not get the error, and finally hitting finish did it. Now it occupies correct amount of space in portrat and landscape (no blank space like the OP screenshot). Designed for ICS and all.


Jamesg, what do you mean by 'manually installed'?


----------



## jamesg

minist said:


> Jamesg, what do you mean by 'manually installed'?


By that I meant I grabbed the actual apk which installs Swype (not the downloader you get from the Swype website). you can find it on phones that have Swype installed in data/app (root access).

Sent from my mind using Tapatalk.


----------



## minist

Wow, so you're saying that the latest swype version works fine without any of the editing mentioned?

Excellent


----------



## Jimmy8881

thanks jamesg, its working great! yes no need to modify or install the installer in any way.


----------



## JohanX

Jimmy8881 said:


> thanks jamesg, its working great! yes no need to modify or install the installer in any way.


I don't know which installer you used, but I just reinstalled the official version from the Swype web site and it bitched about the touchpad screen size.

Fortunately I had backed up my hacked version....

Sent from my cm_tenderloin using Tapatalk


----------



## minist

well if you're able to get hold of the actual 'swype.apk' not the swype installer it will install and work..though in my experience it was a bit temperamental in it's landscape behaviour, sometimes covering the whole screen and sometimes not!

Would be a lot better if there was still the short keyboard option..if you could make it like a moveable keypad that would be perfect!


----------



## yarly

Updated the OP to give better directions based on you all's comments so far and also updated to work with ICS.


----------



## jamesg

@Yarly , Editing the swype downloader, does this simply allow you to install swype or does it install a specified version of swype?


----------



## daonei

How is Swype in comparison to SlideIT? Is it worth going through this process?


----------



## harry66

daonei said:


> How is Swype in comparison to SlideIT? Is it worth going through this process?


I have paid for SlideIT installed on the TP, but just was not happy with it compared with Swype on my SGS phone - e.g. Slideit auto-corrects manually typed words - really annoying.
Just went through the above steps to sign a modified Swype installer and swtiched over to Swype on the TP. Much more to my liking!


----------



## yarly

jamesg said:


> @Yarly , Editing the swype downloader, does this simply allow you to install swype or does it install a specified version of swype?


It installs swype as if your device supported it by default. In other words, you get all the same setup/install options you would get if you had it on your phone with the installer. That means you get other language support and such. It also assures you get the most optimal resolution for swype (not sure if you'll get 1280x720 otherwise). It's also useful for those that cannot get the swype apk from another android device.


----------



## manicmarvin

I tried the repacking method and I expect being a newbie I may have done something wrong but I still had the error messages and the keyboard was just wrong. However, the new version of Swype was downloaded to my GSII a few weeks back and I just copied and installed the apk (com.swype.android.inputmethod-1.apk) onto my Touchpad running CM9 Alpha2. Works a treat, initially the landscape keyboard was to the right but once I rotated the screen it was fine, full width in both landscape and portrait and no nags.

Swype is the best keyboard I've used and to get it working on my Touchpad is just class.

Manic.


----------



## Salvation27

What version apk of Swype is allowing you just to install and work in landscape and portrait modes for ICS Alpha 2.0?
I'll google and download, just let me know which version to use.


----------



## Salvation27

Bueller?


----------



## yarly

Salvation27 said:


> What version apk of Swype is allowing you just to install and work in landscape and portrait modes for ICS Alpha 2.0?
> I'll google and download, just let me know which version to use.


This is a thread about modding the official swype installer to work on the touchpad. Not where to find swype through unofficial means that swype does not support or condone.

If you have questions about that, feel free to ask and I or someone will answer. Otherwise, please respect the topic of the thread.


----------



## Salvation27

yarly said:


> This is a thread about modding the official swype installer to work on the touchpad. Not where to find swype through unofficial means that swype does not support or condone.


Understood, however individuals have stated that they used a particular version and did not need to MOD. Also, understood that stating which version and where to get it is (Unofficial means). But, "modding" is just the same in my opinion. You're still taking their product and changing around for your advantage. Also, even though we aren't them, XDA allows this (yeah, go ahead and tell me to search there because I am doing so anyways.)

This is a "helping" community, and swype is free. To each their own buddy........

Also, I did asked a question, didn't know it had to specifically for someone. Hence waiting for an answer


----------



## yarly

Salvation27 said:


> This is a "helping" community, and swype is free. To each their own buddy........


I'm not going to argue this anymore after this. But if you keep bumping this thread with your request and thread jacking, I will ask a mod to intervene.

From the rules on rootzwiki:



> Rule II-a: "*RootzWiki cannot and will not provide a platform for the advertising, promotion, or advocacy of distributing illegal content including "warez", paid market applications (without developer consent), or any other form of software piracy or illegal activity. Offering applications already available in the Android Market or via other distribution channels is discouraged unless you are the developer or other copyright holder and entitled to such distribution. If you wish to encourage a reader to download software, we suggest you post links to the corresponding market Web Page as this allows developers to get proper feedback for their app.*"


Swype is free as long as you follow the terms of service. The mod in this thread redistributes nothing and requires fetching directly from Swype. Their ToS says do not redistribute through unofficial channels and rootzwiki and xda have both agreed to do so is warez. Asking where you can find it indirectly is just the same as actually giving you the apk. Even themes for swype are not the actual apk of swype for this reason.

And don't start quoting me on "helping" in my own "help/mod" thread that I've spent hours helping people to do things in a kosher way, it's rather quite rude.


----------



## yarly

daonei said:


> How is Swype in comparison to SlideIT? Is it worth going through this process?


It's all about preference. If you like Swype better, then it's worth it. If you are happy with slideIT, then probably not.

Also, updated the OP again a bit to give a few more details on the process. Any other suggestions are welcomed to make it more clear to anyone having troubles or wanting to try it. I may even do a screencast if anyone thinks it will help them.


----------



## Trips555

This doesn't seem to totally work with Touchpad set to 120dpi... the portrait works, but landscape is too small. Is it possible to tweak it for 120?


----------



## Trips555

Scratch that... works great! Thanks!


----------



## Trips555

Damnit... all google apps (GTalk, GMail, for some reason) make the input box fill the screen! Any chance there's a way to fix that? It makes it very unusable!


----------



## yarly

Trips555 said:


> Damnit... all google apps (GTalk, GMail, for some reason) make the input box fill the screen! Any chance there's a way to fix that? It makes it very unusable!


screenshot?


----------



## wizzbang3

I really wish swype would just officially support the touch pad already.
All this hackery is difficult and time consuming. It would be much easier to just download it.


----------



## yarly

wizzbang3 said:


> I really wish swype would just officially support the touch pad already.
> All this hackery is difficult and time consuming. It would be much easier to just download it.


I agree. I posted a request on their forum months ago, but I don't think they have any plans, since they make their money off swype going directly to OEMs and not devices like the touchpad.


----------



## Trips555

It's tough to see, since the background is white, but basically this is in GTalk, in landscape mode, and it covers the whole GTALK area with the big white input box.


----------



## yarly

Oh yeah, that sort of screen. I haven't decided if it's Swype that triggers that or the layout from the app, since it is not always consistent. I'll see if there is a way for Swype to ignore it though since it would work without the popup I'm sure. I was just kind of "dealing" with it since I started using Swype on the touchpad by keeping it in portrait mode as much as possible. However, there's a few times when that does get annoying.


----------



## mrvanity

Its Swype who triggers it.
Even the new ics beta version ,is phone orientated.
If you try the honeycomb version the problem does not exist.


----------



## hejay

I have the newest version for ICS, and if I try to reinstall it unmodified, it just scrunches everything to the left side (doesn't fill the whole screen). Is there something you guys are doing differently that it scales correctly?


----------



## hejay

I found that my problem was that I had auto-rotate disabled. Once you toggle the orientation, you're right as rain. Thanks guys.


----------



## yarly

mrvanity said:


> Its Swype who triggers it.
> Even the new ics beta version ,is phone orientated.
> If you try the honeycomb version the problem does not exist.


I guess I should have elaborated. I didn't know if it was something in the xml layout of the app that triggered swype to show it or not, since it doesn't do it for every app in landscape.

I'll try looking into it this weekend though and see if I can just remove whatever swype is detecting from the ICS version. I haven't tried forcing it to 1280x800 though, that might make it think it's tablet or it might not work at all with the tablet.


----------



## Salvation27

Thank you guys.......This helping community rocks!!!!!


----------



## krackers

Does anyone have the mentioned honeycomb swype apk? If anyone does, can they pm it to me?


----------



## jastonas

Is it wrong to ask for a working swype apk for 1024x768 resolution to be send with pm?


----------



## yarly

jastonas said:


> Is it wrong to ask for a working swype apk for 1024x768 resolution to be send with pm?


Yes, if you're asking me to do so it is.


----------

