Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

尝试着自己修改了下,Android 10 MIUI 11可用 #17

Open
tofuliang opened this issue Jun 20, 2020 · 6 comments
Open

尝试着自己修改了下,Android 10 MIUI 11可用 #17

tofuliang opened this issue Jun 20, 2020 · 6 comments

Comments

@tofuliang
Copy link

tofuliang commented Jun 20, 2020

看着MIUI 11反编译出来的代码

private void checkSystemSelfProtection(boolean arg2) {
        new Thread(arg2) {
            public void run() {
                PackageInfo v4_1;
                Process.setThreadPriority(10);
                if(!Build.IS_TABLET && !this.val$onlyCore) {
                    System.currentTimeMillis();
                    PackageManager v2 = SecurityManagerService.this.mContext.getPackageManager();
                    try {
                        v4_1 = v2.getPackageInfo("android", 0x40);
                    }
                    catch(PackageManager$NameNotFoundException v4) {
                        v4.printStackTrace();
                        throw new RuntimeException("System error: cannot find android package.");
                    }

                    Signature[] v4_2 = v4_1.signatures;
                    if(SecurityManagerService.this.nativeIsReleased()) {
                        SecurityManagerService.this.enforcePlatformSignature(v4_2);
                    }

                    ArrayList v5 = new ArrayList();
                    v5.add("com.lbe.security.miui");
                    String v6 = "com.android.updater";
                    v5.add(v6);
                    String v7 = "com.miui.securitycenter";
                    v5.add(v7);
                    String v8 = "com.xiaomi.finddevice";
                    v5.add(v8);
                    v5.add("com.miui.home");
                    v5.add("com.miui.guardprovider");
                    v5.add("com.miui.gallery");
                    String v10 = "com.xiaomi.market";
                    if(!Build.IS_INTERNATIONAL_BUILD && !Build.IS_CM_CUSTOMIZATION && !Build.IS_CM_CUSTOMIZATION_TEST) {
                        v5.add("com.miui.player");
                        v5.add("com.android.browser");
                        v5.add(v10);
                    }

                    Iterator v9 = v5.iterator();
                    while(v9.hasNext()) {
                        SecurityManagerService.this.checkEnabled(v2, v9.next());
                    }

                    SecurityManagerService.this.enforceAppSignature(v4_2, v6, true);
                    int v9_1 = 0;
                    SecurityManagerService.this.enforceAppSignature(v4_2, v7, false);
                    SecurityManagerService.this.enforceAppSignature(v4_2, v8, true);
                    if(!Build.IS_INTERNATIONAL_BUILD && !Build.IS_CM_CUSTOMIZATION && !Build.IS_CM_CUSTOMIZATION_TEST) {
                        SecurityManagerService.this.enforceAppSignature(v4_2, v10, false);
                    }

                    boolean v6_1 = SecurityManagerService.this.isOldmanMode();
                    v8 = "SecurityManagerService";
                    if(!SecurityManagerService.this.nativeIsReleased() || (v6_1)) {
                        Log.d(v8, "nativeIsReleased not set or " + v6_1);
                    }
                    else {
                        Log.d(v8, "nativeIsReleased set and " + v6_1);
                        SecurityManagerService v7_2 = SecurityManagerService.this;
                        if(v7_2.checkSysAppCrack()) {
                            v9_1 = 1;
                        }

                        v7_2.mSysAppCracked = v9_1;
                    }

                    System.currentTimeMillis();
                }
            }
        }.start();
    }

再看原来的代码,没搞懂


的用意何在,然后看到注释说onlyCore模式,猜想是这里的传值变了,翻遍这个services.jar也没找到哪里有这个val$onlyCore的赋值操作,就粗暴的使用

setIntField(param.thisObject, "val$onlyCore", 1);

试一下,成功了。
我的是K20 Pro 12+512. MIUI 是 11.0.8
配合Magisk模块终于可以去掉自带的应用商店,使用Google Play作为默认商店了。
修改后的源码在此
其他地方没认真验证过是否生效,不敢PR。
#15

附上成功冻结不反弹的列表
Screenshot_2020-06-20-20-33-57-057_com catchingnow icebox
Screenshot_2020-06-20-20-34-11-738_com catchingnow icebox

@lzk50136
Copy link

miui12有效吗?大兄弟

@tofuliang
Copy link
Author

miui12有效吗?大兄弟

有效的!

@neoblackxt
Copy link
Owner

有点意思

@Rakau
Copy link

Rakau commented Oct 29, 2020

我自己没环境,LZ可否编译一个

@tofuliang
Copy link
Author

我自己没环境,LZ可否编译一个

app-debug.apk.zip

@Rakau
Copy link

Rakau commented Oct 30, 2020

我自己没环境,LZ可否编译一个

app-debug.apk.zip

非常感谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants