导航菜单

页面标题

页面副标题

公务员之家 v1.0.1 - k.java 源代码

正在查看: 公务员之家 v1.0.1 应用的 k.java JAVA 源代码文件

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


package com.mobile.auth.c;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.text.TextUtils;
import com.kuaishou.weapon.p0.c;
import com.mobile.auth.gatewayauth.ExceptionProcessor;
import com.ss.android.downloadad.api.constant.AdBaseConstants;
import java.lang.reflect.Method;

public class k {
    private static int a(int i) {
        int i2 = -101;
        if (i != -101) {
            i2 = -1;
            if (i != -1) {
                switch (i) {
                    case 1:
                    case 2:
                    case 4:
                    case 7:
                    case 11:
                    case 16:
                        return 1;
                    case 3:
                    case 5:
                    case 6:
                    case 8:
                    case 9:
                    case 10:
                    case 12:
                    case 14:
                    case AdBaseConstants.DEFAULT_INSTALL_FINISH_TRY_COUNT:
                    case 17:
                        return 2;
                    case 13:
                    case 18:
                    case c.C0003c.c:
                        return 3;
                    default:
                        return i;
                }
            }
        }
        return i2;
    }

    public static NetworkInfo a(Context context) {
        if (context == null) {
            return null;
        }
        try {
            return ((ConnectivityManager) context.getSystemService("connectivity")).getActiveNetworkInfo();
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return null;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return null;
            }
        }
    }

    public static void a(Context context, long j) {
        try {
            try {
                d.a(context, "key_s_p_dm_time", j);
            } catch (Exception e) {
                e.printStackTrace();
            }
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    public static void a(Context context, String str) {
        try {
            try {
                d.a(context, "key_s_p_dm", str);
            } catch (Exception e) {
                e.printStackTrace();
            }
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
            }
        }
    }

    public static boolean b(Context context) {
        try {
            NetworkInfo a = a(context);
            if (a != null) {
                return a.isAvailable();
            }
            return false;
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return false;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return false;
            }
        }
    }

    public static boolean c(Context context) {
        try {
            NetworkInfo a = a(context);
            if (a != null) {
                if (a.getType() == 0) {
                    return true;
                }
            }
            return false;
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return false;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return false;
            }
        }
    }

    public static boolean d(Context context) {
        if (context == null) {
            return true;
        }
        try {
            ConnectivityManager connectivityManager = (ConnectivityManager) context.getApplicationContext().getSystemService("connectivity");
            Method declaredMethod = ConnectivityManager.class.getDeclaredMethod("getMobileDataEnabled", new Class[0]);
            declaredMethod.setAccessible(true);
            return ((Boolean) declaredMethod.invoke(connectivityManager, new Object[0])).booleanValue();
        } catch (Throwable th) {
            try {
                com.mobile.auth.a.a.a("NetUtil", "isMobileEnable error ", th);
                return true;
            } catch (Throwable th2) {
                try {
                    ExceptionProcessor.processException(th2);
                    return false;
                } catch (Throwable th3) {
                    ExceptionProcessor.processException(th3);
                    return false;
                }
            }
        }
    }

    public static String e(Context context) {
        try {
            int k = k(context);
            return k != -101 ? (k == -1 || k == 0) ? "null" : k != 1 ? k != 2 ? k != 3 ? Integer.toString(k) : "4G" : "3G" : "2G" : "WIFI";
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return null;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return null;
            }
        }
    }

    public static String f(Context context) {
        try {
            String e = e(context);
            if (e != null && e.equals("WIFI")) {
                if (d(context)) {
                    return "BOTH";
                }
            }
            return e;
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return null;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return null;
            }
        }
    }

    public static String g(Context context) {
        try {
            String f = f(context);
            if (!TextUtils.isEmpty(f) && !f.equals("null")) {
                if (f.equals("2G")) {
                    return "10";
                }
                if (f.equals("3G")) {
                    return "11";
                }
                if (f.equals("4G")) {
                    return "12";
                }
                if (f.equals("WIFI")) {
                    return "13";
                }
                if (f.equals("BOTH")) {
                    return "14";
                }
            }
            return "15";
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return null;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return null;
            }
        }
    }

    public static String h(Context context) {
        try {
            if (System.currentTimeMillis() - i(context) > 172800000) {
                return "1";
            }
            try {
                return d.b(context, "key_s_p_dm", "1");
            } catch (Exception e) {
                e.printStackTrace();
                return "1";
            }
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return null;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return null;
            }
        }
    }

    public static long i(Context context) {
        Long l;
        try {
            try {
                l = Long.valueOf(d.b(context, "key_s_p_dm_time", 0L));
            } catch (Exception e) {
                e.printStackTrace();
                l = null;
            }
            return l.longValue();
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return -1L;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return -1L;
            }
        }
    }

    public static String j(Context context) {
        try {
            String h = h(context);
            return (TextUtils.isEmpty(h) || h.equals("1")) ? "https://id6.me/auth/preauth.do" : h.equals("2") ? "https://card.e.189.cn/auth/preauth.do" : "https://id6.me/auth/preauth.do";
        } catch (Throwable th) {
            try {
                ExceptionProcessor.processException(th);
                return null;
            } catch (Throwable th2) {
                ExceptionProcessor.processException(th2);
                return null;
            }
        }
    }

    private static int k(Context context) {
        int i = 0;
        try {
            try {
                NetworkInfo a = a(context);
                if (a != null && a.isAvailable() && a.isConnected()) {
                    int type = a.getType();
                    if (type == 1) {
                        i = -101;
                    } else if (type == 0) {
                        i = a.getSubtype();
                    }
                } else {
                    i = -1;
                }
            } catch (Throwable th) {
                try {
                    ExceptionProcessor.processException(th);
                    return -1;
                } catch (Throwable th2) {
                    ExceptionProcessor.processException(th2);
                    return -1;
                }
            }
        } catch (NullPointerException e) {
            e.printStackTrace();
        } catch (Exception e2) {
            e2.printStackTrace();
        }
        return a(i);
    }
}