From f1b4d023232a605dc5be7c49196af7182c73c245 Mon Sep 17 00:00:00 2001 From: Huang Xin Date: Fri, 21 Nov 2025 09:14:50 +0530 Subject: [PATCH] chore: sync app metadata release notes (#2492) --- .../readest-app/scripts/sync-release-notes.sh | 183 ++++++++++++++++++ .../com.bilingify.readest.appdata.xml | 147 ++++++++++---- .../com.bilingify.readest.appdata.xml.sha256 | 1 + packages/tauri-plugins | 2 +- 4 files changed, 290 insertions(+), 43 deletions(-) create mode 100755 apps/readest-app/scripts/sync-release-notes.sh create mode 100644 data/metainfo/com.bilingify.readest.appdata.xml.sha256 diff --git a/apps/readest-app/scripts/sync-release-notes.sh b/apps/readest-app/scripts/sync-release-notes.sh new file mode 100755 index 00000000..fb4731c7 --- /dev/null +++ b/apps/readest-app/scripts/sync-release-notes.sh @@ -0,0 +1,183 @@ +#!/bin/bash + +# Sync release notes from JSON to XML AppData file +# Usage: ./sync_release_notes.sh [json_file] [xml_file] +# +# Description: +# Extracts release information from a JSON file and updates the +# section in an AppData XML file, then calculates the SHA256 checksum. +# +# Arguments: +# json_file: Path to JSON file (default: releases.json) +# xml_file: Path to XML file (default: com.bilingify.readest.appdata.xml) + +set -e +set -o pipefail + +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +NC='\033[0m' # No Color + +# Helper functions +log_info() { + echo -e "${GREEN}✓${NC} $1" +} + +log_warn() { + echo -e "${YELLOW}⚠${NC} $1" +} + +log_error() { + echo -e "${RED}✗${NC} $1" >&2 +} + +# Check if required commands are available +if ! command -v jq >/dev/null 2>&1; then + log_error "jq is required but not installed." + echo "Install it with: apt-get install jq (Debian/Ubuntu) or brew install jq (macOS)" + exit 1 +fi + +# Parse arguments +JSON_FILE="${1:-releases.json}" +XML_FILE="${2:-com.bilingify.readest.appdata.xml}" + +# Validate input files +if [ ! -f "$JSON_FILE" ]; then + log_error "JSON file '$JSON_FILE' not found" + exit 1 +fi + +if [ ! -f "$XML_FILE" ]; then + log_error "XML file '$XML_FILE' not found" + exit 1 +fi + +# Validate JSON format +if ! jq empty "$JSON_FILE" 2>/dev/null; then + log_error "Invalid JSON format in '$JSON_FILE'" + exit 1 +fi + +# Check if releases key exists +if ! jq -e '.releases' "$JSON_FILE" >/dev/null 2>&1; then + log_error "No 'releases' key found in JSON file" + exit 1 +fi + +echo "================================================" +echo "Release Notes Sync Tool" +echo "================================================" +echo "Source: $JSON_FILE" +echo "Target: $XML_FILE" +echo "" + +# Create backup +BACKUP_FILE="${XML_FILE}.backup.$(date +%Y%m%d_%H%M%S)" +cp "$XML_FILE" "$BACKUP_FILE" +log_info "Created backup: $BACKUP_FILE" + +# Create temporary files +TEMP_XML=$(mktemp) +TEMP_RELEASES=$(mktemp) + +# Cleanup function +cleanup() { + rm -f "$TEMP_XML" "$TEMP_RELEASES" +} +trap cleanup EXIT + +# Extract releases from JSON and convert to XML format +log_info "Extracting releases from JSON..." +RELEASE_COUNT=$(jq '.releases | length' "$JSON_FILE") +echo " Found $RELEASE_COUNT releases" + +jq -r ' +.releases | to_entries | sort_by(.key) | reverse | .[0:10] | .[] | +" + +
    +" + +((.value.notes | map("
  • \(.)
  • ")) | join("\n")) + +" +
+
+
" +' "$JSON_FILE" > "$TEMP_RELEASES" + +# Find the releases section in XML and replace it +log_info "Updating XML file..." +awk -v releases="$TEMP_RELEASES" ' +BEGIN { in_releases = 0; printed_releases = 0 } +// { + print $0 + if (printed_releases == 0) { + while ((getline line < releases) > 0) { + print line + } + close(releases) + printed_releases = 1 + } + in_releases = 1 + next +} +/<\/releases>/ { + in_releases = 0 + print $0 + next +} +in_releases { next } +{ print } +' "$XML_FILE" > "$TEMP_XML" + +# Validate the generated XML +if ! grep -q "" "$TEMP_XML" || ! grep -q "" "$TEMP_XML"; then + log_error "Failed to generate valid XML structure" + log_warn "Restoring from backup..." + mv "$BACKUP_FILE" "$XML_FILE" + exit 1 +fi + +# Remove backup if everything is fine +rm "$BACKUP_FILE" + +# Replace original file +mv "$TEMP_XML" "$XML_FILE" +log_info "XML file updated successfully" + +# Calculate SHA256 checksum +echo "" +log_info "Calculating SHA256 checksum..." +if command -v sha256sum >/dev/null 2>&1; then + CHECKSUM=$(sha256sum "$XML_FILE" | awk '{print $1}') +elif command -v shasum >/dev/null 2>&1; then + CHECKSUM=$(shasum -a 256 "$XML_FILE" | awk '{print $1}') +else + log_error "Neither sha256sum nor shasum found" + exit 1 +fi + +# Save checksum to file +CHECKSUM_FILE="${XML_FILE}.sha256" +echo "$CHECKSUM $XML_FILE" > "$CHECKSUM_FILE" + +echo "" +echo "================================================" +echo "Summary" +echo "================================================" +echo " Updated file: $XML_FILE" +echo " Backup file: $BACKUP_FILE" +echo " Checksum file: $CHECKSUM_FILE" +echo " SHA256: $CHECKSUM" +echo " Releases: $RELEASE_COUNT" +echo "" +log_info "Sync completed successfully!" +echo "" +echo "To verify the checksum, run:" +if command -v sha256sum >/dev/null 2>&1; then + echo " sha256sum -c $CHECKSUM_FILE" +else + echo " shasum -a 256 -c $CHECKSUM_FILE" +fi diff --git a/data/metainfo/com.bilingify.readest.appdata.xml b/data/metainfo/com.bilingify.readest.appdata.xml index bd856c60..41d06ffa 100644 --- a/data/metainfo/com.bilingify.readest.appdata.xml +++ b/data/metainfo/com.bilingify.readest.appdata.xml @@ -60,69 +60,132 @@ com.bilingify.readest.desktop - +
    -
  • Reader: Fixed links not working in some MOBI books
  • -
  • TTS: Fixed an issue where some text was skipped during reading
  • -
  • Library: You can now delete only the cloud backup of a book without removing the local copy
  • -
  • Performance: Fonts in the font list now load only when displayed for faster startup
  • -
  • Performance: Opening large MOBI books is now significantly faster
  • -
  • Layout: Fixed overlay scrollbar display in virtualized book lists
  • -
  • Layout: Improved grid cover image height in crop mode
  • -
  • Layout: Removed unsupported screen orientation lock option on iPad
  • -
  • Layout: System context menu no longer appears when selecting text on iPad
  • -
  • Translation: Added Thai (th-TH) language support
  • +
  • Sync: Improved reliability for new accounts so your books sync correctly from the start
  • +
  • Library: Fixed an occasional issue where returning to the library could get stuck
  • +
  • Layout: Improved image display in paginated mode so images won't exceed the available height
  • +
  • TXT: Improved performance and stability when opening and parsing TXT files
  • +
  • Fonts: Fixed an issue where monospace fonts were not applied correctly in code blocks
- +
    -
  • Subscription: You can now upgrade to Readest Premium and manage your subscription
  • -
  • Reader: Added an option to toggle Parallel Reading when viewing multiple books
  • -
  • Translation: Added an option to show or hide the original text in translations
  • -
  • Layout: TOC on Android now uses an overlay scrollbar for easier navigation
  • -
  • Layout: Custom CSS can now also be applied to the library page
  • -
  • Fonts: Added three new CJK fonts to choose from
  • -
  • Shortcuts: Press ESC to quickly close the search bar
  • +
  • Bookshelf: Added support for nested groups to organize your books more flexibly
  • +
  • Sync: Improved reliability by automatically retrying failed book syncs
  • +
  • Sync: Improved token refresh so login sessions stay active longer on KOReader
  • +
  • E-Ink: Enhanced readability on the library page for E-Ink devices
  • +
  • UI: Storage capacity is now displayed with precise values in the user profile
  • +
  • Reader: You can now import files directly into the currently selected book group
  • +
  • Account: You can now update the email address linked to your Readest account
  • +
  • Footnotes: Added compatibility for more footnote formats
- +
    -
  • Layout: Fixed view menu width on smaller screens
  • -
  • Layout: Added option to crop or fit book covers in library view
  • -
  • Reader: You can now apply custom CSS to the reading interface (UI)
  • -
  • Reader: Added an option to show remaining pages in the current chapter
  • -
  • Settings: Added options to reset settings from the config dialog
  • -
  • Import: Fixed encoded filenames when importing TXT files on iOS
  • -
  • Linux: Fixed missing app icon on some Linux distributions
  • -
  • GitHub: Added donation link to support Readest development
  • +
  • TTS: Fixed an issue where system voices were not working on Android
  • +
  • TTS: Added options to customize the highlight style during read-aloud
  • +
  • E-Ink: Disabled all shadows to improve display clarity
  • +
  • E-Ink: Added an option to save the last book cover on Android
  • +
  • Android: Fixed a crash that occurred when toggling 'Allow Script'
  • +
  • Android: Adjusted launcher icon size for better compatibility across devices
- +
    -
  • Layout has been improved for iPad devices
  • -
  • Screen orientation changes are now smoother on iOS
  • -
  • Importing books on iOS during the first launch is now more reliable
  • -
  • Font size no longer changes unexpectedly in scrolled mode on iOS
  • -
  • Top and bottom safe insets are now ignored when no header or footer is present
  • -
  • Interactive books now load correctly on the Desktop platform
  • -
  • Translation is now disabled when the primary language is undefined
  • -
  • Android: the task list background color has been updated with current theme color
  • +
  • Sync: Faster library syncing and support for in-app one-time purchases of extra cloud storage
  • +
  • TTS: You can now choose the target language for read-aloud on translated books
  • +
  • Reader: New keyboard shortcuts make it easier to move between sections
  • +
  • Reader: Smoother scrolling for a more comfortable reading experience
  • +
  • Reader: Footnotes in definition lists are now fully supported
  • +
  • Reader: Improved search accuracy and display of search results
  • +
  • Reader: Clearer error messages when importing books
  • +
  • Reader: Improved safety when loading book content
  • +
  • Settings: You can now choose your own highlight colors
  • +
  • Settings: Added option to adjust screen brightness automatically
  • +
  • E-Ink: Better readability and clearer progress display with underlined links
  • +
  • Android: You can now store app data on an external SD card
  • +
  • iOS: Restores your last reading page if the app was closed in the background
  • +
  • Localization: Added Persian (Farsi) language support
- +
    -
  • Layout: Image size now adjusts more accurately by converting screen units to pixels properly
  • -
  • Layout: Improved header layout on iOS landscape mode — extra spacing has been removed
  • -
  • Settings: Top and bottom margin settings are now more intuitive and better constrained
  • +
  • Load system fonts list at runtime on desktop
  • +
  • Incrementally load new books in synchronization
  • +
  • Change voice language dynamically by detecting text language
  • +
  • Various fixes and enhancements on sync, fonts and highlighting
  • +
+
+
+ + +
    +
  • TTS: Fixed issue where the read-aloud indicator disappeared too quickly
  • +
  • Layout: Overriding book layout no longer affects explicitly set text alignment
  • +
  • Reader: Added localized number display for reading progress in vertical layout
  • +
  • Reader: Enhanced swipe responsiveness for smoother page transitions
  • +
  • Settings: Added an option to disable animations when using E-Ink mode
  • +
+
+
+ + +
    +
  • Reader: Improved chapter detection with better chapter title recognition
  • +
  • Reader: Enhanced compatibility for parsing more footnote formats
  • +
  • Theme: Fixed auto theme switching in new reader windows
  • +
  • TTS: Improved scrolling accuracy to highlighted text during read-aloud
  • +
  • TTS: Fixed crash issues on certain Android systems
  • +
+
+
+ + +
    +
  • Reader: Added support for per-book background image customization
  • +
  • Reader: Added option to override book language metadata for improved hyphenation accuracy
  • +
  • Sync: Readest sync in KOReader can now be triggered using gesture controls
  • +
  • Sync: Fixed a crash in KOReader that occurred when syncing progress without an open book
  • +
  • Sync: Improved upload performance with concurrent upload support
  • +
+
+
+ + +
    +
  • TTS: Improved media session control compatibility across more Android systems
  • +
  • TTS: Made the TTS icon less distracting during read-aloud mode
  • +
  • Settings: Added an option to adjust screen brightness while reading
  • +
  • Settings: Added support for custom background images
  • +
  • PDF: Fixed an issue where scrolling and panning didn’t work correctly when zoomed in
  • +
  • Android: Added adaptive launcher icon for better system integration
  • +
  • Reader: Added keyboard shortcuts for toggling bookmarks
  • +
  • Reader: Annotations are now rendered instantly when opening files
  • +
+
+
+ + +
    +
  • Sync: More reliable syncing between KOReader and Readest
  • +
  • MOBI: Fixed an issue where some footnotes in MOBI/AZW files were not parsed correctly
  • +
  • Storage: Added support for changing data location on Windows, macOS, Linux, and Android
  • +
  • Windows: Portable EXE version now stores all reading data in the directory of the executable
  • +
  • Android: Added background TTS support with media session controls
  • +
  • WebView: Extended compatibility down to version 92
  • +
  • Settings: Added global settings menu to the library page
  • +
  • iOS: Fixed an issue where custom theme colors were not handled correctly on older Safari versions
  • +
  • TTS: Added more languages for Edge TTS
@@ -152,4 +215,4 @@ #d97706 #b45309 - \ No newline at end of file + diff --git a/data/metainfo/com.bilingify.readest.appdata.xml.sha256 b/data/metainfo/com.bilingify.readest.appdata.xml.sha256 new file mode 100644 index 00000000..d3d06d52 --- /dev/null +++ b/data/metainfo/com.bilingify.readest.appdata.xml.sha256 @@ -0,0 +1 @@ +97e7dd288e6d663437e7fa7cc21c1edd3710169b90dfa81af511077a4fe2ec0e ../../data/metainfo/com.bilingify.readest.appdata.xml diff --git a/packages/tauri-plugins b/packages/tauri-plugins index 12da195f..dff6fa98 160000 --- a/packages/tauri-plugins +++ b/packages/tauri-plugins @@ -1 +1 @@ -Subproject commit 12da195fce176117faad1a35af6ea740766ee0c6 +Subproject commit dff6fa986a9a05ba98b6ca660fea78ae97251fc2