Browse Source

Settings e2e

Marino Faggiana 7 years ago
parent
commit
ba2e1d8120

+ 1 - 4
iOSClient/Main/CCMain.m

@@ -1182,14 +1182,13 @@
     metadataNet.action = actionGetActivityServer;
     [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
     
-#ifdef DEBUG
     // Get End-To-End PrivateKey (if enabled)
     if (capabilities.isEndToEndEncryptionEnabled) {
         
         if ([CCUtility isEndToEndEnabled:app.activeAccount]) {
             
             // Activity
-            [[NCManageDatabase sharedInstance] addActivityClient:@"" fileID:@"" action:k_activityDebugActionEndToEndEncryption selector:metadataNet.selector note:@"Encryption E2E available" type:k_activityTypeSuccess verbose:k_activityVerboseHigh activeUrl:app.activeUrl];
+            [[NCManageDatabase sharedInstance] addActivityClient:@"" fileID:@"" action:k_activityDebugActionEndToEndEncryption selector:metadataNet.selector note:@"Encryption E2E available" type:k_activityTypeSuccess verbose:k_activityVerboseHigh activeUrl:@""];
             
         } else {
             
@@ -1197,8 +1196,6 @@
             [app.endToEndInterface initEndToEndEncryption];
         }
     }
-#endif
-    
 }
 
 #pragma mark -

+ 1 - 3
iOSClient/Settings/CCSettings.m

@@ -108,10 +108,9 @@
     [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
     [section addFormRow:row];
     
-#ifdef DEBUG
     // Section : E2EEncryption --------------------------------------------------------------
 
-    section = [XLFormSectionDescriptor formSection];
+    section = [XLFormSectionDescriptor formSectionWithTitle:NSLocalizedString(@"_e2e_settings_encryption_title_", nil)];
     [form addFormSection:section];
     
     // EndToEnd Encryption
@@ -120,7 +119,6 @@
     [row.cellConfig setObject:[UIImage imageNamed:@"settingsE2EEncryption"] forKey:@"imageView.image"];
     row.action.viewControllerClass = [NCManageEndToEndEncryption class];
     [section addFormRow:row];
-#endif
     
     // Section Advanced -------------------------------------------------
     

+ 15 - 11
iOSClient/Settings/NCManageEndToEndEncryption.m

@@ -36,6 +36,20 @@
     
     form = [XLFormDescriptor formDescriptorWithTitle:NSLocalizedString(@"_e2e_settings_encryption_", nil)];
     
+    // Section INITIALIZE -------------------------------------------------
+
+    section = [XLFormSectionDescriptor formSectionWithTitle:NSLocalizedString(@"_e2e_settings_encryption_initialize_", nil)];
+    [form addFormSection:section];
+    
+    // Inizializze e2e
+    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"initE2E" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_e2e_settings_encryption_initialize_", nil)];
+    [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
+    [row.cellConfig setObject:[UIColor blackColor] forKey:@"textLabel.textColor"];
+    [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
+    row.action.formSelector = @selector(initE2E:);
+    [section addFormRow:row];
+    
+#ifdef DEBUGH
     // Section DELETE KEYS -------------------------------------------------
     
     section = [XLFormSectionDescriptor formSectionWithTitle:NSLocalizedString(@"Delete", nil)];
@@ -56,17 +70,7 @@
     [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
     row.action.formSelector = @selector(deletePrivateKey:);
     [section addFormRow:row];
-    
-    section = [XLFormSectionDescriptor formSectionWithTitle:NSLocalizedString(@"Init", nil)];
-    [form addFormSection:section];
-    
-    // Inizializze e2e
-    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"initE2E" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_e2e_settings_encryption_initialize_", nil)];
-    [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
-    [row.cellConfig setObject:[UIColor blackColor] forKey:@"textLabel.textColor"];
-    [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
-    row.action.formSelector = @selector(initE2E:);
-    [section addFormRow:row];
+#endif
     
     return [super initWithForm:form];
 }

+ 9 - 0
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -571,3 +571,12 @@
 // Text File
 
 "_untitled_txt_"                    = "Untitled.txt";
+
+// EndToEnd Encryption
+
+"_e2e_settings_encryption_title_"   = "Encryption";
+"_e2e_settings_encryption_"         = "End To End Encryption";
+"_e2e_settings_encryption_initialize_"    = "Initialize End To End Encryption";
+
+
+