title: How some apk are stored by Android
body: <p>I know that the apk are stored in /data/app with the name of the package (and "-1" at the end). </p>
  
  <p>On not-root phone is not possiple to list (ls) the file contained in /data/app, however since I knon the filename I can copy the apk from /data/app to /mnt/sdcard/whereeveriwant/, even without root permission. </p>
  
  <pre><code>public static void copyFile(String inputPath, String inputFile, String outputPath) {
  InputStream in = null;
  OutputStream out = null;
  try {
      //create output directory if it doesn't exist
      File dir = new File (outputPath); 
      if (!dir.exists()) { dir.mkdirs(); }
      in = new FileInputStream(inputPath + inputFile);        
      out = new FileOutputStream(outputPath + inputFile);
      byte[] buffer = new byte[1024];
      int read;
      while ((read = in.read(buffer)) != -1) {
          out.write(buffer, 0, read);
      }
      in.close();
      in = null;
      out.flush();
      out.close();
      out = null;        
  }  catch (FileNotFoundException fnfe1) {
      Log.e("copy", fnfe1.getMessage());
  } catch (Exception e) {
      Log.e("copy", e.getMessage());
  }
  }
  copyFile(
          "/data/app/", "com.myawesomeapp.android-1.apk",
          Environment.getExternalStorageDirectory() + File.separator + folder + File.separator
  );
  </code></pre>
  
  <p>However for some apps (not free app as far as I know) this method is not working. 
  Do the apk have a different name? Or it is forward locked? </p>
  
  <p>This is a research question, no practical use is intended. </p>