GithubHelp home page GithubHelp logo

davidmr001 / tinker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tencent/tinker

0.0 1.0 0.0 3.24 MB

Tinker is a hot-fix solution library for Android, it supports dex, library and resources update without reinstall apk.

License: Other

Java 96.71% IDL 0.03% Groovy 3.24% Shell 0.02%

tinker's Introduction

Tinker

license Release Version PRs Welcome

Tinker is a hot-fix solution library for Android, it supports dex, library and resources update without reinstalling apk.

tinker.png

Getting started

Add tinker-gradle-plugin as a dependency in your main build.gradle in the root of your project:

buildscript {
    dependencies {
        classpath ('com.tencent.tinker:tinker-patch-gradle-plugin:1.6.1')
    }
}

Then you need to "apply" the plugin and add dependencies by adding the following lines to your app/build.gradle.

dependencies {
    //optional, help to generate the final application 
    compile('com.tencent.tinker:tinker-android-anno:1.6.1')
    //tinker's main Android lib
    compile('com.tencent.tinker:tinker-android-lib:1.6.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 Application class, make it a subclass of TinkerApplication. 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:

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 tinker-android-anno to generate your Application is recommended, you just need to add an annotation for your SampleApplicationLike class

@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.

Known Issues

There are some issues which Tinker can't dynamic update.

  1. Update AndroidManifest.xml, such as add Android Component.
  2. Do not support some Samsung models with os version android-19.
  3. Due to Google Play Developer Distribution Agreement, we can't dynamic update our apk.

Support

Any problem?

  1. Learn more from tinker-sample-android.
  2. Read the source code.
  3. Read the wiki or FAQ for help.
  4. Contact us for help.

Contributing

For more information about contributing issues or pull requests, see our Tinker Contributing Guide.

License

Tinker is under the BSD license. See the LICENSE file for details.

tinker's People

Contributors

dodola avatar shwenzhang avatar tys282000 avatar wanghanlin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.