mirror of
https://github.com/nextcloud/android.git
synced 2024-11-28 18:28:59 +03:00
if e2e app is disabled, show info
Signed-off-by: tobiaskaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
c1c0a4b5ae
commit
530b545d2e
2 changed files with 15 additions and 1 deletions
|
@ -75,6 +75,8 @@ import com.owncloud.android.lib.resources.files.SearchOperation;
|
|||
import com.owncloud.android.lib.resources.files.ToggleEncryptionOperation;
|
||||
import com.owncloud.android.lib.resources.files.ToggleFavoriteOperation;
|
||||
import com.owncloud.android.lib.resources.shares.GetRemoteSharesOperation;
|
||||
import com.owncloud.android.lib.resources.status.OCCapability;
|
||||
import com.owncloud.android.lib.resources.status.OwnCloudVersion;
|
||||
import com.owncloud.android.ui.activity.FileActivity;
|
||||
import com.owncloud.android.ui.activity.FileDisplayActivity;
|
||||
import com.owncloud.android.ui.activity.FolderPickerActivity;
|
||||
|
@ -887,11 +889,22 @@ public class OCFileListFragment extends ExtendedListFragment implements OCFileLi
|
|||
return;
|
||||
}
|
||||
|
||||
Account account = ((FileActivity) mContainerActivity).getAccount();
|
||||
|
||||
// check if e2e app is enabled
|
||||
OCCapability ocCapability = mContainerActivity.getStorageManager().getCapability(account.name);
|
||||
|
||||
if (ocCapability.getEndToEndEncryption().isFalse() ||
|
||||
ocCapability.getEndToEndEncryption().isUnknown()) {
|
||||
Snackbar.make(mCurrentListView, R.string.end_to_end_encryption_not_enabled,
|
||||
Snackbar.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
|
||||
// check if keys are stored
|
||||
ArbitraryDataProvider arbitraryDataProvider = new ArbitraryDataProvider(
|
||||
getContext().getContentResolver());
|
||||
|
||||
Account account = ((FileActivity) mContainerActivity).getAccount();
|
||||
String publicKey = arbitraryDataProvider.getValue(account, EncryptionUtils.PUBLIC_KEY);
|
||||
String privateKey = arbitraryDataProvider.getValue(account, EncryptionUtils.PRIVATE_KEY);
|
||||
|
||||
|
|
|
@ -763,6 +763,7 @@
|
|||
<string name="end_to_end_encryption_title">Set up encryption</string>
|
||||
<string name="end_to_end_encryption_passphrase_title">Make note of your 12 word encryption password</string>
|
||||
<string name="end_to_end_encryption_not_supported">Encryption only works on KitKat(4.4) and beyond.</string>
|
||||
<string name="end_to_end_encryption_not_enabled">End to end encryption not enabled on server.</string>
|
||||
<string name="end_to_end_encryption_confirm_button">Set up encryption</string>
|
||||
<string name="end_to_end_encryption_password">Password…</string>
|
||||
<string name="end_to_end_encryption_unsuccessful">Could not save keys, please try again.</string>
|
||||
|
|
Loading…
Reference in a new issue