implement uploadStickerPack for Dbus; fix isRegistered error

Note: isRegistered (and related methods) for Dbus can throw an
InvalidNumberException when the phone number is incorrectly formatted.
Previously this led to uncaught exceptions. They are now handled.
The problem is in SignalServiceAccountManager.java in the
package org.whispersystems.signalservice.api, which ignores the
first character of a proposed phone number and checks that the
rest is a legitimate int64.

updated documentation
This commit is contained in:
John Freed 2021-08-18 10:37:58 +02:00
parent 663f6f6e73
commit c39b5450ff
5 changed files with 111 additions and 26 deletions

View file

@ -113,7 +113,7 @@ isMember(base64GroupId<s>) -> active<b>::
* base64GroupId : String representing the internal group identifier in Base64 format
* active : Boolean representing whether you are a member of the group
Note that this method does not raise an Exception for a non-existing/unknown group but will simply return false
Exceptions: None; returns false for a non-existing/unknown group
sendEndSessionMessage(recipients<as>) -> <>::
* recipients : String array of phone numbers
@ -195,13 +195,13 @@ Depending on the type of the recipient(s) field this deletes a message with one
Exceptions: Failure, InvalidNumber
sendContacts() -> <>
sendContacts() -> <>::
Sends a synchronization message with the local contacts list to all linked devices.
Exceptions: Failure, UntrustedIdentity
sendSyncRequest() -> <>
sendSyncRequest() -> <>::
Sends a synchronization request to the primary device (for group, contacts, ...). Only works if a secondary device is running the daemon.
@ -213,7 +213,7 @@ trust(number<s>, safetyNumber<s>) -> <>::
Exceptions: Failure, InvalidNumber;
sendTyping(typingAction<b>, base64GroupId<s>, recipients<as>) -> <>
sendTyping(typingAction<b>, base64GroupId<s>, recipients<as>) -> <>::
* typingAction : true = start typing, false = stop typing
* base64GroupId : String representing the internal group identifier in Base64 format
* recipients : List of phone numbers
@ -226,14 +226,20 @@ getContactName(number<s>) -> name<s>::
* number : Phone number
* name : Contact's name in local storage (from the primary device for a linked account, or the one set with setContactName); if not set, contact's profile name is used
Exception: InvalidNumber
setContactName(number<s>,name<>) -> <>::
* number : Phone number
* name : Name to be set in contacts (in local storage with signal-cli)
Exception: InvalidNumber
setExpirationTimer(number<s>,expiration<i>) -> <>::
* number : Phone number
* expiration : Expiration time for messages sent to this number (in seconds). Set to 0 to disable.
Exception: InvalidNumber
getGroupIds() -> groupList<aay>::
getGroupIds(dummy<s>) -> groupList<as>::
dummy : any string (ignored by method; forces output to be identical with getBase64GroupIds)
@ -242,18 +248,22 @@ base64GroupList : Array of strings representing the internal group identifiers i
All groups known are returned, regardless of their active or blocked status. To query that use isMember() and isGroupBlocked()
Exceptions: None
getBase64GroupIds() -> groupList<as>::
groupList : Array of strings representing the internal group identifiers in Base64 format
All groups known are returned, regardless of their active or blocked status. To query that use isMember() and isGroupBlocked()
Exceptions: None
getGroupName(groupId<ay>) -> groupName<s>::
getGroupName(base64GroupId<s>) -> groupName<s>::
groupName : The display name of the group
groupId : Byte array representing the internal group identifier
base64GroupId : String representing the internal group identifier in Base64 format
Exceptions: None, if the group name is not found an empty string is returned
Exceptions: None; if the group name is not found an empty string is returned
getGroupMembers(groupId<ay>) -> members<as>::
getGroupMembers(base64GroupId<s>) -> members<as>::
@ -261,24 +271,28 @@ members : String array with the phone numbers of all active members of a g
groupId : Byte array representing the internal group identifier
base64GroupId : String representing the internal group identifier in Base64 format
Exceptions: None, if the group name is not found an empty array is returned
Exceptions: None; if the group name is not found an empty array is returned
listNumbers() -> numbers<as>::
numbers : String array of all known numbers
This is a concatenated list of all defined contacts as well of profiles known (e.g. peer group members or sender of received messages)
Exceptions: None
getContactNumber(name<s>) -> numbers<as>::
* numbers : Array of phone numbers
* name : Contact or profile name ("firstname lastname")
Searches contacts and known profiles for a given name and returns the list of all known numbers. May result in e.g. two entries if a contact and profile name is set.
Exception: Failure
isContactBlocked(number<s>) -> state<b>::
* number : Phone number
* state : true=blocked, false=not blocked
Exceptions: None, for unknown numbers false is returned
Exception: InvalidNumber for an incorrectly formatted phone number. For unknown numbers, false is returned, but no exception is raised.
isGroupBlocked(groupId<ay>) -> state<b>::
isGroupBlocked(base64GroupId<s>) -> state<b>::
@ -286,11 +300,13 @@ isGroupBlocked(base64GroupId<s>) -> state<b>::
* base64GroupId : String representing the internal group identifier in Base64 format
* state : true=blocked, false=not blocked
Exceptions: None, for unknown groups false is returned
Exceptions: None; for unknown groups false is returned
version() -> version<s>::
* version : Version string of signal-cli
Exceptions: None
isRegistered(number<s>) -> result<b>::
isRegistered(numbers<as>) -> results<ab>::
* number : Phone number
@ -298,6 +314,8 @@ isRegistered(numbers<as>) -> results<ab>::
* result : true=number is registered, false=number is not registered
* results : Boolean array of results
Exception: InvalidNumber for an incorrectly formatted phone number. For unknown numbers, false is returned, but no exception is raised.
listIdentity(number<s>) -> results<a(ssss)>::
* number : Phone number
* results : Array of elements, each consisting of four strings: trust_level, date_added, fingerprint, safety_number
@ -309,7 +327,7 @@ listIdentity(number<s>) -> results<a(ssss)>::
getObjectPath() -> objectPath<s>::
* objectPath : The DBus object path associated with this connection
updateAccount() -> <>
updateAccount() -> <>::
Updates the account attributes on the Signal server.
@ -351,17 +369,22 @@ removePin() -> <>::
Removes registration PIN protection.
verify(number<s>, verificationCode<s>) -> <>
verify(number<s>, verificationCode<s>) -> <>::
* number : Phone number
* verificationCode : Code received from Signal after successful registration request
Command fails if PIN was set after previous registration; use verifyWithPin instead.
verifyWithPin(number<s>, verificationCode<s>, pin<s>) -> <>
verifyWithPin(number<s>, verificationCode<s>, pin<s>) -> <>::
* number : Phone number
* verificationCode : Code received from Signal after successful registration request
* pin : PIN you set with setPin command after verifying previous registration
uploadStickerPack(stickerPackPath<s>) -> <>::
* stickerPackPath : Path to the sticker pack
Exception: Failure
== Signals
SyncMessageReceived (timestamp<x>, sender<s>, destination<s>, groupId<ay>, message<s>, attachments<as>)::