Skip to content

Commit c3113a5

Browse files
committed
Fix preferences restore dir
Signed-off-by: Saul Henriquez <saul_henriquez@hotmail.com>
1 parent b0c8154 commit c3113a5

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Omega/src/com/neoapps/neolauncher/backup/BackupManager.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ class BackupManager(val context: Context, val uri: Uri) {
198198
val cacheParent = contextWrapper.cacheDir.parent
199199
val settingsFile = File(cacheParent, "shared_prefs/${LauncherFiles.SHARED_PREFERENCES_KEY}.xml")
200200
val deviceSettingsFile = File(cacheParent, "shared_prefs/${LauncherFiles.DEVICE_PREFERENCES_KEY}.xml")
201-
val datastoreFile = File(cacheParent, "datastore/neo_launcher.preferences_pb")
201+
val datastoreFile = File(cacheParent, "files/datastore/neo_launcher.preferences_pb")
202202
context.contentResolver.openFileDescriptor(uri, "r")?.use { pfd ->
203203
FileInputStream(pfd.fileDescriptor).use { fileInput ->
204204
ZipInputStream(fileInput).use { zipInput ->
@@ -207,6 +207,10 @@ class BackupManager(val context: Context, val uri: Uri) {
207207
val currentEntry = entry!!
208208
val entryName = currentEntry.name
209209
val targetFile = when {
210+
entryName == "neo_launcher.preferences_pb" -> {
211+
if (!contents.hasFlag(INCLUDE_SETTINGS)) continue
212+
datastoreFile
213+
}
210214
entryName.startsWith("launcher_") ||
211215
entryName == "NeoLauncher.db" ||
212216
entryName == "NeoLauncher.db-shm" ||
@@ -225,10 +229,6 @@ class BackupManager(val context: Context, val uri: Uri) {
225229
WallpaperManager.getInstance(context).setBitmap(bitmap)
226230
continue
227231
}
228-
entryName.endsWith("preferences_pb") -> {
229-
if (!contents.hasFlag(INCLUDE_SETTINGS)) continue
230-
datastoreFile
231-
}
232232
entryName == "${LauncherFiles.SHARED_PREFERENCES_KEY}.xml" -> {
233233
if (!contents.hasFlag(INCLUDE_SETTINGS)) continue
234234
settingsFile

0 commit comments

Comments
 (0)