Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
433 commits
Select commit Hold shift + click to select a range
f173fa7
Again
Luna712 Nov 23, 2025
17e1e61
Try
Luna712 Nov 23, 2025
5ed7674
Try something else
Luna712 Nov 23, 2025
7990fde
Maybe?
Luna712 Nov 23, 2025
ff3e1e9
Revert method for now
Luna712 Nov 23, 2025
6284d92
Merge branch 'master' into testagp
Luna712 Nov 24, 2025
6f2068e
Merge branch 'master' into testagp
Luna712 Nov 24, 2025
29e589a
Merge branch 'master' into testagp
Luna712 Nov 24, 2025
2b8c649
Update
Luna712 Nov 24, 2025
f89340d
Test
Luna712 Nov 24, 2025
747400d
-
Luna712 Nov 24, 2025
f14af00
Update
Luna712 Nov 25, 2025
208ae13
Update
Luna712 Nov 25, 2025
69f5b26
Fix
Luna712 Nov 25, 2025
f2fe1be
Try
Luna712 Nov 25, 2025
cfbbd21
Try
Luna712 Nov 25, 2025
74735b2
-
Luna712 Nov 25, 2025
627448c
Fix
Luna712 Nov 25, 2025
fde40bf
-
Luna712 Nov 25, 2025
a6e74eb
Fix
Luna712 Nov 25, 2025
ce5e797
beta3
Luna712 Nov 27, 2025
6079ee4
Merge branch 'master' into testagp
Luna712 Nov 27, 2025
f7669de
Add
Luna712 Nov 27, 2025
f4d710f
Add
Luna712 Nov 27, 2025
0f7440a
-
Luna712 Nov 27, 2025
4de5b2b
-
Luna712 Nov 27, 2025
7a0e9c3
Merge branch 'master' into testagp
Luna712 Nov 29, 2025
64585fb
Suppress MissingTranslation
Luna712 Nov 29, 2025
12dcb59
Test
Luna712 Nov 29, 2025
ef8d847
Test
Luna712 Nov 29, 2025
47b35f6
-
Luna712 Nov 29, 2025
ce2207f
Test without maven
Luna712 Nov 30, 2025
c55077a
-dokka
Luna712 Nov 30, 2025
c56c642
Try
Luna712 Nov 30, 2025
7bb83c0
Remove
Luna712 Nov 30, 2025
9e165a8
Merge branch 'master' into testagp
Luna712 Nov 30, 2025
12b2ac6
Merge branch 'master' into testagp
Luna712 Nov 30, 2025
1300bc4
Try new generator task
Luna712 Dec 1, 2025
cd4f12a
Try
Luna712 Dec 1, 2025
15cea93
test
Luna712 Dec 1, 2025
76050e8
Try
Luna712 Dec 1, 2025
3d6e2de
Try?
Luna712 Dec 1, 2025
ce87f4f
Try
Luna712 Dec 1, 2025
f4e5d75
Try???
Luna712 Dec 1, 2025
f7d5544
Remove old task and rename new task and fix dependency
Luna712 Dec 1, 2025
eabc2bc
test
Luna712 Dec 1, 2025
1b136c0
Try again...
Luna712 Dec 1, 2025
59b5187
Fix
Luna712 Dec 1, 2025
179b3ae
Try fix
Luna712 Dec 1, 2025
6295a20
test
Luna712 Dec 1, 2025
74a30b9
use string again
Luna712 Dec 1, 2025
6516075
Try using string
Luna712 Dec 1, 2025
6054260
Add
Luna712 Dec 1, 2025
ef390e2
Fix
Luna712 Dec 1, 2025
fd5ad82
-
Luna712 Dec 1, 2025
ece6cc3
-
Luna712 Dec 1, 2025
f8bb46c
Use GitInfo.kt again
Luna712 Dec 1, 2025
4dd7b35
-
Luna712 Dec 1, 2025
4f42b38
Test
Luna712 Dec 1, 2025
0b2e847
Test
Luna712 Dec 1, 2025
77aa08c
-
Luna712 Dec 1, 2025
9c76c8e
Try something else
Luna712 Dec 1, 2025
bc6fee7
Fix?
Luna712 Dec 1, 2025
ec6c23a
Again
Luna712 Dec 1, 2025
b3a8f95
Try
Luna712 Dec 1, 2025
e526ea6
Fix
Luna712 Dec 1, 2025
09032c8
Fix
Luna712 Dec 1, 2025
1bfb6d5
Try again
Luna712 Dec 1, 2025
aaffb8b
Try
Luna712 Dec 1, 2025
cfffbad
Fix
Luna712 Dec 1, 2025
d09ef5e
Fix
Luna712 Dec 1, 2025
d9debfb
Fix
Luna712 Dec 1, 2025
0da2fc2
Fix
Luna712 Dec 1, 2025
2526c71
Try
Luna712 Dec 1, 2025
2b44f24
Fix
Luna712 Dec 1, 2025
811251a
Fix
Luna712 Dec 1, 2025
803d21c
Fix
Luna712 Dec 1, 2025
56e1684
Fix
Luna712 Dec 1, 2025
4ee5a85
Fix
Luna712 Dec 1, 2025
d1b3827
Fix
Luna712 Dec 1, 2025
acb32fd
Fix
Luna712 Dec 1, 2025
03da68b
Try something else again
Luna712 Dec 1, 2025
ce30cb7
remove
Luna712 Dec 1, 2025
8cd25af
Fix?
Luna712 Dec 1, 2025
1903f69
Fix
Luna712 Dec 1, 2025
91cbf04
Fix
Luna712 Dec 1, 2025
b625fba
No java
Luna712 Dec 1, 2025
c096957
Test
Luna712 Dec 1, 2025
3f65303
Test
Luna712 Dec 1, 2025
8b3b51b
Try yet another method
Luna712 Dec 1, 2025
7c19fb5
Try
Luna712 Dec 1, 2025
8302add
Fix
Luna712 Dec 1, 2025
5372e63
Add
Luna712 Dec 1, 2025
ed3f2e5
Update
Luna712 Dec 1, 2025
5af0c1f
Update
Luna712 Dec 1, 2025
cb54920
Fix
Luna712 Dec 1, 2025
173f09a
Update
Luna712 Dec 1, 2025
8624e99
Test
Luna712 Dec 1, 2025
d306d9d
Try asset
Luna712 Dec 1, 2025
bba7f0c
Fix
Luna712 Dec 1, 2025
4ba071a
Once more
Luna712 Dec 1, 2025
6794311
Fix
Luna712 Dec 1, 2025
414d6f6
Fix?
Luna712 Dec 1, 2025
6f334cb
-
Luna712 Dec 1, 2025
9e25826
Try something once again
Luna712 Dec 2, 2025
6a83620
Fix
Luna712 Dec 2, 2025
583d483
Remove androidComponents versions and try fix
Luna712 Dec 2, 2025
f1bd6d3
Cleanup and try fix
Luna712 Dec 2, 2025
786f637
Try
Luna712 Dec 2, 2025
8885b37
-
Luna712 Dec 2, 2025
1d34fc2
Remove
Luna712 Dec 2, 2025
f4cb254
Remove
Luna712 Dec 2, 2025
f170dd2
Move
Luna712 Dec 2, 2025
db87edc
Update
Luna712 Dec 2, 2025
122463c
Update
Luna712 Dec 2, 2025
adac7ad
Update
Luna712 Dec 2, 2025
214b5cc
Nullable handling
Luna712 Dec 2, 2025
82c922d
Update
Luna712 Dec 2, 2025
d450057
Not nullable
Luna712 Dec 2, 2025
2645f13
Update
Luna712 Dec 2, 2025
0465af3
-
Luna712 Dec 2, 2025
e133435
Test
Luna712 Dec 2, 2025
a5be3ec
-
Luna712 Dec 2, 2025
b7eca61
-
Luna712 Dec 2, 2025
79f1c8c
RC2
Luna712 Dec 2, 2025
f704611
-
Luna712 Dec 3, 2025
78ef8ca
Test
Luna712 Dec 3, 2025
aed3c1b
Use temurin
Luna712 Dec 3, 2025
b063839
-
Luna712 Dec 3, 2025
2eaab01
Try dependsOn library assemble
Luna712 Dec 3, 2025
26af899
Try
Luna712 Dec 3, 2025
48066a5
Try assemble
Luna712 Dec 3, 2025
2925e7b
Try preBuild
Luna712 Dec 3, 2025
78479b3
Try
Luna712 Dec 3, 2025
aefe5ee
Try
Luna712 Dec 3, 2025
623587b
-
Luna712 Dec 3, 2025
fcb5d51
-
Luna712 Dec 3, 2025
929f71c
Test
Luna712 Dec 3, 2025
6e14ee4
-
Luna712 Dec 3, 2025
8ee8a49
Try
Luna712 Dec 3, 2025
1acaf1f
-
Luna712 Dec 3, 2025
05171b7
-
Luna712 Dec 3, 2025
56bfe5a
Update
Luna712 Dec 3, 2025
687a80b
Merge branch 'master' into testagp
Luna712 Dec 5, 2025
0825429
Merge branch 'master' into testagp
Luna712 Dec 5, 2025
bcaca07
.
Luna712 Dec 5, 2025
beb3ce5
-
Luna712 Dec 5, 2025
f027ff9
Test
Luna712 Dec 5, 2025
04c509e
Update
Luna712 Dec 5, 2025
2bec960
-
Luna712 Dec 5, 2025
eb024ec
test
Luna712 Dec 5, 2025
6201ecc
Test
Luna712 Dec 5, 2025
9010e0d
Add
Luna712 Dec 5, 2025
d5496cb
Add
Luna712 Dec 5, 2025
7adc545
Add
Luna712 Dec 5, 2025
bffb43d
-
Luna712 Dec 5, 2025
e8664bb
-
Luna712 Dec 5, 2025
445ea27
Add
Luna712 Dec 5, 2025
54e294c
Try
Luna712 Dec 5, 2025
5fe15d0
-
Luna712 Dec 5, 2025
2c9103e
Merge branch 'master' into testagp
Luna712 Dec 6, 2025
6577484
Test
Luna712 Dec 7, 2025
02c22be
-
Luna712 Dec 7, 2025
2965032
Test
Luna712 Dec 7, 2025
d73dca1
Test
Luna712 Dec 7, 2025
3aea959
Test
Luna712 Dec 7, 2025
62c8162
Update
Luna712 Dec 7, 2025
5f677e1
Update
Luna712 Dec 7, 2025
cd7a80c
Test
Luna712 Dec 8, 2025
8f8a46a
Try
Luna712 Dec 8, 2025
745db7f
Test
Luna712 Dec 8, 2025
b11a843
try ffmpeg
Luna712 Dec 8, 2025
969d838
-
Luna712 Dec 8, 2025
979e4e2
Bump versions
Luna712 Dec 9, 2025
d0f16fc
-
Luna712 Dec 9, 2025
9398d1a
Merge branch 'master' into testagp
Luna712 Dec 9, 2025
d803e45
Add
Luna712 Dec 9, 2025
b4fbc5d
Test
Luna712 Dec 10, 2025
9174045
Test
Luna712 Dec 10, 2025
2651709
Test
Luna712 Dec 10, 2025
9a3f68f
Test
Luna712 Dec 10, 2025
eaa9fcb
Update
Luna712 Dec 10, 2025
53dc721
Update
Luna712 Dec 10, 2025
d7f4390
Update
Luna712 Dec 10, 2025
119d111
Update
Luna712 Dec 10, 2025
769f7f0
Update
Luna712 Dec 10, 2025
17e0278
Update
Luna712 Dec 10, 2025
0d87ca8
Update
Luna712 Dec 10, 2025
57a444e
Update
Luna712 Dec 10, 2025
34f4a4b
Merge branch 'master' into testagp
Luna712 Dec 11, 2025
3053bdc
Merge branch 'master' into testagp
Luna712 Dec 11, 2025
37025ff
Merge branch 'master' into testagp
Luna712 Dec 11, 2025
125b24d
Merge branch 'master' into testagp
Luna712 Dec 11, 2025
d446a6c
beta05
Luna712 Dec 11, 2025
3c1890f
Merge branch 'master' into testagp
Luna712 Dec 11, 2025
28f52ba
Add
Luna712 Dec 12, 2025
bf6e795
Test 2.3.20-dev-6795
Luna712 Dec 12, 2025
bb3cd0f
Test 2.3.20-dev-6091
Luna712 Dec 12, 2025
920ad13
Test 2.3.20-dev-6745
Luna712 Dec 12, 2025
b2cc62b
Test 2.3.20-dev-6670
Luna712 Dec 12, 2025
eaf9618
Test 2.3.20-dev-6805
Luna712 Dec 13, 2025
c95b0fc
Test moving file check
Luna712 Dec 13, 2025
3762c39
Test
Luna712 Dec 13, 2025
d3fe146
Try
Luna712 Dec 13, 2025
9fa7b98
-for now
Luna712 Dec 13, 2025
ae1a7f5
Test
Luna712 Dec 13, 2025
e719c14
Use SIGNING_KEY_ALIAS
Luna712 Dec 13, 2025
4753ddc
Update
Luna712 Dec 13, 2025
e360ffb
Update
Luna712 Dec 13, 2025
35214bf
Merge branch 'master' into testagp
Luna712 Dec 13, 2025
4f4c9ee
Merge branch 'master' into testagp
Luna712 Dec 14, 2025
ceba49c
Merge branch 'master' into testagp
Luna712 Dec 15, 2025
102bcb4
Merge branch 'master' into testagp
Luna712 Dec 16, 2025
8287eed
Merge branch 'master' into testagp
Luna712 Dec 16, 2025
182ee15
Merge branch 'master' into testagp
Luna712 Dec 16, 2025
049ac31
Merge branch 'master' into testagp
Luna712 Dec 16, 2025
13d8a70
Remove
Luna712 Dec 16, 2025
fd5e3c3
-
Luna712 Dec 16, 2025
ee39450
Use rc01
Luna712 Dec 18, 2025
9bc7a00
Merge branch 'master' into testagp
Luna712 Dec 19, 2025
933e077
Merge branch 'master' into testagp
Luna712 Dec 20, 2025
485bdc5
Merge branch 'master' into testagp
Luna712 Dec 21, 2025
61008ac
abortOnError = false
Luna712 Dec 21, 2025
2a98f67
2.3.0 instead of 2.3.20-dev-6805
Luna712 Dec 21, 2025
427c34c
Remove ffmpeg
Luna712 Dec 21, 2025
973aacd
Remove maven
Luna712 Dec 21, 2025
247f54b
Merge branch 'master' into testagp
Luna712 Dec 21, 2025
3adff4e
-
Luna712 Dec 21, 2025
7d4ca1d
Merge branch 'master' into testagp
Luna712 Dec 21, 2025
56a304f
-
Luna712 Dec 21, 2025
2d276c7
Merge branch 'master' into testagp
Luna712 Dec 21, 2025
fad3bad
Add
Luna712 Dec 21, 2025
49ef108
Update
Luna712 Dec 21, 2025
18a6aa0
-
Luna712 Dec 21, 2025
a36818f
-
Luna712 Dec 21, 2025
fd20cb8
Try
Luna712 Dec 21, 2025
4ce0c53
Test
Luna712 Dec 21, 2025
e547e12
-
Luna712 Dec 21, 2025
a6fc141
-
Luna712 Dec 21, 2025
23ea2f5
Update
Luna712 Dec 21, 2025
f9b8fa4
Try
Luna712 Dec 21, 2025
2ab86a8
-
Luna712 Dec 21, 2025
aeb30d8
-
Luna712 Dec 21, 2025
f5f89c3
Update
Luna712 Dec 22, 2025
f5189f6
Try
Luna712 Dec 22, 2025
ff8b32b
Try
Luna712 Dec 22, 2025
89560a8
Merge branch 'master' into testagp
Luna712 Dec 24, 2025
e8cb526
-
Luna712 Dec 24, 2025
cca269c
Merge branch 'master' into testagp
Luna712 Jan 19, 2026
f1affd6
9.0.0
Luna712 Jan 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 48 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,56 @@ jobs:
cache-read-only: false

- name: Run Gradle
run: ./gradlew assemblePrereleaseDebug
run: ./gradlew assemblePrereleaseRelease androidSourcesJar makeJar

- name: Upload Artifact
uses: actions/upload-artifact@v6
with:
name: pull-request-build
path: "app/build/outputs/apk/prerelease/debug/*.apk"
path: |
app/build/outputs/apk/prerelease/debug/*.apk
app/build/outputs/apk/prerelease/release/*.apk
app/build/libs/app-sources.jar
app/build/classes.jar
library/build/libs/library-*-sources.jar

- name: Deploy Reports to GitHub Pages
run: |
BRANCH_NAME=${GITHUB_REF#refs/heads/}
TARGET_DIR=gh-pages/$BRANCH_NAME
mkdir -p "$TARGET_DIR"
if [ -d "build/reports" ]; then
cp -r build/reports/. "$TARGET_DIR/"
fi
for REPORT_DIR in */build/reports; do
if [ -d "$REPORT_DIR" ]; then
cp -r "$REPORT_DIR/." "$TARGET_DIR/"
fi
done
INDEX_FILE="$TARGET_DIR/index.html"
echo "<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>Reports for $BRANCH_NAME</title>
</head>
<body>
<h1>Reports for branch $BRANCH_NAME</h1>
<ul>" > "$INDEX_FILE"
find "$TARGET_DIR" -type f -name "*.html" | while read FILE; do
REL_PATH="${FILE#$TARGET_DIR/}"
echo " <li><a href=\"$REL_PATH\">$REL_PATH</a></li>" >> "$INDEX_FILE"
done
echo " </ul>
</body>
</html>" >> "$INDEX_FILE"
shell: bash

- name: Push to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./gh-pages
user_name: "github-actions"
user_email: "github-actions@github.com"
commit_message: "Update reports for ${{ github.ref_name }} [ci skip]"
98 changes: 64 additions & 34 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties
import com.android.build.gradle.tasks.MergeSourceSetFolders
import org.jetbrains.dokka.gradle.engine.parameters.KotlinPlatform
import org.jetbrains.dokka.gradle.engine.parameters.VisibilityModifier
import org.jetbrains.kotlin.gradle.dsl.JvmDefaultMode
Expand All @@ -7,31 +8,49 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile

plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.dokka)
alias(libs.plugins.kotlin.android)
// alias(libs.plugins.dokka)
}

val javaTarget = JvmTarget.fromTarget(libs.versions.jvmTarget.get())
val tmpFilePath = System.getProperty("user.home") + "/work/_temp/keystore/"
val prereleaseStoreFile: File? = File(tmpFilePath).listFiles()?.first()

fun getGitCommitHash(): String {
return try {
val headFile = file("${project.rootDir}/.git/HEAD")

// Read the commit hash from .git/HEAD
if (headFile.exists()) {
val headContent = headFile.readText().trim()
if (headContent.startsWith("ref:")) {
val refPath = headContent.substring(5) // e.g., refs/heads/main
val commitFile = file("${project.rootDir}/.git/$refPath")
if (commitFile.exists()) commitFile.readText().trim() else ""
} else headContent // If it's a detached HEAD (commit hash directly)
} else {
"" // If .git/HEAD doesn't exist
}.take(7) // Return the short commit hash
} catch (_: Throwable) {
"" // Just return an empty string if any exception occurs

tasks.register("generateGitHash") {
val gitHashDir = layout.buildDirectory.dir("generated/git")
val rootDir = project.rootDir
outputs.dir(gitHashDir)

doLast {
val hash = try {
// Read the commit hash from .git/HEAD
val headFile = File(rootDir, ".git/HEAD")
if (headFile.exists()) {
val headContent = headFile.readText().trim()
if (headContent.startsWith("ref:")) {
val refPath = headContent.substring(5) // e.g., refs/heads/main
val commitFile = File(rootDir, ".git/$refPath")
if (commitFile.exists()) commitFile.readText().trim() else ""
} else headContent // If it's a detached HEAD (commit hash directly)
} else "" // If .git/HEAD doesn't exist
} catch (_: Throwable) {
"" // Just set to an empty string if any exception occurs
}.take(7) // Get the short commit hash

val outFile = gitHashDir.get().file("git-hash.txt").asFile
outFile.parentFile.mkdirs()
outFile.writeText(hash)
}
}

tasks.withType<MergeSourceSetFolders> {
if (name.contains("Assets", ignoreCase = true)) {
dependsOn("generateGitHash")
val gitHashDir = layout.buildDirectory.dir("generated/git")

doLast {
val assetsDir = outputs.files.singleFile
val gitHashFile = gitHashDir.get().file("git-hash.txt").asFile
val outFile = File(assetsDir, "git-hash.txt")
gitHashFile.copyTo(outFile, overwrite = true)
}
}
}

Expand All @@ -46,9 +65,14 @@ android {
}

signingConfigs {
if (prereleaseStoreFile != null) {
// We just use SIGNING_KEY_ALIAS here since it won't change
// so won't kill the configuration cache.
if (System.getenv("SIGNING_KEY_ALIAS") != null) {
create("prerelease") {
storeFile = file(prereleaseStoreFile)
val tmpFilePath = System.getProperty("user.home") + "/work/_temp/keystore/"
val prereleaseStoreFile: File? = File(tmpFilePath).listFiles()?.first()

storeFile = prereleaseStoreFile?.let { file(it) }
storePassword = System.getenv("SIGNING_STORE_PASSWORD")
keyAlias = System.getenv("SIGNING_KEY_ALIAS")
keyPassword = System.getenv("SIGNING_KEY_PASSWORD")
Expand All @@ -65,8 +89,6 @@ android {
versionCode = 67
versionName = "4.6.1"

resValue("string", "commit_hash", getGitCommitHash())

manifestPlaceholders["target_sdk_version"] = libs.versions.targetSdk.get()

// Reads local.properties
Expand Down Expand Up @@ -135,26 +157,34 @@ android {
}

java {
// Use Java 17 toolchain even if a higher JDK runs the build.
// Use Java 17 toolchain even if a higher JDK runs the build.
// We still use Java 8 for now which higher JDKs have deprecated.
toolchain {
languageVersion.set(JavaLanguageVersion.of(libs.versions.jdkToolchain.get()))
}
toolchain {
languageVersion.set(JavaLanguageVersion.of(libs.versions.jdkToolchain.get()))
}
}

lint {
abortOnError = false
checkReleaseBuilds = false
}

buildFeatures {
buildConfig = true
resValues = true
}

namespace = "com.lagradost.cloudstream3"
}

androidComponents {
// Make sure lint runs when running debug builds
onVariants(selector().withBuildType("debug")) { variant ->
val variantName = variant.name.replaceFirstChar { it.uppercase() }
tasks.matching { it.name == "assemble$variantName" }.configureEach {
dependsOn("lint", ":library:lint")
}
}
}

dependencies {
// Testing
testImplementation(libs.junit)
Expand Down Expand Up @@ -271,7 +301,7 @@ tasks.withType<KotlinJvmCompile> {
}
}

dokka {
/*dokka {
moduleName = "App"
dokkaSourceSets {
main {
Expand All @@ -288,4 +318,4 @@ dokka {
}
}
}
}
}*/
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import com.lagradost.cloudstream3.ui.settings.Globals.TV
import com.lagradost.cloudstream3.ui.settings.Globals.isLandscape
import com.lagradost.cloudstream3.ui.settings.Globals.isLayout
import com.lagradost.cloudstream3.utils.DataStoreHelper
import com.lagradost.cloudstream3.utils.GitInfo.currentCommitHash
import com.lagradost.cloudstream3.utils.ImageLoader.loadImage
import com.lagradost.cloudstream3.utils.UIHelper.clipboardHelper
import com.lagradost.cloudstream3.utils.UIHelper.fixSystemBarsPadding
Expand Down Expand Up @@ -247,16 +248,17 @@ class SettingsFragment : BaseFragment<MainSettingsBinding>(
}

val appVersion = BuildConfig.VERSION_NAME
val commitInfo = getString(R.string.commit_hash)
val commitHash = activity?.currentCommitHash() ?: ""
val buildTimestamp = SimpleDateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG,
Locale.getDefault()
).apply { timeZone = TimeZone.getTimeZone("UTC")
}.format(Date(BuildConfig.BUILD_DATE)).replace("UTC", "")

binding.appVersion.text = appVersion
binding.buildDate.text = buildTimestamp
binding.commitHash.text = commitHash
binding.appVersionInfo.setOnLongClickListener {
clipboardHelper(txt(R.string.extension_version), "$appVersion $commitInfo $buildTimestamp")
clipboardHelper(txt(R.string.extension_version), "$appVersion $commitHash $buildTimestamp")
true
}
}
Expand Down
20 changes: 20 additions & 0 deletions app/src/main/java/com/lagradost/cloudstream3/utils/GitInfo.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.lagradost.cloudstream3.utils

import android.content.Context

/**
* Simple helper to get the short commit hash from assets.
* The hash is generated at build and stored as an asset
* that can be accessed at runtime for Gradle
* configuration cache support.
*/
object GitInfo {
fun Context.currentCommitHash(): String = try {
assets.open("git-hash.txt")
.bufferedReader()
.readText()
.trim()
} catch (_: Exception) {
""
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import com.lagradost.cloudstream3.services.PackageInstallerService
import com.lagradost.cloudstream3.utils.AppContextUtils.setDefaultFocus
import com.lagradost.cloudstream3.utils.AppUtils.parseJson
import com.lagradost.cloudstream3.utils.Coroutines.ioSafe
import com.lagradost.cloudstream3.utils.GitInfo.currentCommitHash
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
import okio.BufferedSink
Expand Down Expand Up @@ -170,7 +171,7 @@ object InAppUpdater {
Log.d(LOG_TAG, "Fetched GitHub tag: $updateCommitHash")

return Update(
getString(R.string.commit_hash) != updateCommitHash,
currentCommitHash() != updateCommitHash,
foundAsset.browserDownloadUrl,
updateCommitHash,
found.body,
Expand Down
7 changes: 3 additions & 4 deletions app/src/main/res/layout/main_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:text="@string/commit_hash"
android:textColor="?attr/textColor" />
android:textColor="?attr/textColor"
tools:text="1234567" />

<TextView
android:id="@+id/delimiter1"
Expand All @@ -150,9 +150,8 @@
android:layout_height="wrap_content"
android:padding="10dp"
android:textColor="?attr/textColor"
tools:text="21/03/2024 09:02 pm"/>
tools:text="21/03/2024 09:02 pm" />
</LinearLayout>

</LinearLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ plugins {
alias(libs.plugins.android.multiplatform.library) apply false
alias(libs.plugins.buildkonfig) apply false // Universal build config
alias(libs.plugins.dokka) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.kotlin.multiplatform) apply false
}
Expand Down
3 changes: 1 addition & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# https://docs.gradle.org/current/userguide/dependency_versions.html#sec:strict-version
[versions]
activityKtx = "1.11.0"
androidGradlePlugin = "8.13.2"
androidGradlePlugin = "9.0.0"
appcompat = "1.7.1"
biometric = "1.4.0-alpha04"
buildkonfigGradlePlugin = "0.17.1"
Expand Down Expand Up @@ -119,7 +119,6 @@ android-lint = { id = "com.android.lint", version.ref = "androidGradlePlugin" }
android-multiplatform-library = { id = "com.android.kotlin.multiplatform.library", version.ref = "androidGradlePlugin" }
buildkonfig = { id = "com.codingfeline.buildkonfig", version.ref = "buildkonfigGradlePlugin" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokkaGradlePlugin" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlinGradlePlugin" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm" , version.ref = "kotlinGradlePlugin" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlinGradlePlugin" }

Expand Down
Loading