[#1666] Release v1.2.2

* Adopt Zcash SDK v2.2.6

* Changelogs version update

* Version name change

* Update WHATS_NEW_EN.md

updated Whats New for 1.2.2 release

* Update WHATS_NEW_ES.md

Updated WhatsNew in Spanish for 1.2.2 release

* Switch to non-snapshot Zcash SDK version

* Fix app version in What’s New title

* Center longer screen text

* ChangelogParser works with translated titles

---------

Co-authored-by: Andrea Kobrlova <109794238+true-jared@users.noreply.github.com>
This commit is contained in:
Honza Rychnovský 2024-11-18 12:33:33 +01:00 committed by GitHub
parent d31f713361
commit 13cf2c435d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 124 additions and 58 deletions

View File

@ -6,6 +6,8 @@ and this application adheres to [Semantic Versioning](https://semver.org/spec/v2
## [Unreleased]
## [1.2.2 (788)] - 2024-11-17
### Added
- Address book encryption
- Android auto backup support for address book encryption
@ -21,6 +23,7 @@ and this application adheres to [Semantic Versioning](https://semver.org/spec/v2
- The Not enough space and In-app udpate screens have been redesigned
- External links now open in in-app browser
- All the Settings screens have been redesigned
- Adopted Zcash SDK version 2.2.6
### Fixed
- Address book toast now correctly shows on send screen when adding both new and known addresses to text field

View File

@ -3,6 +3,8 @@ package publish
import org.intellij.markdown.ast.getTextInNode
import org.intellij.markdown.flavours.gfm.GFMFlavourDescriptor
import org.intellij.markdown.parser.MarkdownParser
import publish.ChangelogParser.ENGLISH_TAG
import publish.ChangelogParser.SPANISH_TAG
import java.io.File
import java.text.SimpleDateFormat
import java.util.Date
@ -15,6 +17,18 @@ object ChangelogParser {
private const val CHANGELOG_TITLE_POSITION = 0
private const val UNRELEASED_TITLE_POSITION = 4
internal const val ENGLISH_TAG = "EN"
internal const val SPANISH_TAG = "ES"
private const val ADDED_PART_EN = "Added"
private const val ADDED_PART_ES = "Agregado"
private const val CHANGED_PART_EN = "Changed"
private const val CHANGED_PART_ES = "Cambiado"
private const val FIXED_PART_EN = "Fixed"
private const val FIXED_PART_ES = "Arreglado"
private const val REMOVED_PART_EN = "Removed"
private const val REMOVED_PART_ES = "Removido"
private fun log(value: Any) {
if (DEBUG_LOGS_ENABLED) {
println(value)
@ -23,9 +37,10 @@ object ChangelogParser {
fun getChangelogEntry(
filePath: String,
versionNameFallback: String
languageTag: LanguageTag,
versionNameFallback: String,
): ChangelogEntry {
log("Parser: starting...")
log("Parser: starting for file: $filePath")
val src = File(filePath).readText()
val parsedTree = MarkdownParser(GFMFlavourDescriptor()).buildMarkdownTreeFromString(src)
@ -46,7 +61,7 @@ object ChangelogParser {
"Provided changelog file is incorrect or its structure is malformed."
}
val fromIndex = findFirstValidNodeIndex(nodes)
val fromIndex = findFirstValidNodeIndex(languageTag, nodes)
log("Parser: index from: $fromIndex")
val toIndex =
@ -67,10 +82,10 @@ object ChangelogParser {
ChangelogEntry(
version = parts.getVersionPart(versionNameFallback),
date = parts.getDatePart(),
added = parts.getNodePart("Added"),
changed = parts.getNodePart("Changed"),
fixed = parts.getNodePart("Fixed"),
removed = parts.getNodePart("Removed"),
added = parts.getNodePart(titleByLanguage(TitleType.ADDED, languageTag)),
changed = parts.getNodePart(titleByLanguage(TitleType.CHANGED, languageTag)),
fixed = parts.getNodePart(titleByLanguage(TitleType.FIXED, languageTag)),
removed = parts.getNodePart(titleByLanguage(TitleType.REMOVED, languageTag)),
)
}
@ -78,9 +93,12 @@ object ChangelogParser {
return lastChangelogEntry
}
private fun findFirstValidNodeIndex(nodes: List<String>): Int {
private fun findFirstValidNodeIndex(
languageTag: LanguageTag,
nodes: List<String>
): Int {
nodes.forEachIndexed { index, node ->
if (findNodeByPrefix(node) && findValidSubNodeByPrefix(nodes[index + 1])) {
if (findNodeByPrefix(node) && findValidSubNodeByPrefix(languageTag, nodes[index + 1])) {
return index
}
}
@ -90,17 +108,21 @@ object ChangelogParser {
private fun findNodeByPrefix(node: String): Boolean = node.startsWith("## [")
private fun findValidSubNodeByPrefix(subNode: String): Boolean =
subNode.startsWith("### Added") ||
subNode.startsWith("### Changed") ||
subNode.startsWith("### Fixed") ||
subNode.startsWith("### Removed")
private fun findValidSubNodeByPrefix(
languageTag: LanguageTag,
subNode: String
): Boolean =
subNode.startsWith("### ${titleByLanguage(TitleType.ADDED, languageTag)}") ||
subNode.startsWith("### ${titleByLanguage(TitleType.CHANGED, languageTag)}") ||
subNode.startsWith("### ${titleByLanguage(TitleType.FIXED, languageTag)}") ||
subNode.startsWith("### ${titleByLanguage(TitleType.REMOVED, languageTag)}")
private fun List<String>.getVersionPart(versionNameFallback: String): String {
return if (this.contains("## [Unreleased]")) {
versionNameFallback
} else {
this[0].split("[")[1].split("]")[0].trim()
// Parse just version name omitting version code as we currently don't need it in the UI
this[0].split("[")[1].split(" ")[0].trim()
}
}
@ -142,4 +164,45 @@ object ChangelogParser {
ChangelogEntrySection(title = title, content = it)
}
}
private fun titleByLanguage(
type: TitleType,
languageTag: LanguageTag
): String {
return when (type) {
TitleType.ADDED ->
when (languageTag) {
is LanguageTag.English -> ADDED_PART_EN
is LanguageTag.Spanish -> ADDED_PART_ES
}
TitleType.CHANGED ->
when (languageTag) {
is LanguageTag.English -> CHANGED_PART_EN
is LanguageTag.Spanish -> CHANGED_PART_ES
}
TitleType.FIXED ->
when (languageTag) {
is LanguageTag.English -> FIXED_PART_EN
is LanguageTag.Spanish -> FIXED_PART_ES
}
TitleType.REMOVED ->
when (languageTag) {
is LanguageTag.English -> REMOVED_PART_EN
is LanguageTag.Spanish -> REMOVED_PART_ES
}
}
}
}
sealed class LanguageTag(open val tag: String) {
data class English(override val tag: String = ENGLISH_TAG) : LanguageTag(tag)
data class Spanish(override val tag: String = SPANISH_TAG) : LanguageTag(tag)
}
private enum class TitleType {
ADDED,
CHANGED,
FIXED,
REMOVED
}

View File

@ -241,7 +241,11 @@ abstract class PublishToGooglePlay @Inject constructor(
val inAppUpdatePriority = project.property("ZCASH_IN_APP_UPDATE_PRIORITY").toString().toInt()
val releaseNotes: List<LocalizedText> = getReleaseNotesFor(
gradleVersionName, listOf("EN", "ES")
gradleVersionName = gradleVersionName,
languageTags = listOf(
LanguageTag.English(),
LanguageTag.Spanish()
)
)
log("Publish - Version: $versionName has been uploaded")
@ -279,14 +283,18 @@ abstract class PublishToGooglePlay @Inject constructor(
private val releaseNotesFilePath = "docs/whatsNew/WHATS_NEW_"
private val releaseNotesFileSuffix = ".md"
private fun getReleaseNotesFor(gradleVersionName: String, languageTags: List<String>): MutableList<LocalizedText> {
private fun getReleaseNotesFor(
gradleVersionName: String,
languageTags: List<LanguageTag>
): MutableList<LocalizedText> {
return buildList {
languageTags.forEach { languageTag ->
// A description of what is new in this release in form of [LocalizedText]
add(LocalizedText().apply {
language = languageTag
language = languageTag.tag
text = ChangelogParser.getChangelogEntry(
filePath = releaseNotesFilePath + languageTag + releaseNotesFileSuffix,
languageTag = languageTag,
versionNameFallback = gradleVersionName
).toInAppUpdateReleaseNotesText()
})

View File

@ -1,5 +1,6 @@
import co.electriccoin.zcash.Git
import publish.ChangelogParser
import publish.LanguageTag
import java.text.SimpleDateFormat
import java.util.Date
import java.util.TimeZone
@ -103,14 +104,16 @@ fun fillInReleaseNotes(inputs: TaskInputs) {
val releaseNotesEnJson = ChangelogParser.getChangelogEntry(
filePath = releaseNotesEnPath,
versionNameFallback = gradleVersionName
versionNameFallback = gradleVersionName,
languageTag = LanguageTag.English()
).toJsonString()
inputs.property(releaseNotesEn, releaseNotesEnJson)
val releaseNotesEsJson = ChangelogParser.getChangelogEntry(
filePath = releaseNotesEsPath,
versionNameFallback = gradleVersionName
versionNameFallback = gradleVersionName,
languageTag = LanguageTag.Spanish()
).toJsonString()
inputs.property(releaseNotesEs, releaseNotesEsJson)

View File

@ -9,27 +9,21 @@ directly impact users rather than highlighting other key architectural updates.*
## [Unreleased]
## [1.2.2 (788)] - 2024-11-17
### Added
- Address book encryption
- Android auto backup support for address book encryption
- The device authentication feature on the Zashi app launch has been added
- Zashi app now supports Spanish language. It can be changed in the System settings options.
- The Flexa SDK has been adopted to enable payments using the embedded Flexa UI
- New Sending, Success, Failure, and GrpcFailure subscreens of the Send Confirmation screen have been added
- New Copy Transaction IDs feature has been added to the MultipleTransactionFailure screen
- Hola! We taught Zashi to speak Spanish!
- We adopted SDK release 2.2.6 which should help speed up sending multiple transactions.
- We implemented encryption and remote storage for Address Book!
- We added device authentication to app launch.
- We added animated progress screen and new success and failure screens.
### Changed
- Shielded transactions are properly indicated in transaction history
- The in-app update logic has been fixed and is now correctly requested with every app launch
- The Not enough space and In-app udpate screens have been redesigned
- External links now open in in-app browser
- All the Settings screens have been redesigned
- We made Settings and status screens pretty.
- Let us know how you like Zashi with the improved Send Feedback feature.
### Fixed
- Address book toast now correctly shows on send screen when adding both new and known addresses to text field
- The application now correctly navigates to the homepage after deleting the current wallet and creating a new or
recovering an older one
- The in-app update logic has been fixed and is now correctly requested with every app launch
- We fixed the shield icon behaviour in Transaction History.
## [1.2.1 (760)] - 2024-10-22

View File

@ -9,24 +9,18 @@ directly impact users rather than highlighting other key architectural updates.*
## [Unreleased]
### Added
- Address book encryption
- Android auto backup support for address book encryption
- The device authentication feature on the Zashi app launch has been added
- Zashi app now supports Spanish language. It can be changed in the System settings options.
- The Flexa SDK has been adopted to enable payments using the embedded Flexa UI
- New Sending, Success, Failure, and GrpcFailure subscreens of the Send Confirmation screen have been added
- New Copy Transaction IDs feature has been added to the MultipleTransactionFailure screen
## [1.2.2 (788)] - 2024-11-17
### Changed
- Shielded transactions are properly indicated in transaction history
- The in-app update logic has been fixed and is now correctly requested with every app launch
- The Not enough space and In-app udpate screens have been redesigned
- External links now open in in-app browser
- All the Settings screens have been redesigned
### Agregado
- ¡Hola!, Zashi aprendió Español.
- Nuevo manejo de transacciones de baja denominación, esto hace transacciones más rápidas y uso eficiente del saldo.
- Implementación de encriptado y almacenamiento remoto de información en agenda.
- Se agrego una barra de progreso y nuevas pantallas de éxito y falla.
- Inicio de aplicación con autenticación implementada.
### Fixed
- Address book toast now correctly shows on send screen when adding both new and known addresses to text field
- The application now correctly navigates to the homepage after deleting the current wallet and creating a new or
recovering an older one
- The in-app update logic has been fixed and is now correctly requested with every app launch
### Cambiado
- Mejora en pantalla de configuración y estatus.
- Comentarios y sugerencias mejoradas.
### Arreglado
- Icono de transacciones privadas arreglado.

View File

@ -61,7 +61,7 @@ NDK_DEBUG_SYMBOL_LEVEL=symbol_table
# VERSION_CODE is effectively ignored. VERSION_NAME is suffixed with the version code.
# If not using automated Google Play deployment, then these serve as the actual version numbers.
ZCASH_VERSION_CODE=1
ZCASH_VERSION_NAME=1.2.1
ZCASH_VERSION_NAME=1.2.2
# Set these fields, as you need them (e.g. with values "Zcash X" and "co.electriccoin.zcash.x")
# to distinguish a different release build that can be installed alongside the official version
@ -220,7 +220,7 @@ ZCASH_BIP39_VERSION=1.0.8
FLEXA_VERSION=1.0.5
# WARNING: Ensure a non-snapshot version is used before releasing to production
ZCASH_SDK_VERSION=2.2.5-SNAPSHOT
ZCASH_SDK_VERSION=2.2.6
# Toolchain is the Java version used to build the application, which is separate from the
# Java version used to run the application.

View File

@ -218,7 +218,8 @@ private fun Empty(
text = stringResource(id = R.string.address_book_empty),
fontWeight = FontWeight.SemiBold,
color = ZashiColors.Text.textPrimary,
style = ZashiTypography.header6
style = ZashiTypography.header6,
textAlign = TextAlign.Center
)
}