import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import org.whispersystems.libaxolotl.*;
+import org.whispersystems.libaxolotl.AxolotlAddress;
+import org.whispersystems.libaxolotl.IdentityKey;
+import org.whispersystems.libaxolotl.IdentityKeyPair;
+import org.whispersystems.libaxolotl.InvalidKeyIdException;
import org.whispersystems.libaxolotl.state.AxolotlStore;
import org.whispersystems.libaxolotl.state.PreKeyRecord;
import org.whispersystems.libaxolotl.state.SessionRecord;
import org.whispersystems.libaxolotl.state.SignedPreKeyRecord;
-import java.io.IOException;
import java.util.List;
class JsonAxolotlStore implements AxolotlStore {
String trustedKeyName = trustedKey.get("name").asText();
try {
trustedKeyMap.put(trustedKeyName, new IdentityKey(Base64.decode(trustedKey.get("identityKey").asText()), 0));
- } catch (InvalidKeyException | IOException e) {
+ } catch (InvalidKeyException | IOException e) {
System.out.println(String.format("Error while decoding key for: %s", trustedKeyName));
}
}
Integer preKeyId = preKey.get("id").asInt();
try {
preKeyMap.put(preKeyId, Base64.decode(preKey.get("record").asText()));
- } catch (IOException e) {
+ } catch (IOException e) {
System.out.println(String.format("Error while decoding prekey for: %s", preKeyId));
}
}
String sessionName = session.get("name").asText();
try {
sessionMap.put(new AxolotlAddress(sessionName, session.get("deviceId").asInt()), Base64.decode(session.get("record").asText()));
- } catch (IOException e) {
+ } catch (IOException e) {
System.out.println(String.format("Error while decoding session for: %s", sessionName));
}
}
Integer preKeyId = preKey.get("id").asInt();
try {
preKeyMap.put(preKeyId, Base64.decode(preKey.get("record").asText()));
- } catch (IOException e) {
+ } catch (IOException e) {
System.out.println(String.format("Error while decoding prekey for: %s", preKeyId));
}
}
private final static String URL = "https://textsecure-service.whispersystems.org";
private final static TrustStore TRUST_STORE = new WhisperTrustStore();
- public final static String PROJECT_NAME = Manager.class.getPackage().getImplementationTitle();
- public final static String PROJECT_VERSION = Manager.class.getPackage().getImplementationVersion();
+ public final static String PROJECT_NAME = Manager.class.getPackage().getImplementationTitle();
+ public final static String PROJECT_VERSION = Manager.class.getPackage().getImplementationVersion();
private final static String USER_AGENT = PROJECT_NAME + " " + PROJECT_VERSION;
private final static String settingsPath = System.getProperty("user.home") + "/.config/textsecure";