WeChat.apk(点击下载) / g7.java


package lt1;

import android.content.Intent;
import android.graphics.Color;
import android.text.SpannableString;
import android.text.TextPaint;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.TextView;
import at1.j2;
import com.tencent.mm.R;
import com.tencent.mm.storage.w1;
import com.tencent.mm.ui.MMActivity;
import com.tencent.tinker.loader.hotplug.EnvConsts;
import cs1.o;
import d60.z;
import ek4.d0;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Arrays;
import lh4.m;
import t32.e6;
import yz3.j;

public final class g7 {

    /* renamed from: a  reason: collision with root package name */
    public final MMActivity f255154a;

    /* renamed from: b  reason: collision with root package name */
    public final j2.d f255155b;

    /* renamed from: c  reason: collision with root package name */
    public int f255156c = z.s().i().F(w1.a.Am, 0);

    /* renamed from: d  reason: collision with root package name */
    public View f255157d;

    /* renamed from: e  reason: collision with root package name */
    public CheckBox f255158e;

    /* renamed from: f  reason: collision with root package name */
    public int f255159f;

    public static final class a implements View.OnClickListener {

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ g7 f255160d;

        public a(g7 g7Var) {
            this.f255160d = g7Var;
        }

        public final void onClick(View view) {
            ArrayList arrayList = new ArrayList();
            arrayList.add(view);
            Object[] array = arrayList.toArray();
            arrayList.clear();
            j30.a.b("com/tencent/mm/plugin/finder/live/widget/FinderLivePostLicenseWidget$1", "android/view/View$OnClickListener", "onClick", "(Landroid/view/View;)V", this, array);
            this.f255160d.b().setChecked(!this.f255160d.b().isChecked());
            g7 g7Var = this.f255160d;
            g7Var.f255156c = g7Var.b().isChecked() ? 1 : 0;
            this.f255160d.f255155b.onChange();
            g7.a(this.f255160d);
            j30.a.g(this, "com/tencent/mm/plugin/finder/live/widget/FinderLivePostLicenseWidget$1", "android/view/View$OnClickListener", "onClick", "(Landroid/view/View;)V");
        }
    }

    public static final class b implements CompoundButton.OnCheckedChangeListener {

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ g7 f255161a;

        public b(g7 g7Var) {
            this.f255161a = g7Var;
        }

        public final void onCheckedChanged(CompoundButton compoundButton, boolean z15) {
            g7 g7Var = this.f255161a;
            g7Var.f255156c = g7Var.b().isChecked() ? 1 : 0;
            this.f255161a.f255155b.onChange();
            g7.a(this.f255161a);
        }
    }

    public static final class c extends ClickableSpan {

        /* renamed from: d  reason: collision with root package name */
        public final WeakReference<g7> f255162d;

        public c(WeakReference<g7> weakReference) {
            m.g(weakReference, "rWidget");
            this.f255162d = weakReference;
        }

        public void onClick(View view) {
            MMActivity mMActivity;
            ArrayList arrayList = new ArrayList();
            arrayList.add(view);
            Object[] array = arrayList.toArray();
            arrayList.clear();
            j30.a.b("com/tencent/mm/plugin/finder/live/widget/FinderLivePostLicenseWidget$ItermsClickSpan", "android/text/style/ClickableSpan", "onClick", "(Landroid/view/View;)V", this, array);
            m.g(view, "widget");
            g7 g7Var = this.f255162d.get();
            if (g7Var == null || (mMActivity = g7Var.f255154a) == null) {
                j30.a.g(this, "com/tencent/mm/plugin/finder/live/widget/FinderLivePostLicenseWidget$ItermsClickSpan", "android/text/style/ClickableSpan", "onClick", "(Landroid/view/View;)V");
                return;
            }
            Intent intent = new Intent();
            intent.putExtra("rawUrl", "https://weixin.qq.com/cgi-bin/readtemplate?t=finder_live_privacy");
            sv3.b.j(mMActivity, "webview", ".ui.tools.WebViewUI", intent, null);
            j30.a.g(this, "com/tencent/mm/plugin/finder/live/widget/FinderLivePostLicenseWidget$ItermsClickSpan", "android/text/style/ClickableSpan", "onClick", "(Landroid/view/View;)V");
        }

        public void updateDrawState(TextPaint textPaint) {
            m.g(textPaint, "ds");
            textPaint.setColor(Color.parseColor("#7D90A9"));
            textPaint.setUnderlineText(false);
            textPaint.clearShadowLayer();
        }
    }

    public static final class d extends ClickableSpan {

        /* renamed from: d  reason: collision with root package name */
        public final WeakReference<g7> f255163d;

        public d(WeakReference<g7> weakReference) {
            m.g(weakReference, "rWidget");
            this.f255163d = weakReference;
        }

        public void onClick(View view) {
            MMActivity mMActivity;
            ArrayList arrayList = new ArrayList();
            arrayList.add(view);
            Object[] array = arrayList.toArray();
            arrayList.clear();
            j30.a.b("com/tencent/mm/plugin/finder/live/widget/FinderLivePostLicenseWidget$StandardClickSpan", "android/text/style/ClickableSpan", "onClick", "(Landroid/view/View;)V", this, array);
            m.g(view, "widget");
            g7 g7Var = this.f255163d.get();
            if (g7Var == null || (mMActivity = g7Var.f255154a) == null) {
                j30.a.g(this, "com/tencent/mm/plugin/finder/live/widget/FinderLivePostLicenseWidget$StandardClickSpan", "android/text/style/ClickableSpan", "onClick", "(Landroid/view/View;)V");
                return;
            }
            Intent intent = new Intent();
            intent.putExtra("rawUrl", "https://weixin.qq.com/cgi-bin/readtemplate?t=finder_live_up_privacy");
            sv3.b.j(mMActivity, "webview", ".ui.tools.WebViewUI", intent, null);
            j30.a.g(this, "com/tencent/mm/plugin/finder/live/widget/FinderLivePostLicenseWidget$StandardClickSpan", "android/text/style/ClickableSpan", "onClick", "(Landroid/view/View;)V");
        }

        public void updateDrawState(TextPaint textPaint) {
            m.g(textPaint, "ds");
            textPaint.setColor(Color.parseColor("#7D90A9"));
            textPaint.setUnderlineText(false);
            textPaint.clearShadowLayer();
        }
    }

    public g7(MMActivity mMActivity, ViewGroup viewGroup, j2.d dVar) {
        m.g(mMActivity, EnvConsts.ACTIVITY_MANAGER_SRVNAME);
        m.g(viewGroup, "licenseContainer");
        m.g(dVar, "callback");
        this.f255154a = mMActivity;
        this.f255155b = dVar;
        tn1.a aVar = tn1.a.f313149a;
        this.f255157d = viewGroup;
        viewGroup.setOnClickListener(new a(this));
        View findViewById = this.f255157d.findViewById(R.id.l0i);
        m.f(findViewById, "container.findViewById(R.id.post_license_checkbox)");
        this.f255158e = (CheckBox) findViewById;
        b().setOnCheckedChangeListener(new b(this));
        View findViewById2 = this.f255157d.findViewById(R.id.l0k);
        m.f(findViewById2, "container.findViewById(R.id.post_license_tv)");
        TextView textView = (TextView) findViewById2;
        String string = textView.getContext().getResources().getString(R.string.d4l);
        m.f(string, "tv.context.resources.get…inder_live_anchor_iterms)");
        String string2 = textView.getContext().getResources().getString(R.string.d5n);
        m.f(string2, "tv.context.resources.get…der_live_anchor_standard)");
        String string3 = textView.getContext().getResources().getString(R.string.d3y);
        m.f(string3, "tv.context.resources.get…ng.finder_live_agree_new)");
        String format = String.format(string3, Arrays.copyOf(new Object[]{string, string2}, 2));
        m.f(format, "format(format, *args)");
        int H = d0.H(format, string, 0, false, 6, null);
        int H2 = d0.H(format, string2, 0, false, 6, null);
        SpannableString spannableString = new SpannableString(format);
        c cVar = new c(new WeakReference(this));
        d dVar2 = new d(new WeakReference(this));
        spannableString.setSpan(cVar, H, string.length() + H, 33);
        spannableString.setSpan(dVar2, H2, string2.length() + H2, 33);
        textView.setHighlightColor(textView.getContext().getResources().getColor(17170445));
        textView.setMovementMethod(LinkMovementMethod.getInstance());
        textView.setText(spannableString);
        this.f255159f = 4;
    }

    public static final void a(g7 g7Var) {
        int i15;
        if (g7Var.f255156c == 1) {
            i15 = 3;
        } else {
            i15 = 4;
        }
        if (g7Var.f255159f != i15) {
            yz3.d c15 = j.c(o.class);
            m.f(c15, "getService(HellLiveReport::class.java)");
            e6.a.a((e6) c15, 10, String.valueOf(i15), null, 4, null);
            ((o) j.c(o.class)).getClass();
            o.f193527h.Q = (long) i15;
            g7Var.f255159f = i15;
        }
    }

    public final CheckBox b() {
        CheckBox checkBox = this.f255158e;
        if (checkBox != null) {
            return checkBox;
        }
        m.p("checkBox");
        throw null;
    }
}