mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 02:20:39 +00:00
Remove error handling for oracle unlimited crypto issue
This commit is contained in:
parent
0a63dd1db4
commit
357e278f48
11 changed files with 5 additions and 65 deletions
|
@ -102,8 +102,8 @@ This is still experimental and will not work in all situations.
|
||||||
|
|
||||||
The binary is available at *build/native-image/signal-cli*
|
The binary is available at *build/native-image/signal-cli*
|
||||||
|
|
||||||
## Troubleshooting
|
## FAQ and Troubleshooting
|
||||||
If you use a version of the Oracle JRE and get an InvalidKeyException you need to enable unlimited strength crypto. See https://stackoverflow.com/questions/6481627/java-security-illegal-key-size-or-default-parameters for instructions.
|
For frequently asked questions and issues have a look at the [wiki](https://github.com/AsamK/signal-cli/wiki/FAQ)
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,6 @@ import java.io.IOException;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
|
|
||||||
import static org.asamk.signal.util.ErrorUtils.handleAssertionError;
|
|
||||||
|
|
||||||
public class AddDeviceCommand implements LocalCommand {
|
public class AddDeviceCommand implements LocalCommand {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(AddDeviceCommand.class);
|
private final static Logger logger = LoggerFactory.getLogger(AddDeviceCommand.class);
|
||||||
|
@ -41,9 +39,6 @@ public class AddDeviceCommand implements LocalCommand {
|
||||||
} catch (InvalidKeyException e) {
|
} catch (InvalidKeyException e) {
|
||||||
logger.error("Add device link failed", e);
|
logger.error("Add device link failed", e);
|
||||||
throw new UnexpectedErrorException("Add device link failed.");
|
throw new UnexpectedErrorException("Add device link failed.");
|
||||||
} catch (AssertionError e) {
|
|
||||||
handleAssertionError(e);
|
|
||||||
throw e;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,6 @@ import org.whispersystems.signalservice.internal.push.exceptions.GroupPatchNotAc
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import static org.asamk.signal.util.ErrorUtils.handleAssertionError;
|
|
||||||
import static org.asamk.signal.util.ErrorUtils.handleTimestampAndSendMessageResults;
|
import static org.asamk.signal.util.ErrorUtils.handleTimestampAndSendMessageResults;
|
||||||
|
|
||||||
public class JoinGroupCommand implements LocalCommand {
|
public class JoinGroupCommand implements LocalCommand {
|
||||||
|
@ -53,9 +52,6 @@ public class JoinGroupCommand implements LocalCommand {
|
||||||
writer.println("Joined group \"{}\"", newGroupId.toBase64());
|
writer.println("Joined group \"{}\"", newGroupId.toBase64());
|
||||||
}
|
}
|
||||||
handleTimestampAndSendMessageResults(writer, 0, results.second());
|
handleTimestampAndSendMessageResults(writer, 0, results.second());
|
||||||
} catch (AssertionError e) {
|
|
||||||
handleAssertionError(e);
|
|
||||||
throw e;
|
|
||||||
} catch (GroupPatchNotAcceptedException e) {
|
} catch (GroupPatchNotAcceptedException e) {
|
||||||
throw new UserErrorException("Failed to join group, maybe already a member");
|
throw new UserErrorException("Failed to join group, maybe already a member");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
|
@ -17,8 +17,6 @@ import org.whispersystems.libsignal.InvalidKeyException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.concurrent.TimeoutException;
|
import java.util.concurrent.TimeoutException;
|
||||||
|
|
||||||
import static org.asamk.signal.util.ErrorUtils.handleAssertionError;
|
|
||||||
|
|
||||||
public class LinkCommand implements ProvisioningCommand {
|
public class LinkCommand implements ProvisioningCommand {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(LinkCommand.class);
|
private final static Logger logger = LoggerFactory.getLogger(LinkCommand.class);
|
||||||
|
@ -45,9 +43,6 @@ public class LinkCommand implements ProvisioningCommand {
|
||||||
throw new UserErrorException("Link request timed out, please try again.");
|
throw new UserErrorException("Link request timed out, please try again.");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new IOErrorException("Link request error: " + e.getMessage());
|
throw new IOErrorException("Link request error: " + e.getMessage());
|
||||||
} catch (AssertionError e) {
|
|
||||||
handleAssertionError(e);
|
|
||||||
throw e;
|
|
||||||
} catch (InvalidKeyException e) {
|
} catch (InvalidKeyException e) {
|
||||||
logger.debug("Finish device link failed", e);
|
logger.debug("Finish device link failed", e);
|
||||||
throw new UnexpectedErrorException("Invalid key: " + e.getMessage());
|
throw new UnexpectedErrorException("Invalid key: " + e.getMessage());
|
||||||
|
|
|
@ -16,7 +16,6 @@ import org.asamk.signal.util.Util;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import static org.asamk.signal.util.ErrorUtils.handleAssertionError;
|
|
||||||
import static org.asamk.signal.util.ErrorUtils.handleTimestampAndSendMessageResults;
|
import static org.asamk.signal.util.ErrorUtils.handleTimestampAndSendMessageResults;
|
||||||
|
|
||||||
public class QuitGroupCommand implements LocalCommand {
|
public class QuitGroupCommand implements LocalCommand {
|
||||||
|
@ -42,12 +41,7 @@ public class QuitGroupCommand implements LocalCommand {
|
||||||
handleTimestampAndSendMessageResults(writer, results.first(), results.second());
|
handleTimestampAndSendMessageResults(writer, results.first(), results.second());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new IOErrorException("Failed to send message: " + e.getMessage());
|
throw new IOErrorException("Failed to send message: " + e.getMessage());
|
||||||
} catch (AssertionError e) {
|
} catch (GroupNotFoundException | NotAGroupMemberException e) {
|
||||||
handleAssertionError(e);
|
|
||||||
throw e;
|
|
||||||
} catch (GroupNotFoundException e) {
|
|
||||||
throw new UserErrorException("Failed to send to group: " + e.getMessage());
|
|
||||||
} catch (NotAGroupMemberException e) {
|
|
||||||
throw new UserErrorException("Failed to send to group: " + e.getMessage());
|
throw new UserErrorException("Failed to send to group: " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,8 +27,6 @@ import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import static org.asamk.signal.util.ErrorUtils.handleAssertionError;
|
|
||||||
|
|
||||||
public class ReceiveCommand implements ExtendedDbusCommand, LocalCommand {
|
public class ReceiveCommand implements ExtendedDbusCommand, LocalCommand {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(ReceiveCommand.class);
|
private final static Logger logger = LoggerFactory.getLogger(ReceiveCommand.class);
|
||||||
|
@ -169,9 +167,6 @@ public class ReceiveCommand implements ExtendedDbusCommand, LocalCommand {
|
||||||
handler);
|
handler);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new IOErrorException("Error while receiving messages: " + e.getMessage());
|
throw new IOErrorException("Error while receiving messages: " + e.getMessage());
|
||||||
} catch (AssertionError e) {
|
|
||||||
handleAssertionError(e);
|
|
||||||
throw e;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,8 +15,6 @@ import org.freedesktop.dbus.exceptions.DBusExecutionException;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static org.asamk.signal.util.ErrorUtils.handleAssertionError;
|
|
||||||
|
|
||||||
public class RemoteDeleteCommand implements DbusCommand {
|
public class RemoteDeleteCommand implements DbusCommand {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -26,10 +24,8 @@ public class RemoteDeleteCommand implements DbusCommand {
|
||||||
.required(true)
|
.required(true)
|
||||||
.type(long.class)
|
.type(long.class)
|
||||||
.help("Specify the timestamp of the message to delete.");
|
.help("Specify the timestamp of the message to delete.");
|
||||||
subparser.addArgument("-g", "--group")
|
subparser.addArgument("-g", "--group").help("Specify the recipient group ID.");
|
||||||
.help("Specify the recipient group ID.");
|
subparser.addArgument("recipient").help("Specify the recipients' phone number.").nargs("*");
|
||||||
subparser.addArgument("recipient")
|
|
||||||
.help("Specify the recipients' phone number.").nargs("*");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -66,9 +62,6 @@ public class RemoteDeleteCommand implements DbusCommand {
|
||||||
timestamp = signal.sendRemoteDeleteMessage(targetTimestamp, recipients);
|
timestamp = signal.sendRemoteDeleteMessage(targetTimestamp, recipients);
|
||||||
}
|
}
|
||||||
writer.println("{}", timestamp);
|
writer.println("{}", timestamp);
|
||||||
} catch (AssertionError e) {
|
|
||||||
handleAssertionError(e);
|
|
||||||
throw e;
|
|
||||||
} catch (UnknownObject e) {
|
} catch (UnknownObject e) {
|
||||||
throw new UserErrorException("Failed to find dbus object, maybe missing the -u flag: " + e.getMessage());
|
throw new UserErrorException("Failed to find dbus object, maybe missing the -u flag: " + e.getMessage());
|
||||||
} catch (Signal.Error.InvalidNumber e) {
|
} catch (Signal.Error.InvalidNumber e) {
|
||||||
|
|
|
@ -22,8 +22,6 @@ import java.io.IOException;
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static org.asamk.signal.util.ErrorUtils.handleAssertionError;
|
|
||||||
|
|
||||||
public class SendCommand implements DbusCommand {
|
public class SendCommand implements DbusCommand {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(SendCommand.class);
|
private final static Logger logger = LoggerFactory.getLogger(SendCommand.class);
|
||||||
|
@ -67,9 +65,6 @@ public class SendCommand implements DbusCommand {
|
||||||
try {
|
try {
|
||||||
signal.sendEndSessionMessage(recipients);
|
signal.sendEndSessionMessage(recipients);
|
||||||
return;
|
return;
|
||||||
} catch (AssertionError e) {
|
|
||||||
handleAssertionError(e);
|
|
||||||
throw e;
|
|
||||||
} catch (Signal.Error.UntrustedIdentity e) {
|
} catch (Signal.Error.UntrustedIdentity e) {
|
||||||
throw new UntrustedKeyErrorException("Failed to send message: " + e.getMessage());
|
throw new UntrustedKeyErrorException("Failed to send message: " + e.getMessage());
|
||||||
} catch (DBusExecutionException e) {
|
} catch (DBusExecutionException e) {
|
||||||
|
@ -105,9 +100,6 @@ public class SendCommand implements DbusCommand {
|
||||||
var timestamp = signal.sendGroupMessage(messageText, attachments, groupId);
|
var timestamp = signal.sendGroupMessage(messageText, attachments, groupId);
|
||||||
writer.println("{}", timestamp);
|
writer.println("{}", timestamp);
|
||||||
return;
|
return;
|
||||||
} catch (AssertionError e) {
|
|
||||||
handleAssertionError(e);
|
|
||||||
throw e;
|
|
||||||
} catch (DBusExecutionException e) {
|
} catch (DBusExecutionException e) {
|
||||||
throw new UnexpectedErrorException("Failed to send group message: " + e.getMessage());
|
throw new UnexpectedErrorException("Failed to send group message: " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
@ -118,9 +110,6 @@ public class SendCommand implements DbusCommand {
|
||||||
var timestamp = signal.sendNoteToSelfMessage(messageText, attachments);
|
var timestamp = signal.sendNoteToSelfMessage(messageText, attachments);
|
||||||
writer.println("{}", timestamp);
|
writer.println("{}", timestamp);
|
||||||
return;
|
return;
|
||||||
} catch (AssertionError e) {
|
|
||||||
handleAssertionError(e);
|
|
||||||
throw e;
|
|
||||||
} catch (Signal.Error.UntrustedIdentity e) {
|
} catch (Signal.Error.UntrustedIdentity e) {
|
||||||
throw new UntrustedKeyErrorException("Failed to send message: " + e.getMessage());
|
throw new UntrustedKeyErrorException("Failed to send message: " + e.getMessage());
|
||||||
} catch (DBusExecutionException e) {
|
} catch (DBusExecutionException e) {
|
||||||
|
@ -131,9 +120,6 @@ public class SendCommand implements DbusCommand {
|
||||||
try {
|
try {
|
||||||
var timestamp = signal.sendMessage(messageText, attachments, recipients);
|
var timestamp = signal.sendMessage(messageText, attachments, recipients);
|
||||||
writer.println("{}", timestamp);
|
writer.println("{}", timestamp);
|
||||||
} catch (AssertionError e) {
|
|
||||||
handleAssertionError(e);
|
|
||||||
throw e;
|
|
||||||
} catch (UnknownObject e) {
|
} catch (UnknownObject e) {
|
||||||
throw new UserErrorException("Failed to find dbus object, maybe missing the -u flag: " + e.getMessage());
|
throw new UserErrorException("Failed to find dbus object, maybe missing the -u flag: " + e.getMessage());
|
||||||
} catch (Signal.Error.UntrustedIdentity e) {
|
} catch (Signal.Error.UntrustedIdentity e) {
|
||||||
|
|
|
@ -16,8 +16,6 @@ import org.freedesktop.dbus.exceptions.DBusExecutionException;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static org.asamk.signal.util.ErrorUtils.handleAssertionError;
|
|
||||||
|
|
||||||
public class SendReactionCommand implements DbusCommand {
|
public class SendReactionCommand implements DbusCommand {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -75,9 +73,6 @@ public class SendReactionCommand implements DbusCommand {
|
||||||
timestamp = signal.sendMessageReaction(emoji, isRemove, targetAuthor, targetTimestamp, recipients);
|
timestamp = signal.sendMessageReaction(emoji, isRemove, targetAuthor, targetTimestamp, recipients);
|
||||||
}
|
}
|
||||||
writer.println("{}", timestamp);
|
writer.println("{}", timestamp);
|
||||||
} catch (AssertionError e) {
|
|
||||||
handleAssertionError(e);
|
|
||||||
throw e;
|
|
||||||
} catch (UnknownObject e) {
|
} catch (UnknownObject e) {
|
||||||
throw new UserErrorException("Failed to find dbus object, maybe missing the -u flag: " + e.getMessage());
|
throw new UserErrorException("Failed to find dbus object, maybe missing the -u flag: " + e.getMessage());
|
||||||
} catch (Signal.Error.InvalidNumber e) {
|
} catch (Signal.Error.InvalidNumber e) {
|
||||||
|
|
|
@ -18,8 +18,6 @@ import java.util.ArrayList;
|
||||||
import java.util.Base64;
|
import java.util.Base64;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static org.asamk.signal.util.ErrorUtils.handleAssertionError;
|
|
||||||
|
|
||||||
public class UpdateGroupCommand implements DbusCommand {
|
public class UpdateGroupCommand implements DbusCommand {
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(UpdateGroupCommand.class);
|
private final static Logger logger = LoggerFactory.getLogger(UpdateGroupCommand.class);
|
||||||
|
@ -67,9 +65,6 @@ public class UpdateGroupCommand implements DbusCommand {
|
||||||
if (groupId.length != newGroupId.length) {
|
if (groupId.length != newGroupId.length) {
|
||||||
writer.println("Created new group: \"{}\"", Base64.getEncoder().encodeToString(newGroupId));
|
writer.println("Created new group: \"{}\"", Base64.getEncoder().encodeToString(newGroupId));
|
||||||
}
|
}
|
||||||
} catch (AssertionError e) {
|
|
||||||
handleAssertionError(e);
|
|
||||||
throw e;
|
|
||||||
} catch (Signal.Error.AttachmentInvalid e) {
|
} catch (Signal.Error.AttachmentInvalid e) {
|
||||||
throw new UserErrorException("Failed to add avatar attachment for group\": " + e.getMessage());
|
throw new UserErrorException("Failed to add avatar attachment for group\": " + e.getMessage());
|
||||||
} catch (DBusExecutionException e) {
|
} catch (DBusExecutionException e) {
|
||||||
|
|
|
@ -17,10 +17,6 @@ public class ErrorUtils {
|
||||||
private ErrorUtils() {
|
private ErrorUtils() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void handleAssertionError(AssertionError e) {
|
|
||||||
logger.warn("If you use an Oracle JRE please check if you have unlimited strength crypto enabled, see README");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void handleTimestampAndSendMessageResults(
|
public static void handleTimestampAndSendMessageResults(
|
||||||
PlainTextWriter writer, long timestamp, List<SendMessageResult> results
|
PlainTextWriter writer, long timestamp, List<SendMessageResult> results
|
||||||
) throws CommandException {
|
) throws CommandException {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue