{"id":13429337,"url":"https://github.com/Tencent/tinker","last_synced_at":"2025-03-16T03:31:19.174Z","repository":{"id":37663760,"uuid":"67481986","full_name":"Tencent/tinker","owner":"Tencent","description":"Tinker is a hot-fix solution library for Android, it supports dex, library and resources update without reinstall apk.","archived":false,"fork":false,"pushed_at":"2024-09-25T03:08:38.000Z","size":7030,"stargazers_count":17174,"open_issues_count":532,"forks_count":3333,"subscribers_count":697,"default_branch":"dev","last_synced_at":"2024-11-16T09:13:09.359Z","etag":null,"topics":["android","dynamic","hotfix","wechat"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tencent.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-06T06:57:52.000Z","updated_at":"2024-11-15T08:02:17.000Z","dependencies_parsed_at":"2022-07-10T14:17:25.893Z","dependency_job_id":"e5c7bd4b-86c9-4f1c-b06b-9821f54d8f4a","html_url":"https://github.com/Tencent/tinker","commit_stats":{"total_commits":711,"total_committers":47,"mean_commits":"15.127659574468085","dds":0.5063291139240507,"last_synced_commit":"630fb9ff23c7d484db40c40f4c6f3be021673097"},"previous_names":[],"tags_count":76,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tencent%2Ftinker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tencent%2Ftinker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tencent%2Ftinker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tencent%2Ftinker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tencent","download_url":"https://codeload.github.com/Tencent/tinker/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243822312,"owners_count":20353496,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","dynamic","hotfix","wechat"],"created_at":"2024-07-31T02:00:35.385Z","updated_at":"2025-03-16T03:31:19.168Z","avatar_url":"https://github.com/Tencent.png","language":"Java","funding_links":[],"categories":["HotFix","Java","Index","Java (78)","Android 应用","Hotfix","Projects List"],"sub_categories":["Android Hot Fix","网络服务_其他"],"readme":"## Tinker\n[![license](http://img.shields.io/badge/license-BSD3-brightgreen.svg?style=flat)](https://github.com/Tencent/tinker/blob/master/LICENSE)\n[![Release Version](https://img.shields.io/badge/release-1.9.15.1-red.svg)](https://github.com/Tencent/tinker/releases)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/Tencent/tinker/pulls)\n[![WeChat Approved](https://img.shields.io/badge/Wechat_Approved-1.9.15.1-red.svg)](https://github.com/Tencent/tinker/wiki)\n\n[中文说明](https://github.com/Tencent/tinker/wiki)\n\nTinker is a hot-fix solution library for Android, it supports dex, library and resources update without reinstalling apk.\n\n![tinker.png](assets/tinker.png)\n\n## Getting started\nAdd tinker-gradle-plugin as a dependency in your main `build.gradle` in the root of your project:\n\n```gradle\nbuildscript {\n    dependencies {\n        classpath ('com.tencent.tinker:tinker-patch-gradle-plugin:1.9.1')\n    }\n}\n```\n\nThen you need to \"apply\" the plugin and add dependencies by adding the following lines to your `app/build.gradle`.\n\n```gradle\ndependencies {\n    //optional, help to generate the final application\n    provided('com.tencent.tinker:tinker-android-anno:1.9.1')\n    //tinker's main Android lib\n    compile('com.tencent.tinker:tinker-android-lib:1.9.1')\n}\n...\n...\napply plugin: 'com.tencent.tinker.patch'\n```\n\nIf your app has a class that subclasses android.app.Application, then you need to modify that class, and move all its implements to [SampleApplicationLike](https://github.com/Tencent/tinker/blob/master/tinker-sample-android/app/src/main/java/tinker/sample/android/app/SampleApplicationLike.java) rather than Application:\n\n```java\n-public class YourApplication extends Application {\n+public class SampleApplicationLike extends DefaultApplicationLike {\n```\n\nNow you should change your `Application` class, make it a subclass of [TinkerApplication](https://github.com/Tencent/tinker/blob/master/tinker-android/tinker-android-loader/src/main/java/com/tencent/tinker/loader/app/TinkerApplication.java). As you can see from its API, it is an abstract class that does not have a default constructor, so you must define a no-arg constructor:\n\n```java\npublic class SampleApplication extends TinkerApplication {\n    public SampleApplication() {\n      super(\n        //tinkerFlags, which types is supported\n        //dex only, library only, all support\n        ShareConstants.TINKER_ENABLE_ALL,\n        // This is passed as a string so the shell application does not\n        // have a binary dependency on your ApplicationLifeCycle class.\n        \"tinker.sample.android.app.SampleApplicationLike\");\n    }\n}\n```\n\nUse `tinker-android-anno` to generate your `Application` is recommended, you just need to add an annotation for your [SampleApplicationLike](https://github.com/Tencent/tinker/blob/master/tinker-sample-android/app/src/main/java/tinker/sample/android/app/SampleApplicationLike.java) class\n\n```java\n@DefaultLifeCycle(\napplication = \"tinker.sample.android.app.SampleApplication\",             //application name to generate\nflags = ShareConstants.TINKER_ENABLE_ALL)                                //tinkerFlags above\npublic class SampleApplicationLike extends DefaultApplicationLike\n```\n\nHow to install tinker? learn more at the sample [SampleApplicationLike](https://github.com/Tencent/tinker/blob/master/tinker-sample-android/app/src/main/java/tinker/sample/android/app/SampleApplicationLike.java).\n\nFor proguard, we have already made the proguard config automatic, and tinker will also generate the multiDex keep proguard file for you.\n\nFor more tinker configurations, learn more at the sample [app/build.gradle](https://github.com/Tencent/tinker/blob/master/tinker-sample-android/app/build.gradle).\n\n## Ark Support\nHow to run tinker on the Ark?\n### building patch\nJust use the following command:\n```buildconfig\nbash build_patch_dexdiff.sh old=xxx new=xxx\n```\n* `old` indicates the absolute path of android apk(not compiled by Ark) with bugs\n* `new` indicates the absolute path of android apk(not compiled by Ark) with fixing\n\nThe patch file is packaged in APK.\n### compiling in Ark\nTODO\n\nAt present it's compiled by Ark compiler team. The output patch is still packaged in APK format without signature.\n### packaging the patch\nFor tinker-cli, add the following lines to your `tinker_config.xml`. Otherwise, the default configure will be used.\n```xml\n\u003cissue id=\"arkHot\"\u003e\n   \u003cpath value=\"arkHot\"/\u003e         // path of patch\n   \u003cname value=\"patch.apk\"/\u003e      // name of patch\n\u003c/issue\u003e\n```\nFor gradle, add the following lines to your `app/build.gradle`. Otherwise, the default configure will be used.\n```gradle\nark {\n   path = \"arkHot\"         // path of patch\n   name = \"patch.apk\"      // name of patch\n}\n```\nThe patch is compiled by Ark and placed on the above path. all subsequent operations are same as tinker-cli or gradle.\n\nThe ultimated patch APK consists of two patch files:\n\n* `classes.dex` for android\n* `patch.apk` with so for Ark.\n\n## Tinker Known Issues\nThere are some issues which Tinker can't dynamic update.\n\n1. Can't update AndroidManifest.xml, such as add Android Component.\n2. Do not support some Samsung models with os version android-21.\n3. Due to Google Play Developer Distribution Agreement, we can't dynamic update our apk.\n\n## Tinker Support\nAny problem?\n\n1. Learn more from [tinker-sample-android](https://github.com/Tencent/tinker/tree/master/tinker-sample-android).\n2. Read the [source code](https://github.com/Tencent/tinker/tree/master).\n3. Read the [wiki](https://github.com/Tencent/tinker/wiki) or [FAQ](https://github.com/Tencent/tinker/wiki/Tinker-%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98) for help.\n4. Contact us for help.\n\n## Contributing\nFor more information about contributing issues or pull requests, see our [Tinker Contributing Guide](https://github.com/Tencent/tinker/blob/master/CONTRIBUTING.md).\n\n## License\nTinker is under the BSD license. See the [LICENSE](https://github.com/Tencent/tinker/blob/master/LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTencent%2Ftinker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTencent%2Ftinker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTencent%2Ftinker/lists"}