package com.tencent.mm.pluginsdk.ui.tools;

import android.net.Uri;
import android.view.View;
import android.view.View.OnClickListener;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.downloader.model.d;
import com.tencent.mm.plugin.downloader.model.e.a;
import com.tencent.mm.plugin.report.service.h;
import com.tencent.mm.pluginsdk.model.app.q;
import com.tencent.mm.pluginsdk.model.s;
import com.tencent.mm.pluginsdk.ui.tools.AppChooserUI.f;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.ytcommon.BuildConfig;
import java.io.File;

class AppChooserUI$4 implements OnClickListener {
    final /* synthetic */ AppChooserUI vty;

    AppChooserUI$4(AppChooserUI appChooserUI) {
        this.vty = appChooserUI;
    }

    public final void onClick(View view) {
        AppMethodBeat.i(125857);
        ab.i("MicroMsg.AppChooserUI", "mDownloadOnClickListener");
        if (AppChooserUI.a(this.vty) != null) {
            f fVar = AppChooserUI.a(this.vty).vtz;
            if (fVar == f.vtK) {
                if (AppChooserUI.b(this.vty) != null && AppChooserUI.b(this.vty).gLj.isShowing()) {
                    AppChooserUI.a(this.vty).vtz = f.vtL;
                    AppChooserUI.a(this.vty).notifyDataSetChanged();
                }
                a aVar = new a();
                if (AppChooserUI.f(this.vty) == 1) {
                    aVar.It("http://appchannel.html5.qq.com/directdown?app=qqbrowser&channel=10375");
                } else {
                    aVar.It(AppChooserUI.h(this.vty).anK());
                }
                aVar.Iv(AppChooserUI.h(this.vty).dgX());
                aVar.tN(1);
                aVar.ga(true);
                d.bij().a(aVar.kNl);
                s.dhn();
                s.Ku(AppChooserUI.g(this.vty));
                if (AppChooserUI.g(this.vty) == 0) {
                    if (AppChooserUI.i(this.vty)) {
                        h.pYm.e(11168, new Object[]{Integer.valueOf(4), Integer.valueOf(AppChooserUI.f(this.vty))});
                    } else {
                        h.pYm.e(11168, new Object[]{Integer.valueOf(3), Integer.valueOf(AppChooserUI.f(this.vty))});
                    }
                }
                if (AppChooserUI.g(this.vty) == 1) {
                    h.pYm.e(12809, new Object[]{Integer.valueOf(5), BuildConfig.FLAVOR});
                }
                AppMethodBeat.o(125857);
                return;
            } else if (fVar == f.vtM) {
                AppChooserUI appChooserUI = this.vty;
                long j = AppChooserUI.j(this.vty);
                ab.i("MicroMsg.AppChooserUI", "installRecommendApp");
                ab.d("MicroMsg.AppChooserUI", "filepath:%s", new Object[]{String.valueOf(d.bij().hm(j).path)});
                q.a(appChooserUI.mController.ylL, Uri.fromFile(new File(r1)), new AppChooserUI$7(appChooserUI));
            }
        }
        AppMethodBeat.o(125857);
    }
}
