static ComponentName replaceLastAppComponent(Object[] args, String hostPkg) { int index = ArrayUtils.indexOfLast(args, ComponentName.class); if (index != -1) { ComponentName orig = (ComponentName) args[index]; ComponentName newComponent = new ComponentName(hostPkg, orig.getClassName()); args[index] = newComponent; return newComponent; } return null; } }
public static String replaceLastAppPkg(Object[] args) { int index = ArrayUtils.indexOfLast(args, String.class); if (index != -1) { String pkg = (String) args[index]; args[index] = VirtualCore.get().getHostPkg(); return pkg; } return null; }
@Override public boolean beforeCall(Object who, Method method, Object... args) { int index = ArrayUtils.indexOfLast(args, Integer.class); if (index != -1) { int uid = (int) args[index]; if (uid == Process.myUid()) { args[index] = getRealUid(); } } return super.beforeCall(who, method, args); } }
public static ComponentName replaceLastAppComponent(Object[] args) { int index = ArrayUtils.indexOfLast(args, ComponentName.class); if (index != -1) { ComponentName orig = (ComponentName) args[index]; ComponentName newComponent = new ComponentName(VirtualCore.get().getHostPkg(), orig.getClassName()); args[index] = newComponent; return newComponent; } return null; }
public static String replaceLastAppPkg(Object[] args) { int index = ArrayUtils.indexOfLast(args, String.class); if (index != -1) { String pkg = (String) args[index]; args[index] = VirtualCore.get().getHostPkg(); return pkg; } return null; }
public static String replaceLastAppPkg(Object[] args) { int index = ArrayUtils.indexOfLast(args, String.class); if (index != -1) { String pkg = (String) args[index]; args[index] = VirtualCore.get().getHostPkg(); return pkg; } return null; }
@Override public boolean beforeCall(Object who, Method method, Object... args) { int index = ArrayUtils.indexOfLast(args, Integer.class); if (index != -1) { int uid = (int) args[index]; if (uid == Process.myUid()) { args[index] = getRealUid(); } } return super.beforeCall(who, method, args); } }
@Override public boolean beforeCall(Object who, Method method, Object... args) { int index = ArrayUtils.indexOfLast(args, Integer.class); if (index != -1) { int uid = (int) args[index]; if (uid == Process.myUid()) { args[index] = getRealUid(); } } return super.beforeCall(who, method, args); } }