Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ android {
System.getProperty("versionNameSuffix")?.let { versionNameSuffix = it }

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

// Move public API key to BuildConfig to avoid direct exposure in source code
val googleApiKey = System.getenv("NEWPIPE_GOOGLE_API_KEY") ?: "AIzaSyDyT5W0Jh49F30Pqqtyfdf7pDLFKLJoAnw"
buildConfigField("String", "GOOGLE_API_KEY", "\"$googleApiKey\"")
}

buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,8 @@ class PoTokenWebView private constructor(

companion object : PoTokenGenerator.Factory {
private val TAG = PoTokenWebView::class.simpleName
// Public API key used by BotGuard, which has been got by looking at BotGuard requests
private const val GOOGLE_API_KEY = "AIzaSyDyT5W0Jh49F30Pqqtyfdf7pDLFKLJoAnw" // NOSONAR
// Public API key used by BotGuard, moved to BuildConfig
private const val GOOGLE_API_KEY = BuildConfig.GOOGLE_API_KEY
private const val REQUEST_KEY = "O43z0dpjhgX20SCx4KAo"
private const val USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) " +
"AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.3"
Expand Down