Backend Development 11 min read

DeepLink Service Architecture and Implementation for Mobile App Promotion

This article explains the concept of DeepLink, its iOS and Android application scenarios, the design of deployment links across versions, the integration of APK Signature Scheme v2, and the caching strategies (Caffeine) used to efficiently serve channel‑specific packages in a backend service.

Zhuanzhuan Tech
Zhuanzhuan Tech
Zhuanzhuan Tech
DeepLink Service Architecture and Implementation for Mobile App Promotion

DeepLink (deep linking) enables users to click a link in external media such as short‑video ads, social messages, or SMS and be taken directly to a specific page inside a target app; if the app is not installed, the link guides the user to download it first and then performs the jump.

The article first introduces typical use cases for a second‑hand phone recycling app, showing how users can be directed from Douyin, WeChat, or SMS to the app’s recycling page after installation.

Two platform‑specific scenarios are described:

iOS Application Scenario

Because iOS apps can only be installed via the App Store, the DeepLink service redirects the user to an H5 intermediate page that copies the DeepLink URL to the clipboard, launches the App Store for download, and after installation the app reads the clipboard to perform the jump.

Android Application Scenario

On Android, the DeepLink service can directly download the app APK; the DeepLink URL is embedded into the APK using APK Signature Scheme v2, and after installation the app parses the embedded link to navigate to the target page.

The article then details the APK Signature Scheme v2, its advantages over the older scheme, and shows the structure of the APK Signing Block in a table.

DeepLink Service Design

The service focuses on Android implementation and outlines the design of deployment links, which evolve through three versions:

Version 1.0

Link format: https://apk.zhuanstatic.com/deeplink/{appType}_{channel}_{version}_{deepLink}.apk with parameters for app type, channel, version, and DeepLink ID.

Version 2.0

Version removed from the path to avoid malicious version selection; new format: https://apk.zhuanstatic.com/deeplink/{appType}_{channel}_{deepLink}.apk .

Version 3.0

Introduces a non‑CDN redirector (apk.zhuanzhuan.com) that adds the version number and forwards to the CDN‑served domain, ensuring users always receive the latest APK while keeping the public link unchanged.

Packaging and Download

When a deployment link is accessed, the backend extracts parameters (e.g., https://apk.zhuanstatic.com/deeplink/zhuanzhuan_douyin666_9.0.0_huishou.apk ) to identify the channel, app version, and target DeepLink, then embeds the DeepLink into the original APK using the v2 signing scheme to produce a channel‑specific package.

Caching Strategy

To handle high read traffic and avoid overloading the service, two local caches are employed:

Level‑1 Cache (Channel Packages)

/**
 * Cache high‑frequency channel package files
 */
private static final Cache
channelFinalAppCache = CacheBuilder
        .newBuilder()
        .expireAfterAccess(1, TimeUnit.DAYS)
        .maximumSize(15)
        .build();

The cache key combines appType, version, channel, and DeepLink; the top 15 most frequent channel packages cover over 90% of requests.

Level‑2 Cache (Original Packages)

/**
 * Cache original APK files
 */
private static final Cache
channelAppCache = CacheBuilder
        .newBuilder()
        .expireAfterAccess(2, TimeUnit.DAYS)
        .maximumSize(10)
        .build();

The key is appType+version; the cache is pre‑loaded at service startup and refreshed when a new app version is released.

Conclusion

The DeepLink service supports new‑media acquisition and in‑app updates by embedding DeepLink information into channel‑specific APKs, using CDN pre‑warming and rate‑limiting to ensure stability, and leveraging Caffeine caches to achieve high read performance.

backendmobileiOSAndroidcachingDeepLink
Zhuanzhuan Tech
Written by

Zhuanzhuan Tech

A platform for Zhuanzhuan R&D and industry peers to learn and exchange technology, regularly sharing frontline experience and cutting‑edge topics. We welcome practical discussions and sharing; contact waterystone with any questions.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.