0

i need to give super user permission to the user to write(echo) into a particular file, but when I try the following its still showing permission is denied.

any leads will be helpful.

import subprocess
import os, sys

def main():

    subprocess.run("adb shell cat /sy/bu/mm_subsys/devices/subsy/name", shell= False)
    subprocess.run(['adb shell', 'sudo'], shell =False)
    subprocess.run('adb shell "echo related > /ss/bu/mm_subsys/devices/subsy/rest_level"\n', shell= False)



if __name__ == "__main__":
    main()           
flakes
  • 21,558
  • 8
  • 41
  • 88
john
  • 1
  • 3
  • Potentially https://stackoverflow.com/questions/7399028/android-adb-permission-denied – flakes Feb 25 '20 at 01:39
  • 1
    The redirection has to be done in the subshell created by `sudo`, not in the original shell. – Barmar Feb 25 '20 at 01:44
  • See https://stackoverflow.com/questions/82256/how-do-i-use-sudo-to-redirect-output-to-a-location-i-dont-have-permission-to-wr/82278#82278 – Barmar Feb 25 '20 at 01:44
  • got it worked, Thanks. adb root is what needed – john Feb 26 '20 at 19:20

0 Answers0