package com.tencent.mm.plugin.webview.luggage.jsapi;

import android.os.Bundle;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.ai.b;
import com.tencent.mm.plugin.webview.luggage.jsapi.c.1.1;
import com.tencent.mm.plugin.webview.ui.tools.widget.n.a;
import com.tencent.mm.protocal.protobuf.avu;
import com.tencent.mm.protocal.protobuf.avv;
import com.tencent.mm.sdk.platformtools.ab;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;

class c$1$1$1 implements a {
    final /* synthetic */ 1 ujV;

    c$1$1$1(1 1) {
        this.ujV = 1;
    }

    public final void f(int i, Bundle bundle) {
        AppMethodBeat.i(6277);
        ab.i("MicroMsg.JsApiAuthorize", "stev onRevMsg resultCode %d", new Object[]{Integer.valueOf(i)});
        switch (i) {
            case 1:
            case 2:
                c cVar = this.ujV.ujU.ujR;
                String str = this.ujV.ujU.val$appId;
                com.tencent.luggage.d.a.a aVar = this.ujV.ujU.mUf;
                ArrayList arrayList = (ArrayList) bundle.getSerializable("key_scope");
                LinkedList linkedList = new LinkedList();
                Iterator it = arrayList.iterator();
                while (it.hasNext()) {
                    linkedList.add((String) it.next());
                }
                b.a aVar2 = new b.a();
                avu avu = new avu();
                aVar2.fsJ = avu;
                aVar2.fsK = new avv();
                aVar2.uri = "/cgi-bin/mmbiz-bin/js-authorize-confirm";
                aVar2.fsI = 1158;
                aVar2.fsL = 0;
                aVar2.fsM = 0;
                avu.fKh = str;
                avu.wzD = linkedList;
                avu.wzF = 0;
                avu.wzE = i;
                com.tencent.mm.ipcinvoker.wx_extension.b.a(aVar2.acD(), new c$2(cVar, aVar, i));
                if (i == 2) {
                    this.ujV.ujU.mUf.a("auth_deny", null);
                    AppMethodBeat.o(6277);
                    return;
                }
                break;
            default:
                ab.d("MicroMsg.JsApiAuthorize", "press back button!");
                this.ujV.ujU.mUf.a("auth_cancel", null);
                break;
        }
        AppMethodBeat.o(6277);
    }
}
