Skip to content
Merged
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
12 changes: 12 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ val keystoreProperties = Properties().apply {
}
}

val localProperties = Properties().apply {
val propFile = rootProject.file("local.properties")
if (propFile.exists()) {
propFile.inputStream().use { load(it) }
}
}

val enableAbiSplits = providers.gradleProperty("pixelplay.enableAbiSplits")
.getOrElse("true")
.toBoolean()
Expand Down Expand Up @@ -66,6 +73,11 @@ android {
versionName = (project.findProperty("APP_VERSION_NAME") as? String) ?: "1.0.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

val telegramApiId = localProperties.getProperty("TELEGRAM_API_ID") ?: ""
val telegramApiHash = localProperties.getProperty("TELEGRAM_API_HASH") ?: ""
buildConfigField("int", "TELEGRAM_API_ID", telegramApiId.ifEmpty { "0" })
buildConfigField("String", "TELEGRAM_API_HASH", "\"$telegramApiHash\"")
}

signingConfigs {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.theveloper.pixelplay.data.telegram

import android.content.Context
import com.theveloper.pixelplay.BuildConfig
import dagger.hilt.android.qualifiers.ApplicationContext
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.MutableStateFlow
Expand Down Expand Up @@ -108,12 +109,12 @@ class TelegramClientManager @Inject constructor(
true, // useChatInfoDatabase
true, // useMessageDatabase
false, // useSecretChats
2040, // apiId
"b18441a1ff607e10a989891a5462e627", // apiHash
BuildConfig.TELEGRAM_API_ID,
BuildConfig.TELEGRAM_API_HASH,
"en", // systemLanguageCode
android.os.Build.MODEL, // deviceModel
"PixelPlayer Instance", // deviceModel
android.os.Build.VERSION.RELEASE, // systemVersion
"1.0" // applicationVersion
BuildConfig.VERSION_NAME
), defaultHandler)
}
is TdApi.AuthorizationStateWaitPhoneNumber -> {
Expand Down
Loading