- Rooted device
- adb (http://developer.android.com/sdk/index.html)
- apktool (https://code.google.com/p/android-apktool/)
-
Pull SystemUI.apk off the device
$ adb pull /system/app/SystemUI.apk
-
Install the framework (only necessary on non AOSP builds)
$ apktool if SystemUI.apk
-
Decompile the apk
$ apktool d SystemUI.apk
-
Modify
SystemUI/res/values/bools.xml
quick_settings_show_rotation_lock
totrue
-
Recompile the sources and create
SystemUI/build
$ apktool b SystemUI SystemUI-tmp.apk
-
Extract and copy
META-INF
andAndroidManifest.xml
from the original SystemUI.apk toSystemUI/build/apk/
-
Recompile the apk
$ apktool b SystemUI SystemUI-modified.apk
-
Zipalign the apk
$ zipalign -v 4 SystemUI-modified.apk SystemUI-modified-zipaligned.apk
-
Backup the old SystemUI.apk
$ adb shell cp /system/app/SystemUI.apk /system/app/SystemUI.apk_bak
-
Push the new apk to the device
$ adb push SystemUI-modified-zipaligned.apk /system/app/SystemUI.apk
I tend to do everything in recovery so I can easily mount /system as rw. To boot in recovery:
$ adb reboot recovery