o0DoO0o
V2EX  ›  Android

如何确定自己的安卓机有没有 root?

  •  
  •   o0DoO0o · May 19, 2024 · 9939 views
    This topic created in 752 days ago, the information mentioned may be changed or developed.

    已经解了 bl 锁。 我刷了 magisk ,也 fastboot boot magisk_boot.img 重刷了 boot.img ,能够在 magisk 上管理 root 权限

    >adb shell
    wayne:/ $ id
    uid=2000(shell) gid=2000(shell) groups=2000(shell),1004(input),1007(log),1011(adb),1015(sdcard_rw),1028(sdcard_r),1078(ext_data_rw),1079(ext_obb_rw),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats),3009(readproc),3011(uhid),3012(readtracefs) context=u:r:shell:s0
    wayne:/ $ su   # 这一步会在手机上提示是否允许 root
    wayne:/ # id    # 如果我的理解没问题,我可以切换到 root 用户,说明我应该有 root 权限
    uid=0(root) gid=0(root) groups=0(root) context=u:r:magisk:s0
    

    但是我始终无法把根目录挂载成 rw

    wayne:/ # mount | grep "/ "
    /dev/block/dm-0 on / type erofs (ro,seclabel,relatime,user_xattr,acl,cache_strategy=readaround)
    wayne:/ #
    wayne:/ # mount -o rw,remount,rw /
    wayne:/ # mount | grep "/ "
    /dev/block/dm-0 on / type erofs (ro,seclabel,relatime,user_xattr,acl,cache_strategy=readaround)
    wayne:/ #
    

    用 MT 文件管理器(打开时会提示 root ),在根目录上创建一个文件夹,也提示挂载读写失败 似乎我的 root 是个假 root

    6 replies    2024-05-23 22:13:15 +08:00
    ysc3839
        1
    ysc3839  
       May 19, 2024   ❤️ 2
    root 仅代表能得到 UID=0 的权限,不代表分区可写。EROFS 更是不支持写入,要修改只能重新生成镜像整个替换。
    sir283
        2
    sir283  
       May 19, 2024
    出厂安卓 10 以上,分区全部都是 read-only 了,要读写,只能刷 overlay 模块或者重新打包为 ext2/4 分区格式,并增加 rw 权限刷入。
    saucer
        3
    saucer  
       May 19, 2024
    tmpfs 挂载
    12101111
        4
    12101111  
       May 20, 2024
    erofs 本身就是只读 fs ,不可能挂载成读写的。
    magisk 模块就是用来改 rootfs 的,原理是 overlayfs 。
    rev1si0n
        5
    rev1si0n  
       May 23, 2024   ❤️ 1
    正常安卓设备的根系统目录是无法设置读写的,你只能改写下面的 vendor etc system 目录,我不知道你想干啥,一般做这个都是装证书,如果你只是想装证书,不妨看看 https://github.com/rev1si0n/lamda
    o0DoO0o
        6
    o0DoO0o  
    OP
       May 23, 2024
    @rev1si0n 就是想装证书😞
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1375 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 45ms · UTC 17:10 · PVG 01:10 · LAX 10:10 · JFK 13:10
    ♥ Do have faith in what you're doing.