Skip to content

Instantly share code, notes, and snippets.

View ShivamKumarJha's full-sized avatar

Shivam Kumar Jha ShivamKumarJha

View GitHub Profile
@ShivamKumarJha
ShivamKumarJha / Media.kt
Created October 26, 2025 14:54
ExoPlayer media3 powered by Cronet
package com.shivamkumarjha.media_common.model
import com.shivamkumarjha.network_common.HttpRequestData
import com.shivamkumarjha.network_common.ellipsize
import com.shivamkumarjha.network_common.removeDuplicateWordsIgnoreCase
import kotlinx.serialization.Serializable
@Serializable
data class Media(
val httpRequestData: HttpRequestData,
package com.shivamkumarjha.network_common
import kotlinx.serialization.Serializable
@Serializable
data class HttpRequestData(
val url: String,
val headers: Map<String, String> = emptyMap(),
val queries: Map<String, String> = emptyMap(),
val body: String? = null,
From 8e307bb49681fa229205676b9cd23c30428ead9c Mon Sep 17 00:00:00 2001
From: ShivamKumarJha <[email protected]>
Date: Sat, 11 Oct 2025 19:27:26 +0530
Subject: [PATCH] SourcePirateXPlay
Signed-off-by: ShivamKumarJha <[email protected]>
---
settings.gradle.kts | 1 +
source/all/build.gradle.kts | 1 +
.../com/shivamkumarjha/source_all/Get.kt | 2 +
@ShivamKumarJha
ShivamKumarJha / Decrypt.kt
Created October 2, 2025 17:28
EmbedSportsExtractor used streamed.su streamcentre etc
package com.shivamkumarjha.media_extractor.decrypt
import dev.whyoleg.cryptography.CryptographyProvider
import dev.whyoleg.cryptography.DelicateCryptographyApi
import dev.whyoleg.cryptography.algorithms.AES
@OptIn(DelicateCryptographyApi::class)
internal suspend fun aesCbcDecrypt(data: ByteArray, key: ByteArray, iv: ByteArray): String {
val aesCtr = CryptographyProvider.Default.get(AES.CBC)
@ShivamKumarJha
ShivamKumarJha / AppUpdate-Android.json
Last active October 26, 2025 05:31
StreamVault Config
{
"minimum_supported_version": 12,
"latest_supported_version": 17,
"update_message": "",
"update_url": "https://drive.google.com/file/d/1rxSkIsvip2JLgm9knAOQFDREaeq3ci6q/view?usp=drive_link",
"update_messages": [
{
"code": 2,
"message": "📦 StreamVault App — Version 2.0.0 Changelog:\nInitial public release."
},
@ShivamKumarJha
ShivamKumarJha / LinearProgressIndicator.kt
Created May 17, 2025 01:21
LinearProgressIndicator, similar to Material 2 LinearProgressIndicator
package com.example.rideblitzandroidapp.common.ui
import android.content.Context
import android.graphics.Canvas
import android.graphics.Paint
import android.util.AttributeSet
import android.view.View
import com.example.rideblitzandroidapp.R
import com.example.rideblitzandroidapp.common.util.extension.dp
import com.example.rideblitzandroidapp.common.util.extension.getColorById
@ShivamKumarJha
ShivamKumarJha / VLCPlayer.kt
Created March 16, 2024 19:33
VLC Android player in compose with Subtitles
package com.shivamkumarjha.animov.ui.player
import android.net.Uri
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.viewinterop.AndroidView
import org.videolan.libvlc.LibVLC
import androidx.lifecycle.LiveData
import androidx.lifecycle.MediatorLiveData
fun <T, K, R> LiveData<T>.combineWith(
liveData: LiveData<K>,
block: (T?, K?) -> R
): LiveData<R> {
val result = MediatorLiveData<R>()
result.addSource(this) {
result.value = block(this.value, liveData.value)
@ShivamKumarJha
ShivamKumarJha / NetworkHelper.kt
Last active September 24, 2021 18:47
Check internet using ConnectivityManager. Supports API 16 and above.
import android.net.ConnectivityManager
import android.net.NetworkCapabilities
import android.os.Build
class NetworkHelper(private val connectivityManager: ConnectivityManager) {
fun isNetworkConnected(): Boolean {
var result = false
when {
Build.VERSION.SDK_INT >= Build.VERSION_CODES.M -> {
recyclerview.addOnScrollListener(object : RecyclerView.OnScrollListener() {
override fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) {
super.onScrollStateChanged(recyclerView, newState)
when (newState) {
RecyclerView.SCROLL_STATE_DRAGGING -> {
Log.d(TAG, "dragging")
}
RecyclerView.SCROLL_STATE_IDLE -> {
Log.d(TAG, "idle")
}