package com.tencent.mm.plugin.webview.ui.tools;

import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.model.gdpr.b;
import com.tencent.mm.plugin.webview.model.ag;
import com.tencent.mm.plugin.webview.ui.tools.SDKOAuthOtherUI.a;
import com.tencent.mm.protocal.protobuf.bew;
import com.tencent.mm.sdk.platformtools.ab;
import java.util.LinkedList;

class SDKOAuthOtherUI$4 implements b {
    final /* synthetic */ int ust;
    final /* synthetic */ int usu;
    final /* synthetic */ SDKOAuthOtherUI usw;
    final /* synthetic */ int usz;

    SDKOAuthOtherUI$4(SDKOAuthOtherUI sDKOAuthOtherUI, int i, int i2, int i3) {
        this.usw = sDKOAuthOtherUI;
        this.usz = i;
        this.ust = i2;
        this.usu = i3;
    }

    public final void kL(int i) {
        AppMethodBeat.i(7509);
        ab.i("MicroMsg.SDKOAuthOtherUI", " MPGdprPolicyUtil.checkPolicy onPermissionReturn:%d", new Object[]{Integer.valueOf(i)});
        if (i == 1) {
            SDKOAuthOtherUI.d(this.usw).IH(-4);
            AppMethodBeat.o(7509);
            return;
        }
        LinkedList linkedList;
        if (this.usz == 7) {
            a e = SDKOAuthOtherUI.e(this.usw);
            LinkedList linkedList2 = new LinkedList();
            int i2 = 0;
            while (true) {
                int i3 = i2;
                if (i3 >= e.usA.size()) {
                    break;
                }
                bew bew = (bew) e.usA.get(i3);
                if (bew.wIR == 2 || bew.wIR == 3) {
                    linkedList2.add(bew.scope);
                }
                i2 = i3 + 1;
            }
            linkedList = linkedList2;
        } else {
            linkedList = new LinkedList();
        }
        if (this.ust == -2 || this.usu == -2) {
            if (this.ust != -2) {
                if (this.ust == 8 && this.usz == 8) {
                    SDKOAuthOtherUI.d(this.usw).IH(-4);
                    AppMethodBeat.o(7509);
                } else if (this.ust == 7) {
                    SDKOAuthOtherUI.d(this.usw);
                    ag.a(SDKOAuthOtherUI.f(this.usw), linkedList);
                    if (SDKOAuthOtherUI.g(this.usw) == -1) {
                        ab.e("MicroMsg.SDKOAuthOtherUI", "btnCallback: do not get avatarId from pageone");
                    }
                    if (SDKOAuthOtherUI.h(this.usw)) {
                        SDKOAuthOtherUI.d(this.usw);
                        ag.a(linkedList, SDKOAuthOtherUI.g(this.usw), SDKOAuthOtherUI.i(this.usw));
                        AppMethodBeat.o(7509);
                        return;
                    }
                    SDKOAuthOtherUI.d(this.usw).h(linkedList, SDKOAuthOtherUI.g(this.usw));
                    AppMethodBeat.o(7509);
                } else if (SDKOAuthOtherUI.h(this.usw)) {
                    SDKOAuthOtherUI.d(this.usw);
                    ag.a(linkedList, SDKOAuthOtherUI.g(this.usw), SDKOAuthOtherUI.i(this.usw));
                    AppMethodBeat.o(7509);
                } else {
                    SDKOAuthOtherUI.d(this.usw).aB(linkedList);
                    AppMethodBeat.o(7509);
                }
            } else if (this.usu != -2) {
                if (this.usu == 8 && this.usz == 8) {
                    SDKOAuthOtherUI.d(this.usw).IH(-4);
                    AppMethodBeat.o(7509);
                    return;
                }
                if (this.usu == 7) {
                    linkedList.add("snsapi_friend");
                }
                SDKOAuthOtherUI.d(this.usw).aB(linkedList);
                AppMethodBeat.o(7509);
            } else if (this.usz == 8) {
                SDKOAuthOtherUI.d(this.usw).IH(-4);
                AppMethodBeat.o(7509);
            } else {
                SDKOAuthOtherUI.d(this.usw).aB(linkedList);
                AppMethodBeat.o(7509);
            }
        } else if (this.ust == 8 && this.usu == 8 && this.usz == 8) {
            SDKOAuthOtherUI.d(this.usw).IH(-4);
            AppMethodBeat.o(7509);
        } else {
            if (this.usu == 7) {
                linkedList.add("snsapi_friend");
            }
            if (this.ust == 7) {
                SDKOAuthOtherUI.d(this.usw);
                ag.a(SDKOAuthOtherUI.f(this.usw), linkedList);
                if (SDKOAuthOtherUI.g(this.usw) == -1) {
                    ab.e("MicroMsg.SDKOAuthOtherUI", "btnCallback: do not get avatarId from pageone");
                }
                if (SDKOAuthOtherUI.h(this.usw)) {
                    SDKOAuthOtherUI.d(this.usw);
                    ag.a(linkedList, SDKOAuthOtherUI.g(this.usw), SDKOAuthOtherUI.i(this.usw));
                    AppMethodBeat.o(7509);
                    return;
                }
                SDKOAuthOtherUI.d(this.usw).h(linkedList, SDKOAuthOtherUI.g(this.usw));
                AppMethodBeat.o(7509);
            } else if (SDKOAuthOtherUI.h(this.usw)) {
                SDKOAuthOtherUI.d(this.usw);
                ag.a(linkedList, 0, SDKOAuthOtherUI.i(this.usw));
                AppMethodBeat.o(7509);
            } else {
                SDKOAuthOtherUI.d(this.usw).aB(linkedList);
                AppMethodBeat.o(7509);
            }
        }
    }
}
