From eeda46338d9b879aa01dd50a17486935aebde4ee Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Thu, 20 Apr 2017 15:58:39 +0100 Subject: [PATCH] Disallow sharing of journals with version < 2. The reason for that is that before version 2, all the journals of a particular user shared the same encryption key, which means, sharing a journal of version one, would essentially give away the encryption key of all of its journals, even the private ones. This is thus blocked for security reasons. --- .../syncadapter/ui/ViewCollectionActivity.java | 12 ++++++++++++ app/src/main/res/values/strings.xml | 1 + 2 files changed, 13 insertions(+) diff --git a/app/src/main/java/com/etesync/syncadapter/ui/ViewCollectionActivity.java b/app/src/main/java/com/etesync/syncadapter/ui/ViewCollectionActivity.java index a7ecf66c..ac6d8742 100644 --- a/app/src/main/java/com/etesync/syncadapter/ui/ViewCollectionActivity.java +++ b/app/src/main/java/com/etesync/syncadapter/ui/ViewCollectionActivity.java @@ -197,6 +197,18 @@ public class ViewCollectionActivity extends AppCompatActivity implements Refresh @Override public void onClick(DialogInterface dialog, int which) { + } + }).create(); + dialog.show(); + } else if (info.version < 2) { + AlertDialog dialog = new AlertDialog.Builder(this) + .setIcon(R.drawable.ic_info_dark) + .setTitle(R.string.not_allowed_title) + .setMessage(R.string.members_old_journals_not_allowed) + .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + } }).create(); dialog.show(); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ccde4449..d393ebc2 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -107,6 +107,7 @@ Not Allowed Only the owner of this collection (%s) is allowed to edit it. Sharing of address books is currently not supported. + Sharing of old-style journals is not allowed. In order to share this journal, create a new one, and copy its contents over using the \"import\" dialog. If you are experiencing any issues, please contact support. Members