@Override public Object call(Object who, Method method, Object... args) throws Throwable { return getDeviceInfo().deviceId; } }
@Override public Object call(Object who, Method method, Object... args) throws Throwable { if (isFakeLocationEnable()) { return null; } return super.call(who, method, args); } }
@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 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 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); } }
addInjector(new MountServiceStub()); addInjector(new BackupManagerStub()); addInjector(new TelephonyStub()); addInjector(new TelephonyRegistryStub()); addInjector(new PhoneSubInfoStub()); addInjector(new PowerManagerStub());
@Override public boolean beforeCall(Object who, Method method, Object... args) { if (android.os.Build.VERSION.SDK_INT >= 17) { if (isFakeLocationEnable()) { for (int i = args.length - 1; i > 0; i--) { if (args[i] instanceof Integer) { int events = (Integer) args[i]; events ^= PhoneStateListener.LISTEN_CELL_INFO; events ^= PhoneStateListener.LISTEN_CELL_LOCATION; args[i] = events; break; } } } } return super.beforeCall(who, method, args); } });
@Override protected void onBindMethods() { super.onBindMethods(); addMethodProxy(new ReplaceCallingPkgMethodProxy("listen")); addMethodProxy(new ReplaceSequencePkgMethodProxy("listenForSubscriber", 1) { @Override public boolean beforeCall(Object who, Method method, Object... args) { if (android.os.Build.VERSION.SDK_INT >= 17) { if (isFakeLocationEnable()) { for (int i = args.length - 1; i > 0; i--) { if (args[i] instanceof Integer) { int events = (Integer) args[i]; events ^= PhoneStateListener.LISTEN_CELL_INFO; events ^= PhoneStateListener.LISTEN_CELL_LOCATION; args[i] = events; break; } } } } return super.beforeCall(who, method, args); } }); } }
@Override protected void onBindMethods() { super.onBindMethods(); addMethodProxy(new ReplaceCallingPkgMethodProxy("isOffhook")); addMethodProxy(new ReplaceLastPkgMethodProxy("getLine1NumberForDisplay")); addMethodProxy(new ReplaceLastPkgMethodProxy("isOffhookForSubscriber")); addMethodProxy(new ReplaceLastPkgMethodProxy("isRingingForSubscriber")); addMethodProxy(new ReplaceCallingPkgMethodProxy("call")); addMethodProxy(new ReplaceCallingPkgMethodProxy("isRinging")); addMethodProxy(new ReplaceCallingPkgMethodProxy("isIdle")); addMethodProxy(new ReplaceLastPkgMethodProxy("isIdleForSubscriber")); addMethodProxy(new ReplaceCallingPkgMethodProxy("isRadioOn")); addMethodProxy(new ReplaceLastPkgMethodProxy("isRadioOnForSubscriber")); addMethodProxy(new ReplaceLastPkgMethodProxy("isSimPinEnabled")); addMethodProxy(new ReplaceLastPkgMethodProxy("getCdmaEriIconIndex")); addMethodProxy(new ReplaceLastPkgMethodProxy("getCdmaEriIconIndexForSubscriber")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getCdmaEriIconMode")); addMethodProxy(new ReplaceLastPkgMethodProxy("getCdmaEriIconModeForSubscriber")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getCdmaEriText")); addMethodProxy(new ReplaceLastPkgMethodProxy("getCdmaEriTextForSubscriber")); addMethodProxy(new ReplaceLastPkgMethodProxy("getNetworkTypeForSubscriber")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getDataNetworkType")); addMethodProxy(new ReplaceLastPkgMethodProxy("getDataNetworkTypeForSubscriber")); addMethodProxy(new ReplaceLastPkgMethodProxy("getVoiceNetworkTypeForSubscriber")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getLteOnCdmaMode")); addMethodProxy(new ReplaceLastPkgMethodProxy("getLteOnCdmaModeForSubscriber")); addMethodProxy(new ReplaceLastPkgMethodProxy("getCalculatedPreferredNetworkType")); addMethodProxy(new ReplaceLastPkgMethodProxy("getPcscfAddress")); addMethodProxy(new ReplaceLastPkgMethodProxy("getLine1AlphaTagForDisplay")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getMergedSubscriberIds"));
@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 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 Object call(Object who, Method method, Object... args) throws Throwable { return getDeviceInfo().deviceId; } }
@Override public Object call(Object who, Method method, Object... args) throws Throwable { if (isFakeLocationEnable()) { return null; } return super.call(who, method, args); } }
@Override public boolean beforeCall(Object who, Method method, Object... args) { if (android.os.Build.VERSION.SDK_INT >= 17) { if (isFakeLocationEnable()) { for (int i = args.length - 1; i > 0; i--) { if (args[i] instanceof Integer) { int events = (Integer) args[i]; events ^= PhoneStateListener.LISTEN_CELL_INFO; events ^= PhoneStateListener.LISTEN_CELL_LOCATION; args[i] = events; break; } } } } return super.beforeCall(who, method, args); } });
@Override protected void onBindMethods() { super.onBindMethods(); addMethodProxy(new ReplaceCallingPkgMethodProxy("listen")); addMethodProxy(new ReplaceSequencePkgMethodProxy("listenForSubscriber", 1) { @Override public boolean beforeCall(Object who, Method method, Object... args) { if (android.os.Build.VERSION.SDK_INT >= 17) { if (isFakeLocationEnable()) { for (int i = args.length - 1; i > 0; i--) { if (args[i] instanceof Integer) { int events = (Integer) args[i]; events ^= PhoneStateListener.LISTEN_CELL_INFO; events ^= PhoneStateListener.LISTEN_CELL_LOCATION; args[i] = events; break; } } } } return super.beforeCall(who, method, args); } }); } }
@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 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 Object call(Object who, Method method, Object... args) throws Throwable { return getDeviceInfo().deviceId; } }
@Override public Object call(Object who, Method method, Object... args) throws Throwable { if (isFakeLocationEnable()) { return null; } return super.call(who, method, args); } }
@Override public boolean beforeCall(Object who, Method method, Object... args) { if (android.os.Build.VERSION.SDK_INT >= 17) { if (isFakeLocationEnable()) { for (int i = args.length - 1; i > 0; i--) { if (args[i] instanceof Integer) { int events = (Integer) args[i]; events ^= PhoneStateListener.LISTEN_CELL_INFO; events ^= PhoneStateListener.LISTEN_CELL_LOCATION; args[i] = events; break; } } } } return super.beforeCall(who, method, args); } });