[Atrix 4G Q&A, Help & Troubleshooting] Gandalf:
hello everyone

I have updated to kennethpenn's 4.5.91 Gingerbread Beta 4 (must say, it is truly a phenomally put together build !)

I have also noticed that many of the mods that i had applied to 1.8.3 have not been updated for 4.5.91, so i decided to make the changes myself.

Now, I have a pretty decent knowledge of Unix-based operating systems ( I have used Red Hat Linux, Ubuntu, SUSe Linux, OpenBSD, FreeBSD, Solaris, and now OS X) however, I would like to expand my knowledge to include Android.

The first one I attempted to do myself was the Wake on Volume Keys mod.

This is a very simple change to the android.policy.jar file, as you all well know.

For this, I used Windows XP, simply for the fact that I have 7zip and PeaZip installed on it. However, I can do all of this on OS X as well. The file archiver applications I have on OS X are:

1. The Unarchiver

2. Keka

I am going to list my method of applying this edit, and i would ask that someone with solid knowledge on this subject give me their feedback and guidance.

---------------------------------------------------------

My Method of editing android.policy.jar

---------------------------------------------------------

1. Using Root Explorer, I made a copy of /system/framework on my External SD Card

2. Mounting the Phone for USB Mass Storage on Windows XP that I have running in VirtualBox on my Macbook Pro, I moved the copy of the /system/framework directory to my Desktop

3. I downloaded smali-1.2.6.jar and baksmali-1.2.6.jar from code.google.com/p/smali/

4. I placed both of these .jar files in the copy of the framework-edited directory that I created on my Desktop

5. I renamed smali-1.2.6.jar to smali.jar and baksmali-1.2.6.jar to baksmali.jar for simplicity's sake

6. I moved the android.policy.jar file to /framework-edited directory on my Desktop

7. Using 7zip (I also have PeaZip, but for this, I used 7zip, if you think I should use PeaZip, please tell me) I extracted the files from android.policy.jar to end up with classes.dex and META-INF. I then moved classes.dex to /framework-edited so it is in the same directory as smali.jar and baksmali.jar

8. In Command Prompt, I entered:

cd C:\Documents and Settings\Owner\Desktop\framework-edited

in order to be working from the proper location where my files are located

9. Now, having Command Prompt working in the proper location, I entered the following commands:

java -jar baksmali.jar -o classout/ classes.dex

to create a new directory within /framework-edited called /framework-edited/classout

10. I then opened the /classout directory, and navigated to /classout/com/android/internal/policy/impl/ and opened the file KeyguardViewMediator.smali with Notepad

11. I used [Ctrl] + [F] to locate the line:

private isWakeKeyWhenKeyguardShowing(I)Z​

12. I then looked at the lines DIRECTLY below the above line, and following the Original Post on how to manually apply this modification, I removed lines:

0x18

0x19​

13. Upon removing these lines, I simply did a File -> Save As -> KeyguardViewMediator.smali and saved the file to my desktop

14. I [Cut] + [Pasted] the edited KeyguardViewMediator.smali file back to /classout/com/android/internal/policy/impl/ and replaced the original KeyguardViewMediator.smali file

15. With the edited KeyguardViewMediator.smali file in place, I went back to Command Prompt and entered the following commands:

java -Xmx512M -jar smali.jar classout/ -o new-classes.dex

To create a new file called new-classes.dex

16. Changing the name of new-classes.dex to classes.dex, I took the original META-INF file, and my newly created classes.dex files, and, using 7zip, created a new android.policy.zip archive

17. I renamed my newly created android.policy.zip to android.policy.jar, and transferred it to my External SD Card

18. Using Root Explorer, I navigated to /system/framework on my phone, and renamed android.policy.jar to 1122android.policy.jar.bac and [Copy] + [Pasted] my edited android.policy.jar to /system/framework

19. I then immediately powered off my phone, and rebooted into CWM Recovery, and cleared my Dalvik Cache, then rebooted the phone normally through CWM Recovery.

At this point, to my knowledge, I had successfully edited my android.policy.jar file and had manually added the Wake on Volume Keys modification, however, once the phone was fully booted and showing my lockscreen, I unlocked the phone as normal by sliding the slider to the right. As soon as the phone unlocked, I saw pop-ups for processes that had failed and were terminated. I'm not sure what the exact message the pop-ups had, but it was the normal pop-up message you get when a process force-closes. My only option was to click "Ok" so I clicked it, only to have another force-close pop-up.

Apparently, every single process on the phone had force-closed, BUT, the phone was waking when I press a volume key while the screen was off. I had no choice but to pull the battery out.

I decided to reboot into CWM Recovery and "install .zip from SD Card", Nottach's 1% Battery Mod / No Carrier Mod Uninstall Script

I installed Nottach's uninstall script because I hoped that it had an unmodified copy of android.policy.zip in it.

After installing the uninstall script, and rebooting the phone once again, I got to the lock screen, unlocked the phone, and found everything to be in perfect working order, just as before I edited anything,

But the Wake on Volume Keys mod was still applied!

So now, my questions / requests to all of you are:

1. Explain to me what I missed or did wrong that resulted in the force-closure of every single process on the phone prior to installing Nottach's Uninstall script

and

2. Educate me on the proper process that you developers use to apply small modifications such as this one to the android.policy.jar file, or any other related file on the phone for that matter.

My plan is now to change the color of the text on my lock screen (Clock, Date, and possibly Carrier) following this [Guide]

Any and all feedback is welcomed and greatly appreciated, as you will be helping me learn the beginnings of modding and developing :D