remove unused arg from FileCompat.setReadable()
Just trying to keep the code as close to what is actually used as possible.
This commit is contained in:
		
							parent
							
								
									32fc118b3d
								
							
						
					
					
						commit
						972ef3b078
					
				@ -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) {
 | 
			
		||||
 | 
			
		||||
@ -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)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user