mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-26 12:44:38 +00:00
Remove use of PNI Credential.
This commit is contained in:
@@ -6,7 +6,6 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import org.signal.core.util.logging.Log;
|
||||
import org.signal.libsignal.zkgroup.profiles.PniCredential;
|
||||
import org.signal.libsignal.zkgroup.profiles.ProfileKey;
|
||||
import org.signal.libsignal.zkgroup.profiles.ProfileKeyCredential;
|
||||
import org.thoughtcrime.securesms.badges.BadgeRepository;
|
||||
@@ -34,7 +33,6 @@ import org.whispersystems.signalservice.api.profiles.SignalServiceProfile;
|
||||
import org.whispersystems.signalservice.api.push.exceptions.PushNetworkException;
|
||||
import org.whispersystems.signalservice.api.subscriptions.ActiveSubscription;
|
||||
import org.whispersystems.signalservice.internal.ServiceResponse;
|
||||
import org.whispersystems.signalservice.internal.ServiceResponseProcessor;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Comparator;
|
||||
@@ -136,17 +134,6 @@ public class RefreshOwnProfileJob extends BaseJob {
|
||||
if (profileKeyCredential.isPresent()) {
|
||||
setProfileKeyCredential(self, ProfileKeyUtil.getSelfProfileKey(), profileKeyCredential.get());
|
||||
}
|
||||
|
||||
if (SignalStore.account().getAci() != null) {
|
||||
PniCredential pniCredential = ApplicationDependencies.getProfileService()
|
||||
.getPniProfileCredential(SignalStore.account().requireAci(),
|
||||
SignalStore.account().requirePni(),
|
||||
ProfileKeyUtil.getSelfProfileKey())
|
||||
.map(ServiceResponseProcessor.DefaultProcessor::new)
|
||||
.blockingGet()
|
||||
.getResultOrThrow();
|
||||
SignalStore.account().setPniCredential(pniCredential);
|
||||
}
|
||||
}
|
||||
|
||||
private void setProfileKeyCredential(@NonNull Recipient recipient,
|
||||
|
||||
@@ -9,7 +9,6 @@ import org.signal.libsignal.protocol.IdentityKey
|
||||
import org.signal.libsignal.protocol.IdentityKeyPair
|
||||
import org.signal.libsignal.protocol.ecc.Curve
|
||||
import org.signal.libsignal.protocol.util.Medium
|
||||
import org.signal.libsignal.zkgroup.profiles.PniCredential
|
||||
import org.thoughtcrime.securesms.crypto.IdentityKeyUtil
|
||||
import org.thoughtcrime.securesms.crypto.MasterCipher
|
||||
import org.thoughtcrime.securesms.crypto.ProfileKeyUtil
|
||||
@@ -54,7 +53,6 @@ internal class AccountValues internal constructor(store: KeyValueStore) : Signal
|
||||
private const val KEY_PNI_ACTIVE_SIGNED_PREKEY_ID = "account.pni_active_signed_prekey_id"
|
||||
private const val KEY_PNI_SIGNED_PREKEY_FAILURE_COUNT = "account.pni_signed_prekey_failure_count"
|
||||
private const val KEY_PNI_NEXT_ONE_TIME_PREKEY_ID = "account.pni_next_one_time_prekey_id"
|
||||
private const val KEY_PNI_CREDENTIAL = "account.pni_credential"
|
||||
|
||||
@VisibleForTesting
|
||||
const val KEY_E164 = "account.e164"
|
||||
@@ -307,10 +305,6 @@ internal class AccountValues internal constructor(store: KeyValueStore) : Signal
|
||||
val isLinkedDevice: Boolean
|
||||
get() = !isPrimaryDevice
|
||||
|
||||
var pniCredential: PniCredential?
|
||||
set(value) = putBlob(KEY_PNI_CREDENTIAL, value?.serialize())
|
||||
get() = getBlob(KEY_PNI_CREDENTIAL, null)?.let { PniCredential(it) }
|
||||
|
||||
private fun clearLocalCredentials(context: Context) {
|
||||
putString(KEY_SERVICE_PASSWORD, Util.getSecret(18))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user