如何在Android应用程序中保护可绘制资源 [英] How to protect drawable resource in Android application

查看:69
本文介绍了如何在Android应用程序中保护可绘制资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请告诉我如何在apk包中保护我们的资源.通过简单的重命名提取过程,任何人都可以复制和窃取应用程序可绘制资源,例如图像或soundFX文件.我的问题是,有什么方法可以保护Android应用程序中的可绘制资源?

Please tell me how to protect our resource in a apk package. With a simple rename-extract process, any one can copy and thief application drawable resource like images or soundFX files. My question is, is there any way to protect drawable resource in a Android application?

推荐答案

可绘制对象必须是操作系统可访问的,因此必须可读.

The drawable needs to be accessible to the operating system, so it has to be readable.

如果您确实想确保它的安全,则可以考虑将其加密存储为原始资产,然后加载它,将其解密为ByteStream并将其传递给BitmapFactory.当然,这会对性能产生轻微的影响,并且将迫使您手工编写很多本可以用XML轻松完成的工作.否则,

If you really want to keep it secure, you could consider storing it encrypted as a raw asset, then load it, decrypt it into a ByteStream and pass it into the BitmapFactory. That, of course, has slight performance ramifications and will force you to hand-code a lot of stuff that you could have easily done in XML otherwise.

总而言之,窃取数据的方法有很多-如果它是可绘制的,人们可以截取屏幕截图.

That all aside, there are many ways to steal data - if it's a drawable, people could just take a screenshot.

这篇关于如何在Android应用程序中保护可绘制资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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