From 7845f409697356004a204ed686266af8dace9451 Mon Sep 17 00:00:00 2001 From: xC3FFF0E <78732474+xC3FFF0E@users.noreply.github.com> Date: Sat, 19 Mar 2022 21:26:26 +0800 Subject: Update SplashActivity.java --- .../java/com/xc3fff0e/xmanager/SplashActivity.java | 181 ++------------------- 1 file changed, 16 insertions(+), 165 deletions(-) (limited to 'app/src/main/java/com/xc3fff0e/xmanager') diff --git a/app/src/main/java/com/xc3fff0e/xmanager/SplashActivity.java b/app/src/main/java/com/xc3fff0e/xmanager/SplashActivity.java index 535ca33..d234415 100644 --- a/app/src/main/java/com/xc3fff0e/xmanager/SplashActivity.java +++ b/app/src/main/java/com/xc3fff0e/xmanager/SplashActivity.java @@ -33,11 +33,6 @@ import android.content.Intent; import android.net.Uri; import android.app.Activity; import android.content.SharedPreferences; -import com.google.firebase.auth.AuthResult; -import com.google.firebase.auth.FirebaseUser; -import com.google.firebase.auth.FirebaseAuth; -import com.google.android.gms.tasks.OnCompleteListener; -import com.google.android.gms.tasks.Task; import android.graphics.Typeface; import com.wuyr.rippleanimation.*; import androidx.fragment.app.Fragment; @@ -55,20 +50,6 @@ public class SplashActivity extends AppCompatActivity { private TimerTask Timer; private Intent Switch_Activity = new Intent(); private SharedPreferences NAVIGATION_BAR; - private FirebaseAuth xManager_Origins; - private OnCompleteListener _xManager_Origins_create_user_listener; - private OnCompleteListener _xManager_Origins_sign_in_listener; - private OnCompleteListener _xManager_Origins_reset_password_listener; - private OnCompleteListener xManager_Origins_updateEmailListener; - private OnCompleteListener xManager_Origins_updatePasswordListener; - private OnCompleteListener xManager_Origins_emailVerificationSentListener; - private OnCompleteListener xManager_Origins_deleteUserListener; - private OnCompleteListener xManager_Origins_updateProfileListener; - private OnCompleteListener xManager_Origins_phoneAuthListener; - private OnCompleteListener xManager_Origins_googleSignInListener; - - private RequestNetwork Authenticator; - private RequestNetwork.RequestListener _Authenticator_request_listener; @Override protected void onCreate(Bundle _savedInstanceState) { @@ -86,141 +67,6 @@ public class SplashActivity extends AppCompatActivity { icon_manager = findViewById(R.id.icon_manager); title_manager = findViewById(R.id.title_manager); NAVIGATION_BAR = getSharedPreferences("NAVIGATION_BAR", Activity.MODE_PRIVATE); - xManager_Origins = FirebaseAuth.getInstance(); - Authenticator = new RequestNetwork(this); - - _Authenticator_request_listener = new RequestNetwork.RequestListener() { - @Override - public void onResponse(String _param1, String _param2, HashMap _param3) { - final String _tag = _param1; - final String _response = _param2; - final HashMap _responseHeaders = _param3; - - } - - @Override - public void onErrorResponse(String _param1, String _param2) { - final String _tag = _param1; - final String _message = _param2; - - } - }; - - xManager_Origins_updateEmailListener = new OnCompleteListener() { - @Override - public void onComplete(Task _param1) { - final boolean _success = _param1.isSuccessful(); - final String _errorMessage = _param1.getException() != null ? _param1.getException().getMessage() : ""; - - } - }; - - xManager_Origins_updatePasswordListener = new OnCompleteListener() { - @Override - public void onComplete(Task _param1) { - final boolean _success = _param1.isSuccessful(); - final String _errorMessage = _param1.getException() != null ? _param1.getException().getMessage() : ""; - - } - }; - - xManager_Origins_emailVerificationSentListener = new OnCompleteListener() { - @Override - public void onComplete(Task _param1) { - final boolean _success = _param1.isSuccessful(); - final String _errorMessage = _param1.getException() != null ? _param1.getException().getMessage() : ""; - - } - }; - - xManager_Origins_deleteUserListener = new OnCompleteListener() { - @Override - public void onComplete(Task _param1) { - final boolean _success = _param1.isSuccessful(); - final String _errorMessage = _param1.getException() != null ? _param1.getException().getMessage() : ""; - - } - }; - - xManager_Origins_phoneAuthListener = new OnCompleteListener() { - @Override - public void onComplete(Task task) { - final boolean _success = task.isSuccessful(); - final String _errorMessage = task.getException() != null ? task.getException().getMessage() : ""; - - } - }; - - xManager_Origins_updateProfileListener = new OnCompleteListener() { - @Override - public void onComplete(Task _param1) { - final boolean _success = _param1.isSuccessful(); - final String _errorMessage = _param1.getException() != null ? _param1.getException().getMessage() : ""; - - } - }; - - xManager_Origins_googleSignInListener = new OnCompleteListener() { - @Override - public void onComplete(Task task) { - final boolean _success = task.isSuccessful(); - final String _errorMessage = task.getException() != null ? task.getException().getMessage() : ""; - - } - }; - - _xManager_Origins_create_user_listener = new OnCompleteListener() { - @Override - public void onComplete(Task _param1) { - final boolean _success = _param1.isSuccessful(); - final String _errorMessage = _param1.getException() != null ? _param1.getException().getMessage() : ""; - - } - }; - - _xManager_Origins_sign_in_listener = new OnCompleteListener() { - @Override - public void onComplete(Task _param1) { - final boolean _success = _param1.isSuccessful(); - final String _errorMessage = _param1.getException() != null ? _param1.getException().getMessage() : ""; - if (_success) { - Timer = new TimerTask() { - @Override - public void run() { - runOnUiThread(new Runnable() { - @Override - public void run() { - Switch_Activity.setClass(getApplicationContext(), MainActivity.class); - startActivity(Switch_Activity); - finish(); - } - }); - } - }; - _timer.schedule(Timer, (int)(500)); - } - else { - if (0 == SketchwareUtil.getRandom((int)(0), (int)(1))) { - SketchwareUtil.showMessage(getApplicationContext(), "Detection: Graaavy!"); - } - else { - if (1 == SketchwareUtil.getRandom((int)(0), (int)(1))) { - SketchwareUtil.showMessage(getApplicationContext(), "Detected: Salt Added"); - } - } - finishAndRemoveTask(); - finishAffinity(); - } - } - }; - - _xManager_Origins_reset_password_listener = new OnCompleteListener() { - @Override - public void onComplete(Task _param1) { - final boolean _success = _param1.isSuccessful(); - - } - }; } private void initializeLogic() { @@ -288,15 +134,26 @@ public class SplashActivity extends AppCompatActivity { } } } - if (SketchwareUtil.isConnected(getApplicationContext())) { - _xManager_Validator(); - } + Timer = new TimerTask() { + @Override + public void run() { + runOnUiThread(new Runnable() { + @Override + public void run() { + Switch_Activity.setClass(getApplicationContext(), MainActivity.class); + startActivity(Switch_Activity); + finish(); + } + }); + } + }; + _timer.schedule(Timer, (int)(1500)); _Dark_Navigation(); } @Override public void onBackPressed() { - SketchwareUtil.showMessage(getApplicationContext(), "Please wait..."); + SketchwareUtil.showMessage(getApplicationContext(), "Can't Go Back"); } @Override @@ -320,8 +177,7 @@ public class SplashActivity extends AppCompatActivity { } } - } - catch(Exception e) { + } catch (Exception e) { } } @@ -334,11 +190,6 @@ public class SplashActivity extends AppCompatActivity { } - public void _xManager_Validator() { - xManager_Origins.signInWithEmailAndPassword("origins-public@xmanager.com", "xmanager-origins").addOnCompleteListener(SplashActivity.this, _xManager_Origins_sign_in_listener); - } - - @Deprecated public void showMessage(String _s) { Toast.makeText(getApplicationContext(), _s, Toast.LENGTH_SHORT).show(); -- cgit v1.2.3