mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 23:51:21 +02:00
Dev: use build product flavors for app store release (#1205)
## Description Instead of applying a code patch, this PR uses build time [product flavors](https://developer.android.com/build/build-variants#product-flavors) to define the existing default and an app store variant. This is more robust than maintaining a patch file and making sure it is applied before building. The app store variant applies the same code changes (removing install permission, requiring leanback, & setting `UpdateChecker.ACTIVE`), but via manifest placeholders/merging and `BuildConfig` entries. There are no user facing changes. ### Related issues None ### Testing Built the variants and verified manifest changes via aapt ## Screenshots N/A ## AI or LLM usage None
This commit is contained in:
parent
9a3af225a4
commit
31465051ff
11 changed files with 91 additions and 165 deletions
|
|
@ -20,7 +20,7 @@
|
|||
android:required="false" />
|
||||
<uses-feature
|
||||
android:name="android.software.leanback"
|
||||
android:required="false" />
|
||||
android:required="${leanback}" />
|
||||
<uses-feature
|
||||
android:name="android.hardware.microphone"
|
||||
android:required="false" />
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class UpdateChecker
|
|||
|
||||
private val NOTE_REGEX = Regex("<!-- app-note:(.+) -->")
|
||||
|
||||
val ACTIVE = true
|
||||
const val ACTIVE = BuildConfig.UPDATING_ENABLED
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ import org.jellyfin.sdk.model.DeviceInfo
|
|||
import timber.log.Timber
|
||||
import java.io.BufferedReader
|
||||
import java.io.InputStreamReader
|
||||
import java.util.Date
|
||||
import javax.inject.Inject
|
||||
|
||||
@HiltViewModel
|
||||
|
|
@ -75,6 +76,34 @@ class DebugViewModel
|
|||
display.supportedModes.orEmpty()
|
||||
}
|
||||
|
||||
val av1Included by lazy {
|
||||
try {
|
||||
Class.forName("androidx.media3.decoder.av1.Libdav1dVideoRenderer")
|
||||
true
|
||||
} catch (_: ClassNotFoundException) {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
val ffmpegIncluded by lazy {
|
||||
try {
|
||||
Class.forName("androidx.media3.decoder.ffmpeg.FfmpegAudioRenderer")
|
||||
true
|
||||
} catch (_: ClassNotFoundException) {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
val libMpvLoaded by lazy {
|
||||
try {
|
||||
System.loadLibrary("player")
|
||||
System.loadLibrary("mpv")
|
||||
true
|
||||
} catch (_: Exception) {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
viewModelScope.launchIO {
|
||||
serverRepository.currentUser.value?.rowId?.let {
|
||||
|
|
@ -218,6 +247,7 @@ fun DebugPage(
|
|||
style = MaterialTheme.typography.displaySmall,
|
||||
color = MaterialTheme.colorScheme.onSurface,
|
||||
)
|
||||
val buildTime = Date(BuildConfig.BUILD_TIME)
|
||||
val pkgInfo = context.packageManager.getPackageInfo(context.packageName, 0)
|
||||
val installInfo =
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
|
|
@ -239,6 +269,11 @@ fun DebugPage(
|
|||
"Version Code: ${pkgInfo.versionCodeLong}",
|
||||
"ClientInfo: ${viewModel.clientInfo}",
|
||||
"Build type: ${BuildConfig.BUILD_TYPE}",
|
||||
"Build flavor: ${BuildConfig.FLAVOR}",
|
||||
"Build time: $buildTime",
|
||||
"FFMPEG included: ${viewModel.ffmpegIncluded}",
|
||||
"AV1 included: ${viewModel.av1Included}",
|
||||
"libmpv loaded: ${viewModel.libMpvLoaded}",
|
||||
"Debug enabled: ${BuildConfig.DEBUG}",
|
||||
"ABIs: ${Build.SUPPORTED_ABIS.toList()}",
|
||||
) + installInfo
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue