开源软件名称(OpenSource Name):Tencent/tinker开源软件地址(OpenSource Url):https://github.com/Tencent/tinker开源编程语言(OpenSource Language):Java 92.6%开源软件介绍(OpenSource Introduction):TinkerTinker is a hot-fix solution library for Android, it supports dex, library and resources update without reinstalling apk. Getting startedAdd tinker-gradle-plugin as a dependency in your main buildscript {
dependencies {
classpath ('com.tencent.tinker:tinker-patch-gradle-plugin:1.9.1')
}
} Then you need to "apply" the plugin and add dependencies by adding the following lines to your dependencies {
//optional, help to generate the final application
provided('com.tencent.tinker:tinker-android-anno:1.9.1')
//tinker's main Android lib
compile('com.tencent.tinker:tinker-android-lib:1.9.1')
}
...
...
apply plugin: 'com.tencent.tinker.patch' If your app has a class that subclasses android.app.Application, then you need to modify that class, and move all its implements to SampleApplicationLike rather than Application: -public class YourApplication extends Application {
+public class SampleApplicationLike extends DefaultApplicationLike { Now you should change your public class SampleApplication extends TinkerApplication {
public SampleApplication() {
super(
//tinkerFlags, which types is supported
//dex only, library only, all support
ShareConstants.TINKER_ENABLE_ALL,
// This is passed as a string so the shell application does not
// have a binary dependency on your ApplicationLifeCycle class.
"tinker.sample.android.app.SampleApplicationLike");
}
} Use @DefaultLifeCycle(
application = "tinker.sample.android.app.SampleApplication", //application name to generate
flags = ShareConstants.TINKER_ENABLE_ALL) //tinkerFlags above
public class SampleApplicationLike extends DefaultApplicationLike How to install tinker? learn more at the sample SampleApplicationLike. For proguard, we have already made the proguard config automatic, and tinker will also generate the multiDex keep proguard file for you. For more tinker configurations, learn more at the sample app/build.gradle. Ark SupportHow to run tinker on the Ark? building patchJust use the following command:
The patch file is packaged in APK. compiling in ArkTODO At present it's compiled by Ark compiler team. The output patch is still packaged in APK format without signature. packaging the patchFor tinker-cli, add the following lines to your <issue id="arkHot">
<path value="arkHot"/> // path of patch
<name value="patch.apk"/> // name of patch
</issue> For gradle, add the following lines to your ark {
path = "arkHot" // path of patch
name = "patch.apk" // name of patch
} The patch is compiled by Ark and placed on the above path. all subsequent operations are same as tinker-cli or gradle. The ultimated patch APK consists of two patch files:
Tinker Known IssuesThere are some issues which Tinker can't dynamic update.
Tinker SupportAny problem?
ContributingFor more information about contributing issues or pull requests, see our Tinker Contributing Guide. LicenseTinker is under the BSD license. See the LICENSE file for details. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论