[JUSTWORKS] [UPDT 4/23/2011] Swype official beta working on NC CM7/IMEI Spoof

Search This thread

mthe0ry

Senior Member
Feb 13, 2011
79
26
Hey guys I just wanted to drop in and say SORRY I abandoned this post... For a while I was trying to get the code pushed into CM7 but it looks like there is just not enough developer interest and it is somewhat controversial as a practice to merge this code into the branch. If anyone has any difference of opinion there you are welcome to join me in fighting to have it put in our build.

Anyway I am at work right now but when I get home I will create a version of framework.jar for the stable release, a framework.jar for phiremod (what I'm using currently) and I'll also put up the detailed instructions on how I do it... It's not really that complicated, I'm a total Android noob although I do have a fair amount of coding experience. That way if I ever disappear again the resourceful among you guys can recreate it
 

iolinux333

Senior Member
Apr 15, 2008
465
63
I am looking forward to it. I paid for slideIT bit it refused to register to my reflashed nook. the company refused to refund me because they said I wasn't using an approved OS. WTF????? then they stopped responding. they are Thieves based in Israel.
 

mthe0ry

Senior Member
Feb 13, 2011
79
26
Finally updated this *****. I haven't tested both zips on both roms but I can't imagine what would go wrong during the process since it is so simple, both should work. However the IMEI may be different from my previous published version so you may need to re-register with swype under a different email if it doesn't work at first.

Please do let me know here if it works for you though.
 

jiixin

New member
Mar 26, 2011
2
0
Thanks for posting this up! Thought I'd try modifying the the code on a rooted 1.1 eclair but no go. Swype Installer gets to "fetching Swype versions" and then gives the "Swype Installation Failed. There was a data error..."
 

knaries2000

Senior Member
Apr 13, 2009
172
12
Thanks mthe0ry for this and the clear instructions on how to patch new framework. I took the liberty of patching cm7 7.0.1 following your instructions. It was quick and simple. In case anyone is interested.
 

Attachments

  • cm7-701-imei-spoof-framework.jar.zip
    2.9 MB · Views: 69

Cyphernaut

New member
May 1, 2011
1
0
IMEI numbers

Why is there only 14 numbers in the string? Shouldn't there be 15 digits for a proper IMEI or are the applications merely searching for the presence of the string? Thank you for your help in advance!
 

huxleyan

New member
Dec 30, 2010
3
2
I just patched the framework.jar file for CM7 7.0.3 using the method in the OP and pushed it to my Nook.

Swype and SiriusXM both work just fine.

It's attached, hopefully it will save a few people all the recompiling steps.
 

Attachments

  • framework.jar.zip
    3 MB · Views: 395
  • Like
Reactions: meade18

Top Liked Posts

  • There are no posts matching your filters.
  • 14
    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.

    1. 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.
    2. 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
    3. 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.
    4. Navigate to ./out/android/telephony and locate TelephonyManager.smali, and open it with notepad or any normal text editor
    5. 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
      Code:
      .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.
    6. save and close TelephonyManager.smali
    7. 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.
    8. 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
    9. once viewing the contents, you will notice a classes.dex file in the framework.jar file. Right click it and "delete".
    10. 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"
    11. 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.
    4
    Since I already did 7.0.1 mind as well do 7.0.2 too. here it is. I tested it on my nc and swype works fine. Agains, thank you mthe0ry for your work.
    2
    Hi Guys,

    I am aware there is some continued interest in this and I really want to get this pushed into CM7 as an official update. After just a little bit of cursory discussion in #nookie, most of the devs agreed a patch would *not* be illegal, because the nook does not have a cellular radio.

    As soon as I get some time to do some test builds and get some stable code, I will submit a CM7 patch. I am a bit of a Git/Gerrit noob so if someone here already has a repo and build environment set up and ready to go, it may be faster for me to simply tell someone else what files/methods to modify so we can get a working test build.
    2
    Thanks mthe0ry for this and the clear instructions on how to patch new framework. I took the liberty of patching cm7 7.0.1 following your instructions. It was quick and simple. In case anyone is interested.
    2
    here is one for .32 beta 3.1

    removed framework.jar for beta 3.1, people had problems boot after using it. didn't others to hit the same problems.