diff --git a/lib/src/main/java/org/asamk/signal/manager/Manager.java b/lib/src/main/java/org/asamk/signal/manager/Manager.java index c1d62e69..28a5f416 100644 --- a/lib/src/main/java/org/asamk/signal/manager/Manager.java +++ b/lib/src/main/java/org/asamk/signal/manager/Manager.java @@ -1549,6 +1549,10 @@ public class Manager implements Closeable { serviceEnvironmentConfig.getCdsMrenclave()); } catch (Quote.InvalidQuoteFormatException | UnauthenticatedQuoteException | SignatureException | UnauthenticatedResponseException | InvalidKeyException e) { throw new IOException(e.getMessage()); + + /* the NumberFormatException is from Java; see SignalServiceAccountManager.java + * in the package org.whispersystems.signalservice.api + */ } catch (NumberFormatException e) { throw new InvalidNumberException(e.getMessage()); } diff --git a/man/signal-cli-dbus.5.adoc b/man/signal-cli-dbus.5.adoc index fc69c1f2..60ffa64a 100755 --- a/man/signal-cli-dbus.5.adoc +++ b/man/signal-cli-dbus.5.adoc @@ -302,11 +302,6 @@ isGroupBlocked(base64GroupId) -> state:: Exceptions: None; for unknown groups false is returned -version() -> version:: -* version : Version string of signal-cli - -Exceptions: None - isRegistered(number) -> result:: isRegistered(numbers) -> results:: * number : Phone number @@ -316,70 +311,101 @@ isRegistered(numbers) -> results:: Exception: InvalidNumber for an incorrectly formatted phone number. For unknown numbers, false is returned, but no exception is raised. -listIdentity(number) -> results:: -* number : Phone number -* results : Array of elements, each consisting of four strings: trust_level, date_added, fingerprint, safety_number +listIdentity(number) -> identities:: +* number : Phone number +* identities : Array of elements, each consisting of four strings: trust_level, date_added, fingerprint, safety_number ** trust_level : String representation of trust level ** date_added : String representation of date added ** fingerprint : String representation of hexidecimal fingerprint ** safety_number : String representation of safety number (10 or 11 space-separated six-digit numbers) +Exception: InvalidNumber + getObjectPath() -> objectPath:: * objectPath : The DBus object path associated with this connection +Exceptions: None + updateAccount() -> <>:: Updates the account attributes on the Signal server. -getObjectPath() -> objectPath:: -* objectPath : The DBus object path associated with this connection +Exception: Failure version() -> version:: * version : Version string of signal-cli +Exceptions: None + link() -> deviceLinkUri:: link(newDeviceName) -> deviceLinkUri:: * newDeviceName : Name to give new device (defaults to "cli" if no name is given) * deviceLinkUri : URI of newly linked device +Exception: Failure + addDevice(deviceUri) -> <>:: * deviceUri : URI in the form of tsdevice:/?uuid=... Normally received from Signal desktop or smartphone app +Exception: Failure + listDevices() -> devices:: * devices : String array of linked devices +Exception: Failure + removeDevice(deviceId) -> <>:: * deviceId : Device ID to remove, obtained from listDevices() command +Exception: Failure + register(number, voiceVerification) -> <>:: * number : Phone number * voiceVerification : true = use voice verification; false = use SMS verification +Exceptions: Failure, InvalidNumber, RequiresCaptcha + registerWithCaptcha(number, voiceVerification, captcha) -> <>:: * number : Phone number * voiceVerification : true = use voice verification; false = use SMS verification * captcha : Captcha string +Exceptions: Failure, InvalidNumber, RequiresCaptcha + +unregister() -> <>:: + +Unregisters the current device from the Signal server and kills the daemon. + +Exception: Failure + setPin(pin) -> <>:: * pin : PIN you set after registration (resets after 7 days of inactivity) Sets a registration lock PIN, to prevent others from registering your number. +Exception: Failure + removePin() -> <>:: Removes registration PIN protection. +Exception: Failure + verify(number, verificationCode) -> <>:: * number : Phone number * verificationCode : Code received from Signal after successful registration request Command fails if PIN was set after previous registration; use verifyWithPin instead. +Exception: Failure, InvalidNumber + verifyWithPin(number, verificationCode, pin) -> <>:: * number : Phone number * verificationCode : Code received from Signal after successful registration request * pin : PIN you set with setPin command after verifying previous registration +Exception: Failure, InvalidNumber + uploadStickerPack(stickerPackPath) -> <>:: * stickerPackPath : Path to the sticker pack diff --git a/src/main/java/org/asamk/Signal.java b/src/main/java/org/asamk/Signal.java index 27115bd8..36c08424 100644 --- a/src/main/java/org/asamk/Signal.java +++ b/src/main/java/org/asamk/Signal.java @@ -195,7 +195,7 @@ public interface Signal extends DBusInterface { void updateAccount() throws Error.Failure; - List listIdentity(String number); + List listIdentity(String number) throws Error.InvalidNumber; List getContactNumber(final String name) throws Error.Failure;