TopTV v3.0.1版本的 MD5 值为:0fc1b9ce94885bc92edd11a6ee3e5932
以下内容为反编译后的 FreeTrailActivity.java 源代码,内容仅作参考
package com.toptvone.toptviptvbox.WHMCSClientapp.activities;
import a.b.k.c;
import android.annotation.SuppressLint;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.Typeface;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.os.Bundle;
import android.text.InputFilter;
import android.text.Spanned;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import butterknife.BindView;
import butterknife.ButterKnife;
import c.k.a.e.g;
import c.k.a.g.n.a;
import c.k.a.g.n.e;
import c.k.a.i.h.b;
import com.amazonaws.services.s3.internal.Constants;
import com.toptvone.toptviptvbox.R;
import com.toptvone.toptviptvbox.WHMCSClientapp.Clientdatabase.ClientSharepreferenceHandler;
import com.toptvone.toptviptvbox.WHMCSClientapp.interfaces.ApiService;
import com.toptvone.toptviptvbox.model.FreeTrailModelClass;
import com.toptvone.toptviptvbox.model.database.DatabaseHandler;
import com.toptvone.toptviptvbox.model.database.LiveStreamDBHandler;
import com.toptvone.toptviptvbox.model.database.MultiUserDBHandler;
import com.toptvone.toptviptvbox.model.database.SharepreferenceDBHandler;
import com.toptvone.toptviptvbox.view.activity.LoginActivity;
import java.net.NetworkInterface;
import java.util.Collections;
import java.util.Random;
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern;
import k.x;
import me.zhanghai.android.materialprogressbar.BuildConfig;
import o.d;
import o.l;
import o.m;
import org.achartengine.renderer.DefaultRenderer;
public class FreeTrailActivity extends c {
public static InputFilter f23994d = new InputFilter() {
@Override
public CharSequence filter(CharSequence charSequence, int i2, int i3, Spanned spanned, int i4, int i5) {
while (i2 < i3) {
if (Character.getType(charSequence.charAt(i2)) == 19) {
return BuildConfig.FLAVOR;
}
i2++;
}
return null;
}
};
public ProgressDialog B;
public String C;
public SharedPreferences D;
public SharedPreferences.Editor E;
public SharedPreferences F;
public SharedPreferences G;
public SharedPreferences H;
public SharedPreferences.Editor I;
public Boolean J;
public SharedPreferences K;
public SharedPreferences.Editor L;
public LiveStreamDBHandler M;
public SharedPreferences.Editor N;
public SharedPreferences O;
public DatabaseHandler P;
public MultiUserDBHandler Q;
public EditText f23995e;
public EditText f23996f;
public EditText f23997g;
public EditText f23998h;
public Button f23999i;
public TextView f24000j;
public String f24005o;
public String p;
@BindView
public RelativeLayout rl_already_register;
@BindView
public RelativeLayout rl_bt_submit;
@BindView
public RelativeLayout rl_confirmpassword;
@BindView
public RelativeLayout rl_email;
@BindView
public RelativeLayout rl_password;
@BindView
public RelativeLayout rl_username;
public int x;
public Context y;
public String f24001k = BuildConfig.FLAVOR;
public String f24002l = BuildConfig.FLAVOR;
public String f24003m = BuildConfig.FLAVOR;
public String f24004n = BuildConfig.FLAVOR;
public String q = BuildConfig.FLAVOR;
public String r = BuildConfig.FLAVOR;
public String s = BuildConfig.FLAVOR;
public String t = BuildConfig.FLAVOR;
public long u = -1;
public String v = BuildConfig.FLAVOR;
public String w = Build.MODEL;
public String z = BuildConfig.FLAVOR;
public long A = -1;
public static String E0(String str) {
if (TextUtils.isEmpty(str)) {
return str;
}
char[] charArray = str.toCharArray();
StringBuilder sb = new StringBuilder();
boolean z = true;
for (char c2 : charArray) {
if (z && Character.isLetter(c2)) {
sb.append(Character.toUpperCase(c2));
z = false;
} else {
if (Character.isWhitespace(c2)) {
z = true;
}
sb.append(c2);
}
}
return sb.toString();
}
public static String F0() {
String str = Build.MANUFACTURER;
String str2 = Build.MODEL;
if (str2.startsWith(str)) {
return E0(str2);
}
return E0(str) + " " + str2;
}
public static String G0() {
try {
for (NetworkInterface networkInterface : Collections.list(NetworkInterface.getNetworkInterfaces())) {
if (networkInterface.getName().equalsIgnoreCase("wlan0")) {
byte[] hardwareAddress = networkInterface.getHardwareAddress();
if (hardwareAddress == null) {
return BuildConfig.FLAVOR;
}
StringBuilder sb = new StringBuilder();
int length = hardwareAddress.length;
for (int i2 = 0; i2 < length; i2++) {
sb.append(String.format("%02X:", Byte.valueOf(hardwareAddress[i2])));
}
if (sb.length() > 0) {
sb.deleteCharAt(sb.length() - 1);
}
return sb.toString();
}
}
return BuildConfig.FLAVOR;
} catch (Exception unused) {
return BuildConfig.FLAVOR;
}
}
public void D(String str) {
ProgressDialog progressDialog = this.B;
if (progressDialog != null) {
progressDialog.dismiss();
}
if (str.equals(BuildConfig.FLAVOR)) {
e.j0(this.y, "Your Account is invalid or expired !");
} else {
e.j0(this.y, str);
}
}
public void D0() {
try {
this.p = getPackageManager().getPackageInfo(getPackageName(), 0).versionName;
} catch (PackageManager.NameNotFoundException e2) {
e2.printStackTrace();
}
}
public String H0() {
return ((WifiManager) getApplicationContext().getSystemService("wifi")).getConnectionInfo().getMacAddress();
}
public boolean I0(String str) {
return Pattern.compile("^[\\w\\.-]+@([\\w\\-]+\\.)+[A-Z]{2,4}$", 2).matcher(str).matches();
}
public void a() {
ProgressDialog progressDialog = this.B;
if (progressDialog != null) {
progressDialog.show();
}
}
@Override
public void onBackPressed() {
if (a.f17281i.booleanValue()) {
a.f17280h = Boolean.TRUE;
}
finish();
super.onBackPressed();
overridePendingTransition(R.anim.fade_out, R.anim.fade_in);
}
@Override
@SuppressLint({"ResourceType"})
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
g.f16994b = new g(this);
setContentView(R.layout.activity_free_trail);
ButterKnife.a(this);
D0();
s0();
F0();
u0();
String G0 = G0();
this.C = G0;
if (G0.equalsIgnoreCase(BuildConfig.FLAVOR)) {
this.C = H0();
}
this.y = this;
this.M = new LiveStreamDBHandler(this.y);
this.Q = new MultiUserDBHandler(this.y);
this.P = new DatabaseHandler(this.y);
this.f23997g = new EditText(this);
this.f23997g.setLayoutParams(new LinearLayout.LayoutParams(-1, -1));
this.f23997g.setPaddingRelative(35, 0, 35, 0);
this.f23997g.setHint(getResources().getString(R.string.email));
this.f23997g.setHintTextColor(getResources().getColor(R.color.white));
this.f23997g.setHintTextColor(-1);
this.f23997g.setTextSize(22.0f);
this.f23997g.setId(101);
this.f23997g.setBackground(getResources().getDrawable(R.drawable.selector_login_fields));
this.f23997g.setFocusable(true);
this.f23997g.setTypeface(Typeface.SANS_SERIF);
this.f23997g.setInputType(32);
this.rl_email.addView(this.f23997g);
this.f23995e = new EditText(this);
this.f23995e.setLayoutParams(new LinearLayout.LayoutParams(-1, -1));
this.f23995e.setPaddingRelative(35, 0, 35, 0);
this.f23995e.setHint(getResources().getString(R.string.username));
this.f23995e.setHintTextColor(getResources().getColor(R.color.white));
this.f23995e.setHintTextColor(-1);
this.f23995e.setTextSize(22.0f);
this.f23995e.setId(101);
this.f23995e.setBackground(getResources().getDrawable(R.drawable.selector_login_fields));
this.f23995e.setFocusable(true);
this.f23995e.setTypeface(Typeface.SANS_SERIF);
this.f23995e.setInputType(1);
this.rl_username.addView(this.f23995e);
this.f23996f = new EditText(this);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -1);
this.f23996f.setPaddingRelative(35, 0, 35, 0);
this.f23996f.setLayoutParams(layoutParams);
this.f23996f.setHint(getResources().getString(R.string.enter_password));
this.f23996f.setHintTextColor(getResources().getColor(R.color.white));
this.f23996f.setHintTextColor(-1);
this.f23996f.setTextSize(22.0f);
this.f23996f.setId(101);
this.f23996f.setBackground(getResources().getDrawable(R.drawable.selector_login_fields));
this.f23996f.setFocusable(true);
this.f23996f.setTypeface(Typeface.SANS_SERIF);
this.f23996f.setInputType(129);
this.rl_password.addView(this.f23996f);
this.f23998h = new EditText(this);
LinearLayout.LayoutParams layoutParams2 = new LinearLayout.LayoutParams(-1, -1);
this.f23998h.setPaddingRelative(35, 0, 35, 0);
this.f23998h.setLayoutParams(layoutParams2);
this.f23998h.setHint(getResources().getString(R.string.confirm_password));
this.f23998h.setHintTextColor(getResources().getColor(R.color.white));
this.f23998h.setHintTextColor(-1);
this.f23998h.setTextSize(22.0f);
this.f23998h.setId(101);
this.f23998h.setBackground(getResources().getDrawable(R.drawable.selector_login_fields));
this.f23998h.setFocusable(true);
this.f23998h.setTypeface(Typeface.SANS_SERIF);
this.f23998h.setInputType(129);
this.rl_confirmpassword.addView(this.f23998h);
this.f23999i = new Button(this);
LinearLayout.LayoutParams layoutParams3 = new LinearLayout.LayoutParams(-1, -1);
this.f23999i.setPaddingRelative(35, 0, 35, 0);
this.f23999i.setLayoutParams(layoutParams3);
this.f23999i.setText(getResources().getString(R.string.sign_up));
this.f23999i.setTextColor(DefaultRenderer.BACKGROUND_COLOR);
this.f23999i.setTextSize(22.0f);
this.f23999i.setId(105);
this.f23999i.setBackground(getResources().getDrawable(R.drawable.selector_button));
this.f23999i.setFocusable(true);
this.f23999i.setGravity(17);
this.f23999i.setTypeface(Typeface.SANS_SERIF);
this.rl_bt_submit.addView(this.f23999i);
this.f24000j = new TextView(this);
LinearLayout.LayoutParams layoutParams4 = new LinearLayout.LayoutParams(-1, -1);
this.f24000j.setPaddingRelative(35, 0, 35, 0);
this.f24000j.setLayoutParams(layoutParams4);
this.f24000j.setTextColor(-1);
if (new c.k.a.i.d.a.a(this.y).z().equals(a.s0)) {
this.f24000j.setTextSize(22.0f);
} else {
this.f24000j.setTextSize(15.0f);
}
this.f24000j.setText(getResources().getString(R.string.already_registered_login));
this.f24000j.setId(105);
this.f24000j.setGravity(16);
this.f24000j.setBackground(getResources().getDrawable(R.drawable.selector_checkbox));
this.f24000j.setFocusable(true);
this.rl_already_register.addView(this.f24000j);
if (this.y != null) {
ProgressDialog progressDialog = new ProgressDialog(this.y);
this.B = progressDialog;
progressDialog.setMessage("Please wait while we are creating free trial for you");
this.B.setCanceledOnTouchOutside(false);
this.B.setCancelable(false);
this.B.setProgressStyle(0);
}
this.D = getSharedPreferences("sharedPreference", 0);
this.F = getSharedPreferences("sharedprefremberme", 0);
this.G = getSharedPreferences("loginPrefs", 0);
this.H = getSharedPreferences("selected_language", 0);
SharedPreferences sharedPreferences = getSharedPreferences("loginPrefsserverurl", 0);
this.K = sharedPreferences;
this.L = sharedPreferences.edit();
SharedPreferences sharedPreferences2 = getSharedPreferences("upgradeDatePref", 0);
this.O = sharedPreferences2;
this.N = sharedPreferences2.edit();
this.I = this.F.edit();
this.E = this.D.edit();
this.J = Boolean.valueOf(this.F.getBoolean("savelogin", false));
this.f24000j.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
FreeTrailActivity.this.startActivity(new Intent(FreeTrailActivity.this, LoginActivity.class));
FreeTrailActivity.this.finish();
}
});
b.a(this.f23996f);
this.f23995e.setFilters(new InputFilter[]{f23994d});
this.f23999i.setOnClickListener(new View.OnClickListener() {
public final void a() {
Context context;
Resources resources;
int i2;
FreeTrailActivity freeTrailActivity = FreeTrailActivity.this;
freeTrailActivity.f24001k = freeTrailActivity.f23997g.getText().toString().trim();
FreeTrailActivity freeTrailActivity2 = FreeTrailActivity.this;
freeTrailActivity2.f24002l = freeTrailActivity2.f23995e.getText().toString().trim();
FreeTrailActivity freeTrailActivity3 = FreeTrailActivity.this;
freeTrailActivity3.f24003m = freeTrailActivity3.f23996f.getText().toString().trim();
FreeTrailActivity freeTrailActivity4 = FreeTrailActivity.this;
freeTrailActivity4.f24004n = freeTrailActivity4.f23998h.getText().toString().trim();
if (FreeTrailActivity.this.f24001k.isEmpty()) {
FreeTrailActivity freeTrailActivity5 = FreeTrailActivity.this;
context = freeTrailActivity5.y;
resources = freeTrailActivity5.getResources();
i2 = R.string.please_enter_email;
} else {
FreeTrailActivity freeTrailActivity6 = FreeTrailActivity.this;
if (!freeTrailActivity6.I0(freeTrailActivity6.f24001k)) {
FreeTrailActivity freeTrailActivity7 = FreeTrailActivity.this;
context = freeTrailActivity7.y;
resources = freeTrailActivity7.getResources();
i2 = R.string.wrong_format;
} else if (FreeTrailActivity.this.f24002l.isEmpty()) {
FreeTrailActivity freeTrailActivity8 = FreeTrailActivity.this;
context = freeTrailActivity8.y;
resources = freeTrailActivity8.getResources();
i2 = R.string.please_enter_username;
} else if (FreeTrailActivity.this.f24003m.isEmpty()) {
FreeTrailActivity freeTrailActivity9 = FreeTrailActivity.this;
context = freeTrailActivity9.y;
resources = freeTrailActivity9.getResources();
i2 = R.string.please_enter_password;
} else if (FreeTrailActivity.this.f24004n.equalsIgnoreCase(BuildConfig.FLAVOR)) {
FreeTrailActivity freeTrailActivity10 = FreeTrailActivity.this;
context = freeTrailActivity10.y;
resources = freeTrailActivity10.getResources();
i2 = R.string.please_enter_confirm_password;
} else if (FreeTrailActivity.this.f24003m.equals(FreeTrailActivity.this.f24004n)) {
SharepreferenceDBHandler.h0(BuildConfig.FLAVOR, FreeTrailActivity.this.y);
SharepreferenceDBHandler.i0(BuildConfig.FLAVOR, FreeTrailActivity.this.y);
FreeTrailActivity.this.a();
FreeTrailActivity.this.t0();
return;
} else {
FreeTrailActivity freeTrailActivity11 = FreeTrailActivity.this;
context = freeTrailActivity11.y;
resources = freeTrailActivity11.getResources();
i2 = R.string.password_does_not_matched;
}
}
Toast.makeText(context, resources.getString(i2), 0).show();
}
@Override
public void onClick(View view) {
a();
}
});
}
@Override
public void onResume() {
super.onResume();
e.f(this.y);
}
public void s0() {
this.f24005o = Build.VERSION.RELEASE + " " + Build.VERSION_CODES.class.getFields()[Build.VERSION.SDK_INT].getName();
}
public void t0() {
x.b bVar = new x.b();
TimeUnit timeUnit = TimeUnit.SECONDS;
((ApiService) new m.b().b("https://cms.alldrama.tv/").f(bVar.b(300L, timeUnit).f(300L, timeUnit).d(300L, timeUnit).c(false).a()).a(o.p.a.a.d()).d().d(ApiService.class)).j("OUBQqC6334OcxjS", "61Ce6WTJP12wy1a", "freetrail", "yes", this.f24001k, this.f24002l, this.f24003m, this.C, "com.toptvone.toptviptvbox").x(new d<FreeTrailModelClass>() {
@Override
public void a(o.b<FreeTrailModelClass> bVar2, Throwable th) {
FreeTrailActivity freeTrailActivity = FreeTrailActivity.this;
freeTrailActivity.D(freeTrailActivity.getResources().getString(R.string.could_not_connect));
}
@Override
public void b(o.b<FreeTrailModelClass> bVar2, l<FreeTrailModelClass> lVar) {
FreeTrailActivity freeTrailActivity;
String str;
if (lVar == null || !lVar.d() || lVar.a() == null) {
freeTrailActivity = FreeTrailActivity.this;
str = "No Response from server";
} else if (lVar.a().b() != null && lVar.a().b().equalsIgnoreCase("success")) {
ClientSharepreferenceHandler.h(BuildConfig.FLAVOR, FreeTrailActivity.this.y);
if (a.f17280h.booleanValue()) {
a.f17280h = Boolean.FALSE;
}
SharepreferenceDBHandler.h0(FreeTrailActivity.this.f24002l, FreeTrailActivity.this.y);
SharepreferenceDBHandler.i0(FreeTrailActivity.this.f24003m, FreeTrailActivity.this.y);
Intent intent = new Intent(FreeTrailActivity.this, LoginActivity.class);
intent.setAction("login_perform");
FreeTrailActivity.this.startActivity(intent);
FreeTrailActivity.this.finish();
return;
} else {
freeTrailActivity = FreeTrailActivity.this;
str = lVar.a().a();
}
freeTrailActivity.D(str);
}
});
}
public void u0() {
int nextInt = new Random().nextInt(8378600) + Constants.MAXIMUM_UPLOAD_PARTS;
this.x = nextInt;
c.k.a.e.b.f16971b = String.valueOf(nextInt);
}
}