QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 PermissionLeadView.java 源代码,内容仅作参考
package com.tencent.mtt.fileclean.view;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.Typeface;
import android.graphics.drawable.GradientDrawable;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import com.tencent.common.http.Apn;
import com.tencent.luggage.wxa.gq.a;
import com.tencent.mtt.R;
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.ui.widget.QBWebImageView;
import com.tencent.mtt.base.utils.DeviceUtils;
import com.tencent.mtt.browser.jsextension.open.IOpenJsApis;
import com.tencent.mtt.browser.setting.manager.SkinManager;
import com.tencent.mtt.external.reader.IReader;
import com.tencent.mtt.file.page.statistics.FileKeyEvent;
import com.tencent.mtt.fileclean.JunkConsts;
import com.tencent.mtt.fileclean.stat.JunkEventHelper;
import com.tencent.mtt.fileclean.utils.JunkPermissionHelper;
import com.tencent.mtt.nxeasy.page.EasyPageContext;
import com.tencent.mtt.video.base.QBVideoView;
import com.tencent.mtt.view.common.QBImageView;
import com.tencent.mtt.view.common.QBTextView;
import com.tencent.mtt.view.common.QBView;
import com.tencent.mtt.view.layout.QBRelativeLayout;
import com.tencent.mtt.view.toast.MttToaster;
import com.tencent.qqlive.module.videoreport.collect.EventCollector;
import com.tencent.thumbplayer.core.common.TPCodecParamers;
import qb.a.d;
import qb.a.e;
import qb.a.g;
import qb.a.h;
class PermissionLeadView extends QBRelativeLayout implements View.OnClickListener {
private static final float l = DeviceUtils.ac() / 1920.0f;
private static final int m = (int) (l * MttResources.s(67));
private static final int n = (int) (l * MttResources.s(100));
private static final int o = (int) (l * MttResources.s(440));
private static final int p = (int) (l * MttResources.s(83));
private static final int q = (int) (l * MttResources.s(200));
EasyPageContext f66237a;
ActivityHandler.IActivityResultListener f66238b;
Handler f66239c;
QBWebImageView f66240d;
QBWebImageView e;
QBWebImageView f;
QBWebImageView g;
QBVideoView h;
QBView i;
boolean j;
int k;
public PermissionLeadView(EasyPageContext easyPageContext) {
super(easyPageContext.f68800c);
this.f66239c = new Handler(Looper.getMainLooper());
this.j = false;
this.k = MttResources.c(R.color.xu);
this.f66237a = easyPageContext;
setBackgroundColor(this.k);
a(easyPageContext.f68800c);
if (!Apn.isNetworkAvailable()) {
MttToaster.show("网络连接错误", 0);
}
new FileKeyEvent("JUNK_0001", this.f66237a.g, this.f66237a.h, "JUNK_MEM_ACC", "JK", "", JunkEventHelper.b()).b();
JunkConsts.h();
new FileKeyEvent("JUNK_0075", this.f66237a.g, this.f66237a.h, "JUNK_MEM_ACC", "JK", "", JunkEventHelper.b()).b();
StatManager.b().c("BMRB281");
}
private void a(Context context) {
QBVideoView qBVideoView;
String str;
QBImageView qBImageView = new QBImageView(context);
qBImageView.setImageNormalIds(g.E, e.W);
qBImageView.setPadding(MttResources.s(20), MttResources.s(10), MttResources.s(20), MttResources.s(10));
qBImageView.setId(1);
qBImageView.setOnClickListener(this);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-2, -2);
layoutParams.addRule(9);
layoutParams.addRule(10);
layoutParams.topMargin = MttResources.s(29);
addView(qBImageView, layoutParams);
this.f66240d = new QBWebImageView(context);
this.f66240d.setCustomMaskColor(e.U);
this.f66240d.setPlaceHolderColorId(e.U);
this.f66240d.setUrl("https://res.imtt.qq.com/res_mtt/file/permission_lead_dialog_rocket.gif");
this.f66240d.setUseMaskForNightMode(false);
this.f66240d.setId(4);
this.f66240d.setLoopCount(1);
RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(MttResources.s(108), MttResources.s(108));
layoutParams2.addRule(9);
layoutParams2.addRule(10);
layoutParams2.topMargin = m;
layoutParams2.leftMargin = MttResources.s(38);
addView(this.f66240d, layoutParams2);
this.f = new QBWebImageView(context);
this.f.setPlaceHolderDrawableId(g.f85882a);
this.f.setUseMaskForNightMode(false);
this.f.setUrl("https://res.imtt.qq.com/res_mtt/file/usage_permission_lead_bluelines.png");
RelativeLayout.LayoutParams layoutParams3 = new RelativeLayout.LayoutParams(MttResources.s(com.tencent.luggage.wxa.cy.e.CTRL_INDEX), MttResources.s(90));
layoutParams3.addRule(14);
layoutParams3.addRule(10);
layoutParams3.topMargin = n;
addView(this.f, layoutParams3);
this.g = new QBWebImageView(context);
this.g.setPlaceHolderDrawableId(g.f85882a);
this.g.setUseMaskForNightMode(false);
this.g.setUrl("https://res.imtt.qq.com/res_mtt/file/usage_permission_lead_bluelines_below.png");
RelativeLayout.LayoutParams layoutParams4 = new RelativeLayout.LayoutParams(MttResources.s(IReader.XLS_CONVERT_TO_XLSX), MttResources.s(TPCodecParamers.TP_PROFILE_MJPEG_HUFFMAN_LOSSLESS));
layoutParams4.addRule(14);
layoutParams4.addRule(10);
layoutParams4.topMargin = o;
addView(this.g, layoutParams4);
this.e = new QBWebImageView(context);
this.e.setPlaceHolderDrawableId(g.f85882a);
this.e.setUseMaskForNightMode(false);
this.e.setUrl("https://res.imtt.qq.com/res_mtt/file/usage_permission_lead_words.png");
RelativeLayout.LayoutParams layoutParams5 = new RelativeLayout.LayoutParams(MttResources.s(157), MttResources.s(72));
layoutParams5.addRule(11);
layoutParams5.addRule(10);
layoutParams5.topMargin = p;
layoutParams5.rightMargin = MttResources.s(55);
addView(this.e, layoutParams5);
this.h = new QBVideoView(context);
this.h.setId(3);
if (MttResources.a(d.f85870a)) {
qBVideoView = this.h;
str = "https://res.imtt.qq.com/res_mtt/file/usage_permission_lead_video_tf.mp4";
} else {
qBVideoView = this.h;
str = "https://res.imtt.qq.com/res_mtt/file/usage_permission_lead_video.mp4";
}
qBVideoView.a(str, false);
this.h.setControlPanelShow(false);
this.h.setBackgroundColor(MttResources.c(e.U));
this.h.a("disableMobileToast", IOpenJsApis.TRUE);
this.h.a("disableWKLachineToast", IOpenJsApis.TRUE);
this.h.a(0.0f, 0.0f);
this.h.setVideoShowingRatioMode(3);
float af = (DeviceUtils.af() * 822.0f) / 1080.0f;
RelativeLayout.LayoutParams layoutParams6 = new RelativeLayout.LayoutParams((int) af, (int) ((1320.0f * af) / 822.0f));
layoutParams6.addRule(14);
layoutParams6.topMargin = q;
addView(this.h, layoutParams6);
this.h.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
if (PermissionLeadView.this.h.g()) {
return true;
}
PermissionLeadView.this.h.a();
return true;
}
});
this.h.a();
this.h.a(new QBVideoView.IVideoViewListener() {
@Override
public void onBufferingUpdate(int i) {
}
@Override
public void onCompletion() {
}
@Override
public void onError(int i, int i2) {
}
@Override
public void onLoseControl() {
}
@Override
public void onPaused() {
}
@Override
public void onPerformance(Bundle bundle) {
}
@Override
public void onPlayExtraEvent(String str2, Bundle bundle) {
}
@Override
public void onPlayed() {
}
@Override
public void onPlayerDestroyed() {
}
@Override
public void onPrepared(int i, int i2, int i3) {
}
@Override
public void onScreenModeChanged(int i, int i2) {
}
@Override
public void onSeekComplete(int i) {
}
@Override
public void onTimeUpdate(int i) {
}
@Override
public void onVideoStartShowing() {
if (PermissionLeadView.this.i != null) {
PermissionLeadView.this.i.setVisibility(8);
}
}
});
this.i = new QBView(context);
this.i.setBackgroundColor(this.k);
addView(this.i, layoutParams6);
QBTextView qBTextView = new QBTextView(context);
qBTextView.setWidth(MttResources.s(172));
qBTextView.setHeight(MttResources.s(50));
qBTextView.setText("立即开启");
qBTextView.setGravity(17);
qBTextView.setTextSize(MttResources.s(17));
qBTextView.setTypeface(Typeface.defaultFromStyle(1));
qBTextView.setTextColor(Color.parseColor("#ff5543f9"));
qBTextView.setId(2);
qBTextView.setOnClickListener(this);
GradientDrawable gradientDrawable = new GradientDrawable();
gradientDrawable.setColor(MttResources.c(e.W));
gradientDrawable.setCornerRadius(MttResources.a(25.3f));
qBTextView.setBackgroundDrawable(gradientDrawable);
RelativeLayout.LayoutParams layoutParams7 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams7.addRule(8, 3);
layoutParams7.addRule(14);
layoutParams7.bottomMargin = MttResources.s(42);
addView(qBTextView, layoutParams7);
if (SkinManager.s().l()) {
QBView qBView = new QBView(context);
qBView.setClickable(false);
qBView.setBackgroundColor(MttResources.c(R.color.s8));
addView(qBView, new ViewGroup.LayoutParams(-1, -1));
}
f();
this.f66240d.e();
}
private void f() {
new ObjectAnimator();
ObjectAnimator ofFloat = ObjectAnimator.ofFloat(this.e, "translationX", 0.0f, -60.0f);
new ObjectAnimator();
ObjectAnimator ofFloat2 = ObjectAnimator.ofFloat(this.e, a.ab, 0.0f, 1.0f);
new ObjectAnimator();
ObjectAnimator ofFloat3 = ObjectAnimator.ofFloat(this.f, "translationY", 0.0f, -60.0f);
new ObjectAnimator();
ObjectAnimator ofFloat4 = ObjectAnimator.ofFloat(this.f, a.ab, 0.0f, 1.0f);
new ObjectAnimator();
ObjectAnimator ofFloat5 = ObjectAnimator.ofFloat(this.g, "translationY", 0.0f, -60.0f);
new ObjectAnimator();
ObjectAnimator ofFloat6 = ObjectAnimator.ofFloat(this.g, a.ab, 0.0f, 1.0f);
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.playTogether(ofFloat, ofFloat2, ofFloat3, ofFloat4, ofFloat5, ofFloat6);
animatorSet.setDuration(500L);
animatorSet.start();
}
private void g() {
this.f66238b = new ActivityHandler.IActivityResultListener() {
@Override
public void onActivityResult(int i, int i2, Intent intent) {
if (i == 1000) {
ActivityHandler.b().b(this);
if (Build.VERSION.SDK_INT >= 26) {
if (!JunkPermissionHelper.a().b()) {
StatManager.b().c("BMRB111");
PermissionLeadView.this.j = true;
} else {
StatManager.b().c("BMRB027");
PermissionLeadView.this.f66237a.f68798a.b();
PermissionLeadView.this.a();
JunkPermissionHelper.a().a(true);
}
}
}
}
};
}
public void a() {
this.f66240d.j();
this.h.d();
}
public void b() {
this.f66237a.f68798a.b();
JunkPermissionHelper.a().a(false);
}
public boolean c() {
JunkPermissionHelper.a().a(false);
return false;
}
public void d() {
}
public void e() {
a();
}
@Override
public void onClick(View view) {
EventCollector.getInstance().onViewClickedBefore(view);
if (view != null) {
if (view.getId() == 1) {
b();
} else if (view.getId() == 2) {
StatManager.b().c("BMRB026");
if (this.j) {
StatManager.b().c("BMRB112");
}
g();
JunkPermissionHelper.a().a(this.f66238b);
this.f66239c.postDelayed(new Runnable() {
@Override
public void run() {
JunkPermissionHelper.a().a("1. 选择" + MttResources.l(h.f85890b), "2. 在授权弹窗中确认");
}
}, 600L);
}
}
EventCollector.getInstance().onViewClicked(view);
}
}