[Android Software/Hacking General [Developers Only]] GalaxyUser:
Hello,

I searched a lot how to enable the rotation of the lockscreen without third-party application, and I finally found.

I share this change with you.

This operation works with all phones that work with GG / ICS (I have not tested on Cupcake / Donut. / Froyo / Honeycomb).

This tutorial seems very long, but this is explained in great detail for better understanding and to be accessible to all.

First and foremost: I am not responsible if you break, or if others problems occur on your phone. You and only you are responsible. Thank you :)

You must be root to apply the changes. Here's what happens on my Nexus S:

For this we will use apktool which will allow us to uncompil the framework-res.apk of your ROM and adb to replace the original framework.

Note: I see throughout this tutorial as well as adb and java (to run apktool) are already installed on your computer and the drivers too of your phone to work with adb.

Due to a bug in the framework of apktool ICS we are obliged to decompile the framework-res.apk with apktool 4.2 and recompile with apktool 4.3.

Download: apktool 4.2

Download: apktool 4.3

Note: Download in the same folder as adb, it's will simplify the task later.

In our case, we will consider that our working folder is: C:\android_debug

I recommend doing the same to be simpler.

apktool and adb only work with the command prompt, so it must be run.

To do this:

Windows XP: Start -> Run -> cmd.exe

Windows Vista / Seven: -> Start -> in the search bar type cmd.exe and press Enter

This window is displayed (a few lines of text can change, as the first of which is that your version of Windows):

We see that the command prompt is placed directly into your default user folder (here C:\Users\Thomas), so you have to stand in our working folder:

cd c:\android_debug

We will have to decompile framework-res.apk, if you have the rom zip place it in the same directory, otherwise it must be extracted from your phone.

Connect your phone to your computer and then, still in the command prompt (cmd) write:

adb remount

adb pull /system/framework/framework-res.apk

Note: if say toyou it can not find adb ... it's either you have him not placed in C:\android_debug where or that you should write its extension: adb.exe

The command will be this: adb.exe pull /system/framework/framework-res.apk

Will be the same for the rest of the tutorial, write adb.exe rather than adb.

The framework-res.apk is now in your working folder.

We will "install" the framework-res.apk to let apktool use it then:

java -jar apktool43.jar if framework-res.apk

There will now be extracted with apktool 4.2

java -jar apktool42.jar d framework-res.apk

If all goes well you usually this:

We must update the necessary files to activate rotation on the lockscreen.

Go to the following folder: C:\android_debug\framework-res\res\values ​​and open this file with your favorite files editor: bools.xml

Search config_enableLockScreenRotation value and change the false to true:

Save and close the file.

All changes are made, we will be able to recompile the framework :)

So back to the command prompt (yes the window of the 1970s :p)

Type this to run compiling the new framework-res.apk:

java -jar apktool43.jar b framework-res framework-res-new.zip

If all goes well the last message from the command prompt is this:

If you get errors like these:

Nothing serious! apktool just tells you it can not find default translations of some words, but he found in French / Or else.

Note: If you have other errors and framework-res-new.zip is not created is that you made a editing error or that you have the wrong version of apktool.

Now, everything is well and the framework-res-new.zip is created in your working directory (which I recall is C:\android_debug)

The purpose of the step is to replace the file resources.asrc in the original framework-res.apk by the new one placed in framework-res-new.zip

You should open it with your management software zip archives (WinRar here) and then extract the file resources.arsc:

Once the extracted file you can close the archive.

You must rename the file framework-res.apk in framework-res.apk.zip:

When this file is renamed you must open it with your management software archive and then delete the file ressources.arsc:

Leave open the archive and return to your working folder. You must drag the file resources.arsc previously extracted from the archive:

Commit the changes in your management software archive. Rename the file framework-res.apk.zip in framework-res.apk

So we are almost done, this last step is to replace the framework-res.apk in your phone. We will use adb, so back to the command prompt in order to type this:

adb remount

adb push framework-res.apk /system/framework/framework-res.apk

adb shell reboot

Explanations:

adb remount: allows you to have root privileges on the phone

adb push framework-res.apk /system/framework/framework-res.apk: sends the new framework-res.apk on the phone and replaces the existing one

adb shell reboot: reboot the phone

I hope this tutorial is clear enough and that helped you :)

For any spelling mistakes thank you for let me know by PM (I'm a french teenager).

[font=Arial, Verdana, sans-serif]If you like my work, pay me a coffee :)[/font]

​

GalaxyUser