First, you should experiment with the class in your package. If it works, then try to set the class in android.jar in this way.
The class you set is the class in android.jar. The setting method may not appear in your apk, so it may be useless. Click here for detailed explanation
Hello.
First time user of AndroidAOP.
I am trying to get AndroidAOP to work but I am unsure of how it works.
I have applied the plugin as specified with it being enabled, build log shows weaving happening.
I have tried \@AndroidAOPMatchClass and \@AndroidAOPReplaceClass to no avail.
I am trying to get it to output a log message when it intercepts the method.
Code is below.
import android.util.Log; import com.flyjingfish.android_aop_annotation.anno.AndroidAopReplaceClass; import com.flyjingfish.android_aop_annotation.anno.AndroidAopReplaceMethod; @AndroidAopReplaceClass( "android.app.ActivityThread" ) public class CameraSpoofer { @AndroidAopReplaceMethod( "android.app.ActivityThread currentOpPackageName()" ) public static String currentOpPackageName() { Log.d("Test", "Test"); return "different.package.name"; } @AndroidAopReplaceMethod( "android.app.ActivityThread currentPackageName()" ) public static String currentPackageName() { Log.d("Test2", "Test2"); return "different.package.name"; } }
I am on Windows 11 using Android Studio Jellyfish | 2023.3.1
What am I doing wrong?