thanhloc92 / android-event-injector

Automatically exported from code.google.com/p/android-event-injector
0 stars 0 forks source link

STDerror is not correct give #1

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
When testing this code on a panda device, i get broken pipe errors, while in 
fact i should see this error

/system/bin/id output: su: uid 10048 not allowed to su

The problem is that the sinkProcessOutput is started too late.

change in file shell.java
  private static String _runCommand(String command, OUTPUT o) throws IOException {
    DataOutputStream os = null;
    Process process = null;
    try {
      process = Runtime.getRuntime().exec(shell);
++      InputStreamHandler sh = sinkProcessOutput(process, o);
      os = new DataOutputStream(process.getOutputStream());
--      InputStreamHandler sh = sinkProcessOutput(process, o);
      os.writeBytes(command + '\n');
....

Like this you see the first stderr output

Kind regards,

Wim

Original issue reported on code.google.com by wimvanlo...@gmail.com on 3 Oct 2013 at 11:34