CEEX v1.0.1版本的 MD5 值为:d20246587215ec3471b0d051724c6d34
以下内容为反编译后的 FaceProtocalActivity.java 源代码,内容仅作参考
package com.webank.facelight.ui;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.net.http.SslError;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.webkit.SslErrorHandler;
import android.webkit.WebResourceResponse;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;
import android.widget.LinearLayout;
import androidx.core.content.ContextCompat;
import androidx.core.graphics.drawable.DrawableCompat;
import androidx.exifinterface.media.ExifInterface;
import com.huawei.hms.support.hianalytics.HiAnalyticsConstant;
import com.webank.facelight.R;
import com.webank.facelight.contants.WbCloudFaceContant;
import com.webank.facelight.contants.WbFaceError;
import com.webank.facelight.contants.WbFaceVerifyResult;
import com.webank.facelight.tools.WbCloudFaceVerifySdk;
import com.webank.facelight.tools.g;
import com.webank.facelight.ui.FaceVerifyStatus;
import com.webank.facelight.ui.component.b;
import com.webank.facelight.wbanalytics.WBAnalyticsService;
import com.webank.normal.tools.WLogger;
import kotlin.jvm.internal.LongCompanionObject;
public class FaceProtocalActivity extends Activity {
private WbCloudFaceVerifySdk a;
private g b = new g(120000);
private b c;
private LinearLayout d;
private ImageView e;
private WebView f;
private String g;
private String h;
private FaceVerifyStatus.Mode i;
public static class a implements b.InterfaceC0097b {
private WbCloudFaceVerifySdk a;
private Activity b;
public a(WbCloudFaceVerifySdk wbCloudFaceVerifySdk, Activity activity) {
this.a = wbCloudFaceVerifySdk;
this.b = activity;
}
@Override
public void a() {
Context applicationContext;
String str;
WLogger.e("FaceProtocalActivity", "onHomePressed");
this.a.setIsFinishedVerify(true);
if (this.a.getWbFaceVerifyResultListener() != null) {
FaceVerifyStatus.Mode compareMode = this.a.getCompareMode();
if (compareMode.equals(FaceVerifyStatus.Mode.ACT)) {
applicationContext = this.b.getApplicationContext();
str = "active_protocol_detail_exit_self";
} else {
if (compareMode.equals(FaceVerifyStatus.Mode.REFLECTION)) {
applicationContext = this.b.getApplicationContext();
str = "light_protocol_detail_exit_self";
}
WbFaceVerifyResult wbFaceVerifyResult = new WbFaceVerifyResult();
wbFaceVerifyResult.setIsSuccess(false);
wbFaceVerifyResult.setOrderNo(this.a.getOrderNo());
wbFaceVerifyResult.setSign(null);
WbFaceError wbFaceError = new WbFaceError();
wbFaceError.setDomain(WbFaceError.WBFaceErrorDomainNativeProcess);
wbFaceError.setCode(WbFaceError.WBFaceErrorCodeUserCancle);
wbFaceError.setDesc("用户取消");
wbFaceError.setReason("手机home键:用户授权中取消");
wbFaceVerifyResult.setError(wbFaceError);
this.a.getWbFaceVerifyResultListener().onFinish(wbFaceVerifyResult);
}
WBAnalyticsService.trackCustomKVEvent(applicationContext, str, "点击home键返回", null);
WbFaceVerifyResult wbFaceVerifyResult2 = new WbFaceVerifyResult();
wbFaceVerifyResult2.setIsSuccess(false);
wbFaceVerifyResult2.setOrderNo(this.a.getOrderNo());
wbFaceVerifyResult2.setSign(null);
WbFaceError wbFaceError2 = new WbFaceError();
wbFaceError2.setDomain(WbFaceError.WBFaceErrorDomainNativeProcess);
wbFaceError2.setCode(WbFaceError.WBFaceErrorCodeUserCancle);
wbFaceError2.setDesc("用户取消");
wbFaceError2.setReason("手机home键:用户授权中取消");
wbFaceVerifyResult2.setError(wbFaceError2);
this.a.getWbFaceVerifyResultListener().onFinish(wbFaceVerifyResult2);
}
this.b.finish();
}
@Override
public void b() {
WLogger.e("FaceProtocalActivity", "onHomeLongPressed");
}
}
public void a(String str) {
this.f.loadUrl(str);
}
private void b() {
StringBuilder sb;
String str;
b bVar = new b(this);
this.c = bVar;
bVar.a(new a(this.a, this));
String protocolCorpName = this.a.getProtocolCorpName();
WLogger.d("FaceProtocalActivity", "protocolCorpName=" + protocolCorpName);
String replace = protocolCorpName.replace("$$$", HiAnalyticsConstant.REPORT_VAL_SEPARATOR);
WLogger.d("FaceProtocalActivity", "after protocolCorpName=" + replace);
String[] split = replace.split("\\|");
String str2 = null;
String str3 = "Tencent.html?name=";
for (int i = 0; i < split.length; i++) {
WLogger.d("FaceProtocalActivity", "tmp[" + i + "]=" + split[i]);
if (i == 0) {
str2 = split[0];
} else if (i == 1 && split[1].equals(ExifInterface.GPS_MEASUREMENT_3D)) {
str3 = "Webank.html?name=";
}
}
if (this.a.isIpv6()) {
sb = new StringBuilder();
str = "https://idav6.webank.com/s/h5/protocol";
} else {
sb = new StringBuilder();
str = "https://ida.webank.com/s/h5/protocol";
}
sb.append(str);
sb.append(str3);
sb.append(str2);
this.g = sb.toString();
WLogger.d("FaceProtocalActivity", "url=" + this.g);
this.e = (ImageView) findViewById(R.id.wbcf_protocol_back);
if (this.h.equals("custom")) {
Drawable mutate = DrawableCompat.wrap(ContextCompat.getDrawable(this, R.mipmap.wbcf_back)).mutate();
DrawableCompat.setTint(mutate, R.color.wbcf_custom_auth_back_tint);
this.e.setImageDrawable(mutate);
}
LinearLayout linearLayout = (LinearLayout) findViewById(R.id.wbcf_protocol_left_button);
this.d = linearLayout;
linearLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Context applicationContext;
String str4;
if (FaceProtocalActivity.this.f.canGoBack()) {
WLogger.d("FaceProtocalActivity", "左上角返回键,回到上一页");
FaceProtocalActivity.this.f.goBack();
return;
}
WLogger.d("FaceProtocalActivity", "左上角返回键,无上一页,退出授权sdk");
if (!FaceProtocalActivity.this.i.equals(FaceVerifyStatus.Mode.ACT)) {
if (FaceProtocalActivity.this.i.equals(FaceVerifyStatus.Mode.REFLECTION)) {
applicationContext = FaceProtocalActivity.this.getApplicationContext();
str4 = "light_protocol_detail_exit_self";
}
FaceProtocalActivity.this.finish();
}
applicationContext = FaceProtocalActivity.this.getApplicationContext();
str4 = "active_protocol_detail_exit_self";
WBAnalyticsService.trackCustomKVEvent(applicationContext, str4, "左上角返回", null);
FaceProtocalActivity.this.finish();
}
});
WebView webView = (WebView) findViewById(R.id.wbcf_protocol_webview);
this.f = webView;
webView.setBackgroundColor(0);
c();
}
protected void c() {
int i = Build.VERSION.SDK_INT;
if (i >= 16) {
this.f.setImportantForAccessibility(4);
}
this.f.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView webView, String str) {
super.onPageFinished(webView, str);
WLogger.d("FaceProtocalActivity", "onPageFinished:" + System.currentTimeMillis());
}
@Override
public void onPageStarted(WebView webView, String str, Bitmap bitmap) {
super.onPageStarted(webView, str, bitmap);
WLogger.d("FaceProtocalActivity", "onPageStarted:" + System.currentTimeMillis());
}
@Override
public void onReceivedSslError(WebView webView, final SslErrorHandler sslErrorHandler, SslError sslError) {
WLogger.e("FaceProtocalActivity", "webview访问网址ssl证书无效!询问客户");
AlertDialog.Builder builder = new AlertDialog.Builder(FaceProtocalActivity.this);
builder.setMessage("当前页面证书不可信,是否继续访问?");
builder.setPositiveButton("继续", new DialogInterface.OnClickListener(this) {
@Override
public void onClick(DialogInterface dialogInterface, int i2) {
sslErrorHandler.proceed();
}
});
builder.setNegativeButton("取消", new DialogInterface.OnClickListener(this) {
@Override
public void onClick(DialogInterface dialogInterface, int i2) {
sslErrorHandler.cancel();
}
});
builder.create().show();
}
@Override
public WebResourceResponse shouldInterceptRequest(WebView webView, String str) {
return super.shouldInterceptRequest(webView, str);
}
@Override
public boolean shouldOverrideUrlLoading(WebView webView, String str) {
WLogger.d("FaceProtocalActivity", str);
if (str.startsWith("https://")) {
FaceProtocalActivity.this.a(str);
return true;
}
return false;
}
});
WebSettings settings = this.f.getSettings();
settings.setJavaScriptEnabled(true);
if (i >= 26) {
WLogger.d("FaceProtocalActivity", "this phone SafeBrowsingEnabled=" + settings.getSafeBrowsingEnabled());
settings.setSafeBrowsingEnabled(false);
}
settings.setAllowFileAccess(true);
settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);
settings.setSupportZoom(true);
settings.setBuiltInZoomControls(true);
settings.setUseWideViewPort(true);
settings.setSupportMultipleWindows(false);
settings.setLoadWithOverviewMode(true);
settings.setAppCacheEnabled(true);
settings.setDatabaseEnabled(true);
settings.setDomStorageEnabled(true);
settings.setGeolocationEnabled(true);
settings.setAppCacheMaxSize(LongCompanionObject.MAX_VALUE);
settings.setAppCachePath(getDir("appcache", 0).getPath());
settings.setDatabasePath(getDir("databases", 0).getPath());
settings.setGeolocationDatabasePath(getDir("geolocation", 0).getPath());
settings.setPluginState(WebSettings.PluginState.ON_DEMAND);
settings.setRenderPriority(WebSettings.RenderPriority.HIGH);
if (i >= 16) {
settings.setAllowUniversalAccessFromFileURLs(true);
}
if (i <= 19) {
this.f.removeJavascriptInterface("searchBoxJavaBridge_");
this.f.removeJavascriptInterface("accessibility");
this.f.removeJavascriptInterface("accessibilityTraversal");
}
if (i >= 11) {
this.f.removeJavascriptInterface("searchBoxJavaBridge_");
}
this.f.setOnLongClickListener(new View.OnLongClickListener(this) {
@Override
public boolean onLongClick(View view) {
return true;
}
});
a(this.g);
}
@Override
public void onBackPressed() {
Context applicationContext;
String str;
if (this.f.canGoBack()) {
WLogger.d("FaceProtocalActivity", "手机返回键,回到上一页");
this.f.goBack();
return;
}
WLogger.d("FaceProtocalActivity", "手机返回键,无上一页可回,退出授权页面");
super.onBackPressed();
if (!this.i.equals(FaceVerifyStatus.Mode.ACT)) {
if (this.i.equals(FaceVerifyStatus.Mode.REFLECTION)) {
applicationContext = getApplicationContext();
str = "light_protocol_detail_exit_self";
}
finish();
}
applicationContext = getApplicationContext();
str = "active_protocol_detail_exit_self";
WBAnalyticsService.trackCustomKVEvent(applicationContext, str, "手机返回键", null);
finish();
}
@Override
public void onCreate(Bundle bundle) {
Context applicationContext;
String str;
String colorMode;
WLogger.d("FaceProtocalActivity", "onCreate");
WbCloudFaceVerifySdk wbCloudFaceVerifySdk = WbCloudFaceVerifySdk.getInstance();
this.a = wbCloudFaceVerifySdk;
this.i = wbCloudFaceVerifySdk.getCompareMode();
WLogger.d("FaceProtocalActivity", "mWbCloudFaceVerifySdk.getCompareMode()=" + this.i);
if (!this.i.equals(FaceVerifyStatus.Mode.ACT)) {
if (this.i.equals(FaceVerifyStatus.Mode.REFLECTION)) {
applicationContext = getApplicationContext();
str = "light_protocol_detail_enter";
}
colorMode = this.a.getColorMode();
this.h = colorMode;
if (colorMode == null) {
WLogger.e("FaceProtocalActivity", "mWbCloudFaceVerifySdk.getColorMode() null,set default black");
this.h = WbCloudFaceContant.BLACK;
}
super.onCreate(bundle);
setContentView(R.layout.wbcf_face_protocol_layout);
b();
}
applicationContext = getApplicationContext();
str = "active_protocol_detail_enter";
WBAnalyticsService.trackCustomKVEvent(applicationContext, str, null, null);
colorMode = this.a.getColorMode();
this.h = colorMode;
if (colorMode == null) {
}
super.onCreate(bundle);
setContentView(R.layout.wbcf_face_protocol_layout);
b();
}
@Override
public void onDestroy() {
super.onDestroy();
WLogger.i("FaceProtocalActivity", "onDestroy");
}
@Override
public void onPause() {
WLogger.d("TAG", "onPause");
super.onPause();
b bVar = this.c;
if (bVar != null) {
bVar.b();
}
this.b.a();
}
@Override
public void onResume() {
super.onResume();
WLogger.d("FaceProtocalActivity", "onResume");
b bVar = this.c;
if (bVar != null) {
bVar.a();
}
this.b.a(getApplicationContext());
}
@Override
public void onStart() {
WLogger.d("FaceProtocalActivity", "onStart");
super.onStart();
}
@Override
public void onStop() {
WLogger.i("TAG", "onStop");
super.onStop();
}
}