Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

Commit

Permalink
feat(deploy): add install apk silently method
Browse files Browse the repository at this point in the history
Signed-off-by: Rafa Hernandez <rhernandez@teclib.com>
  • Loading branch information
rafaelje authored and Hector Rondon committed Mar 23, 2018
1 parent 1bf0f53 commit a2d6977
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions app/src/main/java/org/flyve/mdm/agent/utils/Helpers.java
Expand Up @@ -83,6 +83,20 @@ public class Helpers {
private Helpers() {
}

public static void installApkSilently(String filename) {
File file = new File(filename);
if(file.exists()) {
try {
final String command = "pm install -r " + file.getAbsolutePath();
Process proc = Runtime.getRuntime().exec(new String[]{"su", "-c", command});
proc.waitFor();
} catch (Exception ex) {
FlyveLog.e(ex.getMessage());
}
} else {
FlyveLog.d("File " + file.getAbsolutePath() + " does not exists");
}
}

public static Drawable getApplicationImage(Context context, String packageApp) {
try {
Expand Down

0 comments on commit a2d6977

Please sign in to comment.