Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump hwsecurity-fido from 2.4.5 to 4.1.0-patch2 #3510

Merged
merged 2 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ ext {
coilKtVersion = "2.5.0"
daggerVersion = "2.49"
emojiVersion = "1.4.0"
fidoVersion = "4.1.0-patch2"
lifecycleVersion = '2.6.2'
okhttpVersion = "4.12.0"
markwonVersion = "4.6.2"
Expand Down Expand Up @@ -252,7 +253,8 @@ dependencies {
implementation "io.coil-kt:coil-svg:${coilKtVersion}"
implementation 'com.github.natario1:Autocomplete:v1.1.0'

implementation 'com.github.cotechde.hwsecurity:hwsecurity-fido:2.4.5'
implementation "com.github.nextcloud-deps.hwsecurity:hwsecurity-fido:${fidoVersion}"
implementation "com.github.nextcloud-deps.hwsecurity:hwsecurity-fido2:${fidoVersion}"

implementation 'com.novoda:merlin:1.2.1'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_TOKEN
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_USERNAME
import com.nextcloud.talk.utils.ssl.TrustManager
import de.cotech.hw.fido.WebViewFidoBridge
import de.cotech.hw.fido2.WebViewWebauthnBridge
import de.cotech.hw.fido2.ui.WebauthnDialogOptions
import io.reactivex.disposables.Disposable
import java.lang.reflect.Field
import java.net.CookieManager
Expand Down Expand Up @@ -99,6 +101,7 @@ class WebViewLoginActivity : BaseActivity() {
private var loginStep = 0
private var automatedLoginAttempted = false
private var webViewFidoBridge: WebViewFidoBridge? = null
private var webViewWebauthnBridge: WebViewWebauthnBridge? = null

private val onBackPressedCallback = object : OnBackPressedCallback(true) {
override fun handleOnBackPressed() {
Expand Down Expand Up @@ -164,6 +167,12 @@ class WebViewLoginActivity : BaseActivity() {
binding.webview.clearHistory()
WebView.clearClientCertPreferences(null)
webViewFidoBridge = WebViewFidoBridge.createInstanceForWebView(this, binding.webview)

val webauthnOptionsBuilder = WebauthnDialogOptions.builder().setShowSdkLogo(true).setAllowSkipPin(true)
webViewWebauthnBridge = WebViewWebauthnBridge.createInstanceForWebView(
this, binding.webview, webauthnOptionsBuilder
)

CookieSyncManager.createInstance(this)
android.webkit.CookieManager.getInstance().removeAllCookies(null)
val headers: MutableMap<String, String> = HashMap()
Expand All @@ -172,12 +181,14 @@ class WebViewLoginActivity : BaseActivity() {
private var basePageLoaded = false
override fun shouldInterceptRequest(view: WebView, request: WebResourceRequest): WebResourceResponse? {
webViewFidoBridge?.delegateShouldInterceptRequest(view, request)
webViewWebauthnBridge?.delegateShouldInterceptRequest(view, request)
return super.shouldInterceptRequest(view, request)
}

override fun onPageStarted(view: WebView, url: String, favicon: Bitmap?) {
super.onPageStarted(view, url, favicon)
webViewFidoBridge?.delegateOnPageStarted(view, url, favicon)
webViewWebauthnBridge?.delegateOnPageStarted(view, url, favicon)
}

@Deprecated("Use shouldOverrideUrlLoading(WebView view, WebResourceRequest request)")
Expand Down
Loading