-
Notifications
You must be signed in to change notification settings - Fork 22
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
Can't choose destination folder for backup [ Play Store Review ] #9
Comments
- fixes #9 Signed-off-by: Keshav Priyadarshi <git@keshav.space>
I still can't on 2.1.0 |
Android is migrating towards more privacy-friendly Android APIs.Below is a brief summary of how that impacts storage accessAndroid >= 11 ( New )
Android < 11 ( Old )
How Safe Notes will handle the storage access?These access control will become more stringent in the coming year, something similar to iOS, and that's good for user privacy. Bottom line is that apps should not use The new feature is tested on Android 12, 11, 10, 9, 8.1, 8.0 and 7.1
|
Thanks for the reply, I understand. I just would like to ask why Safe Notes doesn't use this method used by most modern apps to gain access to a specific directory. |
Safe Notes is already using this for reading import files [ user can pick the import file from anywhere while importing backup] This permission can't be used to write/modify existing files moreover the new files can only be created in the Download directory or app-specific storage location. To write a file at an arbitrary [user chosen] location app would require There is no escape from this. |
I am very sorry, I linked the wrong thing. This intent You may want to have a look at this notes app: autoExportLauncher = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
val uri = result.data?.data
if (result.resultCode == Activity.RESULT_OK && uri != null) {
val output = try {
val cr = context.contentResolver
cr.takePersistableUriPermission(uri, Intent.FLAG_GRANT_WRITE_URI_PERMISSION)
cr.openOutputStream(uri)
} catch (e: Exception) {
Log.i(TAG, "Data export failed", e)
null
}
if (output != null) {
viewModel.setupAutoExport(output, uri.toString())
} else {
showMessage(R.string.export_fail)
autoExportPref.isChecked = false
}
}
} fun setupAutoExport(output: OutputStream, uri: String) {
prefsManager.autoExportUri = uri
viewModelScope.launch(Dispatchers.IO) {
val jsonData = jsonManager.exportJsonData()
try {
output.use {
output.write(jsonData.toByteArray())
}
showMessage(R.string.export_success)
val now = System.currentTimeMillis()
prefsManager.lastAutoExportTime = now
_lastAutoExport.postValue(now)
} catch (e: Exception) {
showMessage(R.string.export_fail)
}
}
} Here is a screen recording: Screen_Recording_20221218-093546_Files.mp4 |
I see you're pointing to the Suppose user creates a backup file at a certain location, the app will receive the content URI of that file. For an offline app, it's paramount that the user can independently access the backup file.
Indulgence is much appreciated and always welcome, that's the point of having this open-source. 😊 TL;DRSAF would work only if there was some way to show the exact location of backup file like this 👇 |
Hello again. Screen_Recording_20240312_163203_Image.Toolbox.mp4 |
No description provided.
The text was updated successfully, but these errors were encountered: