以下操作,必须在 linux 下完成,我是用的虚拟机,推荐使用 Debian or Ubuntu
# 准备工作 下载 Android_boot_image_editor 用来解包、打包 boot.img
git clone https://github.com/cfig/Android_boot_image_editor.git
### 解包
# 复制 boot.img 到 Android_boot_image_editor 目录下
./gradlew unpack
# 解包路径
build/unzip_boot/
#root@archlinux:~/Android_boot_image_editor/build/unzip_boot# ls
#total 13884
#-rw-r--r-- 1 root root 1021 Oct 1 14:11 boot.json
#-rw-r--r-- 1 root root 13265794 Oct 1 14:10 kernel
#-rw-r--r-- 1 root root 134269 Oct 1 14:10 kernel_configs.txt
#-rw-r--r-- 1 root root 7 Oct 1 14:10 kernel_version.txt
#-rw-r--r-- 1 root root 802471 Oct 1 14:11 ramdisk.img.gz
#drwxr-xr-x 8 root root 4096 Oct 1 14:10 root
# 看到的大概就是这样的结构了
# 编辑 boot.json,找到名为 cmdline 的 key,往对应的值添加(注意用空格隔开)
androidboot.selinux=permissive
### 打包
cd Android_boot_image_editor
./gradlew pack
# 会在当前目录生成一个 boot.img.signed 文件
# 刷入
fastboot flash boot boot.img.signed
准确来说,也不是禁用,是设为“宽容”模式
还是蛮简单的。
我是为了体验 ViPER4Android FX 音效。
一劳永逸!!!