@@ -46,8 +46,8 @@ async function getAsset(input: string | number): Promise<string> {
4646 const [ header , data ] = input . split ( ';base64,' )
4747 const [ , type ] = header . split ( '/' )
4848
49- const uri = fs . cacheDirectory + uuidv4 ( ) + `.${ type } `
50- await fs . writeAsStringAsync ( uri , data , { encoding : fs . EncodingType . Base64 } )
49+ const uri = fs . Paths . cache . uri + uuidv4 ( ) + `.${ type } `
50+ await new fs . File ( uri ) . write ( data , { encoding : 'base64' } )
5151
5252 return uri
5353 }
@@ -59,8 +59,8 @@ async function getAsset(input: string | number): Promise<string> {
5959
6060 // Unpack assets in Android Release Mode
6161 if ( ! uri . includes ( ':' ) ) {
62- const file = `${ fs . cacheDirectory } ExponentAsset-${ asset . hash } .${ asset . type } `
63- await fs . copyAsync ( { from : uri , to : file } )
62+ const file = `${ fs . Paths . cache . uri } ExponentAsset-${ asset . hash } .${ asset . type } `
63+ await new fs . File ( uri ) . copy ( new fs . File ( file ) )
6464 uri = file
6565 }
6666
@@ -160,7 +160,7 @@ export function polyfills() {
160160
161161 getAsset ( url )
162162 . then ( async ( uri ) => {
163- const base64 = await fs . readAsStringAsync ( uri , { encoding : fs . EncodingType . Base64 } )
163+ const base64 = await new fs . File ( uri ) . base64 ( )
164164 const data = Buffer . from ( base64 , 'base64' )
165165 onLoad ?.( data . buffer )
166166 } )
0 commit comments