-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
8 changed files
with
453 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
610 changes: 361 additions & 249 deletions
610
app/src/main/java/com/owncloud/android/operations/UploadFileOperation.java
Large diffs are not rendered by default.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
app/src/main/java/com/owncloud/android/operations/e2e/E2EClientData.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* Nextcloud - Android Client | ||
* | ||
* SPDX-FileCopyrightText: 2024 Your Name <[email protected]> | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
package com.owncloud.android.operations.e2e | ||
|
||
import com.owncloud.android.lib.common.OwnCloudClient | ||
|
||
data class E2EClientData(val client: OwnCloudClient, val token: String, val publicKey: String) |
17 changes: 17 additions & 0 deletions
17
app/src/main/java/com/owncloud/android/operations/e2e/E2EData.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* Nextcloud - Android Client | ||
* | ||
* SPDX-FileCopyrightText: 2024 Your Name <[email protected]> | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
package com.owncloud.android.operations.e2e | ||
|
||
import com.owncloud.android.datamodel.e2e.v1.encrypted.EncryptedFile | ||
|
||
data class E2EData( | ||
val key: ByteArray, | ||
val iv: ByteArray, | ||
val encryptedFile: EncryptedFile, | ||
val encryptedFileName: String | ||
) |
46 changes: 46 additions & 0 deletions
46
app/src/main/java/com/owncloud/android/operations/e2e/E2EFiles.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Nextcloud - Android Client | ||
* | ||
* SPDX-FileCopyrightText: 2024 Your Name <[email protected]> | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
package com.owncloud.android.operations.e2e | ||
|
||
import com.owncloud.android.datamodel.OCFile | ||
import com.owncloud.android.lib.common.utils.Log_OC | ||
import java.io.File | ||
|
||
data class E2EFiles( | ||
var parentFile: OCFile, | ||
var temporalFile: File?, | ||
var originalFile: File, | ||
var expectedFile: File?, | ||
var encryptedTempFile: File? | ||
) { | ||
private val tag = "E2EFiles" | ||
|
||
fun deleteTemporalFile() { | ||
if (temporalFile?.exists() == true && temporalFile?.delete() == false) { | ||
Log_OC.e(tag, "Could not delete temporal file " + temporalFile?.absolutePath) | ||
} | ||
} | ||
|
||
fun deleteTemporalFileWithOriginalFileComparison() { | ||
if (originalFile == temporalFile) { | ||
return | ||
} | ||
|
||
val isTemporalFileDeleted = temporalFile?.delete() | ||
Log_OC.d(tag, "isTemporalFileDeleted: $isTemporalFileDeleted") | ||
} | ||
|
||
fun deleteEncryptedTempFile() { | ||
if (encryptedTempFile != null) { | ||
val isTempEncryptedFileDeleted = encryptedTempFile?.delete() | ||
Log_OC.e(tag, "isTempEncryptedFileDeleted: $isTempEncryptedFileDeleted") | ||
} else { | ||
Log_OC.e(tag, "Encrypted temp file cannot be found") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters