K-Studios Hub v1.0版本的 MD5 值为:27abedca3b2878e1cf06ac747d354792
以下内容为反编译后的 ManageAccActivity.java 源代码,内容仅作参考
package com.KS.KStudiosHub;
import android.app.AlertDialog;
import android.content.ClipData;
import android.content.ClipboardManager;
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.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.KS.KStudiosHub.RequestNetwork;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.BuildConfig;
import com.google.firebase.FirebaseApp;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Random;
public class ManageAccActivity extends AppCompatActivity {
private AlertDialog.Builder Asker;
private AlertDialog.Builder ChangeUsername;
private RequestNetwork Deleter;
private RequestNetwork.RequestListener _Deleter_request_listener;
private OnCompleteListener<AuthResult> _fAuth_create_user_listener;
private OnCompleteListener<Void> _fAuth_reset_password_listener;
private OnCompleteListener<AuthResult> _fAuth_sign_in_listener;
private Button button1;
private Button button3;
private Button button4;
private Button button5;
private SharedPreferences deleted_;
private TextView email;
private TextView email_status;
private Button email_verify;
private FirebaseAuth fAuth;
private OnCompleteListener<Void> fAuth_deleteUserListener;
private OnCompleteListener<Void> fAuth_emailVerificationSentListener;
private OnCompleteListener<AuthResult> fAuth_googleSignInListener;
private OnCompleteListener<AuthResult> fAuth_phoneAuthListener;
private OnCompleteListener<Void> fAuth_updateEmailListener;
private OnCompleteListener<Void> fAuth_updatePasswordListener;
private OnCompleteListener<Void> fAuth_updateProfileListener;
private LinearLayout linear1;
private TextView textview1;
private TextView textview6;
private TextView textview8;
private TextView textview9;
private TextView user_uid;
private TextView username;
private SharedPreferences usnm_;
private ScrollView vscroll1;
private HashMap<String, Object> map = new HashMap<>();
private String msg = BuildConfig.FLAVOR;
private Intent TP = new Intent();
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.manage_acc);
initialize(bundle);
FirebaseApp.initializeApp(this);
initializeLogic();
}
private void initialize(Bundle bundle) {
this.vscroll1 = (ScrollView) findViewById(R.id.vscroll1);
this.linear1 = (LinearLayout) findViewById(R.id.linear1);
this.textview1 = (TextView) findViewById(R.id.textview1);
this.username = (TextView) findViewById(R.id.username);
this.button1 = (Button) findViewById(R.id.button1);
this.email = (TextView) findViewById(R.id.email);
this.email_status = (TextView) findViewById(R.id.email_status);
this.email_verify = (Button) findViewById(R.id.email_verify);
this.user_uid = (TextView) findViewById(R.id.user_uid);
this.button3 = (Button) findViewById(R.id.button3);
this.textview6 = (TextView) findViewById(R.id.textview6);
this.textview8 = (TextView) findViewById(R.id.textview8);
this.button4 = (Button) findViewById(R.id.button4);
this.textview9 = (TextView) findViewById(R.id.textview9);
this.button5 = (Button) findViewById(R.id.button5);
this.usnm_ = getSharedPreferences("usnm_", 0);
this.fAuth = FirebaseAuth.getInstance();
this.Asker = new AlertDialog.Builder(this);
this.ChangeUsername = new AlertDialog.Builder(this);
this.deleted_ = getSharedPreferences("deleted_", 0);
this.Deleter = new RequestNetwork(this);
this.button1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ManageAccActivity.this.ChangeUsername.setTitle("Change Username");
ManageAccActivity.this.ChangeUsername.setIcon(R.drawable.edit);
ManageAccActivity.this.ChangeUsername.setMessage("Type your new username and press the confirmation button in order to change your username. You can change it without any time limit.");
final EditText editText = new EditText(ManageAccActivity.this);
editText.setLayoutParams(new LinearLayout.LayoutParams(-2, -2));
ManageAccActivity.this.ChangeUsername.setView(editText);
ManageAccActivity.this.ChangeUsername.setPositiveButton("Confirm", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
if (!editText.getText().toString().equals(BuildConfig.FLAVOR)) {
ManageAccActivity.this.usnm_.edit().putString(FirebaseAuth.getInstance().getCurrentUser().getUid(), editText.getText().toString()).commit();
ManageAccActivity.this.username.setText("Username: ".concat(editText.getText().toString()));
return;
}
editText.setError("You can't set your username to nothing!");
}
});
ManageAccActivity.this.ChangeUsername.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
}
});
ManageAccActivity.this.ChangeUsername.create().show();
}
});
this.email_verify.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
FirebaseAuth.getInstance().getCurrentUser().sendEmailVerification().addOnCompleteListener(ManageAccActivity.this.fAuth_emailVerificationSentListener);
SketchwareUtil.showMessage(ManageAccActivity.this.getApplicationContext(), "Sent a verification email to your email: ".concat(FirebaseAuth.getInstance().getCurrentUser().getEmail()));
}
});
this.button3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ManageAccActivity manageAccActivity = ManageAccActivity.this;
ManageAccActivity.this.getApplicationContext();
((ClipboardManager) manageAccActivity.getSystemService("clipboard")).setPrimaryClip(ClipData.newPlainText("clipboard", FirebaseAuth.getInstance().getCurrentUser().getUid()));
SketchwareUtil.showMessage(ManageAccActivity.this.getApplicationContext(), "Successfully copied User UiD");
}
});
this.button4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ManageAccActivity.this.Asker.setTitle("Change Password");
ManageAccActivity.this.Asker.setIcon(R.drawable.edit);
ManageAccActivity.this.Asker.setMessage("Are you sure you want to change your password? If you confirm we will take you to a login form so that you'll login again and then after you verify yourself you'll be taken to a screen where you'll set your new password.");
ManageAccActivity.this.Asker.setPositiveButton("Change Password", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
ManageAccActivity.this.TP.setClass(ManageAccActivity.this.getApplicationContext(), VerifyActivity.class);
ManageAccActivity.this.startActivity(ManageAccActivity.this.TP);
}
});
ManageAccActivity.this.Asker.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
}
});
ManageAccActivity.this.Asker.create().show();
}
});
this.button5.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ManageAccActivity.this.Asker.setTitle("Delete Account");
ManageAccActivity.this.Asker.setIcon(R.drawable.delete);
ManageAccActivity.this.Asker.setMessage("Are you sure you want to delete your account?\n\nAfter confirming this action your request will be sent to our Team and you'll have 2 weeks before your account will be completely deleted.");
ManageAccActivity.this.Asker.setPositiveButton("Confirm", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
ManageAccActivity.this.deleted_.edit().putString("a1b2c3", "1").commit();
ManageAccActivity.this.map = new HashMap();
ManageAccActivity.this.map.put("username", ManageAccActivity.this.usnm_.getString(FirebaseAuth.getInstance().getCurrentUser().getUid(), BuildConfig.FLAVOR).concat(" {".concat(FirebaseAuth.getInstance().getCurrentUser().getEmail().concat("}"))));
ManageAccActivity.this.map.put("content", "***This user has requested his account to be deleted.***\n\n__Note for Staff:__\n```\nCheck when this message has been sent on Discord (the API from K-Studios Hub is very fast so it's sent and delivered the same day) and then continue the procedure of deleting this user's account after two (2) weeks.\n```\n\nUser UiD: ".concat(FirebaseAuth.getInstance().getCurrentUser().getUid()));
ManageAccActivity.this.Deleter.setParams(ManageAccActivity.this.map, 0);
ManageAccActivity.this.Deleter.startRequestNetwork("POST", "https://discord.com/api/webhooks/1109596865982382110/IsBvMwLyhIot46YyR2__DUwOHaVvPIBHydgjMqC_ZgQ76bCTHzaUNxCfEaZs5cqJL-CN", "#".concat(String.valueOf(SketchwareUtil.getRandom(1000, 9999))), ManageAccActivity.this._Deleter_request_listener);
FirebaseAuth.getInstance().signOut();
ManageAccActivity.this.TP.setClass(ManageAccActivity.this.getApplicationContext(), RegLogActivity.class);
ManageAccActivity.this.startActivity(ManageAccActivity.this.TP);
ManageAccActivity.this.finish();
}
});
ManageAccActivity.this.Asker.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
}
});
ManageAccActivity.this.Asker.create().show();
}
});
this._Deleter_request_listener = new RequestNetwork.RequestListener() {
@Override
public void onResponse(String str, String str2, HashMap<String, Object> hashMap) {
}
@Override
public void onErrorResponse(String str, String str2) {
}
};
this.fAuth_updateEmailListener = new OnCompleteListener<Void>() {
@Override
public void onComplete(Task<Void> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this.fAuth_updatePasswordListener = new OnCompleteListener<Void>() {
@Override
public void onComplete(Task<Void> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this.fAuth_emailVerificationSentListener = new OnCompleteListener<Void>() {
@Override
public void onComplete(Task<Void> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this.fAuth_deleteUserListener = new OnCompleteListener<Void>() {
@Override
public void onComplete(Task<Void> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this.fAuth_phoneAuthListener = new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(Task<AuthResult> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this.fAuth_updateProfileListener = new OnCompleteListener<Void>() {
@Override
public void onComplete(Task<Void> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this.fAuth_googleSignInListener = new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(Task<AuthResult> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this._fAuth_create_user_listener = new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(Task<AuthResult> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this._fAuth_sign_in_listener = new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(Task<AuthResult> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this._fAuth_reset_password_listener = new OnCompleteListener<Void>() {
@Override
public void onComplete(Task<Void> task) {
task.isSuccessful();
}
};
}
private void initializeLogic() {
}
@Override
public void onStart() {
super.onStart();
_BooleanReader(FirebaseAuth.getInstance().getCurrentUser().isEmailVerified());
this.username.setText("Username: ".concat(this.usnm_.getString(FirebaseAuth.getInstance().getCurrentUser().getUid(), BuildConfig.FLAVOR)));
this.email.setText("Email: ".concat(FirebaseAuth.getInstance().getCurrentUser().getEmail()));
this.user_uid.setText("User UiD: ".concat(FirebaseAuth.getInstance().getCurrentUser().getUid()));
}
public void _BooleanReader(boolean z) {
if (String.valueOf(z).equals(true)) {
this.email_status.setText("Verified");
this.email_verify.setVisibility(8);
} else if (String.valueOf(z).equals(false)) {
this.email_status.setText("Not verified yet");
this.email_verify.setVisibility(0);
}
}
@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;
}
}