Skip to content

Fix for issue #18 : Backup not working#93

Merged
Leonavichus merged 1 commit intodarkmoonight:mainfrom
inbhatt:bug-#18
Apr 4, 2025
Merged

Fix for issue #18 : Backup not working#93
Leonavichus merged 1 commit intodarkmoonight:mainfrom
inbhatt:bug-#18

Conversation

@inbhatt
Copy link
Copy Markdown
Contributor

@inbhatt inbhatt commented Apr 3, 2025

Since android 11+ doesn't allow writing to directories other than Download and Documents, I have written Platform specific code for android to use the SAF. The SAF provides with a uri and also writes the isar backup file to the selected uri in MainActivity.kt.

Since we would need bytes to write using the SAF, I first create a file in the Download directory which is allowed on android devices. Then I get the bytes of this file and create the backup file in the directory user selected, and delete the file from the Download folder. On other platforms, I keep the functionality as it was.

I didn't have an ios device to test features there, but I have tried to keep the ios functionalities from breaking.

Since android 11+ doesn't allow writing to directories other than Download and Documents, I have written Platform specific code for android to use the SAF. The SAF provides with a uri and also writes the isar backup file to the selected uri.

Since we would need bytes to write using the SAF, I first create a file in the Download directory which is allowed on android devices. Then I get the bytes of this file and create the backup file in the directory user selected, and delete the file from the Download folder. On other platforms, I keep the functionality as it was.

I didn't have an ios device to test features there, but I have tried to keep the ios functionalities from breaking.
@Leonavichus
Copy link
Copy Markdown
Member

Hi! Thank you so much for your contribution!

@Leonavichus Leonavichus merged commit 10813b2 into darkmoonight:main Apr 4, 2025
@inbhatt
Copy link
Copy Markdown
Contributor Author

inbhatt commented Apr 4, 2025

Glad I could help

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