HYDK v3.0.0版本的 MD5 值为:36b96e4c5561390bc72ab66c2f29a92f
以下内容为反编译后的 j30.java 源代码,内容仅作参考
package p.a.y.e.a.s.e.net;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.content.Context;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.view.ViewGroup;
import android.webkit.JavascriptInterface;
import com.geetest.sdk.dialog.views.GT3GtWebView;
import com.huawei.hms.framework.common.ContainerUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;
public class j30 {
public static int lite_break = 0;
private static final String lite_this = "a";
public static int lite_void;
private n30 lite_byte;
private int lite_case;
private Context lite_do;
private String lite_else;
private a40 lite_for;
private Runnable lite_goto;
private x20 lite_int;
private int lite_new;
private int lite_try;
private GT3GtWebView lite_char = null;
private Handler lite_long = new c();
private n40 lite_if = new n40();
public class b {
public class a implements Runnable {
public final int lite_static;
public final String lite_switch;
public a(int i, String str) {
this.lite_static = i;
this.lite_switch = str;
}
@Override
public void run() {
if (j30.this.lite_int == null || j30.this.lite_int.lite_new() == null) {
w40.lite_if(j30.lite_this, "configBean is null !");
} else {
j30.this.lite_int.lite_new().lite_try(this.lite_static);
}
if (j30.this.lite_if != null) {
if (this.lite_static == 1) {
j30.this.lite_if.lite_int(true, this.lite_switch);
} else {
j30.this.lite_else();
}
}
}
}
public class RunnableC0097b implements Runnable {
public RunnableC0097b() {
}
@Override
public void run() {
if (j30.this.lite_char == null || j30.this.lite_char.lite_this()) {
return;
}
if (j30.this.lite_long != null) {
try {
j30.this.lite_long.removeCallbacks(j30.this.lite_goto);
j30.this.lite_long.removeMessages(1);
} catch (Exception unused) {
}
}
if (j30.this.lite_if != null) {
j30.this.lite_if.lite_do();
}
}
}
public class c implements Runnable {
public final String lite_static;
public c(String str) {
this.lite_static = str;
}
@Override
public void run() {
try {
JSONObject jSONObject = new JSONObject(this.lite_static);
j30.this.lite_if.lite_for(jSONObject.getString("error_code").replaceAll("[a-zA-Z]", ""), jSONObject.getString("user_error"));
} catch (JSONException e) {
e.printStackTrace();
j30.this.lite_if.lite_for("202", this.lite_static + "-->" + e.toString());
}
}
}
public class d implements Runnable {
public d() {
}
@Override
public void run() {
j30.this.lite_char.setVoice(true);
j30.this.lite_for.lite_native("voice");
int lite_do = t40.lite_do(j30.this.lite_do);
int lite_if = t40.lite_if(j30.this.lite_do);
int lite_do2 = r40.lite_do(j30.this.lite_do, 275.0f);
int lite_do3 = r40.lite_do(j30.this.lite_do, 348.0f);
int lite_do4 = r40.lite_do(j30.this.lite_do, 300.0f);
if (j30.this.lite_do.getResources().getConfiguration().orientation == 1) {
int i = (lite_if * 4) / 5;
if (i >= lite_do4) {
lite_do4 = i;
}
if (i <= lite_do3) {
lite_do3 = lite_do4;
}
j30.lite_void = lite_do3;
j30.lite_break = (j30.this.lite_case * lite_do3) / 100;
} else {
int lite_do5 = r40.lite_do(j30.this.lite_do, r40.lite_if(j30.this.lite_do, lite_do) - 44);
if (lite_do5 >= lite_do2) {
lite_do2 = lite_do5;
}
if (lite_do5 <= lite_do3) {
lite_do3 = lite_do2;
}
j30.lite_break = lite_do3;
j30.lite_void = (lite_do3 * 100) / j30.this.lite_case;
}
if (j30.this.lite_char != null && j30.this.lite_char.getLayoutParams() != null) {
ViewGroup.LayoutParams layoutParams = j30.this.lite_char.getLayoutParams();
layoutParams.width = j30.lite_void;
layoutParams.height = j30.lite_break;
j30.this.lite_char.setLayoutParams(layoutParams);
}
if (j30.this.lite_byte != null) {
j30.this.lite_byte.show();
}
}
}
private b() {
}
@JavascriptInterface
public void gt3Error(String str) {
w40.lite_if("JSInterface-->gt3Error", str);
if (j30.this.lite_long != null) {
try {
j30.this.lite_long.removeCallbacks(j30.this.lite_goto);
j30.this.lite_long.removeMessages(1);
} catch (Exception unused) {
}
}
if (j30.this.lite_if == null || j30.this.lite_do == null || !(j30.this.lite_do instanceof Activity)) {
return;
}
((Activity) j30.this.lite_do).runOnUiThread(new c(str));
}
@JavascriptInterface
public void gtCallBack(String str, String str2, String str3) {
w40.lite_if(j30.lite_this, "JSInterface-->gtCallBack-->code: " + str + ", message: " + str3);
String str4 = j30.lite_this;
StringBuilder j = r5.j("JSInterface-->gtCallBack-->code: ", str, ", result: ", str2, ", message: ");
j.append(str3);
w40.lite_int(str4, j.toString());
try {
int parseInt = Integer.parseInt(str);
if (j30.this.lite_do == null || ((Activity) j30.this.lite_do).isFinishing()) {
return;
}
((Activity) j30.this.lite_do).runOnUiThread(new a(parseInt, str2));
} catch (NumberFormatException e) {
e.printStackTrace();
}
}
@JavascriptInterface
public void gtClose() {
w40.lite_if(j30.lite_this, "JSInterface-->gtClose");
if (j30.this.lite_if != null) {
j30.this.lite_if.lite_new();
}
}
@JavascriptInterface
public void gtNotify(String str) {
w40.lite_if(j30.lite_this, "JSInterface-->gtNotify-->" + str);
try {
j30.this.lite_case = Integer.parseInt(new JSONObject(str).getString("aspect_radio"));
if (j30.this.lite_do == null || ((Activity) j30.this.lite_do).isFinishing()) {
return;
}
((Activity) j30.this.lite_do).runOnUiThread(new d());
} catch (Exception e) {
e.printStackTrace();
n40 n40Var = j30.this.lite_if;
StringBuilder b = r5.b("parse aspect_radio failed-->");
b.append(e.toString());
n40Var.lite_for("202", b.toString());
}
}
@JavascriptInterface
public void gtReady() {
w40.lite_if(j30.lite_this, "JSInterface-->gtReady");
if (j30.this.lite_do == null || !(j30.this.lite_do instanceof Activity)) {
return;
}
((Activity) j30.this.lite_do).runOnUiThread(new RunnableC0097b());
}
}
public class c extends Handler {
public c() {
}
@Override
public void handleMessage(Message message) {
if (message.what != 1 || j30.this.lite_if == null) {
return;
}
w40.lite_if(j30.lite_this, String.format("handleMessage-->timeout %s !", Integer.valueOf(j30.this.lite_for.lite_finally())));
j30.this.lite_if.lite_for("204", "load static resource timeout !");
}
}
public class d implements Runnable {
public d() {
}
@Override
public void run() {
Message message = new Message();
message.what = 1;
j30.this.lite_long.sendMessage(message);
}
}
public j30(Context context, n30 n30Var) {
this.lite_do = context;
this.lite_byte = n30Var;
}
private float lite_break() {
return this.lite_do.getResources().getDisplayMetrics().density;
}
private int lite_class() {
int i;
int lite_do = t40.lite_do(this.lite_do);
int lite_if = t40.lite_if(this.lite_do);
int lite_do2 = r40.lite_do(this.lite_do, 300.0f);
int lite_do3 = r40.lite_do(this.lite_do, 275.0f);
int lite_do4 = r40.lite_do(this.lite_do, 410.0f);
int lite_do5 = r40.lite_do(this.lite_do, 348.0f);
String str = lite_this;
StringBuilder b2 = r5.b("widthScreen: ");
b2.append(r40.lite_if(this.lite_do, lite_if));
w40.lite_int(str, b2.toString());
int i2 = lite_do < lite_if ? (lite_do * 4) / 5 : (lite_if * 4) / 5;
if ("beeline".equals(this.lite_for.lite_default()) || (i = this.lite_case) <= 60) {
this.lite_new = lite_do2;
this.lite_try = (lite_do2 * this.lite_case) / 100;
} else if (i >= 100) {
"slide".equals(this.lite_for.lite_default());
if (lite_do < lite_if) {
int lite_do6 = r40.lite_do(this.lite_do, r40.lite_if(r2, lite_do) - 44);
w40.lite_if(str, "limitationWidth: " + lite_do6);
if (s40.lite_for(this.lite_do)) {
if (lite_do6 >= lite_do3) {
lite_do3 = lite_do6;
}
} else if (lite_do6 >= lite_do3) {
lite_do3 = lite_do6;
}
lite_do4 = lite_do3;
if (lite_do < lite_if) {
this.lite_new = (lite_do4 * 100) / this.lite_case;
this.lite_try = lite_do4;
} else {
this.lite_new = lite_do4;
this.lite_try = (this.lite_case * lite_do4) / 100;
}
i2 = lite_do4;
} else {
if (i2 >= lite_do2) {
lite_do2 = i2;
}
if (i2 <= lite_do5) {
lite_do4 = lite_do2;
if (lite_do < lite_if) {
}
i2 = lite_do4;
}
lite_do4 = lite_do5;
if (lite_do < lite_if) {
}
i2 = lite_do4;
}
} else {
if (lite_do < lite_if) {
int lite_do7 = r40.lite_do(this.lite_do, r40.lite_if(r1, lite_do) - 44);
if (lite_do7 >= lite_do3) {
lite_do3 = lite_do7;
}
if (lite_do7 <= lite_do5) {
lite_do5 = lite_do3;
}
} else {
if (i2 >= lite_do2) {
lite_do2 = i2;
}
if (i2 <= lite_do5) {
lite_do5 = lite_do2;
}
}
this.lite_new = lite_do5;
this.lite_try = (this.lite_case * lite_do5) / 100;
i2 = lite_do5;
}
w40.lite_int(str, "widthPX: " + i2);
w40.lite_int(str, "widthDP: " + r40.lite_if(this.lite_do, (float) i2));
w40.lite_int(str, "height: " + this.lite_case);
w40.lite_int(str, "mWidth: " + this.lite_new);
w40.lite_int(str, "mHeight: " + this.lite_try);
StringBuilder sb = new StringBuilder();
sb.append("deviceWidth: ");
sb.append(r40.lite_if(this.lite_do, t40.lite_if(r1)));
w40.lite_int(str, sb.toString());
StringBuilder sb2 = new StringBuilder();
sb2.append("deviceHeight: ");
sb2.append(r40.lite_if(this.lite_do, t40.lite_do(r1)));
w40.lite_int(str, sb2.toString());
return i2;
}
public void lite_case() {
GT3GtWebView gT3GtWebView = this.lite_char;
if (gT3GtWebView != null) {
gT3GtWebView.removeJavascriptInterface("JSInterface");
ViewGroup viewGroup = (ViewGroup) this.lite_char.getParent();
if (viewGroup != null) {
viewGroup.removeView(this.lite_char);
}
this.lite_char.removeAllViews();
this.lite_char.destroy();
this.lite_char = null;
}
try {
Handler handler = this.lite_long;
if (handler != null) {
handler.removeCallbacks(this.lite_goto);
this.lite_long.removeMessages(1);
this.lite_long = null;
}
} catch (Exception unused) {
}
}
public void lite_else() {
GT3GtWebView gT3GtWebView = this.lite_char;
if (gT3GtWebView != null) {
ObjectAnimator ofFloat = ObjectAnimator.ofFloat(gT3GtWebView, "translationX", 0.0f, 2.0f, 4.0f, 2.0f, 0.0f, -2.0f, -4.0f, -2.0f, 0.0f, 2.0f, 4.0f, 2.0f, 0.0f, -2.0f, -4.0f, -2.0f, 0.0f);
ofFloat.setDuration(500L);
ofFloat.start();
}
}
public GT3GtWebView lite_if() {
String str;
String str2;
String str3;
String sb;
new HashMap();
this.lite_case = this.lite_for.lite_public();
new HashMap();
Map<String, Integer> lite_do = this.lite_for.lite_while().lite_do();
if (lite_do == null || lite_do.size() <= 0) {
str = "";
str2 = str;
} else {
str = "";
str2 = str;
for (Map.Entry<String, Integer> entry : lite_do.entrySet()) {
if (!TextUtils.isEmpty(entry.getKey())) {
StringBuilder g = r5.g(str, "&aspect_radio_");
g.append(entry.getKey());
g.append(ContainerUtils.KEY_VALUE_DELIMITER);
g.append(entry.getValue());
str = g.toString();
StringBuilder g2 = r5.g(str2, "&");
g2.append(entry.getKey());
g2.append(ContainerUtils.KEY_VALUE_DELIMITER);
g2.append(this.lite_for.lite_while().lite_try().optString(entry.getKey()));
str2 = g2.toString();
}
}
}
Map<String, String> lite_long = this.lite_for.lite_long();
if (lite_long == null || lite_long.size() <= 0) {
str3 = "";
} else {
str3 = "";
for (Map.Entry<String, String> entry2 : lite_long.entrySet()) {
if (!TextUtils.isEmpty(entry2.getKey())) {
StringBuilder g3 = r5.g(str3, "&");
g3.append(entry2.getKey());
g3.append(ContainerUtils.KEY_VALUE_DELIMITER);
g3.append(entry2.getValue());
str3 = g3.toString();
}
}
}
StringBuilder b2 = r5.b("?gt=");
b2.append(this.lite_for.lite_import());
b2.append("&challenge=");
b2.append(this.lite_for.lite_case());
b2.append("&lang=");
b2.append(this.lite_for.lite_static());
b2.append("&title=&type=");
b2.append(this.lite_for.lite_default());
b2.append("&api_server=");
b2.append(this.lite_for.lite_super().lite_do());
b2.append("&static_servers=");
b2.append(this.lite_for.lite_super().lite_new().toString().replace("[", "").replace("]", ""));
b2.append("&width=100%&timeout=");
b2.append(this.lite_for.lite_abstract());
b2.append("&debug=");
b2.append(this.lite_for.lite_continue());
b2.append(str);
b2.append(str2);
b2.append(str3);
this.lite_else = b2.toString();
List<String> lite_new = this.lite_for.lite_super().lite_new();
if (lite_new == null || lite_new.size() <= 0) {
StringBuilder b3 = r5.b("https://static.geetest.com/static/appweb/app3-index.html");
b3.append(this.lite_else);
sb = b3.toString();
} else {
sb = String.format("https://%s/static/appweb/app3-index.html", lite_new.get(0)) + this.lite_else;
}
try {
GT3GtWebView gT3GtWebView = new GT3GtWebView(this.lite_do.getApplicationContext());
this.lite_char = gT3GtWebView;
gT3GtWebView.lite_for();
if (this.lite_long != null) {
d dVar = new d();
this.lite_goto = dVar;
this.lite_long.postDelayed(dVar, this.lite_for.lite_finally());
}
this.lite_char.setObservable(this.lite_if);
this.lite_char.setLayoutParams(new ViewGroup.LayoutParams(-2, -2));
this.lite_char.setStaticUrl(sb);
this.lite_char.setDataBean(this.lite_for);
this.lite_char.setMyHandler(this.lite_long);
this.lite_char.setRunnable(this.lite_goto);
this.lite_char.loadUrl(sb);
this.lite_char.buildLayer();
this.lite_char.addJavascriptInterface(new b(), "JSInterface");
this.lite_char.setTimeout(this.lite_for.lite_finally());
lite_long();
} catch (Exception e) {
e.printStackTrace();
String str4 = lite_this;
StringBuilder b4 = r5.b("默认webview内核丢失,错误码:204_3-->");
b4.append(e.toString());
w40.lite_if(str4, b4.toString());
for (StackTraceElement stackTraceElement : e.getStackTrace()) {
w40.lite_if(lite_this, stackTraceElement.toString());
}
Handler handler = this.lite_long;
if (handler != null) {
try {
handler.removeCallbacks(this.lite_goto);
this.lite_long.removeMessages(1);
} catch (Exception unused) {
}
}
n40 n40Var = this.lite_if;
if (n40Var != null) {
StringBuilder b5 = r5.b("webview crate error -->");
b5.append(e.toString());
n40Var.lite_for("204_3", b5.toString());
}
}
return this.lite_char;
}
public void lite_int(x20 x20Var) {
this.lite_int = x20Var;
}
public void lite_long() {
lite_class();
GT3GtWebView gT3GtWebView = this.lite_char;
if (gT3GtWebView == null || gT3GtWebView.getLayoutParams() == null) {
return;
}
lite_void = this.lite_new;
lite_break = this.lite_try;
ViewGroup.LayoutParams layoutParams = this.lite_char.getLayoutParams();
layoutParams.width = lite_void;
layoutParams.height = lite_break;
this.lite_char.setLayoutParams(layoutParams);
}
public void lite_new(a40 a40Var) {
this.lite_for = a40Var;
}
public void lite_try(o40 o40Var) {
this.lite_if.lite_if(o40Var);
}
}