Skip to content

Commit

Permalink
v1.2 (build 219)
Browse files Browse the repository at this point in the history
  • Loading branch information
finiasz committed Nov 2, 2023
1 parent 7735490 commit 18c407a
Show file tree
Hide file tree
Showing 48 changed files with 1,969 additions and 707 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# Build 219 (1.2)
2023-11-02

- New troubleshooting activity
- Improved group cloning: it now preserves group admins

# ~~Build 218 (1.1.1)~~
2023-10-28

- Internal release

# Build 217 (1.1)
2023-10-24

Expand Down
8 changes: 5 additions & 3 deletions obv_messenger/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ android {
applicationId "io.olvid.messenger"
minSdkVersion 21
targetSdk 34
versionCode 217
versionName "1.1"
versionCode 219
versionName "1.2"
vectorDrawables.useSupportLibrary true
multiDexEnabled true
resourceConfigurations += ['en', 'fr']
Expand Down Expand Up @@ -139,7 +139,8 @@ dependencies {
implementation 'androidx.lifecycle:lifecycle-runtime-compose:2.6.2'
implementation 'androidx.compose.ui:ui-tooling-preview'
debugImplementation 'androidx.compose.ui:ui-tooling'
implementation 'com.google.accompanist:accompanist-themeadapter-appcompat:0.31.1-alpha'
implementation 'com.google.accompanist:accompanist-themeadapter-appcompat:0.33.2-alpha'
implementation 'com.google.accompanist:accompanist-permissions:0.33.2-alpha'
implementation 'io.coil-kt:coil-compose:2.3.0'

// starting with zxing 3.4.0, API level 24 is required...
Expand Down Expand Up @@ -172,6 +173,7 @@ dependencies {
implementation 'androidx.sharetarget:sharetarget:1.2.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'androidx.work:work-runtime:2.8.1'
implementation 'androidx.datastore:datastore-preferences:1.0.0'

implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1'
implementation 'org.jsoup:jsoup:1.16.1'
Expand Down
3 changes: 3 additions & 0 deletions obv_messenger/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,9 @@
android:name=".onboarding.flow.OnboardingFlowActivity"
android:launchMode="singleTop"
android:theme="@style/AppTheme.NoActionBar.LightBlueStatusBar" />
<activity
android:name=".troubleshooting.TroubleshootingActivity"
android:theme="@style/AppTheme.NoActionBar.AlmostWhiteStatusBar" />
<activity
android:name=".appdialogs.AppDialogShowActivity"
android:configChanges="orientation|screenSize|screenLayout|uiMode"
Expand Down
20 changes: 14 additions & 6 deletions obv_messenger/app/src/main/java/io/olvid/messenger/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.ProcessLifecycleOwner;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.media3.common.util.UnstableApi;
import androidx.preference.PreferenceManager;

import com.google.zxing.BarcodeFormat;
Expand Down Expand Up @@ -285,31 +286,31 @@ public static void openGroupV2DiscussionActivity(Context activityContext, byte[]
activityContext.startActivity(intent);
}

public static void openDiscussionGalleryActivity(Context activityContext, long discussionId, long messageId, long fyleId) {
@UnstableApi public static void openDiscussionGalleryActivity(Context activityContext, long discussionId, long messageId, long fyleId) {
Intent intent = new Intent(getContext(), GalleryActivity.class);
intent.putExtra(GalleryActivity.DISCUSSION_ID_INTENT_EXTRA, discussionId);
intent.putExtra(GalleryActivity.INITIAL_MESSAGE_ID_INTENT_EXTRA, messageId);
intent.putExtra(GalleryActivity.INITIAL_FYLE_ID_INTENT_EXTRA, fyleId);
activityContext.startActivity(intent);
}

public static void openDraftGalleryActivity(Context activityContext, long draftMessageId, long fyleId) {
@UnstableApi public static void openDraftGalleryActivity(Context activityContext, long draftMessageId, long fyleId) {
Intent intent = new Intent(getContext(), GalleryActivity.class);
intent.putExtra(GalleryActivity.DRAFT_INTENT_EXTRA, true);
intent.putExtra(GalleryActivity.INITIAL_MESSAGE_ID_INTENT_EXTRA, draftMessageId);
intent.putExtra(GalleryActivity.INITIAL_FYLE_ID_INTENT_EXTRA, fyleId);
activityContext.startActivity(intent);
}

public static void openMessageGalleryActivity(Context activityContext, long messageId, long fyleId) {
@UnstableApi public static void openMessageGalleryActivity(Context activityContext, long messageId, long fyleId) {
Intent intent = new Intent(getContext(), GalleryActivity.class);
intent.putExtra(GalleryActivity.DRAFT_INTENT_EXTRA, false);
intent.putExtra(GalleryActivity.INITIAL_MESSAGE_ID_INTENT_EXTRA, messageId);
intent.putExtra(GalleryActivity.INITIAL_FYLE_ID_INTENT_EXTRA, fyleId);
activityContext.startActivity(intent);
}

public static void openOwnedIdentityGalleryActivity(Context activityContext, byte[] bytesOwnedIdentity, @Nullable String sortOrder, boolean ascending, long messageId, long fyleId) {
@UnstableApi public static void openOwnedIdentityGalleryActivity(Context activityContext, byte[] bytesOwnedIdentity, @Nullable String sortOrder, boolean ascending, long messageId, long fyleId) {
Intent intent = new Intent(getContext(), GalleryActivity.class);
intent.putExtra(GalleryActivity.BYTES_OWNED_IDENTITY_INTENT_EXTRA, bytesOwnedIdentity);
if (sortOrder != null) {
Expand All @@ -327,7 +328,7 @@ public static void openGroupCreationActivity(Context activityContext) {
activityContext.startActivity(intent);
}

public static void openGroupCreationActivityForCloning(Context activityContext, String absolutePhotoUrl, String serializedGroupDetails, String serializedGroupType, List<Contact> preselectedGroupMembers) {
public static void openGroupCreationActivityForCloning(Context activityContext, String absolutePhotoUrl, String serializedGroupDetails, String serializedGroupType, List<Contact> preselectedGroupMembers, List<Contact> preselectedGroupAdminMembers) {
Intent intent = new Intent(getContext(), GroupCreationActivity.class);
if (absolutePhotoUrl != null) {
intent.putExtra(GroupCreationActivity.ABSOLUTE_PHOTO_URL_INTENT_EXTRA, absolutePhotoUrl);
Expand All @@ -345,6 +346,13 @@ public static void openGroupCreationActivityForCloning(Context activityContext,
}
intent.putParcelableArrayListExtra(GroupCreationActivity.PRESELECTED_GROUP_MEMBERS_INTENT_EXTRA, parcelables);
}
if (preselectedGroupAdminMembers != null) {
ArrayList<Parcelable> parcelables = new ArrayList<>(preselectedGroupAdminMembers.size());
for (Contact contact : preselectedGroupAdminMembers) {
parcelables.add(new BytesKey(contact.bytesContactIdentity));
}
intent.putParcelableArrayListExtra(GroupCreationActivity.PRESELECTED_GROUP_ADMIN_MEMBERS_INTENT_EXTRA, parcelables);
}
activityContext.startActivity(intent);
}

Expand Down Expand Up @@ -1161,7 +1169,7 @@ public void run() {

private static EngineNotificationListener backupKeyListener = null;

private void configureMdmWebDavAutomaticBackups() throws Exception {
static void configureMdmWebDavAutomaticBackups() throws Exception {
BackupCloudProviderService.CloudProviderConfiguration mdmAutoBackupConfiguration = MDMConfigurationSingleton.getAutoBackupConfiguration();
if (mdmAutoBackupConfiguration != null) {
BackupCloudProviderService.CloudProviderConfiguration currentAutoBackupConfiguration = SettingsActivity.getAutomaticBackupConfiguration();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
import io.olvid.messenger.notifications.AndroidNotificationManager;
import io.olvid.messenger.openid.KeycloakManager;
import io.olvid.messenger.services.BackupCloudProviderService;
import io.olvid.messenger.services.MDMConfigurationSingleton;
import io.olvid.messenger.services.PeriodicTasksScheduler;
import io.olvid.messenger.settings.SettingsActivity;

Expand Down Expand Up @@ -135,14 +136,6 @@ private AppSingleton() {
SettingsActivity.setContactDisplayNameFormat(JsonIdentityDetails.FORMAT_STRING_FIRST_LAST_POSITION_COMPANY);
}

if (lastBuildExecuted != 0 && lastBuildExecuted < 124) {
// clear missing google service dialog hide preference
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(App.getContext());
SharedPreferences.Editor editor = prefs.edit();
editor.remove(SettingsActivity.USER_DIALOG_HIDE_GOOGLE_APIS);
editor.apply();
}

if (lastBuildExecuted != 0 && lastBuildExecuted < 136) {
// clear deprecated scaled_turn preference
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(App.getContext());
Expand All @@ -165,6 +158,19 @@ private AppSingleton() {
App.runThread(new ContactDisplayNameFormatChangedTask());
}

if (lastBuildExecuted != 0 && lastBuildExecuted < 219) {
// clear removed dialog hide preference
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(App.getContext());
SharedPreferences.Editor editor = prefs.edit();
editor.remove("user_dialog_hide_battery_optimization");
editor.remove("user_dialog_hide_background_restricted");
editor.remove("user_dialog_hide_alarm_scheduling");
editor.remove("user_dialog_hide_allow_notifications");
editor.remove("user_dialog_hide_full_screen_notification");
editor.remove("pref_key_last_backup_reminder_timestamp");
editor.apply();
}

// TODO: enable this once location is no longer in beta
// if (lastBuildExecuted != 0 && lastBuildExecuted < 171) {
// // if the user has customized attach icon order, add the send location icon so they see it
Expand Down Expand Up @@ -649,6 +655,14 @@ public void generateIdentity(@NonNull final String server,
}
}

// in case we have an MDM configuration, reload it and reconfigure backups
MDMConfigurationSingleton.reloadMDMConfiguration();
try {
App.AppStartupTasks.configureMdmWebDavAutomaticBackups();
} catch (Exception e) {
e.printStackTrace();
}

App.runThread(new OwnedDevicesSynchronisationWithEngineTask(ownedIdentity.bytesOwnedIdentity));

selectIdentity(ownedIdentity.bytesOwnedIdentity, (OwnedIdentity ignored) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public static ClonabilityOutput getClonability(@NonNull Group group) {
null,
absolutePhotoUrl,
clonableGroupContacts,
new ArrayList<>(),
nonGroupV2CapableContacts,
nonContactOrNonChanelSerializedDetails
);
Expand All @@ -144,6 +145,7 @@ public static ClonabilityOutput getClonability(@NonNull Group2 group2) {
}

List<Contact> clonableGroupContacts = new ArrayList<>();
List<Contact> clonableGroupAdminContacts = new ArrayList<>();
List<String> nonContactOrNonChanelSerializedDetails = new ArrayList<>();


Expand All @@ -155,7 +157,11 @@ public static ClonabilityOutput getClonability(@NonNull Group2 group2) {
if (group2Member.contact == null || !group2Member.contact.capabilityGroupsV2 || group2Member.contact.establishedChannelCount == 0) {
nonContactOrNonChanelSerializedDetails.add(group2Member.identityDetails);
} else {
clonableGroupContacts.add(group2Member.contact);
if (group2Member.permissionAdmin) {
clonableGroupAdminContacts.add(group2Member.contact);
} else {
clonableGroupContacts.add(group2Member.contact);
}
}
}

Expand All @@ -165,6 +171,7 @@ public static ClonabilityOutput getClonability(@NonNull Group2 group2) {
serializedGroupType,
absolutePhotoUrl,
clonableGroupContacts,
clonableGroupAdminContacts,
new ArrayList<>(),
nonContactOrNonChanelSerializedDetails
);
Expand All @@ -176,17 +183,19 @@ public static class ClonabilityOutput {
public final String serializedGroupDetails; // contains the actual group name (or custom name), never the members names
public final String serializedGroupType;
public final String absolutePhotoUrl;
public final List<Contact> clonableGroupContacts; // list of contacts in the group (or pending) with whom I have a channel and that have group v2 capability
public final List<Contact> clonableGroupContacts; // list of non admin contacts in the group (or pending) with whom I have a channel and that have group v2 capability
public final List<Contact> clonableGroupAdminContacts; // list of admins in the group (or pending) with whom I have a channel and that have group v2 capability
public final List<Contact> nonGroupV2CapableContacts; // contacts without group v2 capability
public final List<String> nonContactOrNonChanelSerializedDetails; // serializedIdentityDetails of group members without a channel or with whom I am not in contact


public ClonabilityOutput(String groupDisplayName, String serializedGroupDetails, String serializedGroupType, String absolutePhotoUrl, List<Contact> clonableGroupContacts, List<Contact> nonGroupV2CapableContacts, List<String> nonContactOrNonChanelSerializedDetails) {
public ClonabilityOutput(String groupDisplayName, String serializedGroupDetails, String serializedGroupType, String absolutePhotoUrl, List<Contact> clonableGroupContacts, List<Contact> clonableGroupAdminContacts, List<Contact> nonGroupV2CapableContacts, List<String> nonContactOrNonChanelSerializedDetails) {
this.groupDisplayName = groupDisplayName;
this.serializedGroupDetails = serializedGroupDetails;
this.serializedGroupType = serializedGroupType;
this.absolutePhotoUrl = absolutePhotoUrl;
this.clonableGroupContacts = clonableGroupContacts;
this.clonableGroupAdminContacts = clonableGroupAdminContacts;
this.nonGroupV2CapableContacts = nonGroupV2CapableContacts;
this.nonContactOrNonChanelSerializedDetails = nonContactOrNonChanelSerializedDetails;
}
Expand Down Expand Up @@ -228,11 +237,11 @@ public static void initiateGroupCloningOrWarnUser(FragmentActivity activity, Clo
.setMessage(activity.getString(R.string.dialog_message_clone_group_warning_missing_members,
clonabilityOutput.groupDisplayName,
sb.toString()))
.setPositiveButton(R.string.button_label_proceed, ((DialogInterface dialog, int which) -> App.openGroupCreationActivityForCloning(activity, clonabilityOutput.absolutePhotoUrl, clonabilityOutput.serializedGroupDetails, clonabilityOutput.serializedGroupType, clonabilityOutput.clonableGroupContacts)))
.setPositiveButton(R.string.button_label_proceed, ((DialogInterface dialog, int which) -> App.openGroupCreationActivityForCloning(activity, clonabilityOutput.absolutePhotoUrl, clonabilityOutput.serializedGroupDetails, clonabilityOutput.serializedGroupType, clonabilityOutput.clonableGroupContacts, clonabilityOutput.clonableGroupAdminContacts)))
.setNegativeButton(R.string.button_label_cancel, null);
confirmationBuilder.create().show();
} else {
App.openGroupCreationActivityForCloning(activity, clonabilityOutput.absolutePhotoUrl, clonabilityOutput.serializedGroupDetails, clonabilityOutput.serializedGroupType, clonabilityOutput.clonableGroupContacts);
App.openGroupCreationActivityForCloning(activity, clonabilityOutput.absolutePhotoUrl, clonabilityOutput.serializedGroupDetails, clonabilityOutput.serializedGroupType, clonabilityOutput.clonableGroupContacts, clonabilityOutput.clonableGroupAdminContacts);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ public Boolean call() {
appBackupPojo.settings.restore();
}
new Handler(Looper.getMainLooper()).post(SettingsActivity::setDefaultNightMode);
SettingsActivity.setLastBackupReminderTimestamp(System.currentTimeMillis());

return true;
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,14 @@ public void onBackPressed() {
AlertDialog.Builder builder = new SecureAlertDialogBuilder(this, R.style.CustomAlertDialog)
.setTitle(R.string.dialog_title_shared_ephemeral_settings_modified)
.setMessage(R.string.dialog_message_shared_ephemeral_settings_modified)
.setNegativeButton(R.string.button_label_discard, (dialog, which) -> discussionSettingsViewModel.discardEphemeralSettings())
.setPositiveButton(R.string.button_label_update, (dialog, which) -> discussionSettingsViewModel.saveEphemeralSettingsAndNotifyPeers())
.setOnDismissListener(dialog -> super.onBackPressed());
.setNegativeButton(R.string.button_label_discard, (dialog, which) -> {
discussionSettingsViewModel.discardEphemeralSettings();
super.onBackPressed();
})
.setPositiveButton(R.string.button_label_update, (dialog, which) -> {
discussionSettingsViewModel.saveEphemeralSettingsAndNotifyPeers();
super.onBackPressed();
});
builder.create().show();
} else {
super.onBackPressed();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,11 @@ public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float ve
&& e1.getY() > 100 // no fling if starting from top of screen (like to show status bar)
) {
finish();
overridePendingTransition(R.anim.none, R.anim.dismiss_from_fling_down);
if (velocityY < 0) {
overridePendingTransition(R.anim.none, R.anim.dismiss_from_fling_up);
} else {
overridePendingTransition(R.anim.none, R.anim.dismiss_from_fling_down);
}
return true;
}
return false;
Expand Down
Loading

0 comments on commit 18c407a

Please sign in to comment.