Android: 通过静态变量传递值会导致安全问题吗?

Android: Does passing values through static variable cause securtiy issues?

从其他技术角度来看,通过静态变量传递值是重点 here,但是我想知道在所有应用程序范围内使用静态变量作为全局变量是否会导致安全问题或信息泄露,因为 [=14] =] 应用 运行 在独立的沙盒中?

You mean Intent can be said less secure than static variables?

每当您在 Context 上调用 startActivity()startService()bindService()sendBroadcast() 时,Intent 就会离开您的进程,转到核心 OS 进程,然后转到包含您尝试使用的组件的任何进程。这包括调用该方法的组件与其尝试使用的组件在同一进程中的情况。在其他条件相同的情况下,static 变量更安全,因为它不会离开进程(除非您自己离开)。

据我们所知,Intent 对象对间谍是安全的。不过这块过去有过bug,不排除以后有bug的可能。

from all application scope I meant static variables are shared and everybody inside application can see it

您对应用程序中的所有代码负责,框架实现除外。

if an application have several process, static variables are shared among them

没有

or each process hold different instances of static variable?

是的。