检测或阻止用户是否使用虚假位置 [英] Detect or prevent if user uses fake location

查看:13
本文介绍了检测或阻止用户是否使用虚假位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果用户伪造位置,我将阻止他们使用我的应用.所以我使用 isFromMockProvider 来检查该位置是否是假的(关注 here).但在某些情况下,isFromMockProvider() 可能会为伪造的位置返回 false.

I will block a user from using my app if they fake the location. So I use isFromMockProvider to check if the location is fake (follow here). But isFromMockProvider() may return false for faked locations in some cases.

public void onLocationChanged(Location location) {
    textView.append("long:"+location.getLatitude()+" - lat:"+location.getLongitude()+" - isMock :"+location.isFromMockProvider() + "
");
}

我的情况是:我使用应用 假 GPS 位置 假到某个位置,然后我禁用假位置并转到我的应用程序.然后 onLocationChanged 返回虚假位置 isFromMockProvider() = false

My case is: I use app Fake GPS location for fake to a location then I disable fake location and go to my app. Then the onLocationChanged returns the fake location with isFromMockProvider() = false

录像机:https://www.youtube.com/watch?v=rWVvjOCaZiI (在这个视频中,我的当前位置是16.06, 108.21,假的位置是36.26,138.28.你可以在上一个视频中看到位置是36.26,138.28 但是isFromMockProvider=false)

Video recorder: https://www.youtube.com/watch?v=rWVvjOCaZiI (in this video, my current location is 16.06, 108.21, the fake location is 36.26,138.28. You can see in last video the location is 36.26,138.28 but isFromMockProvider=false)

在这种情况下,有什么方法可以检测用户是否使用了虚假位置?任何帮助或建议将不胜感激.
演示项目

Is there any way to detect if a user uses a fake location in this case? Any help or suggestion would be great appreciated.
DEMO project

推荐答案

冒着现实答案的风险

我想提供一个答案,帮助开发人员了解产品设计的公共关系方面,冒着被批评的风险.坦率地说,一个人无法在计算机科学的真空中编写出色的应用程序.满足用户需求并将其与安全性平衡是当今软件界面和行为设计的主要问题之一,尤其是在移动领域.

I'd like to provide an answer that helps the developer understand the public relations aspect of product design, taking the risk of criticism. Frankly, one cannot write great apps in a computer science vacuum. Satisfying user needs and balancing them with security is one of the primary issues in software interface and behavioral design today, especially in the mobile space.

从这个角度来看,您的问题是在这种情况下,有没有办法检测用户是否使用了虚假位置?"可能不是您面临的最相关的问题.我问这个可能对您有更多帮助的问题并没有回避,我可以很好地回答:有什么方法可以安全地从用户设备的地理坐标固件中获取数据,这样就不会被欺骗?"

From this perspective, your question, "Is there any way to detect if a user uses a fake location in this case?" may not be the most pertinent question you face. I'm not being evasive by asking this other question that may help you more and it is something I can answer well: "Is there any way to securely get the data from the user's device's geocoordinate firmware such that it cannot be spoofed?"

这个问题的答案是不".

The answer to this one is, "No."

Android HTTP 客户端合约

保证用户设备位置信息不是 Android 客户端-服务器合同或其竞争对手的合同的一部分.

It is not part of the Android client-server contract or that of its competitors to guarantee user device location information.

实际原因

实际上有一种市场力量可能会无限期地反对这种保证.许多设备所有者(和您的用户)出于隐私以及家庭和家庭安全的原因,希望控制人们是否知道他们的真实位置.

There is actually a market force that will probably push against such a guarantee indefinitely. Many device owners (and your users) want control over whether people know their true location for privacy and home and family security reasons.

解决方案

作为软件设计师,您可以问自己的下一个问题是:应用程序或库如何工作并满足我寻求满足使用今天(或明天)位置的一定比例的用户社区的需求欺骗软件?"

The next question you can ask yourself as a designer of your software is, "How can the app or library work and provide for the needs I seek to fill with a certain percentage of the user community using today's (or tomorrow's) location spoofing software?"

如果您正在编写商业智能软件或您的系统还有其他一些统计方面,那么您需要软件相当于误差线.如果您显示统计数据,那么误差线将是一个合适的图形功能.估计用户群中位置欺骗者的百分比需要进一步研究.

If you are writing business intelligence software or there is some other statistical aspect to your system, then you need the software equivalent of error bars. If you display the stats, then the error bars would be an appropriate graphing feature. Estimating the percentage of location spoofers out of a population of users would require further study.

这篇关于检测或阻止用户是否使用虚假位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆