diff --git a/android/app/build.gradle b/android/app/build.gradle index 4f1d92b02..097e0c19b 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -159,9 +159,6 @@ dependencies { implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0") - implementation project(':react-native-lottie-splash-screen') - implementation project(':react-native-fs') - def isGifEnabled = (findProperty('expo.gif.enabled') ?: "") == "true"; def isWebpEnabled = (findProperty('expo.webp.enabled') ?: "") == "true"; def isWebpAnimatedEnabled = (findProperty('expo.webp.animated') ?: "") == "true"; diff --git a/android/settings.gradle b/android/settings.gradle index 6cee1881f..5574f0ca0 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -7,9 +7,3 @@ includeBuild('../node_modules/react-native-gradle-plugin') apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle") useExpoModules() - -include ':react-native-lottie-splash-screen' -project(':react-native-lottie-splash-screen').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-lottie-splash-screen/android') - -include ':react-native-fs' -project(':react-native-fs').projectDir = new File(settingsDir, '../node_modules/react-native-fs/android') diff --git a/src/services/backup/utils.ts b/src/services/backup/utils.ts index a9433f3cf..284fd35a6 100644 --- a/src/services/backup/utils.ts +++ b/src/services/backup/utils.ts @@ -18,7 +18,9 @@ import { import { BackupCategory } from '@database/types'; import { BackupEntryName } from './types'; import TextFile from '@native/TextFile'; +import { AppDownloadFolder } from '@utils/constants/download'; +const AppDownloadUriPrefix = 'file://' + AppDownloadFolder; export const CACHE_DIR_PATH = RNFS.ExternalCachesDirectoryPath + '/BackupData'; const backupMMKVData = () => { @@ -74,6 +76,7 @@ export const prepareBackupData = async (cacheDirPath: string) => { JSON.stringify({ chapters: chapters, ...novel, + cover: novel.cover?.replace(AppDownloadUriPrefix, ''), }), ); } @@ -115,9 +118,13 @@ export const restoreData = async (cacheDirPath: string) => { await RNFS.readDir(novelDirPath).then(async items => { for (const item of items) { if (item.isFile()) { - await TextFile.readFile(item.path).then(content => - _restoreNovelAndChapters(JSON.parse(content)), - ); + await TextFile.readFile(item.path).then(content => { + const backupNovel = JSON.parse(content); + if (!backupNovel.cover?.startsWith('http')) { + backupNovel.cover = AppDownloadUriPrefix + backupNovel.cover; + } + return _restoreNovelAndChapters(backupNovel); + }); } } });