• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[GUIDE][MIUI12] Bring back blur to MIUI 12

Search This thread

shawkath646

New member
Jul 21, 2019
3
0
Redmi Note 9
I thank you too much, I am the owner of the same terminal, but I still do not understand how to pass the file to the file if the system is in read mode, please notify the person who requested the patch if It really worked for him

Also, I wish I could do the same with my own hands, would you be so kind as to attach a folder with all the necessary files? If it is not much annoying, I await your answer, greetings
Sure ! If it works, I will notify you !
 

Thel_Vadam

New member
Jul 2, 2021
3
0
Seguro! ¡Si funciona, te lo notificaré!
Agradeceré mucho la noticia. Simplemente no puedo encontrar la versión 12.0.1 de China para Merlin, solo 12.0.2, comparta el enlace o, si es así, si funciona en cualquier otra versión de China
Tienes que ir a recuperación, administrador de archivos y luego ir a system / priv-app / MiuiSystemUI y reemplazar el apk allí ^^
Al tener problemas con el proceso, termina con el error "No se pudo copiar 'MiuiSystemUI.apk' a '//MiuiSystemUI.apk': no se pudo crear el archivo: sistema de archivos de solo lectura"
 

Rigby103_epic

Member
Nov 8, 2020
13
2
Agradeceré mucho la noticia. Simplemente no puedo encontrar la versión 12.0.1 de China para Merlin, solo 12.0.2, comparta el enlace o, si es así, si funciona en cualquier otra versión de China

Al tener problemas con el proceso, termina con el error "No se pudo copiar 'MiuiSystemUI.apk' a '//MiuiSystemUI.apk': no se pudo crear el archivo: sistema de archivos de solo lectura"
You have to do it in recovery, not a Root file manager
 

KingKoncorde

New member
May 26, 2021
4
0
Hi. i am getting an error when I try to push the apk using recovery on a RN9 device. It reads: error: failed to copy 'C:\Users\PretendThisIsMyUserName\Downloads\MiuiSystemUI.apk' to '/system/priv-app/MiuiSystemUI/': remote couldn't create file: Read-only file system. How do I fix that?
edit:
I made a magisk module instead and it worked.
 
Last edited:

MehmetKula

New member
May 16, 2018
1
0
How to enable the blur effects on MIUI 12

If you have a low-end device, you probably noticed the gray background color on your control center and notification shade. Let's bring back the glorious blur effect by patching MiuiSystemUI.apk.

Prerequisites:
  • adb
  • smali/baksmali
  • zip
  • a tool to decompile .apk file
  • Custom Recovery
  • Common knowledge. I'm not responsible if you bricked your device or caused a thermonuclear war.
### Prepare the tools needed.

Install the tools required for this operation. Use your favorite distro's package manager to install it or clone it from its github repository.

### Pull MiuiSystemUI.apk from your device

Bash:
$ adb pull /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk .

The command above will copy the apk file to the current directory. It's recommended to create a backup. We will be overwriting it later.

### Decompile or Extract the APK

Decompile the APK with your favorite tool. I will use MT Manager, an android application, for this. Go to the extracted folder. It should contain:
  • assets/
  • kotlin/
  • META-INF/
  • res/
  • AndroidManifest.xml
  • classes.dex
  • resources.arsc
### Disassemble classes.dex

Disassemble it by:

Bash:
$ baksmali d classes.dex

This command should create the out/ folder. It will contain all the .smali files extracted from classes.dex.

Go inside the out/ folder.

### Editing .smali files to enable blur

This is the important part. There are two files we need to edit. The ControlPanelWindowManager.smali that will enable the blur on the control center and StatusBarWindowManager.smali that will enable the blur on the notification shade.

1. Open com/android/systemui/miui/statusbar/phone/ControlPanelWindowManager.smali with your favorite text editor.
2. Find the applyBlurRatio() method. It should be on line 101 to 148. Then change the whole function to:

Code:
.method private applyBlurRatio(F)V
    .registers 5

    .line 180
    invoke-virtual {p0}, Lcom/android/systemui/miui/statusbar/phone/ControlPanelWindowManager;->hasAdded()Z

    move-result v0

    if-eqz v0, :cond_2b

    .line 181
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "setBlurRatio: "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    const-string v1, "ControlPanelWindowManager"

    invoke-static {v1, v0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 182
    iget-object v0, p0, Lcom/android/systemui/miui/statusbar/phone/ControlPanelWindowManager;->mLpChanged:Landroid/view/WindowManager$LayoutParams;

    iget-object v1, p0, Lcom/android/systemui/miui/statusbar/phone/ControlPanelWindowManager;->mControlPanel:Lcom/android/systemui/miui/statusbar/phone/ControlPanelWindowView;

    invoke-virtual {v1}, Landroid/widget/FrameLayout;->getViewRootImpl()Landroid/view/ViewRootImpl;

    move-result-object v1

    const/4 v2, 0x0

    invoke-static {v0, v1, p1, v2}, Landroid/view/SurfaceControlCompat;->setBlur(Landroid/view/WindowManager$LayoutParams;Landroid/view/ViewRootImpl;FI)V

    .line 183
    invoke-direct {p0}, Lcom/android/systemui/miui/statusbar/phone/ControlPanelWindowManager;->apply()V

    :cond_2b
    return-void
.end method

3. Save it.

4. Open com/android/systemui/statusbar/phone/StatusBarWindowManager.smali with your favorite text editor.

5. Find the applyBlurRatio() method. It should be on line 294 to 341. Then change the whole function to:

Code:
.method private applyBlurRatio(Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;)V
    .registers 6

    .line 320
    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->mLpChanged:Landroid/view/WindowManager$LayoutParams;

    iget-object v1, p0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->mStatusBarView:Landroid/view/ViewGroup;

    invoke-virtual {v1}, Landroid/view/ViewGroup;->getViewRootImpl()Landroid/view/ViewRootImpl;

    move-result-object v1

    iget v2, p1, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;->blurRatio:F

    const/4 v3, 0x0

    invoke-static {v0, v1, v2, v3}, Landroid/view/SurfaceControlCompat;->setBlur(Landroid/view/WindowManager$LayoutParams;Landroid/view/ViewRootImpl;FI)V

    .line 323
    iget-object p0, p0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->mBlurRatioListeners:Ljava/util/List;

    invoke-interface {p0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object p0

    :goto_14
    invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_26

    invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$BlurRatioChangedListener;

    .line 324
    iget v1, p1, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;->blurRatio:F

    invoke-interface {v0, v1}, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$BlurRatioChangedListener;->onBlurRatioChanged(F)V

    goto :goto_14

    :cond_26
    return-void
.end method

6. Save it.

### Assemble .smali files back to classes.dex

Inside out/ folder. Execute the command below to assemble all smali files back to classes.dex

Bash:
$ smali a . -o classes.dex

This should create a new classes.dex on the current directory.

### Build a new MiuiSystemUI.apk

Move or copy the compiled classes.dex to the extracted MiuiSystemUI.apk. This should replace the old one. Then delete the out/ folder. We don't need it anymore. Create a new MiuiSystemUI.apk by:

Bash:
$ zip -r MiuiSystemUI.apk assets/ kotlin/ META-INF/ res/ AndroidManifest.xml classes.dex resources.arsc

### Push the new MiuiSystemUI.apk

Go to your custom recovery, mount /system, then push the modified MiuiSystemUI.apk. Note that if you're rooted with Magisk, you can create a magisk module instead.

This will overwrite the default or stock MiuiSystemUI.apk so make sure you made a backup before doing this.

Bash:
$ adb push MiuiSystemUI.apk /system/priv-app/MiuiSystemUI/

### Finish!

Reboot.

PS.
This is my first contribution so go easy on me.

PPS.
Your warranty is now void. I'm not responsible if you bricked your device. You are choosing to make this modifications.

PPPS.
Another method of enabling blur using apktool.
Hello there . can you do it for my android 11 miui 12 global redmi note 8 device please?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    How to enable the blur effects on MIUI 12

    If you have a low-end device, you probably noticed the gray background color on your control center and notification shade. Let's bring back the glorious blur effect by patching MiuiSystemUI.apk.

    Prerequisites:
    • adb
    • smali/baksmali
    • zip
    • a tool to decompile .apk file
    • Custom Recovery
    • Common knowledge. I'm not responsible if you bricked your device or caused a thermonuclear war.
    ### Prepare the tools needed.

    Install the tools required for this operation. Use your favorite distro's package manager to install it or clone it from its github repository.

    ### Pull MiuiSystemUI.apk from your device

    Bash:
    $ adb pull /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk .

    The command above will copy the apk file to the current directory. It's recommended to create a backup. We will be overwriting it later.

    ### Decompile or Extract the APK

    Decompile the APK with your favorite tool. I will use MT Manager, an android application, for this. Go to the extracted folder. It should contain:
    • assets/
    • kotlin/
    • META-INF/
    • res/
    • AndroidManifest.xml
    • classes.dex
    • resources.arsc
    ### Disassemble classes.dex

    Disassemble it by:

    Bash:
    $ baksmali d classes.dex

    This command should create the out/ folder. It will contain all the .smali files extracted from classes.dex.

    Go inside the out/ folder.

    ### Editing .smali files to enable blur

    This is the important part. There are two files we need to edit. The ControlPanelWindowManager.smali that will enable the blur on the control center and StatusBarWindowManager.smali that will enable the blur on the notification shade.

    1. Open com/android/systemui/miui/statusbar/phone/ControlPanelWindowManager.smali with your favorite text editor.
    2. Find the applyBlurRatio() method. It should be on line 101 to 148. Then change the whole function to:

    Code:
    .method private applyBlurRatio(F)V
        .registers 5
    
        .line 180
        invoke-virtual {p0}, Lcom/android/systemui/miui/statusbar/phone/ControlPanelWindowManager;->hasAdded()Z
    
        move-result v0
    
        if-eqz v0, :cond_2b
    
        .line 181
        new-instance v0, Ljava/lang/StringBuilder;
    
        invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
    
        const-string v1, "setBlurRatio: "
    
        invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
    
        invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;
    
        invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
    
        move-result-object v0
    
        const-string v1, "ControlPanelWindowManager"
    
        invoke-static {v1, v0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
    
        .line 182
        iget-object v0, p0, Lcom/android/systemui/miui/statusbar/phone/ControlPanelWindowManager;->mLpChanged:Landroid/view/WindowManager$LayoutParams;
    
        iget-object v1, p0, Lcom/android/systemui/miui/statusbar/phone/ControlPanelWindowManager;->mControlPanel:Lcom/android/systemui/miui/statusbar/phone/ControlPanelWindowView;
    
        invoke-virtual {v1}, Landroid/widget/FrameLayout;->getViewRootImpl()Landroid/view/ViewRootImpl;
    
        move-result-object v1
    
        const/4 v2, 0x0
    
        invoke-static {v0, v1, p1, v2}, Landroid/view/SurfaceControlCompat;->setBlur(Landroid/view/WindowManager$LayoutParams;Landroid/view/ViewRootImpl;FI)V
    
        .line 183
        invoke-direct {p0}, Lcom/android/systemui/miui/statusbar/phone/ControlPanelWindowManager;->apply()V
    
        :cond_2b
        return-void
    .end method

    3. Save it.

    4. Open com/android/systemui/statusbar/phone/StatusBarWindowManager.smali with your favorite text editor.

    5. Find the applyBlurRatio() method. It should be on line 294 to 341. Then change the whole function to:

    Code:
    .method private applyBlurRatio(Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;)V
        .registers 6
    
        .line 320
        iget-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->mLpChanged:Landroid/view/WindowManager$LayoutParams;
    
        iget-object v1, p0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->mStatusBarView:Landroid/view/ViewGroup;
    
        invoke-virtual {v1}, Landroid/view/ViewGroup;->getViewRootImpl()Landroid/view/ViewRootImpl;
    
        move-result-object v1
    
        iget v2, p1, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;->blurRatio:F
    
        const/4 v3, 0x0
    
        invoke-static {v0, v1, v2, v3}, Landroid/view/SurfaceControlCompat;->setBlur(Landroid/view/WindowManager$LayoutParams;Landroid/view/ViewRootImpl;FI)V
    
        .line 323
        iget-object p0, p0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->mBlurRatioListeners:Ljava/util/List;
    
        invoke-interface {p0}, Ljava/util/List;->iterator()Ljava/util/Iterator;
    
        move-result-object p0
    
        :goto_14
        invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
    
        move-result v0
    
        if-eqz v0, :cond_26
    
        invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
    
        move-result-object v0
    
        check-cast v0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$BlurRatioChangedListener;
    
        .line 324
        iget v1, p1, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;->blurRatio:F
    
        invoke-interface {v0, v1}, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$BlurRatioChangedListener;->onBlurRatioChanged(F)V
    
        goto :goto_14
    
        :cond_26
        return-void
    .end method

    6. Save it.

    ### Assemble .smali files back to classes.dex

    Inside out/ folder. Execute the command below to assemble all smali files back to classes.dex

    Bash:
    $ smali a . -o classes.dex

    This should create a new classes.dex on the current directory.

    ### Build a new MiuiSystemUI.apk

    Move or copy the compiled classes.dex to the extracted MiuiSystemUI.apk. This should replace the old one. Then delete the out/ folder. We don't need it anymore. Create a new MiuiSystemUI.apk by:

    Bash:
    $ zip -r MiuiSystemUI.apk assets/ kotlin/ META-INF/ res/ AndroidManifest.xml classes.dex resources.arsc

    ### Push the new MiuiSystemUI.apk

    Go to your custom recovery, mount /system, then push the modified MiuiSystemUI.apk. Note that if you're rooted with Magisk, you can create a magisk module instead.

    This will overwrite the default or stock MiuiSystemUI.apk so make sure you made a backup before doing this.

    Bash:
    $ adb push MiuiSystemUI.apk /system/priv-app/MiuiSystemUI/

    ### Finish!

    Reboot.

    PS.
    This is my first contribution so go easy on me.

    PPS.
    Your warranty is now void. I'm not responsible if you bricked your device. You are choosing to make this modifications.

    PPPS.
    Another method of enabling blur using apktool.
    2
    Worked on my Redmi Note 8T with MIUI Global 12.0.3.0. Thanks A LOT!
    1
    I thank you too much, I am the owner of the same terminal, but I still do not understand how to pass the file to the file if the system is in read mode, please notify the person who requested the patch if It really worked for him

    Also, I wish I could do the same with my own hands, would you be so kind as to attach a folder with all the necessary files? If it is not much annoying, I await your answer, greetings
    You gotta go into recovery, file manager and then go to system/priv-app/MiuiSystemUI and replace the apk in there ^^