mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 21:15:48 +00:00
Add payment activation capability.
This commit is contained in:
committed by
Greyson Parrelli
parent
96b2051400
commit
a13599ae2a
@@ -35,6 +35,7 @@ dependencies {
|
||||
implementation libs.google.protobuf.javalite
|
||||
api libs.google.libphonenumber
|
||||
api libs.jackson.core
|
||||
api libs.jackson.module.kotlin
|
||||
|
||||
implementation libs.libsignal.client
|
||||
api libs.square.okhttp3
|
||||
|
||||
@@ -1,221 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2014-2016 Open Whisper Systems
|
||||
*
|
||||
* Licensed according to the LICENSE file in this repository.
|
||||
*/
|
||||
|
||||
package org.whispersystems.signalservice.api.account;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class AccountAttributes {
|
||||
|
||||
@JsonProperty
|
||||
private String signalingKey;
|
||||
|
||||
@JsonProperty
|
||||
private int registrationId;
|
||||
|
||||
@JsonProperty
|
||||
private boolean voice;
|
||||
|
||||
@JsonProperty
|
||||
private boolean video;
|
||||
|
||||
@JsonProperty
|
||||
private boolean fetchesMessages;
|
||||
|
||||
@JsonProperty
|
||||
private String pin;
|
||||
|
||||
@JsonProperty
|
||||
private String registrationLock;
|
||||
|
||||
@JsonProperty
|
||||
private byte[] unidentifiedAccessKey;
|
||||
|
||||
@JsonProperty
|
||||
private boolean unrestrictedUnidentifiedAccess;
|
||||
|
||||
@JsonProperty
|
||||
private boolean discoverableByPhoneNumber;
|
||||
|
||||
@JsonProperty
|
||||
private Capabilities capabilities;
|
||||
|
||||
@JsonProperty
|
||||
private String name;
|
||||
|
||||
@JsonProperty
|
||||
private int pniRegistrationId;
|
||||
|
||||
public AccountAttributes(String signalingKey,
|
||||
int registrationId,
|
||||
boolean fetchesMessages,
|
||||
String pin,
|
||||
String registrationLock,
|
||||
byte[] unidentifiedAccessKey,
|
||||
boolean unrestrictedUnidentifiedAccess,
|
||||
Capabilities capabilities,
|
||||
boolean discoverableByPhoneNumber,
|
||||
String name,
|
||||
int pniRegistrationId)
|
||||
{
|
||||
this.signalingKey = signalingKey;
|
||||
this.registrationId = registrationId;
|
||||
this.voice = true;
|
||||
this.video = true;
|
||||
this.fetchesMessages = fetchesMessages;
|
||||
this.pin = pin;
|
||||
this.registrationLock = registrationLock;
|
||||
this.unidentifiedAccessKey = unidentifiedAccessKey;
|
||||
this.unrestrictedUnidentifiedAccess = unrestrictedUnidentifiedAccess;
|
||||
this.capabilities = capabilities;
|
||||
this.discoverableByPhoneNumber = discoverableByPhoneNumber;
|
||||
this.name = name;
|
||||
this.pniRegistrationId = pniRegistrationId;
|
||||
}
|
||||
|
||||
public AccountAttributes() {}
|
||||
|
||||
public String getSignalingKey() {
|
||||
return signalingKey;
|
||||
}
|
||||
|
||||
public int getRegistrationId() {
|
||||
return registrationId;
|
||||
}
|
||||
|
||||
public boolean isVoice() {
|
||||
return voice;
|
||||
}
|
||||
|
||||
public boolean isVideo() {
|
||||
return video;
|
||||
}
|
||||
|
||||
public boolean isFetchesMessages() {
|
||||
return fetchesMessages;
|
||||
}
|
||||
|
||||
public String getPin() {
|
||||
return pin;
|
||||
}
|
||||
|
||||
public String getRegistrationLock() {
|
||||
return registrationLock;
|
||||
}
|
||||
|
||||
public byte[] getUnidentifiedAccessKey() {
|
||||
return unidentifiedAccessKey;
|
||||
}
|
||||
|
||||
public boolean isUnrestrictedUnidentifiedAccess() {
|
||||
return unrestrictedUnidentifiedAccess;
|
||||
}
|
||||
|
||||
public boolean isDiscoverableByPhoneNumber() {
|
||||
return discoverableByPhoneNumber;
|
||||
}
|
||||
|
||||
public Capabilities getCapabilities() {
|
||||
return capabilities;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public int getPniRegistrationId() {
|
||||
return pniRegistrationId;
|
||||
}
|
||||
|
||||
public static class Capabilities {
|
||||
@JsonProperty
|
||||
private boolean uuid;
|
||||
|
||||
@JsonProperty("gv2-3")
|
||||
private boolean gv2;
|
||||
|
||||
@JsonProperty
|
||||
private boolean storage;
|
||||
|
||||
@JsonProperty("gv1-migration")
|
||||
private boolean gv1Migration;
|
||||
|
||||
@JsonProperty
|
||||
private boolean senderKey;
|
||||
|
||||
@JsonProperty
|
||||
private boolean announcementGroup;
|
||||
|
||||
@JsonProperty
|
||||
private boolean changeNumber;
|
||||
|
||||
@JsonProperty
|
||||
private boolean stories;
|
||||
|
||||
@JsonProperty
|
||||
private boolean giftBadges;
|
||||
|
||||
@JsonProperty
|
||||
private boolean pni;
|
||||
|
||||
@JsonCreator
|
||||
public Capabilities() {}
|
||||
|
||||
public Capabilities(boolean uuid, boolean gv2, boolean storage, boolean gv1Migration, boolean senderKey, boolean announcementGroup, boolean changeNumber, boolean stories, boolean giftBadges, boolean pni) {
|
||||
this.uuid = uuid;
|
||||
this.gv2 = gv2;
|
||||
this.storage = storage;
|
||||
this.gv1Migration = gv1Migration;
|
||||
this.senderKey = senderKey;
|
||||
this.announcementGroup = announcementGroup;
|
||||
this.changeNumber = changeNumber;
|
||||
this.stories = stories;
|
||||
this.giftBadges = giftBadges;
|
||||
this.pni = pni;
|
||||
}
|
||||
|
||||
public boolean isUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public boolean isGv2() {
|
||||
return gv2;
|
||||
}
|
||||
|
||||
public boolean isStorage() {
|
||||
return storage;
|
||||
}
|
||||
|
||||
public boolean isGv1Migration() {
|
||||
return gv1Migration;
|
||||
}
|
||||
|
||||
public boolean isSenderKey() {
|
||||
return senderKey;
|
||||
}
|
||||
|
||||
public boolean isAnnouncementGroup() {
|
||||
return announcementGroup;
|
||||
}
|
||||
|
||||
public boolean isChangeNumber() {
|
||||
return changeNumber;
|
||||
}
|
||||
|
||||
public boolean isStories() {
|
||||
return stories;
|
||||
}
|
||||
|
||||
public boolean isGiftBadges() {
|
||||
return giftBadges;
|
||||
}
|
||||
|
||||
public boolean isPnp() {
|
||||
return pni;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (C) 2014-2016 Open Whisper Systems
|
||||
*
|
||||
* Licensed according to the LICENSE file in this repository.
|
||||
*/
|
||||
package org.whispersystems.signalservice.api.account
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties
|
||||
import com.fasterxml.jackson.annotation.JsonProperty
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
class AccountAttributes @JsonCreator constructor(
|
||||
@JsonProperty val signalingKey: String?,
|
||||
@JsonProperty val registrationId: Int,
|
||||
@JsonProperty val isVoice: Boolean,
|
||||
@JsonProperty val isVideo: Boolean,
|
||||
@JsonProperty val isFetchesMessages: Boolean,
|
||||
@JsonProperty val pin: String?,
|
||||
@JsonProperty val registrationLock: String?,
|
||||
@JsonProperty val unidentifiedAccessKey: ByteArray?,
|
||||
@JsonProperty val isUnrestrictedUnidentifiedAccess: Boolean,
|
||||
@JsonProperty val isDiscoverableByPhoneNumber: Boolean,
|
||||
@JsonProperty val capabilities: Capabilities?,
|
||||
@JsonProperty val name: String?,
|
||||
@JsonProperty val pniRegistrationId: Int,
|
||||
) {
|
||||
constructor(
|
||||
signalingKey: String?,
|
||||
registrationId: Int,
|
||||
isFetchesMessages: Boolean,
|
||||
pin: String?,
|
||||
registrationLock: String?,
|
||||
unidentifiedAccessKey: ByteArray?,
|
||||
isUnrestrictedUnidentifiedAccess: Boolean,
|
||||
capabilities: Capabilities?,
|
||||
isDiscoverableByPhoneNumber: Boolean,
|
||||
name: String?,
|
||||
pniRegistrationId: Int
|
||||
) : this(
|
||||
signalingKey = signalingKey,
|
||||
registrationId = registrationId,
|
||||
isVoice = true,
|
||||
isVideo = true,
|
||||
isFetchesMessages = isFetchesMessages,
|
||||
pin = pin,
|
||||
registrationLock = registrationLock,
|
||||
unidentifiedAccessKey = unidentifiedAccessKey,
|
||||
isUnrestrictedUnidentifiedAccess = isUnrestrictedUnidentifiedAccess,
|
||||
isDiscoverableByPhoneNumber = isDiscoverableByPhoneNumber,
|
||||
capabilities = capabilities,
|
||||
name = name,
|
||||
pniRegistrationId = pniRegistrationId
|
||||
)
|
||||
|
||||
data class Capabilities @JsonCreator constructor(
|
||||
@JsonProperty val isUuid: Boolean,
|
||||
@JsonProperty("gv2-3") val isGv2: Boolean,
|
||||
@JsonProperty val isStorage: Boolean,
|
||||
@JsonProperty("gv1-migration") val isGv1Migration: Boolean,
|
||||
@JsonProperty val isSenderKey: Boolean,
|
||||
@JsonProperty val isAnnouncementGroup: Boolean,
|
||||
@JsonProperty val isChangeNumber: Boolean,
|
||||
@JsonProperty val isStories: Boolean,
|
||||
@JsonProperty val isGiftBadges: Boolean,
|
||||
@JsonProperty val isPnp: Boolean,
|
||||
@JsonProperty val paymentActivation: Boolean
|
||||
)
|
||||
}
|
||||
@@ -206,10 +206,13 @@ public class SignalServiceProfile {
|
||||
@JsonProperty
|
||||
private boolean pnp;
|
||||
|
||||
@JsonProperty
|
||||
private boolean paymentActivation;
|
||||
|
||||
@JsonCreator
|
||||
public Capabilities() {}
|
||||
|
||||
public Capabilities(boolean storage, boolean gv1Migration, boolean senderKey, boolean announcementGroup, boolean changeNumber, boolean stories, boolean giftBadges, boolean pnp) {
|
||||
public Capabilities(boolean storage, boolean gv1Migration, boolean senderKey, boolean announcementGroup, boolean changeNumber, boolean stories, boolean giftBadges, boolean pnp, boolean paymentActivation) {
|
||||
this.storage = storage;
|
||||
this.gv1Migration = gv1Migration;
|
||||
this.senderKey = senderKey;
|
||||
@@ -218,6 +221,7 @@ public class SignalServiceProfile {
|
||||
this.stories = stories;
|
||||
this.giftBadges = giftBadges;
|
||||
this.pnp = pnp;
|
||||
this.paymentActivation = paymentActivation;
|
||||
}
|
||||
|
||||
public boolean isStorage() {
|
||||
@@ -251,6 +255,10 @@ public class SignalServiceProfile {
|
||||
public boolean isPnp() {
|
||||
return pnp;
|
||||
}
|
||||
|
||||
public boolean isPaymentActivation() {
|
||||
return paymentActivation;
|
||||
}
|
||||
}
|
||||
|
||||
public ExpiringProfileKeyCredentialResponse getExpiringProfileKeyCredentialResponse() {
|
||||
|
||||
Reference in New Issue
Block a user