package com.tencent.mm.plugin.soter.ui;

import android.annotation.TargetApi;
import android.os.Handler;
import android.os.Message;
import android.support.v7.app.b;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.soter.d.k;
import com.tencent.mm.sdk.platformtools.ab;
import java.lang.ref.WeakReference;

public class SoterAuthenticationUI$a extends Handler {
    private WeakReference<SoterAuthenticationUI> lWJ;

    /* synthetic */ SoterAuthenticationUI$a(SoterAuthenticationUI soterAuthenticationUI, byte b) {
        this(soterAuthenticationUI);
    }

    private SoterAuthenticationUI$a(SoterAuthenticationUI soterAuthenticationUI) {
        AppMethodBeat.i(73897);
        this.lWJ = null;
        this.lWJ = new WeakReference(soterAuthenticationUI);
        AppMethodBeat.o(73897);
    }

    @TargetApi(23)
    public final void handleMessage(Message message) {
        AppMethodBeat.i(73898);
        super.handleMessage(message);
        k kVar;
        switch (message.what) {
            case 0:
                ab.i("MicroMsg.SoterAuthenticationUI", "hy: inform ok");
                kVar = (k) message.obj;
                if (this.lWJ == null || this.lWJ.get() == null) {
                    ab.w("MicroMsg.SoterAuthenticationUI", "hy: ui cleared");
                    AppMethodBeat.o(73898);
                    return;
                }
                SoterAuthenticationUI.a((SoterAuthenticationUI) this.lWJ.get(), kVar);
                AppMethodBeat.o(73898);
                return;
            case 1:
                ab.i("MicroMsg.SoterAuthenticationUI", "hy: inform cancel");
                kVar = (k) message.obj;
                if (this.lWJ == null || this.lWJ.get() == null) {
                    ab.w("MicroMsg.SoterAuthenticationUI", "hy: ui cleared");
                    AppMethodBeat.o(73898);
                    return;
                }
                SoterAuthenticationUI.b((SoterAuthenticationUI) this.lWJ.get(), kVar);
                AppMethodBeat.o(73898);
                return;
            case 2:
                ab.i("MicroMsg.SoterAuthenticationUI", "hy: inform fail");
                kVar = (k) message.obj;
                if (this.lWJ == null || this.lWJ.get() == null) {
                    ab.w("MicroMsg.SoterAuthenticationUI", "hy: ui cleared");
                    AppMethodBeat.o(73898);
                    return;
                }
                SoterAuthenticationUI.c((SoterAuthenticationUI) this.lWJ.get(), kVar);
                AppMethodBeat.o(73898);
                return;
            case 3:
                ab.i("MicroMsg.SoterAuthenticationUI", "hy: request permission");
                if (this.lWJ == null || this.lWJ.get() == null) {
                    ab.w("MicroMsg.SoterAuthenticationUI", "hy: ui cleared");
                    AppMethodBeat.o(73898);
                    return;
                }
                String[] stringArray = message.getData().getStringArray("permissions");
                int i = message.getData().getInt("request_code");
                if (stringArray == null || stringArray.length <= 1) {
                    ab.e("MicroMsg.SoterAuthenticationUI", "hy: permission null");
                    AppMethodBeat.o(73898);
                    return;
                }
                ((SoterAuthenticationUI) this.lWJ.get()).requestPermissions(stringArray, i);
                AppMethodBeat.o(73898);
                return;
            case 4:
                ab.i("MicroMsg.SoterAuthenticationUI", "hy: show progress");
                if (this.lWJ == null || this.lWJ.get() == null) {
                    ab.w("MicroMsg.SoterAuthenticationUI", "hy: ui cleared");
                    AppMethodBeat.o(73898);
                    return;
                }
                SoterAuthenticationUI.a((SoterAuthenticationUI) this.lWJ.get());
                AppMethodBeat.o(73898);
                return;
            case 5:
                ab.i("MicroMsg.SoterAuthenticationUI", "hy: dismiss progress");
                if (this.lWJ == null || this.lWJ.get() == null) {
                    ab.w("MicroMsg.SoterAuthenticationUI", "hy: ui cleared");
                    AppMethodBeat.o(73898);
                    return;
                }
                SoterAuthenticationUI.b((SoterAuthenticationUI) this.lWJ.get());
                AppMethodBeat.o(73898);
                return;
            case 6:
                ab.i("MicroMsg.SoterAuthenticationUI", "hy: show dialog");
                if (this.lWJ == null || this.lWJ.get() == null) {
                    ab.w("MicroMsg.SoterAuthenticationUI", "hy: ui cleared");
                    AppMethodBeat.o(73898);
                    return;
                }
                SoterAuthenticationUI.b((b) message.obj);
                AppMethodBeat.o(73898);
                return;
            default:
                ab.e("MicroMsg.SoterAuthenticationUI", "hy: unidentified msg: %d", new Object[]{Integer.valueOf(message.what)});
                AppMethodBeat.o(73898);
                return;
        }
    }

    static /* synthetic */ void a(SoterAuthenticationUI$a soterAuthenticationUI$a) {
        AppMethodBeat.i(73899);
        if (soterAuthenticationUI$a.lWJ != null) {
            soterAuthenticationUI$a.lWJ.clear();
        }
        AppMethodBeat.o(73899);
    }
}
