title: Accessing another app's database in android with su?
body: <p>I've read other questions regarding this and none of them answers this, so please do not mark this as duplicate.</p>
  
  <p>Right now I'm using following code to access the database of other application.</p>
  
  <pre><code>    Process process = null;
      Runtime runtime = Runtime.getRuntime();
      OutputStreamWriter outputStreamWriter;
  
      try {
          String command = dbName + " " + "'" + query + "'" + ";";
          process = runtime.exec("su");
  
          outputStreamWriter = new OutputStreamWriter(process.getOutputStream());
  
          outputStreamWriter.write("sqlite3 " + command);
  
          outputStreamWriter.flush();
          outputStreamWriter.close();
          outputStreamWriter.close();
  
      } catch (IOException e) {
          e.printStackTrace();
      }
  </code></pre>
  
  <p>then using BufferedReader I can read the output line by line. The problem with this approach is I cannot read complex data types such as BLOB. </p>
  
  <p>So my question is How can I read such complex data types from another apps database with root.
  One option can be to copy the sqlite database to sdcard, read data from it and move it back but it involves unnecessary copying of database. Is there any better way other than this.
  Thanks.</p>