import org.asamk.signal.dbus.DbusRegistrationManagerImpl;
import org.asamk.signal.manager.Manager;
import org.asamk.signal.manager.RegistrationManager;
+import org.asamk.signal.manager.Settings;
import org.asamk.signal.manager.SignalAccountFiles;
import org.asamk.signal.manager.api.AccountCheckException;
import org.asamk.signal.manager.api.NotRegisteredException;
-import org.asamk.signal.manager.config.ServiceConfig;
-import org.asamk.signal.manager.config.ServiceEnvironment;
-import org.asamk.signal.manager.storage.identities.TrustNewIdentity;
+import org.asamk.signal.manager.api.ServiceEnvironment;
+import org.asamk.signal.manager.api.TrustNewIdentity;
import org.asamk.signal.output.JsonWriterImpl;
import org.asamk.signal.output.OutputWriter;
import org.asamk.signal.output.PlainTextWriterImpl;
parser.addArgument("--log-file")
.type(File.class)
.help("Write log output to the given file. If --verbose is also given, the detailed logs will only be written to the log file.");
+ parser.addArgument("--scrub-log")
+ .action(Arguments.storeTrue())
+ .help("Scrub possibly sensitive information from the log, like phone numbers and UUIDs.");
parser.addArgument("-c", "--config")
.help("Set the path, where to store the config (Default: $XDG_DATA_HOME/signal-cli , $HOME/.local/share/signal-cli).");
.type(Arguments.enumStringType(TrustNewIdentityCli.class))
.setDefault(TrustNewIdentityCli.ON_FIRST_USE);
+ parser.addArgument("--disable-send-log")
+ .help("Disable message send log (for resending messages that recipient couldn't decrypt)")
+ .action(Arguments.storeTrue());
+
var subparsers = parser.addSubparsers().title("subcommands").dest("command");
Commands.getCommandSubparserAttachers().forEach((key, value) -> {
return;
}
- if (!ServiceConfig.isSignalClientAvailable()) {
+ if (!Manager.isSignalClientAvailable()) {
throw new UserErrorException("Missing required native library dependency: libsignal-client");
}
? TrustNewIdentity.ON_FIRST_USE
: trustNewIdentityCli == TrustNewIdentityCli.ALWAYS ? TrustNewIdentity.ALWAYS : TrustNewIdentity.NEVER;
+ final var disableSendLog = Boolean.TRUE.equals(ns.getBoolean("disable-send-log"));
+
final SignalAccountFiles signalAccountFiles;
try {
signalAccountFiles = new SignalAccountFiles(configPath,
serviceEnvironment,
BaseConfig.USER_AGENT,
- trustNewIdentity);
+ new Settings(trustNewIdentity, disableSendLog));
} catch (IOException e) {
throw new IOErrorException("Failed to read local accounts list", e);
}