TickAdsLite v3.1版本的 MD5 值为:7ff5236e2d7beb37efeddcb8fe8d4660
以下内容为反编译后的 LoadingActivity.java 源代码,内容仅作参考
package com.nishantsharma.tickadslite;
import android.app.Dialog;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.util.SparseBooleanArray;
import android.util.TypedValue;
import android.view.View;
import android.view.Window;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
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.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.nishantsharma.tickadslite.RequestNetwork;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Random;
import java.util.Timer;
import java.util.TimerTask;
public class LoadingActivity extends AppCompatActivity {
private OnCompleteListener<AuthResult> _auth_create_user_listener;
private OnCompleteListener<Void> _auth_reset_password_listener;
private OnCompleteListener<AuthResult> _auth_sign_in_listener;
private ChildEventListener _menu_child_listener;
private RequestNetwork.RequestListener _re_request_listener;
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 ImageView imageview1;
private LinearLayout linear1;
private LinearLayout linear2;
private ProgressBar progressbar1;
private RequestNetwork re;
private SharedPreferences save;
private TimerTask t;
private TextView textview1;
private TextView textview2;
private TextView textview3;
private TextView tiptxt;
private Timer _timer = new Timer();
private FirebaseDatabase _firebase = FirebaseDatabase.getInstance();
private String country = "";
private HashMap<String, Object> mapforcountry = new HashMap<>();
private double n = 0.0d;
private String updatenotice = "";
private boolean Uptodate = false;
private ArrayList<HashMap<String, Object>> menulistmap = new ArrayList<>();
private Intent i = new Intent();
private DatabaseReference menu = this._firebase.getReference("menu");
private Intent link = new Intent();
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.loading);
initialize(bundle);
FirebaseApp.initializeApp(this);
initializeLogic();
}
private void initialize(Bundle bundle) {
this.linear1 = (LinearLayout) findViewById(R.id.linear1);
this.tiptxt = (TextView) findViewById(R.id.tiptxt);
this.imageview1 = (ImageView) findViewById(R.id.imageview1);
this.textview1 = (TextView) findViewById(R.id.textview1);
this.textview3 = (TextView) findViewById(R.id.textview3);
this.progressbar1 = (ProgressBar) findViewById(R.id.progressbar1);
this.linear2 = (LinearLayout) findViewById(R.id.linear2);
this.textview2 = (TextView) findViewById(R.id.textview2);
this.auth = FirebaseAuth.getInstance();
this.re = new RequestNetwork(this);
this.save = getSharedPreferences("save", 0);
this._re_request_listener = new RequestNetwork.RequestListener() {
@Override
public void onResponse(String str, String str2, HashMap<String, Object> hashMap) {
LoadingActivity.this.mapforcountry = (HashMap) new Gson().fromJson(str2, new TypeToken<HashMap<String, Object>>() {
}.getType());
LoadingActivity.this.country = "\n Your Country's ECPM is too low pls connect with another Country\nFor ex:- 🇺🇸USA , 🇨🇦Canada , 🇳🇱Netherlands , 🇦🇺Australia etc , 🇩🇰 Denmark, 🇬🇧United Kingdom, 🇨🇭 Switzerland, 🇯🇵Japan.\nPlease Connect with VPN and Restart App";
if (!str2.equals("")) {
if (LoadingActivity.this.mapforcountry.get("countryCode").toString().equals("US") || LoadingActivity.this.mapforcountry.get("countryCode").toString().equals("DK") || LoadingActivity.this.mapforcountry.get("countryCode").toString().equals("NL") || LoadingActivity.this.mapforcountry.get("countryCode").toString().equals("AU") || LoadingActivity.this.mapforcountry.get("countryCode").toString().equals("CH") || LoadingActivity.this.mapforcountry.get("countryCode").toString().equals("CA") || LoadingActivity.this.mapforcountry.get("countryCode").toString().equals("UK") || LoadingActivity.this.mapforcountry.get("countryCode").toString().equals("JP")) {
if (FirebaseAuth.getInstance().getCurrentUser() != null) {
LoadingActivity.this.i.setClass(LoadingActivity.this.getApplicationContext(), DashboardActivity.class);
LoadingActivity.this.t.cancel();
LoadingActivity.this.startActivity(LoadingActivity.this.i);
LoadingActivity.this.finish();
return;
}
LoadingActivity.this.i.setClass(LoadingActivity.this.getApplicationContext(), MainActivity.class);
LoadingActivity.this.t.cancel();
LoadingActivity.this.startActivity(LoadingActivity.this.i);
LoadingActivity.this.finish();
return;
}
Dialog dialog = new Dialog(LoadingActivity.this);
dialog.requestWindowFeature(1);
dialog.setContentView(R.layout.customdialog2);
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(0));
dialog.setCancelable(false);
dialog.findViewById(R.id.background).setBackground(new GradientDrawable() {
public GradientDrawable getIns(int i, int i2) {
setCornerRadius(i);
setColor(i2);
return this;
}
}.getIns(40, -14273992));
((TextView) dialog.findViewById(R.id.message)).setText(LoadingActivity.this.country);
((TextView) dialog.findViewById(R.id.titletxt)).setText("------ High Ecpm Detection ------");
((TextView) dialog.findViewById(R.id.titletxt)).setBackground(new GradientDrawable() {
public GradientDrawable getIns(int i, int i2) {
setCornerRadius(i);
setColor(i2);
return this;
}
}.getIns(10, -2039584));
dialog.show();
}
}
@Override
public void onErrorResponse(String str, String str2) {
}
};
this._menu_child_listener = new ChildEventListener() {
@Override
public void onChildAdded(DataSnapshot dataSnapshot, String str) {
GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
};
dataSnapshot.getKey();
HashMap hashMap = (HashMap) dataSnapshot.getValue(genericTypeIndicator);
}
@Override
public void onChildChanged(DataSnapshot dataSnapshot, String str) {
GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
};
dataSnapshot.getKey();
HashMap hashMap = (HashMap) dataSnapshot.getValue(genericTypeIndicator);
}
@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.menu.addChildEventListener(this._menu_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();
}
};
}
private void initializeLogic() {
Window window = getWindow();
window.clearFlags(67108864);
window.addFlags(Integer.MIN_VALUE);
window.setStatusBarColor(Color.parseColor("#263238"));
_setcorner(this.tiptxt, 15.0d, 10.0d, "#E0E0E0");
this.t = new TimerTask() {
@Override
public void run() {
LoadingActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
if (SketchwareUtil.isConnected(LoadingActivity.this.getApplicationContext())) {
LoadingActivity.this.re.startRequestNetwork("GET", "http://ip-api.com/json", "", LoadingActivity.this._re_request_listener);
return;
}
Dialog dialog = new Dialog(LoadingActivity.this);
dialog.requestWindowFeature(1);
dialog.setContentView(R.layout.customdialog2);
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(0));
dialog.setCancelable(false);
dialog.findViewById(R.id.background).setBackground(new GradientDrawable() {
public GradientDrawable getIns(int i, int i2) {
setCornerRadius(i);
setColor(i2);
return this;
}
}.getIns(40, -12232092));
((TextView) dialog.findViewById(R.id.message)).setText("Please connect with Internet ❗\nand Restart App");
((TextView) dialog.findViewById(R.id.titletxt)).setVisibility(8);
dialog.show();
}
});
}
};
this._timer.schedule(this.t, 100L);
}
public void _setcorner(View view, double d, double d2, String str) {
GradientDrawable gradientDrawable = new GradientDrawable();
gradientDrawable.setColor(Color.parseColor(str));
gradientDrawable.setCornerRadius((float) d);
view.setElevation((float) d2);
view.setBackground(gradientDrawable);
}
@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;
}
}