android dm-crypt 过程

本文详细解析了Android系统的加密启动过程,重点介绍了/data分区的加密处理机制。文章深入探讨了当遇到加密文件系统或被擦除的情况时,系统如何通过临时挂载tmpfs来实现最小化启动,并请求用户输入密码。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

android 4.0.4为例子

/system/core/init/builtins.c

/* If this fails, it may be an encrypted filesystem
             * or it could just be wiped.  If wiped, that will be
             * handled later in the boot process.
             * We only support encrypting /data.  Check
             * if we're trying to mount it, and if so,
             * assume it's encrypted, mount a tmpfs instead.
             * Then save the orig mount parms in properties
             * for vold to query when it mounts the real
             * encrypted /data.
             */

如果mount失败,可能是加密文件系统,或者是被擦除了。如果是擦除了,讲在boot处理。

我们只支持/data加密。我们将mount成tmpfs.

 /* Set the property that triggers the framework to do a minimal
                 * startup and ask the user for a password
                 */

我们设置属性,framework最小的启动,问密码。

./packages/apps/Settings/src/com/android/settings/CryptKeeper.java:164:

./base/services/java/com/android/server/SystemServer.java

152             // Only run "core" apps if we're encrypting the device.

153             String cryptState = SystemProperties.get("vold.decrypt");

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值