title: Install Android APK without prompt
body: <p>We are writing an Android app that shows ads on large screens.
  We have a backend where advertisers can select the ads, so they are updated almost instantly.
  Because there will be a lot of Android boxes running (plugged into HDMI screens), we should be able to update our software remotely.</p>
  
  <p><strong>This is the case:</strong></p>
  
  <p>Main app is running continuously (unless turned off) and the users never see anything Android related.
  We need an updater app that listens for updates and deletes the main apk, installs a new apk.
  While updating we will show an activity with "Updating, please wait", until the new main apk is installed and showing.</p>
  
  <p><strong>What we need:</strong></p>
  
  <p>We need help on how to implement the update mechanism without prompting the user on ROOTED DEVICE.</p>
  
  <p><strong>What we have:</strong></p>
  
  <p>The updater app is hooked into the boot received event, where a service starts (this service will listen for updates, which will be implemented by a colleague soon).
  The service can start an activity which will prompt the update info while updating.</p>
  
  <p><strong>In the updater activity</strong></p>
  
  <pre><code> try {
              Process proc = Runtime.getRuntime().exec(new String[]{"su", "pm install -r /mnt/sdcard/MYFOLDER/testAPK.apk"});
              stringBuilder.append(String.valueOf(proc.waitFor()));
              stringBuilder.append("\n");
          } catch (Exception e) {
              if (e instanceof IOException) {
                  Log.d(TAG, "IOException");
              } else if (e instanceof InterruptedException) {
                  Log.d(TAG, "InterruptedException");
              } else {
                  e.printStackTrace();
              }
          }
  </code></pre>
  
  <p>The StringBuilder prints 11, but does the same if I give random unexisting command..</p>
  
  <p><strong>In the Manifest</strong></p>
  
  <pre><code>&lt;!-- Permission to start UpdaterService on boot --&gt;
  &lt;uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /&gt;
  
  &lt;!-- Install/delete permissions, only granted to system apps --&gt;
  &lt;uses-permission android:name="android.permission.INSTALL_PACKAGES" /&gt;
  &lt;uses-permission android:name="android.permission.DELETE_PACKAGES" /&gt;
  
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  </code></pre>
  
  <p>The Install packages and delete packages are useless if I don't install my app as system app, am I correct?</p>
  
  <p>Long story short, no installation of my test APK, and I have no idea how to solve this.
  Any help would be appreciated! </p>