- Nov 7, 2010
- 247
- 38
Alright Guys. This thread is long overdue. I am going to cover the mods that I provide on a weekly basis. The information provided should apply to most MIUI ports, regardless of device. Therefore, it is in the Port Section.
There are three areas of interest I wish to cover. They include status bar mods, the lockscreen timeout mod, and the disable wallpaper scroll mod. Most of these mods are the work of other developers. I merely ported the information to MIUI.
I strongly recommend you nandroid backup prior to flashing anything, ever. ( Like you could actually sue me if you bork your phone! But all the devs put a disclaimer, so I'll follow suit ;D )
Let's start with the Status Bar Mods. I implemented the instructions in SteelH's Thread on XDA. Credit for these mods go to JsChiSurf (the Ultimate Smali Superstar!) and pardonmyfreedom (don't know where you dwell, but thank you!)
In order to pull of these mods, you need to know how to use smali / baksmali. This is not a tutorial on these applications. Simply do a google search to learn these easy applications.
The status bar mods require you to use smali / baksmali to decompile and compile the classes.dex in Services.jar
Let's start with Hide USB Debug Icon
Navigate to com\android\server\NotificationManagerService.smali and open the smali file with your favorite code / text editor.
Search for the following line of code
and comment it out with the "#" symbol
Save and compile.
Next we will hide the Clock Icon (most popular!)
Navigate to com/android/server/status/StatusBarPolicy.smali and open the smali file with you favorite code / text editor.
Search for the following line of code ( Roughly around line 574 )
Find the line of code and place the following directly below it.
Save and compile.
Moving on to Hide Battery Icon.
Navigate to com/android/server/status/StatusBarPolicy.smali and open the smali file with you favorite code / text editor.
Search for the following line of code ( Roughly around line 623 )
Find the line of code and place the following directly below it.
Save and compile.
Lockscreen Timeout Mod
I take all credit for this mod. It took me about a week to find the correct class, method, and variable to control this. By default, the lockscreen will timeout and kill the display in five seconds from being turned on. How is it that the MIUI developers can bless us with this truly awesome lockscreen, with animated EQ graphics, music controls, and missed call and text notification, and only give us five seconds to take it all in? Well, let's do something about it. Let's increase the Lockscreen Timeout to 30 seconds!
Decompile com.android.policy and navigate to KeyguardViewMediator.smali. Open with your favorite code / text editor.
Scroll to line 2566 (roughly, depending on how the code changes in the weekly's) and find the following line
Notice that "1388" hex which is equal to 5000 Milliseconds, or 5 seconds.
Change to
Which equals 30000 milliseconds or 30 seconds.
Save and compile.
Note: Feel free to experiment with other values. However, I don't think you will be able to exceed 0xFFFF.
DISABLE WALLPAPER SCROLLING
This mod was created by Sampson. I am posting it here to keep the post consistent with my weekly releases.
Extract classes.dex from Launcher2.apk and decompile using baksmali.
Navigate to com/android/launcher2/Launcher.smali. Open Launcher.smali with your favorite text / code editor.
Search for the following line of code with your text editor's search function.
Directly above this line, you will see the following...
Change the "2" to a "1" so it looks like
Save and compile classes,dex. Now in this case, you need to drop your new classes.dex back into the Launcher2.apk you pulled the original from.
There are three areas of interest I wish to cover. They include status bar mods, the lockscreen timeout mod, and the disable wallpaper scroll mod. Most of these mods are the work of other developers. I merely ported the information to MIUI.
I strongly recommend you nandroid backup prior to flashing anything, ever. ( Like you could actually sue me if you bork your phone! But all the devs put a disclaimer, so I'll follow suit ;D )
Let's start with the Status Bar Mods. I implemented the instructions in SteelH's Thread on XDA. Credit for these mods go to JsChiSurf (the Ultimate Smali Superstar!) and pardonmyfreedom (don't know where you dwell, but thank you!)
In order to pull of these mods, you need to know how to use smali / baksmali. This is not a tutorial on these applications. Simply do a google search to learn these easy applications.
The status bar mods require you to use smali / baksmali to decompile and compile the classes.dex in Services.jar
Let's start with Hide USB Debug Icon
Navigate to com\android\server\NotificationManagerService.smali and open the smali file with your favorite code / text editor.
Search for the following line of code
Code:
iput v7, v6, Landroid/app/Notification;->icon:I
Code:
#iput v7, v6, Landroid/app/Notification;->icon:I
Next we will hide the Clock Icon (most popular!)
Navigate to com/android/server/status/StatusBarPolicy.smali and open the smali file with you favorite code / text editor.
Search for the following line of code ( Roughly around line 574 )
Code:
invoke-direct {p0}, Lcom/android/server/status/StatusBarPolicy;->updateClock()V
Code:
invoke-virtual {p2, v3, v6}, Lcom/android/server/status/StatusBarService;->setIconVisibility(Landroid/os/IBinder;Z)V
Moving on to Hide Battery Icon.
Navigate to com/android/server/status/StatusBarPolicy.smali and open the smali file with you favorite code / text editor.
Search for the following line of code ( Roughly around line 623 )
Code:
iput-object v3, p0, Lcom/android/server/status/StatusBarPolicy;->mBatteryIcon:Landroid/os/IBinder;
Code:
invoke-virtual {p2, v3, v6}, Lcom/android/server/status/StatusBarService;->setIconVisibility(Landroid/os/IBinder;Z)V
Lockscreen Timeout Mod
I take all credit for this mod. It took me about a week to find the correct class, method, and variable to control this. By default, the lockscreen will timeout and kill the display in five seconds from being turned on. How is it that the MIUI developers can bless us with this truly awesome lockscreen, with animated EQ graphics, music controls, and missed call and text notification, and only give us five seconds to take it all in? Well, let's do something about it. Let's increase the Lockscreen Timeout to 30 seconds!
Decompile com.android.policy and navigate to KeyguardViewMediator.smali. Open with your favorite code / text editor.
Scroll to line 2566 (roughly, depending on how the code changes in the weekly's) and find the following line
Code:
const/16 v0, 0x1388
Change to
Code:
const/16 v0, 0x7530
Save and compile.
Note: Feel free to experiment with other values. However, I don't think you will be able to exceed 0xFFFF.
DISABLE WALLPAPER SCROLLING
This mod was created by Sampson. I am posting it here to keep the post consistent with my weekly releases.
Extract classes.dex from Launcher2.apk and decompile using baksmali.
Navigate to com/android/launcher2/Launcher.smali. Open Launcher.smali with your favorite text / code editor.
Search for the following line of code with your text editor's search function.
Code:
invoke-virtual {v4, v5, v1}, Landroid/app/WallpaperManager;->suggestDesiredDimensions(II)V
Directly above this line, you will see the following...
Code:
mul-int/lit8 v5, v3, 0x2
Change the "2" to a "1" so it looks like
Code:
mul-int/lit8 v5, v3, 0x1
Save and compile classes,dex. Now in this case, you need to drop your new classes.dex back into the Launcher2.apk you pulled the original from.