If you like it then dont forget THANKS Button
Things You Need
-smabakv1(attached)- its easier for n00bs
-notepad++
-7-zip
-android.policy.jar(MIUI ROM)
-modded smali's(Attached)
Lets Start
1)Download smabakv1 its attached in post, extract it some where you can easily access it.
2)Copy your android.policy.jar to the directory where you extracted smabakv1.
3)Now run "Run Me.bat" and press 1 to decompile. you will get a classout folder.
4)navigate to "classout\com\android\internal\policy\impl\"
5)open "MiuiGlobalActions$SinglePressAction.smali" in notepad++
6)you need to add the highlighted code exactly where it is shown
Code:
.end annotation
[COLOR="RoyalBlue"][B]# static fields
.field protected static rebootMode:I
.field protected static final rebootOptions:[Ljava/lang/String;[/B][/COLOR]
# instance fields
.field private mIconResId:I
Code:
.field private mTextview:Landroid/widget/TextView;
# direct methods
[COLOR="RoyalBlue"][B].method static constructor <clinit>()V
.registers 3
const/4 v0, 0x3
new-array v0, v0, [Ljava/lang/String;
const/4 v1, 0x0
const-string v2, "Normal"
aput-object v2, v0, v1
const/4 v1, 0x1
const-string v2, "Recovery"
aput-object v2, v0, v1
const/4 v1, 0x2
const-string v2, "Bootloader"
aput-object v2, v0, v1
sput-object v0, Lcom/android/internal/policy/impl/MiuiGlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;
return-void
.end method[/B][/COLOR]
.method protected constructor <init>(II)V
.registers 3
.parameter "iconResId"
.parameter "messageResId"
7)now open "MiuiGlobalActions.smali" with notepad++ located in the same place.
8)search for "MiuiGlobalActions$3" and replace it with "MiuiGlobalActions$222"
99% of time you need to replace MiuiGlobalActions$3,.... but for some devices MiuiGlobalActions$x where x is a number, is diffrent
to find out which is yours
Code:
findstr /n /i /c:"rebootSafeMode" *
you should get something similar to this
Code:
invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowManagerFuncs;->rebootSafeMode()V
now that is your MiuiGlobalActions$x
just replace your MiuiGlobalActions$x with MiuiGlobalActions$222 in MiuiGlobalActions.smali
Click to expand...
Click to collapse
these two places you should change in MiuiGlobalActions.smali
Code:
new-instance v1, Lcom/android/internal/policy/impl/[B]MiuiGlobalActions$3[/B];
Code:
invoke-direct {v1, p0, v2, v3}, Lcom/android/internal/policy/impl/[B]MiuiGlobalActions$3[/B];-><init>(Lcom/android/internal/policy/impl/MiuiGlobalActions;II)V
Note: you need to replace it only in two places
this is for fun,... open "MiuiGlobalActions$222" in notepad++
look for "Reboot phone" and change it to what ever you want
Click to expand...
Click to collapse
Code:
invoke-direct {v1, v2}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;)V
const-string v2, "Reboot phone" [B][COLOR="Blue"]<------ Change it to what ever you want[/COLOR][/B]
invoke-virtual {v1, v2}, Landroid/app/AlertDialog$Builder;->setTitle(Ljava/lang/CharSequence;)Landroid/app/AlertDialog$Builder;
move-result-object v1
9)download modded smali's and place them in the same directory
"classout\com\android\internal\policy\impl\"
10)again run "run me.bat" and select 2 to recompile, you will get "classes.dex"
11)open your "android.policy.jar" in 7-zip and add the "classes.dex" to it,... yes replace it,...
12)push it to your phone, make a rom or do what ever you want from here,...
13)hit THANKS if you like it and feel it was useful
--------------------------------------------------------------------------------------------------------------------------------------
thanks to
Code:
kong, miui, android, kahvitahra, snq- and any1 whom ive forgotten please remind me
thank you sir!!
can you make something like this but to change the autobrightness ? like to default or to other values ?
thanks!!
ruizit0 said:
thank you sir!!
can you make something like this but to change the autobrightness ? like to default or to other values ?
thanks!!
Click to expand...
Click to collapse
maybe tmrw!!! or when i have free time,...
have u tried it on ur own? is it working?
also i have tried the same method from a diff source which was for ICS builds but it didnt work.
more to it, i dont have ShutdownThread;->reboot string in any smali present in IMPL!
Ozadroid said:
have u tried it on ur own? is it working?
also i have tried the same method from a diff source which was for ICS builds but it didnt work.
more to it, i dont have ShutdownThread;->reboot string in any smali present in IMPL!
Click to expand...
Click to collapse
sorry my mistake,... there is no more,... ShutdownThread;->reboot in jb
The smalis are modded for jb...
Which device ur in??? Or porting from where??
did you try replacing "MiuiGlobalActions$3" with "MiuiGlobalActions$222" ????
chiragkrishna said:
sorry my mistake,... there is no more,... ShutdownThread;->reboot in jb
The smalis are modded for jb...
Which device ur in??? Or porting from where??
did you try replacing "MiuiGlobalActions$3" with "MiuiGlobalActions$222" ????
Click to expand...
Click to collapse
nope i dint try urs.. will do it after i finish my work with Miui4 as Miui4.1 is not to the mark for my device!
Ozadroid said:
nope i dint try urs.. will do it after i finish my work with Miui4 as Miui4.1 is not to the mark for my device!
Click to expand...
Click to collapse
updated the guide,... it should be easier now,...
chiragkrishna said:
updated the guide,... it should be easier now,...
Click to expand...
Click to collapse
have you tried it by yourself?? or just posted ??
Thanks for the guide!
Is it possible to include Hot Boot Option? I really miss it
v1r0x said:
Thanks for the guide!
Is it possible to include Hot Boot Option? I really miss it
Click to expand...
Click to collapse
yes it is possible.. i'll just have to unpack my policy
Ozadroid said:
have you tried it by yourself?? or just posted ??
Click to expand...
Click to collapse
i had done that thing only,... but in the guide i screwed up,...
v1r0x said:
Thanks for the guide!
Is it possible to include Hot Boot Option? I really miss it
Click to expand...
Click to collapse
send me the android.policy.jar with HOT BOOT Option
v1r0x said:
Thanks for the guide!
Is it possible to include Hot Boot Option? I really miss it
Click to expand...
Click to collapse
chiragkrishna said:
i had done that thing only,... but in the guide i screwed up,...
send me the android.policy.jar with HOT BOOT Option
Click to expand...
Click to collapse
replace the below .method static constructor <clinit> in your guide and you'll get the 4-way Reboot !
Code:
.method static constructor <clinit>()V
.registers 4
const-string v2, "Droid"
sget-object v3, Landroid/os/Build;->MODEL:Ljava/lang/String;
invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-nez v2, :cond_3b
const-string v2, "GT-I9000"
sget-object v3, Landroid/os/Build;->MODEL:Ljava/lang/String;
invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-nez v2, :cond_3b
const/4 v0, 0x4
new-array v0, v0, [Ljava/lang/String;
const/4 v1, 0x0
const-string v2, "Normal"
aput-object v2, v0, v1
const/4 v1, 0x1
const-string v2, "Hot Boot"
aput-object v2, v0, v1
const/4 v1, 0x2
const-string v2, "GT-I9100"
sget-object v3, Landroid/os/Build;->MODEL:Ljava/lang/String;
invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-nez v2, :cond_2f
const-string v2, "Bootloader"
goto :goto_31
:cond_2f
const-string v2, "Download"
:goto_31
aput-object v2, v0, v1
const/4 v1, 0x3
const-string v2, "Recovery"
aput-object v2, v0, v1
sput-object v0, Lcom/android/internal/policy/impl/MiuiGlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;
goto :goto_4f
:cond_3b
const/4 v0, 0x3
new-array v0, v0, [Ljava/lang/String;
const/4 v1, 0x0
const-string v2, "Normal"
aput-object v2, v0, v1
const/4 v1, 0x1
const-string v2, "Hot Boot"
aput-object v2, v0, v1
const/4 v1, 0x2
const-string v2, "Recovery"
aput-object v2, v0, v1
sput-object v0, Lcom/android/internal/policy/impl/MiuiGlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;
:goto_4f
return-void
.end method
Thanks Ozadroid, but I think Hot Boot doesn't work :/
After hit "Ok" the phone reboots including the htc splash screen. So I think it's a regular reboot?
@OP:
another question^^'
Any idea if it is possible to store the "reboot phone" line in a variable in framework-res or somethink like that?
Think this would be good for a multi lang rom
v1r0x said:
Thanks Ozadroid, but I think Hot Boot doesn't work :/
After hit "Ok" the phone reboots including the htc splash screen. So I think it's a regular reboot?
Click to expand...
Click to collapse
yeah i think so!
but try like this! make a call and try hot boot while the call goes on! if the call gets cut its a normal reboot, if not congrats
I have chinesse tablet
will the same script works on this jellybean tablet
too bad I am getting the following errors trying to recompile android.policy.jar
classout/com/android/internal/policy/impl/MiuiGlobalActions$222$1.smali[27,4] Error for input '.parameter': Invalid directive
classout/com/android/internal/policy/impl/MiuiGlobalActions$222$1.smali[42,4] Error for input '.parameter': Invalid directive
classout/com/android/internal/policy/impl/MiuiGlobalActions$222$1.smali[43,4] Error for input '.parameter': Invalid directive
classout/com/android/internal/policy/impl/MiuiGlobalActions$222$1.smali[42,15] mismatched input '"dialog"' expecting END_METHOD_DIRECTIVE
any help
This is a guide on how to enable unlimited apps on the traybar. This is for devs or users who want to do the mod themselves and include in their custom or own rom.
Tools:
1. apktools/smali/baksmali
2. 7zip
3. notepad++
4. knowledge of using the above tools and decompiling and recompiling.
Guide:
Part I: Editing services.jar
1. Decompile services.jar and edit MultiWindowManagerService.smali located in com/android/server/am folder. Search for the following code and insert the one with ++ highlighted in red (dont include the ++ just the goto :cond_10). Note that cond_10 may be different for your version so look for "const/4 v0, 0x1" below, above it is your "cond_xx" and edit the "goto :cond_10" like "goto :cond_xx".
Code:
.method public isSupportApp(Ljava/lang/String;)Z
.registers 3
.parameter "packageName"
.prologue
.line 410
[COLOR="Red"]++goto :cond_10[/COLOR]
iget-object v0, p0, Lcom/android/server/am/MultiWindowManagerService;->mSupportAppList:Ljava/util/ArrayList;
invoke-virtual {v0, p1}, Ljava/util/ArrayList;->contains(Ljava/lang/Object;)Z
move-result v0
if-nez v0, :cond_10
const-string v0, "android"
invoke-virtual {v0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_12
.line 411
[COLOR="Red"]:cond_10[/COLOR]
const/4 v0, 0x1
.line 414
:goto_11
return v0
:cond_12
const/4 v0, 0x0
goto :goto_11
.end method
2. Recompile.
Part II: Editing SystemUI.apk
1. Decompile SystemUI.apk and edit MiniModeAppsPanel.smali located in com/android/systemui/statusbar folder. Search for "CATEGORY_MULTIWINDOW_LAUNCHER". Just delete the line with "--" highlighted in blue and add the line with "++" highlighted in red. Make sure that the v7 in "const-string v7" is the same as the v7 in "sget-object v7". It could be v11 or v22 or whatever so make sure to edit the "const-string vx" with the correct vx value in "const-string vx".
Code:
[COLOR="Red"]++const-string v7, "android.intent.category.LAUNCHER"[/COLOR]
[COLOR="Blue"]--sget-object v7, Lcom/android/systemui/multiwindow/MultiWindowReflector$Intent;->CATEGORY_MULTIWINDOW_LAUNCHER:Ljava/lang/String;[/COLOR]
2. Recompile.
Part III: Push the edited services.jar and SystemUI.apk to your tablet and reboot.
Awesome dude!! Thanks!
worked perfectly for the new 8013!!
http://d-h.st/YRJ
selective disable?
In general this is really awesome and I really appreciate the options this gives me, but there are some apps where I wish this was either disabled or the overlay button was in another spot. Being right over the enter key on my keyboard or near a button in a game tends to cause some grief for me. Any suggestions?
Edit: Found the answer. Lol. http://forum.xda-developers.com/showthread.php?t=2136313
If, like me, the annoying unclearable notification that storage is low when you go below 500mb really winds you up then this will help. I know how much space I have!!!
Really simple. Decompile services.jar and open com/android/server/DeviceStorageMonitorService.smali.
Find .method private final sendNotification()V
To stop the nag altogether just replace the whole method with...
Code:
.method private final sendNotification()V
return-void
.end method
Compile and youre done!
Or to make it optional add this at the start of the method...
Code:
iget-object v1, p0, Lcom/android/server/DeviceStorageMonitorService;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "low_storage"
const/4 v3, 0x1
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-eqz v1, :cond_new
Then search for return-void in that method and put :cond_new before it.
Add a toggle to secsettings in the nornal way (lots of guides for this) with the key "low_storage".
Thats it. Compile and be nag free!
Enjoy
Sent from my GT-I9305 using Tapatalk
So First; we must thank @Hashcode for hos wonderful Safestrap Recovery That allows us to flash custom ROMs even though we have a locked Bootloader
In this Guide I will show you how to edit your power menu to change the reboot recovery from going to the recovery partition to going to Safestrap
This is independent of the safestrap app, IF AND ONLY IF the safestrap image is on the phone already
This is only for devs who want to incorporate this into their rom and I will not be answering questions on how to do this as even a beginner dev can manage this
I only ask that credit be given to @Hashcode, @Goldie @RErick and AllianceROM and that the supplied script not be changed or modified in anyway,
This is being shared freeley and a little thanks goes a long way
First thing is first
You will need to Decompile android,policy,jar
Look for globalactions$99$1.smali
Inside this smali file you will need to find
.method public onClick(Landroid/content/DialogInterface;I)V
and then look for this set of lines its at the very top
Code:
const/4 v2, 0x1
const/4 v3, 0x0
sget v0, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootMode:I
const/4 v1, -0x1
if-le v0, v1, :cond_0
sget v0, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootMode:I
Directly underneath that last line above add these lines
Code:
const/4 v1, 0x3
if-eq v0, v1, :cond_4
Now, at the very bottom of the same method, directly above the line that says
Code:
goto :goto_1
You will add these lines
Code:
goto :goto_1
:cond_4
const-string v1, "su -c /system/bin/recrbt.sh"
invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime;
move-result-object v2
invoke-virtual {v2, v1}, Ljava/lang/Runtime;->exec(Ljava/lang/String;)Ljava/lang/Process;
Thats it for the jar file. Save and recompile and then I have attached a zip with the needed script inside that needs to be placed in
/system/bin and permissions set to 0755
Or if on a clean flash, dont worry about permissions.
:good:
good job as always! what did u post this in every forum that has safestrap? s3/s4/s5/n2/n3?
will this work or does it need to be modified to work with 4 way reboot mod?
Sent from my SM-G900V using XDA Premium HD app
RErick said:
So First; we must thank @Hashcode for hos wonderful Safestrap Recovery That allows us to flash custom ROMs even though we have a locked Bootloader
In this Guide I will show you how to edit your power menu to change the reboot recovery from going to the recovery partition to going to Safestrap
This is independent of the safestrap app, IF AND ONLY IF the safestrap image is on the phone already
This is only for devs who want to incorporate this into their rom and I will not be answering questions on how to do this as even a beginner dev can manage this
I only ask that credit be given to @Hashcode, @Goldie @RErick and AllianceROM and that the supplied script not be changed or modified in anyway,
This is being shared freeley and a little thanks goes a long way
First thing is first
You will need to Decompile android,policy,jar
Look for globalactions$99$1.smali
Inside this smali file you will need to find
.method public onClick(Landroid/content/DialogInterface;I)V
and then look for this set of lines its at the very top
Code:
const/4 v2, 0x1
const/4 v3, 0x0
sget v0, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootMode:I
const/4 v1, -0x1
if-le v0, v1, :cond_0
sget v0, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootMode:I
Directly underneath that last line above add these lines
Code:
const/4 v1, 0x3
if-eq v0, v1, :cond_4
Now, at the very bottom of the same method, directly above the line that says
Code:
goto :goto_1
You will add these lines
Code:
goto :goto_1
:cond_4
const-string v1, "su -c /system/bin/recrbt.sh"
invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime;
move-result-object v2
invoke-virtual {v2, v1}, Ljava/lang/Runtime;->exec(Ljava/lang/String;)Ljava/lang/Process;
Thats it for the jar file. Save and recompile and then I have attached a zip with the needed script inside that needs to be placed in
/system/bin and permissions set to 0755
Or if on a clean flash, dont worry about permissions.
:good:
Click to expand...
Click to collapse
Hey, I was unable to find this file: globalactions$99$1.smali there isn't even a $99$.. any ideas?
elliwigy said:
Hey, I was unable to find this file: globalactions$99$1.smali there isn't even a $99$.. any ideas?
Click to expand...
Click to collapse
Well... Perhaps your ROM has a different implementation of the 4 way reboot. This is for devs/chefs who want to incorporate into their ROM. Not really for those who don't know where to look. Sorry, I don't have the time to answer all the questions related to this mod.
Hey Guys this a simple Toutourial to how to remove lockscreen albumart while playing music
Huge thanks to @niaboc79 he actually did a toutorial for android 5 and i just want to make it for android 7.
so lets begin
always remember to take a backup before doing this steps
first u need decompile systemui.apk which is locate it in system/priv-apps/systemUI/SystemUI.apk
then locate to SystemUI.apk\smali\com\android\systemui\statusbar\phone
and look for PhoneStatusBar.smali and if u couldn't find it there search the smali file in smali folder then u can find it.
so after than u need to open it look for this method
.method public updateMediaMetaData(ZZ)V
the last (ZZ)V maybe diffrent in some phones so u delete that and search the method.
so in that method we need to bypass the lockscreen album art commond
===============================================================
this is the method it may have a diffrent numbers u need to find green number which is cond 2 and change 2 to 3
Code:
.method public updateMediaMetaData(ZZ)V
.locals 12
iget-object v7, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBackdrop:Lcom/android/systemui/statusbar/BackDropView;
if-nez v7, :cond_0
return-void
:cond_0
iget-boolean v7, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mLaunchTransitionFadingAway:Z
if-eqz v7, :cond_1
iget-object v7, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBackdrop:Lcom/android/systemui/statusbar/BackDropView;
const/4 v8, 0x4
invoke-virtual {v7, v8}, Lcom/android/systemui/statusbar/BackDropView;->setVisibility(I)V
return-void
:cond_1
const/4 v2, 0x0
iget-object v7, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mMediaMetadata:Landroid/media/MediaMetadata;
if-eqz v7, :cond_[COLOR="Lime"]2[/COLOR]
so when u change 2 to 3 u need to remove the cond 2 part which is under the move-result-object v1
which is this part:
Code:
[COLOR="red"]:cond_2
if-eqz v1, :cond_3
new-instance v2, Landroid/graphics/drawable/BitmapDrawable;
iget-object v7, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBackdropBack:Landroid/widget/ImageView;
invoke-virtual {v7}, Landroid/widget/ImageView;->getResources()Landroid/content/res/Resources;
move-result-object v7
invoke-direct {v2, v7, v1}, Landroid/graphics/drawable/BitmapDrawable;-><init>(Landroid/content/res/Resources;Landroid/graphics/Bitmap;)V[/COLOR]
u need delete all of this red code
then save the smali file and recompile with original signature
and put it back on ur phone by insertig that on flashable zip file i will put one in attachments and u need to have 2 copy of that
and u need to place original system ui in one and modified one in the other so if anything goes wrong u can flash back the original and
try again to fix ur problem .
my telegram id is @demondodge
and if u like my little tutorial hit the thanks button .
hope it works for you.
Screen Shots
Screen Shots