[Nook Color General] mthe0ry:
Executive summary: I have put up new framework.jars for phiremod 6.1 and Cm7 stable at the bottom of this thread. The instructions for how to install it are at the bottom, just be sure to rename your file to framework.jar (the .zip extension is just so that XDA will accept it). For those who want to do this to their own custom ROMs that are not phiremod or CM7, I have included instructions on how to do so below.

After much slacking on my part I have finally updated this thread for those who cannot live without swype like myself. Find attached the jar for phiremod 6.1 and the stable release of CM7 for nook color.

In addition, I want to spread the knowledge on how to do this yourself, because the process is very simple and I may not be able to keep this thread maintained in the long run with the way my work has been recently.

To get started, pick out your ROM of choice and download it, open the .zip file (or in the case of images, mount the image) and locate the framework.jar file in /system/framework/ folder. I like to put this file in an empty folder, it can make things a little less confusing down the road.

Download smali and baksmali from here: http://code.google.com/p/smali/ store those two jar files in the same folder as your target framework.jar

Open the command line and navigate to your folder containing smali-x-.jar, baksmali-x-.jar and framework.jar. Once in the folder run the following command (in the case of version 1.2.6:

> java -jar baksmali-1.2.6.jar framework.jar

It will think for a while and then when done you will notice a folder called "out" in the directory.

Navigate to ./out/android/telephony and locate TelephonyManager.smali, and open it with notepad or any normal text editor

Search the document for the phrase "getDeviceId". You should find a section of code that looks like this:

.method public getDeviceId()Ljava/lang/String;

<<<lots of code here>>>

.end method

Obviously (or maybe not so obviously to those without coding experience) it is critical that you find the very next instance of .end method when selecting and replacing the block of code. If you go too far and find a .end method somewhere else, you can potentially delete more code than you want to. If necessary, scan through each line of code one by one so you make sure you aren't deleting some other method.

Once you have identified the code for getDeviceId only, select and replace that entire block of code with this

.method public getDeviceId()Ljava/lang/String;
.registers 4

.prologue
new-instance v1, Ljava/lang/StringBuilder;

const-string v2, "12-34567-89012-45"

invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

move-result-object v1

const-string v0, "Tag"

invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

move-result v0

return-object v1
.end method

If you feel like it, you can put anything you want in the string on line 5, in case you want a different IMEI than everyone else.

save and close TelephonyManager.smali

from the command prompt, make sure you are in your original folder with the 3 jar files in it and the out folder. Then run the following command (for smali 1.2.6:

> java -jar smali-1.2.6.jar -o classes.dex out

After some more thinking you will find a file classes.dex has been created.

open up your framework.jar file with your favorite zip editor. WinRar can handle this task and is free. Important distinction here: you OPEN the framework.jar file, do not EXTRACT it. Just open it so you can view the contents

once viewing the contents, you will notice a classes.dex file in the framework.jar file. Right click it and "delete".

then, add your modified classes.dex to the archive. In WinRar, you do this by right clicking on the whitespace and choosing "add files to archive"

once added to the archive, close out of the .jar file and you are done!

Your framework.jar file now has a modified TelephonyManager which will spoof your IMEI. this is the API call that Swype uses to verify your IMEI and issue you a license in the swype beta.

Note that this is likely only legal for the Nook Color. Do NOT do this for any device with a telephone radio. I repeat, do NOT do this for any device with a telephone radio. That could be illegal and is in most locales, and it would probably really mess your phone up.

-----

Original post describing how to install a modified framework.jar:

-----

Rename the attachment as framework.jar and replace your /system/framework/framework.jar

I used "mount system" app to mount system as writable, and terminal emulator to copy/rename the framework.jar file. Any method should work, really. As with any time you are messing with stuff in /system/, I suggest you make a backup of the original somewhere unless you don't mind doing a clean wipe.

Once that is done, sign up for the swype beta and download/install. Should work out of the box.

Still need a little bit of testing because I have not done much myself. Biggest concern of mine right now is I am not sure what kind of validation Swype servers do on the IMEI. The IMEI is hard-coded into the framework.jar file so everyone who downloads this file theoretically will tell the Swype servers they are using the same device. This might cause some server validation issues down the line, but its possible they didn't even anticipate this as a scenario.

Ideally, if this causes issues, I can modify the IMEI to be a derivative of the MAC address, so that way we are much less likely to have collisions, but I'd prefer to wait until we at least have an RC for CM7 before I do that - or even better get the change submitted to the encore branch if there is enough interest.