android - 使用 shareduserid 的安全性

标签 android security android-manifest ipc

这听起来像是一个模糊的问题,但我不得不问。

我是一名初学者 android 开发人员,刚刚开始了解 android 中进程间通信的工作原理。 如果在 2 个应用程序中使用相同的 shareduserid,那么他们有权访问彼此的数据,这意味着我可以反编译任何 apk,从 list 中找出它的 shareduserid,并创建我的应用程序,使用相同的 shareduserid 来访问它的数据。

我错过了什么吗?

如果我想在未来创建 2 个应用程序(它们一起工作从而暴露 shareduserid),我应该如何保证我的数据安全?

最佳答案

共享用户 ID 由证书签名强制执行。仅当应用程序使用相同的证书签名时,平台才会授予/分配相同的用户 ID。 Ref .:

android:sharedUserId

The name of a Linux user ID that will be shared with other applications. By default, Android assigns each application its own unique user ID. However, if this attribute is set to the same value for two or more applications, they will all share the same ID — provided that they are also signed by the same certificate. Application with the same user ID can access each other's data and, if desired, run in the same process.

关于android - 使用 shareduserid 的安全性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36734951/

相关文章:

Android RecyclerView 最大滚动偏移量

php - 安全登录表单,或者至少我希望如此

android - 如何处理错误 : failed linking references

java - 屏幕方向卡在模拟器上

java - 如何在AndroidManifest中获取设备型号并制定条件?

android - 如果通过 VS Code 运行,Flutter 运行卡在 "Installing build\...\app.apk"

android - 如何使用 Canvas 从圆圈内的字符串文本创建位图?

android - 在 Play 商店获取当前应用版本

java - 如何清理 Java 生成代码的用户输入?

security - 异或加密和解密 key