Browse Source

prepare encrypted database export

cyberta 3 years ago
parent
commit
e7d7ae9d29

+ 2 - 2
DcCore/DcCore/DC/Wrapper.swift

@@ -531,8 +531,8 @@ public class DcContext {
         return DcProvider(dcProviderPointer)
     }
 
-    public func imex(what: Int32, directory: String) {
-        dc_imex(contextPointer, what, directory, nil)
+    public func imex(what: Int32, directory: String, passphrase: String? = nil) {
+        dc_imex(contextPointer, what, directory, passphrase)
     }
 
     public func imexHasBackup(filePath: String) -> String? {

+ 2 - 2
deltachat-ios/Controller/SettingsController.swift

@@ -594,13 +594,13 @@ internal final class SettingsViewController: UITableViewController, ProgressAler
         present(menu, animated: true, completion: nil)
     }
 
-    private func startImex(what: Int32) {
+    private func startImex(what: Int32, passphrase: String? = nil) {
         let documents = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)
         if !documents.isEmpty {
             showProgressAlert(title: String.localized("imex_progress_title_desktop"), dcContext: dcContext)
             DispatchQueue.main.async {
                 self.dcAccounts.stopIo()
-                self.dcContext.imex(what: what, directory: documents[0])
+                self.dcContext.imex(what: what, directory: documents[0], passphrase: passphrase)
             }
         } else {
             logger.error("document directory not found")