refactor: move public api key to build config
This commit is contained in:
parent
77d62deeed
commit
59e01e38fe
@ -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 {
|
||||
|
||||
@ -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"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user