Skip to content

Commit

Permalink
v3.3 (build 255)
Browse files Browse the repository at this point in the history
  • Loading branch information
finiasz committed Nov 14, 2024
1 parent 06363c6 commit 983969d
Show file tree
Hide file tree
Showing 188 changed files with 6,173 additions and 1,745 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Build 255 (3.3)
2024-11-14

- Improved global search layout and performance (tabs, search in group member names, search in personal notes, etc.)
- Support for incoming call notification during a call
- Improved RTL language support

# Build 254 (3.2.2)
2024-10-18

Expand Down
9 changes: 7 additions & 2 deletions obv_engine/engine/src/main/java/io/olvid/engine/Logger.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,13 @@ public static void e(String message) {
}
public static void e(String message, Exception e) {
log(ERROR, message + "( " + e.toString() + ")");
e.printStackTrace();
x(e);
}
public static void x(Throwable throwable) {
if (WARNING >= outputLogLevel) {
outputter.x("Logger", throwable);
}
}


private static final char[] hexArray = "0123456789ABCDEF".toCharArray();
public static String toHexString(byte[] bytes) {
Expand Down Expand Up @@ -121,5 +125,6 @@ public interface LogOutputter {
void i(String tag, String message);
void w(String tag, String message);
void e(String tag, String message);
void x(String tag, Throwable throwable);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public void initialisationComplete() {
}
backupManagerSession.session.commit();
} catch (Exception e) {
e.printStackTrace();
Logger.x(e);
}
}

Expand All @@ -136,7 +136,7 @@ public void setDelegate(CreateSessionDelegate createSessionDelegate) {
BackupKey.createTable(backupManagerSession.session);
backupManagerSession.session.commit();
} catch (SQLException e) {
e.printStackTrace();
Logger.x(e);
throw new RuntimeException("Unable to create backup databases");
}
}
Expand Down Expand Up @@ -202,11 +202,11 @@ public void generateNewBackupKey() {
userInfo.put(BackupNotifications.NOTIFICATION_NEW_BACKUP_SEED_GENERATED_SEED_KEY, backupSeed.toString());
notificationPostingDelegate.postNotification(BackupNotifications.NOTIFICATION_NEW_BACKUP_SEED_GENERATED, userInfo);
} catch (SQLException e) {
e.printStackTrace();
Logger.x(e);
throw new Exception("Failed to save new BackupKey to database");
}
} catch (Exception e) {
e.printStackTrace();
Logger.x(e);
notificationPostingDelegate.postNotification(BackupNotifications.NOTIFICATION_BACKUP_SEED_GENERATION_FAILED, new HashMap<>());
}
}
Expand Down Expand Up @@ -265,7 +265,7 @@ public void setAutoBackupEnabled(boolean enabled, boolean initiateBackupNowIfNee
}
}
} catch (SQLException e) {
e.printStackTrace();
Logger.x(e);
}
}

Expand Down Expand Up @@ -319,7 +319,7 @@ public void initiateBackup(boolean forExpert) {
userInfo.put(BackupNotifications.NOTIFICATION_APP_BACKUP_INITIATION_REQUEST_VERSION_KEY, newVersion);
notificationPostingDelegate.postNotification(BackupNotifications.NOTIFICATION_APP_BACKUP_INITIATION_REQUEST, userInfo);
} catch (Exception e) {
e.printStackTrace();
Logger.x(e);
// nothing to do...
}
});
Expand Down Expand Up @@ -445,7 +445,7 @@ public void backupSuccess(String tag, UID backupKeyUid, int version, String back
notificationPostingDelegate.postNotification(BackupNotifications.NOTIFICATION_BACKUP_FINISHED, userInfo);
}
} catch (Exception e) {
e.printStackTrace();
Logger.x(e);
backupFailed(tag, backupKeyUid, version);
}
});
Expand Down Expand Up @@ -494,7 +494,7 @@ public void markBackupExported(UID backupKeyUid, int version) {
}
backupManagerSession.session.commit();
} catch (SQLException e) {
e.printStackTrace();
Logger.x(e);
}
}

Expand All @@ -516,7 +516,7 @@ public void markBackupUploaded(UID backupKeyUid, int version) {
}
backupManagerSession.session.commit();
} catch (SQLException e) {
e.printStackTrace();
Logger.x(e);
}
}

Expand All @@ -534,7 +534,7 @@ public void discardBackup(UID backupKeyUid, int version) {
backup.setFailed();
Logger.d("Backup discarded.");
} catch (SQLException e) {
e.printStackTrace();
Logger.x(e);
}
}

Expand Down Expand Up @@ -636,7 +636,7 @@ public ObvIdentity[] restoreOwnedIdentitiesFromBackup(String seedString, byte[]

return identityDelegate.restoreOwnedIdentitiesFromBackup(backupContentAndDerivedKeys.pojo.engine.identity_manager, deviceDisplayName, prng);
} catch (Exception e) {
e.printStackTrace();
Logger.x(e);
return null;
}
}
Expand All @@ -660,7 +660,7 @@ public void restoreContactsAndGroupsFromBackup(String seedString, byte[] backupC

notificationPostingDelegate.postNotification(BackupNotifications.NOTIFICATION_BACKUP_RESTORATION_FINISHED, new HashMap<>());
} catch (Exception e) {
e.printStackTrace();
Logger.x(e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void initialisationComplete() {
ObliviousChannel.clean(channelManagerSession);
channelManagerSession.session.commit();
} catch (Exception e) {
e.printStackTrace();
Logger.x(e);
}

try (ChannelManagerSession channelManagerSession = getSession()) {
Expand All @@ -115,7 +115,7 @@ public void initialisationComplete() {
}
channelManagerSession.session.commit();
} catch (Exception e) {
e.printStackTrace();
Logger.x(e);
}

try (ChannelManagerSession channelManagerSession = getSession()) {
Expand Down Expand Up @@ -215,7 +215,7 @@ public void initialisationComplete() {

channelManagerSession.session.commit();
} catch (Exception e) {
e.printStackTrace();
Logger.x(e);
}
}

Expand All @@ -228,7 +228,7 @@ public void setDelegate(CreateSessionDelegate createSessionDelegate) {
ProvisionedKeyMaterial.createTable(channelManagerSession.session);
channelManagerSession.session.commit();
} catch (SQLException e) {
e.printStackTrace();
Logger.x(e);
throw new RuntimeException("Unable to create channel databases");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private void decryptAndProcess(ChannelManagerSession channelManagerSession, Netw
}
}
} catch (Exception e) {
e.printStackTrace();
Logger.x(e);
}
}
}
Expand Down Expand Up @@ -171,7 +171,7 @@ private void decryptAndProcess(ChannelManagerSession channelManagerSession, Netw
channelReceivedMessage.getExtendedPayloadKey()
);
} catch (Exception e) {
e.printStackTrace();
Logger.x(e);
Logger.i("Error while processing a ChannelReceivedApplicationMessage.");
channelManagerSession.networkFetchDelegate.deleteMessageAndAttachments(channelManagerSession.session, networkReceivedMessage.getOwnedIdentity(), networkReceivedMessage.getMessageUid());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ private RatchetingOutput selfRatchet() {
statement.executeUpdate();
this.seedForNextSendKey = ratchetingOutput.getRatchetedSeed();
} catch (SQLException e) {
e.printStackTrace();
Logger.x(e);
return null;
}
return ratchetingOutput;
Expand Down Expand Up @@ -338,7 +338,7 @@ public static ObliviousChannel create(ChannelManagerSession channelManagerSessio
}
return obliviousChannel;
} catch (SQLException e) {
e.printStackTrace();
Logger.x(e);
return null;
}
}
Expand Down Expand Up @@ -498,7 +498,7 @@ public static ObliviousChannel get(ChannelManagerSession channelManagerSession,
}
}
} catch (SQLException e) {
e.printStackTrace();
Logger.x(e);
}
return null;
}
Expand Down Expand Up @@ -600,7 +600,7 @@ public static void deleteMany(final ChannelManagerSession channelManagerSession,
channelManagerSession.notificationPostingDelegate.postNotification(ChannelNotifications.NOTIFICATION_OBLIVIOUS_CHANNEL_DELETED, userInfo);
});
} catch (SQLException e) {
e.printStackTrace();
Logger.x(e);
}
}

Expand Down Expand Up @@ -641,7 +641,7 @@ public void wasCommitted() {
channelManagerSession.fullRatchetProtocolStarterDelegate.startFullRatchetProtocolForObliviousChannel(currentDeviceUid, remoteDeviceUid, remoteIdentity);
} catch (Exception e) {
// no need to do anything, the next message will try to restart the full ratchet
e.printStackTrace();
Logger.x(e);
}
} else {
Logger.w("Full ratchet required, but no FullRatchetProtocolStarterDelegate is set.");
Expand Down Expand Up @@ -848,7 +848,7 @@ public MessageToSend.Header wrapMessageKey(AuthEncKey messageKey, PRNGService pr
try {
encryptedMessageKey = authEnc.encrypt(ratchetingOutput.getAuthEncKey(), Encoded.of(messageKey).getBytes(), prng);
} catch (InvalidKeyException e) {
e.printStackTrace();
Logger.x(e);
return null;
}
byte[] headerBytes = new byte[KeyId.KEYID_LENGTH + encryptedMessageKey.length];
Expand All @@ -873,7 +873,7 @@ public MessageToSend.Header wrapMessageKey(AuthEncKey messageKey, PRNGService pr
channelManagerSession.session.addSessionCommitListener(this);
}
} catch (SQLException e) {
e.printStackTrace();
Logger.x(e);
return null;
}
return header;
Expand All @@ -891,7 +891,7 @@ public static AuthEncKeyAndChannelInfo unwrapMessageKey(ChannelManagerSession ch
deviceUid = channelManagerSession.identityDelegate.getCurrentDeviceUidOfOwnedIdentity(channelManagerSession.session, header.getOwnedIdentity());
} catch (SQLException e) {
Logger.e("Error retrieving a currentDeviceUid -> a received message might have been lost...");
e.printStackTrace();
Logger.x(e);
return null;
}
ProvisionedKeyMaterial[] provisionedKeys = ProvisionedKeyMaterial.getAll(channelManagerSession, keyId, deviceUid);
Expand Down Expand Up @@ -934,7 +934,7 @@ public static AuthEncKeyAndChannelInfo unwrapMessageKey(ChannelManagerSession ch
obliviousChannel.commitHookBits |= HOOK_BIT_MIGHT_NEED_FULL_RATCHET;
channelManagerSession.session.addSessionCommitListener(obliviousChannel);
} catch (SQLException e) {
e.printStackTrace();
Logger.x(e);
}
}
try {
Expand All @@ -943,7 +943,7 @@ public static AuthEncKeyAndChannelInfo unwrapMessageKey(ChannelManagerSession ch
obliviousChannel.confirm();
}
} catch (SQLException e) {
e.printStackTrace();
Logger.x(e);
}
ReceptionChannelInfo receptionChannelInfo = obliviousChannel.getReceptionChannelInfo();
// add information about GKMV2 in receptionChannelInfo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.util.ArrayList;
import java.util.List;

import io.olvid.engine.Logger;
import io.olvid.engine.channel.datatypes.ChannelManagerSession;
import io.olvid.engine.channel.datatypes.RatchetingOutput;
import io.olvid.engine.datatypes.Constants;
Expand Down Expand Up @@ -112,7 +113,7 @@ private void selfRatchet(int count) {
statement.setBytes(6, obliviousChannelRemoteIdentity.getBytes());
statement.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
Logger.x(e);
}
}

Expand All @@ -135,7 +136,7 @@ public static void deleteAllEmpty(ChannelManagerSession channelManagerSession) {
")")) {
statement.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
Logger.x(e);
}
}

Expand All @@ -156,7 +157,7 @@ public static Provision createOrReplace(ChannelManagerSession channelManagerSess
provision.selfRatchet(2*Constants.REPROVISIONING_THRESHOLD);
return provision;
} catch (SQLException e) {
e.printStackTrace();
Logger.x(e);
return null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.util.ArrayList;
import java.util.List;

import io.olvid.engine.Logger;
import io.olvid.engine.channel.datatypes.ChannelManagerSession;
import io.olvid.engine.datatypes.Constants;
import io.olvid.engine.datatypes.Identity;
Expand Down Expand Up @@ -144,7 +145,7 @@ public static ProvisionedKeyMaterial create(ChannelManagerSession channelManager
provisionedKeyMaterial.insert();
return provisionedKeyMaterial;
} catch (SQLException e) {
e.printStackTrace();
Logger.x(e);
return null;
}
}
Expand All @@ -171,7 +172,7 @@ private ProvisionedKeyMaterial(ChannelManagerSession channelManagerSession, Resu
try {
this.authEncKey = (AuthEncKey) new Encoded(res.getBytes(AUTH_ENC_KEY)).decodeSymmetricKey();
} catch (DecodingException e) {
e.printStackTrace();
Logger.x(e);
}
this.expirationTimestamp = res.getLong(EXPIRATION_TIMESTAMP);
this.selfRatchetingCount = res.getInt(SELF_RATCHETING_COUNT);
Expand Down
Loading

0 comments on commit 983969d

Please sign in to comment.