Skip to content

Commit

Permalink
v1.5 (build 230)
Browse files Browse the repository at this point in the history
  • Loading branch information
finiasz committed Mar 4, 2024
1 parent ef67745 commit 47f7d7a
Show file tree
Hide file tree
Showing 83 changed files with 1,837 additions and 742 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Build 230 (1.5)
2024-03-04

- Backward compatibility with ongoin location sharing
- Fix a small markdown bug

# ~~Build 229 (1.5)~~
2024-02-26

- Location sharing comes out of beta!
- Fix a crash with large 16-bit color depth PNG images
- Restart button in troubleshooting activity
- Update WebRTC and Sqlite-JDBC
- Emoji 15.1 support

# Build 227 (1.4)
2024-01-30

Expand Down
10 changes: 5 additions & 5 deletions obv_engine/engine/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ repositories {
dependencies {
// do not update further: jackson >2.13 does not work on older Android APIs
implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.4'
implementation files('libs/sqlite-jdbc-3.42.0.1.jar')
implementation files('libs/sqlite-jdbc-3.45.1.0.jar')

implementation 'org.slf4j:slf4j-api:2.0.11'
implementation 'org.slf4j:slf4j-simple:2.0.11'
implementation 'org.slf4j:slf4j-api:2.0.12'
implementation 'org.slf4j:slf4j-simple:2.0.12'

implementation 'org.bitbucket.b_c:jose4j:0.9.4'
implementation 'org.bitbucket.b_c:jose4j:0.9.5'

implementation 'com.squareup.okhttp3:okhttp:4.12.0'
implementation 'net.iharder:base64:2.3.9'

testImplementation 'junit:junit:4.13.2'
testImplementation 'org.xerial:sqlite-jdbc:3.42.0.1' // only here to check if a new version is available
testImplementation 'org.xerial:sqlite-jdbc:3.45.1.0' // only here to check if a new version is available
}
Binary file removed obv_engine/engine/libs/sqlite-jdbc-3.42.0.1.jar
Binary file not shown.
Binary file added obv_engine/engine/libs/sqlite-jdbc-3.45.1.0.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class PushNotificationTypeAndParameters {
public static final byte PUSH_NOTIFICATION_TYPE_WEBSOCKET_LINUX = 0x12;
public static final byte PUSH_NOTIFICATION_TYPE_WEBSOCKET_DAEMON = 0x13;

// public static final byte PUSH_NOTIFICATION_TYPE_ANDROID_EXPERIMENT = (byte) (0x80);
// public static final byte PUSH_NOTIFICATION_TYPE_NONE = (byte) 0xff;

public final byte pushNotificationType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
import io.olvid.engine.engine.types.JsonGroupDetailsWithVersionAndPhoto;
import io.olvid.engine.engine.types.JsonIdentityDetails;
import io.olvid.engine.engine.types.JsonIdentityDetailsWithVersionAndPhoto;
import io.olvid.engine.engine.types.JsonOsmStyle;
import io.olvid.engine.engine.types.ObvAttachment;
import io.olvid.engine.engine.types.ObvBackupKeyInformation;
import io.olvid.engine.engine.types.ObvBackupKeyVerificationOutput;
Expand Down Expand Up @@ -2425,10 +2426,10 @@ public void queryServerWellKnown(String server) {
}

@Override
public String getOsmServerUrl(byte[] bytesOwnedIdentity) {
public List<JsonOsmStyle> getOsmStyles(byte[] bytesOwnedIdentity) {
try {
Identity ownedIdentity = Identity.of(bytesOwnedIdentity);
return fetchManager.getOsmServerUrl(ownedIdentity.getServer());
return fetchManager.getOsmStyles(ownedIdentity.getServer());
} catch (Exception ignored) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ enum ApiKeyStatus {
void startFreeTrial(byte[] bytesOwnedIdentity);
void verifyReceipt(byte[] bytesOwnedIdentity, String storeToken);
void queryServerWellKnown(String server);
String getOsmServerUrl(byte[] bytesOwnedIdentity);
List<JsonOsmStyle> getOsmStyles(byte[] bytesOwnedIdentity);
String getAddressServerUrl(byte[] bytesOwnedIdentity);

void propagateAppSyncAtomToAllOwnedIdentitiesOtherDevicesIfNeeded(ObvSyncAtom obvSyncAtom) throws Exception;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Olvid for Android
* Copyright © 2019-2024 Olvid SAS
*
* This file is part of Olvid for Android.
*
* Olvid is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* Olvid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Olvid. If not, see <https://www.gnu.org/licenses/>.
*/

package io.olvid.engine.engine.types;


import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.util.Collections;
import java.util.Map;

@JsonIgnoreProperties(ignoreUnknown = true)
public class JsonOsmStyle {
public String id; // should never be null
public Map<String, String> name; // should never be null
public String url; // should never be null

public JsonOsmStyle() {}

public JsonOsmStyle(String id, String url) {
this.id = id;
this.name = Collections.emptyMap();
this.url = url;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@


import java.sql.SQLException;
import java.util.List;
import java.util.UUID;

import io.olvid.engine.datatypes.Identity;
Expand All @@ -31,6 +32,7 @@
import io.olvid.engine.datatypes.containers.ReceivedAttachment;
import io.olvid.engine.datatypes.containers.ServerQuery;
import io.olvid.engine.datatypes.key.symmetric.AuthEncKey;
import io.olvid.engine.engine.types.JsonOsmStyle;

public interface NetworkFetchDelegate {
void downloadMessages(Identity ownedIdentity, UID deviceUid);
Expand Down Expand Up @@ -65,6 +67,6 @@ public interface NetworkFetchDelegate {
void startFreeTrial(Identity ownedIdentity);
void verifyReceipt(Identity ownedIdentity, String storeToken);
void queryServerWellKnown(String server);
String getOsmServerUrl(String server);
List<JsonOsmStyle> getOsmStyles(String server);
String getAddressServerUrl(String server);
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;

import java.sql.SQLException;
import java.util.List;
import java.util.Objects;
import java.util.UUID;

Expand All @@ -41,6 +42,7 @@
import io.olvid.engine.datatypes.containers.ServerQuery;
import io.olvid.engine.datatypes.key.symmetric.AuthEncKey;
import io.olvid.engine.encoder.DecodingException;
import io.olvid.engine.engine.types.JsonOsmStyle;
import io.olvid.engine.metamanager.ChannelDelegate;
import io.olvid.engine.metamanager.CreateSessionDelegate;
import io.olvid.engine.metamanager.IdentityDelegate;
Expand Down Expand Up @@ -585,9 +587,9 @@ public void queryServerWellKnown(String server) {
}

@Override
public String getOsmServerUrl(String server) {
public List<JsonOsmStyle> getOsmStyles(String server) {
try {
return wellKnownCoordinator.getOsmUrl(server);
return wellKnownCoordinator.getOsmStyles(server);
} catch (Exception ignored) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,22 +120,24 @@ private void queueNewDownloadAttachmentOperation(Identity ownedIdentity, UID mes
Logger.d("Download attachment coordinator queueing new DownloadAttachmentOperation.");
DownloadAttachmentOperation op = new DownloadAttachmentOperation(fetchManagerSessionFactory, sslSocketFactory, ownedIdentity, messageUid, attachmentNumber, priorityCategory, initialPriority, this,null, this);
switch (priorityCategory) {
case DownloadAttachmentPriorityCategory.WEIGHT:
case DownloadAttachmentPriorityCategory.WEIGHT: {
downloadAttachmentOperationWeightQueue.queue(op);
PriorityOperation lowestPriorityExecutingOperation = downloadAttachmentOperationWeightQueue.getExecutingOperationThatShouldBeCancelledWhenQueueingWithHigherPriority();
if (lowestPriorityExecutingOperation != null && lowestPriorityExecutingOperation.getPriority() > initialPriority) {
Logger.d("Canceling a DownloadAttachmentOperation with lower priority " + lowestPriorityExecutingOperation.getPriority());
lowestPriorityExecutingOperation.cancel(DownloadAttachmentOperation.RFC_DOES_NOT_HAVE_THE_HIGHEST_PRIORITY);
}
break;
case DownloadAttachmentPriorityCategory.TIMESTAMP:
}
case DownloadAttachmentPriorityCategory.TIMESTAMP: {
downloadAttachmentOperationTimestampQueue.queue(op);
lowestPriorityExecutingOperation = downloadAttachmentOperationTimestampQueue.getExecutingOperationThatShouldBeCancelledWhenQueueingWithHigherPriority();
PriorityOperation lowestPriorityExecutingOperation = downloadAttachmentOperationTimestampQueue.getExecutingOperationThatShouldBeCancelledWhenQueueingWithHigherPriority();
if (lowestPriorityExecutingOperation != null && lowestPriorityExecutingOperation.getPriority() > initialPriority) {
Logger.d("Canceling a DownloadAttachmentOperation with lower priority " + lowestPriorityExecutingOperation.getPriority());
lowestPriorityExecutingOperation.cancel(DownloadAttachmentOperation.RFC_DOES_NOT_HAVE_THE_HIGHEST_PRIORITY);
}
break;
}
default:
Logger.w("Trying to queue a DownloadAttachmentOperation with unknown priorityCategory " + priorityCategory);
}
Expand Down Expand Up @@ -187,7 +189,7 @@ public void onCancelCallback(Operation operation) {
case DownloadAttachmentOperation.RFC_INVALID_CHUNK:
case DownloadAttachmentOperation.RFC_ATTACHMENT_CANNOT_BE_FETCHED:
case DownloadAttachmentOperation.RFC_UNABLE_TO_WRITE_CHUNK_TO_FILE:
case DownloadAttachmentOperation.RFC_UPLOAD_CANCELLED_BY_SENDER:
case DownloadAttachmentOperation.RFC_UPLOAD_CANCELLED_BY_SENDER: {
// We do not try to download the attachment again and mark it for deletion. We notify that the downloadAttachment failed.
try (FetchManagerSession fetchManagerSession = fetchManagerSessionFactory.getSession()) {
InboxAttachment attachment = InboxAttachment.get(fetchManagerSession, ownedIdentity, messageUid, attachmentNumber);
Expand All @@ -208,6 +210,7 @@ public void onCancelCallback(Operation operation) {
userInfo.put(DownloadNotifications.NOTIFICATION_ATTACHMENT_DOWNLOAD_FAILED_ATTACHMENT_NUMBER_KEY, attachmentNumber);
notificationPostingDelegate.postNotification(DownloadNotifications.NOTIFICATION_ATTACHMENT_DOWNLOAD_FAILED, userInfo);
break;
}
case DownloadAttachmentOperation.RFC_ATTACHMENT_CANNOT_BE_FOUND:
case DownloadAttachmentOperation.RFC_FETCH_NOT_REQUESTED:
case DownloadAttachmentOperation.RFC_MARKED_FOR_DELETION:
Expand All @@ -217,27 +220,29 @@ public void onCancelCallback(Operation operation) {
// wait for identity to become active again
waitForIdentityReactivation(ownedIdentity, messageUid, attachmentNumber, priorityCategory, initialPriority);
break;
case DownloadAttachmentOperation.RFC_DOES_NOT_HAVE_THE_HIGHEST_PRIORITY:
case DownloadAttachmentOperation.RFC_DOES_NOT_HAVE_THE_HIGHEST_PRIORITY: {
queueNewDownloadAttachmentOperation(ownedIdentity, messageUid, attachmentNumber, priorityCategory, initialPriority);

userInfo = new HashMap<>();
HashMap<String, Object> userInfo = new HashMap<>();
userInfo.put(DownloadNotifications.NOTIFICATION_ATTACHMENT_DOWNLOAD_WAS_PAUSED_OWNED_IDENTITY_KEY, ownedIdentity);
userInfo.put(DownloadNotifications.NOTIFICATION_ATTACHMENT_DOWNLOAD_WAS_PAUSED_MESSAGE_UID_KEY, messageUid);
userInfo.put(DownloadNotifications.NOTIFICATION_ATTACHMENT_DOWNLOAD_WAS_PAUSED_ATTACHMENT_NUMBER, attachmentNumber);
notificationPostingDelegate.postNotification(DownloadNotifications.NOTIFICATION_ATTACHMENT_DOWNLOAD_WAS_PAUSED, userInfo);
break;
}
case DownloadAttachmentOperation.RFC_INVALID_SIGNED_URL: {
waitForRefreshedUrls(ownedIdentity, messageUid, attachmentNumber, priorityCategory, initialPriority);
refreshInboxAttachmentSignedUrlDelegate.refreshInboxAttachmentSignedUrl(ownedIdentity, messageUid, attachmentNumber);
break;
}
case DownloadAttachmentOperation.RFC_DOWNLOAD_PAUSED:
userInfo = new HashMap<>();
case DownloadAttachmentOperation.RFC_DOWNLOAD_PAUSED: {
HashMap<String, Object> userInfo = new HashMap<>();
userInfo.put(DownloadNotifications.NOTIFICATION_ATTACHMENT_DOWNLOAD_WAS_PAUSED_OWNED_IDENTITY_KEY, ownedIdentity);
userInfo.put(DownloadNotifications.NOTIFICATION_ATTACHMENT_DOWNLOAD_WAS_PAUSED_MESSAGE_UID_KEY, messageUid);
userInfo.put(DownloadNotifications.NOTIFICATION_ATTACHMENT_DOWNLOAD_WAS_PAUSED_ATTACHMENT_NUMBER, attachmentNumber);
notificationPostingDelegate.postNotification(DownloadNotifications.NOTIFICATION_ATTACHMENT_DOWNLOAD_WAS_PAUSED, userInfo);
break;
}
case DownloadAttachmentOperation.RFC_NOT_YET_AVAILABLE_ON_SERVER:
case DownloadAttachmentOperation.RFC_NETWORK_ERROR:
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import io.olvid.engine.datatypes.NoDuplicateOperationQueue;
import io.olvid.engine.datatypes.Operation;
import io.olvid.engine.datatypes.notifications.DownloadNotifications;
import io.olvid.engine.engine.types.JsonOsmStyle;
import io.olvid.engine.metamanager.NotificationPostingDelegate;
import io.olvid.engine.networkfetch.databases.CachedWellKnown;
import io.olvid.engine.networkfetch.datatypes.FetchManagerSession;
Expand Down Expand Up @@ -153,13 +154,13 @@ public void onFinishCallback(Operation operation) {
if (updated) {
HashMap<String, Object> userInfo = new HashMap<>();
userInfo.put(DownloadNotifications.NOTIFICATION_WELL_KNOWN_UPDATED_SERVER_KEY, server);
userInfo.put(DownloadNotifications.NOTIFICATION_WELL_KNOWN_UPDATED_SERVER_CONFIG_KEY, jsonWellKnown.getServerConfig());
userInfo.put(DownloadNotifications.NOTIFICATION_WELL_KNOWN_UPDATED_APP_INFO_KEY, jsonWellKnown.getAppInfo());
userInfo.put(DownloadNotifications.NOTIFICATION_WELL_KNOWN_UPDATED_SERVER_CONFIG_KEY, jsonWellKnown.serverConfig);
userInfo.put(DownloadNotifications.NOTIFICATION_WELL_KNOWN_UPDATED_APP_INFO_KEY, jsonWellKnown.appInfo);
notificationPostingDelegate.postNotification(DownloadNotifications.NOTIFICATION_WELL_KNOWN_UPDATED, userInfo);
} else {
HashMap<String, Object> userInfo = new HashMap<>();
userInfo.put(DownloadNotifications.NOTIFICATION_WELL_KNOWN_DOWNLOAD_SUCCESS_SERVER_KEY, wellKnownDownloadOperation.getServer());
userInfo.put(DownloadNotifications.NOTIFICATION_WELL_KNOWN_DOWNLOAD_SUCCESS_APP_INFO_KEY, jsonWellKnown.getAppInfo());
userInfo.put(DownloadNotifications.NOTIFICATION_WELL_KNOWN_DOWNLOAD_SUCCESS_APP_INFO_KEY, jsonWellKnown.appInfo);
notificationPostingDelegate.postNotification(DownloadNotifications.NOTIFICATION_WELL_KNOWN_DOWNLOAD_SUCCESS, userInfo);
}
}
Expand Down Expand Up @@ -191,7 +192,7 @@ public String getWsUrl(String server) throws NotCachedException {
if (jsonWellKnown.serverConfig == null) {
return null;
}
return jsonWellKnown.serverConfig.getWebSocketUrl();
return jsonWellKnown.serverConfig.webSocketUrl;
}

@Override
Expand All @@ -211,7 +212,7 @@ public List<String> getTurnUrls(String server) throws NotCachedException {
}

@Override
public String getOsmUrl(String server) throws NotCachedException {
public List<JsonOsmStyle> getOsmStyles(String server) throws NotCachedException {
if (!cacheInitialized) {
throw new NotCachedException();
}
Expand All @@ -223,7 +224,7 @@ public String getOsmUrl(String server) throws NotCachedException {
if (jsonWellKnown.serverConfig == null) {
return null;
}
return jsonWellKnown.serverConfig.osmServerUrl;
return jsonWellKnown.serverConfig.osmStyles;
}

@Override
Expand All @@ -244,75 +245,24 @@ public String getAddressUrl(String server) throws NotCachedException {

@JsonIgnoreProperties(ignoreUnknown = true)
public static class JsonWellKnown {
JsonWellKnownServerConfig serverConfig;
Map<String, Integer> appInfo;

@JsonProperty("server")
public JsonWellKnownServerConfig getServerConfig() {
return serverConfig;
}

@JsonProperty("server")
public void setServerConfig(JsonWellKnownServerConfig serverConfig) {
this.serverConfig = serverConfig;
}

public JsonWellKnownServerConfig serverConfig;
@JsonProperty("app")
public Map<String, Integer> getAppInfo() {
return appInfo;
}

@JsonProperty("app")
public void setAppInfo(Map<String, Integer> appInfo) {
this.appInfo = appInfo;
}
public Map<String, Integer> appInfo;
}

@JsonIgnoreProperties(ignoreUnknown = true)
public static class JsonWellKnownServerConfig {
String webSocketUrl;
List<String> turnServerUrls;
String osmServerUrl;
String addressServerUrl;

@JsonProperty("ws_server")
public String getWebSocketUrl() {
return webSocketUrl;
}

@JsonProperty("ws_server")
public void setWebSocketUrl(String webSocketUrl) {
this.webSocketUrl = webSocketUrl;
}

@JsonProperty("turn_servers")
public List<String> getTurnServerUrls() {
return turnServerUrls;
}

public String webSocketUrl;
@JsonProperty("turn_servers")
public void setTurnServerUrls(List<String> turnServerUrls) {
this.turnServerUrls = turnServerUrls;
}

@JsonProperty("osm_server")
public String getOsmServerUrl() {
return osmServerUrl;
}

@JsonProperty("osm_server")
public void setOsmServerUrl(String osmServerUrl) {
this.osmServerUrl = osmServerUrl;
}

public List<String> turnServerUrls;
// no longer used since we have osmStyles
// @JsonProperty("osm_server")
// public String osmServerUrl;
@JsonProperty("address_server")
public String getAddressServerUrl() {
return addressServerUrl;
}

@JsonProperty("address_server")
public void setAddressServerUrl(String addressServerUrl) {
this.addressServerUrl = addressServerUrl;
}
public String addressServerUrl;
@JsonProperty("osm_styles")
public List<JsonOsmStyle> osmStyles;
}
}
Loading

0 comments on commit 47f7d7a

Please sign in to comment.