Chào mừng bạn đến Diễn Đàn ChơiMobile

Cộng đồng Mobile hàng đầu Việt Nam, Phát triển Android, iOS, Kỹ Thuật Mobile. Đăng ký ngay để tạo chủ để và cùng thảo luận !

Fix Remove "MiuiSuperMarket" stuck boot logo

Thảo luận trong 'MIUI Android Development' bắt đầu bởi MạnhIT, 15/12/15.

  1. MạnhIT

    MạnhIT Administrator
    Thành viên BQT Administrator

    10/2/13
    3,955
    4,624
    113
    Nam
    Các Rom MIUI xóa MiuiSuperMarket sẽ gây treo logo, sau đây là cách fix lỗi này.

    - Làm việc với file /system/framework/services.jar, yêu cần file này đã được deodex. Sau đó decompile với apktool

    - Mở file smali/com/android/server/pm/PackageManagerService.smali bằng Notepad++

    - Tìm (nhấn CTRL+F):
    .method static compareSignatures

    Sẽ thấy method này:

    Mã:
    .method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
        .locals 11
        .param p0, "s1"    # [Landroid/content/pm/Signature;
        .param p1, "s2"    # [Landroid/content/pm/Signature;
    
        .prologue
        const/4 v6, 0x1
    
        const/4 v8, -0x3
    
        const/4 v7, 0x0
    
        .line 3096
        if-nez p0, :cond_1
    
        .line 3097
        if-nez p1, :cond_0
    
        .line 3129
        :goto_0
        return v6
    
        .line 3097
        :cond_0
        const/4 v6, -0x1
    
        goto :goto_0
    
        .line 3102
        :cond_1
        if-nez p1, :cond_2
    
        .line 3103
        const/4 v6, -0x2
    
        goto :goto_0
    
        .line 3106
        :cond_2
        array-length v9, p0
    
        array-length v10, p1
    
        if-eq v9, v10, :cond_3
    
        move v6, v8
    
        .line 3107
        goto :goto_0
    
        .line 3111
        :cond_3
        array-length v9, p0
    
        if-ne v9, v6, :cond_5
    
        .line 3112
        aget-object v6, p0, v7
    
        aget-object v9, p1, v7
    
        invoke-virtual {v6, v9}, Landroid/content/pm/Signature;->equals(Ljava/lang/Object;)Z
    
        move-result v6
    
        if-eqz v6, :cond_4
    
        move v6, v7
    
        goto :goto_0
    
        :cond_4
        move v6, v8
    
        goto :goto_0
    
        .line 3117
        :cond_5
        new-instance v3, Ljava/util/HashSet;
    
        invoke-direct {v3}, Ljava/util/HashSet;-><init>()V
    
        .line 3118
        .local v3, "set1":Ljava/util/HashSet;, "Ljava/util/HashSet<Landroid/content/pm/Signature;>;"
        move-object v0, p0
    
        .local v0, "arr$":[Landroid/content/pm/Signature;
        array-length v2, v0
    
        .local v2, "len$":I
        const/4 v1, 0x0
    
        .local v1, "i$":I
        :goto_1
        if-ge v1, v2, :cond_6
    
        aget-object v5, v0, v1
    
        .line 3119
        .local v5, "sig":Landroid/content/pm/Signature;
        invoke-virtual {v3, v5}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z
    
        .line 3118
        add-int/lit8 v1, v1, 0x1
    
        goto :goto_1
    
        .line 3121
        .end local v5    # "sig":Landroid/content/pm/Signature;
        :cond_6
        new-instance v4, Ljava/util/HashSet;
    
        invoke-direct {v4}, Ljava/util/HashSet;-><init>()V
    
        .line 3122
        .local v4, "set2":Ljava/util/HashSet;, "Ljava/util/HashSet<Landroid/content/pm/Signature;>;"
        move-object v0, p1
    
        array-length v2, v0
    
        const/4 v1, 0x0
    
        :goto_2
        if-ge v1, v2, :cond_7
    
        aget-object v5, v0, v1
    
        .line 3123
        .restart local v5    # "sig":Landroid/content/pm/Signature;
        invoke-virtual {v4, v5}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z
    
        .line 3122
        add-int/lit8 v1, v1, 0x1
    
        goto :goto_2
    
        .line 3126
        .end local v5    # "sig":Landroid/content/pm/Signature;
        :cond_7
        invoke-virtual {v3, v4}, Ljava/util/HashSet;->equals(Ljava/lang/Object;)Z
    
        move-result v6
    
        if-eqz v6, :cond_8
    
        move v6, v7
    
        .line 3127
        goto :goto_0
    
        :cond_8
        move v6, v8
    
        .line 3129
        goto :goto_0
    .end method
    
    Xóa nó đi rồi thay bằng method sau:

    Mã:
    .method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
        .registers 9
    
        const/4 v0, 0x0
    
        return v0
    .end method
    
    - Xong thì nhớ ấn Save

    - Mở file smali\com\miui\server\SecurityManagerService.smali bằng Notepad++

    Tìm
    .method private checkSystemSelfProtection

    Thấy method sau:
    Mã:
    .method private checkSystemSelfProtection(Z)V
        .locals 3
        .param p1, "onlyCore"    # Z
    
        .prologue
        .line 226
        iget-object v1, p0, Lcom/miui/server/SecurityManagerService;->mContext:Landroid/content/Context;
    
        invoke-virtual {v1}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
    
        move-result-object v0
    
        .line 227
        .local v0, "pm":Landroid/content/pm/PackageManager;
        sget-boolean v1, Lmiui/os/Build;->IS_TABLET:Z
    
        if-nez v1, :cond_2
    
        if-nez p1, :cond_2
    
        .line 229
        const-string v1, "android"
    
        const-string v2, "com.android.updater"
    
        invoke-virtual {v0, v1, v2}, Landroid/content/pm/PackageManager;->checkSignatures(Ljava/lang/String;Ljava/lang/String;)I
    
        move-result v1
    
        if-eqz v1, :cond_0
    
        .line 230
        new-instance v1, Ljava/lang/RuntimeException;
    
        const-string v2, "System error : cannot find system app : com.android.updater"
    
        invoke-direct {v1, v2}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
    
        throw v1
    
        .line 234
        :cond_0
        const-string v1, "android"
    
        const-string v2, "com.miui.securitycenter"
    
        invoke-virtual {v0, v1, v2}, Landroid/content/pm/PackageManager;->checkSignatures(Ljava/lang/String;Ljava/lang/String;)I
    
        move-result v1
    
        if-eqz v1, :cond_1
    
        .line 235
        new-instance v1, Ljava/lang/RuntimeException;
    
        const-string v2, "System error : cannot find system app : com.miui.securitycenter"
    
        invoke-direct {v1, v2}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
    
        throw v1
    
        .line 238
        :cond_1
        sget-boolean v1, Lmiui/os/Build;->IS_INTERNATIONAL_BUILD:Z
    
        if-nez v1, :cond_2
    
        sget-boolean v1, Lmiui/os/Build;->IS_CM_CUSTOMIZATION:Z
    
        if-nez v1, :cond_2
    
        sget-boolean v1, Lmiui/os/Build;->IS_CM_CUSTOMIZATION_TEST:Z
    
        if-nez v1, :cond_2
    
        .line 241
        const-string v1, "android"
    
        const-string v2, "com.xiaomi.market"
    
        invoke-virtual {v0, v1, v2}, Landroid/content/pm/PackageManager;->checkSignatures(Ljava/lang/String;Ljava/lang/String;)I
    
        move-result v1
    
        if-eqz v1, :cond_2
    
        .line 242
        new-instance v1, Ljava/lang/RuntimeException;
    
        const-string v2, "System error : cannot find system app : com.xiaomi.market"
    
        invoke-direct {v1, v2}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
    
        throw v1
    
        .line 246
        :cond_2
        return-void
    .end method
    
    - Xóa đoạn này ( nó nắm cuối method)

    Mã:
        .line 241
        const-string v1, "android"
    
        const-string v2, "com.xiaomi.market"
    
        invoke-virtual {v0, v1, v2}, Landroid/content/pm/PackageManager;->checkSignatures(Ljava/lang/String;Ljava/lang/String;)I
    
        move-result v1
    
        if-eqz v1, :cond_2
    
        .line 242
        new-instance v1, Ljava/lang/RuntimeException;
    
        const-string v2, "System error : cannot find system app : com.xiaomi.market"
    
        invoke-direct {v1, v2}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
    
        throw v1
    - Xóa xong sẽ như dưới:
    Mã:
    .method private checkSystemSelfProtection(Z)V
        .locals 3
        .param p1, "onlyCore"    # Z
    
        .prologue
        .line 226
        iget-object v1, p0, Lcom/miui/server/SecurityManagerService;->mContext:Landroid/content/Context;
    
        invoke-virtual {v1}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
    
        move-result-object v0
    
        .line 227
        .local v0, "pm":Landroid/content/pm/PackageManager;
        sget-boolean v1, Lmiui/os/Build;->IS_TABLET:Z
    
        if-nez v1, :cond_2
    
        if-nez p1, :cond_2
    
        .line 229
        const-string v1, "android"
    
        const-string v2, "com.android.updater"
    
        invoke-virtual {v0, v1, v2}, Landroid/content/pm/PackageManager;->checkSignatures(Ljava/lang/String;Ljava/lang/String;)I
    
        move-result v1
    
        if-eqz v1, :cond_0
    
        .line 230
        new-instance v1, Ljava/lang/RuntimeException;
    
        const-string v2, "System error : cannot find system app : com.android.updater"
    
        invoke-direct {v1, v2}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
    
        throw v1
    
        .line 234
        :cond_0
        const-string v1, "android"
    
        const-string v2, "com.miui.securitycenter"
    
        invoke-virtual {v0, v1, v2}, Landroid/content/pm/PackageManager;->checkSignatures(Ljava/lang/String;Ljava/lang/String;)I
    
        move-result v1
    
        if-eqz v1, :cond_1
    
        .line 235
        new-instance v1, Ljava/lang/RuntimeException;
    
        const-string v2, "System error : cannot find system app : com.miui.securitycenter"
    
        invoke-direct {v1, v2}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
    
        throw v1
    
        .line 238
        :cond_1
        sget-boolean v1, Lmiui/os/Build;->IS_INTERNATIONAL_BUILD:Z
    
        if-nez v1, :cond_2
    
        sget-boolean v1, Lmiui/os/Build;->IS_CM_CUSTOMIZATION:Z
    
        if-nez v1, :cond_2
    
        sget-boolean v1, Lmiui/os/Build;->IS_CM_CUSTOMIZATION_TEST:Z
    
        if-nez v1, :cond_2
    
        .line 246
        :cond_2
        return-void
    .end method
    - Xong thì compile lại rồi đưa lại vào system, sau đó có thể xóa MiuiSuperMarket thoải mái không treo logo

    Mình đã áp dụng cho Rom MIUI 7 v5.12.10 của Redmi Note 3, ok nhé!

    .
     
    10 people like this.
  2. tngcphng

    Newbie

    2/4/13
    8
    3
    3
    Nam
    đã thử trên note 3 n9005 ko đc nha bác. vẫn treo logo. cái method thứ nhất thì có, còn method thứ 2 ko gioongs
     
  3. mrhoanghy92

    Official Member

    28/3/16
    65
    34
    0
    Nam
    Hưng Yên
    thark bác đang cần cái này, hi vọng được với các máy khác
     
  4. ritaritatech

    Senior Member

    15/2/17
    259
    0
    0
    Nam
    camera hanh trinh,camera ip wifi
    CÔNG TY TNHH TM RITA
    181 Nguyễn Đình Chính, P.11, Q. Phú Nhuận, TP.HCM
    Điện thoại: (08)66 826812 - 0909280812 - 0932042179

    CAMERA HÀNH TRÌNH CHÍNH HÃNG
     

Chia sẻ trang này