@Override protected void onBindMethods() { super.onBindMethods(); addMethodProxy(new ReplaceCallingPkgMethodProxy("getApplicationRestrictions")); addMethodProxy(new ReplaceCallingPkgMethodProxy("notifyPermissionResponse")); addMethodProxy(new ReplaceCallingPkgMethodProxy("requestPermission")); } }
@Override public boolean beforeCall(Object who, Method method, Object... args) { if (args[0] instanceof Integer) { args[0] = getRealUid(); } return super.beforeCall(who, method, args); } }
@Override public Object call(Object who, Method method, Object... args) throws Throwable { if (isFakeLocationEnable()) { return null; } return super.call(who, method, args); } }
@Override protected void onBindMethods() { super.onBindMethods(); addMethodProxy(new ReplaceCallingPkgMethodProxy("addOnAppsChangedListener")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getLauncherActivities")); addMethodProxy(new ReplaceCallingPkgMethodProxy("resolveActivity")); addMethodProxy(new ReplaceCallingPkgMethodProxy("startActivityAsUser")); addMethodProxy(new ReplaceCallingPkgMethodProxy("showAppDetailsAsUser")); addMethodProxy(new ReplaceCallingPkgMethodProxy("isPackageEnabled")); addMethodProxy(new ReplaceCallingPkgMethodProxy("isActivityEnabled")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getApplicationInfo")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getShortcuts")); addMethodProxy(new ReplaceCallingPkgMethodProxy("pinShortcuts")); addMethodProxy(new ReplaceCallingPkgMethodProxy("startShortcut")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getShortcutIconResId")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getShortcutIconFd")); addMethodProxy(new ReplaceCallingPkgMethodProxy("hasShortcutHostPermission")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getShortcutConfigActivities")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getShortcutConfigActivityIntent")); } }
@Override public Object call(Object who, Method method, Object... args) throws Throwable { // noinspection unchecked if (isFakeLocationEnable()) { new ArrayList<ScanResult>(0); } return super.call(who, method, args); } }
@TargetApi(Build.VERSION_CODES.LOLLIPOP) @Override public boolean beforeCall(Object who, Method method, Object... args) { ShortcutInfo shortcutInfo = findFirstShortcutInfo(args); replaceShortcutInfo(shortcutInfo, getHostPkg(), getPM()); return super.beforeCall(who, method, args); }
@Override protected void onBindMethods() { super.onBindMethods(); addMethodProxy(new ReplaceCallingPkgMethodProxy("createVirtualDisplay")); }
@Override public Object call(Object who, Method method, Object... args) throws Throwable { if (isFakeLocationEnable()) { List<VCell> cells = VirtualLocationManager.get().getAllCell(getAppUserId(), getAppPkg()); if (cells != null) { List<CellInfo> result = new ArrayList<CellInfo>(); for (VCell cell : cells) { result.add(createCellInfo(cell)); } return result; } } return super.call(who, method, args); } }
@Override public boolean beforeCall(Object who, Method method, Object... args) { List<ShortcutInfo> shortcutList = findFirstShortcutList(args); if (shortcutList != null) { String hostPkg = getHostPkg(); for (ShortcutInfo shortcutInfo : shortcutList) { replaceShortcutInfo(shortcutInfo, hostPkg, getPM()); } } return super.beforeCall(who, method, args); }
@Override protected void onBindMethods() { super.onBindMethods(); addMethodProxy(new ReplaceCallingPkgMethodProxy("registerClientAsUser")); } }
@Override public Object call(Object who, Method method, Object... args) throws Throwable { if (isFakeLocationEnable()) { VCell cell = VirtualLocationManager.get().getCell(getAppUserId(), getAppPkg()); if (cell != null) { return getCellLocationInternal(cell); } } return super.call(who, method, args); } }
@Override public boolean beforeCall(Object who, Method method, Object... args) { if (args[0] instanceof Integer) { args[0] = getRealUid(); } return super.beforeCall(who, method, args); } }
@Override protected void onBindMethods() { super.onBindMethods(); addMethodProxy(new ReplaceCallingPkgMethodProxy("createSession")); } }
@Override public Object call(Object who, Method method, Object... args) throws Throwable { if (isFakeLocationEnable()) { List<VCell> cells = VirtualLocationManager.get().getNeighboringCell(getAppUserId(), getAppPkg()); if (cells != null) { List<NeighboringCellInfo> infos = new ArrayList<>(); for (VCell cell : cells) { NeighboringCellInfo info = new NeighboringCellInfo(); mirror.android.telephony.NeighboringCellInfo.mLac.set(info, cell.lac); mirror.android.telephony.NeighboringCellInfo.mCid.set(info, cell.cid); mirror.android.telephony.NeighboringCellInfo.mRssi.set(info, 6); infos.add(info); } return infos; } } return super.call(who, method, args); } }
@Override public boolean beforeCall(Object who, Method method, Object... args) { if (args[0] instanceof Integer) { args[0] = getRealUid(); } return super.beforeCall(who, method, args); } }
@Override protected void onBindMethods() { super.onBindMethods(); addMethodProxy(new ReplaceCallingPkgMethodProxy("requestBufferForProcess")); } }
@Override public Object call(Object who, Method method, Object... args) throws Throwable { if (isFakeLocationEnable()) { return null; } return super.call(who, method, args); } }
@TargetApi(Build.VERSION_CODES.LOLLIPOP) @Override public boolean beforeCall(Object who, Method method, Object... args) { ShortcutInfo shortcutInfo = findFirstShortcutInfo(args); replaceShortcutInfo(shortcutInfo, getHostPkg(), getPM()); return super.beforeCall(who, method, args); }
@Override protected void onBindMethods() { super.onBindMethods(); addMethodProxy(new ReplaceCallingPkgMethodProxy("getManifestShortcuts")); // TODO: 18/3/3 Support dynamic shortcut ? addMethodProxy(new ReplaceCallingPkgMethodProxy("getDynamicShortcuts")); addMethodProxy(new ReplacePkgAndShortcutListMethodProxy("setDynamicShortcuts")); addMethodProxy(new ReplaceCallingPkgMethodProxy("addDynamicShortcuts")); addMethodProxy(new ReplaceCallingPkgMethodProxy("createShortcutResultIntent")); addMethodProxy(new ReplaceCallingPkgMethodProxy("disableShortcuts")); addMethodProxy(new ReplaceCallingPkgMethodProxy("enableShortcuts")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getRemainingCallCount")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getRateLimitResetTime")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getIconMaxDimensions")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getMaxShortcutCountPerActivity")); addMethodProxy(new ReplaceCallingPkgMethodProxy("reportShortcutUsed")); addMethodProxy(new ReplaceCallingPkgMethodProxy("onApplicationActive")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getPinnedShortcuts")); addMethodProxy(new ReplacePkgAndShortcutMethodProxy("requestPinShortcut")); }
@Override public Object call(Object who, Method method, Object... args) throws Throwable { // noinspection unchecked if (isFakeLocationEnable()) { new ArrayList<ScanResult>(0); } return super.call(who, method, args); } }