64-bit Adaptation Practices for iQIYI Android App
iQIYI migrated its Android app to 64‑bit by configuring ABI selection, delivering native libraries via universal or split APKs, plugin packages, and a cloud‑based SO distribution platform, adding a front‑end SDK and back‑end publishing service, and applying size‑reduction and hot‑fix optimizations, resulting in faster startup, better performance, and a unified library management workflow.
Background: Modern smartphones now use 64‑bit CPUs, which can address up to 128 GB of memory compared with the 4 GB limit of 32‑bit. Although major Android OEMs already support both 32‑bit and 64‑bit apps, migrating to 64‑bit offers broader innovation space and performance gains.
Principle of 64‑bit adaptation: An app runs in a 64‑bit process when the device’s ro.zygote supports it, creating both 32‑bit and 64‑bit Zygote processes. During installation, the Package Manager Service scans the APK’s lib directory, matches the device’s abiLists , and sets primaryCpuAbi . At launch, the Activity Manager Service forks the appropriate Zygote based on primaryCpuAbi , resulting in a 64‑bit process if the ABI is 64‑bit.
SO library adaptation: Three sources of native libraries exist—bundled static SOs in the APK, plugin‑provided SOs, and dynamically delivered SOs. For each source, iQIYI adopts specific strategies:
APK‑bundled SOs: either build a universal APK containing all ABIs (large size) or generate separate APKs per ABI (requires market support).
Plugin SOs: iQIYI uses a two‑package approach where the plugin center delivers the appropriate ABI‑specific plugin.
Cloud‑delivered SOs: a dedicated SO distribution platform provides front‑end SDK and back‑end publishing components to fetch the correct SO zip based on runtime ABI. Front‑end SDK workflow: The client sends platform ID, app version, and process info to the back‑end, receives configuration, downloads the matching SO zip, and extracts it to the proper directory. The SDK also handles cache validation, MD5 checksum verification, and re‑download on failure. Back‑end publishing platform: Supports uploading SOs for multiple ABIs, and, based on the client’s request, returns the correct SO version and download URL. Optimization measures: Upgrade and compatibility: Ensure cached SOs match the current process ABI; delete mismatched libraries on launch. Tinker hot‑fix: Produce a combined 32 + 64‑bit APK, then split it into separate ABI packages to simplify patch distribution. Compilation size reduction: Use -fvisibility=hidden , switch from -Os to -Oz , enable -flto , and link against c++_shared . These changes reduced iQIYI’s SO size by ~10%. Conclusion: After comprehensive 64‑bit adaptation, iQIYI’s Android app achieved noticeable performance and startup improvements. The unified SO management platform streamlined cross‑team collaboration and reduced integration effort for future ABI updates.
iQIYI Technical Product Team
The technical product team of iQIYI
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.