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.
运行示例
-
inmasterbranch, run and install the app.
it shows『hello world』.
-
copy sample/build/outputs/nuwa dir to somewhere for later use.
for example: /Users/jason/Documents/nuwa
-
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
-
run following command to push patch.jar to sdcard.
adb push sample/build/outputs/nuwa/qihoo/debug/patch.jar /sdcard/
-
restart your application (kill the process).
it shows『patch success』.
Integration
Get Gradle Plugin
-
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' } }
- 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' }