mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
merge with upstream
This commit is contained in:
parent
6a2d0fd35f
commit
8ba2fb8046
5 changed files with 9 additions and 15 deletions
|
@ -1234,8 +1234,6 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener,
|
||||||
changeStatusBarState(isLayout(EMULATOR))
|
changeStatusBarState(isLayout(EMULATOR))
|
||||||
|
|
||||||
/** Biometric stuff for users without accounts **/
|
/** Biometric stuff for users without accounts **/
|
||||||
val noAccounts = settingsManager.getBoolean(getString(R.string.skip_startup_account_select_key), false) || accounts.count() <= 1
|
|
||||||
val authEnabled = settingsManager.getBoolean(getString(R.string.biometric_key), false)
|
|
||||||
val noAccounts = settingsManager.getBoolean(
|
val noAccounts = settingsManager.getBoolean(
|
||||||
getString(R.string.skip_startup_account_select_key),
|
getString(R.string.skip_startup_account_select_key),
|
||||||
false
|
false
|
||||||
|
@ -1245,8 +1243,8 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener,
|
||||||
if (deviceHasPasswordPinLock(this)) {
|
if (deviceHasPasswordPinLock(this)) {
|
||||||
startBiometricAuthentication(this, R.string.biometric_authentication_title, false)
|
startBiometricAuthentication(this, R.string.biometric_authentication_title, false)
|
||||||
|
|
||||||
BiometricAuthenticator.promptInfo?.let { promt ->
|
promptInfo?.let { prompt ->
|
||||||
BiometricAuthenticator.biometricPrompt?.authenticate(promt)
|
biometricPrompt?.authenticate(prompt)
|
||||||
}
|
}
|
||||||
|
|
||||||
// hide background while authenticating, Sorry moms & dads 🙏
|
// hide background while authenticating, Sorry moms & dads 🙏
|
||||||
|
|
|
@ -64,8 +64,8 @@ class AccountSelectActivity : AppCompatActivity(), BiometricAuthenticator.Biomet
|
||||||
false
|
false
|
||||||
)
|
)
|
||||||
|
|
||||||
BiometricAuthenticator.promptInfo?.let { promt ->
|
BiometricAuthenticator.promptInfo?.let { prompt ->
|
||||||
BiometricAuthenticator.biometricPrompt?.authenticate(promt)
|
BiometricAuthenticator.biometricPrompt?.authenticate(prompt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,7 @@ import com.lagradost.cloudstream3.syncproviders.AuthAPI
|
||||||
import com.lagradost.cloudstream3.syncproviders.InAppAuthAPI
|
import com.lagradost.cloudstream3.syncproviders.InAppAuthAPI
|
||||||
import com.lagradost.cloudstream3.syncproviders.OAuth2API
|
import com.lagradost.cloudstream3.syncproviders.OAuth2API
|
||||||
import com.lagradost.cloudstream3.ui.settings.Globals.EMULATOR
|
import com.lagradost.cloudstream3.ui.settings.Globals.EMULATOR
|
||||||
|
import com.lagradost.cloudstream3.ui.settings.Globals.PHONE
|
||||||
import com.lagradost.cloudstream3.ui.settings.Globals.TV
|
import com.lagradost.cloudstream3.ui.settings.Globals.TV
|
||||||
import com.lagradost.cloudstream3.ui.settings.Globals.isLayout
|
import com.lagradost.cloudstream3.ui.settings.Globals.isLayout
|
||||||
import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.getPref
|
import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.getPref
|
||||||
|
@ -296,7 +297,7 @@ class SettingsAccount : PreferenceFragmentCompat(), BiometricAuthenticator.Biome
|
||||||
hideKeyboard()
|
hideKeyboard()
|
||||||
setPreferencesFromResource(R.xml.settings_account, rootKey)
|
setPreferencesFromResource(R.xml.settings_account, rootKey)
|
||||||
// hide preference on tvs and emulators
|
// hide preference on tvs and emulators
|
||||||
if (!isTruePhone()) {
|
if (!isLayout(PHONE)) {
|
||||||
getPref(R.string.biometric_key)?.isVisible = false
|
getPref(R.string.biometric_key)?.isVisible = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,13 +20,12 @@ import com.lagradost.cloudstream3.R
|
||||||
|
|
||||||
object BiometricAuthenticator {
|
object BiometricAuthenticator {
|
||||||
|
|
||||||
|
const val TAG = "cs3Auth"
|
||||||
private const val MAX_FAILED_ATTEMPTS = 3
|
private const val MAX_FAILED_ATTEMPTS = 3
|
||||||
private var failedAttempts = 0
|
private var failedAttempts = 0
|
||||||
const val TAG = "cs3Auth"
|
|
||||||
private var biometricManager: BiometricManager? = null
|
private var biometricManager: BiometricManager? = null
|
||||||
var biometricPrompt: BiometricPrompt? = null
|
var biometricPrompt: BiometricPrompt? = null
|
||||||
var promptInfo: BiometricPrompt.PromptInfo? = null
|
var promptInfo: BiometricPrompt.PromptInfo? = null
|
||||||
|
|
||||||
var authCallback: BiometricAuthCallback? = null // listen to authentication success
|
var authCallback: BiometricAuthCallback? = null // listen to authentication success
|
||||||
|
|
||||||
private fun initializeBiometrics(activity: Activity) {
|
private fun initializeBiometrics(activity: Activity) {
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
|
@ -6,12 +5,9 @@ buildscript {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath("com.android.tools.build:gradle:8.2.1")
|
classpath("com.android.tools.build:gradle:8.2.2")
|
||||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.22")
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.22")
|
||||||
classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.9.10")
|
classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.9.10")
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
|
||||||
// in the individual module build.gradle.kts files
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +19,7 @@ allprojects {
|
||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("com.google.devtools.ksp") version "1.9.22-1.0.16" apply false
|
id("com.google.devtools.ksp") version "1.9.22-1.0.17" apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register<Delete>("clean") {
|
tasks.register<Delete>("clean") {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue