DanGLES3 / NoStorageRestrict

Remove the restriction when selecting folders through SAF
69 stars 7 forks source link

Some apps loose access permission when NSR module is active #7

Closed bege10 closed 1 year ago

bege10 commented 1 year ago

These apps I use loose the previously granted permission to access folders when NSR module is active and the system file manager is used for e.g. storing settings from any app. This issue does not happen as long as the file manager is not used or NSR module is not active.

FolderSync (dk.tacit.android.foldersync.lite): /Android/data/subfolder on internal SD. Other folders an internal SD card are not concerned

SMS Backup & Restore (com.riteshsahu.SMSBackupRestore) any folder on internal or external SD to store backups to.

3C Sensitive Backups (CCC71.sb) any folder on internal or external SD to store backups to

Currently NSR cannot be used or I must re-grant access permission to these apps.

Fairphone 3, /e/OS (based on LineageOS for microG, Android 11)

DanGLES3 commented 1 year ago

These apps I use loose the previously granted permission to access folders when NSR module is active and the system file manager is used for e.g. storing settings from any app. This issue does not happen as long as the file manager is not used or NSR module is not active.

FolderSync (dk.tacit.android.foldersync.lite): /Android/data/subfolder on internal SD. Other folders an internal SD card are not concerned

SMS Backup & Restore (com.riteshsahu.SMSBackupRestore) any folder on internal or external SD to store backups to.

3C Sensitive Backups (CCC71.sb) any folder on internal or external SD to store backups to

Currently NSR cannot be used or I must re-grant access permission to these apps.

Fairphone 3, /e/OS (based on LineageOS for microG, Android 11)

This is most likely due to the module replacing the external storage provider (likely invalidating previous settings), only way to avoid this would be to use the Xposed version of the module which will just patch in the relevant code rather than completely replacing the APK

bege10 commented 1 year ago

Thank you for your quick response. I don't use Xposed so far to not have too many patches on the phone that might make it unstable. Can you recommend to have Magisk with Zygisk and Xposed on the phone without too much hassle?

DanGLES3 commented 1 year ago

Thank you for your quick response. I don't use Xposed so far to not have too many patches on the phone that might make it unstable. Can you recommend to have Magisk with Zygisk and Xposed on the phone without too much hassle?

https://github.com/LSPosed/LSPosed/releases

This should be as straightforward as it gets

ovizii commented 1 year ago

I installed lsposed only for this module and can't get it to work. I downloaded the apk and applied the module (see screenshot) and yet still no access using foldersync. Am I doing something wrong? Any help is appreciated. I even applied it to the foldersync app itself.

Screenshot_20230906-123414_Shell

DanGLES3 commented 1 year ago

I installed lsposed only for this module and can't get it to work. I downloaded the apk and applied the module (see screenshot) and yet still no access using foldersync. Am I doing something wrong? Any help is appreciated. I even applied it to the foldersync app itself.

Screenshot_20230906-123414_Shell

What exactly is the issue? Also you don't need to select another app in Lsposed

ovizii commented 1 year ago

damn, I'm sorry, I realized I posted in the wrong thread as I had multiple tabs open in my browser. Should I remove my posts here and post over there: https://github.com/Xposed-Modules-Repo/com.github.dan.nostoragerestrict ?

Short version, the magisk NSR module doesn't seem to work in my particular case:

I am trying to access certain folders underneath data with the foldersync app for backing up. I have had this working before, but I had to recently update my custom ROM as well as Magisk

So seeing that you recommended going with lsposed, I installed lsposed and the NSR module then set it up as shown in the above screenshot.

I get the error below when trying to browse the data folder. Screenshot_20230906-160932_FolderSync

DanGLES3 commented 1 year ago

damn, I'm sorry, I realized I posted in the wrong thread as I had multiple tabs open in my browser. Should I remove my posts here and post over there: https://github.com/Xposed-Modules-Repo/com.github.dan.nostoragerestrict ?

Short version, the magisk NSR module doesn't seem to work in my particular case:

I am trying to access certain folders underneath data with the foldersync app for backing up. I have had this working before, but I had to recently update my custom ROM as well as Magisk

So seeing that you recommended going with lsposed, I installed lsposed and the NSR module then set it up as shown in the above screenshot.

I get the error below when trying to browse the data folder. Screenshot_20230906-160932_FolderSync

Well, issue is my module can only get around the restriction when it goes through Android's built in file manager (if the app uses the storage access framework to access those folders)

It currently cannot workaround the limitation globally (when an app is using its own file browser) as it seems to be enforced through native code

ovizii commented 1 year ago

I understand now, thanks. I saw that app's file browsing interface looked different from usual and just "assumed" adding the app to your module would solve it. I understand now that was wishful thinking :-)

DanGLES3 commented 1 year ago

I understand now, thanks. I saw that app's file browsing interface looked different from usual and just "assumed" adding the app to your module would solve it. I understand now that was wishful thinking :-)

May I ask what do those buttons above select do? They seem to be related to adding folders (perhaps through the storage access framework)

ovizii commented 1 year ago

I understand now, thanks. I saw that app's file browsing interface looked different from usual and just "assumed" adding the app to your module would solve it. I understand now that was wishful thinking :-)

May I ask what do those buttons above select do? They seem to be related to adding folders (perhaps through the storage access framework)

OMG, I should just shut down all devices for today and stop embarrassing myself online. YES, you are absolutely right. That is what those buttons do. Much appreciated taking the time to actually point out the obvious to me, you saved my day :-)

That is actually the workaround they suggest. The problem was, that with their workaround one could add access to subfolders of data/ one folder at a time. Adding your lsposed module into the mix just allowed me to add access to the complete data/ folder :-)

DanGLES3 commented 1 year ago

I understand now, thanks. I saw that app's file browsing interface looked different from usual and just "assumed" adding the app to your module would solve it. I understand now that was wishful thinking :-)

May I ask what do those buttons above select do? They seem to be related to adding folders (perhaps through the storage access framework)

OMG, I should just shut down all devices for today and stop embarrassing myself online. YES, you are absolutely right. That is what those buttons do. Much appreciated taking the time to actually point out the obvious to me, you saved my day :-)

That is actually the workaround they suggest. The problem was, that with their workaround one could add access to subfolders of data/ one folder at a time. Adding your lsposed module into the mix just allowed me to add access to the complete data/ folder :-)

Great, happy I could help