2013-06-26 4 views
8

Ich versuche, die Standortaktualisierung in Find My Friends mit Theos zu spoofen.iOS private API, um den Standort im Hintergrund zu verfolgen, nachdem die App getötet wurde (wie Find My Friends)

Was ich habe, so weit:

Wenn die App in Vordergrund, konnte ich die Update-Nachricht fälschen (Theos/Logos mit FMFLocation Klasse Haken).

Was fehlt:

Wenn die App ist in Hintergrund oder getötet, sendet sie immer noch meine Position an den Server, wenn mein Freund meine Lage anfordert. Dieses Hintergrundupdate ruft die reguläre Update-Methode NICHT auf, daher funktioniert mein Hook nicht. Außerdem kann es auf eine Standortanfrage vom Netzwerk antworten, selbst wenn die App beendet wird. Ich glaube nicht, dass Apple dieses Verhalten in normalen Apps erlaubt.

Ich denke, das kann nur mit einigen privaten API getan werden. Könnte mir jemand in die richtige Richtung zeigen, um herauszufinden, welche API/Methode es im Hintergrund verwendet?

Antwort

1

Ich fand es heraus! Es ist die aosnotifyd, die den Standort im Hintergrund sendet.

landete ich tun dies:

#import <CoreLocation/CoreLocation.h> 

%hook AOSFindBaseServiceProvider 
-(void)sendCurrentLocation:(id)fp8 isFinished:(BOOL)fp12 forCmd:(id)fp16 withReason:(int)fp20 andAccuracyChange:(double)fp24{ 
    //Mess with (CLLocation *)fp8 here 
    %orig(c,fp12,fp16,fp20,fp24); 
} 
%end 
+0

Haben Sie ein Beispielprojekt für dasselbe? – Maulik

+0

@Maulik Ich habe einen Blog-Post über und Github Repo: http://weishi.github.io/blog/2013/07/19/fixing-find-my-friends-location-shift-in-china/ –

1

Möglicherweise möchten Sie die -startMonitoringSignificantLocationChanges Methode in CLLocationMananger (docs) überprüfen.

Als Land docs:

This method initiates the delivery of location events asynchronously, returning shortly after you call it. Location events are delivered to your delegate’s locationManager:didUpdateLocations: method. The first event to be delivered is usually the most recently cached location event (if any) but may be a newer event in some circumstances. Obtaining a current location fix may take several additional seconds, so be sure to check the timestamps on the location events in your delegate method.

After returning a current location fix, the receiver generates update events only when a significant change in the user’s location is detected. For example, it might generate a new event when the device becomes associated with a different cell tower. It does not rely on the value in the distanceFilter property to generate events. Calling this method several times in succession does not automatically result in new events being generated. Calling stopMonitoringSignificantLocationChanges in between, however, does cause a new initial event to be sent the next time you call this method.

If you start this service and your application is subsequently terminated, the system automatically relaunches the application into the background if a new event arrives. In such a case, the options dictionary passed to the locationManager:didUpdateLocations: method of your application delegate contains the key UIApplicationLaunchOptionsLocationKey to indicate that your application was launched because of a location event. Upon relaunch, you must still configure a location manager object and call this method to continue receiving location events. When you restart location services, the current event is delivered to your delegate immediately. In addition, the location property of your location manager object is populated with the most recent location object even before you start location services.

In addition to your delegate object implementing the locationManager:didUpdateLocations: method, it should also implement the locationManager:didFailWithError: method to respond to potential errors.

Also im Grunde müssen Sie:

  • Stellen Sie die location Schlüssel als Hintergrund-Modus in Ihrer Info.plist Datei
  • einen Start CLLocationMananger
  • Anrufs startMonitoringSignificantLocationChanges
  • Auf Ihrer AppDelegate erhalten Sie eine Position im Info-Wörterbuch, die mit UIApplicationLaunchOptionsLocationKey verschlüsselt wird, wenn sich die Benutzer etwa 500 Meter bewegen.
  • Bei dieser Methode können Sie den Speicherort auf dem Server aktualisieren.
+1

'Eigentlich Meine Freunde' Finden Lage auf eine Anfrage von Netzwerk senden können, auch wenn die App getötet wird und keine Bewegung erkannt wird, die eindeutig nicht von 'startMonitoringSignificantLocationChanges ausgelöst wird '. –

Verwandte Themen