[Guides & Links] TOUCHWIZ UNIFIED MODS THREAD

Search This thread

Kamy

Senior Member
Aug 29, 2012
5,335
19,304
263
Beijing
Would anybody please look at my log:

boolean com.android.server.policy.GlobalActions.isNeedConfirm(): [0xFFFFFFFF] register index out of range (3 >= 3)

I am trying this:


You use v3 register and .locals should be increased to 4 to account for it?
Thanks for the reply. Yeah I guess it was about the register but it is even nagging on local 4 I guess there should be another things that I am missing.
 

kep2008

Senior Member
Feb 27, 2016
353
652
113
Slutsk
Thanks for the reply. Yeah I guess it was about the register but it is even nagging on local 4 I guess there should be another things that I am missing.
Maybe so?
Code:
iget-object v1, p0, Lcom/android/server/policy/GlobalActions;->mContext:Landroid/content/Context;
    
    invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
    
    move-result-object v1

    const-string v2, "pm_confirm_action"

    const/4 v3, 0x1

    invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
    
    move-result [COLOR="Red"]v1[/COLOR]
    
    if-nez v[COLOR="Red"]1[/COLOR], :cond_arya
 

josephpatrick

Senior Member
Jan 24, 2012
1,177
233
83
Bangalore
ok guys couple mods more this is for

" Enable Data Usage with out csc edit "

please work your way to

SystemUI\smali\com\android\systemui\statusbar\Feature.smali

find : sput-boolean v0, Lcom/android/systemui/statusbar/Feature;->mShowDataUsageInQuickPanel:Z

and change V0 to V1


now for next mod this is to

"Remove that anoying bottom white bar on ui on n7 and UX roms" (please look at attachment 1)

please work your way to

SystemUI\smali\com\android\systemui\statusbar\Feature.smali

and find : get-boolean v0, Lcom/android/systemui/statusbar/Feature;->mSupportQuickpanelBlackTheme:Z

and again easy edit change V0 to V1

Also right above that theres mQuickSettingBackgroundAnimation:Z i dont knwo what it does but u can try to enable maybe one of the guys can find if it enables anythign

ok guys have fun

regarding "mSupportQuickpanelBlackTheme:Z" change, the v0 to v1 change, is it for a if condition or move?
 

maxx35000

Senior Member
Jan 14, 2012
1,517
2,821
153
Rennes
Guide For Native Blur

It will Work Only on Ported S7 Edge & Note 7 Roms
View attachment 3931807View attachment 3931808View attachment 3931810
Its Tested on Samsung Galaxy S5 G900H Exynos Variant Running Full S7 Edge & Note 7 Roms

I have attached the LIBS For Both Exynos & SnapDragon Variant Devices
Download And Flash the zip via TWRP Recovery


Have Complete backup of ROM using TWRP to your SD Card and then Proceed
Im not responsible for any loss



Work by @amtra And @yash92duster :good:
Thanks To @tamirda For Guides & Help:D

For me on my A5 2017 port rom for j7 2016 SM-J710FN the lib doesn't work i use four lib from S7 edge Exynos G935FXXU1BPLB and work perfect maybe can help other

Work by @maxx35000
 

Attachments

  • Screenshot_20170301-222626.png
    Screenshot_20170301-222626.png
    232.9 KB · Views: 481
  • Screenshot_20170301-231836.jpg
    Screenshot_20170301-231836.jpg
    87.6 KB · Views: 481
  • Screenshot_20170301-231847.jpg
    Screenshot_20170301-231847.jpg
    52.6 KB · Views: 477
  • Screenshot_20170301-231855.png
    Screenshot_20170301-231855.png
    186.8 KB · Views: 455
  • Screenshot_20170301-221016.png
    Screenshot_20170301-221016.png
    186.1 KB · Views: 445
  • Screenshot_20170301-231912.jpg
    Screenshot_20170301-231912.jpg
    60.2 KB · Views: 445
Last edited:

tdunham

Recognized Contributor
Jun 21, 2008
13,686
36,462
0
TampaBay
Hello guys,

ok so i'm on official 7.0 G920F and i made toggles for power off, emergency and reboot recovery but i'd like to know what's the method of "showconditional" to make "Restart button" a toggle and which file to put it on ?

Thank you.
Sure thing. This should work with many of the GlobalActions$xxx child smali.
Mine is in GlobalActions$9.smali for restart yours might be different.
Before:
Code:
.method public showConditional()Z
    .locals 1

    const/4 v0, 0x1

    return v0
.end method
After:
Code:
.method public showConditional()Z
    .locals 4

    const/4 v0, 0x0

    const/4 v1, 0x1  [COLOR="red"]## change this to 0x0 to not show as default[/COLOR]

    iget-object v2, p0, Lcom/android/server/policy/GlobalActions$9;->this$0:Lcom/android/server/policy/GlobalActions;

    # getter for: Lcom/android/server/policy/GlobalActions;->mContext:Landroid/content/Context;
    invoke-static {v2}, Lcom/android/server/policy/GlobalActions;->access$500(Lcom/android/server/policy/GlobalActions;)Landroid/content/Context;
  [COLOR="Red"]  ## make certain access$500 above in parent calls mcontext
[/COLOR]
    move-result-object v2

    invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v2

    const-string v3, "power_restart"  [COLOR="Red"]## this is your key for rom control
[/COLOR]
    invoke-static {v2, v3, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v2

    if-ne v2, v0, :cond_0

    :goto_0
    return v0

    :cond_0
    move v0, v1

    goto :goto_0
.end method
 
Last edited:
  • Like
Reactions: ryan42680

ryan42680

Senior Member
Aug 17, 2013
1,309
4,080
0
Bou-ismail
steamcommunity.com
Hi guys

Can tell me how change black background to transparent bg on Advanced Power Menu in MM (see image)
Thanks

Try this https://forum.xda-developers.com/showpost.php?p=69547250&postcount=10030

Sure thing. This should work with many of the GlobalActions$xxx child smali.
Mine is in GlobalActions$9.smali for restart yours might be different.
Before:
Code:
.method public showConditional()Z
    .locals 1

    const/4 v0, 0x1

    return v0
.end method
After:
Code:
.method public showConditional()Z
    .locals 4

    const/4 v0, 0x0

    const/4 v1, 0x1  [COLOR="red"]## change this to 0x0 to not show as default[/COLOR]

    iget-object v2, p0, Lcom/android/server/policy/GlobalActions$9;->this$0:Lcom/android/server/policy/GlobalActions;

    # getter for: Lcom/android/server/policy/GlobalActions;->mContext:Landroid/content/Context;
    invoke-static {v2}, Lcom/android/server/policy/GlobalActions;->access$500(Lcom/android/server/policy/GlobalActions;)Landroid/content/Context;
  [COLOR="Red"]  ## make certain access$500 above in parent calls mcontext
[/COLOR]
    move-result-object v2

    invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v2

    const-string v3, "power_restart"  [COLOR="Red"]## this is your key for rom control
[/COLOR]
    invoke-static {v2, v3, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v2

    if-ne v2, v0, :cond_0

    :goto_0
    return v0

    :cond_0
    move v0, v1

    goto :goto_0
.end method

Hello @tdunham and thank you a lot for the help, tried all GlobalActions$... files with no luck so i decided to make advanced power menu, but i get this when i recompile :

apktool b -c services.jar.out
I: Using Apktool 2.2.2
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
Exception in thread "main" org.jf.util.ExceptionWithContext: Unsigned short value out of range: 65536
at org.jf.dexlib2.writer.DexDataWriter.writeUshort(DexDataWriter.java:116)
at org.jf.dexlib2.writer.InstructionWriter.write(InstructionWriter.java:329)
at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1027)
at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:803)
at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:252)
at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:230)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:61)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:36)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:404)
at brut.androlib.Androlib.buildSources(Androlib.java:335)
at brut.androlib.Androlib.build(Androlib.java:291)
at brut.androlib.Androlib.build(Androlib.java:263)
at brut.apktool.Main.cmdBuild(Main.java:227)
at brut.apktool.Main.main(Main.java:84)


Any help ?

Also i noticed that app: packageNameToKill="com.android.systemui" doesn't work anymore ?
 
Last edited:

tdunham

Recognized Contributor
Jun 21, 2008
13,686
36,462
0
TampaBay
Try this https://forum.xda-developers.com/showpost.php?p=69547250&postcount=10030



Hello @tdunham and thank you a lot for the help, tried all GlobalActions$... files with no luck so i decided to make advanced power menu, but i get this when i recompile :

Also i noticed that app: packageNameToKill="com.android.systemui" doesn't work anymore ?
Exception in thread "main" org.jf.util.ExceptionWithContext: Unsigned short value out of range: 65536

I don't know for sure. Something near line 65536.
 
  • Like
Reactions: ryan42680

ryan42680

Senior Member
Aug 17, 2013
1,309
4,080
0
Bou-ismail
steamcommunity.com
Exception in thread "main" org.jf.util.ExceptionWithContext: Unsigned short value out of range: 65536

I don't know for sure. Something near line 65536.


It's called A "method index issue" is having too many methods. If for ex you have too many methods, then the method index can't fit into an unsigned 16-bit value, and this is the error that i got.

And i know that deodexing could potentially alter the number of method references from the original.
 
Last edited:

renzetti.s

Senior Member
Jun 15, 2012
2,205
2,327
203
It's called A "method index issue" is having too many methods. If for ex you have too many methods, then the method index can't fit into an unsigned 16-bit value, and this is the error that i got.

And i know that deodexing could potentially alter the number of method references from the original.
So do you have more than 65000 methods?

if help push thanks
 

kep2008

Senior Member
Feb 27, 2016
353
652
113
Slutsk
LongPress Back to KIll (android 7.0).
Did on SGS 6.

We take attached smali and make changes only in services.jar/smali/com/android/server/policy/PhoneWindowManager.smali from this post
https://forum.xda-developers.com/showpost.php?p=67678848&postcount=7864
If we get an error when recompiling, look here
https://forum.xda-developers.com/showpost.php?p=71413286&postcount=10665

In samsung-services\smali\com\android\server\policy\SamsungPhoneWindowManager.smali find method and increase registers by 3
Code:
.method public interceptKeyBeforeDispatching(Landroid/view/WindowManagerPolicy$WindowState;Landroid/view/KeyEvent;I)J
    .registers [COLOR="Red"]51[/COLOR]
in the same method, insert the code highlighted in blue (goto/16: goto_de must match the code below)
Code:
    :cond_413
    const/16 v40, 0x1

    move/from16 v0, v40

    move-object/from16 v1, p0

    iput-boolean v0, v1, Lcom/android/server/policy/SamsungPhoneWindowManager;->mBackKeyConsumed:Z
	
    [COLOR="Blue"]move-object/from16 v0, p0

    iget-object v0, v0, Lcom/android/server/policy/SamsungPhoneWindowManager;->mContext:Landroid/content/Context;

    move-object/from16 v44, v0

    invoke-virtual/range {v44 .. v44}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v44

    const-string/jumbo v45, "enable_back_kill"

    const/16 v46, 0x0

    invoke-static/range {v44 .. v46}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v44

    if-eqz v44, :cond_kp

    invoke-virtual/range {p0 .. p0}, Lcom/android/server/policy/SamsungPhoneWindowManager;->handleRightLongPress()V

    [B]goto/16 :goto_de[/B]

    :cond_kp[/COLOR]
    .line 2132
    const/16 v40, 0x52

    move-object/from16 v0, p0

    move/from16 v1, v40

    invoke-direct {v0, v1}, Lcom/android/server/policy/SamsungPhoneWindowManager;->injectionKeyEvent(I)V

    [B]goto/16 :goto_de[/B]

    .line 2139
    :sswitch_426
At the end of smali we add a method
Code:
.method public handleRightLongPress()V
    .locals 1

    iget-object v0, p0, Lcom/android/server/policy/SamsungPhoneWindowManager;->mPWM:Lcom/android/server/policy/PhoneWindowManager;

    invoke-virtual {v0}, Lcom/android/server/policy/PhoneWindowManager;->handleRightLongPress()V

    return-void
.end method

Rom Control v2
Code:
<com.wubydax.romcontrol.v2.prefs.MySwitchPreference
        android:defaultValue="false"
        android:key="enable_back_kill"
        android:summaryOff="Menu"
        android:summaryOn="Kill app"
        android:title="LongPress Back"/>

Thanks @OvrDriVE, @tdunham, @thereassaad.
 
Last edited:

RealWelder

Senior Member
Sep 17, 2014
692
291
93
Muncie, IN
Works on 4.4.2 also.

Thanks. I was having a hard time getting this feature working doing other tutorials...this one was nice and easy...and it worked! Also, this works on TW 4.4.2. (I did this for my TAB3)
 

Top Liked Posts

Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone