package com.mexico.inloancash.activity;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import butterknife.ButterKnife;
import com.facebook.AccessToken;
import com.facebook.appevents.codeless.internal.PathComponent;
import com.google.gson.Gson;
import com.indiaholacash.holacash.R;
import com.mexico.inloancash.MyApplication;
import com.mexico.inloancash.bean.BaseBean;
import com.mexico.inloancash.bean.India_MessageInfo_ListBean;
import com.mingle.widget.LoadingView;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import ඓ.ඓ.K.㿎.AbstractC0700;
import ඓ.ඓ.K.㿎.C0701;
import ῲ.ᨨ.㳳.C1841;

public class IndiaHomeActivity extends BaseActivity {
    public LoadingView loadView;
    public Button mIndiaCommitButton;
    public TextView mIndiaDarurat_Content;
    public ImageView mIndiaDarurat_Image;
    public LinearLayout mIndiaDarurat_Linear;
    public ImageView mIndiaDarurat_SureImage;
    public TextView mIndiaDarurat_Text;
    public LinearLayout mIndiaDataLinear;
    public TextView mIndiaIdentitasContent;
    public ImageView mIndiaIdentitasImage;
    public TextView mIndiaIdentitasText;
    public LinearLayout mIndiaIdentitas_Linear;
    public ImageView mIndiaIdentitas_SureImage;
    public ImageView mIndiaLogonBack;
    public ImageView mIndiaPeker_jaanSure_Image;
    public TextView mIndiaPeker_jaanText;
    public TextView mIndiaPeker_jaan_Content;
    public ImageView mIndiaPekerjaan_Image;
    public TextView mIndiaPribadi_Content;
    public ImageView mIndiaPribadi_Image;
    public LinearLayout mIndiaPribadi_Linear;
    public ImageView mIndiaPribadi_SureImage;
    public TextView mIndiaPribadi_Text;
    public ImageView mIndiaTvAuthContact;
    public ImageView mIndiaTvAuthFace;
    public ImageView mIndiaTvAuthPersonalInfo;

    /* renamed from: ඓ  reason: contains not printable characters */
    public boolean f2442 = false;

    /* renamed from: ⁱ  reason: contains not printable characters */
    public boolean f2443 = false;

    /* renamed from: 㴹  reason: contains not printable characters */
    public boolean f2444 = false;

    /* renamed from: 㿎  reason: contains not printable characters */
    public boolean f2445 = false;

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

        @Override // retrofit2.Callback
        public void onFailure(Call<String> call, Throwable th) {
            IndiaHomeActivity.this.f2296.m2185();
        }

        @Override // retrofit2.Callback
        public void onResponse(Call<String> call, Response<String> response) {
            try {
                if (response.isSuccessful()) {
                    BaseBean baseBean = (BaseBean) new Gson().fromJson(response.body(), BaseBean.class);
                    if (baseBean.getCode() == 200) {
                        C1841.m4749();
                        IndiaHomeActivity.this.startActivity(new Intent(IndiaHomeActivity.this, IndiaAuthActivity.class));
                        IndiaHomeActivity.this.finish();
                    } else if (baseBean.getCode() == 401) {
                        IndiaHomeActivity.this.startActivity(new Intent(IndiaHomeActivity.this, IndiaLoginActivity.class));
                    } else {
                        C1841.m4792((Context) IndiaHomeActivity.this, baseBean.getMsg());
                    }
                }
            } catch (Exception unused) {
            }
            IndiaHomeActivity.this.f2296.m2185();
        }
    }

    /* renamed from: com.mexico.inloancash.activity.IndiaHomeActivity$K  reason: contains not printable characters */
    public class C0406 implements Callback<String> {
        public C0406() {
        }

        @Override // retrofit2.Callback
        public void onFailure(Call<String> call, Throwable th) {
            IndiaHomeActivity.this.loadView.setVisibility(8);
            IndiaHomeActivity.this.mIndiaDataLinear.setVisibility(0);
        }

        @Override // retrofit2.Callback
        public void onResponse(Call<String> call, Response<String> response) {
            try {
                if (response.isSuccessful()) {
                    India_MessageInfo_ListBean india_MessageInfo_ListBean = (India_MessageInfo_ListBean) new Gson().fromJson(response.body(), India_MessageInfo_ListBean.class);
                    Log.d("loan", "onResponse:" + response.body());
                    if (india_MessageInfo_ListBean.getCode() == 200) {
                        if (india_MessageInfo_ListBean.getData() != null) {
                            if (india_MessageInfo_ListBean.getData().getOcr() == 1) {
                                IndiaHomeActivity.this.f2442 = true;
                                IndiaHomeActivity.this.mIndiaTvAuthFace.setImageResource(R.mipmap.choose_complet);
                            } else {
                                IndiaHomeActivity.this.mIndiaTvAuthFace.setImageResource(R.mipmap.choose_unfocus);
                                IndiaHomeActivity.this.f2442 = false;
                            }
                            if (india_MessageInfo_ListBean.getData().getCominfo() == 1 && india_MessageInfo_ListBean.getData().getContacts() == 1) {
                                IndiaHomeActivity.this.mIndiaTvAuthPersonalInfo.setImageResource(R.mipmap.choose_complet);
                            } else {
                                IndiaHomeActivity.this.mIndiaTvAuthPersonalInfo.setImageResource(R.mipmap.choose_unfocus);
                            }
                            if (india_MessageInfo_ListBean.getData().getCominfo() == 1) {
                                IndiaHomeActivity.this.f2444 = true;
                            } else {
                                IndiaHomeActivity.this.f2444 = false;
                            }
                            if (india_MessageInfo_ListBean.getData().getContacts() == 1) {
                                IndiaHomeActivity.this.f2443 = true;
                            } else {
                                IndiaHomeActivity.this.f2443 = false;
                            }
                            if (india_MessageInfo_ListBean.getData().getBankinfo() == 1) {
                                IndiaHomeActivity.this.f2445 = true;
                                IndiaHomeActivity.this.mIndiaTvAuthContact.setImageResource(R.mipmap.choose_complet);
                            } else {
                                IndiaHomeActivity.this.f2445 = false;
                                IndiaHomeActivity.this.mIndiaTvAuthContact.setImageResource(R.mipmap.choose_unfocus);
                            }
                        } else {
                            IndiaHomeActivity.this.f2445 = true;
                        }
                        if (!IndiaHomeActivity.this.f2442 || !IndiaHomeActivity.this.f2444 || !IndiaHomeActivity.this.f2445) {
                            IndiaHomeActivity.this.mIndiaCommitButton.setSelected(false);
                        } else {
                            IndiaHomeActivity.this.mIndiaCommitButton.setSelected(true);
                        }
                    } else if (india_MessageInfo_ListBean.getCode() == 401) {
                        IndiaHomeActivity.this.startActivity(new Intent(IndiaHomeActivity.this, IndiaLoginActivity.class));
                    } else if (india_MessageInfo_ListBean.getCode() != 60) {
                        if (india_MessageInfo_ListBean.getCode() != 40) {
                            if (india_MessageInfo_ListBean.getCode() != 41) {
                                if (india_MessageInfo_ListBean.getCode() != 42) {
                                    if (india_MessageInfo_ListBean.getCode() != 43) {
                                        if (india_MessageInfo_ListBean.getCode() != 44) {
                                            if (india_MessageInfo_ListBean.getCode() != 45) {
                                                india_MessageInfo_ListBean.getCode();
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            } catch (Exception unused) {
            }
            IndiaHomeActivity.this.loadView.setVisibility(8);
            IndiaHomeActivity.this.mIndiaDataLinear.setVisibility(0);
        }
    }

    @Override // androidx.activity.ComponentActivity, androidx.core.app.ComponentActivity, com.mexico.inloancash.activity.BaseActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.india_activity_view_authentication);
        ButterKnife.m1066(this);
        C1841.m4791((Activity) this, (int) R.color.theme);
        if (MainActivity.f2549) {
            this.mIndiaCommitButton.setVisibility(8);
        } else {
            this.mIndiaCommitButton.setVisibility(0);
        }
    }

    @Override // androidx.appcompat.app.AppCompatActivity
    public boolean onKeyDown(int i, KeyEvent keyEvent) {
        if (i == 4) {
            finish();
        }
        return super.onKeyDown(i, keyEvent);
    }

    @Override // com.mexico.inloancash.activity.BaseActivity, androidx.fragment.app.FragmentActivity
    public void onResume() {
        super.onResume();
        m1426();
    }

    /* JADX INFO: Can't fix incorrect switch cases order, some code will duplicate */
    public void onViewClicked(View view) {
        Intent intent = new Intent(this, IndiaCerActivity.class);
        switch (view.getId()) {
            case R.id.commit_button /*{ENCODED_INT: 2131296458}*/:
                if (this.mIndiaCommitButton.isSelected()) {
                    m1427();
                    return;
                } else {
                    Toast.makeText(this, "Please complete the above certification", 0).show();
                    return;
                }
            case R.id.darurat_linear /*{ENCODED_INT: 2131296479}*/:
                startActivity(new Intent(this, IndiaAddBankActivity.class));
                return;
            case R.id.identitas_linear /*{ENCODED_INT: 2131296609}*/:
                if (this.f2442) {
                    C1841.m4792((Context) this, "Certification");
                    break;
                } else {
                    intent.putExtra(PathComponent.PATH_INDEX_KEY, 1);
                    startActivity(intent);
                    break;
                }
            case R.id.logon_back /*{ENCODED_INT: 2131296676}*/:
                finish();
                return;
            case R.id.pribadi_linear /*{ENCODED_INT: 2131296816}*/:
                break;
            default:
                return;
        }
        if (!this.f2444) {
            if (this.f2442) {
                intent.putExtra(PathComponent.PATH_INDEX_KEY, 2);
                startActivity(intent);
                return;
            }
            Toast.makeText(this, "Please complete the above certification", 0).show();
        } else if (this.f2443) {
            C1841.m4792((Context) this, "Certification");
        } else if (this.f2442) {
            intent.putExtra(PathComponent.PATH_INDEX_KEY, 3);
            startActivity(intent);
        } else {
            Toast.makeText(this, "Please complete the above certification", 0).show();
        }
    }

    /* renamed from: ؿ  reason: contains not printable characters */
    public void m1426() {
        Log.d("loan", "getAuthInfo");
        AbstractC0700 r0 = C0701.f3707.m2131();
        String r1 = C1841.m4788(AccessToken.TOKEN_KEY, "");
        MyApplication.m1353();
        r0.m2118(r1, MyApplication.f2291).enqueue(new C0406());
    }

    /* renamed from: ᓣ  reason: contains not printable characters */
    public void m1427() {
        this.f2296.m2183();
        C0701.f3707.m2131().m2127(C1841.m4788(AccessToken.TOKEN_KEY, ""), MyApplication.f2291).enqueue(new C0405());
    }
}
