cinit / QAuxiliary

QNotified phoenix - To make OICQ great again
Other
4.37k stars 321 forks source link

[dev] 模仿qa的修改dpi功能,写了一小段java代码放到自己制作的模块里,但激活后不起作用 #1200

Open huajiworld opened 2 months ago

huajiworld commented 2 months ago

描述 / Description

代码片段:

@Override
    public void handleLoadPackage(XC_LoadPackage.LoadPackageParam loadPackageParam) throws Throwable {

        Class<?> CompatibilityInfo = XposedHelpers.findClass("android.content.res.CompatibilityInfo", XposedBridge.BOOTCLASSLOADER);
        Class<?> ActivityThread = XposedHelpers.findClass("android.app.ActivityThread", XposedBridge.BOOTCLASSLOADER);
        if (Build.VERSION.SDK_INT <= 31) {
            XposedHelpers.findAndHookMethod(
                    ActivityThread,
                    "handleConfigurationChanged",
                    Configuration.class,
                    CompatibilityInfo,
                    new XC_MethodHook(XCallback.PRIORITY_HIGHEST) {
                        @Override
                        protected void beforeHookedMethod(MethodHookParam p) throws Throwable {
                            Configuration config = (Configuration) p.args[0];
                            if (config != null) {
                                config.densityDpi=240;
                            }

                        }
                    });
        } else {
            Class<?> ConfigurationController = XposedHelpers.findClass("android.app.ConfigurationController", XposedBridge.BOOTCLASSLOADER);
            XposedHelpers.findAndHookMethod(
                    ConfigurationController,
                    "handleConfigurationChanged",
                    Configuration.class,
                    CompatibilityInfo,
                    new XC_MethodHook(XCallback.PRIORITY_HIGHEST) {
                        @Override
                        protected void beforeHookedMethod(MethodHookParam p) throws Throwable {
                            Configuration config = (Configuration) p.args[0];
                            if (config != null) {
                                config.densityDpi = 240;
                            }

                        }
                    });
        }
    }

LSP 日志里没有任何报错信息,模块正常加载,hook 的软件是自己写的 hello world,但是激活后不起作用,想请教一下这个 dpi 修改功能是怎么起作用的

其他要求 / Other Requirements

cinit commented 2 months ago

打 log 看一下修改前的 dpi 呢

huajiworld commented 2 months ago

打 log 看一下修改前的 dpi 呢

----part 8 start----
[ 2024-09-20T16:41:24.333    10414: 32413: 32413 I/LSPosed-Bridge  ] Loading legacy module com.huajiworld.application2 from /data/app/~~pEkSezs78yQLciXyzr26lQ==/com.huajiworld.application2-uNI-00asBPqWftsxVlfi_g==/base.apk
[ 2024-09-20T16:41:24.336    10414: 32413: 32413 I/LSPosed-Bridge  ]   Loading class com.huajiworld.application2.HookInit
[ 2024-09-20T16:41:24.458    10414: 32413: 32413 I/LSPosed-Bridge  ] 原dpi480
[ 2024-09-20T16:41:24.468    10414: 32413: 32413 I/LSPosed-Bridge  ] 原dpi480
[ 2024-09-20T16:41:24.468    10414: 32413: 32413 I/LSPosed-Bridge  ] 目前dpi480
huajiworld commented 2 months ago

打 log 看一下修改前的 dpi 呢

修改前和修改后没区别

huajiworld commented 2 months ago

打 log 看一下修改前的 dpi 呢

大佬怎么不回我(

cinit commented 2 months ago

@huajiworld 因为我也不知道哪里出问题了

huajiworld commented 2 months ago

@huajiworld 因为我也不知道哪里出问题了

会不会是传统的 Xposed API 问题,要换个新的 API 才行?

cinit commented 2 months ago

@huajiworld 不可能

huajiworld commented 2 months ago

qa 用的是什么 hook api 啊

------------------ 原始邮件 ------------------ 发件人: "ACh @.>; 发送时间: 2024年9月24日(星期二) 凌晨0:22 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [cinit/QAuxiliary] [dev] 模仿qa的修改dpi功能,写了一小段java代码放到自己制作的模块里,但激活后不起作用 (Issue #1200)

@huajiworld 不可能

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

cinit commented 2 months ago

qa 用的是什么 hook api 啊

@huajiworld Xposed API 51+ / libxposed API 100 / LSPlant