package net.media; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.text.TextUtils; import c.b.a.a.a; import c.e.d.h; import com.player.activity.MyApplication; import java.io.InputStreamReader; import java.io.LineNumberReader; import java.util.Random; public class mpc { public static boolean isLoaded = false; public static mpc mp = null; public static int port = 8523; public mpc() { try { if (!isLoaded) { isLoaded = true; System.loadLibrary("mpc_jni"); if (MPCStart(port, "mis.tvbdo.info", "5000", "5002", 1) != -1) { MPCAddMISBackup("mis-backup.tvbdo.info", "5000", "5002", 1); } } } catch (Exception unused) { } } public static mpc getInstance() { if (mp == null) { mp = new mpc(); } return mp; } public native int MPCAddMISBackup(String str, String str2, String str3, int i); public native int MPCReset(); public native int MPCStart(int i, String str, String str2, String str3, int i2); public native int MPCStop(); public String getPro() { return "hls"; } public String getUrl(String str) { String str2; String substring = str.substring(6); StringBuilder a = a.a("http://127.0.0.1:"); a.append(port); a.append("/"); a.append(substring); a.append(".m3u8?t="); String str3 = ""; try { str2 = new LineNumberReader(new InputStreamReader(Runtime.getRuntime().exec("cat /sys/class/net/eth0/address").getInputStream())).readLine().trim(); } catch (Exception unused) { str2 = str3; } if (TextUtils.isEmpty(str2) || !str2.contains(":")) { str2 = h.c("eth0"); } if (TextUtils.isEmpty(str2)) { str2 = h.c("wlan0"); } if (TextUtils.isEmpty(str2)) { WifiInfo connectionInfo = ((WifiManager) MyApplication.f1989b.getSystemService("wifi")).getConnectionInfo(); if (connectionInfo != null) { String macAddress = connectionInfo.getMacAddress(); if (!TextUtils.isEmpty(macAddress)) { str2 = macAddress.trim(); } } str2 = str3; } if (str2.contains("00:00:00")) { Random random = new Random(); for (int i = 0; i < 8; i++) { int nextInt = random.nextInt(16); StringBuilder a2 = a.a(str3); a2.append("0123456789ABCDEF".charAt(nextInt)); str3 = a2.toString(); } str2 = str3; } a.append(str2.toUpperCase()); a.append("&u=tvb@gmail.com&p=0&resp_mode=1&i=akamai"); return a.toString(); } }