A gradle plugin to erase some method in release build type
project's build.gradle:
repositories {
....
maven { url 'https://jitpack.io' }
}
classpath 'com.github.zjutkz:MethodEraser:1.0'
app or lib's build.gradle:
compile ('com.github.zjutkz:MethodEraser:0.0.11') {
exclude module: 'jsr305'
}
@Eraser
public int test() {
int a = 10;
a = a + 1;
return a;
}
you can see result in ../build/intermediates/classes/release/..
@Eraser
public int test() {
return 1;
}