mirror of
https://github.com/mihonapp/mihon.git
synced 2025-03-01 18:34:13 +01:00
Rework build variants and add FOSS variant (#1775)
This commit is contained in:
parent
1dd81ef1e1
commit
fe22f5aa37
6
.github/workflows/build_pull_request.yml
vendored
6
.github/workflows/build_pull_request.yml
vendored
@ -41,10 +41,10 @@ jobs:
|
|||||||
run: ./gradlew spotlessCheck
|
run: ./gradlew spotlessCheck
|
||||||
|
|
||||||
- name: Build app
|
- name: Build app
|
||||||
run: ./gradlew assembleStandardRelease
|
run: ./gradlew assembleRelease
|
||||||
|
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
run: ./gradlew testReleaseUnitTest testStandardReleaseUnitTest
|
run: ./gradlew testReleaseUnitTest
|
||||||
|
|
||||||
- name: Upload APK
|
- name: Upload APK
|
||||||
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
|
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
|
||||||
@ -56,4 +56,4 @@ jobs:
|
|||||||
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
|
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
|
||||||
with:
|
with:
|
||||||
name: mapping-${{ github.sha }}
|
name: mapping-${{ github.sha }}
|
||||||
path: app/build/outputs/mapping/standardRelease
|
path: app/build/outputs/mapping/release
|
||||||
|
10
.github/workflows/build_push.yml
vendored
10
.github/workflows/build_push.yml
vendored
@ -32,10 +32,10 @@ jobs:
|
|||||||
run: ./gradlew spotlessCheck
|
run: ./gradlew spotlessCheck
|
||||||
|
|
||||||
- name: Build app
|
- name: Build app
|
||||||
run: ./gradlew assembleStandardRelease
|
run: ./gradlew assembleRelease -Pwith-analytics -Pwith-updater
|
||||||
|
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
run: ./gradlew testReleaseUnitTest testStandardReleaseUnitTest
|
run: ./gradlew testReleaseUnitTest
|
||||||
|
|
||||||
- name: Upload APK
|
- name: Upload APK
|
||||||
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
|
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
|
||||||
@ -47,7 +47,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
|
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
|
||||||
with:
|
with:
|
||||||
name: mapping-${{ github.sha }}
|
name: mapping-${{ github.sha }}
|
||||||
path: app/build/outputs/mapping/standardRelease
|
path: app/build/outputs/mapping/release
|
||||||
|
|
||||||
# Sign APK and create release for tags
|
# Sign APK and create release for tags
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ jobs:
|
|||||||
mv app/build/outputs/apk/standard/release/app-standard-x86-release-unsigned-signed.apk mihon-x86-${{ env.VERSION_TAG }}.apk
|
mv app/build/outputs/apk/standard/release/app-standard-x86-release-unsigned-signed.apk mihon-x86-${{ env.VERSION_TAG }}.apk
|
||||||
sha=`sha256sum mihon-x86-${{ env.VERSION_TAG }}.apk | awk '{ print $1 }'`
|
sha=`sha256sum mihon-x86-${{ env.VERSION_TAG }}.apk | awk '{ print $1 }'`
|
||||||
echo "APK_X86_SHA=$sha" >> $GITHUB_ENV
|
echo "APK_X86_SHA=$sha" >> $GITHUB_ENV
|
||||||
|
|
||||||
mv app/build/outputs/apk/standard/release/app-standard-x86_64-release-unsigned-signed.apk mihon-x86_64-${{ env.VERSION_TAG }}.apk
|
mv app/build/outputs/apk/standard/release/app-standard-x86_64-release-unsigned-signed.apk mihon-x86_64-${{ env.VERSION_TAG }}.apk
|
||||||
sha=`sha256sum mihon-x86_64-${{ env.VERSION_TAG }}.apk | awk '{ print $1 }'`
|
sha=`sha256sum mihon-x86_64-${{ env.VERSION_TAG }}.apk | awk '{ print $1 }'`
|
||||||
echo "APK_X86_64_SHA=$sha" >> $GITHUB_ENV
|
echo "APK_X86_64_SHA=$sha" >> $GITHUB_ENV
|
||||||
@ -110,7 +110,7 @@ jobs:
|
|||||||
| armeabi-v7a | ${{ env.APK_ARMEABI_V7A_SHA }}
|
| armeabi-v7a | ${{ env.APK_ARMEABI_V7A_SHA }}
|
||||||
| x86 | ${{ env.APK_X86_SHA }} |
|
| x86 | ${{ env.APK_X86_SHA }} |
|
||||||
| x86_64 | ${{ env.APK_X86_64_SHA }} |
|
| x86_64 | ${{ env.APK_X86_64_SHA }} |
|
||||||
|
|
||||||
## If you are unsure which version to choose then go with mihon-${{ env.VERSION_TAG }}.apk
|
## If you are unsure which version to choose then go with mihon-${{ env.VERSION_TAG }}.apk
|
||||||
files: |
|
files: |
|
||||||
mihon-${{ env.VERSION_TAG }}.apk
|
mihon-${{ env.VERSION_TAG }}.apk
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
@file:Suppress("ChromeOsAbiSupport")
|
|
||||||
|
|
||||||
import mihon.buildlogic.getBuildTime
|
import mihon.buildlogic.getBuildTime
|
||||||
import mihon.buildlogic.getCommitCount
|
import mihon.buildlogic.getCommitCount
|
||||||
import mihon.buildlogic.getGitSha
|
import mihon.buildlogic.getGitSha
|
||||||
@ -12,7 +10,10 @@ plugins {
|
|||||||
alias(libs.plugins.aboutLibraries)
|
alias(libs.plugins.aboutLibraries)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gradle.startParameter.taskRequests.toString().contains("Standard")) {
|
val includeAnalytics = project.hasProperty("with-analytics")
|
||||||
|
val includeUpdater = project.hasProperty("with-updater")
|
||||||
|
|
||||||
|
if (includeAnalytics) {
|
||||||
pluginManager.apply {
|
pluginManager.apply {
|
||||||
apply(libs.plugins.google.services.get().pluginId)
|
apply(libs.plugins.google.services.get().pluginId)
|
||||||
apply(libs.plugins.firebase.crashlytics.get().pluginId)
|
apply(libs.plugins.firebase.crashlytics.get().pluginId)
|
||||||
@ -21,8 +22,6 @@ if (gradle.startParameter.taskRequests.toString().contains("Standard")) {
|
|||||||
|
|
||||||
shortcutHelper.setFilePath("./shortcuts.xml")
|
shortcutHelper.setFilePath("./shortcuts.xml")
|
||||||
|
|
||||||
val supportedAbis = setOf("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "eu.kanade.tachiyomi"
|
namespace = "eu.kanade.tachiyomi"
|
||||||
|
|
||||||
@ -35,90 +34,100 @@ android {
|
|||||||
buildConfigField("String", "COMMIT_COUNT", "\"${getCommitCount()}\"")
|
buildConfigField("String", "COMMIT_COUNT", "\"${getCommitCount()}\"")
|
||||||
buildConfigField("String", "COMMIT_SHA", "\"${getGitSha()}\"")
|
buildConfigField("String", "COMMIT_SHA", "\"${getGitSha()}\"")
|
||||||
buildConfigField("String", "BUILD_TIME", "\"${getBuildTime()}\"")
|
buildConfigField("String", "BUILD_TIME", "\"${getBuildTime()}\"")
|
||||||
buildConfigField("boolean", "INCLUDE_UPDATER", "false")
|
buildConfigField("boolean", "INCLUDE_ANALYTICS", "$includeAnalytics")
|
||||||
|
buildConfigField("boolean", "INCLUDE_UPDATER", "$includeUpdater")
|
||||||
buildConfigField("boolean", "PREVIEW", "false")
|
buildConfigField("boolean", "PREVIEW", "false")
|
||||||
|
|
||||||
ndk {
|
|
||||||
abiFilters += supportedAbis
|
|
||||||
}
|
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
val debug by getting {
|
||||||
|
applicationIdSuffix = ".dev"
|
||||||
|
versionNameSuffix = "-${getCommitCount()}"
|
||||||
|
isPseudoLocalesEnabled = true
|
||||||
|
}
|
||||||
|
val release by getting {
|
||||||
|
isMinifyEnabled = true
|
||||||
|
isShrinkResources = true
|
||||||
|
|
||||||
|
proguardFiles("proguard-android-optimize.txt", "proguard-rules.pro")
|
||||||
|
}
|
||||||
|
create("foss") {
|
||||||
|
initWith(release)
|
||||||
|
|
||||||
|
applicationIdSuffix = ".t-foss"
|
||||||
|
|
||||||
|
matchingFallbacks.add(release.name)
|
||||||
|
}
|
||||||
|
create("preview") {
|
||||||
|
initWith(release)
|
||||||
|
|
||||||
|
applicationIdSuffix = ".debug"
|
||||||
|
|
||||||
|
versionNameSuffix = debug.versionNameSuffix
|
||||||
|
signingConfig = debug.signingConfig
|
||||||
|
|
||||||
|
matchingFallbacks.add(release.name)
|
||||||
|
|
||||||
|
buildConfigField("boolean", "PREVIEW", "true")
|
||||||
|
}
|
||||||
|
create("benchmark") {
|
||||||
|
initWith(release)
|
||||||
|
|
||||||
|
isDebuggable = false
|
||||||
|
isProfileable = true
|
||||||
|
versionNameSuffix = "-benchmark"
|
||||||
|
applicationIdSuffix = ".benchmark"
|
||||||
|
|
||||||
|
signingConfig = debug.signingConfig
|
||||||
|
|
||||||
|
matchingFallbacks.add(release.name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
val analyticsDir = if (includeAnalytics) "analytics-firebase" else "analytics-firebase-noop"
|
||||||
|
getByName("main").kotlin.srcDirs("src/$analyticsDir/kotlin")
|
||||||
|
getByName("preview").res.srcDirs("src/debug/res")
|
||||||
|
getByName("benchmark").res.srcDirs("src/debug/res")
|
||||||
|
}
|
||||||
|
|
||||||
splits {
|
splits {
|
||||||
abi {
|
abi {
|
||||||
isEnable = true
|
isEnable = true
|
||||||
reset()
|
|
||||||
include(*supportedAbis.toTypedArray())
|
|
||||||
isUniversalApk = true
|
isUniversalApk = true
|
||||||
}
|
reset()
|
||||||
}
|
include("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
|
||||||
|
|
||||||
buildTypes {
|
|
||||||
named("debug") {
|
|
||||||
versionNameSuffix = "-${getCommitCount()}"
|
|
||||||
applicationIdSuffix = ".debug"
|
|
||||||
isPseudoLocalesEnabled = true
|
|
||||||
}
|
|
||||||
named("release") {
|
|
||||||
isShrinkResources = true
|
|
||||||
isMinifyEnabled = true
|
|
||||||
proguardFiles("proguard-android-optimize.txt", "proguard-rules.pro")
|
|
||||||
}
|
|
||||||
create("preview") {
|
|
||||||
initWith(getByName("release"))
|
|
||||||
buildConfigField("boolean", "PREVIEW", "true")
|
|
||||||
|
|
||||||
signingConfig = signingConfigs.getByName("debug")
|
|
||||||
matchingFallbacks.add("release")
|
|
||||||
val debugType = getByName("debug")
|
|
||||||
versionNameSuffix = debugType.versionNameSuffix
|
|
||||||
applicationIdSuffix = debugType.applicationIdSuffix
|
|
||||||
}
|
|
||||||
create("benchmark") {
|
|
||||||
initWith(getByName("release"))
|
|
||||||
|
|
||||||
signingConfig = signingConfigs.getByName("debug")
|
|
||||||
matchingFallbacks.add("release")
|
|
||||||
isDebuggable = false
|
|
||||||
isProfileable = true
|
|
||||||
versionNameSuffix = "-benchmark"
|
|
||||||
applicationIdSuffix = ".benchmark"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
getByName("preview").res.srcDirs("src/debug/res")
|
|
||||||
getByName("benchmark").res.srcDirs("src/debug/res")
|
|
||||||
}
|
|
||||||
|
|
||||||
flavorDimensions.add("default")
|
|
||||||
|
|
||||||
productFlavors {
|
|
||||||
create("standard") {
|
|
||||||
buildConfigField("boolean", "INCLUDE_UPDATER", "true")
|
|
||||||
dimension = "default"
|
|
||||||
}
|
|
||||||
create("dev") {
|
|
||||||
dimension = "default"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
packaging {
|
packaging {
|
||||||
resources.excludes.addAll(
|
jniLibs {
|
||||||
listOf(
|
keepDebugSymbols += listOf(
|
||||||
|
"libandroidx.graphics.path",
|
||||||
|
"libarchive-jni",
|
||||||
|
"libconscrypt_jni",
|
||||||
|
"libimagedecoder",
|
||||||
|
"libquickjs",
|
||||||
|
"libsqlite3x",
|
||||||
|
)
|
||||||
|
.map { "**/$it.so" }
|
||||||
|
}
|
||||||
|
resources {
|
||||||
|
excludes += setOf(
|
||||||
"kotlin-tooling-metadata.json",
|
"kotlin-tooling-metadata.json",
|
||||||
"META-INF/DEPENDENCIES",
|
|
||||||
"LICENSE.txt",
|
"LICENSE.txt",
|
||||||
"META-INF/LICENSE",
|
"META-INF/**/*.properties",
|
||||||
"META-INF/**/LICENSE.txt",
|
"META-INF/**/LICENSE.txt",
|
||||||
"META-INF/*.properties",
|
"META-INF/*.properties",
|
||||||
"META-INF/**/*.properties",
|
|
||||||
"META-INF/README.md",
|
|
||||||
"META-INF/NOTICE",
|
|
||||||
"META-INF/*.version",
|
"META-INF/*.version",
|
||||||
),
|
"META-INF/DEPENDENCIES",
|
||||||
)
|
"META-INF/LICENSE",
|
||||||
|
"META-INF/NOTICE",
|
||||||
|
"META-INF/README.md",
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependenciesInfo {
|
dependenciesInfo {
|
||||||
@ -263,9 +272,11 @@ dependencies {
|
|||||||
implementation(libs.logcat)
|
implementation(libs.logcat)
|
||||||
|
|
||||||
// Crash reports/analytics
|
// Crash reports/analytics
|
||||||
"standardImplementation"(platform(libs.firebase.bom))
|
if (includeAnalytics) {
|
||||||
"standardImplementation"(libs.firebase.analytics)
|
implementation(platform(libs.firebase.bom))
|
||||||
"standardImplementation"(libs.firebase.crashlytics)
|
implementation(libs.firebase.analytics)
|
||||||
|
implementation(libs.firebase.crashlytics)
|
||||||
|
}
|
||||||
|
|
||||||
// Shizuku
|
// Shizuku
|
||||||
implementation(libs.bundles.shizuku)
|
implementation(libs.bundles.shizuku)
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
package eu.kanade.domain.ui.model
|
package eu.kanade.domain.ui.model
|
||||||
|
|
||||||
import dev.icerock.moko.resources.StringResource
|
import dev.icerock.moko.resources.StringResource
|
||||||
import eu.kanade.tachiyomi.util.system.isDevFlavor
|
import eu.kanade.tachiyomi.util.system.isReleaseBuildType
|
||||||
import eu.kanade.tachiyomi.util.system.isPreviewBuildType
|
|
||||||
import tachiyomi.i18n.MR
|
import tachiyomi.i18n.MR
|
||||||
|
|
||||||
enum class AppTheme(val titleRes: StringResource?) {
|
enum class AppTheme(val titleRes: StringResource?) {
|
||||||
@ -13,7 +12,7 @@ enum class AppTheme(val titleRes: StringResource?) {
|
|||||||
MIDNIGHT_DUSK(MR.strings.theme_midnightdusk),
|
MIDNIGHT_DUSK(MR.strings.theme_midnightdusk),
|
||||||
|
|
||||||
// TODO: re-enable for preview
|
// TODO: re-enable for preview
|
||||||
NORD(MR.strings.theme_nord.takeIf { isDevFlavor || isPreviewBuildType }),
|
NORD(MR.strings.theme_nord.takeUnless { isReleaseBuildType }),
|
||||||
STRAWBERRY_DAIQUIRI(MR.strings.theme_strawberrydaiquiri),
|
STRAWBERRY_DAIQUIRI(MR.strings.theme_strawberrydaiquiri),
|
||||||
TAKO(MR.strings.theme_tako),
|
TAKO(MR.strings.theme_tako),
|
||||||
TEALTURQUOISE(MR.strings.theme_tealturquoise),
|
TEALTURQUOISE(MR.strings.theme_tealturquoise),
|
||||||
|
@ -20,8 +20,7 @@ import androidx.compose.ui.platform.LocalConfiguration
|
|||||||
import eu.kanade.presentation.components.TabbedDialog
|
import eu.kanade.presentation.components.TabbedDialog
|
||||||
import eu.kanade.presentation.components.TabbedDialogPaddings
|
import eu.kanade.presentation.components.TabbedDialogPaddings
|
||||||
import eu.kanade.tachiyomi.ui.library.LibrarySettingsScreenModel
|
import eu.kanade.tachiyomi.ui.library.LibrarySettingsScreenModel
|
||||||
import eu.kanade.tachiyomi.util.system.isDevFlavor
|
import eu.kanade.tachiyomi.util.system.isReleaseBuildType
|
||||||
import eu.kanade.tachiyomi.util.system.isPreviewBuildType
|
|
||||||
import kotlinx.collections.immutable.persistentListOf
|
import kotlinx.collections.immutable.persistentListOf
|
||||||
import tachiyomi.core.common.preference.TriState
|
import tachiyomi.core.common.preference.TriState
|
||||||
import tachiyomi.domain.category.model.Category
|
import tachiyomi.domain.category.model.Category
|
||||||
@ -118,10 +117,7 @@ private fun ColumnScope.FilterPage(
|
|||||||
onClick = { screenModel.toggleFilter(LibraryPreferences::filterCompleted) },
|
onClick = { screenModel.toggleFilter(LibraryPreferences::filterCompleted) },
|
||||||
)
|
)
|
||||||
// TODO: re-enable when custom intervals are ready for stable
|
// TODO: re-enable when custom intervals are ready for stable
|
||||||
if (
|
if ((!isReleaseBuildType) && LibraryPreferences.MANGA_OUTSIDE_RELEASE_PERIOD in autoUpdateMangaRestrictions) {
|
||||||
(isDevFlavor || isPreviewBuildType) &&
|
|
||||||
LibraryPreferences.MANGA_OUTSIDE_RELEASE_PERIOD in autoUpdateMangaRestrictions
|
|
||||||
) {
|
|
||||||
val filterIntervalCustom by screenModel.libraryPreferences.filterIntervalCustom().collectAsState()
|
val filterIntervalCustom by screenModel.libraryPreferences.filterIntervalCustom().collectAsState()
|
||||||
TriStateItem(
|
TriStateItem(
|
||||||
label = stringResource(MR.strings.action_filter_interval_custom),
|
label = stringResource(MR.strings.action_filter_interval_custom),
|
||||||
|
@ -19,8 +19,7 @@ import androidx.compose.ui.Alignment
|
|||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.unit.DpSize
|
import androidx.compose.ui.unit.DpSize
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import eu.kanade.tachiyomi.util.system.isDevFlavor
|
import eu.kanade.tachiyomi.util.system.isReleaseBuildType
|
||||||
import eu.kanade.tachiyomi.util.system.isPreviewBuildType
|
|
||||||
import kotlinx.collections.immutable.toImmutableList
|
import kotlinx.collections.immutable.toImmutableList
|
||||||
import tachiyomi.domain.manga.interactor.FetchInterval
|
import tachiyomi.domain.manga.interactor.FetchInterval
|
||||||
import tachiyomi.i18n.MR
|
import tachiyomi.i18n.MR
|
||||||
@ -109,7 +108,7 @@ fun SetIntervalDialog(
|
|||||||
}
|
}
|
||||||
Spacer(Modifier.height(MaterialTheme.padding.small))
|
Spacer(Modifier.height(MaterialTheme.padding.small))
|
||||||
|
|
||||||
if (onValueChanged != null && (isDevFlavor || isPreviewBuildType)) {
|
if (onValueChanged != null && (!isReleaseBuildType)) {
|
||||||
Text(stringResource(MR.strings.manga_interval_custom_amount))
|
Text(stringResource(MR.strings.manga_interval_custom_amount))
|
||||||
|
|
||||||
BoxWithConstraints(
|
BoxWithConstraints(
|
||||||
|
@ -37,6 +37,7 @@ import androidx.lifecycle.LifecycleOwner
|
|||||||
import androidx.lifecycle.compose.LocalLifecycleOwner
|
import androidx.lifecycle.compose.LocalLifecycleOwner
|
||||||
import eu.kanade.presentation.util.rememberRequestPackageInstallsPermissionState
|
import eu.kanade.presentation.util.rememberRequestPackageInstallsPermissionState
|
||||||
import eu.kanade.tachiyomi.core.security.PrivacyPreferences
|
import eu.kanade.tachiyomi.core.security.PrivacyPreferences
|
||||||
|
import eu.kanade.tachiyomi.util.system.analyticsIncluded
|
||||||
import eu.kanade.tachiyomi.util.system.launchRequestPackageInstallsPermission
|
import eu.kanade.tachiyomi.util.system.launchRequestPackageInstallsPermission
|
||||||
import tachiyomi.i18n.MR
|
import tachiyomi.i18n.MR
|
||||||
import tachiyomi.presentation.core.i18n.stringResource
|
import tachiyomi.presentation.core.i18n.stringResource
|
||||||
@ -122,6 +123,8 @@ internal class PermissionStep : OnboardingStep {
|
|||||||
color = MaterialTheme.colorScheme.onPrimaryContainer,
|
color = MaterialTheme.colorScheme.onPrimaryContainer,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (!analyticsIncluded) return@Column
|
||||||
|
|
||||||
val crashlyticsPref = privacyPreferences.crashlytics()
|
val crashlyticsPref = privacyPreferences.crashlytics()
|
||||||
val crashlytics by crashlyticsPref.collectAsState()
|
val crashlytics by crashlyticsPref.collectAsState()
|
||||||
PermissionSwitch(
|
PermissionSwitch(
|
||||||
|
@ -48,8 +48,7 @@ import eu.kanade.tachiyomi.network.PREF_DOH_SHECAN
|
|||||||
import eu.kanade.tachiyomi.ui.more.OnboardingScreen
|
import eu.kanade.tachiyomi.ui.more.OnboardingScreen
|
||||||
import eu.kanade.tachiyomi.util.CrashLogUtil
|
import eu.kanade.tachiyomi.util.CrashLogUtil
|
||||||
import eu.kanade.tachiyomi.util.system.GLUtil
|
import eu.kanade.tachiyomi.util.system.GLUtil
|
||||||
import eu.kanade.tachiyomi.util.system.isDevFlavor
|
import eu.kanade.tachiyomi.util.system.isReleaseBuildType
|
||||||
import eu.kanade.tachiyomi.util.system.isPreviewBuildType
|
|
||||||
import eu.kanade.tachiyomi.util.system.isShizukuInstalled
|
import eu.kanade.tachiyomi.util.system.isShizukuInstalled
|
||||||
import eu.kanade.tachiyomi.util.system.powerManager
|
import eu.kanade.tachiyomi.util.system.powerManager
|
||||||
import eu.kanade.tachiyomi.util.system.setDefaultSettings
|
import eu.kanade.tachiyomi.util.system.setDefaultSettings
|
||||||
@ -413,10 +412,10 @@ object SettingsAdvancedScreen : SearchableSettings {
|
|||||||
entries = extensionInstallerPref.entries
|
entries = extensionInstallerPref.entries
|
||||||
.filter {
|
.filter {
|
||||||
// TODO: allow private option in stable versions once URL handling is more fleshed out
|
// TODO: allow private option in stable versions once URL handling is more fleshed out
|
||||||
if (isPreviewBuildType || isDevFlavor) {
|
if (isReleaseBuildType) {
|
||||||
true
|
|
||||||
} else {
|
|
||||||
it != BasePreferences.ExtensionInstaller.PRIVATE
|
it != BasePreferences.ExtensionInstaller.PRIVATE
|
||||||
|
} else {
|
||||||
|
true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.associateWith { stringResource(it.titleRes) }
|
.associateWith { stringResource(it.titleRes) }
|
||||||
|
@ -11,6 +11,7 @@ import eu.kanade.tachiyomi.core.security.PrivacyPreferences
|
|||||||
import eu.kanade.tachiyomi.core.security.SecurityPreferences
|
import eu.kanade.tachiyomi.core.security.SecurityPreferences
|
||||||
import eu.kanade.tachiyomi.util.system.AuthenticatorUtil.authenticate
|
import eu.kanade.tachiyomi.util.system.AuthenticatorUtil.authenticate
|
||||||
import eu.kanade.tachiyomi.util.system.AuthenticatorUtil.isAuthenticationSupported
|
import eu.kanade.tachiyomi.util.system.AuthenticatorUtil.isAuthenticationSupported
|
||||||
|
import eu.kanade.tachiyomi.util.system.analyticsIncluded
|
||||||
import kotlinx.collections.immutable.persistentListOf
|
import kotlinx.collections.immutable.persistentListOf
|
||||||
import kotlinx.collections.immutable.toImmutableMap
|
import kotlinx.collections.immutable.toImmutableMap
|
||||||
import tachiyomi.core.common.i18n.stringResource
|
import tachiyomi.core.common.i18n.stringResource
|
||||||
@ -31,10 +32,11 @@ object SettingsSecurityScreen : SearchableSettings {
|
|||||||
override fun getPreferences(): List<Preference> {
|
override fun getPreferences(): List<Preference> {
|
||||||
val securityPreferences = remember { Injekt.get<SecurityPreferences>() }
|
val securityPreferences = remember { Injekt.get<SecurityPreferences>() }
|
||||||
val privacyPreferences = remember { Injekt.get<PrivacyPreferences>() }
|
val privacyPreferences = remember { Injekt.get<PrivacyPreferences>() }
|
||||||
return listOf(
|
return buildList(2) {
|
||||||
getSecurityGroup(securityPreferences),
|
add(getSecurityGroup(securityPreferences))
|
||||||
getFirebaseGroup(privacyPreferences),
|
if (!analyticsIncluded) return@buildList
|
||||||
)
|
add(getFirebaseGroup(privacyPreferences))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
|
@ -9,7 +9,7 @@ import eu.kanade.tachiyomi.core.security.PrivacyPreferences
|
|||||||
import eu.kanade.tachiyomi.core.security.SecurityPreferences
|
import eu.kanade.tachiyomi.core.security.SecurityPreferences
|
||||||
import eu.kanade.tachiyomi.network.NetworkPreferences
|
import eu.kanade.tachiyomi.network.NetworkPreferences
|
||||||
import eu.kanade.tachiyomi.ui.reader.setting.ReaderPreferences
|
import eu.kanade.tachiyomi.ui.reader.setting.ReaderPreferences
|
||||||
import eu.kanade.tachiyomi.util.system.isDevFlavor
|
import eu.kanade.tachiyomi.util.system.isDebugBuildType
|
||||||
import tachiyomi.core.common.preference.AndroidPreferenceStore
|
import tachiyomi.core.common.preference.AndroidPreferenceStore
|
||||||
import tachiyomi.core.common.preference.PreferenceStore
|
import tachiyomi.core.common.preference.PreferenceStore
|
||||||
import tachiyomi.core.common.storage.AndroidStorageFolderProvider
|
import tachiyomi.core.common.storage.AndroidStorageFolderProvider
|
||||||
@ -31,7 +31,7 @@ class PreferenceModule(val app: Application) : InjektModule {
|
|||||||
addSingletonFactory {
|
addSingletonFactory {
|
||||||
NetworkPreferences(
|
NetworkPreferences(
|
||||||
preferenceStore = get(),
|
preferenceStore = get(),
|
||||||
verboseLogging = isDevFlavor,
|
verboseLogging = isDebugBuildType,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
addSingletonFactory {
|
addSingletonFactory {
|
||||||
|
@ -40,7 +40,7 @@ class CrashLogUtil(
|
|||||||
|
|
||||||
fun getDebugInfo(): String {
|
fun getDebugInfo(): String {
|
||||||
return """
|
return """
|
||||||
App version: ${BuildConfig.VERSION_NAME} (${BuildConfig.FLAVOR}, ${BuildConfig.COMMIT_SHA}, ${BuildConfig.VERSION_CODE}, ${BuildConfig.BUILD_TIME})
|
App version: ${BuildConfig.VERSION_NAME} (${BuildConfig.COMMIT_SHA}, ${BuildConfig.VERSION_CODE}, ${BuildConfig.BUILD_TIME})
|
||||||
Android version: ${Build.VERSION.RELEASE} (SDK ${Build.VERSION.SDK_INT}; build ${Build.DISPLAY})
|
Android version: ${Build.VERSION.RELEASE} (SDK ${Build.VERSION.SDK_INT}; build ${Build.DISPLAY})
|
||||||
Device brand: ${Build.BRAND}
|
Device brand: ${Build.BRAND}
|
||||||
Device manufacturer: ${Build.MANUFACTURER}
|
Device manufacturer: ${Build.MANUFACTURER}
|
||||||
|
@ -1,12 +1,17 @@
|
|||||||
|
@file:Suppress("UNUSED", "KotlinConstantConditions")
|
||||||
|
|
||||||
package eu.kanade.tachiyomi.util.system
|
package eu.kanade.tachiyomi.util.system
|
||||||
|
|
||||||
import eu.kanade.tachiyomi.BuildConfig
|
import eu.kanade.tachiyomi.BuildConfig
|
||||||
|
|
||||||
val isDevFlavor: Boolean
|
val analyticsIncluded: Boolean
|
||||||
get() = BuildConfig.FLAVOR == "dev"
|
inline get() = BuildConfig.INCLUDE_ANALYTICS
|
||||||
|
|
||||||
|
val isDebugBuildType: Boolean
|
||||||
|
inline get() = BuildConfig.BUILD_TYPE == "debug"
|
||||||
|
|
||||||
val isPreviewBuildType: Boolean
|
val isPreviewBuildType: Boolean
|
||||||
get() = BuildConfig.BUILD_TYPE == "preview"
|
inline get() = BuildConfig.BUILD_TYPE == "preview"
|
||||||
|
|
||||||
val isReleaseBuildType: Boolean
|
val isReleaseBuildType: Boolean
|
||||||
get() = BuildConfig.BUILD_TYPE == "release"
|
inline get() = BuildConfig.BUILD_TYPE == "release"
|
||||||
|
@ -171,7 +171,7 @@ fun Context.isInstalledFromFDroid(): Boolean {
|
|||||||
|
|
||||||
return installerPackageName == "org.fdroid.fdroid" ||
|
return installerPackageName == "org.fdroid.fdroid" ||
|
||||||
// F-Droid builds typically disable the updater
|
// F-Droid builds typically disable the updater
|
||||||
(!BuildConfig.INCLUDE_UPDATER && !isDevFlavor)
|
(!BuildConfig.INCLUDE_UPDATER && !isDebugBuildType)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Context.launchRequestPackageInstallsPermission() {
|
fun Context.launchRequestPackageInstallsPermission() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user