Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String line = null;
- Process process = Runtime.getRuntime().exec("su");
- DataOutputStream stdIn = new DataOutputStream(process.getOutputStream());
- DataInputStream stdErr = new DataInputStream(process.getErrorStream());
- DataInputStream stdOut = new DataInputStream(process.getInputStream());
- stdIn.writeBytes("grep TeleGuide < /cache/logger/AOL_main.ap.bin.old >> /sdcard/TeleGuide.log\n");
- stdIn.flush();
- while((line = stdOut.readLine()) != null)
- Log.d(TAG, ">> " + line);
- while((line = stdErr.readLine()) != null)
- Log.d(TAG, ">>> " + line);
- stdIn.writeBytes("exit\n");
- stdIn.flush();
- while((line = stdOut.readLine()) != null)
- Log.d(TAG, ">> " + line);
- while((line = stdErr.readLine()) != null)
- Log.d(TAG, ">>> " + line);
- process.destroy();
- stdIn.close();
- stdOut.close();
- stdErr.close();
- Log.d(TAG, "Successfully preserved last sessions logs!");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement