APK反编译源代码展示 - 南明离火平台提供

应用版本信息
应用名称:Caller ID
版本号:1.8.3
包名称:com.callerid.block

MD5 校验值:5ef3f775189f42f146cf0788a99eebd7

反编译源代码说明

EZCallLogFragment.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。


package com.callerid.block.fragment;

import a4.d;
import android.annotation.SuppressLint;
import android.app.role.RoleManager;
import android.content.BroadcastReceiver;
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Typeface;
import android.graphics.drawable.ColorDrawable;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.preference.PreferenceManager;
import android.provider.ContactsContract;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.text.Spannable;
import android.text.style.ForegroundColorSpan;
import android.text.style.StyleSpan;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewStub;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.inputmethod.InputMethodManager;
import android.widget.AbsListView;
import android.widget.AdapterView;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.PopupWindow;
import android.widget.ProgressBar;
import android.widget.ResourceCursorAdapter;
import android.widget.TextView;
import android.widget.Toast;
import androidx.fragment.app.Fragment;
import com.callerid.block.R;
import com.callerid.block.bean.EZBlackList;
import com.callerid.block.bean.EZSearchContacts;
import com.callerid.block.customview.EZKeyboardView;
import com.callerid.block.customview.LImageButton;
import com.callerid.block.customview.ObservableListView;
import com.callerid.block.fragment.EZCallLogFragment;
import com.callerid.block.main.EZCallApplication;
import com.callerid.block.main.MainActivity;
import com.callerid.block.mvc.controller.ContactActivity;
import com.callerid.block.mvc.controller.UnknownContactActivity;
import com.callerid.block.search.CallLogBean;
import com.github.clans.fab.FloatingActionButton;
import com.google.android.gms.ads.a;
import com.google.android.gms.ads.b;
import com.google.android.gms.ads.nativead.NativeAdView;
import com.google.android.gms.ads.nativead.a;
import com.hzy.lib7z.ErrorCode;
import com.rey.material.app.Dialog;
import com.rey.material.app.SimpleDialog;
import f5.r;
import fydialer.ContactAccessor;
import fydialer.IContactSplit;
import java.lang.ref.WeakReference;
import java.text.Collator;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import org.json.JSONArray;
import org.json.JSONObject;
import u5.a;
import y3.r1;
import y3.s1;

public class EZCallLogFragment extends Fragment implements View.OnClickListener {
    private static boolean G1 = false;
    private static boolean H1;
    private static boolean I1;
    private static boolean J1;
    private static boolean K1;
    private static boolean L1;
    private static final StyleSpan M1 = new StyleSpan(2);
    private static final StyleSpan N1 = new StyleSpan(1);
    private static ForegroundColorSpan O1;
    private static final Collator P1;
    private static final String[] Q1;
    private FloatingActionButton A0;
    private int A1;
    private boolean B0;
    private HashMap<String, Integer> B1;
    private Typeface C0;
    private int C1;
    private LinearLayout D0;
    public int D1;
    private FrameLayout E0;
    private TextView F0;
    private ImageView G0;
    private int I0;
    private int J0;
    private boolean L0;
    private int M0;
    private com.google.android.gms.ads.a N0;
    private FrameLayout P0;
    private MainActivity Q0;
    private Context R0;
    private Timer S0;
    public int T0;
    private Animation V0;
    private LinearLayout W0;
    private b4.d X0;
    private ViewStub Y0;
    private ViewStub Z0;

    private com.rey.material.widget.TextView f7048a1;

    private com.rey.material.widget.TextView f7049b1;

    private com.rey.material.widget.TextView f7050c1;

    private com.rey.material.widget.TextView f7051d1;

    private com.rey.material.widget.TextView f7052e1;

    private com.rey.material.widget.TextView f7053f1;

    private com.rey.material.widget.TextView f7054g1;

    private Typeface f7055h1;

    public EZKeyboardView f7056i1;

    public ContactAccessor f7057j1;

    private StringBuilder f7058k1;

    private String f7061n1;

    private i f7062o1;

    private ObservableListView f7063p0;

    public ListView f7064p1;

    private z2.u f7065q0;

    private int f7066q1;

    private int f7068r1;

    private int f7070s1;

    public FloatingActionButton f7072t1;

    private LImageButton f7074u1;

    private LImageButton f7076v1;

    private l f7077w0;

    private LImageButton f7078w1;

    private PopupWindow f7079x0;

    private ProgressBar f7081y0;

    SubscriptionManager f7082y1;

    private TextView f7083z0;

    private List<CallLogBean> f7067r0 = new ArrayList();

    private final List<CallLogBean> f7069s0 = new ArrayList();

    private List<String> f7071t0 = new ArrayList();

    private final List<String> f7073u0 = new ArrayList();

    private HashMap<String, Integer> f7075v0 = new HashMap<>();
    private boolean H0 = false;
    private final ArrayList<CallLogBean> K0 = new ArrayList<>();
    private final k O0 = new k(this);
    private TimerTask U0 = new b();

    private final Handler f7059l1 = new Handler();

    private final o f7060m1 = new o();

    List<SubscriptionInfo> f7080x1 = new ArrayList();

    private final AbsListView.OnScrollListener f7084z1 = new e();
    private final Handler E1 = new Handler();
    private final Runnable F1 = new Runnable() {
        @Override
        public final void run() {
            EZCallLogFragment.F3();
        }
    };

    public class AnonymousClass6 extends SimpleDialog.Builder {
        final CallLogBean A;
        final EZCallLogFragment B;

        public void t() {
            this.B.r3();
        }

        @Override
        public void a(com.rey.material.app.a aVar) {
            super.a(aVar);
        }

        @Override
        public void f(com.rey.material.app.a aVar) {
            i3.g.d(EZCallApplication.d(), this.A.o(), this.A.J(), new i3.f() {
                @Override
                public final void a() {
                    EZCallLogFragment.AnonymousClass6.this.t();
                }
            });
            super.f(aVar);
        }

        @Override
        protected void j(Dialog dialog) {
            try {
                if (this.B.i0()) {
                    dialog.K(-1, -2);
                    dialog.q(EZCallApplication.d().getResources().getColor(R.color.colorPrimary), EZCallApplication.d().getResources().getColor(R.color.btn_gray));
                    dialog.r0(y3.n1.c());
                }
            } catch (Exception e10) {
                e10.printStackTrace();
            }
        }
    }

    public class AnonymousClass9 extends SimpleDialog.Builder {
        AnonymousClass9(int i10) {
            super(i10);
        }

        public void t() {
            try {
                EZCallLogFragment.this.f7083z0.setText(EZCallLogFragment.this.T().getString(R.string.call_history));
                EZCallLogFragment.this.f7069s0.clear();
                EZCallLogFragment.this.r3();
                EZCallLogFragment.this.f7081y0.setVisibility(8);
                Toast.makeText(EZCallApplication.d(), EZCallLogFragment.this.T().getString(R.string.delete_success), 0).show();
            } catch (Exception e10) {
                e10.printStackTrace();
            }
        }

        @Override
        public void a(com.rey.material.app.a aVar) {
            super.a(aVar);
        }

        @Override
        public void f(com.rey.material.app.a aVar) {
            if (EZCallLogFragment.this.i0()) {
                EZCallLogFragment.this.f7081y0.setVisibility(0);
                i3.g.a(EZCallApplication.d(), EZCallLogFragment.this.f7069s0, new i3.f() {
                    @Override
                    public final void a() {
                        EZCallLogFragment.AnonymousClass9.this.t();
                    }
                });
            }
            super.f(aVar);
        }

        @Override
        protected void j(Dialog dialog) {
            try {
                if (EZCallLogFragment.this.i0()) {
                    dialog.K(-1, -2);
                    dialog.r0(y3.n1.c());
                }
            } catch (Exception e10) {
                e10.printStackTrace();
            }
        }
    }

    public class a implements g3.b {
        a() {
        }

        @Override
        public void a(boolean z10) {
            if (z10) {
                try {
                    if (EZCallLogFragment.this.f7067r0 != null && EZCallLogFragment.this.f7067r0.size() > 3 && !"callog_ad".equals(((CallLogBean) EZCallLogFragment.this.f7067r0.get(2)).o())) {
                        CallLogBean callLogBean = new CallLogBean();
                        callLogBean.B0("callog_ad");
                        EZCallLogFragment.this.f7067r0.add(2, callLogBean);
                    }
                    if (EZCallLogFragment.this.f7067r0 != null && EZCallLogFragment.this.f7067r0.size() > 9 && !"callog_ad".equals(((CallLogBean) EZCallLogFragment.this.f7067r0.get(8)).o())) {
                        CallLogBean callLogBean2 = new CallLogBean();
                        callLogBean2.B0("callog_ad");
                        EZCallLogFragment.this.f7067r0.add(8, callLogBean2);
                    }
                    EZCallLogFragment.this.f7065q0.notifyDataSetChanged();
                } catch (Exception e10) {
                    e10.printStackTrace();
                }
            }
        }
    }

    class b extends TimerTask {
        b() {
        }

        @Override
        public void run() {
            EZCallLogFragment.this.x3();
        }
    }

    class c implements AbsListView.OnScrollListener {
        c() {
        }

        @Override
        public void onScroll(AbsListView absListView, int i10, int i11, int i12) {
            if (i10 > EZCallLogFragment.this.I0) {
                if (EZCallLogFragment.this.A0 != null && !EZCallLogFragment.this.A0.y()) {
                    EZCallLogFragment.this.A0.u(true);
                }
            } else if (i10 < EZCallLogFragment.this.I0 && EZCallLogFragment.this.A0 != null && EZCallLogFragment.this.A0.y()) {
                EZCallLogFragment.this.A0.H(true);
            }
            EZCallLogFragment.this.I0 = i10;
            EZCallLogFragment.this.J0 = i11;
        }

        @Override
        public void onScrollStateChanged(AbsListView absListView, int i10) {
            if (i10 != 0) {
                return;
            }
            EZCallLogFragment eZCallLogFragment = EZCallLogFragment.this;
            eZCallLogFragment.b4(eZCallLogFragment.I0, EZCallLogFragment.this.J0);
        }
    }

    public class d extends f5.b {
        d() {
        }

        @Override
        public void l() {
            super.l();
        }

        @Override
        public void m(f5.g gVar) {
            super.m(gVar);
            if (y3.a0.f34733a) {
                y3.a0.a("admob", "Top_onAdFailedToLoad:" + gVar.toString());
            }
            if (EZCallLogFragment.u2(EZCallLogFragment.this) >= 1 || EZCallLogFragment.this.N0 == null) {
                return;
            }
            EZCallLogFragment.this.N0.a(new b.a().c());
        }

        @Override
        public void x() {
            super.x();
            if (y3.a0.f34733a) {
                y3.a0.a("admob", "Top_onAdLoaded");
            }
        }

        @Override
        public void y() {
            super.y();
        }
    }

    class e implements AbsListView.OnScrollListener {
        e() {
        }

        @Override
        public void onScroll(AbsListView absListView, int i10, int i11, int i12) {
        }

        @Override
        public void onScrollStateChanged(AbsListView absListView, int i10) {
            if (i10 == 2) {
                try {
                    if (EZCallLogFragment.L1 && EZCallLogFragment.this.f7056i1.getVisibility() == 0) {
                        EZCallLogFragment eZCallLogFragment = EZCallLogFragment.this;
                        eZCallLogFragment.f7072t1.setImageResource(eZCallLogFragment.f7068r1);
                        EZCallLogFragment.this.k4();
                        if (EZCallLogFragment.this.f7074u1 != null) {
                            EZCallLogFragment.this.f7074u1.setVisibility(8);
                        }
                        if (EZCallLogFragment.this.f7076v1 != null) {
                            EZCallLogFragment.this.f7076v1.setVisibility(8);
                        }
                        if (EZCallLogFragment.this.f7078w1 != null) {
                            EZCallLogFragment.this.f7078w1.setVisibility(8);
                        }
                    }
                } catch (Exception e10) {
                    e10.printStackTrace();
                }
            }
        }
    }

    class f extends TimerTask {
        f() {
        }

        @Override
        public void run() {
            EZCallLogFragment.this.x3();
        }
    }

    class g implements d.f {
        g() {
        }

        @Override
        public void a() {
            EZCallLogFragment.this.o3();
        }

        @Override
        public void b() {
            com.hjq.permissions.f.a(EZCallLogFragment.this.Q0);
        }
    }

    public static class h extends AsyncTask<Void, Void, Void> {

        private final WeakReference<EZCallLogFragment> f7092a;

        h(EZCallLogFragment eZCallLogFragment) {
            this.f7092a = new WeakReference<>(eZCallLogFragment);
        }

        @Override
        public Void doInBackground(Void... voidArr) {
            try {
                EZCallLogFragment eZCallLogFragment = this.f7092a.get();
                if (eZCallLogFragment == null || eZCallLogFragment.f7067r0 == null || eZCallLogFragment.f7067r0.size() <= 0 || eZCallLogFragment.K0 == null) {
                    return null;
                }
                Iterator it = eZCallLogFragment.f7067r0.iterator();
                while (it.hasNext()) {
                    ((CallLogBean) it.next()).M0(false);
                }
                eZCallLogFragment.K0.clear();
                return null;
            } catch (Exception e10) {
                e10.printStackTrace();
                return null;
            }
        }

        @Override
        public void onPostExecute(Void r12) {
            super.onPostExecute(r12);
            EZCallLogFragment eZCallLogFragment = this.f7092a.get();
            if (eZCallLogFragment != null) {
                eZCallLogFragment.f7065q0.notifyDataSetChanged();
            }
        }
    }

    public class i extends ResourceCursorAdapter {

        IContactSplit f7093a;

        private final Context f7094b;

        i(Context context, Cursor cursor, IContactSplit iContactSplit) {
            super(context, R.layout.contacts_list_item, cursor, false);
            this.f7093a = iContactSplit;
            this.f7094b = context;
        }

        public void c(View view, View view2) {
            int intValue = ((Integer) view2.getTag()).intValue();
            EZCallLogFragment.this.f7064p1.performItemClick(view, intValue, getItemId(intValue));
        }

        @Override
        public String convertToString(Cursor cursor) {
            return cursor.getString(2);
        }

        @Override
        public void bindView(View view, Context context, Cursor cursor) {
            try {
                j jVar = (j) view.getTag();
                String string = cursor.getString(2);
                String string2 = cursor.getString(3);
                jVar.f7096a.setText(string, TextView.BufferType.SPANNABLE);
                jVar.f7098c.setText(string2, TextView.BufferType.SPANNABLE);
                EZCallLogFragment.q3((Spannable) jVar.f7096a.getText(), EZCallLogFragment.this.f7061n1);
                EZCallLogFragment.q3((Spannable) jVar.f7098c.getText(), EZCallLogFragment.this.f7061n1);
                String replace = cursor.getString(3).replace(" ", "");
                jVar.f7097b.setTag(replace);
                jVar.f7099d = this.f7093a.getLookupUri(cursor);
                jVar.f7100e.setVisibility(0);
                try {
                    if ("".equals(replace) || replace.length() <= 0) {
                        EZCallLogFragment eZCallLogFragment = EZCallLogFragment.this;
                        eZCallLogFragment.C1 = eZCallLogFragment.A1;
                    } else {
                        Integer num = (Integer) EZCallLogFragment.this.B1.get(String.valueOf(replace.charAt(replace.length() - 1)));
                        if (num != null) {
                            EZCallLogFragment.this.C1 = num.intValue();
                        }
                    }
                } catch (Exception e10) {
                    e10.printStackTrace();
                }
                com.bumptech.glide.b.u(this.f7094b).q(jVar.f7099d).U(EZCallLogFragment.this.C1).c().w0(jVar.f7100e);
            } catch (Exception e11) {
                e11.printStackTrace();
            }
        }

        @Override
        public View newView(Context context, Cursor cursor, ViewGroup viewGroup) {
            EZCallLogFragment.this.A1 = y3.k1.b(this.f7094b, R.attr.attr_xin_icon_1, R.drawable.xin_icon_1);
            int b10 = y3.k1.b(this.f7094b, R.attr.attr_xin_icon_2, R.drawable.xin_icon_2);
            int b11 = y3.k1.b(this.f7094b, R.attr.attr_xin_icon_3, R.drawable.xin_icon_3);
            int b12 = y3.k1.b(this.f7094b, R.attr.attr_xin_icon_4, R.drawable.xin_icon_4);
            int b13 = y3.k1.b(this.f7094b, R.attr.attr_xin_icon_5, R.drawable.xin_icon_5);
            int b14 = y3.k1.b(this.f7094b, R.attr.attr_xin_icon_6, R.drawable.xin_icon_6);
            int b15 = y3.k1.b(this.f7094b, R.attr.attr_xin_icon_7, R.drawable.xin_icon_7);
            int b16 = y3.k1.b(this.f7094b, R.attr.attr_xin_icon_8, R.drawable.xin_icon_8);
            int b17 = y3.k1.b(this.f7094b, R.attr.attr_xin_icon_9, R.drawable.xin_icon_9);
            EZCallLogFragment.this.B1 = new HashMap();
            EZCallLogFragment.this.B1.put("0", Integer.valueOf(EZCallLogFragment.this.A1));
            EZCallLogFragment.this.B1.put("1", Integer.valueOf(EZCallLogFragment.this.A1));
            EZCallLogFragment.this.B1.put("2", Integer.valueOf(b10));
            EZCallLogFragment.this.B1.put("3", Integer.valueOf(b11));
            EZCallLogFragment.this.B1.put("4", Integer.valueOf(b12));
            EZCallLogFragment.this.B1.put("5", Integer.valueOf(b13));
            EZCallLogFragment.this.B1.put("6", Integer.valueOf(b14));
            EZCallLogFragment.this.B1.put("7", Integer.valueOf(b15));
            EZCallLogFragment.this.B1.put("8", Integer.valueOf(b16));
            EZCallLogFragment.this.B1.put("9", Integer.valueOf(b17));
            final View newView = super.newView(context, cursor, viewGroup);
            j jVar = new j();
            jVar.f7096a = (TextView) newView.findViewById(R.id.name);
            ImageView imageView = (ImageView) newView.findViewById(R.id.call_button);
            jVar.f7097b = imageView;
            if (imageView != null) {
                imageView.setOnClickListener(EZCallLogFragment.this.Q0);
            }
            jVar.f7098c = (TextView) newView.findViewById(R.id.data);
            jVar.f7100e = (ImageView) newView.findViewById(R.id.photoview);
            jVar.f7101f = (ImageView) newView.findViewById(R.id.ripple_bg);
            jVar.f7098c.setTypeface(EZCallLogFragment.this.C0);
            newView.setTag(jVar);
            jVar.f7101f.setTag(Integer.valueOf(cursor.getPosition()));
            jVar.f7101f.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    EZCallLogFragment.i.this.c(newView, view);
                }
            });
            return newView;
        }
    }

    public static final class j {

        TextView f7096a;

        ImageView f7097b;

        TextView f7098c;

        Uri f7099d;

        ImageView f7100e;

        ImageView f7101f;

        j() {
        }
    }

    public static class k extends Handler {

        WeakReference<EZCallLogFragment> f7102a;

        k(EZCallLogFragment eZCallLogFragment) {
            this.f7102a = new WeakReference<>(eZCallLogFragment);
        }

        @Override
        public void handleMessage(Message message) {
            super.handleMessage(message);
            try {
                EZCallLogFragment eZCallLogFragment = this.f7102a.get();
                if (eZCallLogFragment != null) {
                    int i10 = message.what;
                    if (i10 != 15001) {
                        if (i10 == 15002 && eZCallLogFragment.f7067r0.size() > 0) {
                            eZCallLogFragment.f7065q0.notifyDataSetChanged();
                            eZCallLogFragment.h3();
                        }
                    } else if (eZCallLogFragment.f7067r0.size() > 0) {
                        eZCallLogFragment.f7065q0.notifyDataSetChanged();
                        eZCallLogFragment.a4();
                    }
                }
            } catch (Exception e10) {
                e10.printStackTrace();
            }
        }
    }

    private class l extends BroadcastReceiver {
        private l() {
        }

        l(EZCallLogFragment eZCallLogFragment, a aVar) {
            this();
        }

        @Override
        public void onReceive(Context context, Intent intent) {
            if ("com.callerid.block.RELOAD_DATA_VEST".equals(intent.getAction())) {
                if (y3.a0.f34733a) {
                    y3.a0.a("tony", "reload_data_vest");
                }
                EZCallLogFragment.this.r3();
            }
            if ("com.callerid.block.CLOSE_AD_VEST".equals(intent.getAction())) {
                if (EZCallLogFragment.this.P0 != null) {
                    EZCallLogFragment.this.P0.setVisibility(8);
                }
                EZCallLogFragment.this.r3();
            }
        }
    }

    public static class m extends AsyncTask<Object, Void, Object> {

        String f7104a;

        WeakReference<EZCallLogFragment> f7105b;

        m(EZCallLogFragment eZCallLogFragment, String str) {
            this.f7105b = new WeakReference<>(eZCallLogFragment);
            this.f7104a = str;
        }

        @Override
        public Cursor doInBackground(Object[] objArr) {
            EZCallLogFragment eZCallLogFragment = this.f7105b.get();
            if (eZCallLogFragment == null) {
                return null;
            }
            try {
                return eZCallLogFragment.f7057j1.recalculate(this.f7104a, EZCallLogFragment.H1);
            } catch (Exception e10) {
                e10.printStackTrace();
                return null;
            }
        }

        @Override
        protected void onPostExecute(Object obj) {
            super.onPostExecute(obj);
            EZCallLogFragment eZCallLogFragment = this.f7105b.get();
            if (eZCallLogFragment != null) {
                eZCallLogFragment.l4((Cursor) obj);
            }
        }
    }

    public static class n extends AsyncTask<Object, Void, Object> {

        WeakReference<EZCallLogFragment> f7106a;

        private final List<String> f7107b;

        private final boolean f7108c;

        n(EZCallLogFragment eZCallLogFragment, List<String> list, boolean z10) {
            this.f7106a = new WeakReference<>(eZCallLogFragment);
            this.f7107b = list;
            this.f7108c = z10;
        }

        @Override
        protected Object doInBackground(Object[] objArr) {
            String b10;
            EZCallLogFragment eZCallLogFragment = this.f7106a.get();
            if (eZCallLogFragment == null) {
                return null;
            }
            EZCallApplication d10 = EZCallApplication.d();
            String country_code = y3.l.f(d10).getCountry_code();
            String str = "";
            if (!y3.d.d(EZCallApplication.d())) {
                w3.h.c(eZCallLogFragment.f7067r0, country_code);
                return "";
            }
            try {
                String jSONArray = new JSONArray((Collection) this.f7107b).toString();
                if (y3.a0.f34733a) {
                    y3.a0.c("searchList", "tel_number_list:" + jSONArray);
                }
                String c10 = y3.u.c(jSONArray);
                String H = r1.H(d10);
                String J = r1.J(d10);
                List<String> list = this.f7107b;
                String D = r1.D(d10, list.get(list.size() - 1));
                HashMap hashMap = new HashMap();
                hashMap.put("tel_number_list", c10);
                hashMap.put("device", "android");
                hashMap.put("uid", H);
                hashMap.put("version", J);
                hashMap.put("default_cc", country_code);
                hashMap.put("cc", country_code);
                hashMap.put("stamp", D);
                String b11 = y3.w.b("https://app.ayamote.com/api/v1/sealis.php", hashMap, "utf-8");
                if (y3.a0.f34733a) {
                    y3.a0.a("searchList", "result:" + b11);
                }
                b10 = y3.u.b(b11);
            } catch (Exception e10) {
                e = e10;
            }
            try {
                if (y3.a0.f34733a) {
                    y3.a0.c("searchList", "enlode_result:" + b10);
                }
                if (b10 == null || "".equals(b10)) {
                    eZCallLogFragment.j4();
                    return b10;
                }
                ArrayList arrayList = new ArrayList();
                JSONObject jSONObject = new JSONObject(b10);
                if (jSONObject.getInt("status") == 1) {
                    JSONArray jSONArray2 = new JSONArray(jSONObject.getString("list"));
                    for (int i10 = 0; i10 < jSONArray2.length(); i10++) {
                        JSONObject jSONObject2 = jSONArray2.getJSONObject(i10);
                        EZSearchContacts eZSearchContacts = new EZSearchContacts();
                        if (jSONObject2.getInt("faild_error_log") == 1) {
                            eZSearchContacts.setSearched(true);
                        } else {
                            eZSearchContacts.setSearch_time(System.currentTimeMillis());
                        }
                        eZSearchContacts.setOld_tel_number(jSONObject2.getString("old_tel_number"));
                        eZSearchContacts.setTel_number(jSONObject2.getString("tel_number"));
                        eZSearchContacts.setT_p(jSONObject2.getString("t_p"));
                        eZSearchContacts.setFormat_tel_number(jSONObject2.getString("format_tel_number"));
                        eZSearchContacts.setOperator(jSONObject2.getString("operator"));
                        eZSearchContacts.setType(jSONObject2.getString("type"));
                        eZSearchContacts.setType_label(jSONObject2.getString("type_label"));
                        eZSearchContacts.setReport_count(jSONObject2.getString("report_count"));
                        eZSearchContacts.setName(jSONObject2.getString(EZBlackList.NAME));
                        eZSearchContacts.setAddress(jSONObject2.getString("address"));
                        eZSearchContacts.setBelong_area(jSONObject2.getString("belong_area"));
                        eZSearchContacts.setAvatar(jSONObject2.getString("avatar"));
                        eZSearchContacts.setFaild_error_log(jSONObject2.getInt("faild_error_log"));
                        eZSearchContacts.setE164_tel_number(jSONObject2.getString("e164_tel_number"));
                        eZSearchContacts.setCc(jSONObject2.getString("cc"));
                        arrayList.add(eZSearchContacts);
                        try {
                            EZSearchContacts f10 = b3.h.c().f(eZSearchContacts.getOld_tel_number());
                            if (f10 != null) {
                                if (f10.getSearch_time() != 0) {
                                    f10.setIs_can_search(false);
                                }
                                f10.setSearched(eZSearchContacts.isSearched());
                                f10.setType_label(eZSearchContacts.getType_label());
                                f10.setReport_count(eZSearchContacts.getReport_count());
                                f10.setBelong_area(eZSearchContacts.getBelong_area());
                                f10.setName(eZSearchContacts.getName());
                                f10.setType(eZSearchContacts.getType());
                                f10.setFormat_tel_number(eZSearchContacts.getFormat_tel_number());
                                f10.setOperator(eZSearchContacts.getOperator());
                                f10.setAddress(eZSearchContacts.getAddress());
                                f10.setAvatar(eZSearchContacts.getAvatar());
                                f10.setTel_number(eZSearchContacts.getTel_number());
                                f10.setT_p(eZSearchContacts.getT_p());
                                f10.setSearch_time(eZSearchContacts.getSearch_time());
                                f10.setE164_tel_number(eZSearchContacts.getE164_tel_number());
                                f10.setCc(eZSearchContacts.getCc());
                                b3.h.c().i(f10, "is_can_search", "isSearched", "type_label", "report_count", "belong_area", EZBlackList.NAME, "type", "format_tel_number", "operator", "address", "avatar", "tel_number", "t_p", "search_time", "e164_tel_number", "cc");
                            } else {
                                b3.h.c().e(eZSearchContacts);
                            }
                        } catch (Exception e11) {
                            e11.printStackTrace();
                        }
                    }
                    try {
                        if (eZCallLogFragment.f7067r0 != null && eZCallLogFragment.f7067r0.size() != 0) {
                            for (int i11 = 0; i11 < eZCallLogFragment.f7067r0.size(); i11++) {
                                CallLogBean callLogBean = (CallLogBean) eZCallLogFragment.f7067r0.get(i11);
                                callLogBean.h0(false);
                                EZSearchContacts f11 = b3.h.c().f(callLogBean.o());
                                if (f11 != null) {
                                    callLogBean.L0(f11.isSearched());
                                    callLogBean.J0(f11.getSearch_time());
                                    callLogBean.X0(r1.s(EZCallApplication.d(), f11.getType_label()));
                                    callLogBean.H0(f11.getReport_count());
                                    callLogBean.e0(f11.getBelong_area());
                                    callLogBean.I0(f11.getName());
                                    if (f11.getType() != null && ("Mobile".equals(f11.getType()) || "Fixed line".equals(f11.getType()))) {
                                        callLogBean.K0(r1.x(EZCallApplication.d(), f11.getType()));
                                    }
                                    callLogBean.T0(f11.getTel_number());
                                    callLogBean.D0(f11.getOld_tel_number());
                                    callLogBean.u0(f11.getFormat_tel_number());
                                    callLogBean.E0(f11.getOperator());
                                    callLogBean.a0(f11.getAddress());
                                    callLogBean.c0(f11.getAvatar());
                                    callLogBean.Y0(f11.isUnSetSpam());
                                    callLogBean.S0(f11.getT_p());
                                    callLogBean.q0(f11.getFaild_error_log());
                                }
                            }
                        }
                    } catch (Exception e12) {
                        e12.printStackTrace();
                    }
                } else {
                    eZCallLogFragment.j4();
                }
                if (!this.f7108c) {
                    return b10;
                }
                eZCallLogFragment.Z3();
                return b10;
            } catch (Exception e13) {
                e = e13;
                str = b10;
                e.printStackTrace();
                eZCallLogFragment.j4();
                w3.h.c(eZCallLogFragment.f7067r0, country_code);
                return str;
            }
        }

        @Override
        protected void onPostExecute(Object obj) {
            super.onPostExecute(obj);
            EZCallLogFragment eZCallLogFragment = this.f7106a.get();
            if (eZCallLogFragment != null && eZCallLogFragment.f7067r0 != null && eZCallLogFragment.f7067r0.size() != 0) {
                eZCallLogFragment.f7065q0.notifyDataSetChanged();
            }
            if (eZCallLogFragment == null || !eZCallLogFragment.B0) {
                return;
            }
            y3.b1.j(EZCallApplication.d());
            eZCallLogFragment.B0 = false;
        }
    }

    public class o extends TimerTask {
        o() {
        }

        @Override
        public void run() {
            try {
                String sb2 = EZCallLogFragment.this.f7058k1.toString();
                if (sb2.contains("#")) {
                    sb2 = sb2.replace('#', ' ');
                }
                if (sb2.indexOf(45) != -1) {
                    sb2 = sb2.replaceAll("-", "");
                }
                new m(EZCallLogFragment.this, sb2).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new Object[0]);
            } catch (Exception e10) {
                e10.printStackTrace();
            }
        }
    }

    static {
        Collator collator = Collator.getInstance();
        P1 = collator;
        Q1 = new String[26];
        collator.setStrength(0);
        for (char c10 = 'a'; c10 <= 'z'; c10 = (char) (c10 + 1)) {
            Q1[c10 - 'a'] = String.valueOf(c10);
        }
    }

    public void A3(ArrayList arrayList, HashMap hashMap) {
        if (arrayList == null || arrayList.size() <= 0) {
            List<CallLogBean> list = this.f7067r0;
            if (list != null && list.size() > 0) {
                this.f7067r0.clear();
            }
            this.f7065q0.notifyDataSetChanged();
        } else {
            this.f7067r0 = arrayList;
            this.f7069s0.addAll(arrayList);
            this.f7065q0.notifyDataSetChanged();
            this.f7083z0.setText(this.f7067r0.get(0).h());
            this.f7075v0 = hashMap;
            List<CallLogBean> list2 = this.f7067r0;
            if (list2 != null && list2.size() != 0) {
                this.W0.setVisibility(8);
                z2.u uVar = this.f7065q0;
                if (uVar != null) {
                    uVar.E(this.f7067r0, hashMap);
                    this.f7065q0.notifyDataSetChanged();
                } else {
                    e4(this.f7067r0, hashMap);
                }
                y3.n0.a().f34776a.execute(new Runnable() {
                    @Override
                    public final void run() {
                        EZCallLogFragment.this.z3();
                    }
                });
                this.D0.setVisibility(8);
                y3.c1.P1(false);
                g4();
            }
        }
        this.W0.setVisibility(0);
        this.D0.setVisibility(8);
        y3.c1.P1(false);
        g4();
    }

    public void B3(String str, String str2) {
        char c10;
        FloatingActionButton floatingActionButton;
        int i10;
        try {
            this.f7061n1 = str2;
            this.f7061n1 = str2.replace(" ", "");
            int hashCode = str.hashCode();
            if (hashCode == 99339) {
                if (str.equals("del")) {
                    c10 = 0;
                    if (c10 != 0) {
                    }
                    if ("".equals(this.f7061n1)) {
                    }
                    floatingActionButton.setImageResource(i10);
                    return;
                }
                c10 = 65535;
                if (c10 != 0) {
                }
                if ("".equals(this.f7061n1)) {
                }
                floatingActionButton.setImageResource(i10);
                return;
            }
            if (hashCode == 1550266221 && str.equals("del_all")) {
                c10 = 1;
                if (c10 != 0) {
                    m4(false);
                } else if (c10 != 1) {
                    m4(true);
                } else {
                    this.f7058k1.setLength(0);
                    this.f7061n1 = "";
                    G1 = false;
                    X3();
                }
                if ("".equals(this.f7061n1)) {
                    floatingActionButton = this.f7072t1;
                    i10 = this.f7070s1;
                } else {
                    floatingActionButton = this.f7072t1;
                    i10 = this.f7066q1;
                }
                floatingActionButton.setImageResource(i10);
                return;
            }
            c10 = 65535;
            if (c10 != 0) {
            }
            if ("".equals(this.f7061n1)) {
            }
            floatingActionButton.setImageResource(i10);
            return;
        } catch (Exception e10) {
            e10.printStackTrace();
        }
        e10.printStackTrace();
    }

    public void C3(AdapterView adapterView, View view, int i10, long j10) {
        i4(((j) view.getTag()).f7099d);
    }

    public void D3(Intent intent, View view) {
        FloatingActionButton floatingActionButton;
        int i10;
        Context applicationContext;
        String str;
        try {
            if (this.f7056i1.getVisibility() != 0) {
                intent.putExtra("order", true);
                intent.setAction("dialstatusnow");
                s0.a.b(this.Q0).d(intent);
                this.f7056i1.setVisibility(0);
                this.f7072t1.setVisibility(0);
                k3();
                String str2 = this.f7061n1;
                if (str2 == null || str2.equals("")) {
                    floatingActionButton = this.f7072t1;
                    i10 = this.f7066q1;
                } else {
                    floatingActionButton = this.f7072t1;
                    i10 = this.f7070s1;
                }
                floatingActionButton.setImageResource(i10);
                return;
            }
            String str3 = this.f7061n1;
            if (str3 == null || str3.equals("")) {
                this.f7056i1.setVisibility(8);
                this.f7072t1.setVisibility(8);
                intent.putExtra("order", false);
                intent.setAction("dialstatusnow");
                s0.a.b(this.Q0).d(intent);
                return;
            }
            if (y3.j1.h(this.Q0.getApplicationContext())) {
                int t10 = y3.c1.t();
                if (t10 != -1) {
                    y3.j1.b(this.Q0, t10, this.f7061n1);
                    return;
                } else if (Build.VERSION.SDK_INT >= 22) {
                    y3.j1.r(this.Q0, this.f7061n1);
                    return;
                } else {
                    applicationContext = this.Q0.getApplicationContext();
                    str = this.f7061n1;
                }
            } else {
                applicationContext = this.Q0.getApplicationContext();
                str = this.f7061n1;
            }
            y3.t0.a(applicationContext, str);
        } catch (Exception e10) {
            e10.printStackTrace();
        }
    }

    public void E3() {
        Uri data;
        try {
            final Intent intent = new Intent();
            this.E1.post(this.F1);
            this.f7061n1 = "";
            k3();
            this.f7056i1.setNumberCallBack(new EZKeyboardView.c() {
                @Override
                public final void a(String str, String str2) {
                    EZCallLogFragment.this.B3(str, str2);
                }
            });
            this.f7058k1 = new StringBuilder();
            this.f7064p1.setOnCreateContextMenuListener(this.Q0);
            this.f7064p1.setOnItemClickListener(new AdapterView.OnItemClickListener() {
                @Override
                public final void onItemClick(AdapterView adapterView, View view, int i10, long j10) {
                    EZCallLogFragment.this.C3(adapterView, view, i10, j10);
                }
            });
            this.f7064p1.setOnScrollListener(this.f7084z1);
            if (a4.d.d(this.Q0.getApplicationContext(), "android.permission.READ_CONTACTS")) {
                this.f7057j1 = ContactAccessor.getInstance(this.Q0.getContentResolver());
                this.D1 = this.f7056i1.f6893b.getText().length();
                if ("".equals(this.f7061n1)) {
                    this.f7064p1.setVisibility(8);
                } else {
                    this.f7064p1.setVisibility(0);
                    i iVar = new i(this.Q0, null, this.f7057j1.getContactSplit());
                    this.f7062o1 = iVar;
                    this.f7064p1.setAdapter((ListAdapter) iVar);
                    this.f7064p1.invalidate();
                }
                try {
                    new m(this, "").executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new Object[0]);
                } catch (Exception e10) {
                    e10.printStackTrace();
                }
            }
            f4();
            try {
                this.f7072t1.setImageResource(this.f7066q1);
            } catch (Exception e11) {
                e11.printStackTrace();
            }
            this.f7072t1.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    EZCallLogFragment.this.D3(intent, view);
                }
            });
            String action = this.Q0.getIntent().getAction();
            if ("android.intent.action.DIAL".equals(this.Q0.getIntent().getAction())) {
                String dataString = this.Q0.getIntent().getDataString();
                String replace = dataString != null ? dataString.replace("tel:", "") : null;
                if (replace == null || "".equals(replace)) {
                    return;
                }
                try {
                    this.f7061n1 = replace;
                    this.f7056i1.f6893b.setText(replace);
                    EditText editText = this.f7056i1.f6893b;
                    editText.setSelection(editText.getText().length());
                    this.f7072t1.setImageResource(this.f7070s1);
                    m4(true);
                    y3.a0.a("dialnumber", "number:" + replace);
                    return;
                } catch (Exception e12) {
                    e = e12;
                }
            } else {
                if (!"android.intent.action.VIEW".equals(action) || (data = this.Q0.getIntent().getData()) == null || !"tel".equals(data.getScheme())) {
                    return;
                }
                String replace2 = data.toString().replace("tel:", "");
                if ("".equals(replace2)) {
                    return;
                }
                try {
                    this.f7061n1 = replace2;
                    this.f7056i1.f6893b.setText(replace2);
                    EditText editText2 = this.f7056i1.f6893b;
                    editText2.setSelection(editText2.getText().length());
                    this.f7072t1.setImageResource(this.f7070s1);
                    m4(true);
                    y3.a0.a("dialnumber", "number:" + replace2);
                    return;
                } catch (Exception e13) {
                    e = e13;
                }
            }
            e.printStackTrace();
        } catch (Exception e14) {
            e14.printStackTrace();
        }
    }

    public static void F3() {
    }

    public void G3(View view) {
        this.f7056i1.setVisibility(0);
        this.f7072t1.setVisibility(0);
        Intent intent = new Intent();
        intent.putExtra("order", true);
        intent.setAction("dialstatusnow");
        s0.a.b(this.Q0).d(intent);
    }

    public void H3(AdapterView adapterView, View view, int i10, long j10) {
        MainActivity mainActivity;
        try {
            List<CallLogBean> list = this.f7067r0;
            if (list == null || list.size() == 0) {
                return;
            }
            CallLogBean callLogBean = this.f7067r0.get(i10);
            if (this.H0) {
                if (callLogBean.T()) {
                    callLogBean.M0(false);
                    view.setBackgroundDrawable(null);
                    this.K0.remove(callLogBean);
                } else {
                    callLogBean.M0(true);
                    view.setBackgroundColor(y3.k1.a(this.R0, R.attr.color_calllogs_selected, R.color.colorselect));
                    this.K0.add(callLogBean);
                }
                c4();
                return;
            }
            y3.a0.a("favtest", "contact:" + callLogBean.toString());
            if (callLogBean.Q()) {
                Intent intent = new Intent();
                Bundle bundle = new Bundle();
                bundle.putParcelable("contact_tony", callLogBean);
                intent.putExtras(bundle);
                intent.setClass(this.Q0, ContactActivity.class);
                S1(intent);
                mainActivity = this.Q0;
            } else {
                Intent intent2 = new Intent();
                Bundle bundle2 = new Bundle();
                bundle2.putParcelable("contact_tony", callLogBean);
                intent2.putExtras(bundle2);
                intent2.setClass(this.Q0, UnknownContactActivity.class);
                S1(intent2);
                mainActivity = this.Q0;
            }
            mainActivity.overridePendingTransition(R.anim.abc_fade_in, R.anim.abc_fade_out);
        } catch (Exception e10) {
            e10.printStackTrace();
        }
    }

    public boolean I3(AdapterView adapterView, View view, int i10, long j10) {
        try {
            List<CallLogBean> list = this.f7067r0;
            if (list != null && list.size() != 0 && i10 < this.f7067r0.size()) {
                CallLogBean callLogBean = this.f7067r0.get(i10);
                if (!this.H0) {
                    this.H0 = true;
                    callLogBean.M0(true);
                    this.K0.add(callLogBean);
                    this.T0 = this.K0.size();
                    view.setBackgroundColor(y3.k1.a(this.R0, R.attr.color_calllogs_selected, R.color.colorselect));
                    h4();
                    c4();
                }
            }
        } catch (Exception e10) {
            e10.printStackTrace();
        }
        return true;
    }

    public boolean J3(View view, int i10, KeyEvent keyEvent) {
        if (keyEvent.getAction() != 0 || i10 != 4) {
            return false;
        }
        y3.c1.P1(false);
        g4();
        return true;
    }

    public void K3(boolean z10) {
        if (z10) {
            try {
                d4();
            } catch (Exception e10) {
                e10.printStackTrace();
            }
        }
    }

    public void L3(boolean z10) {
        if (z10) {
            try {
                z2.u uVar = this.f7065q0;
                if (uVar == null || !uVar.E) {
                    return;
                }
                uVar.C();
            } catch (Exception e10) {
                e10.printStackTrace();
            }
        }
    }

    public void M3(List list, List list2) {
        try {
            this.f7071t0 = list2;
            if (list2 != null && list2.size() > 0) {
                this.f7065q0.notifyDataSetChanged();
                Z3();
            } else if (this.B0) {
                y3.b1.j(EZCallApplication.d());
                this.B0 = false;
            }
        } catch (Exception e10) {
            e10.printStackTrace();
        }
    }

    public void N3(ArrayList arrayList) {
        if (arrayList.size() != 0) {
            try {
                this.f7065q0.notifyDataSetChanged();
                n nVar = new n(this, arrayList, false);
                try {
                    nVar.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new Object[0]);
                } catch (Exception unused) {
                    nVar.execute(new Object[0]);
                }
            } catch (Exception e10) {
                e10.printStackTrace();
            }
        }
    }

    public void O3(com.google.android.gms.ads.nativead.a aVar) {
        NativeAdView nativeAdView = (NativeAdView) LayoutInflater.from(this.Q0).inflate(R.layout.aad_lxr_dx_inmobi, (ViewGroup) null);
        com.callerid.block.util.gg.a.a(aVar, nativeAdView);
        b4.d dVar = this.X0;
        if (dVar != null) {
            dVar.a();
        }
        FrameLayout frameLayout = this.P0;
        if (frameLayout != null) {
            frameLayout.removeAllViews();
            this.P0.addView(nativeAdView);
            this.P0.setVisibility(0);
            if (this.V0 == null) {
                this.V0 = AnimationUtils.loadAnimation(EZCallApplication.d(), R.anim.anim_ad);
            }
            this.P0.startAnimation(this.V0);
        }
    }

    public void P3() {
        this.X0.a();
    }

    public void Q3(boolean z10) {
        if (z10) {
            try {
                d4();
            } catch (Exception e10) {
                e10.printStackTrace();
            }
        }
    }

    public void R3(boolean z10) {
        if (z10) {
            try {
                z2.u uVar = this.f7065q0;
                if (uVar == null || !uVar.E) {
                    return;
                }
                uVar.C();
            } catch (Exception e10) {
                e10.printStackTrace();
            }
        }
    }

    private void S3() {
        Uri withAppendedId;
        Bitmap decodeStream;
        try {
            List<CallLogBean> list = this.f7067r0;
            if (list == null || list.size() <= 0) {
                return;
            }
            ContentResolver contentResolver = EZCallApplication.d().getContentResolver();
            for (int i10 = 0; i10 < this.f7067r0.size(); i10++) {
                try {
                    CallLogBean callLogBean = this.f7067r0.get(i10);
                    if (callLogBean.o() != null && !"".equals(callLogBean.o()) && !r1.e0(callLogBean.o())) {
                        String k10 = r1.k(EZCallApplication.d(), callLogBean.o());
                        if ((k10 != null) && (!"".equals(k10))) {
                            callLogBean.A0(k10);
                            callLogBean.j0(true);
                            int L = r1.L(EZCallApplication.d(), callLogBean.o());
                            callLogBean.G0(L);
                            if (L != 0 && (withAppendedId = ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, callLogBean.u())) != null && (decodeStream = BitmapFactory.decodeStream(ContactsContract.Contacts.openContactPhotoInputStream(contentResolver, withAppendedId))) != null) {
                                callLogBean.p0(true);
                                decodeStream.recycle();
                            }
                        } else {
                            callLogBean.j0(false);
                            callLogBean.A0("");
                            callLogBean.G0(0);
                            callLogBean.p0(false);
                        }
                    }
                } catch (Exception e10) {
                    e10.printStackTrace();
                }
            }
        } catch (Exception e11) {
            e11.printStackTrace();
        }
    }

    private void T3() {
        try {
            List<CallLogBean> list = this.f7067r0;
            if (list == null || list.size() == 0) {
                return;
            }
            for (int i10 = 0; i10 < this.f7067r0.size(); i10++) {
                CallLogBean callLogBean = this.f7067r0.get(i10);
                EZSearchContacts f10 = b3.h.c().f(callLogBean.o());
                if (f10 != null) {
                    callLogBean.L0(f10.isSearched());
                    callLogBean.X0(r1.s(EZCallApplication.d(), f10.getType_label()));
                    callLogBean.H0(f10.getReport_count());
                    callLogBean.e0(f10.getBelong_area());
                    callLogBean.I0(f10.getName());
                    if (f10.getType() != null && ("Mobile".equals(f10.getType()) || "Fixed line".equals(f10.getType()))) {
                        callLogBean.K0(r1.x(EZCallApplication.d(), f10.getType()));
                    }
                    callLogBean.T0(f10.getTel_number());
                    callLogBean.S0(f10.getT_p());
                    callLogBean.D0(f10.getOld_tel_number());
                    callLogBean.u0(f10.getFormat_tel_number());
                    callLogBean.E0(f10.getOperator());
                    callLogBean.a0(f10.getAddress());
                    callLogBean.c0(f10.getAvatar());
                    callLogBean.J0(f10.getSearch_time());
                    callLogBean.Y0(f10.isUnSetSpam());
                    callLogBean.g0(f10.isIs_can_search());
                    callLogBean.q0(f10.getFaild_error_log());
                }
            }
        } catch (Exception e10) {
            e10.printStackTrace();
        }
    }

    private static char U3(char c10) {
        if (Character.isDigit(c10) || c10 == '+') {
            return c10;
        }
        if (c10 == ' ') {
            return '#';
        }
        char W3 = W3(c10);
        if (W3 < 'a' || W3 > 'z') {
            return (char) 0;
        }
        if (W3 <= 'o') {
            return (char) (((W3 - 'a') / 3) + 50);
        }
        if (W3 <= 's') {
            return '7';
        }
        return W3 <= 'v' ? '8' : '9';
    }

    private static int[] V3(Spannable spannable, String str) {
        boolean z10;
        Exception e10;
        ArrayList arrayList = new ArrayList();
        String obj = spannable.toString();
        int[] iArr = {-1, str.length()};
        arrayList.add(0);
        int i10 = 0;
        while (true) {
            i10 = obj.indexOf(" ", i10 + 1);
            if (i10 == -1) {
                break;
            }
            arrayList.add(Integer.valueOf(i10 + 1));
        }
        boolean z11 = true;
        for (int i11 = 0; i11 < arrayList.size(); i11++) {
            try {
                if (U3(spannable.charAt(((Integer) arrayList.get(i11)).intValue())) == str.charAt(0)) {
                    try {
                        iArr[0] = ((Integer) arrayList.get(i11)).intValue();
                        z11 = true;
                    } catch (Exception e11) {
                        e10 = e11;
                        z10 = true;
                        e10.printStackTrace();
                        z11 = z10;
                        if (z11) {
                        }
                        if (!z11) {
                        }
                    }
                }
            } catch (Exception e12) {
                z10 = z11;
                e10 = e12;
            }
            if (z11) {
                int intValue = ((Integer) arrayList.get(i11)).intValue();
                int i12 = 0;
                while (true) {
                    if (i12 >= str.length()) {
                        break;
                    }
                    try {
                        if (U3(spannable.charAt(intValue)) != str.charAt(i12)) {
                            if (spannable.charAt(intValue) != '-') {
                                iArr[0] = -1;
                                iArr[1] = str.length();
                                z11 = false;
                                break;
                            }
                            iArr[1] = iArr[1] + 1;
                            i12--;
                        } else {
                            continue;
                        }
                    } catch (StringIndexOutOfBoundsException unused) {
                        iArr[0] = -1;
                        iArr[1] = str.length();
                        z11 = false;
                    }
                    intValue++;
                    i12++;
                }
            }
            if (!z11) {
                break;
            }
        }
        return iArr;
    }

    private static char W3(char c10) {
        if (c10 == 223) {
            return 's';
        }
        if (c10 == 248 || c10 == 216) {
            return 'o';
        }
        String valueOf = String.valueOf(c10);
        Collator collator = P1;
        String[] strArr = Q1;
        int compare = collator.compare(valueOf, strArr[0]);
        if (compare == 0) {
            return 'a';
        }
        int compare2 = collator.compare(valueOf, strArr[strArr.length - 1]);
        if (compare2 == 0) {
            return 'z';
        }
        if (compare >= 0 && compare2 <= 0) {
            for (char c11 = 'b'; c11 < 'z'; c11 = (char) (c11 + 1)) {
                if (P1.compare(valueOf, Q1[c11 - 'a']) == 0) {
                    return c11;
                }
            }
        }
        return c10;
    }

    private void X3() {
        this.f7059l1.removeCallbacks(this.f7060m1);
        this.f7059l1.postDelayed(this.f7060m1, 500L);
    }

    public void Z3() {
        List list;
        boolean z10;
        try {
            if (this.f7071t0.size() > 20) {
                list = new ArrayList(this.f7071t0.subList(0, 20));
                this.f7071t0.removeAll(list);
                z10 = true;
            } else {
                list = this.f7071t0;
                z10 = false;
            }
            if (y3.a0.f34733a) {
                y3.a0.c("searchList", "searchNumberList.size:" + this.f7071t0.size());
                y3.a0.c("searchList", "canSearchList.size:" + list.size());
            }
            n nVar = new n(this, list, z10);
            if (nVar.getStatus() != AsyncTask.Status.RUNNING) {
                nVar.cancel(true);
                new n(this, list, z10).executeOnExecutor(y3.m1.a(), new Object[0]);
            }
        } catch (Exception e10) {
            e10.printStackTrace();
        }
    }

    public void a4() {
        try {
            i3.h.b(this.f7067r0, new i3.i() {
                @Override
                public final void a(List list, List list2) {
                    EZCallLogFragment.this.M3(list, list2);
                }
            });
        } catch (Exception e10) {
            e10.printStackTrace();
        }
    }

    public void b4(int i10, int i11) {
        try {
            if (y3.a0.f34733a) {
                y3.a0.a("searchList", "滑动后查询 start:" + i10 + " end:" + i11);
            }
            i3.h.a(i10, i11, this.f7067r0, new i3.e() {
                @Override
                public final void a(ArrayList arrayList) {
                    EZCallLogFragment.this.N3(arrayList);
                }
            });
        } catch (Exception e10) {
            e10.printStackTrace();
        }
    }

    @SuppressLint({"SetTextI18n"})
    private void c4() {
        ImageView imageView;
        int i10;
        List<CallLogBean> list = this.f7067r0;
        if (list == null || list.size() <= 0) {
            return;
        }
        this.F0.setText(this.K0.size() + "/" + this.f7067r0.size());
        if (this.K0.size() > 0) {
            y3.c1.P1(true);
            imageView = this.G0;
            i10 = 0;
        } else {
            imageView = this.G0;
            i10 = 8;
        }
        imageView.setVisibility(i10);
    }

    private void d4() {
        try {
            this.M0 = 0;
            this.X0 = b4.c.a(this.P0).j(R.layout.loading_layout_item).k(true).g(0).i(1000).h(R.color.shimmer_color).l();
            a.C0109a c0109a = new a.C0109a(EZCallApplication.d(), "ca-app-pub-5825926894918682/8600262755");
            c0109a.c(new a.c() {
                @Override
                public final void a(com.google.android.gms.ads.nativead.a aVar) {
                    EZCallLogFragment.this.O3(aVar);
                }
            });
            c0109a.g(new a.C0263a().h(new r.a().b(true).a()).a());
            com.google.android.gms.ads.a a10 = c0109a.e(new d()).a();
            this.N0 = a10;
            a10.a(new b.a().c());
            try {
                new Handler().postDelayed(new Runnable() {
                    @Override
                    public final void run() {
                        EZCallLogFragment.this.P3();
                    }
                }, 3000L);
            } catch (Exception e10) {
                e10.printStackTrace();
            }
        } catch (Exception e11) {
            e11.printStackTrace();
        }
    }

    private void e4(List<CallLogBean> list, HashMap<String, Integer> hashMap) {
        z2.u uVar = new z2.u(this.Q0, list, hashMap, this.f7063p0);
        this.f7065q0 = uVar;
        this.f7063p0.setAdapter((ListAdapter) uVar);
        this.f7063p0.invalidate();
    }

    private void f4() {
        int a10 = y3.k1.a(this.Q0, R.attr.color_333333, R.color.color_333333);
        SharedPreferences defaultSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this.Q0);
        I1 = defaultSharedPreferences.getBoolean("matched_italics", false);
        J1 = defaultSharedPreferences.getBoolean("matched_bold", true);
        K1 = defaultSharedPreferences.getBoolean("matched_colour", true);
        O1 = new ForegroundColorSpan(a10);
        H1 = defaultSharedPreferences.getBoolean("match_num_sequence", true);
        L1 = defaultSharedPreferences.getBoolean("auto_hide_dialpad_on_fling", true);
    }

    private void g4() {
        this.D0.setVisibility(8);
        this.E0.setVisibility(0);
        this.H0 = false;
        l3();
    }

    public void h3() {
        try {
            g3.a.a(new a());
        } catch (Exception e10) {
            e10.printStackTrace();
        }
    }

    private void h4() {
        this.D0.setVisibility(0);
        this.E0.setVisibility(8);
    }

    private static void i3(Spannable spannable, int i10, int i11) {
        if (i11 == 0) {
            return;
        }
        Log.d("SPANNABLE NAME", "" + ((Object) spannable));
        if (I1) {
            spannable.setSpan(M1, i10, i10 + i11, 33);
        }
        if (J1) {
            spannable.setSpan(N1, i10, i10 + i11, 33);
        }
        if (K1) {
            spannable.setSpan(O1, i10, i11 + i10, 33);
        }
    }

    private void i4(Uri uri) {
        try {
            Uri contactUri = this.f7057j1.getContactSplit().getContactUri(uri);
            Intent intent = new Intent("android.intent.action.VIEW");
            intent.setData(contactUri);
            S1(intent);
        } catch (Exception e10) {
            e10.printStackTrace();
        }
    }

    private static String j3(char c10) {
        if (c10 == '*') {
            return "?";
        }
        switch (c10) {
            case '2':
                return "[2ABCÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻȀȁȂȃȦȧḀḁẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặÅfrom b: ḂḃḄḅḆḇÇçĆćĈĉĊċČčḈḉ]";
            case '3':
                return "[3DEFĎďḊḋḌḍḎḏḐḑḒḓÈÉÊËèéêëĒēĔĕĖėĘęĚěȄȅȆȇȨȩḔḕḖḗḘḙḚḛḜḝẸẹẺẻẼẽẾếỀềỂểỄễỆệḞḟ]";
            case '4':
                return "[4GHIĜĝĞğĠġĢģǦǧǴǵḠḡĤĥȞȟḢḣḤḥḦḧḨḩḪḫẖÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐȈȉȊȋḬḭḮḯỈỉỊị]";
            case '5':
                return "[5JKLĴĵǰĶķǨǩḰḱḲḳḴḵKĹĺĻļĽľḶḷḸḹḺḻḼḽ]";
            case '6':
                return "[6MNOḾḿṀṁṂṃÑñŃńŅņŇňǸǹṄṅṆṇṈṉṊṋÒÓÔÕÖØòóôõöøŌōŎŏŐőƠơǑǒǪǫǬǭȌȍȎȏȪȫȬȭȮȯȰȱṌṍṎṏṐṑṒṓỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ]";
            case '7':
                return "[7PQRSṔṕṖṗŔŕŖŗŘřȐȑȒȓṘṙṚṛṜṝṞṟߌśŜŝŞşŠšȘșṠṡṢṣṤṥṦṧṨṩ]";
            case '8':
                return "[8TUVŢţŤťȚțṪṫṬṭṮṯṰṱẗÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜȔȕȖȗṲṳṴṵṶṷṸṹṺṻỤụỦủỨứỪừỬửỮữỰựṼṽṾṿ]";
            case '9':
                return "[9WXYZŴŵẀẁẂẃẄẅẆẇẈẉẘẊẋẌẍÝýÿŶŷŸȲȳẎẏẙỲỳỴỵỶỷỸỹŹźŻżŽžẐẑẒẓẔẕ]";
            default:
                return String.valueOf(c10);
        }
    }

    public void j4() {
        try {
            List<CallLogBean> list = this.f7067r0;
            if (list == null || list.size() == 0) {
                return;
            }
            for (int i10 = 0; i10 < this.f7067r0.size(); i10++) {
                this.f7067r0.get(i10).h0(false);
            }
        } catch (Exception e10) {
            e10.printStackTrace();
        }
    }

    private void k3() {
        LImageButton lImageButton;
        SubscriptionManager from;
        List<SubscriptionInfo> activeSubscriptionInfoList;
        CharSequence carrierName;
        CharSequence carrierName2;
        CharSequence carrierName3;
        CharSequence carrierName4;
        CharSequence carrierName5;
        CharSequence carrierName6;
        try {
            if (androidx.core.content.a.a(this.Q0.getApplicationContext(), "android.permission.READ_PHONE_STATE") != 0) {
                return;
            }
            int t10 = y3.c1.t();
            if (!y3.j1.h(this.Q0)) {
                LImageButton lImageButton2 = this.f7074u1;
                if (lImageButton2 != null) {
                    lImageButton2.setVisibility(8);
                }
                LImageButton lImageButton3 = this.f7076v1;
                if (lImageButton3 != null) {
                    lImageButton3.setVisibility(8);
                }
                LImageButton lImageButton4 = this.f7078w1;
                if (lImageButton4 != null) {
                    lImageButton4.setVisibility(8);
                    return;
                }
                return;
            }
            if (t10 != 0) {
                if (t10 == 1) {
                    LImageButton lImageButton5 = this.f7074u1;
                    if (lImageButton5 != null) {
                        lImageButton5.setVisibility(8);
                    }
                    LImageButton lImageButton6 = this.f7076v1;
                    if (lImageButton6 != null) {
                        lImageButton6.setVisibility(0);
                    }
                    lImageButton = this.f7078w1;
                    if (lImageButton != null) {
                        lImageButton.setVisibility(8);
                    }
                } else if (t10 == -1) {
                    LImageButton lImageButton7 = this.f7074u1;
                    if (lImageButton7 != null) {
                        lImageButton7.setVisibility(8);
                    }
                    LImageButton lImageButton8 = this.f7076v1;
                    if (lImageButton8 != null) {
                        lImageButton8.setVisibility(8);
                    }
                    LImageButton lImageButton9 = this.f7078w1;
                    if (lImageButton9 != null) {
                        lImageButton9.setVisibility(0);
                    }
                }
                if (Build.VERSION.SDK_INT >= 22) {
                    from = SubscriptionManager.from(this.Q0);
                    this.f7082y1 = from;
                    activeSubscriptionInfoList = from.getActiveSubscriptionInfoList();
                    this.f7080x1 = activeSubscriptionInfoList;
                    if (activeSubscriptionInfoList == null || activeSubscriptionInfoList.size() != 2) {
                        return;
                    }
                    SubscriptionInfo subscriptionInfo = this.f7080x1.get(0);
                    SubscriptionInfo subscriptionInfo2 = this.f7080x1.get(1);
                    if (subscriptionInfo != null) {
                        carrierName4 = subscriptionInfo.getCarrierName();
                        if (carrierName4 != null) {
                            carrierName5 = subscriptionInfo.getCarrierName();
                            if (!"".contentEquals(carrierName5)) {
                                carrierName6 = subscriptionInfo.getCarrierName();
                                carrierName6.toString();
                            }
                        }
                    }
                    if (subscriptionInfo2 != null) {
                        carrierName = subscriptionInfo2.getCarrierName();
                        if (carrierName != null) {
                            carrierName2 = subscriptionInfo2.getCarrierName();
                            if ("".contentEquals(carrierName2)) {
                                return;
                            }
                            carrierName3 = subscriptionInfo2.getCarrierName();
                            carrierName3.toString();
                            return;
                        }
                        return;
                    }
                    return;
                }
                return;
            }
            LImageButton lImageButton10 = this.f7074u1;
            if (lImageButton10 != null) {
                lImageButton10.setVisibility(0);
            }
            LImageButton lImageButton11 = this.f7076v1;
            if (lImageButton11 != null) {
                lImageButton11.setVisibility(8);
            }
            lImageButton = this.f7078w1;
        } catch (Exception e10) {
            e10.printStackTrace();
        }
    }

    public void k4() {
        Intent intent = new Intent();
        intent.putExtra("order", false);
        intent.setAction("dialstatusnow");
        s0.a.b(this.Q0).d(intent);
        this.f7056i1.setVisibility(8);
        this.f7072t1.setVisibility(8);
    }

    private void l3() {
        new h(this).execute(new Void[0]);
    }

    public void l4(Cursor cursor) {
        try {
            if (cursor.getCount() == 0) {
                G1 = true;
            }
            if ("".equals(this.f7061n1)) {
                this.f7064p1.setVisibility(8);
                try {
                    this.f7062o1.getCursor().deactivate();
                } catch (NullPointerException e10) {
                    e10.getMessage();
                }
                this.f7062o1.changeCursor(cursor);
            } else {
                this.f7062o1 = new i(this.Q0, cursor, this.f7057j1.getContactSplit());
                this.f7064p1.setVisibility(0);
                this.f7064p1.setAdapter((ListAdapter) this.f7062o1);
            }
            this.f7064p1.invalidate();
        } catch (Exception e11) {
            e11.printStackTrace();
        }
    }

    private void m3() {
        char[] charArray = this.f7061n1.toCharArray();
        this.f7058k1.setLength(0);
        for (char c10 : charArray) {
            this.f7058k1.append(j3(c10));
        }
    }

    private void m4(boolean z10) {
        if (!z10) {
            G1 = false;
        }
        m3();
        if (G1) {
            return;
        }
        X3();
    }

    @SuppressLint({"SetTextI18n"})
    public void o3() {
        try {
            List<CallLogBean> list = this.f7067r0;
            if (list == null || list.size() <= 0 || this.K0.size() <= 0) {
                return;
            }
            this.F0.setText("0/" + this.f7067r0.size());
            i3.g.a(EZCallApplication.d(), this.K0, new i3.f() {
                @Override
                public final void a() {
                    EZCallLogFragment.this.y3();
                }
            });
        } catch (Exception e10) {
            e10.printStackTrace();
        }
    }

    private void p3(View view) {
        this.P0 = (FrameLayout) view.findViewById(R.id.fl_gg);
        this.W0 = (LinearLayout) view.findViewById(R.id.empty_data);
        ((TextView) view.findViewById(R.id.empty_des)).setTypeface(this.C0);
        this.W0.setVisibility(8);
    }

    public static void q3(Spannable spannable, String str) {
        int[] V3;
        int i10;
        if (str.length() == 0 || (i10 = (V3 = V3(spannable, str))[0]) == -1) {
            return;
        }
        i3(spannable, i10, V3[1]);
    }

    private void t3() {
        this.Q0.getWindow().getDecorView().post(new Runnable() {
            @Override
            public final void run() {
                EZCallLogFragment.this.E3();
            }
        });
    }

    static int u2(EZCallLogFragment eZCallLogFragment) {
        int i10 = eZCallLogFragment.M0;
        eZCallLogFragment.M0 = i10 + 1;
        return i10;
    }

    private void u3() {
        this.D0 = (LinearLayout) this.Q0.findViewById(R.id.ll_select);
        this.E0 = (FrameLayout) this.Q0.findViewById(R.id.toolbar);
        ImageView imageView = (ImageView) this.Q0.findViewById(R.id.select_close);
        imageView.setOnClickListener(this);
        this.F0 = (TextView) this.Q0.findViewById(R.id.select_count);
        ImageView imageView2 = (ImageView) this.Q0.findViewById(R.id.iv_select_delete);
        this.G0 = imageView2;
        imageView2.setOnClickListener(this);
        if (r1.S(this.Q0).booleanValue()) {
            imageView.setImageResource(y3.k1.b(this.Q0, R.attr.attr_ayu_seet, R.drawable.ayu_seet_black));
        }
    }

    private void v3() {
        Timer timer;
        View inflate = LayoutInflater.from(this.Q0).inflate(R.layout.view_head_share, (ViewGroup) null);
        this.Y0 = (ViewStub) inflate.findViewById(R.id.viewstub_test);
        this.Z0 = (ViewStub) inflate.findViewById(R.id.viewstub_test2);
        TextView textView = (TextView) inflate.findViewById(R.id.tv_filter);
        this.f7083z0 = textView;
        textView.setTypeface(this.C0);
        this.f7055h1 = y3.n1.b();
        if (Build.VERSION.SDK_INT < 29) {
            if (s1.f() && y3.c1.Z()) {
                y3.m.c().g("whatsapp_guide_show");
                try {
                    View inflate2 = this.Y0.inflate();
                    this.f7048a1 = (com.rey.material.widget.TextView) inflate2.findViewById(R.id.tv_per_title);
                    this.f7050c1 = (com.rey.material.widget.TextView) inflate2.findViewById(R.id.tv_turn_on);
                    this.f7051d1 = (com.rey.material.widget.TextView) inflate2.findViewById(R.id.tv_dissmiss);
                    this.f7049b1 = (com.rey.material.widget.TextView) inflate2.findViewById(R.id.tv_per_contents);
                    this.f7048a1.setTypeface(this.f7055h1);
                    this.f7049b1.setTypeface(this.C0);
                    this.f7050c1.setTypeface(this.f7055h1);
                    this.f7051d1.setTypeface(this.f7055h1);
                    this.f7050c1.setOnClickListener(this);
                    this.f7051d1.setOnClickListener(this);
                } catch (Exception unused) {
                    this.Y0.setVisibility(0);
                }
                timer = new Timer();
                this.S0 = timer;
                this.f7063p0.addHeaderView(inflate, null, false);
            }
            this.Y0.setVisibility(8);
            this.f7063p0.addHeaderView(inflate, null, false);
        }
        if (!a4.d.i(this.Q0)) {
            try {
                View inflate3 = this.Z0.inflate();
                this.f7052e1 = (com.rey.material.widget.TextView) inflate3.findViewById(R.id.showcaller_title);
                this.f7054g1 = (com.rey.material.widget.TextView) inflate3.findViewById(R.id.tv_caller_enable);
                this.f7053f1 = (com.rey.material.widget.TextView) inflate3.findViewById(R.id.showcaller_text);
                this.f7052e1.setTypeface(this.f7055h1);
                this.f7053f1.setTypeface(this.C0);
                this.f7054g1.setTypeface(this.f7055h1);
                this.f7054g1.setOnClickListener(this);
            } catch (Exception unused2) {
                this.Z0.setVisibility(0);
            }
            this.f7063p0.addHeaderView(inflate, null, false);
        }
        this.Z0.setVisibility(8);
        if (s1.f() && y3.c1.Z()) {
            y3.m.c().g("whatsapp_guide_show");
            try {
                View inflate4 = this.Y0.inflate();
                this.f7048a1 = (com.rey.material.widget.TextView) inflate4.findViewById(R.id.tv_per_title);
                this.f7050c1 = (com.rey.material.widget.TextView) inflate4.findViewById(R.id.tv_turn_on);
                this.f7051d1 = (com.rey.material.widget.TextView) inflate4.findViewById(R.id.tv_dissmiss);
                this.f7049b1 = (com.rey.material.widget.TextView) inflate4.findViewById(R.id.tv_per_contents);
                this.f7048a1.setTypeface(this.f7055h1);
                this.f7049b1.setTypeface(this.C0);
                this.f7050c1.setTypeface(this.f7055h1);
                this.f7051d1.setTypeface(this.f7055h1);
                this.f7050c1.setOnClickListener(this);
                this.f7051d1.setOnClickListener(this);
            } catch (Exception unused3) {
                this.Y0.setVisibility(0);
            }
            timer = new Timer();
            this.S0 = timer;
            this.f7063p0.addHeaderView(inflate, null, false);
        }
        this.Y0.setVisibility(8);
        this.f7063p0.addHeaderView(inflate, null, false);
    }

    private void w3() {
        View inflate = LayoutInflater.from(this.Q0).inflate(R.layout.popuwindow_filter, (ViewGroup) null);
        com.rey.material.widget.TextView textView = (com.rey.material.widget.TextView) inflate.findViewById(R.id.tv_filter_all);
        com.rey.material.widget.TextView textView2 = (com.rey.material.widget.TextView) inflate.findViewById(R.id.tv_filter_incoming);
        com.rey.material.widget.TextView textView3 = (com.rey.material.widget.TextView) inflate.findViewById(R.id.tv_filter_outgoing);
        com.rey.material.widget.TextView textView4 = (com.rey.material.widget.TextView) inflate.findViewById(R.id.tv_filter_missed);
        com.rey.material.widget.TextView textView5 = (com.rey.material.widget.TextView) inflate.findViewById(R.id.tv_filter_delete);
        textView.setTypeface(this.C0);
        textView2.setTypeface(this.C0);
        textView3.setTypeface(this.C0);
        textView4.setTypeface(this.C0);
        textView5.setTypeface(this.C0);
        textView.setOnClickListener(this);
        textView2.setOnClickListener(this);
        textView3.setOnClickListener(this);
        textView4.setOnClickListener(this);
        textView5.setOnClickListener(this);
        this.f7079x0 = new PopupWindow(inflate);
        this.f7079x0.setWidth(this.Q0.getWindowManager().getDefaultDisplay().getWidth() / 2);
        this.f7079x0.setHeight(-2);
        this.f7079x0.setFocusable(true);
        this.f7079x0.setAnimationStyle(R.style.pop_style);
        this.f7079x0.setBackgroundDrawable(new ColorDrawable(0));
    }

    public void x3() {
        try {
            if (!a4.d.m(this.R0)) {
                if (y3.a0.f34733a) {
                    y3.a0.a("wbb", "未开启通知管理");
                    return;
                }
                return;
            }
            this.U0.cancel();
            if (y3.a0.f34733a) {
                y3.a0.a("wbb", "开启了通知管理");
            }
            y3.m.c().g("whatsapp_notifi_per_enabled");
            y3.c1.C1(true);
            this.R0.startActivity(new Intent(this.Q0, (Class<?>) MainActivity.class));
        } catch (Exception e10) {
            e10.printStackTrace();
        }
    }

    public void y3() {
        try {
            this.K0.clear();
            r3();
        } catch (Exception e10) {
            e10.printStackTrace();
        }
    }

    public void z3() {
        T3();
        this.O0.sendEmptyMessage(15001);
        S3();
        this.O0.sendEmptyMessage(15002);
    }

    @Override
    public View E0(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        View inflate = layoutInflater.inflate(R.layout.contact_record_list, viewGroup, false);
        this.f7064p1 = (ListView) inflate.findViewById(R.id.contactlist);
        this.f7056i1 = (EZKeyboardView) inflate.findViewById(R.id.keyboard_view);
        this.f7072t1 = (FloatingActionButton) inflate.findViewById(R.id.activity_dial_button);
        this.f7074u1 = (LImageButton) inflate.findViewById(R.id.iv_sim_switch1);
        this.f7076v1 = (LImageButton) inflate.findViewById(R.id.iv_sim_switch2);
        this.f7078w1 = (LImageButton) inflate.findViewById(R.id.iv_sim_ask);
        this.f7066q1 = y3.k1.b(this.Q0, R.attr.keyboard_down, R.drawable.keyboard_down);
        this.f7068r1 = y3.k1.b(this.Q0, R.attr.keyboard_up, R.drawable.keyboard_up);
        this.f7070s1 = y3.k1.b(this.Q0, R.attr.dial_button_icon, R.drawable.dial_button);
        t3();
        this.C0 = y3.n1.c();
        this.f7081y0 = (ProgressBar) inflate.findViewById(R.id.progress_search);
        this.f7063p0 = (ObservableListView) inflate.findViewById(R.id.ob_listview);
        this.f7067r0 = new ArrayList();
        w3();
        v3();
        p3(inflate);
        this.L0 = true;
        e4(this.f7067r0, this.f7075v0);
        FloatingActionButton floatingActionButton = (FloatingActionButton) inflate.findViewById(R.id.callphone_dial);
        this.A0 = floatingActionButton;
        floatingActionButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                EZCallLogFragment.this.G3(view);
            }
        });
        this.A0.setShowAnimation(AnimationUtils.loadAnimation(this.Q0, R.anim.show_from_bottom));
        this.A0.setHideAnimation(AnimationUtils.loadAnimation(this.Q0, R.anim.hide_to_bottom));
        u3();
        this.f7063p0.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public final void onItemClick(AdapterView adapterView, View view, int i10, long j10) {
                EZCallLogFragment.this.H3(adapterView, view, i10, j10);
            }
        });
        this.f7063p0.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
            @Override
            public final boolean onItemLongClick(AdapterView adapterView, View view, int i10, long j10) {
                boolean I3;
                I3 = EZCallLogFragment.this.I3(adapterView, view, i10, j10);
                return I3;
            }
        });
        this.f7063p0.setOnScrollListener(new c());
        r3();
        this.f7077w0 = new l(this, null);
        IntentFilter intentFilter = new IntentFilter();
        intentFilter.addAction("com.callerid.block.RELOAD_DATA_VEST");
        intentFilter.addAction("com.callerid.block.CLOSE_AD_VEST");
        s0.a.b(this.R0).c(this.f7077w0, intentFilter);
        y3.a0.a("testrecommend", "Oncreate方法");
        this.B0 = true;
        return inflate;
    }

    @Override
    public void F0() {
        super.F0();
        try {
            TimerTask timerTask = this.U0;
            if (timerTask != null) {
                timerTask.cancel();
                this.U0 = null;
            }
            Timer timer = this.S0;
            if (timer != null) {
                timer.cancel();
                this.S0 = null;
            }
            y3.c1.P1(false);
        } catch (Exception e10) {
            e10.printStackTrace();
        }
        s0.a.b(this.R0).e(this.f7077w0);
    }

    @Override
    public void Q0() {
        super.Q0();
        y3.c1.P1(false);
    }

    @Override
    public void R1(boolean z10) {
        InputMethodManager inputMethodManager;
        View peekDecorView;
        super.R1(z10);
        y3.a0.a("testrecommend", "setUserVisibleHint()");
        if (z10) {
            y3.m.c().g("enter_callLog_tab_page");
            y3.a0.a("testenter", "首页通话记录展示次数");
            try {
                g3.a.a(new g3.b() {
                    @Override
                    public final void a(boolean z11) {
                        EZCallLogFragment.this.Q3(z11);
                    }
                });
                g3.a.a(new g3.b() {
                    @Override
                    public final void a(boolean z11) {
                        EZCallLogFragment.this.R3(z11);
                    }
                });
                MainActivity mainActivity = this.Q0;
                if (mainActivity == null || (inputMethodManager = (InputMethodManager) mainActivity.getSystemService("input_method")) == null || !inputMethodManager.isActive() || this.Q0.getWindow() == null || (peekDecorView = this.Q0.getWindow().peekDecorView()) == null || peekDecorView.getWindowToken() == null) {
                    return;
                }
                inputMethodManager.hideSoftInputFromWindow(peekDecorView.getWindowToken(), 0);
            } catch (Exception e10) {
                e10.printStackTrace();
            }
        }
    }

    @Override
    public void V0() {
        super.V0();
        try {
            if (y3.c1.l0()) {
                this.Y0.setVisibility(8);
            }
            if (this.L0) {
                this.L0 = false;
            } else {
                g3.a.a(new g3.b() {
                    @Override
                    public final void a(boolean z10) {
                        EZCallLogFragment.this.K3(z10);
                    }
                });
            }
            g3.a.a(new g3.b() {
                @Override
                public final void a(boolean z10) {
                    EZCallLogFragment.this.L3(z10);
                }
            });
            if (c0() != null) {
                c0().setOnKeyListener(new View.OnKeyListener() {
                    @Override
                    public final boolean onKey(View view, int i10, KeyEvent keyEvent) {
                        boolean J3;
                        J3 = EZCallLogFragment.this.J3(view, i10, keyEvent);
                        return J3;
                    }
                });
            }
            f4();
        } catch (Exception e10) {
            e10.printStackTrace();
        }
    }

    public void Y3() {
        Intent createRequestRoleIntent;
        if (Build.VERSION.SDK_INT >= 29) {
            y3.m.c().g("permissiondialershow");
            createRequestRoleIntent = ((RoleManager) this.Q0.getSystemService("role")).createRequestRoleIntent("android.app.role.CALL_SCREENING");
            startActivityForResult(createRequestRoleIntent, 1);
        }
    }

    public void n3() {
        AnonymousClass9 anonymousClass9 = new AnonymousClass9(R.style.SimpleDialogLight);
        anonymousClass9.m(T().getString(R.string.update_dialog_ok)).h(T().getString(R.string.cancel_dialog));
        anonymousClass9.o(T().getString(R.string.delete_all_call));
        anonymousClass9.r(y3.n1.c());
        com.rey.material.app.a.m2(anonymousClass9).l2(G(), null);
    }

    @Override
    @SuppressLint({"NonConstantResourceId", "NewApi"})
    public void onClick(View view) {
        MainActivity mainActivity;
        Intent intent;
        Object systemService;
        boolean isRoleAvailable;
        boolean isRoleHeld;
        int i10;
        int id = view.getId();
        try {
            switch (id) {
                case R.id.call_button:
                    try {
                        String str = (String) view.getTag();
                        if (!y3.j1.h(this.Q0.getApplicationContext())) {
                            mainActivity = this.Q0;
                        } else {
                            if (y3.c1.t() != -1) {
                                return;
                            }
                            if (Build.VERSION.SDK_INT >= 22) {
                                y3.j1.r(this.Q0, str);
                                return;
                            }
                            mainActivity = this.Q0;
                        }
                        y3.t0.a(mainActivity.getApplicationContext(), str);
                        return;
                    } catch (Exception unused) {
                        Toast.makeText(this.Q0.getApplicationContext(), this.Q0.getApplicationContext().getResources().getString(R.string.no_phone_related), 1).show();
                        return;
                    }
                case R.id.iv_select_delete:
                    a4.d.o(this.Q0, new g());
                    y3.c1.P1(false);
                    return;
                case R.id.select_close:
                    y3.c1.P1(false);
                    g4();
                    return;
                case R.id.tv_caller_enable:
                    if (a4.d.i(this.Q0)) {
                        return;
                    }
                    Y3();
                    return;
                case R.id.tv_dissmiss:
                    y3.m.c().g("whatsapp_guide_click_close");
                    y3.c1.p1(false);
                    this.Y0.setVisibility(8);
                    return;
                case R.id.tv_turn_on:
                    y3.m.c().g("whatsapp_guide_click_open");
                    y3.c1.p1(false);
                    if (a4.d.m(this.R0)) {
                        y3.c1.C1(true);
                    } else {
                        a4.e.b(this.R0);
                        f fVar = new f();
                        this.U0 = fVar;
                        Timer timer = this.S0;
                        if (timer != null) {
                            timer.schedule(fVar, 0L, 500L);
                        }
                    }
                    this.Y0.setVisibility(8);
                    return;
                default:
                    switch (id) {
                        case R.id.iv_sim_ask:
                            y3.c1.G0(0);
                            k3();
                            return;
                        case R.id.iv_sim_switch1:
                            y3.c1.G0(1);
                            k3();
                            return;
                        case R.id.iv_sim_switch2:
                            y3.c1.G0(-1);
                            k3();
                            return;
                        default:
                            switch (id) {
                                case R.id.tv_filter_all:
                                    if (y3.c1.i(EZCallApplication.d()) != 0) {
                                        y3.c1.w0(EZCallApplication.d(), 0);
                                        s3();
                                    }
                                    this.f7079x0.dismiss();
                                    return;
                                case R.id.tv_filter_delete:
                                    this.f7079x0.dismiss();
                                    int i11 = Build.VERSION.SDK_INT;
                                    if (i11 < 23 || a4.d.j(EZCallApplication.d())) {
                                        n3();
                                        return;
                                    }
                                    try {
                                        if (i11 >= 29) {
                                            systemService = this.R0.getSystemService((Class<Object>) RoleManager.class);
                                            RoleManager roleManager = (RoleManager) systemService;
                                            if (roleManager != null) {
                                                isRoleAvailable = roleManager.isRoleAvailable("android.app.role.DIALER");
                                                if (isRoleAvailable) {
                                                    isRoleHeld = roleManager.isRoleHeld("android.app.role.DIALER");
                                                    if (isRoleHeld) {
                                                        if (y3.a0.f34733a) {
                                                            y3.a0.a("default_dialer", "This app is the default dialer app");
                                                        }
                                                        n3();
                                                    } else {
                                                        if (y3.a0.f34733a) {
                                                            y3.a0.a("default_dialer", "This app isn't the default dialer app");
                                                        }
                                                        intent = roleManager.createRequestRoleIntent("android.app.role.DIALER");
                                                    }
                                                }
                                            }
                                            y3.m.c().g("delete_request_default_dialer");
                                            return;
                                        }
                                        intent = new Intent("android.telecom.action.CHANGE_DEFAULT_DIALER");
                                        intent.putExtra("android.telecom.extra.CHANGE_DEFAULT_DIALER_PACKAGE_NAME", r1.z(EZCallApplication.d()));
                                        startActivityForResult(intent, ErrorCode.ERROR_CODE_PATH_ERROR);
                                        y3.m.c().g("delete_request_default_dialer");
                                        return;
                                    } catch (Exception e10) {
                                        n3();
                                        e10.printStackTrace();
                                        return;
                                    }
                                case R.id.tv_filter_incoming:
                                    if (y3.c1.i(EZCallApplication.d()) != 1) {
                                        y3.c1.w0(EZCallApplication.d(), 1);
                                        s3();
                                    }
                                    this.f7079x0.dismiss();
                                    return;
                                case R.id.tv_filter_missed:
                                    i10 = 3;
                                    break;
                                case R.id.tv_filter_outgoing:
                                    i10 = 2;
                                    break;
                                default:
                                    return;
                            }
                    }
            }
        } catch (Exception e11) {
            e11.printStackTrace();
        }
        e11.printStackTrace();
    }

    public void r3() {
        try {
            if (a4.d.f(this.R0)) {
                this.f7067r0.clear();
                z2.u uVar = this.f7065q0;
                if (uVar != null) {
                    uVar.notifyDataSetChanged();
                }
                this.f7069s0.clear();
                this.f7073u0.clear();
                i3.c.a(new i3.a() {
                    @Override
                    public final void a(ArrayList arrayList, HashMap hashMap) {
                        EZCallLogFragment.this.A3(arrayList, hashMap);
                    }
                });
            }
        } catch (Exception e10) {
            e10.printStackTrace();
        }
    }

    public void s3() {
        List<CallLogBean> list;
        try {
            if (this.f7069s0.size() > 0) {
                int i10 = y3.c1.i(EZCallApplication.d());
                this.f7067r0.clear();
                for (int i11 = 0; i11 < this.f7069s0.size(); i11++) {
                    CallLogBean callLogBean = this.f7069s0.get(i11);
                    if (i10 == 0) {
                        this.f7067r0.addAll(this.f7069s0);
                    } else if (i10 == 1) {
                        if (callLogBean.J() == 1) {
                            list = this.f7067r0;
                            list.add(callLogBean);
                        }
                    } else if (i10 == 2) {
                        if (callLogBean.J() == 2) {
                            list = this.f7067r0;
                            list.add(callLogBean);
                        }
                    } else if (i10 == 3 && callLogBean.J() == 3) {
                        list = this.f7067r0;
                        list.add(callLogBean);
                    }
                }
                List<CallLogBean> list2 = this.f7067r0;
                if (list2 != null && list2.size() > 0) {
                    this.f7083z0.setText(this.f7067r0.get(0).h());
                }
                this.f7065q0.notifyDataSetChanged();
            }
        } catch (Exception e10) {
            e10.printStackTrace();
        }
    }

    @Override
    public void u0(Bundle bundle) {
        super.u0(bundle);
    }

    @Override
    public void v0(int i10, int i11, Intent intent) {
        super.v0(i10, i11, intent);
        if (i10 == 999 && a4.d.j(EZCallApplication.d())) {
            y3.m.c().g("delete_request_default_dialer_enabled");
        }
        if (i10 == 1) {
            if (!a4.d.i(this.Q0)) {
                try {
                    View inflate = this.Z0.inflate();
                    this.f7052e1 = (com.rey.material.widget.TextView) inflate.findViewById(R.id.showcaller_title);
                    this.f7054g1 = (com.rey.material.widget.TextView) inflate.findViewById(R.id.tv_caller_enable);
                    this.f7053f1 = (com.rey.material.widget.TextView) inflate.findViewById(R.id.showcaller_text);
                    this.f7052e1.setTypeface(this.f7055h1);
                    this.f7053f1.setTypeface(this.C0);
                    this.f7054g1.setTypeface(this.f7055h1);
                    this.f7054g1.setOnClickListener(this);
                    return;
                } catch (Exception unused) {
                    this.Z0.setVisibility(0);
                    return;
                }
            }
            y3.m.c().g("permissiondialershowok");
            this.Z0.setVisibility(8);
            if (!s1.f() || !y3.c1.Z()) {
                this.Y0.setVisibility(8);
                return;
            }
            y3.m.c().g("whatsapp_guide_show");
            try {
                View inflate2 = this.Y0.inflate();
                this.f7048a1 = (com.rey.material.widget.TextView) inflate2.findViewById(R.id.tv_per_title);
                this.f7050c1 = (com.rey.material.widget.TextView) inflate2.findViewById(R.id.tv_turn_on);
                this.f7051d1 = (com.rey.material.widget.TextView) inflate2.findViewById(R.id.tv_dissmiss);
                this.f7049b1 = (com.rey.material.widget.TextView) inflate2.findViewById(R.id.tv_per_contents);
                this.f7048a1.setTypeface(this.f7055h1);
                this.f7049b1.setTypeface(this.C0);
                this.f7050c1.setTypeface(this.f7055h1);
                this.f7051d1.setTypeface(this.f7055h1);
                this.f7050c1.setOnClickListener(this);
                this.f7051d1.setOnClickListener(this);
            } catch (Exception unused2) {
                this.Y0.setVisibility(0);
            }
            this.S0 = new Timer();
        }
    }

    @Override
    public void x0(Context context) {
        super.x0(context);
        this.Q0 = (MainActivity) context;
        this.R0 = context;
    }
}