Default [Q] Help implementing a settings toggle!

Hi,
I've been trying to implement a toggle for my Galaxy Ace II X (running ICS 4.0.4). I wish for the toggle to allow the enabling of the "config_unplugTurnsOnScreen" boolean. I used this DIFF guide for reference (yes, I DID sort through the several mods in the DIFF guide) because I previously had success with the CRT animation toggle on that same page. (I substituted a lot of the AOSP lockscreen code for Unplug Screen On code) Instead of referencing to /system/framework/services.jar/smali/com/android/server/PowerManagerService$BrightnessState.smali, I referenced to the PowerManagerService$BatteryReceiver.smali in the same directory (because it is the only smali I could find that mentioned "mUnplugTurnsOnScreen"). I first modded the services.jar, and I used $3100 for the access (I compared the access used for the CRT animation with the rest of the services.jar and I got found a common factor, so I searched for the factor in my services.jar and I found the access I was looking for). It booted fine, no problems at all. Then I modded the SecSettings.apk. I thought I did a pretty good job with it. Pushed it to my device. When I opened the Display Settings and clicked on the toggle, Settings FCed. Same happened with the CRT animation toggle that I had previously implemented. Logcats revealed this:
Quote:
E/AndroidRuntime( 2805): FATAL EXCEPTION: main
E/AndroidRuntime( 2805): java.lang.NoSuchFieldError: com.android.settings.DisplaySettings.mUnplugScreen On
E/AndroidRuntime( 2805): at com.android.settings.DisplaySettings.onPreferenceT reeClick(DisplaySettings.java:773)
E/AndroidRuntime( 2805): at android.preference.Preference.performClick(Prefere nce.java:949)
E/AndroidRuntime( 2805): at android.preference.PreferenceScreen.onItemClick(Pr eferenceScreen.java:202)
E/AndroidRuntime( 2805): at android.widget.AdapterView.performItemClick(Adapte rView.java:292)
E/AndroidRuntime( 2805): at android.widget.AbsListView.performItemClick(AbsLis tView.java:1394)
E/AndroidRuntime( 2805): at android.widget.AbsListView$PerformClick.run(AbsLis tView.java:3024)
E/AndroidRuntime( 2805): at android.widget.AbsListView$1.run(AbsListView.java: 3830)
E/AndroidRuntime( 2805): at android.os.Handler.handleCallback(Handler.java:605 )
E/AndroidRuntime( 2805): at android.os.Handler.dispatchMessage(Handler.java:92 )
E/AndroidRuntime( 2805): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 2805): at android.app.ActivityThread.main(ActivityThread.jav a:4517)
E/AndroidRuntime( 2805): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 2805): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 2805): at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:993)
E/AndroidRuntime( 2805): at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:760)
E/AndroidRuntime( 2805): at dalvik.system.NativeStart.main(Native Method)
E/android.os.Debug( 1523): !@Dumpstate > dumpstate -k -t -n -z -d -o /data/log/dumpstate_app_error
I don't know what to do. I tried modifying all the code related to mUnplugScreenOn, but I'm dumbfounded. Somebody please help me out here. Or at least, lead me in the right direction. Though, I would prefer the first choice. Anyways, here are my SecSettings.apk and services.jar decompiled and zipped up. They might be a bit messy because I have numerous mods applied to them. This is my first real mod I've tried doing without any other guides or threads related to it. I would really appreciate the help. I think if I could knock down this mod, I discover a whole new realm of modding.

Samsung Galaxy Ace II X
(GT-S7560M) - Android 4.3.1 JB - CM10.2 with some bugs

Released Works:Status: Back on track


Press THANKS if I helped you in any way!