MBBD Trace v1.0版本的 MD5 值为:f0273367d111799d70c685af03877187
以下内容为反编译后的 InfoActivity.java 源代码,内容仅作参考
package com.bipul.trace;
import android.app.AlertDialog;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.ColorStateList;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.RippleDrawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.util.SparseBooleanArray;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
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.widget.NestedScrollView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
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 com.google.gson.reflect.TypeToken;
import de.hdodenhof.circleimageview.CircleImageView;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Random;
import java.util.Timer;
import java.util.TimerTask;
public class InfoActivity extends AppCompatActivity {
private ChildEventListener _pr_child_listener;
private LinearLayout adda;
private Button button1;
private LinearLayout callbtn;
private LinearLayout chatbtn;
private CircleImageView circleimageview1;
private SharedPreferences datas;
private AlertDialog.Builder dl;
private EditText edittext1;
private ImageView imageview1;
private ImageView imageview13;
private ImageView imageview14;
private ImageView imageview15;
private ImageView imageview2;
private ImageView imageview3;
private LinearLayout linear2;
private LinearLayout linear3;
private LinearLayout linear4;
private LinearLayout linear56;
private LinearLayout linear57;
private LinearLayout linear59;
private LinearLayout linear61;
private LinearLayout linear62;
private LinearLayout more;
private LinearLayout morebtn;
private TextView nameTxt;
private TextView phoneTxt;
private RecyclerView recyclerview1;
private LinearLayout searchbtn;
private LinearLayout statusbtn;
private TextView textview21;
private TextView textview42;
private TextView textview44;
private TimerTask timer;
private LinearLayout whatsappbtn;
private Timer _timer = new Timer();
private FirebaseDatabase _firebase = FirebaseDatabase.getInstance();
private double count = 0.0d;
private boolean dataFromContact = false;
private HashMap<String, Object> map = new HashMap<>();
private String durationTm = "";
private double hr = 0.0d;
private double min = 0.0d;
private double sec = 0.0d;
private String nameG = "";
private String nmbr = "";
private HashMap<String, Object> mn = new HashMap<>();
private ArrayList<HashMap<String, Object>> peopl = new ArrayList<>();
private ArrayList<HashMap<String, Object>> calLog = new ArrayList<>();
private Intent i = new Intent();
private Calendar cal = Calendar.getInstance();
private Intent Call = new Intent();
private Intent sms = new Intent();
private Intent wa = new Intent();
private DatabaseReference pr = this._firebase.getReference("profiles");
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.info);
initialize(bundle);
FirebaseApp.initializeApp(this);
initializeLogic();
}
private void initialize(Bundle bundle) {
this.more = (LinearLayout) findViewById(R.id.more);
this.linear2 = (LinearLayout) findViewById(R.id.linear2);
this.linear3 = (LinearLayout) findViewById(R.id.linear3);
this.statusbtn = (LinearLayout) findViewById(R.id.statusbtn);
this.textview21 = (TextView) findViewById(R.id.textview21);
this.searchbtn = (LinearLayout) findViewById(R.id.searchbtn);
this.morebtn = (LinearLayout) findViewById(R.id.morebtn);
this.imageview3 = (ImageView) findViewById(R.id.imageview3);
this.imageview1 = (ImageView) findViewById(R.id.imageview1);
this.imageview2 = (ImageView) findViewById(R.id.imageview2);
this.adda = (LinearLayout) findViewById(R.id.adda);
this.circleimageview1 = (CircleImageView) findViewById(R.id.circleimageview1);
this.nameTxt = (TextView) findViewById(R.id.nameTxt);
this.phoneTxt = (TextView) findViewById(R.id.phoneTxt);
this.linear4 = (LinearLayout) findViewById(R.id.linear4);
this.linear62 = (LinearLayout) findViewById(R.id.linear62);
this.recyclerview1 = (RecyclerView) findViewById(R.id.recyclerview1);
this.textview44 = (TextView) findViewById(R.id.textview44);
this.edittext1 = (EditText) findViewById(R.id.edittext1);
this.button1 = (Button) findViewById(R.id.button1);
this.linear56 = (LinearLayout) findViewById(R.id.linear56);
this.callbtn = (LinearLayout) findViewById(R.id.callbtn);
this.linear57 = (LinearLayout) findViewById(R.id.linear57);
this.chatbtn = (LinearLayout) findViewById(R.id.chatbtn);
this.linear59 = (LinearLayout) findViewById(R.id.linear59);
this.whatsappbtn = (LinearLayout) findViewById(R.id.whatsappbtn);
this.linear61 = (LinearLayout) findViewById(R.id.linear61);
this.imageview13 = (ImageView) findViewById(R.id.imageview13);
this.imageview14 = (ImageView) findViewById(R.id.imageview14);
this.imageview15 = (ImageView) findViewById(R.id.imageview15);
this.textview42 = (TextView) findViewById(R.id.textview42);
this.datas = getSharedPreferences("datas", 0);
this.dl = new AlertDialog.Builder(this);
this.statusbtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
InfoActivity.this.finish();
}
});
this.searchbtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
InfoActivity.this.i.setClass(InfoActivity.this.getApplicationContext(), SearchActivity.class);
InfoActivity.this.startActivity(InfoActivity.this.i);
}
});
this.morebtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
InfoActivity.this.i.setClass(InfoActivity.this.getApplicationContext(), MoreActivity.class);
InfoActivity.this.startActivity(InfoActivity.this.i);
}
});
this.button1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (!InfoActivity.this.edittext1.getText().toString().equals("")) {
InfoActivity.this.mn = new HashMap();
InfoActivity.this.mn.put("name", InfoActivity.this.edittext1.getText().toString());
InfoActivity.this.mn.put("number", InfoActivity.this.getIntent().getStringExtra("phone"));
InfoActivity.this.pr.child(InfoActivity.this.getIntent().getStringExtra("phone")).updateChildren(InfoActivity.this.mn);
InfoActivity.this.mn.clear();
SketchwareUtil.showMessage(InfoActivity.this.getApplicationContext(), "Added!");
InfoActivity.this.adda.setVisibility(8);
}
}
});
this.callbtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
InfoActivity.this.Call.setAction("android.intent.action.CALL");
InfoActivity.this.Call.setData(Uri.parse("tel:".concat(InfoActivity.this.getIntent().getStringExtra("phone"))));
InfoActivity.this.startActivity(InfoActivity.this.Call);
}
});
this.chatbtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
InfoActivity.this.sms.setAction("android.intent.action.VIEW");
InfoActivity.this.sms.setData(Uri.parse("sms:".concat(InfoActivity.this.getIntent().getStringExtra("phone"))));
InfoActivity.this.sms.putExtra("sms_body", "");
InfoActivity.this.startActivity(InfoActivity.this.sms);
}
});
this.whatsappbtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
InfoActivity.this.wa.setAction("android.intent.action.VIEW");
InfoActivity.this.wa.setData(Uri.parse("https://wa.me/".concat(InfoActivity.this.getIntent().getStringExtra("phone").replace(" ", "").replace("+", ""))));
InfoActivity.this.startActivity(InfoActivity.this.wa);
}
});
this._pr_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(InfoActivity.this.nmbr)) {
InfoActivity.this.nameTxt.setText(hashMap.get("name").toString());
InfoActivity.this.phoneTxt.setText(hashMap.get("number").toString());
if (hashMap.containsKey("photo")) {
InfoActivity.this.circleimageview1.setVisibility(0);
Glide.with(InfoActivity.this.getApplicationContext()).load(Uri.parse(hashMap.get("photo").toString())).into(InfoActivity.this.circleimageview1);
}
}
}
@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(InfoActivity.this.nmbr)) {
InfoActivity.this.nameTxt.setText(hashMap.get("name").toString());
InfoActivity.this.phoneTxt.setText(hashMap.get("number").toString());
if (hashMap.containsKey("photo")) {
InfoActivity.this.circleimageview1.setVisibility(0);
Glide.with(InfoActivity.this.getApplicationContext()).load(Uri.parse(hashMap.get("photo").toString())).into(InfoActivity.this.circleimageview1);
}
}
}
@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.pr.addChildEventListener(this._pr_child_listener);
}
private void initializeLogic() {
this.nmbr = getIntent().getStringExtra("phone").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(",", "");
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);
((ViewGroup) this.linear3.getParent()).removeView(this.linear3);
NestedScrollView nestedScrollView = new NestedScrollView(this);
nestedScrollView.setLayoutParams(new LinearLayout.LayoutParams(-1, -1));
this.more.addView(nestedScrollView);
nestedScrollView.addView(this.linear3);
_cssstyles();
_getDataFromContact();
_getCallLogData();
}
@Override
public void onActivityResult(int i, int i2, Intent intent) {
super.onActivityResult(i, i2, intent);
this.nmbr = getIntent().getStringExtra("phone").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(",", "");
}
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);
GradientDrawable gradientDrawable3 = new GradientDrawable();
gradientDrawable3.setColor(-1);
gradientDrawable3.setCornerRadius(((int) getApplicationContext().getResources().getDisplayMetrics().density) * 40);
this.statusbtn.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-14575885}), gradientDrawable3, null));
this.statusbtn.setClickable(true);
new GradientDrawable();
GradientDrawable gradientDrawable4 = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{-1, -1});
gradientDrawable4.setCornerRadius(((int) getApplicationContext().getResources().getDisplayMetrics().density) * 100);
this.whatsappbtn.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-14575885}), gradientDrawable4, null));
this.whatsappbtn.setClickable(true);
new GradientDrawable();
GradientDrawable gradientDrawable5 = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{-1, -1});
gradientDrawable5.setCornerRadius(((int) getApplicationContext().getResources().getDisplayMetrics().density) * 100);
this.chatbtn.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-14575885}), gradientDrawable5, null));
this.chatbtn.setClickable(true);
new GradientDrawable();
GradientDrawable gradientDrawable6 = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[]{-1, -1});
gradientDrawable6.setCornerRadius(((int) getApplicationContext().getResources().getDisplayMetrics().density) * 100);
this.callbtn.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-14575885}), gradientDrawable6, null));
this.callbtn.setClickable(true);
}
public void _getDataFromContact() {
if (getIntent().getStringExtra("name").equals("")) {
this.adda.setVisibility(0);
this.nameTxt.setText(getIntent().getStringExtra("phone"));
this.phoneTxt.setText("Contact not saved!!");
return;
}
this.nameTxt.setText(getIntent().getStringExtra("name"));
this.phoneTxt.setText(getIntent().getStringExtra("phone"));
Glide.with(getApplicationContext()).load(Uri.parse("https://ui-avatars.com/api/?background=random&bold=true&length=1&size=128&name=".concat(getIntent().getStringExtra("name").replace(" ", "")))).into(this.circleimageview1);
this.adda.setVisibility(8);
}
public void _getCallLogData() {
this.count = 0.0d;
this.peopl = (ArrayList) new Gson().fromJson(this.datas.getString("calllog", ""), new TypeToken<ArrayList<HashMap<String, Object>>>() {
}.getType());
int i = 0;
while (true) {
int i2 = i;
if (i2 >= this.peopl.size()) {
break;
}
if (this.peopl.get((int) this.count).get("phone").toString().equals(getIntent().getStringExtra("phone"))) {
this.map = new HashMap<>();
this.map.put("phone", this.peopl.get((int) this.count).get("phone").toString());
this.map.put("date", this.peopl.get((int) this.count).get("date").toString());
this.map.put("day", this.peopl.get((int) this.count).get("day").toString());
this.map.put(TypedValues.Transition.S_DURATION, this.peopl.get((int) this.count).get(TypedValues.Transition.S_DURATION).toString());
this.map.put("time", this.peopl.get((int) this.count).get("time").toString());
this.map.put("type", this.peopl.get((int) this.count).get("type").toString());
this.calLog.add(this.map);
}
this.count += 1.0d;
i = i2 + 1;
}
if (this.calLog.size() > 0) {
this.textview44.setVisibility(8);
}
this.recyclerview1.setAdapter(new Recyclerview1Adapter(this.calLog));
this.recyclerview1.setLayoutManager(new LinearLayoutManager(this));
this.adda.setVisibility(8);
}
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 class Recyclerview1Adapter extends RecyclerView.Adapter<ViewHolder> {
ArrayList<HashMap<String, Object>> _data;
public Recyclerview1Adapter(ArrayList<HashMap<String, Object>> arrayList) {
this._data = arrayList;
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
View inflate = InfoActivity.this.getLayoutInflater().inflate(R.layout.recents, (ViewGroup) null);
inflate.setLayoutParams(new RecyclerView.LayoutParams(-1, -2));
return new ViewHolder(inflate);
}
@Override
public void onBindViewHolder(ViewHolder viewHolder, int i) {
View view = viewHolder.itemView;
LinearLayout linearLayout = (LinearLayout) view.findViewById(R.id.linearX);
CircleImageView circleImageView = (CircleImageView) view.findViewById(R.id.circleimageview1);
LinearLayout linearLayout2 = (LinearLayout) view.findViewById(R.id.linear3);
((TextView) view.findViewById(R.id.subtext)).setText(InfoActivity.this._countDuration(Double.parseDouble(this._data.get(i).get(TypedValues.Transition.S_DURATION).toString())));
((TextView) view.findViewById(R.id.name)).setText(new SimpleDateFormat("dd MMM yyyy, hh:mm a").format(Double.valueOf(Double.parseDouble(this._data.get(i).get("date").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);
return;
}
break;
case 844309356:
if (obj.equals("OUTGOING")) {
circleImageView.setImageResource(R.drawable.r67_2);
return;
}
break;
case 875423782:
if (obj.equals("INCOMING")) {
circleImageView.setImageResource(R.drawable.r67_1);
return;
}
break;
}
circleImageView.setImageResource(R.drawable.r67_3);
}
@Override
public int getItemCount() {
return this._data.size();
}
public class ViewHolder extends RecyclerView.ViewHolder {
public ViewHolder(View view) {
super(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;
}
}