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

Search This thread

knaries2000

Senior Member
Apr 13, 2009
172
12
Sorry to hear that your nc won't boot. Unless the upload or download is corrupted I didnt have any problems with that frameworks. I just did exactly what the instructions said in the op. You should be able to just flash 3.1 Rom again without wipe. It will restore the original framework. Is anyone else having issue with that frameworks file? I can take it down in case the upload was corrupted.
 

n0xx187

Senior Member
Jan 1, 2011
74
5
I used the .32 beta 3.1 one you uploaded and got FC at start up of the OS and my task bar would randomly FC to im going to make my own today and see whats up..

Edit.. any one know how to run this command on mac?

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

Thanks
 
Last edited:

n0xx187

Senior Member
Jan 1, 2011
74
5
Ok so I booted up Windows installed the java SDK set my Environment variables and JAVA_HOME...But im getting a Main Class error when trying to execute the Command Java> -jar baksmali.jar framework.jar..

I think i need to set a class path or some thing like that but I dont know any thing about coding.. If one of you Java guys could help me out and point me in the right direction that would be awesome.. I was looking on the java wiki but that just confused me a bit.

Thanks

Edit: Ok so I tried the same thing on my mac and I get
Code:
Java> -jar baksmali.jar framework.jar
Exception in thread "main" java.lang.NoClassDefFoundError: baksmali/jar
Caused by: java.lang.ClassNotFoundException: baksmali.jar
	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
 
Last edited:

the_duck

Member
Feb 12, 2011
19
3
Works on NC w/CM7.0.3 & Dalingrin's OC kernel [4/04/11] at 1100mhz!

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.

Thank you! Downloaded your "framework.jar.zip" file & did the following:

  1. renamed it "framework.jar"
  2. then put it in my dropbox folder on my PC
  3. used ES File Explorer (with following settings checked: Root Options/Root Explorer [X], Mount File System [X])
  4. went to "system --> framework --> framework.jar (long press then "cut", then navigated to sdcard root and then menu/operations/paste to have as a backup)
  5. navigated to dropbox folder on sdcard, long press your "framework.jar" file then cut
  6. navigated back to "system --> framework" folder, then menu/operations/paste
  7. exited & rebooted and now works (reboot took a little longer, but ended up OK)

if you have problems figuring out how to use ESFile Explorer, I basically followed the same steps I used to get the Netflix app working on my NC (device wasn't supported so I had to change the "build.prop" file entry on my device to Nexus S). If you're interested in that video, go to YouTube & search for this (I'm not able to post external links yet): How to get Netflix to Work on the Nook Color and Other Non-Supported Android Devices

My Device: Nook Color running CM7.0.3 & Dalingrin's OC kernel [4/04/11] running at 1100mhz


WOOT!
 
  • Like
Reactions: meade18

martian21

Senior Member
Sep 12, 2010
308
42
Fort Wayne, IN
Here is a framework.jar for CM7 beta 3.1

Made the switch to the CM7 beta 3.1 and needed to get my Swype back.

Attached is a modified framework.jar from the "update-cm-7.1.0-RC0-encore-2.6.32-beta3.1" ROM

Standard Disclaimers apply: Use at your own risk, I take no responsibility...

DO NOT FLASH WITH CLOCKWORKMOD! - unzip and add with Root Explorer.

Martian21
 

Attachments

  • framework.zip
    3 MB · Views: 56

philburkhardt

Senior Member
Aug 30, 2010
1,109
270
47
Seattle Basestar
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!
I was wondering this too. Some apps, like Gameloft games, are specifically looking for 15 digits.

Does anyone know where to add the 15th digit? Does the placement of the dashes matter?

Edit: I don't think it matters for the nook. Didn't do what I wanted it to though. Oh well, back to the drawing board.
 
Last edited:

martian21

Senior Member
Sep 12, 2010
308
42
Fort Wayne, IN
Here is a framework.jar for CM7 Nightly 82

Attached is a modified framework.jar from the "cm_encore_full-82.zip" ROM

Standard Disclaimers apply: Use at your own risk, I take no responsibility...

DO NOT FLASH WITH CLOCKWORKMOD! - unzip and add with Root Explorer.

Martian21
 

Attachments

  • framework_82.zip
    3 MB · Views: 54

BroDroid

Member
Oct 4, 2010
49
2
Denver
Attached is a modified framework.jar from the "cm_encore_full-82.zip" ROM

Standard Disclaimers apply: Use at your own risk, I take no responsibility...

DO NOT FLASH WITH CLOCKWORKMOD! - unzip and add with Root Explorer.

Martian21

what will happen if I use this framework file wit nightly 83?

Sent from my Droid
 

hoyer801

New member
May 13, 2011
1
0
Not wanting to risk it, I went through the lengthier process of extracting the framework.jar from the nightly 85 build and went from there rather than using the attached file.

It works beautifully. Really appreciate the instructions.
 

DizzyDen

Senior Member
Feb 7, 2011
1,301
567
I was wondering this too. Some apps, like Gameloft games, are specifically looking for 15 digits.

Does anyone know where to add the 15th digit? Does the placement of the dashes matter?

Edit: I don't think it matters for the nook. Didn't do what I wanted it to though. Oh well, back to the drawing board.

If you look at the instructions in the original post... there's a "3" skipped in the last set of numbers.... That is where the 15th digit would be.

Currently I am testing with my 16 digit serial number... if it doesn't work I'll drop the last digit (the last 4 are 0's on mine anyway) and see how that works.
 

DizzyDen

Senior Member
Feb 7, 2011
1,301
567
One possible issue I see with the OP's method....

The line references will be thrown off... look just above the GetDeviceID section we are replacing.... there's a reference to .line820.... however after the change line 820 is not the original line 820... thus the call to that line will not work correctly....

I am working on a method to replace the same number of lines we are removing... more to come.

Actually... instead of modifying to replace same number of lines... I opted to try this method...
1. Replace the line ".method public getDeviceId()Ljava/lang/String;" with ".method public getDeviceId2()Ljava/lang/String;"
2. Go to the end of the file and paste the info from OP.....
Code:
.method public getDeviceId()Ljava/lang/String;
    .registers 4

    .prologue
    new-instance v1, Ljava/lang/StringBuilder;
   [b] const-string v2, "12-345678-901234-5"[/b]

    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

The bold above is corrected IMEI structure as noted Here.

NOTES:
You can (and should) chang the IMEI in bold above to match your device serial number... leaving extra 0's off.
You can also use 17 digit IMEI as noted in the above linked documentation.
You can also use the 16 digit serial number of your nook... this is known as IMEISVN schematic.
You should probably use 00-XXXXXX-YYYYYY-ZZZ or 00-XXXXXX-YYYYYY-ZZ since beginning 00 indicates "Test IMEI" by the international standards.
 
Last edited:

meade18

New member
Mar 5, 2011
4
0
Thank you! Downloaded your "framework.jar.zip" file & did the following:

  1. renamed it "framework.jar"
  2. then put it in my dropbox folder on my PC
  3. used ES File Explorer (with following settings checked: Root Options/Root Explorer [X], Mount File System [X])
  4. went to "system --> framework --> framework.jar (long press then "cut", then navigated to sdcard root and then menu/operations/paste to have as a backup)
  5. navigated to dropbox folder on sdcard, long press your "framework.jar" file then cut
  6. navigated back to "system --> framework" folder, then menu/operations/paste
  7. exited & rebooted and now works (reboot took a little longer, but ended up OK)

if you have problems figuring out how to use ESFile Explorer, I basically followed the same steps I used to get the Netflix app working on my NC (device wasn't supported so I had to change the "build.prop" file entry on my device to Nexus S). If you're interested in that video, go to YouTube & search for this (I'm not able to post external links yet): How to get Netflix to Work on the Nook Color and Other Non-Supported Android Devices

My Device: Nook Color running CM7.0.3 & Dalingrin's OC kernel [4/04/11] running at 1100mhz


WOOT!

this worked perfectly, thanks (i don't know how to "thank" you so your thanks meter goes up, sorry.
 

mthe0ry

Senior Member
Feb 13, 2011
79
26
Hey all,

Huge thanks to all the guys who are posting updated frameworks for the nightlies and other mods!

Just wanted to address a few concerns and questions I saw here:

First, If you see "Device ID does not match" that is a validation from the Swype servers that is essentially saying "hey, the IMEI on this device is not the IMEI that you registered (first used) this beta account for". Likely what you are doing is trying to use your swype beta account from your phone on your nook as well. This won't work. You need to create a new beta account, which is as simple as supplying/creating a new email address (so long as the Swype beta remains open......)

Also, as a poster astutely pointed out, the .line flags no longer are aligned with how they were originally when you recompile the smali code. My understanding is that the .line codes are inserted by smali to increase readability and there is no harm in not making them strictly "correct". This is why the recompiled version with incorrect .line tags still works.

As for the 15 digit imei vs 16 digit imei etc questions, really I have no answer for that. I simply went off the wikipedia page which claims there are valid forms of imei that are 15 digit and valid forms that are 16 digit. I went with the 15 digit because the 16 digit supposedly encodes a software version, which I worried might mess with other programs. http://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity

Apparently the IMEI standard is pretty 'ad-hoc' at best... they change the standard to match what is needed seemingly arbitrarily. This might explain why the API call to get the IMEI in android involves no validation logic whatsoever, and it is returned as a string (which therefore does not preclude weird things like dashes).

I suspect you could put just about *anything* in the return statement and it would work. If it doesn't, it's probably logic at the application level which is rejecting it, and at that point it's anyone's guess what validation they are using...
 

DizzyDen

Senior Member
Feb 7, 2011
1,301
567
Hey all,
Also, as a poster astutely pointed out, the .line flags no longer are aligned with how they were originally when you recompile the smali code. My understanding is that the .line codes are inserted by smali to increase readability and there is no harm in not making them strictly "correct". This is why the recompiled version with incorrect .line tags still works.

As for the 15 digit imei vs 16 digit imei etc questions, really I have no answer for that. I simply went off the wikipedia page which claims there are valid forms of imei that are 15 digit and valid forms that are 16 digit. I went with the 15 digit because the 16 digit supposedly encodes a software version, which I worried might mess with other programs. http://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity

Apparently the IMEI standard is pretty 'ad-hoc' at best... they change the standard to match what is needed seemingly arbitrarily. This might explain why the API call to get the IMEI in android involves no validation logic whatsoever, and it is returned as a string (which therefore does not preclude weird things like dashes).

One issue I have with your adressing this is.... if you extract the modified TelephoneProvider.smali the line numbering is NOT changed... so smali is NOT compiling them on the fly.... this is specifically why I change function getDeviceID() to getDeviceID2() and append modified getDeviceID() to the END of TelephonyProvider.smali... this will minimize any potential problems we may not see as of yet.

As for 15, 16 or 14 and/or 17 digit IMEI's... of which ALL are correct... the number of digits indicates which version was in effect at the time the IMEI was generated.... I chose 17 digits so I can include as many digits of the device serial number possible... thus minimizing potential for duplicate IMEI's.

Additionally, according to the standards... you should at least begin the IMEI with 00- to indicate it is a "test" IMEI. While perhaps still not 100 "legal" or "legit"... it should at least be used to minimize potential conflict with an existing user IMEI.
 

Stroid01

Senior Member
Nov 5, 2010
320
45
Atlanta,GA
New to nook modding...but not new to xda.

the original post includes framework for phiremod v6.1 but currently we are on v6.2 my assumption is the frameworks are different. Can anyone confirm if it will work or not? Or if there is an updated framework for that v6.2? Thanks for the help.
 

n0xx187

Senior Member
Jan 1, 2011
74
5
New to nook modding...but not new to xda.

the original post includes framework for phiremod v6.1 but currently we are on v6.2 my assumption is the frameworks are different. Can anyone confirm if it will work or not? Or if there is an updated framework for that v6.2? Thanks for the help.

I dont use phiremod but from using cm7 im going to say that the v6.1 wont work on the v6.2 I would just make my own that way you can use ur SN or ur mac address si you dont have the same as everyone else
 
  • Like
Reactions: Stroid01

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.
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