跳转至

Google Pixel 入坑指南

这是一份写给国内 Pixel 新用户的、从零开始的完整入坑指南❤️

本文基于笔者约 16 小时的实机实验、踩坑排查和整理撰写,目标不是简单罗列命令!

而是把一台刚拆封的 Pixel 在国内环境下如何完成:

  • 联网认证、首次开机、OEM 解锁、USB debugging
  • 镜像下载、Magisk patch
  • bootloader 解锁、刷入 patched init_boot、重新初始化
  • 重新安装 Magisk、验证 root
  • 后续备份复盘

按真实操作顺序完整走一遍。有详细的图文教程, 确保"说人话" 🚀

网上关于 Pixel 国内使用、代理联网、root、Magisk、fastboot 的资料很多,但大多分散在社区帖子、问答和片段教程里,默认读者已经知道很多前置知识。

本文尝试把这些离散信息重新组织成一份自顶向下、图文并茂、手把手的实践记录:每一步为什么做、做完应该看到什么、哪些现象不一定是问题、哪些操作绝对不要乱碰,都会尽量写清楚。

它既是一篇教程,也是一份给未来自己的可复现记录 🛰️✨

Carrot Hu. 2026.0514

Step 1: 通过现有设备VPN实现pixel连接外网服务器认证

alt text

现有设备:

  • iPhone 13, with shadowrocket
  • MacOS Sequoia, with clash verge
  • Pixel, 刚拆封首次开机
  • 一根 iPhone 到 Mac 的数据线

这套方案不依赖校园网认证, 也不依赖 Pixel 先进入系统、ADB、USB debugging

处理思路:

  1. iPhone 通过 USB 给 Mac 供网
  2. Mac 连上网, 开启代理/TUN
  3. MacOS Internet Sharing 生成 Wi-Fi (命名: pixelsetup), 准备给 Pixel 连接
  4. Pixel 开机, 连接 pixelsetup
  5. Pixel 成功进入 Google setup 流程

拓扑安排:

Bash
1
2
3
4
5
6
7
iPhone
     个人热点 + USB 线
Mac
     Clash Verge TUN + Global
MacOS Internet Sharing
     Wi-Fi AP: PixelSetup
Pixel

(1) iPhone 通过 USB 给 Mac 供网

iPhone 端

设置 → 个人热点 → 允许其他人加入

然后用数据线连接 iPhone 和 Mac

iPhone 弹出: Trust This Computer?

选择: Trust / 信任

Mac 端确认 iPhone USB 出现

Bash
1
2
# MacOS Terminal (i use iTerm2)
networksetup -listallhardwareports

可见:

Bash
1
2
3
4
5
6
7
8
# ...
Hardware Port: iPhone USB
Device: en9
Ethernet Address: [XXXX]
# ...
Hardware Port: Wi-Fi
Device: en0
Ethernet Address: [XXXX]

也就是说, 从网口角度:

  • iPhone USB = en9
  • Wi-Fi = en0

(2) Mac 关闭 Wi-Fi 连接, 但不要关闭 Wi-Fi

Wi-Fi要打开, Mac 的 Wi-Fi 要用来发热点!

但是, 它不能再连接 iPhone 热点、校园网或其他 Wi-Fi!!!

正确状态是:

  • iPhone USB: 负责 Mac 上网
  • Wi-Fi: 打开,但不连接任何 Wi-Fi,用来发 PixelSetup

如图所示:

alt text

alt text

(3) Mac 开 Clash Verge

在 Clash Verge 里设置:

  • TUN Mode: On
  • Mode: Global

建议同时打开这些类似选项,具体名字随版本不同:

  • Allow LAN / 允许局域网连接
  • Service Mode
  • Auto Route
  • Auto Redirect

alt text

这里的关键点是

不要只开 System Proxy!!! 必须要 TUN!!!

让 Clash 能处理来自 Pixel 的转发流量!!!

因为 Pixel 的流量不是 Mac 本机 App 流量, 而是从 macOS Internet Sharing 转发进来的

(4) 配置 MacOS Internet Sharing

设置 → 通用 → 共享 → 互联网共享

设置为:

  • 共享以下来源的连接: iPhone USB
  • 共享给使用以下端口的电脑: Wi-Fi
程序员视角
Text Only
1
2
From: iPhone USB / en9
To:   Wi-Fi / en0

alt text

alt text

点 Wi-Fi Options / Wi-Fi 选项, 建议设置成最保守配置:

Bash
1
2
3
网络名称: pixeltest
安全性: 'WPA2 个人级' or 'WPA2/WPA3 个人级'
密码: xxx

alt text

现在看系统状态栏里的 wifi 内容:

alt text

基本上就ok了! 🎉🎉🎉

(5) 其他验证

打开终端运行:

Bash
1
ifconfig bridge100

应该能看到类似这样的:

Bash
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
 ifconfig bridge100
bridge100: flags=8a63<UP,BROADCAST,SMART,RUNNING,ALLMULTI,SIMPLEX,MULTICAST> mtu 1500
    options=63<RXCSUM,TXCSUM,TSO4,TSO6>
    ether [XXXX]
    inet 192.168.2.1 netmask 0xffffff00 broadcast 192.168.2.255
    inet6 [XXXX] prefixlen 64 scopeid 0x1c
    inet6 [XXXX] prefixlen 64 autoconf secured
    Configuration:
        id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
        maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
        root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
        ipfilter disabled flags 0x0
    member: ap1 flags=3<LEARNING,DISCOVER>
            ifmaxaddr 0 port 13 priority 0 path cost 0
    Address cache:
    nd6 options=201<PERFORMNUD,DAD>
    media: autoselect
    status: active

这样就没问题, 其中:

Bash
1
2
3
bridge100 = macOS 给下游设备创建的内网网桥
192.168.2.1 = Mac 在这个下游网络里的网关地址
ap1 = macOS 创建的 Wi-Fi AP 虚拟接口

再运行:

Bash
1
ifconfig ap1

成功时看到:

Bash
1
2
3
4
5
6
7
 ifconfig ap1
ap1: flags=8b63<UP,BROADCAST,SMART,RUNNING,PROMISC,ALLMULTI,SIMPLEX,MULTICAST> mtu 1500
    options=6460<TSO4,TSO6,CHANNEL_IO,PARTIAL_CSUM,ZEROINVERT_CSUM>
    ether [XXXX]
    nd6 options=201<PERFORMNUD,DAD>
    media: autoselect
    status: active

只要 active 即可.

注意: en0 inactive 不一定是问题
Bash
1
ifconfig en0

可能会发现, 输出:

Bash
1
status: inactive

一开始笔者以为这是问题,但后面确认没关系:

在 macOS 当前模式下,热点是通过虚拟 AP 接口 ap1 挂到 bridge100 上的,不一定直接表现为 en0 active

所以最终判断不要只看 en0! 而要看:

  • bridge100 是否有 192.168.2.1
  • bridge100 是否 member: ap1
  • ap1 是否 active
  • 外部设备是否能看到 pixeltest

现在就正式完结撒花了! 🚀

我们这就来转战 pixel 😍

Step 2: Pixel 首次开机该咋做

这一部分忘记逐步截图了...

NOTE: 在后面reboot之后补了, 可参考: Step 11

(1) Step 1: 语言选择英文

(2) 后面的所有步骤, 能 skip 的都 skip

除了wifi, 其他全部skip!!!

  • 指纹/人脸: skip
  • Google Services: skip
  • Gmail 登陆: skip
  • 设置 PIN: 搞个简单的, 123456
  • Assistant / Gemini / Wallet / Backup ...
    • 全部跳过

(3) 只有 Wi-Fi 这一步要稍微注意一下 [应该是在从前往后第二步]

点击选择 pixeltest, 进入认证界面

  1. 输入密码
  2. 点击 Advanced options / 高级选项
    • Proxy: Manual / 手动
    • Proxy hostname: 192.168.2.1
    • Proxy port: Clash 的 mixed/http 端口, 例如笔者的就是 7897
    • IP settings: DHCP

然后就可以了! 进入主页面 🎉

Step 3: 确认 OEM unlocking

(1) 开启 Developer Options

进入 Settings > About phone

  • Build number 连点 7 次
  • 输入 PIN

然后进入 Settings > System > Developer options.

alt text

(2) 打开 OEM unlocking

找到 OEM unlocking打开

如果能打开, 说明这台机器可以 root. 这也是我们的核心诉求, 必须行!

alt text

Step 4: 打开 USB debugging

(1) USB 线连接 pixel 和 mac

(2) 进入 Settings > System > Developer options.

打开 USB debugging.

手机弹窗点 Allow 就行.

alt text

alt text

电脑端检验一下:

Bash
1
2
3
4
5
6
7
8
9
 adb kill-server

❯ adb start-server
* daemon not running; starting now at tcp:5037
* daemon started successfully

❯ adb devices -l
List of devices attached
55201FDCR000G9         device usb:1-1 product:frankel model:Pixel_10 device:frankel transport_id:1

记录当前 Build number:

查看: Settings > About phone > Build number

比如我的是: BD1A.250702.001

Step 5: 准备工作: 下载镜像

(1) 来到官网, 准备OTA Images

电脑浏览器来到 Google Full OTA Images 页面

Pixel 10中, 找到 Build number. 下载对应 full OTA zip

alt text

把它下载进 ~/Android/pixel10-root/.

Bash
1
2
3
4
5
6
 tree -L 2
.
└── pixel10-root
    ├── frankel-ota-bd1a.250702.001-82bd95c6.zip
    ├── platform-tools
    └── platform-tools-latest-darwin.zip

(2) 来到官网, 准备Factory Images

同上选择, 下载对应 full Factory zip

下载进 ~/Android/pixel10-root/.

Bash
1
2
3
4
5
6
7
 tree -L 2
.
└── pixel10-root
    ├── frankel-bd1a.250702.001-factory-1a0ca670.zip
    ├── frankel-ota-bd1a.250702.001-82bd95c6.zip
    ├── platform-tools
    └── platform-tools-latest-darwin.zip

(3) 提取 init_boot.img

Bash
1
2
3
4
cd ~/android/pixel10-root

mkdir -p factory
unzip frankel-bd1a.250702.001-factory-1a0ca670.zip -d factory

会解压30s左右:

Bash
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
 unzip frankel-bd1a.250702.001-factory-1a0ca670.zip -d factory
Archive:  frankel-bd1a.250702.001-factory-1a0ca670.zip
   creating: factory/frankel-bd1a.250702.001/
  inflating: factory/frankel-bd1a.250702.001/flash-base.sh
 extracting: factory/frankel-bd1a.250702.001/image-frankel-bd1a.250702.001.zip


  inflating: factory/frankel-bd1a.250702.001/bootloader-frankel-deepspace-1.0-13704183.img
  inflating: factory/frankel-bd1a.250702.001/proto11.ec.bin
  inflating: factory/frankel-bd1a.250702.001/flash-all.sh
  inflating: factory/frankel-bd1a.250702.001/d3m2.ec.bin
  inflating: factory/frankel-bd1a.250702.001/radio-frankel-g5400i-250625-250626-b-13698361.img
  inflating: factory/frankel-bd1a.250702.001/flash-all.bat
  inflating: factory/frankel-bd1a.250702.001/evt.ec.bin

检查内容:

Bash
1
2
cd ~/android/pixel10-root/factory/frankel-bd1a.250702.001
ls -lh

看见:

Bash
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
 ls -lh
total 19294304
-rw-r--r--@ 1 huluobo  staff    20M  8 14  2025 bootloader-frankel-deepspace-1.0-13704183.img
-rw-r--r--@ 1 huluobo  staff   1.0M  8 14  2025 d3m2.ec.bin
-rw-r--r--@ 1 huluobo  staff   1.0M  8 14  2025 evt.ec.bin
-rw-r--r--@ 1 huluobo  staff   1.0K  8 14  2025 flash-all.bat
-rwxr-xr-x@ 1 huluobo  staff   1.1K  8 14  2025 flash-all.sh*
-rwxr-xr-x@ 1 huluobo  staff   1.0K  8 14  2025 flash-base.sh*
-rw-r--r--@ 1 huluobo  staff   9.0G  8 14  2025 image-frankel-bd1a.250702.001.zip
-rw-r--r--@ 1 huluobo  staff   1.0M  8 14  2025 proto11.ec.bin
-rw-r--r--@ 1 huluobo  staff   175M  8 14  2025 radio-frankel-g5400i-250625-250626-b-13698361.img

这里的image-frankel-bd1a.250702.001.zip就是我们需要的镜像文件了😍

提取 init_boot.img:

Bash
1
unzip -o image-frankel-bd1a.250702.001.zip init_boot.img

然后复制到你的 root 工作目录顶层:

Bash
1
cp -f init_boot.img ~/android/pixel10-root/init_boot.img

检查:

Bash
1
2
3
4
5
 ls -lh init_boot.img
-rw-r--r--@ 1 huluobo  staff   8.0M  5 13 23:59 init_boot.img

❯ file init_boot.img
init_boot.img: Android bootimg

Step 6: 把 init_boot.img 传到 Pixel

(1) 检验连接情况:

Bash
1
2
cd ~/android/pixel10-root
adb devices -l

理想情况输出是:

Bash
1
2
3
 adb devices -l
List of devices attached
55201FDCR000G9         device usb:1-1 product:frankel model:Pixel_10 device:frankel transport_id:2

(2) 传递至手机:

Bash
1
adb push init_boot.img /sdcard/Download/init_boot.img

确认手机里确实有这个文件:

Bash
1
adb shell ls -lh /sdcard/Download/init_boot.img

理想输出:

Bash
1
2
3
4
5
 adb push init_boot.img /sdcard/Download/init_boot.img
init_boot.img: 1 file pushed, 0 skipped. 144.4 MB/s (8388608 bytes in 0.055s) adb shell ls -lh /sdcard/Download/init_boot.img
-rw-rw---- 1 u0_a291 media_rw 8.0M 2026-05-13 23:59 /sdcard/Download/init_boot.img

Step 7: 手机上用 Magisk patch init_boot.img

(1) mac下载magisk, 传给手机

来到 github-magisk

alt text

选择 Magisk-vxxx.apk, 比如笔者下载的就是 Magisk-v30.7.apk

笔者选择把它放进了 ~/android/pixel10-root

传给手机:

Bash
1
adb install -r Magisk-v30.7.apk

显示这样, 就成功了:

Bash
1
2
3
 adb install -r Magisk-v30.7.apk
Performing Streamed Install
Success

(2) 用 Magisk 来 patch init_boot.img

点击: Magisk > Install > Select and Patch a File

文件选择器打开后, 进入 Download, 选择 init_boot.img, 然后点击 "Let's Go"

安装完应该显示这样:

alt text

再次用电脑验证一下:

Bash
1
2
3
4
 adb shell ls -lh /sdcard/Download/
total 16K
-rw-rw---- 1 u0_a291 media_rw 8.0M 2026-05-13 23:59 init_boot.img
-rwxrwx--- 1 u0_a291 media_rw 8.0M 2026-05-14 00:40 magisk_patched-30700_sV4VQ.img

看见 magisk_patched-30700_sV4VQ.img, 大功告成! 🤩

(3) 回传电脑端, 给文件改名

Bash
1
2
3
4
cd ~/android/pixel10-root
adb pull /sdcard/Download/magisk_patched-30700_sV4VQ.img ./magisk_patched.img
ls -lh magisk_patched.img
file magisk_patched.img

正确情况, 输出类似:

Bash
1
2
3
4
5
6
7
8
 adb pull /sdcard/Download/magisk_patched-30700_sV4VQ.img ./magisk_patched.img
/sdcard/Download/magisk_patched-30700_sV4VQ.img: 1 file pulled, 0 skipped. 36.7 MB/s (8388608 bytes in 0.218s) ls -lh magisk_patched.img
-rw-r--r--@ 1 huluobo  staff   8.0M  5 14 00:46 magisk_patched.img

❯ file magisk_patched.img
magisk_patched.img: Android bootimg

Step 8: 进入 bootloader 并检查解锁状态

Bash
1
2
cd ~/android/pixel10-root
./platform-tools/adb reboot bootloader

手机会进入 bootloader / fastboot 页面:

alt text

现在在电脑端进行"reboot"前置检查:

Bash
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
 ./platform-tools/fastboot devices
55201FDCR000G9   fastboot

❯ ./platform-tools/fastboot getvar unlocked
unlocked: no
Finished. Total time: 0.043s

❯ ./platform-tools/fastboot flashing get_unlock_ability
(bootloader) get_unlock_ability: 1
OKAY [  0.038s]
Finished. Total time: 0.038s

Step 9: 正式解锁 bootloader

(1) 解锁

Bash
1
2
cd ~/android/pixel10-root
./platform-tools/fastboot flashing unlock

手机会出现一个警告页面:

alt text

用 "音量键" 切换到: Unlock the bootloader

然后按 "Power 电源键" 确认

(2) 等待 wipe 完成

手机会清空数据。过程可能持续几十秒到几分钟。

完成后可能出现两种情况:

  1. 手机回到 bootloader 页面
    • 这是最方便的情况
    • Mac 上执行: ./platform-tools/fastboot getvar unlocked
    • 应该看到: unlocked: yes
    • 现在显示 unlocked: alt text
  2. 手机自动重启进系统初始化界面
    • 我没遇到, 我是上面的情况. 遇到问ai吧...

Step 10: 刷入 Magisk patched init_boot

确认材料都全, 随后真正刷入命令:

Bash
1
2
3
4
cd ~/android/pixel10-root
ls -lh init_boot.img magisk_patched.img
./platform-tools/fastboot devices
./platform-tools/fastboot flash init_boot magisk_patched.img

正常输出应显示:

Bash
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
 ls -lh init_boot.img magisk_patched.img
-rw-r--r--@ 1 huluobo  staff   8.0M  5 13 23:59 init_boot.img
-rw-r--r--@ 1 huluobo  staff   8.0M  5 14 00:46 magisk_patched.img

❯ ./platform-tools/fastboot devices
55201FDCR000G9   fastboot

❯ ./platform-tools/fastboot flash init_boot magisk_patched.img
Sending 'init_boot_b' (8192 KB)                    OKAY [  0.191s]
Writing 'init_boot_b'                              OKAY [  0.045s]
Finished. Total time: 0.239s

现在执行, 手机会重启. 开机时会出现橙色 bootloader unlocked 警告, 很正常, 等几秒后会继续进入系统:

Bash
1
./platform-tools/fastboot reboot

alt text

Step 11: 重新配置新机, 梦回 Step 2

回到step 2, 一切重新开始, 这一部分走完就成为 root 用户了:

alt text

语言换成英文

alt text

不重要, skip:

alt text

选择我们的 "VPN Netbridge by MAC", 即: pixeltest

alt text

几步曲:

  1. 输入密码
  2. 点击 Advanced Option
    • Proxy: Manual
    • Proxy Hostname: 192.168.2.1 (review Step 1 中 ifconfig bridge100)
    • Proxy Port: 7897 (review Clash Verge 的 port 显示)
    • IP Settings: DHCP

alt text

alt text

alt text


后面的就是按顺序了, 看个人需求, 反正笔者是大多数 skip / No thanks

alt text

alt text

alt text

注意, 国内的sim和esim后面再展开. 因此这里skip:

alt text

时区很重要:

alt text

alt text

alt text

进入主页面:

alt text

Step 12: 重新 developer + usb, 梦回 Step 3 + 4

跟之前一样, 进入 developer option

Bash
1
2
3
4
Settings
→ About phone
→ Build number 连点 7 次
→ 输入锁屏密码

跟之前一样, 打开 usb debugging

Bash
1
2
3
4
Settings
→ System
→ Developer options
→ USB debugging:ON

检验连接情况:

Bash
1
2
cd ~/android/pixel10-root
adb devices -l

形如这样就ok:

Bash
1
2
3
 adb devices -l
List of devices attached
55201FDCR000G9         device usb:1-1 product:frankel model:Pixel_10 device:frankel transport_id:2

Step 13: 重新安装 Magisk App

因为reboot会导致原数据被清空, 因此现在手机里的 Magisk App 已经没了

继续像 Step 7 中 adb install 一样:

Bash
1
2
3
4
5
6
7
 ls
Magisk-v30.7.apk                              frankel-bd1a.250702.001-factory-1a0ca670.zip  init_boot.img                                 platform-tools/
factory/                                      frankel-ota-bd1a.250702.001-82bd95c6.zip      magisk_patched.img                            platform-tools-latest-darwin.zip

❯ adb install -r Magisk-v30.7.apk
Performing Streamed Install
Success

现在打开 Magisk 完成设置:

此时它应该能检测到你已经刷入的 patched init_boot

应该会弹出 Additional setup required 或者类似提示

点"确认", 让它完成设置. 手机会根据指示自动重启一次

Step 14: 验证 root

在电脑端:

Bash
1
adb shell

手机打开magisk, 弹窗点"确认".

此时电脑上:

Text Only
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
❯ adb shell
13|frankel:/ $ su
frankel:/ # whoami
root
frankel:/ # pwd
/
frankel:/ # id
uid=0(root) gid=0(root) groups=0(root) context=u:r:magisk:s0
frankel:/ # su -c id
uid=0(root) gid=0(root) groups=0(root) context=u:r:magisk:s0

恭喜你,大功告成! root成功!!! 🎆🎆🎆🐛🐛🐛😍😍😍🚀🚀🚀

Step 15: 备份与复盘

当我们进行了一系列操作时, 我们操作了什么?

(1) 备份很重要:

Bash
1
2
3
4
5
cd ~/android/pixel10-root

mkdir -p backup-BD1A.250702.001-root
cp init_boot.img magisk_patched.img frankel-bd1a.250702.001-factory-1a0ca670.zip backup-BD1A.250702.001-root/
shasum -a 256 init_boot.img magisk_patched.img | tee backup-BD1A.250702.001-root/hash.txt

然后重启验证:

Bash
1
2
adb reboot
adb shell su -c id

(2) 千万别乱动:

[1] 不要重新锁 bootloader

现在不要执行: fastboot flashing lock

因为我们现在的 init_boot 已经被 Magisk patch

如果在非完全原厂状态下重新锁 bootloader,可能直接无法启动

设备现在的长期状态应该是: bootloader unlocked + Magisk root

开机出现 unlocked warning 是正常现象

[2] Magisk 是什么? 作用是? 背后原理是?

Android 系统有很多目录, 例如:

Bash
1
2
3
4
/system
/vendor
/product
/system_ext

传统改机以前会直接改这些系统分区. 缺点是:

  • 容易改坏系统
  • OTA 更新麻烦
  • 恢复麻烦
  • 安全性差

Magisk 的思路是 systemless modification:

不真正改系统分区. 而是在开机时通过 Magisk 把某些文件、脚本、配置“挂载/注入”进去. 让系统看起来像被改过

所以 Magisk 模块本质上是一包文件和脚本,通常包括:

Bash
1
2
3
4
system/                 # 要“虚拟覆盖”到系统里的文件
post-fs-data.sh          # 开机早期执行脚本
service.sh               # 系统启动后执行的后台脚本
module.prop              # 模块信息
人话理解
  • root 像 sudo
  • Magisk 模块像开机自动加载的系统插件

Magisk 模块适合做: 每次开机都自动生效的系统级修改

有点像 linux 里的 systemd service. 每次开机运行指定脚本

[3] 我们这次是如何获得 root 权限的?

这次不是通过漏洞提权,而是通过解锁 bootloader 后,主动刷入被 Magisk 修改过的 init_boot 镜像来获得 root

workflow:

Bash
1
2
3
4
5
6
7
8
官方 init_boot.img
→ Magisk patch init_boot.img
→ 得到 magisk_patched.img
→ 解锁 bootloader
→ fastboot flash init_boot magisk_patched.img
→ 开机时 Magisk 被提前加载
→ Magisk 提供 su / magiskd
→ 用户执行 su 后获得 uid=0
  1. bootloader 解锁本身不等于 root
    • fastboot flashing unlock 做的事情是, 允许设备启动非完全官方签名状态的镜像
    • 也就是说, 允许启动用户刷入的修改镜像
  2. init_boot.img 何意味
    • Pixel 10 这种新 Android 设备, root 重点通常不在传统的 boot.img
    • 而在init_boot.img, 它里面包含启动早期用到的 ramdisk/init 相关内容
  3. Magisk patch 做了什么:
    • 它把原厂 init_boot.img 内置的workflow改成:
      • 原厂 init_boot.img
      • Magisk 启动
      • Magisk su 支持
      • Magisk daemon 启动逻辑
      • systemless mount 支持
    • 开机时, 系统不是单纯按原厂 init 流程走, 而是 Magisk 会先介入. 相当于 hijack
    • 回忆我们之前的
      • frankel:/ # id
      • uid=0(root) gid=0(root) groups=0(root) context=u:r:magisk:s0
      • root说明, 拿到了 Linux/Android 内核意义上的 root 用户
      • context=u:r:magisk:s0 说明这个 root shell 是通过 Magisk 的上下文跑起来的, 不是普通系统进程自然拥有的 root
  4. su 是怎么生效的?
    • Android 原厂系统里普通用户不能直接执行 su
    • Magisk 刷入后, 会在系统启动时准备好自己的 root 管理环境
      • 现在执行su, Magisk 会接管这个请求,并通过 Magisk App 的授权策略决定 OK or Permission denied

What's Next:

  1. 配置 VPN
  2. 安装 Termux

将手机变成开发者友好的"linux"!

见下一篇文章: 《程序员为什么需要Pixel》