Android 中的每个应用程序(有一些小的例外)在安装过程中都会收到自己的 UID 和 GID。因此,Android 中的每个应用程序都类似于 Linux 中的用户。 Linux 内核在文件系统级别使用沙箱可以防止一个应用程序访问另一个应用程序的文件(类似于 Linux 中每个用户的主目录)。因此,在 Linux 中,只有主目录的所有者(和 root)可以直接访问此目录,而其他用户则不能。
Every application (with some minor exceptions) in Android during the installation receives its own UID and GID. Thus, every application in Android is analog of a user in Linux. Linux kernel using sandboxing on a filesystem level prevents one application from accessing to the files of another application (the analog for this is home directory for every user in Linux). Thus, in Linux only the owner of the home directory (and root) has access to this direct and other users cannot.
If you have a root access to Android you can change the modifiers of the file like you propose in the question. So you can make a folder to be accessible from other applications. Moreover, when you create a file you can set that this file is world-readable and in this case all applications will have access to this file.
Your approach of how databases's work is wrong. Application each have their own database that unless have been linked to a contentprovider are specific to the package that it belongs to.
发布评论
评论(3)
Android 中的每个应用程序(有一些小的例外)在安装过程中都会收到自己的 UID 和 GID。因此,Android 中的每个应用程序都类似于 Linux 中的用户。 Linux 内核在文件系统级别使用沙箱可以防止一个应用程序访问另一个应用程序的文件(类似于 Linux 中每个用户的主目录)。因此,在 Linux 中,只有主目录的所有者(和 root)可以直接访问此目录,而其他用户则不能。
如果您拥有 Android 的 root 访问权限,您可以像您在问题中建议的那样更改文件的修饰符。因此,您可以使其他应用程序可以访问文件夹。此外,当您创建文件时,您可以设置该文件是世界可读的,在这种情况下,所有应用程序都可以访问该文件。
Every application (with some minor exceptions) in Android during the installation receives its own UID and GID. Thus, every application in Android is analog of a user in Linux. Linux kernel using sandboxing on a filesystem level prevents one application from accessing to the files of another application (the analog for this is home directory for every user in Linux). Thus, in Linux only the owner of the home directory (and root) has access to this direct and other users cannot.
If you have a root access to Android you can change the modifiers of the file like you propose in the question. So you can make a folder to be accessible from other applications. Moreover, when you create a file you can set that this file is world-readable and in this case all applications will have access to this file.
是的,这称为沙箱。本质上它使用 Linux 文件权限来强制执行此操作。
如果您需要更多信息,请告诉我。
Yes this is called as sandboxing. Essentially it use Linux file permission to enforce this.
Let me know in case you need more info.
您对数据库工作方式的方法是错误的。每个应用程序都有自己的数据库,除非已链接到内容提供者,否则这些数据库特定于其所属的包。
Your approach of how databases's work is wrong. Application each have their own database that unless have been linked to a contentprovider are specific to the package that it belongs to.