File tree Expand file tree Collapse file tree
src/services/backup/local Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -182,20 +182,12 @@ export const createBackup = async (
182182 ) ;
183183 }
184184
185- const zipFileUri = 'file://' + zipPath ;
186-
187185 try {
188186 if ( ! ( await NativeFile . exists ( zipPath ) ) ) {
189187 throw new Error ( 'Backup zip file was not created' ) ;
190188 }
191189
192- const zipData = await FileSystem . readAsStringAsync ( zipFileUri , {
193- encoding : FileSystem . EncodingType . Base64 ,
194- } ) ;
195-
196- await FileSystem . writeAsStringAsync ( fileUri , zipData , {
197- encoding : FileSystem . EncodingType . Base64 ,
198- } ) ;
190+ await NativeFile . copyFile ( zipPath , fileUri ) ;
199191
200192 const backupTypeText = includeDownloads ? ' (with downloads)' : '' ;
201193
@@ -491,11 +483,7 @@ export const restoreBackup = async (
491483 await NativeFile . unlink ( tempZipPath ) ;
492484 }
493485
494- const zipData = await FileSystem . readAsStringAsync ( backupFile . uri , {
495- encoding : FileSystem . EncodingType . Base64 ,
496- } ) ;
497-
498- await NativeFile . writeFile ( tempZipPath , zipData ) ;
486+ await NativeFile . copyFile ( backupFile . uri , tempZipPath ) ;
499487
500488 if ( ! ( await NativeFile . exists ( tempZipPath ) ) ) {
501489 throw new Error ( 'Failed to create temporary backup file' ) ;
You can’t perform that action at this time.
0 commit comments