mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-05-01 14:13:22 +01:00
Rewrite in-app-payment flows to prepare for backups support.
This commit is contained in:
committed by
Cody Henthorne
parent
b36b00a11c
commit
d719edf104
@@ -4,6 +4,7 @@ package org.whispersystems.signalservice.api.subscriptions;
|
||||
import org.signal.core.util.Base64;
|
||||
import org.whispersystems.signalservice.api.util.Preconditions;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.Arrays;
|
||||
|
||||
@@ -30,6 +31,12 @@ public final class SubscriberId {
|
||||
return Base64.encodeUrlSafeWithPadding(bytes);
|
||||
}
|
||||
|
||||
public static @NonNull SubscriberId deserialize(@NonNull String serialized) throws IOException {
|
||||
byte[] bytes = Base64.decode(serialized);
|
||||
|
||||
return fromBytes(bytes);
|
||||
}
|
||||
|
||||
public static SubscriberId fromBytes(byte[] bytes) {
|
||||
Preconditions.checkArgument(bytes.length == SIZE);
|
||||
return new SubscriberId(bytes);
|
||||
|
||||
Reference in New Issue
Block a user