Updated on 2026-08-14

This commit is contained in:
Tangem 2023-03-02 00:22:28 +04:00
parent e77eff8935
commit 92064843db
67 changed files with 2232 additions and 337 deletions

View file

@ -110,6 +110,7 @@ internal class ConfigManagerImpl @Inject constructor() : ConfigManager {
shopify = configValues.shopifyShop,
zendesk = configValues.zendesk,
swapReferrerAccount = configValues.swapReferrerAccount,
walletConnectProjectId = configValues.walletConnectProjectId,
)
}
}

View file

@ -18,4 +18,5 @@ data class Config(
val shopify: ShopifyShop? = null,
val zendesk: ZendeskConfig? = null,
val swapReferrerAccount: SwapReferrerAccount? = null,
val walletConnectProjectId: String = "",
)

View file

@ -37,6 +37,7 @@ class ConfigValueModel(
val amplitudeApiKey: String,
val swapReferrerAccount: SwapReferrerAccount?,
val kaspaSecondaryApiUrl: String,
val walletConnectProjectId: String,
)
data class AppsFlyer(

View file

@ -0,0 +1,18 @@
package com.tangem.datasource.di
import com.tangem.datasource.files.AndroidFileReader
import com.tangem.datasource.files.FileReader
import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
internal interface FilesModule {
@Binds
@Singleton
fun bindFileReader(androidFileReader: AndroidFileReader): FileReader
}

View file

@ -0,0 +1,17 @@
package com.tangem.datasource.files
import android.content.Context
import dagger.hilt.android.qualifiers.ApplicationContext
import javax.inject.Inject
class AndroidFileReader @Inject constructor(@ApplicationContext private val context: Context) : FileReader {
override fun readFile(fileName: String): String {
return context.openFileInput(fileName).bufferedReader().readText()
}
override fun rewriteFile(content: String, fileName: String) {
context.openFileOutput(fileName, Context.MODE_PRIVATE).use {
it.write(content.toByteArray(), 0, content.length)
}
}
}

View file

@ -0,0 +1,6 @@
package com.tangem.datasource.files
interface FileReader {
fun readFile(fileName: String): String
fun rewriteFile(content: String, fileName: String)
}