I am trying to instrument OkHttpClient builder class. However, I am not able to create ClassReader
in the first place.
import org.objectweb.asm.ClassReader;
...
// this works meaning dependency from gradle is satisfied
okhttp3.OkHttpClient.Builder test = new okhttp3.OkHttpClient.Builder();
...
// but this fails with java.io.IOException: Class not found
ClassReader cr = new ClassReader("okhttp3.OkHttpClient.Builder");
Assuming this is even possible, is there a way to achieve this? My intention is to insert an interceptor to the build()
method of Builer
class.