A hotfix library for Android
Aceso is a Android HotFix by optimizing the AOSP's "InstantRun HotSwap" solution, it is used to fix online bugs without a new APK publish.
1.Add below codes in the outest project's build.gradle file
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.mogujie.aceso:aceso-build:0.0.3'
}
}2.Add below codes in the module's build.gradle
apply plugin: 'AcesoHost'
dependencies {
compile 'com.mogujie.aceso:aceso-android-lib:0.0.1'
}
Add below codes once you need aceso for Debug version.
Aceso {
instrumentDebug = true
}3.Add below codes at the place after HotFix downloaded and Application's onAttachedBaseContext() or onCreate()
new Aceso().installPatch(optDir, patchFile);4.Pls. reserve the file folder "build/intermediates/aceso" under module directory at each HotFix publishment.
1.An additional Fix project is needed(pls. refer to aceso-demo-fix)
2.Pls. add below codes in the outest prject's build.gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.mogujie.aceso:aceso-build:0.0.3'
}
}3.Pls. add below codes in the module's build.gradle:
…4.Pls copy the class to be fixed to Fix project, and reserve the package name, e.g., the class to be fixed named com.mogujie.aceso.demo.MainActivity, the MainActivity in fix project should reserve the package name as com.mogujie.aceso.demo.MainActivity.
5.Fix you bug in Fix project.
6.Pls. add @FixMtd above the method to be fixed once methodLevelFix is set.
7.Execute command gradle acesoRelease(or acesoDebug) to generate the patch package, the patch would be generated under directory build/outputs/apk
8.Deploy the patch to the target phones.
1.Compile and install aceso-demo, press the test button, the 'not fix' would be displayed
2.Execute command gradle acesoRelease(or acesoDebug) in project 'aceso-demo-fix'
3.Use adb push command to push the apk generated to path '/sdcard/fix.apk'
4.Press fix button on the phone
5.Press test button, the 'has been fixed' would be displayed!
Aceso is under the Apache 2.0 license.
No open issues yet, or sync has not completed.