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


package X;

import android.text.TextUtils;
import com.bytedance.covode.number.Covode;
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 java.net.URLEncoder;

/* renamed from: X.772  reason: invalid class name */
public final class AnonymousClass772 implements AVMDLDataLoaderListener {
    public AVMDLDataLoaderConfigure LIZ;
    public AnonymousClass77J LIZIZ;
    public AbstractC1803977c LIZJ;

    static {
        Covode.recordClassIndex(120047);
    }

    public AnonymousClass772() {
        this.LIZ = AVMDLDataLoaderConfigure.getDefaultonfigure();
    }

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

    public final long LIZ(int i2) {
        AVMDLDataLoader instance = AVMDLDataLoader.getInstance();
        if (i2 != 7218) {
            switch (i2) {
                case 8100:
                    if (instance == null) {
                        return -1;
                    }
                    return instance.getLongValue(8100);
                case 8101:
                    if (instance == null) {
                        return -1;
                    }
                    return instance.getLongValue(8101);
                case 8102:
                    return (instance != null && instance.getLongValue(8102) == 1) ? 1 : 0;
                default:
                    return -1;
            }
        } else if (instance == null) {
            return -1;
        } else {
            return instance.getLongValue(7218);
        }
    }

    public final String LIZ(String str, Boolean bool) {
        String str2 = null;
        if (str == null) {
            return null;
        }
        boolean z = false;
        if (!TextUtils.isEmpty(str)) {
            String lowerCase = str.toLowerCase();
            if (!lowerCase.startsWith("http://127.0.0.1") && !lowerCase.startsWith("http://localhost") && !lowerCase.startsWith("file://") && !lowerCase.startsWith("/") && !lowerCase.endsWith(".mpd") && !lowerCase.contains(".mpd?") && !lowerCase.contains(".m3u8?") && !lowerCase.endsWith(".m3u8")) {
                z = true;
            }
        }
        if (!z) {
            return str;
        }
        String localAddr = AVMDLDataLoader.getInstance().getLocalAddr();
        if (TextUtils.isEmpty(localAddr)) {
            return null;
        }
        try {
            str2 = URLEncoder.encode(str, "UTF-8");
        } catch (Throwable unused) {
        }
        String str3 = localAddr + "?rk=v02004b50000bh9ajqhdli3lfv2rgsgg&k=426161df8c5ce110209a6fc6641e049ddfrfgaf&u0=" + str2;
        return bool.booleanValue() ? "mdl://".concat(String.valueOf(str3)) : "http://".concat(String.valueOf(str3));
    }

    public final void LIZ(int i2, String str, int i3) {
        AVMDLDataLoader instance = AVMDLDataLoader.getInstance();
        if (instance != null) {
            if (i2 == 7213 || i2 == 7215) {
                instance.setInt64ValueByStrKey(i2, str, (long) i3);
            } else {
                instance.setInt64ValueByStrKey(i2, str, System.currentTimeMillis());
            }
        }
    }

    public final boolean LIZ() {
        if (AVMDLDataLoader.getInstance() == null) {
            return false;
        }
        return AVMDLDataLoader.getInstance().isRunning();
    }

    @Override // com.ss.mediakit.medialoader.AVMDLDataLoaderListener
    public final String getCheckSumInfo(String str) {
        return null;
    }

    @Override // com.ss.mediakit.medialoader.AVMDLDataLoaderListener
    public final long getInt64Value(int i2, long j) {
        AnonymousClass77J r0;
        if (i2 != 8003) {
            return (i2 == 8004 && (r0 = this.LIZIZ) != null) ? r0.LIZ(j) : j;
        }
        AbstractC1803977c r3 = this.LIZJ;
        return r3 != null ? r3.LIZ(73, 0L) : j;
    }

    @Override // com.ss.mediakit.medialoader.AVMDLDataLoaderListener
    public final String getStringValue(int i2, long j, String str) {
        return null;
    }

    @Override // com.ss.mediakit.medialoader.AVMDLDataLoaderListener
    public final void onNotify(AVMDLDataLoaderNotifyInfo aVMDLDataLoaderNotifyInfo) {
        AnonymousClass77J r4;
        if (aVMDLDataLoaderNotifyInfo != null && this.LIZIZ != null) {
            int i2 = aVMDLDataLoaderNotifyInfo.what;
            if (i2 == 9) {
                AnonymousClass77J r42 = this.LIZIZ;
                if (r42 != null) {
                    r42.LIZ((int) aVMDLDataLoaderNotifyInfo.parameter, aVMDLDataLoaderNotifyInfo.logInfo);
                }
            } else if (i2 == 12 && (r4 = this.LIZIZ) != null) {
                r4.LIZIZ((int) aVMDLDataLoaderNotifyInfo.parameter, aVMDLDataLoaderNotifyInfo.logInfo);
            }
        }
    }
}