package com.tencent.mm.plugin.account.bind.ui;

import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import android.view.MenuItem.OnMenuItemClickListener;
import android.widget.EditText;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.kernel.g;
import com.tencent.mm.plugin.account.bind.a.b;
import com.tencent.mm.sdk.platformtools.bo;
import com.tencent.mm.ui.base.h;
import com.tencent.ytcommon.BuildConfig;
import java.lang.ref.WeakReference;

class VerifyQQUI$b implements OnMenuItemClickListener {
    WeakReference<VerifyQQUI> bSI;

    protected VerifyQQUI$b(VerifyQQUI verifyQQUI) {
        AppMethodBeat.i(13784);
        this.bSI = new WeakReference(verifyQQUI);
        AppMethodBeat.o(13784);
    }

    public final boolean onMenuItemClick(MenuItem menuItem) {
        AppMethodBeat.i(13785);
        VerifyQQUI verifyQQUI = (VerifyQQUI) this.bSI.get();
        if (verifyQQUI == null || verifyQQUI.isFinishing()) {
            AppMethodBeat.o(13785);
        } else {
            EditText editText = (EditText) verifyQQUI.findViewById(2131821783);
            String trim = ((EditText) verifyQQUI.findViewById(2131821782)).getText().toString().trim();
            VerifyQQUI.a(verifyQQUI, editText.getText().toString().trim());
            try {
                VerifyQQUI.a(verifyQQUI, bo.getLong(trim, 0));
                if (VerifyQQUI.c(verifyQQUI) < 10000) {
                    h.g(verifyQQUI.mController.ylL, 2131297618, 2131297616);
                    AppMethodBeat.o(13785);
                } else if (VerifyQQUI.d(verifyQQUI).equals(BuildConfig.FLAVOR)) {
                    h.g(verifyQQUI.mController.ylL, 2131297617, 2131297616);
                    AppMethodBeat.o(13785);
                } else {
                    verifyQQUI.aqX();
                    final b bVar = new b(VerifyQQUI.c(verifyQQUI), VerifyQQUI.d(verifyQQUI), BuildConfig.FLAVOR, BuildConfig.FLAVOR, BuildConfig.FLAVOR, VerifyQQUI.f(verifyQQUI), VerifyQQUI.g(verifyQQUI), false);
                    g.Rg().a(bVar, 0);
                    AppCompatActivity appCompatActivity = verifyQQUI.mController.ylL;
                    verifyQQUI.getString(2131297620);
                    VerifyQQUI.a(verifyQQUI, h.b(appCompatActivity, verifyQQUI.getString(2131297611), true, new OnCancelListener() {
                        public final void onCancel(DialogInterface dialogInterface) {
                            AppMethodBeat.i(13783);
                            g.Rg().c(bVar);
                            AppMethodBeat.o(13783);
                        }
                    }));
                    AppMethodBeat.o(13785);
                }
            } catch (Exception e) {
                h.g(verifyQQUI.mController.ylL, 2131297618, 2131297616);
                AppMethodBeat.o(13785);
            }
        }
        return true;
    }
}
