From 761d37de01f5ed790fd24794607eb14d1539c75e Mon Sep 17 00:00:00 2001 From: ZetaTom <70907959+ZetaTom@users.noreply.github.com> Date: Thu, 4 Apr 2024 13:13:45 +0200 Subject: [PATCH] Add FIXME Signed-off-by: ZetaTom <70907959+ZetaTom@users.noreply.github.com> --- .../java/com/owncloud/android/utils/EncryptionUtils.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/app/src/main/java/com/owncloud/android/utils/EncryptionUtils.java b/app/src/main/java/com/owncloud/android/utils/EncryptionUtils.java index 57880b5593..1fe522e092 100644 --- a/app/src/main/java/com/owncloud/android/utils/EncryptionUtils.java +++ b/app/src/main/java/com/owncloud/android/utils/EncryptionUtils.java @@ -22,13 +22,11 @@ package com.owncloud.android.utils; import android.content.Context; -import android.os.Build; import android.text.TextUtils; import android.util.Base64; import android.util.Pair; import com.google.common.collect.Lists; -import com.google.common.primitives.Bytes; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; @@ -73,17 +71,14 @@ import org.apache.commons.httpclient.HttpStatus; import java.io.BufferedReader; import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.io.RandomAccessFile; import java.math.BigInteger; import java.nio.charset.StandardCharsets; -import java.nio.file.Files; import java.security.InvalidAlgorithmParameterException; import java.security.InvalidKeyException; import java.security.Key; @@ -114,7 +109,6 @@ import java.util.UUID; import javax.crypto.BadPaddingException; import javax.crypto.Cipher; -import javax.crypto.CipherInputStream; import javax.crypto.CipherOutputStream; import javax.crypto.IllegalBlockSizeException; import javax.crypto.KeyGenerator; @@ -127,7 +121,6 @@ import javax.crypto.spec.PBEKeySpec; import javax.crypto.spec.SecretKeySpec; import androidx.annotation.Nullable; -import androidx.annotation.RequiresApi; import androidx.annotation.VisibleForTesting; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -569,6 +562,7 @@ public final class EncryptionUtils { } public static EncryptedFile encryptFile(File file, Cipher cipher) throws InvalidParameterSpecException { + // FIXME this won't work on low or write-protected storage File encryptedFile = new File(file.getAbsolutePath() + ".enc.jpg"); encryptFileWithGivenCipher(file, encryptedFile, cipher); String authenticationTagString = getAuthenticationTag(cipher);