package com.kakao.usermgmt;

import X.0HH;
import X.2FV;
import X.2He;
import X.7s1;
import X.8jA;
import X.C5080LuJ;
import android.content.ClipboardManager;
import android.content.Context;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import java.lang.reflect.Field;

public class LoginButton$2 extends ArrayAdapter<LoginButton$Item> {
    public final /* synthetic */ C5080LuJ this$0;
    public final /* synthetic */ LoginButton$Item[] val$authItems;

    static {
        Covode.recordClassIndex(45921);
    }

    public static Object INVOKEVIRTUAL_com_kakao_usermgmt_LoginButton$2_com_ss_android_ugc_aweme_lancet_GetSystemServiceLancet_getSystemService(Context context, String str) {
        Object obj;
        MethodCollector.i(6423);
        if (Build.VERSION.SDK_INT > 27 || !"clipboard".equals(str)) {
            if (!2FV.LIZIZ && "connectivity".equals(str)) {
                try {
                    new 7s1().LIZ();
                    2FV.LIZIZ = true;
                    obj = context.getSystemService(str);
                } catch (Throwable unused) {
                }
            }
            obj = context.getSystemService(str);
        } else if (2FV.LIZ) {
            synchronized (ClipboardManager.class) {
                try {
                    obj = context.getSystemService(str);
                    if (Thread.currentThread() != Looper.getMainLooper().getThread()) {
                        Field declaredField = ClipboardManager.class.getDeclaredField("mHandler");
                        declaredField.setAccessible(true);
                        declaredField.set(obj, new 2He((Handler) declaredField.get(obj)));
                    }
                } catch (Exception e) {
                    8jA.LIZ(e, "ClipboardManager Handler Reflect Fail");
                } catch (Throwable th) {
                    MethodCollector.o(6423);
                    throw th;
                }
                2FV.LIZ = false;
            }
        } else {
            obj = context.getSystemService(str);
        }
        MethodCollector.o(6423);
        return obj;
    }

    public View getView(int i, View view, ViewGroup viewGroup) {
        if (view == null) {
            view = 0HH.LIZ((LayoutInflater) INVOKEVIRTUAL_com_kakao_usermgmt_LoginButton$2_com_ss_android_ugc_aweme_lancet_GetSystemServiceLancet_getSystemService(getContext(), "layout_inflater"), 2131560418, viewGroup, false);
        }
        ((ImageView) view.findViewById(2131367463)).setImageDrawable(this.this$0.getResources().getDrawable(this.val$authItems[i].icon, getContext().getTheme()));
        ((TextView) view.findViewById(2131367465)).setText(this.val$authItems[i].textId);
        return view;
    }

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    public LoginButton$2(C5080LuJ luJ, Context context, int i, int i2, LoginButton$Item[] loginButton$ItemArr, LoginButton$Item[] loginButton$ItemArr2) {
        super(context, i, i2, loginButton$ItemArr);
        this.this$0 = luJ;
        this.val$authItems = loginButton$ItemArr2;
    }
}
