利用 Magisk 模块永久修改 ro.debuggable & 获取 adb root

前言

搞了好久的 boot.img 解包修改 ro.debuggable 再重打包,失败了 N 次,最后终于成功修改了配置,也刷 boot.img 成功了,结果开机后 ro.debuggable 的值还是 0 。
随后又把刷入的 boot.img 提取了出来,解包验证,发现 prop.default 里的配置 ro.debuggable 确实已经是 1 了,可以手机启动后,不知道为什么(ps: pixel 2 , android 8.1.0),有明白的大侠烦请留言赐教。

方便的解决方案

  • 注:需要翻墙

后来偶然间发现有人提到了用 magisk 模块插件还解决这个问题,并且重启后仍然有效!实测确实可以,非常方便,真是泪目……
1. 用 magisk root 手机后,打开 magisk app , 选择【模块】,搜索MagiskHide Props Config 安装此模块。
2. 重启后,进入 adb shell
3. 执行 props,如果没有安装 busybox 会提示让安装
4. 环境安装好后再次执行 props
5. 选择需要操作的选项即可,非常方便

walleye:/ # props

Loading... Please wait.


MagiskHide Props Config v5.2.4
by Didgeridoohan @ XDA Developers

=====================================
 Updating fingerprints list
=====================================

Checking connection.
No connection.

MagiskHide Props Config v5.2.4
by Didgeridoohan @ XDA Developers

=====================================
 Select an option below.
=====================================

1 - Edit device fingerprint
2 - Device simulation (disabled)
3 - Edit MagiskHide props
4 - Add/edit custom props
5 - Delete prop values
6 - Script settings
7 - Collect logs
r - Reset all options/settings
b - Reboot device
e - Exit

See the module readme or the
support thread @ XDA for details.

Enter your desired option: 3

MagiskHide Props Config v5.2.4
by Didgeridoohan @ XDA Developers

=====================================
 MagiskHide props
 Select an option below:
=====================================

Change the sensitive props set by MagiskHide.

1 - ro.debuggable
2 - ro.secure
3 - ro.build.type
4 - ro.build.tags
5 - ro.build.selinux
a - Change all props
b - Go back to main menu
e - Exit

Pick several options at once by
separating inputs with a comma.
Example: 1,5,6

See the module readme or the
support thread @ XDA for details.

Enter your desired option: 1

MagiskHide Props Config v5.2.4
by Didgeridoohan @ XDA Developers

=====================================
 ro.debuggable
=====================================

Currently set to 0.

You currently have the safe value set.
Are you sure you want to change it to 1?

Enter y(es), n(o) or e(xit): y
Working. Please wait...

MagiskHide Props Config v5.2.4
by Didgeridoohan @ XDA Developers

=====================================
 Reboot - ro.debuggable
=====================================

Reboot for changes to take effect.

Do you want to reboot now (y/n)?

Enter y(es), n(o) or e(xit): y

根据提示操作即可。

adb root

  1. 按上面的操作让

ro.debuggable=1
ro.secure=0

  1. 安装 adbd-Insecure-v2.00 并启动

  2. 之后,再执行 adb root 就可以啦!

发表评论