sharedUserId:安全的,当应用程序已经在市场的变化? [英] sharedUserId: safe to change when app is already in market?

查看:128
本文介绍了sharedUserId:安全的,当应用程序已经在市场的变化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关我们的应用程序的下一个版本,我想改变sharedUserId,因为我们现在使用的内部控制仪表盘的应用程序必须写入到另一个应用程序的设置文件。

For the next version of our application, I want to change the sharedUserId since we now use an internal control dashboard app which must write to the other app's settings files.

不过,由于应用程序是在许多手机已经安装了,这会是一个问题?我跑在模拟器上一个小的测试,而我看到的是*的preference文件.bak的版本不能写入设备的日志例外。不知道那是多么的重要。奇怪的是,防护碰撞设置似乎仍然使用其他的Linux用户ID的工作,即使shared_ preFS文件夹已经建立。

But since the app is already installed on many phones, will this be a problem? I ran a little test on the emulator, and I'm seeing exceptions in the device logs that *.bak versions of the preference files cannot be written. Not sure how critical that is. Curiously, safing settings still seems to work, even though the shared_prefs folder had been created using another Linux user ID.

没有人之前尝试此?

推荐答案

和回答我的问题的再次的:

不,这不是安全的。由于更新通过Android电子市场中的应用程序将不会删除数据库和preference文件,新版本将无法读取或写入这些文件(因为他们根据不同的Linux用户ID被创造),而更新后的应用程序将崩溃。你将不得不要求用户完全卸载并重新安装应用程序,这肯定是不推荐使用。

No, it's not safe. Since updating an app via Android Market will not remove the database and preference files, the new version will not be able to read or write these files (since they were created under a different Linux user ID), and the app will crash after the update. You would have to ask your users to completely uninstall and reinstall the app, which is certainly not recommended.

作为一般规则我由此得出结论: 当你开始开发新的应用程序,确保设置了手动安卓过程安卓sharedUserId 属性!它没有伤害的情况下,你不需要它,但它可以让你完全控制哪些应用程序可以访问这个应用程序的私有资源。

As a general rule I conclude from this: Whenever you start out developing a new app, make sure to set a manual android:process and android:sharedUserId attribute! It doesn't hurt in case you don't need it, but it gives you full control over which apps have access to this app's private resources.

这篇关于sharedUserId:安全的,当应用程序已经在市场的变化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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