Skip to content

Commit

Permalink
fix(POM-288): Handle non-hierarchical URI crash in legacy WebView (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalii-vanziak-cko authored Oct 30, 2023
1 parent bfaf6ee commit d9b89e5
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.app.Activity;
import android.content.Context;
import android.net.Uri;
import android.os.Handler;
import android.util.Base64;
import android.view.ViewGroup;
Expand Down Expand Up @@ -114,11 +115,14 @@ public void run() {
FingerprintWebView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
// Check if the current Android version is supporte
// Check if the current Android version is supported
String token = null;

if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
token = request.getUrl().getQueryParameter("token");
Uri uri = request.getUrl();
if (uri.isHierarchical()) {
token = uri.getQueryParameter("token");
}
}
if (token == null) {
// Android version not supported for fingerprinting
Expand Down

0 comments on commit d9b89e5

Please sign in to comment.