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


package mn1;

import android.content.Context;
import android.content.DialogInterface;
import android.text.SpannableString;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.Window;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import bw3.rr1;
import bw3.sr1;
import bw3.vr1;
import com.google.android.material.bottomsheet.BottomSheetBehavior;
import com.tencent.mm.R;
import com.tencent.mm.plugin.finder.utils.x1;
import com.tencent.mm.plugin.finder.utils.y3;
import com.tencent.mm.plugin.finder.view.FinderPostAnnounceItemsView;
import com.tencent.mm.plugin.finder.view.j;
import com.tencent.mm.plugin.finder.view.p4;
import com.tencent.mm.plugin.finder.webview.ad.ScrollFrameLayout;
import com.tencent.mm.sdk.platformtools.Log;
import com.tencent.mm.ui.t2;
import com.tencent.mm.ui.x4;
import com.tencent.neattextview.textview.view.NeatTextView;
import d60.z;
import dj1.a;
import ek4.d0;
import ek4.y;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import kh4.l;
import lh4.h;
import lh4.m;
import sk1.c;
import sk1.d;
import sk1.q;
import wg4.b0;
import wg4.o;
import xg4.r0;
import xg4.u;
import zz1.e;

public final class n {

    /* renamed from: s  reason: collision with root package name */
    public static final String f266435s;

    /* renamed from: t  reason: collision with root package name */
    public static final float f266436t = (((float) y3.f119479a.a()) * 0.75f);

    /* renamed from: a  reason: collision with root package name */
    public final Context f266437a;

    /* renamed from: b  reason: collision with root package name */
    public final int f266438b;

    /* renamed from: c  reason: collision with root package name */
    public final long f266439c;

    /* renamed from: d  reason: collision with root package name */
    public final boolean f266440d;

    /* renamed from: e  reason: collision with root package name */
    public final int f266441e;

    /* renamed from: f  reason: collision with root package name */
    public TextView f266442f;

    /* renamed from: g  reason: collision with root package name */
    public com.google.android.material.bottomsheet.a f266443g;

    /* renamed from: h  reason: collision with root package name */
    public BottomSheetBehavior<View> f266444h;

    /* renamed from: i  reason: collision with root package name */
    public j f266445i;

    /* renamed from: j  reason: collision with root package name */
    public int f266446j;

    /* renamed from: k  reason: collision with root package name */
    public final ArrayList<String> f266447k;

    /* renamed from: l  reason: collision with root package name */
    public l<? super vr1, b0> f266448l;

    /* renamed from: m  reason: collision with root package name */
    public boolean f266449m;

    /* renamed from: n  reason: collision with root package name */
    public boolean f266450n;

    /* renamed from: o  reason: collision with root package name */
    public boolean f266451o;

    /* renamed from: p  reason: collision with root package name */
    public vr1 f266452p;

    /* renamed from: q  reason: collision with root package name */
    public kh4.a<b0> f266453q;

    /* renamed from: r  reason: collision with root package name */
    public boolean f266454r;

    public static final class a implements DialogInterface.OnDismissListener {

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

        public a(n nVar) {
            this.f266455d = nVar;
        }

        public final void onDismiss(DialogInterface dialogInterface) {
            this.f266455d.f266443g = null;
        }
    }

    public static final class b implements DialogInterface.OnShowListener {

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

        public b(n nVar) {
            this.f266456d = nVar;
        }

        public final void onShow(DialogInterface dialogInterface) {
            BottomSheetBehavior<View> bottomSheetBehavior = this.f266456d.f266444h;
            if (bottomSheetBehavior != null) {
                bottomSheetBehavior.B(3);
            }
        }
    }

    static {
        e.f356376d.getClass();
        String d15 = ((jt3.b) z.q(jt3.b.class)).gv0().d("FinderPostOriginRuleUrl");
        if (d15 == null) {
            d15 = "https://support.weixin.qq.com/cgi-bin/mmsupportacctnodeweb-bin/pages/GzdzwPjCFZDCZkmI";
        }
        Log.i("FinderConfig", "FINDER_POST_ORIGIN_RULE_URL info = " + d15);
        f266435s = d15;
    }

    /* JADX WARNING: Code restructure failed: missing block: B:18:0x0069, code lost:
        if (((java.lang.Number) ((tl1.c) ((wg4.n) zz1.e.f356408f6).getValue()).t()).intValue() == 1) goto L_0x006b;
     */
    public n(Context context, int i15, long j15, String str, boolean z15, int i16, int i17, h hVar) {
        long j16 = 0;
        j15 = (i17 & 4) != 0 ? 0 : j15;
        str = (i17 & 8) != 0 ? "" : str;
        boolean z16 = false;
        z15 = (i17 & 16) != 0 ? false : z15;
        i16 = (i17 & 32) != 0 ? 0 : i16;
        m.g(context, "context");
        m.g(str, "exportId");
        this.f266437a = context;
        this.f266438b = i15;
        this.f266439c = j15;
        this.f266440d = z15;
        this.f266441e = i16;
        this.f266446j = -1;
        this.f266447k = new ArrayList<>();
        q b15 = d.f302423a.b(r32.b.c(context));
        if (((b15 != null ? b15.field_additionalFlag : j16) & 64) != 64) {
            e.f356376d.getClass();
        }
        z16 = true;
        this.f266449m = z16;
    }

    public static final void a(n nVar, String str) {
        if (nVar.f266445i == null) {
            l32.d dVar = new l32.d(nVar.f266437a);
            j jVar = new j(dVar, str);
            nVar.f266445i = jVar;
            jVar.f121056g = new m(nVar, str);
            ScrollFrameLayout e15 = dVar.e();
            x4.m0(((TextView) e15.findViewById(R.id.l0v)).getPaint(), 0.8f);
            View findViewById = e15.findViewById(R.id.l0z);
            float dimension = f266436t - e15.getContext().getResources().getDimension(R.dimen.f359066ce);
            ViewGroup.LayoutParams layoutParams = findViewById.getLayoutParams();
            layoutParams.height = (int) dimension;
            findViewById.setLayoutParams(layoutParams);
            ((Button) e15.findViewById(R.id.l0y)).setOnClickListener(new a(nVar));
            ((Button) e15.findViewById(R.id.l0x)).setOnClickListener(new b(nVar));
        }
        j jVar2 = nVar.f266445i;
        if (jVar2 != null) {
            Log.i("Finder.AnnounceWebViewDialogWrapper", "showDialog showAfterWebViewReady: %b, webViewReady: %b", Boolean.FALSE, Boolean.valueOf(jVar2.f121053d));
            Log.i("Finder.AnnounceWebViewDialogWrapper", "realShow");
            jVar2.f121050a.show();
        }
    }

    public final sr1 b() {
        boolean z15;
        vr1 vr12;
        q b15 = d.f302423a.b(r32.b.c(this.f266437a));
        if (b15 != null) {
            z15 = c.e(b15);
        } else {
            z15 = false;
        }
        if (z15 || (vr12 = this.f266452p) == null) {
            return null;
        }
        sr1 sr12 = new sr1();
        sr12.f36731d.add(Integer.valueOf(vr12.f40201d));
        return sr12;
    }

    public final vr1 c() {
        boolean z15;
        rr1 rr12;
        LinkedList<vr1> linkedList;
        int size = this.f266447k.size();
        int i15 = this.f266446j;
        if (i15 < 0 || i15 >= size) {
            z15 = false;
        } else {
            z15 = true;
        }
        T t15 = null;
        if (!z15) {
            return null;
        }
        String str = this.f266447k.get(i15);
        m.f(str, "typeNameList[index]");
        String str2 = str;
        ij1.b a15 = a.C2191a.a(dj1.b.f200487e, r32.b.c(this.f266437a), false, 2, null);
        if (a15 == null || (rr12 = a15.r2().I) == null || (linkedList = rr12.f35619d) == null) {
            return null;
        }
        Iterator<T> it = linkedList.iterator();
        while (true) {
            if (!it.hasNext()) {
                break;
            }
            T next = it.next();
            if (y.m(next.f40202e, str2, false, 2, null)) {
                t15 = next;
                break;
            }
        }
        return t15;
    }

    public final void d(View view, String str) {
        String str2;
        if (this.f266440d) {
            str2 = "upgrade_original_right";
        } else {
            str2 = "set_original_statement";
        }
        x1 x1Var = x1.f119449a;
        wg4.l[] lVarArr = new wg4.l[4];
        int i15 = 0;
        lVarArr[0] = new wg4.l("original_statement_type", Integer.valueOf(this.f266449m ? 1 : 0));
        vr1 c15 = c();
        if (c15 != null) {
            i15 = c15.f40201d;
        }
        lVarArr[1] = new wg4.l("original_type", Integer.valueOf(i15));
        lVarArr[2] = new wg4.l("feed_id", m60.d.p(this.f266439c));
        lVarArr[3] = new wg4.l("original_statement_source_page", Integer.valueOf(this.f266441e));
        x1Var.h(view, str2, str, r0.f(lVarArr));
    }

    public final void e() {
        TextView textView;
        int size = this.f266447k.size();
        int i15 = this.f266446j;
        boolean z15 = false;
        if (i15 >= 0 && i15 < size) {
            z15 = true;
        }
        if (z15 && (textView = this.f266442f) != null) {
            textView.setText(this.f266447k.get(i15));
        }
    }

    public final void f(boolean z15) {
        String str;
        Window window;
        View decorView;
        Window window2;
        LinkedList<vr1> linkedList;
        boolean z16;
        if (this.f266443g == null) {
            boolean z17 = this.f266440d;
            View inflate = LayoutInflater.from(this.f266437a).inflate(R.layout.b5y, (ViewGroup) null, false);
            m.e(inflate, "null cannot be cast to non-null type android.widget.ScrollView");
            ScrollView scrollView = (ScrollView) inflate;
            scrollView.setOnTouchListener(new c(scrollView));
            TextView textView = (TextView) scrollView.findViewById(R.id.l19);
            x4.m0(textView.getPaint(), 0.8f);
            Button button = (Button) scrollView.findViewById(R.id.l1c);
            button.setEnabled(false);
            x4.m0(button.getPaint(), 0.8f);
            button.setOnClickListener(new k(this, button));
            d(scrollView, "view_exp");
            TextView textView2 = (TextView) scrollView.findViewById(R.id.q9z);
            if (z17) {
                textView.setText(scrollView.getContext().getResources().getString(R.string.lke));
                button.setText(scrollView.getContext().getResources().getString(R.string.lkd));
                textView2.setVisibility(0);
            } else {
                textView2.setVisibility(8);
            }
            View findViewById = scrollView.findViewById(R.id.q9x);
            if (findViewById != null) {
                findViewById.setOnClickListener(new d(this));
            }
            CheckBox checkBox = (CheckBox) scrollView.findViewById(R.id.f364259l14);
            checkBox.setOnCheckedChangeListener(new j(this, button));
            NeatTextView neatTextView = (NeatTextView) scrollView.findViewById(R.id.l17);
            String string = scrollView.getContext().getResources().getString(R.string.f368511ew3);
            m.f(string, "context.resources.getStr…t_origin_agreement_known)");
            String string2 = scrollView.getContext().getResources().getString(R.string.ew5);
            m.f(string2, "context.resources.getStr…ost_origin_agreement_use)");
            String string3 = scrollView.getContext().getResources().getString(R.string.ew4, string, string2);
            m.f(string3, "context.resources.getStr…nownUrlName, ruleUrlName)");
            SpannableString spannableString = new SpannableString(string3);
            int H = d0.H(string3, string, 0, false, 6, null);
            spannableString.setSpan(new p4(string3, scrollView.getContext().getResources().getColor(R.color.Link_100), scrollView.getContext().getResources().getColor(R.color.a9e), false, false, new e(this)), H, string.length() + H, 17);
            int H2 = d0.H(string3, string2, 0, false, 6, null);
            spannableString.setSpan(new p4(string3, scrollView.getContext().getResources().getColor(R.color.Link_100), scrollView.getContext().getResources().getColor(R.color.a9e), false, false, new f(this)), H2, string2.length() + H2, 17);
            FinderPostAnnounceItemsView finderPostAnnounceItemsView = (FinderPostAnnounceItemsView) scrollView.findViewById(R.id.f364258l13);
            ArrayList arrayList = new ArrayList();
            if (this.f266449m) {
                str = "";
            } else {
                str = finderPostAnnounceItemsView.getContext().getResources().getString(R.string.lk_);
                m.f(str, "{\n                      …                        }");
            }
            arrayList.add(new o(finderPostAnnounceItemsView.getContext().getResources().getString(R.string.lka), str, new g(finderPostAnnounceItemsView)));
            arrayList.add(new o(finderPostAnnounceItemsView.getContext().getResources().getString(R.string.lkc), "", null));
            arrayList.add(new o(finderPostAnnounceItemsView.getContext().getResources().getString(R.string.lkb), "", null));
            int i15 = 0;
            for (Iterator it = arrayList.iterator(); it.hasNext(); it = it) {
                Object next = it.next();
                int i16 = i15 + 1;
                if (i15 >= 0) {
                    o oVar = (o) next;
                    View inflate2 = t2.b(finderPostAnnounceItemsView.getContext()).inflate(R.layout.b5v, (ViewGroup) null, true);
                    LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -2);
                    if (i15 != 0) {
                        layoutParams.topMargin = finderPostAnnounceItemsView.f120390d;
                    }
                    finderPostAnnounceItemsView.addView(inflate2, layoutParams);
                    m.f(inflate2, "itemView");
                    ((TextView) inflate2.findViewById(R.id.l1g)).setText(oVar.f332815d);
                    finderPostAnnounceItemsView.f120391e = inflate2.findViewById(R.id.q9y);
                    if (oVar.f332816e.length() > 0) {
                        z16 = true;
                    } else {
                        z16 = false;
                    }
                    if (z16) {
                        View view = finderPostAnnounceItemsView.f120391e;
                        if (view != null) {
                            k30.a aVar = new k30.a();
                            ThreadLocal<k30.a> threadLocal = k30.c.f244265a;
                            aVar.c(0);
                            j30.a.d(view, aVar.b(), "com/tencent/mm/plugin/finder/view/FinderPostAnnounceItemsView", "setAnnounceText", "(Landroid/view/View;Lkotlin/Triple;)V", "android/view/View_EXEC_", "setVisibility", "(I)V");
                            view.setVisibility(((Integer) aVar.a(0)).intValue());
                            j30.a.e(view, "com/tencent/mm/plugin/finder/view/FinderPostAnnounceItemsView", "setAnnounceText", "(Landroid/view/View;Lkotlin/Triple;)V", "android/view/View_EXEC_", "setVisibility", "(I)V");
                        }
                        View view2 = finderPostAnnounceItemsView.f120391e;
                        if (view2 != null) {
                            view2.setOnClickListener(oVar.f332817f);
                        }
                        ((TextView) inflate2.findViewById(R.id.l1e)).setText(oVar.f332816e);
                    } else {
                        View view3 = finderPostAnnounceItemsView.f120391e;
                        if (view3 != null) {
                            k30.a aVar2 = new k30.a();
                            ThreadLocal<k30.a> threadLocal2 = k30.c.f244265a;
                            aVar2.c(8);
                            j30.a.d(view3, aVar2.b(), "com/tencent/mm/plugin/finder/view/FinderPostAnnounceItemsView", "setAnnounceText", "(Landroid/view/View;Lkotlin/Triple;)V", "android/view/View_EXEC_", "setVisibility", "(I)V");
                            view3.setVisibility(((Integer) aVar2.a(0)).intValue());
                            j30.a.e(view3, "com/tencent/mm/plugin/finder/view/FinderPostAnnounceItemsView", "setAnnounceText", "(Landroid/view/View;Lkotlin/Triple;)V", "android/view/View_EXEC_", "setVisibility", "(I)V");
                            i15 = i16;
                        }
                    }
                    i15 = i16;
                } else {
                    u.l();
                    throw null;
                }
            }
            neatTextView.setOnTouchListener(new kv3.d0(scrollView.getContext()));
            neatTextView.b(spannableString);
            neatTextView.setOnClickListener(new h(checkBox));
            ((FrameLayout) scrollView.findViewById(R.id.l15)).setOnClickListener(new i(checkBox));
            this.f266447k.clear();
            ij1.b a15 = a.C2191a.a(dj1.b.f200487e, r32.b.c(this.f266437a), false, 2, null);
            rr1 rr12 = a15 != null ? a15.r2().I : null;
            if (!(rr12 == null || (linkedList = rr12.f35619d) == null)) {
                ArrayList arrayList2 = new ArrayList();
                for (T t15 : linkedList) {
                    if (t15.f40203f.contains(Integer.valueOf(this.f266438b))) {
                        arrayList2.add(t15);
                    }
                }
                Iterator it4 = arrayList2.iterator();
                while (it4.hasNext()) {
                    ArrayList<String> arrayList3 = this.f266447k;
                    String str2 = ((vr1) it4.next()).f40202e;
                    if (str2 == null) {
                        str2 = "";
                    }
                    arrayList3.add(str2);
                }
            }
            if (!this.f266447k.isEmpty()) {
                View findViewById2 = scrollView.findViewById(R.id.l1_);
                k30.a aVar3 = new k30.a();
                ThreadLocal<k30.a> threadLocal3 = k30.c.f244265a;
                aVar3.c(0);
                j30.a.d(findViewById2, aVar3.b(), "com/tencent/mm/plugin/finder/helper/FinderOriginSheetHelper", "initOriginType", "(Landroid/view/View;)V", "android/view/View_EXEC_", "setVisibility", "(I)V");
                findViewById2.setVisibility(((Integer) aVar3.a(0)).intValue());
                j30.a.e(findViewById2, "com/tencent/mm/plugin/finder/helper/FinderOriginSheetHelper", "initOriginType", "(Landroid/view/View;)V", "android/view/View_EXEC_", "setVisibility", "(I)V");
                findViewById2.setOnClickListener(new l(this));
                this.f266442f = (TextView) findViewById2.findViewById(R.id.l1a);
                e();
            }
            if (z15) {
                checkBox.setChecked(true);
                button.setEnabled(true);
            }
            com.google.android.material.bottomsheet.a aVar4 = new com.google.android.material.bottomsheet.a(this.f266437a, R.style.f24do);
            this.f266443g = aVar4;
            aVar4.setContentView(scrollView);
            ViewParent parent = scrollView.getParent();
            m.e(parent, "null cannot be cast to non-null type android.view.View");
            this.f266444h = BottomSheetBehavior.y((View) parent);
            com.google.android.material.bottomsheet.a aVar5 = this.f266443g;
            if (!(aVar5 == null || (window2 = aVar5.getWindow()) == null)) {
                window2.setDimAmount(0.5f);
            }
            com.google.android.material.bottomsheet.a aVar6 = this.f266443g;
            if (!(aVar6 == null || (window = aVar6.getWindow()) == null || (decorView = window.getDecorView()) == null)) {
                decorView.setBackgroundResource(R.drawable.ayr);
            }
            com.google.android.material.bottomsheet.a aVar7 = this.f266443g;
            if (aVar7 != null) {
                aVar7.setOnDismissListener(new a(this));
            }
            com.google.android.material.bottomsheet.a aVar8 = this.f266443g;
            if (aVar8 != null) {
                aVar8.setOnShowListener(new b(this));
            }
        }
        com.google.android.material.bottomsheet.a aVar9 = this.f266443g;
        if (aVar9 != null) {
            aVar9.show();
        }
    }
}