CCIPTV PRO v3.0.9.1版本的 MD5 值为:e78d4d980447be4a9f823314f45bbf03

以下内容为反编译后的 e.java 源代码,内容仅作参考


package f.j.a.h.i;

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 boxbr.apksrebrand.smarters.model.callback.GetEpisdoeDetailsCallback;
import boxbr.apksrebrand.smarters.model.pojo.XMLTVProgrammePojo;
import boxbr.apksrebrand.smarters.view.activity.CheckAppupdateActivity;
import boxbr.apksrebrand.smarters.view.activity.HoneyPlayer;
import boxbr.apksrebrand.smarters.view.activity.ImportM3uActivity;
import boxbr.apksrebrand.smarters.view.activity.LoginActivity;
import boxbr.apksrebrand.smarters.view.activity.MultiUserActivity;
import boxbr.apksrebrand.smarters.view.activity.NewDashboardActivity;
import boxbr.apksrebrand.smarters.view.activity.NotificationActivity;
import boxbr.apksrebrand.smarters.view.activity.PlayExternalPlayerActivity;
import boxbr.apksrebrand.smarters.view.activity.RateUsActivity;
import boxbr.apksrebrand.smarters.view.activity.RecordingActivity;
import boxbr.apksrebrand.smarters.view.activity.RoutingActivity;
import boxbr.apksrebrand.smarters.view.activity.SplashActivity;
import boxbr.apksrebrand.smarters.view.adapter.RecordingAdapter;
import boxbr.apksrebrand.smarters.view.ijkplayer.activities.NSTIJKPlayerEPGActivity;
import boxbr.apksrebrand.smarters.view.ijkplayer.activities.NSTIJKPlayerSkyActivity;
import com.iptvsmarters.cciptv.R;
import d.h.h.h;
import f.d.s;
import f.j.a.f.g;
import f.j.a.h.c;
import f.j.a.i.p.l;
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 m.x;
import org.joda.time.DateTimeConstants;
import org.joda.time.LocalDateTime;
import org.joda.time.chrono.BasicChronology;
import q.m;
import tv.danmaku.ijk.media.player.IjkMediaMeta;
import tv.danmaku.ijk.media.player.IjkMediaPlayer;
public class e {
    public static PopupWindow f10111f;
    public static SharedPreferences f10112g;
    public static SharedPreferences f10113h;
    public static f.j.a.k.d.a.a f10114i;
    public static AsyncTask f10115j;
    public static AsyncTask f10116k;
    public static AsyncTask f10117l;
    public static AsyncTask f10118m;
    public static boolean f10119n;
    public static AsyncTask f10120o;
    public static Dialog f10121p;
    public SharedPreferences a;
    public int b = 0;
    public boolean c = false;
    public int f10122d = 5;
    public int[] f10123e = {1};

    public class a implements View.OnClickListener {
        public a(e eVar) {
        }

        @Override
        public void onClick(View view) {
            e.f10111f.dismiss();
        }
    }

    public class b implements View.OnClickListener {
        public final Activity b;

        public class a implements Runnable {
            public a(b bVar) {
            }

            @Override
            public void run() {
                e.f10111f.dismiss();
            }
        }

        public b(Activity activity) {
            this.b = activity;
        }

        @Override
        public void onClick(View view) {
            e.this.a = PreferenceManager.getDefaultSharedPreferences(this.b);
            SharedPreferences.Editor edit = e.this.a.edit();
            edit.putBoolean("CANCELLED", true);
            edit.apply();
            e.this.n0(this.b, "stopped");
            Activity activity = this.b;
            Toast.makeText(activity, activity.getResources().getString(R.string.download_stopped), 0).show();
            new Handler().postDelayed(new a(this), 500L);
        }
    }

    public class c implements View.OnClickListener {
        public c(e eVar) {
        }

        @Override
        public void onClick(View view) {
            e.f10111f.dismiss();
        }
    }

    public class d implements View.OnClickListener {
        public String b;
        public boolean c = true;
        public final Activity f10124d;
        public final EditText f10125e;
        public final SharedPreferences f10126f;

        public class a implements c.j {
            public a() {
            }

            @Override
            public void a(String str) {
                d.this.b = str;
                d.this.f10125e.setText(str);
                SharedPreferences.Editor edit = d.this.f10126f.edit();
                edit.putString("recordingDir", str);
                edit.apply();
                Activity activity = d.this.f10124d;
                Toast.makeText(activity, "Chosen directory: " + str, 1).show();
            }
        }

        public d(e eVar, Activity activity, EditText editText, SharedPreferences sharedPreferences) {
            this.f10124d = activity;
            this.f10125e = editText;
            this.f10126f = sharedPreferences;
        }

        @Override
        public void onClick(View view) {
            f.j.a.h.c cVar = new f.j.a.h.c(this.f10124d, new a());
            cVar.K(this.c);
            if (Build.VERSION.SDK_INT >= 30) {
                cVar.E("");
            } else {
                cVar.D("");
            }
            this.c = !this.c;
        }
    }

    public class View$OnClickListenerC0274e implements View.OnClickListener {
        public final EditText b;
        public final Activity c;
        public final String f10127d;
        public final EditText f10128e;
        public final EditText f10129f;

        public class a implements Runnable {
            public a(View$OnClickListenerC0274e view$OnClickListenerC0274e) {
            }

            @Override
            public void run() {
                e.f10111f.dismiss();
            }
        }

        public View$OnClickListenerC0274e(EditText editText, Activity activity, String str, EditText editText2, EditText editText3) {
            this.b = editText;
            this.c = activity;
            this.f10127d = str;
            this.f10128e = editText2;
            this.f10129f = editText3;
        }

        public final boolean a() {
            Activity activity;
            Resources resources;
            int i2;
            if (this.f10128e.getText().toString().trim().length() == 0) {
                activity = this.c;
                resources = activity.getResources();
                i2 = R.string.input_filename;
            } else if (this.b.getText().toString().trim().length() == 0) {
                activity = this.c;
                resources = activity.getResources();
                i2 = R.string.input_duration;
            } else if (this.b.getText().toString().trim().length() == 0) {
                return true;
            } else {
                try {
                    e.R(this.b.getText().toString());
                    return true;
                } catch (NumberFormatException unused) {
                    activity = this.c;
                    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.b.getText().toString());
                } catch (NumberFormatException unused) {
                    i2 = 0;
                }
                new h(this.c, this.f10127d, i2, this.f10128e.getText().toString(), true, this.f10129f.getText().toString());
                new Handler().postDelayed(new a(this), 500L);
            }
        }
    }

    public class f implements View.OnClickListener {
        public f(e eVar) {
        }

        @Override
        public void onClick(View view) {
            e.f10111f.dismiss();
        }
    }

    public class g implements View.OnClickListener {
        public final File b;
        public final RecordingActivity c;
        public final ArrayList f10131d;
        public final RecordingAdapter f10132e;
        public final TextView f10133f;

        public class a implements Runnable {
            public a(g gVar) {
            }

            @Override
            public void run() {
                e.f10111f.dismiss();
            }
        }

        public g(e eVar, File file, RecordingActivity recordingActivity, ArrayList arrayList, RecordingAdapter recordingAdapter, TextView textView) {
            this.b = file;
            this.c = recordingActivity;
            this.f10131d = arrayList;
            this.f10132e = recordingAdapter;
            this.f10133f = textView;
        }

        @Override
        public void onClick(View view) {
            if (this.b.exists() && this.b.delete()) {
                RecordingActivity recordingActivity = this.c;
                Toast.makeText(recordingActivity, recordingActivity.getResources().getString(R.string.recording_deleted), 0).show();
                File[] A = e.A(this.c);
                if (A != null && A.length > 0) {
                    this.f10131d.clear();
                    for (File file : A) {
                        if (file.toString().endsWith(".ts")) {
                            this.f10131d.addAll(Arrays.asList(file));
                        }
                    }
                    ArrayList arrayList = this.f10131d;
                    if (arrayList != null && arrayList.size() > 0) {
                        this.f10132e.t();
                        new Handler().postDelayed(new a(this), 500L);
                    }
                }
                this.f10131d.clear();
                this.f10132e.t();
                this.f10133f.setVisibility(0);
                new Handler().postDelayed(new a(this), 500L);
            }
        }
    }

    public class h {
        public Context a;
        public int b;
        public int c;
        public String f10134d;
        public int f10135e;
        public String f10136f;
        public String f10137g;
        public NotificationManager f10139i;
        public NotificationManager f10140j;
        public Notification f10141k;
        public h.d f10142l;
        public h.d f10143m;
        public CountDownTimer r;
        public CountDownTimer s;
        public String f10138h = "";
        public int f10144n = 234231;
        public boolean f10145o = false;
        public boolean f10146p = false;
        public boolean f10147q = false;
        public boolean t = false;
        public boolean u = false;

        public class a extends CountDownTimer {

            public class CountDownTimerC0275a extends CountDownTimer {
                public CountDownTimerC0275a(long j2, long j3) {
                    super(j2, j3);
                }

                @Override
                public void onFinish() {
                    h.this.s.cancel();
                    h.this.f10145o = true;
                }

                @Override
                public void onTick(long j2) {
                    NotificationManager notificationManager;
                    int i2;
                    Notification c;
                    if (h.this.t) {
                        h hVar = h.this;
                        if (!e.this.c) {
                            Log.e("Debugging:", "cancelled recording");
                            h.this.f10139i.cancelAll();
                            h.this.s.cancel();
                            h.this.C("stopped");
                            return;
                        }
                        hVar.b -= e.this.f10123e[0];
                        h hVar2 = h.this;
                        hVar2.c = hVar2.b * 1000;
                        Log.e("Debugging:", "retrying: " + h.this.c);
                        h.this.s.cancel();
                        return;
                    }
                    int[] iArr = e.this.f10123e;
                    int i3 = iArr[0];
                    iArr[0] = i3 + 1;
                    if (Build.VERSION.SDK_INT >= 26) {
                        h hVar3 = h.this;
                        e.this.a = PreferenceManager.getDefaultSharedPreferences(hVar3.a);
                        SharedPreferences.Editor edit = e.this.a.edit();
                        edit.putBoolean("CANCELLED", false);
                        edit.apply();
                        h hVar4 = h.this;
                        NotificationActivity.a(hVar4.f10144n, hVar4.a);
                        h hVar5 = h.this;
                        Notification.Builder builder = new Notification.Builder(h.this.a);
                        StringBuilder sb = new StringBuilder();
                        sb.append(h.this.a.getResources().getString(R.string.recording_dots));
                        sb.append(e.this.c0(i3));
                        sb.append(" - ");
                        h hVar6 = h.this;
                        sb.append(e.this.c0(hVar6.f10135e / 1000));
                        hVar5.f10141k = builder.setContentTitle(sb.toString()).setSmallIcon(R.mipmap.ic_launcher).setChannelId("ksjadf87").setSound((Uri) null, (AudioAttributes) null).build();
                        h.this.f10139i.createNotificationChannel(new NotificationChannel("ksjadf87", h.this.a.getResources().getString(R.string.recording_dots), 2));
                        h hVar7 = h.this;
                        notificationManager = hVar7.f10139i;
                        i2 = hVar7.f10144n;
                        c = hVar7.f10141k;
                    } else {
                        h.d dVar = h.this.f10142l;
                        StringBuilder sb2 = new StringBuilder();
                        sb2.append(h.this.a.getResources().getString(R.string.recording_dots));
                        sb2.append(e.this.c0(i3));
                        sb2.append(" - ");
                        h hVar8 = h.this;
                        sb2.append(e.this.c0(hVar8.f10135e / 1000));
                        dVar.n(sb2.toString());
                        h hVar9 = h.this;
                        notificationManager = hVar9.f10139i;
                        i2 = hVar9.f10144n;
                        c = hVar9.f10142l.c();
                    }
                    notificationManager.notify(i2, c);
                    if (h.this.u) {
                        h.this.f10139i.cancelAll();
                        h.this.s.cancel();
                    }
                    Log.e("Debugging:", "Seconds:" + e.this.c0(i3) + "   Reverse Seconds:" + e.this.c0((int) (j2 / 1000)) + " asdf:" + h.this.c + " Timeinseconds:" + h.this.b);
                    h hVar10 = h.this;
                    e.this.n0(hVar10.a, "processing");
                }
            }

            public a(long j2, long j3) {
                super(j2, j3);
            }

            @Override
            public void onFinish() {
                cancel();
                h hVar = h.this;
                if (e.this.c || !hVar.f10147q) {
                    return;
                }
                h.this.C("failed");
            }

            @Override
            public void onTick(long j2) {
                Log.e("onTick", "Testing:" + j2);
                if (h.this.f10146p) {
                    Log.e("download started", "Testing:" + j2);
                    cancel();
                    h hVar = h.this;
                    hVar.s = new CountDownTimerC0275a((long) hVar.c, 1000L).start();
                }
            }
        }

        @SuppressLint({"StaticFieldLeak"})
        public class b extends AsyncTask<Void, Void, Void> {
            public FileOutputStream a;

            public class a implements Runnable {
                public a() {
                }

                @Override
                public void run() {
                    h hVar = h.this;
                    e.this.b++;
                    e.j0(hVar.a, "Retrying (" + e.this.b + "/" + e.this.f10122d + ")");
                    new b(h.this, null).execute(new Void[0]);
                }
            }

            public class RunnableC0276b implements Runnable {
                public RunnableC0276b() {
                }

                @Override
                public void run() {
                    h hVar = h.this;
                    e.this.b++;
                    e.j0(hVar.a, "Retrying (" + e.this.b + "/" + e.this.f10122d + ")");
                    new b(h.this, null).execute(new Void[0]);
                }
            }

            public b() {
                this.a = null;
            }

            public b(h hVar, f.j.a.h.i.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.f10136f).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.a.edit();
                        edit.putBoolean("CANCELLED", true);
                        edit.apply();
                        h.this.t = true;
                        e.this.c = true;
                        h.this.f10146p = false;
                        return null;
                    }
                    if (h.this.f10134d == null || h.this.f10134d.equals("")) {
                        if (Build.VERSION.SDK_INT >= 19) {
                            file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), "BoxBRApks");
                        } else {
                            file = new File(Environment.getExternalStorageDirectory() + "/Download", "BoxBRApks");
                        }
                        if (!file.exists()) {
                            file.mkdirs();
                        }
                        if (Build.VERSION.SDK_INT >= 19) {
                            hVar = h.this;
                            valueOf = String.valueOf(new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), "BoxBRApks"));
                        } else {
                            hVar = h.this;
                            valueOf = String.valueOf(new File(Environment.getExternalStorageDirectory() + "/Download", "BoxBRApks"));
                        }
                        hVar.f10134d = valueOf;
                    }
                    if (h.this.f10138h == null || h.this.f10138h.equals("")) {
                        if (!h.this.f10137g.contains(".ts")) {
                            h hVar2 = h.this;
                            hVar2.f10137g = h.this.f10137g + ".ts";
                        }
                        file2 = new File(String.valueOf(h.this.f10134d + "/" + h.this.f10137g));
                        if (file2.exists() && !e.this.c) {
                            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss", Locale.US);
                            Date date = new Date();
                            h hVar3 = h.this;
                            hVar3.f10138h = simpleDateFormat.format(date) + "_" + h.this.f10137g;
                            file2 = new File(String.valueOf(h.this.f10134d + "/" + h.this.f10138h));
                        }
                    } else {
                        file2 = new File(String.valueOf(h.this.f10134d + "/" + h.this.f10138h));
                    }
                    this.a = new FileOutputStream(file2, true);
                    BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(this.a);
                    BufferedInputStream bufferedInputStream = new BufferedInputStream(httpURLConnection.getInputStream());
                    byte[] bArr = new byte[BasicChronology.CACHE_SIZE];
                    long currentTimeMillis = (System.currentTimeMillis() / 1000) + h.this.b;
                    h.this.f10146p = true;
                    h.this.t = false;
                    while (true) {
                        int read = bufferedInputStream.read(bArr);
                        if (read != -1 && System.currentTimeMillis() / 1000 < currentTimeMillis && !h.this.f10145o) {
                            e.this.a = PreferenceManager.getDefaultSharedPreferences(h.this.a);
                            h.this.t = e.this.a.getBoolean("CANCELLED", false);
                            if (h.this.t) {
                                h.this.t = true;
                                e.this.b = 0;
                                e.this.c = false;
                                SharedPreferences.Editor edit2 = e.this.a.edit();
                                edit2.putBoolean("CANCELLED", true);
                                edit2.apply();
                                break;
                            }
                            e.this.b = 0;
                            e.this.c = false;
                            bufferedOutputStream.write(bArr, 0, read);
                        } else {
                            break;
                        }
                    }
                    bufferedOutputStream.close();
                    bufferedInputStream.close();
                    return null;
                } catch (Exception e2) {
                    SharedPreferences.Editor edit3 = e.this.a.edit();
                    edit3.putBoolean("CANCELLED", true);
                    edit3.apply();
                    h.this.t = true;
                    h hVar4 = h.this;
                    e.this.c = true;
                    hVar4.f10146p = false;
                    Log.e("Download Task", "Retrying " + e2.getMessage());
                    return null;
                }
            }

            @Override
            public void onPostExecute(Void r8) {
                Handler handler;
                Runnable runnableC0276b;
                h hVar;
                String string;
                try {
                } catch (Exception e2) {
                    e2.printStackTrace();
                    h.this.f10147q = true;
                    h hVar2 = h.this;
                    hVar2.C(hVar2.a.getResources().getString(R.string.failed));
                }
                if (this.a == null) {
                    if (e.this.c) {
                        if (e.this.b >= e.this.f10122d) {
                            e.this.c = false;
                            h.this.f10147q = true;
                            hVar = h.this;
                            string = h.this.a.getResources().getString(R.string.failed);
                            hVar.C(string);
                        } else {
                            e.this.c = true;
                            handler = new Handler();
                            runnableC0276b = new RunnableC0276b();
                            handler.postDelayed(runnableC0276b, 10000L);
                        }
                    }
                    super.onPostExecute(r8);
                }
                if (h.this.t) {
                    if (e.this.c) {
                        if (e.this.b >= e.this.f10122d) {
                            e.j0(h.this.a, h.this.a.getResources().getString(R.string.DownloadFailed));
                            e.this.c = false;
                            h.this.f10147q = true;
                            hVar = h.this;
                            string = h.this.a.getResources().getString(R.string.failed);
                        } else {
                            e.this.c = true;
                            handler = new Handler();
                            runnableC0276b = new a();
                            handler.postDelayed(runnableC0276b, 10000L);
                        }
                    }
                    super.onPostExecute(r8);
                }
                hVar = h.this;
                string = h.this.a.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.f10136f = "";
            this.f10137g = "";
            this.a = activity;
            this.f10136f = str;
            int i3 = i2 * 60;
            int i4 = i3 * 1000;
            this.c = i4;
            this.f10135e = i4;
            this.b = i3;
            this.f10134d = str3;
            this.f10137g = str2;
            e.this.a = PreferenceManager.getDefaultSharedPreferences(activity);
            new b(this, null).execute(new Void[0]);
        }

        public void A() {
            e.this.a = PreferenceManager.getDefaultSharedPreferences(this.a);
            SharedPreferences.Editor edit = e.this.a.edit();
            edit.putBoolean("CANCELLED", false);
            edit.apply();
            PendingIntent a2 = NotificationActivity.a(this.f10144n, this.a);
            if (Build.VERSION.SDK_INT >= 26) {
                return;
            }
            this.f10142l.a(R.drawable.stop_icon, "Stop", a2);
        }

        public void B() {
            NotificationManager notificationManager;
            int i2;
            Notification c;
            NotificationManager notificationManager2 = this.f10139i;
            if (notificationManager2 != null) {
                notificationManager2.cancelAll();
            }
            NotificationManager notificationManager3 = this.f10140j;
            if (notificationManager3 != null) {
                notificationManager3.cancelAll();
            }
            if (!e.this.c) {
                Context context = this.a;
                Toast.makeText(context, context.getResources().getString(R.string.download_started), 0).show();
            }
            this.f10139i = (NotificationManager) this.a.getSystemService("notification");
            h.d dVar = new h.d(this.a);
            this.f10142l = dVar;
            if (Build.VERSION.SDK_INT >= 26) {
                NotificationChannel notificationChannel = new NotificationChannel("ksjadf87", this.a.getResources().getString(R.string.recording_dots), 2);
                this.f10141k = new Notification.Builder(this.a).setContentTitle(this.a.getResources().getString(R.string.live_recording)).setContentText(this.a.getResources().getString(R.string.recording_dots)).setSmallIcon(R.mipmap.ic_launcher).setChannelId("ksjadf87").setProgress(100, 0, true).build();
                this.f10139i.createNotificationChannel(notificationChannel);
                notificationManager = this.f10139i;
                i2 = this.f10144n;
                c = this.f10141k;
            } else {
                dVar.o(this.a.getResources().getString(R.string.live_recording));
                dVar.y(100, 0, true);
                dVar.n(this.a.getResources().getString(R.string.recording_dots));
                dVar.A(R.mipmap.ic_launcher);
                notificationManager = this.f10139i;
                i2 = this.f10144n;
                c = this.f10142l.c();
            }
            notificationManager.notify(i2, c);
            CountDownTimer countDownTimer = this.r;
            if (countDownTimer != null) {
                countDownTimer.cancel();
            }
            this.r = new a(20000L, 1000L).start();
        }

        public final void C(String str) {
            int i2;
            this.f10139i.cancelAll();
            CountDownTimer countDownTimer = this.s;
            if (countDownTimer != null) {
                countDownTimer.cancel();
            }
            h.d dVar = new h.d(this.a);
            dVar.A(R.mipmap.ic_launcher);
            dVar.o(this.a.getResources().getString(R.string.live_recording));
            this.f10143m = dVar;
            if (str.equals("completed")) {
                e.this.n0(this.a, "completed");
                this.u = true;
                h.d dVar2 = this.f10143m;
                Resources resources = this.a.getResources();
                i2 = R.string.download_completed;
                dVar2.n(resources.getString(R.string.download_completed));
            } else if (str.equals("failed")) {
                e.this.n0(this.a, "failed");
                h.d dVar3 = this.f10143m;
                Resources resources2 = this.a.getResources();
                i2 = R.string.download_failed;
                dVar3.n(resources2.getString(R.string.download_failed));
            } else if (str.equals("stopped")) {
                e.this.n0(this.a, "stopped");
                h.d dVar4 = this.f10143m;
                Resources resources3 = this.a.getResources();
                i2 = R.string.download_stopped;
                dVar4.n(resources3.getString(R.string.download_stopped));
            }
            NotificationManager notificationManager = (NotificationManager) this.a.getSystemService("notification");
            this.f10140j = notificationManager;
            notificationManager.notify(455, this.f10143m.c());
        }
    }

    public static class i implements View.OnFocusChangeListener {
        public View b;
        public Activity c;

        public i(View view, Activity activity) {
            this.b = view;
            this.c = activity;
        }

        public i(View view, CheckAppupdateActivity checkAppupdateActivity) {
            this.b = view;
            this.c = checkAppupdateActivity;
        }

        public i(View view, MultiUserActivity multiUserActivity) {
            this.b = view;
            this.c = multiUserActivity;
        }

        public i(View view, NewDashboardActivity newDashboardActivity) {
            this.b = view;
            this.c = newDashboardActivity;
        }

        public i(View view, RateUsActivity rateUsActivity) {
            this.b = view;
            this.c = rateUsActivity;
        }

        public i(View view, RecordingActivity recordingActivity) {
            this.b = view;
            this.c = recordingActivity;
        }

        public i(View view, SplashActivity splashActivity) {
            this.b = view;
            this.c = splashActivity;
        }

        public i(View view, NSTIJKPlayerSkyActivity nSTIJKPlayerSkyActivity) {
            this.b = view;
            this.c = nSTIJKPlayerSkyActivity;
        }

        public final void a(float f2) {
            ObjectAnimator ofFloat = ObjectAnimator.ofFloat(this.b, "scaleX", f2);
            ofFloat.setDuration(150L);
            ofFloat.start();
        }

        public final void b(float f2) {
            ObjectAnimator ofFloat = ObjectAnimator.ofFloat(this.b, "scaleY", f2);
            ofFloat.setDuration(150L);
            ofFloat.start();
        }

        @Override
        @SuppressLint({"ResourceType"})
        public void onFocusChange(View view, boolean z) {
            int i2;
            if (this.c != null) {
                if (!z) {
                    if (z) {
                        return;
                    }
                    a(1.0f);
                    b(1.0f);
                    View view2 = this.b;
                    if (view2 != null && view2.getTag() != null && this.b.getTag().equals("1")) {
                        view.setBackgroundResource(R.drawable.black_button_dark);
                    }
                    View view3 = this.b;
                    if (view3 != null && view3.getTag() != null && this.b.getTag().equals("2")) {
                        view.setBackgroundResource(R.drawable.black_button_dark);
                    }
                    View view4 = this.b;
                    if (view4 == null || view4.getTag() == null || !this.b.getTag().equals("3")) {
                        return;
                    }
                    view.setBackgroundResource(R.drawable.black_button_dark);
                    return;
                }
                float f2 = z ? 1.12f : 1.0f;
                View view5 = this.b;
                if (view5 == null || view5.getTag() == null || !this.b.getTag().equals("1")) {
                    View view6 = this.b;
                    if (view6 == null || view6.getTag() == null || !this.b.getTag().equals("2")) {
                        View view7 = this.b;
                        if (view7 == null || view7.getTag() == null || !this.b.getTag().equals("3")) {
                            view.setBackground(this.c.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 a;
        public final f.j.a.i.p.e b;
        public ArrayList<XMLTVProgrammePojo> c;
        public f.j.a.k.h.c f10148d;
        public String f10149e;

        @SuppressLint({"StaticFieldLeak"})
        public class a extends AsyncTask<String, Integer, Boolean> {
            public a(Context context) {
            }

            @Override
            public Boolean doInBackground(String... strArr) {
                publishProgress(0);
                if (j.this.b != null) {
                    j.this.b.G(j.this.c);
                    j.this.c.clear();
                    j.this.b.g2("epg", "1", j.this.f10149e);
                }
                return Boolean.TRUE;
            }

            @Override
            public void onPostExecute(Boolean bool) {
            }

            @Override
            public void onProgressUpdate(Integer... numArr) {
            }

            @Override
            public void onCancelled() {
            }

            @Override
            public void onPreExecute() {
            }
        }

        public j(int i2, Context context, f.j.a.i.p.e eVar) {
            this.f10149e = "0";
            this.f10149e = String.valueOf(i2);
            this.a = context;
            this.b = eVar;
        }

        @Override
        public Boolean doInBackground(Void... voidArr) {
            f.j.a.i.p.e eVar;
            if (!this.f10149e.equals("0") && (eVar = this.b) != null) {
                eVar.S1(this.f10149e);
            }
            Log.e("honey", "epg u 1");
            this.f10148d = new f.j.a.k.h.c();
            Log.e("honey", "epg u 2");
            this.f10148d.a(this.a);
            Log.e("honey", "epg u 3");
            this.c = this.f10148d.b();
            Log.e("honey", "epg u 4");
            ArrayList<XMLTVProgrammePojo> arrayList = this.c;
            if (arrayList == null || arrayList.size() <= 0) {
                f.j.a.i.p.e eVar2 = this.b;
                if (eVar2 == null || eVar2.h1(this.f10149e) == 0) {
                    return Boolean.FALSE;
                }
                this.b.g2("epg", "1", this.f10149e);
            } else {
                Log.e("honey", "size u :" + this.c.size());
            }
            return Boolean.TRUE;
        }

        @Override
        public void onPostExecute(Boolean bool) {
            f.j.a.i.p.e eVar;
            String str;
            try {
                if (bool.booleanValue()) {
                    f.j.a.h.i.a.g0 = false;
                    ArrayList<XMLTVProgrammePojo> arrayList = this.c;
                    if (arrayList == null || arrayList.size() <= 0) {
                        return;
                    }
                    try {
                        e.f10120o = new a(this.a).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new String[0]);
                        return;
                    } catch (Exception unused) {
                        eVar = this.b;
                        str = "0";
                    }
                } else {
                    eVar = this.b;
                    str = "2";
                }
                eVar.g2("epg", str, this.f10149e);
            } catch (Exception unused2) {
            }
        }

        @Override
        public void onPreExecute() {
        }
    }

    public e() {
        new ArrayList();
    }

    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_DOWNLOADS), "BoxBRApks");
            } else {
                file = new File(Environment.getExternalStorageDirectory() + "/Download", "BoxBRApks");
            }
            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", f.j.a.h.i.a.d0), Locale.US).format(new Date());
            } catch (Exception unused) {
                return "";
            }
        }
        return "";
    }

    public static long C(Context context) {
        if (context != null) {
            try {
                SharedPreferences sharedPreferences = context.getSharedPreferences("loginPrefs", 0);
                f10112g = sharedPreferences;
                if (sharedPreferences != null) {
                    return v(sharedPreferences.getString("selectedEPGShift", f.j.a.h.i.a.b0));
                }
                return 0L;
            } catch (Exception unused) {
                return 0L;
            }
        }
        return 0L;
    }

    public static String D(Context context, int i2, String str, String str2) {
        StringBuilder sb;
        String str3;
        SharedPreferences sharedPreferences = context.getSharedPreferences("allowedFormat", 0);
        SharedPreferences sharedPreferences2 = context.getSharedPreferences("loginPrefs", 0);
        String string = sharedPreferences2.getString("username", "");
        String string2 = sharedPreferences2.getString("password", "");
        String string3 = sharedPreferences.getString("allowedFormat", "");
        String string4 = sharedPreferences2.getString("serverUrl", "");
        String string5 = sharedPreferences2.getString("serverProtocol", "");
        String string6 = sharedPreferences2.getString("serverPortHttps", "");
        String string7 = sharedPreferences2.getString("serverPort", "");
        String string8 = sharedPreferences2.getString("serverPortRtmp", "");
        if (string3 != null && string3.equals("default")) {
            string3 = "ts";
        }
        if (string5 != null) {
            char c2 = 65535;
            int hashCode = string5.hashCode();
            if (hashCode != 3213448) {
                if (hashCode != 3504631) {
                    if (hashCode == 99617003 && string5.equals("https")) {
                        c2 = 1;
                    }
                } else if (string5.equals("rmtp")) {
                    c2 = 2;
                }
            } else if (string5.equals("http")) {
                c2 = 0;
            }
            if (c2 != 0) {
                if (c2 == 1) {
                    if (string4 != null && !string4.startsWith("https://")) {
                        string4 = "https://" + string4;
                    }
                    sb = new StringBuilder();
                    sb.append(string4);
                    sb.append(":");
                    str3 = string6;
                } else if (c2 != 2) {
                    if (string4 != null && !string4.startsWith("http://") && !string4.startsWith("https://")) {
                        string4 = "http://" + string4;
                    }
                    sb = new StringBuilder();
                } else {
                    if (string4 != null && !string4.startsWith("rmtp://")) {
                        string4 = "rmtp://" + string4;
                    }
                    sb = new StringBuilder();
                    sb.append(string4);
                    sb.append(":");
                    str3 = string8;
                }
                sb.append(str3);
                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(".");
                sb.append(string3);
                return sb.toString();
            }
            if (string4 != null && !string4.startsWith("http://")) {
                string4 = "http://" + string4;
            }
            sb = new StringBuilder();
            sb.append(string4);
            sb.append(":");
            sb.append(string7);
            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(".");
            sb.append(string3);
            return sb.toString();
        }
        return null;
    }

    public static String E(Context context, int i2, String str, String str2) {
        char c2 = 0;
        SharedPreferences sharedPreferences = context.getSharedPreferences("loginPrefs", 0);
        String string = sharedPreferences.getString("username", "");
        String string2 = sharedPreferences.getString("password", "");
        String string3 = sharedPreferences.getString("serverUrl", "");
        String string4 = sharedPreferences.getString("serverProtocol", "");
        String string5 = sharedPreferences.getString("serverPortHttps", "");
        String string6 = sharedPreferences.getString("serverPort", "");
        String string7 = sharedPreferences.getString("serverPortRtmp", "");
        if (string4 != null) {
            int hashCode = string4.hashCode();
            if (hashCode != 3213448) {
                if (hashCode != 3504631) {
                    if (hashCode == 99617003 && string4.equals("https")) {
                        c2 = 1;
                    }
                    c2 = 65535;
                } else {
                    if (string4.equals("rmtp")) {
                        c2 = 2;
                    }
                    c2 = 65535;
                }
            }
            if (c2 == 0) {
                if (string3 != null && !string3.startsWith("http://")) {
                    string3 = "http://" + string3;
                }
                return string3 + ":" + string6 + "/" + str2 + "/" + string + "/" + string2 + "/" + i2 + "." + str;
            } else if (c2 == 1) {
                if (string3 != null && !string3.startsWith("https://")) {
                    string3 = "https://" + string3;
                }
                return string3 + ":" + string5 + "/" + str2 + "/" + string + "/" + string2 + "/" + i2 + "." + str;
            } else if (c2 == 2) {
                if (string3 != null && !string3.startsWith("rmtp://")) {
                    string3 = "rmtp://" + string3;
                }
                return string3 + ":" + string7 + "/" + str2 + "/" + string + "/" + string2 + "/" + i2 + "." + str;
            } else {
                if (string3 != null && !string3.startsWith("http://") && !string3.startsWith("https://")) {
                    string3 = "http://" + string3;
                }
                return string3 + ":" + string6 + "/" + str2 + "/" + string + "/" + string2 + "/" + i2 + "." + str;
            }
        }
        return null;
    }

    public static String F(Context context, int i2, String str, String str2) {
        SharedPreferences sharedPreferences = context.getSharedPreferences("loginPrefs", 0);
        String string = sharedPreferences.getString("username", "");
        String string2 = sharedPreferences.getString("password", "");
        String string3 = sharedPreferences.getString("serverUrl", "");
        String string4 = sharedPreferences.getString("serverProtocol", "");
        String string5 = sharedPreferences.getString("serverPortHttps", "");
        String string6 = sharedPreferences.getString("serverPort", "");
        String string7 = sharedPreferences.getString("serverPortRtmp", "");
        if (string4 != null) {
            char c2 = 65535;
            int hashCode = string4.hashCode();
            if (hashCode != 3213448) {
                if (hashCode != 3504631) {
                    if (hashCode == 99617003 && string4.equals("https")) {
                        c2 = 1;
                    }
                } else if (string4.equals("rmtp")) {
                    c2 = 2;
                }
            } else if (string4.equals("http")) {
                c2 = 0;
            }
            if (c2 == 0) {
                if (string3 != null && !string3.startsWith("http://")) {
                    string3 = "http://" + string3;
                }
                if (str.equals("")) {
                    return string3 + ":" + string6 + "/" + string + "/" + string2 + "/" + i2 + str;
                }
                return string3 + ":" + string6 + "/" + str2 + "/" + string + "/" + string2 + "/" + i2 + str;
            } else if (c2 == 1) {
                if (string3 != null && !string3.startsWith("https://")) {
                    string3 = "https://" + string3;
                }
                if (str.equals("")) {
                    return string3 + ":" + string5 + "/" + string + "/" + string2 + "/" + i2 + str;
                }
                return string3 + ":" + string5 + "/" + str2 + "/" + string + "/" + string2 + "/" + i2 + str;
            } else if (c2 == 2) {
                if (string3 != null && !string3.startsWith("rmtp://")) {
                    string3 = "rmtp://" + string3;
                }
                if (str.equals("")) {
                    return string3 + ":" + string7 + "/" + string + "/" + string2 + "/" + i2 + str;
                }
                return string3 + ":" + string7 + "/" + str2 + "/" + string + "/" + string2 + "/" + i2 + str;
            } else {
                if (string3 != null && !string3.startsWith("http://") && !string3.startsWith("https://")) {
                    string3 = "http://" + string3;
                }
                if (str.equals("")) {
                    return string3 + ":" + string6 + "/" + string + "/" + string2 + "/" + i2 + str;
                }
                return string3 + ":" + string6 + "/" + str2 + "/" + string + "/" + string2 + "/" + i2 + str;
            }
        }
        return null;
    }

    public static String G(Context context) {
        char c2 = 0;
        SharedPreferences sharedPreferences = context.getSharedPreferences("loginPrefs", 0);
        sharedPreferences.getString("username", "");
        sharedPreferences.getString("password", "");
        String string = sharedPreferences.getString("serverUrl", "");
        String string2 = sharedPreferences.getString("serverProtocol", "");
        String string3 = sharedPreferences.getString("serverPortHttps", "");
        String string4 = sharedPreferences.getString("serverPort", "");
        String string5 = sharedPreferences.getString("serverPortRtmp", "");
        int hashCode = string2.hashCode();
        if (hashCode != 3213448) {
            if (hashCode != 3504631) {
                if (hashCode == 99617003 && string2.equals("https")) {
                    c2 = 1;
                }
                c2 = 65535;
            } else {
                if (string2.equals("rmtp")) {
                    c2 = 2;
                }
                c2 = 65535;
            }
        }
        if (c2 == 0) {
            if (!string.startsWith("http://")) {
                string = "http://" + string;
            }
            return string + ":" + string4 + "/";
        } else if (c2 == 1) {
            if (!string.startsWith("https://")) {
                string = "https://" + string;
            }
            return string + ":" + string3 + "/";
        } else if (c2 == 2) {
            if (!string.startsWith("rmtp://")) {
                string = "rmtp://" + string;
            }
            return string + ":" + string5 + "/";
        } else {
            if (!string.startsWith("http://") && !string.startsWith("https://")) {
                string = "http://" + string;
            }
            return string + ":" + string4 + "/";
        }
    }

    public static void H() {
        try {
            if (f10121p == null || !f10121p.isShowing()) {
                return;
            }
            f10121p.dismiss();
        } catch (Exception unused) {
        }
    }

    public static void I(Context context) {
        f.j.a.i.p.e eVar = new f.j.a.i.p.e(context);
        f.j.a.k.d.a.a aVar = new f.j.a.k.d.a.a(context);
        ArrayList<f.j.a.i.p.b> D0 = eVar.D0();
        String valueOf = (D0 == null || D0.size() <= 0) ? "0" : String.valueOf(D0.get(0).c());
        if (valueOf.equals("0")) {
            return;
        }
        f.j.a.i.p.d K1 = eVar.K1("epg", valueOf);
        if (K1.d() == null && K1.e() == null && K1.f() == null) {
            K1 = new f.j.a.i.p.d();
            K1.l("epg");
            K1.j("0");
            K1.g("");
            K1.k("");
            K1.i(valueOf);
            ArrayList<f.j.a.i.p.d> arrayList = new ArrayList<>();
            arrayList.add(0, K1);
            eVar.M1(arrayList, l.f(context));
        }
        if ((K1.d() == null || !K1.d().equals("2")) && (K1.d() == null || !K1.d().equals("0"))) {
            if (K1.d() == null || !K1.d().equals("1")) {
                if (K1.d() != null) {
                    K1.d().equals("3");
                    return;
                }
                return;
            }
            long q2 = q(new SimpleDateFormat("dd/MM/yyyy", Locale.US), K1.a(), h());
            if (!g(context) || q2 < aVar.d()) {
                return;
            }
        }
        J(eVar, valueOf, context);
    }

    public static void J(f.j.a.i.p.e eVar, String str, Context context) {
        if (f.j.a.h.i.a.g0) {
            f.j.a.h.i.a.g0 = false;
        }
        eVar.f2("epg", "3");
        if (Build.VERSION.SDK_INT >= 11) {
            new j(R(str), context, eVar).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new Void[0]);
        } else {
            new j(R(str), context, eVar).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 && f.j.a.h.i.a.f10097g.booleanValue() && l.f(context).equals("m3u")) {
            context.startActivity(new Intent(context, ImportM3uActivity.class));
        }
    }

    public static void N(Context context) {
        if (context != null) {
            if (!f.j.a.h.i.a.A.booleanValue()) {
                Toast.makeText(context, context.getString(R.string.logged_out), 0).show();
            }
            f.j.a.h.i.a.A = Boolean.FALSE;
            Intent intent = f.j.a.h.i.a.f10096f.booleanValue() ? new Intent(context, MultiUserActivity.class) : (f.j.a.h.i.a.f10097g.booleanValue() && f.j.a.h.i.a.f10098h.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", "");
            edit.clear();
            edit.apply();
            if (edit != null) {
                edit.putString("selectedEPGShift", string);
                edit.apply();
            }
            SharedPreferences.Editor edit2 = context.getSharedPreferences("sharedprefremberme", 0).edit();
            edit2.clear();
            edit2.apply();
            if (f.j.a.h.i.a.f10097g.booleanValue() && f.j.a.h.i.a.f10098h.booleanValue()) {
                SharedPreferences.Editor edit3 = context.getSharedPreferences("sharedprefremberme", 0).edit();
                edit3.putBoolean("savelogin", false);
                edit3.apply();
                if (l.f(context).equalsIgnoreCase("m3u")) {
                    SharedPreferences.Editor edit4 = context.getSharedPreferences("sharedprefremberme", 0).edit();
                    edit4.clear();
                    edit4.apply();
                }
            }
            if (f.j.a.h.i.a.f10095e.booleanValue() && !(f.j.a.h.i.a.f10097g.booleanValue() && f.j.a.h.i.a.f10098h.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 "";
        }
    }

    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 "";
        }
    }

    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) {
        f10114i = new f.j.a.k.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("") ? 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 = l.d(context);
                if (!l.d(context).equals("default") && !new f.j.a.i.p.c(context).a(d2)) {
                    l.M("default", "default", context);
                }
                f10114i = new f.j.a.k.d.a.a(context);
                String e2 = l.e(context);
                if (!e2.equals("default")) {
                    String D = D(context, i2, str6, str8);
                    String d3 = l.d(context);
                    Intent intent2 = new Intent(context, PlayExternalPlayerActivity.class);
                    intent2.putExtra(IjkMediaPlayer.OnNativeInvokeListener.ARG_URL, D);
                    intent2.putExtra("packagename", e2);
                    intent2.putExtra("app_name", d3);
                    context.startActivity(intent2);
                    return;
                }
                if (f10114i.t() == 3) {
                    f10114i.I(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(IjkMediaMeta.IJKM_KEY_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 = l.u(context);
            if (!l.v(context).equals("default") && !new f.j.a.i.p.c(context).a(u)) {
                l.a0("default", "default", context);
            }
            String v = l.v(context);
            if (!v.equals("default")) {
                String E = l.f(context).equals("m3u") ? str6 : E(context, i2, str3, "series");
                String u2 = l.u(context);
                Intent intent2 = new Intent(context, PlayExternalPlayerActivity.class);
                intent2.putExtra(IjkMediaPlayer.OnNativeInvokeListener.ARG_URL, E);
                intent2.putExtra("packagename", v);
                intent2.putExtra("app_name", u2);
                context.startActivity(intent2);
                return;
            }
            f10114i = new f.j.a.k.d.a.a(context);
            String str9 = l.f(context).equalsIgnoreCase("m3u") ? "movies_m3u" : "series";
            if (f10114i.t() == 3) {
                f10114i.I(context.getResources().getString(R.string.hardware_decoder));
                intent = new Intent(context, HoneyPlayer.class);
                intent.putExtra(IjkMediaMeta.IJKM_KEY_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 = IjkMediaMeta.IJKM_KEY_TYPE;
                intent.putExtra(str7, str6);
            } else {
                str7 = "VIDEO_URL";
                str8 = IjkMediaMeta.IJKM_KEY_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) {
        Intent intent;
        if (context != null) {
            String C = l.C(context);
            if (!l.D(context).equals("default") && !new f.j.a.i.p.c(context).a(C)) {
                l.i0("default", "default", context);
            }
            String str7 = l.f(context).equalsIgnoreCase("m3u") ? "movies_m3u" : "movies";
            String C2 = l.C(context);
            String D = l.D(context);
            if (!D.equals("default")) {
                if (!l.f(context).equalsIgnoreCase("m3u")) {
                    str6 = E(context, i2, str3, "movie");
                }
                Intent intent2 = new Intent(context, PlayExternalPlayerActivity.class);
                intent2.putExtra(IjkMediaPlayer.OnNativeInvokeListener.ARG_URL, str6);
                intent2.putExtra("packagename", D);
                intent2.putExtra("app_name", C2);
                context.startActivity(intent2);
                return;
            }
            f.j.a.k.d.a.a aVar = new f.j.a.k.d.a.a(context);
            f10114i = aVar;
            if (aVar.t() == 3) {
                f10114i.I(context.getResources().getString(R.string.hardware_decoder));
                intent = new Intent(context, HoneyPlayer.class);
            } else {
                intent = new Intent(context, HoneyPlayer.class);
            }
            intent.putExtra(IjkMediaMeta.IJKM_KEY_TYPE, str7);
            intent.putExtra("OPENED_STREAM_ID", i2);
            intent.putExtra("STREAM_TYPE", str2);
            intent.putExtra("STREAM_TOTAL_DURATION", i3);
            intent.putExtra("VIDEO_NUM", R(str4));
            intent.putExtra("VIDEO_TITLE", str5);
            intent.putExtra("CONTAINER_EXTENSION", str3);
            intent.putExtra("VIDEO_URL", str6);
            context.startActivity(intent);
        }
    }

    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) {
        Intent intent;
        if (context != null) {
            f.j.a.k.d.a.a aVar = new f.j.a.k.d.a.a(context);
            f10114i = aVar;
            if (aVar.t() == 3) {
                f10114i.I(context.getResources().getString(R.string.hardware_decoder));
                intent = new Intent(context, NSTIJKPlayerSkyActivity.class);
                intent.putExtra("OPENED_STREAM_ID", i2);
                intent.putExtra("STREAM_TYPE", str2);
            } else {
                intent = 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 = l.g(context);
            if (!l.h(context).equals("default") && !new f.j.a.i.p.c(context).a(g2)) {
                l.O("default", "default", context);
            }
            String h2 = l.h(context);
            String str9 = "";
            if (h2.equals("default")) {
                f.j.a.k.d.a.a aVar = new f.j.a.k.d.a.a(context);
                f10114i = aVar;
                if (aVar.t() == 3) {
                    f10114i.I(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("") ? -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", "");
            if (string == null || string.isEmpty() || string.equals("") || !string.equals("default")) {
                if (string != null && !string.isEmpty() && !string.equals("") && string.equals("ts")) {
                    str9 = ".ts";
                } else if (string != null && !string.isEmpty() && !string.equals("") && string.equals("m3u8")) {
                    str9 = ".m3u8";
                }
            }
            if (!l.f(context).equalsIgnoreCase("m3u")) {
                str8 = F(context, i2, str9, "live");
            }
            String g3 = l.g(context);
            Intent intent2 = new Intent(context, PlayExternalPlayerActivity.class);
            intent2.putExtra(IjkMediaPlayer.OnNativeInvokeListener.ARG_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(f.j.a.h.i.a.f10105o, "").toLowerCase();
                Log.e("URl from Back", ">>>>>>>>" + lowerCase);
                if (!lowerCase.startsWith("http://") && !lowerCase.startsWith("https://")) {
                    lowerCase = "http://" + lowerCase;
                }
                if (!lowerCase.endsWith("/")) {
                    lowerCase = lowerCase + "/";
                }
                f.j.a.h.i.a.z = lowerCase;
                x.b bVar = new x.b();
                bVar.c(60L, TimeUnit.SECONDS);
                bVar.g(60L, TimeUnit.SECONDS);
                bVar.e(60L, TimeUnit.SECONDS);
                bVar.d(true);
                x a2 = bVar.a();
                m.b bVar2 = new m.b();
                bVar2.b(lowerCase);
                bVar2.f(a2);
                bVar2.a(q.p.a.a.d());
                return bVar2.d();
            } catch (IllegalArgumentException | NullPointerException | Exception unused) {
            }
        }
        return null;
    }

    public static m Z(Context context) {
        if (context != null) {
            try {
                x.b bVar = new x.b();
                bVar.c(60L, TimeUnit.SECONDS);
                bVar.g(60L, TimeUnit.SECONDS);
                bVar.e(60L, TimeUnit.SECONDS);
                bVar.d(false);
                x a2 = bVar.a();
                m.b bVar2 = new m.b();
                bVar2.b("https://users.iptvsmarters.com/");
                bVar2.f(a2);
                bVar2.a(q.p.a.a.d());
                return bVar2.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();
                bVar.c(60L, TimeUnit.SECONDS);
                bVar.g(60L, TimeUnit.SECONDS);
                bVar.e(60L, TimeUnit.SECONDS);
                bVar.d(false);
                x a2 = bVar.a();
                m.b bVar2 = new m.b();
                bVar2.b("http://api.themoviedb.org/3/");
                bVar2.f(a2);
                bVar2.a(q.p.a.a.d());
                return bVar2.d();
            } catch (IllegalArgumentException | NullPointerException | Exception unused) {
            }
        }
        return null;
    }

    public static void b0(Context context) {
        if (context != null) {
            try {
                new f.j.a.k.d.a.a(context).w().equals(f.j.a.h.i.a.i0);
            } 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", "");
            if (string.equals("")) {
                return;
            }
            d0(context, string);
        }
    }

    public static boolean g(Context context) {
        return context.getSharedPreferences("automation_epg", 0).getString("automation_epg", "").equals("checked");
    }

    public static void g0(Activity activity) {
        try {
            Dialog dialog = new Dialog(activity);
            f10121p = dialog;
            dialog.setContentView(R.layout.spinkitanimation);
            f10121p.getWindow().setBackgroundDrawable(new ColorDrawable(0));
            f10121p.getWindow().setGravity(17);
            f10121p.setCancelable(false);
            f10121p.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);
        f10121p = dialog;
        dialog.setContentView(R.layout.spinkitanimation);
        f10121p.getWindow().setBackgroundDrawable(new ColorDrawable(0));
        f10121p.getWindow().setGravity(17);
        f10121p.setCancelable(false);
        f10121p.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 == "" || str.isEmpty()) {
            return;
        }
        Toast.makeText(context, str, 0).show();
    }

    public static long k(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 void k0(Context context, String str) {
        if (context == null || str == "" || str.isEmpty()) {
            return;
        }
        Toast.makeText(context, str, 1).show();
    }

    public static long l(String str, Context context) {
        if (str == null) {
            return 0L;
        }
        try {
            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss", Locale.US);
            simpleDateFormat.setTimeZone(TimeZone.getTimeZone(new f.j.a.k.d.a.a(context).y()));
            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 l0(long j2) {
        try {
            int i2 = 0;
            List asList = Arrays.asList(Long.valueOf(TimeUnit.DAYS.toMillis(365L)), Long.valueOf(TimeUnit.DAYS.toMillis(30L)), Long.valueOf(TimeUnit.DAYS.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.c : "");
                    stringBuffer.append(" ago");
                } else {
                    i2++;
                }
            }
            return "".equals(stringBuffer.toString()) ? "0 sec ago" : stringBuffer.toString();
        } catch (Exception unused) {
            return "0 sec ago";
        }
    }

    public static void m(Context context) {
        String m0 = m0(f.j.a.k.d.c.a.a.a());
        String packageName = context.getApplicationContext().getPackageName();
        String L = L(context);
        String m02 = m0(f.j.a.k.d.c.a.e.d());
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss", Locale.US);
        if (k(simpleDateFormat, simpleDateFormat.format(new Date(f.j.a.k.d.c.a.f.a(context))), simpleDateFormat.format(new Date())) < f.j.a.k.d.c.a.d.p() || m0 == null || m02 == null) {
            return;
        }
        if (L.equals(m0) && (m0 == null || m02 == null || packageName.equals(m02))) {
            return;
        }
        String m03 = m0(f.j.a.k.d.c.a.h.a() + f.j.a.k.d.c.a.h.i());
        String m04 = m0(f.j.a.k.d.c.a.i.i() + f.j.a.k.d.c.a.i.h());
        String m05 = m0(f.j.a.k.d.c.a.g.f() + f.j.a.k.d.c.a.g.h());
        Toast.makeText(context, m03 + m04 + m05, 1).show();
        ((Activity) context).finishAffinity();
    }

    public static String m0(String str) {
        return Build.VERSION.SDK_INT >= 19 ? new String(Base64.decode(str, 0), StandardCharsets.UTF_8) : "";
    }

    public static m n(Context context) {
        x.b bVar = new x.b();
        bVar.c(60L, TimeUnit.SECONDS);
        bVar.g(60L, TimeUnit.SECONDS);
        bVar.e(60L, TimeUnit.SECONDS);
        bVar.d(false);
        x a2 = bVar.a();
        m.b bVar2 = new m.b();
        bVar2.b("http://ip-cms.135.148.33.103.host/");
        bVar2.f(a2);
        bVar2.a(q.p.a.a.d());
        return bVar2.d();
    }

    public static m o(Context context) {
        x.b bVar = new x.b();
        bVar.c(60L, TimeUnit.SECONDS);
        bVar.g(60L, TimeUnit.SECONDS);
        bVar.e(60L, TimeUnit.SECONDS);
        bVar.d(false);
        x a2 = bVar.a();
        m.b bVar2 = new m.b();
        StringBuilder sb = new StringBuilder();
        sb.append(g.a.a);
        bVar2.b(sb.toString());
        bVar2.f(a2);
        bVar2.a(q.p.a.a.d());
        return bVar2.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 "";
        }
    }

    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) {
        char c2;
        switch (str.hashCode()) {
            case 3121:
                if (str.equals("ar")) {
                    c2 = 6;
                    break;
                }
                c2 = 65535;
                break;
            case 3201:
                if (str.equals("de")) {
                    c2 = '\b';
                    break;
                }
                c2 = 65535;
                break;
            case 3241:
                if (str.equals("en")) {
                    c2 = 0;
                    break;
                }
                c2 = 65535;
                break;
            case 3246:
                if (str.equals("es")) {
                    c2 = 5;
                    break;
                }
                c2 = 65535;
                break;
            case 3276:
                if (str.equals("fr")) {
                    c2 = 7;
                    break;
                }
                c2 = 65535;
                break;
            case 3325:
                if (str.equals("he")) {
                    c2 = 14;
                    break;
                }
                c2 = 65535;
                break;
            case 3338:
                if (str.equals("hr")) {
                    c2 = 4;
                    break;
                }
                c2 = 65535;
                break;
            case 3341:
                if (str.equals("hu")) {
                    c2 = 11;
                    break;
                }
                c2 = 65535;
                break;
            case 3365:
                if (str.equals("in")) {
                    c2 = 18;
                    break;
                }
                c2 = 65535;
                break;
            case 3371:
                if (str.equals("it")) {
                    c2 = '\t';
                    break;
                }
                c2 = 65535;
                break;
            case 3428:
                if (str.equals("ko")) {
                    c2 = '\r';
                    break;
                }
                c2 = 65535;
                break;
            case 3494:
                if (str.equals("ms")) {
                    c2 = 16;
                    break;
                }
                c2 = 65535;
                break;
            case 3518:
                if (str.equals("nl")) {
                    c2 = 17;
                    break;
                }
                c2 = 65535;
                break;
            case 3580:
                if (str.equals("pl")) {
                    c2 = 1;
                    break;
                }
                c2 = 65535;
                break;
            case 3588:
                if (str.equals("pt")) {
                    c2 = 2;
                    break;
                }
                c2 = 65535;
                break;
            case 3645:
                if (str.equals("ro")) {
                    c2 = '\n';
                    break;
                }
                c2 = 65535;
                break;
            case 3678:
                if (str.equals("sq")) {
                    c2 = '\f';
                    break;
                }
                c2 = 65535;
                break;
            case 3683:
                if (str.equals("sv")) {
                    c2 = 19;
                    break;
                }
                c2 = 65535;
                break;
            case 3710:
                if (str.equals("tr")) {
                    c2 = 3;
                    break;
                }
                c2 = 65535;
                break;
            case 3734:
                if (str.equals("uk")) {
                    c2 = 15;
                    break;
                }
                c2 = 65535;
                break;
            default:
                c2 = 65535;
                break;
        }
        switch (c2) {
            case 0:
            default:
                return 0;
            case 1:
                return 1;
            case 2:
                return 2;
            case 3:
                return 3;
            case 4:
                return 4;
            case 5:
                return 5;
            case 6:
                return 6;
            case 7:
                return 7;
            case '\b':
                return 8;
            case '\t':
                return 9;
            case '\n':
                return 10;
            case 11:
                return 11;
            case '\f':
                return 12;
            case '\r':
                return 13;
            case 14:
                return 14;
            case 15:
                return 15;
            case 16:
                return 16;
            case 17:
                return 17;
            case 18:
                return 18;
            case 19:
                return 19;
        }
    }

    @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("")) {
            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 "";
                        }
                    }
                    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 "";
        }
        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", f.j.a.h.i.a.d0);
            f.j.a.k.d.a.a aVar = new f.j.a.k.d.a.a(context);
            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US);
            SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat(string, Locale.US);
            simpleDateFormat.setTimeZone(TimeZone.getTimeZone(aVar.y()));
            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) {
        char c2;
        int hashCode = str.hashCode();
        if (hashCode != 48) {
            switch (hashCode) {
                case 1382:
                    if (str.equals("+1")) {
                        c2 = '\r';
                        break;
                    }
                    c2 = 65535;
                    break;
                case 1383:
                    if (str.equals("+2")) {
                        c2 = 14;
                        break;
                    }
                    c2 = 65535;
                    break;
                case 1384:
                    if (str.equals("+3")) {
                        c2 = 15;
                        break;
                    }
                    c2 = 65535;
                    break;
                case 1385:
                    if (str.equals("+4")) {
                        c2 = 16;
                        break;
                    }
                    c2 = 65535;
                    break;
                case 1386:
                    if (str.equals("+5")) {
                        c2 = 17;
                        break;
                    }
                    c2 = 65535;
                    break;
                case 1387:
                    if (str.equals("+6")) {
                        c2 = 18;
                        break;
                    }
                    c2 = 65535;
                    break;
                case 1388:
                    if (str.equals("+7")) {
                        c2 = 19;
                        break;
                    }
                    c2 = 65535;
                    break;
                case 1389:
                    if (str.equals("+8")) {
                        c2 = 20;
                        break;
                    }
                    c2 = 65535;
                    break;
                case 1390:
                    if (str.equals("+9")) {
                        c2 = 21;
                        break;
                    }
                    c2 = 65535;
                    break;
                default:
                    switch (hashCode) {
                        case 1444:
                            if (str.equals("-1")) {
                                c2 = 11;
                                break;
                            }
                            c2 = 65535;
                            break;
                        case 1445:
                            if (str.equals("-2")) {
                                c2 = '\n';
                                break;
                            }
                            c2 = 65535;
                            break;
                        case 1446:
                            if (str.equals("-3")) {
                                c2 = '\t';
                                break;
                            }
                            c2 = 65535;
                            break;
                        case 1447:
                            if (str.equals("-4")) {
                                c2 = '\b';
                                break;
                            }
                            c2 = 65535;
                            break;
                        case 1448:
                            if (str.equals("-5")) {
                                c2 = 7;
                                break;
                            }
                            c2 = 65535;
                            break;
                        case 1449:
                            if (str.equals("-6")) {
                                c2 = 6;
                                break;
                            }
                            c2 = 65535;
                            break;
                        case 1450:
                            if (str.equals("-7")) {
                                c2 = 5;
                                break;
                            }
                            c2 = 65535;
                            break;
                        case 1451:
                            if (str.equals("-8")) {
                                c2 = 4;
                                break;
                            }
                            c2 = 65535;
                            break;
                        case 1452:
                            if (str.equals("-9")) {
                                c2 = 3;
                                break;
                            }
                            c2 = 65535;
                            break;
                        default:
                            switch (hashCode) {
                                case 42890:
                                    if (str.equals("+10")) {
                                        c2 = 22;
                                        break;
                                    }
                                    c2 = 65535;
                                    break;
                                case 42891:
                                    if (str.equals("+11")) {
                                        c2 = 23;
                                        break;
                                    }
                                    c2 = 65535;
                                    break;
                                case 42892:
                                    if (str.equals("+12")) {
                                        c2 = 24;
                                        break;
                                    }
                                    c2 = 65535;
                                    break;
                                default:
                                    switch (hashCode) {
                                        case 44812:
                                            if (str.equals("-10")) {
                                                c2 = 2;
                                                break;
                                            }
                                            c2 = 65535;
                                            break;
                                        case 44813:
                                            if (str.equals("-11")) {
                                                c2 = 1;
                                                break;
                                            }
                                            c2 = 65535;
                                            break;
                                        case 44814:
                                            if (str.equals("-12")) {
                                                c2 = 0;
                                                break;
                                            }
                                            c2 = 65535;
                                            break;
                                        default:
                                            c2 = 65535;
                                            break;
                                    }
                            }
                    }
            }
        } else {
            if (str.equals("0")) {
                c2 = '\f';
            }
            c2 = 65535;
        }
        switch (c2) {
            case 0:
                return 0;
            case 1:
                return 1;
            case 2:
                return 2;
            case 3:
                return 3;
            case 4:
                return 4;
            case 5:
                return 5;
            case 6:
                return 6;
            case 7:
                return 7;
            case '\b':
                return 8;
            case '\t':
                return 9;
            case '\n':
                return 10;
            case 11:
                return 11;
            case '\f':
            default:
                return 12;
            case '\r':
                return 13;
            case 14:
                return 14;
            case 15:
                return 15;
            case 16:
                return 16;
            case 17:
                return 17;
            case 18:
                return 18;
            case 19:
                return 19;
            case 20:
                return 20;
            case 21:
                return 21;
            case 22:
                return 22;
            case 23:
                return 23;
            case 24:
                return 24;
        }
    }

    @SuppressLint({"DefaultLocale"})
    public String c0(int i2) {
        return String.format("%02d:%02d:%02d", Integer.valueOf(i2 / DateTimeConstants.SECONDS_PER_HOUR), Integer.valueOf((i2 % DateTimeConstants.SECONDS_PER_HOUR) / 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");
            f.j.a.k.d.a.a aVar = new f.j.a.k.d.a.a(recordingActivity);
            f10114i = aVar;
            View inflate = layoutInflater.inflate(aVar.w().equals(f.j.a.h.i.a.i0) ? R.layout.delete_recording_popup_tv : R.layout.delete_recording_popup, relativeLayout);
            PopupWindow popupWindow = new PopupWindow(recordingActivity);
            f10111f = popupWindow;
            popupWindow.setContentView(inflate);
            f10111f.setWidth(-1);
            f10111f.setHeight(-1);
            f10111f.setFocusable(true);
            f10111f.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(this));
            if (button != null) {
                button.setOnClickListener(new g(this, 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");
            f.j.a.k.d.a.a aVar = new f.j.a.k.d.a.a(activity);
            f10114i = aVar;
            View inflate = layoutInflater.inflate(aVar.w().equals(f.j.a.h.i.a.i0) ? R.layout.download_running_popup_tv : R.layout.download_running_popup, relativeLayout);
            PopupWindow popupWindow = new PopupWindow(activity);
            f10111f = popupWindow;
            popupWindow.setContentView(inflate);
            f10111f.setWidth(-1);
            f10111f.setHeight(-1);
            f10111f.setFocusable(true);
            f10111f.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(this));
            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;
        EditText editText;
        File file2;
        if (activity != null) {
            RelativeLayout relativeLayout = (RelativeLayout) activity.findViewById(R.id.rl_password_verification);
            LayoutInflater layoutInflater = (LayoutInflater) activity.getSystemService("layout_inflater");
            f.j.a.k.d.a.a aVar = new f.j.a.k.d.a.a(activity);
            f10114i = aVar;
            View inflate = layoutInflater.inflate(aVar.w().equals(f.j.a.h.i.a.i0) ? R.layout.recording_popup_tv : R.layout.recording_popup, relativeLayout);
            PopupWindow popupWindow = new PopupWindow(activity);
            f10111f = popupWindow;
            popupWindow.setContentView(inflate);
            f10111f.setWidth(-1);
            f10111f.setHeight(-1);
            f10111f.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 (l.f(activity).equals("m3u")) {
                str6 = str4;
            } else {
                if (str2.equals("")) {
                    str5 = str3 + i2;
                } else {
                    str5 = str3 + i2 + ".ts";
                }
                str6 = str5;
            }
            editText2.setText(str7);
            editText2.requestFocus();
            editText4.setEnabled(false);
            if (Build.VERSION.SDK_INT >= 19) {
                file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), "BoxBRApks");
            } else {
                file = new File(Environment.getExternalStorageDirectory() + "/Download", "BoxBRApks");
            }
            if (!file.exists()) {
                file.mkdirs();
            }
            SharedPreferences sharedPreferences = activity.getSharedPreferences("recordingDir", 0);
            if (Build.VERSION.SDK_INT >= 19) {
                file2 = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), "BoxBRApks");
                editText = editText2;
            } else {
                StringBuilder sb = new StringBuilder();
                editText = editText2;
                sb.append(Environment.getExternalStorageDirectory());
                sb.append("/");
                sb.append("Download");
                file2 = new File(sb.toString(), "BoxBRApks");
            }
            editText4.setText(sharedPreferences.getString("recordingDir", String.valueOf(file2)));
            button2.setOnClickListener(new c(this));
            button3.setOnClickListener(new d(this, activity, editText4, sharedPreferences));
            if (button != null) {
                button.setOnClickListener(new View$OnClickListenerC0274e(editText3, activity, str6, editText, editText4));
            }
            f10111f.showAtLocation(inflate, 17, 0, 0);
        }
    }

    public void n0(Context context, String str) {
        if (context != null) {
            SharedPreferences sharedPreferences = context.getSharedPreferences("downloadStatus", 0);
            f10113h = sharedPreferences;
            SharedPreferences.Editor edit = sharedPreferences.edit();
            edit.putString("downloadStatus", str);
            edit.apply();
        }
    }
}