protected static boolean isFakeLocationEnable() { return VirtualLocationManager.get().getMode(VUserHandle.myUserId(), VClientImpl.get().getCurrentPackage()) != 0; }
private void notifyLocation(Map listeners) { if (listeners != null) { try { if (!listeners.isEmpty()) { VLocation vLocation = VirtualLocationManager.get().getLocation(); if (vLocation != null) { Location location = vLocation.toSysLocation(); //noinspection unchecked Set<Map.Entry> entries = listeners.entrySet(); for (Map.Entry entry : entries) { Object value = entry.getValue(); if (value != null) { try { LocationManager.ListenerTransport.onLocationChanged.call(value, location); } catch (Throwable e) { e.printStackTrace(); } } } } } } catch (Throwable e) { e.printStackTrace(); } } }
@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()) { 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().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); } }
private void saveLocation(LocationData locationData) { if(locationData.location == null||locationData.location.isEmpty()){ VirtualLocationManager.get().setMode(locationData.userId, locationData.packageName, 0); }else if(locationData.mode != 2){ VirtualLocationManager.get().setMode(locationData.userId, locationData.packageName, 2); } VirtualLocationManager.get().setLocation(locationData.userId, locationData.packageName, locationData.location); }
@Override public Object call(Object who, Method method, Object... args) throws Throwable { if (!(args[0] instanceof String)) { LocationRequest request = (LocationRequest) args[0]; fixLocationRequest(request); } if (isFakeLocationEnable()) { VLocation loc = VirtualLocationManager.get().getLocation(); if (loc != null) { return loc.toSysLocation(); } else { return null; } } return super.call(who, method, args); } }
public void run() { if (!listeners.isEmpty()) { if (VirtualLocationManager.get().getMode() == VirtualLocationManager.MODE_CLOSE) { listeners.clear(); return;
@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); } }
private void saveLocation(LocationData locationData) { if (locationData.location == null || locationData.location.isEmpty()) { VirtualLocationManager.get().setMode(locationData.userId, locationData.packageName, 0); } else if (locationData.mode != 2) { VirtualLocationManager.get().setMode(locationData.userId, locationData.packageName, 2); } VirtualLocationManager.get().setLocation(locationData.userId, locationData.packageName, locationData.location); }
VirtualGPSSatalines satalines = VirtualGPSSatalines.get(); try { VLocation location = VirtualLocationManager.get().getLocation(); if (location != null) { String date = new SimpleDateFormat("HHmmss:SS", Locale.US).format(new Date());
protected static boolean isFakeLocationEnable() { return VirtualLocationManager.get().getMode(VUserHandle.myUserId(), VClientImpl.get().getCurrentPackage()) != 0; }
@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 (!(args[0] instanceof String)) { LocationRequest request = (LocationRequest) args[0]; fixLocationRequest(request); } if (isFakeLocationEnable()) { VLocation loc = VirtualLocationManager.get().getLocation(); if (loc != null) { return loc.toSysLocation(); } else { return null; } } return super.call(who, method, args); } }
protected static boolean isFakeLocationEnable() { return VirtualLocationManager.get().getMode(VUserHandle.myUserId(), VClientImpl.get().getCurrentPackage()) != 0; }
@Override public Object call(Object who, Method method, Object... args) throws Throwable { if (!(args[0] instanceof String)) { LocationRequest request = (LocationRequest) args[0]; fixLocationRequest(request); } if (isFakeLocationEnable()) { VLocation loc = VirtualLocationManager.get().getLocation(); if (loc != null) { return loc.toSysLocation(); } else { return null; } } return super.call(who, method, args); } }