当前位置: 首页>>代码示例>>Java>>正文


Java ServiceConnectionDelegate类代码示例

本文整理汇总了Java中com.lody.virtual.client.hook.secondary.ServiceConnectionDelegate的典型用法代码示例。如果您正苦于以下问题:Java ServiceConnectionDelegate类的具体用法?Java ServiceConnectionDelegate怎么用?Java ServiceConnectionDelegate使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ServiceConnectionDelegate类属于com.lody.virtual.client.hook.secondary包,在下文中一共展示了ServiceConnectionDelegate类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: call

import com.lody.virtual.client.hook.secondary.ServiceConnectionDelegate; //导入依赖的package包/类
@Override
public Object call(Object who, Method method, Object... args) throws Throwable {
    IInterface caller = (IInterface) args[0];
    IBinder token = (IBinder) args[1];
    Intent service = (Intent) args[2];
    String resolvedType = (String) args[3];
    IServiceConnection conn = (IServiceConnection) args[4];
    int flags = (int) args[5];
    int userId = VUserHandle.myUserId();
    if (isServerProcess()) {
        userId = service.getIntExtra("_VA_|_user_id_", VUserHandle.USER_NULL);
    }
    if (userId == VUserHandle.USER_NULL) {
        return method.invoke(who, args);
    }
    ServiceInfo serviceInfo = VirtualCore.get().resolveServiceInfo(service, userId);
    if (serviceInfo != null) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            service.setComponent(new ComponentName(serviceInfo.packageName, serviceInfo.name));
        }
        conn = ServiceConnectionDelegate.getDelegate(conn);
        return VActivityManager.get().bindService(caller.asBinder(), token, service, resolvedType,
                conn, flags, userId);
    }
    return method.invoke(who, args);
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:27,代码来源:MethodProxies.java

示例2: bindService

import com.lody.virtual.client.hook.secondary.ServiceConnectionDelegate; //导入依赖的package包/类
public int bindService(Context context, Intent service, ServiceConnection connection, int flags) {
    try {
        IServiceConnection conn = ServiceConnectionDelegate.getDelegate(context, connection, flags);
        return getService().bindService(null, null, service, null, conn, flags, 0);
    } catch (RemoteException e) {
        return VirtualRuntime.crash(e);
    }
}
 
开发者ID:coding-dream,项目名称:TPlayer,代码行数:9,代码来源:VActivityManager.java

示例3: unbindService

import com.lody.virtual.client.hook.secondary.ServiceConnectionDelegate; //导入依赖的package包/类
public boolean unbindService(Context context, ServiceConnection connection) {
    try {
        IServiceConnection conn = ServiceConnectionDelegate.removeDelegate(context, connection);
        return getService().unbindService(conn, VUserHandle.myUserId());
    } catch (RemoteException e) {
        return VirtualRuntime.crash(e);
    }
}
 
开发者ID:coding-dream,项目名称:TPlayer,代码行数:9,代码来源:VActivityManager.java

示例4: call

import com.lody.virtual.client.hook.secondary.ServiceConnectionDelegate; //导入依赖的package包/类
@Override
public Object call(Object who, Method method, Object... args) throws Throwable {
	IServiceConnection conn = (IServiceConnection) args[0];
	ServiceConnectionDelegate delegate = ServiceConnectionDelegate.removeDelegate(conn);
	if (delegate == null) {
		return method.invoke(who, args);
	}
	return VActivityManager.get().unbindService(delegate);
}
 
开发者ID:codehz,项目名称:container,代码行数:10,代码来源:UnbindService.java

示例5: call

import com.lody.virtual.client.hook.secondary.ServiceConnectionDelegate; //导入依赖的package包/类
@Override
public Object call(Object who, Method method, Object... args) throws Throwable {
	IInterface caller = (IInterface) args[0];
	IBinder token = (IBinder) args[1];
	Intent service = (Intent) args[2];
	String resolvedType = (String) args[3];
	IServiceConnection conn = (IServiceConnection) args[4];
	if (!VirtualCore.get().getComponentDelegate().onStartService(service)) return 0;
	int flags = (int) args[5];
	int userId = VUserHandle.myUserId();
	if (isServerProcess()) {
		userId = service.getIntExtra("_VA_|_user_id_", VUserHandle.USER_NULL);
	}
	if (userId == VUserHandle.USER_NULL) {
		return method.invoke(who, args);
	}
	ServiceInfo serviceInfo = VirtualCore.get().resolveServiceInfo(service, userId);
	if (serviceInfo != null) {
		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
			service.setComponent(new ComponentName(serviceInfo.packageName, serviceInfo.name));
		}
		conn = ServiceConnectionDelegate.getDelegate(conn);
		return VActivityManager.get().bindService(caller.asBinder(), token, service, resolvedType,
                   conn, flags, userId);
	}
	return method.invoke(who, args);
}
 
开发者ID:codehz,项目名称:container,代码行数:28,代码来源:BindService.java


注:本文中的com.lody.virtual.client.hook.secondary.ServiceConnectionDelegate类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。