YukiHookAPI - An efficient Kotlin version of the Xposed Hook API

Last update: Jun 19, 2022

Yuki Hook API

Eclipse Marketplace Eclipse Marketplace Eclipse Marketplace
🔥 An efficient Kotlin version of the Xposed Hook API.

Introduce

Get Startted

  • 敬请期待...

License

MIT License

Copyright (C) 2022 HighCapable

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

GitHub

https://github.com/fankes/YukiHookAPI
You might also like...

New version of my Android app that shows you popular movies using themoviedb.org API.

New version of my Android app that shows you popular movies using themoviedb.org API.

New version of my Android app that shows you popular movies using themoviedb.org API. Using Modern Android Develpment skills like Kotlin, Room, Retrofit, Hilt, coroutines, Flow and Jetpack Compose.

Apr 21, 2022

An library to help android developers working easly with activities and fragments (Kotlin version)

An library to help android developers working easly with activities and fragments (Kotlin version)

AFM An library to help android developer working easly with activities and fragments (Kotlin) Motivation Accelerate the process and abstract the logic

Sep 3, 2020

Freegemas libGDX is an Android and Java desktop port of Freegemas, which in turn is an open source version of the well known Bejeweled.

Freegemas libGDX is an Android and Java desktop port of Freegemas, which in turn is an open source version of the well known Bejeweled.

freegemas-gdx Freegemas libGDX is an Android, HTML 5 and Java desktop port of Freegemas, which in turn is an open source version of the well known Bej

Jun 21, 2022

Freegemas libGDX is an Android and Java desktop port of Freegemas, which in turn is an open source version of the well known Bejeweled.

Freegemas libGDX is an Android and Java desktop port of Freegemas, which in turn is an open source version of the well known Bejeweled.

freegemas-gdx Freegemas libGDX is an Android, HTML 5 and Java desktop port of Freegemas, which in turn is an open source version of the well known Bej

Feb 13, 2022

An unofficial version of the Android library for the Muse EEG headset

libmuse NOTE: This is an unofficial version of the Android library for interfacing with the Muse EEG headset. The Muse headset is a research-grade, lo

Apr 12, 2022

The simplest version of a notepad application with the feature to save pictures on a note.

PhotoNotePad Easy to write, read and organize notes with photo(s). Feature A note has... title content date color pin images Easy to write a note. Pro

Dec 5, 2021

SyncPlay - The unofficial Syncplay client for Android. Works with the Desktop version of Syncplay

About SyncPlay BETA: The unofficial Syncplay client for Android. Works with the

Jun 19, 2022

The unofficial Syncplay client for Android. Works with the Desktop version of Syncplay !

SyncPlay BETA: About Syncplay BETA: This is the UNOFFICIAL Syncplay client for Android. If you don't know Syncplay, have a look here: https://syncplay

Jun 19, 2022

Archive of the latest version of "Android vShell" app.

vShell vShell (Virtual Shell) — a successor of Termux project which provides an alternate implementation of the Linux terminal emulator for Android OS

Mar 22, 2022
Comments
  • 1. Prefs相关问题

    在Activity中,使用以下代码保存配置。

    val strongMode = sharedPreferences.getBoolean("strong_mode", false)
    modulePrefs.putBoolean("strong_mode", strongMode)
    

    保存后,在Activity中再使用modulePrefsgetBoolean方法进行检查,发现设置已经保存。

    但是在hook中,prefs.getBoolean始终返回默认值false,perfs.all返回为空。

    Target API 32,运行系统API 31,已经按照文档中说明进行配置,也参考了demo中的代码,使用PrefsData问题依然出现,使用String进行数据保存问题依旧。

    请问是我用法不对,还是这是一个bug。

    Reviewed by mahoshojoHCG at 2022-04-17 06:05
  • 2. Simply support initZygote

    The data structure of IXposedHookZygoteInit.StartupParam is very simple, therefor data wrapper is not created.

    Been handled together, relax superclass restriction of proxy class (hook entry) to meet the complex customization needs of users.

    Reviewed by ApeaSuperz at 2022-04-11 01:37
  • 3. Added getField & setField function

    假如需要修改自定义类型实例(innerClassInstance)中的变量(testString)

    class HookedClass {
        inner class TestClass(){
            val testString = "String Content"
        }
        private val innerClassInstance = TestClass()
    }
    

    根据我已了解到的YukiHookAPI用法,我会这样写:

    val innerClassInstance = field { name = "innerClassInstance" }.get(instance).any()
    innerClassInstance.javaclass.field { name = "testString" }.get(innerClassInstance).set("another String")
    

    如果需要设置innerClassInstance中的很多变量就会感觉很麻烦,要写多个innerClassInstance.javaclass,加上这个commit后就可以写成:

    val mField =  instance.getField("innerClassInstance").any()
    mField.setField("testString", "another String")
    

    这样如果需要设置innerClassInstance中的多个变量,就可以多写几个mField.setField()。而且直接对实例操作也会看起来更直观。 按照这个commit的写法,只能对 field 名称这个单一条件进行搜索,不过这个可以后续优化 我是YukiHookAPI的新手,如果已有类似简便的写法,也请麻烦告诉我一下 :-)

    Reviewed by GSWXXN at 2022-05-14 15:46
  • 4. [bug]在windows下无法识别路径,无法正常编译

    在win下无法识别路径,编译失败。在linux下可正常编译。

    test项目 MIUINativeNotifyIcon

    > Task :app:kspDebugKotlin FAILED
    e: [ksp] [YukiHookAPI] Project Source Path "src\main" not matched
    Looking for help? see https://github.com/fankes/YukiHookAPI/wiki/%E4%BD%9C%E4%B8%BA-Xposed-%E6%A8%A1%E5%9D%97%E4%BD%BF%E7%94%A8%E7%9A%84%E7%9B%B8%E5%85%B3%E9%85%8D%E7%BD%AE
    e: [ksp] java.lang.RuntimeException: [YukiHookAPI] Project Source Path "src\main" not matched
    Looking for help? see https://github.com/fankes/YukiHookAPI/wiki/%E4%BD%9C%E4%B8%BA-Xposed-%E6%A8%A1%E5%9D%97%E4%BD%BF%E7%94%A8%E7%9A%84%E7%9B%B8%E5%85%B3%E9%85%8D%E7%BD%AE
            at com.highcapable.yukihookapi_ksp_xposed.YukiHookXposedProcessor$create$1.error(YukiHookXposedProcessor.kt:89)
            at com.highcapable.yukihookapi_ksp_xposed.YukiHookXposedProcessor$create$1.access$error(YukiHookXposedProcessor.kt:49)
            at com.highcapable.yukihookapi_ksp_xposed.YukiHookXposedProcessor$create$1$injectAssets$1.invoke(YukiHookXposedProcessor.kt:172)
            at com.highcapable.yukihookapi_ksp_xposed.YukiHookXposedProcessor$create$1$injectAssets$1.invoke(YukiHookXposedProcessor.kt:162)
            at com.highcapable.yukihookapi_ksp_xposed.YukiHookXposedProcessor$create$1.environment(YukiHookXposedProcessor.kt:78)
            at com.highcapable.yukihookapi_ksp_xposed.YukiHookXposedProcessor$create$1.environment$default(YukiHookXposedProcessor.kt:76)
            at com.highcapable.yukihookapi_ksp_xposed.YukiHookXposedProcessor$create$1.injectAssets(YukiHookXposedProcessor.kt:162)
            at com.highcapable.yukihookapi_ksp_xposed.YukiHookXposedProcessor$create$1.access$injectAssets(YukiHookXposedProcessor.kt:49)
            at com.highcapable.yukihookapi_ksp_xposed.YukiHookXposedProcessor$create$1$injectProcess$1.invoke$lambda-4$fetchKSClassDeclaration(YukiHookXposedProcessor.kt:119)
            at com.highcapable.yukihookapi_ksp_xposed.YukiHookXposedProcessor$create$1$injectProcess$1.invoke(YukiHookXposedProcessor.kt:148)
            at com.highcapable.yukihookapi_ksp_xposed.YukiHookXposedProcessor$create$1$injectProcess$1.invoke(YukiHookXposedProcessor.kt:107)
            at com.highcapable.yukihookapi_ksp_xposed.YukiHookXposedProcessor$create$1.environment(YukiHookXposedProcessor.kt:78)
            at com.highcapable.yukihookapi_ksp_xposed.YukiHookXposedProcessor$create$1.environment$default(YukiHookXposedProcessor.kt:76)
            at com.highcapable.yukihookapi_ksp_xposed.YukiHookXposedProcessor$create$1.injectProcess(YukiHookXposedProcessor.kt:107)
            at com.highcapable.yukihookapi_ksp_xposed.YukiHookXposedProcessor$create$1.process(YukiHookXposedProcessor.kt:99)
            at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension$doAnalysis$4$1.invoke(KotlinSymbolProcessingExtension.kt:195)
            at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension$doAnalysis$4$1.invoke(KotlinSymbolProcessingExtension.kt:193)
            at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.handleException(KotlinSymbolProcessingExtension.kt:287)
            at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.doAnalysis(KotlinSymbolProcessingExtension.kt:193)
            at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:120)
            at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:96)
            at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:262)
            at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:53)
            at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:113)
            at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:253)
            at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:100)
            at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli$default(KotlinToJVMBytecodeCompiler.kt:58)
            at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:170)
            at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:52)
            at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:92)
            at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44)
            at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98)
            at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1618)
            at jdk.internal.reflect.GeneratedMethodAccessor97.invoke(Unknown Source)
            at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.base/java.lang.reflect.Method.invoke(Method.java:564)
            at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
            at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
            at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
            at java.base/java.security.AccessController.doPrivileged(AccessController.java:691)
            at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
            at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:587)
            at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828)
            at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:705)
            at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
            at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704)
            at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
            at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
            at java.base/java.lang.Thread.run(Thread.java:832)
    
    e: Error occurred in KSP, check log for detail
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':app:kspDebugKotlin'.
    > Compilation error. See log for more details
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    
    * Get more help at https://help.gradle.org
    
    BUILD FAILED in 1s
    14 actionable tasks: 1 executed, 13 up-to-date
    
    Reviewed by naicfeng at 2022-02-17 04:00
Related tags
AnyText - An Xposed module trying to hook TextView in any activities

AnyText What's this This application provides features to modify any TextView in

Jun 8, 2022
An inline hook library for Android apps.

android-inline-hook README 中文版 shadowhook is an inline hook library for Android apps. shadowhook is a module of "the android-inline-hook project". Fea

Jun 14, 2022
A general purpose kotlin library that use kotlin coroutines, flows and channels to provide timer features with the most easy and efficient way

Timer Timer is a general purpose kotlin library that use kotlin coroutines, flows and channels to provide timer features with the most easy and effici

Feb 13, 2022
A simple xposed module that helps you use your AdGuard subscription in multiple devices

DualGuard A simple xposed module that helps you use your AdGuard subscription in multiple (>3) devices. Monstor ahead! / 警告 This is NOT a module that

Jun 10, 2022
SIMNumberSetter - A small Xposed module to set the SIM card's phone subscriber number
SIMNumberSetter - A small Xposed module to set the SIM card's phone subscriber number

SIM Number Setter SIM Number Setter is a small Xposed module that invokes normal

Jun 11, 2022
Xposed module for Snapchat.

SnapMod Xposed module for Snapchat. Setup To set SnapMod up, download and install the latest apk from here. When you open it, it will ask to install s

Jun 16, 2022
Media Provider Manager - An Xposed module intended to prevent media storage abuse
Media Provider Manager - An Xposed module intended to prevent media storage abuse

Media Provider Manager - An Xposed module intended to prevent media storage abuse

Jun 16, 2022
Mixed Xposed+Magisk module for customization of AOSP-based Android 12+
Mixed Xposed+Magisk module for customization of AOSP-based Android 12+

This is a mixed Xposed+Magisk module, which is made to allow customizations that are not originally designed in AOSP (Android Open Source Project).

Jun 21, 2022
An efficient GitHub profile app, written in Kotlin!
An efficient GitHub profile app, written in Kotlin!

GitPositive An efficient GitHub profile app, written in Kotlin! GitPositive aims to be a simple and efficient GitHub profile app, following the princi

May 23, 2022
This project is focused on the sample using the API's new preview version of Android-L, use of transitions, shadows etc...

Android L preview example Description This project is focused on the sample using the API's new preview version of Android-L, use of transitions, shad

Jul 26, 2021