@FakeLocMark("fake scan result") private final class GetScanResults extends ReplaceCallingPkgMethodProxy { public GetScanResults() { super("getScanResults"); } @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); } }
@FakeLocMark("cell location") static class GetCellLocation extends ReplaceCallingPkgMethodProxy { public GetCellLocation() { super("getCellLocation"); } @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); } }
@FakeLocMark("cell location") static class GetAllCellInfo extends ReplaceCallingPkgMethodProxy { public GetAllCellInfo() { super("getAllCellInfo"); } @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); } }
@FakeLocMark("neb cell location") static class GetNeighboringCellInfo extends ReplaceCallingPkgMethodProxy { public GetNeighboringCellInfo() { super("getNeighboringCellInfo"); } @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); } }
@FakeLocMark("Fake wifi bssid") @FakeDeviceMark("fake wifi MAC") private final class GetConnectionInfo extends MethodProxy { @Override public String getMethodName() { return "getConnectionInfo"; } @Override public Object call(Object who, Method method, Object... args) throws Throwable { WifiInfo wifiInfo = (WifiInfo) method.invoke(who, args); if (isFakeLocationEnable()) { mirror.android.net.wifi.WifiInfo.mBSSID.set(wifiInfo, "00:00:00:00:00:00"); mirror.android.net.wifi.WifiInfo.mMacAddress.set(wifiInfo, "00:00:00:00:00:00"); } if (VASettings.Wifi.FAKE_WIFI_STATE) { return createWifiInfo(); } if (wifiInfo != null) { mirror.android.net.wifi.WifiInfo.mMacAddress.set(wifiInfo, getDeviceInfo().wifiMac); } return wifiInfo; } }
@FakeLocMark("fake scan result") private final class GetScanResults extends ReplaceCallingPkgMethodProxy { public GetScanResults() { super("getScanResults"); } @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); } }
@FakeLocMark("fake scan result") private final class GetScanResults extends ReplaceCallingPkgMethodProxy { public GetScanResults() { super("getScanResults"); } @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); } }
@FakeLocMark("cell location") static class GetCellLocation extends ReplaceCallingPkgMethodProxy { public GetCellLocation() { super("getCellLocation"); } @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); } }
@FakeLocMark("cell location") static class GetCellLocation extends ReplaceCallingPkgMethodProxy { public GetCellLocation() { super("getCellLocation"); } @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); } }
@FakeLocMark("cell location") static class GetAllCellInfo extends ReplaceCallingPkgMethodProxy { public GetAllCellInfo() { super("getAllCellInfo"); } @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); } }
@FakeLocMark("cell location") static class GetAllCellInfo extends ReplaceCallingPkgMethodProxy { public GetAllCellInfo() { super("getAllCellInfo"); } @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); } }
@FakeLocMark("neb cell location") static class GetNeighboringCellInfo extends ReplaceCallingPkgMethodProxy { public GetNeighboringCellInfo() { super("getNeighboringCellInfo"); } @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); } }
@FakeLocMark("neb cell location") static class GetNeighboringCellInfo extends ReplaceCallingPkgMethodProxy { public GetNeighboringCellInfo() { super("getNeighboringCellInfo"); } @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); } }
@FakeLocMark("Fake wifi bssid") @FakeDeviceMark("fake wifi MAC") private final class GetConnectionInfo extends MethodProxy { @Override public String getMethodName() { return "getConnectionInfo"; } @Override public Object call(Object who, Method method, Object... args) throws Throwable { WifiInfo wifiInfo = (WifiInfo) method.invoke(who, args); if (isFakeLocationEnable()) { mirror.android.net.wifi.WifiInfo.mBSSID.set(wifiInfo, "00:00:00:00:00:00"); mirror.android.net.wifi.WifiInfo.mMacAddress.set(wifiInfo, "00:00:00:00:00:00"); } if (VASettings.Wifi.FAKE_WIFI_STATE) { return createWifiInfo(); } if (wifiInfo != null) { mirror.android.net.wifi.WifiInfo.mMacAddress.set(wifiInfo, getDeviceInfo().wifiMac); } return wifiInfo; } }
@FakeLocMark("Fake wifi bssid") @FakeDeviceMark("fake wifi MAC") private final class GetConnectionInfo extends MethodProxy { @Override public String getMethodName() { return "getConnectionInfo"; } @Override public Object call(Object who, Method method, Object... args) throws Throwable { WifiInfo wifiInfo = (WifiInfo) method.invoke(who, args); if (isFakeLocationEnable()) { mirror.android.net.wifi.WifiInfo.mBSSID.set(wifiInfo, "00:00:00:00:00:00"); mirror.android.net.wifi.WifiInfo.mMacAddress.set(wifiInfo, "00:00:00:00:00:00"); } if (VASettings.Wifi.FAKE_WIFI_STATE) { return createWifiInfo(); } if (wifiInfo != null) { mirror.android.net.wifi.WifiInfo.mMacAddress.set(wifiInfo, getDeviceInfo().wifiMac); } return wifiInfo; } }