===
Forked from jaywcjlove/maslink, added config-free app lookup via iTunes Search API.
maslink is a tiny static redirect page for Apple App Store deep links.
GitHub README previews often strip custom protocols such as macappstore://, which makes direct Mac App Store links unclickable. This project provides a normal https:// URL that can be used in README files and then converted back into a native App Store deep link in the browser.
maslink is a static redirect helper, not a package downloader, installer, update service, or dependency distribution channel.
What it does:
- Accept
id,platform, and optional locale query parameters. - Build an App Store deep link or Apple web fallback URL in the browser.
- Attempt a client-side redirect.
What it does not do:
- Download executable files, archives, or installers from GitHub or third-party servers.
- Inject third-party scripts, ads, trackers, or package manager dependencies.
- Proxy App Store traffic through a backend service.
Trust boundary:
- A user must trust the hosted
maslinkpage to generate only the expected Apple App Store target URL. - This means
maslinkintroduces an additional redirect trust point compared with linking directly to an App Store URL. - That risk is real, but it is different from a classic software supply-chain attack because this project does not ship runtime dependencies or distribute binaries.
Threats this project can help with:
- GitHub README stripping custom protocols such as
macappstore://. - Providing a clickable HTTPS entry point that still opens the App Store natively.
Threats this project does not solve:
- A compromised hosting account or repository changing the redirect target.
- DNS, CDN, or static hosting compromise.
- User trust decisions about whether the hosted redirect page operator is trustworthy.
Ways to reduce trust risk:
- Self-host the static page if you need full control over the redirect surface.
- Keep the project dependency-free and static.
- Keep redirect logic small and auditable.
- Restrict generated targets to Apple App Store deep links and Apple web fallback URLs only.
Instead of linking to:
macappstore://itunes.apple.com/app/6768043307
link to:
https://maslink.hocgin.top/?id=6768043307&l=cn&platform=ios
When the page opens, it will:
- Read the query parameters.
- Build the correct App Store deep link.
- Attempt to redirect automatically.
- Show manual buttons for native open and web fallback.
id: Apple app ID, numeric only, required.l: Apple storefront/locale segment, optional. If omitted, the page will infer it from the browser language, then fall back tous.platform: Target platform, optional, default ismac.
Supported platform values:
maciosiphoneipad
Locale detection examples:
zh-CN->cnen-US->usja-JP->jp- If the browser language cannot be resolved, fallback is
us
For macOS:
macappstore://itunes.apple.com/app/id<ID>?mt=12&l=<LOCALE>
For iOS:
itms-apps://itunes.apple.com/app/id<ID>?l=<LOCALE>
Web fallback:
https://apps.apple.com/<LOCALE>/app/id<ID>
This repository is a plain static site.
To self-host it, deploy the contents of docs/ as static files:
docs/index.htmldocs/data.jsondocs/appicon/*
Keep the relative file layout unchanged, and expose index.html at the site root or a subpath.
For GitHub Pages, set the publish folder to /docs.
Example:
https://YOUR-DOMAIN/PATH/?id=6768043307&platform=mac
When an app ID is not found in the local data.json, this page automatically falls back to the iTunes Search API to fetch app name, icon, and platform info. No manual configuration required.
Lookup priority:
- Local config (
data.json) - Browser cache (
localStorage, 7-day TTL) - iTunes Search API (
https://itunes.apple.com/lookup?id=xxx)
Any API result is cached in localStorage so subsequent visits skip the network request.