feat: more dynamically set app name, add WintryColor option as an icon, revert versioning to 1.0.0
This commit is contained in:
parent
96a6d77093
commit
6fdc1b8aaf
10 changed files with 42 additions and 13 deletions
|
|
@ -24,8 +24,8 @@ android {
|
|||
defaultConfig {
|
||||
minSdk = 28
|
||||
targetSdk = 36
|
||||
versionCode = 10_00_02
|
||||
versionName = "1.0.2"
|
||||
versionCode = 10_00_00
|
||||
versionName = "1.0.0"
|
||||
|
||||
vectorDrawables {
|
||||
useSupportLibrary = true
|
||||
|
|
@ -34,6 +34,7 @@ android {
|
|||
buildConfigField("String", "APPLICATION_NAME", "\"Wintry Manager\"")
|
||||
buildConfigField("String", "TAG", "\"WintryManager\"")
|
||||
|
||||
buildConfigField("String", "GITHUB_ORG", "\"wtcord\"")
|
||||
buildConfigField("String", "SUPPORT_SERVER", "\"ybPB5tgD\"")
|
||||
|
||||
buildConfigField("String", "BACKEND_URL", "\"https://aliucord.com/\"")
|
||||
|
|
|
|||
|
|
@ -17,6 +17,12 @@ class PathManager(
|
|||
*/
|
||||
val aliucordDir = Environment.getExternalStorageDirectory().resolve("Aliucord")
|
||||
|
||||
/**
|
||||
* The Wintry folder where shared Wintry files are stored.
|
||||
* Standard path: `~/Wintry`
|
||||
*/
|
||||
val wintryDir = Environment.getExternalStorageDirectory().resolve("Wintry")
|
||||
|
||||
/**
|
||||
* The directory in external storage in which plugins are stored by Aliucord.
|
||||
*/
|
||||
|
|
@ -30,7 +36,7 @@ class PathManager(
|
|||
/**
|
||||
* Global keystore used for signing APKs.
|
||||
*/
|
||||
val keystoreFile = aliucordDir.resolve("ks.keystore")
|
||||
val keystoreFile = wintryDir.resolve("ks.keystore")
|
||||
|
||||
/**
|
||||
* The internal directory used for downloading components related to patching, and
|
||||
|
|
|
|||
|
|
@ -36,11 +36,11 @@ class AndroidDownloadManager(application: Application) : IDownloadManager {
|
|||
|
||||
// Create and start a download in the system DownloadManager
|
||||
val downloadId = DownloadManager.Request(url.toUri())
|
||||
.setTitle("Aliucord Manager")
|
||||
.setTitle(BuildConfig.APPLICATION_NAME)
|
||||
.setDescription("Downloading ${out.name}...")
|
||||
.setDestinationUri(Uri.fromFile(out))
|
||||
.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE)
|
||||
.addRequestHeader("User-Agent", "Aliucord Manager/${BuildConfig.VERSION_NAME}")
|
||||
.addRequestHeader("User-Agent", "${BuildConfig.APPLICATION_NAME}/${BuildConfig.VERSION_NAME}")
|
||||
.let(downloadManager::enqueue)
|
||||
|
||||
// Repeatedly request download state until it is finished
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ package com.aliucord.manager.patcher.util
|
|||
|
||||
import com.aliucord.manager.manager.PathManager
|
||||
import com.android.apksig.ApkSigner
|
||||
import dev.wintry.manager.BuildConfig
|
||||
import org.bouncycastle.asn1.x500.X500Name
|
||||
import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo
|
||||
import org.bouncycastle.cert.X509v3CertificateBuilder
|
||||
|
|
@ -31,7 +32,7 @@ object Signer : KoinComponent {
|
|||
|
||||
// Create new keystore if it doesn't exist
|
||||
if (!paths.keystoreFile.exists()) {
|
||||
paths.aliucordDir.mkdirs()
|
||||
paths.wintryDir.mkdirs()
|
||||
newKeystore(paths.keystoreFile)
|
||||
}
|
||||
|
||||
|
|
@ -42,7 +43,7 @@ object Signer : KoinComponent {
|
|||
val certificate = keyStore.getCertificate(alias) as X509Certificate
|
||||
|
||||
ApkSigner.SignerConfig.Builder(
|
||||
"Aliucord Manager signer",
|
||||
"${BuildConfig.APPLICATION_NAME} signer",
|
||||
keyStore.getKey(alias, password) as PrivateKey,
|
||||
listOf(certificate)
|
||||
).build()
|
||||
|
|
@ -64,7 +65,7 @@ object Signer : KoinComponent {
|
|||
do serialNumber = SecureRandom().nextInt().toBigInteger()
|
||||
while (serialNumber < BigInteger.ZERO)
|
||||
|
||||
val x500Name = X500Name("CN=Aliucord Manager")
|
||||
val x500Name = X500Name("CN=${BuildConfig.APPLICATION_NAME}")
|
||||
val pair = KeyPairGenerator.getInstance("RSA").run {
|
||||
initialize(2048)
|
||||
generateKeyPair()
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ fun ProjectHeader(
|
|||
Row(
|
||||
horizontalArrangement = Arrangement.Center,
|
||||
) {
|
||||
TextButton(onClick = { uriHandler.openUri("https://github.com/Aliucord") }) {
|
||||
TextButton(onClick = { uriHandler.openUri("https://github.com/${BuildConfig.GITHUB_ORG}") }) {
|
||||
Icon(
|
||||
painter = painterResource(R.drawable.ic_account_github_white_24dp),
|
||||
contentDescription = null,
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import androidx.compose.runtime.Immutable
|
|||
enum class IconOptionsMode {
|
||||
Original,
|
||||
OldDiscord,
|
||||
Wintry,
|
||||
Aliucord,
|
||||
CustomColor,
|
||||
CustomImage,
|
||||
|
|
|
|||
|
|
@ -74,11 +74,17 @@ class IconOptionsModel(
|
|||
// ---------- Other ---------- //
|
||||
init {
|
||||
when (prefilledOptions) {
|
||||
is IconReplacement.CustomColor if prefilledOptions.color == IconReplacement.WintryColor -> {
|
||||
changeMode(IconOptionsMode.Wintry)
|
||||
initSelectedColor(IconReplacement.WintryColor)
|
||||
}
|
||||
|
||||
is IconReplacement.CustomColor if prefilledOptions.color == IconReplacement.AliucordColor -> {
|
||||
changeMode(IconOptionsMode.Aliucord)
|
||||
initSelectedColor(IconReplacement.AliucordColor)
|
||||
}
|
||||
|
||||
|
||||
is IconReplacement.CustomColor -> {
|
||||
changeMode(IconOptionsMode.CustomColor)
|
||||
initSelectedColor(prefilledOptions.color)
|
||||
|
|
@ -98,6 +104,7 @@ class IconOptionsModel(
|
|||
return when (mode) {
|
||||
IconOptionsMode.Original -> IconReplacement.Original
|
||||
IconOptionsMode.OldDiscord -> IconReplacement.OldDiscord
|
||||
IconOptionsMode.Wintry -> IconReplacement.CustomColor(IconReplacement.WintryColor)
|
||||
IconOptionsMode.Aliucord -> IconReplacement.CustomColor(IconReplacement.AliucordColor)
|
||||
IconOptionsMode.CustomColor -> IconReplacement.CustomColor(color = selectedColor.toColor())
|
||||
IconOptionsMode.CustomImage -> IconReplacement.CustomImage(
|
||||
|
|
|
|||
|
|
@ -119,6 +119,12 @@ fun IconOptionsScreenContent(
|
|||
selected = mode == IconOptionsMode.OldDiscord,
|
||||
onClick = remember { { setMode(IconOptionsMode.OldDiscord) } },
|
||||
)
|
||||
RadioSelectorItem(
|
||||
name = stringResource(R.string.wintry),
|
||||
description = stringResource(R.string.iconopts_variant_desc_wintry),
|
||||
selected = mode == IconOptionsMode.Wintry,
|
||||
onClick = remember { { setMode(IconOptionsMode.Wintry) } },
|
||||
)
|
||||
RadioSelectorItem(
|
||||
name = stringResource(R.string.aliucord),
|
||||
description = stringResource(R.string.iconopts_variant_desc_aliucord),
|
||||
|
|
@ -214,6 +220,7 @@ private fun IconPreview(
|
|||
IconOptionsMode.Original -> PatchOptions.IconReplacement.BlurpleColor
|
||||
IconOptionsMode.OldDiscord -> PatchOptions.IconReplacement.OldBlurpleColor
|
||||
IconOptionsMode.Aliucord -> PatchOptions.IconReplacement.AliucordColor
|
||||
IconOptionsMode.Wintry -> PatchOptions.IconReplacement.WintryColor
|
||||
IconOptionsMode.CustomColor -> selectedColor.toColor()
|
||||
IconOptionsMode.CustomImage -> error("unreachable")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,6 +108,11 @@ data class PatchOptions(
|
|||
*/
|
||||
val AliucordColor = Color(0xFF00C853)
|
||||
|
||||
/**
|
||||
* The default Wintry background color.
|
||||
*/
|
||||
val WintryColor = Color(0xFF133E87)
|
||||
|
||||
/**
|
||||
* The new Discord blurple used in icons.
|
||||
*/
|
||||
|
|
@ -122,12 +127,12 @@ data class PatchOptions(
|
|||
|
||||
companion object {
|
||||
val Default = PatchOptions(
|
||||
appName = "Aliucord",
|
||||
packageName = "com.aliucord",
|
||||
appName = "Wintry",
|
||||
packageName = "dev.wintry.app",
|
||||
debuggable = false,
|
||||
iconReplacement = IconReplacement.CustomColor(IconReplacement.AliucordColor),
|
||||
iconReplacement = IconReplacement.CustomColor(IconReplacement.WintryColor),
|
||||
versionPreference = VersionPreference.Stable,
|
||||
customVersionCode = "126021",
|
||||
customVersionCode = "",
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,6 +85,7 @@ class PatchOptionsScreen(
|
|||
selectedColor = when (iconModel.mode) {
|
||||
IconOptionsMode.Original -> PatchOptions.IconReplacement.BlurpleColor
|
||||
IconOptionsMode.OldDiscord -> PatchOptions.IconReplacement.OldBlurpleColor
|
||||
IconOptionsMode.Wintry -> PatchOptions.IconReplacement.WintryColor
|
||||
IconOptionsMode.Aliucord -> PatchOptions.IconReplacement.AliucordColor
|
||||
IconOptionsMode.CustomColor -> iconModel.selectedColor.toColor()
|
||||
IconOptionsMode.CustomImage -> null
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue