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


package X;

import andhook.lib.xposed.callbacks.XCallback;
import android.content.Context;
import android.net.Uri;
import android.os.Environmenu;
import android.os.Message;
import android.text.TextUtils;
import com.bytedance.android.livesdk.livesetting.broadcast.LiveMaxRetainAlogMessageSizeSetting;
import com.bytedance.android.livesdk.livesetting.gift.LiveGuideWattingDurationSetting;
import com.bytedance.android.livesdk.livesetting.message.HotLiveMessageSizeSetting;
import com.bytedance.android.livesdk.livesetting.pullstream.LiveNetAdaptiveHurryTimeSetting;
import com.bytedance.android.livesdk.livesetting.wallet.LiveRechargeAgeThresholdSetting;
import com.bytedance.bpea.entry.common.DataType;
import com.bytedance.covode.number.Covode;
import com.bytedance.keva.Keva;
import com.oplus.ocs.base.common.constant.CommonStatusCodes;
import com.ss.mediakit.medialoader.AVMDLDataLoader;
import com.ss.mediakit.medialoader.AVMDLDataLoaderConfigure;
import com.ss.mediakit.medialoader.AVMDLDataLoaderListener;
import com.ss.mediakit.medialoader.AVMDLDataLoaderNotifyInfo;
import com.ss.mediakit.medialoader.AVMDLLibraryManagerWrapper;
import com.ss.mediakit.medialoader.AVMDLStartCompleteListener;
import com.ss.mediakit.net.AVMDLDNSParser;
import com.ss.ttm.vcshared.VCBaseKitLoader;
import com.swift.sandhook.utils.FileUtils;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.lang.ref.WeakReference;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.locks.ReentrantLock;
import org.json.JSONArray;
import org.json.JSONObject;

/* renamed from: X.76y  reason: invalid class name and case insensitive filesystem */
public final class C1803576y implements AVMDLDataLoaderListener, AVMDLStartCompleteListener {
    public volatile AbstractC173186rL LIZ;
    public AnonymousClass779 LIZIZ;
    public AnonymousClass77K LIZJ;
    public volatile int LIZLLL;
    public AnonymousClass770 LJ;
    public AnonymousClass770 LJFF;
    public AnonymousClass770 LJI;
    public HashMap<String, ArrayList<C173386rf>> LJII;
    public final ReentrantLock LJIIIIZZ;
    public AVMDLDataLoader LJIIIZ;
    public AVMDLDataLoaderConfigure LJIIJ;
    public Context LJIIJJI;
    public C173076rA LJIIL;
    public AbstractC169776lq LJIILIIL;
    public AbstractC169756lo LJIILJJIL;
    public long LJIILL;
    public boolean LJIILLIIL;
    public final ReentrantLock LJIIZILJ;
    public int LJIJ;
    public AbstractC49991y8 LJIJI;
    public WeakReference<AbstractC49991y8> LJIJJ;
    public int LJIJJLI;
    public boolean LJIL;
    public C173756sG LJJ;
    public int LJJI;
    public int LJJIFFI;
    public final AnonymousClass773 LJJII;
    public volatile boolean LJJIII;
    public AnonymousClass770 LJJIIJ;
    public ClassLoader LJJIIJZLJL;
    public AnonymousClass76N LJJIIZ;
    public Exception LJJIIZI;
    public String LJJIJ;
    public int LJJIJIIJI;
    public int LJJIJIIJIL;
    public boolean LJJIJIL;
    public int LJJIJL;
    public int LJJIJLIJ;
    public int LJJIL;
    public int LJJIZ;
    public boolean LJJJ;
    public int LJJJI;
    public String LJJJIL;
    public int LJJJJ;
    public int LJJJJI;
    public int LJJJJIZL;
    public int LJJJJJ;
    public int LJJJJJL;
    public boolean LJJJJL;
    public int LJJJJLI;
    public int LJJJJLL;
    public int LJJJJZ;
    public int LJJJJZI;
    public int LJJJLIIL;
    public int LJJJLL;
    public int LJJJLZIJ;
    public int LJJJZ;
    public boolean LJJL;
    public int LJJLI;
    public int LJJLIIIIJ;

    static {
        Covode.recordClassIndex(118618);
    }

    public C1803576y() {
        this.LIZLLL = 1;
        this.LJ = new AnonymousClass770(this, (byte) 0);
        this.LJFF = new AnonymousClass770(this, (byte) 0);
        this.LJI = new AnonymousClass770(this, (byte) 0);
        this.LJJIIJ = new AnonymousClass770(this, (byte) 0);
        this.LJII = new HashMap<>();
        this.LJIIIIZZ = new ReentrantLock();
        this.LJIIIZ = null;
        this.LJIIJ = null;
        this.LJIIJJI = null;
        this.LJJIIJZLJL = null;
        this.LJJIIZ = null;
        this.LJJIIZI = null;
        this.LJJIJ = null;
        this.LJIIL = null;
        this.LJIILIIL = null;
        this.LJIILJJIL = null;
        this.LJJIJIIJI = 0;
        this.LJIILL = -1;
        this.LJIILLIIL = true;
        this.LJJIJIIJIL = 0;
        this.LJJIJIL = false;
        this.LJIIZILJ = new ReentrantLock();
        this.LJIJ = 0;
        this.LJJIJL = 0;
        this.LJJIJLIJ = 0;
        this.LJIJI = null;
        this.LJIJJ = null;
        this.LJIJJLI = -1;
        this.LJJIL = 0;
        this.LJJIZ = 0;
        this.LJJJ = false;
        this.LJJJI = 1;
        this.LJJJIL = null;
        this.LJJJJ = 0;
        this.LJJJJI = 0;
        this.LJJJJIZL = 0;
        this.LJJJJJ = 0;
        this.LJJJJJL = 0;
        this.LJIL = false;
        this.LJJ = null;
        this.LJJJJL = true;
        this.LJJJJLI = 0;
        this.LJJI = 0;
        this.LJJIFFI = 0;
        this.LJJJJLL = 0;
        this.LJJJJZ = 0;
        this.LJJJJZI = 0;
        this.LJJJLIIL = 0;
        this.LJJJLL = 0;
        this.LJJJLZIJ = 0;
        this.LJJJZ = 0;
        this.LJJL = false;
        this.LJJII = new AnonymousClass773();
        this.LJJLI = 0;
        this.LJJLIIIIJ = 0;
        this.LJJIIZ = AnonymousClass76N.LIZ();
        this.LIZLLL = 1;
        this.LJIIJ = AVMDLDataLoaderConfigure.getDefaultonfigure();
    }

    public /* synthetic */ C1803576y(byte b) {
        this();
    }

    public static C1803576y LIZ() {
        return C173826sN.LIZ;
    }

    private String LIZ(String str, String str2, int i2) {
        if (TextUtils.isEmpty(str)) {
            return null;
        }
        String LJI2 = AnonymousClass77O.LJI(str);
        if (TextUtils.isEmpty(LJI2)) {
            return null;
        }
        if (TextUtils.isEmpty(str2)) {
            str2 = str;
        }
        String LJI3 = AnonymousClass77O.LJI(str2);
        if (!TextUtils.isEmpty(LJI3)) {
            str = LJI3;
        }
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append("?rk=");
        stringBuffer.append(str);
        stringBuffer.append("&k=");
        stringBuffer.append(LJI2);
        stringBuffer.append("&pv=");
        stringBuffer.append(1);
        if (i2 > 0) {
            stringBuffer.append("&l=");
            stringBuffer.append(i2);
        }
        return stringBuffer.toString();
    }

    private String LIZ(String str, String str2, long j, long j2, String[] strArr, String str3, String str4, int i2, String str5, boolean z, String str6, int i3) {
        if (TextUtils.isEmpty(str) || strArr == null || strArr.length <= 0) {
            return null;
        }
        String[] strArr2 = (String[]) strArr.clone();
        if (j2 <= 0) {
            j2 = 0;
        }
        for (String str7 : strArr2) {
            if (!LJIILJJIL(str7)) {
                return null;
            }
        }
        String[] LIZIZ2 = LIZIZ(strArr2);
        String LJI2 = AnonymousClass77O.LJI(str);
        if (TextUtils.isEmpty(LJI2)) {
            return null;
        }
        TextUtils.isEmpty(str2);
        String[] LIZ2 = LIZ(LIZIZ2);
        C169566lV.LIZ("DataLoaderHelper", "preloadProxyQuery: key = " + str + ", rawKey = " + str2);
        if (!TextUtils.isEmpty(str2)) {
            str = str2;
        }
        String LJI3 = AnonymousClass77O.LJI(str);
        if (TextUtils.isEmpty(LJI3)) {
            LJI3 = "videoId";
        }
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append("?rk=");
        stringBuffer.append(LJI3);
        stringBuffer.append("&k=");
        stringBuffer.append(LJI2);
        if (j2 > 0) {
            stringBuffer.append("&s=");
            stringBuffer.append(j + j2);
        }
        if (i2 > 0) {
            stringBuffer.append("&l=");
            stringBuffer.append(i2);
        }
        if (!TextUtils.isEmpty(str3)) {
            String LJI4 = AnonymousClass77O.LJI(str3);
            if (!TextUtils.isEmpty(LJI4)) {
                stringBuffer.append("&p=");
                stringBuffer.append(LJI4);
            }
        }
        if (!TextUtils.isEmpty(str5)) {
            String LJI5 = AnonymousClass77O.LJI(str5);
            if (!TextUtils.isEmpty(LJI5)) {
                stringBuffer.append("&h=");
                stringBuffer.append(LJI5);
            }
        }
        if (z) {
            stringBuffer.append("&ft=1");
        }
        if (i3 > 0) {
            stringBuffer.append("&ev=".concat(String.valueOf(i3)));
        }
        if (!TextUtils.isEmpty(str6)) {
            String LJI6 = AnonymousClass77O.LJI(str6);
            if (!TextUtils.isEmpty(LJI6)) {
                stringBuffer.append("&dtk=");
                stringBuffer.append(LJI6);
            }
        }
        StringBuffer stringBuffer2 = new StringBuffer();
        for (int i4 = 0; i4 < LIZ2.length; i4++) {
            String LJIILIIL2 = LJIILIIL(LIZ2[i4]);
            StringBuffer stringBuffer3 = new StringBuffer();
            if (!TextUtils.isEmpty(LJIILIIL2)) {
                stringBuffer3.append("&u");
                stringBuffer3.append(i4);
                stringBuffer3.append("=");
                stringBuffer3.append(LJIILIIL2);
            }
            if (stringBuffer.length() + stringBuffer2.length() + stringBuffer3.length() + 32 > 3096) {
                break;
            }
            stringBuffer2.append(stringBuffer3);
        }
        if (stringBuffer2.length() <= 0) {
            return null;
        }
        stringBuffer.append(stringBuffer2);
        if (!TextUtils.isEmpty(str4) && stringBuffer.length() + str4.length() + 33 <= 3096) {
            stringBuffer.append("&");
            stringBuffer.append(str4);
        }
        return stringBuffer.toString();
    }

    private String LIZ(String str, String str2, long j, long j2, String[] strArr, String str3, String str4, boolean z, String str5) {
        return LIZ(str, str2, j, j2, strArr, str3, str4, 0, (String) null, z, str5, 0);
    }

    private String LIZ(String str, String str2, long j, String[] strArr, String str3, String str4, int i2, String str5, boolean z) {
        return LIZ(str, str2, j, 0, strArr, str3, str4, i2, str5, z, (String) null, 0);
    }

    private String LIZ(HashMap<String, String> hashMap) {
        if (hashMap == null || hashMap.size() <= 0) {
            return null;
        }
        StringBuilder sb = new StringBuilder();
        for (String str : hashMap.keySet()) {
            sb.append(str).append(": ").append(hashMap.get(str)).append("\r\n");
        }
        return sb.toString();
    }

    private JSONObject LIZ(JSONObject jSONObject) {
        try {
            long LIZ2 = C176646wv.LIZ.LIZ();
            if (LIZ2 > 0) {
                jSONObject.put("_play_waste_data", LIZ2);
            }
            long LIZIZ2 = C176646wv.LIZ.LIZIZ();
            if (LIZIZ2 > 0) {
                jSONObject.put("_play_consumed_data", LIZIZ2);
            }
        } catch (Exception unused) {
        }
        return jSONObject;
    }

    private void LIZ(int i2, int i3) {
        this.LJIIZILJ.lock();
        C169566lV.LIZIZ("DataLoaderHelper", "setIntValue key = " + i2 + ", value = " + i3);
        boolean z = true;
        if (i2 == 1) {
            this.LJIIJ.mMaxCacheSize = i3;
        } else if (i2 == 2) {
            this.LJIIJ.mRWTimeOut = i3;
        } else if (i2 == 3) {
            this.LJIIJ.mOpenTimeOut = i3;
        } else if (i2 == 4) {
            this.LJIIJ.mTryCount = i3;
        } else if (i2 == 5) {
            this.LJIIJ.mLoaderType = i3;
        } else if (i2 == 7) {
            this.LJIIJ.mEnableExternDNS = i3;
        } else if (i2 == 8) {
            this.LJIIJ.mEnableSocketReuse = i3;
        } else if (i2 == 9) {
            this.LJIIJ.mSocketIdleTimeOut = i3;
        } else if (i2 == 55) {
            this.LJIIJ.mMaxCacheAge = i3;
        } else if (i2 == 56) {
            this.LJIIJ.mEnableMaxCacheAgeForAllDir = i3;
        } else if (i2 == 60) {
            this.LJIIJ.mEnablePreloadReUse = i3;
        } else if (i2 == 61) {
            this.LJIJ = i3;
        } else if (i2 == 109) {
            C173166rJ.LIZ.LJIIJJI = i3;
        } else if (i2 == 110) {
            C173166rJ.LIZ.LJIILL = i3;
        } else if (i2 == 112) {
            this.LJIIJ.mSpeedSampleInterval = i3;
        } else if (i2 != 113) {
            switch (i2) {
                case 11:
                    this.LJIIJ.mPreloadParallelNum = i3;
                    AVMDLDataLoader aVMDLDataLoader = this.LJIIIZ;
                    if (aVMDLDataLoader != null) {
                        aVMDLDataLoader.setIntValue(102, i3);
                        break;
                    }
                    break;
                case 12:
                    if (i3 >= 100) {
                        this.LJJIFFI = this.LJIIJ.mPreloadStrategy;
                        this.LJIIJ.mPreloadStrategy = 100;
                    } else {
                        this.LJJIFFI = this.LJIIJ.mPreloadStrategy;
                        this.LJIIJ.mPreloadStrategy = i3;
                    }
                    this.LJJI = i3;
                    if (i3 == 200) {
                        this.LJIIJ.mEnableIOManager = 1;
                        break;
                    }
                    break;
                case 13:
                    this.LJIIJ.mCheckSumLevel = i3;
                    break;
                case 14:
                    this.LJIIJ.mTestSpeedTypeVersion = i3;
                    break;
                case 15:
                    this.LJJIJIIJI = i3;
                    break;
                case 16:
                    this.LJIIJ.mLoaderFactoryP2PLevel = i3;
                    break;
                case 17:
                    C169566lV.LIZ("DataLoaderHelper", "set write file notify intervalMS ".concat(String.valueOf(i3)));
                    this.LJIIJ.mWriteFileNotifyIntervalMS = i3;
                    break;
                case LiveRechargeAgeThresholdSetting.DEFAULT /*{ENCODED_INT: 18}*/:
                    this.LJJJI = i3;
                    break;
                case 19:
                    this.LJJJJ = i3;
                    break;
                case 20:
                    this.LJJJJI = i3;
                    break;
                case 21:
                    this.LJIIJ.mEnableDownloaderLog = i3;
                    break;
                case 22:
                    this.LJIIJ.mEnableTTNetLoader = i3;
                    break;
                case 23:
                    this.LJIIJ.mTTNetLoaderCronetBufSizeKB = i3;
                    break;
                case LiveGuideWattingDurationSetting.DEFAULT /*{ENCODED_INT: 30}*/:
                    this.LJIIJ.mEncryptVersion = i3;
                    break;
                case FileUtils.FileMode.MODE_IRGRP /*{ENCODED_INT: 32}*/:
                    if (i3 <= 0) {
                        z = false;
                    }
                    this.LJJL = z;
                    break;
                case 50:
                    this.LJIIJ.mIsCloseFileCache = i3;
                    break;
                case HotLiveMessageSizeSetting.DEFAULT /*{ENCODED_INT: 80}*/:
                    this.LJIIJ.mPreloadWaitListType = i3;
                    break;
                case 119:
                    C173376re.LIZ.LIZ(i3);
                    break;
                case 121:
                    this.LJIIJ.mUseNewSpeedTestForSingle = i3;
                    break;
                case 200:
                    this.LJIIJ.mEnableEventInfo = i3;
                    break;
                case LiveMaxRetainAlogMessageSizeSetting.DEFAULT /*{ENCODED_INT: 500}*/:
                    this.LJIIJ.mLiveP2pAllow = i3;
                    break;
                case 501:
                    this.LJIIJ.mLiveLoaderType = i3;
                    break;
                case 502:
                    this.LJIIJ.mLiveLoaderEnable = i3;
                    break;
                case 505:
                    this.LJIIJ.mLiveWatchDurationThreshold = i3;
                    break;
                case 506:
                    this.LJIIJ.mLiveCacheThresholdHttpToP2p = i3;
                    break;
                case 507:
                    this.LJIIJ.mLiveCacheThresholdP2pToHttp = i3;
                    break;
                case 508:
                    this.LJIIJ.mLiveMaxTrySwitchP2pTimes = i3;
                    break;
                case 509:
                    this.LJIIJ.mLiveWaitP2pReadyThreshold = i3;
                    break;
                case 510:
                    this.LJIIJ.mLiveMobileUploadAllow = i3;
                    break;
                case 511:
                    this.LJIIJ.mLiveMobileDownloadAllow = i3;
                    break;
                case 512:
                    this.LJIIJ.mAlogEnable = i3;
                    AVMDLDataLoader aVMDLDataLoader2 = this.LJIIIZ;
                    if (aVMDLDataLoader2 != null) {
                        aVMDLDataLoader2.setIntValue(7225, i3);
                        break;
                    }
                    break;
                case 513:
                    this.LJIIJ.mLiveRecvDataTimeout = i3;
                    break;
                case 1000:
                    if (this.LJJIJLIJ == 1) {
                        LJI();
                        AVMDLDataLoader aVMDLDataLoader3 = this.LJIIIZ;
                        if (aVMDLDataLoader3 != null) {
                            aVMDLDataLoader3.setIntValue(7217, 1);
                            break;
                        }
                    }
                    break;
                case 1001:
                    this.LJIIJ.mEnablePreconnect = i3;
                    break;
                case CommonStatusCodes.AUTHENTICATE_FAIL /*{ENCODED_INT: 1002}*/:
                    this.LJIIJ.mPreconnectNum = i3;
                    break;
                case CommonStatusCodes.AUTHCODE_EXPECTED /*{ENCODED_INT: 1004}*/:
                    if (i3 == 0) {
                        z = false;
                    }
                    this.LJIILLIIL = z;
                    C169566lV.LIZ("DataLoaderHelper", "setIntValue: mInvalidMdlProcotol: " + this.LJIILLIIL);
                    break;
                case CommonStatusCodes.VERSION_INCOMPATIBLE /*{ENCODED_INT: 1005}*/:
                    if (i3 != 1) {
                        z = false;
                    }
                    this.LJJIJIL = z;
                    C169566lV.LIZ("DataLoaderHelper", "config DATALOADER_KEY_SET_MDL_PROTOCOL_ENABLE: " + this.LJJIJIL);
                    break;
                case CommonStatusCodes.AUTHCODE_RECYCLE /*{ENCODED_INT: 1006}*/:
                    this.LJIIJ.mRingBufferSizeKB = i3;
                    break;
                case CommonStatusCodes.AUTHCODE_INVALID /*{ENCODED_INT: 1007}*/:
                    this.LJIIJ.mEnableFileCacheV2 = i3;
                    break;
                case CommonStatusCodes.STATUS_EXCEPTION /*{ENCODED_INT: 1009}*/:
                    this.LJIIJ.mEnableFileRingBuffer = i3;
                    break;
                case 1010:
                    this.LJIIJ.mEnableUseFileExtendLoaderBuffer = i3;
                    break;
                case 1011:
                    this.LJJIJLIJ = i3;
                    break;
                case 1100:
                    this.LJJIJL = i3;
                    break;
                case 1101:
                    this.LJIIJ.mEnableLoaderPreempt = i3;
                    break;
                case 1102:
                    this.LJIIJ.mAccessCheckLevel = i3;
                    break;
                case 1103:
                    this.LJIIJ.mNextDownloadThreshold = i3;
                    break;
                case 1104:
                    AVMDLDataLoader aVMDLDataLoader4 = this.LJIIIZ;
                    if (aVMDLDataLoader4 != null) {
                        aVMDLDataLoader4.setIntValue(7219, i3);
                        break;
                    }
                    break;
                case 1105:
                    this.LJIIJ.mSocketSendBufferKB = i3;
                    break;
                case 1108:
                    this.LJIIJ.mEnableSyncDnsForPcdn = i3;
                    break;
                case 1109:
                    AVMDLDataLoader aVMDLDataLoader5 = this.LJIIIZ;
                    if (aVMDLDataLoader5 != null) {
                        aVMDLDataLoader5.setIntValue(7227, i3);
                        break;
                    }
                    break;
                case 1110:
                    this.LJIIJ.mXYLibValue = i3;
                    break;
                case 1111:
                    this.LJIIJ.mCheckPreloadLevel = i3;
                    break;
                case 1112:
                    this.LJJIZ = i3;
                    break;
                case 1113:
                    if (i3 == 0) {
                        z = false;
                    }
                    this.LJJJ = z;
                    break;
                case 1115:
                    this.LJIIJ.mMaxIPV6Num = i3;
                    break;
                case 1116:
                    this.LJIIJ.mMaxIPV4Num = i3;
                    break;
                case 1117:
                    this.LJIIJ.mForbidByPassCookie = i3;
                    break;
                case 1118:
                    this.LJIIJ.mEnableLazyBufferpool = i3;
                    break;
                case 1119:
                    this.LJIIJ.mSessionTimeout = i3;
                    break;
                case 1120:
                    this.LJIIJ.mEnableNewBufferpool = i3;
                    break;
                case 1121:
                    this.LJIIJ.mNewBufferPoolBlockSize = i3;
                    break;
                case 1122:
                    this.LJIIJ.mNewBufferPoolResidentSize = i3;
                    break;
                case 1123:
                    this.LJIIJ.mNewBufferPoolGrowBlockCount = i3;
                    break;
                case 1124:
                    this.LJIIJ.mEnablePlayInfoCache = i3;
                    break;
                case 1125:
                    this.LJIIJ.mControlCDNRangeType = i3;
                    break;
                case 1126:
                    this.LJIIJ.mEnableP2PPreDown = i3;
                    break;
                case 1127:
                    this.LJIIJ.mEnablePlayLog = i3;
                    break;
                case 1128:
                    this.LJIIJ.mEnableNetScheduler = i3;
                    break;
                case 1129:
                    this.LJIIJ.mNetSchedulerBlockAllNetErr = i3;
                    break;
                case 1130:
                    this.LJIIJ.mNetSchedulerBlockErrCount = i3;
                    break;
                case 1131:
                    this.LJIIJ.mNetSChedulerBlockDurationMs = i3;
                    break;
                case 1132:
                    this.LJIIJ.mFirstRangeLeftThreshold = i3;
                    break;
                case 1133:
                    this.LJIIJ.mIsAllowTryTheLastUrl = i3;
                    break;
                case 1134:
                    this.LJIIJ.mEnableCacheReqRange = i3;
                    break;
                case 1135:
                    this.LJIIJ.mEnableLoaderSeek = i3;
                    break;
                case 1136:
                    this.LJIIJ.mP2PPreDownPeerCount = i3;
                    break;
                case 1137:
                    this.LJIIJ.mEnableDynamicTimeout = i3;
                    break;
                case 1138:
                    this.LJIIJ.mSocketInitialTimeout = i3;
                    break;
                case 1139:
                    this.LJIIJ.mMaxSocketReuseCount = i3;
                    break;
                case 1140:
                    AVMDLDNSParser.setIntValue(10, i3);
                    break;
                case 1141:
                    AVMDLDNSParser.setIntValue(2, i3);
                    break;
                case 1143:
                    this.LJIIJ.mP2PFirstRangeLoaderType = i3;
                    break;
                case 1145:
                    this.LJIIJ.mMaxAliveHostNum = i3;
                    break;
                case 1146:
                    this.LJIIJ.mFileExtendSizeKB = i3;
                    break;
                case 1147:
                    this.LJIIJ.mMinAllowSpeed = i3;
                    break;
                case 1148:
                    this.LJIIJ.mNetSchedulerBlockHostIpErrCount = i3;
                    break;
                case 1150:
                    this.LJIIJ.mEnableIOManager = i3;
                    break;
                case 1151:
                    this.LJIIJ.mEnableOwnVDPPreloadNotify = i3;
                    break;
                case 1154:
                    this.LJJJJLL = i3;
                    break;
                case 1155:
                    this.LJJJLL = i3;
                    break;
                case 1156:
                    if (i3 > 0) {
                        this.LJJII.LIZ = (long) i3;
                        break;
                    }
                    break;
                case 1157:
                    if (i3 > 0) {
                        this.LJJII.LIZIZ = (long) i3;
                        break;
                    }
                    break;
                case 1158:
                    this.LJIIJ.mMaxFileMemCacheSize = i3;
                    break;
                case 1159:
                    this.LJIIJ.mMaxFileMemCacheNum = i3;
                    break;
                case 1160:
                    if (i3 >= 0) {
                        this.LJIIJ.mEnableEarlyData = i3;
                        break;
                    }
                    break;
                case 1161:
                    if (i3 > 0) {
                        this.LJIIJ.mSocketRecvBufferSize = i3;
                        break;
                    }
                    break;
                case 1162:
                    if (i3 > 0) {
                        this.LJIIJ.mEnableSpeedPredict = i3;
                        break;
                    }
                    break;
                case 1163:
                    this.LJJJJZ = i3;
                    break;
                case 1164:
                    this.LJIIJ.mEnableUseOriginalUrl = i3;
                    break;
                case 1166:
                    this.LJIIJ.mEnableLoaderLogExtractUrls = i3;
                    break;
                case 1167:
                    this.LJIIJ.mMaxLoaderLogNum = i3;
                    break;
                case 1168:
                    this.LJIIJ.mCheckContentTypeMethod = i3;
                    break;
                case 1169:
                    this.LJIIJ.mCloseThreadPool = i3;
                    break;
                case 1170:
                    this.LJJJJZI = i3;
                    break;
                case 1501:
                    this.LJIIJ.mEnableCellularUp = i3;
                    break;
                case 1503:
                    this.LJJJLZIJ = i3;
                    break;
                case 1504:
                    this.LJJJZ = i3;
                    break;
                case 1505:
                    this.LJJJLIIL = i3;
                    break;
                case 1701:
                    this.LJIIJ.mEnableByteMediaNetLoader = i3;
                    break;
                case LiveNetAdaptiveHurryTimeSetting.DEFAULT /*{ENCODED_INT: 2000}*/:
                    this.LJIIJ.mEnableStorageModule = i3;
                    break;
                case 2001:
                    this.LJIIJ.mStoPlayDldWinSizeKBNM = i3;
                    break;
                case 2002:
                    this.LJIIJ.mStoPlayDldWinSizeKBLS = i3;
                    break;
                case 2003:
                    this.LJIIJ.mStoRingBufferSizeKB = i3;
                    break;
                case 2004:
                    this.LJIIJ.mStoIoWriteLimitKBTh1 = i3;
                    break;
                case 2005:
                    this.LJIIJ.mStoIoWriteLimitKBTh2 = i3;
                    break;
                case 2006:
                    this.LJIIJ.mStoMaxIdleTimeSec = i3;
                    break;
                case 2008:
                    if (i3 >= 0) {
                        this.LJIIJ.mThreadStackSizeLevel = i3;
                        break;
                    }
                    break;
                case 2009:
                    if (i3 > 0) {
                        this.LJIIJ.mThreadPoolMinCount = i3;
                        break;
                    }
                    break;
                case 2010:
                    if (i3 > 0) {
                        this.LJIIJ.mEnableThreadPoolCheckIdle = i3;
                        break;
                    }
                    break;
                case 2011:
                    if (i3 > 0) {
                        this.LJIIJ.mThreadPoolTTLSecond = i3;
                        break;
                    }
                    break;
                case 2012:
                    if (i3 > 0) {
                        this.LJIIJ.mMaxIpNum = i3;
                        break;
                    }
                    break;
                case 2100:
                    if (i3 >= 0) {
                        this.LJIIJ.mEnableP2pUpload = i3;
                        break;
                    }
                    break;
                case 2102:
                    if (i3 >= 0) {
                        this.LJIIJ.mDevDiskSizeMB = i3;
                        break;
                    }
                    break;
                case 2104:
                    if (i3 >= 0) {
                        this.LJIIJ.mDevMemorySizeMB = i3;
                        break;
                    }
                    break;
                case 9000:
                    this.LJJIL = i3;
                    break;
                case 9001:
                    this.LJIIJ.mIgnorePlayInfo = i3;
                    break;
                case 9008:
                    this.LJJJJJL = i3;
                    break;
                case 9013:
                    this.LJJLI = i3;
                    break;
                case 9014:
                    if (i3 == 1 || i3 == 0) {
                        this.LJIIJ.mEnableMultiDownloadPath = i3;
                        break;
                    }
                case 9015:
                    this.LJJLIIIIJ = i3;
                    break;
                default:
                    switch (i2) {
                        case 63:
                            this.LJIIJ.mMaxIpCountEachDomain = i3;
                            break;
                        case FileUtils.FileMode.MODE_IXUSR /*{ENCODED_INT: 64}*/:
                            this.LJIIJ.mEnableIpBucket = i3;
                            break;
                        case 65:
                            this.LJIIJ.mErrorStateTrustTime = i3;
                            break;
                        case 66:
                            this.LJIIJ.mOnlyUseCdn = i3;
                            break;
                        default:
                            switch (i2) {
                                case 90:
                                    this.LJIIJ.mDNSMainType = i3;
                                    AVMDLDNSParser.setIntValue(0, i3);
                                    break;
                                case 91:
                                    this.LJIIJ.mDNSBackType = i3;
                                    AVMDLDNSParser.setIntValue(1, i3);
                                    break;
                                case 92:
                                    this.LJIIJ.mMainToBackUpDelayedTime = i3;
                                    AVMDLDNSParser.setIntValue(3, i3);
                                    break;
                                case 93:
                                    this.LJIIJ.mEnableBenchMarkIOSpeed = i3;
                                    break;
                                case 94:
                                    this.LJIIJ.mSpeedCoefficientValue = i3;
                                    break;
                                case 95:
                                    C173166rJ.LIZ.LJIIL = i3;
                                    break;
                                case 96:
                                    C173166rJ.LIZ.LJIIIIZZ = i3;
                                    break;
                                case 97:
                                    C173166rJ.LIZ.LJIIIZ = i3;
                                    break;
                                case 98:
                                    C173166rJ.LIZ.LJIIJ = i3;
                                    break;
                                case 99:
                                    C173166rJ.LIZ.LJIILIIL = i3;
                                    break;
                                case 100:
                                    this.LJIIJ.mMaxTlsVersion = i3;
                                    break;
                                case 101:
                                    this.LJIIJ.mEnableSessionReuse = i3;
                                    break;
                                default:
                                    switch (i2) {
                                        case 103:
                                            AVMDLDNSParser.setIntValue(4, i3);
                                            break;
                                        case 104:
                                            AVMDLDNSParser.setIntValue(5, i3);
                                            break;
                                        case 105:
                                            try {
                                                AVMDLDNSParser.setIntValue(6, i3);
                                                break;
                                            } catch (Exception e) {
                                                e.printStackTrace();
                                                break;
                                            } catch (Throwable th) {
                                                this.LJIIZILJ.unlock();
                                                throw th;
                                            }
                                        case 106:
                                            AVMDLDNSParser.setIntValue(7, 1);
                                            break;
                                    }
                            }
                    }
            }
        } else {
            this.LJIIJ.mGlobalSpeedSampleInterval = i3;
            AVMDLDataLoader aVMDLDataLoader6 = this.LJIIIZ;
            if (aVMDLDataLoader6 != null) {
                aVMDLDataLoader6.setIntValue(7370, i3);
            }
        }
        this.LJIIZILJ.unlock();
    }

    private void LIZ(AnonymousClass767 r9, C1803676z r10) {
        if (r9 == null || r10 == null) {
            C169566lV.LJ("DataLoaderHelper", "[preload] prepare url info fail. info or taskItem is null");
            return;
        }
        String[] LIZIZ2 = r9.LIZIZ();
        String LIZIZ3 = r9.LIZIZ(15);
        AnonymousClass777 LIZIZ4 = r10.LIZIZ(LIZIZ3);
        if (LIZIZ2 == null || LIZIZ2.length <= 0) {
            C169566lV.LJ("DataLoaderHelper", "[preload] url info, urls info invalid");
            r10.LIZ(-100001);
            return;
        }
        String[] strArr = (String[]) LIZIZ2.clone();
        boolean z = false;
        if (r10.LJIIJJI != null) {
            z = r10.LJIIJJI.LJI;
        } else if (r10.LJIILIIL != null) {
            z = r10.LJIILIIL.LJII;
        }
        String[] LIZ2 = LIZ(z, strArr);
        String str = null;
        if (!(r10.LJIILIIL == null || r10.LJIILIIL.LJIILIIL == null || TextUtils.isEmpty(LIZIZ3))) {
            String LIZ3 = r10.LJIILIIL.LJIILIIL.LIZ();
            if (!TextUtils.isEmpty(LIZ3) && LIZ3.contains(LIZIZ3)) {
                str = LIZ3;
            }
            if (!TextUtils.isEmpty(str)) {
                LIZIZ3 = AnonymousClass77O.LIZ(this.LJIIJJI, str);
            }
        }
        if (LIZIZ4 == null) {
            LIZIZ4 = r10.LIZIZ(LIZIZ3);
        }
        if (LIZIZ4 == null) {
            r10.LIZ(-100001);
            return;
        }
        LIZIZ4.LIZ = LIZIZ3;
        LIZIZ4.LJ = r9;
        LIZIZ4.LIZLLL = r9.LIZIZ(5);
        LIZIZ4.LIZJ = r9.LIZJ();
        LIZIZ4.LJFF = LIZ2;
        LIZIZ4.LJIIL = str;
        LIZIZ4.LJI = AnonymousClass776.LIZ(r9, r10);
        C169566lV.LIZIZ("DataLoaderHelper", "[preload] prepare url info. videoId = " + r10.LIZ + ", key is " + LIZIZ3 + ", resolution = " + LIZIZ4.LIZJ.toString());
    }

    public static void LIZ(C1803576y r1, int i2, int i3) {
        if (!C16530lG.LIZ()) {
            r1.LIZ(i2, i3);
        } else if (i2 != 12) {
            r1.LIZ(i2, i3);
        } else {
            r1.LIZ(i2, i3);
            Keva.getRepo("ab_repo_cold_boot").storeInt("dataloader_key_int_preload_stragety", i3);
        }
    }

    private void LIZ(C1803676z r32, AnonymousClass777 r33) {
        if (r32 == null || r33 == null) {
            C169566lV.LJ("DataLoaderHelper", "[preload] start mdl preload task fail. track is null");
            return;
        }
        C169566lV.LIZ("DataLoaderHelper", "[preload] start mdl preload task.  key = " + r33.LIZ);
        String str = r33.LJIILIIL;
        String str2 = r33.LIZ;
        if (r32.LJIILJJIL != null && r32.LJIILJJIL.LJIIIIZZ != null) {
            r33.LIZIZ = LIZ(str2, r32.LIZ, r32.LJII);
            if (!TextUtils.isEmpty(r33.LIZIZ)) {
                this.LJI.LIZLLL(str2);
                this.LJI.LIZ(r32);
                if (r33.LJIIIIZZ > 0 && r33.LJIIIIZZ < r33.LJII + 102400) {
                    r33.LJIIIZ += r33.LJIIIIZZ;
                    r33.LJIIIIZZ = 0;
                }
                C169566lV.LIZ("DataLoaderHelper", "[preload] preload offset " + r33.LJIIIIZZ + " header size = " + r33.LJII + " preload size = " + r33.LJIIIZ);
                if (r33.LJIIIIZZ > 0) {
                    if (r33.LJII > 0) {
                        this.LJIIIZ.preloadResource(r33.LIZIZ, (int) r33.LJII);
                    }
                    this.LJIIIZ.preloadResource(r33.LIZIZ, (int) r33.LJIIIIZZ, (int) r33.LJIIIZ);
                } else {
                    this.LJIIIZ.preloadResource(r33.LIZIZ, (int) r33.LJIIIZ);
                }
            } else {
                r32.LIZ(-100001);
            }
            C169566lV.LIZ("DataLoaderHelper", AnonymousClass0EJ.LIZ("[preload] exect preload task by provider mode, key is %s; videoId = %s proxyurl:%s", new Object[]{str2, r32.LIZ, r33.LIZIZ}));
        } else if (r33.LJFF != null) {
            String[] strArr = r33.LJFF;
            boolean LIZ2 = r32.LIZIZ != null ? r32.LIZIZ.LIZ(AnonymousClass763.HLS) : false;
            if (strArr.length > 0 && !TextUtils.isEmpty(strArr[0]) && strArr[0].toLowerCase().contains(".m3u")) {
                LIZ2 = true;
            }
            AnonymousClass776.LIZ(r32, r33);
            r33.LIZIZ = LIZ(str2, r32.LIZ, r33.LJIIIIZZ, strArr, r33.LJIIL, r33.LJI, r32.LJII, str, LIZ2);
            if (!TextUtils.isEmpty(r33.LIZIZ)) {
                this.LJI.LIZLLL(str2);
                this.LJI.LIZ(r32);
                if (r33.LJIIIIZZ > 0 && r33.LJIIIIZZ < r33.LJII + 102400) {
                    r33.LJIIIZ += r33.LJIIIIZZ;
                    r33.LJIIIIZZ = 0;
                }
                C169566lV.LIZ("DataLoaderHelper", "[preload] preload offset " + r33.LJIIIIZZ + " header size = " + r33.LJII + " preload size = " + r33.LJIIIZ);
                if (r33.LJIIIIZZ > 0) {
                    if (r33.LJII > 0) {
                        this.LJIIIZ.preloadResource(r33.LIZIZ, (int) r33.LJII);
                    }
                    this.LJIIIZ.preloadResource(r33.LIZIZ, (int) r33.LJIIIIZZ, (int) r33.LJIIIZ);
                } else {
                    this.LJIIIZ.preloadResource(r33.LIZIZ, (int) r33.LJIIIZ);
                }
                C169566lV.LIZ("DataLoaderHelper", AnonymousClass0EJ.LIZ("[preload] exect preload task ,key is %s; videoId = %s", new Object[]{r33.LIZ, r32.LIZ}));
                return;
            }
            r32.LIZ(-100001);
        } else {
            r32.LIZ(-100001);
        }
    }

    private void LIZ(String str, String str2, long j, C178336ze r10, AnonymousClass778 r11) {
        String str3;
        if (TextUtils.isEmpty(str)) {
            C169566lV.LJ("DataLoaderHelper", "[preload] key invalid.");
        } else if (this.LJIIIZ == null || this.LIZLLL != 0) {
            C169566lV.LJ("DataLoaderHelper", "[preload] need load mdl first.");
        } else if (this.LJFF.LIZ(str) || this.LJ.LIZ(str)) {
            C169566lV.LIZIZ("DataLoaderHelper", "[preload] add the same key task.");
        } else {
            AnonymousClass768 r4 = AnonymousClass768.Undefine;
            if (!(r10 == null || r10.LIZIZ == null)) {
                r4 = r10.LIZIZ;
            }
            String str4 = Environmenu.MEDIA_UNKNOWN;
            if (r11 != null) {
                if (!TextUtils.isEmpty(r11.LIZLLL)) {
                    str4 = r11.LIZLLL;
                }
                if (!TextUtils.isEmpty(r11.LJ)) {
                    str3 = r11.LJ;
                }
                str3 = null;
            } else if (r10 != null) {
                if (!TextUtils.isEmpty(r10.LJIIJ)) {
                    str4 = r10.LJIIJ;
                }
                if (!TextUtils.isEmpty(r10.LJIIJJI)) {
                    str3 = r10.LJIIJJI;
                }
                str3 = null;
            } else {
                str4 = null;
                str3 = null;
            }
            C1803676z r2 = new C1803676z(this);
            r2.LIZ(str, r4, j);
            r2.LIZ = str2;
            r2.LJIIJJI = null;
            r2.LJIILIIL = r10;
            r2.LJIILJJIL = r11;
            r2.LJIIZILJ = str4;
            r2.LJIJ = str3;
            if (r11 != null) {
                r2.LJII = r11.LJI;
            }
            if (r10 != null) {
                r2.LIZIZ = r10.LIZ;
                r2.LJII = r10.LJIIL;
                r2.LJ = r10.LIZLLL / 1000.0f;
                r2.LJFF = r10.LJ;
                r2.LJI = r10.LJFF;
            }
            if (r2.LJIIJJI != null) {
                r2.LJIIJ = new AnonymousClass774(this, this);
                r2.LJII = -1;
            }
            if (this.LJ.LIZ(r2)) {
                LJIIJJI();
            } else {
                r2.LIZ(-1002);
            }
        }
    }

    private String[] LIZ(boolean z, String[] strArr) {
        if (!z) {
            return strArr;
        }
        for (int i2 = 0; i2 < strArr.length; i2++) {
            if (!TextUtils.isEmpty(strArr[i2])) {
                strArr[i2] = AnonymousClass77O.LIZIZ(strArr[i2], "p2p=0");
            }
        }
        return strArr;
    }

    private String[] LIZ(String[] strArr) {
        if (strArr == null || strArr.length == 0 || C173166rJ.LIZ.LJ() == 1) {
            return strArr;
        }
        for (int i2 = 0; i2 < strArr.length; i2++) {
            if (!TextUtils.isEmpty(strArr[i2])) {
                strArr[i2] = AnonymousClass77O.LIZIZ(strArr[i2], "p2p=0");
            }
        }
        return strArr;
    }

    private String LIZIZ(long j) {
        int i2 = (int) j;
        if (i2 == 0) {
            return JF4.LIZJ;
        }
        if (i2 == 1) {
            return "cellular";
        }
        if (i2 != 2) {
            return null;
        }
        return "wifi";
    }

    private String[] LIZIZ(String[] strArr) {
        if (strArr == null || strArr.length <= 1) {
            return strArr;
        }
        ArrayList arrayList = new ArrayList();
        arrayList.add(strArr[0]);
        for (int i2 = 1; i2 < strArr.length; i2++) {
            String str = strArr[i2];
            Boolean bool = true;
            int size = arrayList.size() - 1;
            while (true) {
                if (size < 0) {
                    break;
                } else if (((String) arrayList.get(size)).equals(str)) {
                    bool = false;
                    break;
                } else {
                    size--;
                }
            }
            if (bool.booleanValue()) {
                arrayList.add(str);
            }
        }
        String[] strArr2 = new String[arrayList.size()];
        arrayList.toArray(strArr2);
        return strArr2;
    }

    private void LIZJ(C1803676z r10) {
        ArrayList<C1803676z> LIZLLL2 = this.LJJIIJ.LIZLLL();
        for (int i2 = 0; i2 < LIZLLL2.size(); i2++) {
            C1803676z r1 = LIZLLL2.get(i2);
            if (!TextUtils.isEmpty(r1.LIZ) && !TextUtils.isEmpty(r10.LIZ) && r1.LIZ.equals(r10.LIZ)) {
                return;
            }
        }
        this.LJIIZILJ.lock();
        AnonymousClass773 r4 = this.LJJII;
        String str = r10.LIZ;
        r4.LIZJ.lock();
        if (!r4.LIZLLL.containsKey(str)) {
            if (r4.LIZLLL.size() >= 2) {
                r4.LIZLLL.clear();
            }
            r4.LIZLLL.put(str, new AnonymousClass77C());
        }
        C169566lV.LIZIZ("PreloadUtil", "key :" + str + " cache end.");
        AnonymousClass77C r5 = r4.LIZLLL.get(str);
        if (r5 != null) {
            r5.LJ = true;
            if (!r5.LJFF) {
                C169566lV.LIZIZ("PreloadUtil", "cached video trigger preload " + str + " cache end ");
                C173826sN.LIZ.LIZ(r5.LIZ);
                r5.LJFF = true;
            }
        } else {
            C169566lV.LIZIZ("PreloadUtil", "key :" + str + " play info null");
        }
        r4.LIZJ.unlock();
        this.LJIIZILJ.unlock();
        ArrayList<C173386rf> LJIILL2 = LJIILL(r10.LIZ);
        if (!(LJIILL2 == null || LJIILL2.size() == 0)) {
            for (int i3 = 0; i3 < LJIILL2.size(); i3++) {
                LJIILL2.get(i3).LJJIJ();
            }
        }
    }

    /* JADX DEBUG: Multi-variable search result rejected for r1v10, resolved type: boolean */
    /* JADX WARN: Multi-variable type inference failed */
    private int LJFF(int i2) {
        int i3;
        this.LJIIZILJ.lock();
        if (i2 == 7) {
            i3 = this.LJIIJ.mEnableExternDNS;
        } else if (i2 == 8) {
            i3 = this.LJIIJ.mEnableSocketReuse;
        } else if (i2 == 12) {
            i3 = this.LJJI;
        } else if (i2 == 90) {
            i3 = this.LJIIJ.mDNSMainType;
        } else if (i2 == 103) {
            i3 = AVMDLDNSParser.getIntValue(4);
        } else if (i2 == 105) {
            i3 = AVMDLDNSParser.getIntValue(6);
        } else if (i2 == 1001) {
            i3 = this.LJIIJ.mEnablePreconnect;
        } else if (i2 == 1008) {
            i3 = this.LJIJJLI;
        } else if (i2 == 1150) {
            i3 = this.LJIIJ.mEnableIOManager;
        } else if (i2 == 9009) {
            i3 = this.LJIL;
        } else if (i2 == 100) {
            i3 = this.LJIIJ.mMaxTlsVersion;
        } else if (i2 == 101) {
            i3 = this.LJIIJ.mEnableSessionReuse;
        } else if (i2 == 114) {
            i3 = this.LJJJJIZL;
        } else if (i2 != 115) {
            i3 = -1;
        } else {
            try {
                i3 = this.LJJJJJ;
            } catch (Throwable th) {
                this.LJIIZILJ.unlock();
                throw th;
            }
        }
        this.LJIIZILJ.unlock();
        return i3 == 1 ? 1 : 0;
    }

    private boolean LJIIIZ() {
        String LIZJ2;
        if (this.LIZ == null) {
            return true;
        }
        if (this.LJJIL == 1 && this.LJIIJJI != null) {
            try {
                String str = this.LJIIJJI.getApplicationInfo().dataDir + "/lib";
                if (!(str == null || (LIZJ2 = AnonymousClass77O.LIZJ(new File(str + File.separatorChar + "libavmdl.so"))) == null)) {
                    C169566lV.LJ("DataLoaderHelper", "libavmdl md5: ".concat(String.valueOf(LIZJ2)));
                }
            } catch (Exception unused) {
            }
        }
        if (this.LIZ != null && !this.LJJIII) {
            if (this.LJJJJLL == 1) {
                try {
                    this.LJJIII = this.LIZ.LIZ();
                } catch (Exception unused2) {
                    this.LJJIII = false;
                }
            }
            C169566lV.LIZIZ("DataLoaderHelper", "try to load avmdl: " + this.LJJIII);
            if (!this.LJJIII) {
                this.LJJIII = this.LIZ.LIZ();
            }
        }
        return this.LJJIII;
    }

    private void LJIIJ() {
        ArrayList arrayList = new ArrayList();
        if (this.LJFF.LIZ() > 0) {
            while (true) {
                C1803676z LIZJ2 = this.LJFF.LIZJ();
                if (LIZJ2 == null) {
                    break;
                } else if (LIZJ2.LJII >= 10000) {
                    arrayList.add(LIZJ2);
                } else {
                    if (LIZJ2.LJIIIZ != null) {
                        LIZJ2.LJIIIZ.LIZ();
                    }
                    LIZ(LIZJ2);
                }
            }
            for (int i2 = 0; i2 < arrayList.size(); i2++) {
                this.LJFF.LIZ((C1803676z) arrayList.get(i2));
            }
            arrayList.clear();
        }
        if (this.LJ.LIZ() > 0) {
            while (true) {
                C1803676z LIZJ3 = this.LJ.LIZJ();
                if (LIZJ3 == null) {
                    break;
                } else if (LIZJ3.LJII >= 10000) {
                    arrayList.add(LIZJ3);
                } else {
                    if (LIZJ3.LJIIIZ != null) {
                        LIZJ3.LJIIIZ.LIZ();
                    }
                    LIZ(LIZJ3);
                }
            }
            for (int i3 = 0; i3 < arrayList.size(); i3++) {
                this.LJ.LIZ((C1803676z) arrayList.get(i3));
            }
            arrayList.clear();
        }
        if (this.LJI.LIZ() > 0) {
            boolean z = false;
            while (true) {
                C1803676z LIZJ4 = this.LJI.LIZJ();
                if (LIZJ4 == null) {
                    break;
                } else if (LIZJ4.LJII >= 10000) {
                    arrayList.add(LIZJ4);
                } else {
                    LIZ(LIZJ4);
                    z = true;
                }
            }
            if (z) {
                this.LJIIIZ.cancelAll();
            }
            for (int i4 = 0; i4 < arrayList.size(); i4++) {
                this.LJI.LIZ((C1803676z) arrayList.get(i4));
            }
            arrayList.clear();
        }
    }

    private void LJIIJJI() {
        String str;
        String str2;
        AnonymousClass76O LIZ2;
        if (this.LJIIIZ == null) {
            C169566lV.LJ("DataLoaderHelper", "[preload] need load mdl first.");
            return;
        }
        C1803676z LIZIZ2 = this.LJ.LIZIZ();
        if (LIZIZ2 != null) {
            if (this.LJFF.LIZ(LIZIZ2)) {
                this.LJ.LIZJ();
                if (LIZIZ2.LIZIZ == null && LIZIZ2.LJIILJJIL == null) {
                    LIZIZ2.LIZ();
                    HashMap hashMap = new HashMap();
                    if (LIZIZ2.LJIIJJI != null && LIZIZ2.LJIIJJI.LIZLLL.equals("bytevc2")) {
                        hashMap.put("codec_type", "4");
                    } else if (LIZIZ2.LJIIJJI != null && LIZIZ2.LJIIJJI.LIZLLL.equals("bytevc1")) {
                        hashMap.put("codec_type", "3");
                    }
                    if (LIZIZ2.LJIIJJI != null && LIZIZ2.LJIIJJI.LJ) {
                        hashMap.put("format_type", "dash");
                    }
                    if (LIZIZ2.LJIIJJI != null && LIZIZ2.LJIIJJI.LJFF) {
                        hashMap.put("ssl", "1");
                    }
                    String str3 = null;
                    if (LIZIZ2.LJIIJJI == null || LIZIZ2.LJIIJJI.LJIIJ == null) {
                        str = null;
                        str2 = null;
                    } else {
                        str = LIZIZ2.LJIIJJI.LJIIJ.LIZ();
                        str2 = LIZIZ2.LJIIJJI.LJIIJ.LIZIZ();
                        if (LIZIZ2.LJIIJJI.LJII) {
                            str = AnonymousClass77O.LIZIZ(str);
                        }
                        LIZIZ2.LJIIL = str;
                    }
                    if (this.LIZIZ != null && TextUtils.isEmpty(LIZIZ2.LJIIL)) {
                        str = LIZIZ2.LJIIJJI.LJII ? AnonymousClass77O.LIZIZ((String) null) : null;
                        LIZIZ2.LJIIL = C50931ze.LIZ(str);
                        str2 = null;
                    }
                    C69252o6.LIZ();
                    String LIZ3 = C50931ze.LIZ(str);
                    synchronized (AnonymousClass77A.class) {
                        try {
                            LIZ2 = this.LJJIIZ.LIZ(LIZIZ2.LIZ, LIZ3);
                        } finally {
                        }
                    }
                    if (LIZ2 == null || LIZ2.LIZJ) {
                        if (LIZIZ2.LJIIJJI != null) {
                            LIZIZ2.LJIIIZ = new AnonymousClass76P(this.LJIIJJI, null);
                            LIZIZ2.LIZIZ();
                            LIZIZ2.LJIIIZ.LJFF = LIZIZ2.LJIIJJI.LJIIIZ;
                            LIZIZ2.LJIIIZ.LJI = LIZIZ2.LJIIJJI.LIZ;
                            LIZIZ2.LJIIIZ.LIZ(true);
                            AnonymousClass76P r2 = LIZIZ2.LJIIIZ;
                            if (!(LIZIZ2.LJIIJJI.LIZJ == 2 || LIZIZ2.LJIIJJI.LIZJ == 4)) {
                                str3 = str2;
                            }
                            r2.LIZ(LIZ3, str3, LIZIZ2.LJIIJJI.LIZJ);
                        }
                        return;
                    }
                    LIZIZ2.LIZIZ = LIZ2.LIZ;
                    C169566lV.LIZ("DataLoaderHelper", AnonymousClass0EJ.LIZ("[preload] get videoModel , videoId = %s", new Object[]{LIZIZ2.LIZ}));
                    LIZIZ(LIZIZ2);
                    return;
                }
                LIZIZ(LIZIZ2);
            }
        }
    }

    public static String LJIILIIL(String str) {
        if (TextUtils.isEmpty(str)) {
            return str;
        }
        C169566lV.LIZIZ("TTHelperEncode", "before encode:".concat(String.valueOf(str)));
        try {
            String queryComponentEncode = AVMDLDataLoader.queryComponentEncode(str);
            if (TextUtils.isEmpty(queryComponentEncode)) {
                C169566lV.LIZIZ("TTHelperEncode", "call native encode fail,try java");
                queryComponentEncode = URLEncoder.encode(str, "UTF-8");
            }
            C169566lV.LIZIZ("TTHelperEncode", "after encode:".concat(String.valueOf(queryComponentEncode)));
            return queryComponentEncode;
        } catch (UnsupportedEncodingException unused) {
            return null;
        }
    }

    private boolean LJIILJJIL(String str) {
        if (TextUtils.isEmpty(str)) {
            return false;
        }
        String lowerCase = str.toLowerCase();
        return !lowerCase.startsWith("mdl://") && !lowerCase.startsWith("http://127.0.0.1") && !lowerCase.startsWith("http://localhost") && !lowerCase.startsWith("file://") && !lowerCase.startsWith("/") && !lowerCase.endsWith(".mpd") && !lowerCase.contains(".mpd?") && ((this.LJJJJJL == 1 && this.LJIL) || (!lowerCase.contains(".m3u8?") && !lowerCase.endsWith(".m3u8"))) && !lowerCase.contains(".m3u?") && !lowerCase.endsWith(".m3u");
    }

    private ArrayList<C173386rf> LJIILL(String str) {
        if (TextUtils.isEmpty(str)) {
            return null;
        }
        try {
            this.LJIIIIZZ.lock();
            ArrayList<C173386rf> arrayList = this.LJII.get(str);
            if (arrayList != null) {
                ArrayList<C173386rf> arrayList2 = new ArrayList<>();
                arrayList2.addAll(arrayList);
                C169566lV.LIZ("DataLoaderHelper", "get engine ref,rawKey = " + str + " engine ref count: " + arrayList2.size());
                return arrayList2;
            }
            this.LJIIIIZZ.unlock();
            return null;
        } finally {
            this.LJIIIIZZ.unlock();
        }
    }

    public final long LIZ(long j, boolean z) {
        this.LJIIZILJ.lock();
        try {
            AVMDLDataLoader aVMDLDataLoader = this.LJIIIZ;
            if (aVMDLDataLoader == null) {
                this.LJIIZILJ.unlock();
                return -1;
            }
            long tryToClearAndGetCachesByUsedTime = aVMDLDataLoader.tryToClearAndGetCachesByUsedTime(j, z);
            this.LJIIZILJ.unlock();
            return tryToClearAndGetCachesByUsedTime;
        } catch (Throwable unused) {
            this.LJIIZILJ.unlock();
            return 0;
        }
    }

    public final String LIZ(String str, String str2, long j, String[] strArr, AnonymousClass768 r34, String str3, AnonymousClass767 r36, String str4, String str5, boolean z, boolean z2, String str6) {
        boolean z3;
        if (this.LIZLLL != 0 || TextUtils.isEmpty(str) || strArr == null || strArr.length <= 0) {
            return null;
        }
        String[] LIZ2 = LIZ((String[]) strArr.clone());
        boolean z4 = false;
        for (int i2 = 0; i2 < LIZ2.length; i2++) {
            if (!LJIILJJIL(LIZ2[i2])) {
                C169566lV.LIZIZ("DataLoaderHelper", "not support");
                return LIZ2[i2];
            }
        }
        if (this.LJIIIZ == null) {
            C169566lV.LJ("DataLoaderHelper", "start mdl first");
            return null;
        }
        if (this.LJJJJJL == 1) {
            String lowerCase = LIZ2[0].toLowerCase();
            z3 = z2 || lowerCase.contains(".m3u8?") || lowerCase.endsWith(".m3u8") || lowerCase.contains(".m3u?") || lowerCase.endsWith(".m3u");
            if (z3) {
                z = true;
            }
        } else {
            z3 = false;
        }
        this.LJIIZILJ.lock();
        try {
            String localAddr = this.LJIIIZ.getLocalAddr();
            if (TextUtils.isEmpty(localAddr)) {
                C169566lV.LJ("DataLoaderHelper", "local host error");
                return null;
            }
            String LIZ3 = LIZ(str, str2, 0, j, LIZ2, str4, str5, z3, str6);
            if (TextUtils.isEmpty(LIZ3)) {
                this.LJIIZILJ.unlock();
                return null;
            }
            StringBuffer stringBuffer = new StringBuffer();
            int i3 = this.LJJIJIIJIL;
            this.LJJIJIIJIL = i3 + 1;
            StringBuffer stringBuffer2 = new StringBuffer();
            C169566lV.LIZ("DataLoaderHelper", "proxy url, mInvalidMdlProcotol: " + this.LJIILLIIL);
            boolean z5 = this.LJJIJIL;
            if (!this.LJJL || AnonymousClass77O.LIZ(LIZ2)) {
                z4 = z5;
            } else {
                C169566lV.LIZ("DataLoaderHelper", "url not transcode, not use native mdl");
            }
            if (z || this.LJIILLIIL || !z4) {
                stringBuffer.append("http://");
                stringBuffer.append(localAddr);
                stringBuffer.append("/");
                stringBuffer.append(i3);
            } else {
                stringBuffer.append("mdl://");
                stringBuffer.append("id");
                stringBuffer.append(i3);
                stringBuffer.append("/");
            }
            stringBuffer.append(LIZ3);
            stringBuffer2.append(LIZ3);
            String auth = this.LJIIIZ.getAuth(LIZ3);
            if (!TextUtils.isEmpty(auth)) {
                stringBuffer.append("&ah=");
                stringBuffer.append(auth);
                stringBuffer2.append("&ah=");
                stringBuffer2.append(auth);
            }
            String stringBuffer3 = stringBuffer.toString();
            C169566lV.LIZ("DataLoaderHelper", "_proxyUrl: ".concat(String.valueOf(stringBuffer3)));
            this.LJIIZILJ.unlock();
            C1803676z LIZJ2 = this.LJJIIJ.LIZJ(str2);
            if (LIZJ2 == null) {
                LIZJ2 = new C1803676z(this);
            }
            AnonymousClass777 LIZIZ2 = LIZJ2.LIZIZ(str);
            if (LIZIZ2 != null) {
                LIZIZ2.LIZ = str;
                LIZJ2.LIZ = str2;
                LIZIZ2.LIZIZ = stringBuffer3;
                LIZIZ2.LIZJ = r34;
                LIZIZ2.LIZLLL = str3;
                LIZIZ2.LJ = r36;
                LIZIZ2.LJFF = LIZ2;
                LIZIZ2.LJIIL = str4;
                LIZIZ2.LJI = str5;
                this.LJJIIJ.LIZ(LIZJ2);
            }
            return stringBuffer3;
        } finally {
            this.LJIIZILJ.unlock();
        }
    }

    public final String LIZ(String str, String str2, String[] strArr, int i2, String str3) {
        if (TextUtils.isEmpty(str) || strArr == null || strArr.length <= 0) {
            return null;
        }
        return LIZ(str, str2, 0L, 0L, strArr, str3, (String) null, 0, (String) null, false, (String) null, i2);
    }

    public final void LIZ(int i2) {
        int i3;
        this.LJIIZILJ.lock();
        if (this.LJIIJ.mLoaderType == i2 || (i3 = this.LJJJJLI) == i2) {
            this.LJIIZILJ.unlock();
        } else if (i3 > 0) {
            this.LJIIZILJ.unlock();
        } else {
            try {
                this.LJIIIZ.setIntValue(7227, i2);
            } catch (Exception unused) {
                C169566lV.LIZIZ("DataLoaderHelper", "set backup loader type failed");
            } finally {
                this.LJIIZILJ.unlock();
            }
        }
    }

    /* JADX WARNING: Can't wrap try/catch for region: R(2:27|28) */
    /* JADX WARNING: Code restructure failed: missing block: B:28:?, code lost:
        X.C169566lV.LJ("DataLoaderHelper", "setLongValue failed, key: " + r4 + ", value: " + r5);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:31:0x0091, code lost:
        r1 = move-exception;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:32:0x0092, code lost:
        r3.LJIIZILJ.unlock();
     */
    /* JADX WARNING: Code restructure failed: missing block: B:33:0x0097, code lost:
        throw r1;
     */
    /* JADX WARNING: Failed to process nested try/catch */
    /* JADX WARNING: Missing exception handler attribute for start block: B:27:0x006f */
    public final void LIZ(int i2, long j) {
        this.LJIIZILJ.lock();
        C169566lV.LIZIZ("DataLoaderHelper", "setLongValue key = " + i2 + ", value = " + j);
        int i3 = -1;
        if (i2 == 62) {
            i3 = 1100;
        } else if (i2 == 1142) {
            this.LJIIJ.mP2PStragetyLevel = j;
        } else if (i2 == 1144) {
            this.LJIIJ.mConnectPoolStragetyValue = j;
        } else if (i2 == 1152) {
            this.LJIIJ.mMonitorTimeInternal = j;
        } else if (i2 != 1153) {
            switch (i2) {
                case 22:
                    i3 = 7210;
                    break;
                case 23:
                    i3 = 7211;
                    break;
                case 24:
                    i3 = 7212;
                    break;
                case 25:
                    i3 = 7213;
                    break;
                case 26:
                    i3 = 7214;
                    break;
                case 27:
                    i3 = 7215;
                    break;
                case 28:
                    i3 = 7338;
                    break;
            }
        } else {
            this.LJIIJ.mMonitorMinAllowLoadSize = j;
        }
        AVMDLDataLoader aVMDLDataLoader = this.LJIIIZ;
        if (aVMDLDataLoader != null) {
            aVMDLDataLoader.setLongValue(i3, j);
        }
        this.LJIIZILJ.unlock();
    }

    public final void LIZ(int i2, String str) {
        C169566lV.LIZIZ("DataLoaderHelper", "setStringValue key = " + i2 + ", value = " + str);
        this.LJIIZILJ.lock();
        if (i2 != 0) {
            if (i2 == 107) {
                AVMDLDNSParser.setStringValue(8, str);
            } else if (i2 == 108) {
                AVMDLDNSParser.setStringValue(9, str);
            } else if (i2 == 1106) {
                this.LJIIJ.mVdpABTestId = str;
            } else if (i2 != 1107) {
                switch (i2) {
                    case 0:
                        break;
                    case 102:
                        this.LJIIJ.mNetCacheDir = str;
                        break;
                    case 111:
                        this.LJIIJ.mDownloadDir = str;
                        break;
                    case 514:
                        this.LJIIJ.mLiveContainerString = str;
                        break;
                    case 1149:
                        this.LJIIJ.mNetSchedulerConfigStr = str;
                        break;
                    case 1165:
                        this.LJIIJ.mDynamicPreconnectConfigStr = str;
                        break;
                    case 1500:
                        this.LJIIJ.mMdlExtensionOptsStr = str;
                        break;
                    case 1502:
                        this.LJIIJ.mTemporaryOptStr = str;
                        break;
                    case 2007:
                        this.LJIIJ.mStoStrategyConfig = str;
                        break;
                    case 2101:
                        this.LJIIJ.mVdpExtGlobalInfo = str;
                        break;
                    case 9010:
                        this.LJIIJ.mSocketTraingCenterConfigStr = str;
                        break;
                    case 9012:
                        this.LJIIJ.mP2PConfigStr = str;
                        break;
                    default:
                        switch (i2) {
                            case 1506:
                            case 1507:
                            case 1508:
                                if (!TextUtils.isEmpty(str)) {
                                    if (TextUtils.isEmpty(this.LJIIJ.mCustomUA)) {
                                        this.LJIIJ.mCustomUA = str;
                                    } else {
                                        StringBuilder sb = new StringBuilder();
                                        AVMDLDataLoaderConfigure aVMDLDataLoaderConfigure = this.LJIIJ;
                                        aVMDLDataLoaderConfigure.mCustomUA = sb.append(aVMDLDataLoaderConfigure.mCustomUA).append(",").append(str).toString();
                                    }
                                }
                                C169566lV.LIZIZ("DataLoaderHelper", "cur custom UA" + this.LJIIJ.mCustomUA);
                                break;
                            default:
                                switch (i2) {
                                    case 9002:
                                        this.LJIIJ.mSettingsDomain = str;
                                        break;
                                    case 9003:
                                        this.LJIIJ.mDmDomain = str;
                                        break;
                                    case 9004:
                                        this.LJIIJ.mForesightDomain = str;
                                        break;
                                    case 9005:
                                        this.LJIIJ.mDomains = str;
                                        break;
                                    case 9006:
                                        try {
                                            this.LJIIJ.mKeyDomain = str;
                                            break;
                                        } catch (Exception unused) {
                                            break;
                                        } catch (Throwable th) {
                                            this.LJIIZILJ.unlock();
                                            throw th;
                                        }
                                    case 9007:
                                        this.LJIIJ.mKeyToken = str;
                                        break;
                                }
                        }
                }
            } else {
                this.LJIIJ.mVdpGroupId = str;
            }
            this.LJIIZILJ.unlock();
        }
        this.LJIIJ.mCacheDir = str;
        this.LJIIZILJ.unlock();
    }

    public final void LIZ(int i2, String str, long j) {
        if (this.LIZLLL != 0) {
            C169566lV.LIZIZ("DataLoaderHelper", "dataloader not started, not allow set play info");
        } else if (this.LJJJJZ > 0) {
            this.LJIIZILJ.lock();
            if (this.LJJII.LIZ > 0 && this.LJJII.LIZIZ > 0) {
                AnonymousClass773 r2 = this.LJJII;
                r2.LIZJ.lock();
                if (!r2.LIZLLL.containsKey(str)) {
                    if (r2.LIZLLL.size() >= 2) {
                        r2.LIZLLL.clear();
                    }
                    AnonymousClass77C r1 = new AnonymousClass77C();
                    r1.LIZLLL = str;
                    r2.LIZLLL.put(str, r1);
                }
                AnonymousClass77C r12 = r2.LIZLLL.get(str);
                if (r12 != null) {
                    if (i2 == 22) {
                        r12.LIZJ = j;
                    } else if (i2 == 23) {
                        r12.LIZIZ = j;
                        r2.LIZ(str);
                    } else if (i2 == 25) {
                        r2.LIZ("buffering", str);
                    } else if (i2 == 27) {
                        r12.LIZ = j;
                        r2.LIZ(str);
                    }
                }
                r2.LIZJ.unlock();
            }
            this.LJIIZILJ.unlock();
        }
    }

    public final void LIZ(long j) {
        AnonymousClass779 r0 = this.LIZIZ;
        if (r0 != null) {
            r0.LIZ(9, 0, j, "");
        }
    }

    public final synchronized void LIZ(AbstractC169756lo r2) {
        this.LJIILJJIL = r2;
    }

    public final void LIZ(C173386rf r5, String str) {
        if (!TextUtils.isEmpty(str)) {
            try {
                this.LJIIIIZZ.lock();
                ArrayList<C173386rf> arrayList = this.LJII.get(str);
                if (arrayList == null) {
                    arrayList = new ArrayList<>();
                    this.LJII.put(str, arrayList);
                }
                if (!arrayList.contains(r5)) {
                    arrayList.add(r5);
                    C169566lV.LIZ("DataLoaderHelper", "add engine ref,rawKey = " + str + " engine ref count: " + arrayList.size());
                }
            } finally {
                this.LJIIIIZZ.unlock();
            }
        }
    }

    public final void LIZ(C178336ze r20) {
        if (r20 == null || r20.LIZ == null || r20.LIZIZ == null) {
            C169566lV.LJ("DataLoaderHelper", "[preload] addTask videoModel input invalid");
            if (r20 != null) {
                r20.LIZ();
                return;
            }
            return;
        }
        String str = null;
        if (r20.LJIIIIZZ > 0) {
            String LJIIL2 = r20.LIZ.LJIIL();
            if (!TextUtils.isEmpty(LJIIL2)) {
                C173286rV.LIZ.LIZIZ().addMedia(LJIIL2, null, null, false);
                HashMap hashMap = new HashMap();
                if (!TextUtils.isEmpty("")) {
                    hashMap.put("extra_config", "");
                }
                C173276rU r3 = new C173276rU(null);
                r3.LIZJ = r20.LIZ;
                Map<String, Integer> LIZ2 = C173286rV.LIZ.LIZ(r20.LIZ, 2, hashMap, r3);
                if (LIZ2 != null) {
                    int intValue = LIZ2.get("video").intValue();
                    C169566lV.LIZ("DataLoaderHelper", "[GearStrategy] gear strategy addTask videoBitrate=" + intValue + " audioBitrate=" + LIZ2.get(DataType.AUDIO).intValue());
                    List<AnonymousClass767> LIZIZ2 = r20.LIZ.LIZIZ();
                    if (intValue > 0 && LIZIZ2 != null) {
                        AnonymousClass768 r9 = r20.LIZIZ;
                        HashMap hashMap2 = new HashMap();
                        Iterator<AnonymousClass767> it = LIZIZ2.iterator();
                        while (true) {
                            if (!it.hasNext()) {
                                break;
                            }
                            AnonymousClass767 next = it.next();
                            if (next != null && next.LIZ() != AnonymousClass766.LIZIZ && next.LIZJ() != null && ((long) next.LIZ(3)) == ((long) intValue)) {
                                r9 = next.LIZJ();
                                if (!TextUtils.isEmpty(next.LIZIZ(32))) {
                                    hashMap2.put(32, next.LIZIZ(32));
                                }
                            }
                        }
                        r20.LIZIZ = r9;
                        if (hashMap2.size() > 0) {
                            r20.LJIIIZ = hashMap2;
                        }
                    }
                }
            }
        }
        AnonymousClass767 LIZ3 = r20.LIZ.LIZ(r20.LIZIZ, r20.LJIIIZ, true);
        if (LIZ3 != null) {
            str = LIZ3.LIZIZ(15);
        }
        if (TextUtils.isEmpty(str)) {
            C169566lV.LJ("DataLoaderHelper", "[preload] key invalid.");
            r20.LIZ();
            return;
        }
        String LIZIZ3 = r20.LIZ.LIZIZ(2);
        if (TextUtils.isEmpty(LIZIZ3)) {
            C169566lV.LJ("DataLoaderHelper", "[preload] videoId invalid.");
            r20.LIZ();
            return;
        }
        this.LJIIZILJ.lock();
        try {
            LIZ(str, LIZIZ3, r20.LIZJ, r20, (AnonymousClass778) null);
        } finally {
            this.LJIIZILJ.unlock();
        }
    }

    public final void LIZ(C1803676z r3) {
        if (r3 != null && !r3.LJIILL) {
            r3.LJIILL = true;
            if (r3.LIZJ() != null) {
                r3.LIZJ().LIZ(new C178326zd(5));
            }
        }
    }

    public final void LIZ(AnonymousClass778 r8) {
        this.LJIIZILJ.lock();
        try {
            LIZ(r8.LIZ, r8.LIZJ, r8.LJFF, (C178336ze) null, r8);
        } finally {
            this.LJIIZILJ.unlock();
        }
    }

    public final void LIZ(String str) {
        AnonymousClass779 r0 = this.LIZIZ;
        if (r0 != null) {
            r0.LIZ(8, 0, 0, str);
        }
    }

    public final void LIZ(String str, String str2) {
        AVMDLDNSParser.getInstance().setBackUpIP(str, str2);
        if (!TextUtils.isEmpty(str) && !TextUtils.isEmpty(str2)) {
            this.LJJJJJ = 1;
        }
    }

    public final void LIZ(String str, String str2, String str3, long j) {
        if (TextUtils.isEmpty(str3)) {
            C169566lV.LJ("DataLoaderHelper", "[preload] url invalid.");
            return;
        }
        LIZ(new AnonymousClass778(str, str2, j, new String[]{str3}));
    }

    public final void LIZ(String str, String str2, String[] strArr, long j, String str3) {
        if (strArr == null || strArr.length == 0) {
            C169566lV.LJ("DataLoaderHelper", "urls invalid.");
        } else {
            LIZ(new AnonymousClass778(str, str2, j, strArr, str3));
        }
    }

    public final void LIZ(JSONObject jSONObject, long j) {
        String next;
        if (jSONObject == null) {
            C169566lV.LJ("DataLoaderHelper", "ip direct info invalid");
        } else if (C49891xy.LIZ == -1 || 1000 * j >= C49891xy.LIZ) {
            this.LJIIZILJ.lock();
            try {
                Iterator<String> keys = jSONObject.keys();
                do {
                    next = keys.next();
                    JSONArray optJSONArray = jSONObject.optJSONArray(next);
                    String str = "";
                    for (int i2 = 0; i2 < optJSONArray.length(); i2++) {
                        str = str + optJSONArray.optString(i2);
                        if (i2 < optJSONArray.length() - 1) {
                            str = str + ",";
                        }
                    }
                    AVMDLDNSParser.updateDNSInfo(next, str, j);
                    if (!keys.hasNext()) {
                        break;
                    }
                } while (!TextUtils.isEmpty(next));
            } catch (Exception e) {
                C169566lV.LJ("DataLoaderHelper", e.toString());
            } finally {
                this.LJIIZILJ.unlock();
            }
        } else {
            C169566lV.LJ("DataLoaderHelper", "network did change, dnsinfo is invalid");
        }
    }

    public final void LIZIZ(int i2) {
        LIZ(this, 512, i2);
    }

    /* JADX WARNING: Removed duplicated region for block: B:100:0x030f  */
    /* JADX WARNING: Removed duplicated region for block: B:72:0x0231  */
    public final void LIZIZ(C1803676z r32) {
        long j;
        int i2;
        int i3;
        int i4;
        long j2;
        long j3;
        long j4;
        long j5;
        long j6;
        long j7;
        C1803576y r8 = this;
        if (r32 == null) {
            LJIIJJI();
        } else if (r8.LJIIIZ == null) {
            C169566lV.LJ("DataLoaderHelper", "[preload] need load mdl first.");
        } else {
            Map<Integer, String> map = null;
            if (!(r32.LJIIJJI == null || r32.LJIIJJI.LJIIIIZZ == null)) {
                map = r32.LJIIJJI.LJIIIIZZ;
            }
            if (!(r32.LJIILIIL == null || r32.LJIILIIL.LJIIIZ == null)) {
                map = r32.LJIILIIL.LJIIIZ;
            }
            r8.LJFF.LIZIZ(r32);
            long j8 = r32.LIZLLL;
            if (r32.LIZIZ != null) {
                ArrayList arrayList = new ArrayList();
                if (r32.LIZIZ.LIZ(AnonymousClass763.DASH)) {
                    if (r32.LIZIZ.LJII().equals("segment_base")) {
                        AnonymousClass767 LIZ2 = r32.LIZIZ.LIZ(r32.LJIIIIZZ, AnonymousClass766.LIZ, map, true);
                        AnonymousClass767 LIZ3 = r32.LIZIZ.LIZ(r32.LJIIIIZZ, AnonymousClass766.LIZIZ, map, true);
                        j8 = r32.LIZLLL;
                        j = r32.LIZLLL;
                        if (LIZ2 == null || LIZ3 == null) {
                            j2 = 0;
                            j3 = 0;
                            i2 = 0;
                            j4 = 0;
                            j5 = 0;
                        } else {
                            C54042Bd LJ2 = LIZ3.LJ();
                            C54042Bd LJ3 = LIZ2.LJ();
                            long j9 = r32.LJIILIIL != null ? r32.LJIILIIL.LJI : 0;
                            if (LIZ3.LJJIIZI != null) {
                                HashMap<Double, Long> hashMap = LIZ3.LJJIIZI;
                                double d = (double) j9;
                                Double.isNaN(d);
                                double d2 = d / 1000.0d;
                                if (!(hashMap.get(Double.valueOf(d2)) == null || LIZ2.LJJIIZI == null || LIZ2.LJJIIZI.get(Double.valueOf(d2)) == null)) {
                                    j3 = LIZ3.LJJIIZI.get(Double.valueOf(d2)).longValue();
                                    j4 = LIZ2.LJJIIZI.get(Double.valueOf(d2)).longValue();
                                    C169566lV.LIZ("DataLoaderHelper", "[preload] preload millisecondOffset ".concat(String.valueOf(j9)));
                                    C169566lV.LIZ("DataLoaderHelper", "[preload] preload audioOffset ".concat(String.valueOf(j3)));
                                    C169566lV.LIZ("DataLoaderHelper", "[preload] preload videoOffset ".concat(String.valueOf(j4)));
                                    j6 = 0;
                                    if (j9 > j6 || LJ2 == null) {
                                        j7 = 0;
                                        j2 = 0;
                                    } else {
                                        if (j3 == j6) {
                                            j3 = (long) LJ2.LIZ(((float) j9) / 1000.0f);
                                        }
                                        j2 = (long) (LJ2.LIZIZ + 102400);
                                        C169566lV.LIZ("DataLoaderHelper", "[preload] preload audio header size ".concat(String.valueOf(j2)));
                                        j7 = 0;
                                    }
                                    if (j9 > j7 || LJ3 == null) {
                                        j5 = 0;
                                    } else {
                                        if (j4 == j7) {
                                            j4 = (long) LJ3.LIZ(((float) j9) / 1000.0f);
                                        }
                                        j5 = ((long) LJ3.LIZIZ) > r32.LIZLLL ? (long) LJ3.LIZIZ : r32.LIZLLL;
                                        C169566lV.LIZ("DataLoaderHelper", "[preload] preload video header size ".concat(String.valueOf(j5)));
                                    }
                                    if (r32.LJ > 0.0f || LJ2 == null || LJ3 == null) {
                                        i2 = 0;
                                    } else {
                                        j8 = (long) LJ3.LIZ(r32.LJ);
                                        j = (long) LJ2.LIZ(r32.LJ);
                                        C169566lV.LIZ("DataLoaderHelper", "[preload] preload second" + r32.LJ + " preload size audio = " + j + " ,video = " + j8);
                                        C169566lV.LIZ("DataLoaderHelper", "[preload] preload audioOffset ".concat(String.valueOf(j3)));
                                        C169566lV.LIZ("DataLoaderHelper", "[preload] preload videoOffset ".concat(String.valueOf(j4)));
                                        if (r32.LJFF > 0 && j8 + j < r32.LJFF) {
                                            r32.LIZLLL = r32.LJFF;
                                            C169566lV.LIZ("DataLoaderHelper", "[preload] preload size limit to" + r32.LJFF);
                                            j8 = 0;
                                            j = 0;
                                        }
                                        if (r32.LJI <= 0 || j8 + j <= r32.LJI) {
                                            i2 = 1;
                                        } else {
                                            r32.LIZLLL = r32.LJI;
                                            C169566lV.LIZ("DataLoaderHelper", "[preload] preload size limit to" + r32.LJI);
                                            i2 = 1;
                                            j8 = 0;
                                            j = 0;
                                        }
                                    }
                                    if (j9 <= 0) {
                                        j8 = r32.LIZLLL;
                                        r8 = this;
                                        if (r8.LJJJZ > 0) {
                                            j = (r32.LIZLLL * ((long) r8.LJJJZ)) / 100;
                                            int i5 = r8.LJJJLZIJ;
                                            if (i5 > 0 && j < ((long) i5)) {
                                                j = (long) i5;
                                            }
                                        } else {
                                            j = r32.LIZLLL;
                                        }
                                    } else {
                                        r8 = this;
                                        if (j8 <= 0 || j <= 0 || (j8 == r32.LIZLLL && j == r32.LIZLLL)) {
                                            C169566lV.LIZ("DataLoaderHelper", "[preload] preload size  audio = " + j + " ,video = " + j8);
                                            int LIZ4 = LIZ2.LIZ(3);
                                            int LIZ5 = LIZ3.LIZ(3);
                                            if (LIZ4 > 0 && LIZ5 > 0) {
                                                float f = (float) LIZ4;
                                                float f2 = (float) (LIZ4 + LIZ5);
                                                j8 = (long) (((float) r32.LIZLLL) * (f / f2));
                                                j = (long) (((float) r32.LIZLLL) * (((float) LIZ5) / f2));
                                            }
                                            i2 = 0;
                                        }
                                    }
                                }
                            }
                            j4 = 0;
                            j6 = 0;
                            j3 = 0;
                            if (j9 > j6) {
                            }
                            j7 = 0;
                            j2 = 0;
                            if (j9 > j7) {
                            }
                            j5 = 0;
                            if (r32.LJ > 0.0f) {
                            }
                            i2 = 0;
                            if (j9 <= 0) {
                            }
                        }
                        C169566lV.LIZ("DataLoaderHelper", "[preload] preload size  audio = " + j + " ,video = " + j8);
                        if (r8.LJJJ && LIZ3 != null) {
                            String LIZIZ2 = LIZ3.LIZIZ(15);
                            if (!TextUtils.isEmpty(LIZIZ2)) {
                                arrayList.add(LIZ3);
                                AnonymousClass777 LIZIZ3 = r32.LIZIZ(LIZIZ2);
                                LIZIZ3.LJIIIZ = j;
                                LIZIZ3.LJII = j2;
                                LIZIZ3.LJIIIIZZ = j3;
                                r8.LIZ(LIZ3, r32);
                                r8.LIZ(r32, LIZIZ3);
                            }
                        }
                        if (LIZ2 != null) {
                            String LIZIZ4 = LIZ2.LIZIZ(15);
                            if (!TextUtils.isEmpty(LIZIZ4)) {
                                arrayList.add(LIZ2);
                                AnonymousClass777 LIZIZ5 = r32.LIZIZ(LIZIZ4);
                                LIZIZ5.LJIIIZ = j8;
                                LIZIZ5.LJII = j5;
                                LIZIZ5.LJIIIIZZ = j4;
                                r8.LIZ(LIZ2, r32);
                                r8.LIZ(r32, LIZIZ5);
                            }
                        }
                        if (!r8.LJJJ && LIZ3 != null) {
                            String LIZIZ6 = LIZ3.LIZIZ(15);
                            if (!TextUtils.isEmpty(LIZIZ6)) {
                                arrayList.add(LIZ3);
                                AnonymousClass777 LIZIZ7 = r32.LIZIZ(LIZIZ6);
                                LIZIZ7.LJIIIZ = j;
                                LIZIZ7.LJII = j2;
                                LIZIZ7.LJIIIIZZ = j3;
                                r8.LIZ(LIZ3, r32);
                                r8.LIZ(r32, LIZIZ7);
                            }
                        }
                    }
                    j = 0;
                    i2 = 0;
                } else {
                    AnonymousClass767 LIZ6 = r32.LIZIZ.LIZ(r32.LJIIIIZZ, map, true);
                    if (LIZ6 != null) {
                        String LIZIZ8 = LIZ6.LIZIZ(15);
                        if (!TextUtils.isEmpty(LIZIZ8)) {
                            arrayList.add(LIZ6);
                            AnonymousClass777 LIZIZ9 = r32.LIZIZ(LIZIZ8);
                            C54042Bd LJ4 = LIZ6.LJ();
                            long j10 = r32.LJIILIIL != null ? r32.LJIILIIL.LJI : 0;
                            if (j10 <= 0 || LJ4 == null) {
                                i3 = 0;
                                i4 = 0;
                            } else {
                                i3 = LJ4.LIZ(((float) j10) / 1000.0f);
                                i4 = LJ4.LIZIZ + 5120;
                            }
                            long j11 = r32.LIZLLL;
                            if (r32.LJ <= 0.0f || LJ4 == null) {
                                j = 0;
                                i2 = 0;
                            } else {
                                int LIZ7 = LJ4.LIZ(r32.LJ);
                                if (LIZ7 > 0) {
                                    j11 = (long) LIZ7;
                                    i2 = 1;
                                } else {
                                    i2 = 0;
                                }
                                j = 0;
                                if (r32.LJFF > 0 && j11 < r32.LJFF) {
                                    j11 = r32.LJFF;
                                    i2 = 0;
                                }
                                if (r32.LJI > 0 && j11 > r32.LJI) {
                                    j11 = r32.LJI;
                                    i2 = 0;
                                }
                                C169566lV.LIZ("DataLoaderHelper", "[preload] preload second" + r32.LJ + " ,video size = " + j11);
                            }
                            if (LIZ6.LIZ() == AnonymousClass766.LIZ) {
                                j8 = j11;
                            } else {
                                j = j11;
                            }
                            LIZIZ9.LJIIIZ = j11;
                            LIZIZ9.LJIIIIZZ = (long) i3;
                            LIZIZ9.LJII = (long) i4;
                            r8.LIZ(LIZ6, r32);
                            r8.LIZ(r32, LIZIZ9);
                        }
                    }
                    j = 0;
                    i2 = 0;
                }
                if (arrayList.size() == 0) {
                    C169566lV.LIZ("DataLoaderHelper", "invalid videoModel");
                    LJIIJJI();
                    return;
                } else if (r32.LIZJ() != null) {
                    C178326zd r1 = new C178326zd(1);
                    r1.LIZIZ = arrayList;
                    r32.LIZJ().LIZ(r1);
                }
            } else {
                if (r32.LJIILJJIL != null && r32.LJIILJJIL.LJII != null && r32.LJIILJJIL.LJII.length > 0) {
                    AnonymousClass777 r2 = r32.LJIJI.get(0);
                    r2.LJFF = r32.LJIILJJIL.LJII;
                    r2.LJIIIZ = r32.LIZLLL;
                    r2.LIZJ = r32.LJIIIIZZ;
                    r2.LJIIL = r32.LJIILJJIL.LIZIZ;
                    r2.LJIILIIL = r8.LIZ(r32.LJIILJJIL.LJIIJ);
                    r8.LIZ(r32, r2);
                } else if (!(r32.LJIILJJIL == null || r32.LJIILJJIL.LJIIIIZZ == null)) {
                    AnonymousClass777 r3 = r32.LJIJI.get(0);
                    r3.LIZIZ = r8.LIZ(r3.LIZ, r32.LIZ, r32.LJII);
                    r3.LJIIIZ = r32.LIZLLL;
                    r3.LIZJ = r32.LJIIIIZZ;
                    r3.LJFF = r32.LJIILJJIL.LJII;
                    r3.LJIIL = r32.LJIILJJIL.LIZIZ;
                    r3.LJIILIIL = r8.LIZ(r32.LJIILJJIL.LJIIJ);
                    r8.LIZ(r32, r3);
                    C169566lV.LIZ("DataLoaderHelper", AnonymousClass0EJ.LIZ("exect preload task by provider mode, key is %s; videoId = %s proxyurl:%s", new Object[]{r3.LIZ, r32.LIZ, r3.LIZIZ}));
                }
                j = 0;
                i2 = 0;
            }
            if (r32.LIZJ() != null) {
                C178326zd r22 = new C178326zd(6);
                r22.LJII = i2;
                r22.LJIIIZ = j8;
                r22.LJIIIIZZ = j;
                r32.LIZJ().LIZ(r22);
                C169566lV.LIZ("DataLoaderHelper", "[preload] notify info. type = ".concat(String.valueOf(i2)));
            }
            LJIIJJI();
        }
    }

    public final void LIZIZ(String str) {
        AVMDLDataLoader aVMDLDataLoader;
        if (this.LIZLLL == 0 && !TextUtils.isEmpty(str)) {
            this.LJIIZILJ.lock();
            try {
                Uri parse = Uri.parse(str);
                int port = parse.getPort();
                if (port == -1) {
                    port = 80;
                    if (str.startsWith("https")) {
                        port = 443;
                    }
                }
                if (!(parse == null || (aVMDLDataLoader = this.LJIIIZ) == null)) {
                    aVMDLDataLoader.preConnectByHost(parse.getHost(), port);
                }
            } finally {
                this.LJIIZILJ.unlock();
            }
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:17:0x002f, code lost:
        if (com.ss.mediakit.medialoader.AVMDLDataLoader.initWithLibraryManager() == 0) goto L_0x0031;
     */
    /* JADX WARNING: Removed duplicated region for block: B:21:0x0038  */
    public final boolean LIZIZ() {
        boolean z;
        ClassLoader classLoader;
        if (this.LJIIIZ != null) {
            return true;
        }
        if (!AVMDLDataLoader.isVCBasekitStaticLinked()) {
            VCBaseKitLoader.loadLibrary();
        }
        if (this.LJJLI == 1) {
            if (!(this.LIZ == null && this.LIZIZ == null)) {
                AVMDLLibraryManagerWrapper.setLibraryLoader(new C173836sO(this));
            }
            if (this.LJJJJLL == 1) {
                AVMDLLibraryManagerWrapper.setEnableV2(true);
            }
        }
        if (!LJIIIZ()) {
            C169566lV.LJ("DataLoaderHelper", AnonymousClass0EJ.LIZ("library load fail", new Object[0]));
            return false;
        }
        if (this.LIZ == null && this.LJJJJLL == 1 && this.LIZIZ != null) {
            C169566lV.LIZIZ("DataLoaderHelper", "try to load mdlv2");
            AVMDLDataLoader.loadAVMDLBaseLibrary();
            this.LIZIZ.LIZ();
            C169566lV.LIZIZ("DataLoaderHelper", "load mdlv2: false");
        }
        if (AVMDLDataLoader.init(this.LIZ != null, this.LJJIJIIJI != 0) != 0) {
            C169566lV.LJ("DataLoaderHelper", AnonymousClass0EJ.LIZ("library has not been loaded", new Object[0]));
            return false;
        }
        C169566lV.LJ("P2PLIB", AnonymousClass0EJ.LIZ("loadertype:%d NeedDLLoadP2PLib:%d, liveloaderType: %d", new Object[]{Integer.valueOf(this.LJIIJ.mLoaderType), Integer.valueOf(this.LJJIJIIJI), Integer.valueOf(this.LJIIJ.mLiveLoaderType)}));
        if (this.LJJIJIIJI == 0 && ((this.LJIIJ.mLoaderType > 0 || (this.LJIIJ.mLiveLoaderType != 10000 && this.LJIIJ.mLiveLoaderType >= 7)) && this.LIZIZ != null)) {
            if (this.LJJLIIIIJ == 1) {
                C169566lV.LJ("P2PLIB", "delay to load p2p lib");
                z = true;
                if (this.LJIIJ.mEnableByteMediaNetLoader > 0) {
                    C169566lV.LIZIZ("ByteMediaNet", "enable byte media try init env, context:" + this.LJIIJJI + "  classloader:" + this.LJJIIJZLJL);
                    Context context = this.LJIIJJI;
                    if (!(context == null || (classLoader = this.LJJIIJZLJL) == null)) {
                        AVMDLDataLoader.initByteMediaNetEnv(context, classLoader);
                        C169566lV.LIZIZ("ByteMediaNet", "init byte media env end");
                    }
                }
                AVMDLDataLoader instance = AVMDLDataLoader.getInstance();
                this.LJIIIZ = instance;
                instance.setConfigure(this.LJIIJ);
                this.LJIIIZ.setListener(this);
                this.LJIIIZ.setStartCompleteListener(this);
                if (z && this.LIZIZ != null) {
                    this.LJIIIZ.setPluginLibraryLoader(new C173846sP(this));
                }
                this.LJIIL = new C173076rA(this, (byte) 0);
                return true;
            }
            C169566lV.LJ("P2PLIB", "try to load p2p lib");
            this.LIZIZ.LIZ();
            C169566lV.LJ("P2PLIB", AnonymousClass0EJ.LIZ("load p2p lib result:%d", new Object[]{0}));
        }
        z = false;
        if (this.LJIIJ.mEnableByteMediaNetLoader > 0) {
        }
        try {
            AVMDLDataLoader instance2 = AVMDLDataLoader.getInstance();
            this.LJIIIZ = instance2;
            instance2.setConfigure(this.LJIIJ);
            this.LJIIIZ.setListener(this);
            this.LJIIIZ.setStartCompleteListener(this);
            this.LJIIIZ.setPluginLibraryLoader(new C173846sP(this));
            this.LJIIL = new C173076rA(this, (byte) 0);
            return true;
        } catch (Exception unused) {
            return false;
        }
    }

    public final long LIZJ(int i2) {
        long j;
        this.LJIIZILJ.lock();
        long j2 = -1;
        if (i2 != 1003) {
            if (i2 == 1152) {
                j = this.LJIIJ.mMonitorTimeInternal;
            } else if (i2 != 1153) {
                this.LJIIZILJ.unlock();
                return -1;
            } else {
                try {
                    j = this.LJIIJ.mMonitorMinAllowLoadSize;
                } catch (Throwable th) {
                    this.LJIIZILJ.unlock();
                    throw th;
                }
            }
            this.LJIIZILJ.unlock();
            return j;
        }
        if (this.LJJIJIL) {
            j2 = this.LJIILL;
        }
        this.LJIIZILJ.unlock();
        return j2;
    }

    public final JSONObject LIZJ(String str) {
        String cDNLog;
        if (this.LIZLLL != 0 || TextUtils.isEmpty(str)) {
            return null;
        }
        this.LJIIZILJ.lock();
        try {
            AVMDLDataLoader aVMDLDataLoader = this.LJIIIZ;
            if (!(aVMDLDataLoader == null || (cDNLog = aVMDLDataLoader.getCDNLog(str)) == null)) {
                JSONObject jSONObject = new JSONObject(cDNLog);
                C169566lV.LIZIZ("DataLoaderHelper", "get cdn log suc" + jSONObject.toString());
                this.LJIIZILJ.unlock();
                return jSONObject;
            }
        } catch (Exception e) {
            C169566lV.LIZIZ("DataLoaderHelper", "get log exception" + e.toString());
        } catch (Throwable th) {
            this.LJIIZILJ.unlock();
            throw th;
        }
        this.LJIIZILJ.unlock();
        return null;
    }

    public final boolean LIZJ() {
        this.LJIIZILJ.lock();
        try {
            return this.LIZLLL == 0;
        } finally {
            this.LJIIZILJ.unlock();
        }
    }

    public final int LIZLLL(int i2) {
        return !C16530lG.LIZ() ? LJFF(i2) : i2 != 12 ? LJFF(i2) : Keva.getRepo("ab_repo_cold_boot").getInt("dataloader_key_int_preload_stragety", -1);
    }

    public final long LIZLLL(String str) {
        long j = 0;
        if (this.LIZLLL != 0) {
            return 0;
        }
        this.LJIIZILJ.lock();
        try {
            AVMDLDataLoader aVMDLDataLoader = this.LJIIIZ;
            if (aVMDLDataLoader != null) {
                long tryQuickGetCacheSize = aVMDLDataLoader.tryQuickGetCacheSize(str);
                if (tryQuickGetCacheSize > 0) {
                    j = tryQuickGetCacheSize;
                }
            }
        } catch (Throwable unused) {
        }
        this.LJIIZILJ.unlock();
        return j;
    }

    public final boolean LIZLLL() {
        return this.LJJJJZ > 0 && this.LJJII.LIZ > 0 && this.LJJII.LIZIZ > 0;
    }

    public final String LJ(String str) {
        String str2 = null;
        if (TextUtils.isEmpty(str)) {
            return null;
        }
        this.LJIIZILJ.lock();
        try {
            AVMDLDataLoader aVMDLDataLoader = this.LJIIIZ;
            if (aVMDLDataLoader != null) {
                str2 = aVMDLDataLoader.getStringValueByStr(str, 1010);
            }
        } catch (Exception unused) {
        } catch (Throwable th) {
            this.LJIIZILJ.unlock();
            throw th;
        }
        this.LJIIZILJ.unlock();
        return str2;
    }

    public final void LJ() {
        if (this.LIZLLL != 0) {
            C169566lV.LIZIZ("DataLoaderHelper", "dataloader not started, not allow set play info");
        } else if (this.LJJJJZI > 0) {
            this.LJIIZILJ.lock();
            this.LJIIIZ.setIntValue(7410, C49951y4.LIZ().LIZIZ);
            C69252o6.LIZ();
            this.LJIIIZ.setIntValue(7409, -1);
            this.LJIIZILJ.unlock();
        }
    }

    public final void LJ(int i2) {
        if (i2 == 1) {
            i2 = 1;
        } else if (i2 >= 4) {
            i2 = 5;
        }
        C173256rS r2 = C173286rV.LIZ;
        r2.LIZIZ().setIntValue(XCallback.PRIORITY_HIGHEST, i2);
        r2.LJ = i2;
    }

    public final AnonymousClass77D LJFF(String str) {
        AnonymousClass77D r4 = null;
        if (TextUtils.isEmpty(str)) {
            return null;
        }
        this.LJIIZILJ.lock();
        try {
            if (this.LJIIIZ != null) {
                if (this.LIZLLL == 0) {
                    String stringCacheInfo = this.LJIIIZ.getStringCacheInfo(str);
                    if (stringCacheInfo != null) {
                        String[] split = stringCacheInfo.split(",");
                        if (split.length >= 4) {
                            AnonymousClass77D r2 = new AnonymousClass77D(this);
                            r2.LIZJ = split[3];
                            if (!TextUtils.isEmpty(split[0])) {
                                r2.LIZIZ = Long.valueOf(split[0]).longValue();
                            }
                            if (!TextUtils.isEmpty(split[1])) {
                                r2.LIZ = Long.valueOf(split[1]).longValue();
                            }
                            C169566lV.LIZIZ("DataLoaderHelper", "get cache info.");
                            r4 = r2;
                        }
                    }
                }
            }
        } catch (Throwable unused) {
        }
        this.LJIIZILJ.unlock();
        return r4;
    }

    /* JADX INFO: finally extract failed */
    public final String LJFF() {
        AVMDLDataLoader aVMDLDataLoader;
        this.LJIIZILJ.lock();
        try {
            if (this.LJJIJ == null && (aVMDLDataLoader = this.LJIIIZ) != null) {
                this.LJJIJ = aVMDLDataLoader.getStringValue(11);
            }
            String str = this.LJJIJ;
            this.LJIIZILJ.unlock();
            return str;
        } catch (Exception unused) {
            this.LJIIZILJ.unlock();
            return null;
        } catch (Throwable th) {
            this.LJIIZILJ.unlock();
            throw th;
        }
    }

    public final long LJI(String str) {
        this.LJIIZILJ.lock();
        long j = 0;
        try {
            if (this.LJIIIZ != null) {
                long cacheSize = this.LJIIIZ.getCacheSize(AnonymousClass77O.LIZ(this.LJIIJJI, str), str);
                if (cacheSize > 0) {
                    j = cacheSize;
                }
            }
        } catch (Throwable unused) {
        }
        this.LJIIZILJ.unlock();
        return j;
    }

    public final void LJI() {
        this.LJIIZILJ.lock();
        try {
            AVMDLDataLoader aVMDLDataLoader = this.LJIIIZ;
            if (aVMDLDataLoader != null) {
                aVMDLDataLoader.clearNetinfoCache();
            }
        } catch (Throwable unused) {
        }
        this.LJIIZILJ.unlock();
    }

    public final void LJII() {
        if (this.LJIIIZ == null || this.LIZLLL != 0) {
            C169566lV.LJ("DataLoaderHelper", "need start mdl first");
            return;
        }
        if (this.LJJJLIIL == 1 && C173286rV.LIZ.LIZIZ().isRunning()) {
            C173286rV.LIZ.LIZIZ().businessEvent(31205, 1);
        }
        this.LJIIZILJ.lock();
        try {
            LJIIJ();
            this.LJIIZILJ.unlock();
        } catch (Throwable unused) {
            this.LJIIZILJ.unlock();
        }
    }

    public final void LJII(String str) {
        if (!TextUtils.isEmpty(str)) {
            this.LJIIZILJ.lock();
            try {
                if (this.LJIIIZ == null) {
                    C169566lV.LJ("DataLoaderHelper", "mInnerDataLoader == null");
                } else {
                    C169566lV.LIZ("DataLoaderHelper", " force remove mdl file. key ".concat(String.valueOf(str)));
                    this.LJIIIZ.forceRemoveFileCache(str);
                }
            } catch (Throwable unused) {
            }
            this.LJIIZILJ.unlock();
        }
    }

    public final long LJIIIIZZ() {
        return this.LJFF.LIZ() + this.LJI.LIZ() + this.LJ.LIZ();
    }

    public final long LJIIIIZZ(String str) {
        long j = 0;
        if (this.LIZLLL != 0) {
            return 0;
        }
        this.LJIIZILJ.lock();
        try {
            AVMDLDataLoader aVMDLDataLoader = this.LJIIIZ;
            if (aVMDLDataLoader != null) {
                long cacheSize = aVMDLDataLoader.getCacheSize(str);
                if (cacheSize > 0) {
                    j = cacheSize;
                }
            }
        } catch (Throwable unused) {
        }
        this.LJIIZILJ.unlock();
        return j;
    }

    public final C173156rI LJIIIZ(String str) {
        AnonymousClass77D LJFF2 = LJFF(str);
        if (LJFF2 == null) {
            return null;
        }
        C173156rI r2 = new C173156rI(this);
        r2.LIZIZ = LJFF2.LIZ;
        r2.LIZJ = LJFF2.LIZIZ;
        r2.LIZ = LJFF2.LIZJ;
        return r2;
    }

    public final String LJIIJ(String str) {
        try {
            if (TextUtils.isEmpty(str)) {
                return null;
            }
            if (!str.startsWith("mdl://")) {
                return str;
            }
            int indexOf = str.indexOf("?");
            if (indexOf == -1) {
                return null;
            }
            String localAddr = this.LJIIIZ.getLocalAddr();
            if (TextUtils.isEmpty(localAddr)) {
                return null;
            }
            StringBuffer stringBuffer = new StringBuffer();
            stringBuffer.append("http://");
            stringBuffer.append(localAddr);
            stringBuffer.append(str.substring(indexOf));
            String stringBuffer2 = stringBuffer.toString();
            C169566lV.LJ("DataLoaderHelper", "_proxyUrl: ".concat(String.valueOf(stringBuffer2)));
            return stringBuffer2;
        } catch (Exception unused) {
            C169566lV.LJ("DataLoaderHelper", "get proxy url failed: ".concat(String.valueOf(str)));
            return str;
        }
    }

    public final boolean LJIIJJI(String str) {
        boolean z = false;
        if (this.LIZLLL != 0) {
            return false;
        }
        this.LJIIZILJ.lock();
        try {
            if (this.LJIIIZ != null) {
                if (!TextUtils.isEmpty(str)) {
                    this.LJIIIZ.downloadResource(str);
                    C169566lV.LIZ("DataLoaderHelper", "[downloader] start download resource = ".concat(String.valueOf(str)));
                    z = true;
                }
            }
        } catch (Throwable unused) {
        }
        this.LJIIZILJ.unlock();
        return z;
    }

    public final void LJIIL(String str) {
        this.LJJIIJ.LIZLLL(str);
    }

    @Override // com.ss.mediakit.medialoader.AVMDLDataLoaderListener
    public final String getCheckSumInfo(String str) {
        try {
            if (this.LIZIZ == null || TextUtils.isEmpty(str)) {
                return null;
            }
            return this.LIZIZ.LIZIZ(str);
        } catch (Exception unused) {
            return null;
        }
    }

    @Override // com.ss.mediakit.medialoader.AVMDLDataLoaderListener
    public final long getInt64Value(int i2, long j) {
        return 0;
    }

    @Override // com.ss.mediakit.medialoader.AVMDLDataLoaderListener
    public final String getStringValue(int i2, long j, String str) {
        String str2 = str;
        C169566lV.LIZ("DataLoaderHelper", "[preload] getStringValue, key = ".concat(String.valueOf(str2)));
        String str3 = null;
        if (i2 == 1506) {
            AnonymousClass770 r0 = this.LJI;
            C1803676z LIZIZ2 = r0 != null ? r0.LIZIZ(str2) : null;
            C169566lV.LIZ("DataLoaderHelper", "[preload] getStringValue, key = ".concat(String.valueOf(str2)));
            if (!(LIZIZ2 == null || LIZIZ2.LJIILJJIL == null || LIZIZ2.LJIILJJIL.LJIIIIZZ == null)) {
                String LIZJ2 = LIZIZ2.LJIILJJIL.LJIIIIZZ.LIZJ();
                String[] LIZ2 = LIZIZ2.LJIILJJIL.LJIIIIZZ.LIZ();
                AnonymousClass777 LIZ3 = LIZIZ2.LIZ(str2);
                long LIZIZ3 = LIZIZ2.LJIILJJIL.LJIIIIZZ.LIZIZ();
                String LIZLLL2 = LIZIZ2.LJIILJJIL.LJIIIIZZ.LIZLLL();
                if (LIZIZ2.LJIIZILJ != null) {
                    str3 = "tag=" + AnonymousClass77O.LJI(LIZIZ2.LJIIZILJ);
                }
                str3 = LIZ(LIZJ2, LIZJ2, LIZ3.LJIIIIZZ, LIZIZ3, LIZ2, LIZLLL2, str3, false, (String) null);
                if (!TextUtils.isEmpty(LIZJ2)) {
                    str2 = LIZJ2;
                }
                LIZ3.LIZ = str2;
                C169566lV.LIZ("DataLoaderHelper", AnonymousClass0EJ.LIZ("[preload] get proxxy url from url: %s", new Object[]{str3}));
            }
        } else if (i2 == 1509 && this.LIZIZ != null && !TextUtils.isEmpty(str2)) {
            HashMap<String, String> LIZ4 = this.LIZIZ.LIZ(str2);
            if (LIZ4 == null || LIZ4.size() == 0) {
                return null;
            }
            StringBuilder sb = new StringBuilder();
            for (String str4 : LIZ4.keySet()) {
                if (!TextUtils.isEmpty(str4) && !TextUtils.isEmpty(LIZ4.get(str4))) {
                    sb.append(str4).append(": ").append(LIZ4.get(str4)).append("\r\n");
                }
            }
            C169566lV.LIZ("DataLoaderHelper", AnonymousClass0EJ.LIZ("[customheader] get custom header:%s url: %s", new Object[]{str2, sb.toString()}));
            return sb.toString();
        }
        return str3;
    }

    /* JADX INFO: Can't fix incorrect switch cases order, some code will duplicate */
    @Override // com.ss.mediakit.medialoader.AVMDLDataLoaderListener
    public final void onNotify(AVMDLDataLoaderNotifyInfo aVMDLDataLoaderNotifyInfo) {
        String str;
        C1803676z LIZIZ2;
        int i2;
        String str2;
        int i3;
        int i4;
        AnonymousClass770 r18;
        C1803676z r9;
        if (aVMDLDataLoaderNotifyInfo != null) {
            int i5 = aVMDLDataLoaderNotifyInfo.what;
            if (i5 != 8) {
                if (i5 == 24) {
                    AnonymousClass779 r1 = this.LIZIZ;
                    if (r1 != null) {
                        r1.LIZ(30, 0, aVMDLDataLoaderNotifyInfo.parameter, aVMDLDataLoaderNotifyInfo.logInfo);
                        return;
                    }
                    return;
                } else if (i5 == 70) {
                    aVMDLDataLoaderNotifyInfo.jsonLog = LIZ(aVMDLDataLoaderNotifyInfo.jsonLog);
                    AbstractC169756lo r2 = this.LJIILJJIL;
                    if (r2 != null) {
                        r2.LIZ(aVMDLDataLoaderNotifyInfo.logType, aVMDLDataLoaderNotifyInfo.jsonLog);
                        return;
                    }
                    AnonymousClass779 r4 = this.LIZIZ;
                    if (r4 != null) {
                        r4.LIZ(3, aVMDLDataLoaderNotifyInfo.logType, aVMDLDataLoaderNotifyInfo.jsonLog);
                    }
                    C169566lV.LIZIZ("DataLoaderHelper", "heart beat msg: " + aVMDLDataLoaderNotifyInfo.logInfo);
                    return;
                } else if (i5 == 700) {
                    C169566lV.LIZIZ("DataLoaderHelper", "KeyIsSpeedTestSampledByTime  mNeedSpeedTestByTimeInternal:" + this.LJJIZ + " code:" + aVMDLDataLoaderNotifyInfo.code);
                    AnonymousClass77K r7 = this.LIZJ;
                    if (r7 != null) {
                        r7.LIZ(aVMDLDataLoaderNotifyInfo.code, aVMDLDataLoaderNotifyInfo.parameter, aVMDLDataLoaderNotifyInfo.logInfo, aVMDLDataLoaderNotifyInfo.logType, aVMDLDataLoaderNotifyInfo.logExtraJsonStr);
                    }
                    int i6 = this.LJJIZ;
                    if (i6 != 1) {
                        i3 = 2;
                        i4 = i6 != 2 ? -1 : 32;
                    } else {
                        i3 = 2;
                        i4 = 2;
                    }
                    if (this.LIZIZ != null && i4 != -1) {
                        C169566lV.LIZIZ("DataLoaderHelper", "KeyIsSpeedTestSampledByTimenotify by" + (i4 == i3 ? "general" : "timeinternal") + "speed info code:" + aVMDLDataLoaderNotifyInfo.code + " parameter:" + aVMDLDataLoaderNotifyInfo.parameter);
                        this.LIZIZ.LIZ(i4, aVMDLDataLoaderNotifyInfo.code, aVMDLDataLoaderNotifyInfo.parameter, aVMDLDataLoaderNotifyInfo.logInfo);
                        return;
                    }
                    return;
                } else if (i5 == 702) {
                    AnonymousClass77K r12 = this.LIZJ;
                    if (r12 != null && r12 != null) {
                        r12.LIZ(aVMDLDataLoaderNotifyInfo.logInfo);
                        return;
                    }
                    return;
                } else if (i5 == 10) {
                    AbstractC169756lo r22 = this.LJIILJJIL;
                    if (r22 != null) {
                        r22.LIZ(aVMDLDataLoaderNotifyInfo.logType, aVMDLDataLoaderNotifyInfo.jsonLog);
                        return;
                    }
                    AnonymousClass779 r42 = this.LIZIZ;
                    if (r42 != null) {
                        r42.LIZ(4, aVMDLDataLoaderNotifyInfo.logType, aVMDLDataLoaderNotifyInfo.jsonLog);
                        C169566lV.LIZIZ("DataLoaderHelper", "live loader log msg: " + aVMDLDataLoaderNotifyInfo.logInfo);
                        return;
                    }
                    return;
                } else if (i5 == 11) {
                    AbstractC169756lo r23 = this.LJIILJJIL;
                    if (r23 != null) {
                        r23.LIZ(aVMDLDataLoaderNotifyInfo.logType, aVMDLDataLoaderNotifyInfo.jsonLog);
                        return;
                    }
                    AnonymousClass779 r43 = this.LIZIZ;
                    if (r43 != null) {
                        r43.LIZ(5, aVMDLDataLoaderNotifyInfo.logType, aVMDLDataLoaderNotifyInfo.jsonLog);
                        C169566lV.LIZIZ("DataLoaderHelper", "live loader log sample msg: " + aVMDLDataLoaderNotifyInfo.logInfo);
                        return;
                    }
                    return;
                } else if (i5 == 901) {
                    C169566lV.LIZIZ("multinetwork", AnonymousClass0EJ.LIZ("target network:%d current network:%d", new Object[]{Long.valueOf(aVMDLDataLoaderNotifyInfo.parameter), Long.valueOf(aVMDLDataLoaderNotifyInfo.code)}));
                    String LIZIZ3 = LIZIZ(aVMDLDataLoaderNotifyInfo.parameter);
                    String LIZIZ4 = LIZIZ(aVMDLDataLoaderNotifyInfo.code);
                    if (!TextUtils.isEmpty(LIZIZ3) && !TextUtils.isEmpty(LIZIZ4) && this.LIZIZ != null) {
                        C169566lV.LIZIZ("multinetwork", "do callback target: " + LIZIZ3 + " current: " + LIZIZ4);
                        C169566lV.LIZIZ("multinetwork", "end do callback target: " + LIZIZ3 + " current: " + LIZIZ4);
                        return;
                    }
                    return;
                } else if (i5 != 902) {
                    switch (i5) {
                        case 0:
                            AbstractC169756lo r24 = this.LJIILJJIL;
                            if (r24 != null) {
                                r24.LIZ(aVMDLDataLoaderNotifyInfo.logType, aVMDLDataLoaderNotifyInfo.jsonLog);
                                return;
                            }
                            AnonymousClass779 r25 = this.LIZIZ;
                            if (r25 != null) {
                                r25.LIZ(0, aVMDLDataLoaderNotifyInfo.logType, aVMDLDataLoaderNotifyInfo.jsonLog);
                            }
                            if (this.LJIILIIL != null && !this.LJJJJL) {
                                return;
                            }
                            return;
                        case 1:
                            AbstractC169756lo r26 = this.LJIILJJIL;
                            if (r26 != null) {
                                r26.LIZ(aVMDLDataLoaderNotifyInfo.logType, aVMDLDataLoaderNotifyInfo.jsonLog);
                                return;
                            }
                            AnonymousClass779 r3 = this.LIZIZ;
                            if (r3 != null) {
                                r3.LIZ(1, aVMDLDataLoaderNotifyInfo.logType, aVMDLDataLoaderNotifyInfo.jsonLog);
                            }
                            if (this.LJIILIIL != null && !this.LJJJJL) {
                                return;
                            }
                            return;
                        case 2:
                            AnonymousClass779 r13 = this.LIZIZ;
                            if (r13 != null) {
                                r13.LIZ(2, aVMDLDataLoaderNotifyInfo.code, aVMDLDataLoaderNotifyInfo.parameter, aVMDLDataLoaderNotifyInfo.logInfo);
                                return;
                            }
                            return;
                        case 3:
                        case 4:
                            C169566lV.LIZIZ("DataLoaderHelper", "KeyIsFileCacheProgress log = " + aVMDLDataLoaderNotifyInfo.logInfo + ", task type = " + aVMDLDataLoaderNotifyInfo.parameter + " code = " + ((int) aVMDLDataLoaderNotifyInfo.code));
                            if (aVMDLDataLoaderNotifyInfo.logInfo == null) {
                                return;
                            }
                            if (aVMDLDataLoaderNotifyInfo.parameter == 3) {
                                C1807278j.LIZ.LIZ(aVMDLDataLoaderNotifyInfo.logInfo);
                                return;
                            }
                            boolean z = aVMDLDataLoaderNotifyInfo.parameter == 2;
                            if (aVMDLDataLoaderNotifyInfo != null && !TextUtils.isEmpty(aVMDLDataLoaderNotifyInfo.logInfo)) {
                                String[] split = aVMDLDataLoaderNotifyInfo.logInfo.split(",");
                                if (split.length >= 4) {
                                    try {
                                        long longValue = Long.valueOf(split[0]).longValue();
                                        long longValue2 = Long.valueOf(split[1]).longValue();
                                        if (longValue2 > 0 || aVMDLDataLoaderNotifyInfo.what == 4) {
                                            String str3 = split[2];
                                            String str4 = split[3];
                                            if (z) {
                                                r9 = this.LJI.LIZIZ(str3);
                                                if (r9 == null) {
                                                    C169566lV.LIZ("DataLoaderHelper", "[preload] preload temItem == null return " + aVMDLDataLoaderNotifyInfo.logInfo);
                                                    if (aVMDLDataLoaderNotifyInfo.what == 4) {
                                                        C174206sz r72 = new C174206sz(this);
                                                        r72.LJ = longValue;
                                                        r72.LIZLLL = longValue2;
                                                        r72.LIZ = str3;
                                                        r72.LJIIIIZZ = 2;
                                                        r72.LIZJ = str4;
                                                        AnonymousClass779 r0 = this.LIZIZ;
                                                        if (r0 != null) {
                                                            r0.LIZ(r72);
                                                            C169566lV.LIZ("DataLoaderHelper", " task progress. cache end. key = ".concat(String.valueOf(str3)));
                                                            return;
                                                        }
                                                        return;
                                                    }
                                                    return;
                                                }
                                                r18 = this.LJI;
                                            } else {
                                                r9 = this.LJJIIJ.LIZIZ(str3);
                                                if (r9 == null) {
                                                    C169566lV.LIZ("DataLoaderHelper", "[preload] play temItem == null return " + aVMDLDataLoaderNotifyInfo.logInfo);
                                                    return;
                                                }
                                                r18 = this.LJJIIJ;
                                            }
                                            if (r9 != null) {
                                                AnonymousClass777 LIZ2 = r9.LIZ(str3);
                                                if (LIZ2 != null) {
                                                    LIZ2.LJIIJ = longValue2;
                                                    LIZ2.LJIIJJI = longValue;
                                                    LIZ2.LJIIL = str4;
                                                }
                                                String str5 = TextUtils.isEmpty(r9.LIZ) ? str3 : r9.LIZ;
                                                AnonymousClass771 LIZ3 = C178316zc.LIZ.LIZ(str5);
                                                if (LIZ3 == null) {
                                                    LIZ3 = new AnonymousClass771(this);
                                                }
                                                LIZ3.LIZ = r9.LIZ;
                                                LIZ3.LIZIZ = z ? 2 : 1;
                                                LIZ3.LIZ(r9);
                                                if (!(longValue2 != longValue || LIZ2 == null || LIZ2.LJ == null)) {
                                                    C169566lV.LIZ("DataLoaderHelper", "[preload] " + (LIZ2.LJ.LIZ() == AnonymousClass766.LIZIZ ? "Audio" : "Video") + " cache complete key: " + str3);
                                                }
                                                AnonymousClass779 r73 = this.LIZIZ;
                                                if (r73 != null) {
                                                    r73.LIZ(LIZ3);
                                                }
                                                C178316zc.LIZ.LIZ(str5, LIZ3);
                                                if (LIZ3.LIZJ() || ((z && LIZ3.LIZIZ()) || aVMDLDataLoaderNotifyInfo.what == 4)) {
                                                    r18.LIZLLL(str3);
                                                    C178316zc.LIZ.LIZIZ(str5);
                                                    if (!z) {
                                                        C169566lV.LIZ("DataLoaderHelper", "[preload] notify vid cache end key: ".concat(String.valueOf(str5)));
                                                        LIZJ(r9);
                                                    }
                                                    C174206sz r74 = new C174206sz(this);
                                                    r74.LJ = longValue;
                                                    r74.LIZLLL = longValue2;
                                                    r74.LIZ = str3;
                                                    r74.LIZJ = str4;
                                                    r74.LJFF = LIZ2.LIZJ;
                                                    r74.LJI = LIZ2.LIZLLL;
                                                    r74.LJII = LIZ2.LJ;
                                                    r74.LIZIZ = r9.LIZ;
                                                    r74.LJIIIIZZ = LIZ3.LIZIZ;
                                                    if (r9.LIZJ() != null && z) {
                                                        C178326zd r14 = new C178326zd(2);
                                                        r14.LIZJ = r74;
                                                        r14.LIZLLL = LIZ3;
                                                        r9.LIZJ().LIZ(r14);
                                                        C169566lV.LIZ("DataLoaderHelper", "[preload] notify end cache size = " + LIZ3.LIZ());
                                                    }
                                                    AnonymousClass779 r02 = this.LIZIZ;
                                                    if (r02 != null) {
                                                        r02.LIZ(r74);
                                                        C169566lV.LIZ("DataLoaderHelper", " task progress. cache end. key = " + str3 + ", rawKey = " + str5);
                                                        return;
                                                    }
                                                    return;
                                                }
                                                return;
                                            }
                                            return;
                                        }
                                        C169566lV.LIZ("DataLoaderHelper", "[preload] mediaSize <= 0 return " + aVMDLDataLoaderNotifyInfo.logInfo);
                                        return;
                                    } catch (Exception unused) {
                                        return;
                                    }
                                } else {
                                    return;
                                }
                            } else {
                                return;
                            }
                        case 5:
                            AnonymousClass779 r15 = this.LIZIZ;
                            if (r15 != null) {
                                r15.LIZ(20, aVMDLDataLoaderNotifyInfo.code, aVMDLDataLoaderNotifyInfo.parameter, aVMDLDataLoaderNotifyInfo.logInfo);
                                return;
                            }
                            return;
                        case 6:
                            try {
                                JSONObject LIZ4 = C58112Qu.LIZ(aVMDLDataLoaderNotifyInfo.jsonLog);
                                if (LIZ4 != null) {
                                    AnonymousClass779 r03 = this.LIZIZ;
                                    if (r03 != null) {
                                        r03.LIZ(LIZ4);
                                    }
                                    C169566lV.LIZIZ("avmdlcdnlog", "receive log:".concat(String.valueOf(LIZ4)));
                                    return;
                                }
                                return;
                            } catch (Exception e) {
                                e.printStackTrace();
                                return;
                            }
                        default:
                            switch (i5) {
                                case 13:
                                    if (this.LIZIZ != null && aVMDLDataLoaderNotifyInfo.jsonLog != null) {
                                        this.LIZIZ.LIZ(0, aVMDLDataLoaderNotifyInfo.logType, aVMDLDataLoaderNotifyInfo.jsonLog);
                                        return;
                                    }
                                    return;
                                case 14:
                                    C169566lV.LIZ("DataLoaderHelper", "MDL Alog: " + aVMDLDataLoaderNotifyInfo.logInfo);
                                    return;
                                case 15:
                                    AbstractC169756lo r27 = this.LJIILJJIL;
                                    if (r27 != null) {
                                        r27.LIZ(aVMDLDataLoaderNotifyInfo.logType, aVMDLDataLoaderNotifyInfo.jsonLog);
                                        return;
                                    } else if (this.LIZIZ != null && aVMDLDataLoaderNotifyInfo.jsonLog != null) {
                                        this.LIZIZ.LIZ(aVMDLDataLoaderNotifyInfo.logType, aVMDLDataLoaderNotifyInfo.jsonLog);
                                        return;
                                    } else {
                                        return;
                                    }
                                case 16:
                                    AnonymousClass779 r28 = this.LIZIZ;
                                    if (r28 != null) {
                                        r28.LIZ(0, aVMDLDataLoaderNotifyInfo.logType, aVMDLDataLoaderNotifyInfo.jsonLog);
                                        return;
                                    }
                                    return;
                                default:
                                    switch (i5) {
                                        case 19:
                                            AbstractC169756lo r29 = this.LJIILJJIL;
                                            if (r29 != null) {
                                                r29.LIZ(aVMDLDataLoaderNotifyInfo.logType, aVMDLDataLoaderNotifyInfo.jsonLog);
                                                return;
                                            }
                                            AnonymousClass779 r32 = this.LIZIZ;
                                            if (r32 != null) {
                                                r32.LIZ(7, aVMDLDataLoaderNotifyInfo.logType, aVMDLDataLoaderNotifyInfo.jsonLog);
                                                return;
                                            }
                                            return;
                                        case 20:
                                            break;
                                        case 21:
                                            if (aVMDLDataLoaderNotifyInfo.logInfo != null) {
                                                C1807278j.LIZ.LIZ(aVMDLDataLoaderNotifyInfo.logInfo);
                                                return;
                                            }
                                            return;
                                        case 22:
                                            if (aVMDLDataLoaderNotifyInfo.logInfo != null) {
                                                String str6 = aVMDLDataLoaderNotifyInfo.logInfo;
                                                C1807278j r210 = C1807278j.LIZ;
                                                if (!TextUtils.isEmpty(str6) && r210.LJIIJJI != null) {
                                                    r210.LJIIJJI.sendMessage(Message.obtain(r210.LJIIJJI, 2, str6));
                                                    return;
                                                }
                                                return;
                                            }
                                            return;
                                        default:
                                            switch (i5) {
                                                case 1000:
                                                case 1001:
                                                case CommonStatusCodes.AUTHENTICATE_FAIL /*{ENCODED_INT: 1002}*/:
                                                case CommonStatusCodes.TIME_EXPIRED /*{ENCODED_INT: 1003}*/:
                                                    AbstractC169756lo r211 = this.LJIILJJIL;
                                                    if (r211 != null) {
                                                        r211.LIZ(aVMDLDataLoaderNotifyInfo.logType, aVMDLDataLoaderNotifyInfo.jsonLog);
                                                        return;
                                                    }
                                                    AnonymousClass779 r212 = this.LIZIZ;
                                                    if (r212 != null) {
                                                        r212.LIZ(10, aVMDLDataLoaderNotifyInfo.logType, aVMDLDataLoaderNotifyInfo.jsonLog);
                                                        return;
                                                    }
                                                    return;
                                                default:
                                                    return;
                                            }
                                    }
                            }
                    }
                } else {
                    C169566lV.LIZIZ("DataLoaderHelper", "KeyIsFileDeleteSizeByUsedTime size: " + aVMDLDataLoaderNotifyInfo.code);
                    AnonymousClass779 r16 = this.LIZIZ;
                    if (r16 != null) {
                        r16.LIZ(31, 0, aVMDLDataLoaderNotifyInfo.code, null);
                        return;
                    }
                    return;
                }
            }
            String str7 = "kTTVideoErrorDomainDataLoaderPreload";
            if (aVMDLDataLoaderNotifyInfo.logInfo != null && aVMDLDataLoaderNotifyInfo.parameter == 3) {
                String str8 = aVMDLDataLoaderNotifyInfo.logInfo;
                long j = aVMDLDataLoaderNotifyInfo.code;
                C1807278j r44 = C1807278j.LIZ;
                int i7 = (int) j;
                long j2 = aVMDLDataLoaderNotifyInfo.parameter;
                if (i7 != -5000) {
                    if (i7 == -4000) {
                        str2 = "request invalid.";
                    } else if (i7 == -2000) {
                        str2 = "media data content length invalid";
                    } else if (i7 == -3001) {
                        i2 = -9944;
                        str2 = "server invalid. response status code >= 500";
                    } else if (i7 != -3000) {
                        switch (i7) {
                            case -1002:
                                str2 = "Waiting for too many tasks, > 20";
                                break;
                            case -1001:
                                str2 = "add the same key task.";
                                break;
                            case -1000:
                                str2 = "create preload task fail.";
                                break;
                            default:
                                str2 = "task fail. reply task error.";
                                break;
                        }
                    } else {
                        i2 = !C49891xy.LIZIZ(this.LJIIJJI) ? -9960 : -9945;
                        str2 = "url invalid. response status code >= 400";
                    }
                    i2 = i7;
                } else {
                    i2 = -9948;
                    str2 = "write file fail.";
                }
                if (j2 == 3) {
                    str7 = "kTTVideoErrorDomainDownload";
                }
                C1803376w r213 = new C1803376w(str7, i2, i7, "key = " + str8 + ", reason = " + str2);
                if (!TextUtils.isEmpty(str8) && r44.LJIIJJI != null) {
                    ArrayList arrayList = new ArrayList();
                    arrayList.add(str8);
                    arrayList.add(r213);
                    r44.LJIIJJI.sendMessage(Message.obtain(r44.LJIIJJI, 1, arrayList));
                }
            } else if (aVMDLDataLoaderNotifyInfo.logInfo != null) {
                C169566lV.LIZ("DataLoaderHelper", " task fail log = " + aVMDLDataLoaderNotifyInfo.logInfo + ", code = " + aVMDLDataLoaderNotifyInfo.code + ", task type = " + aVMDLDataLoaderNotifyInfo.parameter);
                String[] split2 = aVMDLDataLoaderNotifyInfo.logInfo.split(",");
                if (split2.length > 0 && (LIZIZ2 = this.LJI.LIZIZ((str = split2[0]))) != null) {
                    AnonymousClass770 r10 = this.LJI;
                    C1803376w r45 = new C1803376w(str7, (int) aVMDLDataLoaderNotifyInfo.code, aVMDLDataLoaderNotifyInfo.logInfo);
                    String str9 = TextUtils.isEmpty(LIZIZ2.LIZ) ? str : LIZIZ2.LIZ;
                    AnonymousClass771 LIZ5 = C178316zc.LIZ.LIZ(str9);
                    if (LIZ5 == null) {
                        LIZ5 = new AnonymousClass771(this);
                    }
                    LIZ5.LIZ = LIZIZ2.LIZ;
                    LIZ5.LIZIZ = (int) aVMDLDataLoaderNotifyInfo.parameter;
                    LIZ5.LIZ(LIZIZ2);
                    AnonymousClass775 LIZ6 = LIZ5.LIZ(str);
                    if (LIZ6 != null) {
                        LIZ6.LJI = r45;
                    }
                    AnonymousClass779 r17 = this.LIZIZ;
                    if (r17 != null) {
                        r17.LIZ(LIZ5);
                    }
                    C178316zc.LIZ.LIZ(str9, LIZ5);
                    if (LIZ5.LIZJ() || LIZ5.LIZIZ()) {
                        r10.LIZLLL(str);
                        C169566lV.LIZ("DataLoaderHelper", "pop all task item. videoId = " + LIZIZ2.LIZ + " key = " + str);
                        C178316zc.LIZ.LIZIZ(str9);
                        if (this.LIZIZ != null) {
                            C174206sz r8 = new C174206sz(this);
                            r8.LJIIIIZZ = (int) aVMDLDataLoaderNotifyInfo.parameter;
                            r8.LIZIZ = LIZIZ2.LIZ;
                            r8.LIZ = str;
                            if (!(LIZIZ2.LJIILJJIL == null || LIZIZ2.LJIILJJIL.LIZIZ == null)) {
                                r8.LIZJ = LIZIZ2.LJIILJJIL.LIZIZ;
                                r8.LIZ = null;
                            }
                            this.LIZIZ.LIZ(r8);
                        }
                        if (LIZIZ2.LIZJ() != null && aVMDLDataLoaderNotifyInfo.parameter == 2) {
                            C178326zd r19 = new C178326zd(3);
                            r19.LJ = r45;
                            r19.LIZLLL = LIZ5;
                            r19.LIZJ = null;
                            LIZIZ2.LIZJ().LIZ(r19);
                        }
                    }
                }
            }
        }
    }

    @Override // com.ss.mediakit.medialoader.AVMDLStartCompleteListener
    public final void onStartComplete() {
        C169566lV.LIZIZ("DataLoaderHelper", "MediaDataLoader start complete");
        C173376re.LIZ.LIZ().LIZ(C175426ux.LJFF);
        int i2 = C49951y4.LIZ().LIZ;
        this.LJIJJLI = i2;
        AVMDLDataLoader aVMDLDataLoader = this.LJIIIZ;
        if (aVMDLDataLoader != null) {
            aVMDLDataLoader.setIntValue(7219, i2);
            if (!C173286rV.LIZ.LIZIZ().isRunning()) {
                C169566lV.LIZIZ("DataLoaderHelper", "strategy center running failed, set mdl preload strategy back " + this.LJJIFFI);
                this.LJIIIZ.setIntValue(1030, this.LJJIFFI);
            }
        }
    }
}