forked from TeamNewPipe/NewPipe
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use JSON for settings imports/exports
- Loading branch information
Showing
8 changed files
with
292 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 0 additions & 21 deletions
21
app/src/main/java/org/schabi/newpipe/settings/NewPipeFileLocator.kt
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
app/src/main/java/org/schabi/newpipe/settings/export/BackupFileLocator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.schabi.newpipe.settings.export | ||
|
||
import java.io.File | ||
|
||
/** | ||
* Locates specific files of NewPipe based on the home directory of the app. | ||
*/ | ||
class BackupFileLocator(private val homeDir: File) { | ||
companion object { | ||
const val FILE_NAME_DB = "newpipe.db" | ||
@Deprecated( | ||
"Serializing preferences with Java's ObjectOutputStream is vulnerable to injections", | ||
replaceWith = ReplaceWith("FILE_NAME_JSON_PREFS") | ||
) | ||
const val FILE_NAME_SERIALIZED_PREFS = "newpipe.settings" | ||
const val FILE_NAME_JSON_PREFS = "preferences.json" | ||
} | ||
|
||
val dbDir by lazy { File(homeDir, "/databases") } | ||
|
||
val db by lazy { File(dbDir, FILE_NAME_DB) } | ||
|
||
val dbJournal by lazy { File(dbDir, "$FILE_NAME_DB-journal") } | ||
|
||
val dbShm by lazy { File(dbDir, "$FILE_NAME_DB-shm") } | ||
|
||
val dbWal by lazy { File(dbDir, "$FILE_NAME_DB-wal") } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.