Giter VIP home page Giter VIP logo

Comments (18)

keshav-space avatar keshav-space commented on May 22, 2024 2

Update

In the last few days, I have extensively read about android's migration towards more privacy-friendly Android APIs.

Below is a brief summary of how that impacts storage access

Android >= 11

No Storage Permission : Apps can create new files in the download folder without permission
Media and File Permission : Apps can read media and files but can't modify or create files except in app-specific storage space [ moreover, the android will never expose the actual file location rather a cached file location is shared with apps]
All File Permission : When MANAGE_EXTERNAL_STORAGE permission is granted, app can read/modify/create/delete files in external shared storage.

Android < 11

No Storage Permission : App can not access any part of external shared storage
File Permission : App can read, modify, create and delete files in external shared storage.

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 All file Permission unless absolutely needed.
Safe Notes will not use All File Permission, this means that users will not be able to choose the location of their choice for backup. Backup will be made inside the Download directory within the Safe Notes folder. [See videos below ]

@landry314 This will also resolve the issue you raised here #60, auto backup and manual export is merged.
With fewer nobs and dials, backup looks much simpler and more intuitive.

@ghoevil though I haven't been able to test new feature on Harmony OS I'm sure it will work there too.

The new feature is tested on Android 12, 11, 10, 9, 8.1, 8.0 and 7.1

Android 12 Android 12 Android 11 Android 10
Android_12-API_32-Pixel_4.mp4
Android_12-API_31-Pixel_4.mp4
Android_11-API_30-Pixel_4.mp4
Android_10-API_29-Pixel_4.mp4
Android 9 Android 8.1 Android 8.0 Android 7.1
Android_9-API-28-Pixel-4.mp4
Android_8.1-API_27-Pixel-4.mp4
Android_8-API_26-Pixel_4.mp4
Android_7.1-API_25-Pixel_4.mp4

from safenotes.

keshav-space avatar keshav-space commented on May 22, 2024 1

The v2.0.2-beta release is out and it should fix this issue.
Do test this out and let me know if it's working. safenotes-v2.0.2-beta.apk

What was causing backup and export to fail?

After doing some research on this it turns out that to store files in generic user-desired locations or to do backups the app needs to have MANAGE_EXTERNAL_STORAGE permission.

it was made in version 1.0. i still have a "vault" file from then.

In v1.0 export were directly saved in the download folder which is accessible by apps without using MANAGE_EXTERNAL_STORAGE permission.
But to save files anywhere outside app-specific storage space is not consistently possible without MANAGE_EXTERNAL_STORAGE, for some OS it might work for some it might not and that is expected behavior.

Moreover, for the backup to work - the same backup file is periodically updated which is not possible with novice create document intent

Note: ACTION_CREATE_DOCUMENT cannot overwrite an existing file. If your app tries to save a file with the same name, the system appends a number in parentheses at the end of the file name.

For example, if your app tries to save a file called confirmation.pdf in a directory that already has a file with that name, the system saves the new file with the name confirmation(1).pdf.

References

from safenotes.

landry314 avatar landry314 commented on May 22, 2024 1

Oh, good news, I was able to create a folder INSIDE /Download and create a backup file there. The Auto Backup feature is working in there too!

from safenotes.

keshav-space avatar keshav-space commented on May 22, 2024

Few things needed
Device: ??
OS and Version: ??
SafeNotes Version: ??
ScreenShot of Backup Page: ??

from safenotes.

landry314 avatar landry314 commented on May 22, 2024

I have the same problem and have discussed it a lot in issue #58. i wonder how many people are not able to backup. what operating system and version are you on?

from safenotes.

ghoevil avatar ghoevil commented on May 22, 2024

@keshav-space I also met the same bugs, no matter to use auto, or backup now, or manual export.

from safenotes.

ghoevil avatar ghoevil commented on May 22, 2024

@keshav-space

You can see the photos as below.

zFt3wj.jpg

zFtM6S.jpg

zFtuSf.jpg

from safenotes.

landry314 avatar landry314 commented on May 22, 2024

even though i disabled secure display, still screenshots are just black. i cant show you. nothing happens. no backup is ever made. it was made in version 1.0. i still have a "vault" file from then.

from safenotes.

ghoevil avatar ghoevil commented on May 22, 2024

@landry314 You have to Kill it from the background run after disable,and re-open the app. It will be able to let you make screenshot.

from safenotes.

landry314 avatar landry314 commented on May 22, 2024

Well, what you could do, is maintain a few versions of backups for x days, labeling them with their date then delete the oldest backup while replacing it with the newest. This is good in case the user makes a mistake deleting data and solves the file naming problem above.

I am still stuck on the fdroid signature version or I would beta test.

I tried selecting the /Download folder but it won't let me which is funny because in version 1.0 that was the ONLY option. It will let me choose any other folder on /sdcard/ which is not protected space but it wont actually write to it...

from safenotes.

ghoevil avatar ghoevil commented on May 22, 2024

@keshav-space just test the beta, doesn't work.

img

from safenotes.

keshav-space avatar keshav-space commented on May 22, 2024

@ghoevil, please share the os and version.

from safenotes.

keshav-space avatar keshav-space commented on May 22, 2024

Well, what you could do, is maintain a few versions of backups for x days, labeling them with their date then delete the oldest backup while replacing it with the newest. This is good in case the user makes a mistake deleting data and solves the file naming problem above.

The problem I discussed earlier can only be addressed by MANAGE_EXTERNAL_STORAGE permission.
i.e. application can not modify or delete or replace an existing file using create document intent irrespective of which app created it.

v2.0.2-beta has addressed that issue.

from safenotes.

ghoevil avatar ghoevil commented on May 22, 2024

@keshav-space I'm using Huawei P40,and os is Harmony OS 2.0.0.276.

from safenotes.

ghoevil avatar ghoevil commented on May 22, 2024

@keshav-space yes good, now backup works well on the beta ver. , but the language cannot be clicked with no response.

from safenotes.

landry314 avatar landry314 commented on May 22, 2024

you could also make the backup path:

/storage/emulated/0/Android/data/com.trisven.safenotes/files/Backup/

this makes it harder for the user to find the file but would require no extra permissions i believe.

with an app like Neobackup, all you would need to do is select "External Data" in the backup and it would be added.

from safenotes.

keshav-space avatar keshav-space commented on May 22, 2024

but the language cannot be clicked with no response.

The language setting is already added and will be fully functional on the next release i.e. v2.1.0 #86

you could also make the backup path:

/storage/emulated/0/Android/data/com.trisven.safenotes/files/Backup/

  • Users won't be able to easily find the backup file while changing the device.
  • Since that's Safe Notes' app-specific folder user won't be able to couple the backup with other tools like SyncThing

from safenotes.

keshav-space avatar keshav-space commented on May 22, 2024

closing this issue since this was addressed with the new release v2.1.0 https://github.com/keshav-space/safenotes/releases/tag/v2.1.0

from safenotes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.