[AT&T, Rogers, Bell, Telus Samsung Galaxy S III] shane87:
SecSettings.apk force closes

First of all, I want to give a HUGE thanks to loserskater for posting this and other mods! I have done quite a bit of programming, in Java, C, and C++, as well as scripting. However, I am still fairly new to smali. I implemented vlara's no ongoing wifi notification mod, and after much fighting with apktool and my phone, I finally got it working. Now I am trying to implement this mod, and I am having some trouble. I used apktool to decompile the SecSettings.apk that I built with vlara's ongoing wifi mod in it, which started off as a 100% stock SecSettings.apk from UCDLK3 official update. I followed the instructions in the op to a tee, rebuilt SecSettings, then extracted res, assets, resources.asrc, and classes.dex from the rebuilt apk and injected them into the original apk, overwriting the files in the original apk, but leaving the original AndroidManifest.xml and META-INF folder. Then I decompiled android.policy.jar with apktool (android.policy.jar was 100% stock UCDLK3), followed the instructions to a t, and rebuilt. Then I extracted classes.dex from the rebuilt android.policy.jar and put it in the stock android.policy.jar, overwriting the classes.dex in there. Then I pushed both files to my phone, set permissions, and rebooted. Everything boots up nicely, and my settings works, kind of. I can launch settings, and change my settings. However, when I tap "Display Settings" it force closes. I pulled a logcat, and the error seems to be in SecSettings/com/android/settings/DisplaySettings, in the onPreferenceChange method. After closely scrutinizing my DisplaySettings.smali with the mods, I can not find what I have done wrong. Everything looks identical to what loserskater posted.

If anyone wants to take a look at my SecSettings.apk file, I'll post it, and I'll post the logcat output from the crash as well.

Any help would be appreciated!!

My SecSettings.apk

[EDIT]FIXED LINK TO MY SecSettings.apk[/EDIT]

Logcat output (captured on my Ubuntu workstation with adb logcat):

I/InputReader( 771): Touch event's action is 0x1 (deviceType=0) [pCnt=1, s=]

I/InputDispatcher( 771): Delivering touch to current input target: action: 0x1

I/InputDispatcher( 771): Delivering touch to current input target: action: 0x1

I/InputDispatcher( 771): Delivering touch to current input target: action: 0x1

I/power ( 771): *** acquire_dvfs_lock : lockType : 1 freq : 1026000

D/PowerManagerService( 771): acquireDVFSLockLocked : type : DVFS_MIN_LIMIT frequency : 1026000 uid : 1000 pid : 771 tag : ActivityManager

W/ActivityManager( 771): mDVFSLock.acquire()

I/WifiEnabler(29565): Pause : 3

I/BluetoothPolicyService( 771): isBluetoothEnabled

D/KeyguardViewMediator( 771): setHidden false

D/AT_Distributor( 3429): gUartPath = dev/ttyHSL0

D/AT_Distributor( 3429): UART ttyHSL0 is used by console

E/AT_Distributor( 3429): Failed to init ATD

D/AbsListView(29565): Get MotionRecognitionManager

W/dalvikvm(29565): VFY: register1 v0 type 17, wanted ref

W/dalvikvm(29565): VFY: bad arg 1 (into Ljava/lang/Object;)

W/dalvikvm(29565): VFY: rejecting call to Ljava/lang/String;.equals (Ljava/lang/Object;)Z

W/dalvikvm(29565): VFY: rejecting opcode 0x6e at 0x01c0

W/dalvikvm(29565): VFY: rejected Lcom/android/settings/DisplaySettings;.onPreferenceChange (Landroid/preference/Preference;Ljava/lang/Object;)Z

W/dalvikvm(29565): Verifier rejected class Lcom/android/settings/DisplaySettings;

W/dalvikvm(29565): Class init failed in newInstance call (Lcom/android/settings/DisplaySettings;)

D/AndroidRuntime(29565): Shutting down VM

W/dalvikvm(29565): threadid=1: thread exiting with uncaught exception (group=0x415ee438)

E/AndroidRuntime(29565): FATAL EXCEPTION: main

E/AndroidRuntime(29565): java.lang.VerifyError: com/android/settings/DisplaySettings

E/AndroidRuntime(29565):	at java.lang.Class.newInstanceImpl(Native Method)

E/AndroidRuntime(29565):	at java.lang.Class.newInstance(Class.java:1319)

E/AndroidRuntime(29565):	at android.app.Fragment.instantiate(Fragment.java:577)

E/AndroidRuntime(29565):	at android.preference.PreferenceActivity.switchToHeaderInner(PreferenceActivity.java:1222)

E/AndroidRuntime(29565):	at android.preference.PreferenceActivity.switchToHeader(PreferenceActivity.java:1238)

E/AndroidRuntime(29565):	at android.preference.PreferenceActivity.onCreate(PreferenceActivity.java:611)

E/AndroidRuntime(29565):	at com.android.settings.Settings.onCreate(Settings.java:185)

E/AndroidRuntime(29565):	at android.app.Activity.performCreate(Activity.java:5048)

E/AndroidRuntime(29565):	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)

E/AndroidRuntime(29565):	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2052)

E/AndroidRuntime(29565):	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2113)

E/AndroidRuntime(29565):	at android.app.ActivityThread.access$700(ActivityThread.java:139)

E/AndroidRuntime(29565):	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1224)

E/AndroidRuntime(29565):	at android.os.Handler.dispatchMessage(Handler.java:99)

E/AndroidRuntime(29565):	at android.os.Looper.loop(Looper.java:137)

E/AndroidRuntime(29565):	at android.app.ActivityThread.main(ActivityThread.java:4918)

E/AndroidRuntime(29565):	at java.lang.reflect.Method.invokeNative(Native Method)

E/AndroidRuntime(29565):	at java.lang.reflect.Method.invoke(Method.java:511)

E/AndroidRuntime(29565):	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1004)

E/AndroidRuntime(29565):	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:771)

E/AndroidRuntime(29565):	at dalvik.system.NativeStart.main(Native Method)

E/android.os.Debug( 771): !@Dumpstate > dumpstate -k -t -z -d -o /data/log/dumpstate_app_error

I/dumpstate( 3432): begin

E/Sensors ( 771): accelHandler -0.204774 5.840255 7.479646

E/MP-Decision( 1708): UP Ld:0 Nw:1.990000 Tw:140 rq:2.000000 seq:147.000000

E/MP-Decision( 1708): Error(-22) changing core status to online

E/MP-Decision( 1708): DOWN Ld:0 Ns:1.100000 Ts:190 rq:0.000000 seq:196.000000

E/MP-Decision( 1708): Error(-22) changing core status to offline

V/AlarmManager( 771): waitForAlarm result :2

D/STATUSBAR-NetworkController( 1216): refreshSignalCluster:0

D/STATUSBAR-SignalClusterView( 1216): mSeparateMobileGroup=8

D/STATUSBAR-SignalClusterView( 1216): mSeparateMobileGroup=8

D/STATUSBAR-SignalClusterView( 1216): mSeparateMobileGroup=8

D/overlay ( 216): FROM_STATE = OV_BYPASS_2_LAYER TO_STATE = OV_CLOSED

E/SMD ( 212): DCD ON

E/MP-Decision( 1708): UP Ld:0 Nw:1.990000 Tw:140 rq:2.200000 seq:147.000000

E/MP-Decision( 1708): Error(-22) changing core status to online

E/MP-Decision( 1708): DOWN Ld:0 Ns:1.100000 Ts:190 rq:0.000000 seq:196.000000

E/MP-Decision( 1708): Error(-22) changing core status to offline

[EDIT]

I fixed my SecSettings issue! As it turns out, I had placed one modified section in the wrong place, and the final modification for SecSettings, in the onPreferenceChange function, is slightly distorted in the op. It has some extra lines coloured red that shouldn't be. The last lines that should be coloured red are:

.line 993

:cond_next

All of the lines after that are context. I finally figured that out after comparing what was in my DisplaySettings.smali with what loserskater posted in the op.