OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046
以下内容为反编译后的 ai.java 源代码,内容仅作参考
package com.excelliance.kxqp.util;
import android.app.Activity;
import android.app.Dialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.provider.Settings;
import android.text.Html;
import android.text.SpannableString;
import android.text.TextPaint;
import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.StringRes;
import com.excean.bytedancebi.bean.BiEventClick;
import com.excean.bytedancebi.bean.BiEventDialogShow;
import com.excean.ggspace.main.R;
import com.excelliance.kxqp.ShortCutActivity;
import com.excelliance.kxqp.api.ApiManager;
import com.excelliance.kxqp.bean.AdultInfo;
import com.excelliance.kxqp.gs.appstore.model.ResponseData;
import com.excelliance.kxqp.gs.thpool.tp;
import com.excelliance.kxqp.gs.util.av;
import com.excelliance.kxqp.gs.util.bx;
import com.excelliance.kxqp.gs.util.by;
import com.excelliance.kxqp.gs.util.cd;
import com.excelliance.kxqp.gs.util.ce;
import com.excelliance.kxqp.gs.util.cf;
import com.excelliance.kxqp.statistics.index.annotation.PrikeyElement;
import com.tencent.open.SocialConstants;
import java.util.Calendar;
import java.util.HashMap;
public class ai {
private static volatile ai f14924a;
private static a f14925b;
private TextView c;
private TextView d;
private boolean e;
public interface b extends Runnable {
void a(String str, String str2);
}
private ai() {
}
public static ai a() {
if (f14924a == null) {
synchronized (ai.class) {
if (f14924a == null) {
f14924a = new ai();
}
}
}
return f14924a;
}
public void a(final Activity activity, boolean z, String str, String str2, final b bVar, final b bVar2) {
if (activity == null || activity.isFinishing()) {
return;
}
f14925b = new a(activity, R.style.theme_dialog_no_title2);
View inflate = LayoutInflater.from(activity).inflate(R.layout.real_name_authentication_dialog_layout, (ViewGroup) null);
SpannableString spannableString = new SpannableString("已阅读并同意《实名认证服务协议》");
spannableString.setSpan(new ClickableSpan() {
@Override
public void onClick(@NonNull View view) {
Intent intent = new Intent();
intent.setComponent(new ComponentName(activity.getPackageName(), "com.excelliance.kxqp.gs.ui.question.CommonWebViewActivity"));
intent.putExtra(SocialConstants.PARAM_URL, "https://h5.ourplay.com.cn/html/identify-agreement/");
activity.startActivity(intent);
}
@Override
public void updateDrawState(@NonNull TextPaint textPaint) {
super.updateDrawState(textPaint);
textPaint.setUnderlineText(false);
textPaint.setColor(activity.getResources().getColor(R.color.new_main_color));
}
}, 6, "已阅读并同意《实名认证服务协议》".length(), 17);
final CheckBox checkBox = (CheckBox) inflate.findViewById(R.id.check_box);
TextView textView = (TextView) inflate.findViewById(R.id.tv_real_name_info);
LinearLayout linearLayout = (LinearLayout) inflate.findViewById(R.id.ll_portocol);
textView.setMovementMethod(LinkMovementMethod.getInstance());
textView.setText(spannableString);
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean z2) {
BiEventClick biEventClick = new BiEventClick();
biEventClick.button_name = "勾选《实名认证服务协议》";
if (z2) {
biEventClick.button_function = "同意《实名认证服务协议》";
} else {
biEventClick.button_function = "取消同意《实名认证服务协议》";
}
com.excean.bytedancebi.c.a.a().a(biEventClick);
}
});
this.d = (TextView) inflate.findViewById(R.id.content_tv);
TextView textView2 = (TextView) inflate.findViewById(R.id.title_tv);
TextView textView3 = (TextView) inflate.findViewById(R.id.cancel_real_name);
final EditText editText = (EditText) inflate.findViewById(R.id.real_name_et);
final EditText editText2 = (EditText) inflate.findViewById(R.id.id_number_et);
if (!e(activity)) {
editText2.setRawInputType(2);
}
TextView textView4 = (TextView) inflate.findViewById(R.id.commit_tv);
if (z) {
editText.setEnabled(false);
editText2.setEnabled(false);
this.d.setVisibility(8);
linearLayout.setVisibility(8);
textView2.setText(R.string.finish_identity_authentication);
a(str, editText);
b(str2, editText2);
textView4.setText(R.string.ensure);
textView4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (ai.f14925b == null || !ai.f14925b.isShowing()) {
return;
}
ai.f14925b.dismiss();
}
});
if (!bx.a().b(activity)) {
textView3.setVisibility(0);
linearLayout.setVisibility(8);
textView3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
BiEventClick biEventClick = new BiEventClick();
biEventClick.current_page = "我的页面";
biEventClick.dialog_name = "已实名认证弹窗";
biEventClick.button_name = "注销实名认证按钮";
com.excelliance.kxqp.gs.g.c.a().a(biEventClick);
ai.this.c();
if (bVar2 != null) {
bVar2.run();
}
}
});
}
} else {
this.d.setVisibility(0);
a(activity, R.string.real_name_authentication_rules5_with_warn);
textView2.setText(R.string.real_name_authentication_title);
editText.setEnabled(true);
editText2.setEnabled(true);
textView4.setText(R.string.comment_edit_submit);
this.c = (TextView) inflate.findViewById(R.id.error_msg_tv);
textView4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (checkBox.isChecked()) {
if (ai.this.d(activity)) {
Toast.makeText(activity, R.string.over_test_times, 0).show();
return;
}
String obj = editText.getText().toString();
String obj2 = editText2.getText().toString();
if (!TextUtils.isEmpty(obj) && !TextUtils.isEmpty(obj2)) {
ai.this.c.setVisibility(8);
if (bVar != null) {
bVar.a(obj, obj2);
}
BiEventClick biEventClick = new BiEventClick();
biEventClick.dialog_name = "实名认证弹窗(可加速)";
biEventClick.current_page = "我的页面";
biEventClick.page_type = "弹框页";
biEventClick.button_name = "提交按钮";
com.excelliance.kxqp.gs.g.c.a().a(biEventClick);
return;
}
ToastUtil.showToast(activity, activity.getString(R.string.info_error));
return;
}
Toast.makeText(activity, R.string.please_check_protocol, 0).show();
BiEventDialogShow biEventDialogShow = new BiEventDialogShow();
biEventDialogShow.current_page = "我的页面";
biEventDialogShow.dialog_type = "toast";
biEventDialogShow.toast_name = "请勾选同意《实名认证服务协议》";
com.excean.bytedancebi.c.a.a().a(biEventDialogShow);
}
});
f14925b.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialogInterface) {
if ("dismiss_flag".equals(((a) dialogInterface).a())) {
ai.this.a(activity);
}
}
});
if (ce.a(activity) > by.a(activity, "sp_config").a("sp_key_last_time_identification_authentication", (Long) 0L)) {
by.a(activity, "sp_config").a("sp_key_real_name_commit_times", 0);
}
}
f14925b.setContentView(inflate);
Window window = f14925b.getWindow();
if (window != null) {
WindowManager.LayoutParams attributes = window.getAttributes();
attributes.width = activity.getResources().getDisplayMetrics().widthPixels - com.excelliance.kxqp.gs.util.ad.a(activity, 60.0f);
attributes.height = -2;
}
if (f14925b != null && !f14925b.isShowing()) {
f14925b.show();
}
BiEventDialogShow biEventDialogShow = new BiEventDialogShow();
biEventDialogShow.current_page = "我的页面";
biEventDialogShow.dialog_type = "弹窗";
biEventDialogShow.dialog_name = "实名认证老弹框";
com.excelliance.kxqp.gs.g.c.a().a(biEventDialogShow);
}
public boolean b() {
return f14925b != null && f14925b.isShowing();
}
public boolean d(Context context) {
return by.a(context, "sp_config").c("sp_key_real_name_commit_times", 0) >= 3;
}
private void a(String str, EditText editText) {
if (TextUtils.isEmpty(str)) {
return;
}
editText.setEnabled(false);
StringBuilder sb = new StringBuilder();
sb.append(str.substring(0, 1));
int length = str.substring(1).length();
for (int i = 0; i < length; i++) {
sb.append(PrikeyElement.WAIT);
}
editText.setText(sb);
}
private void b(String str, EditText editText) {
if (TextUtils.isEmpty(str)) {
return;
}
editText.setEnabled(false);
String substring = str.substring(0, 4);
String substring2 = str.substring(str.length() - 4);
StringBuilder sb = new StringBuilder();
sb.append(substring);
for (int i = 0; i < str.length() - 8; i++) {
sb.append(PrikeyElement.WAIT);
}
sb.append(substring2);
editText.setText(sb);
}
public void c() {
if (f14925b == null || !f14925b.isShowing()) {
return;
}
f14925b.a("dismiss_flag");
f14925b.dismiss();
}
public void a(Activity activity, @StringRes int i, String str) {
if (activity == null || activity.isFinishing()) {
return;
}
if (this.c != null && cd.a(str)) {
this.c.setVisibility(0);
}
if (this.d != null) {
a(activity, i);
}
}
public static class a extends Dialog {
private String f14960a;
public a(@NonNull Context context, int i) {
super(context, i);
}
public void a(String str) {
this.f14960a = str;
}
public String a() {
return this.f14960a;
}
@Override
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
a unused = ai.f14925b = null;
}
}
public void a(Activity activity) {
if (activity == null || activity.isFinishing() || f14925b == null || f14925b.isShowing()) {
return;
}
Window window = f14925b.getWindow();
if (window != null) {
window.getAttributes().width = activity.getResources().getDisplayMetrics().widthPixels - com.excelliance.kxqp.gs.util.ad.a(activity, 60.0f);
}
f14925b.a(null);
View inflate = LayoutInflater.from(activity).inflate(R.layout.real_name_authentication_succeed_layout, (ViewGroup) null);
inflate.findViewById(R.id.ensure).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ai.f14925b.dismiss();
}
});
f14925b.setContentView(inflate);
f14925b.show();
}
private void a(Context context, @StringRes int i) {
int c = 3 - by.a(context, "sp_config").c("sp_key_real_name_commit_times", 0);
if (c < 0) {
c = 0;
}
String string = context.getString(i);
if (string.contains("今日剩余%s次")) {
string = String.format(string, Integer.valueOf(c));
}
this.d.setText(Html.fromHtml(string));
}
public void a(final Activity activity, final b bVar, final boolean z, final String str) {
if (activity == null || activity.isFinishing()) {
return;
}
f14925b = new a(activity, R.style.theme_dialog_no_title2);
this.e = z;
View inflate = LayoutInflater.from(activity).inflate(R.layout.real_name_authentication_dialog_layout, (ViewGroup) null);
this.d = (TextView) inflate.findViewById(R.id.content_tv);
if (z) {
this.d.setText(Html.fromHtml(activity.getString(R.string.real_name_authentication_rules5_with_warn)));
} else {
this.d.setText(Html.fromHtml(activity.getString(R.string.real_name_authentication_rules2)));
}
SpannableString spannableString = new SpannableString("已阅读并同意《实名认证服务协议》");
spannableString.setSpan(new ClickableSpan() {
@Override
public void onClick(@NonNull View view) {
Intent intent = new Intent();
intent.setComponent(new ComponentName(activity.getPackageName(), "com.excelliance.kxqp.gs.ui.question.CommonWebViewActivity"));
intent.putExtra(SocialConstants.PARAM_URL, "https://h5.ourplay.com.cn/html/identify-agreement/");
activity.startActivity(intent);
}
@Override
public void updateDrawState(@NonNull TextPaint textPaint) {
super.updateDrawState(textPaint);
textPaint.setUnderlineText(false);
textPaint.setColor(activity.getResources().getColor(R.color.new_main_color));
}
}, 6, "已阅读并同意《实名认证服务协议》".length(), 17);
final CheckBox checkBox = (CheckBox) inflate.findViewById(R.id.check_box);
TextView textView = (TextView) inflate.findViewById(R.id.tv_real_name_info);
textView.setMovementMethod(LinkMovementMethod.getInstance());
textView.setText(spannableString);
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean z2) {
BiEventClick biEventClick = new BiEventClick();
biEventClick.button_name = "勾选《实名认证服务协议》";
if (z2) {
biEventClick.button_function = "同意《实名认证服务协议》";
} else {
biEventClick.button_function = "取消同意《实名认证服务协议》";
}
com.excean.bytedancebi.c.a.a().a(biEventClick);
}
});
TextView textView2 = (TextView) inflate.findViewById(R.id.title_tv);
final EditText editText = (EditText) inflate.findViewById(R.id.real_name_et);
final EditText editText2 = (EditText) inflate.findViewById(R.id.id_number_et);
if (!e(activity)) {
editText2.setRawInputType(2);
}
TextView textView3 = (TextView) inflate.findViewById(R.id.commit_tv);
this.d.setVisibility(0);
textView2.setText(R.string.real_name_authentication_title);
editText.setEnabled(true);
editText2.setEnabled(true);
textView3.setText(R.string.comment_edit_submit);
this.c = (TextView) inflate.findViewById(R.id.error_msg_tv);
textView3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (checkBox.isChecked()) {
if (ai.this.d(activity)) {
Toast.makeText(activity, R.string.over_test_times, 0).show();
return;
}
String obj = editText.getText().toString();
String obj2 = editText2.getText().toString();
if (TextUtils.isEmpty(obj) || TextUtils.isEmpty(obj2)) {
return;
}
ai.this.c.setVisibility(8);
if (bVar != null) {
bVar.a(obj, obj2);
}
BiEventClick biEventClick = new BiEventClick();
if (z) {
biEventClick.dialog_name = "实名认证弹窗(可加速)";
} else {
biEventClick.dialog_name = "实名认证弹窗(玩游戏)";
}
biEventClick.current_page = str;
biEventClick.page_type = "弹框页";
biEventClick.button_name = "提交按钮";
com.excelliance.kxqp.gs.g.c.a().a(biEventClick);
return;
}
Toast.makeText(activity, R.string.please_check_protocol, 0).show();
BiEventDialogShow biEventDialogShow = new BiEventDialogShow();
biEventDialogShow.current_page = str;
biEventDialogShow.dialog_type = "toast";
biEventDialogShow.toast_name = "请勾选同意《实名认证服务协议》";
com.excean.bytedancebi.c.a.a().a(biEventDialogShow);
}
});
f14925b.setContentView(inflate);
if (activity instanceof ShortCutActivity) {
f14925b.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialogInterface) {
if ("dismiss_flag".equals(((a) dialogInterface).a())) {
return;
}
activity.finish();
}
});
}
Window window = f14925b.getWindow();
if (window != null) {
WindowManager.LayoutParams attributes = window.getAttributes();
int i = activity.getResources().getDisplayMetrics().widthPixels;
int i2 = activity.getResources().getDisplayMetrics().heightPixels;
if (activity.getResources().getConfiguration().orientation == 1) {
attributes.width = i - com.excelliance.kxqp.gs.util.ad.a(activity, 60.0f);
} else {
attributes.width = i2 - com.excelliance.kxqp.gs.util.ad.a(activity, 60.0f);
}
attributes.height = -2;
window.setAttributes(attributes);
}
if (ce.a(activity) > by.a(activity, "sp_config").a("sp_key_last_time_identification_authentication", (Long) 0L)) {
by.a(activity, "sp_config").a("sp_key_real_name_commit_times", 0);
}
if (f14925b != null && !f14925b.isShowing()) {
f14925b.show();
}
BiEventDialogShow biEventDialogShow = new BiEventDialogShow();
biEventDialogShow.current_page = str;
biEventDialogShow.dialog_type = "弹窗";
if (z) {
biEventDialogShow.dialog_name = "实名认证弹窗(可加速)";
} else {
biEventDialogShow.dialog_name = "实名认证弹窗(玩游戏)";
}
com.excelliance.kxqp.gs.g.c.a().a(biEventDialogShow);
}
public void a(final Activity activity, final b bVar, final String str) {
if (activity == null || activity.isFinishing()) {
return;
}
f14925b = new a(activity, R.style.theme_dialog_no_title2);
View inflate = LayoutInflater.from(activity).inflate(R.layout.real_name_authentication_dialog_layout, (ViewGroup) null);
this.d = (TextView) inflate.findViewById(R.id.content_tv);
this.d.setText(Html.fromHtml(activity.getString(R.string.real_name_authentication_rules5_with_warn)));
SpannableString spannableString = new SpannableString("已阅读并同意《实名认证服务协议》");
spannableString.setSpan(new ClickableSpan() {
@Override
public void onClick(@NonNull View view) {
Intent intent = new Intent();
intent.setComponent(new ComponentName(activity.getPackageName(), "com.excelliance.kxqp.gs.ui.question.CommonWebViewActivity"));
intent.putExtra(SocialConstants.PARAM_URL, "https://h5.ourplay.com.cn/html/identify-agreement/");
activity.startActivity(intent);
}
@Override
public void updateDrawState(@NonNull TextPaint textPaint) {
super.updateDrawState(textPaint);
textPaint.setUnderlineText(false);
textPaint.setColor(activity.getResources().getColor(R.color.new_main_color));
}
}, 6, "已阅读并同意《实名认证服务协议》".length(), 17);
final CheckBox checkBox = (CheckBox) inflate.findViewById(R.id.check_box);
TextView textView = (TextView) inflate.findViewById(R.id.tv_real_name_info);
textView.setMovementMethod(LinkMovementMethod.getInstance());
textView.setText(spannableString);
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
BiEventClick biEventClick = new BiEventClick();
biEventClick.button_name = "勾选《实名认证服务协议》";
if (z) {
biEventClick.button_function = "同意《实名认证服务协议》";
} else {
biEventClick.button_function = "取消同意《实名认证服务协议》";
}
com.excean.bytedancebi.c.a.a().a(biEventClick);
}
});
TextView textView2 = (TextView) inflate.findViewById(R.id.title_tv);
final EditText editText = (EditText) inflate.findViewById(R.id.real_name_et);
final EditText editText2 = (EditText) inflate.findViewById(R.id.id_number_et);
if (!e(activity)) {
editText2.setRawInputType(2);
}
TextView textView3 = (TextView) inflate.findViewById(R.id.commit_tv);
this.d.setVisibility(0);
textView2.setText(R.string.real_name_authentication_title);
editText.setEnabled(true);
editText2.setEnabled(true);
textView3.setText(R.string.comment_edit_submit);
this.c = (TextView) inflate.findViewById(R.id.error_msg_tv);
textView3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (checkBox.isChecked()) {
if (ai.this.d(activity)) {
Toast.makeText(activity, R.string.over_test_times, 0).show();
return;
}
String obj = editText.getText().toString();
String obj2 = editText2.getText().toString();
if (TextUtils.isEmpty(obj) || TextUtils.isEmpty(obj2)) {
return;
}
ai.this.c.setVisibility(8);
if (bVar != null) {
bVar.a(obj, obj2);
}
BiEventClick biEventClick = new BiEventClick();
biEventClick.dialog_name = "实名认证弹窗(可加速)";
biEventClick.current_page = str;
biEventClick.page_type = "弹框页";
biEventClick.button_name = "提交按钮";
com.excelliance.kxqp.gs.g.c.a().a(biEventClick);
return;
}
Toast.makeText(activity, R.string.please_check_protocol, 0).show();
BiEventDialogShow biEventDialogShow = new BiEventDialogShow();
biEventDialogShow.current_page = str;
biEventDialogShow.dialog_type = "toast";
biEventDialogShow.toast_name = "请勾选同意《实名认证服务协议》";
com.excean.bytedancebi.c.a.a().a(biEventDialogShow);
}
});
f14925b.setContentView(inflate);
if (activity instanceof ShortCutActivity) {
f14925b.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialogInterface) {
if ("dismiss_flag".equals(((a) dialogInterface).a())) {
return;
}
activity.finish();
}
});
}
Window window = f14925b.getWindow();
if (window != null) {
WindowManager.LayoutParams attributes = window.getAttributes();
int i = activity.getResources().getDisplayMetrics().widthPixels;
int i2 = activity.getResources().getDisplayMetrics().heightPixels;
if (activity.getResources().getConfiguration().orientation == 1) {
attributes.width = i - com.excelliance.kxqp.gs.util.ad.a(activity, 60.0f);
} else {
attributes.width = i2 - com.excelliance.kxqp.gs.util.ad.a(activity, 60.0f);
}
attributes.height = -2;
window.setAttributes(attributes);
}
if (ce.a(activity) > by.a(activity, "sp_config").a("sp_key_last_time_identification_authentication", (Long) 0L)) {
by.a(activity, "sp_config").a("sp_key_real_name_commit_times", 0);
}
if (f14925b != null && !f14925b.isShowing()) {
f14925b.show();
}
BiEventDialogShow biEventDialogShow = new BiEventDialogShow();
biEventDialogShow.current_page = str;
biEventDialogShow.dialog_type = "弹窗";
biEventDialogShow.dialog_name = "实名认证弹窗(可加速)";
com.excelliance.kxqp.gs.g.c.a().a(biEventDialogShow);
}
public void a(final Activity activity, final Runnable runnable, final b bVar, final String str) {
if (activity == null || activity.isFinishing()) {
return;
}
f14925b = new a(activity, R.style.theme_dialog_no_title2);
View inflate = LayoutInflater.from(activity).inflate(R.layout.real_name_authentication_dialog_layout, (ViewGroup) null);
this.d = (TextView) inflate.findViewById(R.id.content_tv);
inflate.findViewById(R.id.ll_portocol).setVisibility(8);
this.d.setText(Html.fromHtml(activity.getString(R.string.real_name_authentication_rules5_with_warn)));
TextView textView = (TextView) inflate.findViewById(R.id.title_tv);
EditText editText = (EditText) inflate.findViewById(R.id.real_name_et);
EditText editText2 = (EditText) inflate.findViewById(R.id.id_number_et);
editText.setVisibility(8);
editText2.setVisibility(8);
((TextView) inflate.findViewById(R.id.commit_tv)).setVisibility(8);
this.d.setVisibility(0);
textView.setText(R.string.anti_addiction_warn);
inflate.findViewById(R.id.real_name_verify_layout).setVisibility(0);
inflate.findViewById(R.id.launch_game).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ai.this.c();
runnable.run();
BiEventClick biEventClick = new BiEventClick();
biEventClick.dialog_name = "防沉迷提示弹窗";
biEventClick.current_page = str;
biEventClick.page_type = "弹框页";
biEventClick.button_name = "启动游戏(不加速)按钮";
com.excelliance.kxqp.gs.g.c.a().a(biEventClick);
}
});
inflate.findViewById(R.id.show_real_name_verify_dialog).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ai.this.c();
ai.this.a(activity, bVar, true, str);
BiEventClick biEventClick = new BiEventClick();
biEventClick.dialog_name = "防沉迷提示弹窗";
biEventClick.current_page = str;
biEventClick.page_type = "弹框页";
biEventClick.button_name = "实名认证按钮";
com.excelliance.kxqp.gs.g.c.a().a(biEventClick);
}
});
f14925b.setContentView(inflate);
if (activity instanceof ShortCutActivity) {
f14925b.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialogInterface) {
if ("dismiss_flag".equals(((a) dialogInterface).a())) {
return;
}
activity.finish();
}
});
}
Window window = f14925b.getWindow();
if (window != null) {
WindowManager.LayoutParams attributes = window.getAttributes();
attributes.width = activity.getResources().getDisplayMetrics().widthPixels - com.excelliance.kxqp.gs.util.ad.a(activity, 60.0f);
attributes.height = -2;
}
if (ce.a(activity) > by.a(activity, "sp_config").a("sp_key_last_time_identification_authentication", (Long) 0L)) {
by.a(activity, "sp_config").a("sp_key_real_name_commit_times", 0);
}
if (f14925b != null && !f14925b.isShowing()) {
f14925b.show();
}
BiEventDialogShow biEventDialogShow = new BiEventDialogShow();
biEventDialogShow.current_page = str;
biEventDialogShow.dialog_type = "弹窗";
biEventDialogShow.dialog_name = "防沉迷提示弹窗";
com.excelliance.kxqp.gs.g.c.a().a(biEventDialogShow);
}
public static void a(Context context) {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(ce.a(context));
calendar.set(11, 0);
calendar.set(12, 0);
calendar.set(13, 0);
calendar.add(5, 1);
by.a(context, "sp_config").a("sp_key_last_time_identification_authentication", calendar.getTimeInMillis());
}
public void a(final Activity activity, final String str) {
int c = by.a(activity, "sp_config").c("sp_key_real_name_commit_times", 0) + 1;
if (c == 1) {
a((Context) activity);
}
tp.i(new Runnable() {
@Override
public void run() {
ai.a().a(activity, ai.this.e ? R.string.real_name_authentication_rules5_with_warn : R.string.real_name_authentication_rules2_with_warn, str);
}
});
by.a(activity, "sp_config").a("sp_key_real_name_commit_times", c);
}
public void a(Context context, String str) {
String format;
int c = 3 - by.a(context, "sp_config").c("sp_key_real_name_commit_times", 0);
if (c < 0) {
c = 0;
}
BiEventDialogShow biEventDialogShow = new BiEventDialogShow();
biEventDialogShow.dialog_type = "toast";
if (c == 0) {
format = context.getString(R.string.real_name_verify_failed2);
} else {
format = String.format(context.getString(R.string.real_name_verify_failed), Integer.valueOf(c));
}
cf.a(context, format, 0);
biEventDialogShow.toast_name = format;
biEventDialogShow.current_page = str;
com.excelliance.kxqp.gs.g.c.a().a(biEventDialogShow);
}
public void a(Context context, String str, String str2) {
BiEventDialogShow biEventDialogShow = new BiEventDialogShow();
biEventDialogShow.dialog_type = "toast";
cf.a(context, str2, 0);
biEventDialogShow.toast_name = str2;
biEventDialogShow.current_page = str;
com.excelliance.kxqp.gs.g.c.a().a(biEventDialogShow);
}
private boolean e(Context context) {
String[] split;
String string = Settings.Secure.getString(context.getContentResolver(), "default_input_method");
Log.d("RealNameAuthenticationD", "defaultInput = " + string);
return !TextUtils.isEmpty(string) && (split = string.split("/")) != null && split.length > 0 && (TextUtils.equals(split[0], "com.samsung.android.honeyboard") || TextUtils.equals(split[0], "com.google.android.inputmethod.latin") || TextUtils.equals(split[0], "com.baidu.input_bbk.service"));
}
public static void b(Context context) {
Intent intent = new Intent();
intent.setAction(context.getPackageName() + "action.refresh.real.name.verify");
context.sendBroadcast(intent);
}
public static void c(final Context context) {
tp.f(new Runnable() {
@Override
public void run() {
HashMap hashMap = new HashMap();
hashMap.put("rid", bx.a().a(context));
hashMap.put("aid", av.a().a(context));
Log.d("RealNameAuthenticationD", "subscribe: requestBody:" + hashMap);
com.excelliance.kxqp.api.c cVar = new com.excelliance.kxqp.api.c(context);
cVar.a(ApiManager.getInstance().b(context, 15000L, 15000L, "https://api.ourplay.com.cn/").b(hashMap));
ResponseData b2 = cVar.b();
boolean b3 = bx.a().b(context);
Log.d("RealNameAuthenticationD", "RealNameAuthenticationDialogUtil/responseData: " + b2);
if (b2 == null || b2.code != 0) {
return;
}
SharedPreferences sharedPreferences = context.getSharedPreferences("USERINFO", 0);
bx a2 = bx.a();
AdultInfo adultInfo = (AdultInfo) b2.data;
if (adultInfo != null) {
if (adultInfo.isVerified) {
if (b3) {
a2.a(sharedPreferences, "USER_REAL_NAME_VERIFY", 1);
a2.a(sharedPreferences, "USER_IS_ADULT", adultInfo.isAdult);
a2.b(sharedPreferences, "USER_REAL_NAME", adultInfo.realUsername);
a2.b(sharedPreferences, "USER_ID_NUMBER", adultInfo.idNumber);
} else {
a2.a(sharedPreferences, "DEVICE_ID_VERIFY", 1);
a2.a(sharedPreferences, "DEVICE_IS_ADULT", adultInfo.isAdult);
a2.b(sharedPreferences, "DEVICE_REAL_NAME", adultInfo.realUsername);
a2.b(sharedPreferences, "DEVICE_ID_NUMBER", adultInfo.idNumber);
}
} else if (b3) {
a2.a(sharedPreferences, "USER_REAL_NAME_VERIFY", 0);
a2.a(sharedPreferences, "USER_IS_ADULT", 0);
a2.b(sharedPreferences, "USER_REAL_NAME", "");
a2.b(sharedPreferences, "USER_ID_NUMBER", "");
} else {
a2.a(sharedPreferences, "DEVICE_ID_VERIFY", 0);
a2.a(sharedPreferences, "DEVICE_IS_ADULT", 0);
a2.b(sharedPreferences, "DEVICE_REAL_NAME", "");
a2.b(sharedPreferences, "DEVICE_ID_NUMBER", "");
}
ai.b(context);
}
}
});
}
}