From 106da8e7527ab72d4b6927b1923ff59d2ad32d27 Mon Sep 17 00:00:00 2001 From: NekoInverter <42698724+NekoInverter@users.noreply.github.com> Date: Sat, 4 Apr 2020 15:06:29 +0800 Subject: [PATCH] Remove slient install temp apk --- .../org/meowcat/edxposed/manager/util/InstallApkUtil.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/meowcat/edxposed/manager/util/InstallApkUtil.java b/app/src/main/java/org/meowcat/edxposed/manager/util/InstallApkUtil.java index aaca4477..c59b436e 100644 --- a/app/src/main/java/org/meowcat/edxposed/manager/util/InstallApkUtil.java +++ b/app/src/main/java/org/meowcat/edxposed/manager/util/InstallApkUtil.java @@ -51,8 +51,7 @@ public class InstallApkUtil extends AsyncTask { static void installApkNormally(Context context, String localFilename) { Intent installIntent = new Intent(Intent.ACTION_INSTALL_PACKAGE); installIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - Uri uri; - uri = FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID + ".fileprovider", new File(localFilename)); + Uri uri = FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID + ".fileprovider", new File(localFilename)); installIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); installIntent.setDataAndType(uri, DownloadsUtil.MIME_TYPE_APK); installIntent.putExtra(Intent.EXTRA_INSTALLER_PACKAGE_NAME, context.getApplicationInfo().packageName); @@ -82,8 +81,7 @@ public class InstallApkUtil extends AsyncTask { Shell.Result result = Shell.su("pm install -r -f \"" + path + fileName + "\"").exec(); returnCode = result.getCode(); output = result.getOut(); - //noinspection ResultOfMethodCallIgnored - new File(path + fileName).delete(); + Shell.su("rm -f " + path + fileName).exec(); } catch (IllegalStateException e) { returnCode = ERROR_ROOT_NOT_GRANTED; }