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


package zs2;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Message;
import androidx.camera.core.FocusMeteringAction;
import bw3.c42;
import bw3.r04;
import com.tencent.mm.R;
import com.tencent.mm.plugin.readerapp.ui.ReaderAppSubscribeUI;
import com.tencent.mm.plugin.readerapp.ui.ReaderAppUI;
import com.tencent.mm.plugin.report.service.q;
import com.tencent.mm.pluginsdk.ui.preference.HelperHeaderPreference;
import com.tencent.mm.sdk.platformtools.Log;
import com.tencent.mm.sdk.platformtools.MMHandler;
import com.tencent.mm.sdk.platformtools.MultiProcessMMKV;
import com.tencent.mm.sdk.platformtools.Util;
import com.tencent.mm.sdk.storage.MStorageEx;
import com.tencent.mm.storage.w1;
import com.tencent.mm.storage.z1;
import com.tencent.mm.ui.base.preference.CheckBoxPreference;
import com.tencent.mm.ui.q1;
import d60.z;
import dn.h;
import eh0.i;
import eh0.p;
import i14.j;
import jh2.k0;
import junit.framework.Assert;
import k14.g;
import kh2.n;
import nf0.u0;
import nf0.w0;
import p64.i0;
import ys2.l;

public class b implements gu3.a, MStorageEx.IOnStorageChange {

    /* renamed from: d  reason: collision with root package name */
    public g f355375d;

    /* renamed from: e  reason: collision with root package name */
    public Context f355376e;

    /* renamed from: f  reason: collision with root package name */
    public z1 f355377f;

    /* renamed from: g  reason: collision with root package name */
    public boolean f355378g;

    /* renamed from: h  reason: collision with root package name */
    public boolean f355379h;

    /* renamed from: i  reason: collision with root package name */
    public long f355380i;

    public class a implements DialogInterface.OnClickListener {

        /* renamed from: zs2.b$a$a  reason: collision with other inner class name */
        public class C6635a implements l.c {

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

            public C6635a(a aVar, ProgressDialog progressDialog) {
                this.f355382a = progressDialog;
            }

            @Override // ys2.l.c
            public void a() {
                this.f355382a.dismiss();
            }

            @Override // ys2.l.c
            public boolean b() {
                return false;
            }
        }

        public a() {
        }

        public void onClick(DialogInterface dialogInterface, int i15) {
            Context context = b.this.f355376e;
            l.VN0(new C6635a(this, j.Q(context, "", context.getString(R.string.hrc), false, false, null)));
        }
    }

    /* renamed from: zs2.b$b  reason: collision with other inner class name */
    public class DialogInterface$OnClickListenerC6636b implements DialogInterface.OnClickListener {
        public DialogInterface$OnClickListenerC6636b() {
        }

        public void onClick(DialogInterface dialogInterface, int i15) {
            q.INSTANCE.g(15413, 4, "", "");
            b bVar = b.this;
            bVar.c(bVar.f355376e, false, null);
        }
    }

    public class c extends MMHandler {

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

        /* renamed from: b  reason: collision with root package name */
        public final /* synthetic */ Context f355385b;

        /* renamed from: c  reason: collision with root package name */
        public final /* synthetic */ q1 f355386c;

        public class a implements l.c {

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

            public a(c cVar, ProgressDialog progressDialog) {
                this.f355388a = progressDialog;
            }

            @Override // ys2.l.c
            public void a() {
                ProgressDialog progressDialog = this.f355388a;
                if (progressDialog != null) {
                    progressDialog.dismiss();
                }
            }

            @Override // ys2.l.c
            public boolean b() {
                return false;
            }
        }

        public c(boolean z15, Context context, q1 q1Var) {
            this.f355384a = z15;
            this.f355385b = context;
            this.f355386c = q1Var;
        }

        @Override // com.tencent.mm.sdk.platformtools.MMHandler
        public void handleMessage(Message message) {
            int i15;
            int n15 = u0.n();
            if (this.f355384a) {
                i15 = n15 & -524289;
            } else {
                i15 = n15 | 524288;
            }
            z.s().i().K(34, Integer.valueOf(i15));
            r04 r042 = new r04();
            r042.f34790d = 524288;
            r042.f34791e = !this.f355384a ? 1 : 0;
            ((p) ((k0) z.q(k0.class)).Na0()).h(new n(39, r042));
            if (!this.f355384a) {
                Context context = this.f355385b;
                l.VN0(new a(this, j.Q(context, "", context.getString(R.string.hrc), false, false, null)));
                b.b(false);
            } else {
                b.b(true);
                w0.s0(b.this.f355377f, true);
            }
            q1 q1Var = this.f355386c;
            if (q1Var != null) {
                q1Var.onNotifyChange(null, null);
            }
        }
    }

    public class d implements Runnable {

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

        /* renamed from: e  reason: collision with root package name */
        public final /* synthetic */ MMHandler f355390e;

        public d(b bVar, ProgressDialog progressDialog, MMHandler mMHandler) {
            this.f355389d = progressDialog;
            this.f355390e = mMHandler;
        }

        public void run() {
            ProgressDialog progressDialog = this.f355389d;
            if (progressDialog != null) {
                progressDialog.dismiss();
                this.f355390e.sendEmptyMessage(0);
            }
        }
    }

    public b(Context context) {
        this.f355376e = context;
    }

    public static void b(boolean z15) {
        int i15;
        int i16;
        int o15 = u0.o();
        if (z15) {
            i15 = o15 & -1025;
        } else {
            i15 = o15 | 1024;
        }
        z.s().i().K(40, Integer.valueOf(i15));
        if (z15) {
            i16 = 2;
        } else {
            i16 = 1;
        }
        ((p) ((k0) z.q(k0.class)).Na0()).h(new i(26, i16));
    }

    @Override // gu3.a
    public boolean I(g gVar, z1 z1Var, boolean z15, int i15) {
        Assert.assertTrue(gVar != null);
        Assert.assertTrue(z1Var != null);
        Assert.assertTrue(z1.G5(z1Var.getUsername()));
        z.s().i().add(this);
        this.f355377f = z1Var;
        this.f355375d = gVar;
        this.f355380i = u0.i();
        Context context = this.f355376e;
        if (context instanceof Activity) {
            q.INSTANCE.g(15413, 16, "", "", "", "", "", 0, 0, ((Activity) context).getIntent().getStringExtra("reportSessionId"));
        }
        d();
        return true;
    }

    @Override // gu3.a
    public boolean a(String str) {
        w1.a aVar = w1.a.f175164ap;
        if (Util.nullAsNil(str).length() <= 0) {
            return false;
        }
        if (str.equals("contact_info_readerappnews_view")) {
            Intent intent = new Intent(this.f355376e, ReaderAppUI.class);
            intent.putExtra("type", 20);
            intent.setFlags(67108864);
            Context context = this.f355376e;
            k30.a aVar2 = new k30.a();
            aVar2.c(intent);
            j30.a.d(context, aVar2.b(), "com/tencent/mm/plugin/readerapp/ui/ContactWidgetReaderAppNews", "gotoViewReaderapp", "()V", "Undefined", "startActivity", "(Landroid/content/Intent;)V");
            context.startActivity((Intent) aVar2.a(0));
            j30.a.e(context, "com/tencent/mm/plugin/readerapp/ui/ContactWidgetReaderAppNews", "gotoViewReaderapp", "()V", "Undefined", "startActivity", "(Landroid/content/Intent;)V");
            ((h) yz3.j.c(h.class)).Ev().tz();
            return true;
        } else if (str.equals("contact_info_readerappnews_subscribe")) {
            Intent intent2 = new Intent(this.f355376e, ReaderAppSubscribeUI.class);
            Context context2 = this.f355376e;
            k30.a aVar3 = new k30.a();
            aVar3.c(intent2);
            j30.a.d(context2, aVar3.b(), "com/tencent/mm/plugin/readerapp/ui/ContactWidgetReaderAppNews", "handleEvent", "(Ljava/lang/String;)Z", "Undefined", "startActivity", "(Landroid/content/Intent;)V");
            context2.startActivity((Intent) aVar3.a(0));
            j30.a.e(context2, "com/tencent/mm/plugin/readerapp/ui/ContactWidgetReaderAppNews", "handleEvent", "(Ljava/lang/String;)Z", "Undefined", "startActivity", "(Landroid/content/Intent;)V");
            return true;
        } else {
            if (str.equals("contact_info_readerappnews_help")) {
                Intent intent3 = new Intent();
                intent3.putExtra("rawUrl", "https://ifeedback.qq.com/platform/feedback?app_id=1078&uin=test");
                intent3.putExtra("geta8key_scene", 79);
                sv3.b.j(this.f355376e, "webview", ".ui.tools.WebViewUI", intent3, null);
            }
            if (str.equals("contact_info_readerappnews_clear_data")) {
                Context context3 = this.f355376e;
                j.A(context3, context3.getString(R.string.bcv), "", this.f355376e.getString(R.string.f367399sl), this.f355376e.getString(R.string.f367394sg), new a(), null);
                return true;
            } else if (str.equals("contact_info_readerappnews_recv_remind")) {
                CheckBoxPreference checkBoxPreference = (CheckBoxPreference) this.f355375d.a(str);
                boolean z15 = (u0.o() & 1024) == 0;
                if (!z15) {
                    q.INSTANCE.g(15413, 7, "", "");
                } else {
                    q.INSTANCE.g(15413, 6, "", "");
                }
                if (checkBoxPreference != null) {
                    checkBoxPreference.S(!z15);
                }
                b(!z15);
                return true;
            } else if (str.equals("contact_info_readerappnews_top")) {
                if (((CheckBoxPreference) this.f355375d.a(str)).R()) {
                    q.INSTANCE.g(15413, 13);
                    w0.n0("newsapp", true, true);
                    this.f355379h = true;
                } else {
                    q.INSTANCE.g(15413, 14);
                    w0.v0("newsapp", true);
                    this.f355379h = false;
                }
                if (this.f355379h) {
                    this.f355380i |= 8192;
                } else {
                    this.f355380i &= -8193;
                }
                z.s().i().L(aVar, Long.valueOf(this.f355380i));
                long j15 = this.f355380i;
                MultiProcessMMKV a15 = u60.d.f316491a.c().a();
                if (a15 != null) {
                    a15.encode("USERINFO_EXT_STATUS2_LONG_SYNC", j15);
                }
                Log.i("MicroMsg.LightPushKV", "saveConfig name = %s, value = %s", "USERINFO_EXT_STATUS2_LONG_SYNC", Long.valueOf(j15));
                int i15 = this.f355379h ? 1 : 2;
                c42 c422 = new c42();
                c422.f17931d = 82;
                c422.f17932e = i15;
                ((p) ((k0) z.q(k0.class)).Na0()).h(new n(23, c422));
                Log.i("MicroMsg.ContactWidgetReaderAppNews", "switch ext change : isTop open = " + this.f355379h + " item value = " + c422.f17932e + " functionId = " + c422.f17931d);
                return true;
            } else if (str.equals("contact_info_readerappnews_mute")) {
                CheckBoxPreference checkBoxPreference2 = (CheckBoxPreference) this.f355375d.a(str);
                if (w0.L(this.f355377f)) {
                    q.INSTANCE.g(15413, 11);
                    w0.s0(this.f355377f, true);
                    this.f355378g = false;
                } else {
                    q.INSTANCE.g(15413, 12);
                    w0.j0(this.f355377f, true);
                    this.f355378g = true;
                }
                if (this.f355378g) {
                    this.f355380i |= 4096;
                } else {
                    this.f355380i &= -4097;
                }
                z.s().i().L(aVar, Long.valueOf(this.f355380i));
                long j16 = this.f355380i;
                MultiProcessMMKV a16 = u60.d.f316491a.c().a();
                if (a16 != null) {
                    a16.encode("USERINFO_EXT_STATUS2_LONG_SYNC", j16);
                }
                Log.i("MicroMsg.LightPushKV", "saveConfig name = %s, value = %s", "USERINFO_EXT_STATUS2_LONG_SYNC", Long.valueOf(j16));
                int i16 = this.f355378g ? 1 : 2;
                c42 c423 = new c42();
                c423.f17931d = 81;
                c423.f17932e = i16;
                ((p) ((k0) z.q(k0.class)).Na0()).h(new n(23, c423));
                Log.i("MicroMsg.ContactWidgetReaderAppNews", "switch ext change : isMute open = " + this.f355378g + " item value = " + c423.f17932e + " functionId = " + c423.f17931d);
                return true;
            } else if (str.equals("contact_info_readerappnews_install")) {
                q.INSTANCE.g(15413, 5, "", "");
                c(this.f355376e, true, null);
                return true;
            } else if (str.equals("contact_info_readerappnews_uninstall")) {
                Context context4 = this.f355376e;
                j.A(context4, context4.getString(R.string.iws), "", this.f355376e.getString(R.string.f367399sl), this.f355376e.getString(R.string.f367394sg), new DialogInterface$OnClickListenerC6636b(), null);
                return true;
            } else {
                Log.e("MicroMsg.ContactWidgetReaderAppNews", "handleEvent : unExpected key = " + str);
                return false;
            }
        }
    }

    public void c(Context context, boolean z15, q1<z1> q1Var) {
        int i15;
        if (z15) {
            i15 = R.string.iwq;
        } else {
            i15 = R.string.iww;
        }
        i0 Q = j.Q(context, context.getString(R.string.f367625yv), context.getString(i15), true, true, null);
        c cVar = new c(z15, context, q1Var);
        ((xc4.j) xc4.j.f338034d).i(new d(this, Q, cVar), FocusMeteringAction.DEFAULT_AUTOCANCEL_DURATION);
    }

    public final void d() {
        int i15;
        boolean z15 = true;
        if ((u0.n() & 524288) == 0) {
            i15 = 1;
        } else {
            i15 = 0;
        }
        this.f355375d.removeAll();
        this.f355375d.b(R.xml.f370535z);
        HelperHeaderPreference helperHeaderPreference = (HelperHeaderPreference) this.f355375d.a("contact_info_header_helper");
        helperHeaderPreference.Q(this.f355377f.getUsername(), this.f355377f.f(), this.f355376e.getString(R.string.bgc));
        helperHeaderPreference.R(i15);
        CheckBoxPreference checkBoxPreference = (CheckBoxPreference) this.f355375d.a("contact_info_readerappnews_recv_remind");
        if ((u0.o() & 1024) != 0) {
            z15 = false;
        }
        if (checkBoxPreference != null) {
            checkBoxPreference.S(z15);
        }
        ((CheckBoxPreference) this.f355375d.a("contact_info_readerappnews_mute")).S(w0.L(this.f355377f));
        ((CheckBoxPreference) this.f355375d.a("contact_info_readerappnews_top")).S(this.f355377f.E3());
        if (i15 != 0) {
            this.f355375d.o("contact_info_readerappnews_install");
            return;
        }
        this.f355375d.o("contact_info_readerappnews_subscribe");
        this.f355375d.o("contact_info_readerappnews_view");
        this.f355375d.o("contact_info_readerappnews_help");
        this.f355375d.o("contact_info_readerappnews_clear_data");
        this.f355375d.o("contact_info_readerappnews_uninstall");
        this.f355375d.o("contact_info_readerappnews_recv_remind");
        this.f355375d.o("contact_info_readerappnews_mute");
        this.f355375d.o("contact_info_readerappnews_top");
    }

    @Override // gu3.a
    public void onActivityResult(int i15, int i16, Intent intent) {
    }

    @Override // gu3.a
    public boolean onDetach() {
        z.s().i().remove(this);
        ((h) yz3.j.c(h.class)).Ev().tz();
        return true;
    }

    @Override // com.tencent.mm.sdk.storage.MStorageEx.IOnStorageChange
    public void onNotifyChange(int i15, MStorageEx mStorageEx, Object obj) {
        int nullAsInt = Util.nullAsInt(obj, 0);
        if (mStorageEx != z.s().i() || nullAsInt <= 0) {
            Log.e("MicroMsg.ContactWidgetReaderAppNews", "onNotifyChange error obj:%d stg:%s", Integer.valueOf(nullAsInt), mStorageEx);
        } else if (nullAsInt == 40 || nullAsInt == 34 || nullAsInt == 7) {
            d();
        }
    }
}