QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 MessageCenterPrivacyDialogManager.java 源代码,内容仅作参考
package com.tencent.mtt.msgcenter;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Color;
import android.os.Handler;
import android.os.Looper;
import android.text.SpannableStringBuilder;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.text.style.ForegroundColorSpan;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import com.tencent.common.utils.ExternalDataDir;
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.browser.window.SoftwareLicenseView;
import com.tencent.mtt.businesscenter.PrivacyContentDialog;
import com.tencent.mtt.operation.event.EventLog;
import com.tencent.mtt.resource.UIResourceDimen;
import com.tencent.mtt.setting.BaseSettings;
import com.tencent.mtt.uifw2.base.resource.QBResource;
import com.tencent.mtt.view.common.QBTextView;
import com.tencent.mtt.view.dialog.alert.NewQBAlertDialogBuilder;
import com.tencent.mtt.view.dialog.alert.QBAlertDialog;
import com.tencent.mtt.view.dialog.alert.QBAlertDialogBase;
import com.tencent.mtt.view.layout.QBLinearLayout;
import com.tencent.qqlive.module.videoreport.collect.EventCollector;
import java.util.ArrayList;
import java.util.List;
import qb.a.e;
public class MessageCenterPrivacyDialogManager implements View.OnClickListener {
private static final String f67739a = ExternalDataDir.f10215a + "/hippy";
private QBAlertDialog f67740b;
private Handler f67741c;
private Context f67742d;
private DialogInterface.OnDismissListener e;
private final List<DialogInterface.OnDismissListener> f;
private SoftwareLicenseView g;
private PrivacyContentDialog h;
public static class PrivacyDialogManagerHolder {
public static final MessageCenterPrivacyDialogManager f67753a = new MessageCenterPrivacyDialogManager();
}
private MessageCenterPrivacyDialogManager() {
this.f67741c = null;
this.f67742d = null;
this.f = new ArrayList();
this.f67741c = new Handler(Looper.getMainLooper());
}
public View a(String str, Context context, final View.OnClickListener onClickListener) {
QBLinearLayout qBLinearLayout = new QBLinearLayout(context);
qBLinearLayout.setOrientation(1);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -2);
layoutParams.leftMargin = UIResourceDimen.dimen.bo;
layoutParams.rightMargin = UIResourceDimen.dimen.bo;
qBLinearLayout.setLayoutParams(layoutParams);
QBTextView qBTextView = new QBTextView(context);
LinearLayout.LayoutParams layoutParams2 = new LinearLayout.LayoutParams(-1, -2);
layoutParams2.gravity = 1;
qBTextView.setLayoutParams(layoutParams2);
qBTextView.setTextColor(QBResource.b(e.n));
qBTextView.setTextSize(UIResourceDimen.dimen.bi);
qBTextView.setGravity(1);
qBTextView.setLineSpacing(UIResourceDimen.a(2.0f), 1.0f);
qBTextView.setText(str);
qBLinearLayout.addView(qBTextView);
QBTextView qBTextView2 = new QBTextView(context);
LinearLayout.LayoutParams layoutParams3 = new LinearLayout.LayoutParams(-1, -2);
layoutParams3.gravity = 1;
layoutParams3.topMargin = MttResources.s(10);
qBTextView2.setLayoutParams(layoutParams3);
qBTextView2.setTextColor(QBResource.b(e.n));
qBTextView2.setTextSize(UIResourceDimen.dimen.bg);
qBTextView2.setGravity(1);
qBTextView2.setLineSpacing(UIResourceDimen.a(2.0f), 1.0f);
SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder();
spannableStringBuilder.append((CharSequence) "请你务必审慎阅读、充分理解服务协议和隐私政策各条款,包括但不限于用户注意事项、用户行为规范以及为了向你提供服务而收集、使用、存储你个人信息的情况等。你可阅读《服务协议》和《QQ浏览器隐私保护指引》了解详细信息。如你同意,请点击下方按钮开始接受我们的服务。");
spannableStringBuilder.setSpan(new ClickableSpan() {
@Override
public void onClick(View view) {
MessageCenterPrivacyDialogManager.this.a("服务协议", "https://rule.tencent.com/rule/preview/60870208-c9ff-42b8-af61-e4469d722d0b", onClickListener);
}
}, 78, 84, 33);
spannableStringBuilder.setSpan(new ForegroundColorSpan(Color.parseColor("#4c9afa")), 78, 84, 33);
spannableStringBuilder.setSpan(new ClickableSpan() {
@Override
public void onClick(View view) {
MessageCenterPrivacyDialogManager.this.a("QQ浏览器隐私保护指引", "https://privacy.qq.com/document/priview/2491347092a64d7fa00cbc2bf68fbbbb", onClickListener);
}
}, 85, 98, 33);
spannableStringBuilder.setSpan(new ForegroundColorSpan(Color.parseColor("#4c9afa")), 85, 98, 33);
qBTextView2.setMovementMethod(LinkMovementMethod.getInstance());
qBTextView2.setText(spannableStringBuilder);
qBLinearLayout.addView(qBTextView2);
return qBLinearLayout;
}
public static MessageCenterPrivacyDialogManager a() {
return PrivacyDialogManagerHolder.f67753a;
}
public void a(DialogInterface.OnDismissListener onDismissListener) {
QBAlertDialog qBAlertDialog = this.f67740b;
if (qBAlertDialog != null) {
qBAlertDialog.setOnDismissListener(onDismissListener);
}
}
public void a(String str, String str2, final View.OnClickListener onClickListener) {
this.h = new PrivacyContentDialog(ActivityHandler.b().a());
this.h.setCanceledOnTouchOutside(false);
this.g = new SoftwareLicenseView(this.f67742d, str, str2);
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(-1, -1);
this.g.setPadding(0, BaseSettings.a().m(), 0, 0);
this.g.setLayoutParams(layoutParams);
this.g.setBackgroundColor(-1);
this.g.consumeTouchEvent();
this.g.setCloseButtonOnClickListener(this);
this.h.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialogInterface) {
MessageCenterPrivacyDialogManager messageCenterPrivacyDialogManager = MessageCenterPrivacyDialogManager.this;
messageCenterPrivacyDialogManager.a(messageCenterPrivacyDialogManager.f67742d, onClickListener);
if (MessageCenterPrivacyDialogManager.this.g == null || MessageCenterPrivacyDialogManager.this.g.getParent() == null) {
return;
}
((ViewGroup) MessageCenterPrivacyDialogManager.this.g.getParent()).removeView(MessageCenterPrivacyDialogManager.this.g);
}
});
this.h.setContentView(this.g);
this.h.show();
}
public boolean a(final Context context, final View.OnClickListener onClickListener) {
this.f67742d = context;
QBAlertDialog qBAlertDialog = this.f67740b;
if (qBAlertDialog == null || !qBAlertDialog.isShowing()) {
this.f67741c.post(new Runnable() {
@Override
public void run() {
if (context == null) {
return;
}
StatManager.b().c("DL00112");
MessageCenterPrivacyDialogManager.this.f67740b = new NewQBAlertDialogBuilder().a((String) null).a("我知道了", 1).a();
MessageCenterPrivacyDialogManager.this.f67740b.b(MessageCenterPrivacyDialogManager.this.a("服务协议和隐私政策", context, onClickListener));
MessageCenterPrivacyDialogManager messageCenterPrivacyDialogManager = MessageCenterPrivacyDialogManager.this;
messageCenterPrivacyDialogManager.a(messageCenterPrivacyDialogManager.e);
MessageCenterPrivacyDialogManager.this.f67740b.setCanceledOnTouchOutside(false);
MessageCenterPrivacyDialogManager.this.f67740b.a(onClickListener);
MessageCenterPrivacyDialogManager.this.f67740b.j(false);
MessageCenterPrivacyDialogManager.this.f67740b.setCancelable(false);
MessageCenterPrivacyDialogManager.this.f67740b.a(new QBAlertDialogBase.HandleBackListener() {
@Override
public void a() {
}
});
MessageCenterPrivacyDialogManager.this.f67740b.show();
}
});
return true;
}
EventLog.a("MessageCenterPrivacyDialogManager", "正在展示弹窗,不重复展示了");
return false;
}
public void b() {
QBAlertDialog qBAlertDialog = this.f67740b;
if (qBAlertDialog != null) {
qBAlertDialog.dismiss();
}
}
@Override
public void onClick(View view) {
EventCollector.getInstance().onViewClickedBefore(view);
PrivacyContentDialog privacyContentDialog = this.h;
if (privacyContentDialog != null) {
privacyContentDialog.dismiss();
}
EventCollector.getInstance().onViewClicked(view);
}
}