SKM TOURNAMENT v1.0版本的 MD5 值为:3f4f4ff9cf9de96fafbfe80869223ebf
以下内容为反编译后的 MainActivity.java 源代码,内容仅作参考
package com.skm.tournament;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.util.SparseBooleanArray;
import android.util.TypedValue;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.exifinterface.media.ExifInterface;
import com.airbnb.lottie.LottieAnimationView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
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.google.firebase.iid.InstanceIdResult;
import com.google.firebase.messaging.FirebaseMessaging;
import com.skm.tournament.RequestNetwork;
import java.text.Normalizer;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Random;
import java.util.Timer;
import java.util.TimerTask;
public class MainActivity 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 OnCompleteListener CloudMessage_onCompleteListener;
private AlertDialog.Builder Dialog;
private SharedPreferences FirebaseCloud;
private ImageView Icon;
private LottieAnimationView Lottie;
private LinearLayout MainBg;
private AlertDialog.Builder Pro;
private TimerTask Timer;
private LinearLayout VerBg;
private TextView VerTv;
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 _Version_child_listener;
private RequestNetwork.RequestListener _WiFi_request_listener;
private Timer _timer = new Timer();
private FirebaseDatabase _firebase = FirebaseDatabase.getInstance();
private String ServerKey = "";
private String Package_Name = "";
private String Versions = "";
private String App_Version = "";
private String App_Url = "";
private ArrayList<HashMap<String, Object>> VersionCode = new ArrayList<>();
private Intent Screen = new Intent();
private DatabaseReference Version = this._firebase.getReference("Version");
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.main);
initialize(bundle);
FirebaseApp.initializeApp(this);
initializeLogic();
}
private void initialize(Bundle bundle) {
this.MainBg = (LinearLayout) findViewById(R.id.MainBg);
this.Icon = (ImageView) findViewById(R.id.Icon);
this.VerBg = (LinearLayout) findViewById(R.id.VerBg);
this.Lottie = (LottieAnimationView) findViewById(R.id.Lottie);
this.VerTv = (TextView) findViewById(R.id.VerTv);
this.Auth = FirebaseAuth.getInstance();
this.Dialog = new AlertDialog.Builder(this);
this.WiFi = new RequestNetwork(this);
this.Pro = new AlertDialog.Builder(this);
this.FirebaseCloud = getSharedPreferences("FirebaseCloud", 0);
this.CloudMessage_onCompleteListener = new OnCompleteListener<InstanceIdResult>() {
@Override
public void onComplete(Task<InstanceIdResult> task) {
task.isSuccessful();
task.getResult().getToken();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this._WiFi_request_listener = new AnonymousClass2();
this._Version_child_listener = new ChildEventListener() {
@Override
public void onChildAdded(DataSnapshot dataSnapshot, String str) {
GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
};
dataSnapshot.getKey();
}
@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();
}
@Override
public void onCancelled(DatabaseError databaseError) {
databaseError.getCode();
databaseError.getMessage();
}
};
this.Version.addChildEventListener(this._Version_child_listener);
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();
}
};
}
public class AnonymousClass2 implements RequestNetwork.RequestListener {
AnonymousClass2() {
}
@Override
public void onResponse(String str, String str2, HashMap<String, Object> hashMap) {
if (FirebaseAuth.getInstance().getCurrentUser() != null) {
MainActivity.this.Timer = new TimerTask() {
@Override
public void run() {
MainActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
MainActivity.this.Screen.setClass(MainActivity.this.getApplicationContext(), HomeActivity.class);
MainActivity.this.startActivity(MainActivity.this.Screen);
MainActivity.this.finish();
}
});
}
};
MainActivity.this._timer.schedule(MainActivity.this.Timer, 1500L);
} else {
MainActivity.this.Timer = new TimerTask() {
@Override
public void run() {
MainActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
MainActivity.this.Screen.setClass(MainActivity.this.getApplicationContext(), CreateActivity.class);
MainActivity.this.startActivity(MainActivity.this.Screen);
MainActivity.this.finish();
}
});
}
};
MainActivity.this._timer.schedule(MainActivity.this.Timer, 1500L);
}
}
@Override
public void onErrorResponse(String str, String str2) {
MainActivity.this.Dialog.setTitle("Internet Not Available");
MainActivity.this.Dialog.setIcon(R.drawable.wifi);
MainActivity.this.Dialog.setMessage("Internet Unavailable. Enable Data Or Wifi To Continue Apps.");
MainActivity.this.Dialog.setCancelable(false);
MainActivity.this.Dialog.setPositiveButton("TRY AGAIN", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
MainActivity.this.WiFi.startRequestNetwork("GET", "https://www.google.com", ExifInterface.GPS_MEASUREMENT_IN_PROGRESS, MainActivity.this._WiFi_request_listener);
}
});
MainActivity.this.Dialog.setNegativeButton("EXIT", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
MainActivity.this.finishAffinity();
}
});
MainActivity.this.Dialog.create().show();
}
}
private void initializeLogic() {
if (FirebaseAuth.getInstance().getCurrentUser() != null) {
this.Timer = new TimerTask() {
@Override
public void run() {
MainActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
MainActivity.this.Screen.setClass(MainActivity.this.getApplicationContext(), HomeActivity.class);
MainActivity.this.startActivity(MainActivity.this.Screen);
MainActivity.this.finish();
}
});
}
};
this._timer.schedule(this.Timer, 1500L);
} else {
this.Timer = new TimerTask() {
@Override
public void run() {
MainActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
MainActivity.this.Screen.setClass(MainActivity.this.getApplicationContext(), CreateActivity.class);
MainActivity.this.startActivity(MainActivity.this.Screen);
MainActivity.this.finish();
}
});
}
};
this._timer.schedule(this.Timer, 1500L);
}
}
public void _subscribeFCMTopic(String str) {
if (str.matches("[a-zA-Z0-9-_.~%]{1,900}")) {
FirebaseMessaging.getInstance().subscribeToTopic(Normalizer.normalize(str, Normalizer.Form.NFD).replaceAll("[\\p{InCombiningDiacriticalMarks}]", "")).addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()) {
MainActivity.this.FirebaseCloud.edit().putString("CloudMessage", "CloudMessage").commit();
SketchwareUtil.showMessage(MainActivity.this.getApplicationContext(), "Welcome");
} else {
SketchwareUtil.showMessage(MainActivity.this.getApplicationContext(), "Invalid");
}
}
});
} else {
SketchwareUtil.showMessage(getApplicationContext(), "Invalid Topic");
}
}
public void _glideFromURL(String str, ImageView imageView) {
Glide.with(getApplicationContext()).load(str).diskCacheStrategy(DiskCacheStrategy.ALL).error(R.drawable.app_icon).into(imageView);
}
public void _VersionApps() {
this.Version.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
MainActivity.this.VersionCode = new ArrayList();
try {
GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
};
Iterator<DataSnapshot> it = dataSnapshot.getChildren().iterator();
while (it.hasNext()) {
MainActivity.this.VersionCode.add((HashMap) it.next().getValue(genericTypeIndicator));
}
} catch (Exception e) {
e.printStackTrace();
}
MainActivity.this.App_Version = ((HashMap) MainActivity.this.VersionCode.get(0)).get("Code").toString();
MainActivity.this.App_Url = ((HashMap) MainActivity.this.VersionCode.get(0)).get("Url").toString();
if (Double.parseDouble(MainActivity.this.Versions) != Double.parseDouble(MainActivity.this.App_Version)) {
Double.parseDouble(MainActivity.this.Versions);
Double.parseDouble(MainActivity.this.App_Version);
} else {
MainActivity.this.WiFi.startRequestNetwork("GET", "https://www.google.com", ExifInterface.GPS_MEASUREMENT_IN_PROGRESS, MainActivity.this._WiFi_request_listener);
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}
@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;
}
}