Load Ouinet settings from local.properties file using Gradle

This commit is contained in:
Miguel 2022-05-31 18:27:14 -05:00
parent 624e199e6b
commit 4bd35009cd
2 changed files with 10 additions and 0 deletions

View File

@ -3,6 +3,9 @@ plugins {
id 'kotlin-android'
}
Properties localProperties = new Properties()
localProperties.load(rootProject.file('local.properties').newDataInputStream())
android {
compileSdk 32
@ -14,6 +17,10 @@ android {
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
buildConfigField "String", "CACHE_PUB_KEY", localProperties['CACHE_PUB_KEY']
buildConfigField "String", "INJECTOR_CREDENTIALS", localProperties['INJECTOR_CREDENTIALS']
buildConfigField "String", "INJECTOR_TLS_CERT", localProperties['INJECTOR_TLS_CERT']
}
buildTypes {

View File

@ -12,6 +12,9 @@ class MainActivity : AppCompatActivity() {
var config = Config.ConfigBuilder(this)
.setCacheType("bep5-http")
.setTlsCaCertStorePath("file:///android_asset/cacert.pem")
.setCacheHttpPubKey(BuildConfig.CACHE_PUB_KEY)
.setInjectorCredentials(BuildConfig.INJECTOR_CREDENTIALS)
.setInjectorTlsCert(BuildConfig.INJECTOR_TLS_CERT)
.build()
}
}