Skip to content

Proof Mode to work only with Private Cloud Camera uploads #671

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 5, 2025

Conversation

prathieshna
Copy link

No description provided.

@@ -830,7 +822,8 @@

mSnackBar?.show()
lifecycleScope.launch(Dispatchers.IO) {
val media = Picker.import(this@MainActivity, getSelectedProject(), uri)
//When we are sharing a file to be uploaded to Save app we don't generate proof.

Check warning

Code scanning / detekt

Checks if comments have the right spacing Warning

Missing space after //
@@ -59,7 +55,8 @@
val snackbar = showProgressSnackBar(activity, root, activity.getString(R.string.importing_media))

activity.lifecycleScope.launch(Dispatchers.IO) {
val media = import(activity, project(), result.map { it.uri })
// We don't generate proof for media picker files.
val media = import(activity, project(), result.map { it.uri },false)

Check warning

Code scanning / detekt

Reports spaces around commas Warning

Missing spacing after ","
val media = import(activity, project(), listOf(uri))
// We generate proof for in app capture Just because we toggle it true, it doesn't generate proof.
// It should be on in the settings too. We check that inside import
val media = import(activity, project(), listOf(uri),true)

Check warning

Code scanning / detekt

Reports spaces around commas Warning

Missing spacing after ","
val result = ArrayList<Media>()

for (uri in uris) {
try {
val media = import(context, project, uri)
//Simply pass the generate proof boolean for single file import which is looped here

Check warning

Code scanning / detekt

Checks if comments have the right spacing Warning

Missing space after //
@@ -154,7 +155,7 @@
return result
}

fun import(context: Context, project: Project?, uri: Uri): Media? {
fun import(context: Context, project: Project?, uri: Uri, generateProof: Boolean): Media? {

Check warning

Code scanning / detekt

Restrict the number of return statements in methods. Warning

Function import has 3 return statements which exceeds the limit of 2.
//If Proof mode is on we need this to be on always
Prefs.proofModeLocation = true
Prefs.proofModeNetwork = true
//Generate proof for camera photos and also always track location

Check warning

Code scanning / detekt

Checks if comments have the right spacing Warning

Missing space after //
hash = ProofMode.generateProof(mContext, mMedia.fileUri, proofHash)
}
return ProofMode.getProofDir(mContext, mMedia.mediaHashString).listFiles() ?: emptyArray()
// Here we are simply fetching the files. Don't generate proof here. This is only called during upload.

Check warning

Code scanning / detekt

Reports mis-indented code Warning

Unexpected indentation (8) (should be 12)
}
return ProofMode.getProofDir(mContext, mMedia.mediaHashString).listFiles() ?: emptyArray()
// Here we are simply fetching the files. Don't generate proof here. This is only called during upload.
// Generating Proof here won't make sense because the file can be created well before it could be uploaded.

Check warning

Code scanning / detekt

Reports mis-indented code Warning

Unexpected indentation (8) (should be 12)
return ProofMode.getProofDir(mContext, mMedia.mediaHashString).listFiles() ?: emptyArray()
// Here we are simply fetching the files. Don't generate proof here. This is only called during upload.
// Generating Proof here won't make sense because the file can be created well before it could be uploaded.
var files = ProofMode.getProofDir(mContext, mMedia.mediaHashString).listFiles() ?: emptyArray()

Check warning

Code scanning / detekt

Reports mis-indented code Warning

Unexpected indentation (10) (should be 12)
// Here we are simply fetching the files. Don't generate proof here. This is only called during upload.
// Generating Proof here won't make sense because the file can be created well before it could be uploaded.
var files = ProofMode.getProofDir(mContext, mMedia.mediaHashString).listFiles() ?: emptyArray()
return files

Check warning

Code scanning / detekt

Reports mis-indented code Warning

Unexpected indentation (10) (should be 12)
Copy link

@Elelan Elelan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Elelan Elelan merged commit e8bf6f0 into next May 5, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants