Delete unused libsignal-service models.

This commit is contained in:
Greyson Parrelli
2026-09-15 18:26:02 -04:00
parent afbca463bd
commit 4b9a08f2fb
21 changed files with 0 additions and 1005 deletions
@@ -1,70 +0,0 @@
package org.whispersystems.signalservice.api.account;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.signal.libsignal.protocol.IdentityKey;
import org.whispersystems.signalservice.api.push.SignedPreKeyEntity;
import org.whispersystems.signalservice.internal.push.KyberPreKeyEntity;
import org.whispersystems.signalservice.internal.push.OutgoingPushMessage;
import org.signal.network.util.JsonUtil;
import java.util.List;
import java.util.Map;
public final class PniKeyDistributionRequest {
@JsonProperty
@JsonSerialize(using = JsonUtil.IdentityKeySerializer.class)
@JsonDeserialize(using = JsonUtil.IdentityKeyDeserializer.class)
private IdentityKey pniIdentityKey;
@JsonProperty
private List<OutgoingPushMessage> deviceMessages;
@JsonProperty
private Map<String, SignedPreKeyEntity> devicePniSignedPrekeys;
@JsonProperty("devicePniPqLastResortPrekeys")
private Map<String, KyberPreKeyEntity> devicePniLastResortKyberPrekeys;
@JsonProperty
private Map<String, Integer> pniRegistrationIds;
@JsonProperty
private boolean signatureValidOnEachSignedPreKey;
@SuppressWarnings("unused")
public PniKeyDistributionRequest() {}
public PniKeyDistributionRequest(IdentityKey pniIdentityKey,
List<OutgoingPushMessage> deviceMessages,
Map<String, SignedPreKeyEntity> devicePniSignedPrekeys,
Map<String, KyberPreKeyEntity> devicePniLastResortKyberPrekeys,
Map<String, Integer> pniRegistrationIds,
boolean signatureValidOnEachSignedPreKey)
{
this.pniIdentityKey = pniIdentityKey;
this.deviceMessages = deviceMessages;
this.devicePniSignedPrekeys = devicePniSignedPrekeys;
this.devicePniLastResortKyberPrekeys = devicePniLastResortKyberPrekeys;
this.pniRegistrationIds = pniRegistrationIds;
this.signatureValidOnEachSignedPreKey = signatureValidOnEachSignedPreKey;
}
public IdentityKey getPniIdentityKey() {
return pniIdentityKey;
}
public List<OutgoingPushMessage> getDeviceMessages() {
return deviceMessages;
}
public Map<String, SignedPreKeyEntity> getDevicePniSignedPrekeys() {
return devicePniSignedPrekeys;
}
public Map<String, Integer> getPniRegistrationIds() {
return pniRegistrationIds;
}
}
@@ -1,69 +0,0 @@
/**
* Copyright (C) 2014-2016 Open Whisper Systems
*
* Licensed according to the LICENSE file in this repository.
*/
package org.whispersystems.signalservice.api.push;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* A class that represents a contact's registration state.
*/
public class ContactTokenDetails {
@JsonProperty
private String token;
@JsonProperty
private String relay;
@JsonProperty
private String number;
@JsonProperty
private boolean voice;
@JsonProperty
private boolean video;
public ContactTokenDetails() {}
/**
* @return The "anonymized" token (truncated hash) that's transmitted to the server.
*/
public String getToken() {
return token;
}
/**
* @return The federated server this contact is registered with, or null if on your server.
*/
public String getRelay() {
return relay;
}
/**
* @return Whether this contact supports secure voice calls.
*/
public boolean isVoice() {
return voice;
}
public boolean isVideo() {
return video;
}
public void setNumber(String number) {
this.number = number;
}
/**
* @return This contact's username (e164 formatted number).
*/
public String getNumber() {
return number;
}
}
@@ -1,62 +0,0 @@
package org.whispersystems.signalservice.api.subscriptions;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.whispersystems.signalservice.api.profiles.SignalServiceProfile;
import java.math.BigDecimal;
import java.util.Map;
/**
* Available subscription levels.
*/
public final class SubscriptionLevels {
/**
* Reserved level for boost badge.
*/
public static final String BOOST_LEVEL = "1";
private final Map<String, Level> levels;
@JsonCreator
public SubscriptionLevels(@JsonProperty("levels") Map<String, Level> levels) {
this.levels = levels;
}
public Map<String, Level> getLevels() {
return levels;
}
/**
* An available subscription level
*/
public static final class Level {
private final String name;
private final SignalServiceProfile.Badge badge;
private final Map<String, BigDecimal> currencies;
@JsonCreator
public Level(@JsonProperty("name") String name,
@JsonProperty("badge") SignalServiceProfile.Badge badge,
@JsonProperty("currencies") Map<String, BigDecimal> currencies)
{
this.name = name;
this.badge = badge;
this.currencies = currencies;
}
public String getName() {
return name;
}
public SignalServiceProfile.Badge getBadge() {
return badge;
}
public Map<String, BigDecimal> getCurrencies() {
return currencies;
}
}
}
@@ -1,48 +0,0 @@
package org.whispersystems.signalservice.internal.contacts.crypto;
import com.fasterxml.jackson.annotation.JsonProperty;
public class SignatureBodyEntity {
@JsonProperty
private byte[] isvEnclaveQuoteBody;
@JsonProperty
private String isvEnclaveQuoteStatus;
@JsonProperty
private Long version;
@JsonProperty
private String timestamp;
@JsonProperty
private String advisoryURL;
@JsonProperty
private String[] advisoryIDs;
public byte[] getIsvEnclaveQuoteBody() {
return isvEnclaveQuoteBody;
}
public String getIsvEnclaveQuoteStatus() {
return isvEnclaveQuoteStatus;
}
public String getAdvisoryUrl() {
return advisoryURL;
}
public String[] getAdvisoryIds() {
return advisoryIDs;
}
public Long getVersion() {
return version;
}
public String getTimestamp() {
return timestamp;
}
}
@@ -1,78 +0,0 @@
/*
* Copyright (C) 2017 Open Whisper Systems
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.whispersystems.signalservice.internal.contacts.entities;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;
public class DiscoveryRequest {
@JsonProperty
private int addressCount;
@JsonProperty
private byte[] commitment;
@JsonProperty
private byte[] iv;
@JsonProperty
private byte[] data;
@JsonProperty
private byte[] mac;
@JsonProperty
private Map<String, QueryEnvelope> envelopes;
public DiscoveryRequest() { }
public DiscoveryRequest(int addressCount, byte[] commitment, byte[] iv, byte[] data, byte[] mac, Map<String, QueryEnvelope> envelopes) {
this.addressCount = addressCount;
this.commitment = commitment;
this.iv = iv;
this.data = data;
this.mac = mac;
this.envelopes = envelopes;
}
public byte[] getCommitment() {
return commitment;
}
public byte[] getIv() {
return iv;
}
public byte[] getData() {
return data;
}
public byte[] getMac() {
return mac;
}
public int getAddressCount() {
return addressCount;
}
@Override
public String toString() {
return "{ addressCount: " + addressCount + ", envelopes: " + envelopes.size() + " }";
}
}
@@ -1,58 +0,0 @@
/*
* Copyright (C) 2017 Open Whisper Systems
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.whispersystems.signalservice.internal.contacts.entities;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.signal.core.util.Hex;
public class DiscoveryResponse {
@JsonProperty
private byte[] requestId;
@JsonProperty
private byte[] iv;
@JsonProperty
private byte[] data;
@JsonProperty
private byte[] mac;
public DiscoveryResponse() {}
public byte[] getRequestId() {
return requestId;
}
public byte[] getIv() {
return iv;
}
public byte[] getData() {
return data;
}
public byte[] getMac() {
return mac;
}
public String toString() {
return "{iv: " + (iv == null ? null : Hex.toString(iv)) + ", data: " + (data == null ? null: Hex.toString(data)) + ", mac: " + (mac == null ? null : Hex.toString(mac)) + "}";
}
}
@@ -1,59 +0,0 @@
package org.whispersystems.signalservice.internal.contacts.entities;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.signal.core.util.Hex;
public class KeyBackupRequest {
@JsonProperty
private byte[] requestId;
@JsonProperty
private byte[] iv;
@JsonProperty
private byte[] data;
@JsonProperty
private byte[] mac;
@JsonProperty
private String type;
public KeyBackupRequest() {
}
public KeyBackupRequest(byte[] requestId, byte[] iv, byte[] data, byte[] mac, String type) {
this.requestId = requestId;
this.iv = iv;
this.data = data;
this.mac = mac;
this.type = type;
}
public byte[] getRequestId() {
return requestId;
}
public byte[] getIv() {
return iv;
}
public byte[] getData() {
return data;
}
public byte[] getMac() {
return mac;
}
public String getType() {
return type;
}
public String toString() {
return "{ type:" + type + ", requestId: " + Hex.toString(requestId) + ", iv: " + Hex.toString(iv) + ", data: " + Hex.toString(data) + ", mac: " + Hex.toString(mac) + "}";
}
}
@@ -1,41 +0,0 @@
package org.whispersystems.signalservice.internal.contacts.entities;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.signal.core.util.Hex;
public class KeyBackupResponse {
@JsonProperty
private byte[] iv;
@JsonProperty
private byte[] data;
@JsonProperty
private byte[] mac;
public KeyBackupResponse() {}
public KeyBackupResponse(byte[] iv, byte[] data, byte[] mac) {
this.iv = iv;
this.data = data;
this.mac = mac;
}
public byte[] getIv() {
return iv;
}
public byte[] getData() {
return data;
}
public byte[] getMac() {
return mac;
}
public String toString() {
return "{iv: " + (iv == null ? null : Hex.toString(iv)) + ", data: " + (data == null ? null: Hex.toString(data)) + ", mac: " + (mac == null ? null : Hex.toString(mac)) + "}";
}
}
@@ -1,15 +0,0 @@
package org.whispersystems.signalservice.internal.contacts.entities;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;
public class MultiRemoteAttestationResponse {
@JsonProperty
private Map<String, RemoteAttestationResponse> attestations;
public Map<String, RemoteAttestationResponse> getAttestations() {
return attestations;
}
}
@@ -1,27 +0,0 @@
package org.whispersystems.signalservice.internal.contacts.entities;
import com.fasterxml.jackson.annotation.JsonProperty;
public class QueryEnvelope {
@JsonProperty
private byte[] requestId;
@JsonProperty
private byte[] iv;
@JsonProperty
private byte[] data;
@JsonProperty
private byte[] mac;
public QueryEnvelope() { }
public QueryEnvelope(byte[] requestId, byte[] iv, byte[] data, byte[] mac) {
this.requestId = requestId;
this.iv = iv;
this.data = data;
this.mac = mac;
}
}
@@ -1,40 +0,0 @@
/*
* Copyright (C) 2017 Open Whisper Systems
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.whispersystems.signalservice.internal.contacts.entities;
import com.fasterxml.jackson.annotation.JsonProperty;
public class RemoteAttestationRequest {
@JsonProperty
private byte[] clientPublic;
@JsonProperty
private int iasVersion;
public RemoteAttestationRequest() {}
public RemoteAttestationRequest(byte[] clientPublic) {
this.clientPublic = clientPublic;
this.iasVersion = 4;
}
public byte[] getClientPublic() {
return clientPublic;
}
}
@@ -1,103 +0,0 @@
/*
* Copyright (C) 2017 Open Whisper Systems
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.whispersystems.signalservice.internal.contacts.entities;
import com.fasterxml.jackson.annotation.JsonProperty;
public class RemoteAttestationResponse {
@JsonProperty
private byte[] serverEphemeralPublic;
@JsonProperty
private byte[] serverStaticPublic;
@JsonProperty
private byte[] quote;
@JsonProperty
private byte[] iv;
@JsonProperty
private byte[] ciphertext;
@JsonProperty
private byte[] tag;
@JsonProperty
private String signature;
@JsonProperty
private String certificates;
@JsonProperty
private String signatureBody;
public RemoteAttestationResponse(byte[] serverEphemeralPublic, byte[] serverStaticPublic,
byte[] iv, byte[] ciphertext, byte[] tag,
byte[] quote, String signature, String certificates, String signatureBody)
{
this.serverEphemeralPublic = serverEphemeralPublic;
this.serverStaticPublic = serverStaticPublic;
this.iv = iv;
this.ciphertext = ciphertext;
this.tag = tag;
this.quote = quote;
this.signature = signature;
this.certificates = certificates;
this.signatureBody = signatureBody;
}
public RemoteAttestationResponse() {}
public byte[] getServerEphemeralPublic() {
return serverEphemeralPublic;
}
public byte[] getServerStaticPublic() {
return serverStaticPublic;
}
public byte[] getQuote() {
return quote;
}
public byte[] getIv() {
return iv;
}
public byte[] getCiphertext() {
return ciphertext;
}
public byte[] getTag() {
return tag;
}
public String getSignature() {
return signature;
}
public String getCertificates() {
return certificates;
}
public String getSignatureBody() {
return signatureBody;
}
}
@@ -1,38 +0,0 @@
package org.whispersystems.signalservice.internal.contacts.entities;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class TokenResponse {
@JsonProperty
private byte[] backupId;
@JsonProperty
private byte[] token;
@JsonProperty
private int tries;
@JsonCreator
public TokenResponse() {
}
public TokenResponse(byte[] backupId, byte[] token, int tries) {
this.backupId = backupId;
this.token = token;
this.tries = tries;
}
public byte[] getBackupId() {
return backupId;
}
public byte[] getToken() {
return token;
}
public int getTries() {
return tries;
}
}
@@ -1,78 +0,0 @@
package org.whispersystems.signalservice.internal.push;
import com.fasterxml.jackson.annotation.JsonProperty;
public class AttachmentV2UploadAttributes {
@JsonProperty
private String url;
@JsonProperty
private String key;
@JsonProperty
private String credential;
@JsonProperty
private String acl;
@JsonProperty
private String algorithm;
@JsonProperty
private String date;
@JsonProperty
private String policy;
@JsonProperty
private String signature;
@JsonProperty
private String attachmentId;
@JsonProperty
private String attachmentIdString;
public AttachmentV2UploadAttributes() {}
public String getUrl() {
return url;
}
public String getKey() {
return key;
}
public String getCredential() {
return credential;
}
public String getAcl() {
return acl;
}
public String getAlgorithm() {
return algorithm;
}
public String getDate() {
return date;
}
public String getPolicy() {
return policy;
}
public String getSignature() {
return signature;
}
public String getAttachmentId() {
return attachmentId;
}
public String getAttachmentIdString() {
return attachmentIdString;
}
}
@@ -1,15 +0,0 @@
package org.whispersystems.signalservice.internal.push;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Response for {@link org.whispersystems.signalservice.api.push.exceptions.CdsiResourceExhaustedException}
*/
public class CdsiResourceExhaustedResponse {
@JsonProperty("retry_after")
private int retryAfter;
public int getRetryAfter() {
return retryAfter;
}
}
@@ -1,13 +0,0 @@
package org.whispersystems.signalservice.internal.push;
import com.fasterxml.jackson.annotation.JsonProperty;
public class ContactDiscoveryFailureReason {
@JsonProperty
private final String reason;
public ContactDiscoveryFailureReason(String reason) {
this.reason = reason == null ? "" : reason;
}
}
@@ -1,25 +0,0 @@
/**
* Copyright (C) 2014-2016 Open Whisper Systems
*
* Licensed according to the LICENSE file in this repository.
*/
package org.whispersystems.signalservice.internal.push;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.whispersystems.signalservice.api.push.ContactTokenDetails;
import java.util.List;
public class ContactTokenDetailsList {
@JsonProperty
private List<ContactTokenDetails> contacts;
public ContactTokenDetailsList() {}
public List<ContactTokenDetails> getContacts() {
return contacts;
}
}
@@ -1,18 +0,0 @@
package org.whispersystems.signalservice.internal.push;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* JSON POJO that represents the returned ACI from a call to
* /v1/account/username/[username]
*/
public class GetAciByUsernameResponse {
@JsonProperty
private String uuid;
public GetAciByUsernameResponse() {}
public String getUuid() {
return uuid;
}
}
@@ -1,24 +0,0 @@
package org.whispersystems.signalservice.internal.push;
import com.fasterxml.jackson.annotation.JsonProperty;
class SetUsernameRequest {
@JsonProperty
private String nickname;
@JsonProperty
private String existingUsername;
SetUsernameRequest(String nickname, String existingUsername) {
this.nickname = nickname;
this.existingUsername = existingUsername;
}
String getNickname() {
return nickname;
}
String getExistingUsername() {
return existingUsername;
}
}
@@ -1,14 +0,0 @@
package org.whispersystems.signalservice.internal.push;
import com.fasterxml.jackson.annotation.JsonProperty;
class SetUsernameResponse {
@JsonProperty
private String username;
SetUsernameResponse() {}
String getUsername() {
return username;
}
}
@@ -1,110 +0,0 @@
package org.whispersystems.signalservice.internal.push;
import com.fasterxml.jackson.annotation.JsonProperty;
public class SignalServiceEnvelopeEntity {
@JsonProperty
private int type;
@JsonProperty
private String relay;
@JsonProperty
private long timestamp;
@JsonProperty
private String source;
@JsonProperty
private String sourceUuid;
@JsonProperty
private int sourceDevice;
@JsonProperty
private String destinationUuid;
@JsonProperty
private byte[] message;
@JsonProperty
private byte[] content;
@JsonProperty
private long serverTimestamp;
@JsonProperty
private String guid;
@JsonProperty
private Boolean urgent;
@JsonProperty
private Boolean story;
@JsonProperty
private byte[] reportSpamToken;
public SignalServiceEnvelopeEntity() {}
public int getType() {
return type;
}
public String getRelay() {
return relay;
}
public long getTimestamp() {
return timestamp;
}
public String getSourceE164() {
return source;
}
public String getSourceUuid() {
return sourceUuid;
}
public boolean hasSource() {
return sourceUuid != null;
}
public int getSourceDevice() {
return sourceDevice;
}
public byte[] getMessage() {
return message;
}
public byte[] getContent() {
return content;
}
public long getServerTimestamp() {
return serverTimestamp;
}
public String getServerUuid() {
return guid;
}
public String getDestinationUuid() {
return destinationUuid;
}
public boolean isUrgent() {
return urgent == null || urgent;
}
public boolean isStory() {
return story != null && story;
}
public byte[] getReportSpamToken() {
return reportSpamToken;
}
}