explaingit

tencent/tinker

17,631JavaAudience · developerComplexity · 4/5LicenseSetup · hard

TLDR

Tinker is a Tencent library that lets Android apps patch their compiled code, native libs, and resources at runtime without a full app store reinstall.

Mindmap

mindmap
  root((tinker))
    Inputs
      Old APK
      New APK
      Gradle config
    Outputs
      Patch file
      Hot-fixed app
    Use Cases
      Ship bug fixes fast
      Update dex code
      Replace assets
      Patch native libs
    Tech Stack
      Java
      Android
      Gradle plugin
    Limits
      No Google Play
      No manifest changes
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Push a critical bug fix to an Android app without a Play Store release.

USE CASE 2

Update images and layouts inside a published Chinese-market Android app.

USE CASE 3

Patch a crashing native library on user devices via a downloaded patch.

USE CASE 4

Build a custom in-app update channel for an enterprise Android app.

Tech stack

JavaAndroidGradleC

Getting it running

Difficulty · hard Time to first run · 1day+

Forbidden on Google Play and requires custom patch distribution plus Gradle plugin wiring.

BSD license lets you use the code in commercial Android apps freely with attribution.

In plain English

Tinker is a Java library for Android that solves a painful problem for mobile app developers: when you discover a bug in your published Android app, normally you have to release a new version, submit it to the app store, and wait for users to download and install the update. Tinker allows you to push a "hot fix", a small patch file, that updates the app on users' devices without requiring a full reinstall. This is called "hot-fixing." Specifically, Tinker can update three kinds of content in your app: the compiled code (dex files, which contain the Java logic of your app), native libraries (compiled code for low-level system operations), and resources (images, layouts, and other assets). Developers generate a patch file by comparing the old and new version of the app, then distribute that patch file to users through their own update mechanism. Tinker applies the patch when the app restarts. The library is developed by Tencent and is used in WeChat. It integrates with the standard Android build system (Gradle), you add it as a plugin, make a few configuration changes to your app's startup code, and then use Tinker's build tools to generate patches. There are some things Tinker cannot fix: it cannot update the app's manifest file (which declares core components), and hot-fixing is not permitted on Google Play, so this approach is more common in markets where apps are distributed outside of Google Play. The code is released under a BSD license.

Copy-paste prompts

Prompt 1
Add Tinker to my Android Gradle project and show me the minimum app initialization code.
Prompt 2
Generate a Tinker patch file by diffing two APKs from the command line.
Prompt 3
Explain why Tinker patches cannot be used on Google Play and what alternatives exist.
Prompt 4
Set up a small Spring server that hosts Tinker patches and have my Android client poll and apply them.
Prompt 5
Debug why my Tinker patch is being rejected on app restart with a signature mismatch error.
Open on GitHub → Explain another repo

← tencent on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.