Skip to content

Commit

Permalink
Refactor: Use standard preferences for YouTube cookie
Browse files Browse the repository at this point in the history
Switched from encrypted preferences to standard preferences for storing the YouTube cookie in `AccountsSettings` and `MainActivity`.
  • Loading branch information
fast4x committed Jan 31, 2025
1 parent 06fb523 commit b6b7d31
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ class MainActivity :

YoutubePreferences.preference =
YoutubePreferenceItem(
cookie = encryptedPreferences.getString(ytCookieKey, ""),
cookie = preferences.getString(ytCookieKey, ""),
visitordata = visitorData
.takeIf { it != "null" }
?: Innertube.DEFAULT_VISITOR_DATA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ fun isYouTubeSyncEnabled(): Boolean {
}

fun isYouTubeLoggedIn(): Boolean {
val cookie = appContext().encryptedPreferences.getString(ytCookieKey, "")
val cookie = appContext().preferences.getString(ytCookieKey, "")
val isLoggedIn = cookie?.let { parseCookieString(it) }?.contains("SAPISID") == true
return isLoggedIn
}
Expand Down

0 comments on commit b6b7d31

Please sign in to comment.