type
status
date
summary
slug
tags
category
icon
password

修改 system.img

  1. 挂载 system.img
    1. sudo mount -o rw,loop system.img ~/system_oho
  1. 修改 system/etc/param/ohos.para
    1. const.secure=1 -> const.secure=0
      const.debuggable=0 -> const.debuggable=1
  1. 修改 system/etc/param/hdc.para
  1. 修改 system/etc/init/hdcd.cfg
    1. 参考 非root版本文件内容root版本文件内容 修改即可,其中 hdcd 的 selinux 上下文设置为 u:r:hdcd:s0 , 也就是不改。
  1. 修改 system/etc/selinux/system_common.cil
    1. (type sh) -> (typepermissive sh)
  1. 取消挂载

Patch emulator

按照上面的方法对 system.img 进行 patch 后,发现镜像文件检验失败无法启动镜像(我镜像你也要校验,真下头
notion image
对 Emulator 文件进行逆向后发现,校验的实现在 CheckImage::CheckSign 函数
notion image
patch 也比较简单 VerifyReleaseCmsFile 函数修改为 return 0 即可。 然后重新签名一下
其中 app.entitlements 的内容为
notion image