Write files to /system

前端 未结 4 1980
失恋的感觉
失恋的感觉 2020-12-17 06:04

I know this has been asked a lot but never answered. I definetly need to write files to root there is no other solution. I currently use this code but it doesn\'t show anyth

4条回答
  •  轮回少年
    2020-12-17 06:48

    Your

    Runtime.getRuntime().exec("su");
    

    does nothing. As the process is created and then released. To move files you will need to use the cat binary with su. IE

    Runtime.getRuntime().exec("su cat filepath1 > filepath2");
    

    for as many commands as you want to do it would be better to get the process instance of su and then execute all of your move commands at once.

    Also note that you may have to mount the system partition as rw as it is probably not r/w by default.

提交回复
热议问题