Android:每次打开应用程序时都应该调用 LicenseChecker 吗?
因此,我已经前后阅读了 LVL 文档,并将其与我的应用程序一起使用。我已经看到有关缓存响应的问题。但它仍然让我想知道,根据 LVL 文档中的一些措辞,Google 是否希望我们在每次初始化应用程序时调用许可证检查器?这是实现这一点的最安全的方法吗?像 Google 建议的那样使用 ServerManagedPolicy,我们是否只是调用许可证检查,然后运行我们的应用程序或在失败时执行我们选择的任何操作?我的一个小问题是网络数据的使用。他们让我们在不通知用户的情况下谨慎使用资源,在我看来,这是在不让用户知道的情况下使用网络数据。
除此之外,是否有人因此代码而导致其应用程序出现任何类型的延迟?由于我的应用程序的性质,每次打开它然后等待网络通过肯定会分散其使用的注意力。我应该自己缓存响应,还是我想得太多了?
So I have read the LVL docs backward and forward, and have it working with my app. I have seen the questions about the response being cached. But it still leaves me wondering, based on some of the wording in the LVL docs, does Google want us to call the license checker every time the app is initialized? Is that the safest way to implement this? Using the ServerManagedPolicy like Google suggests, do we just call the license check, and either run our app or do whatever we choose if they fail? One of my small concerns is the use of network data. They drill into us the need to be cautious of using resources without informing the user, and it seems to me this is a use of network data without letting the user know.
To add to this, is anyone experiencing any type of delay to their app due to this code? Due to the nature of my app, opening it and then waiting every time for an ok to come through the network would definitely distract from its use. Should I cache the response myself, or am I way over thinking this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
你回答了你自己的问题;如果您觉得每次启动时调用该服务会造成破坏(例如,用户不在覆盖范围内),那么就不要这样做。
谷歌没有就使用许可服务的频率提出建议;这取决于您作为应用程序开发人员对盗版的偏执程度,以及您认为不断检查会惹恼用户的程度。
You answered your own question; if you feel that calling the service every time you start would be disruptive (which it would, e.g. the user is out of coverage), then don't do it.
Google make no recommendations about how often to use the licensing service; it's down to how paranoid you as the application developer are about piracy, balanced with how much you feel constantly checking would annoy the user.
好吧,公平地说,只是偶尔检查一次......但是你可以在哪里“安全”地存储信息,你应该每天只检查一次呢?
例如,第一次启动应用程序时,您会检查它。 LVL 的结果是有效的:因此您存储上次成功检查的日期。但存放在哪里呢?使用共享首选项?这安全吗?因为如果您在设备上具有 root 访问权限,您可以访问首选项并更改有效日期(将来无论哪种方式,是的,当然您可以在代码中检查:-))
PS。抱歉,无法发表评论:(
Ok, fair, only check it once in a while.. But where can you "safely" store the information, that you should check it once a day only?
Eg, the first time you start the app, you will check it. Result of LVL is valid: so you store the date of the last successful check. But where to store it? Using SharedPreferences ? Is this safe? Because if you have root access on your device you could access the preference and change the valid date (to either way in the future, an yes, ofcourse you can check that in the code :-))
PS. Sorry, could not make a comment :(
每次启动应用程序时调用它。由 Google 提供的 LVL 库将缓存响应并在用户下次启动应用程序时使用它,因此如果用户在缓存有效时间范围内重新启动应用程序,则不需要网络连接。
您可能想要做的是更改缓存的有效时间。默认情况下,谷歌附带的缓存有效时间相当短,这导致缓存过期时一些处于网络之外的用户感到不安。
Call it every time you start the app. The LVL library, as shipped by Google, will cache the response and use it the next time the user starts the app, thus not requiring a network connection if they restart the application within the cache valid time-frame.
What you likely want to do is change the amount of time the cache is valid. By default, google ships with a fairly low cache-valid time, which resulted in some upset users who were outside of a network when the cache had expired.
关于 LVL:虽然 SDK 提供了示例实现,但 Google 本身明确建议不要“按原样”使用它。
http://www.google.com/events/io/2011/sessions/evading-pirates-and-stopping-vampires-using-license-verification-library-in-app -billing-and-app-engine.html
看完之后,我相信 LVL 不是售价 1-2 美元的应用程序的选择。此外,失败的 LVL 检查(如果没有可用网络)会激怒合法用户。
虽然您确实可以实现某种缓存 LVL 响应,但它始终会归结为一个问题:您希望在多大程度上以牺牲合法用户的利益为代价来防止盗版?
并且:开发人员的时间是有限的,因此也许更值得花精力改进应用程序,而不是浪费大量时间试图减少非法使用。
Concerning LVL: Although the SDK provides a sample implementation, Google themselves, clearly recommend against using it "as-is".
http://www.google.com/events/io/2011/sessions/evading-pirates-and-stopping-vampires-using-license-verification-library-in-app-billing-and-app-engine.html
After watching that, I believe, LVL is not an option for apps sold for 1-2$. Furthermore, a failed LVL check (if no network is available) will piss off legitimate users.
while it is true, that you can implement some kind of caching LVL responses, it will always boild down to the question, in how far you want to protect against piracy at the expense of legitimate users?
And: developer time is limited, so maybe it is more worthwhile to put efforts in improving an app, instead off wasting to much time trying to cut down illegal usage.