Skip to content

Instantly share code, notes, and snippets.

@tylertreat
Created December 31, 2014 21:27
Show Gist options
  • Select an option

  • Save tylertreat/9931eeff6e5feab2b682 to your computer and use it in GitHub Desktop.

Select an option

Save tylertreat/9931eeff6e5feab2b682 to your computer and use it in GitHub Desktop.
MyClass myClass = new MyClass();
MyClass proxy = ProxyBuilder.forClass(MyClass.class)
.dexCache(getInstrumentation().getTargetContext().getDir("dx", Context.MODE_PRIVATE))
.handler(new HelloWorldInvocationHandler(myClass))
.build();
proxy.foo(42); // "Hello World" is printed and then 42 is passed to foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment