How to use su command over adb shell?

前端 未结 6 1933
悲&欢浪女
悲&欢浪女 2020-12-14 17:44

I need to make a script that executes a lots of thing on Android device, my device is rooted, when I enter on the shell, I can give the command su, and it works but I need p

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-14 18:34

    for my use case, i wanted to grab the SHA1 hash from the magisk config file. the below worked for me.

    adb shell "su -c "cat /sbin/.magisk/config | grep SHA | awk -F= '{ print $2 }'""
    

提交回复
热议问题