Nuwa:热修复你的 Android 应用

jopen 9年前
Nuwa,采用纯Java实现,能够热修复你的Android应用。利用它来修复你的android应用程序,可以不需要发布一个新的APK到应用商店。

特性

  • Support both dalvik and art runtime.
  • Support productFlavor and buildType.
  • Support proguard and multidex.
  • Pure java implementation.

运行示例 

  1. inmasterbranch, run and install the app.

    it shows『hello world』.

  2. copy sample/build/outputs/nuwa dir to somewhere for later use.

    for example: /Users/jason/Documents/nuwa

  3. change tobugfixbranch, run the following command in terminal to generate patch.jar.

    ./gradlew clean nuwaQihooDebugPatch -P NuwaDir=/Users/jason/Documents/nuwa

    java verison must be same using android studio and terminal

  4. run following command to push patch.jar to sdcard.

    adb push sample/build/outputs/nuwa/qihoo/debug/patch.jar /sdcard/

  5. restart your application (kill the process).

    it shows『patch success』.

Integration

Get Gradle Plugin

  1. add following to the build.gradle of your root project.

    classpath 'cn.jiajixin.nuwa:gradle:1.2.1'

    build.gradle maybe look like this:

    buildscript {      repositories {          jcenter()      }      dependencies {          classpath 'com.android.tools.build:gradle:1.2.3'          classpath 'cn.jiajixin.nuwa:gradle:1.2.1'      }  }
  2. add following to your build.gradle: >apply plugin: "cn.jiajixin.nuwa"

Get Nuwa SDK

  • gradle dependency:

    dependencies {      compile 'cn.jiajixin.nuwa:nuwa:1.0.0'  }

项目主页:http://www.open-open.com/lib/view/home/1447378656882