Android 应用程序复制保护和数据文件
在我的应用程序中,我在代码中的以下硬编码位置访问我的 sqlite 数据库:
/data/data/ com.mydomain.appname/databases/database.db
如果我在Market Place,我的应用程序仍然可以访问该位置吗?
或者我是否必须将其更改为类似以下内容:
/data-private/data/ com.mydomain.appname/databases/database.db
(或类似的内容)
因为我只有一部开发手机,我无法测试我的应用程序在打开复制保护后是否仍然正常运行。
谢谢你!
[编辑:为了清楚起见,对这个问题进行了重新表述]
In my app, I access my sqlite database at the following hard-coded location in my code:
/data/data/ com.mydomain.appname/databases/database.db
If I turn ON copy protection in the Market Place, will my app still have access to this location?
Or will I have to change it to something like:
/data-private/data/ com.mydomain.appname/databases/database.db
(or something like this)
Since I have a Dev phone only, I have no way of testing to see if my app still functions normally after turning on copy protection.
Thank you!
[edit: this question was rephrased for clarity]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据我的经验,将复制保护设置为启用不会影响您以任何方式访问应用程序中的文件的方式。
不过,我建议您永远不要将该应用程序上的复制保护更改为禁用。大约 9 个月前,我犯了这个错误,我的应用程序的用户不太高兴。基本上我最初上传了一个应用程序并启用了复制保护。我决定关闭复制保护,因为所有的报告都表明它是多么脆弱/容易被规避。因此,在该游戏的下一次更新中,我关闭了复制保护。问题是应用程序的非复制保护版本无法读取应用程序的复制保护版本创建的文件。因此人们无法保存或加载已保存的游戏或高分。解决方案是完全删除游戏并重新安装,这远非理想的。
他们现在可能已经解决了这个问题,但我不愿意测试并找出答案。
In my experience setting the copy protection to enabled does not affect how you access the files in your app in any way.
I will however recommend that you do not ever change the copy protection on that app to disabled. I made that mistake about 9 months or so ago and the users of my app were not very happy. Basically I had originally uploaded an app and enabled copy protection. I decided to turn copy protection off because of all of the reports about how weak/easily circumventable it was. So on my next update of that game I turned copy protection off. The problem with this is that the non copy protected version of the application could not read the files created by the copy protected version of the app. So people could not save or load their saved games or high scores. The solution was to completely remove the game and reinstall which is far from desirable.
They may have fixed this by now but I am not willing to test and find out.
我还添加了带有复制保护的应用程序,但收到朋友的报告称他们在市场上找不到该应用程序,但一旦我关闭复制保护,每个人都可以找到我的应用程序。但打开该选项后,数据访问或任何其他问题都没有问题。
I also added my app with copy protection on but got reports from friends that they could not find the app on Market but as soon as I switched of the copy protection everyone could find my app. But there was no problem with data access or anything with the option turned on.