mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-08 19:44:16 +08:00
Added new documentations files
This commit is contained in:
33
docs-source/src/en/about/about.md
Normal file
33
docs-source/src/en/about/about.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# About this document
|
||||
|
||||
> This document is powered by [VuePress](https://v2.vuepress.vuejs.org/en).
|
||||
|
||||
## License
|
||||
|
||||
[The MIT License (MIT)](https://github.com/fankes/YukiHookAPI/blob/master/LICENSE)
|
||||
|
||||
```:no-line-numbers
|
||||
MIT License
|
||||
|
||||
Copyright (C) 2019-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.
|
||||
```
|
||||
|
||||
Copyright © 2019-2022 HighCapable
|
280
docs-source/src/en/about/changelog.md
Normal file
280
docs-source/src/en/about/changelog.md
Normal file
@@ -0,0 +1,280 @@
|
||||
# Changelog
|
||||
|
||||
> The version update history of `YukiHookAPI` is recorded here.
|
||||
|
||||
::: danger
|
||||
|
||||
We will only maintain the latest API version, if you are using an outdate API version, you voluntarily renounce any possibility of maintenance.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
To avoid translation time consumption, Changelog will use **Google Translation** from **Chinese** to **English**, please refer to the original text for actual reference.
|
||||
|
||||
Time zone of version release date: **UTC+8**
|
||||
|
||||
:::
|
||||
|
||||
### 1.0.92 | 2022.05.31  <Badge type="tip" text="latest" vertical="middle" />
|
||||
|
||||
- Fixed the naming method of callback in a large number of methods
|
||||
- Changed the solution to fix the problem that `YukiHookDataChannel` cannot call back the current `Activity` broadcast on devices lower than **Android 12**
|
||||
- The `InjectYukiHookWithXposed` annotation adds the `isUsingResourcesHook` function, now you can selectively disable the dependency interface that automatically generates `IXposedHookInitPackageResources`
|
||||
|
||||
### 1.0.91 | 2022.05.29  <Badge type="warning" text="stale" vertical="middle" />
|
||||
|
||||
- Fixed the `ClassLoader` error when the customized system of some devices is booted in the LSPosed environment, thanks to [Luckyzyx](https://github.com/luckyzyx) for the feedback
|
||||
- Fixed `YukiHookDataChannel` not being able to call back the current `Activity` broadcast on **ZUI** and systems below **Android 12**
|
||||
- Integrate the `YukiHookModuleStatus` function into `YukiHookAPI.Status`, rewrite a lot of methods, now you can judge the status information such as module activation in the module and the host in both directions
|
||||
|
||||
### 1.0.90 | 2022.05.27  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Fixed `YukiHookDataChannel` crashing when the module sets the listener callback
|
||||
- Fixed `YukiHookDataChannel` still calling back when not in current `Activity`
|
||||
- Remove the default value of `YukiHookDataChannel` callback event, no callback
|
||||
- Removed `YukiHookModulePrefs` warning printed if XShare is unreadable
|
||||
- Added the `isXSharePrefsReadable` method in `YukiHookModulePrefs` to determine whether the current XShare is available
|
||||
|
||||
### 1.0.89 | 2022.05.26  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Fixed the problem that `YukiHookDataChannel` cannot be repeatedly set to monitor, and added the function of repeating response in different `Activity` modules and automatically following `Activity` to destroy the monitor function
|
||||
- Added `YukiHookDataChannel` repeated listening use case description document
|
||||
- Add the `onAlreadyHooked` method to determine whether the current method is repeated Hook
|
||||
- Modify part of the logic of repeatedly adding HashMap, remove the `putIfAbsent` method, allow to override the addition
|
||||
- Fixed several possible bugs
|
||||
|
||||
### 1.0.88 | 2022.05.25  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Fully decoupled from Xposed API
|
||||
- Added `android` type in `type`
|
||||
- Separate `YukiHookModuleStatus` from auto-generated code and add `isEnableHookModuleStatus` switch, it is up to you to enable or not
|
||||
- Internal closure processing for the constructors of a large number of classes in the API
|
||||
- Set `YukiHookModulePrefs` to run as a singleton to prevent repeated creation and waste of system resources
|
||||
- Fix the bug that Hook cannot be nested since version `1.0.80`, and optimize the related functions of nested Hook
|
||||
- Modify the Hooker storage scheme from HashSet to HashMap to prevent the problem of repeatedly adding Hookers
|
||||
- Modify the core implementation method of Hook, add duplicate checking to avoid repeating the Hook multiple callbacks to the `HookParam` method
|
||||
- `MethodFinder` and `FieldFinder` add the function of finding fuzzy methods and variable names, you can call `name { ... }` to set search conditions, and support regular expressions
|
||||
- Optimize and modify the way to get `appContext` to reduce the possibility of getting empty
|
||||
- Modify the print `TAG` of `logger` in the automatically generated code to default to your custom name, which is convenient for debugging
|
||||
- Optimize the `Hooker` implementation of `YukiHookBridge` to improve Hook performance
|
||||
- `PackageParam` adds the `onAppLifecycle` method, which can natively monitor the life cycle of the host and implement the registration system broadcast function
|
||||
- Added `YukiHookDataChannel` function to communicate using system out-of-order broadcast while the module and the host remain alive
|
||||
- `YukiHookDataChannel` adds the `checkingVersionEquals` method, which can be monitored to verify that the host has not updated the version mismatch problem after the module is updated
|
||||
- Added Java version example in the example code of `demo-module` for reference only
|
||||
|
||||
### 1.0.87 | 2022.05.10  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Added `refreshModuleAppResources` function to adapt Resources refresh when the language region, font size, resolution changes, etc.
|
||||
- Added `isEnableModuleAppResourcesCache` function, you can set whether to automatically cache the resources of the current module
|
||||
|
||||
### 1.0.86 | 2022.05.06  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Fixed the problem of continuous error reporting during `initZygote` when Resources Hook is not supported, reproduced in **ZUI**/**LSPosed CI(1.8.3-6550)**
|
||||
- Optimize and handle exceptions for Resources Hook, only print errors and warnings if they are used and not supported
|
||||
|
||||
### 1.0.85 | 2022.05.04  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Fixed a serious problem of not being able to hook the system framework, since `1.0.80`
|
||||
- Added in the debug log to distinguish the package name loaded by `initZygote` as `android-zygote`, `packageName` keeps `android` unchanged
|
||||
|
||||
### 1.0.83 | 2022.05.04  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Fixed `YukiHookModuleStatus` reporting a lot of errors after `loadSystem`
|
||||
- Added `android` type in `type`
|
||||
- Updated example descriptions in help documentation
|
||||
|
||||
### 1.0.82 | 2022.05.04  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Fixed a concept confusion error, distinguishing the relationship between `initZygote` and the system framework, there are problems with the previous comments and documentation, I am very sorry
|
||||
- `PackageParam` adds `loadSystem` method, no need to write `loadApp(name = "android")` to hook the system framework
|
||||
|
||||
### 1.0.81 | 2022.05.04  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Fix the problem that the method and constructor that cannot be found in the Hook method body still output the error log after setting the condition using the `by` method
|
||||
- Added a global log to display the package name of the current Hook APP during the execution of the Hook, and fixed a problem with the printing style of the error log
|
||||
|
||||
### 1.0.80 | 2022.05.01  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- The `InjectYukiHookWithXposed` annotation adds the `entryClassName` function, which can customize the generated `xposed_init` entry class name
|
||||
- ~~`YukiHookXposedInitProxy`~~ renamed to `IYukiHookXposedInit`, the original interface name has been invalidated and will be deleted directly in subsequent versions
|
||||
- Added `initZygote` and Resources Hook functions to support Hook Layout
|
||||
- Added `onXposedEvent` method to listen to all events of native Xposed API
|
||||
- Perform `inline` processing on the `lambda` of the Hook function to avoid generating excessively broken anonymous classes and improve the running performance after compilation
|
||||
- Fix `PrefsData` compiled method body copy is too large
|
||||
- Added `XSharePreference` readability test, which will automatically print a warning log if it fails
|
||||
- `PackageParam` adds `appResources`, `moduleAppResources`, `moduleAppFilePath` functions
|
||||
- `loadApp` of `PackageParam` adds the function of not writing `name`, and all APPs are filtered by default
|
||||
- `PackageParam` adds the `loadZygote` method, which can directly hook the system framework
|
||||
- `PackageParam` added `resources().hook` function
|
||||
- Optimization method, construction method, variable search function, the error log that cannot be found will display the set query conditions first
|
||||
- Added `hasExtends` extension method to determine whether the current `Class` has an inheritance relationship
|
||||
- Added `isSupportResourcesHook` function to determine whether resource hooks are currently supported (Resources Hook)
|
||||
- `current` function adds `superClass` method to call superclass
|
||||
- New `superClass` query conditions for search methods, construction methods and variables, you can continue to search in the parent class
|
||||
- `YukiHookAPI` lots of methods are decoupled from Xposed API
|
||||
- Added native Hook priority function of Xposed API
|
||||
- Fix the problem that `isFirstApplication` may be inaccurate
|
||||
- Block the problem that MiuiCatcherPatch repeatedly calls the Hook entry method on the MIUI system
|
||||
- Optimize Hook entry calling method to avoid multiple calls due to Hook Framework issues
|
||||
- Fix the problem that Hook `ClassLoader` causes Hook to freeze, thanks to [WankkoRee](https://github.com/WankkoRee) for the feedback
|
||||
- Improve the performance after the `XC_Callback` interface is connected
|
||||
- Java `type` added `ClassLoader` type
|
||||
- Optimize the API help documentation, fix the problem that the page may be continuously cached
|
||||
|
||||
### 1.0.78 | 2022.04.18  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- `YukiHookModulePrefs` adds `isRunInNewXShareMode` method, which can be used to determine whether the module is currently in `New XSharePreference` mode
|
||||
- Fixed `YukiHookModulePrefs` working in `New XSharePreference` mode
|
||||
- Added `ModulePreferenceFragment`, now you can completely replace `PreferenceFragmentCompat` and start using the new functionality
|
||||
- Adapt the Sp data storage solution of `PreferenceFragmentCompat`, thanks to [mahoshojoHCG](https://github.com/mahoshojoHCG) for feedback
|
||||
- Update autohandlers and `Kotlin` dependencies to the latest version
|
||||
- Fixed some bugs in documentation and code comments
|
||||
|
||||
### 1.0.77 | 2022.04.15  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- `YukiHookModulePrefs` added `clear` method, thanks to [WankkoRee](https://github.com/WankkoRee) for the suggestion
|
||||
- `YukiHookModulePrefs` added `getStringSet`, `putStringSet`, `all` methods
|
||||
- Added `any` method to `args` of `HookParam`
|
||||
- Added `ModuleApplication`, which can be inherited in modules to achieve more functions
|
||||
- Connect all `findClass` functions to the Xposed API, and continue to use native `ClassLoader` in non-hosted environments
|
||||
- Fixed some possible bugs
|
||||
|
||||
### 1.0.75 | 2022.04.13  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Corrected the logic recognition part of the automatic handler, thanks to [ApeaSuperz](https://github.com/ApeaSuperz) contribution
|
||||
- Fixed an issue where the reference to a doc comment was not changed
|
||||
- `firstArgs` and `lastArgs` methods have been removed from `HookParam`, now you can use `args().first()` and `args().last()` instead of it
|
||||
- Removed default parameter `index = 0` in `args()` in `HookParam`, now you can use `args().first()` or `args(index = 0)` to replace it
|
||||
- The `result` function in `HookParam` adds generic matching, now you can use `result<T>` to match the known return value type of your target method
|
||||
- The `emptyParam` condition is added to the method and constructor query function, and the misunderstanding of the query condition that needs to be paid attention to in the document has been improved
|
||||
- Added `android` type in `type`
|
||||
|
||||
### 1.0.73 | 2022.04.10  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Fixed some Chinese translation errors in documents, thanks to [WankkoRee](https://github.com/WankkoRee) for their contributions
|
||||
- Fix the problem that `XC_LoadPackage.LoadPackageParam` throws an exception when the content is empty in some cases, thanks to [Luckyzyx](https://github.com/luckyzyx) for the feedback
|
||||
- Fix some known bugs and improve Hook stability
|
||||
|
||||
### 1.0.72 | 2022.04.09  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Update API documentation to new address
|
||||
- Add `appContext` function to `PackageParam`
|
||||
- Fix some known bugs and improve Hook stability
|
||||
|
||||
### 1.0.71 | 2022.04.04  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Fixed a serious issue that would stop the Hook from throwing an exception when VariousClass could not be matched
|
||||
|
||||
### 1.0.70 | 2022.04.04  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Fixed `instanceClass` reporting an error after being called in a static instance
|
||||
- Add `isUseAppClassLoader` function in Hook process, thanks to [WankkoRee](https://github.com/WankkoRee) for feedback
|
||||
- Added the `withProcess` function, which can be hooked according to the currently specified process of the APP
|
||||
- Fixed critical logic errors in lookup methods, constructor classes and variables
|
||||
- Fixed the problem that the abnormal output cannot be ignored when the Hook target class does not exist
|
||||
- Fixed the problem that the Hook could not take effect due to the fast loading of the APP startup method in some cases
|
||||
- Fixed `allMethods` not throwing an exception when it is not hooked to a method, thanks to [WankkoRee](https://github.com/WankkoRee) for the feedback
|
||||
- Added Hook status monitoring function, thanks to [WankkoRee](https://github.com/WankkoRee) for the suggestion
|
||||
- Modify the way the Xposed entry is injected into the class, and redefine the definition domain of the API
|
||||
- Added obfuscated method and variable lookup function, you can use different types of filter `index` to locate the specified method and variable, thanks to [WankkoRee](https://github.com/WankkoRee) for the ideas provided
|
||||
- When looking for methods and variables, multiple types are allowed, such as the class name declared by `String` and `VariousClass`
|
||||
- Add a new `current` function, which can build a reflection method operation space for any class, and easily call and modify the methods and variables in it
|
||||
- Fixed a lot of bugs in the hook process, thanks to [WankkoRee](https://github.com/WankkoRee) for contributing to this project
|
||||
|
||||
### 1.0.69 | 2022.03.30  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Added and improved annotations for some method functions
|
||||
- Added more example Hook content in Demo
|
||||
- Fixed the issue that only the last one takes effect when `allMethods` is used multiple times in a Hook instance, thanks to [WankkoRee](https://github.com/WankkoRee) for the feedback
|
||||
|
||||
### 1.0.68 | 2022.03.29  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Added new use case and LSPosed scope in Demo
|
||||
- Added `Member` lookup cache and lookup cache configuration switches
|
||||
- Removed and modified `MethodFinder`, `FieldFinder` and `HookParam` related method calls
|
||||
- Add more `cast` types in `Finder` and support `cast` as array
|
||||
- Overall performance and stability improvements
|
||||
- Fix bugs that may exist in the previous version
|
||||
|
||||
### 1.0.67 | 2022.03.27  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Added three `modifiers` functions in `Finder`, which can filter `static`, `native`, `public`, `abstract` and many other description types
|
||||
- When searching for methods and constructors, the method parameter type can be blurred to a specified number for searching
|
||||
- Added `hasModifiers` extension for `Member`
|
||||
- Added `give` method in `MethodFinder` and `ConstructorFinder` to get primitive types
|
||||
- Added `PrefsData` template function in `YukiHookModulePrefs`
|
||||
- Completely refactored method, constructor and variable lookup scheme
|
||||
- Optimized code comments and fixed possible bugs
|
||||
|
||||
### 1.0.66 | 2022.03.25  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Fixed a serious bug in `MethodFinder`
|
||||
- Added `args` call method in `hookParam`
|
||||
- Fix other possible problems and fix some class annotation problems
|
||||
|
||||
### 1.0.65 | 2022.03.25  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Republished version to fix the incorrect new version of the Maven repository due to cache issues
|
||||
- Added `MethodFinder` and `FieldFinder` new return value calling methods
|
||||
- Fix possible problems and fix possible problems during the use of Tai Chi
|
||||
- Fixed possible problems with auto-generated Xposed entry classes
|
||||
- Added `android` type and `java` type in `type`
|
||||
|
||||
### 1.0.6 | 2022.03.20  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Fixed `YukiHookModulePrefs` being ignored every time after using `direct` once to ignore cache
|
||||
- Added new API, abolished the traditional usage of `isActive` to judge module activation
|
||||
- Fixed the issue of printing debug logs when using the API in a non-Xposed environment
|
||||
- Fixed log output issue and unintercepted exception issue when looking for `Field`
|
||||
- Decoupling Xposed API in `ReflectionUtils`
|
||||
- Added `YukiHookModuleStatus` method name confusion to reduce the size of module generation
|
||||
- The welcome message will no longer be printed when loading the module's own Hook
|
||||
- Fix some bugs that still exist in the previous version
|
||||
|
||||
### 1.0.55 | 2022.03.18  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Fixed an annotation error
|
||||
- Temporarily fix a bug
|
||||
- Added a large number of `android` types in `type` and a small number of `java` types
|
||||
- Fix compatibility issues between new and old Kotlin APIs
|
||||
|
||||
### 1.0.5 | 2022.03.18  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Fixed the problem that the welcome message was printed multiple times in the case of the old version of the LSPosed framework
|
||||
- Added `onInit` method to configure `YukiHookAPI`
|
||||
- Added `executorName` and `executorVersion` to get the name and version number of the current hook framework
|
||||
- Added `by` method to set the timing and condition of Hook
|
||||
- `YukiHookModulePrefs` adds a controllable key-value cache, which can dynamically update data when the host is running
|
||||
- Fixed some possible bugs
|
||||
|
||||
### 1.0.4 | 2022.03.06  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Fix LSPosed cannot find `XposedBridge` after enabling "Only module classloader can use Xposed API" option in latest version
|
||||
- Added constant version name and version number for `YukiHookAPI`
|
||||
- Added `hasField` method and `isAllowPrintingLogs` configuration parameter
|
||||
- Added `isDebug` to enable the API to automatically print the welcome message to test whether the module is valid
|
||||
|
||||
### 1.0.3 | 2022.03.02  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Fixed a potential exception not intercepted BUG
|
||||
- Added `ignoredError` function
|
||||
- Added `android` type in `type`
|
||||
- Added `ClassNotFound` function after listening to `hook`
|
||||
|
||||
### 1.0.2 | 2022.02.18  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Fix the problem that the project path cannot be found under Windows
|
||||
- Remove part of reflection API, merge into `BaseFinder` for integration
|
||||
- Add a method to create Hook directly using string
|
||||
|
||||
### 1.0.1 | 2022.02.15  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- `RemedyPlan` adds `onFind` function
|
||||
- Integrate and modify some reflection API code
|
||||
- Added `java` type in `type`
|
||||
- Fixed the issue that ignored errors still output in the console
|
||||
|
||||
### 1.0 | 2022.02.14  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- The first version is submitted to Maven
|
13
docs-source/src/en/about/contacts.md
Normal file
13
docs-source/src/en/about/contacts.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# Contact Us
|
||||
|
||||
> If you have any questions in use, or have any constructive suggestions, you can contact us.
|
||||
|
||||
Join us [Click to join Telegram group](https://t.me/YukiHookAPI)
|
||||
|
||||
Find me on **Twitter** [@fankesyooni](https://twitter.com/fankesyooni)
|
||||
|
||||
## Help with maintenance
|
||||
|
||||
Thank you for choosing and using `YukiHookAPI`.
|
||||
|
||||
If you have code-related suggestions and requests, you can submit a Pull Request on Github.
|
43
docs-source/src/en/about/future.md
Normal file
43
docs-source/src/en/about/future.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# Looking for future
|
||||
|
||||
> The future is bright and uncertain, let us look forward to the future development space of `YukiHookAPI`.
|
||||
|
||||
## Unresolved Issues
|
||||
|
||||
> Here are the unresolved issues with `YukiHookAPI`.
|
||||
|
||||
### YukiHookModulePrefs
|
||||
|
||||
Currently only supports LSPosed perfectly, other Xposed Framework need to downgrade the module target api.
|
||||
|
||||
TaiChi may not be supported at all, and TaiChi needs a lower target api to adapt on high-version systems.
|
||||
|
||||
Some Xposed Module developers currently choose the Hook target app self's SharedPreferences storage solution to solve the module settings sharing problem.
|
||||
|
||||
In the later period, the permissions of the Android system will become more and more strict, and `selinux` is a big problem currently facing, which needs to be discussed and studied.
|
||||
|
||||
## Future Plans
|
||||
|
||||
> Features that `YukiHookAPI` may add later are included here.
|
||||
|
||||
### Lite version supported for standalone use
|
||||
|
||||
::: tip To be discussed
|
||||
|
||||
At present, the API only supports binding to **xposed_init** through the automatic handler.
|
||||
|
||||
If you don't like the automatic handler, you must implement the module loading entry yourself.
|
||||
|
||||
In the future, the Lite version with only API functions will be launched according to the number of people required.
|
||||
|
||||
You can submit **issues** with us.
|
||||
|
||||
:::
|
||||
|
||||
We have provided the Xposed native API listening interface, you can find or view the implementation method of the Demo [here](../config/xposed-using#native-xposed-api-event).
|
||||
|
||||
### Support for more Hook Framework
|
||||
|
||||
As an API, currently only docking `XposedBridge` as a compatibility layer still has certain limitations.
|
||||
|
||||
Most `inline hook` do not have a `Java` compatibility layer, and the `Java` compatibility layer adaptation of `native hook` may be considered later.
|
55
docs-source/src/en/api/home.md
Normal file
55
docs-source/src/en/api/home.md
Normal file
@@ -0,0 +1,55 @@
|
||||
---
|
||||
next:
|
||||
text: Public API
|
||||
link: /en/api/public/com/highcapable/yukihookapi/YukiHookAPI
|
||||
---
|
||||
|
||||
# Document Introduce
|
||||
|
||||
> The document here will synchronize the relevant usage of the latest API version, please keep `YukiHookAPI` as the latest version to use the latest version of the function.
|
||||
|
||||
## Function Description
|
||||
|
||||
> The function description mainly introduces the related usage and purpose of the current API.
|
||||
|
||||
## Function Example Description
|
||||
|
||||
> The function examples mainly show the basic usage examples of the current API for reference.
|
||||
|
||||
## Change Record Description
|
||||
|
||||
The function of the first version will be marked as `v<version>` `first`;
|
||||
|
||||
New function added later will be marked as `v<version>` `added`;
|
||||
|
||||
Later modified function will be appended as `v<version>` `modified`;
|
||||
|
||||
Later deprecated function will be marked as `v<version>` `deprecated` and strikethrough;
|
||||
|
||||
Later removed function will be marked as `v<version>` `removed` and strikethrough.
|
||||
|
||||
## Related Symbols Description
|
||||
|
||||
- *kt* Kotlin Static File
|
||||
|
||||
- *annotation* Annotation Class
|
||||
|
||||
- *interface* Interface Class
|
||||
|
||||
- *object* Class (Singleton)
|
||||
|
||||
- *class* Class
|
||||
|
||||
- *field* Field or `get` / `set` method or read-only `get` method
|
||||
|
||||
- *method* Method
|
||||
|
||||
- *enum* Enum constant
|
||||
|
||||
- *ext-field* Extension field (global)
|
||||
|
||||
- *ext-method* Extension method (global)
|
||||
|
||||
- *i-ext-field* Extension field (internal)
|
||||
|
||||
- *i-ext-method* Extension method (internal)
|
9
docs-source/src/en/api/special-features/host-inject.md
Normal file
9
docs-source/src/en/api/special-features/host-inject.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Host Resource Injection Extension *
|
||||
|
||||
::: warning
|
||||
|
||||
The current page has not been translated yet.
|
||||
|
||||
If necessary, please temporarily switch to the **Simplified Chinese** page, or help us improve the translation of this page.
|
||||
|
||||
:::
|
@@ -0,0 +1,9 @@
|
||||
# Host Lifecycle Extension *
|
||||
|
||||
::: warning
|
||||
|
||||
The current page has not been translated yet.
|
||||
|
||||
If necessary, please temporarily switch to the **Simplified Chinese** page, or help us improve the translation of this page.
|
||||
|
||||
:::
|
9
docs-source/src/en/api/special-features/logger.md
Normal file
9
docs-source/src/en/api/special-features/logger.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Debug Logger *
|
||||
|
||||
::: warning
|
||||
|
||||
The current page has not been translated yet.
|
||||
|
||||
If necessary, please temporarily switch to the **Simplified Chinese** page, or help us improve the translation of this page.
|
||||
|
||||
:::
|
9
docs-source/src/en/api/special-features/reflection.md
Normal file
9
docs-source/src/en/api/special-features/reflection.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Reflection Extensions *
|
||||
|
||||
::: warning
|
||||
|
||||
The current page has not been translated yet.
|
||||
|
||||
If necessary, please temporarily switch to the **Simplified Chinese** page, or help us improve the translation of this page.
|
||||
|
||||
:::
|
@@ -0,0 +1,9 @@
|
||||
# Xposed Module and Host Channel *
|
||||
|
||||
::: warning
|
||||
|
||||
The current page has not been translated yet.
|
||||
|
||||
If necessary, please temporarily switch to the **Simplified Chinese** page, or help us improve the translation of this page.
|
||||
|
||||
:::
|
9
docs-source/src/en/api/special-features/xposed-prefs.md
Normal file
9
docs-source/src/en/api/special-features/xposed-prefs.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Xposed Module Data Storage *
|
||||
|
||||
::: warning
|
||||
|
||||
The current page has not been translated yet.
|
||||
|
||||
If necessary, please temporarily switch to the **Simplified Chinese** page, or help us improve the translation of this page.
|
||||
|
||||
:::
|
9
docs-source/src/en/config/api-example.md
Normal file
9
docs-source/src/en/config/api-example.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# API Basic Configs *
|
||||
|
||||
::: warning
|
||||
|
||||
The current page has not been translated yet.
|
||||
|
||||
If necessary, please temporarily switch to the **Simplified Chinese** page, or help us improve the translation of this page.
|
||||
|
||||
:::
|
9
docs-source/src/en/config/api-exception.md
Normal file
9
docs-source/src/en/config/api-exception.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# API Exception Handling *
|
||||
|
||||
::: warning
|
||||
|
||||
The current page has not been translated yet.
|
||||
|
||||
If necessary, please temporarily switch to the **Simplified Chinese** page, or help us improve the translation of this page.
|
||||
|
||||
:::
|
9
docs-source/src/en/config/api-using.md
Normal file
9
docs-source/src/en/config/api-using.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Use as Hook API Configs *
|
||||
|
||||
::: warning
|
||||
|
||||
The current page has not been translated yet.
|
||||
|
||||
If necessary, please temporarily switch to the **Simplified Chinese** page, or help us improve the translation of this page.
|
||||
|
||||
:::
|
27
docs-source/src/en/config/r8-proguard.md
Normal file
27
docs-source/src/en/config/r8-proguard.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# R8 & Proguard Obfuscate
|
||||
|
||||
> In most scenarios, the Xposed Module can be compressed by native obfuscation.
|
||||
>
|
||||
> Here is the configuration method of obfuscation.
|
||||
|
||||
## R8
|
||||
|
||||
> If you are using `R8` then you don't need any special configuration for `YukiHookAPI`.
|
||||
|
||||
## Proguard
|
||||
|
||||
> ~~If you are still using `Proguard`, you need to do some rule configuration.~~
|
||||
|
||||
::: danger
|
||||
|
||||
Proguard rules have been deprecated, please don't use them anymore.
|
||||
|
||||
Since Android Gradle Plugin 4.2, the obfuscator with the latest version of the Android Jetpack default is **R8**, and you no longer need to consider obfuscation.
|
||||
|
||||
:::
|
||||
|
||||
To enable `R8` in any version, please add the following rules to the `gradle.properties` file, no configuration is required for Android Gradle Plugin 7.0 and above.
|
||||
|
||||
```groovy
|
||||
android.enableR8=true
|
||||
```
|
9
docs-source/src/en/config/xposed-using.md
Normal file
9
docs-source/src/en/config/xposed-using.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Use as Xposed Module Configs *
|
||||
|
||||
::: warning
|
||||
|
||||
The current page has not been translated yet.
|
||||
|
||||
If necessary, please temporarily switch to the **Simplified Chinese** page, or help us improve the translation of this page.
|
||||
|
||||
:::
|
9
docs-source/src/en/guide/example.md
Normal file
9
docs-source/src/en/guide/example.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Usage Example *
|
||||
|
||||
::: warning
|
||||
|
||||
The current page has not been translated yet.
|
||||
|
||||
If necessary, please temporarily switch to the **Simplified Chinese** page, or help us improve the translation of this page.
|
||||
|
||||
:::
|
186
docs-source/src/en/guide/home.md
Normal file
186
docs-source/src/en/guide/home.md
Normal file
@@ -0,0 +1,186 @@
|
||||
# Introduce
|
||||
|
||||
> This is a Hook API Framework, it does not provide any Hook function itself, it needs the support of basic Xposed API.
|
||||
|
||||
## Background
|
||||
|
||||
This is an efficient Xposed Hook API rebuilt in `Kotlin`.
|
||||
|
||||
The name is taken from ["ももくり" heroine Yuki Kurihara](https://www.bilibili.com/bangumi/play/ss5016).
|
||||
|
||||
Formerly the Innocent Xposed API used in [Development Learning Project](https://github.com/fankes/TMore), now renamed and open sourced.
|
||||
|
||||
## Usage
|
||||
|
||||
`YukiHookAPI` is built entirely with `Kotlin` `lambda` syntax.
|
||||
|
||||
Abandoning the original less friendly `XposedHelpers`, you can use it to easily create Xposed Modules and easily implement custom Hook API.
|
||||
|
||||
## Language Requirement
|
||||
|
||||
Please use `Kotlin`, the framework part of the code composition is also compatible with `Java` but the implementation of the basic Hook scene **may not work at all**.
|
||||
|
||||
All demo code in this document will be described using `Kotlin`, if you don't know how to use `Kotlin` then you may not be able to use `YukiHookAPI`.
|
||||
|
||||
Part of the Java Demo code can be found [here](https://github.com/fankes/YukiHookAPI/tree/master/demo-module/src/main/java/com/highcapable/yukihookapi/demo_module/hook/java), but not recommended.
|
||||
|
||||
## Source of Inspiration
|
||||
|
||||
Previously, when we built an Xposed Module, we first needed to create an `xposed_init` file under `assets`.
|
||||
|
||||
Then, manually fill in your own entry class name into the file and use `XposedHelpers` to implement our Hook logic.
|
||||
|
||||
Since `Kotlin` is the main Android development language, this API is really not very elegant to use.
|
||||
|
||||
Is there any **easy to use, light, elegant** solution?
|
||||
|
||||
With this idea, `YukiHookAPI` was born.
|
||||
|
||||
Now, we only need to write a small amount of code, and all the time and expense are handed over to automation.
|
||||
|
||||
With `Kotlin`'s elegant `lambda` writing and `YukiHookAPI`, you can make your Hook logic more beautiful and clear.
|
||||
|
||||
> The following example
|
||||
|
||||
:::: code-group
|
||||
::: code-group-item Yuki Hook API
|
||||
|
||||
```kotlin
|
||||
@InjectYukiHookWithXposed
|
||||
class HookEntry : IYukiHookXposedInit {
|
||||
|
||||
override fun onHook() = encase {
|
||||
loadZygote {
|
||||
ActivityClass.hook {
|
||||
injectMember {
|
||||
method {
|
||||
name = "onCreate"
|
||||
param(BundleClass)
|
||||
}
|
||||
beforeHook {
|
||||
// Your code here.
|
||||
}
|
||||
afterHook {
|
||||
// Your code here.
|
||||
}
|
||||
}
|
||||
}
|
||||
resources().hook {
|
||||
injectResource {
|
||||
conditions {
|
||||
name = "sym_def_app_icon"
|
||||
mipmap()
|
||||
}
|
||||
replaceToModuleResource(R.mipmap.ic_launcher)
|
||||
}
|
||||
}
|
||||
}
|
||||
loadApp(name = "com.android.browser") {
|
||||
ActivityClass.hook {
|
||||
injectMember {
|
||||
method {
|
||||
name = "onCreate"
|
||||
param(BundleClass)
|
||||
}
|
||||
beforeHook {
|
||||
// Your code here.
|
||||
}
|
||||
afterHook {
|
||||
// Your code here.
|
||||
}
|
||||
}
|
||||
}
|
||||
resources().hook {
|
||||
injectResource {
|
||||
conditions {
|
||||
name = "ic_launcher"
|
||||
mipmap()
|
||||
}
|
||||
replaceToModuleResource(R.mipmap.ic_launcher)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
:::
|
||||
::: code-group-item Xposed API
|
||||
|
||||
```kotlin
|
||||
class HookEntry : IXposedHookZygoteInit, IXposedHookLoadPackage, IXposedHookInitPackageResources {
|
||||
|
||||
private lateinit var moduleResources: XModuleResources
|
||||
|
||||
override fun initZygote(sparam: IXposedHookZygoteInit.StartupParam) {
|
||||
moduleResources = XModuleResources.createInstance(sparam.modulePath, null)
|
||||
XResources.setSystemWideReplacement(
|
||||
"android", "mipmap", "sym_def_app_icon",
|
||||
moduleResources.fwd(R.mipmap.ic_launcher)
|
||||
)
|
||||
XposedHelpers.findAndHookMethod(
|
||||
Activity::class.java.name,
|
||||
null, "onCreate",
|
||||
Bundle::class.java,
|
||||
object : XC_MethodHook() {
|
||||
override fun beforeHookedMethod(param: MethodHookParam?) {
|
||||
// Your code here.
|
||||
}
|
||||
|
||||
override fun afterHookedMethod(param: MethodHookParam?) {
|
||||
// Your code here.
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
if (lpparam.packageName == "com.android.browser")
|
||||
XposedHelpers.findAndHookMethod(
|
||||
Activity::class.java.name,
|
||||
lpparam.classLoader, "onCreate",
|
||||
Bundle::class.java,
|
||||
object : XC_MethodHook() {
|
||||
override fun beforeHookedMethod(param: MethodHookParam?) {
|
||||
// Your code here.
|
||||
}
|
||||
|
||||
override fun afterHookedMethod(param: MethodHookParam?) {
|
||||
// Your code here.
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun handleInitPackageResources(resparam: XC_InitPackageResources.InitPackageResourcesParam) {
|
||||
if (resparam.packageName == "com.android.browser")
|
||||
resparam.res.setReplacement(
|
||||
"com.android.browser", "mipmap", "ic_launcher",
|
||||
moduleResources.fwd(R.mipmap.ic_launcher)
|
||||
)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
:::
|
||||
::::
|
||||
|
||||
Yes, you read that right, just needing these codes can completely replace the Xposed API to achieve the same function.
|
||||
|
||||
Now, with the help of the efficient and powerful `YukiHookAPI`, you can implement a very simple Xposed Module.
|
||||
|
||||
## Suppored Hook Framework
|
||||
|
||||
The following are the `Hook Framework` and Xposed framework supported by `YukiHookAPI`.
|
||||
|
||||
| Hook Framework | ST | Description |
|
||||
| --------------------------------------------------------- | --- | ----------------------------------------------------------------------------------------- |
|
||||
| [LSPosed](https://github.com/LSPosed/LSPosed) | ✅ | Stable use in multiple scenarios |
|
||||
| [LSPatch](https://github.com/LSPosed/LSPatch) | ⭕ | WIP after this project is improved |
|
||||
| [EdXposed](https://github.com/ElderDrivers/EdXposed) | ❎ | Maintenance has stopped, no longer recommended |
|
||||
| [Pine](https://github.com/canyie/pine) | ⭕ | Only available |
|
||||
| [SandHook](https://github.com/asLody/SandHook) | ⭕ | Only available |
|
||||
| [Whale](https://github.com/asLody/whale) | ⭕ | Need [xposed-hook-based-on-whale](https://github.com/WindySha/xposed-hook-based-on-whale) |
|
||||
| [YAHFA](https://github.com/PAGalaxyLab/YAHFA) | ❗ | Need to implement the Xposed API yourself |
|
||||
| [FastHook](https://github.com/turing-technician/FastHook) | ❗ | Need to implement the Xposed API yourself |
|
||||
| [Epic](https://github.com/tiann/epic) | ❗ | Need [Dexposed](https://github.com/alibaba/dexposed) by yourself |
|
||||
| [TaiChi](https://github.com/taichi-framework/TaiChi) | ⭕ | Only available for Xposed Module |
|
||||
| [Xposed](https://github.com/rovo89/Xposed) | ❎ | Not test, no longer recommended |
|
89
docs-source/src/en/guide/knowledge.md
Normal file
89
docs-source/src/en/guide/knowledge.md
Normal file
@@ -0,0 +1,89 @@
|
||||
# Basic Knowledge
|
||||
|
||||
> Here is a collection of Xposed-related introductions and the key points of knowledge that need to be grasped before start.
|
||||
>
|
||||
> Anyone who already knows can skip it.
|
||||
|
||||
The basic knowledge content <u>**not necessarily completely accurate**</u>, please read it according to your own opinion.
|
||||
|
||||
If you find **any errors in this page, please correct it and help us improve**.
|
||||
|
||||
## Related Introduction
|
||||
|
||||
> Here's an introduction to Xposed and how Hooks work.
|
||||
|
||||
### What is Xposed
|
||||
|
||||
> Xposed Framework (Xposed Framework) is a set of open source framework services that run in Android high-privilege mode. It can affect program operation (modify the system) without modifying the APK file. Based on it, many Powerful modules that operate simultaneously without conflicting functions.
|
||||
|
||||
The above content is copied from Baidu Encyclopedia.
|
||||
|
||||
### What can Xposed do
|
||||
|
||||
> The structure below describes the basic workings and principles of Xposed.
|
||||
|
||||
```:no-line-numbers
|
||||
Xposed Framework
|
||||
└── App's Environment
|
||||
└── Hooker (Hooked)
|
||||
...
|
||||
App's Environment
|
||||
└── Hooker (Hooked)
|
||||
...
|
||||
...
|
||||
```
|
||||
|
||||
We can achieve the ultimate goal of controlling its behavior by injecting the **Host (App)** when the **Host (App)** is running.
|
||||
|
||||
This mode of operation of Xposed is called **parasitism**. The Xposed Module follows the lifecycle of the host and completes its own life course within the lifecycle of the **Host**.
|
||||
|
||||
We can call the **Host**'s methods, fields, and constructors through reflection, and use the Hook operation provided by `XposedBridge` to dynamically insert our own code before and after the method to be executed by the **Host (App)**, or completely replace the target, or even intercept.
|
||||
|
||||
### Development Process
|
||||
|
||||
Today's Xposed Manager has been completely replaced by its derivative works, and the era of **SuperSU** has ended, and now, with **Magisk**, everything behind is possible again.
|
||||
|
||||
> Its development history can be roughly divided into **Xposed(Dalvik)** → **Xposed(ART)** → **Xposed(Magisk)** → **EdXposed(Riru)**/**LSPosed(Riru/ Zygisk)**
|
||||
|
||||
### Derivatives
|
||||
|
||||
> The structure below describes how and how the Xposed-like Hook Framework works.
|
||||
|
||||
```:no-line-numbers
|
||||
App's Environment
|
||||
└── Hook Framework
|
||||
└── Hooker (Hooked)
|
||||
...
|
||||
```
|
||||
|
||||
Through the operation principle of Xposed, many frameworks of the same type have been derived. As mobile devices in today's era are more and more difficult to obtain Root permissions or even flash, and when they are not just needed, some Root-free frameworks are also produced, such as **Tai Chi**.
|
||||
|
||||
These Hook Frameworks at the ART level can also complete the Hook process with the same principle as Xposed without using the Xposed API. The operating principle of Root-free is to modify the APK and inject the Hook process into the **Host**, and control it through external modules.
|
||||
|
||||
Another product is to use the existing functions of the Android operating environment to virtualize an environment that is completely the same as the current device system, and run App in it. This is the virtual App technology **VirtualApp**, which was later derived as **VirtualXposed** .
|
||||
|
||||
The Root-free frameworks mentioned above are **Tai Chi/Wuji**, **VirtualXposed/SandVXposed**.
|
||||
|
||||
### What YukiHookAPI does
|
||||
|
||||
Since Xposed appeared until now, apart from `XposedHelpers`, which is well known to developers, there is still no set of syntactic sugar for `Kotlin` and API with complete usage encapsulation.
|
||||
|
||||
The birth of this API framework is to hope that in the current era of Xposed, more capable Xposed Module developers can avoid detours and complete the entire development process more easily and simply.
|
||||
|
||||
In the future, `YukiHookAPI` will adapt to more third-party Hook Frameworks based on the goal of using the Xposed API, so as to improve the entire ecosystem and help more developers make Xposed Module development simpler and easier to understand.
|
||||
|
||||
## Let's Started
|
||||
|
||||
Before starting, you need to have the following basics to better use `YukiHookAPI`.
|
||||
|
||||
- Grasp and understand Android development and simple system operation principles
|
||||
|
||||
- To grasp and understand the internal structure of Android APK and simple decompilation knowledge, you can refer to [Jadx](https://github.com/skylot/jadx) and [ApkTool](https://github.com/iBotPeaches/Apktool)
|
||||
|
||||
- Grasp and proficient in using Java reflection, understand simple Smali syntax, understand Dex file structure, and use reverse analysis to locate method locations
|
||||
|
||||
- Grasp the basic native [Xposed API](https://api.xposed.info) usage, understand the operation principle of Xposed
|
||||
|
||||
- Grasp Kotlin language and learn to use **Kotlin lambda**
|
||||
|
||||
- Grasp and understand Kotlin and Java mixing, calling each other, and Java bytecode generated by Kotlin
|
259
docs-source/src/en/guide/move-to-new-api.md
Normal file
259
docs-source/src/en/guide/move-to-new-api.md
Normal file
@@ -0,0 +1,259 @@
|
||||
# Migrate from Xposed API
|
||||
|
||||
> If you are familiar with Xposed API, you can refer to the same point below to quickly migrate your API to `YukiHookAPI`.
|
||||
|
||||
## Migrate Hook Entry Point
|
||||
|
||||
> Migrated from `XC_LoadPackage.LoadPackageParam` to `PackageParam`.
|
||||
|
||||
`YukiHookAPI` implements the `lambda` method body `this` usage for `PackageParam`, and the `PackageParam` object can be obtained globally in the `encase` method body.
|
||||
|
||||
> The API function differences are compared as follows
|
||||
|
||||
:::: code-group
|
||||
::: code-group-item Yuki Hook API
|
||||
|
||||
```kotlin
|
||||
override fun onHook() = encase {
|
||||
// Get the package name of the current Hook
|
||||
packageName
|
||||
// Get the ApplicationInfo of the current Hook
|
||||
appInfo
|
||||
// Get the system context object
|
||||
systemContext
|
||||
// Get the host Application lifecycle
|
||||
appContext
|
||||
// Hook specified app
|
||||
loadApp(name = "com.demo.test") {
|
||||
// Class Hook
|
||||
findClass("com.demo.test.TestClass").hook {
|
||||
injectMember {
|
||||
method {
|
||||
name = "test"
|
||||
param(BooleanType)
|
||||
}
|
||||
afterHook {
|
||||
// ...
|
||||
}
|
||||
}
|
||||
}
|
||||
// Resources Hook (fixed usage)
|
||||
resources().hook {
|
||||
injectResource {
|
||||
conditions {
|
||||
name = "ic_launcher"
|
||||
mipmap()
|
||||
}
|
||||
replaceToModuleResource(R.mipmap.ic_launcher)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
:::
|
||||
::: code-group-item Xposed API
|
||||
|
||||
```kotlin
|
||||
private lateinit var moduleResources: XModuleResources
|
||||
|
||||
override fun initZygote(sparam: IXposedHookZygoteInit.StartupParam) {
|
||||
moduleResources = XModuleResources.createInstance(sparam.modulePath, null)
|
||||
}
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
// Get the package name of the current Hook
|
||||
lpparam.packageName
|
||||
// Get the ApplicationInfo of the current Hook
|
||||
lpparam.applicationInfo
|
||||
// Get the system context object
|
||||
// There is no ready-made calling method in the native Xposed API, you need to reflect ActivityThread to achieve it
|
||||
// Get the host Application lifecycle
|
||||
AndroidAppHelper.currentApplication()
|
||||
// Class Hook
|
||||
if(lpparam.packageName == "com.demo.test")
|
||||
XposedHelpers.findAndHookMethod(
|
||||
"com.demo.test.TestClass", lpparam.classLoader,
|
||||
"test", Boolean::class.java,
|
||||
object : XC_MethodHook() {
|
||||
override fun afterHookedMethod(param: MethodHookParam) {
|
||||
// ...
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
override fun handleInitPackageResources(resparam: XC_InitPackageResources.InitPackageResourcesParam) {
|
||||
// Get the package name of the current Hook
|
||||
resparam.packageName
|
||||
// Resources Hook
|
||||
resparam.res.setReplacement(
|
||||
"com.demo.test", "mipmap", "ic_launcher",
|
||||
moduleResources.fwd(R.mipmap.ic_launcher)
|
||||
)
|
||||
}
|
||||
```
|
||||
|
||||
:::
|
||||
::::
|
||||
|
||||
## Migrate Hook Method Body
|
||||
|
||||
> Migrated from `XC_MethodHook.MethodHookParam` to `HookParam`.
|
||||
|
||||
### Before/After Hook
|
||||
|
||||
`YukiHookAPI` also implements the `lambda` method body `this` usage for `HookParam`, and the `HookParam` object can be obtained globally in the method bodies such as `beforeHook` and `afterHook`.
|
||||
|
||||
> The API function differences are compared as follows
|
||||
|
||||
:::: code-group
|
||||
::: code-group-item Yuki Hook API
|
||||
|
||||
```kotlin
|
||||
afterHook {
|
||||
// Get the current Hook instance
|
||||
instance
|
||||
// Get the Class instance of the current Hook
|
||||
instanceClass
|
||||
// Get and cast the current Hook instance to the specified type T
|
||||
instance<T>()
|
||||
// Get the method parameter array
|
||||
args
|
||||
// Get the first T of the method parameter
|
||||
args().first().cast<T>()
|
||||
// Get the last bit of the method parameter T
|
||||
args().last().cast<T>()
|
||||
// Get any subscript T of the method parameter, here is an example of 2
|
||||
args(index = 2).cast<T>()
|
||||
// Set any subscript of the method parameter, here is an example of 2
|
||||
args(index = 2).set(...)
|
||||
// Get the return value
|
||||
result
|
||||
// Get the return value and cast to T
|
||||
result<T>()
|
||||
// Modify the content of the return value
|
||||
result = ...
|
||||
// Remove the content of the return value
|
||||
resultNull()
|
||||
// Throw an exception to the Hook app
|
||||
Throwable("Fatal").throwToApp()
|
||||
// Execute the original method without hook and call with the original method parameters, generics can be omitted
|
||||
callOriginal<Any?>()
|
||||
// Execute the original method without Hook and customize the method parameter call, the generic type can be omitted
|
||||
invokeOriginal<Any?>(...)
|
||||
}
|
||||
```
|
||||
|
||||
:::
|
||||
::: code-group-item Xposed API
|
||||
|
||||
```kotlin
|
||||
override fun afterHookedMethod(param: MethodHookParam) {
|
||||
// Get the current Hook instance
|
||||
param.thisObject
|
||||
// Get the Class instance of the current Hook
|
||||
param.thisObject.javaClass
|
||||
// Get and cast the current Hook instance to the specified type T
|
||||
param.thisObject as T
|
||||
// Get the method parameter array
|
||||
param.args
|
||||
// Get the first T of the method parameter
|
||||
param.args[0] as T
|
||||
// Get the last bit of the method parameter T
|
||||
param.args[param.args.lastIndex] as T
|
||||
// Get any subscript T of the method parameter, here is an example of 2
|
||||
param.args[2] as T
|
||||
// Set any subscript of the method parameter, here is an example of 2
|
||||
param.args[2] = ...
|
||||
// Get the return value
|
||||
param.result
|
||||
// Get the return value and cast to T
|
||||
param.result as T
|
||||
// Modify the content of the return value
|
||||
param.result = ...
|
||||
// Remove the content of the return value
|
||||
param.result = null
|
||||
// Throw an exception to the Hook app
|
||||
param.throwable = Throwable("Fatal")
|
||||
// Execute the original method without hooking
|
||||
XposedBridge.invokeOriginalMethod(param.method, param.thisObject, ...)
|
||||
}
|
||||
```
|
||||
|
||||
:::
|
||||
::::
|
||||
|
||||
### Replace Hook
|
||||
|
||||
The `replaceHook` method is special, and the `YukiHookAPI` makes a variety of forms for it to choose from.
|
||||
|
||||
> The API function differences are compared as follows
|
||||
|
||||
:::: code-group
|
||||
::: code-group-item Yuki Hook API
|
||||
|
||||
```kotlin
|
||||
/// A method with no return value void
|
||||
|
||||
replaceUnit {
|
||||
// Implement the replaced logic directly here
|
||||
}
|
||||
|
||||
/// A method with a return value
|
||||
|
||||
replaceAny {
|
||||
// Implement the replaced logic here
|
||||
// ...
|
||||
// Need to return the return value corresponding to the method, no need to write return, just put the parameter in the last digit
|
||||
// Assuming the return value of this method is an Int, we just need to ensure that the last bit is the return value we need
|
||||
0
|
||||
}
|
||||
|
||||
/// For some methods, we just need to replace their return value, then there are the following implementations
|
||||
/// It should be noted that the parameters passed in by the method of directly replacing the return value are fixed. If you want to dynamically replace the return value, please use the above replaceAny method body
|
||||
|
||||
// Replace with the return value you need
|
||||
replaceTo(...)
|
||||
// Replace with return value of type Boolean
|
||||
replaceToTrue()
|
||||
// Intercept return value
|
||||
intercept()
|
||||
```
|
||||
|
||||
:::
|
||||
::: code-group-item Xposed API
|
||||
|
||||
```kotlin
|
||||
/// A method with no return value void
|
||||
|
||||
override fun replaceHookedMethod(param: MethodHookParam): Any? {
|
||||
// Implement the replaced logic directly here
|
||||
return null
|
||||
}
|
||||
|
||||
/// A method with a return value
|
||||
|
||||
override fun replaceHookedMethod(param: MethodHookParam): Int {
|
||||
// Implement the replaced logic here
|
||||
// ...
|
||||
// Assume the return value of this method is an Int
|
||||
return 0
|
||||
}
|
||||
|
||||
/// For some methods, we just need to replace their return value, then there are the following implementations
|
||||
|
||||
// Replace with the return value you need
|
||||
override fun replaceHookedMethod(param: MethodHookParam) = ...
|
||||
// Replace with return value of type Boolean
|
||||
override fun replaceHookedMethod(param: MethodHookParam) = true
|
||||
// Intercept return value
|
||||
override fun replaceHookedMethod(param: MethodHookParam) = null
|
||||
```
|
||||
|
||||
:::
|
||||
::::
|
||||
|
||||
## Migrate Other Features
|
||||
|
||||
`YukiHookAPI` is a complete rewrite of the Xposed API, you can refer to [API Document](../api/home) and [Special Features](../api/special-features/reflection) to determine some functional Migration and use.
|
208
docs-source/src/en/guide/quick-start.md
Normal file
208
docs-source/src/en/guide/quick-start.md
Normal file
@@ -0,0 +1,208 @@
|
||||
# Quick Start
|
||||
|
||||
> Integrate `YukiHookAPI` into your project.
|
||||
|
||||
## Environment Requirements
|
||||
|
||||
- Windows 7 and above / macOS 10.14 and above / Linux distributions (Arch/Debian)
|
||||
|
||||
- Android Studio 2021.1 and above
|
||||
|
||||
- IntelliJ IDEA 2021.1 and above
|
||||
|
||||
- Kotlin 1.7.0 and above
|
||||
|
||||
- Android Gradle Plugin 7.0 and above
|
||||
|
||||
- Gradle 7.0 and above
|
||||
|
||||
- JVM 11 and above (Since API `1.0.80`)
|
||||
|
||||
## Automatically build the project
|
||||
|
||||
`YukiHookAPI` provides an automated build tool that can help you quickly build an Android standard project template with Xposed Module dependencies, and use the built template to start the next step directly.
|
||||
|
||||
You can [click here](../tools/yukihookapi-projectbuilder) to check it out.
|
||||
|
||||
## Manually configure the project
|
||||
|
||||
If you don't want to use automated build tools, you can still manually configure project dependencies as follows.
|
||||
|
||||
### Create Project
|
||||
|
||||
Use `Android Studio` or `IntelliJ IDEA` to create a new Android project and select `Kotlin` in the `Language` column to automatically add basic dependencies.
|
||||
|
||||
### Integration Dependencies
|
||||
|
||||
Add dependencies to your project `build.gradle`.
|
||||
|
||||
> The following example
|
||||
|
||||
```groovy
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
// ❗If your Plugin version is too low, be sure to add it as an Xposed Module, other cases are optional
|
||||
maven { url "https://dl.bintray.com/kotlin/kotlin-eap" }
|
||||
// ❗Be sure to add it as an Xposed Module, optional in other cases
|
||||
maven { url "https://api.xposed.info/" }
|
||||
// MavenCentral has a 2-hour cache, if you cannot integrate the latest version, please add this address
|
||||
maven { url "https://s01.oss.sonatype.org/content/repositories/releases" }
|
||||
}
|
||||
```
|
||||
|
||||
Add `plugin` to your app `build.gradle`.
|
||||
|
||||
> The following example
|
||||
|
||||
```groovy
|
||||
plugins {
|
||||
// ❗Be sure to add it as an Xposed Module, optional in other cases
|
||||
id 'com.google.devtools.ksp' version '<ksp-version>'
|
||||
}
|
||||
```
|
||||
|
||||
Add dependencies to your app `build.gradle`.
|
||||
|
||||
> The following example
|
||||
|
||||
```groovy
|
||||
dependencies {
|
||||
// base dependencies
|
||||
implementation 'com.highcapable.yukihookapi:api:<yuki-version>'
|
||||
// ❗Be sure to add it as an Xposed Module, optional in other cases
|
||||
compileOnly 'de.robv.android.xposed:api:82'
|
||||
// ❗Be sure to add it as an Xposed Module, optional in other cases
|
||||
ksp 'com.highcapable.yukihookapi:ksp-xposed:<yuki-version>'
|
||||
}
|
||||
```
|
||||
|
||||
Please modify **<ksp-version>** to the latest version from [here](https://github.com/google/ksp/releases) **(Please choose your current corresponding Kotlin version)**.
|
||||
|
||||
Please modify **<yuki-version>** to the latest version [here](../about/changelog).
|
||||
|
||||
::: danger
|
||||
|
||||
The **api** of **YukiHookAPI** and the versions that **ksp-xposed** depend on must correspond one by one, otherwise a version mismatch error will occur.
|
||||
|
||||
:::
|
||||
|
||||
Modify the JVM version of `Kotlin` to 11 and above in your app `build.gradle`.
|
||||
|
||||
> The following example
|
||||
|
||||
```groovy
|
||||
android {
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '11'
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
::: warning
|
||||
|
||||
Since API **1.0.80** version, the default JVM version is 11, and 1.8 and below are no longer supported.
|
||||
|
||||
:::
|
||||
|
||||
### Use as Xposed Module
|
||||
|
||||
Add the base code to your `AndroidManifest.xml`.
|
||||
|
||||
> The following example
|
||||
|
||||
```xml
|
||||
<!-- Set as Xposed Module -->
|
||||
<meta-data
|
||||
android:name="xposedmodule"
|
||||
android:value="true" />
|
||||
|
||||
<!-- set your module description -->
|
||||
<meta-data
|
||||
android:name="xposeddescription"
|
||||
android:value="Fill in your Xposed Module description" />
|
||||
|
||||
<!-- The minimum Xposed version number, if you are using EdXposed/LSPosed, the minimum recommended is 93 -->
|
||||
<meta-data
|
||||
android:name="xposedminversion"
|
||||
android:value="93" />
|
||||
|
||||
<!-- Optional: configure support for New XSharePrefs without adjusting xposedminversion to 93 -->
|
||||
<meta-data
|
||||
android:name="xposedsharedprefs"
|
||||
android:value="true"/>
|
||||
```
|
||||
|
||||
Create a Hook entry class in your project, inherit from `IYukiHookXposedInit` and add the annotation `@InjectYukiHookWithXposed`.
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
@InjectYukiHookWithXposed
|
||||
class HookEntry : IYukiHookXposedInit {
|
||||
|
||||
override fun onHook() = YukiHookAPI.encase {
|
||||
// Your code here.
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
::: tip Suggestion
|
||||
|
||||
You can inherit **Application** of your module app from **ModuleApplication** to achieve a complete user experience.
|
||||
|
||||
For more functions, please refer to [ModuleApplication](../api/public/com/highcapable/yukihookapi/hook/xposed/application/ModuleApplication).
|
||||
|
||||
:::
|
||||
|
||||
Then, you can start writing Hook code.
|
||||
|
||||
For configuration details related to use as an Xposed Module, you can [click here](../config/xposed-using) to continue reading.
|
||||
|
||||
If you are currently using Xposed API, you can refer to [Migrating from Xposed API](../guide/move-to-new-api).
|
||||
|
||||
### Use as Hook API
|
||||
|
||||
#### Integration
|
||||
|
||||
Create your custom `Application`.
|
||||
|
||||
::: danger
|
||||
|
||||
Regardless of the **Hook Framework** you use, you need to add its docking Xposed dependency support.
|
||||
|
||||
If the target **Hook Framework** does not integrate Xposed API, you need to implement and connect **XposedBridge** by yourself.
|
||||
|
||||
:::
|
||||
|
||||
Add `YukiHookAPI.encase` method to `attachBaseContext`.
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
override fun attachBaseContext(base: Context?) {
|
||||
// Load Hook Framework
|
||||
//
|
||||
// Your code here.
|
||||
//
|
||||
// Load YukiHookAPI
|
||||
YukiHookAPI.encase(base) {
|
||||
// Your code here.
|
||||
}
|
||||
super.attachBaseContext(base)
|
||||
}
|
||||
```
|
||||
|
||||
Then, you can start writing Hook code in much the same way you would use it as an Xposed Module.
|
||||
|
||||
For configuration details related to use as a Hook API, you can [click here](../config/api-using) to continue reading.
|
||||
|
||||
::: warning
|
||||
|
||||
**YukiHookModuleStatus**, **YukiHookModulePrefs**, **YukiHookDataChannel** and Resources Hook functionality will not work when using a custom Hook Framework instead of the full Xposed Module.
|
||||
|
||||
:::
|
56
docs-source/src/en/index.md
Normal file
56
docs-source/src/en/index.md
Normal file
@@ -0,0 +1,56 @@
|
||||
---
|
||||
home: true
|
||||
title: Home
|
||||
heroImage: /images/logo.png
|
||||
actions:
|
||||
- text: Get Started
|
||||
link: /en/guide/home
|
||||
type: primary
|
||||
- text: Changelog
|
||||
link: /en/about/changelog
|
||||
type: secondary
|
||||
features:
|
||||
- title: Xposed Module Develop
|
||||
details: The automatic builder can help you quickly create an Xposed Module, automatic configure the entry class and xposed_init file.
|
||||
- title: Light and Elegant
|
||||
details: A powerful, elegant, beautiful API built with Kotlin lambda can help you quickly implement members search and methods hooks.
|
||||
- title: Debugging Efficient
|
||||
details: A rich debug log function, detailing the name of each hooked method, time-consuming to find the class can quickly debug and find errors.
|
||||
- title: Easy to transplant
|
||||
details: Native support for Xposed API usage, in any case, the supported Hook Framework with Xposed API can be quickly spliced with it.
|
||||
- title: Obfuscate Support
|
||||
details: The built Xposed Module simply supports R8, obfuscate will not destroy the hook entry point, and no other configuration is required under R8.
|
||||
- title: Quickly Started
|
||||
details: Simple and easy to use it now! Do not need complex configuration and full development experience, Integrate dependencies and enjoy yourself.
|
||||
footer: MIT License | Copyright (C) 2019-2022 HighCapable
|
||||
---
|
||||
|
||||
### All Hook process in one step, everything is simplified
|
||||
|
||||
```kotlin
|
||||
loadApp(name = "com.android.browser") {
|
||||
ActivityClass.hook {
|
||||
injectMember {
|
||||
method {
|
||||
name = "onCreate"
|
||||
param(BundleClass)
|
||||
}
|
||||
beforeHook {
|
||||
// Your code here.
|
||||
}
|
||||
afterHook {
|
||||
// Your code here.
|
||||
}
|
||||
}
|
||||
}
|
||||
resources().hook {
|
||||
injectResource {
|
||||
conditions {
|
||||
name = "ic_launcher"
|
||||
mipmap()
|
||||
}
|
||||
replaceToModuleResource(R.mipmap.ic_launcher)
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
41
docs-source/src/en/tools/yukihookapi-projectbuilder.md
Normal file
41
docs-source/src/en/tools/yukihookapi-projectbuilder.md
Normal file
@@ -0,0 +1,41 @@
|
||||
# YukiHookAPI Project Builder
|
||||
|
||||
> This is an automatic building tool for Xposed Modules using `YukiHookAPI` as the core.
|
||||
>
|
||||
> Implementing automated search relies on quickly building an Android project template that includes a Xposed Module environment.
|
||||
|
||||
<img src="/images/yukihookapi-projectbuilder-en.png" width = "720"/>
|
||||
|
||||
## Get Project
|
||||
|
||||
This project is open source and free, and will be maintained continuously according to your usage.
|
||||
|
||||
The original version may have imperfections or bugs. We welcome to your feedback.
|
||||
|
||||
Project Address [YukiHookAPI-ProjectBuilder](https://github.com/fankes/YukiHookAPI-ProjectBuilder)。
|
||||
|
||||
If you want to download directly, you can [click here](https://github.com/fankes/YukiHookAPI-ProjectBuilder/releases) to go to the Release address.
|
||||
|
||||
## Usage
|
||||
|
||||
> Here contains the basic usage and function explanation.
|
||||
|
||||
### Basic Usage
|
||||
|
||||
- The software use process requires your device connected to the Internet.
|
||||
|
||||
- After starting the software, simply configure the project you want to create, click the **button** in the lower right corner or select **Project > Run Build** from the menu bar to start the task.
|
||||
|
||||
- After waiting for the automatic dependency search to complete, you can configure the project dependencies. It is recommended to use the latest dependencies to ensure the stability of the project, and the build tools only support the latest dependencies.
|
||||
|
||||
- Select the folder where you need to create the project. After starting, the project will be created in the location you selected, and wait for the whole process to complete and the project will be created.
|
||||
|
||||
### Config Template
|
||||
|
||||
Config template is an extension function, you can select menu bar **Project > Config Template > New Template**.
|
||||
|
||||
And then, you can create a template with the current config, and you can re-create it from **Saved Template** next time Load the template to restore the current config.
|
||||
|
||||
### Multilingual Support
|
||||
|
||||
The software language follows the current system, and you can manually select the software interface language in the **Language** column of the menu bar.
|
Reference in New Issue
Block a user