在研究Android系统时,有时会遇到Sandbox(沙箱)这个概念。沙箱概念本身并不是太新奇,但是一直不是很清楚Android是如何实现它所称的“沙箱”的。网上不少人声称应用使用了虚拟机就是应用了沙箱,一直对这种说法表示怀疑。

最近发现Android的网站上更新了一些文档,其中包括对Sandbox的解释,这才明白Android中Sandbox的含义。

Android的”沙箱“就是在Linux的进程管理基础上对UID的使用做了改进。普通的Linux中启动的应用通常和登陆用户相关联,同一用户的UID相同。但是Android中给不同的应用都赋予了不同的UID,这样不同的应用将不能相互访问资源。对应用而言,这样会更加封闭,安全。虽然这个现象早已了解,但是一直不知道这就是Android所谓的”sandbox“。

有关英文解释见下面:

The Application Sandbox

The Android platform takes advantage of the Linux user-based protection as a means of identifying and isolating application resources. The Android system assigns a unique user ID (UID) to each Android application and runs it as that user in a separate process. This approach is different from other operating systems (including the traditional Linux configuration), where multiple applications run with the same user permissions.

This sets up a kernel-level Application Sandbox. The kernel enforces security between applications and the system at the process level through standard Linux facilities, such as user and group IDs that are assigned to applications. By default, applications cannot interact with each other and applications have limited access to the operating system. If application A tries to do something malicious like read application B's data or dial the phone without permission (which is a separate application), then the operating system protects against this because application A does not have the appropriate user privileges. The sandbox is simple, auditable, and based on decades-old UNIX-style user separation of processes and file permissions.

Since the Application Sandbox is in the kernel, this security model extends to native code and to operating system applications. All of the software above the kernel in Figure 1, including operating system libraries, application framework, application runtime, and all applications run within the Application Sandbox. On some platforms, developers are constrained to a specific development framework, set of APIs, or language in order to enforce security. On Android, there are no restrictions on how an application can be written that are required to enforce security; in this respect, native code is just as secure as interpreted code.

In some operating systems, memory corruption errors generally lead to completely compromising the security of the device. This is not the case in Android due to all applications and their resources being sandboxed at the OS level. A memory corruption error will only allow arbitrary code execution in the context of that particular application, with the permissions established by the operating system.

Like all security features, the Application Sandbox is not unbreakable. However, to break out of



android虚拟应用沙箱,Android的SandBox(沙箱)相关推荐

  1. android 虚拟按键自定义,Android手机底部栏虚拟按键的操作

    防止屏幕长度和主流不符导致底部出现黑色空白区域,应该在AndroidManifest.xml文件中,添加如下代码: 实例图.png 至于在Application中添加 android:resizeab ...

  2. android 虚拟键 高度,Android获取虚拟按键的高度(适配全面屏)

    在开发过程中,假如我们要从底部弹出一个popwindow,这时候我们需要考虑获取实际显示的虚拟键高度. 期望: 全面屏下 1.1 开启全面屏开关-返回0 1.2 关闭全面屏开关-执行非全面屏下处理方式 ...

  3. android 虚拟键背景,Android 设置应用的底部导航栏(虚拟按键)背景颜色

    Android手机机型种类繁多,但是虚拟按键也就是底部的导航栏,不外乎两种设计方式,一种是作为虚拟按键设计到屏幕内部,一种是作为系统按键设计到屏幕外面. 对于按键在屏幕内部的机型,因为虚拟按键也是屏幕 ...

  4. android 虚拟键 高度,Android,获取虚拟键盘的高度

    在很多时候,很多需求下,我们都需要得知键盘的高度啊!实在不能理解为什么安卓不提供这样方便的API.虽然没有很好的监听事件,但是我们还是可以制造一个的.想想虚拟键盘弹起来之后界面发生了什么变化?对的,有 ...

  5. android程序导入虚拟机,android项目打包成apk应用程序后部署到虚拟机上测试

    一:打包成apk包 这个比较简单,如下 右键点击项目--> export -->  android Project -->  选择密钥等信息  --> 填写密钥信息  --&g ...

  6. android按钮被遮住,解决Android 虚拟按键遮住了页面内容的问题

    在启动页的时候华为手机虚拟按键遮挡住了启动页下面的字找了找解决办法,特地记录一下 第一种办法:扩展虚拟按键 //状态栏 @ 顶部getWindow().addFlags(WindowManager.L ...

  7. Android 虚拟按键上报

    概述  本文主要讲述触摸屏上可能用到的虚拟按键menu.home.return,底层驱动的实现和相关实现原理,其中和上层有联系的只是概述. 两种实现方式  对于触摸按键的发送可以分为两种方法: 1. ...

  8. android 虚拟按键源码流程分析

    android 虚拟按键流程分析 今天来说说android 的虚拟按键的源码流程.大家都知道,android 系统的状态栏,虚拟按键,下拉菜单,以及通知显示,keyguard 锁屏都是在framewo ...

  9. android 覆盖虚拟按键,解决Android 虚拟按键遮住了页面内容的问题

    在启动页的时候华为手机虚拟按键遮挡住了启动页下面的字找了找解决办法,特地记录一下 第一种办法:扩展虚拟按键 //状态栏 @ 顶部getWindow().addFlags(WindowManager.L ...

  10. android dialog隐藏虚拟按键,Android应用开发之Android dialog 去除虚拟按键的解决方法...

    本文将带你了解Android应用开发Android dialog 去除虚拟按键的解决方法,希望本文对大家学Android有所帮助. Android   部分机型没有物理按键,只有虚拟按键,Activi ...

最新文章

  1. 三维数据平滑处理_你该如何正确的处理思看科技三维扫描仪得到的数据?
  2. 01.elasticsearch-mapping全面解析
  3. 业务时间做开发,使用jeecg框架
  4. SQL Server系列
  5. vue音乐项目歌手页面滚动、吸顶效果
  6. JavaScript常用DOM操作方法和函数
  7. 便于理解mysql内幕的各种逻辑图组
  8. 神经网络基础模型--Logistic Regression的理论和实践
  9. Error:Execution failed for task ':app:lint'.
  10. python数字转中文字符_python数字金额转换为中文大写金额
  11. mac电脑外接显示器后没有声音
  12. 抽样分布的形式与原有总体的分布和样本容量n的大小有关
  13. 慕课秒杀项目seckill
  14. html5鼠标悬停下拉列表,HTML5与CSS3中鼠标悬停会有下拉列表
  15. 虚函数 2 之虚函数的定义
  16. 知云文献翻译打不开_还在为论文翻译烦恼吗?点进来帮您解决
  17. Matlab绘图-详细全面(图)
  18. 计算机实验员技能大赛,“迎接挑战”计算机技能大赛圆满结束!
  19. IS-IS协议所使用的NET地址由哪几部分构成?
  20. java实现PEKS_JAVA线程基础

热门文章

  1. AutoCAD Civil 3D 中缓和曲线的定义
  2. 缓和曲线回头曲线交点法坐标计算实例
  3. 维特智能六轴加速度电子陀螺仪传感器姿态倾角温补传感器模块JY60
  4. 全球与中国烧碱片市场深度研究分析报告
  5. Android打开pdf文件
  6. 解决Adobe Reader 打开PDF文件10秒左右自动关闭问题
  7. CAD-Arcgis 坐标校正
  8. matlab多个图例,Matlab 画多个图例( Plot multiple legends )
  9. NOIp2014 提高组 Day1 T1 生活大爆炸版石头剪刀布
  10. 基于STM32F429,Cubemx的SAI音频播放实验