QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 AcocuntLogoutConfirmView.java 源代码,内容仅作参考
package com.tencent.mtt.external.setting.logout;
import MTT.IDCenterIdStruct;
import MTT.IDCenterTokenStruct;
import android.content.Context;
import android.graphics.Typeface;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.text.TextPaint;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.TextView;
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.MTT.UnRegisterReq;
import com.tencent.mtt.MTT.UnRegisterRsp;
import com.tencent.mtt.R;
import com.tencent.mtt.account.base.IAccount;
import com.tencent.mtt.base.account.AccountConst;
import com.tencent.mtt.base.account.AccountInfo;
import com.tencent.mtt.base.functionwindow.MttFunctionwindowProxy;
import com.tencent.mtt.base.skin.MttResources;
import com.tencent.mtt.base.stat.StatManager;
import com.tencent.mtt.base.wup.GUIDManager;
import com.tencent.mtt.base.wup.WUPRequest;
import com.tencent.mtt.browser.window.UrlParams;
import com.tencent.mtt.businesscenter.facade.IFrameworkDelegate;
import com.tencent.mtt.external.setting.facade.ForwardListener;
import com.tencent.mtt.external.setting.facade.ViewState;
import com.tencent.mtt.hippy.qb.views.richtexteditor.spans.BoldSpan;
import com.tencent.mtt.newskin.SimpleSkinBuilder;
import com.tencent.mtt.operation.event.EventLog;
import com.tencent.mtt.qbcontext.core.QBContext;
import com.tencent.mtt.sdkcontext.SDKContext;
import com.tencent.mtt.view.dialog.alert.MttLoadingDialog;
import com.tencent.mtt.view.edittext.base.SpannableStringBuilder;
import com.tencent.mtt.view.setting.ElasticScrollView;
import com.tencent.mtt.view.toast.MttToaster;
import com.tencent.qqlive.module.videoreport.collect.EventCollector;
import java.util.HashMap;
import qb.a.e;
import qb.a.f;
public class AcocuntLogoutConfirmView extends FrameLayout implements Handler.Callback, IWUPRequestCallBack, ViewState {
private ForwardListener f59731a;
private MttFunctionwindowProxy f59732b;
private LogOutListener f59733c;
private Handler f59734d;
private MttLoadingDialog e;
public interface LogOutListener {
void a(boolean z);
}
public AcocuntLogoutConfirmView(Context context, MttFunctionwindowProxy mttFunctionwindowProxy) {
super(context);
this.f59732b = mttFunctionwindowProxy;
this.f59734d = new Handler(Looper.getMainLooper(), this);
SimpleSkinBuilder.a(this).a(e.C).c().f();
a(context);
}
private void a(Context context) {
ElasticScrollView elasticScrollView = new ElasticScrollView(context);
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(-1, -1);
layoutParams.bottomMargin = MttResources.s(144);
addView(elasticScrollView, layoutParams);
LinearLayout linearLayout = new LinearLayout(context);
linearLayout.setOrientation(1);
elasticScrollView.addView(linearLayout, new FrameLayout.LayoutParams(-1, -2));
int s = MttResources.s(16);
TextView textView = new TextView(context);
SimpleSkinBuilder.a(textView).g(e.f85871a).f();
textView.setTextSize(1, MttResources.r(MttResources.h(f.t)));
textView.setTypeface(Typeface.DEFAULT_BOLD);
textView.setText(MttResources.l(R.string.c3));
LinearLayout.LayoutParams layoutParams2 = new LinearLayout.LayoutParams(-1, -2);
layoutParams2.topMargin = MttResources.s(22);
layoutParams2.rightMargin = s;
layoutParams2.leftMargin = s;
linearLayout.addView(textView, layoutParams2);
TextView textView2 = new TextView(context);
textView2.setMovementMethod(LinkMovementMethod.getInstance());
SimpleSkinBuilder.a(textView2).g(e.f85871a).f();
textView2.setTextSize(1, MttResources.r(MttResources.h(f.r)));
SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder();
String l = MttResources.l(R.string.c4);
String l2 = MttResources.l(R.string.ca);
spannableStringBuilder.append((CharSequence) l).append((CharSequence) l2).append((CharSequence) MttResources.l(R.string.c5));
spannableStringBuilder.setSpan(new ClickableSpan() {
@Override
public void onClick(View view) {
((IFrameworkDelegate) QBContext.getInstance().getService(IFrameworkDelegate.class)).doLoad(new UrlParams("https://qbact.html5.qq.com/newtickets?addressbar=hide"));
}
@Override
public void updateDrawState(TextPaint textPaint) {
super.updateDrawState(textPaint);
textPaint.setUnderlineText(false);
textPaint.setColor(MttResources.c(e.f));
}
}, l.length(), l.length() + l2.length(), 33);
spannableStringBuilder.setSpan(new BoldSpan(), l.length() + l2.length(), spannableStringBuilder.length(), 18);
textView2.setText(spannableStringBuilder);
LinearLayout.LayoutParams layoutParams3 = new LinearLayout.LayoutParams(-1, -2);
layoutParams3.topMargin = MttResources.s(24);
layoutParams3.rightMargin = s;
layoutParams3.leftMargin = s;
linearLayout.addView(textView2, layoutParams3);
TextView textView3 = new TextView(context);
textView3.setMovementMethod(LinkMovementMethod.getInstance());
SimpleSkinBuilder.a(textView3).g(e.f85871a).f();
textView3.setTextSize(1, MttResources.r(MttResources.h(f.r)));
SpannableStringBuilder spannableStringBuilder2 = new SpannableStringBuilder();
String l3 = MttResources.l(R.string.c7);
spannableStringBuilder2.append((CharSequence) l3).append((CharSequence) MttResources.l(R.string.c8));
spannableStringBuilder2.setSpan(new BoldSpan(), l3.length(), spannableStringBuilder2.length(), 18);
textView3.setText(spannableStringBuilder2);
LinearLayout.LayoutParams layoutParams4 = new LinearLayout.LayoutParams(-1, -2);
layoutParams4.topMargin = MttResources.s(24);
layoutParams4.rightMargin = s;
layoutParams4.leftMargin = s;
linearLayout.addView(textView3, layoutParams4);
TextView textView4 = new TextView(context);
SimpleSkinBuilder.a(textView4).g(e.f85871a).f();
textView4.setTextSize(1, MttResources.r(MttResources.h(f.r)));
textView4.setText(MttResources.l(R.string.c9));
LinearLayout.LayoutParams layoutParams5 = new LinearLayout.LayoutParams(-1, -2);
layoutParams5.topMargin = MttResources.s(24);
layoutParams5.rightMargin = s;
layoutParams5.leftMargin = s;
linearLayout.addView(textView4, layoutParams5);
TextView textView5 = new TextView(context);
textView5.setTypeface(Typeface.DEFAULT_BOLD);
textView5.setMovementMethod(LinkMovementMethod.getInstance());
textView5.setText(MttResources.l(R.string.cl));
SimpleSkinBuilder.a(textView5).g(e.f85871a).f();
textView5.setTextSize(1, MttResources.r(MttResources.h(f.r)));
textView5.setGravity(17);
FrameLayout.LayoutParams layoutParams6 = new FrameLayout.LayoutParams(-1, MttResources.s(48));
layoutParams6.rightMargin = s;
layoutParams6.leftMargin = s;
layoutParams6.bottomMargin = MttResources.s(92);
layoutParams6.gravity = 80;
RoundCornerDrawable roundCornerDrawable = new RoundCornerDrawable(MttResources.c(e.E));
roundCornerDrawable.a(MttResources.s(4));
textView5.setBackgroundDrawable(roundCornerDrawable);
addView(textView5, layoutParams6);
textView5.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
EventCollector.getInstance().onViewClickedBefore(view);
if (AcocuntLogoutConfirmView.this.f59732b != null) {
AcocuntLogoutConfirmView.this.f59732b.b(false, 0);
}
if (AcocuntLogoutConfirmView.this.f59733c != null) {
AcocuntLogoutConfirmView.this.f59733c.a(false);
}
EventCollector.getInstance().onViewClicked(view);
}
});
TextView textView6 = new TextView(context);
textView6.setTypeface(Typeface.DEFAULT_BOLD);
textView6.setMovementMethod(LinkMovementMethod.getInstance());
textView6.setText(MttResources.l(R.string.c_));
SimpleSkinBuilder.a(textView6).g(e.e).f();
textView6.setTextSize(1, MttResources.r(MttResources.h(f.r)));
textView6.setGravity(17);
FrameLayout.LayoutParams layoutParams7 = new FrameLayout.LayoutParams(-1, MttResources.s(48));
layoutParams7.rightMargin = s;
layoutParams7.leftMargin = s;
layoutParams7.bottomMargin = MttResources.s(24);
layoutParams7.gravity = 80;
RoundCornerDrawable roundCornerDrawable2 = new RoundCornerDrawable(MttResources.c(e.g));
roundCornerDrawable2.a(MttResources.s(4));
textView6.setBackgroundDrawable(roundCornerDrawable2);
addView(textView6, layoutParams7);
textView6.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
EventCollector.getInstance().onViewClickedBefore(view);
StatManager.b().c("EIC250601");
AcocuntLogoutConfirmView.this.f();
EventCollector.getInstance().onViewClicked(view);
}
});
}
private void e() {
this.e = new MttLoadingDialog(getContext());
this.e.a("正在注销...");
this.e.show();
}
public void f() {
int i;
int i2;
e();
UnRegisterReq unRegisterReq = new UnRegisterReq();
unRegisterReq.sGuid = GUIDManager.a().f();
AccountInfo currentUserInfo = ((IAccount) SDKContext.getInstance().getService(IAccount.class)).getCurrentUserInfo();
unRegisterReq.sQBID = currentUserInfo.qbId;
IDCenterIdStruct iDCenterIdStruct = new IDCenterIdStruct();
iDCenterIdStruct.sId = currentUserInfo.getQQorWxId();
HashMap hashMap = new HashMap();
IDCenterTokenStruct iDCenterTokenStruct = new IDCenterTokenStruct();
if (currentUserInfo.isQQAccount()) {
iDCenterIdStruct.eType = 1;
iDCenterTokenStruct.sAppID = String.valueOf(AccountConst.QQ_FAST_LOGIN_APPID);
iDCenterTokenStruct.sToken = currentUserInfo.A2;
i2 = 4;
} else {
if (currentUserInfo.isConnectAccount()) {
iDCenterIdStruct.eType = 4;
iDCenterTokenStruct.sAppID = String.valueOf(AccountConst.QQ_CONNECT_APPID);
iDCenterTokenStruct.sToken = currentUserInfo.getQQorWxToken();
i = 7;
} else {
if (!currentUserInfo.isWXAccount()) {
if (currentUserInfo.isPhoneAccount()) {
iDCenterIdStruct.eType = 6;
iDCenterTokenStruct.sAppID = AccountConst.PHONE_APPID;
iDCenterTokenStruct.sToken = currentUserInfo.getQQorWxToken();
i = 9;
}
unRegisterReq.mapTokens = hashMap;
unRegisterReq.stId = iDCenterIdStruct;
WUPRequest wUPRequest = new WUPRequest("idcenter4client", "unRegister", this);
wUPRequest.putRequestParam("stReq", unRegisterReq);
WUPTaskProxy.send(wUPRequest);
}
iDCenterIdStruct.eType = 2;
iDCenterTokenStruct.sAppID = String.valueOf(AccountConst.WX_APPID);
iDCenterTokenStruct.sToken = currentUserInfo.getQQorWxToken();
i2 = 2;
}
i2 = Integer.valueOf(i);
}
hashMap.put(i2, iDCenterTokenStruct);
unRegisterReq.mapTokens = hashMap;
unRegisterReq.stId = iDCenterIdStruct;
WUPRequest wUPRequest2 = new WUPRequest("idcenter4client", "unRegister", this);
wUPRequest2.putRequestParam("stReq", unRegisterReq);
WUPTaskProxy.send(wUPRequest2);
}
@Override
public void b() {
}
@Override
public void c() {
}
@Override
public void cd_() {
}
@Override
public boolean ce_() {
return false;
}
@Override
public void d() {
}
@Override
public boolean handleMessage(Message message) {
MttLoadingDialog mttLoadingDialog;
String str;
if (message.what != 100) {
str = message.what == 101 ? "注销失败,请重试" : "注销成功";
mttLoadingDialog = this.e;
if (mttLoadingDialog != null && mttLoadingDialog.isShowing()) {
this.e.dismiss();
}
return false;
}
((IAccount) SDKContext.getInstance().getService(IAccount.class)).logout();
MttFunctionwindowProxy mttFunctionwindowProxy = this.f59732b;
if (mttFunctionwindowProxy != null) {
mttFunctionwindowProxy.b(false, 0);
}
this.f59733c.a(true);
MttToaster.show(str, 0);
mttLoadingDialog = this.e;
if (mttLoadingDialog != null) {
this.e.dismiss();
}
return false;
}
@Override
public void onWUPTaskFail(WUPRequestBase wUPRequestBase) {
EventLog.a(AccountConst.EVENT_TAG, "注销失败, wup task failed: ");
this.f59734d.sendEmptyMessage(101);
}
@Override
public void onWUPTaskSuccess(WUPRequestBase wUPRequestBase, WUPResponseBase wUPResponseBase) {
String str;
if (wUPResponseBase == null) {
str = "注销失败, response is null";
} else {
Object obj = wUPResponseBase.get("stRsp");
if (!(obj instanceof UnRegisterRsp)) {
return;
}
UnRegisterRsp unRegisterRsp = (UnRegisterRsp) obj;
if (unRegisterRsp.stRspHeader != null) {
if (unRegisterRsp.stRspHeader.iCode == 200) {
EventLog.a(AccountConst.EVENT_TAG, "注销成功, iCode: 200");
this.f59734d.sendEmptyMessage(100);
return;
}
EventLog.a(AccountConst.EVENT_TAG, "注销失败, iCode: " + unRegisterRsp.stRspHeader.iCode);
this.f59734d.sendEmptyMessage(101);
return;
}
str = "注销失败, stRspHeader is null";
}
EventLog.a(AccountConst.EVENT_TAG, str);
this.f59734d.sendEmptyMessage(101);
}
public void setForwardListener(ForwardListener forwardListener) {
this.f59731a = forwardListener;
}
public void setLogOutListener(LogOutListener logOutListener) {
this.f59733c = logOutListener;
}
}