2023-08-12 20:25:30 +00:00
|
|
|
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties
|
2022-10-26 19:56:31 +00:00
|
|
|
import org.jetbrains.dokka.gradle.DokkaTask
|
|
|
|
import java.io.ByteArrayOutputStream
|
|
|
|
import java.net.URL
|
|
|
|
|
|
|
|
plugins {
|
|
|
|
id("com.android.application")
|
|
|
|
id("kotlin-android")
|
|
|
|
id("kotlin-kapt")
|
|
|
|
id("org.jetbrains.dokka")
|
|
|
|
}
|
|
|
|
|
|
|
|
val tmpFilePath = System.getProperty("user.home") + "/work/_temp/keystore/"
|
|
|
|
val prereleaseStoreFile: File? = File(tmpFilePath).listFiles()?.first()
|
|
|
|
|
|
|
|
fun String.execute() = ByteArrayOutputStream().use { baot ->
|
|
|
|
if (project.exec {
|
|
|
|
workingDir = projectDir
|
|
|
|
commandLine = this@execute.split(Regex("\\s"))
|
|
|
|
standardOutput = baot
|
2023-07-31 23:25:28 +00:00
|
|
|
}.exitValue == 0)
|
2022-10-26 19:56:31 +00:00
|
|
|
String(baot.toByteArray()).trim()
|
|
|
|
else null
|
|
|
|
}
|
|
|
|
|
|
|
|
android {
|
|
|
|
testOptions {
|
|
|
|
unitTests.isReturnDefaultValues = true
|
|
|
|
}
|
2023-07-13 21:18:37 +00:00
|
|
|
|
|
|
|
viewBinding {
|
|
|
|
enable = true
|
|
|
|
}
|
|
|
|
|
2023-08-19 19:48:10 +00:00
|
|
|
externalNativeBuild {
|
|
|
|
cmake {
|
|
|
|
path("CMakeLists.txt")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-26 19:56:31 +00:00
|
|
|
signingConfigs {
|
|
|
|
create("prerelease") {
|
|
|
|
if (prereleaseStoreFile != null) {
|
|
|
|
storeFile = file(prereleaseStoreFile)
|
|
|
|
storePassword = System.getenv("SIGNING_STORE_PASSWORD")
|
|
|
|
keyAlias = System.getenv("SIGNING_KEY_ALIAS")
|
|
|
|
keyPassword = System.getenv("SIGNING_KEY_PASSWORD")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-05 11:39:34 +00:00
|
|
|
compileSdk = 33
|
2022-10-26 19:56:31 +00:00
|
|
|
buildToolsVersion = "30.0.3"
|
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
applicationId = "com.lagradost.cloudstream3"
|
|
|
|
minSdk = 21
|
2023-08-23 22:23:06 +00:00
|
|
|
targetSdk = 29
|
2022-10-26 19:56:31 +00:00
|
|
|
|
2023-03-15 21:22:19 +00:00
|
|
|
versionCode = 59
|
2023-08-23 16:43:55 +00:00
|
|
|
versionName = "4.1.7"
|
2022-10-26 19:56:31 +00:00
|
|
|
|
|
|
|
resValue("string", "app_version", "${defaultConfig.versionName}${versionNameSuffix ?: ""}")
|
|
|
|
resValue("string", "commit_hash", "git rev-parse --short HEAD".execute() ?: "")
|
|
|
|
resValue("bool", "is_prerelease", "false")
|
|
|
|
|
2023-08-12 20:25:30 +00:00
|
|
|
// Reads local.properties
|
|
|
|
val localProperties = gradleLocalProperties(rootDir)
|
|
|
|
|
2022-10-26 19:56:31 +00:00
|
|
|
buildConfigField(
|
|
|
|
"String",
|
|
|
|
"BUILDDATE",
|
|
|
|
"new java.text.SimpleDateFormat(\"yyyy-MM-dd HH:mm\").format(new java.util.Date(" + System.currentTimeMillis() + "L));"
|
|
|
|
)
|
2023-08-12 20:25:30 +00:00
|
|
|
buildConfigField(
|
|
|
|
"String",
|
|
|
|
"SIMKL_CLIENT_ID",
|
|
|
|
"\"" + (System.getenv("SIMKL_CLIENT_ID") ?: localProperties["simkl.id"]) + "\""
|
|
|
|
)
|
|
|
|
buildConfigField(
|
|
|
|
"String",
|
|
|
|
"SIMKL_CLIENT_SECRET",
|
|
|
|
"\"" + (System.getenv("SIMKL_CLIENT_SECRET") ?: localProperties["simkl.secret"]) + "\""
|
|
|
|
)
|
2022-10-26 19:56:31 +00:00
|
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
|
|
|
|
|
|
kapt {
|
|
|
|
includeCompileClasspath = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
buildTypes {
|
|
|
|
release {
|
|
|
|
isDebuggable = false
|
|
|
|
isMinifyEnabled = false
|
|
|
|
isShrinkResources = false
|
2023-07-31 23:25:28 +00:00
|
|
|
proguardFiles(
|
|
|
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
|
|
"proguard-rules.pro"
|
|
|
|
)
|
2022-10-26 19:56:31 +00:00
|
|
|
}
|
|
|
|
debug {
|
|
|
|
isDebuggable = true
|
|
|
|
applicationIdSuffix = ".debug"
|
2023-07-31 23:25:28 +00:00
|
|
|
proguardFiles(
|
|
|
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
|
|
"proguard-rules.pro"
|
|
|
|
)
|
2022-10-26 19:56:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
flavorDimensions.add("state")
|
|
|
|
productFlavors {
|
|
|
|
create("stable") {
|
|
|
|
dimension = "state"
|
|
|
|
resValue("bool", "is_prerelease", "false")
|
|
|
|
}
|
|
|
|
create("prerelease") {
|
|
|
|
dimension = "state"
|
|
|
|
resValue("bool", "is_prerelease", "true")
|
|
|
|
buildConfigField("boolean", "BETA", "true")
|
|
|
|
applicationIdSuffix = ".prerelease"
|
|
|
|
signingConfig = signingConfigs.getByName("prerelease")
|
|
|
|
versionNameSuffix = "-PRE"
|
|
|
|
versionCode = (System.currentTimeMillis() / 60000).toInt()
|
|
|
|
}
|
|
|
|
}
|
2023-08-04 03:37:41 +00:00
|
|
|
//toolchain {
|
2023-08-12 20:25:30 +00:00
|
|
|
// languageVersion.set(JavaLanguageVersion.of(17))
|
|
|
|
// }
|
|
|
|
// jvmToolchain(17)
|
2023-08-04 03:37:41 +00:00
|
|
|
|
2022-10-26 19:56:31 +00:00
|
|
|
compileOptions {
|
|
|
|
isCoreLibraryDesugaringEnabled = true
|
|
|
|
|
2023-08-04 15:20:23 +00:00
|
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
2022-10-26 19:56:31 +00:00
|
|
|
}
|
|
|
|
kotlinOptions {
|
2023-08-04 15:20:23 +00:00
|
|
|
jvmTarget = "1.8"
|
2022-10-26 19:56:31 +00:00
|
|
|
freeCompilerArgs = listOf("-Xjvm-default=compatibility")
|
|
|
|
}
|
|
|
|
lint {
|
|
|
|
abortOnError = false
|
|
|
|
checkReleaseBuilds = false
|
|
|
|
}
|
|
|
|
namespace = "com.lagradost.cloudstream3"
|
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
maven("https://jitpack.io")
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
implementation("com.google.android.mediahome:video:1.0.0")
|
2023-08-04 03:37:41 +00:00
|
|
|
implementation("androidx.test.ext:junit-ktx:1.1.5")
|
2022-10-26 19:56:31 +00:00
|
|
|
testImplementation("org.json:json:20180813")
|
|
|
|
|
2023-08-04 03:37:41 +00:00
|
|
|
implementation("androidx.core:core-ktx:1.10.1")
|
|
|
|
implementation("androidx.appcompat:appcompat:1.6.1") // need target 32 for 1.5.0
|
2022-10-26 19:56:31 +00:00
|
|
|
|
|
|
|
// dont change this to 1.6.0 it looks ugly af
|
|
|
|
implementation("com.google.android.material:material:1.5.0")
|
|
|
|
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
|
2023-08-04 03:37:41 +00:00
|
|
|
implementation("androidx.navigation:navigation-fragment-ktx:2.6.0")
|
|
|
|
implementation("androidx.navigation:navigation-ui-ktx:2.6.0")
|
|
|
|
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.6.1")
|
|
|
|
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1")
|
2022-10-26 19:56:31 +00:00
|
|
|
testImplementation("junit:junit:4.13.2")
|
2023-08-04 03:37:41 +00:00
|
|
|
androidTestImplementation("androidx.test.ext:junit:1.1.5")
|
|
|
|
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
|
2023-07-15 01:25:32 +00:00
|
|
|
androidTestImplementation("androidx.test:core")
|
2022-10-26 19:56:31 +00:00
|
|
|
|
|
|
|
//implementation("io.karn:khttp-android:0.1.2") //okhttp instead
|
2023-08-16 14:15:39 +00:00
|
|
|
// implementation("org.jsoup:jsoup:1.13.1")
|
2022-10-26 19:56:31 +00:00
|
|
|
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.13.1")
|
|
|
|
|
|
|
|
implementation("androidx.preference:preference-ktx:1.2.0")
|
|
|
|
|
|
|
|
implementation("com.github.bumptech.glide:glide:4.13.1")
|
|
|
|
kapt("com.github.bumptech.glide:compiler:4.13.1")
|
|
|
|
implementation("com.github.bumptech.glide:okhttp3-integration:4.13.0")
|
|
|
|
|
|
|
|
implementation("jp.wasabeef:glide-transformations:4.3.0")
|
|
|
|
|
|
|
|
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
|
|
|
|
|
|
|
|
// implementation("androidx.leanback:leanback-paging:1.1.0-alpha09")
|
|
|
|
|
2023-08-02 17:36:05 +00:00
|
|
|
// Media 3
|
2023-08-17 21:11:59 +00:00
|
|
|
implementation("androidx.media3:media3-common:1.1.1")
|
|
|
|
implementation("androidx.media3:media3-exoplayer:1.1.1")
|
|
|
|
implementation("androidx.media3:media3-datasource-okhttp:1.1.1")
|
|
|
|
implementation("androidx.media3:media3-ui:1.1.1")
|
|
|
|
implementation("androidx.media3:media3-session:1.1.1")
|
|
|
|
implementation("androidx.media3:media3-cast:1.1.1")
|
|
|
|
implementation("androidx.media3:media3-exoplayer-hls:1.1.1")
|
|
|
|
implementation("androidx.media3:media3-exoplayer-dash:1.1.1")
|
2023-08-02 17:36:05 +00:00
|
|
|
// Custom ffmpeg extension for audio codecs
|
|
|
|
implementation("com.github.recloudstream:media-ffmpeg:1.1.0")
|
2022-10-26 19:56:31 +00:00
|
|
|
|
|
|
|
//implementation("com.google.android.exoplayer:extension-leanback:2.14.0")
|
|
|
|
|
|
|
|
// Bug reports
|
2023-08-17 21:11:59 +00:00
|
|
|
implementation("ch.acra:acra-core:5.11.0")
|
|
|
|
implementation("ch.acra:acra-toast:5.11.0")
|
2022-10-26 19:56:31 +00:00
|
|
|
|
|
|
|
compileOnly("com.google.auto.service:auto-service-annotations:1.0")
|
|
|
|
//either for java sources:
|
|
|
|
annotationProcessor("com.google.auto.service:auto-service:1.0")
|
|
|
|
//or for kotlin sources (requires kapt gradle plugin):
|
|
|
|
kapt("com.google.auto.service:auto-service:1.0")
|
|
|
|
|
|
|
|
// subtitle color picker
|
|
|
|
implementation("com.jaredrummler:colorpicker:1.1.0")
|
|
|
|
|
|
|
|
//run JS
|
2022-11-01 17:01:29 +00:00
|
|
|
// do not upgrade to 1.7.14, since in 1.7.14 Rhino uses the `SourceVersion` class, which is not
|
|
|
|
// available on Android (even when using desugaring), and `NoClassDefFoundError` is thrown
|
|
|
|
implementation("org.mozilla:rhino:1.7.13")
|
2022-10-26 19:56:31 +00:00
|
|
|
|
|
|
|
// TorrentStream
|
|
|
|
//implementation("com.github.TorrentStream:TorrentStream-Android:2.7.0")
|
|
|
|
|
|
|
|
// Downloading
|
2023-08-04 03:37:41 +00:00
|
|
|
implementation("androidx.work:work-runtime:2.8.1")
|
|
|
|
implementation("androidx.work:work-runtime-ktx:2.8.1")
|
2022-10-26 19:56:31 +00:00
|
|
|
|
|
|
|
// Networking
|
2023-08-16 14:15:39 +00:00
|
|
|
// implementation("com.squareup.okhttp3:okhttp:4.9.2")
|
|
|
|
// implementation("com.squareup.okhttp3:okhttp-dnsoverhttps:4.9.1")
|
2023-08-12 20:25:30 +00:00
|
|
|
implementation("com.github.Blatzar:NiceHttp:0.4.3")
|
2022-11-23 14:57:56 +00:00
|
|
|
// To fix SSL fuckery on android 9
|
|
|
|
implementation("org.conscrypt:conscrypt-android:2.2.1")
|
2022-10-26 19:56:31 +00:00
|
|
|
// Util to skip the URI file fuckery 🙏
|
|
|
|
implementation("com.github.tachiyomiorg:unifile:17bec43")
|
|
|
|
|
|
|
|
// API because cba maintaining it myself
|
|
|
|
implementation("com.uwetrottmann.tmdb2:tmdb-java:2.6.0")
|
|
|
|
|
2023-08-17 23:46:29 +00:00
|
|
|
implementation("com.github.discord:OverlappingPanels:0.1.5")
|
2022-10-26 19:56:31 +00:00
|
|
|
// debugImplementation because LeakCanary should only run in debug builds.
|
2023-07-16 00:25:36 +00:00
|
|
|
//debugImplementation("com.squareup.leakcanary:leakcanary-android:2.12")
|
2022-10-26 19:56:31 +00:00
|
|
|
|
|
|
|
// for shimmer when loading
|
|
|
|
implementation("com.facebook.shimmer:shimmer:0.5.0")
|
|
|
|
|
|
|
|
implementation("androidx.tvprovider:tvprovider:1.0.0")
|
|
|
|
|
|
|
|
// used for subtitle decoding https://github.com/albfernandez/juniversalchardet
|
|
|
|
implementation("com.github.albfernandez:juniversalchardet:2.4.0")
|
|
|
|
|
2023-05-03 20:16:35 +00:00
|
|
|
// newpipe yt taken from https://github.com/TeamNewPipe/NewPipe/blob/dev/app/build.gradle#L204
|
2023-08-16 14:15:39 +00:00
|
|
|
// this should be updated frequently to avoid trailer fu*kery
|
|
|
|
implementation("com.github.TeamNewPipe:NewPipeExtractor:1f08d28")
|
2022-11-01 17:01:29 +00:00
|
|
|
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.6")
|
2022-10-26 19:56:31 +00:00
|
|
|
|
|
|
|
// Library/extensions searching with Levenshtein distance
|
|
|
|
implementation("me.xdrop:fuzzywuzzy:1.4.0")
|
2023-01-28 22:38:02 +00:00
|
|
|
|
2023-07-14 19:43:46 +00:00
|
|
|
// color palette for images -> colors
|
2023-01-28 22:38:02 +00:00
|
|
|
implementation("androidx.palette:palette-ktx:1.0.0")
|
2022-10-26 19:56:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks.register("androidSourcesJar", Jar::class) {
|
|
|
|
archiveClassifier.set("sources")
|
|
|
|
from(android.sourceSets.getByName("main").java.srcDirs) //full sources
|
|
|
|
}
|
|
|
|
|
|
|
|
// this is used by the gradlew plugin
|
|
|
|
tasks.register("makeJar", Copy::class) {
|
2022-10-26 20:39:36 +00:00
|
|
|
from("build/intermediates/compile_app_classes_jar/prereleaseDebug")
|
2022-10-26 19:56:31 +00:00
|
|
|
into("build")
|
|
|
|
include("classes.jar")
|
|
|
|
dependsOn("build")
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType<DokkaTask>().configureEach {
|
|
|
|
moduleName.set("Cloudstream")
|
|
|
|
dokkaSourceSets {
|
|
|
|
named("main") {
|
|
|
|
sourceLink {
|
|
|
|
// Unix based directory relative path to the root of the project (where you execute gradle respectively).
|
|
|
|
localDirectory.set(file("src/main/java"))
|
|
|
|
|
|
|
|
// URL showing where the source code can be accessed through the web browser
|
|
|
|
remoteUrl.set(URL("https://github.com/recloudstream/cloudstream/tree/master/app/src/main/java"))
|
|
|
|
// Suffix which is used to append the line number to the URL. Use #L for GitHub
|
|
|
|
remoteLineSuffix.set("#L")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-01-28 22:38:55 +00:00
|
|
|
}
|