File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
src/main/java/org/schabi/newpipe/util/potoken Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,10 @@ android {
4848 System .getProperty(" versionNameSuffix" )?.let { versionNameSuffix = it }
4949
5050 testInstrumentationRunner = " androidx.test.runner.AndroidJUnitRunner"
51+
52+ // Move public API key to BuildConfig to avoid direct exposure in source code
53+ val googleApiKey = System .getenv(" NEWPIPE_GOOGLE_API_KEY" ) ? : " AIzaSyDyT5W0Jh49F30Pqqtyfdf7pDLFKLJoAnw"
54+ buildConfigField(" String" , " GOOGLE_API_KEY" , " \" $googleApiKey \" " )
5155 }
5256
5357 buildTypes {
Original file line number Diff line number Diff line change @@ -363,8 +363,8 @@ class PoTokenWebView private constructor(
363363
364364 companion object : PoTokenGenerator .Factory {
365365 private val TAG = PoTokenWebView ::class .simpleName
366- // Public API key used by BotGuard, which has been got by looking at BotGuard requests
367- private const val GOOGLE_API_KEY = " AIzaSyDyT5W0Jh49F30Pqqtyfdf7pDLFKLJoAnw " // NOSONAR
366+ // Public API key used by BotGuard, moved to BuildConfig
367+ private const val GOOGLE_API_KEY = BuildConfig . GOOGLE_API_KEY
368368 private const val REQUEST_KEY = " O43z0dpjhgX20SCx4KAo"
369369 private const val USER_AGENT = " Mozilla/5.0 (Windows NT 10.0; Win64; x64) " +
370370 " AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.3"
You can’t perform that action at this time.
0 commit comments