Codota Logo
MockLocationHelper
Code IndexAdd Codota to your IDE (free)

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

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
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

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

private static String leftZeroPad(int num, int size) {
  return leftZeroPad(String.valueOf(num), size);
}
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

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

  @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: darkskygit/VirtualApp

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: bzsome/VirtualApp-x326

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: darkskygit/VirtualApp

  @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: darkskygit/VirtualApp

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

  @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

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);
}
origin: bzsome/VirtualApp-x326

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: darkskygit/VirtualApp

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: bzsome/VirtualApp-x326

  @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: bzsome/VirtualApp-x326

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

  @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: bzsome/VirtualApp-x326

private static String leftZeroPad(int num, int size) {
  return leftZeroPad(String.valueOf(num), size);
}
origin: darkskygit/VirtualApp

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: darkskygit/VirtualApp

private static String leftZeroPad(int num, int size) {
  return leftZeroPad(String.valueOf(num), size);
}
com.lody.virtual.client.hook.proxies.locationMockLocationHelper

Most used methods

  • checksum
  • getGPSLat
  • getNorthWest
  • getSouthEast
  • invokeNmeaReceived
  • invokeSvStatusChanged
  • leftZeroPad
  • setGpsStatus

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSupportFragmentManager (FragmentActivity)
  • findViewById (Activity)
  • requestLocationUpdates (LocationManager)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
  • LogFactory (org.apache.commons.logging)
    A minimal incarnation of Apache Commons Logging's LogFactory API, providing just the common Log look
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
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