jimu-decompiled/sources/com/tencent/open/c/c.java
2025-05-13 19:24:51 +02:00

97 lines
3.6 KiB
Java

package com.tencent.open.c;
import android.content.Context;
import android.view.KeyEvent;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import com.tencent.open.a.f;
import com.tencent.open.web.security.SecureJsInterface;
/* compiled from: ProGuard */
/* loaded from: classes.dex */
public class c extends b {
public static boolean a;
private KeyEvent b;
private com.tencent.open.web.security.a c;
public c(Context context) {
super(context);
}
@Override // android.webkit.WebView, android.view.ViewGroup, android.view.View
public boolean dispatchKeyEvent(KeyEvent keyEvent) {
int unicodeChar;
f.b("openSDK_LOG.SecureWebView", "-->dispatchKeyEvent, is device support: " + a);
if (!a) {
return super.dispatchKeyEvent(keyEvent);
}
if (keyEvent.getAction() != 0) {
return super.dispatchKeyEvent(keyEvent);
}
int keyCode = keyEvent.getKeyCode();
if (keyCode == 4) {
return super.dispatchKeyEvent(keyEvent);
}
if (keyCode == 66) {
return super.dispatchKeyEvent(keyEvent);
}
if (keyCode == 67) {
com.tencent.open.web.security.a.b = true;
return super.dispatchKeyEvent(keyEvent);
}
if (keyEvent.getUnicodeChar() == 0) {
return super.dispatchKeyEvent(keyEvent);
}
if (!SecureJsInterface.isPWDEdit || (((unicodeChar = keyEvent.getUnicodeChar()) < 33 || unicodeChar > 95) && (unicodeChar < 97 || unicodeChar > 125))) {
return super.dispatchKeyEvent(keyEvent);
}
this.b = new KeyEvent(0, 17);
return super.dispatchKeyEvent(this.b);
}
@Override // android.webkit.WebView, android.view.View
public InputConnection onCreateInputConnection(EditorInfo editorInfo) {
f.c("openSDK_LOG.SecureWebView", "-->create input connection, is edit: " + SecureJsInterface.isPWDEdit);
InputConnection onCreateInputConnection = super.onCreateInputConnection(editorInfo);
f.a("openSDK_LOG.SecureWebView", "-->onCreateInputConnection, inputConn is " + onCreateInputConnection);
if (onCreateInputConnection == null) {
a = false;
return onCreateInputConnection;
}
a = true;
this.c = new com.tencent.open.web.security.a(super.onCreateInputConnection(editorInfo), false);
return this.c;
}
@Override // android.webkit.WebView, android.view.View, android.view.KeyEvent.Callback
public boolean onKeyDown(int i, KeyEvent keyEvent) {
int unicodeChar;
f.b("openSDK_LOG.SecureWebView", "-->onKeyDown, is device support: " + a);
if (!a) {
return super.onKeyDown(i, keyEvent);
}
if (keyEvent.getAction() != 0) {
return super.onKeyDown(i, keyEvent);
}
int keyCode = keyEvent.getKeyCode();
if (keyCode == 4) {
return super.onKeyDown(i, keyEvent);
}
if (keyCode == 66) {
return super.onKeyDown(i, keyEvent);
}
if (keyCode == 67) {
com.tencent.open.web.security.a.b = true;
return super.onKeyDown(i, keyEvent);
}
if (keyEvent.getUnicodeChar() == 0) {
return super.onKeyDown(i, keyEvent);
}
if (!SecureJsInterface.isPWDEdit || (((unicodeChar = keyEvent.getUnicodeChar()) < 33 || unicodeChar > 95) && (unicodeChar < 97 || unicodeChar > 125))) {
return super.onKeyDown(i, keyEvent);
}
this.b = new KeyEvent(0, 17);
return super.onKeyDown(this.b.getKeyCode(), this.b);
}
}