翰林优商.apk(点击下载) / m1.java


package com.kuaishou.weapon.p0;

import android.content.Context;
import android.os.Environment;
import android.os.StatFs;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Calendar;
import java.util.Locale;
import java.util.TimeZone;
import org.json.JSONObject;

public class m1 {
    public static int a(Context context) {
        try {
            DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
            if (displayMetrics != null) {
                return displayMetrics.densityDpi;
            }
            return -1;
        } catch (Exception unused) {
            return -1;
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:29:0x0069, code lost:
        if (r3 != null) goto L_0x006c;
     */
    /* JADX WARNING: Failed to process nested try/catch */
    /* JADX WARNING: Missing exception handler attribute for start block: B:30:0x006c */
    /* JADX WARNING: Removed duplicated region for block: B:26:0x0064 A[SYNTHETIC, Splitter:B:26:0x0064] */
    public static JSONObject a() {
        BufferedReader bufferedReader;
        JSONObject jSONObject = new JSONObject();
        DataInputStream dataInputStream = null;
        try {
            DataInputStream dataInputStream2 = new DataInputStream(Runtime.getRuntime().exec("lsmod").getInputStream());
            try {
                bufferedReader = new BufferedReader(new InputStreamReader(dataInputStream2));
                while (true) {
                    try {
                        String readLine = bufferedReader.readLine();
                        if (readLine == null) {
                            dataInputStream2.close();
                            try {
                                bufferedReader.close();
                            } catch (IOException unused) {
                            }
                            return jSONObject;
                        } else if (!TextUtils.isEmpty(readLine)) {
                            String a = o1.a(readLine);
                            if (a.contains("-") && a.contains(";")) {
                                String[] split = a.replace(";;;", ";").split(";");
                                if (split.length > 1) {
                                    jSONObject.put(split[0], split[1]);
                                }
                            }
                        }
                    } catch (Throwable unused2) {
                        dataInputStream = dataInputStream2;
                        if (dataInputStream != null) {
                        }
                    }
                }
            } catch (Throwable unused3) {
                bufferedReader = null;
                dataInputStream = dataInputStream2;
                if (dataInputStream != null) {
                }
            }
        } catch (Throwable unused4) {
            bufferedReader = null;
            if (dataInputStream != null) {
                try {
                    dataInputStream.close();
                } catch (IOException unused5) {
                }
            }
        }
    }

    public static String b() {
        String str;
        try {
            str = Locale.getDefault().toString();
        } catch (Throwable unused) {
            str = "";
        }
        return str == null ? "" : str;
    }

    public static String c() {
        long j;
        try {
            if ("mounted".equals(Environment.getExternalStorageState())) {
                StatFs statFs = new StatFs(Environment.getExternalStorageDirectory().getPath());
                j = ((long) statFs.getBlockSize()) * ((long) statFs.getBlockCount());
                return String.valueOf(j);
            }
        } catch (Throwable unused) {
        }
        j = 0;
        return String.valueOf(j);
    }

    public static JSONObject d() {
        try {
            JSONObject jSONObject = new JSONObject();
            TimeZone timeZone = Calendar.getInstance().getTimeZone();
            if (timeZone == null) {
                return null;
            }
            jSONObject.put("0", String.valueOf(timeZone.getOffset(System.currentTimeMillis()) / 1000));
            jSONObject.put("1", timeZone.getID());
            return jSONObject;
        } catch (Exception unused) {
            return null;
        }
    }
}