mirror of
https://github.com/AllanWang/Frost-for-Facebook.git
synced 2024-11-08 12:02:33 +01:00
Move biometric init out of coroutine launch
This commit is contained in:
parent
f8b477b976
commit
5f397d2b8f
@ -70,8 +70,8 @@ class StartActivity : KauBaseActivity() {
|
||||
showInvalidWebView()
|
||||
}
|
||||
|
||||
val authDefer = BiometricUtils.authenticate(this@StartActivity)
|
||||
launch {
|
||||
val authDefer = BiometricUtils.authenticate(this@StartActivity)
|
||||
try {
|
||||
FbCookie.switchBackUser()
|
||||
val cookies = ArrayList(cookieDao.selectAll())
|
||||
|
@ -209,8 +209,8 @@ abstract class WebOverlayActivityBase : BaseActivity(),
|
||||
|
||||
with(web) {
|
||||
Prefs.prevId = Prefs.userId
|
||||
val authDefer = BiometricUtils.authenticate(this@WebOverlayActivityBase)
|
||||
launch {
|
||||
val authDefer = BiometricUtils.authenticate(this@WebOverlayActivityBase)
|
||||
if (userId != Prefs.userId)
|
||||
FbCookie.switchUser(userId)
|
||||
authDefer.await()
|
||||
|
@ -65,6 +65,11 @@ object BiometricUtils {
|
||||
return Prefs.biometricsEnabled && System.currentTimeMillis() - lastUnlockTime > UNLOCK_TIME_INTERVAL
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a prompt dialog and attempt to return an auth object.
|
||||
* Note that the underlying request will call [androidx.fragment.app.FragmentTransaction.commit],
|
||||
* so this cannot happen after onSaveInstanceState.
|
||||
*/
|
||||
fun authenticate(activity: FragmentActivity, force: Boolean = false): BiometricDeferred {
|
||||
val deferred: BiometricDeferred = CompletableDeferred()
|
||||
if (!force && !shouldPrompt(activity)) {
|
||||
|
@ -1,3 +1,4 @@
|
||||
v2.4.0
|
||||
|
||||
* Removed web only mode for auth requests. Marking notifications as read is now disabled by default to deal with phishing accusations.
|
||||
* Removed web only mode for auth requests. Marking notifications as read is now disabled by default to deal with phishing accusations.
|
||||
* Save images with the correct extensions.
|
@ -8,7 +8,7 @@
|
||||
|
||||
<version title="v2.4.0" />
|
||||
<item text="Removed web only mode for auth requests. Marking notifications as read is now disabled by default to deal with phishing accusations." />
|
||||
<item text="" />
|
||||
<item text="Save images with the correct extensions." />
|
||||
<item text="" />
|
||||
|
||||
<version title="v2.3.2" />
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
## v2.4.0
|
||||
* Removed web only mode for auth requests. Marking notifications as read is now disabled by default to deal with phishing accusations.
|
||||
* Save images with the correct extensions.
|
||||
|
||||
## v2.3.2
|
||||
* Disable auto feed refresh by default and add setting to re-enable it
|
||||
|
Loading…
Reference in New Issue
Block a user