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


Java VActivityManager类代码示例

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


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

示例1: call

import com.lody.virtual.client.ipc.VActivityManager; //导入依赖的package包/类
@Override
public Object call(Object who, Method method, Object... args) throws Throwable {
    String creator = (String) args[1];
    String[] resolvedTypes = (String[]) args[6];
    int type = (int) args[0];
    int flags = (int) args[7];
    if ((PendingIntent.FLAG_UPDATE_CURRENT & flags) != 0) {
        flags = (flags & ~(PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_NO_CREATE)) | PendingIntent.FLAG_CANCEL_CURRENT;
    }
    if (args[5] instanceof Intent[]) {
        Intent[] intents = (Intent[]) args[5];
        if (intents.length > 0) {
            Intent intent = intents[intents.length - 1];
            if (resolvedTypes != null && resolvedTypes.length > 0) {
                intent.setDataAndType(intent.getData(), resolvedTypes[resolvedTypes.length - 1]);
            }
            Intent targetIntent = redirectIntentSender(type, creator, intent);
            if (targetIntent != null) {
                args[5] = new Intent[]{targetIntent};
            }
        }
    }
    args[7] = flags;
    args[1] = getHostPkg();
    // Force userId to 0
    if (args[args.length - 1] instanceof Integer) {
        args[args.length - 1] = 0;
    }
    IInterface sender = (IInterface) method.invoke(who, args);
    if (sender != null && creator != null) {
        VActivityManager.get().addPendingIntent(sender.asBinder(), creator);
    }
    return sender;
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:35,代码来源:MethodProxies.java

示例2: callActivityOnResume

import com.lody.virtual.client.ipc.VActivityManager; //导入依赖的package包/类
@Override
public void callActivityOnResume(Activity activity) {
    VirtualCore.get().getComponentDelegate().beforeActivityResume(activity);
    VActivityManager.get().onActivityResumed(activity);
    super.callActivityOnResume(activity);
    VirtualCore.get().getComponentDelegate().afterActivityResume(activity);
    Intent intent = activity.getIntent();
    if (intent != null) {
        Bundle bundle = intent.getBundleExtra("_VA_|_sender_");
        if (bundle != null) {
            IBinder callbackToken = BundleCompat.getBinder(bundle, "_VA_|_ui_callback_");
            IUiCallback callback = IUiCallback.Stub.asInterface(callbackToken);
            if (callback != null) {
                try {
                    callback.onAppOpened(VClientImpl.get().getCurrentPackage(), VUserHandle.myUserId());
                } catch (RemoteException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:23,代码来源:AppInstrumentation.java

示例3: handleReceiver

import com.lody.virtual.client.ipc.VActivityManager; //导入依赖的package包/类
private void handleReceiver(ReceiverData data) {
    BroadcastReceiver.PendingResult result = data.resultData.build();
    try {
        if (!isBound()) {
            bindApplication(data.component.getPackageName(), data.processName);
        }
        Context context = mInitialApplication.getBaseContext();
        Context receiverContext = ContextImpl.getReceiverRestrictedContext.call(context);
        String className = data.component.getClassName();
        BroadcastReceiver receiver = (BroadcastReceiver) context.getClassLoader().loadClass(className).newInstance();
        mirror.android.content.BroadcastReceiver.setPendingResult.call(receiver, result);
        data.intent.setExtrasClassLoader(context.getClassLoader());
        receiver.onReceive(receiverContext, data.intent);
        if (mirror.android.content.BroadcastReceiver.getPendingResult.call(receiver) != null) {
            result.finish();
        }
    } catch (Exception e) {
        e.printStackTrace();
        throw new RuntimeException(
                "Unable to start receiver " + data.component
                        + ": " + e.toString(), e);
    }
    VActivityManager.get().broadcastFinish(data.resultData);
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:25,代码来源:VClientImpl.java

示例4: afterCall

import com.lody.virtual.client.ipc.VActivityManager; //导入依赖的package包/类
@Override
public Object afterCall(Object who, Method method, Object[] args, Object result) throws Throwable {
    IBinder token = (IBinder) args[0];
    ActivityClientRecord r = VActivityManager.get().getActivityRecord(token);
    boolean taskRemoved = VActivityManager.get().onActivityDestroy(token);
    if (!taskRemoved && r != null && r.activity != null && r.info.getThemeResource() != 0) {
        try {
            TypedValue out = new TypedValue();
            Resources.Theme theme = r.activity.getResources().newTheme();
            theme.applyStyle(r.info.getThemeResource(), true);
            if (theme.resolveAttribute(android.R.attr.windowAnimationStyle, out, true)) {

                TypedArray array = theme.obtainStyledAttributes(out.data,
                        new int[]{
                                android.R.attr.activityCloseEnterAnimation,
                                android.R.attr.activityCloseExitAnimation
                        });
                r.activity.overridePendingTransition(array.getResourceId(0, 0), array.getResourceId(1, 0));
                array.recycle();
            }
        } catch (Throwable e) {
            e.printStackTrace();
        }
    }
    return super.afterCall(who, method, args, result);
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:27,代码来源:MethodProxies.java

示例5: callActivityOnCreate

import com.lody.virtual.client.ipc.VActivityManager; //导入依赖的package包/类
@Override
public void callActivityOnCreate(Activity activity, Bundle icicle) {
    VirtualCore.get().getComponentDelegate().beforeActivityCreate(activity);
    IBinder token = mirror.android.app.Activity.mToken.get(activity);
    ActivityClientRecord r = VActivityManager.get().getActivityRecord(token);
    if (r != null) {
        r.activity = activity;
    }
    ContextFixer.fixContext(activity);
    ActivityFixer.fixActivity(activity);
    ActivityInfo info = null;
    if (r != null) {
        info = r.info;
    }
    if (info != null) {
        if (info.theme != 0) {
            activity.setTheme(info.theme);
        }
        if (activity.getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
                && info.screenOrientation != ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) {
            activity.setRequestedOrientation(info.screenOrientation);
        }
    }
    super.callActivityOnCreate(activity, icicle);
    VirtualCore.get().getComponentDelegate().afterActivityCreate(activity);
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:27,代码来源:AppInstrumentation.java

示例6: detectProcessType

import com.lody.virtual.client.ipc.VActivityManager; //导入依赖的package包/类
private void detectProcessType() {
    // Host package name
    hostPkgName = context.getApplicationInfo().packageName;
    // Main process name
    mainProcessName = context.getApplicationInfo().processName;
    // Current process name
    processName = ActivityThread.getProcessName.call(mainThread);
    if (processName.equals(mainProcessName)) {
        processType = ProcessType.Main;
    } else if (processName.endsWith(Constants.SERVER_PROCESS_NAME)) {
        processType = ProcessType.Server;
    } else if (VActivityManager.get().isAppProcess(processName)) {
        processType = ProcessType.VAppClient;
    } else {
        processType = ProcessType.CHILD;
    }
    if (isVAppProcess()) {
        systemPid = VActivityManager.get().getSystemPid();
    }
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:21,代码来源:VirtualCore.java

示例7: call

import com.lody.virtual.client.ipc.VActivityManager; //导入依赖的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:coding-dream,项目名称:TPlayer,代码行数:27,代码来源:MethodProxies.java

示例8: handleReceiver

import com.lody.virtual.client.ipc.VActivityManager; //导入依赖的package包/类
private void handleReceiver(ReceiverData data) {
    BroadcastReceiver.PendingResult result = data.resultData.build();
    try {
        Context context = createPackageContext(data.component.getPackageName());
        Context receiverContext = ContextImpl.getReceiverRestrictedContext.call(context);
        String className = data.component.getClassName();
        BroadcastReceiver receiver = (BroadcastReceiver) context.getClassLoader().loadClass(className).newInstance();
        mirror.android.content.BroadcastReceiver.setPendingResult.call(receiver, result);
        data.intent.setExtrasClassLoader(context.getClassLoader());
        receiver.onReceive(receiverContext, data.intent);
        if (mirror.android.content.BroadcastReceiver.getPendingResult.call(receiver) != null) {
            result.finish();
        }
    } catch (Exception e) {
        e.printStackTrace();
        throw new RuntimeException(
                "Unable to start receiver " + data.component
                        + ": " + e.toString(), e);
    }
    VActivityManager.get().broadcastFinish(data.resultData);
}
 
开发者ID:codehz,项目名称:container,代码行数:22,代码来源:VClientImpl.java

示例9: afterCall

import com.lody.virtual.client.ipc.VActivityManager; //导入依赖的package包/类
@Override
public Object afterCall(Object who, Method method, Object[] args, Object result) throws Throwable {
	IBinder token = (IBinder) args[0];
	ActivityClientRecord r = VActivityManager.get().getActivityRecord(token);
	boolean taskRemoved = VActivityManager.get().onActivityDestroy(token);
	if (!taskRemoved && r != null && r.activity != null && r.info.getThemeResource() != 0) {
		try {
               TypedValue out = new TypedValue();
               Resources.Theme theme = r.activity.getResources().newTheme();
               theme.applyStyle(r.info.getThemeResource(), true);
               if (theme.resolveAttribute(android.R.attr.windowAnimationStyle, out, true)) {

                   TypedArray array = theme.obtainStyledAttributes(out.data,
                           new int[]{
                                   android.R.attr.activityCloseEnterAnimation,
                                   android.R.attr.activityCloseExitAnimation
                           });
                   r.activity.overridePendingTransition(array.getResourceId(0, 0), array.getResourceId(1, 0));
                   array.recycle();
               }
           } catch (Throwable e) {
               e.printStackTrace();
           }
	}
	return super.afterCall(who, method, args, result);
}
 
开发者ID:codehz,项目名称:container,代码行数:27,代码来源:FinishActivity.java

示例10: call

import com.lody.virtual.client.ipc.VActivityManager; //导入依赖的package包/类
@Override
public synchronized Object call(Object who, Method method, Object... args) throws Throwable {
	List<ActivityManager.RunningAppProcessInfo> infoList = (List<ActivityManager.RunningAppProcessInfo>) method
			.invoke(who, args);
	if (infoList != null) {
		for (ActivityManager.RunningAppProcessInfo info : infoList) {
			if (VActivityManager.get().isAppPid(info.pid)) {
				List<String> pkgList = VActivityManager.get().getProcessPkgList(info.pid);
				String processName = VActivityManager.get().getAppProcessName(info.pid);
				if (processName != null) {
					info.processName = processName;
				}
				info.pkgList = pkgList.toArray(new String[pkgList.size()]);
				info.uid = VUserHandle.getAppId(VActivityManager.get().getUidByPid(info.pid));
			}
		}
	}
	return infoList;
}
 
开发者ID:codehz,项目名称:container,代码行数:20,代码来源:GetRunningAppProcesses.java

示例11: call

import com.lody.virtual.client.ipc.VActivityManager; //导入依赖的package包/类
@Override
public Object call(Object who, Method method, Object... args) throws Throwable {
    String creator = (String) args[1];
    args[1] = getHostPkg();
    String[] resolvedTypes = (String[]) args[6];
    int type = (int) args[0];
    if (args[5] instanceof Intent[]) {
        Intent[] intents = (Intent[]) args[5];
        if (intents.length > 0) {
            Intent intent = intents[intents.length - 1];
            if (resolvedTypes != null && resolvedTypes.length > 0) {
                intent.setDataAndType(intent.getData(), resolvedTypes[resolvedTypes.length - 1]);
            }
            Intent proxyIntent = redirectIntentSender(type, creator, intent);
            if (proxyIntent != null) {
                intents[intents.length - 1] = proxyIntent;
            }
        }
    }
    if (args.length > 7 && args[7] instanceof Integer) {
        args[7] = PendingIntent.FLAG_UPDATE_CURRENT;
    }
    IInterface sender = (IInterface) method.invoke(who, args);
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2 && sender != null && creator != null) {
        VActivityManager.get().addPendingIntent(sender.asBinder(), creator);
    }
    return sender;
}
 
开发者ID:codehz,项目名称:container,代码行数:29,代码来源:GetIntentSender.java

示例12: call

import com.lody.virtual.client.ipc.VActivityManager; //导入依赖的package包/类
@Override
public Object call(Object who, Method method, Object... args) throws Throwable {
    IInterface sender = (IInterface) args[0];
    if (sender != null) {
        IBinder binder = sender.asBinder();
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
            PendingIntent pendingIntent = PendingIntentData.readPendingIntent(binder);
            Intent intent = PendingIntentJBMR2.getIntent.call(pendingIntent);
            if (intent != null) {
                String creator = intent.getStringExtra("_VA_|_creator_");
                if (creator != null) {
                    return creator;
                }
            }
        } else {
            PendingIntentData data = VActivityManager.get().getPendingIntent(binder);
            if (data != null) {
                return data.creator;
            }
        }
    }
    return super.call(who, method, args);
}
 
开发者ID:codehz,项目名称:container,代码行数:24,代码来源:GetPackageForIntentSender.java

示例13: callActivityOnCreate

import com.lody.virtual.client.ipc.VActivityManager; //导入依赖的package包/类
@Override
public void callActivityOnCreate(Activity activity, Bundle icicle) {
       VirtualCore.get().getComponentDelegate().beforeActivityCreate(activity);
	IBinder token = mirror.android.app.Activity.mToken.get(activity);
	ActivityClientRecord r = VActivityManager.get().getActivityRecord(token);
	if (r != null) {
           r.activity = activity;
       }
	ContextFixer.fixContext(activity);
	ActivityFixer.fixActivity(activity);
	ActivityInfo info = null;
	if (r != null) {
           info = r.info;
       }
	if (info != null) {
           if (info.theme != 0) {
               activity.setTheme(info.theme);
           }
           if (activity.getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
                   && info.screenOrientation != ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) {
               activity.setRequestedOrientation(info.screenOrientation);
           }
       }
	super.callActivityOnCreate(activity, icicle);
	VirtualCore.get().getComponentDelegate().afterActivityCreate(activity);
}
 
开发者ID:codehz,项目名称:container,代码行数:27,代码来源:AppInstrumentation.java

示例14: onGetCallingUid

import com.lody.virtual.client.ipc.VActivityManager; //导入依赖的package包/类
public static int onGetCallingUid(int originUid) {
    int callingPid = Binder.getCallingPid();
    if (callingPid == Process.myPid()) {
        return VClientImpl.get().getBaseVUid();
    }
    if (callingPid == VirtualCore.get().getSystemPid()) {
        return Process.SYSTEM_UID;
    }
    int vuid = VActivityManager.get().getUidByPid(callingPid);
    if (vuid != -1) {
        return VUserHandle.getAppId(vuid);
    }
    VLog.d(TAG, "Unknown uid: " + callingPid);
    return VClientImpl.get().getBaseVUid();
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:16,代码来源:NativeEngine.java

示例15: onCreate

import com.lody.virtual.client.ipc.VActivityManager; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    finish();
    Intent intent = getIntent();
    StubActivityRecord r = new StubActivityRecord(intent);
    if (r.intent == null) {
        return;
    }
    r.intent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
    VActivityManager.get().startActivity(r.intent, r.userId);
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:13,代码来源:StubPendingActivity.java


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