这里写自定义目录标题
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即可