导航菜单

页面标题

页面副标题

jsgt v4.8.1 - c.java 源代码

正在查看: jsgt v4.8.1 应用的 c.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package ne;

import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Build;
import android.os.Environment;
import android.os.Handler;
import android.os.Looper;
import android.os.StatFs;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
import com.meizu.cloud.pushinternal.DebugLogger;
import com.xiaomi.push.service.XMPushService;
import fk.p;
import fk.y0;
import fk.z0;
import gl.i0;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Method;
import java.math.BigInteger;
import java.net.SocketException;
import java.net.SocketTimeoutException;
import java.net.UnknownHostException;
import java.nio.charset.Charset;
import java.security.InvalidKeyException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.text.SimpleDateFormat;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
import java.util.Random;
import javax.crypto.Cipher;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import oj.e;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import qh.c6;
import qh.f5;
import qh.g2;
import qh.g4;
import qh.h5;
import qh.j5;
import qh.k2;
import qh.m6;
import qh.n5;
import qh.o2;
import qh.t2;
import qh.u2;
import qh.v0;
import qh.y5;
import qh.z4;
import te.k0;
import te.x0;
import tv.danmaku.ijk.media.player.IjkMediaMeta;
import tv.danmaku.ijk.media.player.IjkMediaPlayer;

public class c implements com.google.gson.internal.r, h0.c, d4.c, o2, pl.b, x.c, y.a, z1.b {
    public static Method A = null;
    public static Method B = null;
    public static Method C = null;
    public static boolean D = false;
    public static int E = 0;
    public static Method F = null;
    public static Boolean G = null;
    public static Context H = null;
    public static BufferedOutputStream a = null;
    public static final int b = 0;
    public static Class c = null;
    public static String d = "https://ulogs.umeng.com";
    public static String e = "https://ulogs.umengcloud.com";
    public static HashMap f = null;
    public static c g = null;
    public static int h = 0;
    public static volatile int k = -1;
    public static c l = null;
    public static float r = -1.0f;
    public static String s = "";
    public static int t;
    public static boolean u;
    public static boolean v;
    public static Class y;
    public static Class z;
    public static final int[] i = {1, 2, 4, 8, 16, 32, 64, 128};
    public static final String[] j = {"", "A", "AI", "AN", "ANG", "AO", "BA", "BAI", "BAN", "BANG", "BAO", "BEI", "BEN", "BENG", "BI", "BIAN", "BIAO", "BIE", "BIN", "BING", "BO", "BU", "CA", "CAI", "CAN", "CANG", "CAO", "CE", "CEN", "CENG", "CHA", "CHAI", "CHAN", "CHANG", "CHAO", "CHE", "CHEN", "CHENG", "CHI", "CHONG", "CHOU", "CHU", "CHUAI", "CHUAN", "CHUANG", "CHUI", "CHUN", "CHUO", "CI", "CONG", "COU", "CU", "CUAN", "CUI", "CUN", "CUO", "DA", "DAI", "DAN", "DANG", "DAO", "DE", "DENG", "DI", "DIA", "DIAN", "DIAO", "DIE", "DING", "DIU", "DONG", "DOU", "DU", "DUAN", "DUI", "DUN", "DUO", "E", "EI", "EN", "ER", "E^", "FA", "FAN", "FANG", "FEI", "FEN", "FENG", "FO", "FOU", "FU", "GA", "GAI", "GAN", "GANG", "GAO", "GE", "GEI", "GEN", "GENG", "GONG", "GOU", "GU", "GUA", "GUAI", "GUAN", "GUANG", "GUI", "GUN", "GUO", "HA", "HAI", "HAN", "HANG", "HAO", "HE", "HEI", "HEN", "HENG", "HONG", "HOU", "HU", "HUA", "HUAI", "HUAN", "HUANG", "HUI", "HUN", "HUO", "JI", "JIA", "JIAN", "JIANG", "JIAO", "JIE", "JIN", "JING", "JIONG", "JIU", "JU", "JUAN", "JUE", "JUN", "KA", "KAI", "KAN", "KANG", "KAO", "KE", "KEN", "KENG", "KONG", "KOU", "KU", "KUA", "KUAI", "KUAN", "KUANG", "KUI", "KUN", "KUO", "LA", "LAI", "LAN", "LANG", "LAO", "LE", "LEI", "LENG", "LI", "LIA", "LIAN", "LIANG", "LIAO", "LIE", "LIN", "LING", "LIU", "LONG", "LOU", "LU", "LUAN", "LUN", "LUO", "LV", "LVE", "M", "MA", "MAI", "MAN", "MANG", "MAO", "ME", "MEI", "MEN", "MENG", "MI", "MIAN", "MIAO", "MIE", "MIN", "MING", "MIU", "MO", "MOU", "MU", "NA", "NAI", "NAN", "NANG", "NAO", "NE", "NEI", "NEN", "NENG", "NG", "NI", "NIAN", "NIANG", "NIAO", "NIE", "NIN", "NING", "NIU", "NONG", "NOU", "NU", "NUAN", "NUO", "NV", "NVE", "O", "OU", "PA", "PAI", "PAN", "PANG", "PAO", "PEI", "PEN", "PENG", "PI", "PIAN", "PIAO", "PIE", "PIN", "PING", "PO", "POU", "PU", "QI", "QIA", "QIAN", "QIANG", "QIAO", "QIE", "QIN", "QING", "QIONG", "QIU", "QU", "QUAN", "QUE", "QUN", "RAN", "RANG", "RAO", "RE", "REN", "RENG", "RI", "RONG", "ROU", "RU", "RUAN", "RUI", "RUN", "RUO", "SA", "SAI", "SAN", "SANG", "SAO", "SE", "SEN", "SENG", "SHA", "SHAI", "SHAN", "SHANG", "SHAO", "SHE", "SHEI", "SHEN", "SHENG", "SHI", "SHOU", "SHU", "SHUA", "SHUAI", "SHUAN", "SHUANG", "SHUI", "SHUN", "SHUO", "SI", "SONG", "SOU", "SU", "SUAN", "SUI", "SUN", "SUO", "TA", "TAI", "TAN", "TANG", "TAO", "TE", "TENG", "TI", "TIAN", "TIAO", "TIE", "TING", "TONG", "TOU", "TU", "TUAN", "TUI", "TUN", "TUO", "WA", "WAI", "WAN", "WANG", "WEI", "WEN", "WENG", "WO", "WU", "XI", "XIA", "XIAN", "XIANG", "XIAO", "XIE", "XIN", "XING", "XIONG", "XIU", "XU", "XUAN", "XUE", "XUN", "YA", "YAN", "YANG", "YAO", "YE", "YI", "YIAO", "YIN", "YING", "YO", "YONG", "YOU", "YU", "YUAN", "YUE", "YUN", "ZA", "ZAI", "ZAN", "ZANG", "ZAO", "ZE", "ZEI", "ZEN", "ZENG", "ZHA", "ZHAI", "ZHAN", "ZHANG", "ZHAO", "ZHE", "ZHEI", "ZHEN", "ZHENG", "ZHI", "ZHONG", "ZHOU", "ZHU", "ZHUA", "ZHUAI", "ZHUAN", "ZHUANG", "ZHUI", "ZHUN", "ZHUO", "ZI", "ZONG", "ZOU", "ZU", "ZUAN", "ZUI", "ZUN", "ZUO"};
    public static final la.c m = new la.c("CONDITION_FALSE");
    public static final int[] w = {2130969904, 2130969905, 2130969906};
    public static final int[] x = {2130969907, 2130969908, 2130969909, 2130969910, 2130969911, 2130969912, 2130969913, 2130969914, 2130969915, 2130969916, 2130969917, 2130969918, 2130969919};

    public c() {
    }

    public static void A(Context context, vd.f fVar, String... strArr) {
        if (D) {
            S(context, fVar);
            try {
                B.invoke(z, context, "requireApi", strArr);
            } catch (Exception e2) {
                de.a.c("OpenConfig", "trackCustomEvent exception: " + e2.toString());
            }
        }
    }

    public static void B(String str, Context context, y5 y5Var, int i2) {
        h5 h5Var;
        if (context == null || (h5Var = y5Var.a) == null) {
            return;
        }
        int i3 = h5Var.a;
        int i4 = i3 > 0 ? i3 + 1000 : -1;
        if (i2 <= 0) {
            byte[] c2 = m6.c(y5Var);
            i2 = c2 != null ? c2.length : 0;
        }
        y(i4, i2, context, str);
    }

    public static void C(java.lang.String r2, android.content.Context r3, qh.n6 r4, qh.h5 r5, int r6) {
        throw new UnsupportedOperationException("Method not decompiled: ne.c.C(java.lang.String, android.content.Context, qh.n6, qh.h5, int):void");
    }

    public static void D(String str, String str2, Object... objArr) {
        if (h >= 1) {
            DebugLogger.e(androidx.appcompat.graphics.drawable.a.h("PushTracker->", str), r(str2, objArr));
        }
    }

    public static void E(String str, HashMap hashMap) {
        BufferedWriter bufferedWriter;
        Exception e2;
        if (TextUtils.isEmpty(str) || hashMap.size() == 0) {
            return;
        }
        File file = new File(str);
        if (file.exists()) {
            file.delete();
        }
        BufferedWriter bufferedWriter2 = null;
        try {
            bufferedWriter = new BufferedWriter(new FileWriter(file));
            try {
                try {
                    for (String str2 : hashMap.keySet()) {
                        bufferedWriter.write(str2 + "%%%" + ((String) hashMap.get(str2)));
                        bufferedWriter.newLine();
                    }
                } catch (Exception e3) {
                    e2 = e3;
                    lh.b.h(e2);
                    v0.q(bufferedWriter);
                }
            } catch (Throwable th2) {
                th = th2;
                bufferedWriter2 = bufferedWriter;
                v0.q(bufferedWriter2);
                throw th;
            }
        } catch (Exception e4) {
            bufferedWriter = null;
            e2 = e4;
        } catch (Throwable th3) {
            th = th3;
            v0.q(bufferedWriter2);
            throw th;
        }
        v0.q(bufferedWriter);
    }

    public static void F(HashMap hashMap, String str, long j2, long j3) {
        StringBuilder sb;
        String str2 = (String) hashMap.get(str);
        if (TextUtils.isEmpty(str2)) {
            sb = new StringBuilder();
        } else {
            long[] J = J(str2);
            if (J != null) {
                long j4 = J[0];
                if (j4 > 0) {
                    long j5 = J[1];
                    if (j5 >= 0) {
                        j2 += j4;
                        j3 += j5;
                        sb = new StringBuilder();
                    }
                }
            }
            sb = new StringBuilder();
        }
        sb.append(j2);
        sb.append("#");
        sb.append(j3);
        hashMap.put(str, sb.toString());
    }

    public static void G(JSONObject jSONObject, boolean z2) {
        if (!z2 && jSONObject.has("sessions")) {
            jSONObject.remove("sessions");
        }
        if (jSONObject.has("active_user")) {
            jSONObject.remove("active_user");
        }
        if (jSONObject.has(IjkMediaPlayer.OnNativeInvokeListener.ARG_ERROR)) {
            jSONObject.remove(IjkMediaPlayer.OnNativeInvokeListener.ARG_ERROR);
        }
        if (jSONObject.has("ekv")) {
            jSONObject.remove("ekv");
        }
        if (jSONObject.has("gkv")) {
            jSONObject.remove("gkv");
        }
        if (jSONObject.has("active_user")) {
            jSONObject.remove("active_user");
        }
        if (jSONObject.has("userlevel")) {
            jSONObject.remove("userlevel");
        }
    }

    public static boolean H(ArrayList arrayList) {
        return arrayList == null || arrayList.isEmpty();
    }

    public static byte[] I(String str) {
        try {
            return str.getBytes("UTF-8");
        } catch (UnsupportedEncodingException unused) {
            return str.getBytes();
        }
    }

    public static long[] J(String str) {
        long[] jArr = new long[2];
        try {
            String[] split = str.split("#");
            if (split.length >= 2) {
                jArr[0] = Long.parseLong(split[0].trim());
                jArr[1] = Long.parseLong(split[1].trim());
            }
            return jArr;
        } catch (Exception e2) {
            lh.b.h(e2);
            return null;
        }
    }

    public static String K(String str) {
        if (TextUtils.isEmpty(str)) {
            return "";
        }
        try {
            MessageDigest messageDigest = MessageDigest.getInstance("MD5");
            messageDigest.update(I(str));
            return String.format("%1$032X", new BigInteger(1, messageDigest.digest()));
        } catch (NoSuchAlgorithmException unused) {
            return str;
        }
    }

    public static String L(String str) {
        if (TextUtils.isEmpty(str)) {
            return "";
        }
        StringBuilder sb = new StringBuilder();
        int length = str.length();
        int i2 = 3;
        if (length < 3) {
            int i3 = length / 3;
            if (i3 <= 1) {
                i3 = 1;
            }
            if (i3 <= 3) {
                i2 = i3;
            }
        }
        int i4 = 0;
        while (i4 < length) {
            int i5 = i4 + 1;
            if (i5 % i2 == 0) {
                sb.append("*");
            } else {
                sb.append(str.charAt(i4));
            }
            i4 = i5;
        }
        return sb.toString();
    }

    public static final void M(Throwable th2, Throwable exception) {
        kotlin.jvm.internal.i.f(th2, "<this>");
        kotlin.jvm.internal.i.f(exception, "exception");
        if (th2 != exception) {
            tj.b.a.a(th2, exception);
        }
    }

    public static void N(Handler handler) {
        if (Looper.myLooper() != handler.getLooper()) {
            throw new IllegalStateException("Must be called on the handler thread");
        }
    }

    public static de.f O() {
        String externalStorageState = Environment.getExternalStorageState();
        if (!("mounted".equals(externalStorageState) || "mounted_ro".equals(externalStorageState))) {
            return null;
        }
        File externalStorageDirectory = Environment.getExternalStorageDirectory();
        de.f fVar = new de.f();
        fVar.a = externalStorageDirectory;
        StatFs statFs = new StatFs(externalStorageDirectory.getAbsolutePath());
        long blockSize = statFs.getBlockSize();
        long blockCount = statFs.getBlockCount();
        long availableBlocks = statFs.getAvailableBlocks();
        fVar.b = blockCount * blockSize;
        fVar.c = availableBlocks * blockSize;
        return fVar;
    }

    public static String P(String str) {
        if (TextUtils.isEmpty(str)) {
            return "";
        }
        StringBuffer stringBuffer = new StringBuffer();
        if (str.length() >= 48) {
            stringBuffer.append(str.substring(0, 6));
            stringBuffer.append(str.substring(12, 16));
            stringBuffer.append(str.substring(26, 32));
            stringBuffer.append(str.substring(48));
        }
        return stringBuffer.toString();
    }

    public static String Q(byte[] bArr) {
        if (bArr == null || bArr.length <= 0) {
            return null;
        }
        try {
            return new String(bArr, "UTF-8");
        } catch (UnsupportedEncodingException unused) {
            return new String(bArr);
        }
    }

    public static JSONArray R() {
        JSONArray jSONArray = new JSONArray();
        try {
            long currentTimeMillis = System.currentTimeMillis();
            JSONObject jSONObject = new JSONObject();
            x0 c2 = x0.c();
            Context a2 = ef.a.a(null);
            c2.getClass();
            jSONObject.put("id", x0.b(a2));
            jSONObject.put("start_time", currentTimeMillis);
            jSONObject.put("end_time", currentTimeMillis + 60000);
            jSONObject.put("duration", 60000L);
            jSONArray.put(jSONObject);
        } catch (JSONException unused) {
        }
        return jSONArray;
    }

    public static void S(Context context, vd.f fVar) {
        try {
            if (ee.h.b(context, fVar.a).e("Common_ta_enable")) {
                C.invoke(y, Boolean.TRUE);
            } else {
                C.invoke(y, Boolean.FALSE);
            }
        } catch (Exception e2) {
            de.a.c("OpenConfig", "checkStatStatus exception: " + e2.toString());
        }
    }

    public static void T(String str, String str2, Object... objArr) {
        if (h >= 2) {
            DebugLogger.d(androidx.appcompat.graphics.drawable.a.h("PushTracker->", str), r(str2, objArr));
        }
    }

    public static String U(String str) {
        if (str == null) {
            return null;
        }
        try {
            MessageDigest messageDigest = MessageDigest.getInstance("SHA1");
            messageDigest.update(I(str));
            return String.format("%1$032X", new BigInteger(1, messageDigest.digest()));
        } catch (NoSuchAlgorithmException unused) {
            return str;
        }
    }

    public static void V(String str, String str2, Object... objArr) {
        if (h >= 3) {
            DebugLogger.i(androidx.appcompat.graphics.drawable.a.h("PushTracker->", str), r(str2, objArr));
        }
    }

    public static void W(long j2) {
        if (j2 < 0 || j2 > 2147483647L) {
            throw new i0(j2);
        }
    }

    public static void X(Object obj, String str) {
        if (obj == null) {
            throw new NullPointerException(str);
        }
    }

    public static final e.a Y(Throwable exception) {
        kotlin.jvm.internal.i.f(exception, "exception");
        return new e.a(exception);
    }

    public static byte[] Z(String str, String str2) {
        try {
            byte[] d0 = d0(str, str2);
            String format = String.format("%03d", Integer.valueOf(d0.length));
            byte[] bArr = new byte[d0.length + 3];
            bArr[0] = (byte) format.charAt(0);
            bArr[1] = (byte) format.charAt(1);
            bArr[2] = (byte) format.charAt(2);
            System.arraycopy(d0, 0, bArr, 3, d0.length);
            return bArr;
        } catch (Exception unused) {
            return null;
        }
    }

    public static void a0(Context context, vd.f fVar) {
        if (!TextUtils.isEmpty(fVar.c)) {
            ce.f a2 = ce.f.a();
            String str = fVar.c;
            a2.getClass();
            ce.f.d(str, fVar.a, "11", "0");
        }
        if (D) {
            S(context, fVar);
            String str2 = fVar.c;
            if (str2 != null) {
                try {
                    A.invoke(z, context, str2);
                } catch (Exception e2) {
                    de.a.c("OpenConfig", "reportQQ exception: " + e2.toString());
                }
            }
        }
    }

    public static short b0(byte[] bArr, byte[] bArr2, int i2) {
        int i3 = i2 % 8;
        short s2 = (short) (bArr2[i2] & 255);
        return (bArr[i2 / 8] & i[i3]) != 0 ? (short) (s2 | 256) : s2;
    }

    public static byte[] c0(String str, String str2) {
        try {
            byte[] bytes = str2.getBytes("UTF-8");
            Cipher cipher = Cipher.getInstance("RC4");
            cipher.init(1, new SecretKeySpec(str.getBytes("UTF-8"), "RC4"));
            return cipher.update(bytes);
        } catch (Throwable th2) {
            Log.e("LOG_FILE", "encrypt exception:" + th2.getMessage());
            return null;
        }
    }

    public static byte[] d0(String str, String str2) {
        try {
            byte[] bytes = str2.getBytes("UTF-8");
            Cipher cipher = Cipher.getInstance("RC4");
            cipher.init(1, new SecretKeySpec(str.getBytes("UTF-8"), "RC4"));
            return cipher.update(bytes);
        } catch (Throwable th2) {
            Log.e("LOG_FILE", "encrypt exception:" + th2.getMessage());
            return null;
        }
    }

    public static void e0() {
        if (Thread.currentThread() != Looper.getMainLooper().getThread()) {
            throw new IllegalStateException("You must only modify the ObservableList on the main thread.");
        }
    }

    public static void f0(String str) {
        for (String str2 : f.keySet()) {
            if (!str2.equals(str)) {
                ((Activity) f.get(str2)).finish();
            }
        }
    }

    public static Context g0(Context context) {
        String str;
        if (G == null) {
            try {
                String str2 = "unknow";
                boolean z2 = yf.l.a;
                boolean z3 = true;
                try {
                    str = (String) Class.forName("android.os.SystemProperties").getMethod("get", String.class).invoke(null, "ro.crypto.type");
                } catch (Exception e2) {
                    e2.printStackTrace();
                    str = "unknow";
                }
                if (str != null && str.length() != 0) {
                    str2 = str;
                }
                if (!"file".equals(str2)) {
                    z3 = false;
                }
                G = Boolean.valueOf(z3);
                yf.p.g("ContextDelegate", "mIsFbeProject = " + G.toString());
            } catch (Exception e3) {
                yf.p.b("ContextDelegate", "mIsFbeProject = " + e3.getMessage());
            }
        }
        Boolean bool = G;
        if ((bool == null ? false : bool.booleanValue()) && context != null) {
            Context context2 = H;
            if (context2 != null) {
                return context2;
            }
            try {
                if (F == null) {
                    F = Context.class.getMethod("createCredentialProtectedStorageContext", new Class[0]);
                }
                context = (Context) F.invoke(context, new Object[0]);
            } catch (Exception e4) {
                e4.printStackTrace();
            }
            H = context;
        }
        return context;
    }

    public static c h0() {
        if (g == null) {
            g = new c(5);
        }
        if (f == null) {
            f = new HashMap();
        }
        return g;
    }

    public static c i0() {
        if (l == null) {
            l = new c();
        }
        return l;
    }

    public static int j0(char c2) {
        int i2 = c2 - 19968;
        return (i2 < 0 || i2 >= 7000) ? (7000 > i2 || i2 >= 14000) ? b0(v0.j, v0.k, i2 - 14000) : b0(a0.c.D0, a0.c.E0, i2 - 7000) : b0(b7.b.s, b7.b.t, i2);
    }

    public static String k0(long j2) {
        Calendar calendar = Calendar.getInstance();
        Calendar calendar2 = Calendar.getInstance();
        calendar2.setTimeInMillis(j2);
        int i2 = calendar.get(1);
        int i3 = calendar.get(2);
        int i4 = calendar.get(5);
        int i5 = calendar.get(11);
        int i6 = calendar.get(12);
        int i7 = calendar2.get(1);
        int i8 = calendar2.get(2);
        int i9 = calendar2.get(5);
        int i10 = calendar2.get(11);
        int i11 = calendar2.get(12);
        if (i2 - i7 > 0) {
            return "很久以前";
        }
        int i12 = i3 - i8;
        if (i12 > 0) {
            return aa.a.j(i12, "月前");
        }
        int i13 = i4 - i9;
        if (i13 > 0) {
            return aa.a.j(i13, "天前");
        }
        int i14 = i5 - i10;
        if (i14 > 0) {
            return aa.a.j(i14, "小时前");
        }
        int i15 = i6 - i11;
        return i15 > 0 ? aa.a.j(i15, "分前") : "刚刚";
    }

    public static int l(Throwable th2) {
        Throwable th3;
        boolean z2 = th2 instanceof g4;
        if (z2 && (th3 = ((g4) th2).b) != null) {
            th2 = th3;
        }
        String message = th2.getMessage();
        if (th2.getCause() != null) {
            message = th2.getCause().getMessage();
        }
        if (th2 instanceof SocketTimeoutException) {
            return 105;
        }
        if (!(th2 instanceof SocketException)) {
            if (th2 instanceof UnknownHostException) {
                return 107;
            }
            return z2 ? 399 : 0;
        }
        if (message.indexOf("Network is unreachable") != -1) {
            return 102;
        }
        if (message.indexOf("Connection refused") != -1) {
            return 103;
        }
        if (message.indexOf("Connection timed out") != -1) {
            return 105;
        }
        if (message.endsWith("EACCES (Permission denied)")) {
            return 101;
        }
        if (message.indexOf("Connection reset by peer") != -1) {
            return 109;
        }
        if (message.indexOf("Broken pipe") != -1) {
            return IjkMediaMeta.FF_PROFILE_H264_HIGH_10;
        }
        if (message.indexOf("No route to host") != -1) {
            return 104;
        }
        return message.endsWith("EINVAL (Invalid argument)") ? 106 : 199;
    }

    public static String l0(long j2) {
        Calendar calendar = Calendar.getInstance();
        Calendar calendar2 = Calendar.getInstance();
        calendar2.setTimeInMillis(j2);
        int i2 = calendar.get(1);
        int i3 = calendar.get(2);
        int i4 = calendar.get(5);
        int i5 = calendar.get(11);
        int i6 = calendar.get(12);
        int i7 = calendar2.get(1);
        int i8 = calendar2.get(2);
        int i9 = calendar2.get(5);
        int i10 = calendar2.get(11);
        int i11 = calendar2.get(12);
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        if (i2 - i7 > 0) {
            return simpleDateFormat.format(new Date(j2));
        }
        if (i3 - i8 > 0) {
            return simpleDateFormat.format(new Date(j2));
        }
        int i12 = i4 - i9;
        if (i12 > 7) {
            return simpleDateFormat.format(new Date(j2));
        }
        if (i12 > 0) {
            return aa.a.j(i12, "天前");
        }
        int i13 = i5 - i10;
        if (i13 > 0) {
            return aa.a.j(i13, "小时前");
        }
        int i14 = i6 - i11;
        return i14 > 0 ? aa.a.j(i14, "分前") : "刚刚";
    }

    public static long m(JSONObject jSONObject) {
        return jSONObject.toString().getBytes().length;
    }

    public static SimpleDateFormat m0(int i2, int i3) {
        String str;
        String str2;
        StringBuilder sb = new StringBuilder();
        if (i2 == 0) {
            str = "EEEE, MMMM d, yyyy";
        } else if (i2 == 1) {
            str = "MMMM d, yyyy";
        } else if (i2 == 2) {
            str = "MMM d, yyyy";
        } else {
            if (i2 != 3) {
                throw new IllegalArgumentException(android.support.v4.media.a.f("Unknown DateFormat style: ", i2));
            }
            str = "M/d/yy";
        }
        sb.append(str);
        sb.append(" ");
        if (i3 == 0 || i3 == 1) {
            str2 = "h:mm:ss a z";
        } else if (i3 == 2) {
            str2 = "h:mm:ss a";
        } else {
            if (i3 != 3) {
                throw new IllegalArgumentException(android.support.v4.media.a.f("Unknown DateFormat style: ", i3));
            }
            str2 = "h:mm a";
        }
        sb.append(str2);
        return new SimpleDateFormat(sb.toString(), Locale.US);
    }

    public static String n(int i2) {
        Random random = new Random();
        StringBuffer stringBuffer = new StringBuffer();
        for (int i3 = 0; i3 < i2; i3++) {
            stringBuffer.append("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(random.nextInt(62)));
        }
        return stringBuffer.toString();
    }

    public static final void n0(qj.f fVar, Throwable th2) {
        try {
            fk.p pVar = (fk.p) fVar.get(p.a.a);
            if (pVar == null) {
                fk.q.a(fVar, th2);
            } else {
                pVar.handleException(fVar, th2);
            }
        } catch (Throwable th3) {
            if (th2 != th3) {
                RuntimeException runtimeException = new RuntimeException("Exception while trying to handle coroutine exception", th3);
                M(runtimeException, th2);
                th2 = runtimeException;
            }
            fk.q.a(fVar, th2);
        }
    }

    public static String o(Context context) {
        boolean z2;
        String deviceId;
        if (!TextUtils.isEmpty(s)) {
            return s;
        }
        String j2 = v0.j("ro.target.product");
        if (TextUtils.isEmpty(j2)) {
            DebugLogger.i("DeviceUtils", "current product is phone");
            z2 = true;
        } else {
            DebugLogger.i("DeviceUtils", "current product is " + j2);
            z2 = false;
        }
        String str = null;
        if (z2) {
            try {
                pb.c d2 = new pb.b(new pb.a("android.telephony.MzTelephonyManager"), "getDeviceId", new Class[0]).d(new Object[0]);
                if (!d2.a || TextUtils.isEmpty((CharSequence) d2.b)) {
                    TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService("phone");
                    if (telephonyManager != null) {
                        deviceId = telephonyManager.getDeviceId();
                    }
                } else {
                    deviceId = (String) d2.b;
                }
                str = deviceId;
            } catch (Exception e2) {
                e2.printStackTrace();
            }
        } else {
            String str2 = Build.SERIAL;
            DebugLogger.i("DeviceUtils", "device serial " + str2);
            if (!TextUtils.isEmpty(str2)) {
                DebugLogger.e("DeviceUtils", "mac address null");
                if (!TextUtils.isEmpty(null)) {
                    throw null;
                }
            }
        }
        s = str;
        return s;
    }

    public static final int o0(int i2) {
        if (i2 < 0) {
            return i2;
        }
        if (i2 < 3) {
            return i2 + 1;
        }
        if (i2 < 1073741824) {
            return (int) ((i2 / 0.75f) + 1.0f);
        }
        return Integer.MAX_VALUE;
    }

    public static String p(String str) {
        if (TextUtils.isEmpty(str)) {
            return "";
        }
        StringBuffer stringBuffer = new StringBuffer();
        if (str.length() >= 48) {
            stringBuffer.append(str.substring(6, 12));
            stringBuffer.append(str.substring(16, 26));
            stringBuffer.append(str.substring(32, 48));
        }
        return stringBuffer.toString();
    }

    public static final void p0(fk.y yVar, qj.d dVar, boolean z2) {
        Object f2 = yVar.f();
        Throwable c2 = yVar.c(f2);
        Object Y = c2 != null ? Y(c2) : yVar.d(f2);
        if (!z2) {
            dVar.resumeWith(Y);
            return;
        }
        kotlinx.coroutines.internal.b bVar = (kotlinx.coroutines.internal.b) dVar;
        qj.d<T> dVar2 = bVar.e;
        qj.f context = dVar2.getContext();
        Object b2 = kotlinx.coroutines.internal.o.b(context, bVar.g);
        y0 v0 = b2 != kotlinx.coroutines.internal.o.a ? v0(dVar2, context) : null;
        try {
            bVar.e.resumeWith(Y);
            oj.h hVar = oj.h.a;
            if (v0 != null) {
                throw null;
            }
            kotlinx.coroutines.internal.o.a(context, b2);
        } catch (Throwable th2) {
            if (v0 != null) {
                throw null;
            }
            kotlinx.coroutines.internal.o.a(context, b2);
            throw th2;
        }
    }

    public static String q(String str, String str2) {
        if (TextUtils.isEmpty(str) || TextUtils.isEmpty(str2)) {
            return "";
        }
        StringBuffer stringBuffer = new StringBuffer();
        if (str2.length() >= 16 && str.length() >= 16) {
            stringBuffer.append(str2.substring(0, 6));
            stringBuffer.append(str.substring(0, 6));
            stringBuffer.append(str2.substring(6, 10));
            stringBuffer.append(str.substring(6, 16));
            stringBuffer.append(str2.substring(10, 16));
            stringBuffer.append(str.substring(16));
            stringBuffer.append(str2.substring(16));
        }
        return stringBuffer.toString();
    }

    public static final long q0(long r23, long r25, long r27, java.lang.String r29) {
        throw new UnsupportedOperationException("Method not decompiled: ne.c.q0(long, long, long, java.lang.String):long");
    }

    public static String r(String str, Object... objArr) {
        return Thread.currentThread().getName() + "|" + String.format(str, objArr);
    }

    public static int r0(String str, int i2, int i3, int i4, int i5) {
        if ((i5 & 4) != 0) {
            i3 = 1;
        }
        if ((i5 & 8) != 0) {
            i4 = Integer.MAX_VALUE;
        }
        return (int) q0(i2, i3, i4, str);
    }

    public static String s(Collection collection) {
        Iterator it2;
        Object next;
        if (collection == null || (it2 = collection.iterator()) == null) {
            return null;
        }
        if (!it2.hasNext()) {
            return "";
        }
        Object next2 = it2.next();
        if (!it2.hasNext()) {
            return next2.toString();
        }
        StringBuffer stringBuffer = new StringBuffer(256);
        if (next2 == null) {
            stringBuffer.append(next2);
            while (it2.hasNext()) {
                stringBuffer.append(",");
                next = it2.next();
                if (next != null) {
                }
            }
            return stringBuffer.toString();
        }
        stringBuffer.append(next);
    }

    public static final void s0(Object obj) {
        if (obj instanceof e.a) {
            throw ((e.a) obj).a;
        }
    }

    public static String t(mh.c cVar) {
        return cVar.a + "#" + cVar.b + "#" + cVar.c + "#" + cVar.h;
    }

    public static String t0(String str) {
        if (str == null || str.length() == 0) {
            return str;
        }
        StringBuffer stringBuffer = new StringBuffer();
        for (int i2 = 0; i2 < str.length(); i2++) {
            char charAt = str.charAt(i2);
            stringBuffer.append((19968 <= charAt && charAt <= 40869 && j0(charAt) > 0) || 12295 == charAt ? charAt == 12295 ? "LING" : j[j0(charAt)] : String.valueOf(charAt));
            if (i2 != str.length() - 1) {
                stringBuffer.append("");
            }
        }
        return stringBuffer.toString();
    }

    public static HashMap u(String str) {
        HashMap hashMap = new HashMap();
        if (TextUtils.isEmpty(str) || !new File(str).exists()) {
            return hashMap;
        }
        BufferedReader bufferedReader = null;
        ?? r1 = 0;
        BufferedReader bufferedReader2 = null;
        try {
            try {
                BufferedReader bufferedReader3 = new BufferedReader(new FileReader(str));
                while (true) {
                    try {
                        String readLine = bufferedReader3.readLine();
                        if (readLine == null) {
                            break;
                        }
                        ?? split = readLine.split("%%%");
                        r1 = split.length;
                        if (r1 >= 2) {
                            r1 = 0;
                            r1 = 0;
                            if (!TextUtils.isEmpty(split[0]) && !TextUtils.isEmpty(split[1])) {
                                r1 = split[0];
                                hashMap.put(r1, split[1]);
                            }
                        }
                    } catch (Exception e2) {
                        e = e2;
                        bufferedReader2 = bufferedReader3;
                        lh.b.h(e);
                        v0.q(bufferedReader2);
                        bufferedReader = bufferedReader2;
                        return hashMap;
                    } catch (Throwable th2) {
                        th = th2;
                        bufferedReader = bufferedReader3;
                        v0.q(bufferedReader);
                        throw th;
                    }
                }
                v0.q(bufferedReader3);
                bufferedReader = r1;
            } catch (Throwable th3) {
                th = th3;
            }
        } catch (Exception e3) {
            e = e3;
        }
        return hashMap;
    }

    public static final Map u0(Map map) {
        Map.Entry entry = (Map.Entry) map.entrySet().iterator().next();
        Map singletonMap = Collections.singletonMap(entry.getKey(), entry.getValue());
        kotlin.jvm.internal.i.e(singletonMap, "with(entries.iterator().…ingletonMap(key, value) }");
        return singletonMap;
    }

    public static mh.c v(String str) {
        mh.c cVar = null;
        try {
            String[] split = TextUtils.isEmpty(str) ? null : str.split("#");
            if (split == null || split.length < 4 || TextUtils.isEmpty(split[0]) || TextUtils.isEmpty(split[1]) || TextUtils.isEmpty(split[2]) || TextUtils.isEmpty(split[3])) {
                return null;
            }
            mh.c cVar2 = new mh.c();
            try {
                cVar2.a = Integer.parseInt(split[0]);
                cVar2.b = split[1];
                cVar2.c = Integer.parseInt(split[2]);
                cVar2.h = Integer.parseInt(split[3]);
                return cVar2;
            } catch (Exception unused) {
                cVar = cVar2;
                lh.b.n("parse per key error");
                return cVar;
            }
        } catch (Exception unused2) {
        }
    }

    public static final y0 v0(qj.d dVar, qj.f fVar) {
        y0 y0Var;
        if (!(dVar instanceof sj.d)) {
            return null;
        }
        if (!(fVar.get(z0.a) != null)) {
            return null;
        }
        sj.d dVar2 = (sj.d) dVar;
        while (!(dVar2 instanceof fk.x) && (dVar2 = dVar2.getCallerFrame()) != null) {
            if (dVar2 instanceof y0) {
                y0Var = (y0) dVar2;
                break;
            }
        }
        y0Var = null;
        if (y0Var == null) {
            return y0Var;
        }
        throw null;
    }

    public static JSONObject w(Context context, long j2, JSONObject jSONObject) {
        JSONObject jSONObject2 = new JSONObject();
        try {
            if (!jSONObject.has("content")) {
                return jSONObject2;
            }
            JSONObject jSONObject3 = jSONObject.getJSONObject("content");
            if (jSONObject3.has("analytics")) {
                JSONObject jSONObject4 = jSONObject3.getJSONObject("analytics");
                if (jSONObject4.has("ekv")) {
                    jSONObject4.remove("ekv");
                }
                if (jSONObject4.has("gkv")) {
                    jSONObject4.remove("gkv");
                }
                if (jSONObject4.has(IjkMediaPlayer.OnNativeInvokeListener.ARG_ERROR)) {
                    jSONObject4.remove(IjkMediaPlayer.OnNativeInvokeListener.ARG_ERROR);
                }
                jSONObject3.put("analytics", jSONObject4);
            }
            jSONObject2.put("content", jSONObject3);
            if (jSONObject.has("header")) {
                jSONObject2.put("header", jSONObject.getJSONObject("header"));
            }
            if (m(jSONObject2) <= j2) {
                return jSONObject2;
            }
            try {
                k0.b(context).getClass();
                k0.q();
                k0.b(context).p();
                k0.b(context).k(true, false);
                k0.b(context).a.clear();
                v0.j0("MobclickRT", "--->>> u-app packet overload !!! ");
            } catch (Throwable unused) {
            }
            return null;
        } catch (Throwable unused2) {
            return jSONObject2;
        }
    }

    public static synchronized void w0(java.io.File r6, java.lang.String r7, byte[] r8, java.lang.String r9) {
        throw new UnsupportedOperationException("Method not decompiled: ne.c.w0(java.io.File, java.lang.String, byte[], java.lang.String):void");
    }

    public static z5.a x(Context context) {
        z5.a aVar = ((y5.a) y5.c.i(context.getPackageName())).a;
        return aVar != null ? aVar : ((y5.a) y5.b.h(context.getPackageName())).a;
    }

    public static void y(int i2, int i3, Context context, String str) {
        int i4;
        ConnectivityManager connectivityManager;
        if (i2 <= 0 || i3 <= 0) {
            return;
        }
        int i5 = -1;
        if (z4.b == -1) {
            try {
                connectivityManager = (ConnectivityManager) context.getSystemService("connectivity");
            } catch (Exception unused) {
            }
            if (connectivityManager != null) {
                NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
                if (activeNetworkInfo != null) {
                    i4 = activeNetworkInfo.getType();
                    z4.b = i4;
                }
            }
            i4 = -1;
            z4.b = i4;
        }
        int i6 = z4.b;
        if (-1 != i6) {
            i5 = (i3 * (i6 == 0 ? 13 : 11)) / 10;
        }
        if (i2 != t2.a(n5.UploadTinyData)) {
            u2 b2 = u2.b(context.getApplicationContext());
            long j2 = i5;
            b2.getClass();
            if (i2 < 0 || j2 < 0) {
                return;
            }
            mh.c cVar = new mh.c();
            cVar.a = 1000;
            cVar.c = 1000;
            cVar.b = "P100000";
            cVar.h = i2;
            cVar.i = 1L;
            cVar.j = j2;
            cVar.f = str;
            cVar.g = "5_3_0-C";
            b2.h(cVar);
        }
    }

    public void a(Bitmap bitmap, Bitmap bitmap2) {
    }

    @Override
    public boolean apply(String str) {
        return (TextUtils.isEmpty(str) || str.toLowerCase().endsWith(".gif")) ? false : true;
    }

    public boolean b(Context context, Bitmap bitmap, float f2) {
        return false;
    }

    public String c(String str, String str2) {
        if (TextUtils.isEmpty(str) || TextUtils.isEmpty(str2)) {
            return "";
        }
        try {
            return d(str, str2.getBytes("UTF-8"));
        } catch (UnsupportedEncodingException unused) {
            return "";
        }
    }

    public String d(String str, byte[] bArr) {
        if (bArr != null && bArr.length != 0) {
            SecretKeySpec secretKeySpec = new SecretKeySpec(str.getBytes(Charset.forName("UTF-8")), "HmacSHA256");
            try {
                Mac mac = Mac.getInstance(secretKeySpec.getAlgorithm());
                mac.init(secretKeySpec);
                return b5.a.s(mac.doFinal(bArr));
            } catch (InvalidKeyException | NoSuchAlgorithmException unused) {
            }
        }
        return "";
    }

    public String e(String str) {
        int lastIndexOf = str.lastIndexOf(46);
        String substring = (lastIndexOf == -1 || lastIndexOf <= str.lastIndexOf(47) || (lastIndexOf + 2) + 4 <= str.length()) ? "" : str.substring(lastIndexOf + 1, str.length());
        try {
            byte[] digest = MessageDigest.getInstance("MD5").digest(str.getBytes());
            StringBuffer stringBuffer = new StringBuffer();
            for (byte b2 : digest) {
                stringBuffer.append(String.format("%02x", Byte.valueOf(b2)));
            }
            String stringBuffer2 = stringBuffer.toString();
            return TextUtils.isEmpty(substring) ? stringBuffer2 : aa.a.m(stringBuffer2, ".", substring);
        } catch (NoSuchAlgorithmException e2) {
            throw new IllegalStateException(e2);
        }
    }

    @Override
    public void f(Context context, HashMap hashMap) {
        c6 c6Var = new c6();
        c6Var.d = k2.a(context).c;
        c6Var.i = k2.a(context).d;
        c6Var.e = "awake_app_response";
        c6Var.c = a0.c.c();
        c6Var.h = hashMap;
        byte[] c2 = m6.c(com.xiaomi.push.service.j.d(c6Var.i, c6Var.d, c6Var, h5.Notification, true));
        if (!(context instanceof XMPushService)) {
            lh.b.d("MoleInfo : context is not correct in pushLayer " + c6Var.c);
        } else {
            lh.b.d("MoleInfo : send data directly in pushLayer " + c6Var.c);
            ((XMPushService) context).a(context.getPackageName(), c2, true);
        }
    }

    @Override
    public void g(Context context, HashMap hashMap) {
        lh.b.d("MoleInfo:\u3000" + g2.b(hashMap));
    }

    public HashMap h() {
        return new HashMap();
    }

    @Override
    public void i(Context context, HashMap hashMap) {
        f5 a2 = f5.a(context);
        if (a2 != null) {
            String a3 = g2.a(hashMap);
            Context context2 = a2.a;
            String packageName = context2.getPackageName();
            String packageName2 = context2.getPackageName();
            j5 j5Var = new j5();
            j5Var.g = "category_awake_app";
            j5Var.c = "wake_up_app";
            j5Var.a(1L);
            j5Var.b = a3;
            j5Var.f = true;
            j5Var.l.set(2, true);
            j5Var.a = "push_sdk_channel";
            j5Var.h = packageName2;
            a2.b(j5Var, packageName);
        }
    }

    public String j(String str, String str2) {
        return "";
    }

    public Object k() {
        return new ArrayDeque();
    }

    public void release() {
    }

    public synchronized void z(Context context, int i2, Throwable th2) {
        String str;
        StringBuilder sb;
        e.a("TbsCoreLoadStat", "[loadError] errorCode: " + i2 + ", details:" + String.valueOf(th2));
        if (k == -1) {
            k = i2;
            String.valueOf(th2);
            je.h.h(context).k(i2, th2);
            str = "TbsCoreLoadStat";
            sb = new StringBuilder();
            sb.append(k);
            sb.append(" report success!");
        } else {
            str = "TbsCoreLoadStat";
            sb = new StringBuilder();
            sb.append(k);
            sb.append(" is reported, others will be saved in local TbsLog!");
        }
        e.c(str, sb.toString());
    }

    public c(int i2) {
    }
}