QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 RealNameExecutor.java 源代码,内容仅作参考
package com.tencent.mtt.browser.account.usercenter.realname;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.view.View;
import com.huawei.hms.support.hianalytics.HiAnalyticsConstant;
import com.tencent.common.wup.IWUPRequestCallBack;
import com.tencent.common.wup.WUPRequestBase;
import com.tencent.common.wup.WUPResponseBase;
import com.tencent.common.wup.WUPTaskProxy;
import com.tencent.mtt.R;
import com.tencent.mtt.account.base.IAccount;
import com.tencent.mtt.base.account.facade.IUserRealName;
import com.tencent.mtt.base.functionwindow.ActivityHandler;
import com.tencent.mtt.base.skin.MttResources;
import com.tencent.mtt.base.stat.StatManager;
import com.tencent.mtt.base.wup.WUPRequest;
import com.tencent.mtt.browser.account.usercenter.MTT.CommonUserInfo;
import com.tencent.mtt.browser.account.usercenter.MTT.RnStatReq;
import com.tencent.mtt.browser.account.usercenter.MTT.RnStatRsp;
import com.tencent.mtt.browser.account.usercenter.UserCenterUtils;
import com.tencent.mtt.browser.window.UrlParams;
import com.tencent.mtt.sdkcontext.SDKContext;
import com.tencent.mtt.setting.PublicSettingManager;
import com.tencent.mtt.view.dialog.alert.MttLoadingDialog;
import com.tencent.mtt.view.dialog.newui.SimpleDialogBuilder;
import com.tencent.mtt.view.dialog.newui.builder.api.INoImageDialogBuilder;
import com.tencent.mtt.view.dialog.newui.dialog.DialogBase;
import com.tencent.mtt.view.dialog.newui.view.ViewOnClickListener;
public class RealNameExecutor implements Handler.Callback, IWUPRequestCallBack, IUserRealName {
private IUserRealName.IsRealNameListener f35175a = null;
private final Handler f35176b = new Handler(Looper.getMainLooper(), this);
private MttLoadingDialog f35177c;
private void a() {
if (this.f35177c != null) {
return;
}
if (ActivityHandler.b().a() == null) {
this.f35177c = null;
return;
}
this.f35177c = new MttLoadingDialog(ActivityHandler.b().a());
this.f35177c.a(MttResources.l(R.string.b75));
this.f35177c.setCancelable(false);
}
public void a(int i, int i2) {
Message obtainMessage = this.f35176b.obtainMessage(i2);
obtainMessage.arg1 = i;
obtainMessage.sendToTarget();
}
public void b() {
this.f35176b.post(new Runnable() {
@Override
public void run() {
new UrlParams("qb://realname?https://res.imtt.qq.com/verifyPage/index.html").b(1).c(0).d(true).e();
}
});
}
private CommonUserInfo c() {
return UserCenterUtils.a();
}
private boolean d() {
return ((IAccount) SDKContext.getInstance().getService(IAccount.class)).getCurrentUserInfo().isValidLogin();
}
private void e() {
a();
MttLoadingDialog mttLoadingDialog = this.f35177c;
if (mttLoadingDialog == null || mttLoadingDialog.isShowing()) {
return;
}
this.f35177c.show();
}
private void f() {
MttLoadingDialog mttLoadingDialog = this.f35177c;
if (mttLoadingDialog == null || !mttLoadingDialog.isShowing()) {
return;
}
this.f35177c.cancel();
}
@Override
public void a(IUserRealName.DoRealNameListener doRealNameListener) {
RealNameListenerPool.a().a(doRealNameListener);
if (d()) {
this.f35176b.post(new Runnable() {
@Override
public void run() {
INoImageDialogBuilder e = SimpleDialogBuilder.e();
e.d(MttResources.l(R.string.b74));
e.e(MttResources.l(R.string.b73));
e.c(MttResources.l(R.string.ud));
e.a(MttResources.l(R.string.atp));
e.a_(new ViewOnClickListener() {
@Override
public void onClick(View view, DialogBase dialogBase) {
dialogBase.dismiss();
StatManager.b().c("CIC03");
RealNameExecutor.this.b();
}
});
e.c(new ViewOnClickListener() {
@Override
public void onClick(View view, DialogBase dialogBase) {
dialogBase.dismiss();
StatManager.b().c("CIC02");
RealNameExecutor.this.a(1, 2);
}
});
StatManager.b().c("CIC01");
e.e();
}
});
} else {
a(2, 2);
}
}
@Override
public void a(IUserRealName.IsRealNameListener isRealNameListener) {
a(isRealNameListener, true);
}
@Override
public void a(IUserRealName.IsRealNameListener isRealNameListener, boolean z) {
this.f35175a = isRealNameListener;
CommonUserInfo c2 = c();
if (c2 == null) {
a(2, 1);
return;
}
if (c2.iIdType == 2 || c2.iIdType == 6) {
a(0, 1);
return;
}
if (PublicSettingManager.a().getInt("key_real_name_" + c2.sUserId, -1) == 0) {
a(0, 1);
return;
}
if (z) {
this.f35176b.obtainMessage(3).sendToTarget();
}
WUPRequest wUPRequest = new WUPRequest("QBUserInfo", "queryRnStat", this);
RnStatReq rnStatReq = new RnStatReq();
rnStatReq.stCommonUserInfo = c2;
wUPRequest.putRequestParam(HiAnalyticsConstant.Direction.REQUEST, rnStatReq);
wUPRequest.setClassLoader(getClass().getClassLoader());
WUPTaskProxy.send(wUPRequest);
}
@Override
public boolean handleMessage(Message message) {
if (message == null) {
return false;
}
int i = message.arg1;
if (i != 1 && i != 0 && i != 2) {
i = 2;
}
int i2 = message.what;
if (i2 == 1) {
IUserRealName.IsRealNameListener isRealNameListener = this.f35175a;
if (isRealNameListener != null) {
isRealNameListener.a(i);
}
} else if (i2 == 2) {
RealNameListenerPool.a().a(i, "fail");
} else if (i2 == 3) {
e();
} else if (i2 == 4) {
f();
}
return false;
}
@Override
public void onWUPTaskFail(WUPRequestBase wUPRequestBase) {
this.f35176b.obtainMessage(4).sendToTarget();
a(2, 1);
}
@Override
public void onWUPTaskSuccess(WUPRequestBase wUPRequestBase, WUPResponseBase wUPResponseBase) {
this.f35176b.obtainMessage(4).sendToTarget();
if (wUPResponseBase == null) {
onWUPTaskFail(wUPRequestBase);
return;
}
Object obj = wUPResponseBase.get(HiAnalyticsConstant.Direction.RESPONSE, getClass().getClassLoader());
if (obj == null || !(obj instanceof RnStatRsp)) {
onWUPTaskFail(wUPRequestBase);
return;
}
int i = ((RnStatRsp) obj).eRet;
if (i != 0) {
if (i != 101) {
a(2, 1);
return;
} else {
a(1, 1);
return;
}
}
CommonUserInfo c2 = c();
if (c2 == null) {
a(2, 1);
return;
}
PublicSettingManager.a().setInt("key_real_name_" + c2.sUserId, 0);
a(0, 1);
}
}