use of com.lody.virtual.client.hook.base.ResultStaticHook in project VirtualApp by asLody.
the class ActivityManagerPatch method onBindHooks.
@Override
protected void onBindHooks() {
super.onBindHooks();
if (VirtualCore.get().isVAppProcess()) {
addHook(new ReplaceLastUidHook("checkPermissionWithToken"));
addHook(new isUserRunning());
addHook(new ResultStaticHook("updateConfiguration", 0));
addHook(new ReplaceCallingPkgHook("setAppLockedVerifying"));
addHook(new StaticHook("checkUriPermission") {
@Override
public Object afterCall(Object who, Method method, Object[] args, Object result) throws Throwable {
return PackageManager.PERMISSION_GRANTED;
}
});
addHook(new StaticHook("getRecentTasks") {
@Override
public Object call(Object who, Method method, Object... args) throws Throwable {
Object _infos = method.invoke(who, args);
//noinspection unchecked
List<ActivityManager.RecentTaskInfo> infos = ParceledListSliceCompat.isReturnParceledListSlice(method) ? ParceledListSlice.getList.call(_infos) : (List) _infos;
for (ActivityManager.RecentTaskInfo info : infos) {
AppTaskInfo taskInfo = VActivityManager.get().getTaskInfo(info.id);
if (taskInfo == null) {
continue;
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
info.baseActivity = taskInfo.baseActivity;
info.topActivity = taskInfo.topActivity;
}
info.origActivity = taskInfo.baseActivity;
info.baseIntent = taskInfo.baseIntent;
}
return _infos;
}
});
}
}
use of com.lody.virtual.client.hook.base.ResultStaticHook in project VirtualApp by asLody.
the class AppWidgetManagerPatch method onBindHooks.
@Override
protected void onBindHooks() {
super.onBindHooks();
addHook(new ResultStaticHook("startListening", new int[0]));
addHook(new ResultStaticHook("stopListening", 0));
addHook(new ResultStaticHook("allocateAppWidgetId", 0));
addHook(new ResultStaticHook("deleteAppWidgetId", 0));
addHook(new ResultStaticHook("deleteHost", 0));
addHook(new ResultStaticHook("deleteAllHosts", 0));
addHook(new ResultStaticHook("getAppWidgetViews", null));
addHook(new ResultStaticHook("getAppWidgetIdsForHost", null));
addHook(new ResultStaticHook("createAppWidgetConfigIntentSender", null));
addHook(new ResultStaticHook("updateAppWidgetIds", 0));
addHook(new ResultStaticHook("updateAppWidgetOptions", 0));
addHook(new ResultStaticHook("getAppWidgetOptions", null));
addHook(new ResultStaticHook("partiallyUpdateAppWidgetIds", 0));
addHook(new ResultStaticHook("updateAppWidgetProvider", 0));
addHook(new ResultStaticHook("notifyAppWidgetViewDataChanged", 0));
addHook(new ResultStaticHook("getInstalledProvidersForProfile", null));
addHook(new ResultStaticHook("getAppWidgetInfo", null));
addHook(new ResultStaticHook("hasBindAppWidgetPermission", false));
addHook(new ResultStaticHook("setBindAppWidgetPermission", 0));
addHook(new ResultStaticHook("bindAppWidgetId", false));
addHook(new ResultStaticHook("bindRemoteViewsService", 0));
addHook(new ResultStaticHook("unbindRemoteViewsService", 0));
addHook(new ResultStaticHook("getAppWidgetIds", new int[0]));
addHook(new ResultStaticHook("isBoundWidgetPackage", false));
}
use of com.lody.virtual.client.hook.base.ResultStaticHook in project VirtualApp by asLody.
the class DropBoxManagerPatch method onBindHooks.
@Override
protected void onBindHooks() {
super.onBindHooks();
addHook(new ResultStaticHook("getNextEntry", null));
}
Aggregations