TikTok.apk(点击下载) / C59542Wh.java


package X;

import android.content.Context;
import android.text.TextUtils;
import com.bytedance.android.monitor.HybridMonitor;
import com.bytedance.covode.number.Covode;
import com.swift.sandhook.utils.FileUtils;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.InputStream;

/* renamed from: X.2Wh  reason: invalid class name and case insensitive filesystem */
public final class C59542Wh {
    public static String LIZ = "webview_monitor_js_file/slardar_sdk.js";
    public static String LIZIZ = "webview_monitor_js_file/slardar_bridge.js";
    public static String LIZJ = "";
    public static String LIZLLL = "";
    public static String LJ = "";
    public static String LJFF = " javascript:( ";
    public static String LJI = " )() ";
    public static String LJII = " function(){ ";
    public static String LJIIIIZZ = " } ";

    static {
        Covode.recordClassIndex(17819);
    }

    public static String LIZ(Context context, String str, String str2) {
        if (TextUtils.isEmpty(LIZJ)) {
            if (TextUtils.isEmpty(str)) {
                LIZJ = LIZ(context, LIZ, true);
            } else {
                LIZJ = LIZ(context, str, false);
            }
        }
        if (TextUtils.isEmpty(LIZLLL)) {
            LIZLLL = LIZ(context, LIZIZ, true);
        }
        LJ = str2;
        if (str2 == null) {
            str2 = "";
        }
        LJ = str2;
        return LJFF + LJII + LIZJ + LIZLLL + LJ + LJIIIIZZ + LJI;
    }

    /* JADX WARNING: Can't wrap try/catch for region: R(3:14|15|(2:17|18)) */
    /* JADX WARNING: Code restructure failed: missing block: B:15:?, code lost:
        com.bytedance.android.monitor.HybridMonitor.getInstance().getExceptionHandler();
     */
    /* JADX WARNING: Code restructure failed: missing block: B:16:0x0040, code lost:
        if (0 != 0) goto L_0x0042;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:18:?, code lost:
        r2.close();
     */
    /* JADX WARNING: Code restructure failed: missing block: B:19:0x0046, code lost:
        com.bytedance.android.monitor.HybridMonitor.getInstance().getExceptionHandler();
     */
    /* JADX WARNING: Code restructure failed: missing block: B:23:0x0054, code lost:
        r1 = move-exception;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:24:0x0055, code lost:
        if (0 != 0) goto L_0x0057;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:26:?, code lost:
        r2.close();
     */
    /* JADX WARNING: Code restructure failed: missing block: B:27:0x005b, code lost:
        com.bytedance.android.monitor.HybridMonitor.getInstance().getExceptionHandler();
     */
    /* JADX WARNING: Code restructure failed: missing block: B:30:0x0064, code lost:
        throw r1;
     */
    /* JADX WARNING: Failed to process nested try/catch */
    /* JADX WARNING: Missing exception handler attribute for start block: B:14:0x0039 */
    public static String LIZ(Context context, String str, boolean z) {
        byte[] bArr = new byte[FileUtils.FileMode.MODE_ISGID];
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        InputStream inputStream = null;
        InputStream open = z ? context.getAssets().open(str) : new FileInputStream(str);
        while (true) {
            int read = open.read(bArr);
            if (read == -1) {
                break;
            }
            byteArrayOutputStream.write(bArr, 0, read);
        }
        if (open != null) {
            try {
                open.close();
            } catch (Exception unused) {
                HybridMonitor.getInstance().getExceptionHandler();
            }
        }
        return byteArrayOutputStream.toString();
    }
}