Move all ACRA credentials to props file

This commit is contained in:
ChronosX88 2022-01-15 19:33:30 +03:00
parent 9a2d534620
commit 150550dc2c
Signed by: ChronosXYZ
GPG Key ID: 085A69A82C8C511A
5 changed files with 26 additions and 8 deletions

2
.gitignore vendored
View File

@ -17,3 +17,5 @@
/app/src/main/assets/yggdrasil-0.3.8-linux-arm64
/app/src/main/assets/yggdrasil-0.3.8-linux-armhf
/.idea/
acra.properties

View File

@ -1,5 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DesignSurface">
<option name="filePathToZoomLevelMap">
<map>
<entry key="app/src/main/res/layout/activity_main.xml" value="0.3385416666666667" />
<entry key="app/src/main/res/layout/activity_peer_list.xml" value="0.3385416666666667" />
<entry key="app/src/main/res/layout/content_main.xml" value="0.24728260869565216" />
<entry key="app/src/main/res/menu/save_peers.xml" value="0.3385416666666667" />
</map>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>

3
acra.properties.sample Normal file
View File

@ -0,0 +1,3 @@
ACRA_BACKEND_URL=""
ACRA_LOGIN=""
ACRA_PASSWORD=""

View File

@ -1,6 +1,10 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
def acraSecretsPropertiesFile = rootProject.file("acra.properties")
def acraSecretsProperties = new Properties()
acraSecretsProperties.load(new FileInputStream(acraSecretsPropertiesFile))
android {
compileSdkVersion 31
defaultConfig {
@ -12,6 +16,10 @@ android {
versionName "2.0.18"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
setProperty("archivesBaseName", project.getParent().name+"-"+versionName)
buildConfigField("String", "ACRA_BACKEND_URL", acraSecretsProperties['ACRA_BACKEND_URL'])
buildConfigField("String", "ACRA_LOGIN", acraSecretsProperties['ACRA_LOGIN'])
buildConfigField("String", "ACRA_PASSWORD", acraSecretsProperties['ACRA_PASSWORD'])
}
signingConfigs {
release {

View File

@ -9,11 +9,6 @@ import org.acra.ktx.initAcra
import org.acra.sender.HttpSender
class YggApplication : Application() {
companion object {
const val ACRA_BACKEND_URL = "http://acrarium.rivchain.org/acrarium-1.4.6/report"
}
override fun attachBaseContext(base: Context) {
super.attachBaseContext(base)
@ -23,9 +18,9 @@ class YggApplication : Application() {
reportFormat = StringFormat.JSON
//each plugin you chose above can be configured in a block like this:
httpSender {
uri = ACRA_BACKEND_URL
basicAuthLogin="KOF7CEnt5tfTqIhj"
basicAuthPassword = "F4cCIqo9EjpihcPt"
uri = BuildConfig.ACRA_BACKEND_URL
basicAuthLogin = BuildConfig.ACRA_LOGIN
basicAuthPassword = BuildConfig.ACRA_PASSWORD
httpMethod = HttpSender.Method.POST
}
dialog {