SKM TOURNAMENT v1.0版本的 MD5 值为:3f4f4ff9cf9de96fafbfe80869223ebf
以下内容为反编译后的 LiveActivity.java 源代码,内容仅作参考
package com.skm.tournament;
import android.app.ProgressDialog;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.RippleDrawable;
import android.os.Bundle;
import android.util.SparseBooleanArray;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.EditText;
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.exifinterface.media.ExifInterface;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.FirebaseApp;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
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.firebase.database.ValueEventListener;
import com.skm.tournament.RequestNetwork;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Random;
public class LiveActivity extends AppCompatActivity {
private FirebaseAuth Auth;
private OnCompleteListener<Void> Auth_deleteUserListener;
private OnCompleteListener<Void> Auth_emailVerificationSentListener;
private OnCompleteListener<AuthResult> Auth_googleSignInListener;
private OnCompleteListener<AuthResult> Auth_phoneAuthListener;
private OnCompleteListener<Void> Auth_updateEmailListener;
private OnCompleteListener<Void> Auth_updatePasswordListener;
private OnCompleteListener<Void> Auth_updateProfileListener;
private LinearLayout BG1;
private LinearLayout BG2;
private EditText Enter;
private ImageView Send;
private ListView SmsView;
private RequestNetwork WiFi;
private OnCompleteListener<AuthResult> _Auth_create_user_listener;
private OnCompleteListener<Void> _Auth_reset_password_listener;
private OnCompleteListener<AuthResult> _Auth_sign_in_listener;
private ChildEventListener _Sms_child_listener;
private ChildEventListener _Users_child_listener;
private RequestNetwork.RequestListener _WiFi_request_listener;
private ProgressDialog prog;
private FirebaseDatabase _firebase = FirebaseDatabase.getInstance();
private HashMap<String, Object> Hello = new HashMap<>();
private String Key = "";
private String Name = "";
private ArrayList<HashMap<String, Object>> SmsCreate = new ArrayList<>();
private DatabaseReference Sms = this._firebase.getReference("Sms");
private DatabaseReference Users = this._firebase.getReference("Users");
private Calendar Cal = Calendar.getInstance();
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.live);
initialize(bundle);
FirebaseApp.initializeApp(this);
initializeLogic();
}
private void initialize(Bundle bundle) {
this.BG1 = (LinearLayout) findViewById(R.id.BG1);
this.SmsView = (ListView) findViewById(R.id.SmsView);
this.BG2 = (LinearLayout) findViewById(R.id.BG2);
this.Enter = (EditText) findViewById(R.id.Enter);
this.Send = (ImageView) findViewById(R.id.Send);
this.Auth = FirebaseAuth.getInstance();
this.WiFi = new RequestNetwork(this);
this.Send.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (!LiveActivity.this.Enter.getText().toString().equals("")) {
LiveActivity.this.Key = LiveActivity.this.Sms.push().getKey();
LiveActivity.this.Hello = new HashMap();
LiveActivity.this.Hello.put("Name", LiveActivity.this.Name);
LiveActivity.this.Hello.put("Time", new SimpleDateFormat("hh:mm a").format(LiveActivity.this.Cal.getTime()));
LiveActivity.this.Hello.put("Sms", LiveActivity.this.Enter.getText().toString());
LiveActivity.this.Hello.put("Uid", FirebaseAuth.getInstance().getCurrentUser().getUid());
LiveActivity.this.Hello.put("Key", LiveActivity.this.Key);
LiveActivity.this.Sms.child(LiveActivity.this.Key).updateChildren(LiveActivity.this.Hello);
LiveActivity.this.Hello.clear();
SketchwareUtil.showMessage(LiveActivity.this.getApplicationContext(), "Sms Send");
LiveActivity.this.Enter.setText("");
return;
}
SketchwareUtil.showMessage(LiveActivity.this.getApplicationContext(), "Enter Sms Here");
}
});
this._Sms_child_listener = new ChildEventListener() {
@Override
public void onChildAdded(DataSnapshot dataSnapshot, String str) {
GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
};
dataSnapshot.getKey();
LiveActivity.this.Sms.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot2) {
LiveActivity.this.SmsCreate = new ArrayList();
try {
GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator2 = new GenericTypeIndicator<HashMap<String, Object>>() {
};
Iterator<DataSnapshot> it = dataSnapshot2.getChildren().iterator();
while (it.hasNext()) {
LiveActivity.this.SmsCreate.add((HashMap) it.next().getValue(genericTypeIndicator2));
}
} catch (Exception e) {
e.printStackTrace();
}
LiveActivity.this.SmsView.setAdapter((ListAdapter) new SmsViewAdapter(LiveActivity.this.SmsCreate));
((BaseAdapter) LiveActivity.this.SmsView.getAdapter()).notifyDataSetChanged();
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}
@Override
public void onChildChanged(DataSnapshot dataSnapshot, String str) {
GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
};
dataSnapshot.getKey();
}
@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();
LiveActivity.this.Sms.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot2) {
LiveActivity.this.SmsCreate = new ArrayList();
try {
GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator2 = new GenericTypeIndicator<HashMap<String, Object>>() {
};
Iterator<DataSnapshot> it = dataSnapshot2.getChildren().iterator();
while (it.hasNext()) {
LiveActivity.this.SmsCreate.add((HashMap) it.next().getValue(genericTypeIndicator2));
}
} catch (Exception e) {
e.printStackTrace();
}
LiveActivity.this.SmsView.setAdapter((ListAdapter) new SmsViewAdapter(LiveActivity.this.SmsCreate));
((BaseAdapter) LiveActivity.this.SmsView.getAdapter()).notifyDataSetChanged();
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}
@Override
public void onCancelled(DatabaseError databaseError) {
databaseError.getCode();
databaseError.getMessage();
}
};
this.Sms.addChildEventListener(this._Sms_child_listener);
this._Users_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(FirebaseAuth.getInstance().getCurrentUser().getUid())) {
LiveActivity.this.Name = hashMap.get("Name").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(FirebaseAuth.getInstance().getCurrentUser().getUid())) {
LiveActivity.this.Name = hashMap.get("Name").toString();
}
}
@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();
}
@Override
public void onCancelled(DatabaseError databaseError) {
databaseError.getCode();
databaseError.getMessage();
}
};
this.Users.addChildEventListener(this._Users_child_listener);
this._WiFi_request_listener = new RequestNetwork.RequestListener() {
@Override
public void onResponse(String str, String str2, HashMap<String, Object> hashMap) {
LiveActivity.this._Loading(false, "Loading...");
}
@Override
public void onErrorResponse(String str, String str2) {
}
};
this.Auth_updateEmailListener = new OnCompleteListener<Void>() {
@Override
public void onComplete(Task<Void> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this.Auth_updatePasswordListener = new OnCompleteListener<Void>() {
@Override
public void onComplete(Task<Void> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this.Auth_emailVerificationSentListener = new OnCompleteListener<Void>() {
@Override
public void onComplete(Task<Void> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this.Auth_deleteUserListener = new OnCompleteListener<Void>() {
@Override
public void onComplete(Task<Void> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this.Auth_phoneAuthListener = new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(Task<AuthResult> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this.Auth_updateProfileListener = new OnCompleteListener<Void>() {
@Override
public void onComplete(Task<Void> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this.Auth_googleSignInListener = new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(Task<AuthResult> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this._Auth_create_user_listener = new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(Task<AuthResult> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this._Auth_sign_in_listener = new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(Task<AuthResult> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this._Auth_reset_password_listener = new OnCompleteListener<Void>() {
@Override
public void onComplete(Task<Void> task) {
task.isSuccessful();
}
};
}
private void initializeLogic() {
_Loading(true, "Loading...");
this.SmsView.setTranscriptMode(2);
this.SmsView.setStackFromBottom(true);
_rippleRoundStroke(this.Enter, "#EEEEEE", "#EEEEEE", 40.0d, 0.0d, "#FFFFFF");
}
@Override
public void onStart() {
super.onStart();
this.WiFi.startRequestNetwork("GET", "https://www.google.com", ExifInterface.GPS_MEASUREMENT_IN_PROGRESS, this._WiFi_request_listener);
}
public void _rippleRoundStroke(View view, String str, String str2, double d, double d2, String str3) {
GradientDrawable gradientDrawable = new GradientDrawable();
gradientDrawable.setColor(Color.parseColor(str));
gradientDrawable.setCornerRadius((float) d);
gradientDrawable.setStroke((int) d2, Color.parseColor("#" + str3.replace("#", "")));
view.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{Color.parseColor(str2)}), gradientDrawable, null));
}
public void _Loading(boolean z, String str) {
if (z) {
if (this.prog == null) {
this.prog = new ProgressDialog(this);
this.prog.setMax(100);
this.prog.setIndeterminate(true);
this.prog.setCancelable(false);
this.prog.setCanceledOnTouchOutside(false);
}
this.prog.setMessage(str);
this.prog.show();
return;
}
if (this.prog != null) {
this.prog.dismiss();
}
}
public class SmsViewAdapter extends BaseAdapter {
ArrayList<HashMap<String, Object>> _data;
public SmsViewAdapter(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(int i, View view, ViewGroup viewGroup) {
LayoutInflater layoutInflater = LiveActivity.this.getLayoutInflater();
if (view == null) {
view = layoutInflater.inflate(R.layout.sms, (ViewGroup) null);
}
LinearLayout linearLayout = (LinearLayout) view.findViewById(R.id.AdminBg);
LinearLayout linearLayout2 = (LinearLayout) view.findViewById(R.id.AmarBg);
TextView textView = (TextView) view.findViewById(R.id.AdminTv1);
TextView textView2 = (TextView) view.findViewById(R.id.AdminTv2);
TextView textView3 = (TextView) view.findViewById(R.id.AdminTv3);
TextView textView4 = (TextView) view.findViewById(R.id.AmarTv1);
TextView textView5 = (TextView) view.findViewById(R.id.AmarTv2);
TextView textView6 = (TextView) view.findViewById(R.id.AmarTv3);
linearLayout2.setElevation(5.0f);
linearLayout.setElevation(5.0f);
linearLayout2.setBackground(new GradientDrawable() {
public GradientDrawable getIns(int i2, int i3) {
setCornerRadius(i2);
setColor(i3);
return this;
}
}.getIns(5, -14575885));
linearLayout.setBackground(new GradientDrawable() {
public GradientDrawable getIns(int i2, int i3) {
setCornerRadius(i2);
setColor(i3);
return this;
}
}.getIns(5, -1));
if (this._data.get(i).get("Uid").toString().equals(FirebaseAuth.getInstance().getCurrentUser().getUid())) {
if (this._data.get(i).get("Name").toString().equals("Admin")) {
linearLayout2.setVisibility(8);
linearLayout.setVisibility(0);
} else {
linearLayout.setVisibility(8);
linearLayout2.setVisibility(0);
}
} else {
linearLayout2.setVisibility(8);
linearLayout.setVisibility(8);
}
textView4.setText(this._data.get(i).get("Name").toString());
textView5.setText(this._data.get(i).get("Sms").toString());
textView6.setText(this._data.get(i).get("Time").toString());
textView.setText(this._data.get(i).get("Name").toString());
textView2.setText(this._data.get(i).get("Sms").toString());
textView3.setText(this._data.get(i).get("Time").toString());
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;
}
}