Skip to content
HighCapablePublic

Latest commit

 

History

1,532 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yuki Hook

GitHub license Telegram Telegram Telegram QQ

LOGO

A modern hook API and Xposed module solution.

English | 简体中文

LOGO HighCapable

This project belongs to the organization above. Click the link to follow us and discover more awesome projects.

What's this

This project was originally created to provide a standard and well-defined hook API to replace XposedHelpers, which was defined by Rovo89 on Android and is no longer very modern. Now, it aims to be a hook API and to bring a unified development experience to Xposed modules, no matter which underlying hook solution you are using.

The project icon is redrawn by MaiTungTM and the name is taken from Yuki Kurihara, the heroine of the anime 「ももくり」, and it was formerly the Innocent Xposed API used in this project.

YukiHook has been renamed from YukiHookAPI with a modern rewrite of its underlying implementation, and it will continue to evolve and be maintained as a general hook API and Xposed module solution for Android.

Why YukiHook?

Previously, when developing an Xposed module, we first had to create an xposed_init file under assets, then fill in our entry class name manually and use XposedHelpers to implement our hook logic. Since Kotlin became the main language for Android development, this API is no longer very modern to use.

Is there a useful, lightweight and modern solution? With this idea in mind, YukiHook was born. Now, we only need to write one set of hook code, and YukiHook takes care of the entry files and module configuration for different base modules.

With Kotlin's modern DSL syntax and the syntactic sugar provided by YukiHook, your hook logic can be cleaner and clearer.

The following example

object HookEntry : YukiHookXposedModule {

    override fun onHook() = encase {
        loadApp("io.github.myapp") {
            // Use Java native reflection to get.
            val onCreate = Activity::class.java.getDeclaredMethod(
                "onCreate", Bundle::class.java
            )
            // Use KavaRef to get.
            val onCreate = Activity::class.resolve().firstMethod {
                name = "onCreate"
                parameters(Bundle::class)
            }

            onCreate.hook {
                before {
                    // Your code here.
                }
                after {
                    // Your code here.
                }
            }
        }
    }
}
LOGO KavaRef

🚀 Not a fan of the native Java reflection API? YukiHook now uses KavaRef as a modern reflection API. Click the link above to get started.

Get Started

LOGO YukiHook Documentation

You can go to the documentation page for more detailed tutorials and content.

What's next?

  1. Add dependencies: Add yukihook-core, yukihook-compiler and one base module to your project.
  2. Create the entry class: Implement YukiHookXposedModule and add the entry annotation that matches your base module.
  3. Build the project: The entry class and configuration files of the module are generated at compile time, and you can start hooking.

In the opened page, select the Quick Start section in the sidebar to continue reading.

Migrating from other Hook APIs? Please read Migration to YukiHook.

Exploring New Version

YukiHook 2.x is being rebuilt on the 2.x branch, you can click here to follow its development progress.

Adopters

You can go to here to see the projects that are currently using YukiHook.

More Projects

Hey, wait a second! 👋

If this project was helpful, why not stick around and check out more of my work below?

Feel free to leave a follow or a star ⭐️ if they bring you value!

Star History

Star History Chart

Third-Party Open Source Usage Statement

License

Apache License Version 2.0

Copyright (C) 2019 HighCapable

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Copyright © 2019 HighCapable

Releases

Packages

Used by

Contributors

Languages