Clear out checks for SDK < 23 as they're no longer relevant.

This commit is contained in:
Alex Hart
2025-10-31 12:50:47 -03:00
committed by Michelle Tang
parent ab9c8626c0
commit 1d7ae669b6
57 changed files with 137 additions and 387 deletions

View File

@@ -1,7 +1,6 @@
package org.thoughtcrime.securesms.backup;
import android.content.Context;
import android.os.Build;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -24,8 +23,8 @@ public final class BackupPassphrase {
String passphrase = TextSecurePreferences.getBackupPassphrase(context);
String encryptedPassphrase = TextSecurePreferences.getEncryptedBackupPassphrase(context);
if (Build.VERSION.SDK_INT < 23 || (passphrase == null && encryptedPassphrase == null)) {
return stripSpaces(passphrase);
if (passphrase == null && encryptedPassphrase == null) {
return null;
}
if (encryptedPassphrase == null) {
@@ -40,8 +39,8 @@ public final class BackupPassphrase {
}
public static void set(@NonNull Context context, @Nullable String passphrase) {
if (passphrase == null || Build.VERSION.SDK_INT < 23) {
TextSecurePreferences.setBackupPassphrase(context, passphrase);
if (passphrase == null) {
TextSecurePreferences.setBackupPassphrase(context, null);
TextSecurePreferences.setEncryptedBackupPassphrase(context, null);
} else {
KeyStoreHelper.SealedData encryptedPassphrase = KeyStoreHelper.seal(passphrase.getBytes());