Skip to content
LaurieWired edited this page Jul 13, 2023 · 15 revisions

ARTful Overview

ARTful is an open-source tool that allows users to manipulate the Android runtime. It works by hooking ArtMethod objects for two specified methods and swapping their values to entirely overwrite the target

"targetMethod" is the destination method that will be replaced. "newMethod" is the method whose code will actually be executed anytime a call to targetMethod is made after swapping.

Method signatures must match and methods must be static

Hooking Via Object

Example:

MainActivity.class.getDeclaredMethod("maliciousMethod")

Hooking Via Method Signature

JNI Signature Reference

Example:

replaceAppMethodBySignature("com/app/artful/MainActivity", "benignMethod", "()Ljava/lang/String;")

Replacing Android Framework Methods

You can replace any static method located inside the Android Framework with your own method inside of your app. A pre-coded list of multiple Android APIs that ARTful can automatically replace can be found below. If you would like to replace one not already added to ARTful, you could instead call the replaceAppMethodBySignature or replaceAppMethodByObject methods and simply pass in the references to the Android Framework method.

Clone this wiki locally