[Epic 4G Android Development] The_Legendary:
This is a guide to show you how to modify your own framework.jar to fix your rotation lag!!!!!

I am in NO way responsible for anything that happens to your device or PC in this process

This is my own experience and I will not guarantee that this will work for you but more was discussed in this thread by AmericanJedi001 http://xdaforums.com/showthread.php?t=1347012 and this thread by chris41g http://xdaforums.com/showthread.php?t=1143221

and Thanks to Americanjedi001 and Chris41g for their work into the rotation lag fix and making this guide possible :)

REQUIREMENTS

1.Java JDK 7u2 installed on your PC

2.AutoSmali to decompress/rebuild classes.dex(attached)

3.Rooted device

4.ES file explorer (or some other root explorer but I am using ES for this guide)

(I suggest wiping x3 first then doing a horizontal calibration. Don't calibrate after. Then I suggest fixing permissions once you are done)

Steps

1.Ok, so first you will need to download the Java JDK if you don't have it already. Here is a link:http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u2-download-1377129.html

When installing make sure to note where it is installing to. Usually C:/Program Files/Java/jre7/jdk1.7.0_02 Let it install.

2.Browse to your Java folder in Program Files. Browse to the "jre7" folder. Move the jdk1.7.0_02 folder and all it's contents to C:

3. Make a new folder on your C: drive named "framework" without the quotes.

4.Download the ES file explorer or use another root explorer. If using ES once it is installed open it up and hit the menu button, then settings, scroll down and make sure your home directory is just "/" without the quotes and the box ROOT EXPLORER is checked.

5.In ES browse to /system/framework and long press on the file framework.jar and select "copy". You will see a white box with a blue arrow appear at the bottom.

6.Now in ES browse to /sdcard and press the white box with the arrow and then press the framework.jar file and it will copy the file.

7.Now exit ES and plug your Epic into your PC. Browse to your Epic and you will see the framework.jar file that we just copied. Copy this file to the C:/framework folder we made earlier and after that you can delete it off of your sdcard from within windows.

8.Now open up command prompt and browse to the framework folder by using the command

then we will use the command

This will extract 1 folder and 2 files into the framework folder we created. Meta-INF, preloaded-classes, and classes.dex and it's easier to leave cmd open at this point

9.DELETE framework.jar from the framework folder and LEAVE the other 3. Download the AutoSmali.zip attached below and make a new folder on your desktop and name it AutoSmali. Extract the files from the zip into the AutoSmali folder. Also move the classes.dex file from the framework folder to the AutoSmali folder.

10.Open the AutoSmali folder and run baksmali.bat and it will open another command prompt window telling you to make sure that the .dex file is the only .dex file in this folder and press any key to continue.. after pressing any key it will start creating a new folder inside the AutoSmali folder named AutoBakSmali_Out. Wait for it to decompile and when it's done it will tell you to press any key and it will close.

11.Open the AutoBakSmali_Out folder and browse to /android/view/ and scroll to the bottom to find a file named "WindowOrientationListener.smali" Right-click this file and open with notepad.

12.In notepad you are looking for this line.

Now where it says .line 54 could also be .line 67. In CM7 it's 67 and in legendary rc2.2 it was 54 for me. So use the find function in notepad CTRL+F and search for either

.line 54

or

.line 67

because there is only one .line 54 or .line 67 in the whole file.

Once you find that line right under it, it will say const/4 v0, 0x3 and you will need to change and ONLY change the 3 in 0x3 to a 0 so it now looks like this.

13.Once you changed the 3 to a 0 you can now press CTRL+S and make sure it saves and then close out of Notepad. Now go back all the way to the AutoBakSmali_Out folder and you will see 3 different folders inside. These must be moved to the AutoSmali_In folder. The easiest way to do this is to highlight all three folders and an option to move the selected items will appear on the left side of the window. This will open another window. Browse to the AutoSmali_In folder and select move.

14.Run smali.bat and it will say make sure the folders you want compiled is in AutoSmali_In and to press any key... it will say it is being compiled so just wait and when it's done it will say press any key to exit. This will create a new file in the AutoSmali folder called "AutoSmali_Out.dex

15.Delete the classes.dex file from the AutoSmali folder and rename AutoSmali_Out.dex to classes.dex move this classes.dex back to the framework folder on your C: drive

16.Now either open back up cmd and browse to your framework folder or if you were a good boy you left it up. Now you have to recompile the framewrok.jar so make sure your old one is deleted and not still in there then run this command

This will make a new framework.jar file in the framework folder. Plug your Epic back in and copy this new framework.jar file to the root of your sd card.

17.Open ES file explorer on your Epic and browse to /system/framework and rename your old framework.jar to something else so you have a backup. Then browse to /sdcard and you will see the framework.jar file we just created. Long press and choose "move to" this time. It will open a small window and you will have to browse to /system/framework then press ok.

18.Now enjoy your lag-free rotation. You can delete all the files in the AutoSmali_In folder and the framework folder. I keep the rest because flashing to different roms or way different kernels seem to break this. I only use this framework.jar for the exact ROM and KERNEL I got the original framework.jar from. I switch back to the backup one before flashing. Then make a new one from tat framework.jar

Happy Hacking!!!!!!!!!​