Skip to content
Merged
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
16 changes: 16 additions & 0 deletions frontend/src/routes/downloads.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,22 @@ function DownloadPage() {
>
Join Google Play Beta
</a>
<div className="w-full border-t border-[hsl(var(--marketing-card-border))] pt-4">
<p className="text-[hsl(var(--marketing-text-muted))] text-sm mb-3 text-center">
Or download the APK directly:
</p>
<a
href="https://github.com/OpenSecretCloud/Maple/releases/download/v1.99.0-android-beta1/app-universal-release.apk"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Hardcoded APK version will become stale quickly.

The APK download URL is hardcoded to a specific version (v1.99.0-android-beta1), while desktop downloads dynamically fetch the latest release using getLatestDownloadInfo(). As new Android releases are published, this link will point to an outdated version, degrading the user experience.

Consider one of these approaches:

Option 1 (Recommended): Extend the existing dynamic release fetching

Add Android APK URL to the DownloadUrls interface and update getLatestDownloadInfo() to include it:

 interface DownloadUrls {
   macOS: string;
   linuxAppImage: string;
   linuxDeb: string;
   linuxRpm: string;
+  androidApk: string;
 }

Then update the fallback and use the dynamic URL:

 const FALLBACK_URLS: DownloadUrls = {
   macOS: `${FALLBACK_BASE_URL}/Maple_${FALLBACK_VERSION}_universal.dmg`,
   linuxAppImage: `${FALLBACK_BASE_URL}/Maple_${FALLBACK_VERSION}_amd64.AppImage`,
   linuxDeb: `${FALLBACK_BASE_URL}/Maple_${FALLBACK_VERSION}_amd64.deb`,
-  linuxRpm: `${FALLBACK_BASE_URL}/Maple-${FALLBACK_VERSION}-1.x86_64.rpm`
+  linuxRpm: `${FALLBACK_BASE_URL}/Maple-${FALLBACK_VERSION}-1.x86_64.rpm`,
+  androidApk: `${FALLBACK_BASE_URL}/app-universal-release.apk`
 };

Update the link to use the dynamic URL:

                   <a
-                    href="https://github.com/OpenSecretCloud/Maple/releases/download/v1.99.0-android-beta1/app-universal-release.apk"
+                    href={downloadUrls.androidApk}
                     className="py-2 px-4 rounded-lg text-center font-medium transition-all duration-300 block

Option 2: Use a separate constant for the Android release tag

If Android releases follow a different versioning scheme or cadence, define a constant at the top of the file:

const ANDROID_BETA_TAG = "v1.99.0-android-beta1";
const ANDROID_APK_URL = `https://github.com/OpenSecretCloud/Maple/releases/download/${ANDROID_BETA_TAG}/app-universal-release.apk`;

This at least makes the version easier to update in one place.

🤖 Prompt for AI Agents
In frontend/src/routes/downloads.tsx around line 259, the APK download URL is
hardcoded to a specific release tag making it stale; update the code to fetch
the APK URL dynamically by extending the DownloadUrls interface to include an
androidApk (or apkUrl) field, modify getLatestDownloadInfo() to populate that
field from the release assets (falling back to the existing hardcoded URL if not
found), and replace the hardcoded href with the new dynamic download field;
alternatively, if Android uses a separate cadence, add a single ANDROID_BETA_TAG
constant and construct ANDROID_APK_URL from it and use that constant in place of
the hardcoded URL.

className="py-2 px-4 rounded-lg text-center font-medium transition-all duration-300 block
dark:bg-white/90 dark:text-black dark:hover:bg-[hsl(var(--purple))]/80 dark:hover:text-[hsl(var(--foreground))] dark:active:bg-white/80
bg-background text-foreground hover:bg-[hsl(var(--purple))] hover:text-[hsl(var(--foreground))] active:bg-background/80
border border-[hsl(var(--purple))]/30 hover:border-[hsl(var(--purple))]"
target="_blank"
rel="noopener noreferrer"
>
Download APK (Beta)
</a>
</div>
<p className="text-[hsl(var(--marketing-text-muted))] text-xs text-center">
Beta version - help us test new features before the official release
</p>
Expand Down
Loading