1

I am trying to copy files from /data/app folder, but facing the following issues, please advice.

Process suProcess = Runtime.getRuntime().exec("su");
DataOutputStream os = new     DataOutputStream(suProcess.getOutputStream);
  1. Error is, Required : android.os.Process, Found : java.lang.Process in the first line of the code.
  2. Cannot resolve symbol, getOutputStream in the second line.

Kindly let me know why these issues occur, and how do I resolve them. Thanks.

1 Answers1

0

android.os.Process, Found : java.lang.Process

Be sure to import the right class.

import java.lang.Process;

Or declare your process like this :

java.lang.Process suProcess = Runtime.getRuntime().exec("su"); 

Cannot resolve symbol, getOutputStream

getOutputStream is a method then you need to add () to be able to compile your code.

DataOutputStream os = new     DataOutputStream(suProcess.getOutputStream());
Guillaume Barré
  • 4,168
  • 2
  • 27
  • 50