This article is for those with Macs and iphones.



This chapter is hydrology, the use of Xcode simulation positioning card has a very early tutorial, here is only a line of dry goods, leaving Xcode is still guaranteed to simulate positioning unchanged.

Object: LBS applications such as Nails

In the past two years, many enterprises and small and medium-sized companies have started to use Tacks to check in. Many helpless pain party because take a bus a few minutes late, was deducted money, a few minutes late, the full attendance was lost, so here we can alleviate the pain of the code dog — simulation positioning (first punch, and then to the company). Those who already know how to locate the Xcode simulation can skip to the end and ignore the previous sections.

The company sets the clocking range of 100 meters, 500 meters and 1 kilometer, but based on the technology of simulated positioning, Dingding adds a WiFi clocking option. Positioning clocking and WiFi opening can be superimposed to ensure that someone cheats by clocking (how to crack WiFi will be explained later).

Driving a car

  • One Mac (Xcode installed)
  • An iPhone (jailbreak doesn’t matter)
  • A data cable.

The coordinate system



The original coordinates
Mars coordinates
Secondary encrypted coordinates

  • Original coordinates: The original GPS coordinates wGS-84 were obtained on the phone.
  • Mars coordinates: I add a set of encryption coordinates, China national Survey Bureau (and the same stupid organization GFW) — GCJ-02: Google, Autonavi.
  • Baidu encrypted coordinates: on the basis of Mars coordinates again elegant encrypted coordinates — BD-09: Baidu.

In the far east, there is a Chinese dynasty.


There was a Chinese mapping bureau, and they invented an algorithm to offset the earth coordinates of the American satellite GPS, and when they calculated that, they came up with a Mars coordinate.


In order for Mars coordinates to display correctly, we added this algorithm to each navigation software, which can restore the location on your map. And charge for each navigation. Call it national security. And this algorithm looks pretty cool. It’s not reversible.


So, this is the only country where people are using the wrong coordinates. Authentic cover one’s ears and steal a bell.


Civilian satellite accuracy already gives you a cold sweat, let alone military satellite. They don’t use Chinese maps for war valuation.


Unfortunately, LBS apps are a hassle.

Elegant algorithms

Choose a technician

Coordinates access:

First, choose the location you want to simulate according to your preferences. Here is amAP as an example:









1Copy the code
104.06521, 30.589833Copy the code

On the clock

WGS-84
GCJ-02
Ethereal reduction algorithm
ACC AvIC City Square, Chengdu city, Sichuan Province


1Copy the code
104.06263069384391, 30.593234492328744Copy the code

service

gpx


<? The XML version = "1.0" encoding = "utf-8"? > < GPX version = "1.1" creator = "GMapToGPX 6.4 j - http://www.elsewhere.org/GMapToGPX/" xmlns="http://www.topografix.com/GPX/1/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"> <wpt Lat = "30.593234492328744" lon = "104.06263069384391" > < / WPT > < / GPX >Copy the code

According to different positions, the original coordinates obtained by transformation can be corresponding to LAT and LON.

Remember to turn your phone on first.

The real machine will run a new empty iOS project, drag the above GPX file into the project, configure Scheme, and then the real machine will run.








This time do not click Stop, directly Home button background, and then open the application with positioning to see your current position, 484 super happy. Restore the location method, directly Stop can be.

The clock

Big health care is done, maybe some clubs will give you a little gift, you want to make the technician happy and give you a little surprise at the end.

Spicy, here comes the surprise:

  • Crack the nail WiFi card: change the name of the WiFi at home to the company’s WiFi card. According to my test, our company only configured and verified SSID, but did not verify DHCP address.
  • Clock-in anytime and anywhere: follow the above steps to complete the simulation location, do not Stop, directly unplug the data line (guess Xcode developer mode started a process to simulate location, if Xcode does not Stop, then the process will not Kill).
  • The downside: If your company has ENABLED DHCP, you’ll have to rely on social workers to get the address, and you’ll have to clock in at home.
  • Disadvantages: the recovery method can only restart the mobile phone to restore the location, after testing, wechat map can not be used, a blank, so here is wide to use the unused old test machine to focus on punching, I can only help you here.

At noon, I tested the red envelope bike of Mobike. If my mobile phone positioning did not change, no matter how far I rode, the cycling distance was 0 meters, and there was only one red envelope (the same is true for all four red envelope bikes at noon). See here I should not tell you how to masturbate red envelopes, the cost of masturbating red envelopes is relatively high, you must carry the computer at any time, if the company is not open WiFi, you happen to carry the computer, then you can really punch in anytime and anywhere.

Demo:github.com/rockerhx/Si…