[MOD][HOW-TO] Even more toggles! Lockscreen + Screen Timeout [4.3 | 4.4 coming ASAP]

talkingmonkeys

Recognized Contributor / Themer
May 15, 2013
2,644
4,411
0
Cool, let me know
Now for editing systemui.apk (the first step) its just doesn't seem right to me just to put the text there and not have it like everything else. Is this correct?

<string name="notification_panel_lockscreen">Lockscreen</string>
<string name="notification_panel_timeout">Screen Timeout</string>

Thanks for putting in the time to do this CNexus :silly:
 

CNexus

Senior Member
May 17, 2012
9,009
13,993
263
~/android
@LeoDeos

Figured out why Lockscreen toggle was not showing up for you! You need to add "LockScreen" with capital S to the database file (or via secsettingsprovider/csc feature.xml edit)

The smali file is called LockScreen, so it has to match :good:
The rest of it is fine though (make sure you change the code you added to secsettings too, replace all instances of Lockscreen with LockScreen)
 
  • Like
Reactions: LeoDeos

tdunham

Recognized Contributor
Jun 21, 2008
13,686
36,462
0
TampaBay
Systemui smali errors for LockscreenQuickSettingButton.smali.

Code:
[34,4] Error for input '.param': Invalid directive
 [139,4] Error for input '.param': Invalid directive
 [34,11] mismatched input 'p1' expecting END_METHOD_DIRECTIVE
 [139,11] mismatched input 'p1' expecting END_METHOD_DIRECTIVE
 Exception in thread "main" brut.androlib.AndrolibException: Could not smali file
 : G:\Sync\Android\apktoolsJB\JBapktools\SystemUI\smali\com\android\systemui\stat
 usbar\policy\quicksetting\LockscreenQuickSettingButton.smali
 
Last edited:

LeoDeos

Senior Member
Dec 23, 2012
919
1,341
0
Santeramo in Colle (Ba)
@LeoDeos

Figured out why Lockscreen toggle was not showing up for you! You need to add "LockScreen" with capital S to the database file (or via secsettingsprovider/csc feature.xml edit)

The smali file is called LockScreen, so it has to match :good:
The rest of it is fine though (make sure you change the code you added to secsettings too, replace all instances of Lockscreen with LockScreen)
Great...you're right :fingers-crossed:
Now work all well...thanks a lot.
I was ready to do a full wipe :)

Screeshot:
 
Last edited:

talkingmonkeys

Recognized Contributor / Themer
May 15, 2013
2,644
4,411
0
Sorry, should be fixed now @talkingmonkeys

This happens every time I edit it via the app :mad:
Cool thanks man right as I finished editing everything else :silly:

Can't get systemui.apk to recompile even without removing that line out of LockScreenQuickSettingButton.smali. This is the error its giving me.

I: Checking whether sources has changed...
I: Smaling...
[34,4] Error for input '.param': Invalid directive
[139,4] Error for input '.param': Invalid directive
[34,11] mismatched input 'p1' expecting END_METHOD_DIRECTIVE
[139,11] mismatched input 'p1' expecting END_METHOD_DIRECTIVE
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: C:\Users\Jake\Documents\androidwork\apktool\AndroidMultitool\Decompiled_apk\SystemUI\smali\com\android\systemui\statusbar\policy\quicksetting\LockScreenQuickSettingButton.smali
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:45)
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:33)
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:66)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:50)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:36)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:256)
at brut.androlib.Androlib.buildSources(Androlib.java:217)
at brut.androlib.Androlib.build(Androlib.java:208)
at brut.androlib.Androlib.build(Androlib.java:177)
at brut.apktool.Main.cmdBuild(Main.java:237)
at brut.apktool.Main.main(Main.java:79)
The system cannot find the file specified.
The system cannot find the file specified.


Edit: doh forgot to check baksmali when decompiling systemui.apk. I believe this is the reason for these errors @tdunham

Nope, didn't solve it. Perhaps using a different program for it would work? Its also giving an error on screentimeout smali because I tried just removing the lockscreen one and seeing if the other would work. Using Android Multitool
 
Last edited:
  • Like
Reactions: tdunham

LeoDeos

Senior Member
Dec 23, 2012
919
1,341
0
Santeramo in Colle (Ba)
@tdunham @LeoDeos @talkingmonkeys

I've updated the smali files in the OP, please download again...the reason that you tdunham and talkingmonkeys are getting that error is because I used a different version of apktool, but it shouldn't throw those errors with the updated files now
for me now is perfect, as you can see the screenshots in the last post
thanks again :)
 

LeoDeos

Senior Member
Dec 23, 2012
919
1,341
0
Santeramo in Colle (Ba)
No problem, the lockscreen toggle is working like it should for you right? (Actually disables lock screen on toggle)
Yes...it works well.
I noticed, however, that on reboot it is always disabled.


Ps. You forgot to link your script enabler in the OP (or flash the enable zip linked at the BEGINNING of this post) ;)
 
Last edited:

tdunham

Recognized Contributor
Jun 21, 2008
13,686
36,462
0
TampaBay
Yes...it works well.
I noticed, however, that on reboot it is always disabled.

Ps. You forgot to link your script enabler in the OP (or flash the enable zip linked at the BEGINNING of this post) ;)
Ah, good catch, I'll fix both of those right now
Please post the fixes/changes for those of us that are still in the middle of making changes. :)
 

CNexus

Senior Member
May 17, 2012
9,009
13,993
263
~/android
Last time I promise...but the toggle files are updated again :silly:

LockScreenQuickSettingButton.smali was the only one that was changed this time

Enable zip also added to OP (flash after you push the modded files to get the toggles to show in SystemUI)
 

LeoDeos

Senior Member
Dec 23, 2012
919
1,341
0
Santeramo in Colle (Ba)
Last time I promise...but the toggle files are updated again :silly:

LockScreenQuickSettingButton.smali was the only one that was changed this time

Enable zip also added to OP (flash after you push the modded files to get the toggles to show in SystemUI)
I tried the new files but I immediately have SystemUI FC

log:
W/dalvikvm( 9566): Exception Ljava/lang/ArrayIndexOutOfBoundsException; thrown while initializing Lcom/android/systemui/statusbar/policy/quicksetting/ScreenTimeoutQuickSettingButton;
D/AndroidRuntime( 9566): Shutting down VM
W/dalvikvm( 9566): threadid=1: thread exiting with uncaught exception (group=0x41cab700)
E/AndroidRuntime( 9566): FATAL EXCEPTION: main
E/AndroidRuntime( 9566): java.lang.ExceptionInInitializerError
E/AndroidRuntime( 9566): at java.lang.Class.classForName(Native Method)
E/AndroidRuntime( 9566): at java.lang.Class.forName(Class.java:204)
E/AndroidRuntime( 9566): at java.lang.Class.forName(Class.java:169)
E/AndroidRuntime( 9566): at com.android.systemui.statusbar.policy.quicksetting.QuickSettingPanel.refreshView(QuickSettingPanel.java:647)
E/AndroidRuntime( 9566): at com.android.systemui.statusbar.policy.quicksetting.QuickSettingPanel.onFinishInflate(QuickSettingPanel.java:707)
E/AndroidRuntime( 9566): at android.view.LayoutInflater.rInflate(LayoutInflater.java:774)
E/AndroidRuntime( 9566): at android.view.LayoutInflater.rInflate(LayoutInflater.java:769)
E/AndroidRuntime( 9566): at android.view.LayoutInflater.rInflate(LayoutInflater.java:769)
E/AndroidRuntime( 9566): at android.view.LayoutInflater.inflate(LayoutInflater.java:498)
E/AndroidRuntime( 9566): at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
E/AndroidRuntime( 9566): at android.view.ViewStub.inflate(ViewStub.java:259)
E/AndroidRuntime( 9566): at com.android.systemui.statusbar.phone.PhoneStatusBar.makeStatusBarView(PhoneStatusBar.java:894)
E/AndroidRuntime( 9566): at com.android.systemui.statusbar.phone.PhoneStatusBar.addStatusBarWindow(PhoneStatusBar.java:3245)
E/AndroidRuntime( 9566): at com.android.systemui.statusbar.phone.PhoneStatusBar.createAndAddWindows(PhoneStatusBar.java:3214)
E/AndroidRuntime( 9566): at com.android.systemui.statusbar.BaseStatusBar.start(BaseStatusBar.java:438)
E/AndroidRuntime( 9566): at com.android.systemui.statusbar.phone.PhoneStatusBar.start(PhoneStatusBar.java:508)
E/AndroidRuntime( 9566): at com.android.systemui.SystemUIService.onCreate(SystemUIService.java:100)
E/AndroidRuntime( 9566): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2687)
E/AndroidRuntime( 9566): at android.app.ActivityThread.access$1700(ActivityThread.java:159)
E/AndroidRuntime( 9566): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1404)
E/AndroidRuntime( 9566): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 9566): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 9566): at android.app.ActivityThread.main(ActivityThread.java:5419)
E/AndroidRuntime( 9566): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 9566): at java.lang.reflect.Method.invoke(Method.java:525)
E/AndroidRuntime( 9566): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1209)
E/AndroidRuntime( 9566): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1025)
E/AndroidRuntime( 9566): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 9566): Caused by: java.lang.ArrayIndexOutOfBoundsException: length=4; index=16
E/AndroidRuntime( 9566): at com.android.systemui.statusbar.policy.quicksetting.ScreenTimeoutQuickSettingButton.<clinit>(ScreenTimeoutQuickSettingButton.java)
E/AndroidRuntime( 9566): ... 28 more
I/ActivityManager( 2656): Notify an ApplicationCrash
W/ActivityManager( 2656): Process com.android.systemui has crashed too many times: killing!
I/dumpstate( 9594): begin
D/SPenGesture( 2656): SpenGestureView: setFocusedWindow
D/CrashAnrDetector( 2656): processName: com.android.systemui
D/CrashAnrDetector( 2656): broadcastEvent : com.android.systemui system_app_crash
 
Last edited:

talkingmonkeys

Recognized Contributor / Themer
May 15, 2013
2,644
4,411
0
Last time I promise...but the toggle files are updated again :silly:

LockScreenQuickSettingButton.smali was the only one that was changed this time

Enable zip also added to OP (flash after you push the modded files to get the toggles to show in SystemUI)
Sorry to make you have to do another :( I found another little bug. When you edit the toggles it removes the lockscreen toggle completely. I still have the screen timeout one though.

Reflashing the enable zip adds it back but it just repeats itself when I goto edit the toggles again. This does work though and everything functioned fine. I did update the lockscreenquicksettingbutton.smali also before I went ahead and tested this.
 

CNexus

Senior Member
May 17, 2012
9,009
13,993
263
~/android
Sorry to make you have to do another :( I found another little bug. When you edit the toggles it removes the lockscreen toggle completely. I still have the screen timeout one though.

Reflashing the enable zip adds it back but it just repeats itself when I goto edit the toggles again. This does work though and everything functioned fine. I did update the lockscreenquicksettingbutton.smali also before I went ahead and tested this.
Did you.update the secsettings edit? And replace Lockscreen with LockScreen?
 
  • Like
Reactions: talkingmonkeys

CNexus

Senior Member
May 17, 2012
9,009
13,993
263
~/android
I tried the new files but I immediately have SystemUI FC

log:
W/dalvikvm( 9566): Exception Ljava/lang/ArrayIndexOutOfBoundsException; thrown while initializing Lcom/android/systemui/statusbar/policy/quicksetting/ScreenTimeoutQuickSettingButton;
D/AndroidRuntime( 9566): Shutting down VM
W/dalvikvm( 9566): threadid=1: thread exiting with uncaught exception (group=0x41cab700)
E/AndroidRuntime( 9566): FATAL EXCEPTION: main
E/AndroidRuntime( 9566): java.lang.ExceptionInInitializerError
E/AndroidRuntime( 9566): at java.lang.Class.classForName(Native Method)
E/AndroidRuntime( 9566): at java.lang.Class.forName(Class.java:204)
E/AndroidRuntime( 9566): at java.lang.Class.forName(Class.java:169)
E/AndroidRuntime( 9566): at com.android.systemui.statusbar.policy.quicksetting.QuickSettingPanel.refreshView(QuickSettingPanel.java:647)
E/AndroidRuntime( 9566): at com.android.systemui.statusbar.policy.quicksetting.QuickSettingPanel.onFinishInflate(QuickSettingPanel.java:707)
E/AndroidRuntime( 9566): at android.view.LayoutInflater.rInflate(LayoutInflater.java:774)
E/AndroidRuntime( 9566): at android.view.LayoutInflater.rInflate(LayoutInflater.java:769)
E/AndroidRuntime( 9566): at android.view.LayoutInflater.rInflate(LayoutInflater.java:769)
E/AndroidRuntime( 9566): at android.view.LayoutInflater.inflate(LayoutInflater.java:498)
E/AndroidRuntime( 9566): at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
E/AndroidRuntime( 9566): at android.view.ViewStub.inflate(ViewStub.java:259)
E/AndroidRuntime( 9566): at com.android.systemui.statusbar.phone.PhoneStatusBar.makeStatusBarView(PhoneStatusBar.java:894)
E/AndroidRuntime( 9566): at com.android.systemui.statusbar.phone.PhoneStatusBar.addStatusBarWindow(PhoneStatusBar.java:3245)
E/AndroidRuntime( 9566): at com.android.systemui.statusbar.phone.PhoneStatusBar.createAndAddWindows(PhoneStatusBar.java:3214)
E/AndroidRuntime( 9566): at com.android.systemui.statusbar.BaseStatusBar.start(BaseStatusBar.java:438)
E/AndroidRuntime( 9566): at com.android.systemui.statusbar.phone.PhoneStatusBar.start(PhoneStatusBar.java:508)
E/AndroidRuntime( 9566): at com.android.systemui.SystemUIService.onCreate(SystemUIService.java:100)
E/AndroidRuntime( 9566): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2687)
E/AndroidRuntime( 9566): at android.app.ActivityThread.access$1700(ActivityThread.java:159)
E/AndroidRuntime( 9566): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1404)
E/AndroidRuntime( 9566): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 9566): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 9566): at android.app.ActivityThread.main(ActivityThread.java:5419)
E/AndroidRuntime( 9566): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 9566): at java.lang.reflect.Method.invoke(Method.java:525)
E/AndroidRuntime( 9566): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1209)
E/AndroidRuntime( 9566): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1025)
E/AndroidRuntime( 9566): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 9566): Caused by: java.lang.ArrayIndexOutOfBoundsException: length=4; index=16
E/AndroidRuntime( 9566): at com.android.systemui.statusbar.policy.quicksetting.ScreenTimeoutQuickSettingButton.<clinit>(ScreenTimeoutQuickSettingButton.java)
E/AndroidRuntime( 9566): ... 28 more
I/ActivityManager( 2656): Notify an ApplicationCrash
W/ActivityManager( 2656): Process com.android.systemui has crashed too many times: killing!
I/dumpstate( 9594): begin
D/SPenGesture( 2656): SpenGestureView: setFocusedWindow
D/CrashAnrDetector( 2656): processName: com.android.systemui
D/CrashAnrDetector( 2656): broadcastEvent : com.android.systemui system_app_crash
I'm gonna gave to say that it's something on your end because I didn't touch the screen timeout smali on the last update, only the lock screen smali