TopTV v3.0.1版本的 MD5 值为:0fc1b9ce94885bc92edd11a6ee3e5932
以下内容为反编译后的 e.java 源代码,内容仅作参考
package c.k.a.g.n;
import a.i.h.j;
import android.animation.ObjectAnimator;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Dialog;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.drawable.ColorDrawable;
import android.media.AudioAttributes;
import android.net.Uri;
import android.net.wifi.WifiManager;
import android.os.AsyncTask;
import android.os.Build;
import android.os.CountDownTimer;
import android.os.Environment;
import android.os.Handler;
import android.preference.PreferenceManager;
import android.provider.Settings;
import android.util.Base64;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.PopupWindow;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import c.k.a.g.f;
import com.amazonaws.mobileconnectors.cognitoauth.util.ClientConstants;
import com.amazonaws.mobileconnectors.s3.transferutility.TransferService;
import com.amazonaws.services.s3.model.InstructionFileId;
import com.toptvone.toptviptvbox.R;
import com.toptvone.toptviptvbox.model.callback.GetEpisdoeDetailsCallback;
import com.toptvone.toptviptvbox.model.database.EPGSourcesModel;
import com.toptvone.toptviptvbox.model.database.ExternalPlayerDataBase;
import com.toptvone.toptviptvbox.model.database.ImportStatusModel;
import com.toptvone.toptviptvbox.model.database.LiveStreamDBHandler;
import com.toptvone.toptviptvbox.model.database.SharepreferenceDBHandler;
import com.toptvone.toptviptvbox.model.pojo.XMLTVProgrammePojo;
import com.toptvone.toptviptvbox.view.activity.CheckAppupdateActivity;
import com.toptvone.toptviptvbox.view.activity.ExoPlayerMoviesSeriesActivity;
import com.toptvone.toptviptvbox.view.activity.HoneyPlayer;
import com.toptvone.toptviptvbox.view.activity.ImportM3uActivity;
import com.toptvone.toptviptvbox.view.activity.LoginActivity;
import com.toptvone.toptviptvbox.view.activity.MultiUserActivity;
import com.toptvone.toptviptvbox.view.activity.NewDashboardActivity;
import com.toptvone.toptviptvbox.view.activity.NotificationActivity;
import com.toptvone.toptviptvbox.view.activity.PlayExternalPlayerActivity;
import com.toptvone.toptviptvbox.view.activity.RateUsActivity;
import com.toptvone.toptviptvbox.view.activity.RecordingActivity;
import com.toptvone.toptviptvbox.view.activity.RoutingActivity;
import com.toptvone.toptviptvbox.view.activity.VodActivityNewFlowSubCategories;
import com.toptvone.toptviptvbox.view.adapter.RecordingAdapter;
import com.toptvone.toptviptvbox.view.demo.NSTEXOPlayerSkyActivity;
import com.toptvone.toptviptvbox.view.ijkplayer.activities.NSTIJKPlayerEPGActivity;
import com.toptvone.toptviptvbox.view.ijkplayer.activities.NSTIJKPlayerSkyActivity;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.Serializable;
import java.net.HttpURLConnection;
import java.net.NetworkInterface;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.TimeZone;
import java.util.concurrent.TimeUnit;
import k.x;
import me.zhanghai.android.materialprogressbar.BuildConfig;
import o.m;
import org.joda.time.LocalDateTime;
public class e {
public static PopupWindow f17295a = null;
public static SharedPreferences f17296b = null;
public static SharedPreferences f17297c = null;
public static c.k.a.i.d.a.a f17298d = null;
public static AsyncTask f17299e = null;
public static AsyncTask f17300f = null;
public static AsyncTask f17301g = null;
public static AsyncTask f17302h = null;
public static boolean f17303i = false;
public static AsyncTask f17304j;
public static Dialog f17305k;
public SharedPreferences f17306l;
public int f17307m = 0;
public boolean f17308n = false;
public int f17309o = 5;
public int[] p = {1};
public String q = BuildConfig.FLAVOR;
public ArrayList<String> r = new ArrayList<>();
public class a implements View.OnClickListener {
public a() {
}
@Override
public void onClick(View view) {
e.f17295a.dismiss();
}
}
public class b implements View.OnClickListener {
public final Activity f17311b;
public class a implements Runnable {
public a() {
}
@Override
public void run() {
e.f17295a.dismiss();
}
}
public b(Activity activity) {
this.f17311b = activity;
}
@Override
public void onClick(View view) {
e.this.f17306l = PreferenceManager.getDefaultSharedPreferences(this.f17311b);
SharedPreferences.Editor edit = e.this.f17306l.edit();
edit.putBoolean("CANCELLED", true);
edit.apply();
e.this.n0(this.f17311b, "stopped");
Activity activity = this.f17311b;
Toast.makeText(activity, activity.getResources().getString(R.string.download_stopped), 0).show();
new Handler().postDelayed(new a(), 500L);
}
}
public class c implements View.OnClickListener {
public c() {
}
@Override
public void onClick(View view) {
e.f17295a.dismiss();
}
}
public class d implements View.OnClickListener {
public String f17315b = BuildConfig.FLAVOR;
public boolean f17316c = true;
public final Activity f17317d;
public final EditText f17318e;
public final SharedPreferences f17319f;
public class a implements f.j {
public a() {
}
@Override
public void a(String str) {
d.this.f17315b = str;
d.this.f17318e.setText(str);
SharedPreferences.Editor edit = d.this.f17319f.edit();
edit.putString("recordingDir", str);
edit.apply();
Activity activity = d.this.f17317d;
Toast.makeText(activity, "Chosen directory: " + str, 1).show();
}
}
public d(Activity activity, EditText editText, SharedPreferences sharedPreferences) {
this.f17317d = activity;
this.f17318e = editText;
this.f17319f = sharedPreferences;
}
@Override
public void onClick(View view) {
c.k.a.g.f fVar = new c.k.a.g.f(this.f17317d, new a());
fVar.J(this.f17316c);
if (Build.VERSION.SDK_INT >= 30) {
fVar.D(BuildConfig.FLAVOR);
} else {
fVar.C(BuildConfig.FLAVOR);
}
this.f17316c = !this.f17316c;
}
}
public class View$OnClickListenerC0236e implements View.OnClickListener {
public final EditText f17322b;
public final Activity f17323c;
public final String f17324d;
public final EditText f17325e;
public final EditText f17326f;
public class a implements Runnable {
public a() {
}
@Override
public void run() {
e.f17295a.dismiss();
}
}
public View$OnClickListenerC0236e(EditText editText, Activity activity, String str, EditText editText2, EditText editText3) {
this.f17322b = editText;
this.f17323c = activity;
this.f17324d = str;
this.f17325e = editText2;
this.f17326f = editText3;
}
public final boolean a() {
Activity activity;
Resources resources;
int i2;
if (this.f17325e.getText().toString().trim().length() == 0) {
activity = this.f17323c;
resources = activity.getResources();
i2 = R.string.input_filename;
} else if (this.f17322b.getText().toString().trim().length() == 0) {
activity = this.f17323c;
resources = activity.getResources();
i2 = R.string.input_duration;
} else if (this.f17322b.getText().toString().trim().length() == 0) {
return true;
} else {
try {
e.R(this.f17322b.getText().toString());
return true;
} catch (NumberFormatException unused) {
activity = this.f17323c;
resources = activity.getResources();
i2 = R.string.enter_correct_duaration;
}
}
Toast.makeText(activity, resources.getString(i2), 1).show();
return false;
}
@Override
public void onClick(View view) {
int i2;
if (a()) {
try {
i2 = e.R(this.f17322b.getText().toString());
} catch (NumberFormatException unused) {
i2 = 0;
}
new h(this.f17323c, this.f17324d, i2, this.f17325e.getText().toString(), true, this.f17326f.getText().toString());
new Handler().postDelayed(new a(), 500L);
}
}
}
public class f implements View.OnClickListener {
public f() {
}
@Override
public void onClick(View view) {
e.f17295a.dismiss();
}
}
public class g implements View.OnClickListener {
public final File f17330b;
public final RecordingActivity f17331c;
public final ArrayList f17332d;
public final RecordingAdapter f17333e;
public final TextView f17334f;
public class a implements Runnable {
public a() {
}
@Override
public void run() {
e.f17295a.dismiss();
}
}
public g(File file, RecordingActivity recordingActivity, ArrayList arrayList, RecordingAdapter recordingAdapter, TextView textView) {
this.f17330b = file;
this.f17331c = recordingActivity;
this.f17332d = arrayList;
this.f17333e = recordingAdapter;
this.f17334f = textView;
}
@Override
public void onClick(View view) {
if (this.f17330b.exists() && this.f17330b.delete()) {
RecordingActivity recordingActivity = this.f17331c;
Toast.makeText(recordingActivity, recordingActivity.getResources().getString(R.string.recording_deleted), 0).show();
File[] A = e.A(this.f17331c);
if (A != null && A.length > 0) {
this.f17332d.clear();
for (File file : A) {
if (file.toString().endsWith(".ts")) {
this.f17332d.addAll(Arrays.asList(file));
}
}
ArrayList arrayList = this.f17332d;
if (arrayList != null && arrayList.size() > 0) {
this.f17333e.v();
new Handler().postDelayed(new a(), 500L);
}
}
this.f17332d.clear();
this.f17333e.v();
this.f17334f.setVisibility(0);
new Handler().postDelayed(new a(), 500L);
}
}
}
public class h {
public Context f17337a;
public int f17338b;
public int f17339c;
public String f17340d;
public int f17341e;
public String f17342f;
public String f17343g;
public NotificationManager f17345i;
public NotificationManager f17346j;
public Notification f17347k;
public j.e f17348l;
public j.e f17349m;
public boolean r;
public CountDownTimer s;
public CountDownTimer t;
public String f17344h = BuildConfig.FLAVOR;
public int f17350n = 234231;
public boolean f17351o = false;
public boolean p = false;
public boolean q = false;
public final String u = "CANCELLED";
public boolean v = false;
public boolean w = false;
public class a extends CountDownTimer {
public class CountDownTimerC0237a extends CountDownTimer {
public CountDownTimerC0237a(long j2, long j3) {
super(j2, j3);
}
@Override
public void onFinish() {
h.this.t.cancel();
h.this.f17351o = true;
}
@Override
public void onTick(long j2) {
NotificationManager notificationManager;
int i2;
Notification c2;
if (h.this.v) {
h hVar = h.this;
if (!e.this.f17308n) {
Log.e("Debugging:", "cancelled recording");
h.this.f17345i.cancelAll();
h.this.t.cancel();
h.this.C("stopped");
return;
}
hVar.f17338b -= e.this.p[0];
h hVar2 = h.this;
hVar2.f17339c = hVar2.f17338b * 1000;
Log.e("Debugging:", "retrying: " + h.this.f17339c);
h.this.t.cancel();
return;
}
int[] iArr = e.this.p;
int i3 = iArr[0];
iArr[0] = i3 + 1;
if (Build.VERSION.SDK_INT >= 26) {
h hVar3 = h.this;
e.this.f17306l = PreferenceManager.getDefaultSharedPreferences(hVar3.f17337a);
SharedPreferences.Editor edit = e.this.f17306l.edit();
edit.putBoolean("CANCELLED", false);
edit.apply();
h hVar4 = h.this;
NotificationActivity.a(hVar4.f17350n, hVar4.f17337a);
h hVar5 = h.this;
Notification.Builder builder = new Notification.Builder(h.this.f17337a);
StringBuilder sb = new StringBuilder();
sb.append(h.this.f17337a.getResources().getString(R.string.recording_dots));
sb.append(e.this.c0(i3));
sb.append(" - ");
h hVar6 = h.this;
sb.append(e.this.c0(hVar6.f17341e / 1000));
hVar5.f17347k = builder.setContentTitle(sb.toString()).setSmallIcon(R.mipmap.ic_launcher).setChannelId("ksjadf87").setSound((Uri) null, (AudioAttributes) null).build();
h.this.f17345i.createNotificationChannel(new NotificationChannel("ksjadf87", h.this.f17337a.getResources().getString(R.string.recording_dots), 2));
h hVar7 = h.this;
notificationManager = hVar7.f17345i;
i2 = hVar7.f17350n;
c2 = hVar7.f17347k;
} else {
j.e eVar = h.this.f17348l;
StringBuilder sb2 = new StringBuilder();
sb2.append(h.this.f17337a.getResources().getString(R.string.recording_dots));
sb2.append(e.this.c0(i3));
sb2.append(" - ");
h hVar8 = h.this;
sb2.append(e.this.c0(hVar8.f17341e / 1000));
eVar.n(sb2.toString());
h hVar9 = h.this;
notificationManager = hVar9.f17345i;
i2 = hVar9.f17350n;
c2 = hVar9.f17348l.c();
}
notificationManager.notify(i2, c2);
if (h.this.w) {
h.this.f17345i.cancelAll();
h.this.t.cancel();
}
Log.e("Debugging:", "Seconds:" + e.this.c0(i3) + " Reverse Seconds:" + e.this.c0((int) (j2 / 1000)) + " asdf:" + h.this.f17339c + " Timeinseconds:" + h.this.f17338b);
h hVar10 = h.this;
e.this.n0(hVar10.f17337a, "processing");
}
}
public a(long j2, long j3) {
super(j2, j3);
}
@Override
public void onFinish() {
cancel();
h hVar = h.this;
if (e.this.f17308n || !hVar.q) {
return;
}
h.this.C("failed");
}
@Override
public void onTick(long j2) {
Log.e("onTick", "Testing:" + j2);
if (h.this.p) {
Log.e("download started", "Testing:" + j2);
cancel();
h hVar = h.this;
hVar.t = new CountDownTimerC0237a((long) hVar.f17339c, 1000L).start();
}
}
}
@SuppressLint({"StaticFieldLeak"})
public class b extends AsyncTask<Void, Void, Void> {
public File f17354a;
public FileOutputStream f17355b;
public class a implements Runnable {
public a() {
}
@Override
public void run() {
h hVar = h.this;
e.this.f17307m++;
e.j0(hVar.f17337a, "Retrying (" + e.this.f17307m + "/" + e.this.f17309o + ")");
new b(h.this, null).execute(new Void[0]);
}
}
public class RunnableC0238b implements Runnable {
public RunnableC0238b() {
}
@Override
public void run() {
h hVar = h.this;
e.this.f17307m++;
e.j0(hVar.f17337a, "Retrying (" + e.this.f17307m + "/" + e.this.f17309o + ")");
new b(h.this, null).execute(new Void[0]);
}
}
public b() {
this.f17354a = null;
this.f17355b = null;
}
public b(h hVar, c.k.a.g.n.d dVar) {
this();
}
@Override
public Void doInBackground(Void... voidArr) {
File file;
h hVar;
String valueOf;
File file2;
try {
HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(h.this.f17342f).openConnection();
httpURLConnection.setRequestMethod("GET");
httpURLConnection.setUseCaches(false);
httpURLConnection.connect();
if (httpURLConnection.getResponseCode() != 200) {
Log.e("Download Task", "Server returned HTTP " + httpURLConnection.getResponseCode() + " " + httpURLConnection.getResponseMessage());
SharedPreferences.Editor edit = e.this.f17306l.edit();
edit.putBoolean("CANCELLED", true);
edit.apply();
h.this.v = true;
h hVar2 = h.this;
e.this.f17308n = true;
hVar2.p = false;
return null;
}
if (h.this.f17340d == null || h.this.f17340d.equals(BuildConfig.FLAVOR)) {
int i2 = Build.VERSION.SDK_INT;
if (i2 >= 19) {
file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS), "TopTV");
} else {
file = new File(Environment.getExternalStorageDirectory() + "/Documents", "TopTV");
}
if (!file.exists()) {
file.mkdirs();
}
if (i2 >= 19) {
hVar = h.this;
valueOf = String.valueOf(new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS), "TopTV"));
} else {
hVar = h.this;
valueOf = String.valueOf(new File(Environment.getExternalStorageDirectory() + "/Documents", "TopTV"));
}
hVar.f17340d = valueOf;
}
if (h.this.f17344h == null || h.this.f17344h.equals(BuildConfig.FLAVOR)) {
if (!h.this.f17343g.contains(".ts")) {
h hVar3 = h.this;
hVar3.f17343g = h.this.f17343g + ".ts";
}
file2 = new File(String.valueOf(h.this.f17340d + "/" + h.this.f17343g));
if (file2.exists() && !e.this.f17308n) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss", Locale.US);
Date date = new Date();
h hVar4 = h.this;
hVar4.f17344h = simpleDateFormat.format(date) + "_" + h.this.f17343g;
file2 = new File(String.valueOf(h.this.f17340d + "/" + h.this.f17344h));
}
} else {
file2 = new File(String.valueOf(h.this.f17340d + "/" + h.this.f17344h));
}
this.f17355b = new FileOutputStream(file2, true);
BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(this.f17355b);
BufferedInputStream bufferedInputStream = new BufferedInputStream(httpURLConnection.getInputStream());
byte[] bArr = new byte[1024];
long currentTimeMillis = (System.currentTimeMillis() / 1000) + h.this.f17338b;
h.this.p = true;
h.this.v = false;
while (true) {
int read = bufferedInputStream.read(bArr);
if (read != -1 && System.currentTimeMillis() / 1000 < currentTimeMillis && !h.this.f17351o) {
h hVar5 = h.this;
e.this.f17306l = PreferenceManager.getDefaultSharedPreferences(hVar5.f17337a);
h hVar6 = h.this;
hVar6.v = e.this.f17306l.getBoolean("CANCELLED", false);
if (h.this.v) {
h.this.v = true;
e eVar = e.this;
eVar.f17307m = 0;
eVar.f17308n = false;
SharedPreferences.Editor edit2 = eVar.f17306l.edit();
edit2.putBoolean("CANCELLED", true);
edit2.apply();
break;
}
e eVar2 = e.this;
eVar2.f17307m = 0;
eVar2.f17308n = false;
bufferedOutputStream.write(bArr, 0, read);
} else {
break;
}
}
bufferedOutputStream.close();
bufferedInputStream.close();
return null;
} catch (Exception e2) {
SharedPreferences.Editor edit3 = e.this.f17306l.edit();
edit3.putBoolean("CANCELLED", true);
edit3.apply();
h.this.v = true;
h hVar7 = h.this;
e.this.f17308n = true;
hVar7.p = false;
Log.e("Download Task", "Retrying " + e2.getMessage());
return null;
}
}
@Override
public void onPostExecute(Void r8) {
Handler handler;
Runnable runnableC0238b;
h hVar;
String string;
try {
} catch (Exception e2) {
e2.printStackTrace();
h.this.q = true;
h hVar2 = h.this;
hVar2.C(hVar2.f17337a.getResources().getString(R.string.failed));
}
if (this.f17355b == null) {
e eVar = e.this;
if (eVar.f17308n) {
if (eVar.f17307m >= eVar.f17309o) {
h hVar3 = h.this;
e.this.f17308n = false;
hVar3.q = true;
hVar = h.this;
string = hVar.f17337a.getResources().getString(R.string.failed);
hVar.C(string);
} else {
e.this.f17308n = true;
handler = new Handler();
runnableC0238b = new RunnableC0238b();
handler.postDelayed(runnableC0238b, 10000L);
}
}
super.onPostExecute(r8);
}
if (h.this.v) {
e eVar2 = e.this;
if (eVar2.f17308n) {
if (eVar2.f17307m >= eVar2.f17309o) {
e.j0(h.this.f17337a, h.this.f17337a.getResources().getString(R.string.DownloadFailed));
h hVar4 = h.this;
e.this.f17308n = false;
hVar4.q = true;
hVar = h.this;
string = hVar.f17337a.getResources().getString(R.string.failed);
} else {
e.this.f17308n = true;
handler = new Handler();
runnableC0238b = new a();
handler.postDelayed(runnableC0238b, 10000L);
}
}
super.onPostExecute(r8);
}
hVar = h.this;
string = hVar.f17337a.getResources().getString(R.string.completed);
hVar.C(string);
super.onPostExecute(r8);
}
@Override
public void onPreExecute() {
super.onPreExecute();
h.this.B();
h.this.A();
}
}
public h(Activity activity, String str, int i2, String str2, boolean z, String str3) {
this.f17342f = BuildConfig.FLAVOR;
this.f17343g = BuildConfig.FLAVOR;
this.r = true;
this.f17337a = activity;
this.f17342f = str;
int i3 = i2 * 60;
int i4 = i3 * 1000;
this.f17339c = i4;
this.f17341e = i4;
this.f17338b = i3;
this.r = z;
this.f17340d = str3;
this.f17343g = str2;
e.this.f17306l = PreferenceManager.getDefaultSharedPreferences(activity);
new b(this, null).execute(new Void[0]);
}
public void A() {
e.this.f17306l = PreferenceManager.getDefaultSharedPreferences(this.f17337a);
SharedPreferences.Editor edit = e.this.f17306l.edit();
edit.putBoolean("CANCELLED", false);
edit.apply();
PendingIntent a2 = NotificationActivity.a(this.f17350n, this.f17337a);
if (Build.VERSION.SDK_INT >= 26) {
return;
}
this.f17348l.a(R.drawable.stop_icon, "Stop", a2);
}
public void B() {
NotificationManager notificationManager;
int i2;
Notification c2;
NotificationManager notificationManager2 = this.f17345i;
if (notificationManager2 != null) {
notificationManager2.cancelAll();
}
NotificationManager notificationManager3 = this.f17346j;
if (notificationManager3 != null) {
notificationManager3.cancelAll();
}
if (!e.this.f17308n) {
Context context = this.f17337a;
Toast.makeText(context, context.getResources().getString(R.string.download_started), 0).show();
}
this.f17345i = (NotificationManager) this.f17337a.getSystemService(TransferService.INTENT_KEY_NOTIFICATION);
j.e eVar = new j.e(this.f17337a);
this.f17348l = eVar;
if (Build.VERSION.SDK_INT >= 26) {
NotificationChannel notificationChannel = new NotificationChannel("ksjadf87", this.f17337a.getResources().getString(R.string.recording_dots), 2);
this.f17347k = new Notification.Builder(this.f17337a).setContentTitle(this.f17337a.getResources().getString(R.string.live_recording)).setContentText(this.f17337a.getResources().getString(R.string.recording_dots)).setSmallIcon(R.mipmap.ic_launcher).setChannelId("ksjadf87").setProgress(100, 0, true).build();
this.f17345i.createNotificationChannel(notificationChannel);
notificationManager = this.f17345i;
i2 = this.f17350n;
c2 = this.f17347k;
} else {
eVar.o(this.f17337a.getResources().getString(R.string.live_recording)).y(100, 0, true).n(this.f17337a.getResources().getString(R.string.recording_dots)).A(R.mipmap.ic_launcher);
notificationManager = this.f17345i;
i2 = this.f17350n;
c2 = this.f17348l.c();
}
notificationManager.notify(i2, c2);
CountDownTimer countDownTimer = this.s;
if (countDownTimer != null) {
countDownTimer.cancel();
}
this.s = new a(20000L, 1000L).start();
}
public final void C(String str) {
int i2;
this.f17345i.cancelAll();
CountDownTimer countDownTimer = this.t;
if (countDownTimer != null) {
countDownTimer.cancel();
}
this.f17349m = new j.e(this.f17337a).A(R.mipmap.ic_launcher).o(this.f17337a.getResources().getString(R.string.live_recording));
if (str.equals("completed")) {
e.this.n0(this.f17337a, "completed");
this.w = true;
j.e eVar = this.f17349m;
Resources resources = this.f17337a.getResources();
i2 = R.string.download_completed;
eVar.n(resources.getString(R.string.download_completed));
} else if (str.equals("failed")) {
e.this.n0(this.f17337a, "failed");
j.e eVar2 = this.f17349m;
Resources resources2 = this.f17337a.getResources();
i2 = R.string.download_failed;
eVar2.n(resources2.getString(R.string.download_failed));
} else if (str.equals("stopped")) {
e.this.n0(this.f17337a, "stopped");
j.e eVar3 = this.f17349m;
Resources resources3 = this.f17337a.getResources();
i2 = R.string.download_stopped;
eVar3.n(resources3.getString(R.string.download_stopped));
}
NotificationManager notificationManager = (NotificationManager) this.f17337a.getSystemService(TransferService.INTENT_KEY_NOTIFICATION);
this.f17346j = notificationManager;
notificationManager.notify(455, this.f17349m.c());
}
}
public static class i implements View.OnFocusChangeListener {
public View f17359b;
public Activity f17360c;
public i(View view, Activity activity) {
this.f17359b = view;
this.f17360c = activity;
}
public i(View view, CheckAppupdateActivity checkAppupdateActivity) {
this.f17359b = view;
this.f17360c = checkAppupdateActivity;
}
public i(View view, MultiUserActivity multiUserActivity) {
this.f17359b = view;
this.f17360c = multiUserActivity;
}
public i(View view, NewDashboardActivity newDashboardActivity) {
this.f17359b = view;
this.f17360c = newDashboardActivity;
}
public i(View view, RateUsActivity rateUsActivity) {
this.f17359b = view;
this.f17360c = rateUsActivity;
}
public i(View view, RecordingActivity recordingActivity) {
this.f17359b = view;
this.f17360c = recordingActivity;
}
public i(View view, VodActivityNewFlowSubCategories vodActivityNewFlowSubCategories) {
this.f17359b = view;
this.f17360c = vodActivityNewFlowSubCategories;
}
public i(View view, NSTIJKPlayerSkyActivity nSTIJKPlayerSkyActivity) {
this.f17359b = view;
this.f17360c = nSTIJKPlayerSkyActivity;
}
public final void a(float f2) {
ObjectAnimator ofFloat = ObjectAnimator.ofFloat(this.f17359b, "scaleX", f2);
ofFloat.setDuration(150L);
ofFloat.start();
}
public final void b(float f2) {
ObjectAnimator ofFloat = ObjectAnimator.ofFloat(this.f17359b, "scaleY", f2);
ofFloat.setDuration(150L);
ofFloat.start();
}
@Override
@SuppressLint({"ResourceType"})
public void onFocusChange(View view, boolean z) {
int i2;
if (this.f17360c != null) {
if (!z) {
if (z) {
return;
}
a(1.0f);
b(1.0f);
View view2 = this.f17359b;
if (view2 != null && view2.getTag() != null && this.f17359b.getTag().equals("1")) {
view.setBackgroundResource(R.drawable.black_button_dark);
}
View view3 = this.f17359b;
if (view3 != null && view3.getTag() != null && this.f17359b.getTag().equals("2")) {
view.setBackgroundResource(R.drawable.black_button_dark);
}
View view4 = this.f17359b;
if (view4 == null || view4.getTag() == null || !this.f17359b.getTag().equals("3")) {
return;
}
view.setBackgroundResource(R.drawable.black_button_dark);
return;
}
float f2 = z ? 1.12f : 1.0f;
View view5 = this.f17359b;
if (view5 == null || view5.getTag() == null || !this.f17359b.getTag().equals("1")) {
View view6 = this.f17359b;
if (view6 == null || view6.getTag() == null || !this.f17359b.getTag().equals("2")) {
View view7 = this.f17359b;
if (view7 == null || view7.getTag() == null || !this.f17359b.getTag().equals("3")) {
view.setBackground(this.f17360c.getResources().getDrawable(R.drawable.selector_checkbox));
return;
}
a(f2);
b(f2);
i2 = R.drawable.blue_btn_effect;
} else {
a(f2);
b(f2);
i2 = R.drawable.logout_btn_effect;
}
} else {
a(f2);
b(f2);
i2 = R.drawable.back_btn_effect;
}
view.setBackgroundResource(i2);
}
}
}
@SuppressLint({"StaticFieldLeak"})
public static class j extends AsyncTask<Void, Boolean, Boolean> {
public final Context f17361a;
public final LiveStreamDBHandler f17362b;
public ArrayList<XMLTVProgrammePojo> f17363c;
public c.k.a.i.h.c f17364d;
public String f17365e;
@SuppressLint({"StaticFieldLeak"})
public class a extends AsyncTask<String, Integer, Boolean> {
public volatile boolean f17366a = true;
public Context f17367b;
public a(Context context) {
this.f17367b = null;
this.f17367b = context;
}
@Override
public Boolean doInBackground(String... strArr) {
publishProgress(0);
if (j.this.f17362b != null) {
j.this.f17362b.r(j.this.f17363c);
j.this.f17363c.clear();
j.this.f17362b.w2("epg", "1", j.this.f17365e);
}
return Boolean.TRUE;
}
@Override
public void onPostExecute(Boolean bool) {
}
@Override
public void onProgressUpdate(Integer... numArr) {
}
@Override
public void onCancelled() {
this.f17366a = false;
}
@Override
public void onPreExecute() {
}
}
public j(int i2, Context context, LiveStreamDBHandler liveStreamDBHandler) {
this.f17365e = "0";
this.f17365e = String.valueOf(i2);
this.f17361a = context;
this.f17362b = liveStreamDBHandler;
}
@Override
public Boolean doInBackground(Void... voidArr) {
LiveStreamDBHandler liveStreamDBHandler;
if (!this.f17365e.equals("0") && (liveStreamDBHandler = this.f17362b) != null) {
liveStreamDBHandler.i2(this.f17365e);
}
Log.e("honey", "epg u 1");
this.f17364d = new c.k.a.i.h.c();
Log.e("honey", "epg u 2");
this.f17364d.a(this.f17361a);
Log.e("honey", "epg u 3");
this.f17363c = this.f17364d.b();
Log.e("honey", "epg u 4");
ArrayList<XMLTVProgrammePojo> arrayList = this.f17363c;
if (arrayList == null || arrayList.size() <= 0) {
LiveStreamDBHandler liveStreamDBHandler2 = this.f17362b;
if (liveStreamDBHandler2 == null || liveStreamDBHandler2.x1(this.f17365e) == 0) {
return Boolean.FALSE;
}
this.f17362b.w2("epg", "1", this.f17365e);
} else {
Log.e("honey", "size u :" + this.f17363c.size());
}
return Boolean.TRUE;
}
@Override
public void onPostExecute(Boolean bool) {
LiveStreamDBHandler liveStreamDBHandler;
String str;
try {
if (bool.booleanValue()) {
c.k.a.g.n.a.q0 = false;
ArrayList<XMLTVProgrammePojo> arrayList = this.f17363c;
if (arrayList == null || arrayList.size() <= 0) {
return;
}
try {
e.f17304j = new a(this.f17361a).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new String[0]);
return;
} catch (Exception unused) {
liveStreamDBHandler = this.f17362b;
str = "0";
}
} else {
liveStreamDBHandler = this.f17362b;
str = "2";
}
liveStreamDBHandler.w2("epg", str, this.f17365e);
} catch (Exception unused2) {
}
}
@Override
public void onPreExecute() {
}
}
public static File[] A(Context context) {
File file;
if (context != null) {
SharedPreferences sharedPreferences = context.getSharedPreferences("recordingDir", 0);
if (Build.VERSION.SDK_INT >= 19) {
file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS), "TopTV");
} else {
file = new File(Environment.getExternalStorageDirectory() + "/Documents", "TopTV");
}
return new File(sharedPreferences.getString("recordingDir", String.valueOf(file))).listFiles();
}
return null;
}
public static String B(Context context) {
if (context != null) {
try {
return new SimpleDateFormat(context.getSharedPreferences("timeFormat", 0).getString("timeFormat", c.k.a.g.n.a.m0), Locale.US).format(new Date());
} catch (Exception unused) {
return BuildConfig.FLAVOR;
}
}
return BuildConfig.FLAVOR;
}
public static long C(Context context) {
if (context != null) {
try {
SharedPreferences sharedPreferences = context.getSharedPreferences("loginPrefs", 0);
f17296b = sharedPreferences;
if (sharedPreferences != null) {
return v(sharedPreferences.getString("selectedEPGShift", c.k.a.g.n.a.k0));
}
return 0L;
} catch (Exception unused) {
return 0L;
}
}
return 0L;
}
public static String D(Context context, int i2, String str, String str2) {
StringBuilder sb;
char c2 = 0;
SharedPreferences sharedPreferences = context.getSharedPreferences("allowedFormat", 0);
SharedPreferences sharedPreferences2 = context.getSharedPreferences("loginPrefs", 0);
String string = sharedPreferences2.getString("username", BuildConfig.FLAVOR);
String string2 = sharedPreferences2.getString("password", BuildConfig.FLAVOR);
String string3 = sharedPreferences.getString("allowedFormat", BuildConfig.FLAVOR);
String string4 = sharedPreferences2.getString("serverUrl", BuildConfig.FLAVOR);
String string5 = sharedPreferences2.getString("serverProtocol", BuildConfig.FLAVOR);
String string6 = sharedPreferences2.getString("serverPortHttps", BuildConfig.FLAVOR);
String string7 = sharedPreferences2.getString("serverPort", BuildConfig.FLAVOR);
String string8 = sharedPreferences2.getString("serverPortRtmp", BuildConfig.FLAVOR);
if (string3 != null && string3.equals("default")) {
string3 = "ts";
}
if (string5 != null) {
switch (string5.hashCode()) {
case 3213448:
break;
case 3504631:
if (string5.equals("rmtp")) {
c2 = 1;
break;
}
c2 = 65535;
break;
case 99617003:
if (string5.equals(ClientConstants.DOMAIN_SCHEME)) {
c2 = 2;
break;
}
c2 = 65535;
break;
default:
c2 = 65535;
break;
}
switch (c2) {
case 0:
if (string4 != null && !string4.startsWith("http://")) {
string4 = "http://" + string4;
}
sb = new StringBuilder();
sb.append(string4);
sb.append(":");
sb.append(string7);
break;
case 1:
if (string4 != null && !string4.startsWith("rmtp://")) {
string4 = "rmtp://" + string4;
}
sb = new StringBuilder();
sb.append(string4);
sb.append(":");
sb.append(string8);
break;
case 2:
if (string4 != null && !string4.startsWith("https://")) {
string4 = "https://" + string4;
}
sb = new StringBuilder();
sb.append(string4);
sb.append(":");
sb.append(string6);
break;
default:
if (string4 != null && !string4.startsWith("http://") && !string4.startsWith("https://")) {
string4 = "http://" + string4;
}
sb = new StringBuilder();
sb.append(string4);
sb.append(":");
sb.append(string7);
break;
}
sb.append("/timeshift/");
sb.append(string);
sb.append("/");
sb.append(string2);
sb.append("/");
sb.append(str2);
sb.append("/");
sb.append(str);
sb.append("/");
sb.append(i2);
sb.append(InstructionFileId.DOT);
sb.append(string3);
return s(sb.toString());
}
return null;
}
public static String E(Context context, int i2, String str, String str2) {
StringBuilder sb;
String str3;
char c2 = 0;
SharedPreferences sharedPreferences = context.getSharedPreferences("loginPrefs", 0);
String string = sharedPreferences.getString("username", BuildConfig.FLAVOR);
String string2 = sharedPreferences.getString("password", BuildConfig.FLAVOR);
String string3 = sharedPreferences.getString("serverUrl", BuildConfig.FLAVOR);
String string4 = sharedPreferences.getString("serverProtocol", BuildConfig.FLAVOR);
String string5 = sharedPreferences.getString("serverPortHttps", BuildConfig.FLAVOR);
String string6 = sharedPreferences.getString("serverPort", BuildConfig.FLAVOR);
String string7 = sharedPreferences.getString("serverPortRtmp", BuildConfig.FLAVOR);
if (string4 != null) {
switch (string4.hashCode()) {
case 3213448:
break;
case 3504631:
if (string4.equals("rmtp")) {
c2 = 1;
break;
}
c2 = 65535;
break;
case 99617003:
if (string4.equals(ClientConstants.DOMAIN_SCHEME)) {
c2 = 2;
break;
}
c2 = 65535;
break;
default:
c2 = 65535;
break;
}
switch (c2) {
case 0:
if (string3 != null && !string3.startsWith("http://")) {
string3 = "http://" + string3;
}
sb = new StringBuilder();
sb.append(string3);
sb.append(":");
sb.append(string6);
sb.append("/");
sb.append(str2);
sb.append("/");
sb.append(string);
sb.append("/");
sb.append(string2);
sb.append("/");
sb.append(i2);
sb.append(InstructionFileId.DOT);
sb.append(str);
str3 = sb.toString();
break;
case 1:
if (string3 != null && !string3.startsWith("rmtp://")) {
string3 = "rmtp://" + string3;
}
str3 = string3 + ":" + string7 + "/" + str2 + "/" + string + "/" + string2 + "/" + i2 + InstructionFileId.DOT + str;
break;
case 2:
if (string3 != null && !string3.startsWith("https://")) {
string3 = "https://" + string3;
}
sb = new StringBuilder();
sb.append(string3);
sb.append(":");
sb.append(string5);
sb.append("/");
sb.append(str2);
sb.append("/");
sb.append(string);
sb.append("/");
sb.append(string2);
sb.append("/");
sb.append(i2);
sb.append(InstructionFileId.DOT);
sb.append(str);
str3 = sb.toString();
break;
default:
if (string3 != null && !string3.startsWith("http://") && !string3.startsWith("https://")) {
string3 = "http://" + string3;
}
sb = new StringBuilder();
sb.append(string3);
sb.append(":");
sb.append(string6);
sb.append("/");
sb.append(str2);
sb.append("/");
sb.append(string);
sb.append("/");
sb.append(string2);
sb.append("/");
sb.append(i2);
sb.append(InstructionFileId.DOT);
sb.append(str);
str3 = sb.toString();
break;
}
return s(str3);
}
return null;
}
public static String F(Context context, int i2, String str, String str2) {
StringBuilder sb;
String str3;
char c2 = 0;
SharedPreferences sharedPreferences = context.getSharedPreferences("loginPrefs", 0);
String string = sharedPreferences.getString("username", BuildConfig.FLAVOR);
String string2 = sharedPreferences.getString("password", BuildConfig.FLAVOR);
String string3 = sharedPreferences.getString("serverUrl", BuildConfig.FLAVOR);
String string4 = sharedPreferences.getString("serverProtocol", BuildConfig.FLAVOR);
String string5 = sharedPreferences.getString("serverPortHttps", BuildConfig.FLAVOR);
String string6 = sharedPreferences.getString("serverPort", BuildConfig.FLAVOR);
String string7 = sharedPreferences.getString("serverPortRtmp", BuildConfig.FLAVOR);
if (string4 != null) {
switch (string4.hashCode()) {
case 3213448:
break;
case 3504631:
if (string4.equals("rmtp")) {
c2 = 1;
break;
}
c2 = 65535;
break;
case 99617003:
if (string4.equals(ClientConstants.DOMAIN_SCHEME)) {
c2 = 2;
break;
}
c2 = 65535;
break;
default:
c2 = 65535;
break;
}
switch (c2) {
case 0:
if (string3 != null && !string3.startsWith("http://")) {
string3 = "http://" + string3;
}
if (str.equals(BuildConfig.FLAVOR)) {
sb = new StringBuilder();
sb.append(string3);
sb.append(":");
sb.append(string6);
sb.append("/");
sb.append(string);
sb.append("/");
sb.append(string2);
sb.append("/");
sb.append(i2);
sb.append(str);
str3 = sb.toString();
break;
} else {
sb = new StringBuilder();
sb.append(string3);
sb.append(":");
sb.append(string6);
sb.append("/");
sb.append(str2);
sb.append("/");
sb.append(string);
sb.append("/");
sb.append(string2);
sb.append("/");
sb.append(i2);
sb.append(str);
str3 = sb.toString();
}
break;
case 1:
if (string3 != null && !string3.startsWith("rmtp://")) {
string3 = "rmtp://" + string3;
}
if (!str.equals(BuildConfig.FLAVOR)) {
str3 = string3 + ":" + string7 + "/" + str2 + "/" + string + "/" + string2 + "/" + i2 + str;
break;
} else {
str3 = string3 + ":" + string7 + "/" + string + "/" + string2 + "/" + i2 + str;
break;
}
case 2:
if (string3 != null && !string3.startsWith("https://")) {
string3 = "https://" + string3;
}
if (str.equals(BuildConfig.FLAVOR)) {
sb = new StringBuilder();
sb.append(string3);
sb.append(":");
sb.append(string5);
sb.append("/");
sb.append(string);
sb.append("/");
sb.append(string2);
sb.append("/");
sb.append(i2);
sb.append(str);
str3 = sb.toString();
break;
} else {
sb = new StringBuilder();
sb.append(string3);
sb.append(":");
sb.append(string5);
sb.append("/");
sb.append(str2);
sb.append("/");
sb.append(string);
sb.append("/");
sb.append(string2);
sb.append("/");
sb.append(i2);
sb.append(str);
str3 = sb.toString();
}
break;
default:
if (string3 != null && !string3.startsWith("http://") && !string3.startsWith("https://")) {
string3 = "http://" + string3;
}
if (str.equals(BuildConfig.FLAVOR)) {
sb = new StringBuilder();
sb.append(string3);
sb.append(":");
sb.append(string6);
sb.append("/");
sb.append(string);
sb.append("/");
sb.append(string2);
sb.append("/");
sb.append(i2);
sb.append(str);
str3 = sb.toString();
break;
} else {
sb = new StringBuilder();
sb.append(string3);
sb.append(":");
sb.append(string6);
sb.append("/");
sb.append(str2);
sb.append("/");
sb.append(string);
sb.append("/");
sb.append(string2);
sb.append("/");
sb.append(i2);
sb.append(str);
str3 = sb.toString();
}
break;
}
return s(str3);
}
return null;
}
public static String G(Context context) {
StringBuilder sb;
String str;
char c2 = 0;
SharedPreferences sharedPreferences = context.getSharedPreferences("loginPrefs", 0);
sharedPreferences.getString("username", BuildConfig.FLAVOR);
sharedPreferences.getString("password", BuildConfig.FLAVOR);
String string = sharedPreferences.getString("serverUrl", BuildConfig.FLAVOR);
String string2 = sharedPreferences.getString("serverProtocol", BuildConfig.FLAVOR);
String string3 = sharedPreferences.getString("serverPortHttps", BuildConfig.FLAVOR);
String string4 = sharedPreferences.getString("serverPort", BuildConfig.FLAVOR);
String string5 = sharedPreferences.getString("serverPortRtmp", BuildConfig.FLAVOR);
string2.hashCode();
switch (string2.hashCode()) {
case 3213448:
break;
case 3504631:
if (string2.equals("rmtp")) {
c2 = 1;
break;
}
c2 = 65535;
break;
case 99617003:
if (string2.equals(ClientConstants.DOMAIN_SCHEME)) {
c2 = 2;
break;
}
c2 = 65535;
break;
default:
c2 = 65535;
break;
}
switch (c2) {
case 0:
if (!string.startsWith("http://")) {
string = "http://" + string;
}
sb = new StringBuilder();
sb.append(string);
sb.append(":");
sb.append(string4);
sb.append("/");
str = sb.toString();
break;
case 1:
if (!string.startsWith("rmtp://")) {
string = "rmtp://" + string;
}
str = string + ":" + string5 + "/";
break;
case 2:
if (!string.startsWith("https://")) {
string = "https://" + string;
}
sb = new StringBuilder();
sb.append(string);
sb.append(":");
sb.append(string3);
sb.append("/");
str = sb.toString();
break;
default:
if (!string.startsWith("http://") && !string.startsWith("https://")) {
string = "http://" + string;
}
sb = new StringBuilder();
sb.append(string);
sb.append(":");
sb.append(string4);
sb.append("/");
str = sb.toString();
break;
}
return s(str);
}
public static void H() {
try {
Dialog dialog = f17305k;
if (dialog == null || !dialog.isShowing()) {
return;
}
f17305k.dismiss();
} catch (Exception unused) {
}
}
public static void I(Context context) {
LiveStreamDBHandler liveStreamDBHandler = new LiveStreamDBHandler(context);
c.k.a.i.d.a.a aVar = new c.k.a.i.d.a.a(context);
ArrayList<EPGSourcesModel> T0 = liveStreamDBHandler.T0();
String valueOf = (T0 == null || T0.size() <= 0) ? "0" : String.valueOf(T0.get(0).c());
if (valueOf.equals("0")) {
return;
}
ImportStatusModel a2 = liveStreamDBHandler.a2("epg", valueOf);
if (a2.d() == null && a2.e() == null && a2.f() == null) {
a2 = new ImportStatusModel();
a2.l("epg");
a2.j("0");
a2.g(BuildConfig.FLAVOR);
a2.k(BuildConfig.FLAVOR);
a2.i(valueOf);
ArrayList<ImportStatusModel> arrayList = new ArrayList<>();
arrayList.add(0, a2);
liveStreamDBHandler.c2(arrayList, SharepreferenceDBHandler.f(context));
}
if ((a2.d() == null || !a2.d().equals("2")) && (a2.d() == null || !a2.d().equals("0"))) {
if (a2.d() == null || !a2.d().equals("1")) {
if (a2.d() != null) {
a2.d().equals("3");
return;
}
return;
}
long q = q(new SimpleDateFormat("dd/MM/yyyy", Locale.US), a2.a(), h());
if (!g(context) || q < aVar.h()) {
return;
}
}
J(liveStreamDBHandler, valueOf, context);
}
public static void J(LiveStreamDBHandler liveStreamDBHandler, String str, Context context) {
if (c.k.a.g.n.a.q0) {
c.k.a.g.n.a.q0 = false;
}
liveStreamDBHandler.v2("epg", "3");
if (Build.VERSION.SDK_INT >= 11) {
new j(R(str), context, liveStreamDBHandler).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new Void[0]);
} else {
new j(R(str), context, liveStreamDBHandler).execute(new Void[0]);
}
}
public static boolean K(long j2, long j3, Context context) {
if (context != null) {
try {
long millis = LocalDateTime.now().toDateTime().getMillis() + C(context);
if (j2 <= millis && j3 >= millis) {
return true;
}
} catch (Exception unused) {
}
}
return false;
}
public static String L(Context context) {
return String.valueOf(context.getApplicationInfo().loadLabel(context.getPackageManager()));
}
public static void M(Context context) {
if (context != null && c.k.a.g.n.a.f17277e.booleanValue() && SharepreferenceDBHandler.f(context).equals("m3u")) {
context.startActivity(new Intent(context, ImportM3uActivity.class));
}
}
public static void N(Context context) {
if (context != null) {
if (!c.k.a.g.n.a.J.booleanValue()) {
Toast.makeText(context, context.getString(R.string.logged_out), 0).show();
}
c.k.a.g.n.a.J = Boolean.FALSE;
Intent intent = c.k.a.g.n.a.f17276d.booleanValue() ? new Intent(context, MultiUserActivity.class) : (c.k.a.g.n.a.f17277e.booleanValue() && c.k.a.g.n.a.f17278f.booleanValue()) ? new Intent(context, RoutingActivity.class) : new Intent(context, LoginActivity.class);
SharedPreferences sharedPreferences = context.getSharedPreferences("loginPrefs", 0);
SharedPreferences.Editor edit = sharedPreferences.edit();
String string = sharedPreferences.getString("selectedEPGShift", BuildConfig.FLAVOR);
edit.clear();
edit.apply();
edit.putString("selectedEPGShift", string);
edit.apply();
SharedPreferences.Editor edit2 = context.getSharedPreferences("sharedprefremberme", 0).edit();
edit2.clear();
edit2.apply();
if (c.k.a.g.n.a.f17277e.booleanValue() && c.k.a.g.n.a.f17278f.booleanValue()) {
SharedPreferences.Editor edit3 = context.getSharedPreferences("sharedprefremberme", 0).edit();
edit3.putBoolean("savelogin", false);
edit3.apply();
if (SharepreferenceDBHandler.f(context).equalsIgnoreCase("m3u")) {
SharedPreferences.Editor edit4 = context.getSharedPreferences("sharedprefremberme", 0).edit();
edit4.clear();
edit4.apply();
}
}
if (c.k.a.g.n.a.f17275c.booleanValue() && !(c.k.a.g.n.a.f17277e.booleanValue() && c.k.a.g.n.a.f17278f.booleanValue())) {
context.startActivity(intent);
return;
}
context.startActivity(intent);
((Activity) context).finish();
}
}
public static String O(String str) {
try {
MessageDigest messageDigest = MessageDigest.getInstance("MD5");
messageDigest.update(str.getBytes());
byte[] digest = messageDigest.digest();
StringBuilder sb = new StringBuilder();
for (byte b2 : digest) {
String hexString = Integer.toHexString(b2 & 255);
while (hexString.length() < 2) {
hexString = "0" + hexString;
}
sb.append(hexString);
}
return sb.toString();
} catch (NoSuchAlgorithmException e2) {
e2.printStackTrace();
return BuildConfig.FLAVOR;
}
}
public static String P(String str) {
try {
return new SimpleDateFormat("dd/MM/yyyy").format(new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy", Locale.US).parse(str));
} catch (ParseException e2) {
e2.printStackTrace();
return BuildConfig.FLAVOR;
}
}
public static int Q(String str) {
try {
return Integer.parseInt(str);
} catch (NumberFormatException unused) {
return -1;
}
}
public static int R(String str) {
try {
return Integer.parseInt(str);
} catch (NumberFormatException unused) {
return 0;
}
}
public static void S(Context context, int i2, String str, String str2, String str3, String str4, String str5, String str6, String str7) {
f17298d = new c.k.a.i.d.a.a(context);
Intent intent = new Intent(context, NSTIJKPlayerEPGActivity.class);
intent.putExtra("MultiPlayer", "true");
intent.putExtra("OPENED_STREAM_ID", i2);
intent.putExtra("STREAM_TYPE", str);
intent.putExtra("VIDEO_NUM", !str2.equals(BuildConfig.FLAVOR) ? R(str2) : -1);
intent.putExtra("VIDEO_TITLE", str3);
intent.putExtra("EPG_CHANNEL_ID", str4);
intent.putExtra("EPG_CHANNEL_LOGO", str5);
intent.putExtra("OPENED_CAT_ID", str6);
intent.putExtra("VIDEO_URL", str7);
context.startActivity(intent);
}
public static void T(Context context, String str, int i2, String str2, String str3, String str4, String str5, String str6, String str7, String str8) {
Intent intent;
if (context != null) {
try {
String d2 = SharepreferenceDBHandler.d(context);
if (!SharepreferenceDBHandler.d(context).equals("default") && !new ExternalPlayerDataBase(context).d(d2)) {
SharepreferenceDBHandler.N("default", "default", context);
}
f17298d = new c.k.a.i.d.a.a(context);
String e2 = SharepreferenceDBHandler.e(context);
if (!e2.equals("default")) {
String D = D(context, i2, str6, str8);
String d3 = SharepreferenceDBHandler.d(context);
Intent intent2 = new Intent(context, PlayExternalPlayerActivity.class);
intent2.putExtra("url", D);
intent2.putExtra("packagename", e2);
intent2.putExtra("app_name", d3);
context.startActivity(intent2);
return;
}
if (f17298d.w() == 3) {
f17298d.Q(context.getResources().getString(R.string.hardware_decoder));
intent = new Intent(context, HoneyPlayer.class);
} else {
intent = new Intent(context, HoneyPlayer.class);
}
intent.putExtra("OPENED_STREAM_ID", i2);
intent.putExtra("type", "catch_up");
intent.putExtra("VIDEO_NUM", R(str2));
intent.putExtra("VIDEO_TITLE", str3);
intent.putExtra("STREAM_START_TIME", str6);
intent.putExtra("STREAM_STOP_TIME", str8);
context.startActivity(intent);
} catch (Exception unused) {
}
}
}
public static void U(Context context, String str, int i2, String str2, String str3, String str4, String str5, List<GetEpisdoeDetailsCallback> list, String str6) {
String str7;
String str8;
Intent intent;
if (context != null) {
String u = SharepreferenceDBHandler.u(context);
if (!SharepreferenceDBHandler.v(context).equals("default") && !new ExternalPlayerDataBase(context).d(u)) {
SharepreferenceDBHandler.b0("default", "default", context);
}
String v = SharepreferenceDBHandler.v(context);
if (!v.equals("default")) {
String E = SharepreferenceDBHandler.f(context).equals("m3u") ? str6 : E(context, i2, str3, "series");
String u2 = SharepreferenceDBHandler.u(context);
Intent intent2 = new Intent(context, PlayExternalPlayerActivity.class);
intent2.putExtra("url", E);
intent2.putExtra("packagename", v);
intent2.putExtra("app_name", u2);
context.startActivity(intent2);
return;
}
f17298d = new c.k.a.i.d.a.a(context);
String str9 = SharepreferenceDBHandler.f(context).equalsIgnoreCase("m3u") ? "movies_m3u" : "series";
if (f17298d.w() == 3) {
f17298d.Q(context.getResources().getString(R.string.hardware_decoder));
intent = new Intent(context, HoneyPlayer.class);
intent.putExtra("type", str9);
intent.putExtra("OPENED_STREAM_ID", i2);
intent.putExtra("STREAM_TYPE", str2);
intent.putExtra("VIDEO_NUM", R(str4));
intent.putExtra("VIDEO_TITLE", str5);
intent.putExtra("CONTAINER_EXTENSION", str3);
intent.putExtra("EPISODES", (Serializable) list);
str7 = "VIDEO_URL";
str8 = "type";
intent.putExtra(str7, str6);
} else {
str7 = "VIDEO_URL";
str8 = "type";
intent = new Intent(context, HoneyPlayer.class);
}
intent.putExtra(str8, str9);
intent.putExtra("OPENED_STREAM_ID", i2);
intent.putExtra("STREAM_TYPE", str2);
intent.putExtra("VIDEO_NUM", R(str4));
intent.putExtra("VIDEO_TITLE", str5);
intent.putExtra("CONTAINER_EXTENSION", str3);
intent.putExtra("EPISODES", (Serializable) list);
intent.putExtra(str7, str6);
context.startActivity(intent);
}
}
public static void V(Context context, String str, int i2, String str2, String str3, String str4, String str5, String str6, int i3) {
if (context != null) {
String D = SharepreferenceDBHandler.D(context);
if (!SharepreferenceDBHandler.E(context).equals("default") && !new ExternalPlayerDataBase(context).d(D)) {
SharepreferenceDBHandler.j0("default", "default", context);
}
String str7 = SharepreferenceDBHandler.f(context).equalsIgnoreCase("m3u") ? "movies_m3u" : "movies";
String D2 = SharepreferenceDBHandler.D(context);
String E = SharepreferenceDBHandler.E(context);
if (!E.equals("default")) {
if (!SharepreferenceDBHandler.f(context).equalsIgnoreCase("m3u")) {
str6 = E(context, i2, str3, "movie");
}
Intent intent = new Intent(context, PlayExternalPlayerActivity.class);
intent.putExtra("url", str6);
intent.putExtra("packagename", E);
intent.putExtra("app_name", D2);
context.startActivity(intent);
return;
}
c.k.a.i.d.a.a aVar = new c.k.a.i.d.a.a(context);
f17298d = aVar;
Intent intent2 = aVar.w() == 3 ? new Intent(context, ExoPlayerMoviesSeriesActivity.class) : new Intent(context, HoneyPlayer.class);
intent2.putExtra("type", str7);
intent2.putExtra("OPENED_STREAM_ID", i2);
intent2.putExtra("STREAM_TYPE", str2);
intent2.putExtra("STREAM_TOTAL_DURATION", i3);
intent2.putExtra("VIDEO_NUM", R(str4));
intent2.putExtra("VIDEO_TITLE", str5);
intent2.putExtra("CONTAINER_EXTENSION", str3);
intent2.putExtra("VIDEO_URL", str6);
context.startActivity(intent2);
}
}
public static void W(Context context, String str, int i2, String str2, int i3, String str3, String str4, String str5, String str6, String str7, String str8) {
if (context != null) {
f17298d = new c.k.a.i.d.a.a(context);
String l2 = SharepreferenceDBHandler.l(context);
Intent intent = (l2 == null || !l2.equalsIgnoreCase("default")) ? new Intent(context, NSTEXOPlayerSkyActivity.class) : new Intent(context, NSTIJKPlayerSkyActivity.class);
intent.putExtra("OPENED_STREAM_ID", i2);
intent.putExtra("STREAM_TYPE", str2);
intent.putExtra("VIDEO_NUM", i3);
intent.putExtra("VIDEO_TITLE", str3);
intent.putExtra("EPG_CHANNEL_ID", str4);
intent.putExtra("EPG_CHANNEL_LOGO", str5);
intent.putExtra("OPENED_CAT_ID", str6);
intent.putExtra("VIDEO_URL", str7);
intent.putExtra("OPENED_CAT_NAME", str8);
context.startActivity(intent);
}
}
public static void X(Context context, String str, int i2, String str2, String str3, String str4, String str5, String str6, String str7, String str8) {
Intent intent;
if (context != null) {
String g2 = SharepreferenceDBHandler.g(context);
if (!SharepreferenceDBHandler.h(context).equals("default") && !new ExternalPlayerDataBase(context).d(g2)) {
SharepreferenceDBHandler.P("default", "default", context);
}
String h2 = SharepreferenceDBHandler.h(context);
boolean equals = h2.equals("default");
String str9 = BuildConfig.FLAVOR;
if (equals) {
c.k.a.i.d.a.a aVar = new c.k.a.i.d.a.a(context);
f17298d = aVar;
if (aVar.w() == 3) {
f17298d.Q(context.getResources().getString(R.string.hardware_decoder));
intent = new Intent(context, NSTIJKPlayerEPGActivity.class);
} else {
intent = new Intent(context, NSTIJKPlayerEPGActivity.class);
}
intent.putExtra("MultiPlayer", "false");
intent.putExtra("OPENED_STREAM_ID", i2);
intent.putExtra("STREAM_TYPE", str2);
intent.putExtra("VIDEO_NUM", str3.equals(BuildConfig.FLAVOR) ? -1 : R(str3));
intent.putExtra("VIDEO_TITLE", str4);
intent.putExtra("EPG_CHANNEL_ID", str5);
intent.putExtra("EPG_CHANNEL_LOGO", str6);
intent.putExtra("OPENED_CAT_ID", str7);
intent.putExtra("VIDEO_URL", str8);
context.startActivity(intent);
return;
}
String string = context.getSharedPreferences("allowedFormat", 0).getString("allowedFormat", BuildConfig.FLAVOR);
if (string == null || string.isEmpty() || string.equals(BuildConfig.FLAVOR) || !string.equals("default")) {
if (string != null && !string.isEmpty() && !string.equals(BuildConfig.FLAVOR) && string.equals("ts")) {
str9 = ".ts";
} else if (string != null && !string.isEmpty() && !string.equals(BuildConfig.FLAVOR) && string.equals("m3u8")) {
str9 = ".m3u8";
}
}
if (!SharepreferenceDBHandler.f(context).equalsIgnoreCase("m3u")) {
str8 = F(context, i2, str9, "live");
}
String g3 = SharepreferenceDBHandler.g(context);
Intent intent2 = new Intent(context, PlayExternalPlayerActivity.class);
intent2.putExtra("url", str8);
intent2.putExtra("packagename", h2);
intent2.putExtra("app_name", g3);
context.startActivity(intent2);
}
}
public static m Y(Context context) {
if (context != null) {
try {
String lowerCase = context.getSharedPreferences("loginPrefsserverurl", 0).getString(c.k.a.g.n.a.t, BuildConfig.FLAVOR).toLowerCase();
Log.e("URl from Back", ">>>>>>>>" + lowerCase);
if (!lowerCase.startsWith("http://") && !lowerCase.startsWith("https://")) {
lowerCase = "http://" + lowerCase;
}
if (!lowerCase.endsWith("/")) {
lowerCase = lowerCase + "/";
}
c.k.a.g.n.a.H = lowerCase;
x.b bVar = new x.b();
TimeUnit timeUnit = TimeUnit.SECONDS;
return new m.b().b(lowerCase).f(bVar.b(60L, timeUnit).f(60L, timeUnit).d(60L, timeUnit).c(true).a()).a(o.p.a.a.d()).d();
} catch (IllegalArgumentException | NullPointerException | Exception unused) {
}
}
return null;
}
public static m Z(Context context) {
if (context != null) {
try {
x.b bVar = new x.b();
TimeUnit timeUnit = TimeUnit.SECONDS;
return new m.b().b("https://users.iptvsmarters.com/").f(bVar.b(60L, timeUnit).f(60L, timeUnit).d(60L, timeUnit).c(false).a()).a(o.p.a.a.d()).d();
} catch (IllegalArgumentException | NullPointerException | Exception unused) {
}
}
return null;
}
public static void a(Context context) {
context.startActivity(new Intent(context, NewDashboardActivity.class));
}
public static m a0(Context context) {
if (context != null) {
try {
x.b bVar = new x.b();
TimeUnit timeUnit = TimeUnit.SECONDS;
return new m.b().b("http://api.themoviedb.org/3/").f(bVar.b(60L, timeUnit).f(60L, timeUnit).d(60L, timeUnit).c(false).a()).a(o.p.a.a.d()).d();
} catch (IllegalArgumentException | NullPointerException | Exception unused) {
}
}
return null;
}
public static void b0(Context context) {
if (context != null) {
try {
new c.k.a.i.d.a.a(context).z();
} catch (Exception unused) {
}
}
}
public static void d0(Context context, String str) {
String str2 = "en";
if (!str.equals("English")) {
if (str.equals("Polish")) {
str2 = "pl";
} else if (str.equals("Portuguese")) {
str2 = "pt";
} else if (str.equals("Turkish")) {
str2 = "tr";
} else if (str.equals("Croatian")) {
str2 = "hr";
} else if (str.equals("Spanish")) {
str2 = "es";
} else if (str.equals("Arabic")) {
str2 = "ar";
} else if (str.equals("French")) {
str2 = "fr";
} else if (str.equals("German")) {
str2 = "de";
} else if (str.equals("Italian")) {
str2 = "it";
} else if (str.equals("Romanian")) {
str2 = "ro";
} else if (str.equals("Hungary")) {
str2 = "hu";
} else if (str.equals("Albanian")) {
str2 = "sq";
} else if (str.equals("Korean")) {
str2 = "ko";
} else if (str.equals("Hebrew")) {
str2 = "he";
} else if (str.equals("Ukrainian")) {
str2 = "uk";
} else if (str.equals("Malay")) {
str2 = "ms";
} else if (str.equals("Dutch")) {
str2 = "nl";
} else if (str.equals("Indonesian")) {
str2 = "in";
} else if (str.equals("Swedish")) {
str2 = "sv";
}
}
if (context != null) {
Resources resources = context.getResources();
Resources resources2 = context.getApplicationContext().getResources();
Locale locale = new Locale(str2);
Locale.setDefault(locale);
Configuration configuration = new Configuration();
configuration.locale = locale;
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
resources2.updateConfiguration(configuration, resources.getDisplayMetrics());
Configuration configuration2 = resources.getConfiguration();
configuration2.setLocale(locale);
context.getApplicationContext().createConfigurationContext(configuration2);
context.createConfigurationContext(configuration2);
}
}
public static boolean e(String str, Context context) {
if (context != null) {
try {
context.getPackageManager().getPackageInfo(str, 1);
return true;
} catch (PackageManager.NameNotFoundException unused) {
}
}
return false;
}
public static void f(Context context) {
if (context != null) {
String string = context.getSharedPreferences("selected_language", 0).getString("selected_language", BuildConfig.FLAVOR);
if (string.equals(BuildConfig.FLAVOR)) {
return;
}
d0(context, string);
}
}
public static boolean g(Context context) {
return context.getSharedPreferences("automation_epg", 0).getString("automation_epg", BuildConfig.FLAVOR).equals("checked");
}
public static void g0(Activity activity) {
try {
Dialog dialog = new Dialog(activity);
f17305k = dialog;
dialog.setContentView(R.layout.spinkitanimation);
f17305k.getWindow().setBackgroundDrawable(new ColorDrawable(0));
f17305k.getWindow().setGravity(17);
f17305k.setCancelable(false);
f17305k.show();
} catch (Exception unused) {
}
}
public static String h() {
return P(Calendar.getInstance().getTime().toString());
}
public static void h0(Context context) {
Dialog dialog = new Dialog(context);
f17305k = dialog;
dialog.setContentView(R.layout.spinkitanimation);
f17305k.getWindow().setBackgroundDrawable(new ColorDrawable(0));
f17305k.getWindow().setGravity(17);
f17305k.setCancelable(false);
f17305k.show();
}
public static void i(Context context) {
try {
j(context.getCacheDir());
} catch (Exception e2) {
e2.printStackTrace();
}
}
public static boolean j(File file) {
if (file == null || !file.isDirectory()) {
if (file == null || !file.isFile()) {
return false;
}
return file.delete();
}
for (String str : file.list()) {
if (!j(new File(file, str))) {
return false;
}
}
return file.delete();
}
public static void j0(Context context, String str) {
if (context == null || str == BuildConfig.FLAVOR || str.isEmpty()) {
return;
}
Toast.makeText(context, str, 0).show();
}
public static void k(File file) {
try {
if (file.isDirectory()) {
for (File file2 : file.listFiles()) {
k(file2);
}
}
file.delete();
} catch (Exception unused) {
}
}
public static void k0(Context context, String str) {
if (context == null || str == BuildConfig.FLAVOR || str.isEmpty()) {
return;
}
Toast.makeText(context, str, 1).show();
}
public static long l(SimpleDateFormat simpleDateFormat, String str, String str2) {
try {
return TimeUnit.DAYS.convert(simpleDateFormat.parse(str2).getTime() - simpleDateFormat.parse(str).getTime(), TimeUnit.MILLISECONDS);
} catch (Exception e2) {
e2.printStackTrace();
return 0L;
}
}
public static String l0(long j2) {
try {
TimeUnit timeUnit = TimeUnit.DAYS;
int i2 = 0;
List asList = Arrays.asList(Long.valueOf(timeUnit.toMillis(365L)), Long.valueOf(timeUnit.toMillis(30L)), Long.valueOf(timeUnit.toMillis(1L)), Long.valueOf(TimeUnit.HOURS.toMillis(1L)), Long.valueOf(TimeUnit.MINUTES.toMillis(1L)), Long.valueOf(TimeUnit.SECONDS.toMillis(1L)));
List asList2 = Arrays.asList("year", "month", "day", "hour", "min", "sec");
StringBuffer stringBuffer = new StringBuffer();
while (true) {
if (i2 >= asList.size()) {
break;
}
long longValue = j2 / ((Long) asList.get(i2)).longValue();
if (longValue > 0) {
stringBuffer.append(longValue);
stringBuffer.append(" ");
stringBuffer.append((String) asList2.get(i2));
stringBuffer.append(longValue != 1 ? "s" : BuildConfig.FLAVOR);
stringBuffer.append(" ago");
} else {
i2++;
}
}
return BuildConfig.FLAVOR.equals(stringBuffer.toString()) ? "0 sec ago" : stringBuffer.toString();
} catch (Exception unused) {
return "0 sec ago";
}
}
public static long m(String str, Context context) {
if (str == null) {
return 0L;
}
try {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss", Locale.US);
simpleDateFormat.setTimeZone(TimeZone.getTimeZone(new c.k.a.i.d.a.a(context).B()));
return simpleDateFormat.parse(str.substring(0, 14)).getTime();
} catch (NumberFormatException e2) {
Log.e("XMLTVReader", "Exception", e2);
return 0L;
} catch (Exception e3) {
Log.e("XMLTVReader", "Exception", e3);
return 0L;
}
}
public static String m0(String str) {
return Build.VERSION.SDK_INT >= 19 ? new String(Base64.decode(str, 0), StandardCharsets.UTF_8) : BuildConfig.FLAVOR;
}
public static void n(Context context) {
String m0 = m0(c.k.a.i.d.c.a.a.a());
String packageName = context.getApplicationContext().getPackageName();
String L = L(context);
String m02 = m0(c.k.a.i.d.c.a.e.d());
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss", Locale.US);
if (l(simpleDateFormat, simpleDateFormat.format(new Date(c.k.a.i.d.c.a.f.a(context))), simpleDateFormat.format(new Date())) < c.k.a.i.d.c.a.d.p() || m0 == null || m02 == null) {
return;
}
if (L.equals(m0) && packageName.equals(m02)) {
return;
}
String m03 = m0(c.k.a.i.d.c.a.h.a() + c.k.a.i.d.c.a.h.i());
String m04 = m0(c.k.a.i.d.c.a.i.i() + c.k.a.i.d.c.a.i.h());
String m05 = m0(c.k.a.i.d.c.a.g.f() + c.k.a.i.d.c.a.g.h());
Toast.makeText(context, m03 + m04 + m05, 1).show();
((Activity) context).finishAffinity();
}
public static m o(Context context) {
x.b bVar = new x.b();
TimeUnit timeUnit = TimeUnit.SECONDS;
return new m.b().b("http://51.158.145.183/").f(bVar.b(60L, timeUnit).f(60L, timeUnit).d(60L, timeUnit).c(false).a()).a(o.p.a.a.d()).d();
}
public static String p(String str) {
try {
return new SimpleDateFormat(" MMMM dd,yyyy").format(new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy", Locale.US).parse(str));
} catch (Exception e2) {
e2.printStackTrace();
return BuildConfig.FLAVOR;
}
}
public static long q(SimpleDateFormat simpleDateFormat, String str, String str2) {
try {
return TimeUnit.DAYS.convert(simpleDateFormat.parse(str2).getTime() - simpleDateFormat.parse(str).getTime(), TimeUnit.MILLISECONDS);
} catch (Exception e2) {
e2.printStackTrace();
return 0L;
}
}
public static String r() {
return Build.MANUFACTURER + " " + Build.PRODUCT;
}
public static String s(String str) {
return str.replaceAll(" ", "%20");
}
public static int t(String str) {
str.hashCode();
char c2 = 65535;
switch (str.hashCode()) {
case 3121:
if (str.equals("ar")) {
c2 = 0;
break;
}
break;
case 3201:
if (str.equals("de")) {
c2 = 1;
break;
}
break;
case 3241:
if (str.equals("en")) {
c2 = 2;
break;
}
break;
case 3246:
if (str.equals("es")) {
c2 = 3;
break;
}
break;
case 3276:
if (str.equals("fr")) {
c2 = 4;
break;
}
break;
case 3325:
if (str.equals("he")) {
c2 = 5;
break;
}
break;
case 3338:
if (str.equals("hr")) {
c2 = 6;
break;
}
break;
case 3341:
if (str.equals("hu")) {
c2 = 7;
break;
}
break;
case 3365:
if (str.equals("in")) {
c2 = '\b';
break;
}
break;
case 3371:
if (str.equals("it")) {
c2 = '\t';
break;
}
break;
case 3428:
if (str.equals("ko")) {
c2 = '\n';
break;
}
break;
case 3494:
if (str.equals("ms")) {
c2 = 11;
break;
}
break;
case 3518:
if (str.equals("nl")) {
c2 = '\f';
break;
}
break;
case 3580:
if (str.equals("pl")) {
c2 = '\r';
break;
}
break;
case 3588:
if (str.equals("pt")) {
c2 = 14;
break;
}
break;
case 3645:
if (str.equals("ro")) {
c2 = 15;
break;
}
break;
case 3678:
if (str.equals("sq")) {
c2 = 16;
break;
}
break;
case 3683:
if (str.equals("sv")) {
c2 = 17;
break;
}
break;
case 3710:
if (str.equals("tr")) {
c2 = 18;
break;
}
break;
case 3734:
if (str.equals("uk")) {
c2 = 19;
break;
}
break;
}
switch (c2) {
case 0:
return 6;
case 1:
return 8;
case 2:
default:
return 0;
case 3:
return 5;
case 4:
return 7;
case 5:
return 14;
case 6:
return 4;
case 7:
return 11;
case '\b':
return 18;
case '\t':
return 9;
case '\n':
return 13;
case 11:
return 16;
case '\f':
return 17;
case '\r':
return 1;
case 14:
return 2;
case 15:
return 10;
case 16:
return 12;
case 17:
return 19;
case 18:
return 3;
case 19:
return 15;
}
}
@SuppressLint({"HardwareIds"})
public static String u(Context context) {
String string;
try {
string = Settings.Secure.getString(context.getContentResolver(), "android_id");
} catch (Exception unused) {
}
if (string == null || string.equals(BuildConfig.FLAVOR)) {
for (NetworkInterface networkInterface : Collections.list(NetworkInterface.getNetworkInterfaces())) {
if (networkInterface.getName().equalsIgnoreCase("wlan0")) {
byte[] hardwareAddress = networkInterface.getHardwareAddress();
if (hardwareAddress == null) {
try {
return ((WifiManager) context.getApplicationContext().getSystemService("wifi")).getConnectionInfo().getMacAddress();
} catch (Exception unused2) {
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;
}
return string;
}
public static int v(String str) {
int i2;
int i3 = 0;
if (str != null) {
try {
if (str.isEmpty()) {
return 0;
}
if (str.contains("+")) {
i2 = R(str.split("\\+")[1]);
} else if (!str.contains("-")) {
return 0;
} else {
i2 = -R(str.split("\\-")[1]);
}
i3 = i2 * 60 * 60 * 1000;
return i3;
} catch (Exception unused) {
return i3;
}
}
return 0;
}
public static String w(String str, Context context) {
try {
String string = context.getSharedPreferences("timeFormat", 0).getString("timeFormat", c.k.a.g.n.a.m0);
c.k.a.i.d.a.a aVar = new c.k.a.i.d.a.a(context);
Locale locale = Locale.US;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", locale);
SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat(string, locale);
simpleDateFormat.setTimeZone(TimeZone.getTimeZone(aVar.B()));
String format = simpleDateFormat2.format(new Date(Long.parseLong(String.valueOf(Long.valueOf(simpleDateFormat.parse(str).getTime())))));
Log.e("TimeZone", TimeZone.getDefault().getID());
return format;
} catch (Exception unused) {
return "00-00-0000 00:00";
}
}
public static int x(Context context) {
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
return (int) ((displayMetrics.widthPixels / displayMetrics.density) / 180.0f);
}
public static int y(long j2, long j3, Context context) {
if (context != null) {
try {
long millis = LocalDateTime.now().toDateTime().getMillis() + C(context);
if (j2 < j3 && millis < j3) {
if (millis <= j2) {
return 100;
}
return (int) (((j3 - millis) * 100) / (j3 - j2));
}
} catch (Exception unused) {
}
}
return 0;
}
public static int z(String str) {
str.hashCode();
char c2 = 65535;
switch (str.hashCode()) {
case 48:
if (str.equals("0")) {
c2 = 0;
break;
}
break;
case 1382:
if (str.equals("+1")) {
c2 = 1;
break;
}
break;
case 1383:
if (str.equals("+2")) {
c2 = 2;
break;
}
break;
case 1384:
if (str.equals("+3")) {
c2 = 3;
break;
}
break;
case 1385:
if (str.equals("+4")) {
c2 = 4;
break;
}
break;
case 1386:
if (str.equals("+5")) {
c2 = 5;
break;
}
break;
case 1387:
if (str.equals("+6")) {
c2 = 6;
break;
}
break;
case 1388:
if (str.equals("+7")) {
c2 = 7;
break;
}
break;
case 1389:
if (str.equals("+8")) {
c2 = '\b';
break;
}
break;
case 1390:
if (str.equals("+9")) {
c2 = '\t';
break;
}
break;
case 1444:
if (str.equals("-1")) {
c2 = '\n';
break;
}
break;
case 1445:
if (str.equals("-2")) {
c2 = 11;
break;
}
break;
case 1446:
if (str.equals("-3")) {
c2 = '\f';
break;
}
break;
case 1447:
if (str.equals("-4")) {
c2 = '\r';
break;
}
break;
case 1448:
if (str.equals("-5")) {
c2 = 14;
break;
}
break;
case 1449:
if (str.equals("-6")) {
c2 = 15;
break;
}
break;
case 1450:
if (str.equals("-7")) {
c2 = 16;
break;
}
break;
case 1451:
if (str.equals("-8")) {
c2 = 17;
break;
}
break;
case 1452:
if (str.equals("-9")) {
c2 = 18;
break;
}
break;
case 42890:
if (str.equals("+10")) {
c2 = 19;
break;
}
break;
case 42891:
if (str.equals("+11")) {
c2 = 20;
break;
}
break;
case 42892:
if (str.equals("+12")) {
c2 = 21;
break;
}
break;
case 44812:
if (str.equals("-10")) {
c2 = 22;
break;
}
break;
case 44813:
if (str.equals("-11")) {
c2 = 23;
break;
}
break;
case 44814:
if (str.equals("-12")) {
c2 = 24;
break;
}
break;
}
switch (c2) {
case 0:
default:
return 12;
case 1:
return 13;
case 2:
return 14;
case 3:
return 15;
case 4:
return 16;
case 5:
return 17;
case 6:
return 18;
case 7:
return 19;
case '\b':
return 20;
case '\t':
return 21;
case '\n':
return 11;
case 11:
return 10;
case '\f':
return 9;
case '\r':
return 8;
case 14:
return 7;
case 15:
return 6;
case 16:
return 5;
case 17:
return 4;
case 18:
return 3;
case 19:
return 22;
case 20:
return 23;
case 21:
return 24;
case 22:
return 2;
case 23:
return 1;
case 24:
return 0;
}
}
@SuppressLint({"DefaultLocale"})
public String c0(int i2) {
return String.format("%02d:%02d:%02d", Integer.valueOf(i2 / 3600), Integer.valueOf((i2 % 3600) / 60), Integer.valueOf(i2 % 60));
}
public void e0(RecordingActivity recordingActivity, File file, RecordingAdapter recordingAdapter, ArrayList<File> arrayList, TextView textView) {
if (recordingActivity != null) {
RelativeLayout relativeLayout = (RelativeLayout) recordingActivity.findViewById(R.id.rl_password_verification);
LayoutInflater layoutInflater = (LayoutInflater) recordingActivity.getSystemService("layout_inflater");
c.k.a.i.d.a.a aVar = new c.k.a.i.d.a.a(recordingActivity);
f17298d = aVar;
View inflate = layoutInflater.inflate(aVar.z().equals(c.k.a.g.n.a.s0) ? R.layout.delete_recording_popup_tv : R.layout.delete_recording_popup, relativeLayout);
PopupWindow popupWindow = new PopupWindow(recordingActivity);
f17295a = popupWindow;
popupWindow.setContentView(inflate);
f17295a.setWidth(-1);
f17295a.setHeight(-1);
f17295a.setFocusable(true);
f17295a.showAtLocation(inflate, 17, 0, 0);
Button button = (Button) inflate.findViewById(R.id.bt_start_recording);
Button button2 = (Button) inflate.findViewById(R.id.bt_close);
if (button != null) {
button.setOnFocusChangeListener(new i((View) button, recordingActivity));
button.requestFocus();
button.requestFocusFromTouch();
}
if (button2 != null) {
button2.setOnFocusChangeListener(new i((View) button2, recordingActivity));
}
button2.setOnClickListener(new f());
if (button != null) {
button.setOnClickListener(new g(file, recordingActivity, arrayList, recordingAdapter, textView));
}
}
}
public void f0(Activity activity) {
if (activity != null) {
RelativeLayout relativeLayout = (RelativeLayout) activity.findViewById(R.id.rl_password_verification);
LayoutInflater layoutInflater = (LayoutInflater) activity.getSystemService("layout_inflater");
c.k.a.i.d.a.a aVar = new c.k.a.i.d.a.a(activity);
f17298d = aVar;
View inflate = layoutInflater.inflate(aVar.z().equals(c.k.a.g.n.a.s0) ? R.layout.download_running_popup_tv : R.layout.download_running_popup, relativeLayout);
PopupWindow popupWindow = new PopupWindow(activity);
f17295a = popupWindow;
popupWindow.setContentView(inflate);
f17295a.setWidth(-1);
f17295a.setHeight(-1);
f17295a.setFocusable(true);
f17295a.showAtLocation(inflate, 17, 0, 0);
Button button = (Button) inflate.findViewById(R.id.bt_start_recording);
Button button2 = (Button) inflate.findViewById(R.id.bt_close);
if (button != null) {
button.setOnFocusChangeListener(new i(button, activity));
}
if (button2 != null) {
button2.setOnFocusChangeListener(new i(button2, activity));
}
button2.setOnClickListener(new a());
if (button != null) {
button.setOnClickListener(new b(activity));
}
}
}
public void i0(Activity activity, String str, String str2, String str3, int i2, String str4) {
String str5;
String str6;
File file;
View view;
File file2;
EditText editText;
if (activity != null) {
RelativeLayout relativeLayout = (RelativeLayout) activity.findViewById(R.id.rl_password_verification);
LayoutInflater layoutInflater = (LayoutInflater) activity.getSystemService("layout_inflater");
c.k.a.i.d.a.a aVar = new c.k.a.i.d.a.a(activity);
f17298d = aVar;
View inflate = layoutInflater.inflate(aVar.z().equals(c.k.a.g.n.a.s0) ? R.layout.recording_popup_tv : R.layout.recording_popup, relativeLayout);
PopupWindow popupWindow = new PopupWindow(activity);
f17295a = popupWindow;
popupWindow.setContentView(inflate);
f17295a.setWidth(-1);
f17295a.setHeight(-1);
f17295a.setFocusable(true);
Button button = (Button) inflate.findViewById(R.id.bt_start_recording);
Button button2 = (Button) inflate.findViewById(R.id.bt_close);
EditText editText2 = (EditText) inflate.findViewById(R.id.et_file_name);
EditText editText3 = (EditText) inflate.findViewById(R.id.et_duration);
Button button3 = (Button) inflate.findViewById(R.id.bt_browse);
EditText editText4 = (EditText) inflate.findViewById(R.id.et_browse);
if (button != null) {
button.setOnFocusChangeListener(new i(button, activity));
}
if (button2 != null) {
button2.setOnFocusChangeListener(new i(button2, activity));
}
if (button3 != null) {
button3.setOnFocusChangeListener(new i(button3, activity));
}
String str7 = str + ".ts";
if (SharepreferenceDBHandler.f(activity).equals("m3u")) {
str6 = str4;
} else {
if (str2.equals(BuildConfig.FLAVOR)) {
str5 = str3 + i2;
} else {
str5 = str3 + i2 + ".ts";
}
str6 = str5;
}
editText2.setText(str7);
editText2.requestFocus();
editText4.setEnabled(false);
int i3 = Build.VERSION.SDK_INT;
if (i3 >= 19) {
file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS), "TopTV");
view = inflate;
} else {
StringBuilder sb = new StringBuilder();
view = inflate;
sb.append(Environment.getExternalStorageDirectory());
sb.append("/");
sb.append("Documents");
file = new File(sb.toString(), "TopTV");
}
if (!file.exists()) {
file.mkdirs();
}
SharedPreferences sharedPreferences = activity.getSharedPreferences("recordingDir", 0);
if (i3 >= 19) {
file2 = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS), "TopTV");
editText = editText2;
} else {
StringBuilder sb2 = new StringBuilder();
editText = editText2;
sb2.append(Environment.getExternalStorageDirectory());
sb2.append("/");
sb2.append("Documents");
file2 = new File(sb2.toString(), "TopTV");
}
editText4.setText(sharedPreferences.getString("recordingDir", String.valueOf(file2)));
button2.setOnClickListener(new c());
button3.setOnClickListener(new d(activity, editText4, sharedPreferences));
if (button != null) {
button.setOnClickListener(new View$OnClickListenerC0236e(editText3, activity, str6, editText, editText4));
}
f17295a.showAtLocation(view, 17, 0, 0);
}
}
public void n0(Context context, String str) {
if (context != null) {
SharedPreferences sharedPreferences = context.getSharedPreferences("downloadStatus", 0);
f17297c = sharedPreferences;
SharedPreferences.Editor edit = sharedPreferences.edit();
edit.putString("downloadStatus", str);
edit.apply();
}
}
}