Google 许可服务 - 了解概念
我不明白Google的许可服务
场景的概念: 用户 A 在设备 X 上购买应用程序。 然后,用户 A 通过他的另一台设备 Y 访问 Android 市场来安装该应用程序,并且由于他在两台设备上使用相同的帐户,因此他不必第二次付费。
该应用程序发出许可证检查请求,其中包括设备特定数据或安装过程中生成并存储在设备上的随机数据。
据我了解,设备 X 和 Y 上的额外数据会有所不同,因此同一用户和应用程序的许可证检查请求有所不同,但仍被认为是有效的。
那么,在从 Android 市场下载期间,额外的请求数据也会存储在每个用户/应用程序/设备的许可服务器上吗?
用户 A 无法将应用程序从设备 X 复制到设备 Y,许可证检查会失败,因为从 Android 市场安装应用程序时,该设备或安装特定数据仅存储在服务器上?
I don't understand the concept of Google's Licensing Service
Scenario:
user A purchases an app on device X.
User A then accesses the Android market via his other device Y to install the app and he doesn't have to pay a second time since he uses the same account on both devices.
The app makes a license check request which includes either device specific data or random data generated during the installation and stored on the device.
As far as I understand that extra data would be different on device X and Y therefore the license check request is different for the same user and app but still recognized as valid.
So that extra request data is also stored on the licensing server per user/ app/ device during the download from the Android market?
User A cannot copy the app from device X to device Y, the license check would fail since that device or installation specific data is only stored on the server when installing the app from the Android market?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
某些信息保存在本地。例如:
ServerManagedPolicy
将上次响应、有效性时间戳、重试截止时间、最大重试次数和重试次数保存为本地设备数据。特别是由于“最后响应”存储在本地,因此鼓励您混淆本地数据(否则恶意用户可能会输入自己的本地数据,表明许可证有效),并且
AESObfuscator
类提供为:当您构造
ASObfuscator
时,您需要提供byte[] salt、String applicationId、String deviceId
。PBEKeySpec
的密码基于applicationId
和deviceId
(您可以在提供的源代码中看到)。com.example.android.market.licensing.MainActivity
中的注释表明您可以提供的不仅仅是Secure.ANDROID_ID
作为deviceId
。您需要确保其安全程度取决于您的判断 - 它可以像在应用程序中硬编码一个值一样简单(new String(byte[]{(byte) 75, (byte) 12}) + Secure。 ANDROID_ID)
或其他一些加密方案(其讨论可能更适合加密论坛)。Certain information is saved locally. For example:
ServerManagedPolicy
saves the last response, validity timestamp, retry until, max retries and retry count as local-device data.Especially because of the Last Response being stored locally, you are encouraged to obfuscate the local data (otherwise a malaicious user could enter their own local data, indicating the license as valid) and the
AESObfuscator
class is provided as:When you construct the
AESObfuscator
, you provide abyte[] salt, String applicationId, String deviceId
. ThePBEKeySpec
's password is based upon theapplicationId
anddeviceId
(you can see in the source code provided).The comment in
com.example.android.market.licensing.MainActivity
indicates you can provide more than justSecure.ANDROID_ID
as thedeviceId
. How secure you need to make this is up to your discretion - it could be as simple as hardcoding a value in your application(new String(byte[]{(byte) 75, (byte) 12}) + Secure.ANDROID_ID)
or some other cryptography scheme (whose discussion may be more appropriate for a cryptography forum).