GithubHelp home page GithubHelp logo

hotfix's Introduction

HotFix热修复

Tinker:https://github.com/Tencent/tinker

image

1、Tinker搭配的这些,目前没发现啥问题:

minsdk <=21、 targetsdk 33、 android gradle plugin 7.4.2、 Gradle 7.5.1、 R8 4.0.71

2、tinkerId 和new tinkerId 需要不一样

configField("TINKER_ID", ""tinker_id_${getTinkerIdValue()}"") // tinkerId 可以设为项目的versionName作为基准,有一个小细节是必须以**tinker_id_**开头,不然会报错

configField("NEW_TINKER_ID", ""${releaseTime()}"") // new tinkerId 可以设为项目的打包时间,不断更新

image

3、如何打patch包:

2020031816064317

4、把patch包拖拽到AS查看信息:

1704877292982

5、测试时把补丁推送到应用私有目录,也可以放到assets中copy到私有目录

adb push “patch文件的路径” /storage/emulated/0/Android/data/包名/files/

6、查看打补丁包的过程,可以利用logcat 筛选tag是 Tinker. 的信息。如果出现如下图说明打补丁成功,打补丁过程较长,自测多次需要90s左右

image

7、打包监听返回的状态

//patch listener error code

public static final int ERROR_PATCH_OK                = 0;

public static final int ERROR_PATCH_DISABLE           = -1;

public static final int ERROR_PATCH_NOTEXIST          = -2;

public static final int ERROR_PATCH_RUNNING           = -3;

public static final int ERROR_PATCH_INSERVICE         = -4;

public static final int ERROR_PATCH_JIT               = -5;

public static final int ERROR_PATCH_ALREADY_APPLY     = -6;

hotfix's People

Contributors

gaoleicoding avatar

Stargazers

 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.