QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 SplashLoginSocialUI.java 源代码,内容仅作参考
package com.tencent.mtt.base.account.gateway.pages;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import com.tencent.mtt.R;
import com.tencent.mtt.account.base.IAccount;
import com.tencent.mtt.account.base.UserLoginListener;
import com.tencent.mtt.base.account.AccountConst;
import com.tencent.mtt.base.account.PrefetchPhoneFrom;
import com.tencent.mtt.base.account.gateway.AgreementConfig;
import com.tencent.mtt.base.account.gateway.AgreementTextView;
import com.tencent.mtt.base.account.gateway.UtilsKt;
import com.tencent.mtt.base.account.gateway.common.ConfigKeyKt;
import com.tencent.mtt.base.account.gateway.common.Social;
import com.tencent.mtt.base.account.gateway.common.StyleKey;
import com.tencent.mtt.base.stat.StatManager;
import com.tencent.mtt.browser.share.export.socialshare.qqshare.QQShareActivity;
import com.tencent.mtt.browser.window.UrlParams;
import com.tencent.mtt.businesscenter.facade.IFrameworkDelegate;
import com.tencent.mtt.hippy.dom.node.NodeProps;
import com.tencent.mtt.hippy.qb.views.HippyQBViewTouchAndDrawData;
import com.tencent.mtt.qbcontext.core.QBContext;
import com.tencent.mtt.setting.PublicSettingManager;
import com.tencent.mtt.view.toast.MttToaster;
import com.tencent.qqlive.module.videoreport.collect.EventCollector;
import java.util.HashMap;
import java.util.Map;
import kotlin.Lazy;
import kotlin.LazyKt;
import kotlin.Unit;
import kotlin.collections.MapsKt;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function3;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
public final class SplashLoginSocialUI extends FrameLayout implements UserLoginListener {
public static final Companion f32057a = new Companion(null);
private final Lazy f32058b;
private boolean f32059c;
private final Bundle f32060d;
private final Lazy e;
private final Map<String, String> f;
private final UserLoginListener g;
private HashMap h;
public static final class Companion {
private Companion() {
}
public Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
}
public SplashLoginSocialUI(final Context context, Map<String, String> map, UserLoginListener userLoginListener) {
super(context);
Intrinsics.checkParameterIsNotNull(context, "context");
this.f = map;
this.g = userLoginListener;
this.f32058b = LazyKt.lazy(new Function0<View>() {
{
super(0);
}
@Override
public final View invoke() {
return LayoutInflater.from(context).inflate(R.layout.k0, SplashLoginSocialUI.this);
}
});
Bundle bundle = new Bundle();
bundle.putInt(QQShareActivity.KEY_FROM_WHERE, 10097);
bundle.putBoolean(AccountConst.LOGIN_CUSTOM_NEED_TOAST, false);
this.f32060d = bundle;
this.e = LazyKt.lazy(new Function0<Boolean>() {
{
super(0);
}
@Override
public Boolean invoke() {
return Boolean.valueOf(invoke2());
}
public final boolean invoke2() {
Map map2;
String str;
map2 = SplashLoginSocialUI.this.f;
if (map2 == null || (str = (String) map2.get("show_ignore_btn")) == null) {
return false;
}
return Boolean.parseBoolean(str);
}
});
c();
View layout = getLayout();
Intrinsics.checkExpressionValueIsNotNull(layout, "layout");
layout.findViewById(R.id.login_btn_wx).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
EventCollector.getInstance().onViewClickedBefore(view);
if (SplashLoginSocialUI.this.a()) {
((AgreementTextView) SplashLoginSocialUI.this.a(R.id.agreement)).a();
} else {
SplashLoginSocialUI.this.a("LFNLI02");
UtilsKt.a(new Function1<Boolean, Unit>() {
{
super(1);
}
@Override
public Unit invoke(Boolean bool) {
invoke(bool.booleanValue());
return Unit.INSTANCE;
}
public final void invoke(boolean z) {
if (z) {
UtilsKt.a("打开微信登录", "SplashLoginSocialUI");
UtilsKt.a(Social.WX, SplashLoginSocialUI.this.f32060d, SplashLoginSocialUI.this, (Function3) null, 8, (Object) null);
} else {
UtilsKt.a("微信未安装", "SplashLoginSocialUI");
((IFrameworkDelegate) QBContext.getInstance().getService(IFrameworkDelegate.class)).doLoad(new UrlParams("https://dldir1.qq.com/weixin/android/weixin806android1900_arm64.apk?bindUrl=https://sc.qq.com/qr/fx/?guid=b07f590c5e94e0160436be7e144988cb"));
SplashLoginSocialUI.this.f32059c = true;
}
}
});
}
EventCollector.getInstance().onViewClicked(view);
}
});
View layout2 = getLayout();
Intrinsics.checkExpressionValueIsNotNull(layout2, "layout");
((ImageView) layout2.findViewById(R.id.login_btn_qq)).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
EventCollector.getInstance().onViewClickedBefore(view);
if (SplashLoginSocialUI.this.a()) {
((AgreementTextView) SplashLoginSocialUI.this.a(R.id.agreement)).a();
} else {
UtilsKt.a("打开QQ登录", "SplashLoginSocialUI");
SplashLoginSocialUI.this.a("LFNLI03");
UtilsKt.a(Social.QQ, SplashLoginSocialUI.this.f32060d, SplashLoginSocialUI.this, (Function3) null, 8, (Object) null);
}
EventCollector.getInstance().onViewClicked(view);
}
});
View layout3 = getLayout();
Intrinsics.checkExpressionValueIsNotNull(layout3, "layout");
((ImageView) layout3.findViewById(R.id.login_btn_phone)).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
EventCollector.getInstance().onViewClickedBefore(view);
UtilsKt.a("打开手机登录", "SplashLoginSocialUI");
SplashLoginSocialUI.this.a("LFNLI04");
((IAccount) QBContext.getInstance().getService(IAccount.class)).doQuickLoginPhone(SplashLoginSocialUI.this.f32060d, SplashLoginSocialUI.this);
EventCollector.getInstance().onViewClicked(view);
}
});
View layout4 = getLayout();
Intrinsics.checkExpressionValueIsNotNull(layout4, "layout");
AgreementTextView agreementTextView = (AgreementTextView) layout4.findViewById(R.id.agreement);
agreementTextView.setVisibility(AgreementConfig.f31768a.a() ? 0 : 8);
agreementTextView.setAgreementText(" 请阅读并同意用户协议和QQ浏览器隐私保护指引");
b();
}
public final void a(String str) {
Map<String, String> mutableMap;
StatManager.b().c(str);
Map<String, String> map = this.f;
if (map == null || (mutableMap = MapsKt.toMutableMap(map)) == null) {
return;
}
mutableMap.put("rtype", HippyQBViewTouchAndDrawData.GES_TYPE_CLICK);
StatManager.b().b("MTT_SPLASH_BUSINESS_FUNNEL", mutableMap);
}
public final boolean a() {
return AgreementConfig.f31768a.a() && !((AgreementTextView) a(R.id.agreement)).b();
}
private final void b() {
if (getShowIgnoreBtn()) {
View layout = getLayout();
Intrinsics.checkExpressionValueIsNotNull(layout, "layout");
TextView textView = (TextView) layout.findViewById(R.id.btn_ignore);
Intrinsics.checkExpressionValueIsNotNull(textView, "layout.btn_ignore");
textView.setVisibility(0);
}
View layout2 = getLayout();
Intrinsics.checkExpressionValueIsNotNull(layout2, "layout");
((TextView) layout2.findViewById(R.id.btn_ignore)).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
UserLoginListener userLoginListener;
EventCollector.getInstance().onViewClickedBefore(view);
userLoginListener = SplashLoginSocialUI.this.g;
if (userLoginListener != null) {
userLoginListener.onLoginFailed(-1, "跳过");
}
EventCollector.getInstance().onViewClicked(view);
}
});
}
private final void c() {
d();
e();
}
private final void d() {
String string = PublicSettingManager.a().getString("ANDROID_PUBLIC_PREFS_LOGIN_SPLASH_TITLE", "");
if (string == null || string.length() == 0) {
return;
}
View layout = getLayout();
Intrinsics.checkExpressionValueIsNotNull(layout, "layout");
TextView textView = (TextView) layout.findViewById(R.id.tv_tip);
Intrinsics.checkExpressionValueIsNotNull(textView, "layout.tv_tip");
textView.setText(string);
}
private final void e() {
View layout = getLayout();
Intrinsics.checkExpressionValueIsNotNull(layout, "layout");
ImageView imageView = (ImageView) layout.findViewById(R.id.login_btn_phone);
Intrinsics.checkExpressionValueIsNotNull(imageView, "layout.login_btn_phone");
imageView.setVisibility(ConfigKeyKt.a(StyleKey.Default) ? 8 : 0);
}
private final View getLayout() {
return (View) this.f32058b.getValue();
}
private final boolean getShowIgnoreBtn() {
return ((Boolean) this.e.getValue()).booleanValue();
}
public View a(int i) {
if (this.h == null) {
this.h = new HashMap();
}
View view = (View) this.h.get(Integer.valueOf(i));
if (view != null) {
return view;
}
View findViewById = findViewById(i);
this.h.put(Integer.valueOf(i), findViewById);
return findViewById;
}
@Override
public void onAttachedToWindow() {
super.onAttachedToWindow();
UtilsKt.a(NodeProps.ON_ATTACHED_TO_WINDOW, "SplashLoginSocialUI");
StatManager.b().c("LFNLI01");
((IAccount) QBContext.getInstance().getService(IAccount.class)).preFetchPhone(PrefetchPhoneFrom.SPLASH);
}
@Override
public void onLoginFailed(int i, String str) {
if (i != 1) {
MttToaster.show("登录失败", 0);
}
}
@Override
public void onLoginSuccess() {
UserLoginListener userLoginListener = this.g;
if (userLoginListener != null) {
userLoginListener.onLoginSuccess();
MttToaster.show(R.string.aci, 0);
}
}
@Override
public void onWindowVisibilityChanged(int i) {
super.onWindowVisibilityChanged(i);
UtilsKt.a("onWindowVisibilityChanged", "SplashLoginSocialUI");
if (i == 0 && this.f32059c) {
this.f32059c = false;
UtilsKt.a(new Function1<Boolean, Unit>() {
{
super(1);
}
@Override
public Unit invoke(Boolean bool) {
invoke(bool.booleanValue());
return Unit.INSTANCE;
}
public final void invoke(boolean z) {
if (z) {
UtilsKt.a("打开微信登录", "SplashLoginSocialUI");
UtilsKt.a(Social.WX, SplashLoginSocialUI.this.f32060d, SplashLoginSocialUI.this, (Function3) null, 8, (Object) null);
}
}
});
}
}
}