Updated on 2026-08-14
This commit is contained in:
parent
e77eff8935
commit
92064843db
67 changed files with 2232 additions and 337 deletions
|
|
@ -110,6 +110,7 @@ internal class ConfigManagerImpl @Inject constructor() : ConfigManager {
|
|||
shopify = configValues.shopifyShop,
|
||||
zendesk = configValues.zendesk,
|
||||
swapReferrerAccount = configValues.swapReferrerAccount,
|
||||
walletConnectProjectId = configValues.walletConnectProjectId,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -18,4 +18,5 @@ data class Config(
|
|||
val shopify: ShopifyShop? = null,
|
||||
val zendesk: ZendeskConfig? = null,
|
||||
val swapReferrerAccount: SwapReferrerAccount? = null,
|
||||
val walletConnectProjectId: String = "",
|
||||
)
|
||||
|
|
@ -37,6 +37,7 @@ class ConfigValueModel(
|
|||
val amplitudeApiKey: String,
|
||||
val swapReferrerAccount: SwapReferrerAccount?,
|
||||
val kaspaSecondaryApiUrl: String,
|
||||
val walletConnectProjectId: String,
|
||||
)
|
||||
|
||||
data class AppsFlyer(
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
package com.tangem.datasource.files
|
||||
|
||||
interface FileReader {
|
||||
fun readFile(fileName: String): String
|
||||
fun rewriteFile(content: String, fileName: String)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue