feat: F-Droid flavor

This commit is contained in:
rebelonion 2024-02-06 01:10:12 -06:00
parent 21f5d503cd
commit c0f3fed142
37 changed files with 218 additions and 97 deletions

View file

@ -5,6 +5,7 @@ import androidx.fragment.app.FragmentActivity
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import ani.dantotsu.BuildConfig
import ani.dantotsu.R
import ani.dantotsu.connections.discord.Discord
import ani.dantotsu.connections.mal.MAL
@ -100,7 +101,9 @@ class AnilistHomeViewModel : ViewModel() {
Anilist.getSavedToken()
MAL.getSavedToken(context)
Discord.getSavedToken(context)
if (PrefManager.getVal(PrefName.CheckUpdate)) AppUpdater.check(context)
if (!BuildConfig.FLAVOR.contains("fdroid")) {
if (PrefManager.getVal(PrefName.CheckUpdate)) AppUpdater.check(context)
}
genres.postValue(Anilist.query.getGenresAndTags(context))
}

View file

@ -0,0 +1,9 @@
package ani.dantotsu.connections.crashlytics
interface CrashlyticsInterface {
fun logException(e: Throwable)
fun log(message: String)
fun setUserId(id: String)
fun setCustomKey(key: String, value: String)
fun setCrashlyticsCollectionEnabled(enabled: Boolean)
}

View file

@ -0,0 +1,24 @@
package ani.dantotsu.connections.crashlytics
class CrashlyticsStub : CrashlyticsInterface {
override fun logException(e: Throwable) {
//no-op
}
override fun log(message: String) {
//no-op
}
override fun setUserId(id: String) {
//no-op
}
override fun setCustomKey(key: String, value: String) {
//no-op
}
override fun setCrashlyticsCollectionEnabled(enabled: Boolean) {
//no-op
}
}