Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,17 @@ class TweaksRepositoryImpl(
}
}

override fun getShowAllPlatforms(): Flow<Boolean> =
preferences.data.map { prefs ->
prefs[SHOW_ALL_PLATFORMS_KEY] ?: false
}

override suspend fun setShowAllPlatforms(enabled: Boolean) {
preferences.edit { prefs ->
prefs[SHOW_ALL_PLATFORMS_KEY] = enabled
}
}

override fun getBatteryOptimizationPromptDismissed(): Flow<Boolean> =
preferences.data.map { prefs ->
prefs[BATTERY_OPT_PROMPT_DISMISSED_KEY] ?: false
Expand Down Expand Up @@ -457,6 +468,7 @@ class TweaksRepositoryImpl(
private val EXTERNAL_IMPORT_BANNER_DISMISSED_AT_KEY = intPreferencesKey("external_import_banner_dismissed_at")
private val APK_INSPECT_COACHMARK_SHOWN_KEY = booleanPreferencesKey("apk_inspect_coachmark_shown")
private val CHANNEL_CHIP_COACHMARK_SHOWN_KEY = booleanPreferencesKey("channel_chip_coachmark_shown")
private val SHOW_ALL_PLATFORMS_KEY = booleanPreferencesKey("show_all_platforms")
private val BATTERY_OPT_PROMPT_DISMISSED_KEY = booleanPreferencesKey("battery_opt_prompt_dismissed")
private val LAST_SEEN_WHATS_NEW_VERSION_CODE_KEY = intPreferencesKey("last_seen_whats_new_version_code")
private val ANNOUNCEMENTS_DISMISSED_IDS_KEY = stringSetPreferencesKey("announcements_dismissed_ids")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@ interface TweaksRepository {

suspend fun setChannelChipCoachmarkShown(shown: Boolean)

/**
* When true, the release-assets picker on Details shows installers
* for every OS (grouped by platform section). When false (default),
* only assets installable on the current platform are listed.
*/
fun getShowAllPlatforms(): Flow<Boolean>

suspend fun setShowAllPlatforms(enabled: Boolean)

/**
* One-shot watermark for the battery-optimization prompt on
* aggressive-OEM ROMs (Oppo / OnePlus / Realme / Xiaomi / vivo /
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package zed.rainxch.core.domain.util

import zed.rainxch.core.domain.model.DiscoveryPlatform

/**
* Maps a release asset filename to the OS platform it targets, by
* extension. Returns `null` for files we can't classify (zip bundles,
* sources, sig/sha files, etc.) — callers should drop those from the
* cross-platform picker so the list isn't polluted by non-installable
* sidecars.
*/
fun assetPlatformOf(assetName: String): DiscoveryPlatform? {
val lower = assetName.lowercase()
return when {
lower.endsWith(".apk") -> DiscoveryPlatform.Android
lower.endsWith(".exe") || lower.endsWith(".msi") -> DiscoveryPlatform.Windows
lower.endsWith(".dmg") || lower.endsWith(".pkg") -> DiscoveryPlatform.Macos
lower.endsWith(".deb") ||
lower.endsWith(".rpm") ||
lower.endsWith(".appimage") ||
lower.endsWith(".pkg.tar.zst") ||
lower.endsWith(".snap") ||
lower.endsWith(".flatpakref") -> DiscoveryPlatform.Linux
else -> null
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"Silent install via root — Magisk, KernelSU, and APatch users can now install without Shizuku or Dhizuku.",
"Search in Starred and Favourites — quickly filter long lists by repo name, owner, description, or language.",
"Self-owned ✓ badge — when you're signed in, repos you own get a verified checkmark on Home and Search cards.",
"Hide repository — long-press any repo card on Home or Search to hide it from discovery. The repo stays in your library if you have it installed."
"Hide repository — long-press any repo card on Home or Search to hide it from discovery. The repo stays in your library if you have it installed.",
"Multi-OS release picker — toggle 'Show all platforms' on the asset picker to grab Android APKs from desktop or Linux .debs from your phone. Other-platform downloads open in your browser to save for transfer."
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1165,4 +1165,12 @@
<string name="open_on_github">فتح في GitHub</string>
<string name="mark_as_viewed">وضع علامة مشاهد</string>
<string name="mark_as_unviewed">إلغاء علامة مشاهد</string>
<string name="show_all_platforms_label">إظهار جميع المنصات</string>
<string name="platform_section_android">Android</string>
<string name="platform_section_windows">Windows</string>
<string name="platform_section_macos">macOS</string>
<string name="platform_section_linux">Linux</string>
<string name="saved_for_transfer_hint">منصة أخرى — يفتح في المتصفح للحفظ والنقل</string>
<string name="section_chip_your_device">جهازك</string>
<string name="section_chip_for_transfer">للنقل</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -1141,4 +1141,12 @@
<string name="open_on_github">GitHub-এ খুলুন</string>
<string name="mark_as_viewed">দেখা হিসেবে চিহ্নিত করুন</string>
<string name="mark_as_unviewed">অদেখা হিসেবে চিহ্নিত করুন</string>
<string name="show_all_platforms_label">সব প্ল্যাটফর্ম দেখান</string>
<string name="platform_section_android">Android</string>
<string name="platform_section_windows">Windows</string>
<string name="platform_section_macos">macOS</string>
<string name="platform_section_linux">Linux</string>
<string name="saved_for_transfer_hint">অন্য প্ল্যাটফর্ম — ট্রান্সফারের জন্য সংরক্ষণে ব্রাউজারে খুলবে</string>
<string name="section_chip_your_device">আপনার ডিভাইস</string>
<string name="section_chip_for_transfer">ট্রান্সফারের জন্য</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -1113,4 +1113,12 @@
<string name="open_on_github">Abrir en GitHub</string>
<string name="mark_as_viewed">Marcar como visto</string>
<string name="mark_as_unviewed">Marcar como no visto</string>
<string name="show_all_platforms_label">Mostrar todas las plataformas</string>
<string name="platform_section_android">Android</string>
<string name="platform_section_windows">Windows</string>
<string name="platform_section_macos">macOS</string>
<string name="platform_section_linux">Linux</string>
<string name="saved_for_transfer_hint">Otra plataforma — se abre en el navegador para guardar y transferir</string>
<string name="section_chip_your_device">Tu dispositivo</string>
<string name="section_chip_for_transfer">Para transferir</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -1114,4 +1114,12 @@
<string name="open_on_github">Ouvrir sur GitHub</string>
<string name="mark_as_viewed">Marquer comme vu</string>
<string name="mark_as_unviewed">Marquer comme non vu</string>
<string name="show_all_platforms_label">Afficher toutes les plateformes</string>
<string name="platform_section_android">Android</string>
<string name="platform_section_windows">Windows</string>
<string name="platform_section_macos">macOS</string>
<string name="platform_section_linux">Linux</string>
<string name="saved_for_transfer_hint">Autre plateforme — s\'ouvre dans le navigateur pour enregistrement et transfert</string>
<string name="section_chip_your_device">Votre appareil</string>
<string name="section_chip_for_transfer">Pour transfert</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -1152,4 +1152,12 @@
<string name="open_on_github">GitHub पर खोलें</string>
<string name="mark_as_viewed">देखा हुआ चिह्नित करें</string>
<string name="mark_as_unviewed">अनदेखा चिह्नित करें</string>
<string name="show_all_platforms_label">सभी प्लेटफ़ॉर्म दिखाएं</string>
<string name="platform_section_android">Android</string>
<string name="platform_section_windows">Windows</string>
<string name="platform_section_macos">macOS</string>
<string name="platform_section_linux">Linux</string>
<string name="saved_for_transfer_hint">अन्य प्लेटफ़ॉर्म — ट्रांसफ़र के लिए सहेजने हेतु ब्राउज़र में खुलता है</string>
<string name="section_chip_your_device">आपका डिवाइस</string>
<string name="section_chip_for_transfer">ट्रांसफ़र के लिए</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -1153,4 +1153,12 @@
<string name="open_on_github">Apri su GitHub</string>
<string name="mark_as_viewed">Segna come visto</string>
<string name="mark_as_unviewed">Segna come non visto</string>
<string name="show_all_platforms_label">Mostra tutte le piattaforme</string>
<string name="platform_section_android">Android</string>
<string name="platform_section_windows">Windows</string>
<string name="platform_section_macos">macOS</string>
<string name="platform_section_linux">Linux</string>
<string name="saved_for_transfer_hint">Altra piattaforma — si apre nel browser per salvare e trasferire</string>
<string name="section_chip_your_device">Il tuo dispositivo</string>
<string name="section_chip_for_transfer">Da trasferire</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -1108,4 +1108,12 @@
<string name="open_on_github">GitHub で開く</string>
<string name="mark_as_viewed">既読にする</string>
<string name="mark_as_unviewed">未読にする</string>
<string name="show_all_platforms_label">すべてのプラットフォームを表示</string>
<string name="platform_section_android">Android</string>
<string name="platform_section_windows">Windows</string>
<string name="platform_section_macos">macOS</string>
<string name="platform_section_linux">Linux</string>
<string name="saved_for_transfer_hint">他のプラットフォーム — ブラウザで開き、転送用に保存します</string>
<string name="section_chip_your_device">このデバイス</string>
<string name="section_chip_for_transfer">転送用</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -1143,4 +1143,12 @@
<string name="open_on_github">GitHub에서 열기</string>
<string name="mark_as_viewed">본 항목으로 표시</string>
<string name="mark_as_unviewed">본 항목 해제</string>
<string name="show_all_platforms_label">모든 플랫폼 표시</string>
<string name="platform_section_android">Android</string>
<string name="platform_section_windows">Windows</string>
<string name="platform_section_macos">macOS</string>
<string name="platform_section_linux">Linux</string>
<string name="saved_for_transfer_hint">다른 플랫폼 — 전송용 저장을 위해 브라우저에서 열립니다</string>
<string name="section_chip_your_device">내 기기</string>
<string name="section_chip_for_transfer">전송용</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -1134,4 +1134,12 @@
<string name="open_on_github">Otwórz w GitHub</string>
<string name="mark_as_viewed">Oznacz jako obejrzane</string>
<string name="mark_as_unviewed">Oznacz jako nieobejrzane</string>
<string name="show_all_platforms_label">Pokaż wszystkie platformy</string>
<string name="platform_section_android">Android</string>
<string name="platform_section_windows">Windows</string>
<string name="platform_section_macos">macOS</string>
<string name="platform_section_linux">Linux</string>
<string name="saved_for_transfer_hint">Inna platforma — otwiera się w przeglądarce, aby zapisać do transferu</string>
<string name="section_chip_your_device">Twoje urządzenie</string>
<string name="section_chip_for_transfer">Do transferu</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -1134,4 +1134,12 @@
<string name="open_on_github">Открыть на GitHub</string>
<string name="mark_as_viewed">Отметить как просмотренный</string>
<string name="mark_as_unviewed">Снять отметку</string>
<string name="show_all_platforms_label">Показать все платформы</string>
<string name="platform_section_android">Android</string>
<string name="platform_section_windows">Windows</string>
<string name="platform_section_macos">macOS</string>
<string name="platform_section_linux">Linux</string>
<string name="saved_for_transfer_hint">Другая платформа — открывается в браузере для сохранения и переноса</string>
<string name="section_chip_your_device">Это устройство</string>
<string name="section_chip_for_transfer">Для переноса</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -1150,4 +1150,12 @@
<string name="open_on_github">GitHub\'da aç</string>
<string name="mark_as_viewed">Görüldü olarak işaretle</string>
<string name="mark_as_unviewed">Görülmedi olarak işaretle</string>
<string name="show_all_platforms_label">Tüm platformları göster</string>
<string name="platform_section_android">Android</string>
<string name="platform_section_windows">Windows</string>
<string name="platform_section_macos">macOS</string>
<string name="platform_section_linux">Linux</string>
<string name="saved_for_transfer_hint">Diğer platform — aktarma için kaydetmek üzere tarayıcıda açılır</string>
<string name="section_chip_your_device">Cihazınız</string>
<string name="section_chip_for_transfer">Aktarım için</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -1110,4 +1110,12 @@
<string name="open_on_github">在 GitHub 打开</string>
<string name="mark_as_viewed">标记为已查看</string>
<string name="mark_as_unviewed">取消已查看标记</string>
<string name="show_all_platforms_label">显示所有平台</string>
<string name="platform_section_android">Android</string>
<string name="platform_section_windows">Windows</string>
<string name="platform_section_macos">macOS</string>
<string name="platform_section_linux">Linux</string>
<string name="saved_for_transfer_hint">其他平台 — 在浏览器中打开以保存并转移</string>
<string name="section_chip_your_device">你的设备</string>
<string name="section_chip_for_transfer">用于转移</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,14 @@
<string name="open_on_github">Open on GitHub</string>
<string name="mark_as_viewed">Mark as viewed</string>
<string name="mark_as_unviewed">Mark as unviewed</string>
<string name="show_all_platforms_label">Show all platforms</string>
<string name="platform_section_android">Android</string>
<string name="platform_section_windows">Windows</string>
<string name="platform_section_macos">macOS</string>
<string name="platform_section_linux">Linux</string>
<string name="saved_for_transfer_hint">Other platform — opens in browser to save for transfer</string>
<string name="section_chip_your_device">Your device</string>
<string name="section_chip_for_transfer">For transfer</string>
<string name="repository_hidden">Repository hidden</string>
<string name="undo_hide">Undo</string>
<string name="hidden_repositories_title">Hidden repositories</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,20 @@ sealed interface DetailsAction {
* Persists so the coachmark only ever shows once.
*/
data object OnAcknowledgeChannelChipCoachmark : DetailsAction

/**
* Flip the "Show all platforms" picker setting (persisted globally).
* Carries the explicit target value so rapid back-and-forth toggles
* don't race against a stale read of the in-memory state.
*/
data class OnToggleShowAllPlatforms(val enabled: Boolean) : DetailsAction

/**
* Download a non-current-platform asset for transfer to another
* device. Routes to the user's browser so the file lands in their
* normal Downloads folder.
*/
Comment thread
greptile-apps[bot] marked this conversation as resolved.
data class OnDownloadForTransfer(
val assetUrl: String,
) : DetailsAction
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ data class DetailsState(
* `ChannelChip` so users discover the per-app channel toggle.
*/
val isChannelChipCoachmarkPending: Boolean = false,
/**
* Mirrors `TweaksRepository.getShowAllPlatforms()`. When true the
* release-assets picker lists installers for every OS (grouped by
* section); the install button still operates on the current
* platform's primary asset.
*/
val showAllPlatforms: Boolean = false,
) {
val filteredReleases: List<GithubRelease>
get() =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ class DetailsViewModel(
observeApkInspectCoachmark()
observeChannelChipCoachmark()
observeCurrentUserForBadge()
observeShowAllPlatforms()

hasLoadedInitialData = true
}
Expand Down Expand Up @@ -492,6 +493,29 @@ class DetailsViewModel(
DetailsAction.OnAcknowledgeChannelChipCoachmark -> {
acknowledgeChannelChipCoachmark()
}

is DetailsAction.OnToggleShowAllPlatforms -> {
viewModelScope.launch {
try {
tweaksRepository.setShowAllPlatforms(action.enabled)
} catch (e: CancellationException) {
throw e
} catch (e: Throwable) {
logger.warn("Toggle show-all-platforms failed: ${e.message}")
}
}
}

is DetailsAction.OnDownloadForTransfer -> {
// Cross-platform assets land here when the user picks an
// installer for a different OS. Browser handles the
// actual save-to-Downloads — keeps install plumbing
// unchanged and matches existing "open external link"
// flows on Details.
helper.openUrl(action.assetUrl) { err ->
logger.warn("Open transfer download failed: $err")
}
}
}
}

Expand Down Expand Up @@ -873,6 +897,14 @@ class DetailsViewModel(
}
}

private fun observeShowAllPlatforms() {
viewModelScope.launch {
tweaksRepository.getShowAllPlatforms().collect { enabled ->
_state.update { it.copy(showAllPlatforms = enabled) }
}
}
}

private fun observeChannelChipCoachmark() {
viewModelScope.launch {
val alreadyShown =
Expand Down
Loading