1
0
mirror of https://github.com/AllanWang/Frost-for-Facebook.git synced 2024-11-10 04:52:38 +01:00

Move biometric init out of coroutine launch

This commit is contained in:
Allan Wang 2019-09-08 02:06:14 -07:00
parent f8b477b976
commit 5f397d2b8f
No known key found for this signature in database
GPG Key ID: C93E3F9C679D7A56
6 changed files with 11 additions and 4 deletions

View File

@ -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())

View File

@ -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()

View File

@ -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)) {

View File

@ -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.

View File

@ -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" />

View File

@ -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