【android多开虚拟引擎blackbox更新】

本文详细描述了如何在Android14中实现对小米系统的兼容,包括使用MethodHook和ProxyMethod处理`bindService`方法,以及提到通过替换inlinehook框架为ShadowHook来应对系统内核变化。同时提到了VirtualApp的商业版本开源及维护联系方式。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Android14的兼容

@ProxyMethod(“bindService”)
public static class BindService extends MethodHook {

    @Override
    protected Object hook(Object who, Method method, Object[] args) throws Throwable {
        Intent intent = (Intent) args[2];
        Intent proxyIntent = null;
        String resolvedType = (String) args[3];
        IServiceConnection connection = (IServiceConnection) args[4];

        int userId = intent.getIntExtra("_B_|_UserId", -1);
        userId = userId == -1 ? BActivityThread.getUserId() : userId;
        int callingPkgIdx = false ? 7 : (char) 6;
        long flags = getIntOrLongValue(args[5]);
        ResolveInfo resolveInfo = BlackBoxCore.getBPackageManager().resolveService(intent, 0, resolvedType, userId);
        if (resolveInfo != null || AppSystemEnv.isOpenPackage(intent.getComponent())) {
            if (BuildCompat.isU()){
                args[5] = Long.valueOf(flags & 2147483647L);
            }else{
                args[5] = Integer.valueOf((int) (flags & 2147483647L));
            }
            proxyIntent = BlackBoxCore.getBActivityManager().bindService(intent, connection == null ? null : connection.asBinder(), resolvedType,
                    userId);
            if (connection != null) {
                if (intent.getComponent() == null && resolveInfo != null) {
                    intent.setComponent(new ComponentName(resolveInfo.serviceInfo.packageName, resolveInfo.serviceInfo.name));
                }

                IServiceConnection proxy = ServiceConnectionDelegate.createProxy(connection, intent);
                args[4] = proxy;

                WeakReference<?> weakReference = BRLoadedApkServiceDispatcherInnerConnection.get(connection).mDispatcher();
                                    if (weakReference != null) {
                                        BRLoadedApkServiceDispatcher.get(weakReference.get())._set_mConnection(proxy);
                                    }
                }
            }
            if (BuildCompat.isT()){
                if (proxyIntent != null) {
                    args[2] = proxyIntent;
                    return method.invoke(who, args);
                }
            }else{
                return 0;
            }
        return 0;
    }

    @Override
    protected boolean isEnable() {

        return BlackBoxCore.get().isBlackProcess() || BlackBoxCore.get().isServerProcess();
    }
}

代码链接: 点击跳转
此版本支持 Android 5.0 ~ 14.0

小米系统Android14的兼容

由系统内核变更引起
最简单的方法:将inline hook框架换成字节的ShadowHook即可

VirtualApp

VirutalApp商业版本开源链接:点击跳转
如果需要对你们的虚拟引擎进行维护和更新可以联系我:点击进入交流群

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值