From dda3ea15b7f66753992d0eef0640e373da0816d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Mon, 5 Oct 2015 13:45:45 +0200 Subject: [PATCH] Privileged Extension: Remove install/unistall commands, not needed and can cause problems --- .../privileged/install/InstallExtension.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/F-Droid/src/org/fdroid/fdroid/privileged/install/InstallExtension.java b/F-Droid/src/org/fdroid/fdroid/privileged/install/InstallExtension.java index b535607ae..6aaf780db 100644 --- a/F-Droid/src/org/fdroid/fdroid/privileged/install/InstallExtension.java +++ b/F-Droid/src/org/fdroid/fdroid/privileged/install/InstallExtension.java @@ -85,13 +85,11 @@ abstract class InstallExtension { private List getInstallCommands(String apkPath) { final List commands = new ArrayList<>(); - commands.add("mount -o rw,remount /system"); + commands.add("mount -o rw,remount /system"); // remount as read-write commands.addAll(getCopyToSystemCommands(apkPath)); - commands.add("pm uninstall " + PrivilegedInstaller.PRIVILEGED_EXTENSION_PACKAGE_NAME); commands.add("mv " + getInstallPath() + ".tmp " + getInstallPath()); - commands.add("pm install -r " + getInstallPath()); commands.add("sleep 5"); // wait until the app is really installed - commands.add("mount -o ro,remount /system"); + commands.add("mount -o ro,remount /system"); // remount as read-only commands.add("am force-stop " + PrivilegedInstaller.PRIVILEGED_EXTENSION_PACKAGE_NAME); commands.addAll(getPostInstallCommands()); return commands; @@ -116,7 +114,6 @@ abstract class InstallExtension { commands.add("am force-stop " + PrivilegedInstaller.PRIVILEGED_EXTENSION_PACKAGE_NAME); commands.add("pm clear " + PrivilegedInstaller.PRIVILEGED_EXTENSION_PACKAGE_NAME); commands.add("mount -o rw,remount /system"); - commands.add("pm uninstall " + PrivilegedInstaller.PRIVILEGED_EXTENSION_PACKAGE_NAME); commands.addAll(getCleanUninstallCommands()); commands.add("sleep 5"); commands.add("mount -o ro,remount /system"); @@ -201,7 +198,7 @@ abstract class InstallExtension { */ @Override protected List getCopyToSystemCommands(String apkPath) { - List commands = new ArrayList<>(3); + List commands = new ArrayList<>(4); commands.add("mkdir -p " + getSystemFolder()); // create app directory if not existing commands.add("chmod 755 " + getSystemFolder()); commands.add("cat " + apkPath + " > " + getInstallPath() + ".tmp"); @@ -229,10 +226,8 @@ abstract class InstallExtension { @Override protected List getCleanUninstallCommands() { - final List commands = new ArrayList<>(3); - commands.add("rm -f " + getInstallPath()); - commands.add("sleep 1"); - commands.add("rm -f " + getSystemFolder()); + final List commands = new ArrayList<>(1); + commands.add("rm -rf " + getSystemFolder()); return commands; }