Skip to content

Commit 24b5afc

Browse files
committed
E2EE setup with removing passphrase locally applied as per NC PR: nextcloud/android#11031 & library PR: nextcloud#1000
1 parent 5bb85e5 commit 24b5afc

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

library/src/main/java/com/owncloud/android/lib/resources/status/GetCapabilitiesRemoteOperation.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ public class GetCapabilitiesRemoteOperation extends RemoteOperation {
159159
private static final String NODE_USER_STATUS_ENABLED = "enabled";
160160
private static final String NODE_USER_STATUS_SUPPORTS_EMOJI = "supports_emoji";
161161

162+
// end to end encryption
163+
private static final String PROPERTY_KEYS_EXIST = "keys-exist";
162164

163165
private OCCapability currentCapability = null;
164166

@@ -556,6 +558,19 @@ private OCCapability parseResponse(String response) throws JSONException {
556558
} else {
557559
capability.setEndToEndEncryption(CapabilityBooleanType.FALSE);
558560
}
561+
562+
if (respEndToEndEncryption.has(PROPERTY_KEYS_EXIST)) {
563+
final boolean keysExist = respEndToEndEncryption.getBoolean(PROPERTY_KEYS_EXIST);
564+
if (keysExist) {
565+
capability.setEndToEndEncryptionKeysExist(CapabilityBooleanType.TRUE);
566+
} else {
567+
capability.setEndToEndEncryptionKeysExist(CapabilityBooleanType.FALSE);
568+
}
569+
} else {
570+
capability.setEndToEndEncryptionKeysExist(CapabilityBooleanType.UNKNOWN);
571+
}
572+
573+
559574
Log_OC.d(TAG, "*** Added " + NODE_END_TO_END_ENCRYPTION);
560575
}
561576

library/src/main/java/com/owncloud/android/lib/resources/status/OCCapability.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ class OCCapability {
8686
var fullNextSearchFiles: CapabilityBooleanType? = null
8787

8888
var endToEndEncryption = CapabilityBooleanType.UNKNOWN
89+
var endToEndEncryptionKeysExist = CapabilityBooleanType.UNKNOWN
8990

9091
// Richdocuments
9192
var richDocuments = CapabilityBooleanType.UNKNOWN

0 commit comments

Comments
 (0)