提供额外的媒体资源(图形/声音)作为Google Play应用内结算项目 [英] Offering additional media resources (graphics/sounds) as Google Play in-app billed items

查看:87
本文介绍了提供额外的媒体资源(图形/声音)作为Google Play应用内结算项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我通过Google Play提供的Android应用中,我想提供可通过应用内结算方式购买的其他商品。



我喜欢的商品种类想要提供的是媒体内容,如图形和声音,通常会进入应用程序的 res 文件夹。



<问题是,当然必须保护这些资源。在其文档中,Google建议不要将内容存储在应用程序包中,而是要获取购买商品后输入密钥,然后将密钥发送到检查密钥的远程服务器,如果成功,则提供下载到应用程序的图形/声音。



从安全角度来看,这听起来不错。但是,如果我这样做,我就不能像使用正常访问资源那样容易地使用内容。例如,如果用户可以获得其他背景PNG,我不能使用 R.drawable.new_background 但必须以编程方式解码位图,对吗?



那么是否有通过应用内结算下载其他媒体内容的替代方案或最佳做法?



我想说,就像每个人一样无论如何,谁足够坚定可以对代码进行反向工程,为什么不将内容存储在应用程序内部,而是根据用户可能完全使用该内容进行强力检查。

解决方案

在应用程序中不存储其他内容的一个明显原因是应用程序的应用程序下载大小。如果您提供音频作为附加内容,它可以大大增加您的应用程序的大小。用户关心它。此外,它还可以更轻松地发布其他内容,因为您可以通过服务器端/开发人员控制台执行此操作,而无需发布应用程序更新。此外,如果您想提供高质量的图形,您将能够直接向设备提供适当版本的图像,而无需存储所有密度/屏幕尺寸版本。



如果您担心安全问题,您可以随时使用加密和签名来访问资源,并通过正确地混淆代码(或者甚至将安全/解密相关代码移动到本机端)来使攻击者的生活更加艰难,这将使其更快)。



是的,这会产生一个缺点,你必须以编程方式解码它们并且没有任何关系。老实说,我不明白为什么这么大的交易,相反,我认为你将拥有更多数据驱动的资源访问权限非常方便。



As总结我真的不认为有这样做的标准,这取决于您的应用程序和内容类型。如果您提供固定的5-10张图像,那么将它们保存在本地是完全正常的,如果它是更丰富的内容,更多的项目,更重的资源,那么客户端服务器将更适合您。


Within my Android app that is available via Google Play, I want to offer additional items that can be bought via in-app billing.

The kind of items I want to offer is media content such as graphics and sounds, which would normally go into the res folder of the app.

The problem is that these resources must be protected, of course. In its documentation, Google suggests not to store the content inside of the application package but to obtain a key after the item was bought and then send the key to a remote server where the key is checked and, if successful, the graphics/sounds offered for download to the app.

This sounds good, from the security perspective. But if I do this, I can't use the content as easily as resources can be accessed normally. If the user can get additional background PNGs, for example, I can't use R.drawable.new_background but have to decode the bitmap programatically, right?

So are there any alternatives or best practices for downloading additional media content via in-app billing?

I would say, as everyone who is determined enough can reverse-engineer the code, anyway, why not just store the content inside of the app but do strong checks if the user might use that content at all.

解决方案

One of obvious reasons for not storing additional content in the app is your app's app download size. If you are offering audio as additional content it can drammatically increase the size of your application. And users care about it. Besides it makes it easier to publish additional content, since you can do it via your server side/developer console without the need to publish app update. Moreover, if you want to provide high quality graphics, you will be able to serve appropriate version of the image directly to the device without the need of storing all density/screen size versions.

If you are concerned about security you can always use encryption and signatures to access resources and make attackers life much harder by properly obfuscating your code (or even moving security/decryption related code to native side, which will make it faster as well).

Yes, that would create a drawback that you will have to decode them programmatically and there is nothing to do about it. I honestly don't see why it is so big of a deal, on contrary, I think it's quite convenient that you will have more data driven access to resources.

As a summary I dont really think there are any standards for doing this and it depends on your app and content type. If you offer a fixed amout of 5-10 images, then there it is perfectly fine to keep them locally, if it is richer content, more items, heavier resources, then client-server would suit you more.

这篇关于提供额外的媒体资源(图形/声音)作为Google Play应用内结算项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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