Codota Logo
com.lody.virtual.client.hook.proxies.location
Code IndexAdd Codota to your IDE (free)

How to use com.lody.virtual.client.hook.proxies.location

Best Java code snippets using com.lody.virtual.client.hook.proxies.location (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: android-hacker/VirtualXposed

private static String leftZeroPad(int num, int size) {
  return leftZeroPad(String.valueOf(num), size);
}
origin: android-hacker/VirtualXposed

super.onBindMethods();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
  addMethodProxy(new ReplaceLastPkgMethodProxy("addTestProvider"));
  addMethodProxy(new ReplaceLastPkgMethodProxy("removeTestProvider"));
  addMethodProxy(new ReplaceLastPkgMethodProxy("setTestProviderLocation"));
  addMethodProxy(new ReplaceLastPkgMethodProxy("clearTestProviderLocation"));
  addMethodProxy(new ReplaceLastPkgMethodProxy("setTestProviderEnabled"));
  addMethodProxy(new ReplaceLastPkgMethodProxy("clearTestProviderEnabled"));
  addMethodProxy(new ReplaceLastPkgMethodProxy("setTestProviderStatus"));
  addMethodProxy(new ReplaceLastPkgMethodProxy("clearTestProviderStatus"));
  addMethodProxy(new FakeReplaceLastPkgMethodProxy("addGpsMeasurementsListener", true));
  addMethodProxy(new FakeReplaceLastPkgMethodProxy("addGpsNavigationMessageListener", true));
  addMethodProxy(new FakeReplaceLastPkgMethodProxy("removeGpsMeasurementListener", 0));
  addMethodProxy(new FakeReplaceLastPkgMethodProxy("removeGpsNavigationMessageListener", 0));
  addMethodProxy(new FakeReplaceLastPkgMethodProxy("requestGeofence", 0));
  addMethodProxy(new FakeReplaceLastPkgMethodProxy("removeGeofence", 0));
  addMethodProxy(new FakeReplaceLastPkgMethodProxy("addProximityAlert", 0));
  addMethodProxy(new FakeReplaceLastPkgMethodProxy("addNmeaListener", 0));
  addMethodProxy(new FakeReplaceLastPkgMethodProxy("removeNmeaListener", 0));
origin: android-hacker/VirtualXposed

  @Override
  public Object call(final Object who, Method method, Object... args) throws Throwable {
    if (Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN) {
      LocationRequest request = (LocationRequest) args[0];
      fixLocationRequest(request);
    }
    if (isFakeLocationEnable()) {
      Object transport = ArrayUtils.getFirst(args, mirror.android.location.LocationManager.ListenerTransport.TYPE);
      if (transport != null) {
        Object locationManager = mirror.android.location.LocationManager.ListenerTransport.this$0.get(transport);
        MockLocationHelper.setGpsStatus(locationManager);
        GPSListenerThread.get().addListenerTransport(locationManager);
      }
      return 0;
    }
    return super.call(who, method, args);
  }
}
origin: android-hacker/VirtualXposed

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    if (isFakeLocationEnable()) {
      Object transport = ArrayUtils.getFirst(args, mirror.android.location.LocationManager.GpsStatusListenerTransport.TYPE);
      Object locationManager = mirror.android.location.LocationManager.GpsStatusListenerTransport.this$0.get(transport);
      mirror.android.location.LocationManager.GpsStatusListenerTransport.onGpsStarted.call(transport);
      mirror.android.location.LocationManager.GpsStatusListenerTransport.onFirstFix.call(transport, 0);
      if (mirror.android.location.LocationManager.GpsStatusListenerTransport.mListener.get(transport) != null) {
        MockLocationHelper.invokeSvStatusChanged(transport);
      } else {
        MockLocationHelper.invokeNmeaReceived(transport);
      }
      GPSListenerThread.get().addListenerTransport(locationManager);
      return true;
    }
    return super.call(who, method, args);
  }
}
origin: android-hacker/VirtualXposed

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    if (!isFakeLocationEnable()) {
      return super.call(who, method, args);
    }
    Object transport = ArrayUtils.getFirst(args, mirror.android.location.LocationManager.GnssStatusListenerTransport.TYPE);
    if (transport != null) {
      mirror.android.location.LocationManager.GnssStatusListenerTransport.onGnssStarted.call(transport, new Object[0]);
      if (mirror.android.location.LocationManager.GnssStatusListenerTransport.mGpsListener.get(transport) != null) {
        MockLocationHelper.invokeSvStatusChanged(transport);
      } else {
        MockLocationHelper.invokeNmeaReceived(transport);
      }
      mirror.android.location.LocationManager.GnssStatusListenerTransport.onFirstFix.call(transport, Integer.valueOf(0));
      Object locationManager = mirror.android.location.LocationManager.GnssStatusListenerTransport.this$0.get(transport);
      GPSListenerThread.get().addListenerTransport(locationManager);
    }
    return true;
  }
}
origin: android-hacker/VirtualXposed

if (location != null) {
  String date = new SimpleDateFormat("HHmmss:SS", Locale.US).format(new Date());
  String lat = getGPSLat(location.latitude);
  String lon = getGPSLat(location.longitude);
  String latNW = getNorthWest(location);
  String lonSE = getSouthEast(location);
  String $GPGGA = checksum(String.format("$GPGGA,%s,%s,%s,%s,%s,1,%s,692,.00,M,.00,M,,,", date, lat, latNW, lon, lonSE, satalines.getSvCount()));
  String $GPRMC = checksum(String.format("$GPRMC,%s,A,%s,%s,%s,%s,0,0,260717,,,A,", date, lat, latNW, lon, lonSE));
  if (LocationManager.GnssStatusListenerTransport.onNmeaReceived != null) {
    LocationManager.GnssStatusListenerTransport.onNmeaReceived.call(listener, System.currentTimeMillis(), "$GPGSV,1,1,04,12,05,159,36,15,41,087,15,19,38,262,30,31,56,146,19,*73");
origin: android-hacker/VirtualXposed

if (VERSION.SDK_INT >= 24) {
  Map nmeaListeners = LocationManager.mGnssNmeaListeners.get(transport);
  notifyGPSStatus(LocationManager.mGnssStatusListeners.get(transport));
  notifyMNmeaListener(nmeaListeners);
  gpsStatusListeners = LocationManager.mGpsStatusListeners.get(transport);
  notifyGPSStatus(gpsStatusListeners);
  notifyMNmeaListener(LocationManager.mGpsNmeaListeners.get(transport));
} else {
  gpsStatusListeners = LocationManager.mGpsStatusListeners.get(transport);
  notifyGPSStatus(gpsStatusListeners);
  notifyMNmeaListener(LocationManager.mNmeaListeners.get(transport));
    notifyLocation(listeners);
origin: android-hacker/VirtualXposed

public void run() {
  if (!listeners.isEmpty()) {
    for (Entry entry : listeners.entrySet()) {
      try {
        Object transport = entry.getKey();
        MockLocationHelper.invokeSvStatusChanged(transport);
        MockLocationHelper.invokeNmeaReceived(transport);
      } catch (Throwable e) {
        e.printStackTrace();
      }
    }
  }
}
origin: android-hacker/VirtualXposed

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    if (isFakeLocationEnable()) {
      return mDefValue;
    }
    return super.call(who, method, args);
  }
}
origin: android-hacker/VirtualXposed

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    if (isFakeLocationEnable()) {
      return true;
    }
    return super.call(who, method, args);
  }
}
origin: android-hacker/VirtualXposed

@Override
public Object call(Object who, Method method, Object... args) throws Throwable {
  if (isFakeLocationEnable()) {
    return true;
  }
  return super.call(who, method, args);
}
origin: android-hacker/VirtualXposed

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    if (isFakeLocationEnable()) {
      return LocationManager.GPS_PROVIDER;
    }
    return super.call(who, method, args);
  }
}
origin: android-hacker/VirtualXposed

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    if (isFakeLocationEnable()) {
      // TODO
      return 0;
    }
    return super.call(who, method, args);
  }
}
origin: android-hacker/VirtualXposed

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    if (isFakeLocationEnable()) {
      return 0;
    }
    return super.call(who, method, args);
  }
}
origin: android-hacker/VirtualXposed

private void notifyMNmeaListener(Map listeners) {
  if (listeners != null && !listeners.isEmpty()) {
    //noinspection unchecked
    Set<Map.Entry> entries = listeners.entrySet();
    for (Map.Entry entry : entries) {
      try {
        Object value = entry.getValue();
        if (value != null) {
          MockLocationHelper.invokeNmeaReceived(value);
        }
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
  }
}
origin: android-hacker/VirtualXposed

private void notifyGPSStatus(Map listeners) {
  if (listeners != null && !listeners.isEmpty()) {
    //noinspection unchecked
    Set<Map.Entry> entries = listeners.entrySet();
    for (Map.Entry entry : entries) {
      try {
        Object value = entry.getValue();
        if (value != null) {
          MockLocationHelper.invokeSvStatusChanged(value);
        }
      } catch (Throwable e) {
        e.printStackTrace();
      }
    }
  }
}
origin: android-hacker/VirtualXposed

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    if (isFakeLocationEnable()) {
      String provider = (String) args[0];
      if (LocationManager.PASSIVE_PROVIDER.equals(provider)) {
        return true;
      }
      if (LocationManager.GPS_PROVIDER.equals(provider)) {
        return true;
      }
      if (LocationManager.NETWORK_PROVIDER.equals(provider)) {
        return true;
      }
      return false;
    }
    return super.call(who, method, args);
  }
}
origin: android-hacker/VirtualXposed

  @Override
  public Object afterCall(Object who, Method method, Object[] args, Object result) throws Throwable {
    if (isFakeLocationEnable()) {
      return super.afterCall(who, method, args, result);
    }
    try {
      Reflect.on(result).set("mRequiresNetwork", false);
      Reflect.on(result).set("mRequiresCell", false);
    } catch (Throwable e) {
      e.printStackTrace();
    }
    return result;
  }
}
origin: android-hacker/VirtualXposed

  @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);
  }
}
origin: android-hacker/VirtualXposed

public static String getGPSLat(double v) {
  int du = (int) v;
  double fen = (v - (double) du) * 60.0d;
  return du + leftZeroPad((int) fen, 2) + ":" + String.valueOf(fen).substring(2);
}
com.lody.virtual.client.hook.proxies.location

Most used classes

  • GPSListenerThread
  • LocationManagerStub$FakeReplaceLastPkgMethodProxy
  • LocationManagerStub
  • MethodProxies$AddGpsStatusListener
  • MethodProxies$GetBestProvider
  • MethodProxies$IsProviderEnabled,
  • MethodProxies$RegisterGnssStatusCallback,
  • MethodProxies$RemoveGpsStatusListener,
  • MethodProxies$RemoveUpdates,
  • MethodProxies$RequestLocationUpdates,
  • MethodProxies$getProviderProperties,
  • MethodProxies$locationCallbackFinished,
  • MethodProxies$sendExtraCommand,
  • MockLocationHelper
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now