MBBD Trace v1.0版本的 MD5 值为:f0273367d111799d70c685af03877187

以下内容为反编译后的 HomeActivity.java 源代码,内容仅作参考


package com.bipul.trace;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.ColorStateList;
import android.database.Cursor;
import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.RippleDrawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Vibrator;
import android.provider.ContactsContract;
import android.util.SparseBooleanArray;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.constraintlayout.core.motion.utils.TypedValues;
import androidx.core.view.PointerIconCompat;
import androidx.exifinterface.media.ExifInterface;
import com.bumptech.glide.Glide;
import com.google.android.gms.common.internal.ImagesContract;
import com.google.firebase.FirebaseApp;
import com.google.firebase.database.ChildEventListener;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.GenericTypeIndicator;
import com.google.gson.Gson;
import de.hdodenhof.circleimageview.CircleImageView;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.HashMap;
import java.util.Random;
import org.apache.http.cookie.ClientCookie;
public class HomeActivity extends AppCompatActivity {
    private TextView Blood;
    private ChildEventListener _profiles_child_listener;
    private ChildEventListener _shownmbr_child_listener;
    private ChildEventListener _update_child_listener;
    private LinearLayout back;
    private LinearLayout call;
    private LinearLayout callLogPermisionBox;
    private CircleImageView circleimageview2;
    private LinearLayout contactbox;
    private LinearLayout contactbtn;
    private LinearLayout contactpermission;
    private SharedPreferences datas;
    private LinearLayout dialerbox;
    private LinearLayout dialerbtn;
    private TextView give_call_log_permission;
    private TextView give_contact_permission;
    private ImageView imageview1;
    private ImageView imageview10;
    private ImageView imageview11;
    private ImageView imageview12;
    private ImageView imageview13;
    private ImageView imageview2;
    private ImageView imageview4;
    private ImageView imageview5;
    private ImageView imageview6;
    private ImageView imageview7;
    private ImageView img;
    private LinearLayout linear1;
    private LinearLayout linear10;
    private LinearLayout linear12;
    private LinearLayout linear13;
    private LinearLayout linear14;
    private LinearLayout linear16;
    private LinearLayout linear18;
    private LinearLayout linear2;
    private LinearLayout linear20;
    private LinearLayout linear21;
    private LinearLayout linear22;
    private LinearLayout linear24;
    private LinearLayout linear26;
    private LinearLayout linear28;
    private LinearLayout linear29;
    private LinearLayout linear3;
    private LinearLayout linear30;
    private LinearLayout linear32;
    private LinearLayout linear34;
    private LinearLayout linear36;
    private LinearLayout linear4;
    private LinearLayout linear44;
    private LinearLayout linear45;
    private LinearLayout linear46;
    private LinearLayout linear48;
    private LinearLayout linear5;
    private LinearLayout linear50;
    private LinearLayout linear51;
    private LinearLayout linear52;
    private LinearLayout linear56;
    private LinearLayout linear57;
    private LinearLayout linear6;
    private LinearLayout linear8;
    private LinearLayout linname;
    private ListView listview1;
    private ListView listview2;
    private LinearLayout logbox;
    private LinearLayout logbtn;
    private LinearLayout mag;
    private LinearLayout morebtn;
    private TextView namev;
    private TextView numb;
    private LinearLayout searchbtn;
    private TextView textview21;
    private TextView textview22;
    private TextView textview23;
    private TextView textview24;
    private TextView textview25;
    private TextView textview26;
    private TextView textview27;
    private TextView textview28;
    private TextView textview29;
    private TextView textview30;
    private TextView textview31;
    private TextView textview32;
    private TextView textview33;
    private TextView textview34;
    private TextView textview35;
    private TextView textview36;
    private TextView textview37;
    private TextView textview38;
    private TextView textview39;
    private TextView textview41;
    private TextView textview42;
    private AlertDialog.Builder up;
    private Vibrator vb;
    private LinearLayout x0;
    private LinearLayout x1;
    private LinearLayout x2;
    private LinearLayout x3;
    private LinearLayout x4;
    private LinearLayout x5;
    private LinearLayout x6;
    private LinearLayout x7;
    private LinearLayout x8;
    private LinearLayout x9;
    private LinearLayout xhash;
    private LinearLayout xstar;
    private FirebaseDatabase _firebase = FirebaseDatabase.getInstance();
    private String backgroundColor = "";
    private double radius1 = 0.0d;
    private String names = "";
    private HashMap<String, Object> map = new HashMap<>();
    private double type = 0.0d;
    private double min = 0.0d;
    private double sec = 0.0d;
    private double hr = 0.0d;
    private String durationTm = "";
    private HashMap<String, Object> bipul = new HashMap<>();
    private String jsonMap = "";
    private HashMap<String, Object> mam = new HashMap<>();
    private String str = "";
    private String nmbr = "";
    private ArrayList<HashMap<String, Object>> contacts = new ArrayList<>();
    private ArrayList<HashMap<String, Object>> callLog = new ArrayList<>();
    private Calendar cal = Calendar.getInstance();
    private Intent i = new Intent();
    private Intent sms = new Intent();
    private Intent Call = new Intent();
    private DatabaseReference profiles = this._firebase.getReference("profiles");
    private DatabaseReference shownmbr = this._firebase.getReference("profiles");
    private Intent vi = new Intent();
    private DatabaseReference update = this._firebase.getReference("update");
    private Intent upda = new Intent();

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.home);
        initialize(bundle);
        FirebaseApp.initializeApp(this);
        initializeLogic();
    }

    private void initialize(Bundle bundle) {
        this.linear1 = (LinearLayout) findViewById(R.id.linear1);
        this.linear2 = (LinearLayout) findViewById(R.id.linear2);
        this.linear5 = (LinearLayout) findViewById(R.id.linear5);
        this.dialerbox = (LinearLayout) findViewById(R.id.dialerbox);
        this.logbox = (LinearLayout) findViewById(R.id.logbox);
        this.contactbox = (LinearLayout) findViewById(R.id.contactbox);
        this.textview21 = (TextView) findViewById(R.id.textview21);
        this.searchbtn = (LinearLayout) findViewById(R.id.searchbtn);
        this.morebtn = (LinearLayout) findViewById(R.id.morebtn);
        this.imageview1 = (ImageView) findViewById(R.id.imageview1);
        this.imageview2 = (ImageView) findViewById(R.id.imageview2);
        this.linear3 = (LinearLayout) findViewById(R.id.linear3);
        this.linname = (LinearLayout) findViewById(R.id.linname);
        this.numb = (TextView) findViewById(R.id.numb);
        this.linear4 = (LinearLayout) findViewById(R.id.linear4);
        this.linear12 = (LinearLayout) findViewById(R.id.linear12);
        this.linear20 = (LinearLayout) findViewById(R.id.linear20);
        this.linear28 = (LinearLayout) findViewById(R.id.linear28);
        this.linear44 = (LinearLayout) findViewById(R.id.linear44);
        this.img = (ImageView) findViewById(R.id.img);
        this.Blood = (TextView) findViewById(R.id.Blood);
        this.namev = (TextView) findViewById(R.id.namev);
        this.linear6 = (LinearLayout) findViewById(R.id.linear6);
        this.x1 = (LinearLayout) findViewById(R.id.x1);
        this.linear8 = (LinearLayout) findViewById(R.id.linear8);
        this.x2 = (LinearLayout) findViewById(R.id.x2);
        this.linear10 = (LinearLayout) findViewById(R.id.linear10);
        this.x3 = (LinearLayout) findViewById(R.id.x3);
        this.linear13 = (LinearLayout) findViewById(R.id.linear13);
        this.textview25 = (TextView) findViewById(R.id.textview25);
        this.textview26 = (TextView) findViewById(R.id.textview26);
        this.textview27 = (TextView) findViewById(R.id.textview27);
        this.linear14 = (LinearLayout) findViewById(R.id.linear14);
        this.x4 = (LinearLayout) findViewById(R.id.x4);
        this.linear16 = (LinearLayout) findViewById(R.id.linear16);
        this.x5 = (LinearLayout) findViewById(R.id.x5);
        this.linear18 = (LinearLayout) findViewById(R.id.linear18);
        this.x6 = (LinearLayout) findViewById(R.id.x6);
        this.linear21 = (LinearLayout) findViewById(R.id.linear21);
        this.textview28 = (TextView) findViewById(R.id.textview28);
        this.textview29 = (TextView) findViewById(R.id.textview29);
        this.textview30 = (TextView) findViewById(R.id.textview30);
        this.linear22 = (LinearLayout) findViewById(R.id.linear22);
        this.x7 = (LinearLayout) findViewById(R.id.x7);
        this.linear24 = (LinearLayout) findViewById(R.id.linear24);
        this.x8 = (LinearLayout) findViewById(R.id.x8);
        this.linear26 = (LinearLayout) findViewById(R.id.linear26);
        this.x9 = (LinearLayout) findViewById(R.id.x9);
        this.linear29 = (LinearLayout) findViewById(R.id.linear29);
        this.textview31 = (TextView) findViewById(R.id.textview31);
        this.textview32 = (TextView) findViewById(R.id.textview32);
        this.textview33 = (TextView) findViewById(R.id.textview33);
        this.linear30 = (LinearLayout) findViewById(R.id.linear30);
        this.xstar = (LinearLayout) findViewById(R.id.xstar);
        this.linear32 = (LinearLayout) findViewById(R.id.linear32);
        this.x0 = (LinearLayout) findViewById(R.id.x0);
        this.linear34 = (LinearLayout) findViewById(R.id.linear34);
        this.xhash = (LinearLayout) findViewById(R.id.xhash);
        this.linear36 = (LinearLayout) findViewById(R.id.linear36);
        this.circleimageview2 = (CircleImageView) findViewById(R.id.circleimageview2);
        this.textview34 = (TextView) findViewById(R.id.textview34);
        this.textview35 = (TextView) findViewById(R.id.textview35);
        this.textview37 = (TextView) findViewById(R.id.textview37);
        this.textview36 = (TextView) findViewById(R.id.textview36);
        this.linear48 = (LinearLayout) findViewById(R.id.linear48);
        this.mag = (LinearLayout) findViewById(R.id.mag);
        this.linear45 = (LinearLayout) findViewById(R.id.linear45);
        this.call = (LinearLayout) findViewById(R.id.call);
        this.linear46 = (LinearLayout) findViewById(R.id.linear46);
        this.back = (LinearLayout) findViewById(R.id.back);
        this.linear50 = (LinearLayout) findViewById(R.id.linear50);
        this.imageview10 = (ImageView) findViewById(R.id.imageview10);
        this.imageview7 = (ImageView) findViewById(R.id.imageview7);
        this.imageview11 = (ImageView) findViewById(R.id.imageview11);
        this.listview2 = (ListView) findViewById(R.id.listview2);
        this.callLogPermisionBox = (LinearLayout) findViewById(R.id.callLogPermisionBox);
        this.linear56 = (LinearLayout) findViewById(R.id.linear56);
        this.give_call_log_permission = (TextView) findViewById(R.id.give_call_log_permission);
        this.imageview13 = (ImageView) findViewById(R.id.imageview13);
        this.linear57 = (LinearLayout) findViewById(R.id.linear57);
        this.textview41 = (TextView) findViewById(R.id.textview41);
        this.textview42 = (TextView) findViewById(R.id.textview42);
        this.listview1 = (ListView) findViewById(R.id.listview1);
        this.contactpermission = (LinearLayout) findViewById(R.id.contactpermission);
        this.linear51 = (LinearLayout) findViewById(R.id.linear51);
        this.give_contact_permission = (TextView) findViewById(R.id.give_contact_permission);
        this.imageview12 = (ImageView) findViewById(R.id.imageview12);
        this.linear52 = (LinearLayout) findViewById(R.id.linear52);
        this.textview38 = (TextView) findViewById(R.id.textview38);
        this.textview39 = (TextView) findViewById(R.id.textview39);
        this.dialerbtn = (LinearLayout) findViewById(R.id.dialerbtn);
        this.logbtn = (LinearLayout) findViewById(R.id.logbtn);
        this.contactbtn = (LinearLayout) findViewById(R.id.contactbtn);
        this.imageview4 = (ImageView) findViewById(R.id.imageview4);
        this.textview22 = (TextView) findViewById(R.id.textview22);
        this.imageview5 = (ImageView) findViewById(R.id.imageview5);
        this.textview23 = (TextView) findViewById(R.id.textview23);
        this.imageview6 = (ImageView) findViewById(R.id.imageview6);
        this.textview24 = (TextView) findViewById(R.id.textview24);
        this.datas = getSharedPreferences("datas", 0);
        this.vb = (Vibrator) getSystemService("vibrator");
        this.up = new AlertDialog.Builder(this);
        this.searchbtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                HomeActivity.this.i.setClass(HomeActivity.this.getApplicationContext(), SearchActivity.class);
                HomeActivity.this.startActivity(HomeActivity.this.i);
            }
        });
        this.morebtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                HomeActivity.this.i.setClass(HomeActivity.this.getApplicationContext(), MoreActivity.class);
                HomeActivity.this.startActivity(HomeActivity.this.i);
            }
        });
        this.numb.setOnLongClickListener(new View.OnLongClickListener() {
            @Override
            public boolean onLongClick(View view) {
                return true;
            }
        });
        this.namev.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (!HomeActivity.this.namev.getText().toString().equals("")) {
                    HomeActivity.this.vi.setAction("android.intent.action.VIEW");
                    HomeActivity.this.vi.setData(Uri.parse("https://jannat-mbbdteam.blogspot.com/p/p.html?mode=App&v=1&phone=".concat(HomeActivity.this.numb.getText().toString())));
                    HomeActivity.this.startActivity(Intent.createChooser(HomeActivity.this.vi, "Choice a Browser "));
                }
            }
        });
        this.x1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                HomeActivity.this._AddValueToText("1");
            }
        });
        this.x2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                HomeActivity.this._AddValueToText(ExifInterface.GPS_MEASUREMENT_2D);
            }
        });
        this.x3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                HomeActivity.this._AddValueToText(ExifInterface.GPS_MEASUREMENT_3D);
            }
        });
        this.x4.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                HomeActivity.this._AddValueToText("4");
            }
        });
        this.x5.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                HomeActivity.this._AddValueToText("5");
            }
        });
        this.x6.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                HomeActivity.this._AddValueToText("6");
            }
        });
        this.x7.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                HomeActivity.this._AddValueToText("7");
            }
        });
        this.x8.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                HomeActivity.this._AddValueToText("8");
            }
        });
        this.x9.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                HomeActivity.this._AddValueToText("9");
            }
        });
        this.xstar.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                HomeActivity.this._AddValueToText("*");
            }
        });
        this.x0.setOnLongClickListener(new View.OnLongClickListener() {
            @Override
            public boolean onLongClick(View view) {
                HomeActivity.this._AddValueToText("+");
                return true;
            }
        });
        this.x0.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                HomeActivity.this._AddValueToText("0");
            }
        });
        this.xhash.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                HomeActivity.this._AddValueToText("#");
            }
        });
        this.mag.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                HomeActivity.this.sms.setAction("android.intent.action.VIEW");
                HomeActivity.this.sms.setData(Uri.parse("sms:".concat(HomeActivity.this.numb.getText().toString())));
                HomeActivity.this.sms.putExtra("sms_body", "");
                HomeActivity.this.startActivity(HomeActivity.this.sms);
            }
        });
        this.call.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (HomeActivity.this.checkSelfPermission("android.permission.CALL_PHONE") != -1) {
                    HomeActivity.this.Call.setAction("android.intent.action.CALL");
                    HomeActivity.this.Call.setData(Uri.parse("tel:".concat(HomeActivity.this.numb.getText().toString())));
                    HomeActivity.this.startActivity(HomeActivity.this.Call);
                    SketchwareUtil.showMessage(HomeActivity.this.getApplicationContext(), "Calling To ".concat(HomeActivity.this.namev.getText().toString()));
                    return;
                }
                HomeActivity.this.requestPermissions(new String[]{"android.permission.CALL_PHONE"}, 1000);
            }
        });
        this.back.setOnLongClickListener(new View.OnLongClickListener() {
            @Override
            public boolean onLongClick(View view) {
                HomeActivity.this.numb.setText("");
                HomeActivity.this._checkText();
                return true;
            }
        });
        this.back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                HomeActivity.this._backSpace();
                HomeActivity.this.linname.setVisibility(8);
            }
        });
        this.give_call_log_permission.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                HomeActivity.this.requestPermissions(new String[]{"android.permission.READ_CALL_LOG"}, PointerIconCompat.TYPE_ALIAS);
            }
        });
        this.give_contact_permission.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                HomeActivity.this.requestPermissions(new String[]{"android.permission.READ_CONTACTS"}, 9090);
            }
        });
        this.dialerbtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                HomeActivity.this._clickDial();
            }
        });
        this.logbtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                HomeActivity.this._clickCall();
            }
        });
        this.contactbtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                HomeActivity.this._clickPeople();
                SketchwareUtil.showMessage(HomeActivity.this.getApplicationContext(), String.valueOf(HomeActivity.this.contacts.size()).concat(" Contacts"));
            }
        });
        this._profiles_child_listener = new ChildEventListener() {
            @Override
            public void onChildAdded(DataSnapshot dataSnapshot, String str) {
                GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
                };
                dataSnapshot.getKey();
                HashMap hashMap = (HashMap) dataSnapshot.getValue(genericTypeIndicator);
            }

            @Override
            public void onChildChanged(DataSnapshot dataSnapshot, String str) {
                GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
                };
                dataSnapshot.getKey();
                HashMap hashMap = (HashMap) dataSnapshot.getValue(genericTypeIndicator);
            }

            @Override
            public void onChildMoved(DataSnapshot dataSnapshot, String str) {
            }

            @Override
            public void onChildRemoved(DataSnapshot dataSnapshot) {
                GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
                };
                dataSnapshot.getKey();
                HashMap hashMap = (HashMap) dataSnapshot.getValue(genericTypeIndicator);
            }

            @Override
            public void onCancelled(DatabaseError databaseError) {
                databaseError.getCode();
                databaseError.getMessage();
            }
        };
        this.profiles.addChildEventListener(this._profiles_child_listener);
        this._shownmbr_child_listener = new ChildEventListener() {
            @Override
            public void onChildAdded(DataSnapshot dataSnapshot, String str) {
                GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
                };
                String key = dataSnapshot.getKey();
                HashMap hashMap = (HashMap) dataSnapshot.getValue(genericTypeIndicator);
                if (key.equals(HomeActivity.this.numb.getText().toString())) {
                    HomeActivity.this.namev.setText(hashMap.get("name").toString());
                    HomeActivity.this.linname.setVisibility(0);
                    if (hashMap.containsKey("photo")) {
                        HomeActivity.this.img.setVisibility(0);
                        Glide.with(HomeActivity.this.getApplicationContext()).load(Uri.parse(hashMap.get("photo").toString())).into(HomeActivity.this.img);
                    }
                    if (hashMap.containsKey("blood")) {
                        HomeActivity.this.img.setVisibility(0);
                        HomeActivity.this.Blood.setText(hashMap.get("blood").toString());
                    }
                }
            }

            @Override
            public void onChildChanged(DataSnapshot dataSnapshot, String str) {
                GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
                };
                String key = dataSnapshot.getKey();
                HashMap hashMap = (HashMap) dataSnapshot.getValue(genericTypeIndicator);
                if (key.equals(HomeActivity.this.numb.getText().toString())) {
                    HomeActivity.this.namev.setText(hashMap.get("name").toString());
                    HomeActivity.this.linname.setVisibility(0);
                    if (hashMap.containsKey("photo")) {
                        HomeActivity.this.img.setVisibility(0);
                        Glide.with(HomeActivity.this.getApplicationContext()).load(Uri.parse(hashMap.get("photo").toString())).into(HomeActivity.this.img);
                    }
                }
            }

            @Override
            public void onChildMoved(DataSnapshot dataSnapshot, String str) {
            }

            @Override
            public void onChildRemoved(DataSnapshot dataSnapshot) {
                GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
                };
                dataSnapshot.getKey();
                HashMap hashMap = (HashMap) dataSnapshot.getValue(genericTypeIndicator);
            }

            @Override
            public void onCancelled(DatabaseError databaseError) {
                databaseError.getCode();
                databaseError.getMessage();
            }
        };
        this.shownmbr.addChildEventListener(this._shownmbr_child_listener);
        this._update_child_listener = new ChildEventListener() {
            @Override
            public void onChildAdded(DataSnapshot dataSnapshot, String str) {
                GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
                };
                dataSnapshot.getKey();
                final HashMap hashMap = (HashMap) dataSnapshot.getValue(genericTypeIndicator);
                if (hashMap.get(ClientCookie.VERSION_ATTR).toString().equals(ExifInterface.GPS_MEASUREMENT_2D)) {
                    HomeActivity.this.up.setTitle("Update Available!");
                    HomeActivity.this.up.setIcon(R.drawable.sts);
                    HomeActivity.this.up.setMessage(hashMap.get("details").toString());
                    HomeActivity.this.up.setPositiveButton("Update", new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialogInterface, int i) {
                            HomeActivity.this.upda.setAction("android.intent.action.VIEW");
                            HomeActivity.this.upda.setData(Uri.parse(hashMap.get(ImagesContract.URL).toString()));
                            HomeActivity.this.startActivity(Intent.createChooser(HomeActivity.this.upda, "Download The App"));
                            HomeActivity.this.finish();
                        }
                    });
                    HomeActivity.this.up.setCancelable(false);
                    HomeActivity.this.up.create().show();
                }
            }

            @Override
            public void onChildChanged(DataSnapshot dataSnapshot, String str) {
                GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
                };
                dataSnapshot.getKey();
                HashMap hashMap = (HashMap) dataSnapshot.getValue(genericTypeIndicator);
            }

            @Override
            public void onChildMoved(DataSnapshot dataSnapshot, String str) {
            }

            @Override
            public void onChildRemoved(DataSnapshot dataSnapshot) {
                GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
                };
                dataSnapshot.getKey();
                HashMap hashMap = (HashMap) dataSnapshot.getValue(genericTypeIndicator);
            }

            @Override
            public void onCancelled(DatabaseError databaseError) {
                databaseError.getCode();
                databaseError.getMessage();
            }
        };
        this.update.addChildEventListener(this._update_child_listener);
    }

    private void initializeLogic() {
        if (Build.VERSION.SDK_INT > 19) {
            Window window = getWindow();
            window.clearFlags(67108864);
            window.addFlags(Integer.MIN_VALUE);
            window.setStatusBarColor(-1);
        }
        getWindow().getDecorView().setSystemUiVisibility(8192);
        getWindow().setStatusBarColor(-1);
        _cssstyles();
        this.radius1 = 50.0d;
        _checkText();
        _readContacts();
        _readCallLogs();
        String string = this.datas.getString("tab", "");
        switch (string.hashCode()) {
            case 609404514:
                if (string.equals("CALL LOG")) {
                    _clickCall();
                    break;
                }
                _clickDial();
                break;
            case 1669509120:
                if (string.equals("CONTACT")) {
                    _clickPeople();
                    break;
                }
                _clickDial();
                break;
            default:
                _clickDial();
                break;
        }
        this.linname.setVisibility(8);
        this.img.setVisibility(8);
        this.shownmbr.removeEventListener(this._shownmbr_child_listener);
    }

    public void _cssstyles() {
        GradientDrawable gradientDrawable = new GradientDrawable();
        gradientDrawable.setColor(-1);
        gradientDrawable.setCornerRadius(((int) getApplicationContext().getResources().getDisplayMetrics().density) * 40);
        this.searchbtn.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-14575885}), gradientDrawable, null));
        this.searchbtn.setClickable(true);
        GradientDrawable gradientDrawable2 = new GradientDrawable();
        gradientDrawable2.setColor(-1);
        gradientDrawable2.setCornerRadius(((int) getApplicationContext().getResources().getDisplayMetrics().density) * 40);
        this.morebtn.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-14575885}), gradientDrawable2, null));
        this.morebtn.setClickable(true);
        _styleView(this.dialerbtn, this.radius1, 0.0d, "#EEEEEE");
        _styleView(this.logbtn, this.radius1, 0.0d, "#EEEEEE");
        _styleView(this.contactbtn, this.radius1, 0.0d, "#EEEEEE");
        new GradientDrawable();
        GradientDrawable gradientDrawable3 = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{-1118482, -1118482});
        gradientDrawable3.setCornerRadius(((int) getApplicationContext().getResources().getDisplayMetrics().density) * 100);
        this.x1.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-14575885}), gradientDrawable3, null));
        this.x1.setClickable(true);
        new GradientDrawable();
        GradientDrawable gradientDrawable4 = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{-1118482, -1118482});
        gradientDrawable4.setCornerRadius(((int) getApplicationContext().getResources().getDisplayMetrics().density) * 100);
        this.x2.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-14575885}), gradientDrawable4, null));
        this.x2.setClickable(true);
        new GradientDrawable();
        GradientDrawable gradientDrawable5 = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{-1118482, -1118482});
        gradientDrawable5.setCornerRadius(((int) getApplicationContext().getResources().getDisplayMetrics().density) * 100);
        this.x3.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-14575885}), gradientDrawable5, null));
        this.x3.setClickable(true);
        new GradientDrawable();
        GradientDrawable gradientDrawable6 = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{-1118482, -1118482});
        gradientDrawable6.setCornerRadius(((int) getApplicationContext().getResources().getDisplayMetrics().density) * 100);
        this.x4.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-14575885}), gradientDrawable6, null));
        this.x4.setClickable(true);
        new GradientDrawable();
        GradientDrawable gradientDrawable7 = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{-1118482, -1118482});
        gradientDrawable7.setCornerRadius(((int) getApplicationContext().getResources().getDisplayMetrics().density) * 100);
        this.x5.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-14575885}), gradientDrawable7, null));
        this.x5.setClickable(true);
        new GradientDrawable();
        GradientDrawable gradientDrawable8 = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{-1118482, -1118482});
        gradientDrawable8.setCornerRadius(((int) getApplicationContext().getResources().getDisplayMetrics().density) * 100);
        this.x6.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-14575885}), gradientDrawable8, null));
        this.x6.setClickable(true);
        new GradientDrawable();
        GradientDrawable gradientDrawable9 = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{-1118482, -1118482});
        gradientDrawable9.setCornerRadius(((int) getApplicationContext().getResources().getDisplayMetrics().density) * 100);
        this.x7.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-14575885}), gradientDrawable9, null));
        this.x7.setClickable(true);
        new GradientDrawable();
        GradientDrawable gradientDrawable10 = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{-1118482, -1118482});
        gradientDrawable10.setCornerRadius(((int) getApplicationContext().getResources().getDisplayMetrics().density) * 100);
        this.x8.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-14575885}), gradientDrawable10, null));
        this.x8.setClickable(true);
        new GradientDrawable();
        GradientDrawable gradientDrawable11 = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{-1118482, -1118482});
        gradientDrawable11.setCornerRadius(((int) getApplicationContext().getResources().getDisplayMetrics().density) * 100);
        this.x9.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-14575885}), gradientDrawable11, null));
        this.x9.setClickable(true);
        new GradientDrawable();
        GradientDrawable gradientDrawable12 = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{-1118482, -1118482});
        gradientDrawable12.setCornerRadius(((int) getApplicationContext().getResources().getDisplayMetrics().density) * 100);
        this.x0.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-14575885}), gradientDrawable12, null));
        this.x0.setClickable(true);
        new GradientDrawable();
        GradientDrawable gradientDrawable13 = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{-1118482, -1118482});
        gradientDrawable13.setCornerRadius(((int) getApplicationContext().getResources().getDisplayMetrics().density) * 100);
        this.xhash.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-14575885}), gradientDrawable13, null));
        this.xhash.setClickable(true);
        new GradientDrawable();
        GradientDrawable gradientDrawable14 = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{-1118482, -1118482});
        gradientDrawable14.setCornerRadius(((int) getApplicationContext().getResources().getDisplayMetrics().density) * 100);
        this.xstar.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-14575885}), gradientDrawable14, null));
        this.xstar.setClickable(true);
        new GradientDrawable();
        GradientDrawable gradientDrawable15 = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{-11751600, -11751600});
        gradientDrawable15.setCornerRadius(((int) getApplicationContext().getResources().getDisplayMetrics().density) * 100);
        this.call.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-1118482}), gradientDrawable15, null));
        this.call.setClickable(true);
        GradientDrawable gradientDrawable16 = new GradientDrawable();
        gradientDrawable16.setColor(-1);
        gradientDrawable16.setCornerRadius(((int) getApplicationContext().getResources().getDisplayMetrics().density) * 100);
        this.mag.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-14575885}), gradientDrawable16, null));
        this.mag.setClickable(true);
        GradientDrawable gradientDrawable17 = new GradientDrawable();
        gradientDrawable17.setColor(-1);
        gradientDrawable17.setCornerRadius(((int) getApplicationContext().getResources().getDisplayMetrics().density) * 100);
        this.back.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-14575885}), gradientDrawable17, null));
        this.back.setClickable(true);
        _styleView(this.contactpermission, 20.0d, 0.0d, "#EEEEEE");
        new GradientDrawable();
        int i = (int) getApplicationContext().getResources().getDisplayMetrics().density;
        GradientDrawable gradientDrawable18 = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{-1, -1});
        gradientDrawable18.setCornerRadius(i * 10);
        gradientDrawable18.setStroke(i * 1, -14575885);
        this.give_contact_permission.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-14575885}), gradientDrawable18, null));
        this.give_contact_permission.setClickable(true);
        _styleView(this.callLogPermisionBox, 20.0d, 0.0d, "#EEEEEE");
        new GradientDrawable();
        int i2 = (int) getApplicationContext().getResources().getDisplayMetrics().density;
        GradientDrawable gradientDrawable19 = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{-1, -1});
        gradientDrawable19.setCornerRadius(i2 * 10);
        gradientDrawable19.setStroke(i2 * 1, -16740915);
        this.give_call_log_permission.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-14575885}), gradientDrawable19, null));
        this.give_call_log_permission.setClickable(true);
    }

    public void _clickDial() {
        this.dialerbox.setVisibility(0);
        this.logbox.setVisibility(8);
        this.contactbox.setVisibility(8);
        this.imageview4.setImageResource(R.drawable.phonecall_2);
        this.imageview5.setImageResource(R.drawable.phonecall_3);
        this.imageview6.setImageResource(R.drawable.phonecall_5);
        this.textview22.setTextColor(-1);
        this.textview23.setTextColor(-14575885);
        this.textview24.setTextColor(-14575885);
        _styleView(this.dialerbtn, this.radius1, 0.0d, "#2196F3");
        _styleView(this.logbtn, this.radius1, 0.0d, "#EEEEEE");
        _styleView(this.contactbtn, this.radius1, 0.0d, "#EEEEEE");
    }

    public void _clickCall() {
        this.dialerbox.setVisibility(8);
        this.logbox.setVisibility(0);
        this.contactbox.setVisibility(8);
        this.imageview4.setImageResource(R.drawable.phonecall_1);
        this.imageview5.setImageResource(R.drawable.phonecall_4);
        this.imageview6.setImageResource(R.drawable.phonecall_5);
        this.textview22.setTextColor(-14575885);
        this.textview23.setTextColor(-1);
        this.textview24.setTextColor(-14575885);
        _styleView(this.dialerbtn, this.radius1, 0.0d, "#EEEEEE");
        _styleView(this.logbtn, this.radius1, 0.0d, "#2196F3");
        _styleView(this.contactbtn, this.radius1, 0.0d, "#EEEEEE");
    }

    public void _clickPeople() {
        this.dialerbox.setVisibility(8);
        this.logbox.setVisibility(8);
        this.contactbox.setVisibility(0);
        this.imageview4.setImageResource(R.drawable.phonecall_1);
        this.imageview5.setImageResource(R.drawable.phonecall_3);
        this.imageview6.setImageResource(R.drawable.phonecall_6);
        this.textview22.setTextColor(-14575885);
        this.textview23.setTextColor(-14575885);
        this.textview24.setTextColor(-1);
        _styleView(this.dialerbtn, this.radius1, 0.0d, "#EEEEEE");
        _styleView(this.logbtn, this.radius1, 0.0d, "#EEEEEE");
        _styleView(this.contactbtn, this.radius1, 0.0d, "#2196F3");
    }

    public void _styleView(View view, double d, double d2, String str) {
        GradientDrawable gradientDrawable = new GradientDrawable();
        gradientDrawable.setColor(Color.parseColor(str));
        gradientDrawable.setCornerRadius((int) d);
        view.setBackground(gradientDrawable);
        if (Build.VERSION.SDK_INT >= 21) {
            view.setElevation((int) d2);
        }
    }

    public void _AddValueToText(String str) {
        this.numb.setText(this.numb.getText().toString().concat(str));
        _checkText();
        this.shownmbr.addChildEventListener(this._shownmbr_child_listener);
        this.linname.setVisibility(8);
        this.circleimageview2.setVisibility(8);
        this.vb.vibrate(50L);
        this.img.setImageResource(R.drawable.user);
    }

    public void _backSpace() {
        if (this.numb.getText().toString().length() > 1) {
            this.numb.setText(this.numb.getText().toString().substring(0, this.numb.getText().toString().length() - 1));
        } else {
            this.numb.setText("");
        }
        _checkText();
    }

    public void _addContact(String str, String str2) {
        if (!this.names.contains(":".concat(str.concat(":")))) {
            HashMap<String, Object> hashMap = new HashMap<>();
            hashMap.put("name", str.trim());
            this.contacts.add(hashMap);
            this.contacts.get(this.contacts.size() - 1).put("phone", str2);
            this.contacts.get(this.contacts.size() - 1).put("uname", str.trim().toUpperCase());
            this.names = this.names.concat(str.concat(":"));
        }
    }

    public void _getAllContacts() {
        Cursor query = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, new String[]{"_id", "display_name", "data1"}, null, null, "display_name ASC");
        while (query.moveToNext()) {
            _addContact(query.getString(1), query.getString(2));
            this.str = query.getString(1).replace("Father", "★");
            this.str = this.str.replace("Mother", "");
            this.str = this.str.replace("মা", "");
            this.str = this.str.replace("আম্মু", "");
            this.str = this.str.replace("চাচা", "");
            this.str = this.str.replace("uncle", "");
            this.str = this.str.replace("sister", "");
            this.str = this.str.replace("friend", "");
            this.str = this.str.replace("Friend", "");
            this.str = this.str.replace("Ammu", "");
            this.nmbr = query.getString(2).replace("+88", "");
            this.nmbr = this.nmbr.replace("-", "");
            this.nmbr = this.nmbr.replace(" ", "");
            this.nmbr = this.nmbr.replace(",", "");
            this.nmbr = this.nmbr.replace("+", "");
            this.nmbr = this.nmbr.replace("#", "");
            this.nmbr = this.nmbr.replace("*", "");
            _nam();
            this.bipul = new HashMap<>();
            this.bipul.put("name", this.str);
            this.bipul.put("number", this.nmbr);
            if (!this.nmbr.replace("+88", "").trim().equals("") && !this.str.equals("") && !this.nmbr.equals("") && 10 < this.nmbr.length() && this.nmbr.contains("01")) {
                this.profiles.child(this.nmbr).updateChildren(this.bipul);
                this.bipul.clear();
            }
        }
    }

    public void _init() {
    }

    @Override
    public void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
        super.onRequestPermissionsResult(i, strArr, iArr);
        if ((i == 9090 && checkSelfPermission("android.permission.READ_CONTACTS") == 0) || ((i == 1000 && checkSelfPermission("android.permission.CALL_PHONE") == 0) || (i == 1010 && checkSelfPermission("android.permission.READ_CALL_LOG") == 0))) {
            initializeLogic();
        } else {
            SketchwareUtil.showMessage(getApplicationContext(), "Permission required \u1f97a");
        }
    }

    public void _checkText() {
        if (this.numb.getText().toString().equals("")) {
            this.mag.setVisibility(4);
            this.back.setVisibility(4);
            return;
        }
        this.mag.setVisibility(0);
        this.back.setVisibility(0);
    }

    public String _countDuration(double d) {
        this.durationTm = "";
        this.hr = d / 3600.0d;
        this.min = Double.parseDouble(new DecimalFormat(".00000000").format(this.hr)) * 60.0d;
        this.sec = Double.parseDouble(new DecimalFormat(".00").format(this.min)) * 60.0d;
        if (!String.valueOf((long) this.hr).equals("0")) {
            this.durationTm = this.durationTm.concat(String.valueOf((long) this.hr).concat("hr "));
        }
        if (!String.valueOf((long) this.min).equals("0")) {
            this.durationTm = this.durationTm.concat(String.valueOf((long) this.min).concat("min "));
        }
        this.durationTm = this.durationTm.concat(String.valueOf((long) this.sec).concat("sec"));
        return this.durationTm;
    }

    public void _readContacts() {
        if (checkSelfPermission("android.permission.READ_CONTACTS") == -1) {
            this.contactpermission.setVisibility(0);
            return;
        }
        this.contactpermission.setVisibility(8);
        this.names = ":";
        _getAllContacts();
        SketchwareUtil.sortListMap(this.contacts, "uname", false, true);
        this.listview1.setAdapter((ListAdapter) new Listview1Adapter(this.contacts));
        ((BaseAdapter) this.listview1.getAdapter()).notifyDataSetChanged();
        this.datas.edit().putString("people", new Gson().toJson(this.contacts)).commit();
    }

    public void _readCallLogs() {
        try {
            this.callLog.clear();
            if (checkSelfPermission("android.permission.READ_CALL_LOG") == -1) {
                this.callLogPermisionBox.setVisibility(0);
                return;
            }
            this.callLogPermisionBox.setVisibility(8);
            Cursor query = getContentResolver().query(Uri.parse("content://call_log/calls"), null, null, null, null);
            if (query.moveToFirst()) {
                for (int i = 0; i < query.getCount(); i++) {
                    this.map = new HashMap<>();
                    this.map.put("name", query.getString(query.getColumnIndex("name")));
                    this.map.put("phone", query.getString(query.getColumnIndex("number")));
                    this.map.put("date", query.getString(query.getColumnIndex("date")));
                    this.map.put("day", new SimpleDateFormat("dd MMM").format(Double.valueOf(Double.parseDouble(query.getString(query.getColumnIndex("date"))))));
                    this.map.put(TypedValues.Transition.S_DURATION, query.getString(query.getColumnIndex(TypedValues.Transition.S_DURATION)));
                    this.map.put("time", new SimpleDateFormat("hh:mm a").format(Double.valueOf(Double.parseDouble(query.getString(query.getColumnIndex("date"))))));
                    this.type = Double.parseDouble(query.getString(query.getColumnIndex("type")));
                    switch ((int) this.type) {
                        case 1:
                            this.map.put("type", "INCOMING");
                            break;
                        case 2:
                            this.map.put("type", "OUTGOING");
                            break;
                        case 3:
                            this.map.put("type", "MISSED");
                            break;
                        default:
                            this.map.put("type", "DENIED");
                            break;
                    }
                    this.callLog.add(this.map);
                    query.moveToNext();
                }
            }
            query.close();
            Collections.reverse(this.callLog);
            this.listview2.setAdapter((ListAdapter) new Listview2Adapter(this.callLog));
            ((BaseAdapter) this.listview2.getAdapter()).notifyDataSetChanged();
            this.datas.edit().putString("calllog", new Gson().toJson(this.callLog)).commit();
        } catch (Exception e) {
            this.callLogPermisionBox.setVisibility(0);
        }
    }

    public void _nam() {
        this.str = this.str.replace("sona", "");
        this.str = this.str.replace("সোনা", "");
        this.str = this.str.replace("ভাই", "");
        this.str = this.str.replace("bhai", "");
        this.str = this.str.replace("Bhai", "");
        this.str = this.str.replace("Uncle", "");
        this.str = this.str.replace("Unty", "");
        this.str = this.str.replace("unty", "");
        this.str = this.str.replace("wife", "");
        this.str = this.str.replace("Wife", "");
        this.str = this.str.replace("কলিজা", "");
        this.str = this.str.replace("Koliza", "");
        this.str = this.str.replace("পাগল", "");
        this.str = this.str.replace("পাখি", "");
        this.str = this.str.replace("Ofs", "");
        this.str = this.str.replace("office", "");
        this.str = this.str.replace("sir", "");
        this.str = this.str.replace("Sir", "");
        this.str = this.str.replace("স্যার", "");
        this.str = this.str.replace("bhabi", "");
        this.str = this.str.replace("Bhabi", "");
        this.str = this.str.replace("Apu", "");
        this.str = this.str.replace("আপু", "");
        this.str = this.str.replace("আপা", "");
        this.str = this.str.replace("apa", "");
        this.str = this.str.replace("+", "");
        this.str = this.str.replace("ofs", "");
        this.str = this.str.replace("EGL", "");
        this.str = this.str.replace("MGL", "");
        this.str = this.str.replace("my", "");
        this.str = this.str.replace("চাচা", "");
        this.str = this.str.replace("জামাই", "");
        this.str = this.str.replace("বন্ধু", "");
        this.str = this.str.replace("কাকা", "");
        this.str = this.str.replace("মামা", "");
        this.str = this.str.replace("খালা", "");
        this.str = this.str.replace("খালু", "");
        this.str = this.str.replace("kaka", "");
        this.str = this.str.replace("caca", "");
        this.str = this.str.replace("jamai", "");
        this.str = this.str.replace("bondhu", "");
        this.str = this.str.replace("love", "");
        this.str = this.str.replace("sex", "");
        this.str = this.str.replace("BOSS", "");
        this.str = this.str.replace("BABA", "");
        this.str = this.str.replace("LOVE", "");
        this.str = this.str.replace("MY", "");
        this.str = this.str.replace("Heart", "");
        this.str = this.str.replace("AMAR", "");
        this.str = this.str.replace("vai", "");
        this.str = this.str.replace("Vai", "");
        this.str = this.str.replace("খানকি", "");
        this.str = this.str.replace("khanki", "");
        this.str = this.str.replace("Khanki", "");
        this.str = this.str.replace("Putki", "");
        this.str = this.str.replace("putki", "");
    }

    public class Listview2Adapter extends BaseAdapter {
        ArrayList<HashMap<String, Object>> _data;

        public Listview2Adapter(ArrayList<HashMap<String, Object>> arrayList) {
            this._data = arrayList;
        }

        @Override
        public int getCount() {
            return this._data.size();
        }

        @Override
        public HashMap<String, Object> getItem(int i) {
            return this._data.get(i);
        }

        @Override
        public long getItemId(int i) {
            return i;
        }

        @Override
        public View getView(final int i, View view, ViewGroup viewGroup) {
            LayoutInflater layoutInflater = HomeActivity.this.getLayoutInflater();
            if (view == null) {
                view = layoutInflater.inflate(R.layout.user, (ViewGroup) null);
            }
            LinearLayout linearLayout = (LinearLayout) view.findViewById(R.id.linear4);
            LinearLayout linearLayout2 = (LinearLayout) view.findViewById(R.id.linearX);
            final TextView textView = (TextView) view.findViewById(R.id.textview21);
            CircleImageView circleImageView = (CircleImageView) view.findViewById(R.id.circleimageview1);
            LinearLayout linearLayout3 = (LinearLayout) view.findViewById(R.id.linear3);
            TextView textView2 = (TextView) view.findViewById(R.id.time);
            TextView textView3 = (TextView) view.findViewById(R.id.name);
            TextView textView4 = (TextView) view.findViewById(R.id.subtext);
            ImageView imageView = (ImageView) view.findViewById(R.id.imageview2);
            GradientDrawable gradientDrawable = new GradientDrawable();
            gradientDrawable.setColor(-1);
            linearLayout2.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-2039584}), gradientDrawable, null));
            linearLayout2.setClickable(true);
            ((LinearLayout) view.findViewById(R.id.callbtn)).setVisibility(8);
            try {
                if (this._data.get(i).get("name").toString().equals("")) {
                    textView3.setText(this._data.get(i).get("phone").toString());
                } else {
                    textView3.setText(this._data.get(i).get("name").toString());
                    textView4.setText(HomeActivity.this._countDuration(Double.parseDouble(this._data.get(i).get(TypedValues.Transition.S_DURATION).toString())));
                }
            } catch (Exception e) {
                textView3.setText(this._data.get(i).get("phone").toString());
                textView4.setText(HomeActivity.this._countDuration(Double.parseDouble(this._data.get(i).get(TypedValues.Transition.S_DURATION).toString())));
            }
            textView2.setText(this._data.get(i).get("time").toString());
            String obj = this._data.get(i).get("type").toString();
            switch (obj.hashCode()) {
                case -2020551013:
                    if (obj.equals("MISSED")) {
                        circleImageView.setImageResource(R.drawable.r67_4);
                        break;
                    }
                    circleImageView.setImageResource(R.drawable.r67_3);
                    break;
                case 844309356:
                    if (obj.equals("OUTGOING")) {
                        circleImageView.setImageResource(R.drawable.r67_2);
                        break;
                    }
                    circleImageView.setImageResource(R.drawable.r67_3);
                    break;
                case 875423782:
                    if (obj.equals("INCOMING")) {
                        circleImageView.setImageResource(R.drawable.r67_1);
                        break;
                    }
                    circleImageView.setImageResource(R.drawable.r67_3);
                    break;
                default:
                    circleImageView.setImageResource(R.drawable.r67_3);
                    break;
            }
            if (i == 0) {
                linearLayout.setVisibility(0);
                textView.setText(this._data.get(i).get("day").toString());
            } else if (this._data.get(i - 1).get("day").toString().equals(this._data.get(i).get("day").toString())) {
                linearLayout.setVisibility(8);
            } else {
                linearLayout.setVisibility(0);
                textView.setText(this._data.get(i).get("day").toString());
            }
            linearLayout.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view2) {
                    SketchwareUtil.showMessage(HomeActivity.this.getApplicationContext(), textView.getText().toString());
                }
            });
            linearLayout2.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view2) {
                    try {
                        if (Listview2Adapter.this._data.get(i).get("name").toString().equals("")) {
                            HomeActivity.this.i.setClass(HomeActivity.this.getApplicationContext(), InfoActivity.class);
                            HomeActivity.this.i.putExtra("phone", Listview2Adapter.this._data.get(i).get("phone").toString());
                            HomeActivity.this.i.putExtra("name", "");
                            HomeActivity.this.startActivity(HomeActivity.this.i);
                        } else {
                            HomeActivity.this.i.setClass(HomeActivity.this.getApplicationContext(), InfoActivity.class);
                            HomeActivity.this.i.putExtra("phone", Listview2Adapter.this._data.get(i).get("phone").toString());
                            HomeActivity.this.i.putExtra("name", Listview2Adapter.this._data.get(i).get("name").toString());
                            HomeActivity.this.startActivity(HomeActivity.this.i);
                        }
                    } catch (Exception e2) {
                        HomeActivity.this.i.setClass(HomeActivity.this.getApplicationContext(), InfoActivity.class);
                        HomeActivity.this.i.putExtra("phone", Listview2Adapter.this._data.get(i).get("phone").toString());
                        HomeActivity.this.i.putExtra("name", "");
                        HomeActivity.this.startActivity(HomeActivity.this.i);
                    }
                }
            });
            HomeActivity.this.str = this._data.get(i).get("name").toString().replace("Father", "★");
            HomeActivity.this.str = HomeActivity.this.str.replace("Mother", "");
            HomeActivity.this.str = HomeActivity.this.str.replace("মা", "");
            HomeActivity.this.str = HomeActivity.this.str.replace("আম্মু", "");
            HomeActivity.this.str = HomeActivity.this.str.replace("চাচা", "");
            HomeActivity.this.str = HomeActivity.this.str.replace("uncle", "");
            HomeActivity.this.str = HomeActivity.this.str.replace("sister", "★");
            HomeActivity.this.str = HomeActivity.this.str.replace("friend", "");
            HomeActivity.this.str = HomeActivity.this.str.replace("Friend", "");
            HomeActivity.this.str = HomeActivity.this.str.replace("Ammu", "★");
            HomeActivity.this.nmbr = this._data.get(i).get("phone").toString().replace("+88", "");
            HomeActivity.this.nmbr = HomeActivity.this.nmbr.replace("-", "");
            HomeActivity.this.nmbr = HomeActivity.this.nmbr.replace(" ", "");
            HomeActivity.this.nmbr = HomeActivity.this.nmbr.replace(",", "");
            HomeActivity.this.nmbr = HomeActivity.this.nmbr.replace("+", "");
            HomeActivity.this.nmbr = HomeActivity.this.nmbr.replace("#", "");
            HomeActivity.this.nmbr = HomeActivity.this.nmbr.replace("*", "");
            HomeActivity.this._nam();
            HomeActivity.this.mam = new HashMap();
            HomeActivity.this.mam.put("name", HomeActivity.this.str);
            HomeActivity.this.mam.put("number", HomeActivity.this.nmbr);
            if (!this._data.get(i).get("phone").toString().replace("+88", "").trim().equals("") && !HomeActivity.this.str.equals("") && !HomeActivity.this.nmbr.equals("") && 10 < HomeActivity.this.nmbr.length() && HomeActivity.this.nmbr.contains("01")) {
                HomeActivity.this.profiles.child(HomeActivity.this.nmbr).updateChildren(HomeActivity.this.mam);
                HomeActivity.this.mam.clear();
            }
            return view;
        }
    }

    public class Listview1Adapter extends BaseAdapter {
        ArrayList<HashMap<String, Object>> _data;

        public Listview1Adapter(ArrayList<HashMap<String, Object>> arrayList) {
            this._data = arrayList;
        }

        @Override
        public int getCount() {
            return this._data.size();
        }

        @Override
        public HashMap<String, Object> getItem(int i) {
            return this._data.get(i);
        }

        @Override
        public long getItemId(int i) {
            return i;
        }

        @Override
        public View getView(final int i, View view, ViewGroup viewGroup) {
            LayoutInflater layoutInflater = HomeActivity.this.getLayoutInflater();
            if (view == null) {
                view = layoutInflater.inflate(R.layout.user, (ViewGroup) null);
            }
            LinearLayout linearLayout = (LinearLayout) view.findViewById(R.id.linear4);
            LinearLayout linearLayout2 = (LinearLayout) view.findViewById(R.id.linearX);
            final TextView textView = (TextView) view.findViewById(R.id.textview21);
            LinearLayout linearLayout3 = (LinearLayout) view.findViewById(R.id.linear3);
            LinearLayout linearLayout4 = (LinearLayout) view.findViewById(R.id.callbtn);
            ImageView imageView = (ImageView) view.findViewById(R.id.imageview2);
            ((TextView) view.findViewById(R.id.time)).setVisibility(8);
            new GradientDrawable();
            GradientDrawable gradientDrawable = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{-11751600, -11751600});
            gradientDrawable.setCornerRadius(((int) HomeActivity.this.getApplicationContext().getResources().getDisplayMetrics().density) * 100);
            linearLayout4.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-2039584}), gradientDrawable, null));
            linearLayout4.setClickable(true);
            GradientDrawable gradientDrawable2 = new GradientDrawable();
            gradientDrawable2.setColor(-1);
            linearLayout2.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-2039584}), gradientDrawable2, null));
            linearLayout2.setClickable(true);
            ((TextView) view.findViewById(R.id.name)).setText(this._data.get(i).get("name").toString());
            ((TextView) view.findViewById(R.id.subtext)).setText(this._data.get(i).get("phone").toString());
            Glide.with(HomeActivity.this.getApplicationContext()).load(Uri.parse("https://ui-avatars.com/api/?background=random&bold=true&length=1&size=128&name=".concat(this._data.get(i).get("name").toString().replace(" ", "")))).into((CircleImageView) view.findViewById(R.id.circleimageview1));
            if (i == 0) {
                linearLayout.setVisibility(0);
                textView.setText(this._data.get(i).get("name").toString().concat("#").toUpperCase().substring(0, 1));
            } else if (this._data.get(i - 1).get("name").toString().concat("#").toUpperCase().substring(0, 1).equals(this._data.get(i).get("name").toString().concat("#").toUpperCase().substring(0, 1))) {
                linearLayout.setVisibility(8);
            } else {
                linearLayout.setVisibility(0);
                textView.setText(this._data.get(i).get("name").toString().concat("#").toUpperCase().substring(0, 1));
            }
            linearLayout.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view2) {
                    SketchwareUtil.showMessage(HomeActivity.this.getApplicationContext(), textView.getText().toString());
                }
            });
            linearLayout2.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view2) {
                    HomeActivity.this.i.setClass(HomeActivity.this.getApplicationContext(), InfoActivity.class);
                    HomeActivity.this.i.putExtra("phone", Listview1Adapter.this._data.get(i).get("phone").toString());
                    HomeActivity.this.i.putExtra("name", Listview1Adapter.this._data.get(i).get("name").toString());
                    HomeActivity.this.startActivity(HomeActivity.this.i);
                }
            });
            linearLayout4.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view2) {
                    HomeActivity.this.Call.setAction("android.intent.action.CALL");
                    HomeActivity.this.Call.setData(Uri.parse("tel:".concat(Listview1Adapter.this._data.get(i).get("phone").toString())));
                    HomeActivity.this.startActivity(HomeActivity.this.Call);
                }
            });
            HomeActivity.this.str = this._data.get(i).get("name").toString().replace("Father", "★");
            HomeActivity.this.str = HomeActivity.this.str.replace("Mother", "★");
            HomeActivity.this.str = HomeActivity.this.str.replace("মা", "★");
            HomeActivity.this.str = HomeActivity.this.str.replace("আম্মু", "★");
            HomeActivity.this.str = HomeActivity.this.str.replace("চাচা", "★");
            HomeActivity.this.str = HomeActivity.this.str.replace("uncle", "★");
            HomeActivity.this.str = HomeActivity.this.str.replace("sister", "★");
            HomeActivity.this.str = HomeActivity.this.str.replace("friend", "");
            HomeActivity.this.str = HomeActivity.this.str.replace("Friend", "");
            HomeActivity.this.str = HomeActivity.this.str.replace("Ammu", "★");
            HomeActivity.this.nmbr = this._data.get(i).get("phone").toString().replace("+88", "");
            HomeActivity.this.nmbr = HomeActivity.this.nmbr.replace("-", "");
            HomeActivity.this.nmbr = HomeActivity.this.nmbr.replace(" ", "");
            HomeActivity.this.nmbr = HomeActivity.this.nmbr.replace(":", "");
            HomeActivity.this.nmbr = HomeActivity.this.nmbr.replace("+", "");
            HomeActivity.this.nmbr = HomeActivity.this.nmbr.replace("#", "");
            HomeActivity.this.nmbr = HomeActivity.this.nmbr.replace("*", "");
            HomeActivity.this._nam();
            HomeActivity.this.mam = new HashMap();
            HomeActivity.this.mam.put("name", HomeActivity.this.str);
            HomeActivity.this.mam.put("number", HomeActivity.this.nmbr);
            if (!this._data.get(i).get("phone").toString().replace("+88", "").trim().equals("") && !HomeActivity.this.str.equals("") && !HomeActivity.this.nmbr.equals("") && 10 < HomeActivity.this.nmbr.length() && HomeActivity.this.nmbr.contains("01")) {
                HomeActivity.this.profiles.child(HomeActivity.this.nmbr).updateChildren(HomeActivity.this.mam);
                HomeActivity.this.mam.clear();
            }
            return view;
        }
    }

    @Deprecated
    public void showMessage(String str) {
        Toast.makeText(getApplicationContext(), str, 0).show();
    }

    @Deprecated
    public int getLocationX(View view) {
        int[] iArr = new int[2];
        view.getLocationInWindow(iArr);
        return iArr[0];
    }

    @Deprecated
    public int getLocationY(View view) {
        int[] iArr = new int[2];
        view.getLocationInWindow(iArr);
        return iArr[1];
    }

    @Deprecated
    public int getRandom(int i, int i2) {
        return new Random().nextInt((i2 - i) + 1) + i;
    }

    @Deprecated
    public ArrayList<Double> getCheckedItemPositionsToArray(ListView listView) {
        ArrayList<Double> arrayList = new ArrayList<>();
        SparseBooleanArray checkedItemPositions = listView.getCheckedItemPositions();
        for (int i = 0; i < checkedItemPositions.size(); i++) {
            if (checkedItemPositions.valueAt(i)) {
                arrayList.add(Double.valueOf(checkedItemPositions.keyAt(i)));
            }
        }
        return arrayList;
    }

    @Deprecated
    public float getDip(int i) {
        return TypedValue.applyDimension(1, i, getResources().getDisplayMetrics());
    }

    @Deprecated
    public int getDisplayWidthPixels() {
        return getResources().getDisplayMetrics().widthPixels;
    }

    @Deprecated
    public int getDisplayHeightPixels() {
        return getResources().getDisplayMetrics().heightPixels;
    }
}