- Updated the PreferencesFragment.kt

- New Build Variant added
- New strings added in strings.xml
- Updated build.gradle
This commit is contained in:
2026-03-08 14:39:00 +01:00
parent 040e59ee58
commit df602c5220
4 changed files with 68 additions and 27 deletions
+12
View File
@@ -43,6 +43,18 @@ android {
targetCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17
} }
flavorDimensions "distributor"
productFlavors {
michas {
dimension "distributor"
buildConfigField "boolean", "FLAVOR_FDROID", "false"
}
fdroid {
dimension "distributor"
buildConfigField "boolean", "FLAVOR_FDROID", "true"
}
}
buildTypes { buildTypes {
debug { debug {
minifyEnabled false minifyEnabled false
@@ -2,6 +2,7 @@ package com.michatec.store.entity
import com.fasterxml.jackson.core.JsonGenerator import com.fasterxml.jackson.core.JsonGenerator
import com.fasterxml.jackson.core.JsonParser import com.fasterxml.jackson.core.JsonParser
import com.michatec.store.BuildConfig
import com.michatec.store.utility.extension.json.* import com.michatec.store.utility.extension.json.*
data class Repository( data class Repository(
@@ -72,36 +73,47 @@ data class Repository(
lastModified, entityTag, updated, timestamp, authentication) lastModified, entityTag, updated, timestamp, authentication)
} }
private fun defaultRepository(address: String, name: String, description: String, private fun defaultRepository(address: String, name: String, description: String,
version: Int, enabled: Boolean, fingerprint: String, authentication: String): Repository { version: Int, enabled: Boolean, fingerprint: String, authentication: String): Repository {
return Repository(-1, address, emptyList(), name, description, version, enabled, return Repository(-1, address, emptyList(), name, description, version, enabled,
fingerprint, "", "", 0L, 0L, authentication) fingerprint, "", "", 0L, 0L, authentication)
} }
val defaultRepositories = listOf(run { val defaultRepositories: List<Repository>
defaultRepository("https://repo.dgplayser.duckdns.org/fdroid/repo", "Michachatz F-Droid Repo", "Michachatz official repository. " + get() {
"Everything in this repository is always built from the source code.", val isFdroid = BuildConfig.FLAVOR_FDROID
21, true, "3546DCBDD900F280EE2161CC163C1156BE2C2F3EB810415115039E0C7D3242C0", "") return listOfNotNull(
}, if (isFdroid) null else defaultRepository(
run { "https://repo.dgplayser.duckdns.org/fdroid/repo",
defaultRepository("https://f-droid.org/repo", "F-Droid", "The official F-Droid Free Software repository. " + "Michachatz F-Droid Repo",
"Everything in this repository is always built from the source code.", "Michachatz official repository. Everything in this repository is always built from the source code.",
21, false, "43238D512C1E5EB2D6569F4A3AFBF5523418B82E0A3ED1552770ABB9A9C9CCAB", "") 21, true, "3546DCBDD900F280EE2161CC163C1156BE2C2F3EB810415115039E0C7D3242C0", ""
}, run { ),
defaultRepository("https://f-droid.org/archive", "F-Droid Archive", "The archive of the official F-Droid Free " + defaultRepository(
"Software repository. Apps here are old and can contain known vulnerabilities and security issues!", "https://f-droid.org/repo",
21, false, "43238D512C1E5EB2D6569F4A3AFBF5523418B82E0A3ED1552770ABB9A9C9CCAB", "") "F-Droid",
}, run { "The official F-Droid Free Software repository. Everything in this repository is always built from the source code.",
defaultRepository("https://guardianproject.info/fdroid/repo", "Guardian Project Official Releases", "The " + 21, isFdroid, "43238D512C1E5EB2D6569F4A3AFBF5523418B82E0A3ED1552770ABB9A9C9CCAB", ""
"official repository of The Guardian Project apps for use with the F-Droid client. Applications in this " + ),
"repository are official binaries built by the original application developers and signed by the same key as " + defaultRepository(
"the APKs that are released in the Google Play Store.", "https://f-droid.org/archive",
21, false, "B7C2EEFD8DAC7806AF67DFCD92EB18126BC08312A7F2D6F3862E46013C7A6135", "") "F-Droid Archive",
}, run { "The archive of the official F-Droid Free Software repository. Apps here are old and can contain known vulnerabilities and security issues!",
defaultRepository("https://guardianproject.info/fdroid/archive", "Guardian Project Archive", "The official " + 21, false, "43238D512C1E5EB2D6569F4A3AFBF5523418B82E0A3ED1552770ABB9A9C9CCAB", ""
"repository of The Guardian Project apps for use with the F-Droid client. This contains older versions of " + ),
"applications from the main repository.", 21, false, defaultRepository(
"B7C2EEFD8DAC7806AF67DFCD92EB18126BC08312A7F2D6F3862E46013C7A6135", "") "https://guardianproject.info/fdroid/repo",
}) "Guardian Project Official Releases",
"The official repository of The Guardian Project apps for use with the F-Droid client.",
21, false, "B7C2EEFD8DAC7806AF67DFCD92EB18126BC08312A7F2D6F3862E46013C7A6135", ""
),
defaultRepository(
"https://guardianproject.info/fdroid/archive",
"Guardian Project Archive",
"The official repository of The Guardian Project apps for use with the F-Droid client. This contains older versions.",
21, false, "B7C2EEFD8DAC7806AF67DFCD92EB18126BC08312A7F2D6F3862E46013C7A6135", ""
)
)
}
} }
} }
@@ -86,6 +86,21 @@ class PreferencesFragment: ScreenFragment() {
addSwitch(Preferences.Key.IncompatibleVersions, getString(R.string.incompatible_versions), addSwitch(Preferences.Key.IncompatibleVersions, getString(R.string.incompatible_versions),
getString(R.string.incompatible_versions_summary)) getString(R.string.incompatible_versions_summary))
} }
preferencesLayout.addCategory("Credits") {
val texts = 16f
addView(TextView(context).apply {
setText(R.string.credits)
textSize = texts
setPadding(resources.sizeScaled(16), resources.sizeScaled(16), 0, resources.sizeScaled(8))
setTextColor(context.getColorFromAttr(android.R.attr.textColorPrimary))
})
addView(TextView(context).apply {
setText(R.string.credits_to_fork)
textSize = texts
setPadding(resources.sizeScaled(16), resources.sizeScaled(16), 0, resources.sizeScaled(14))
setTextColor(context.getColorFromAttr(android.R.attr.textColorPrimary))
})
}
disposable = Preferences.observable disposable = Preferences.observable
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
+3 -1
View File
@@ -10,7 +10,7 @@
<string name="always">Always</string> <string name="always">Always</string>
<string name="anti_features">Anti-features</string> <string name="anti_features">Anti-features</string>
<string name="application">Application</string> <string name="application">Application</string>
<string name="application_name" translatable="false">Store</string> <string name="application_name" translatable="false">Michas Store</string>
<string name="application_not_found">Application not found</string> <string name="application_not_found">Application not found</string>
<string name="author_email">Author email</string> <string name="author_email">Author email</string>
<string name="author_website">Author website</string> <string name="author_website">Author website</string>
@@ -164,5 +164,7 @@
<string name="waiting_to_start_download">Waiting to start download</string> <string name="waiting_to_start_download">Waiting to start download</string>
<string name="website">Website</string> <string name="website">Website</string>
<string name="address_redirect_FORMAT">The repository address was redirected to %s. Do you want to use it instead?</string> <string name="address_redirect_FORMAT">The repository address was redirected to %s. Do you want to use it instead?</string>
<string name="credits">Credits to Michatec</string>
<string name="credits_to_fork">This is a fork from github.com/kitsunyan/foxy-droid.</string>
</resources> </resources>