
Announcements
Hello,
i am currently developing an app to detect current location, actually if i click a button a label will show my current location name and then there is a button will not visible if the location is not in my location. However, it can be tricked by using fake gps, my question is, how to detect if user using fake gps or how to overcome this issue
Thank you
Hi @AdhamFH :
Are your users using this app on mobile devices?
This is probably an almost unsolvable problem. Especially if the user has obtained root access to the mobile device, then he can cheat almost as much as he wants.
My idea is that if the user's GPS positioning is real, then it must be able to change multiple times in a short period of time (I tested that only a small range of movement is required, and the positioning value will change). If the GPS positioning is a fake value, it is difficult for the user to adjust the GPS position multiple times in a short period of time (for example, change twice within 10s)
So my method is to verify the GPS position 3 times in 9s, If the 3 times of latitude and longitude recorded by the app in 9 seconds are the same, then the button is not displayed.
1\Add a timer control
AutoStart
true
Duration
3000 /*loop in 3S*/
OnTimerEnd
Collect(
thecollection,
{Value: Location.Latitude & Location.Longitude}
); /*thecollection is my custom collection*/
If(
CountRows(thecollection) = 3 && !(Last(
FirstN(
thecollection,
1
)
).Value = Last(
FirstN(
thecollection,
2
)
).Value && Last(
FirstN(
thecollection,
2
)
).Value = Last(
FirstN(
thecollection,
3
)
).Value && Last(
FirstN(
thecollection,
1
)
).Value = Last(
FirstN(
thecollection,
3
)
).Value),
Set(
Visible,
true
) /*Visible is my custom variable*/
);
If(
CountRows(thecollection) = 3,
Clear(thecollection)
)
Repeat
If(Visible,false,true)
Visible
false /*make it unvisible*/
2/set the button's Visible property to:
Visible
If the app records the same latitude and longitude 3 times in 9 seconds, the button will not displayed.
The most important thing is that you can’t tell the user the logic of your backend, otherwise smart users may still find ways to cheat.
Best Regards,
Bof