### Create Method Hooks with HookFactory (New libXposed API) in Kotlin Source: https://context7.com/kyuubiran/ezxhelper/llms.txt Demonstrates creating method hooks using HookFactory with the newer libXposed API. The API is similar to the classic Xposed API, supporting before and after callbacks, method replacement, and custom priorities. It also includes examples for accessing hook parameters and unhooking. ```kotlin import io.github.kyuubiran.ezxhelper.core.finder.MethodFinder import io.github.kyuubiran.ezxhelper.xposed.dsl.HookFactory.`-Static`.createHook import io.github.libxposed.api.XposedInterface import android.util.Log // Find method val method = MethodFinder.fromClass("com.target.MainActivity") .filterByName("checkPremium") .first() // Create hook (API is similar to API 82) val unhook = method.createHook { before { param -> // param is BeforeHookParam in API 100 // Access: param.thisObject, param.args, param.method Log.d("Hook", "checkPremium called") } after { param -> // param is AfterHookParam // Can modify param.result Log.d("Hook", "Result: ${param.result}") } } // Replace method method.createHook { replace { param -> true // Premium always enabled } } // With custom priority method.createHook(priority = XposedInterface.PRIORITY_HIGHEST) { before { param -> param.result = true // Skip original, return true } } // Unhook unhook.unhook() ``` -------------------------------- ### Initialize EzXposed and Handle Package Loading in Xposed Module (Kotlin) Source: https://context7.com/kyuubiran/ezxhelper/llms.txt This snippet shows the main entry point for an Xposed module using EzXHelper. It initializes EzXposed, sets up logging, and delegates hook initialization to other classes. It targets a specific package and includes error handling for hook initialization. ```kotlin package com.example.mymodule import de.robv.android.xposed.IXposedHookLoadPackage import de.robv.android.xposed.IXposedHookZygoteInit import de.robv.android.xposed.callbacks.XC_LoadPackage import io.github.kyuubiran.ezxhelper.xposed.EzXposed import io.github.kyuubiran.ezxhelper.android.logging.Logger const val TARGET_PACKAGE = "com.target.app" class MainHook : IXposedHookLoadPackage, IXposedHookZygoteInit { override fun initZygote(startupParam: IXposedHookZygoteInit.StartupParam) { EzXposed.initZygote(startupParam) } override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { if (lpparam.packageName != TARGET_PACKAGE) return // Initialize EzXHelper EzXposed.initHandleLoadPackage(lpparam) Logger.tag = "MyModule" Logger.i("Hooking $TARGET_PACKAGE") // Initialize hooks try { PremiumHook.init() AdsHook.init() UIHook.init() } catch (e: Exception) { Logger.e("Failed to initialize hooks", e) } } } ``` -------------------------------- ### Java Method Hooking with EzXHelper Source: https://context7.com/kyuubiran/ezxhelper/llms.txt Demonstrates how to use EzXHelper's static methods in Java to find methods and create method hooks. It covers creating MethodFinders, filtering methods by name and parameters, and setting up before, after, or combined hooks with optional priorities. Dependencies include EzXHelper core and Xposed DSL. ```java import io.github.kyuubiran.ezxhelper.core.finder.MethodFinder; import io.github.kyuubiran.ezxhelper.xposed.dsl.HookFactory; import android.app.Application; public class ExampleJavaHook { public void init() { // Create MethodFinder var finder = MethodFinder.fromClass(Application.class); // Find method with chained filters var onCreate = finder.filterByName("onCreate") .filterEmptyParam() .first(); // Create hook using static factory methods HookFactory.createMethodHook(onCreate, hookFactory -> { hookFactory.before(param -> { System.out.println("Before onCreate"); }); hookFactory.after(param -> { System.out.println("After onCreate"); }); }); // Create before-only hook HookFactory.createMethodBeforeHook(onCreate, param -> { System.out.println("Only before"); }); // Create after-only hook with priority HookFactory.createMethodAfterHook( /* priority */ 100, onCreate, param -> System.out.println("High priority after") ); } } ``` -------------------------------- ### Create Method Hooks with HookFactory (Classic Xposed API) in Kotlin Source: https://context7.com/kyuubiran/ezxhelper/llms.txt Illustrates how to create method hooks using the DSL-style HookFactory for the classic Xposed API. It covers before and after callbacks, replacing methods entirely, returning constant values, interrupting methods, and setting custom priorities. It also shows how to hook multiple methods at once and unhook them. ```kotlin import io.github.kyuubiran.ezxhelper.core.finder.MethodFinder import io.github.kyuubiran.ezxhelper.xposed.dsl.HookFactory.`-Static`.createHook import io.github.kyuubiran.ezxhelper.xposed.dsl.HookFactory.`-Static`.createBeforeHook import io.github.kyuubiran.ezxhelper.xposed.dsl.HookFactory.`-Static`.createAfterHook import de.robv.android.xposed.XC_MethodHook import android.util.Log import android.app.Application // Find the method to hook val method = MethodFinder.fromClass(Application::class) .filterByName("onCreate") .filterEmptyParam() .first() // Create hook with before and after callbacks val unhook = method.createHook { before { param -> // Called before original method // param.thisObject - the instance being hooked // param.args - method arguments array Log.i("Hook", "onCreate() called on ${param.thisObject}") } after { param -> // Called after original method returns // param.result - return value (null for void methods) Log.i("Hook", "onCreate() finished") } } // Create before-only hook val beforeUnhook = method.createBeforeHook { param -> Log.i("Hook", "Before onCreate()") } // Create after-only hook val afterUnhook = method.createAfterHook { param -> Log.i("Hook", "After onCreate()") } // Replace method entirely val loginMethod = MethodFinder.fromClass("com.app.Auth") .filterByName("checkLicense") .first() loginMethod.createHook { replace { param -> // Return value replaces original method true // Always return true } } // Return constant value loginMethod.createHook { returnConstant(true) } // Interrupt method (return null) val adMethod = MethodFinder.fromClass("com.ads.AdLoader") .filterByName("loadAd") .first() adMethod.createHook { interrupt() // Method returns null immediately } // Hook with custom priority val highPriorityHook = method.createHook(priority = XC_MethodHook.PRIORITY_HIGHEST) { before { param -> // Runs before other hooks } } // Hook multiple methods at once val methods = MethodFinder.fromClass("com.app.Utils") .filterByNameStartsWith("log") .toList() methods.createHooks { before { param -> Log.d("Intercepted", "Logging method called") } } // Unhook when done unhook.unhook() ``` -------------------------------- ### Initialize EzXReflection with a ClassLoader Source: https://github.com/kyuubiran/ezxhelper/blob/3.x/README_en.md This Kotlin snippet demonstrates how to initialize the EzXReflection utility with a specific ClassLoader. This is recommended to ensure correct reflection behavior, especially when not running within the default system classloader. ```kotlin // Optional // Invoke this before use reflection utils // or it will use ClassLoader.getSystemClassLoader() by default. EzXReflection.init(yourClassLoader) ``` -------------------------------- ### Initialize EzXposed for Xposed API 100 Source: https://github.com/kyuubiran/ezxhelper/blob/3.x/README_en.md This Kotlin code illustrates the initialization process for EzXposed when using Xposed API version 100. It covers initializing the Xposed module and handling package loaded events. ```kotlin init { EzXposed.initXposedModule(xposedInterface) } override fun onPackageLoaded(param: PackageLoadedParam) { // ... EzXposed.initOnPackageLoaded(param) } ``` -------------------------------- ### Kotlin ClassUtil for Class Loading and Static Operations Source: https://context7.com/kyuubiran/ezxhelper/llms.txt Provides utility functions in Kotlin for loading classes, accessing static fields, and invoking static methods using EzXHelper's ClassUtil. It supports null-safe loading, searching through superclasses, and best-match invocation based on provided arguments. Dependencies include EzXHelper core utilities. ```kotlin import io.github.kyuubiran.ezxhelper.core.util.ClassUtil // Load class with null safety val clazz = ClassUtil.loadClass("com.example.MyClass") // Throws if not found val clazzOrNull = ClassUtil.loadClassOrNull("com.example.MayNotExist") // Returns null // Load first existing class from multiple candidates val configClass = ClassUtil.loadFirstClass( "com.example.ConfigV2", "com.example.ConfigV1", "com.example.Config" ) // Get static field value val instance = ClassUtil.getStaticObject(clazz, "INSTANCE") val instanceOrNull = ClassUtil.getStaticObjectOrNull(clazz, "sInstance") // Get static field searching superclasses val value = ClassUtil.getStaticObjectUntilSuperclass( clazz, "TAG", untilSuperClass = { this == Any::class.java } // Stop condition ) // Set static field ClassUtil.setStaticObject(clazz, "sDebugMode", true) // Invoke static method with best-match parameters val result = ClassUtil.invokeStaticMethodBestMatch( clazz, "getInstance", returnType = clazz, // Expected return type, null to ignore "param1", 42 // Arguments ) // Create new instance with best-match constructor val obj = ClassUtil.newInstanceBestMatch(clazz, context, "name") // Check primitive type matching ClassUtil.isPrimitiveTypeMatch(Int::class.java, Integer::class.java) // true ClassUtil.toPrimitiveType(Integer::class.java) // Returns int.class ``` -------------------------------- ### Initialize EzXReflection for Standalone JVM Applications Source: https://context7.com/kyuubiran/ezxhelper/llms.txt This Kotlin snippet demonstrates initializing EzXReflection for non-Xposed JVM applications. It sets the default `ClassLoader` for reflection operations. If not explicitly called, it defaults to `ClassLoader.getSystemClassLoader()`. This initialization is optional when using `xposed-api-*` modules as they handle it automatically. ```kotlin import io.github.kyuubiran.ezxhelper.core.EzXReflection // For standalone JVM usage (without Xposed) // Set default ClassLoader for reflection operations EzXReflection.init(MyApplication::class.java.classLoader) // If not called, defaults to ClassLoader.getSystemClassLoader() // This is optional when using xposed-api-* modules as they call it automatically ``` -------------------------------- ### ClassHelper and ObjectHelper - Kotlin Wrapper Classes Source: https://context7.com/kyuubiran/ezxhelper/llms.txt Provides `ClassHelper` and `ObjectHelper` for simplified static and instance operations on classes and objects, respectively. Supports direct instantiation, field access, method invocation, and block syntax for cleaner code. No external dependencies beyond standard Kotlin/Java reflection. ```kotlin import io.github.kyuubiran.ezxhelper.core.helper.ClassHelper import io.github.kyuubiran.ezxhelper.core.helper.ClassHelper.`-Static`.classHelper import io.github.kyuubiran.ezxhelper.core.helper.ObjectHelper import io.github.kyuubiran.ezxhelper.core.helper.ObjectHelper.`-Static`.objectHelper // ClassHelper - static operations val helper = MyClass::class.java.classHelper() val instance = helper.getStaticObject("INSTANCE") helper.setStaticObject("sDebug", true) val result = helper.invokeStaticMethodBestMatch("create", null, context) val newObj = helper.newInstanceBestMatch(context, "name") // Block syntax for ClassHelper MyClass::class.java.classHelper { val tag = getStaticObject("TAG") as String setStaticObject("sEnabled", true) invokeStaticMethodBestMatch("init") } // ObjectHelper - instance operations val objHelper = myObject.objectHelper() val context = objHelper.getObject("mContext") as Context objHelper.setObject("mCallback", newCallback) val processResult = objHelper.invokeMethodBestMatch("process", String::class.java, "input") // Block syntax for ObjectHelper myObject.objectHelper { val handler = getObject("mHandler") as Handler setObject("mListener", newListener) invokeMethodBestMatch("refresh") } // Return value from block val fieldValue = myObject.objectHelper { getObjectOrNull("mValue") } ``` -------------------------------- ### Block Ad Loading using EzXHelper MethodFinder (Kotlin) Source: https://context7.com/kyuubiran/ezxhelper/llms.txt This Kotlin snippet demonstrates how to block ad loading in an Xposed module using EzXHelper. It identifies common ad-related class names and uses MethodFinder to locate methods containing 'load' (case-insensitive). It then applies hooks to these methods to interrupt their execution, effectively preventing ads from loading. ```kotlin package com.example.mymodule import io.github.kyuubiran.ezxhelper.core.finder.MethodFinder import io.github.kyuubiran.ezxhelper.xposed.dsl.HookFactory.`-Static`.createHook import io.github.kyuubiran.ezxhelper.core.util.ClassUtil object AdsHook { fun init() { // Block ad loading val adClasses = listOf( "com.target.app.ads.AdManager", "com.google.android.gms.ads.AdLoader" ) for (className in adClasses) { val clazz = ClassUtil.loadClassOrNull(className) ?: continue MethodFinder.fromClass(clazz) .filterByNameContains("load", ignoreCase = true) .toList() .forEach { it.createHook { interrupt() // Return null/void immediately } } } } } ``` -------------------------------- ### Add EzXHelper Dependencies to build.gradle.kts Source: https://github.com/kyuubiran/ezxhelper/blob/3.x/README_en.md This snippet demonstrates how to include the EzXHelper core, Xposed API (version 82 or 100), and Android utility extensions in your build.gradle.kts file. Ensure you replace '' with the correct EzXHelper version. ```kotlin dependencies { val ezxhelperVersion = "" implementation("io.github.kyuubiran.ezxhelper:core:$ezxhelperVersion") // Xposed api 82 implementation("io.github.kyuubiran.ezxhelper:xposed-api-82:$ezxhelperVersion") // Xposed api 100 // implementation("io.github.kyuubiran.ezxhelper:xposed-api-100:$ezxhelperVersion") // If you need to use Android related utility extensions, you can include it implementation("io.github.kyuubiran.ezxhelper:android-utils:$ezxhelperVersion") } ``` -------------------------------- ### Module Resources Access - Xposed Framework - Kotlin Source: https://context7.com/kyuubiran/ezxhelper/llms.txt Provides utilities to access module resources (strings, drawables, etc.) from within hooked applications in the Xposed framework. Requires initialization of `EzXposed` and optionally setting a custom package ID in `build.gradle.kts`. Resources can be accessed after injecting the module's asset path into the hooked application's context. ```kotlin import io.github.kyuubiran.ezxhelper.xposed.EzXposed import de.robv.android.xposed.IXposedHookLoadPackage import de.robv.android.xposed.IXposedHookZygoteInit import de.robv.android.xposed.XC_LoadPackage import android.app.Activity // In build.gradle.kts, set custom resource ID to avoid conflicts: // android { // androidResources.additionalParameters( // "--allow-reserved-package-id", // "--package-id", "0x64" // Use 0x30-0x6F range // ) // } // API 82: Requires initZygote() to be called first class MainHook : IXposedHookLoadPackage, IXposedHookZygoteInit { override fun initZygote(startupParam: IXposedHookZygoteInit.StartupParam) { EzXposed.initZygote(startupParam) } override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { // ... // After hooking into an Activity's onCreate: afterActivityCreated { activity: Activity -> // Inject module resources into Activity context EzXposed.addModuleAssetPath(activity) // Now you can use module resources val text = activity.getString(R.string.module_message) val drawable = activity.getDrawable(R.drawable.module_icon) } } } // API 100: Initialize module resources after initXposedModule init { EzXposed.initXposedModule(base) EzXposed.initModuleResources() // Sets up modulePath and moduleRes } // Access module resources directly val moduleString = EzXposed.moduleRes.getString(R.string.hello) // Inject into hooked app context EzXposed.addModuleAssetPath(activityContext) ``` -------------------------------- ### Initialize EzXposed for Xposed API 82 Source: https://github.com/kyuubiran/ezxhelper/blob/3.x/README_en.md This Kotlin code snippet shows the necessary initialization calls for EzXposed when targeting Xposed API version 82. It includes initializing handleLoadPackage and optionally initZygote. ```kotlin override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { // ... EzXposed.initHandleLoadPackage(lpparam) } // Optional override fun initZygote(startupParam: IXposedHookZygoteInit.StartupParam) { EzXposed.initZygote(startupParam) } ``` -------------------------------- ### Hook Premium Check Methods using EzXHelper Finders and DSL (Kotlin) Source: https://context7.com/kyuubiran/ezxhelper/llms.txt This Kotlin snippet demonstrates how to hook methods related to premium status checks in an Xposed module using EzXHelper. It uses MethodFinder to locate specific methods by name, parameter types, and return types, and then employs the HookFactory DSL to replace method behavior or intercept calls. ```kotlin package com.example.mymodule import io.github.kyuubiran.ezxhelper.core.finder.MethodFinder import io.github.kyuubiran.ezxhelper.xposed.dsl.HookFactory.`-Static`.createHook import io.github.kyuubiran.ezxhelper.android.logging.Logger object PremiumHook { fun init() { // Find premium check method val isPremiumMethod = MethodFinder.fromClass("com.target.app.billing.PremiumManager") .filterByName("isPremium") .filterEmptyParam() .filterByReturnType(Boolean::class.java) .first() // Hook to always return true isPremiumMethod.createHook { replace { Logger.d("isPremium() called, returning true") true } } // Also hook the async version MethodFinder.fromClass("com.target.app.billing.PremiumManager") .filterByName("checkPremiumStatus") .filterByParamTypes(Function1::class.java) // Callback parameter .toList() .forEach { it.createHook { before { // Invoke callback with premium = true @Suppress("UNCHECKED_CAST") val callback = it.args[0] as Function1 callback(true) it.result = null // Skip original } } } Logger.i("Premium hooks initialized") } } ``` -------------------------------- ### Find Constructors in a Class with EZ-XHelper Source: https://context7.com/kyuubiran/ezxhelper/llms.txt Locate constructors within a specified class using a fluent API. Supports filtering by parameter count, types, and accessibility (public). Allows for flexible parameter type matching using assignable types. ```kotlin import io.github.kyuubiran.ezxhelper.core.finder.ConstructorFinder import io.github.kyuubiran.ezxhelper.core.finder.ConstructorFinder.`-Static`.constructorFinder // Create finder from class val finder = ConstructorFinder.fromClass("com.example.MyClass") // Or use extension val finder2 = MyClass::class.java.constructorFinder() // Find no-argument constructor val defaultCtor = finder .filterEmptyParam() .first() // Find constructor with specific parameter types val contextCtor = finder .filterByParamTypes(android.content.Context::class.java) .first() // Find constructor by parameter count val multiParamCtor = finder .filterByParamCount(3) .first() // Find all public constructors val publicCtors = finder .filterPublic() .toList() // Find constructor with assignable parameter types (subclass matching) val flexibleCtor = finder .filterByAssignableParamTypes( android.content.Context::class.java, // Accepts Activity, Service, etc. null // Skip checking this parameter ) .firstOrNull() ``` -------------------------------- ### Add EzXHelper Dependencies to build.gradle Source: https://github.com/kyuubiran/ezxhelper/blob/3.x/README_en.md This snippet shows how to add the EzXHelper core, Xposed API (version 82 or 100), and Android utility extensions to your project's build.gradle file. Replace '' with the actual EzXHelper version. ```groovy dependencies { def ezxhelperVersion = '' implementation "io.github.kyuubiran.ezxhelper:core:$ezxhelperVersion" // Xposed api 82 implementation "io.github.kyuubiran.ezxhelper:xposed-api-82:$ezxhelperVersion" // Xposed api 100 // implementation "io.github.kyuubiran.ezxhelper:xposed-api-100:$ezxhelperVersion" // If you need to use Android related utility extensions, you can include it implementation "io.github.kyuubiran.ezxhelper:android-utils:$ezxhelperVersion" } ``` -------------------------------- ### Find Classes with ClassFinder in Kotlin Source: https://context7.com/kyuubiran/ezxhelper/llms.txt Demonstrates how to use ClassFinder to locate classes from a collection based on package, field types, method signatures, implemented interfaces, and inheritance. It covers filtering for abstract classes and anonymous classes, as well as counting constructors and fields. ```kotlin import io.github.kyuubiran.ezxhelper.core.finder.ClassFinder // Create finder from array of classes val classes = arrayOf(String::class.java, StringBuilder::class.java, StringBuffer::class.java) val finder = ClassFinder.fromArray(classes) // Filter classes by package val filtered = finder .filterPackage("java.lang") .toList() // Find class that has specific field type val classWithHandler = finder .filterHasFieldType(android.os.Handler::class.java) .first() // Find class that has specific method signature val classWithMethod = finder .filterHasMethodSignature(String::class.java, Int::class.java) // Method returns String, takes Int .first() // Find class implementing interfaces val runnableClasses = finder .filterImplementInterfaces(Runnable::class.java, java.io.Serializable::class.java) .toList() // Find subclasses val activities = finder .filterIsSubclassOf(android.app.Activity::class.java) .filterIsNotAbstract() .toList() // Complex filtering val targetClass = finder .filterIsNotInterface() .filterIsNotEnum() .filterIsNotAnonymous() .filterHasConstructorCount(2) .filterHasMethodName("execute") .filterHasFieldTypeAndCount(String::class.java, 3) // Has exactly 3 String fields .first() ``` -------------------------------- ### Kotlin ObjectUtil for Instance Field and Method Operations Source: https://context7.com/kyuubiran/ezxhelper/llms.txt Provides utility functions in Kotlin for accessing and modifying instance fields, and invoking instance methods using EzXHelper's ObjectUtil. It supports searching fields up the class hierarchy, best-match method invocation, and explicit parameter type specification. Dependencies include EzXHelper core utilities and misc helpers. ```kotlin import io.github.kyuubiran.ezxhelper.core.util.ObjectUtil val myObject = getTargetObject() // Some object instance // Get field value val context = ObjectUtil.getObject(myObject, "mContext") as Context val contextOrNull = ObjectUtil.getObjectOrNull(myObject, "mContext") // Get field from specific class in hierarchy val fieldValue = ObjectUtil.getObject( myObject, "mPrivateField", clazz = BaseClass::class.java // Look in this specific class ) // Search field up the class hierarchy val inheritedValue = ObjectUtil.getObjectUntilSuperclass( myObject, "mHandler", untilSuperClass = { this.simpleName == "Activity" } // Stop at Activity ) // Set field value ObjectUtil.setObject(myObject, "mEnabled", true) ObjectUtil.setObjectUntilSuperclass(myObject, "mCallback", newCallback) // Invoke instance method with best-match parameters val result = ObjectUtil.invokeMethodBestMatch( myObject, "process", returnType = String::class.java, // Expected return type "input", 100 // Method arguments ) // Invoke method with explicit parameter types import io.github.kyuubiran.ezxhelper.core.misc.paramTypes import io.github.kyuubiran.ezxhelper.core.misc.params val result2 = ObjectUtil.invokeMethod( myObject, "calculate", returnType = null, paramTypes = paramTypes(Int::class.java, String::class.java), params = params(42, "test") ) ``` -------------------------------- ### Find Methods in a Class with EZ-XHelper Source: https://context7.com/kyuubiran/ezxhelper/llms.txt Locate methods within a specified class using a fluent API. Supports filtering by name, parameter types, return type, static modifiers, and abstract/final status. Can search inherited methods and filter by JVM descriptor signature. ```kotlin import io.github.kyuubiran.ezxhelper.core.finder.MethodFinder import io.github.kyuubiran.ezxhelper.core.finder.MethodFinder.`-Static`.methodFinder import android.app.Application // Create finder from a class val finder = MethodFinder.fromClass(Application::class) // Or use class name string val finder2 = MethodFinder.fromClass("android.app.Application") // Or use extension function val finder3 = Application::class.java.methodFinder() // Find onCreate() method with no parameters val onCreateMethod = finder .filterByName("onCreate") .filterEmptyParam() .first() // Throws NoSuchElementException if not found // Find method returning void with specific parameters val attachMethod = finder .filterByName("attach") .filterVoidReturnType() .filterByParamTypes(android.content.Context::class.java) .firstOrNull() // Returns null if not found // Find static methods with return type extending CharSequence val staticMethods = MethodFinder.fromClass("com.example.Utils") .filterStatic() .filterByReturnTypeExtendsFrom(CharSequence::class.java) .toList() // Find methods with complex parameter filtering val methods = finder .filterByName("process") .filterByParamCount(3) // Exactly 3 parameters .filterByParamTypes(String::class.java, null, Int::class.java) // null = skip check .filterNonAbstract() .filterNonFinal() .toList() // Search in superclasses as well val inheritedMethod = finder .filterByName("toString") .findSuper() // Include methods from superclasses .first() // Filter by parameter signature (JVM descriptor style) // "IIIZ" = (int, int, int, boolean) val signatureMethod = finder .filterByParamSignature("IIIZ") .first() ``` -------------------------------- ### Find Fields in a Class with EZ-XHelper Source: https://context7.com/kyuubiran/ezxhelper/llms.txt Locate fields within a specified class using a fluent API. Supports filtering by name, type, static modifiers, and final status. Can search inherited fields and provides direct lookup methods. ```kotlin import io.github.kyuubiran.ezxhelper.core.finder.FieldFinder import io.github.kyuubiran.ezxhelper.core.finder.FieldFinder.`-Static`.fieldFinder // Create finder from class val finder = FieldFinder.fromClass("com.example.MyClass") // Or use extension val finder2 = MyClass::class.java.fieldFinder() // Find field by exact name val contextField = finder .filterByName("mContext") .first() // Find field by name pattern val matchingFields = finder .filterByNameContains("listener", ignoreCase = true) .filterByType(android.view.View.OnClickListener::class.java) .toList() // Find static final String fields val stringConstants = finder .filterStatic() .filterFinal() .filterByType(String::class.java) .toList() // Find field by type hierarchy val callbackFields = finder .filterByTypeExtendsFrom(Runnable::class.java) .filterNonStatic() .toList() // Direct lookup methods val field = finder.firstByName("mValue") val fieldOrNull = finder.firstOrNullByType(Int::class.java) val fieldByPrefix = finder.firstByNameStartsWith("m") // Search in superclasses val inheritedField = finder .filterByName("tag") .findSuper { this == android.view.View::class.java } // Stop at View class .firstOrNull() ``` -------------------------------- ### Logger - Android Logging Utility - Kotlin Source: https://context7.com/kyuubiran/ezxhelper/llms.txt A configurable Android logging utility that allows setting a custom tag and log level to filter messages. Supports basic logging (Verbose, Debug, Info, Warning, Error) and logging exceptions. Can be extended with custom logger implementations. ```kotlin import io.github.kyuubiran.ezxhelper.android.logging.Logger import io.github.kyuubiran.ezxhelper.android.logging.ILogger // Configure logger Logger.tag = "MyXposedModule" Logger.logLevel = Logger.LogLevel.DEBUG // Filter out VERBOSE logs // Basic logging Logger.v("Verbose message") Logger.d("Debug message") Logger.i("Info message") Logger.w("Warning message") Logger.e("Error message") // Log with exception try { riskyOperation() } catch (e: Exception) { Logger.e("Operation failed", e) // Or exception first: Logger.e(e, "Operation failed") } // Custom logger implementation Logger.currentLogger = object : ILogger { override val tag: String = "CustomTag" override fun v(msg: String, thr: Throwable?) { // Custom verbose logging } override fun d(msg: String, thr: Throwable?) { /* ... */ } override fun i(msg: String, thr: Throwable?) { /* ... */ } override fun w(msg: String, thr: Throwable?) { /* ... */ } override fun e(msg: String, thr: Throwable?) { /* ... */ } } // Disable logging entirely Logger.logLevel = Logger.LogLevel.NONE ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.