Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,133 @@
package com.mbridge.msdk.playercommon.exoplayer2.drm;
import android.os.ConditionVariable;
import android.os.Handler;
import android.os.HandlerThread;
import android.util.Pair;
import com.mbridge.msdk.playercommon.exoplayer2.C;
import com.mbridge.msdk.playercommon.exoplayer2.drm.DrmSession;
import com.mbridge.msdk.playercommon.exoplayer2.drm.ExoMediaCrypto;
import com.mbridge.msdk.playercommon.exoplayer2.upstream.HttpDataSource;
import com.mbridge.msdk.playercommon.exoplayer2.util.Assertions;
import java.util.HashMap;
import java.util.UUID;
/* loaded from: classes4.dex */
public final class OfflineLicenseHelper<T extends ExoMediaCrypto> {
private final ConditionVariable conditionVariable;
private final DefaultDrmSessionManager<T> drmSessionManager;
private final HandlerThread handlerThread;
public static OfflineLicenseHelper<FrameworkMediaCrypto> newWidevineInstance(String str, HttpDataSource.Factory factory) throws UnsupportedDrmException {
return newWidevineInstance(str, false, factory, null);
}
public static OfflineLicenseHelper<FrameworkMediaCrypto> newWidevineInstance(String str, boolean z, HttpDataSource.Factory factory) throws UnsupportedDrmException {
return newWidevineInstance(str, z, factory, null);
}
public static OfflineLicenseHelper<FrameworkMediaCrypto> newWidevineInstance(String str, boolean z, HttpDataSource.Factory factory, HashMap<String, String> hashMap) throws UnsupportedDrmException {
UUID uuid = C.WIDEVINE_UUID;
return new OfflineLicenseHelper<>(uuid, FrameworkMediaDrm.newInstance(uuid), new HttpMediaDrmCallback(str, z, factory), hashMap);
}
public OfflineLicenseHelper(UUID uuid, ExoMediaDrm<T> exoMediaDrm, MediaDrmCallback mediaDrmCallback, HashMap<String, String> hashMap) {
HandlerThread handlerThread = new HandlerThread("OfflineLicenseHelper");
this.handlerThread = handlerThread;
handlerThread.start();
this.conditionVariable = new ConditionVariable();
DefaultDrmSessionEventListener defaultDrmSessionEventListener = new DefaultDrmSessionEventListener() { // from class: com.mbridge.msdk.playercommon.exoplayer2.drm.OfflineLicenseHelper.1
@Override // com.mbridge.msdk.playercommon.exoplayer2.drm.DefaultDrmSessionEventListener
public void onDrmKeysLoaded() {
OfflineLicenseHelper.this.conditionVariable.open();
}
@Override // com.mbridge.msdk.playercommon.exoplayer2.drm.DefaultDrmSessionEventListener
public void onDrmSessionManagerError(Exception exc) {
OfflineLicenseHelper.this.conditionVariable.open();
}
@Override // com.mbridge.msdk.playercommon.exoplayer2.drm.DefaultDrmSessionEventListener
public void onDrmKeysRestored() {
OfflineLicenseHelper.this.conditionVariable.open();
}
@Override // com.mbridge.msdk.playercommon.exoplayer2.drm.DefaultDrmSessionEventListener
public void onDrmKeysRemoved() {
OfflineLicenseHelper.this.conditionVariable.open();
}
};
DefaultDrmSessionManager<T> defaultDrmSessionManager = new DefaultDrmSessionManager<>(uuid, exoMediaDrm, mediaDrmCallback, hashMap);
this.drmSessionManager = defaultDrmSessionManager;
defaultDrmSessionManager.addListener(new Handler(handlerThread.getLooper()), defaultDrmSessionEventListener);
}
public final synchronized byte[] getPropertyByteArray(String str) {
return this.drmSessionManager.getPropertyByteArray(str);
}
public final synchronized void setPropertyByteArray(String str, byte[] bArr) {
this.drmSessionManager.setPropertyByteArray(str, bArr);
}
public final synchronized String getPropertyString(String str) {
return this.drmSessionManager.getPropertyString(str);
}
public final synchronized void setPropertyString(String str, String str2) {
this.drmSessionManager.setPropertyString(str, str2);
}
public final synchronized byte[] downloadLicense(DrmInitData drmInitData) throws DrmSession.DrmSessionException {
Assertions.checkArgument(drmInitData != null);
return blockingKeyRequest(2, null, drmInitData);
}
public final synchronized byte[] renewLicense(byte[] bArr) throws DrmSession.DrmSessionException {
Assertions.checkNotNull(bArr);
return blockingKeyRequest(2, bArr, null);
}
public final synchronized void releaseLicense(byte[] bArr) throws DrmSession.DrmSessionException {
Assertions.checkNotNull(bArr);
blockingKeyRequest(3, bArr, null);
}
public final synchronized Pair<Long, Long> getLicenseDurationRemainingSec(byte[] bArr) throws DrmSession.DrmSessionException {
Assertions.checkNotNull(bArr);
DrmSession<T> openBlockingKeyRequest = openBlockingKeyRequest(1, bArr, null);
DrmSession.DrmSessionException error = openBlockingKeyRequest.getError();
Pair<Long, Long> licenseDurationRemainingSec = WidevineUtil.getLicenseDurationRemainingSec(openBlockingKeyRequest);
this.drmSessionManager.releaseSession(openBlockingKeyRequest);
if (error == null) {
return licenseDurationRemainingSec;
}
if (error.getCause() instanceof KeysExpiredException) {
return Pair.create(0L, 0L);
}
throw error;
}
public final void release() {
this.handlerThread.quit();
}
private byte[] blockingKeyRequest(int i, byte[] bArr, DrmInitData drmInitData) throws DrmSession.DrmSessionException {
DrmSession<T> openBlockingKeyRequest = openBlockingKeyRequest(i, bArr, drmInitData);
DrmSession.DrmSessionException error = openBlockingKeyRequest.getError();
byte[] offlineLicenseKeySetId = openBlockingKeyRequest.getOfflineLicenseKeySetId();
this.drmSessionManager.releaseSession(openBlockingKeyRequest);
if (error == null) {
return offlineLicenseKeySetId;
}
throw error;
}
private DrmSession<T> openBlockingKeyRequest(int i, byte[] bArr, DrmInitData drmInitData) {
this.drmSessionManager.setMode(i, bArr);
this.conditionVariable.close();
DrmSession<T> acquireSession = this.drmSessionManager.acquireSession(this.handlerThread.getLooper(), drmInitData);
this.conditionVariable.block();
return acquireSession;
}
}