0

What I want:

I want my app to use su command to take screenshot in background even after I unroot the phone.

code example:

val process = Runtime.getRuntime().exec("su")
val outputStream = OutputStreamWriter(process.outputStream)
outputStream.write("/system/bin/screencap -p\n")

What I tried:

I thought I will just root my phone and install the app in priv-app folder and then unroot but it's not working like that.

How can I do this?

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
  • How will you make sure that your app is running in the background? The lifetime of an app after closing it is at-most 5secs, irrespective of the fact whether you use it in root or un-root mode. – Abhishek Dutt Sep 03 '22 at 04:14
  • if you talk about force stop then I didn't care about this. if not then I don't know what you are talking about. – AloneWalker Sep 03 '22 at 20:37

1 Answers1

-1

It's impossible to grant root access after unrooting. You can give fake root access in termux but it just shows #. So no use.

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103