From 972ef3b0786a93c0a3d5734bde0c6116885f6d0a Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 13 Apr 2016 12:20:06 -0400 Subject: [PATCH] remove unused arg from FileCompat.setReadable() Just trying to keep the code as close to what is actually used as possible. --- .../org/fdroid/fdroid/compat/FileCompat.java | 17 +++++++++-------- .../org/fdroid/fdroid/installer/Installer.java | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/org/fdroid/fdroid/compat/FileCompat.java b/app/src/main/java/org/fdroid/fdroid/compat/FileCompat.java index 2dc047785..44c6ae8cb 100644 --- a/app/src/main/java/org/fdroid/fdroid/compat/FileCompat.java +++ b/app/src/main/java/org/fdroid/fdroid/compat/FileCompat.java @@ -85,20 +85,21 @@ public class FileCompat { } } + /** + * Set a {@link SanitizedFile} readable by all if {@code readable} is {@code true}. + * + * @return {@code true} if the operation succeeded + */ @TargetApi(9) - public static boolean setReadable(SanitizedFile file, boolean readable, boolean ownerOnly) { - + public static boolean setReadable(SanitizedFile file, boolean readable) { if (Build.VERSION.SDK_INT >= 9) { - return file.setReadable(readable, ownerOnly); + return file.setReadable(readable, false); } - String mode; if (readable) { - mode = ownerOnly ? "0600" : "0644"; + return setMode(file, "0644"); } else { - mode = "0000"; + return setMode(file, "0000"); } - return setMode(file, mode); - } private static boolean setMode(SanitizedFile file, String mode) { diff --git a/app/src/main/java/org/fdroid/fdroid/installer/Installer.java b/app/src/main/java/org/fdroid/fdroid/installer/Installer.java index cdbb39bc0..8a2e21ed6 100644 --- a/app/src/main/java/org/fdroid/fdroid/installer/Installer.java +++ b/app/src/main/java/org/fdroid/fdroid/installer/Installer.java @@ -222,7 +222,7 @@ public abstract class Installer { // have access is insecure, because apps with permission to write to the external // storage can overwrite the app between F-Droid asking for it to be installed and // the installer actually installing it. - FileCompat.setReadable(apkToInstall, true, false); + FileCompat.setReadable(apkToInstall, true); installPackageInternal(apkToInstall); NotificationManager nm = (NotificationManager)