|
|
@@ -36,7 +36,6 @@ import net.lingala.zip4j.model.ZipParameters
|
|
|
import net.lingala.zip4j.model.enums.EncryptionMethod
|
|
|
import org.fossify.commons.adapters.MyRecyclerViewAdapter
|
|
|
import org.fossify.commons.dialogs.ConfirmationDialog
|
|
|
-import org.fossify.commons.dialogs.EnterPasswordDialog
|
|
|
import org.fossify.commons.dialogs.FilePickerDialog
|
|
|
import org.fossify.commons.dialogs.PropertiesDialog
|
|
|
import org.fossify.commons.dialogs.RadioGroupDialog
|
|
|
@@ -100,6 +99,7 @@ import org.fossify.filemanager.databinding.ItemSectionBinding
|
|
|
import org.fossify.filemanager.dialogs.CompressAsDialog
|
|
|
import org.fossify.filemanager.dialogs.FileOperationProgressDialog
|
|
|
import org.fossify.filemanager.dialogs.PasswordConfirmationDialog
|
|
|
+import org.fossify.filemanager.dialogs.PasswordDialog
|
|
|
import org.fossify.filemanager.extensions.config
|
|
|
import org.fossify.filemanager.extensions.isPathOnRoot
|
|
|
import org.fossify.filemanager.extensions.isZipFile
|
|
|
@@ -735,7 +735,7 @@ class ItemsAdapter(
|
|
|
return@handleSAFDialog
|
|
|
}
|
|
|
|
|
|
- EnterPasswordDialog(activity, { password ->
|
|
|
+ PasswordDialog(activity) { password ->
|
|
|
val progressDialog = FileOperationProgressDialog(activity, R.string.decrypting)
|
|
|
progressDialog.start()
|
|
|
ensureBackgroundThread {
|
|
|
@@ -753,9 +753,7 @@ class ItemsAdapter(
|
|
|
finishActMode()
|
|
|
}
|
|
|
}
|
|
|
- }, {
|
|
|
- // user canceled the password prompt
|
|
|
- })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -776,6 +774,7 @@ class ItemsAdapter(
|
|
|
var skipped = 0
|
|
|
var failed = 0
|
|
|
allFiles.forEachIndexed { index, f ->
|
|
|
+ onProgress(f.name, index + 1, allFiles.size, 0L, 0L)
|
|
|
try {
|
|
|
if (f.exists() && f.length() > 0L) {
|
|
|
CryptoHelper.encryptFile(f, password) { processed, total ->
|
|
|
@@ -811,6 +810,7 @@ class ItemsAdapter(
|
|
|
var skipped = 0
|
|
|
var failed = 0
|
|
|
allFiles.forEachIndexed { index, f ->
|
|
|
+ onProgress(f.name, index + 1, allFiles.size, 0L, 0L)
|
|
|
if (!CryptoHelper.isEncrypted(f)) {
|
|
|
skipped++
|
|
|
return@forEachIndexed
|