mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-06 02:35:40 +08:00
Compare commits
262 Commits
Author | SHA1 | Date | |
---|---|---|---|
2c1d99e0ea
|
|||
db5516ad6d
|
|||
7135d34381
|
|||
67e2dac3c4
|
|||
e17e7681ec
|
|||
932f644c7f
|
|||
f8c1a27169
|
|||
6b08287991
|
|||
311926b3cb
|
|||
684e3abbdc
|
|||
14399538ea
|
|||
701cbe0fc0
|
|||
de5a3ffe83
|
|||
4ecc67507a
|
|||
beb7b431f8
|
|||
d36a6a10e0
|
|||
242322954a
|
|||
c8f1e3441e
|
|||
cca6e1d2a8
|
|||
6ead14e65b
|
|||
|
fafd54139b | ||
|
54c4379e97 | ||
|
34a701a83c | ||
2f832d46d4
|
|||
d81c74c60a
|
|||
7509112177
|
|||
3e6435905e
|
|||
155077436d
|
|||
67116bba5a
|
|||
34f90a2466
|
|||
d6db8925c9
|
|||
7f97ad7197
|
|||
5262e15749
|
|||
1fd68bf6e3
|
|||
7aecf84829
|
|||
8b607b2243
|
|||
fddd2991a1
|
|||
|
32c430650f | ||
|
5dd117c8bb | ||
|
a72bc47c4f | ||
|
ff256bd41d | ||
|
9c7c9248f8 | ||
|
e4ea41e46c | ||
|
71e977b6cf | ||
a10c15d5ab
|
|||
e397a301d4
|
|||
c5b191ad8a
|
|||
9ef793695c
|
|||
5c946f7fd9
|
|||
e8754c7ede
|
|||
|
04405c5a53 | ||
|
f5a3f31cc9 | ||
e655e185b4
|
|||
bccd46ffde
|
|||
f29ce486e1
|
|||
e019ad5ed7
|
|||
cac9460335
|
|||
1005cd0eea
|
|||
c1aaa97681
|
|||
20c4eced2b
|
|||
fe2342ba42
|
|||
500b416650
|
|||
6b7a9961cc
|
|||
f9120b7422
|
|||
87b651420c
|
|||
039392e729
|
|||
b4ee6a0e15
|
|||
ece229c683
|
|||
95f309e0f6
|
|||
6df206ce7d
|
|||
|
e4799af576 | ||
|
142ea597ac | ||
|
49a3a87e06 | ||
2f72812e58
|
|||
b8450e9a2e
|
|||
0ca2365aa1
|
|||
7b527186c8
|
|||
6e8a7db742
|
|||
31e3b7a678
|
|||
69419f9f2e
|
|||
9a152a436d
|
|||
dc4b0281bd
|
|||
d55e4e3f16
|
|||
333877c4de
|
|||
87adab8029
|
|||
8f523d470d
|
|||
6d82c28081
|
|||
5939e1dcd3
|
|||
ba9928b43c
|
|||
8462d9cb34
|
|||
94ffac84bc
|
|||
8d8002df87
|
|||
ce3c2fa360
|
|||
973e406b95
|
|||
fc1a8ae5e1
|
|||
7b9af68fe6
|
|||
c4100247f8
|
|||
c801f2aeca
|
|||
6687c69b17
|
|||
29a594d272
|
|||
c7cafa11a9
|
|||
a19dfb3b5f
|
|||
a2056db45e
|
|||
6e57dc9ab0
|
|||
39656b81b3
|
|||
e0b18eb81c
|
|||
5d9b473bd6
|
|||
545f7f92ab
|
|||
b38d2b63ea
|
|||
c921348572
|
|||
4e0f88dbad
|
|||
c7decb4119
|
|||
da26016630
|
|||
922907fa0f
|
|||
a003a4ea07
|
|||
ae71bea0a0
|
|||
92106d6e92
|
|||
044e67ae7f
|
|||
58ed2b962e
|
|||
73e09bef25
|
|||
89cec45326
|
|||
3d149a92ca
|
|||
d04b9a5211
|
|||
fa24de805a
|
|||
f5c2ce2468
|
|||
3f5114851c
|
|||
edcc17907b
|
|||
786b2ad9ea
|
|||
da170e7ae1
|
|||
5c415c8d61
|
|||
8c8cfc5498
|
|||
6e658baf17
|
|||
375b2f3398
|
|||
7d2dc3c268
|
|||
7280397d79
|
|||
1ffa0fab4f
|
|||
71203cd9bf
|
|||
b8bb903ff7
|
|||
ea86a2b60a
|
|||
3ca7f4b017
|
|||
b531fce974
|
|||
d7b670c94d
|
|||
3118b3a5e6
|
|||
18ec0e2727
|
|||
e813aaf97a
|
|||
460ac083b0
|
|||
00bea93085
|
|||
2ee38ee54e
|
|||
c9e2720afc
|
|||
e3da58952f
|
|||
0709317d36
|
|||
bca5a07826
|
|||
fd84b22532
|
|||
fe2f5c802e
|
|||
dbe451d29c
|
|||
c651776da0
|
|||
ee1fc85a4e
|
|||
3ab4a8ee12
|
|||
18172145ef
|
|||
418fd9de00
|
|||
24290a7ee2
|
|||
92daf533c9
|
|||
4d0dce8fd3
|
|||
68f8b0f571
|
|||
cfeac9075a
|
|||
38b296274c
|
|||
00788cce5a
|
|||
e14c3e3808
|
|||
c849690699
|
|||
d0d1ce1cb9
|
|||
09e96feda4
|
|||
1af4ff8525
|
|||
e7cca9b5ca
|
|||
1f1a0b6c11
|
|||
24412eea84
|
|||
b518376c00
|
|||
fe0bae8dfd
|
|||
8aa5f34c36
|
|||
a8a40b562f
|
|||
20618c10ec
|
|||
2c21554902
|
|||
23f4da648a
|
|||
9ebe38e358
|
|||
d6f83ffc3c
|
|||
ac316d1427
|
|||
208c49cc0a
|
|||
a65dbe2c2f
|
|||
0c239dcda4
|
|||
2db28d8aab
|
|||
5bd18269c2
|
|||
8ba166dab9
|
|||
dd7912a577
|
|||
fc2187ddc8
|
|||
bdae1944f2
|
|||
e4063866f9
|
|||
53de203733
|
|||
db8cafe1f4
|
|||
a88e88786e
|
|||
|
f02e512ad8 | ||
|
9da4743feb | ||
befa2d26ee
|
|||
|
4e8c46a85b | ||
|
52739b9572 | ||
30b4fda708
|
|||
1e030ee72c
|
|||
482efff67c
|
|||
1012777858
|
|||
|
a40318378f | ||
|
d2d95703dc | ||
|
1bb2c4e5a2 | ||
9f24bffedc
|
|||
f85cafc73d
|
|||
c5f2163fa3
|
|||
e986a85d5a
|
|||
0454c6faee
|
|||
a398720755
|
|||
f6096721b7
|
|||
0b5bb7f09c
|
|||
160856ebad
|
|||
21970d1bc2
|
|||
c2e4651137
|
|||
495aa08eb6
|
|||
48ed26366a
|
|||
60f8937d55
|
|||
388147f089
|
|||
cc321df3b8
|
|||
ea609fb1c3
|
|||
ddacf818c8
|
|||
03320b40fa
|
|||
635e8b5e40
|
|||
6b4804cfb8
|
|||
51a9f42bd5
|
|||
f9cdcc508f
|
|||
b41897fd58
|
|||
9e1a6f2b07
|
|||
7f7b8e94f5
|
|||
390ee9e509
|
|||
e298f19e33
|
|||
b61bd33a67
|
|||
9ba7497b7a
|
|||
1215ccf220
|
|||
f8eefd58fd
|
|||
404bbfa4eb
|
|||
3b8eba21b0
|
|||
c743dad733
|
|||
68b7e3738f
|
|||
7244d0b9b3
|
|||
3ddd4b3c0d
|
|||
eeacd4f7d0
|
|||
98d46a3d9e
|
|||
a8121d8735
|
|||
914b059d9c
|
|||
a0714eb996
|
|||
8120206f4d
|
|||
05a7059eeb
|
|||
7c8086fde3
|
|||
dc079e7dc8
|
|||
099ece1e97
|
|||
f489313054
|
|||
e17ce34d77
|
|||
df5a24cf3f
|
|||
1020203278
|
35
.editorconfig
Normal file
35
.editorconfig
Normal file
@@ -0,0 +1,35 @@
|
||||
# noinspection EditorConfigKeyCorrectness
|
||||
[{*.kt,*.kts}]
|
||||
ktlint_standard_annotation = disabled
|
||||
ktlint_standard_filename = disabled
|
||||
ktlint_standard_wrapping = disabled
|
||||
ktlint_standard_import-ordering = enabled
|
||||
ktlint_standard_max-line-length = disabled
|
||||
ktlint_standard_multiline-if-else = disabled
|
||||
ktlint_standard_argument-list-wrapping = disabled
|
||||
ktlint_standard_parameter-list-wrapping = disabled
|
||||
ktlint_standard_trailing-comma-on-declaration-site = disabled
|
||||
ktlint_function_signature_body_expression_wrapping = multiline
|
||||
ktlint_standard_string-template-indent = disabled
|
||||
ktlint_standard_function-signature = disabled
|
||||
ktlint_standard_trailing-comma-on-call-site = disabled
|
||||
ktlint_standard_multiline-expression-wrapping = disabled
|
||||
ktlint_standard_no-empty-first-line-in-class-body = disabled
|
||||
ktlint_standard_if-else-wrapping = disabled
|
||||
ktlint_standard_if-else-bracing = disabled
|
||||
ktlint_standard_statement-wrapping = disabled
|
||||
ktlint_standard_blank-line-before-declaration = disabled
|
||||
ktlint_standard_no-empty-file = disabled
|
||||
ktlint_standard_property-naming = disabled
|
||||
ktlint_standard_function-naming = disabled
|
||||
ktlint_standard_chain-method-continuation = disabled
|
||||
ktlint_standard_class-signature = disabled
|
||||
ktlint_standard_condition-wrapping = disabled
|
||||
ktlint_standard_class-signature = disabled
|
||||
ktlint_standard_no-trailing-spaces = disabled
|
||||
ktlint_standard_multiline-loop = disabled
|
||||
ij_continuation_indent_size = 2
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
insert_final_newline = false
|
||||
max_line_length = 150
|
37
.github/workflows/docs-deploy.yml
vendored
Normal file
37
.github/workflows/docs-deploy.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
name: Deploy to GitHub pages
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- 'docs-source/**'
|
||||
- '.github/workflows/**'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
docs:
|
||||
if: ${{ success() }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
- name: Build VuePress site
|
||||
run: |
|
||||
cd docs-source
|
||||
yarn -i
|
||||
yarn docs:build-gh-pages
|
||||
- name: Deploy to GitHub Pages
|
||||
uses: crazy-max/ghaction-github-pages@v4
|
||||
with:
|
||||
target_branch: gh-pages
|
||||
build_dir: docs-source/dist
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
117
.gitignore
vendored
117
.gitignore
vendored
@@ -1,15 +1,110 @@
|
||||
## Fully .gtignore for IntelliJ, Android Studio and Gradle based Java projects
|
||||
## References:
|
||||
## - https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
||||
## - https://github.com/android/platform-samples/blob/main/.gitignore
|
||||
|
||||
# User-specific stuff
|
||||
.idea/**/workspace.xml
|
||||
.idea/**/tasks.xml
|
||||
.idea/**/usage.statistics.xml
|
||||
.idea/**/dictionaries
|
||||
.idea/**/shelf
|
||||
|
||||
# AWS User-specific
|
||||
.idea/**/aws.xml
|
||||
|
||||
# Generated files
|
||||
.idea/**/contentModel.xml
|
||||
|
||||
# Sensitive or high-churn files
|
||||
.idea/**/dataSources/
|
||||
.idea/**/dataSources.ids
|
||||
.idea/**/dataSources.local.xml
|
||||
.idea/**/sqlDataSources.xml
|
||||
.idea/**/dynamic.xml
|
||||
.idea/**/uiDesigner.xml
|
||||
.idea/**/dbnavigator.xml
|
||||
|
||||
# Gradle
|
||||
.idea/**/gradle.xml
|
||||
.idea/**/libraries
|
||||
|
||||
# Gradle and Maven with auto-import
|
||||
.idea/.name
|
||||
.idea/artifacts
|
||||
.idea/compiler.xml
|
||||
.idea/jarRepositories.xml
|
||||
.idea/modules.xml
|
||||
.idea/*.iml
|
||||
.idea/modules
|
||||
.idea/caches
|
||||
.idea/material_theme**
|
||||
.idea/other.xml
|
||||
*.iml
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea/caches
|
||||
/.idea/libraries
|
||||
/.idea/modules.xml
|
||||
/.idea/workspace.xml
|
||||
/.idea/navEditor.xml
|
||||
/.idea/assetWizardSettings.xml
|
||||
.DS_Store
|
||||
/build
|
||||
*.ipr
|
||||
|
||||
# Kotlin
|
||||
.kotlin
|
||||
|
||||
# Misc
|
||||
.idea/misc.xml
|
||||
|
||||
# CMake
|
||||
cmake-build-*/
|
||||
|
||||
# Mongo Explorer plugin
|
||||
.idea/**/mongoSettings.xml
|
||||
|
||||
# File-based project format
|
||||
*.iws
|
||||
|
||||
# IntelliJ
|
||||
out/
|
||||
|
||||
# mpeltonen/sbt-idea plugin
|
||||
.idea_modules/
|
||||
|
||||
# JIRA plugin
|
||||
atlassian-ide-plugin.xml
|
||||
|
||||
# Cursive Clojure plugin
|
||||
.idea/replstate.xml
|
||||
|
||||
# SonarLint plugin
|
||||
.idea/sonarlint/
|
||||
|
||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||
com_crashlytics_export_strings.xml
|
||||
crashlytics.properties
|
||||
crashlytics-build.properties
|
||||
fabric.properties
|
||||
|
||||
# Editor-based Rest Client
|
||||
.idea/httpRequests
|
||||
|
||||
# Android studio 3.1+ serialized cache file
|
||||
.idea/caches/build_file_checksums.ser
|
||||
|
||||
# Android studio 3.1+ additional
|
||||
.idea/deployment*.xml
|
||||
.idea/assetWizardSettings.xml
|
||||
.idea/androidTestResultsUserPreferences.xml
|
||||
|
||||
# Android projects
|
||||
**/local.properties
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
.cxx
|
||||
local.properties
|
||||
|
||||
# Gradle projects
|
||||
.gradle
|
||||
build/
|
||||
|
||||
# Mkdocs temporary serving folder
|
||||
docs-gen
|
||||
site
|
||||
*.bak
|
||||
.idea/appInsightsSettings.xml
|
||||
|
||||
# Mac OS
|
||||
.DS_Store
|
4
.idea/.gitignore
generated
vendored
4
.idea/.gitignore
generated
vendored
@@ -1,3 +1,5 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
/gradle.xml
|
||||
/misc.xml
|
||||
/workspace.xml
|
6
.idea/AndroidProjectSystem.xml
generated
Normal file
6
.idea/AndroidProjectSystem.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AndroidProjectSystem">
|
||||
<option name="providerId" value="com.android.tools.idea.GradleProjectSystem" />
|
||||
</component>
|
||||
</project>
|
9
.idea/compiler.xml
generated
9
.idea/compiler.xml
generated
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="11">
|
||||
<module name="YukiHookAPI.app" target="11" />
|
||||
<module name="YukiHookAPI.yukihookapi-yaya" target="11" />
|
||||
</bytecodeTargetLevel>
|
||||
</component>
|
||||
</project>
|
24
.idea/gradle.xml
generated
24
.idea/gradle.xml
generated
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="GRADLE" />
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="Embedded JDK" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/demo-app" />
|
||||
<option value="$PROJECT_DIR$/demo-module" />
|
||||
<option value="$PROJECT_DIR$/yukihookapi" />
|
||||
<option value="$PROJECT_DIR$/yukihookapi-ksp-xposed" />
|
||||
<option value="$PROJECT_DIR$/yukihookapi-stub" />
|
||||
</set>
|
||||
</option>
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
2
.idea/inspectionProfiles/Project_Default.xml
generated
2
.idea/inspectionProfiles/Project_Default.xml
generated
@@ -1,10 +1,12 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="CheckImageSize" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
|
||||
<option name="processCode" value="true" />
|
||||
<option name="processLiterals" value="true" />
|
||||
<option name="processComments" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="UnstableApiUsage" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
</profile>
|
||||
</component>
|
45
.idea/jarRepositories.xml
generated
45
.idea/jarRepositories.xml
generated
@@ -1,45 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="MavenRepo" />
|
||||
<option name="name" value="MavenRepo" />
|
||||
<option name="url" value="https://repo.maven.apache.org/maven2/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="maven3" />
|
||||
<option name="name" value="maven3" />
|
||||
<option name="url" value="https://www.jitpack.io" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="maven" />
|
||||
<option name="name" value="maven" />
|
||||
<option name="url" value="https://maven.aliyun.com/nexus/content/groups/public/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="maven2" />
|
||||
<option name="name" value="maven2" />
|
||||
<option name="url" value="https://maven.aliyun.com/nexus/content/repositories/jcenter" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="Google" />
|
||||
<option name="name" value="Google" />
|
||||
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="maven4" />
|
||||
<option name="name" value="maven4" />
|
||||
<option name="url" value="https://dl.bintray.com/kotlin/kotlin-eap" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
2
.idea/kotlinc.xml
generated
2
.idea/kotlinc.xml
generated
@@ -7,6 +7,6 @@
|
||||
<option name="additionalArguments" value="-version -Xopt-in=kotlin.RequiresOptIn" />
|
||||
</component>
|
||||
<component name="KotlinJpsPluginSettings">
|
||||
<option name="version" value="1.7.20" />
|
||||
<option name="version" value="2.1.10" />
|
||||
</component>
|
||||
</project>
|
11
.idea/ktlint-plugin.xml
generated
Normal file
11
.idea/ktlint-plugin.xml
generated
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="KtLint plugin">
|
||||
<ktlintMode>MANUAL</ktlintMode>
|
||||
<formatOnSave>false</formatOnSave>
|
||||
</component>
|
||||
<component name="com.nbadal.ktlint.KtlintProjectSettings">
|
||||
<ktlintMode>MANUAL</ktlintMode>
|
||||
<ktlintRulesetVersion>DEFAULT</ktlintRulesetVersion>
|
||||
</component>
|
||||
</project>
|
11
.idea/ktlint.xml
generated
Normal file
11
.idea/ktlint.xml
generated
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="KtlintProjectConfiguration">
|
||||
<treatAsErrors>false</treatAsErrors>
|
||||
<disabledRules>
|
||||
<list>
|
||||
<option value="package-name" />
|
||||
</list>
|
||||
</disabledRules>
|
||||
</component>
|
||||
</project>
|
10
.idea/migrations.xml
generated
Normal file
10
.idea/migrations.xml
generated
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectMigrations">
|
||||
<option name="MigrateToGradleLocalJavaHome">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
36
.idea/misc.xml
generated
36
.idea/misc.xml
generated
@@ -1,36 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DesignSurface">
|
||||
<option name="filePathToZoomLevelMap">
|
||||
<map>
|
||||
<entry key="app/src/main/res/layout/activity_main.xml" value="0.4169230769230769" />
|
||||
<entry key="app_demo/src/main/res/layout/activity_main.xml" value="0.4375" />
|
||||
<entry key="demo-app/src/main/res/drawable/ic_launcher_background.xml" value="0.238" />
|
||||
<entry key="demo-app/src/main/res/layout/activity_main.xml" value="0.4375" />
|
||||
<entry key="demo-module/src/main/res/drawable-v24/ic_launcher_foreground.xml" value="0.238" />
|
||||
<entry key="demo-module/src/main/res/drawable/ic_launcher_background.xml" value="0.238" />
|
||||
<entry key="demo-module/src/main/res/layout/activity_main.xml" value="0.4375" />
|
||||
<entry key="demo-module/src/main/res/mipmap-anydpi-v26/ic_launcher.xml" value="0.238" />
|
||||
<entry key="demo-module/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml" value="0.238" />
|
||||
<entry key="demo-module/src/main/res/xml/settings_preference.xml" value="0.4359375" />
|
||||
<entry key="demo-module/src/main/res/xml/settings_preferences.xml" value="0.43697916666666664" />
|
||||
<entry key="demo/src/main/res/layout/activity_main.xml" value="0.4375" />
|
||||
<entry key="module_demo/src/main/res/layout/activity_main.xml" value="0.4375" />
|
||||
<entry key="yukihookapi-ui-component/src/main/kotlin/com/highcapable/yukihookapi/ui/view/ModuleActiveBannerView.kt" value="0.44074074074074077" />
|
||||
<entry key="yukihookapi-ui-component/src/main/res/drawable-night/bg_dark_round.xml" value="0.238" />
|
||||
<entry key="yukihookapi-ui-component/src/main/res/drawable/bg_button_round.xml" value="0.238" />
|
||||
<entry key="yukihookapi-ui-component/src/main/res/drawable/bg_dark_round.xml" value="0.238" />
|
||||
<entry key="yukihookapi-ui-component/src/main/res/drawable/bg_green_round.xml" value="0.238" />
|
||||
<entry key="yukihookapi-ui-component/src/main/res/drawable/bg_orange_round.xml" value="0.238" />
|
||||
<entry key="yukihookapi-ui-component/src/main/res/drawable/bg_yellow_round.xml" value="0.238" />
|
||||
<entry key="yukihookapi-ui-component/src/main/res/layout/wgt_module_active_banner.xml" value="0.4359375" />
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
</project>
|
17
.idea/runConfigurations.xml
generated
Normal file
17
.idea/runConfigurations.xml
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RunConfigurationProducerService">
|
||||
<option name="ignoredProducers">
|
||||
<set>
|
||||
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
215
LICENSE
215
LICENSE
@@ -1,21 +1,202 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2022 HighCapable
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
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:
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
1. Definitions.
|
||||
|
||||
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.
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright HighCapable [name of copyright owner]
|
||||
|
||||
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.
|
||||
|
109
README-zh-CN.md
109
README-zh-CN.md
@@ -1,46 +1,35 @@
|
||||
# Yuki Hook API
|
||||
|
||||

|
||||

|
||||
[](https://t.me/YukiHookAPI)
|
||||
<br/><br/>
|
||||
<img src="https://github.com/fankes/YuKiHookAPI/blob/master/img-src/icon.png?raw=true" width = "100" height = "100"/>
|
||||
<br/>
|
||||
<br/>
|
||||
⛱️ 一个使用 Kotlin 构建的高效 Hook API 与 Xposed 模块解决方案。
|
||||
<br/>
|
||||
[](https://github.com/HighCapable/YukiHookAPI/blob/master/LICENSE)
|
||||
[](https://github.com/HighCapable/YukiHookAPI/releases)
|
||||
[](https://t.me/YukiHookAPI)
|
||||
[](https://t.me/HighCapable_Dev)
|
||||
[](https://qm.qq.com/cgi-bin/qm/qr?k=Pnsc5RY6N2mBKFjOLPiYldbAbprAU3V7&jump_from=webapi&authKey=X5EsOVzLXt1dRunge8ryTxDRrh9/IiW1Pua75eDLh9RE3KXE+bwXIYF5cWri/9lf)
|
||||
|
||||
[English](https://github.com/fankes/YukiHookAPI/blob/master/README.md) | 简体中文
|
||||
<img src="img-src/icon.png" width = "100" height = "100" alt="LOGO"/>
|
||||
|
||||
⛱️ 一个使用 Kotlin 构建的高效 Hook API 与 Xposed 模块解决方案。
|
||||
|
||||
[English](README.md) | 简体中文
|
||||
|
||||
| <img src="https://github.com/HighCapable/.github/blob/main/img-src/logo.jpg?raw=true" width = "30" height = "30" alt="LOGO"/> | [HighCapable](https://github.com/HighCapable) |
|
||||
|-------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------|
|
||||
|
||||
这个项目属于上述组织,**点击上方链接关注这个组织**,发现更多好项目。
|
||||
|
||||
## 这是什么
|
||||
|
||||
- 这是一个使用 Kotlin 基于 Xposed API 重新构建的高效 Hook API,同时为 Xposed 模块的开发打造了丰富的功能扩展
|
||||
- 名称取自 [《ももくり》女主 栗原 雪(Yuki)](https://www.bilibili.com/bangumi/play/ss5016)
|
||||
- 前身为 [开发学习项目](https://github.com/fankes/TMore) 中使用的 Innocent Xposed API,现在重新命名并开源
|
||||
这是一个使用 Kotlin 基于 Xposed API 重新构建的高效 Hook API,同时为 Xposed 模块的开发打造了丰富的功能扩展。
|
||||
|
||||
## 支持的功能
|
||||
名称取自 [《ももくり》女主 栗原 雪(Yuki)](https://www.bilibili.com/bangumi/play/ss5016)。
|
||||
|
||||
- Hook Framework 支持的基本 ART 动态方法 Hook 功能
|
||||
- Xposed 资源钩子 (Resources Hook)
|
||||
|
||||
## 扩展功能
|
||||
|
||||
- 自动化 Xposed 模块构建 (完全无需自行创建 `assets/xposed_init`)
|
||||
- [New XSharedPreferences](https://github.com/LSPosed/LSPosed/wiki/New-XSharedPreferences#for-the-module) 支持
|
||||
- DataChannel (宿主 ←→ 模块) 无序广播通讯通道功能
|
||||
- 简单快捷地实现混淆的字节码反射、查找功能
|
||||
前身为 [开发学习项目](https://github.com/fankes/TMore) 中使用的 Innocent Xposed API,现在重新命名并开源。
|
||||
|
||||
## 开始使用
|
||||
|
||||
- [点击这里](https://fankes.github.io/YukiHookAPI/zh-cn/) 前往文档页面查看更多详细教程和内容。
|
||||
[点击这里](https://highcapable.github.io/YukiHookAPI/zh-cn/) 前往文档页面查看更多详细教程和内容。
|
||||
|
||||
## 联系我们
|
||||
|
||||
- [点击加入 Telegram 群组](https://t.me/YukiHookAPI)
|
||||
|
||||
## 展望未来
|
||||
|
||||
如果你喜欢 `YukiHookAPI` 项目,欢迎为此项目贡献你的代码 **PR**,可以是任何改进的建议以及新增的功能。
|
||||
有关支持性的相关信息,你可以直接 [点击这里](https://highcapable.github.io/YukiHookAPI/zh-cn/guide/supportive) 进行查看。
|
||||
|
||||
## 合作项目
|
||||
|
||||
@@ -61,16 +50,34 @@
|
||||
| [Auto NFC](https://github.com/GSWXXN/AutoNFC) | [GSWXXN](https://github.com/GSWXXN) |
|
||||
| [不要竖屏](https://github.com/WankkoRee/Portrait2Landscape) | [WankkoRee](https://github.com/WankkoRee) |
|
||||
| [QDReadHook](https://github.com/xihan123/QDReadHook) | [xihan123](https://github.com/xihan123) |
|
||||
| [HXReadHook](https://github.com/xihan123/HXReadHook) | [xihan123](https://github.com/xihan123) |
|
||||
| [WxRecordRead](https://github.com/pwh-pwh/wxrecordread) | [Coderpwh](https://github.com/pwh-pwh) |
|
||||
| [FuckShake](https://github.com/pwh-pwh/fuck_shake) | [Coderpwh](https://github.com/pwh-pwh) |
|
||||
| [MIUI更新进化](https://miup.utssg.xyz) | [ZQDesigned](https://github.com/ZQDesigned) |
|
||||
| [MIUI录屏进化](https://www.coolapk.com/apk/UTSSG.ZQDesigned.miuirecordercracker) | [ZQDesigned](https://github.com/ZQDesigned) |
|
||||
| [Fuck AD](https://github.com/hujiayucc/Fuck-AD) | [hujiayucc](https://github.com/hujiayucc) |
|
||||
| [最右强力去广告](https://github.com/kazutoiris/zuiyou-adfree) | [kazutoiris](https://github.com/kazutoiris) |
|
||||
| [叮嗒出行强力去广告](https://github.com/kazutoiris/dingda-adfree) | [kazutoiris](https://github.com/kazutoiris) |
|
||||
| [无限幻境](https://github.com/kazutoiris/infinite-illusion) | [kazutoiris](https://github.com/kazutoiris) |
|
||||
| [HookGG](https://github.com/HdShare/HookGG) | [HdShare](https://github.com/HdShare) |
|
||||
| [OnePlusPlusLauncher](https://github.com/wizpizz/OnePlusPlusLauncher) | [wizpizz](https://github.com/wizpizz) |
|
||||
|
||||
你也在使用 `YukiHookAPI` 吗?快来 **PR** 将你的存储仓库添加到上方的列表(私有仓库可以不需要注明网页链接)。
|
||||
你也在使用 `YukiHookAPI` 吗?快来 **PR** 将你的存储仓库添加到上方的列表 (私有仓库可以不需要注明网页链接)。
|
||||
|
||||
## 捐赠支持
|
||||
## 项目推广
|
||||
|
||||
- 工作不易,无意外情况此项目将继续维护下去,提供更多可能,欢迎打赏。<br/><br/>
|
||||
<img src="https://github.com/fankes/YuKiHookAPI/blob/master/img-src/wechat_code.jpg?raw=true" width = "200" height = "200"/>
|
||||
<!--suppress HtmlDeprecatedAttribute -->
|
||||
<div align="center">
|
||||
<h2>嘿,还请君留步!👋</h2>
|
||||
<h3>这里有 Android 开发工具、UI 设计、Gradle 插件、Xposed 模块和实用软件等相关项目。</h3>
|
||||
<h3>如果下方的项目能为你提供帮助,不妨为我点个 star 吧!</h3>
|
||||
<h3>所有项目免费、开源,遵循对应开源许可协议。</h3>
|
||||
<h1><a href="https://github.com/fankes/fankes/blob/main/project-promote/README-zh-CN.md">→ 查看更多关于我的项目,请点击这里 ←</a></h1>
|
||||
</div>
|
||||
|
||||
## Star History
|
||||
|
||||

|
||||
|
||||
## 第三方开源使用声明
|
||||
|
||||
@@ -79,30 +86,24 @@
|
||||
|
||||
## 许可证
|
||||
|
||||
- [MIT](https://choosealicense.com/licenses/mit)
|
||||
- [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
||||
|
||||
```
|
||||
MIT License
|
||||
Apache License Version 2.0
|
||||
|
||||
Copyright (C) 2019-2023 HighCapable
|
||||
Copyright (C) 2019 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:
|
||||
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
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
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.
|
||||
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.
|
||||
```
|
||||
|
||||
版权所有 © 2019-2023 HighCapable
|
||||
版权所有 © 2019 HighCapable
|
||||
|
108
README.md
108
README.md
@@ -1,47 +1,36 @@
|
||||
# Yuki Hook API
|
||||
|
||||

|
||||

|
||||
[](https://t.me/YukiHookAPI)
|
||||
<br/><br/>
|
||||
<img src="https://github.com/fankes/YuKiHookAPI/blob/master/img-src/icon.png?raw=true" width = "100" height = "100"/>
|
||||
<br/>
|
||||
<br/>
|
||||
⛱️ An efficient Hook API and Xposed Module solution built in Kotlin.
|
||||
<br/>
|
||||
[](https://github.com/HighCapable/YukiHookAPI/blob/master/LICENSE)
|
||||
[](https://github.com/HighCapable/YukiHookAPI/releases)
|
||||
[](https://t.me/YukiHookAPI)
|
||||
[](https://t.me/HighCapable_Dev)
|
||||
[](https://qm.qq.com/cgi-bin/qm/qr?k=Pnsc5RY6N2mBKFjOLPiYldbAbprAU3V7&jump_from=webapi&authKey=X5EsOVzLXt1dRunge8ryTxDRrh9/IiW1Pua75eDLh9RE3KXE+bwXIYF5cWri/9lf)
|
||||
|
||||
English | [简体中文](https://github.com/fankes/YukiHookAPI/blob/master/README-zh-CN.md)
|
||||
<img src="img-src/icon.png" width = "100" height = "100" alt="LOGO"/>
|
||||
|
||||
⛱️ An efficient Hook API and Xposed Module solution built in Kotlin.
|
||||
|
||||
English | [简体中文](README-zh-CN.md)
|
||||
|
||||
| <img src="https://github.com/HighCapable/.github/blob/main/img-src/logo.jpg?raw=true" width = "30" height = "30" alt="LOGO"/> | [HighCapable](https://github.com/HighCapable) |
|
||||
|-------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------|
|
||||
|
||||
This project belongs to the above-mentioned organization, **click the link above to follow this organization** and discover more good projects.
|
||||
|
||||
## What's this
|
||||
|
||||
- This is an efficient Hook API rebuilt based on the Xposed API using Kotlin, and creates rich function extensions for the development of
|
||||
Xposed Modules
|
||||
- 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
|
||||
This is an efficient Hook API rebuilt based on the Xposed API using Kotlin,
|
||||
and creates rich function extensions for the development of Xposed Modules.
|
||||
|
||||
## Supports
|
||||
The name is taken from ["ももくり" heroine Yuki Kurihara](https://www.bilibili.com/bangumi/play/ss5016).
|
||||
|
||||
- Basic ART dynamic method hook functions supported by Hook Framework
|
||||
- Xposed Resources Hook
|
||||
|
||||
## Extensions
|
||||
|
||||
- Automatic Xposed Module Build (No need to create `assets/xposed_init` by yourself)
|
||||
- [New XSharedPreferences](https://github.com/LSPosed/LSPosed/wiki/New-XSharedPreferences#for-the-module) Supports
|
||||
- DataChannel (Host ←→ Module)
|
||||
- Simple and quick implementation of obfuscated bytecode reflection and finding functions
|
||||
Formerly the Innocent Xposed API used in [Development Learning Project](https://github.com/fankes/TMore), now renamed and open sourced.
|
||||
|
||||
## Get Started
|
||||
|
||||
- [Click here](https://fankes.github.io/YukiHookAPI/en/) go to the documentation page for more detailed tutorials and content.
|
||||
[Click here](https://highcapable.github.io/YukiHookAPI/en/) go to the documentation page for more detailed tutorials and content.
|
||||
|
||||
## Contacts
|
||||
|
||||
- [Follow us on Telegram](https://t.me/YukiHookAPI)
|
||||
|
||||
## Features
|
||||
|
||||
If you like the `YukiHookAPI` project, we welcome you to make a **PR** in this project, any suggestions for improvement and new features.
|
||||
For supportive related information, you can check it directly [click here](https://highcapable.github.io/YukiHookAPI/en/guide/supportive).
|
||||
|
||||
## Cooperations
|
||||
|
||||
@@ -62,13 +51,36 @@ The following are projects that have collaborated and are using `YukiHookAPI`.
|
||||
| [Auto NFC](https://github.com/GSWXXN/AutoNFC) | [GSWXXN](https://github.com/GSWXXN) |
|
||||
| [不要竖屏](https://github.com/WankkoRee/Portrait2Landscape) | [WankkoRee](https://github.com/WankkoRee) |
|
||||
| [QDReadHook](https://github.com/xihan123/QDReadHook) | [xihan123](https://github.com/xihan123) |
|
||||
| [HXReadHook](https://github.com/xihan123/HXReadHook) | [xihan123](https://github.com/xihan123) |
|
||||
| [WxRecordRead](https://github.com/pwh-pwh/wxrecordread) | [Coderpwh](https://github.com/pwh-pwh) |
|
||||
| [FuckShake](https://github.com/pwh-pwh/fuck_shake) | [Coderpwh](https://github.com/pwh-pwh) |
|
||||
| [MIUI更新进化](https://miup.utssg.xyz) | [ZQDesigned](https://github.com/ZQDesigned) |
|
||||
| [MIUI录屏进化](https://www.coolapk.com/apk/UTSSG.ZQDesigned.miuirecordercracker) | [ZQDesigned](https://github.com/ZQDesigned) |
|
||||
| [Fuck AD](https://github.com/hujiayucc/Fuck-AD) | [hujiayucc](https://github.com/hujiayucc) |
|
||||
| [Zuiyou ADFree](https://github.com/kazutoiris/zuiyou-adfree) | [kazutoiris](https://github.com/kazutoiris) |
|
||||
| [Dingda ADFree](https://github.com/kazutoiris/dingda-adfree) | [kazutoiris](https://github.com/kazutoiris) |
|
||||
| [Infinite Illusion](https://github.com/kazutoiris/infinite-illusion) | [kazutoiris](https://github.com/kazutoiris) |
|
||||
| [HookGG](https://github.com/HdShare/HookGG) | [HdShare](https://github.com/HdShare) |
|
||||
| [OnePlusPlusLauncher](https://github.com/wizpizz/OnePlusPlusLauncher) | [wizpizz](https://github.com/wizpizz) |
|
||||
|
||||
Are you also using `YukiHookAPI`? Come and **PR** to add your repository to the list above (private repositories do not need to indicate web
|
||||
links).
|
||||
|
||||
## Promotion
|
||||
|
||||
<!--suppress HtmlDeprecatedAttribute -->
|
||||
<div align="center">
|
||||
<h2>Hey, please stay! 👋</h2>
|
||||
<h3>Here are related projects such as Android development tools, UI design, Gradle plugins, Xposed Modules and practical software. </h3>
|
||||
<h3>If the project below can help you, please give me a star! </h3>
|
||||
<h3>All projects are free, open source, and follow the corresponding open source license agreement. </h3>
|
||||
<h1><a href="https://github.com/fankes/fankes/blob/main/project-promote/README.md">→ To see more about my projects, please click here ←</a></h1>
|
||||
</div>
|
||||
|
||||
## Star History
|
||||
|
||||

|
||||
|
||||
## Third-Party Open Source Usage Statement
|
||||
|
||||
- [Kotlin Symbol Processing API](https://github.com/google/ksp)
|
||||
@@ -76,30 +88,24 @@ links).
|
||||
|
||||
## License
|
||||
|
||||
- [MIT](https://choosealicense.com/licenses/mit)
|
||||
- [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
||||
|
||||
```
|
||||
MIT License
|
||||
Apache License Version 2.0
|
||||
|
||||
Copyright (C) 2019-2023 HighCapable
|
||||
Copyright (C) 2019 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:
|
||||
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
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
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.
|
||||
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-2023 HighCapable
|
||||
Copyright © 2019 HighCapable
|
||||
|
48
build.gradle
48
build.gradle
@@ -1,48 +0,0 @@
|
||||
//file:noinspection unused
|
||||
plugins {
|
||||
id 'com.android.application' version '7.4.0' apply false
|
||||
id 'com.android.library' version '7.4.0' apply false
|
||||
id 'org.jetbrains.kotlin.android' version '1.7.22' apply false
|
||||
}
|
||||
|
||||
ext {
|
||||
devId = "0"
|
||||
devUser = "fankesyooni"
|
||||
userEmail = "qzmmcn@163.com"
|
||||
groupId = "com.highcapable.yukihookapi"
|
||||
apiVersion = "1.1.8"
|
||||
repoName = "YukiHookAPI"
|
||||
repoDescription = "An efficient Hook API and Xposed Module solution built in Kotlin."
|
||||
licenceName = "MIT License"
|
||||
licenceUrl = "https://github.com/fankes/YukiHookAPI/blob/master/LICENSE"
|
||||
website = "https://github.com/fankes/YukiHookAPI"
|
||||
githubConnection = "scm:git:git://github.com/path/to/repo.git"
|
||||
githubDeveloperConnection = "scm:git:ssh://github.com/path/to/repo.git"
|
||||
githubUrl = "https://github.com/path/to/repo"
|
||||
ossName = "OSSRH"
|
||||
ossUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取授权文件内容 - 用于 Maven 的提交
|
||||
*
|
||||
* 若编译失败请将路径替换为自己的或置空
|
||||
* @param name
|
||||
* @return [String]
|
||||
*/
|
||||
static String getFileContent(String name) {
|
||||
String result = ""
|
||||
try {
|
||||
FileReader reader = new FileReader("/Users/fankes/Project/Android/Xposed/YukiHookAPI/.gradle/" + name)
|
||||
BufferedReader buff = new BufferedReader(reader)
|
||||
result = buff.readLine()
|
||||
buff.close()
|
||||
reader.close()
|
||||
} catch (Throwable ignored) {
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
7
build.gradle.kts
Normal file
7
build.gradle.kts
Normal file
@@ -0,0 +1,7 @@
|
||||
plugins {
|
||||
autowire(libs.plugins.android.application) apply false
|
||||
autowire(libs.plugins.android.library) apply false
|
||||
autowire(libs.plugins.kotlin.jvm) apply false
|
||||
autowire(libs.plugins.kotlin.android) apply false
|
||||
autowire(libs.plugins.kotlin.ksp) apply false
|
||||
}
|
1
demo-app/.gitignore
vendored
1
demo-app/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
/build
|
@@ -1,58 +0,0 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
}
|
||||
|
||||
android {
|
||||
signingConfigs {
|
||||
debug {
|
||||
storeFile file('../keystore/public')
|
||||
storePassword '123456'
|
||||
keyAlias 'public'
|
||||
keyPassword '123456'
|
||||
v1SigningEnabled true
|
||||
v2SigningEnabled true
|
||||
}
|
||||
}
|
||||
|
||||
compileSdk 33
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.highcapable.yukihookapi.demo_app"
|
||||
minSdk 21
|
||||
targetSdk 33
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
signingConfig signingConfigs.debug
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '11'
|
||||
}
|
||||
buildFeatures {
|
||||
viewBinding true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'androidx.core:core-ktx:1.9.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.6.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'
|
||||
implementation 'com.google.android.material:material:1.8.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
||||
}
|
@@ -1,36 +0,0 @@
|
||||
package com.highcapable.yukihookapi.demo_app.test;
|
||||
|
||||
public class Main extends SuperMain {
|
||||
|
||||
private final String content;
|
||||
|
||||
public Main() {
|
||||
super("");
|
||||
content = "";
|
||||
}
|
||||
|
||||
public Main(String content) {
|
||||
super(content);
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getTestResultFirst() {
|
||||
return "The world is beautiful";
|
||||
}
|
||||
|
||||
public String getTestResultFirst(String string) {
|
||||
return string;
|
||||
}
|
||||
|
||||
public String getTestResultLast() {
|
||||
return "The world is fantastic";
|
||||
}
|
||||
|
||||
public final String getTestResultLast(String string) {
|
||||
return string;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
}
|
@@ -1,22 +0,0 @@
|
||||
package com.highcapable.yukihookapi.demo_app.test;
|
||||
|
||||
public class SuperMain {
|
||||
|
||||
private final String content;
|
||||
|
||||
public SuperMain(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getSuperString() {
|
||||
return "The sea is blue";
|
||||
}
|
||||
|
||||
public String getString() {
|
||||
return getContent();
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
}
|
@@ -1,70 +0,0 @@
|
||||
/*
|
||||
* YukiHookAPI - An efficient Hook API and Xposed Module solution built in Kotlin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiHookAPI
|
||||
*
|
||||
* MIT License
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This file is Created by fankes on 2022/2/9.
|
||||
*/
|
||||
@file:Suppress("SameParameterValue", "UsePropertyAccessSyntax")
|
||||
|
||||
package com.highcapable.yukihookapi.demo_app.ui
|
||||
|
||||
import android.os.Bundle
|
||||
import android.widget.Toast
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.highcapable.yukihookapi.demo_app.databinding.ActivityMainBinding
|
||||
import com.highcapable.yukihookapi.demo_app.test.Main
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
ActivityMainBinding.inflate(layoutInflater).apply {
|
||||
setContentView(root)
|
||||
appDemoFirstText.text = getFirstText()
|
||||
appDemoSecondText.text = secondText
|
||||
appDemoThirdText.text = Main("Feel real").getString()
|
||||
appDemoFourthText.text = getRegularText("Have fun day")
|
||||
appDemoFifthText.text = getDataText()
|
||||
appDemoSixthText.text = getArray(arrayOf("apple", "banana")).let { "${it[0]}, ${it[1]}" }
|
||||
appDemoSeventhText.text = Main().getTestResultFirst()
|
||||
appDemoEighthText.text = Main().getTestResultFirst("Find something interesting")
|
||||
appDemoNinthText.text = Main().getTestResultLast()
|
||||
appDemoTenthText.text = Main().getTestResultLast("This is the last sentence")
|
||||
appDemoEleventhText.text = Main().getSuperString()
|
||||
appDemoButton.setOnClickListener { toast() }
|
||||
}
|
||||
}
|
||||
|
||||
private val secondText = "This is a miracle"
|
||||
|
||||
private fun getArray(array: Array<String>) = array
|
||||
|
||||
private fun getFirstText() = "Hello World!"
|
||||
|
||||
private fun getRegularText(string: String) = string
|
||||
|
||||
private fun getDataText() = "No data found"
|
||||
|
||||
private fun toast() = Toast.makeText(this, "Nothing to show", Toast.LENGTH_SHORT).show()
|
||||
}
|
@@ -1,132 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fillViewport="true"
|
||||
android:scrollbars="none"
|
||||
tools:ignore="HardcodedText,ContentDescription">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:src="@mipmap/ic_face_unhappy" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="25dp"
|
||||
android:text="@string/test_string"
|
||||
android:textSize="17.5sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_demo_first_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="sample"
|
||||
android:textSize="17.5sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_demo_second_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="sample"
|
||||
android:textSize="17.5sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_demo_eleventh_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="sample"
|
||||
android:textSize="17.5sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_demo_third_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="sample"
|
||||
android:textSize="17.5sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_demo_fourth_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="sample"
|
||||
android:textSize="17.5sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_demo_seventh_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="sample"
|
||||
android:textSize="17.5sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_demo_eighth_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="sample"
|
||||
android:textSize="17.5sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_demo_ninth_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="sample"
|
||||
android:textSize="17.5sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_demo_tenth_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="sample"
|
||||
android:textSize="17.5sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_demo_sixth_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="sample"
|
||||
android:textSize="17.5sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_demo_fifth_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="sample"
|
||||
android:textSize="17.5sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:src="@android:mipmap/sym_def_app_icon" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/app_demo_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Click Me!"
|
||||
android:textAllCaps="false" />
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
3
demo-module/.gitignore
vendored
3
demo-module/.gitignore
vendored
@@ -1,3 +0,0 @@
|
||||
/build
|
||||
/src/main/assets/xposed_init
|
||||
/src/main/resources/META-INF/yukihookapi_init
|
@@ -1,72 +0,0 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
id 'com.google.devtools.ksp' version '1.7.22-1.0.8'
|
||||
}
|
||||
|
||||
android {
|
||||
signingConfigs {
|
||||
debug {
|
||||
storeFile file('../keystore/public')
|
||||
storePassword '123456'
|
||||
keyAlias 'public'
|
||||
keyPassword '123456'
|
||||
v1SigningEnabled true
|
||||
v2SigningEnabled true
|
||||
}
|
||||
}
|
||||
|
||||
compileSdk 33
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.highcapable.yukihookapi.demo_module"
|
||||
minSdk 21
|
||||
targetSdk 33
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
signingConfig signingConfigs.debug
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '11'
|
||||
freeCompilerArgs = [
|
||||
'-Xno-param-assertions',
|
||||
'-Xno-call-assertions',
|
||||
'-Xno-receiver-assertions'
|
||||
]
|
||||
}
|
||||
buildFeatures {
|
||||
viewBinding true
|
||||
}
|
||||
aaptOptions.additionalParameters '--allow-reserved-package-id', '--package-id', '0x64'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Used 82 API Version
|
||||
compileOnly 'de.robv.android.xposed:api:82'
|
||||
// Implementation API
|
||||
implementation project(':yukihookapi')
|
||||
// Implementation Processor
|
||||
ksp project(':yukihookapi-ksp-xposed')
|
||||
implementation 'androidx.preference:preference-ktx:1.2.0'
|
||||
implementation 'androidx.core:core-ktx:1.9.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.6.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'
|
||||
implementation 'com.google.android.material:material:1.8.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
* YukiHookAPI - An efficient Hook API and Xposed Module solution built in Kotlin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiHookAPI
|
||||
*
|
||||
* MIT License
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This file is Created by fankes on 2022/4/15.
|
||||
*/
|
||||
package com.highcapable.yukihookapi.demo_module.application
|
||||
|
||||
import com.highcapable.yukihookapi.hook.log.loggerD
|
||||
import com.highcapable.yukihookapi.hook.xposed.application.ModuleApplication
|
||||
|
||||
class DemoApplication : ModuleApplication() {
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
loggerD(msg = "I am running in module space")
|
||||
}
|
||||
}
|
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* YukiHookAPI - An efficient Hook API and Xposed Module solution built in Kotlin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiHookAPI
|
||||
*
|
||||
* MIT License
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This file is Created by fankes on 2022/3/27.
|
||||
*/
|
||||
package com.highcapable.yukihookapi.demo_module.data
|
||||
|
||||
import com.highcapable.yukihookapi.hook.xposed.channel.data.ChannelData
|
||||
import com.highcapable.yukihookapi.hook.xposed.prefs.data.PrefsData
|
||||
|
||||
object DataConst {
|
||||
|
||||
val TEST_KV_DATA = PrefsData("test_data", "Test data is nothing")
|
||||
|
||||
val TEST_CN_DATA = ChannelData<String>("key_from_host")
|
||||
}
|
@@ -1,62 +0,0 @@
|
||||
/*
|
||||
* YukiHookAPI - An efficient Hook API and Xposed Module solution built in Kotlin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiHookAPI
|
||||
*
|
||||
* MIT License
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This file is Created by fankes on 2022/8/16.
|
||||
*/
|
||||
package com.highcapable.yukihookapi.demo_module.hook.factory
|
||||
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.util.TypedValue
|
||||
import android.widget.Button
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import com.highcapable.yukihookapi.hook.factory.current
|
||||
|
||||
/**
|
||||
* Fixed [AlertDialog] dialog button issue after injecting Module App's Resources in some Host Apps
|
||||
*
|
||||
* Reset button text color and background by reflection [Drawable]
|
||||
*
|
||||
* 修复 [AlertDialog] 对话框按钮在一些宿主中注入模块资源后会发生问题
|
||||
*
|
||||
* 通过反射重新设置按钮的文字颜色和背景 [Drawable]
|
||||
* @return [AlertDialog]
|
||||
*/
|
||||
fun AlertDialog.compatStyle(): AlertDialog {
|
||||
current().field { name = "mAlert" }.current {
|
||||
arrayOf(
|
||||
field { name = "mButtonPositive" }.cast<Button>(),
|
||||
field { name = "mButtonNegative" }.cast<Button>(),
|
||||
field { name = "mButtonNeutral" }.cast<Button>()
|
||||
).forEach {
|
||||
it?.setBackgroundResource(TypedValue().apply {
|
||||
context.theme.resolveAttribute(android.R.attr.selectableItemBackground, this, true)
|
||||
}.resourceId)
|
||||
it?.setTextColor(TypedValue().apply {
|
||||
context.theme.resolveAttribute(android.R.attr.colorPrimary, this, true)
|
||||
}.data)
|
||||
}
|
||||
}
|
||||
return this
|
||||
}
|
@@ -1,129 +0,0 @@
|
||||
/*
|
||||
* YukiHookAPI - An efficient Kotlin version of the Xposed Hook API.
|
||||
* Copyright (C) 2019-2022 HighCapable
|
||||
* https://github.com/fankes/YukiHookAPI
|
||||
*
|
||||
* MIT License
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This file is Created by fankes on 2022/5/25.
|
||||
*/
|
||||
package com.highcapable.yukihookapi.demo_module.hook.java;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.highcapable.yukihookapi.YukiHookAPI;
|
||||
import com.highcapable.yukihookapi.hook.log.YukiHookLogger;
|
||||
import com.highcapable.yukihookapi.hook.xposed.bridge.event.YukiXposedEvent;
|
||||
import com.highcapable.yukihookapi.hook.xposed.proxy.IYukiHookXposedInit;
|
||||
|
||||
import kotlin.Unit;
|
||||
|
||||
// ========
|
||||
// This only demonstrates how to use it in the Java case (Java 1.8+ only)
|
||||
// The code here is for demonstration only, does not mean that it will work in the future, Demo will only sync the latest Kotlin usage
|
||||
// It is recommended to use Kotlin to complete the writing of the Hook part
|
||||
// Please remove the code note "//" below to use this demo, but make sure to comment out the HookEntry annotation on the Kotlin side
|
||||
// 这里仅演示了 Java 情况下的使用方式 (仅限 Java 1.8+)
|
||||
// 这里的代码仅供演示 - 并不代表今后都可以正常运行 - Demo 只会同步最新的 Kotlin 使用方法
|
||||
// 建议还是使用 Kotlin 来完成 Hook 部分的编写
|
||||
// 请删除下方的注释 "//" 以使用此 Demo - 但要确保注释掉 Kotlin 一边的 HookEntry 的注解
|
||||
// ========
|
||||
// @InjectYukiHookWithXposed
|
||||
public class HookEntry implements IYukiHookXposedInit {
|
||||
|
||||
@Override
|
||||
public void onInit() {
|
||||
YukiHookAPI.Configs config = YukiHookAPI.Configs.INSTANCE;
|
||||
YukiHookLogger.Configs.INSTANCE.setTag("YukiHookAPI-Demo");
|
||||
YukiHookLogger.Configs.INSTANCE.setEnable(true);
|
||||
YukiHookLogger.Configs.INSTANCE.setRecord(false);
|
||||
YukiHookLogger.Configs.INSTANCE.elements(
|
||||
YukiHookLogger.Configs.TAG,
|
||||
YukiHookLogger.Configs.PRIORITY,
|
||||
YukiHookLogger.Configs.PACKAGE_NAME,
|
||||
YukiHookLogger.Configs.USER_ID
|
||||
);
|
||||
config.setDebug(true);
|
||||
config.setEnableModulePrefsCache(true);
|
||||
config.setEnableModuleAppResourcesCache(true);
|
||||
config.setEnableHookModuleStatus(true);
|
||||
config.setEnableDataChannel(true);
|
||||
config.setEnableMemberCache(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHook() {
|
||||
// Here is the Java writing method that is more similar to the Kotlin writing method, just for reference
|
||||
// Calling Kotlin's lambda in Java also needs to return Unit.INSTANCE in the Unit case
|
||||
// 这里介绍了比较近似于 Kotlin 写法的 Java 写法 - 仅供参考
|
||||
// 在 Java 中调用 Kotlin 的 lambda 在 Unit 情况下也需要 return Unit.INSTANCE
|
||||
YukiHookAPI.INSTANCE.encase(e -> {
|
||||
e.loadZygote(l -> {
|
||||
l.hook(Activity.class, false, h -> {
|
||||
h.injectMember(h.getPRIORITY_DEFAULT(), "Default", i -> {
|
||||
i.method(m -> {
|
||||
m.setName("onCreate");
|
||||
m.param(Bundle.class);
|
||||
return null;
|
||||
});
|
||||
i.afterHook(a -> {
|
||||
Activity instance = ((Activity) a.getInstance());
|
||||
instance.setTitle(instance.getTitle() + " [Active]");
|
||||
return Unit.INSTANCE;
|
||||
});
|
||||
return Unit.INSTANCE;
|
||||
});
|
||||
return Unit.INSTANCE;
|
||||
});
|
||||
return Unit.INSTANCE;
|
||||
});
|
||||
// The rest of the code has been omitted, you can continue to refer to the above method to complete
|
||||
// 余下部分代码已略 - 可继续参考上述方式完成
|
||||
// ...
|
||||
return Unit.INSTANCE;
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onXposedEvent() {
|
||||
// Since Java does not support some methods that do not override Kotlin Interface
|
||||
// So this method is not needed here, you can leave the content blank
|
||||
// 由于 Java 不支持不重写 Kotlin Interface 的部分方法
|
||||
// 所以不需要此方法这里可以不填写内容
|
||||
YukiXposedEvent event = YukiXposedEvent.INSTANCE;
|
||||
event.onInitZygote(startupParam -> {
|
||||
// Write the startupParam method here
|
||||
// 这里编写 startupParam 方法
|
||||
return Unit.INSTANCE;
|
||||
});
|
||||
event.onHandleLoadPackage(loadPackageParam -> {
|
||||
// Write the loadPackageParam method here
|
||||
// 这里编写 loadPackageParam 方法
|
||||
return Unit.INSTANCE;
|
||||
});
|
||||
event.onHandleInitPackageResources(resourcesParam -> {
|
||||
// Write the resourcesParam method here
|
||||
// 这里编写 resourcesParam 方法
|
||||
return Unit.INSTANCE;
|
||||
});
|
||||
}
|
||||
}
|
@@ -1,114 +0,0 @@
|
||||
/*
|
||||
* YukiHookAPI - An efficient Hook API and Xposed Module solution built in Kotlin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiHookAPI
|
||||
*
|
||||
* MIT License
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This file is Created by fankes on 2022/1/29.
|
||||
*/
|
||||
@file:Suppress("SetTextI18n")
|
||||
|
||||
package com.highcapable.yukihookapi.demo_module.ui
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.widget.Toast
|
||||
import com.highcapable.yukihookapi.YukiHookAPI
|
||||
import com.highcapable.yukihookapi.demo_module.R
|
||||
import com.highcapable.yukihookapi.demo_module.data.DataConst
|
||||
import com.highcapable.yukihookapi.demo_module.databinding.ActivityMainBinding
|
||||
import com.highcapable.yukihookapi.hook.factory.dataChannel
|
||||
import com.highcapable.yukihookapi.hook.factory.modulePrefs
|
||||
import com.highcapable.yukihookapi.hook.xposed.parasitic.activity.base.ModuleAppCompatActivity
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
class MainActivity : ModuleAppCompatActivity() {
|
||||
|
||||
override val moduleTheme get() = R.style.Theme_Default
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
ActivityMainBinding.inflate(layoutInflater).apply {
|
||||
setContentView(root)
|
||||
moduleEnvironment {
|
||||
dataChannel(packageName = "com.highcapable.yukihookapi.demo_app").with {
|
||||
wait(DataConst.TEST_CN_DATA) {
|
||||
Toast.makeText(applicationContext, it, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
moduleDemoActiveText.text = "Module is Active:${YukiHookAPI.Status.isModuleActive}"
|
||||
moduleDemoActiveZhText.text = "Xposed 模块激活状态"
|
||||
moduleDemoFrameworkText.text = "Hook Framework:${YukiHookAPI.Status.Executor.name}"
|
||||
moduleDemoFrameworkZhText.text = "当前的 Hook 框架"
|
||||
moduleDemoApiVersionText.text = "Xposed API Version:${YukiHookAPI.Status.Executor.apiLevel}"
|
||||
moduleDemoApiVersionZhText.text = "Xposed API 版本"
|
||||
moduleDemoYukiHookApiVersionText.text = "YukiHookAPI Version:${YukiHookAPI.API_VERSION_NAME}(${YukiHookAPI.API_VERSION_CODE})"
|
||||
moduleDemoYukiHookApiVersionZhText.text = "YukiHookAPI 版本"
|
||||
moduleDemoNewXshareText.text =
|
||||
"${if (YukiHookAPI.Status.isXposedEnvironment) "XSharedPreferences Readable" else "New XSharedPreferences"}:${modulePrefs.isPreferencesAvailable}"
|
||||
moduleDemoNewXshareZhText.text =
|
||||
if (YukiHookAPI.Status.isXposedEnvironment) "XSharedPreferences 是否可用" else "New XSharedPreferences 支持状态"
|
||||
moduleDemoResHookText.text = "Support Resources Hook:${YukiHookAPI.Status.isSupportResourcesHook}"
|
||||
moduleDemoResHookZhText.text = "资源钩子支持状态"
|
||||
moduleDemoComTimeStampText.text =
|
||||
"Compiled Time:${SimpleDateFormat.getDateTimeInstance().format(Date(YukiHookAPI.Status.compiledTimestamp))}"
|
||||
moduleDemoEditText.also {
|
||||
hostEnvironment {
|
||||
it.isEnabled = false
|
||||
moduleDemoButton.isEnabled = false
|
||||
}
|
||||
it.setText(modulePrefs.get(DataConst.TEST_KV_DATA))
|
||||
moduleDemoButton.setOnClickListener { _ ->
|
||||
moduleEnvironment {
|
||||
if (it.text.toString().isNotEmpty()) {
|
||||
modulePrefs.put(DataConst.TEST_KV_DATA, it.text.toString())
|
||||
Toast.makeText(applicationContext, "Saved", Toast.LENGTH_SHORT).show()
|
||||
} else Toast.makeText(applicationContext, "Please enter the text", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
moduleDemoFrgButton.setOnClickListener { startActivity(Intent(this@MainActivity, PreferenceActivity::class.java)) }
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Running only in (Xposed) Host environment
|
||||
*
|
||||
* 仅在 (Xposed) 宿主环境执行
|
||||
* @param callback Running in the (Xposed) Host environment / 在宿主环境执行
|
||||
*/
|
||||
private inline fun hostEnvironment(callback: () -> Unit) {
|
||||
if (YukiHookAPI.Status.isXposedEnvironment) callback()
|
||||
}
|
||||
|
||||
/**
|
||||
* Running only in Module environment
|
||||
*
|
||||
* 仅在模块环境执行
|
||||
* @param callback Running in the Module environment / 在模块环境执行
|
||||
*/
|
||||
private inline fun moduleEnvironment(callback: () -> Unit) {
|
||||
if (YukiHookAPI.Status.isXposedEnvironment.not()) callback()
|
||||
}
|
||||
}
|
@@ -1,64 +0,0 @@
|
||||
/*
|
||||
* YukiHookAPI - An efficient Hook API and Xposed Module solution built in Kotlin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiHookAPI
|
||||
*
|
||||
* MIT License
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This file is Created by fankes on 2022/4/18.
|
||||
*/
|
||||
package com.highcapable.yukihookapi.demo_module.ui
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.preference.SwitchPreference
|
||||
import com.highcapable.yukihookapi.YukiHookAPI
|
||||
import com.highcapable.yukihookapi.demo_module.R
|
||||
import com.highcapable.yukihookapi.hook.xposed.parasitic.activity.base.ModuleAppCompatActivity
|
||||
import com.highcapable.yukihookapi.hook.xposed.prefs.ui.ModulePreferenceFragment
|
||||
|
||||
class PreferenceActivity : ModuleAppCompatActivity() {
|
||||
|
||||
override val moduleTheme get() = R.style.Theme_Default
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
title = "PreferenceFragment"
|
||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||
if (savedInstanceState == null)
|
||||
supportFragmentManager
|
||||
.beginTransaction()
|
||||
.replace(android.R.id.content, SettingsFragment())
|
||||
.commitAllowingStateLoss()
|
||||
}
|
||||
|
||||
override fun onSupportNavigateUp(): Boolean {
|
||||
onBackPressedDispatcher.onBackPressed()
|
||||
return true
|
||||
}
|
||||
|
||||
class SettingsFragment : ModulePreferenceFragment() {
|
||||
|
||||
override fun onCreatePreferencesInModuleApp(savedInstanceState: Bundle?, rootKey: String?) {
|
||||
setPreferencesFromResource(R.xml.settings_preferences, rootKey)
|
||||
findPreference<SwitchPreference>("show_dialog_when_demo_app_opend")?.isEnabled = YukiHookAPI.Status.isXposedEnvironment.not()
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,213 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fillViewport="true"
|
||||
android:scrollbars="none"
|
||||
tools:ignore="HardcodedText">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="50dp"
|
||||
android:layout_marginRight="50dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:gravity="center|start"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_demo_active_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center|start"
|
||||
android:singleLine="true"
|
||||
android:text="sample"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_demo_active_zh_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:alpha="0.85"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center|start"
|
||||
android:singleLine="true"
|
||||
android:text="sample"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_demo_framework_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center|start"
|
||||
android:singleLine="true"
|
||||
android:text="sample"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_demo_framework_zh_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:alpha="0.85"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center|start"
|
||||
android:singleLine="true"
|
||||
android:text="sample"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_demo_api_version_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center|start"
|
||||
android:singleLine="true"
|
||||
android:text="sample"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_demo_api_version_zh_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:alpha="0.85"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center|start"
|
||||
android:singleLine="true"
|
||||
android:text="sample"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_demo_yuki_hook_api_version_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center|start"
|
||||
android:singleLine="true"
|
||||
android:text="sample"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_demo_yuki_hook_api_version_zh_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:alpha="0.85"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center|start"
|
||||
android:singleLine="true"
|
||||
android:text="sample"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_demo_new_xshare_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center|start"
|
||||
android:singleLine="true"
|
||||
android:text="sample"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_demo_new_xshare_zh_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:alpha="0.85"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center|start"
|
||||
android:singleLine="true"
|
||||
android:text="sample"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_demo_res_hook_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center|start"
|
||||
android:singleLine="true"
|
||||
android:text="sample"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_demo_res_hook_zh_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="25dp"
|
||||
android:alpha="0.85"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center|start"
|
||||
android:singleLine="true"
|
||||
android:text="sample"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center|start"
|
||||
android:singleLine="true"
|
||||
android:text="Leave something in there"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/module_demo_edit_text"
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Please enter the text"
|
||||
android:singleLine="true"
|
||||
android:textSize="18sp"
|
||||
tools:ignore="Autofill,LabelFor,TextFields" />
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/module_demo_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="Save Test Data"
|
||||
android:textAllCaps="false" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/module_demo_frg_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Open PreferenceFragment"
|
||||
android:textAllCaps="false" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_demo_com_time_stamp_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="25dp"
|
||||
android:alpha="0.45"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center|start"
|
||||
android:singleLine="true"
|
||||
android:text="placeholder"
|
||||
android:textSize="13sp" />
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
@@ -1,3 +0,0 @@
|
||||
<resources>
|
||||
<string name="app_name">YukiHookDemoModule</string>
|
||||
</resources>
|
7
docs-source/.gitignore
vendored
7
docs-source/.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
node_modules
|
||||
src/.vuepress/.cache
|
||||
src/.vuepress/.temp
|
||||
/node_modules
|
||||
/src/.vuepress/.cache
|
||||
/src/.vuepress/.temp
|
||||
/dist
|
@@ -1,15 +1,16 @@
|
||||
{
|
||||
"name": "yukihookapi_docs",
|
||||
"license": "MIT",
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@mr-hope/vuepress-plugin-copy-code": "^1.30.0",
|
||||
"@vuepress/plugin-prismjs": "^2.0.0-beta.51",
|
||||
"@vuepress/plugin-search": "^2.0.0-beta.51",
|
||||
"@vuepress/plugin-shiki": "^2.0.0-beta.51",
|
||||
"vuepress": "^2.0.0-beta.51"
|
||||
"@vuepress/plugin-prismjs": "2.0.0-rc.0",
|
||||
"@vuepress/plugin-search": "2.0.0-rc.0",
|
||||
"@vuepress/plugin-shiki": "2.0.0-rc.0",
|
||||
"vuepress": "2.0.0-rc.0"
|
||||
},
|
||||
"scripts": {
|
||||
"docs:dev": "vuepress dev src",
|
||||
"docs:build": "vuepress build src"
|
||||
"docs:build": "vuepress build src",
|
||||
"docs:build-gh-pages": "vuepress build src && touch dist/.nojekyll"
|
||||
}
|
||||
}
|
@@ -25,7 +25,7 @@ export default {
|
||||
navbar: navBarItems['/en/'],
|
||||
selectLanguageText: 'English (US)',
|
||||
selectLanguageName: 'English',
|
||||
editLinkText: 'Edit this page on Github',
|
||||
editLinkText: 'Edit this page on GitHub',
|
||||
tip: 'Tips',
|
||||
warning: 'Notice',
|
||||
danger: 'Pay Attention',
|
||||
@@ -34,7 +34,7 @@ export default {
|
||||
navbar: navBarItems['/zh-cn/'],
|
||||
selectLanguageText: '简体中文 (CN)',
|
||||
selectLanguageName: '简体中文',
|
||||
editLinkText: '在 Github 上编辑此页',
|
||||
editLinkText: '在 GitHub 上编辑此页',
|
||||
notFound: ['这里什么都没有', '我们怎么到这来了?', '这是一个 404 页面', '看起来我们进入了错误的链接'],
|
||||
backToHome: '回到首页',
|
||||
contributorsText: '贡献者',
|
||||
|
@@ -5,6 +5,7 @@ const baseApiPath = '/api/public/com/highcapable/yukihookapi/';
|
||||
const navigationLinks = {
|
||||
start: [
|
||||
'/guide/home',
|
||||
'/guide/supportive',
|
||||
'/guide/knowledge',
|
||||
'/guide/quick-start',
|
||||
'/guide/example',
|
||||
@@ -15,6 +16,8 @@ const navigationLinks = {
|
||||
'/config/api-exception',
|
||||
'/config/xposed-using',
|
||||
'/config/api-using',
|
||||
'/config/move-to-api-1-2-x',
|
||||
'/config/move-to-api-1-3-x',
|
||||
'/config/r8-proguard'
|
||||
],
|
||||
tools: '/tools/yukihookapi-projectbuilder',
|
||||
@@ -29,7 +32,7 @@ const navigationLinks = {
|
||||
baseApiPath + 'hook/param/HookParam',
|
||||
baseApiPath + 'annotation/xposed/InjectYukiHookWithXposed',
|
||||
baseApiPath + 'hook/xposed/proxy/IYukiHookXposedInit',
|
||||
baseApiPath + 'hook/xposed/prefs/YukiHookModulePrefs',
|
||||
baseApiPath + 'hook/xposed/prefs/YukiHookPrefsBridge',
|
||||
baseApiPath + 'hook/xposed/prefs/ui/ModulePreferenceFragment',
|
||||
baseApiPath + 'hook/xposed/prefs/data/PrefsData',
|
||||
baseApiPath + 'hook/xposed/channel/YukiHookDataChannel',
|
||||
@@ -49,10 +52,13 @@ const navigationLinks = {
|
||||
baseApiPath + 'hook/type/android/ViewTypeFactory',
|
||||
baseApiPath + 'hook/type/java/VariableTypeFactory',
|
||||
baseApiPath + 'hook/type/defined/DefinedTypeFactory',
|
||||
baseApiPath + 'hook/log/LoggerFactory',
|
||||
baseApiPath + 'hook/log/YLog',
|
||||
baseApiPath + 'hook/log/data/YLogData',
|
||||
baseApiPath + 'hook/factory/ReflectionFactory',
|
||||
baseApiPath + 'hook/factory/YukiHookFactory',
|
||||
baseApiPath + 'hook/entity/YukiBaseHooker',
|
||||
baseApiPath + 'hook/core/api/compat/type/ExecutorType',
|
||||
baseApiPath + 'hook/core/api/priority/YukiHookPriority',
|
||||
baseApiPath + 'hook/core/YukiMemberHookCreator',
|
||||
baseApiPath + 'hook/core/YukiResourcesHookCreator',
|
||||
baseApiPath + 'hook/core/finder/members/MethodFinder',
|
||||
@@ -93,7 +99,7 @@ const navigationLinks = {
|
||||
|
||||
export const configs = {
|
||||
dev: {
|
||||
dest: '../docs/',
|
||||
dest: 'dist',
|
||||
port: 9000
|
||||
},
|
||||
website: {
|
||||
@@ -113,7 +119,7 @@ export const configs = {
|
||||
}
|
||||
},
|
||||
github: {
|
||||
repo: 'https://github.com/fankes/YukiHookAPI',
|
||||
repo: 'https://github.com/HighCapable/YukiHookAPI',
|
||||
branch: 'master',
|
||||
dir: 'docs-source/src'
|
||||
}
|
||||
@@ -126,10 +132,11 @@ export const navBarItems = {
|
||||
text: 'Get Started',
|
||||
children: [
|
||||
{ text: 'Introduce', link: i18n.string(navigationLinks.start[0], 'en') },
|
||||
{ text: 'Basic Knowledge', link: i18n.string(navigationLinks.start[1], 'en') },
|
||||
{ text: 'Quick Start', link: i18n.string(navigationLinks.start[2], 'en') },
|
||||
{ text: 'Usage Example', link: i18n.string(navigationLinks.start[3], 'en') },
|
||||
{ text: 'Migrate from Xposed API', link: i18n.string(navigationLinks.start[4], 'en') }
|
||||
{ text: 'Supportive', link: i18n.string(navigationLinks.start[1], 'en') },
|
||||
{ text: 'Basic Knowledge', link: i18n.string(navigationLinks.start[2], 'en') },
|
||||
{ text: 'Quick Start', link: i18n.string(navigationLinks.start[3], 'en') },
|
||||
{ text: 'Usage Example', link: i18n.string(navigationLinks.start[4], 'en') },
|
||||
{ text: 'Migrate from Other Hook APIs', link: i18n.string(navigationLinks.start[5], 'en') }
|
||||
]
|
||||
}, {
|
||||
text: 'Configs',
|
||||
@@ -138,7 +145,9 @@ export const navBarItems = {
|
||||
{ text: 'API Exception Handling', link: i18n.string(navigationLinks.config[1], 'en') },
|
||||
{ text: 'Use as Xposed Module Configs', link: i18n.string(navigationLinks.config[2], 'en') },
|
||||
{ text: 'Use as Hook API Configs', link: i18n.string(navigationLinks.config[3], 'en') },
|
||||
{ text: 'R8 & Proguard Obfuscate', link: i18n.string(navigationLinks.config[4], 'en') }
|
||||
{ text: 'Migrate to YukiHookAPI 1.2.x', link: i18n.string(navigationLinks.config[4], 'en') },
|
||||
{ text: 'Migrate to YukiHookAPI 1.3.x', link: i18n.string(navigationLinks.config[5], 'en') },
|
||||
{ text: 'R8 & Proguard Obfuscate', link: i18n.string(navigationLinks.config[6], 'en') }
|
||||
]
|
||||
}, {
|
||||
text: 'Tools',
|
||||
@@ -175,10 +184,11 @@ export const navBarItems = {
|
||||
text: '入门',
|
||||
children: [
|
||||
{ text: '介绍', link: i18n.string(navigationLinks.start[0], 'zh-cn') },
|
||||
{ text: '基础知识', link: i18n.string(navigationLinks.start[1], 'zh-cn') },
|
||||
{ text: '快速开始', link: i18n.string(navigationLinks.start[2], 'zh-cn') },
|
||||
{ text: '用法示例', link: i18n.string(navigationLinks.start[3], 'zh-cn') },
|
||||
{ text: '从 Xposed API 迁移', link: i18n.string(navigationLinks.start[4], 'zh-cn') }
|
||||
{ text: '支持性', link: i18n.string(navigationLinks.start[1], 'zh-cn') },
|
||||
{ text: '基础知识', link: i18n.string(navigationLinks.start[2], 'zh-cn') },
|
||||
{ text: '快速开始', link: i18n.string(navigationLinks.start[3], 'zh-cn') },
|
||||
{ text: '用法示例', link: i18n.string(navigationLinks.start[4], 'zh-cn') },
|
||||
{ text: '从其它 Hook API 迁移', link: i18n.string(navigationLinks.start[5], 'zh-cn') }
|
||||
]
|
||||
}, {
|
||||
text: '配置',
|
||||
@@ -187,7 +197,9 @@ export const navBarItems = {
|
||||
{ text: 'API 异常处理', link: i18n.string(navigationLinks.config[1], 'zh-cn') },
|
||||
{ text: '作为 Xposed 模块使用的相关配置', link: i18n.string(navigationLinks.config[2], 'zh-cn') },
|
||||
{ text: '作为 Hook API 使用的相关配置', link: i18n.string(navigationLinks.config[3], 'zh-cn') },
|
||||
{ text: 'R8 与 Proguard 混淆', link: i18n.string(navigationLinks.config[4], 'zh-cn') }
|
||||
{ text: '迁移至 YukiHookAPI 1.2.x', link: i18n.string(navigationLinks.config[4], 'zh-cn') },
|
||||
{ text: '迁移至 YukiHookAPI 1.3.x', link: i18n.string(navigationLinks.config[5], 'zh-cn') },
|
||||
{ text: 'R8 与 Proguard 混淆', link: i18n.string(navigationLinks.config[6], 'zh-cn') }
|
||||
]
|
||||
}, {
|
||||
text: '工具',
|
||||
|
@@ -1,33 +1,27 @@
|
||||
# About this Document
|
||||
# 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)
|
||||
[Apache-2.0](https://github.com/HighCapable/YukiHookAPI/blob/master/LICENSE)
|
||||
|
||||
```:no-line-numbers
|
||||
MIT License
|
||||
Apache License Version 2.0
|
||||
|
||||
Copyright (C) 2019-2023 HighCapable
|
||||
Copyright (C) 2019 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:
|
||||
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
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
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.
|
||||
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-2023 HighCapable
|
||||
Copyright © 2019 HighCapable
|
@@ -16,9 +16,96 @@ Time zone of version release date: **UTC+8**
|
||||
|
||||
:::
|
||||
|
||||
### 1.1.8 | 2023.02.01  <Badge type="tip" text="latest" vertical="middle" />
|
||||
### 1.3.0 | 2024.06.25  <Badge type="tip" text="latest" vertical="middle" />
|
||||
|
||||
- Fixed the problem that the underlying Hook method cannot update the modified state synchronously when modifying parameters such as `result` during callback, thanks to the [Issue](https://github.com/fankes/YukiHookAPI/issues/23) of [Yongzheng Lai](https://github.com/elvizlai)
|
||||
- This is a major update, please refer to [Migrate to YukiHookAPI 1.3.x](https://highcapable.github.io/YukiHookAPI/zh-cn/config/move-to-api-1-3-x)
|
||||
- The reflection API of `YukiHookAPI` is deprecated, please move to the brand new [KavaRef](https://github.com/HighCapable/KavaRef)
|
||||
- The limitation of duplicate Hooks has been deprecated, now you can repeat the same method of the Hook
|
||||
- Deprecated ~~`ModuleAppActivity`~~, ~~`ModuleAppCompatActivity`~~, please use `ModuleActivity` to create your own proxy `Activity`
|
||||
- `YLog` is now allowed to pass `msg` into any object and will be automatically converted to a string for printing
|
||||
- `FreeReflection` has been deprecated and has now switched to [AndroidHiddenApiBypass](https://github.com/LSPosed/AndroidHiddenApiBypass)
|
||||
|
||||
### 1.2.1 | 2024.06.20  <Badge type="warning" text="stale" vertical="middle" />
|
||||
|
||||
- Catch exceptions in singleton Hooker to prevent it from blocking the entire process
|
||||
- Add automatic use of "`" in the automatic handler to fix the situation where Kotlin keywords are package names, thanks to [Fengning Zhu](https://github.com/zhufengning) for [PR](https://github.com/HighCapable/YukiHookAPI/pull/70)
|
||||
- Adapt to Kotlin 2.0.0+, fix the problem that it cannot be compiled during automatic processing, thanks to [xihan123](https://github.com/xihan123) for [PR](https://github.com/HighCapable/YukiHookAPI/pull/76)
|
||||
|
||||
### 1.2.0 | 2023.10.07  <Badge type="warning" text="stale" vertical="middle" />
|
||||
|
||||
- The license agreement has been changed from `MIT` to `Apache-2.0`, subsequent versions will be distributed under this license agreement, you should change the relevant license agreement after using this version
|
||||
- This is a breaking update, please refer to [Migrate to YukiHookAPI 1.2.x](https://highcapable.github.io/YukiHookAPI/en/config/move-to-api-1-2-x) for details
|
||||
- Adapted to Android 14, thanks to [BlueCat300](https://github.com/BlueCat300) for [PR](https://github.com/HighCapable/YukiHookAPI/pull/44)
|
||||
- Fixed `findAllInterfaces` related issues, thanks to [buffcow](https://github.com/buffcow) for [PR](https://github.com/HighCapable/YukiHookAPI/pull/38)
|
||||
- Fixed the delayed callback problem in the Hook process, thanks to [cesaryuan](https://github.com/cesaryuan) for his [Issue](https://github.com/HighCapable/YukiHookAPI/issues/47)
|
||||
- Added support for Resources Hook related functions, please refer to this [Issue](https://github.com/HighCapable/YukiHookAPI/issues/36) for details
|
||||
- Added `YukiHookAPI.TAG`
|
||||
- Deprecated ~~`YukiHookAPI.API_VERSION_NAME`~~, ~~`YukiHookAPI.API_VERSION_CODE`~~, merged into `YukiHookAPI.VERSION`
|
||||
- Added `YukiHookAPI.TAG`
|
||||
- Deprecated ~~`YukiHookAPI.API_VERSION_NAME`~~, ~~`YukiHookAPI.API_VERSION_CODE`~~, merged into `YukiHookAPI.VERSION`
|
||||
- Deprecated ~~`useDangerousOperation`~~ method in `YukiMemberHookCreator`
|
||||
- Deprecated ~~`instanceClass`~~ function in `YukiMemberHookCreator`, it is no longer recommended
|
||||
- Modify `instanceClass` in `HookParam` to be a null safe return value type
|
||||
- Detach all Hook objects created using `injectMember` to `LegacyCreator`
|
||||
- Modify `appClassLoader` in `PackageParam` to be a null safe return value type
|
||||
- Refactor all `logger...` methods to new usage `YLog`
|
||||
- Removed the `-->` style behind the print log function
|
||||
- Fixed and improved the problem that the module package name cannot be obtained through KSP after using `namespace`
|
||||
- Functions such as whether to enable module activation status have now been moved to the `InjectYukiHookWithXposed` annotation
|
||||
- Detached [FreeReflection](https://github.com/tiann/FreeReflection) will no longer be automatically generated and will be automatically imported as a dependency
|
||||
- Added a warning log that will be automatically printed when the same Hook method is repeated
|
||||
- The `findClass(...)` method in `PackageParam` is obsolete, please migrate to the `"...".toClass()` method
|
||||
- The `String.hook { ... }` method in `PackageParam` is obsolete, and it is recommended to use a new method for Hook
|
||||
- `AppLifecycle` can now be created repeatedly in different Hookers
|
||||
- The old version of Hook priority writing is obsolete and migrated to `YukiHookPriority`
|
||||
- Removed the `tag` function in the Hook process
|
||||
- Refactored `remendy` functionality in find methods, which now prints exceptions in steps
|
||||
- The multi-method find result type is changed from `HashSet` to `MutableList`
|
||||
- Added `method()`, `constructor()`, `field()` to directly obtain all object functions in the class
|
||||
- `constructor()` no longer behaves like `constructor { emptyParam() }`
|
||||
- Added `lazyClass` and `lazyClassOrNull` methods to lazily load `Class`
|
||||
|
||||
### 1.1.11 | 2023.04.25  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Fixed a critical issue since `1.1.5` version where the `Member` cache did not take effect and persistent storage eventually caused app out of memory (OOM), thanks to [Art-Chen](https://github.com/Art-Chen)
|
||||
- Remove the direct cache function of `Member` and deprecated ~~`YukiReflection.Configs.isEnableMemberCache`~~, keep the cache function of `Class`
|
||||
- Modified finder to `Sequence`, optimize the finding speed and performance of `Member`
|
||||
- Remove the `YukiHookPrefsBridge`'s direct key-value cache function and removed `LruCache` related functions
|
||||
- Deprecated ~~`YukiHookAPI.Configs.isEnablePrefsBridgeCache`~~
|
||||
- Deprecated ~~`direct`~~, ~~`clearCache`~~ functions in `YukiHookPrefsBridge`
|
||||
|
||||
### 1.1.10 | 2023.04.21  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- The `Activity` proxy function adds the function of specifying a separate proxy `Activity` for each proxied `Activity`
|
||||
- Fixed problem that the `contains` and `all` methods in `YukiHookPrefsBridge` did not judge the `native` function
|
||||
- Integrate the cache function in `YukiHookPrefsBridge` into `PreferencesCacheManager` and use `LruCache` as a key-value pair cache
|
||||
- Modify `YukiHookPrefsBridge` key-value pair caching function to take effect in all environments (Module Apps, Host Apps)
|
||||
- Modify part of `HashMap` used for caching to `ArrayMap` to reduce memory consumption
|
||||
- Fix some other possible problems
|
||||
|
||||
### 1.1.9 | 2023.04.17  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Change the type of dependent library from **Java Library** (jar) to **Android Library** (aar)
|
||||
- Remove the inspection function of internal methods and parameters through Hook or reflection API
|
||||
- Fixed the problem that `YukiHookDataChannel` automatically segmented data sending function could not work normally (exception would still be thrown)
|
||||
- Added the ability to manually modify the maximum data byte size allowed by `YukiHookDataChannel` to be sent at one time according to the limitations of the target device
|
||||
- Remove the restriction that `YukiHookDataChannel` can only be used in module `Activity`, now you can use it anywhere
|
||||
- Modify and standardize the broadcast Action name used by `YukiHookDataChannel`
|
||||
- Fix the problem that `BadParcelableException` occurs when `YukiHookDataChannel` has different modules with the same host
|
||||
- Added `ExecutorType`, you can get the type of known Hook Framework through `YukiHookAPI.Status.Executor.type`
|
||||
- ~~`YukiHookModulePrefs`~~ renamed to `YukiHookPrefsBridge`
|
||||
- Modify `YukiHookPrefsBridge` to be implemented as a non-singleton, as a singleton may cause data confusion
|
||||
- Deprecated ~~`Context.modulePrefs(...)`~~ method, please move to `Context.prefs(...)`
|
||||
- `YukiHookPrefsBridge` adds `native` method, which supports storing private data in modules and hosts directly as native storage
|
||||
- Integrate the storage method in `YukiHookPrefsBridge` to `YukiHookPrefsBridge.Editor`, please use `edit` method to store data
|
||||
- `YukiHookPrefsBridge` adds `contains` method
|
||||
- Cache dynamically created proxy objects in `YukiHookPrefsBridge`, try to fix problems that may cause OOM in the host and modules
|
||||
- Modify the proxy class of the `Activity` proxy function to be dynamically generated to prevent conflicts caused by injecting different modules into the host
|
||||
- Fixed some other possible problems
|
||||
|
||||
### 1.1.8 | 2023.02.01  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Fixed the problem that the underlying Hook method cannot update the modified state synchronously when modifying parameters such as `result` during callback, thanks to the [Issue](https://github.com/HighCapable/YukiHookAPI/issues/23) of [Yongzheng Lai](https://github.com/elvizlai)
|
||||
- Move the entry class name file automatically generated by `YukiHookAPI` from `assets/yukihookapi_init` to `resources/META-INF/yukihookapi_init`
|
||||
- When only printing the exception stack, the `msg` parameter is allowed to be empty and the `msg` parameter can not be set, and the log with the `msg` parameter left blank will not be logged unless the exception stack is not empty
|
||||
- Fixed the bug that the log printed by the exception that occurs in the body of the Hook callback method has no specific method information
|
||||
@@ -30,7 +117,7 @@ Time zone of version release date: **UTC+8**
|
||||
- Fixed the problem that there may be multiple registration lifecycles in `PackageParam.AppLifecycle`
|
||||
- Revert: The 1.1.7 version has been withdrawn due to a serious problem, please update to this version directly (the update log is the same as version 1.1.7)
|
||||
|
||||
### 1.1.6 | 2023.01.21  <Badge type="warning" text="stale" vertical="middle" />
|
||||
### 1.1.6 | 2023.01.21  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Fixed the serious problem that `ClassLoader` does not match after `PackageParam` keeps a single instance when there may be multiple package names in the same process when Xposed Module is loaded
|
||||
- When the package name is not distinguished when there are multiple package names in the same process, stop loading the singleton child Hooker and print a warning message
|
||||
@@ -38,7 +125,7 @@ Time zone of version release date: **UTC+8**
|
||||
- Modify the method parameter name `param` of reflection calls in `MethodFinder`, `ConstructorFinder`, `ReflectionFactory` to `args`
|
||||
- Added the function of judging the parameters of the entry class constructor in the automatic processing program of the Xposed Module, the entry class needs to ensure that it does not have any constructor parameters
|
||||
|
||||
### 1.1.5 | 2023.01.13  <Badge type="warning" text="stale" vertical="middle" />
|
||||
### 1.1.5 | 2023.01.13  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Standardize and optimize the overall code style
|
||||
- Privatized some APIs called internally
|
||||
@@ -80,7 +167,7 @@ Time zone of version release date: **UTC+8**
|
||||
- Fixed the problem that the debug log data package name processed by `YukiHookLogger` may be incorrect in the (Xposed) Host environment
|
||||
- Fixed the problem that the package name may be incorrect on some systems (in some system apps) when the Xposed Module loads the Resource Hook event
|
||||
|
||||
### 1.1.4 | 2022.10.04  <Badge type="warning" text="stale" vertical="middle" />
|
||||
### 1.1.4 | 2022.10.04  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Fixed the issue that `YukiHookDataChannel` may not respond to broadcast events in the system framework, reproduced in A13
|
||||
- Fixed the issue that `YukiHookDataChannel` could not communicate with Module App in Host App for multiple versions
|
||||
@@ -90,7 +177,7 @@ Time zone of version release date: **UTC+8**
|
||||
- Added `loadApp`, `loadZygote`, `loadSystem`, `withProcess` multi-parameter methods of the same name in `PackageParam`
|
||||
- Fixed some possible bugs
|
||||
|
||||
### 1.1.3 | 2022.09.30  <Badge type="warning" text="stale" vertical="middle" />
|
||||
### 1.1.3 | 2022.09.30  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
- Fixed a fatal bug where the Hook entry class name could not be customized
|
||||
- Added some code notes in `LoggerFactory` and updated special features documentation
|
||||
@@ -135,7 +222,7 @@ Time zone of version release date: **UTC+8**
|
||||
- Added `generic` function to reflect and call generics, you can use it in `Class` or `CurrentClass`
|
||||
- obsolete the `buildOfAny` method, now use the `buildOf` method directly (without generics) to use the constructor to create a new object and get the result `Any`
|
||||
- Fixed the issue of null pointer exception when using `hasExtends`
|
||||
- `CurrentClass` added non-`lambda` method of calling
|
||||
- `CurrentClass` added non-**lambda** method of calling
|
||||
- `CurrentClass` adds `name` and `simpleName` functions
|
||||
- Completely rewrite the core method of `ReflectionTool`, sorting and classifying different search conditions
|
||||
- Fixed the problem that `Member` obtained by directly calling `declared` in `ReflectionTool` throws an exception
|
||||
@@ -151,7 +238,7 @@ Time zone of version release date: **UTC+8**
|
||||
- Added multiple search function in reflection search, you can use relative search conditions to obtain multiple search results at the same time, thanks to **AA** and [Kitsune](https://github.com/KyuubiRan) for suggestions
|
||||
- Fixed the problem that the object obtained by `appClassLoader` is incorrect in system applications in some systems, thanks to [Luckyzyx](https://github.com/luckyzyx) for the feedback
|
||||
- Modified the calling method of `XposedBridge.invokeOriginalMethod` and added `original` function in `MethodFinder.Result.Instance`
|
||||
- Fixed the problem of wrong value of `getStringSet` method in `YukiHookModulePrefs` and optimize the code style, thanks to [Teddy_Zhu](https://github.com/Teddy-Zhu) [PR](https://github.com/fankes/YukiHookAPI/pull/19)
|
||||
- Fixed the problem of wrong value of `getStringSet` method in `YukiHookModulePrefs` and optimize the code style, thanks to [Teddy_Zhu](https://github.com/Teddy-Zhu) [PR](https://github.com/HighCapable/YukiHookAPI/pull/19)
|
||||
- Modify `YukiHookModulePrefs` to intercept exceptions that may not exist in `XSharePreference`
|
||||
- Fixed the problem that `YukiHookDataChannel` could not be successfully registered in some third-party ROM system frameworks
|
||||
- Secured `YukiHookDataChannel`, now it can only communicate between modules from the specified package name and the host
|
||||
@@ -174,7 +261,7 @@ Time zone of version release date: **UTC+8**
|
||||
- Added the function of removing Hook in the Hook process, you can use the `remove` and `removeSelf` methods to remove the hook
|
||||
- Fixed the issue that caused the host to throw an exception when ReplaceHook failed, and now it is modified to call the original method to ensure the normal operation of the host function
|
||||
- Added the function of checking the return value of the method in the Hook process. If the return value does not match, it will automatically throw an exception or print an error according to the situation
|
||||
- Added `array` type to Resources Hook, thanks to [PR](https://github.com/fankes/YukiHookAPI/pull/12) of [GSWXXN](https://github.com/GSWXXN)
|
||||
- Added `array` type to Resources Hook, thanks to [PR](https://github.com/HighCapable/YukiHookAPI/pull/12) of [GSWXXN](https://github.com/GSWXXN)
|
||||
- Moved `me.weishu.reflection` to `thirdparty` to prevent conflicting dependencies of the same name introduced at the same time
|
||||
- Remove the exception thrown when the Hook method body is empty, and modify it to print the warning log
|
||||
- Modify the exception handling logic of `AppLifecycle` and throw it directly to the host when an exception occurs
|
||||
@@ -264,7 +351,7 @@ Time zone of version release date: **UTC+8**
|
||||
- ~~`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
|
||||
- Perform `inline` processing on the **lambda** of the Hook function to avoid generating excessively broken anonymous classes and improve the running performance after compilation
|
||||
- Fixed `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
|
||||
@@ -292,7 +379,7 @@ Time zone of version release date: **UTC+8**
|
||||
- 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
|
||||
- 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" />
|
||||
@@ -383,7 +470,7 @@ Time zone of version release date: **UTC+8**
|
||||
- Added `MethodFinder` and `FieldFinder` new return value calling methods
|
||||
- Fixed 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`
|
||||
- Added `android` type and Java type in `type`
|
||||
|
||||
### 1.0.6 | 2022.03.20  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
|
||||
@@ -400,7 +487,7 @@ Time zone of version release date: **UTC+8**
|
||||
|
||||
- Fixed an annotation error
|
||||
- Temporarily fix a bug
|
||||
- Added a large number of `android` types in `type` and a small number of `java` types
|
||||
- Added a large number of `android` types in `type` and a small number of Java types
|
||||
- Fixed compatibility issues between new and old Kotlin APIs
|
||||
|
||||
### 1.0.5 | 2022.03.18  <Badge type="danger" text="outdate" vertical="middle" />
|
||||
@@ -436,7 +523,7 @@ Time zone of version release date: **UTC+8**
|
||||
|
||||
- `RemedyPlan` adds `onFind` function
|
||||
- Integrate and modify some reflection API code
|
||||
- Added `java` type in `type`
|
||||
- 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" />
|
||||
|
@@ -2,12 +2,15 @@
|
||||
|
||||
> 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)
|
||||
Join our developers group.
|
||||
|
||||
Find me on **Twitter** [@fankesyooni](https://twitter.com/fankesyooni)
|
||||
- [Click to join Telegram group](https://t.me/YukiHookAPI)
|
||||
- [Click to join Telegram group (Developer)](https://t.me/HighCapable_Dev)
|
||||
|
||||
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.
|
||||
If you have code-related suggestions and requests, you can submit a Pull Request on GitHub.
|
@@ -6,7 +6,7 @@
|
||||
|
||||
> Here are the unresolved issues with `YukiHookAPI`.
|
||||
|
||||
### YukiHookModulePrefs
|
||||
### YukiHookPrefsBridge
|
||||
|
||||
Currently only supports LSPosed perfectly, other Xposed Framework need to downgrade the module target api.
|
||||
|
||||
@@ -16,6 +16,14 @@ Some Xposed Module developers currently choose the Hook target app self's Shared
|
||||
|
||||
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.
|
||||
|
||||
::: tip Updated on 2023.10.06
|
||||
|
||||
LSPosed has now experimentally launched [Modern Xposed API](https://github.com/libxposed), which uses Service to communicate with modules, which will solve the problem of module data storage.
|
||||
|
||||
In order to ensure the compatibility of most modules, **YukiHookAPI** plans to use a customized ContentProvider to realize data exchange between the Module App and the Host App in the future, so stay tuned.
|
||||
|
||||
:::
|
||||
|
||||
## Future Plans
|
||||
|
||||
> Features that `YukiHookAPI` may add later are included here.
|
||||
@@ -26,7 +34,10 @@ If you like the Reflection API of `YukiHookAPI`, but your project may not need r
|
||||
|
||||
Well here is some good news for you:
|
||||
|
||||
The core Reflection API of `YukiHookAPI` has been decoupled into [YukiReflection](https://github.com/fankes/YukiReflection) project, which can now be used in any Android project.
|
||||
~~The core Reflection API of `YukiHookAPI` has been decoupled into [YukiReflection](https://github.com/HighCapable/YukiReflection) project, which can now be used in any Android project.~~
|
||||
|
||||
The `YukiReflection` project has been deprecated due to many unsolved black box issues, so we no longer recommend anyone to use it.
|
||||
Please now migrate to the brand new design [KavaRef](https://github.com/HighCapable/KavaRef).
|
||||
|
||||
::: tip To be Discussed
|
||||
|
||||
@@ -42,8 +53,12 @@ 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-events).
|
||||
|
||||
### Support for More Hook Framework
|
||||
### Milestone Plan
|
||||
|
||||
As an API, currently only docking `XposedBridge` as a compatibility layer still has certain limitations.
|
||||
The plans below have been published in `issues` on GitHub, and you can view the progress of each project.
|
||||
|
||||
Most `inline hook` do not have a `Java` compatibility layer, and the `Java` compatibility layer adaptation of `native hook` may be considered later.
|
||||
All functions are expected to be completed in `2.0.0` version, so stay tuned.
|
||||
|
||||
- [New Xposed Module Config Plan](https://github.com/HighCapable/YukiHookAPI/issues/49)
|
||||
- [New Hook Entry Class](https://github.com/HighCapable/YukiHookAPI/issues/48)
|
||||
- ~~[New Hook Code Style](https://github.com/HighCapable/YukiHookAPI/issues/33)~~ (Replaced by [KavaRef](https://github.com/HighCapable/KavaRef))
|
@@ -8,6 +8,14 @@ next:
|
||||
|
||||
> 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.
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the
|
||||
Dokka plugin in version `2.0.0`.
|
||||
If you encounter unsolvable problems, you can contact us via [Contact Us](../about/contacts).
|
||||
|
||||
:::
|
||||
|
||||
## Function Description
|
||||
|
||||
> The function description mainly introduces the related usage and purpose of the current API.
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
@@ -24,33 +30,53 @@ object YukiHookAPI
|
||||
|
||||
> 这是 `YukiHookAPI` 的 API 调用总类,Hook 相关功能的开始、Hook 相关功能的配置都在这里。
|
||||
|
||||
## API_VERSION_NAME <span class="symbol">- field</span>
|
||||
## TAG <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
const val API_VERSION_NAME: String
|
||||
const val TAG: String
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.4` `added`
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 获取当前 `YukiHookAPI` 的名称 (标签)。
|
||||
|
||||
## VERSION <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
const val VERSION: String
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 获取当前 `YukiHookAPI` 的版本。
|
||||
|
||||
## API_VERSION_CODE <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
const val API_VERSION_CODE: Int
|
||||
```
|
||||
<h2 class="deprecated">API_VERSION_NAME - field</h2>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.4` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
`v1.2.0` `deprecated`
|
||||
|
||||
> 获取当前 `YukiHookAPI` 的版本号。
|
||||
不再区分版本名称和版本号,请迁移到 `VERSION`
|
||||
|
||||
<h2 class="deprecated">API_VERSION_CODE - field</h2>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.4` `added`
|
||||
|
||||
`v1.2.0` `deprecated`
|
||||
|
||||
不再区分版本名称和版本号,请迁移到 `VERSION`
|
||||
|
||||
<h2 class="deprecated">executorName - field</h2>
|
||||
|
||||
@@ -60,7 +86,7 @@ const val API_VERSION_CODE: Int
|
||||
|
||||
`v1.0.91` `removed`
|
||||
|
||||
请转移到 `Status.Executor.name`
|
||||
请迁移到 `Status.Executor.name`
|
||||
|
||||
<h2 class="deprecated">executorVersion - field</h2>
|
||||
|
||||
@@ -70,7 +96,7 @@ const val API_VERSION_CODE: Int
|
||||
|
||||
`v1.0.91` `removed`
|
||||
|
||||
请转移到 `Status.Executor.apiLevel`、`Status.Executor.versionName`、`Status.Executor.versionCode`
|
||||
请迁移到 `Status.Executor.apiLevel`、`Status.Executor.versionName`、`Status.Executor.versionCode`
|
||||
|
||||
## Status <span class="symbol">- object</span>
|
||||
|
||||
@@ -114,7 +140,7 @@ val isXposedEnvironment: Boolean
|
||||
|
||||
> 获取当前是否为 (Xposed) 宿主环境。
|
||||
|
||||
<h3 class="deprecated">executorName - field</h3>
|
||||
<h2 class="deprecated">executorName - field</h2>
|
||||
|
||||
**Change Records**
|
||||
|
||||
@@ -122,9 +148,9 @@ val isXposedEnvironment: Boolean
|
||||
|
||||
`v1.1.5` `deprecated`
|
||||
|
||||
请转移到 `Executor.name`
|
||||
请迁移到 `Executor.name`
|
||||
|
||||
<h3 class="deprecated">executorVersion - field</h3>
|
||||
<h2 class="deprecated">executorVersion - field</h2>
|
||||
|
||||
**Change Records**
|
||||
|
||||
@@ -132,7 +158,7 @@ val isXposedEnvironment: Boolean
|
||||
|
||||
`v1.1.5` `deprecated`
|
||||
|
||||
请转移到 `Executor.apiLevel`、`Executor.versionName`、`Executor.versionCode`
|
||||
请迁移到 `Executor.apiLevel`、`Executor.versionName`、`Executor.versionCode`
|
||||
|
||||
### isModuleActive <span class="symbol">- field</span>
|
||||
|
||||
@@ -152,7 +178,7 @@ val isModuleActive: Boolean
|
||||
|
||||
在模块环境中你需要将 **Application** 继承于 **ModuleApplication**。
|
||||
|
||||
在模块环境中需要启用 **Configs.isEnableHookModuleStatus**。
|
||||
在模块环境中需要启用 **InjectYukiHookWithXposed.isUsingXposedModuleStatus**。
|
||||
|
||||
在 (Xposed) 宿主环境中仅返回非 **isTaiChiModuleActive** 的激活状态。
|
||||
|
||||
@@ -174,7 +200,7 @@ val isXposedModuleActive: Boolean
|
||||
|
||||
::: warning
|
||||
|
||||
在模块环境中需要启用 **Configs.isEnableHookModuleStatus**。
|
||||
在模块环境中需要启用 **InjectYukiHookWithXposed.isUsingXposedModuleStatus**。
|
||||
|
||||
在 (Xposed) 宿主环境中始终返回 true。
|
||||
|
||||
@@ -214,11 +240,11 @@ val isSupportResourcesHook: Boolean
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 判断当前 Hook Framework 是否支持资源钩子(Resources Hook)。
|
||||
> 判断当前 Hook Framework 是否支持资源钩子 (Resources Hook)。
|
||||
|
||||
::: warning
|
||||
|
||||
在模块环境中需要启用 **Configs.isEnableHookModuleStatus**。
|
||||
在模块环境中需要启用 **InjectYukiHookWithXposed.isUsingXposedModuleStatus**。
|
||||
|
||||
在 (Xposed) 宿主环境中可能会延迟等待事件回调后才会返回 true。
|
||||
|
||||
@@ -256,7 +282,27 @@ val name: String
|
||||
|
||||
::: warning
|
||||
|
||||
在模块环境中需要启用 **Configs.isEnableHookModuleStatus**。
|
||||
在模块环境中需要启用 **InjectYukiHookWithXposed.isUsingXposedModuleStatus**。
|
||||
|
||||
:::
|
||||
|
||||
#### type <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
val type: ExecutorType
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.9` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 获取当前 Hook Framework 类型。
|
||||
|
||||
::: warning
|
||||
|
||||
在模块环境中需要启用 **InjectYukiHookWithXposed.isUsingXposedModuleStatus**。
|
||||
|
||||
:::
|
||||
|
||||
@@ -276,7 +322,7 @@ val apiLevel: Int
|
||||
|
||||
::: warning
|
||||
|
||||
在模块环境中需要启用 **Configs.isEnableHookModuleStatus**。
|
||||
在模块环境中需要启用 **InjectYukiHookWithXposed.isUsingXposedModuleStatus**。
|
||||
|
||||
:::
|
||||
|
||||
@@ -296,7 +342,7 @@ val versionName: String
|
||||
|
||||
::: warning
|
||||
|
||||
在模块环境中需要启用 **Configs.isEnableHookModuleStatus**。
|
||||
在模块环境中需要启用 **InjectYukiHookWithXposed.isUsingXposedModuleStatus**。
|
||||
|
||||
:::
|
||||
|
||||
@@ -316,7 +362,7 @@ val versionCode: Int
|
||||
|
||||
::: warning
|
||||
|
||||
在模块环境中需要启用 **Configs.isEnableHookModuleStatus**。
|
||||
在模块环境中需要启用 **InjectYukiHookWithXposed.isUsingXposedModuleStatus**。
|
||||
|
||||
:::
|
||||
|
||||
@@ -337,7 +383,7 @@ object Configs
|
||||
### debugLog <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun debugLog(initiate: YukiHookLogger.Configs.() -> Unit)
|
||||
inline fun debugLog(initiate: YLog.Configs.() -> Unit)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
@@ -346,7 +392,7 @@ inline fun debugLog(initiate: YukiHookLogger.Configs.() -> Unit)
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 配置 `YukiHookLogger.Configs` 相关参数。
|
||||
> 配置 `YLog.Configs` 相关参数。
|
||||
|
||||
<h3 class="deprecated">debugTag - field</h3>
|
||||
|
||||
@@ -356,7 +402,7 @@ inline fun debugLog(initiate: YukiHookLogger.Configs.() -> Unit)
|
||||
|
||||
`v1.1.0` `deprecated`
|
||||
|
||||
请转移到 `YukiHookLogger.Configs.tag`
|
||||
请迁移到 `YLog.Configs.tag`
|
||||
|
||||
### isDebug <span class="symbol">- field</span>
|
||||
|
||||
@@ -372,7 +418,7 @@ var isDebug: Boolean
|
||||
|
||||
> 是否启用 Debug 模式。
|
||||
|
||||
默认为开启状态,开启后模块将会向 `Logcat` 和 (Xposed) 宿主环境中的日志功能打印详细的 Hook 日志,关闭后仅会打印 `E` 级别的日志。
|
||||
默认不启用,启用后模块将会向 `Logcat` 和 (Xposed) 宿主环境中的日志功能打印详细的 Hook 日志,关闭后仅会打印 `E` 级别的日志。
|
||||
|
||||
<h3 class="deprecated">isAllowPrintingLogs - field</h3>
|
||||
|
||||
@@ -382,25 +428,27 @@ var isDebug: Boolean
|
||||
|
||||
`v1.1.0` `deprecated`
|
||||
|
||||
请转移到 `YukiHookLogger.Configs.isEnable`
|
||||
请迁移到 `YLog.Configs.isEnable`
|
||||
|
||||
### isEnableModulePrefsCache <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
var isEnableModulePrefsCache: Boolean
|
||||
```
|
||||
<h3 class="deprecated">isEnableModulePrefsCache - field</h3>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.5` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
`v1.1.9` `deprecated`
|
||||
|
||||
> 是否启用 `YukiHookModulePrefs` 的键值缓存功能。
|
||||
请迁移到 `isEnablePrefsBridgeCache`
|
||||
|
||||
为防止内存复用过高问题,此功能默认启用。
|
||||
<h3 class="deprecated">isEnablePrefsBridgeCache - field</h3>
|
||||
|
||||
你可以手动在 `YukiHookModulePrefs` 中自由开启和关闭缓存功能以及清除缓存。
|
||||
**Change Records**
|
||||
|
||||
`v1.1.9` `added`
|
||||
|
||||
`v1.1.11` `deprecated`
|
||||
|
||||
键值的直接缓存功能已被移除,因为其存在内存溢出 (OOM) 问题
|
||||
|
||||
### isEnableModuleAppResourcesCache <span class="symbol">- field</span>
|
||||
|
||||
@@ -426,27 +474,15 @@ var isEnableModuleAppResourcesCache: Boolean
|
||||
|
||||
:::
|
||||
|
||||
### isEnableHookModuleStatus <span class="symbol">- field</span>
|
||||
<h3 class="deprecated">isEnableHookModuleStatus - field</h3>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
var isEnableHookModuleStatus: Boolean
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
**变更记录**
|
||||
|
||||
`v1.0.88` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
`v1.2.0` `deprecated`
|
||||
|
||||
> 是否启用 Hook Xposed 模块激活等状态功能.
|
||||
|
||||
为原生支持 Xposed 模块激活状态检测,此功能默认启用。
|
||||
|
||||
::: warning
|
||||
|
||||
关闭后你将不能再在模块环境中使用 **YukiHookAPI.Status** 中的激活状态判断功能。
|
||||
|
||||
:::
|
||||
请手动迁移到 `InjectYukiHookWithXposed.isUsingXposedModuleStatus`
|
||||
|
||||
### isEnableHookSharedPreferences <span class="symbol">- field</span>
|
||||
|
||||
@@ -468,7 +504,7 @@ var isEnableHookSharedPreferences: Boolean
|
||||
|
||||
这是一个可选的实验性功能,此功能默认不启用。
|
||||
|
||||
仅用于修复某些系统可能会出现在启用了 **New XSharedPreferences** 后依然出现文件权限错误问题,若你能正常使用 **YukiHookModulePrefs** 就不建议启用此功能。
|
||||
仅用于修复某些系统可能会出现在启用了 **New XSharedPreferences** 后依然出现文件权限错误问题,若你能正常使用 **YukiHookPrefsBridge** 就不建议启用此功能。
|
||||
|
||||
:::
|
||||
|
||||
@@ -490,29 +526,15 @@ var isEnableDataChannel: Boolean
|
||||
|
||||
此功能默认启用,关闭后将不会在功能初始化的时候装载 `YukiHookDataChannel`。
|
||||
|
||||
### isEnableMemberCache <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
var isEnableMemberCache: Boolean
|
||||
```
|
||||
<h3 class="deprecated">isEnableMemberCache - field</h3>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.68` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
`v1.1.11` `deprecated`
|
||||
|
||||
> 是否启用 `Member` 缓存功能。
|
||||
|
||||
为防止 `Member` 复用过高造成的系统 GC 问题,此功能默认启用。
|
||||
|
||||
启用后会缓存已经找到的 `Method`、`Constructor`、`Field`。
|
||||
|
||||
缓存的 `Member` 都将处于 `ReflectsCacheStore` 的全局静态实例中。
|
||||
|
||||
推荐使用 `MethodFinder`、`ConstructorFinder`、`FieldFinder` 来获取 `Member`。
|
||||
|
||||
除非缓存的 `Member` 发生了混淆的问题,例如使用 R8 混淆后的 APP 的目标 `Member`,否则建议启用。
|
||||
`Member` 的直接缓存功能已被移除,因为其存在内存溢出 (OOM) 问题
|
||||
|
||||
## configs <span class="symbol">- method</span>
|
||||
|
||||
@@ -530,7 +552,7 @@ inline fun configs(initiate: Configs.() -> Unit)
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 对 `Configs` 类实现了一个 `lambda` 方法体。
|
||||
> 对 `Configs` 类实现了一个 **lambda** 方法体。
|
||||
|
||||
你可以轻松地调用它进行配置。
|
||||
|
||||
@@ -552,12 +574,10 @@ object HookEntry : IYukiHookXposedInit {
|
||||
elements(TAG, PRIORITY, PACKAGE_NAME, USER_ID)
|
||||
}
|
||||
isDebug = BuildConfig.DEBUG
|
||||
isEnableModulePrefsCache = true
|
||||
isEnableModuleAppResourcesCache = true
|
||||
isEnableHookModuleStatus = true
|
||||
isEnableHookSharedPreferences = false
|
||||
isEnableDataChannel = true
|
||||
isEnableMemberCache = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -582,12 +602,10 @@ object HookEntry : IYukiHookXposedInit {
|
||||
elements(TAG, PRIORITY, PACKAGE_NAME, USER_ID)
|
||||
}
|
||||
isDebug = BuildConfig.DEBUG
|
||||
isEnableModulePrefsCache = true
|
||||
isEnableModuleAppResourcesCache = true
|
||||
isEnableHookModuleStatus = true
|
||||
isEnableHookSharedPreferences = false
|
||||
isEnableDataChannel = true
|
||||
isEnableMemberCache = true
|
||||
}
|
||||
|
||||
override fun onHook() {
|
||||
@@ -604,22 +622,20 @@ object HookEntry : IYukiHookXposedInit {
|
||||
object HookEntry : IYukiHookXposedInit {
|
||||
|
||||
override fun onInit() {
|
||||
YukiHookLogger.Configs.tag = "YukiHookAPI"
|
||||
YukiHookLogger.Configs.isEnable = true
|
||||
YukiHookLogger.Configs.isRecord = false
|
||||
YukiHookLogger.Configs.elements(
|
||||
YukiHookLogger.Configs.TAG,
|
||||
YukiHookLogger.Configs.PRIORITY,
|
||||
YukiHookLogger.Configs.PACKAGE_NAME,
|
||||
YukiHookLogger.Configs.USER_ID
|
||||
YLog.Configs.tag = "YukiHookAPI"
|
||||
YLog.Configs.isEnable = true
|
||||
YLog.Configs.isRecord = false
|
||||
YLog.Configs.elements(
|
||||
YLog.Configs.TAG,
|
||||
YLog.Configs.PRIORITY,
|
||||
YLog.Configs.PACKAGE_NAME,
|
||||
YLog.Configs.USER_ID
|
||||
)
|
||||
YukiHookAPI.Configs.isDebug = BuildConfig.DEBUG
|
||||
YukiHookAPI.Configs.isEnableModulePrefsCache = true
|
||||
YukiHookAPI.Configs.isEnableModuleAppResourcesCache = true
|
||||
YukiHookAPI.Configs.isEnableHookModuleStatus = true
|
||||
YukiHookAPI.InjectYukiHookWithXposed.isUsingXposedModuleStatus = true
|
||||
YukiHookAPI.Configs.isEnableHookSharedPreferences = false
|
||||
YukiHookAPI.Configs.isEnableDataChannel = true
|
||||
YukiHookAPI.Configs.isEnableMemberCache = true
|
||||
}
|
||||
|
||||
override fun onHook() {
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
@@ -17,6 +23,7 @@ annotation class InjectYukiHookWithXposed(
|
||||
val sourcePath: String,
|
||||
val modulePackageName: String,
|
||||
val entryClassName: String,
|
||||
val isUsingXposedModuleStatus: Boolean,
|
||||
val isUsingResourcesHook: Boolean
|
||||
)
|
||||
```
|
||||
@@ -33,6 +40,10 @@ annotation class InjectYukiHookWithXposed(
|
||||
|
||||
新增 `isUsingResourcesHook` 参数
|
||||
|
||||
`v1.2.0` `modified`
|
||||
|
||||
新增 `isUsingXposedModuleStatus` 参数
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 标识 `YukiHookAPI` 注入 Xposed 入口的类注解。
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
@@ -13,7 +19,7 @@ You can use the **Chrome Translation Plugin** to translate entire pages for refe
|
||||
# CurrentClass <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
class CurrentClass internal constructor(internal val classSet: Class<*>, internal val instance: Any)
|
||||
class CurrentClass internal constructor(private val classSet: Class<*>, internal val instance: Any)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
@@ -133,7 +139,7 @@ inline fun method(initiate: MethodConditions): MethodFinder.Result.Instance
|
||||
## SuperClass <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inner class SuperClass internal constructor(internal val superClassSet: Class<*>)
|
||||
inner class SuperClass internal constructor(private val superClassSet: Class<*>)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
@@ -27,11 +33,11 @@ class GenericClass internal constructor(private val type: ParameterizedType)
|
||||
## argument <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun argument(index: Int): Class<*>
|
||||
fun argument(index: Int): Class<*>?
|
||||
```
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun <reified T> argument(index: Int): Class<T>
|
||||
inline fun <reified T> argument(index: Int): Class<T>?
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
@@ -42,6 +48,16 @@ inline fun <reified T> argument(index: Int): Class<T>
|
||||
|
||||
新增泛型返回值 `Class<T>` 方法
|
||||
|
||||
`v1.2.0` `modified`
|
||||
|
||||
方法的返回值可为 `null`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 获得泛型参数数组下标的 `Class` 实例。
|
||||
> 获得泛型参数数组下标的 `Class` 实例。
|
||||
|
||||
::: warning
|
||||
|
||||
在运行时局部变量的泛型会被擦除,获取不到时将会返回 **null**。
|
||||
|
||||
:::
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
@@ -13,7 +19,7 @@ You can use the **Chrome Translation Plugin** to translate entire pages for refe
|
||||
# YukiMemberHookCreator <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
class YukiMemberHookCreator internal constructor(internal val packageParam: PackageParam, internal val hookClass: HookClass)
|
||||
class YukiMemberHookCreator internal constructor(private val packageParam: PackageParam, private val hookClass: HookClass)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
@@ -36,53 +42,37 @@ class YukiMemberHookCreator internal constructor(internal val packageParam: Pack
|
||||
|
||||
> `YukiHookAPI` 的 `Member` 核心 Hook 实现类。
|
||||
|
||||
## PRIORITY_DEFAULT <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
val PRIORITY_DEFAULT: Int
|
||||
```
|
||||
<h2 class="deprecated">PRIORITY_DEFAULT - field</h2>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.80` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
`v1.2.0` `deprecated`
|
||||
|
||||
> 默认 Hook 回调优先级。
|
||||
请迁移到 `YukiHookPriority`
|
||||
|
||||
## PRIORITY_LOWEST <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
val PRIORITY_LOWEST: Int
|
||||
```
|
||||
<h2 class="deprecated">PRIORITY_LOWEST - field</h2>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.80` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
`v1.2.0` `deprecated`
|
||||
|
||||
> 延迟回调 Hook 方法结果。
|
||||
请迁移到 `YukiHookPriority`
|
||||
|
||||
## PRIORITY_HIGHEST <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
val PRIORITY_HIGHEST: Int
|
||||
```
|
||||
<h2 class="deprecated">PRIORITY_HIGHEST - field</h2>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.80` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
`v1.2.0` `deprecated`
|
||||
|
||||
> 更快回调 Hook 方法结果。
|
||||
请迁移到 `YukiHookPriority`
|
||||
|
||||
## instanceClass <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
val instanceClass: Class<*>
|
||||
```
|
||||
<h2 class="deprecated">instanceClass - field</h2>
|
||||
|
||||
**Change Records**
|
||||
|
||||
@@ -92,21 +82,11 @@ val instanceClass: Class<*>
|
||||
|
||||
~~`thisClass`~~ 更名为 `instanceClass`
|
||||
|
||||
**Function Illustrate**
|
||||
`v1.2.0` `deprecated`
|
||||
|
||||
> 得到当前被 Hook 的 `Class`。
|
||||
不再推荐使用
|
||||
|
||||
::: danger
|
||||
|
||||
不推荐直接使用,万一得不到 **Class** 对象则会无法处理异常导致崩溃。
|
||||
|
||||
:::
|
||||
|
||||
## injectMember <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun injectMember(priority: Int, tag: String, initiate: MemberHookCreator.() -> Unit): MemberHookCreator.Result
|
||||
```
|
||||
<h2 class="deprecated">injectMember - method</h2>
|
||||
|
||||
**Change Records**
|
||||
|
||||
@@ -118,72 +98,38 @@ inline fun injectMember(priority: Int, tag: String, initiate: MemberHookCreator.
|
||||
|
||||
增加 `priority` Hook 优先级
|
||||
|
||||
`v1.2.0` `deprecated`
|
||||
|
||||
请迁移到另一个 `injectMember`
|
||||
|
||||
## injectMember <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun injectMember(priority: YukiHookPriority, initiate: MemberHookCreator.LegacyCreator.() -> Unit): MemberHookCreator.Result
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 注入要 Hook 的 `Method`、`Constructor`。
|
||||
|
||||
**Function Example**
|
||||
|
||||
你可以注入任意 `Method` 与 `Constructor`,使用 `injectMember` 即可创建一个 `Hook` 对象。
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
injectMember {
|
||||
// Your code here.
|
||||
}
|
||||
```
|
||||
|
||||
你还可以自定义 `tag`,方便你在调试的时候能够区分你的 `Hook` 对象。
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
injectMember(tag = "KuriharaYuki") {
|
||||
// Your code here.
|
||||
}
|
||||
```
|
||||
|
||||
你还可以自定义 `priority`,以控制当前 Hook 对象并列执行的优先级速度。
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
injectMember(priority = PRIORITY_HIGHEST) {
|
||||
// Your code here.
|
||||
}
|
||||
```
|
||||
|
||||
## useDangerousOperation <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun useDangerousOperation(option: String)
|
||||
```
|
||||
<h2 class="deprecated">useDangerousOperation - method</h2>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
`v1.2.0` `deprecated`
|
||||
|
||||
> 允许 Hook 过程中的所有危险行为。
|
||||
|
||||
请在 `option` 中键入 `Yes do as I say!` 代表你同意允许所有危险行为。
|
||||
|
||||
你还需要在整个调用域中声明注解 `CauseProblemsApi` 以消除警告。
|
||||
|
||||
若你只需要 Hook `ClassLoader` 的 `loadClass` 方法,请参考 [ClassLoader.onLoadClass](../factory/ReflectionFactory#classloader-onloadclass-ext-method)。
|
||||
|
||||
::: danger
|
||||
|
||||
若你不知道允许此功能会带来何种后果,请勿使用。
|
||||
|
||||
:::
|
||||
此功能已被弃用
|
||||
|
||||
## MemberHookCreator <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inner class MemberHookCreator internal constructor(private val priority: Int, internal val tag: String)
|
||||
inner class MemberHookCreator internal constructor(private val priority: YukiHookPriority, private val hookMode: HookMode)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
@@ -204,343 +150,41 @@ inner class MemberHookCreator internal constructor(private val priority: Int, in
|
||||
|
||||
修正拼写错误的 **Creater** 命名到 **Creator**
|
||||
|
||||
`v1.2.0` `modified`
|
||||
|
||||
移除 `tag`
|
||||
|
||||
`priority` 类型由 `Int` 变更为 `YukiHookPriority`
|
||||
|
||||
增加 `hookMode` Hook 模式
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> Hook 核心功能实现类,查找和处理需要 Hook 的 `Method`、`Constructor`。
|
||||
|
||||
<h3 class="deprecated">member - field</h3>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0` `first`
|
||||
|
||||
`v1.1.0` `removed`
|
||||
|
||||
请转移到 `members`
|
||||
|
||||
### members <span class="symbol">- method</span>
|
||||
### before <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun members(vararg member: Member?)
|
||||
fun before(initiate: HookParam.() -> Unit): HookCallback
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 手动指定要 Hook 的 `Method`、`Constructor`。
|
||||
|
||||
::: warning
|
||||
|
||||
不建议使用此方法设置目标需要 Hook 的 **Member** 对象,你可以使用 **method** 或 **constructor** 方法。
|
||||
|
||||
:::
|
||||
|
||||
**Function Example**
|
||||
|
||||
你可以调用 `instanceClass` 来手动查找要 Hook 的 `Method`、`Constructor`。
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
injectMember {
|
||||
members(instanceClass.getDeclaredMethod("test", StringClass))
|
||||
beforeHook {}
|
||||
afterHook {}
|
||||
}
|
||||
```
|
||||
|
||||
同样地,你也可以传入一组 `Member` 同时进行 Hook。
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
injectMember {
|
||||
members(
|
||||
instanceClass.getDeclaredMethod("test1", StringClass),
|
||||
instanceClass.getDeclaredMethod("test2", StringClass),
|
||||
instanceClass.getDeclaredMethod("test3", StringClass)
|
||||
)
|
||||
beforeHook {}
|
||||
afterHook {}
|
||||
}
|
||||
```
|
||||
|
||||
<h3 class="deprecated">allMethods - method</h3>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0` `first`
|
||||
|
||||
`v1.1.0` `deprecated`
|
||||
|
||||
请使用 `method { name = /** name */ }.all()` 来取代它
|
||||
|
||||
<h3 class="deprecated">allConstructors - method</h3>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0` `first`
|
||||
|
||||
`v1.1.0` `deprecated`
|
||||
|
||||
请使用 `allMembers(MembersType.CONSTRUCTOR)` 来取代它
|
||||
|
||||
### allMembers <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun allMembers(type: MembersType)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 查找并 Hook `hookClass` 中的全部 `Method`、`Constructor`。
|
||||
|
||||
::: warning
|
||||
|
||||
无法准确处理每个 **Member** 的返回值和 **param**,建议使用 **method** or **constructor** 对每个 **Member** 单独 Hook。
|
||||
|
||||
:::
|
||||
|
||||
### method <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun method(initiate: MethodConditions): MethodFinder.Result
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0` `first`
|
||||
|
||||
`v1.0.80` `modified`
|
||||
|
||||
将方法体进行 inline
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 查找当前 `Class` 需要 Hook 的 `Method` 。
|
||||
|
||||
**Function Example**
|
||||
|
||||
你可参考 [MethodFinder](finder/members/MethodFinder) 查看详细用法。
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
injectMember {
|
||||
method {
|
||||
name = "test"
|
||||
param(StringClass)
|
||||
returnType = UnitType
|
||||
}
|
||||
beforeHook {}
|
||||
afterHook {}
|
||||
}
|
||||
```
|
||||
|
||||
若想 Hook 当前查找 `method { ... }` 条件的全部结果,你只需要在最后加入 `all` 即可。
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
injectMember {
|
||||
method {
|
||||
name = "test"
|
||||
paramCount(1..5)
|
||||
}.all()
|
||||
beforeHook {}
|
||||
afterHook {}
|
||||
}
|
||||
```
|
||||
|
||||
此时 `beforeHook` 与 `afterHook` 会在每个查找到的结果中多次回调 Hook 方法体。
|
||||
|
||||
::: warning
|
||||
|
||||
若没有 **all**,默认只会 Hook 当前条件查找到的数组下标结果第一位。
|
||||
|
||||
:::
|
||||
|
||||
### constructor <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun constructor(initiate: ConstructorConditions): ConstructorFinder.Result
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0` `first`
|
||||
|
||||
`v1.0.80` `modified`
|
||||
|
||||
将方法体进行 inline
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 查找当前 `Class` 需要 Hook 的 `Constructor`。
|
||||
|
||||
**Function Example**
|
||||
|
||||
你可参考 [ConstructorFinder](finder/members/ConstructorFinder) 查看详细用法。
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
injectMember {
|
||||
constructor { param(StringClass) }
|
||||
beforeHook {}
|
||||
afterHook {}
|
||||
}
|
||||
```
|
||||
|
||||
若想 Hook 当前查找 `constructor { ... }` 条件的全部结果,你只需要在最后加入 `all` 即可。
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
injectMember {
|
||||
constructor { paramCount(1..5) }.all()
|
||||
beforeHook {}
|
||||
afterHook {}
|
||||
}
|
||||
```
|
||||
|
||||
此时 `beforeHook` 与 `afterHook` 会在每个查找到的结果中多次回调 Hook 方法体。
|
||||
|
||||
::: warning
|
||||
|
||||
若没有 **all**,默认只会 Hook 当前条件查找到的数组下标结果第一位。
|
||||
|
||||
:::
|
||||
|
||||
### HookParam.field <span class="symbol">- i-ext-method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun HookParam.field(initiate: FieldConditions): FieldFinder.Result
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0` `first`
|
||||
|
||||
`v1.0.80` `modified`
|
||||
|
||||
将方法体进行 inline
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 使用当前 `hookClass` 查找并得到 `Field`。
|
||||
|
||||
**Function Example**
|
||||
|
||||
你可参考 [FieldFinder](finder/members/FieldFinder) 查看详细用法。
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
injectMember {
|
||||
method {
|
||||
name = "test"
|
||||
param(StringClass)
|
||||
returnType = UnitType
|
||||
}
|
||||
afterHook {
|
||||
// 这里不需要再调用 instanceClass.field 进行查找
|
||||
field {
|
||||
name = "isSweet"
|
||||
type = BooleanType
|
||||
}.get(instance).setTrue()
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### HookParam.method <span class="symbol">- i-ext-method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun HookParam.method(initiate: MethodConditions): MethodFinder.Result
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.2` `first`
|
||||
|
||||
`v1.0.80` `modified`
|
||||
|
||||
将方法体进行 inline
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 使用当前 `hookClass` 查找并得到 `Method` 。
|
||||
|
||||
### HookParam.constructor <span class="symbol">- i-ext-method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun HookParam.constructor(initiate: ConstructorConditions): ConstructorFinder.Result
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.2` `first`
|
||||
|
||||
`v1.0.80` `modified`
|
||||
|
||||
将方法体进行 inline
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 使用当前 `hookClass` 查找并得到 `Constructor`。
|
||||
|
||||
### HookParam.injectMember <span class="symbol">- i-ext-method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun HookParam.injectMember(priority: Int, tag: String, initiate: MemberHookCreator.() -> Unit): MemberHookCreator.Result
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.88` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 注入要 Hook 的 `Method`、`Constructor` (嵌套 Hook)。
|
||||
|
||||
### beforeHook <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun beforeHook(initiate: HookParam.() -> Unit): HookCallback
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0` `first`
|
||||
|
||||
`v1.1.0` `modified`
|
||||
|
||||
新增 `HookCallback` 返回类型
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 在 `Member` 执行完成前 Hook。
|
||||
|
||||
### afterHook <span class="symbol">- method</span>
|
||||
### after <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun afterHook(initiate: HookParam.() -> Unit): HookCallback
|
||||
fun after(initiate: HookParam.() -> Unit): HookCallback
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0` `first`
|
||||
|
||||
`v1.1.0` `modified`
|
||||
|
||||
新增 `HookCallback` 返回类型
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -670,6 +314,26 @@ fun removeSelf(result: (Boolean) -> Unit)
|
||||
|
||||
:::
|
||||
|
||||
### LegacyCreator <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inner class LegacyCreator internal constructor()
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 使用 `injectMember` 创建的 Hook 核心功能实现类 (旧版本)。
|
||||
|
||||
::: warning
|
||||
|
||||
大部分旧版 API 已被迁移至此处,将不再特殊说明其中包含的旧版 API。
|
||||
|
||||
:::
|
||||
|
||||
### HookCallback <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
@@ -734,24 +398,6 @@ inline fun result(initiate: Result.() -> Unit): Result
|
||||
|
||||
> 创建监听失败事件方法体。
|
||||
|
||||
**Function Example**
|
||||
|
||||
你可以使用此方法为 `Result` 类创建 `lambda` 方法体。
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
injectMember {
|
||||
// Your code here.
|
||||
}.result {
|
||||
onHooked {}
|
||||
onAlreadyHooked {}
|
||||
ignoredConductFailure()
|
||||
onHookingFailure {}
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
#### by <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
@@ -291,6 +297,52 @@ injectResource {
|
||||
}
|
||||
```
|
||||
|
||||
### replaceTo <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun replaceTo(result: (original: Any) -> Any?)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 替换指定 Resources 为指定的值。
|
||||
|
||||
::: warning
|
||||
|
||||
此方法只支持部分类型,例如 **String**、**Boolean**。
|
||||
|
||||
此方法不支持在 **HookEntryType.ZYGOTE** 时使用。
|
||||
|
||||
:::
|
||||
|
||||
### replaceToModuleResource <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun replaceToModuleResource(result: (original: Any) -> Int)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 替换为当前 Xposed 模块的 Resources。
|
||||
|
||||
你可以直接使用模块的 `R.string.xxx`、`R.mipmap.xxx`、`R.drawable.xxx` 替换 Hook APP 的 Resources。
|
||||
|
||||
::: warning
|
||||
|
||||
此方法只支持部分类型,例如 **String**、**Boolean**。
|
||||
|
||||
此方法不支持在 **HookEntryType.ZYGOTE** 时使用。
|
||||
|
||||
:::
|
||||
|
||||
### injectAsLayout <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
|
@@ -0,0 +1,121 @@
|
||||
---
|
||||
pageClass: code-page
|
||||
---
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
|
||||
:::
|
||||
|
||||
# ExecutorType <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
enum class ExecutorType
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.9` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> Hook Framework 类型定义。
|
||||
|
||||
定义了目前已知使用频率较高的 Hook Framework。
|
||||
|
||||
后期根据 Hook Framework 特征和使用情况将会继续添加新的类型。
|
||||
|
||||
无法识别的 Hook Framework 将被定义为 `UNKNOWN`。
|
||||
|
||||
## UNKNOWN <span class="symbol">- enum</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
UNKNOWN
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.9` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 未知类型。
|
||||
|
||||
## XPOSED <span class="symbol">- enum</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
XPOSED
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.9` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 原版、第三方 Xposed。
|
||||
|
||||
## LSPOSED_LSPATCH <span class="symbol">- enum</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
LSPOSED_LSPATCH
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.9` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> LSPosed、LSPatch。
|
||||
|
||||
## ED_XPOSED <span class="symbol">- enum</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
ED_XPOSED
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.9` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> EdXposed。
|
||||
|
||||
## TAICHI_XPOSED <span class="symbol">- enum</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
TAICHI_XPOSED
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.9` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> TaiChi (太极)。
|
||||
|
||||
## BUG_XPOSED <span class="symbol">- enum</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
BUG_XPOSED
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.9` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> BugXposed (应用转生)。
|
@@ -0,0 +1,77 @@
|
||||
---
|
||||
pageClass: code-page
|
||||
---
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
|
||||
:::
|
||||
|
||||
# YukiHookPriority <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
enum class YukiHookPriority
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.5` `added`
|
||||
|
||||
`v1.2.0` `modified`
|
||||
|
||||
移除 `internal` 对外公开
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> Hook 回调优先级配置类。
|
||||
|
||||
## DEFAULT <span class="symbol">- enum</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
DEFAULT
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.5` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 默认 Hook 回调优先级。
|
||||
|
||||
## LOWEST <span class="symbol">- enum</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
LOWEST
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.5` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 延迟回调 Hook 方法结果。
|
||||
|
||||
## HIGHEST <span class="symbol">- enum</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
HIGHEST
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.5` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 更快回调 Hook 方法结果。
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
@@ -22,7 +28,7 @@ class NameRules private constructor()
|
||||
|
||||
`v1.1.0` `modified`
|
||||
|
||||
`NameConditions` 更名为 `NameRules`
|
||||
~~`NameConditions`~~ 更名为 `NameRules`
|
||||
|
||||
作为 lambda 整体判断条件使用
|
||||
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
@@ -32,7 +38,7 @@ class DexClassFinder internal constructor(
|
||||
|
||||
::: warning
|
||||
|
||||
此功能尚在试验阶段,性能与稳定性可能仍然存在问题,使用过程遇到问题请向我们报告并帮助我们改进。
|
||||
此功能尚在实验阶段,性能与稳定性可能仍然存在问题,使用过程遇到问题请向我们报告并帮助我们改进。
|
||||
|
||||
:::
|
||||
|
||||
@@ -441,7 +447,7 @@ fun enclosing(vararg name: String)
|
||||
## FromPackageRules <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inner class FromPackageRules internal constructor(private val packages: ArrayList<ClassRulesData.PackageRulesData>)
|
||||
inner class FromPackageRules internal constructor(private val packages: MutableList<ClassRulesData.PackageRulesData>)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
@@ -625,20 +631,24 @@ fun get(): Class<*>?
|
||||
### all <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun all(): HashSet<Class<*>>
|
||||
fun all(): MutableList<Class<*>>
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
|
||||
`v1.2.0` `modified`
|
||||
|
||||
返回值类型由 `HashSet` 修改为 `MutableList`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 得到 `Class` 本身数组。
|
||||
|
||||
返回全部查找条件匹配的多个 `Class` 实例。
|
||||
|
||||
在查找条件找不到任何结果的时候将返回空的 `HashSet`。
|
||||
在查找条件找不到任何结果的时候将返回空的 `MutableList`。
|
||||
|
||||
若你设置了 `async` 请使用 [waitAll](#waitall-method) 方法。
|
||||
|
||||
@@ -685,20 +695,24 @@ fun wait(result: (Class<*>?) -> Unit): Result
|
||||
### waitAll <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun waitAll(result: (HashSet<Class<*>>) -> Unit): Result
|
||||
fun waitAll(result: (MutableList<Class<*>>) -> Unit): Result
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
|
||||
`v1.2.0` `modified`
|
||||
|
||||
`result` 类型由 `HashSet` 修改为 `MutableList`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 得到 `Class` 本身数组 (异步)。
|
||||
|
||||
回调全部查找条件匹配的多个 `Class` 实例。
|
||||
|
||||
在查找条件找不到任何结果的时候将回调空的 `HashSet`。
|
||||
在查找条件找不到任何结果的时候将回调空的 `MutableList`。
|
||||
|
||||
你需要设置 `async` 后此方法才会被回调,否则请使用 [all](#all-method) 方法。
|
||||
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
@@ -13,7 +19,7 @@ You can use the **Chrome Translation Plugin** to translate entire pages for refe
|
||||
# ConstructorRules <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
class ConstructorRules internal constructor(internal val rulesData: ConstructorRulesData) : BaseRules
|
||||
class ConstructorRules internal constructor(private val rulesData: ConstructorRulesData) : BaseRules
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
@@ -13,7 +19,7 @@ You can use the **Chrome Translation Plugin** to translate entire pages for refe
|
||||
# FieldRules <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
class FieldRules internal constructor(internal val rulesData: FieldRulesData) : BaseRules
|
||||
class FieldRules internal constructor(private val rulesData: FieldRulesData) : BaseRules
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
@@ -13,7 +19,7 @@ You can use the **Chrome Translation Plugin** to translate entire pages for refe
|
||||
# MemberRules <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
class MemberRules internal constructor(internal val rulesData: MemberRulesData) : BaseRules
|
||||
class MemberRules internal constructor(private val rulesData: MemberRulesData) : BaseRules
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
@@ -13,7 +19,7 @@ You can use the **Chrome Translation Plugin** to translate entire pages for refe
|
||||
# MethodRules <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
class MethodRules internal constructor(internal val rulesData: MethodRulesData) : BaseRules
|
||||
class MethodRules internal constructor(private val rulesData: MethodRulesData) : BaseRules
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
@@ -291,7 +297,7 @@ inner class Result internal constructor()
|
||||
#### onFind <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun onFind(initiate: HashSet<Constructor<*>>.() -> Unit)
|
||||
fun onFind(initiate: MutableList<Constructor<*>>.() -> Unit)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
@@ -302,6 +308,10 @@ fun onFind(initiate: HashSet<Constructor<*>>.() -> Unit)
|
||||
|
||||
`initiate` 参数 `Constructor` 变为 `HashSet<Constructor>`
|
||||
|
||||
`v1.2.0` `modified`
|
||||
|
||||
`initiate` 类型由 `HashSet` 修改为 `MutableList`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 当在 `RemedyPlan` 中找到结果时。
|
||||
@@ -350,7 +360,7 @@ inline fun result(initiate: Process.() -> Unit): Process
|
||||
|
||||
**Function Example**
|
||||
|
||||
你可以使用 `lambda` 形式创建 `Result` 类。
|
||||
你可以使用 **lambda** 形式创建 `Result` 类。
|
||||
|
||||
> The following example
|
||||
|
||||
@@ -467,7 +477,7 @@ inline fun result(initiate: Result.() -> Unit): Result
|
||||
|
||||
**Function Example**
|
||||
|
||||
你可以使用 `lambda` 形式创建 `Result` 类。
|
||||
你可以使用 **lambda** 形式创建 `Result` 类。
|
||||
|
||||
> The following example
|
||||
|
||||
@@ -543,13 +553,17 @@ constructor {
|
||||
### all <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun all(): ArrayList<Instance>
|
||||
fun all(): MutableList<Instance>
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
|
||||
`v1.2.0` `modified`
|
||||
|
||||
返回值类型由 `ArrayList` 修改为 `MutableList`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 获得 `Constructor` 实例处理类数组。
|
||||
@@ -591,20 +605,24 @@ fun give(): Constructor<*>?
|
||||
### giveAll <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun giveAll(): HashSet<Constructor<*>>
|
||||
fun giveAll(): MutableList<Constructor<*>>
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
|
||||
`v1.2.0` `modified`
|
||||
|
||||
返回值类型由 `HashSet` 修改为 `MutableList`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 得到 `Constructor` 本身数组。
|
||||
|
||||
返回全部查找条件匹配的多个 `Constructor` 实例。
|
||||
|
||||
在查找条件找不到任何结果的时候将返回空的 `HashSet`。
|
||||
在查找条件找不到任何结果的时候将返回空的 `MutableList`。
|
||||
|
||||
### wait <span class="symbol">- method</span>
|
||||
|
||||
@@ -633,13 +651,17 @@ fun wait(initiate: Instance.() -> Unit)
|
||||
### waitAll <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun waitAll(initiate: ArrayList<Instance>.() -> Unit)
|
||||
fun waitAll(initiate: MutableList<Instance>.() -> Unit)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
|
||||
`v1.2.0` `modified`
|
||||
|
||||
`initiate` 类型由 `ArrayList` 修改为 `MutableList`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 获得 `Constructor` 实例处理类数组,配合 `RemedyPlan` 使用。
|
||||
@@ -743,7 +765,7 @@ fun ignored(): Result
|
||||
|
||||
`v1.1.0` `deprecated`
|
||||
|
||||
请转移到新方法 `ignored()`
|
||||
请迁移到新方法 `ignored()`
|
||||
|
||||
### Instance <span class="symbol">- class</span>
|
||||
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
@@ -44,7 +50,7 @@ class FieldFinder internal constructor(override val classSet: Class<*>?) : Membe
|
||||
|
||||
`v1.0` `first`
|
||||
|
||||
`v1.0.2` `removed`
|
||||
`v1.0.2` `移除`
|
||||
|
||||
## name <span class="symbol">- field</span>
|
||||
|
||||
@@ -289,22 +295,26 @@ inner class Result internal constructor()
|
||||
#### onFind <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun onFind(initiate: HashSet<Field>.() -> Unit)
|
||||
fun onFind(initiate: MutableList<Field>.() -> Unit)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
|
||||
`v1.2.0` `modified`
|
||||
|
||||
`initiate` 类型由 `HashSet` 修改为 `MutableList`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 当在 `RemedyPlan` 中找到结果时。
|
||||
|
||||
**Function Example**
|
||||
**功能示例**
|
||||
|
||||
你可以方便地对重查找的 `Field` 实现 `onFind` 方法。
|
||||
|
||||
> The following example
|
||||
> 示例如下
|
||||
|
||||
```kotlin
|
||||
field {
|
||||
@@ -317,7 +327,7 @@ field {
|
||||
## Result <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inner class Result internal constructor(internal val isNoSuch: Boolean, private val throwable: Throwable?) : BaseResult
|
||||
inner class Result internal constructor(internal val isNoSuch: Boolean, internal val throwable: Throwable?) : BaseResult
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
@@ -350,11 +360,11 @@ inline fun result(initiate: Result.() -> Unit): Result
|
||||
|
||||
> 创建监听结果事件方法体。
|
||||
|
||||
**Function Example**
|
||||
**功能示例**
|
||||
|
||||
你可以使用 `lambda` 形式创建 `Result` 类。
|
||||
你可以使用 **lambda** 形式创建 `Result` 类。
|
||||
|
||||
> The following example
|
||||
> 示例如下
|
||||
|
||||
```kotlin
|
||||
field {
|
||||
@@ -387,11 +397,11 @@ fun get(instance: Any?): Instance
|
||||
|
||||
若有多个 `Field` 结果只会返回第一个。
|
||||
|
||||
**Function Example**
|
||||
**功能示例**
|
||||
|
||||
你可以轻松地得到 `Field` 的实例以及使用它进行设置实例。
|
||||
|
||||
> The following example
|
||||
> 示例如下
|
||||
|
||||
```kotlin
|
||||
field {
|
||||
@@ -401,7 +411,7 @@ field {
|
||||
|
||||
如果你取到的是静态 `Field`,可以不需要设置实例。
|
||||
|
||||
> The following example
|
||||
> 示例如下
|
||||
|
||||
```kotlin
|
||||
field {
|
||||
@@ -412,24 +422,28 @@ field {
|
||||
### all <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun all(instance: Any?): ArrayList<Instance>
|
||||
fun all(instance: Any?): MutableList<Instance>
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
|
||||
`v1.2.0` `modified`
|
||||
|
||||
返回值类型由 `ArrayList` 修改为 `MutableList`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 获得 `Field` 实例处理类数组。
|
||||
|
||||
返回全部查找条件匹配的多个 `Field` 实例结果。
|
||||
|
||||
**Function Example**
|
||||
**功能示例**
|
||||
|
||||
你可以通过此方法来获得当前条件结果中匹配的全部 `Field`,其 `Field` 所在实例用法与 `get` 相同。
|
||||
|
||||
> The following example
|
||||
> 示例如下
|
||||
|
||||
```kotlin
|
||||
field {
|
||||
@@ -460,20 +474,24 @@ fun give(): Field?
|
||||
### giveAll <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun giveAll(): HashSet<Field>
|
||||
fun giveAll(): MutableList<Field>
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
|
||||
`v1.2.0` `modified`
|
||||
|
||||
返回值类型由 `HashSet` 修改为 `MutableList`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 得到 `Field` 本身数组。
|
||||
|
||||
返回全部查找条件匹配的多个 `Field` 实例。
|
||||
|
||||
在查找条件找不到任何结果的时候将返回空的 `HashSet`。
|
||||
在查找条件找不到任何结果的时候将返回空的 `MutableList`。
|
||||
|
||||
### wait <span class="symbol">- method</span>
|
||||
|
||||
@@ -502,13 +520,17 @@ fun wait(instance: Any?, initiate: Instance.() -> Unit)
|
||||
### waitAll <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun waitAll(instance: Any?, initiate: ArrayList<Instance>.() -> Unit)
|
||||
fun waitAll(instance: Any?, initiate: MutableList<Instance>.() -> Unit)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
|
||||
`v1.2.0` `modified`
|
||||
|
||||
`initiate` 类型由 `ArrayList` 修改为 `MutableList`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 获得 `Field` 实例处理类数组,配合 `RemedyPlan` 使用。
|
||||
@@ -537,13 +559,13 @@ inline fun remedys(initiate: RemedyPlan.() -> Unit): Result
|
||||
|
||||
> 创建 `Field` 重查找功能。
|
||||
|
||||
**Function Example**
|
||||
**功能示例**
|
||||
|
||||
当你遇到一种 `Field` 可能存在不同形式的存在时,可以使用 `RemedyPlan` 重新查找它,而没有必要使用 `onNoSuchField` 捕获异常二次查找 `Field`。
|
||||
|
||||
若第一次查找失败了,你还可以在这里继续添加此方法体直到成功为止。
|
||||
|
||||
> The following example
|
||||
> 示例如下
|
||||
|
||||
```kotlin
|
||||
field {
|
||||
@@ -602,7 +624,7 @@ fun ignored(): Result
|
||||
|
||||
`v1.1.0` `deprecated`
|
||||
|
||||
请转移到新方法 `ignored()`
|
||||
请迁移到新方法 `ignored()`
|
||||
|
||||
### Instance <span class="symbol">- class</span>
|
||||
|
||||
@@ -630,7 +652,7 @@ inner class Instance internal constructor(private val instance: Any?, private va
|
||||
|
||||
`v1.0` `first`
|
||||
|
||||
`v1.1.0` `removed`
|
||||
`v1.1.0` `移除`
|
||||
|
||||
请直接使用 `any` 方法得到 `Field` 自身的实例化对象
|
||||
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
@@ -435,7 +441,7 @@ inner class Result internal constructor()
|
||||
#### onFind <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun onFind(initiate: HashSet<Method>.() -> Unit)
|
||||
fun onFind(initiate: MutableList<Method>.() -> Unit)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
@@ -446,6 +452,10 @@ fun onFind(initiate: HashSet<Method>.() -> Unit)
|
||||
|
||||
`initiate` 参数 `Method` 变为 `HashSet<Method>`
|
||||
|
||||
`v1.2.0` `modified`
|
||||
|
||||
`initiate` 类型由 `HashSet` 修改为 `MutableList`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 当在 `RemedyPlan` 中找到结果时。
|
||||
@@ -494,7 +504,7 @@ inline fun result(initiate: Process.() -> Unit): Process
|
||||
|
||||
**Function Example**
|
||||
|
||||
你可以使用 `lambda` 形式创建 `Result` 类。
|
||||
你可以使用 **lambda** 形式创建 `Result` 类。
|
||||
|
||||
> The following example
|
||||
|
||||
@@ -611,7 +621,7 @@ inline fun result(initiate: Result.() -> Unit): Result
|
||||
|
||||
**Function Example**
|
||||
|
||||
你可以使用 `lambda` 形式创建 `Result` 类。
|
||||
你可以使用 **lambda** 形式创建 `Result` 类。
|
||||
|
||||
> The following example
|
||||
|
||||
@@ -673,13 +683,17 @@ method {
|
||||
### all <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun all(instance: Any?): ArrayList<Instance>
|
||||
fun all(instance: Any?): MutableList<Instance>
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
|
||||
`v1.2.0` `modified`
|
||||
|
||||
返回值类型由 `ArrayList` 修改为 `MutableList`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 获得 `Method` 实例处理类数组。
|
||||
@@ -721,20 +735,24 @@ fun give(): Method?
|
||||
### giveAll <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun giveAll(): HashSet<Method>
|
||||
fun giveAll(): MutableList<Method>
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
|
||||
`v1.2.0` `modified`
|
||||
|
||||
返回值类型由 `HashSet` 修改为 `MutableList`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 得到 `Method` 本身数组。
|
||||
|
||||
返回全部查找条件匹配的多个 `Method` 实例。
|
||||
|
||||
在查找条件找不到任何结果的时候将返回空的 `HashSet`。
|
||||
在查找条件找不到任何结果的时候将返回空的 `MutableList`。
|
||||
|
||||
### wait <span class="symbol">- method</span>
|
||||
|
||||
@@ -763,13 +781,17 @@ fun wait(instance: Any?, initiate: Instance.() -> Unit)
|
||||
### waitAll <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun waitAll(instance: Any?, initiate: ArrayList<Instance>.() -> Unit)
|
||||
fun waitAll(instance: Any?, initiate: MutableList<Instance>.() -> Unit)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
|
||||
`v1.2.0` `modified`
|
||||
|
||||
`initiate` 类型由 `ArrayList` 修改为 `MutableList`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 获得 `Method` 实例处理类数组,配合 `RemedyPlan` 使用。
|
||||
@@ -873,7 +895,7 @@ fun ignored(): Result
|
||||
|
||||
`v1.1.0` `deprecated`
|
||||
|
||||
请转移到新方法 `ignored()`
|
||||
请迁移到新方法 `ignored()`
|
||||
|
||||
### Instance <span class="symbol">- class</span>
|
||||
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
@@ -76,6 +82,24 @@ CONSTRUCTOR
|
||||
|
||||
> 全部 `Constructor`。
|
||||
|
||||
## LazyClass <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
open class LazyClass<T> internal constructor(
|
||||
private val instance: Any,
|
||||
private val initialize: Boolean,
|
||||
private val loader: ClassLoaderInitializer?
|
||||
)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 懒装载 `Class` 实例。
|
||||
|
||||
## ClassLoader.listOfClasses <span class="symbol">- ext-method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
@@ -118,7 +142,7 @@ inline fun ClassLoader.searchClass(name: String, async: Boolean, initiate: Class
|
||||
|
||||
建议启用 **async** 或设置 **name** 参数,**name** 参数将在 Hook APP (宿主) 不同版本中自动进行本地缓存以提升效率。
|
||||
|
||||
此功能尚在试验阶段,性能与稳定性可能仍然存在问题,使用过程遇到问题请向我们报告并帮助我们改进。
|
||||
此功能尚在实验阶段,性能与稳定性可能仍然存在问题,使用过程遇到问题请向我们报告并帮助我们改进。
|
||||
|
||||
:::
|
||||
|
||||
@@ -536,7 +560,7 @@ inline fun <reified T> classOf(loader: ClassLoader?, initialize: Boolean): Class
|
||||
|
||||
**Function Example**
|
||||
|
||||
我们要获取一个 `Class` 在 `Kotlin` 下不通过反射时应该这样做。
|
||||
我们要获取一个 `Class` 在 Kotlin 下不通过反射时应该这样做。
|
||||
|
||||
> The following example
|
||||
|
||||
@@ -561,6 +585,50 @@ val customClassLoader: ClassLoader? = ... // 假设这个就是你的 ClassLoade
|
||||
classOf<DemoClass>(customClassLoader)
|
||||
```
|
||||
|
||||
## lazyClass <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun lazyClass(name: String, initialize: Boolean, loader: ClassLoaderInitializer?): LazyClass.NonNull<Any>
|
||||
```
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun <reified T> lazyClass(name: String, initialize: Boolean, loader: ClassLoaderInitializer?): LazyClass.NonNull<T>
|
||||
```
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun lazyClass(variousClass: VariousClass, initialize: Boolean, loader: ClassLoaderInitializer?): LazyClass.NonNull<Any>
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 懒装载 `Class`。
|
||||
|
||||
## lazyClassOrNull <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun lazyClassOrNull(name: String, initialize: Boolean, loader: ClassLoaderInitializer?): LazyClass.Nullable<Any>
|
||||
```
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun <reified T> lazyClassOrNull(name: String, initialize: Boolean, loader: ClassLoaderInitializer?): LazyClass.Nullable<T>
|
||||
```
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun lazyClassOrNull(variousClass: VariousClass, initialize: Boolean, loader: ClassLoaderInitializer?): LazyClass.Nullable<Any>
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 懒装载 `Class`。
|
||||
|
||||
## String.hasClass <span class="symbol">- ext-method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
@@ -904,7 +972,7 @@ inline fun <reified T : Any> T.current(ignored: Boolean, initiate: CurrentClass.
|
||||
|
||||
`v1.1.0` `deprecated`
|
||||
|
||||
请转移到 `buildOf` 方法
|
||||
请迁移到 `buildOf` 方法
|
||||
|
||||
## Class.buildOf <span class="symbol">- ext-method</span>
|
||||
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
@@ -22,7 +28,7 @@ You can use the **Chrome Translation Plugin** to translate entire pages for refe
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 这是 `YukiHookAPI` 相关 `lambda` 方法的封装类以及部分 API 用法。
|
||||
> 这是 `YukiHookAPI` 相关 **lambda** 方法的封装类以及部分 API 用法。
|
||||
|
||||
## IYukiHookXposedInit.configs <span class="symbol">- ext-method</span>
|
||||
|
||||
@@ -64,33 +70,45 @@ fun IYukiHookXposedInit.encase(vararg hooker: YukiBaseHooker)
|
||||
|
||||
> 在 `IYukiHookXposedInit` 中调用 `YukiHookAPI`。
|
||||
|
||||
## Context.modulePrefs <span class="symbol">- ext-field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
val Context.modulePrefs: YukiHookModulePrefs
|
||||
```
|
||||
<h2 class="deprecated">Context.modulePrefs - ext-field</h2>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
`v1.1.9` `deprecated`
|
||||
|
||||
> 获取模块的存取对象。
|
||||
请迁移到 `prefs` 方法
|
||||
|
||||
## Context.modulePrefs <span class="symbol">- ext-method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun Context.modulePrefs(name: String): YukiHookModulePrefs
|
||||
```
|
||||
<h2 class="deprecated">Context.modulePrefs - ext-method</h2>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0` `first`
|
||||
|
||||
`v1.1.9` `deprecated`
|
||||
|
||||
请迁移到 `prefs` 方法
|
||||
|
||||
## Context.prefs <span class="symbol">- ext-method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun Context.prefs(name: String): YukiHookPrefsBridge
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.9` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 获取模块的存取对象,可设置 `name` 为自定义 Sp 存储名称。
|
||||
> 创建 `YukiHookPrefsBridge` 对象。
|
||||
|
||||
可以同时在模块与 (Xposed) 宿主环境中使用。
|
||||
|
||||
如果你想在 (Xposed) 宿主环境将数据存入当前宿主的私有空间,请使用 `YukiHookPrefsBridge.native` 方法。
|
||||
|
||||
在未声明任何条件的情况下 (Xposed) 宿主环境默认读取模块中的数据。
|
||||
|
||||
## Context.dataChannel <span class="symbol">- ext-method</span>
|
||||
|
||||
@@ -104,7 +122,7 @@ fun Context.dataChannel(packageName: String): YukiHookDataChannel.NameSpace
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 获取模块的数据通讯桥命名空间对象。
|
||||
> 获取 `YukiHookDataChannel` 对象。
|
||||
|
||||
::: danger
|
||||
|
||||
@@ -212,7 +230,7 @@ fun Context.applyModuleTheme(theme: Int, configuration: Configuration?): ModuleC
|
||||
|
||||
`v1.0.91` `removed`
|
||||
|
||||
请转移到 `YukiHookAPI.Status.isSupportResourcesHook`
|
||||
请迁移到 `YukiHookAPI.Status.isSupportResourcesHook`
|
||||
|
||||
<h2 class="deprecated">isModuleActive - field</h2>
|
||||
|
||||
@@ -222,7 +240,7 @@ fun Context.applyModuleTheme(theme: Int, configuration: Configuration?): ModuleC
|
||||
|
||||
`v1.0.91` `removed`
|
||||
|
||||
请转移到 `YukiHookAPI.Status.isModuleActive`
|
||||
请迁移到 `YukiHookAPI.Status.isModuleActive`
|
||||
|
||||
<h2 class="deprecated">isXposedModuleActive - field</h2>
|
||||
|
||||
@@ -232,7 +250,7 @@ fun Context.applyModuleTheme(theme: Int, configuration: Configuration?): ModuleC
|
||||
|
||||
`v1.0.91` `removed`
|
||||
|
||||
请转移到 `YukiHookAPI.Status.isXposedModuleActive`
|
||||
请迁移到 `YukiHookAPI.Status.isXposedModuleActive`
|
||||
|
||||
<h2 class="deprecated">isTaiChiModuleActive - field</h2>
|
||||
|
||||
@@ -242,7 +260,7 @@ fun Context.applyModuleTheme(theme: Int, configuration: Configuration?): ModuleC
|
||||
|
||||
`v1.0.91` `removed`
|
||||
|
||||
请转移到 `YukiHookAPI.Status.isTaiChiModuleActive`
|
||||
请迁移到 `YukiHookAPI.Status.isTaiChiModuleActive`
|
||||
|
||||
<h1 class="deprecated">YukiHookModuleStatus - class</h1>
|
||||
|
||||
@@ -252,4 +270,4 @@ fun Context.applyModuleTheme(theme: Int, configuration: Configuration?): ModuleC
|
||||
|
||||
`v1.0.91` `deprecated`
|
||||
|
||||
请转移到 `YukiHookAPI.Status`
|
||||
请迁移到 `YukiHookAPI.Status`
|
@@ -4,35 +4,403 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
|
||||
:::
|
||||
|
||||
# LoggerFactory <span class="symbol">- kt</span>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 这是 `YukiHookAPI` 的日志封装类,可实现同时向 `Logcat` 和 (Xposed) 宿主环境打印日志的功能。
|
||||
|
||||
## LoggerType <span class="symbol">- class</span>
|
||||
# YLog <span class="symbol">- object</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
enum class LoggerType
|
||||
object YLog
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 需要打印的日志类型。
|
||||
> 全局 Log 管理类。
|
||||
|
||||
## inMemoryData <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
val inMemoryData: MutableList<YLogData>
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 当前全部已记录的日志数据。
|
||||
|
||||
::: danger
|
||||
|
||||
获取到的日志数据在 Hook APP (宿主) 及模块进程中是相互隔离的。
|
||||
|
||||
:::
|
||||
|
||||
## contents <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
val contents: String
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 获取当前日志文件内容。
|
||||
|
||||
如果当前没有已记录的日志会返回空字符串。
|
||||
|
||||
::: danger
|
||||
|
||||
获取到的日志数据在 Hook APP (宿主) 及模块进程中是相互隔离的。
|
||||
|
||||
:::
|
||||
|
||||
## contents <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun contents(data: List<YLogData>): String
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 获取、格式化当前日志文件内容。
|
||||
|
||||
如果当前没有已记录的日志 (`data` 为空) 会返回空字符串。
|
||||
|
||||
::: danger
|
||||
|
||||
获取到的日志数据在 Hook APP (宿主) 及模块进程中是相互隔离的。
|
||||
|
||||
:::
|
||||
|
||||
## clear <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun clear()
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 清除全部已记录的日志。
|
||||
|
||||
你也可以直接获取 [inMemoryData](#inmemorydata-field) 来清除。
|
||||
|
||||
::: danger
|
||||
|
||||
获取到的日志数据在 Hook APP (宿主) 及模块进程中是相互隔离的。
|
||||
|
||||
:::
|
||||
|
||||
## saveToFile <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun saveToFile(fileName: String, data: List<YLogData>)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 保存当前日志到文件。
|
||||
|
||||
若当前未开启 `Configs.isRecord` 或记录为空则不会进行任何操作。
|
||||
|
||||
日志文件会追加到 `fileName` 的文件结尾,若文件不存在会自动创建。
|
||||
|
||||
::: danger
|
||||
|
||||
文件读写权限取决于当前宿主、模块已获取的权限。
|
||||
|
||||
:::
|
||||
|
||||
## Configs <span class="symbol">- object</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
object Configs
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 配置 `YLog`。
|
||||
|
||||
### TAG <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
const val TAG: Int
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 标签。
|
||||
|
||||
### PRIORITY <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
const val PRIORITY: Int
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 优先级。
|
||||
|
||||
### PACKAGE_NAME <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
const val PACKAGE_NAME: Int
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 当前宿主的包名。
|
||||
|
||||
### USER_ID <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
const val USER_ID: Int
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 当前宿主的用户 ID (主用户不显示)。
|
||||
|
||||
### tag <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
var tag: String
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 这是一个调试日志的全局标识。
|
||||
|
||||
默认文案为 `YukiHookAPI`。
|
||||
|
||||
你可以修改为你自己的文案。
|
||||
|
||||
### isEnable <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
var isEnable: Boolean
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 是否启用调试日志的输出功能。
|
||||
|
||||
关闭后将会停用 `YukiHookAPI` 对全部日志的输出。
|
||||
|
||||
但是不影响当你手动调用下面这些方法输出日志。
|
||||
|
||||
`debug`、`info`、`warn`、`error`。
|
||||
|
||||
当 `isEnable` 关闭后 `YukiHookAPI.Configs.isDebug` 也将同时关闭。
|
||||
|
||||
### isRecord <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
var isRecord: Boolean
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 是否启用调试日志的记录功能。
|
||||
|
||||
开启后将会在内存中记录全部可用的日志和异常堆栈。
|
||||
|
||||
需要同时启用 [isEnable](#isenable-field) 才能有效。
|
||||
|
||||
::: danger
|
||||
|
||||
过量的日志可能会导致宿主运行缓慢或造成频繁 GC。
|
||||
|
||||
:::
|
||||
|
||||
开启后你可以调用 [YLog.saveToFile](#savetofile-method) 实时保存日志到文件或使用 [YLog.contents](#contents-field) 获取实时日志文件。
|
||||
|
||||
### elements <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun elements(vararg item: Int)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 自定义调试日志对外显示的元素。
|
||||
|
||||
只对日志记录和 (Xposed) 宿主环境的日志生效。
|
||||
|
||||
日志元素的排列将按照你在 `item` 中设置的顺序进行显示。
|
||||
|
||||
你还可以留空 `item` 以不显示除日志内容外的全部元素。
|
||||
|
||||
可用的元素有:`TAG`、`PRIORITY`、`PACKAGE_NAME`、`USER_ID`。
|
||||
|
||||
**功能示例**
|
||||
|
||||
打印的日志样式将按照你设置的排列顺序和元素内容进行。
|
||||
|
||||
> 示例如下
|
||||
|
||||
```kotlin
|
||||
elements(TAG, PRIORITY, PACKAGE_NAME, USER_ID)
|
||||
```
|
||||
|
||||
以上内容定义的日志将显示为如下样式。
|
||||
|
||||
> 示例如下
|
||||
|
||||
```:no-line-numbers
|
||||
[YukiHookAPI][D][com.demo.test][999]--> This is a log
|
||||
```
|
||||
|
||||
如果我们调整元素顺序以及减少个数,那么结果又会不一样。
|
||||
|
||||
> 示例如下
|
||||
|
||||
```kotlin
|
||||
elements(PACKAGE_NAME, USER_ID, PRIORITY)
|
||||
```
|
||||
|
||||
以上内容定义的日志将显示为如下样式。
|
||||
|
||||
> 示例如下
|
||||
|
||||
```:no-line-numbers
|
||||
[com.demo.test][999][D]--> This is a log
|
||||
```
|
||||
|
||||
## debug <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun debug(msg: String, e: Throwable?, tag: String, env: EnvType)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 打印 Debug 级别 Log。
|
||||
|
||||
## info <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun info(msg: String, e: Throwable?, tag: String, env: EnvType)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 打印 Info 级别 Log。
|
||||
|
||||
## warn <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun warn(msg: String, e: Throwable?, tag: String, env: EnvType)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 打印 Warn 级别 Log。
|
||||
|
||||
## error <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun error(msg: String, e: Throwable?, tag: String, env: EnvType)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 打印 Error 级别 Log。
|
||||
|
||||
## EnvType <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
enum class EnvType
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 需要打印的日志环境类型。
|
||||
|
||||
决定于模块与 (Xposed) 宿主环境使用的打印方式。
|
||||
|
||||
@@ -44,22 +412,12 @@ LOGD
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 仅使用 `android.util.Log`。
|
||||
|
||||
<h3 class="deprecated">XPOSEDBRIDGE - enum</h3>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
|
||||
`v1.1.5` `deprecated`
|
||||
|
||||
请转移到 `XPOSED_ENVIRONMENT`
|
||||
|
||||
### XPOSED_ENVIRONMENT <span class="symbol">- enum</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
@@ -68,7 +426,7 @@ XPOSED_ENVIRONMENT
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.5` `added`
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -88,7 +446,7 @@ SCOPE
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -106,7 +464,7 @@ BOTH
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -116,433 +474,12 @@ BOTH
|
||||
|
||||
模块环境仅使用 `LOGD`。
|
||||
|
||||
## YukiLoggerData <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
data class YukiLoggerData internal constructor(
|
||||
var timestamp: Long,
|
||||
var time: String,
|
||||
var tag: String,
|
||||
var priority: String,
|
||||
var packageName: String,
|
||||
var userId: Int,
|
||||
var msg: String,
|
||||
var throwable: Throwable?
|
||||
) : Serializable
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.2` `added`
|
||||
|
||||
`v1.1.4` `modified`
|
||||
|
||||
实现 `Serializable` 接口并标识为 `data class`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 调试日志数据实现类。
|
||||
|
||||
## YukiHookLogger <span class="symbol">- object</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
object YukiHookLogger
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 调试日志实现类。
|
||||
|
||||
### inMemoryData <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
val inMemoryData: ArrayList<YukiLoggerData>
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.2` `added`
|
||||
|
||||
`v1.1.4` `modified`
|
||||
|
||||
类型由 `HashSet` 修改为 `ArrayList`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 当前全部已记录的日志数据。
|
||||
|
||||
::: danger
|
||||
|
||||
获取到的日志数据在 Hook APP (宿主) 及模块进程中是相互隔离的。
|
||||
|
||||
:::
|
||||
|
||||
### contents <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
val contents: String
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 获取当前日志文件内容。
|
||||
|
||||
如果当前没有已记录的日志会返回空字符串。
|
||||
|
||||
::: danger
|
||||
|
||||
获取到的日志数据在 Hook APP (宿主) 及模块进程中是相互隔离的。
|
||||
|
||||
:::
|
||||
|
||||
### contents <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun contents(data: ArrayList<YukiLoggerData>): String
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.5` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 获取、格式化当前日志文件内容。
|
||||
|
||||
如果当前没有已记录的日志 (`data` 为空) 会返回空字符串。
|
||||
|
||||
::: danger
|
||||
|
||||
获取到的日志数据在 Hook APP (宿主) 及模块进程中是相互隔离的。
|
||||
|
||||
:::
|
||||
|
||||
### clear <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun clear()
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 清除全部已记录的日志。
|
||||
|
||||
::: danger
|
||||
|
||||
获取到的日志数据在 Hook APP (宿主) 及模块进程中是相互隔离的。
|
||||
|
||||
:::
|
||||
|
||||
你也可以直接获取 [inMemoryData](#inmemorydata-field) 来清除。
|
||||
|
||||
### saveToFile <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun saveToFile(fileName: String, data: ArrayList<YukiLoggerData>)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
|
||||
`v1.1.5` `modified`
|
||||
|
||||
新增 `data` 参数
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 保存当前日志到文件。
|
||||
|
||||
若当前未开启 `Configs.isRecord` 或记录为空则不会进行任何操作。
|
||||
|
||||
日志文件会追加到 `fileName` 的文件结尾,若文件不存在会自动创建。
|
||||
|
||||
::: danger
|
||||
|
||||
文件读写权限取决于当前宿主、模块已获取的权限。
|
||||
|
||||
:::
|
||||
|
||||
### Configs <span class="symbol">- object</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
object Configs
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 配置 `YukiHookLogger`。
|
||||
|
||||
#### TAG <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
const val TAG: Int
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 标签。
|
||||
|
||||
#### PRIORITY <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
const val PRIORITY: Int
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 优先级。
|
||||
|
||||
#### PACKAGE_NAME <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
const val PACKAGE_NAME: Int
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 当前宿主的包名。
|
||||
|
||||
#### USER_ID <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
const val USER_ID: Int
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 当前宿主的用户 ID (主用户不显示)。
|
||||
|
||||
#### isEnable <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
var isEnable: Boolean
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 是否启用调试日志的输出功能。
|
||||
|
||||
关闭后将会停用 `YukiHookAPI` 对全部日志的输出。
|
||||
|
||||
但是不影响当你手动调用下面这些方法输出日志。
|
||||
|
||||
`loggerD`、`loggerI`、`loggerW`、`loggerE`。
|
||||
|
||||
当 `isEnable` 关闭后 `YukiHookAPI.Configs.isDebug` 也将同时关闭。
|
||||
|
||||
#### isRecord <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
var isRecord: Boolean
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 是否启用调试日志的记录功能。
|
||||
|
||||
开启后将会在内存中记录全部可用的日志和异常堆栈。
|
||||
|
||||
需要同时启用 [isEnable](#isenable-field) 才能有效。
|
||||
|
||||
::: danger
|
||||
|
||||
过量的日志可能会导致宿主运行缓慢或造成频繁 GC。
|
||||
|
||||
:::
|
||||
|
||||
开启后你可以调用 [YukiHookLogger.saveToFile](#savetofile-method) 实时保存日志到文件或使用 [YukiHookLogger.contents](#contents-field) 获取实时日志文件。
|
||||
|
||||
#### tag <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
var tag: String
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 这是一个调试日志的全局标识。
|
||||
|
||||
默认文案为 `YukiHookAPI`。
|
||||
|
||||
你可以修改为你自己的文案。
|
||||
|
||||
#### elements <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun elements(vararg item: Int)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 自定义调试日志对外显示的元素。
|
||||
|
||||
只对日志记录和 (Xposed) 宿主环境的日志生效。
|
||||
|
||||
日志元素的排列将按照你在 `item` 中设置的顺序进行显示。
|
||||
|
||||
你还可以留空 `item` 以不显示除日志内容外的全部元素。
|
||||
|
||||
可用的元素有:`TAG`、`PRIORITY`、`PACKAGE_NAME`、`USER_ID`。
|
||||
|
||||
**Function Example**
|
||||
|
||||
打印的日志样式将按照你设置的排列顺序和元素内容进行。
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
elements(TAG, PRIORITY, PACKAGE_NAME, USER_ID)
|
||||
```
|
||||
|
||||
以上内容定义的日志将显示为如下样式。
|
||||
|
||||
> The following example
|
||||
|
||||
```:no-line-numbers
|
||||
[YukiHookAPI][D][com.demo.test][999]--> This is a log
|
||||
```
|
||||
|
||||
如果我们调整元素顺序以及减少个数,那么结果又会不一样。
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
elements(PACKAGE_NAME, USER_ID, PRIORITY)
|
||||
```
|
||||
|
||||
以上内容定义的日志将显示为如下样式。
|
||||
|
||||
> The following example
|
||||
|
||||
```:no-line-numbers
|
||||
[com.demo.test][999][D]--> This is a log
|
||||
```
|
||||
|
||||
## loggerD <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun loggerD(tag: String, msg: String, type: LoggerType)
|
||||
```
|
||||
<h1 class="deprecated">LoggerFactory - kt</h1>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0` `first`
|
||||
|
||||
`v1.1.0` `modified`
|
||||
`v1.2.0` `deprecated`
|
||||
|
||||
新增 `type` 参数
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 向 `Logcat` 和 (Xposed) 宿主环境打印日志,级别 `D`。
|
||||
|
||||
`tag` 的默认参数为 `YukiHookAPI.Configs.debugTag`,你可以进行自定义。
|
||||
|
||||
## loggerI <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun loggerI(tag: String, msg: String, type: LoggerType)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0` `first`
|
||||
|
||||
`v1.1.0` `modified`
|
||||
|
||||
新增 `type` 参数
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 向 `Logcat` 和 (Xposed) 宿主环境打印日志,级别 `I`。
|
||||
|
||||
`tag` 的默认参数为 `YukiHookAPI.Configs.debugTag`,你可以进行自定义。
|
||||
|
||||
## loggerW <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun loggerW(tag: String, msg: String, type: LoggerType)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0` `first`
|
||||
|
||||
`v1.1.0` `modified`
|
||||
|
||||
新增 `type` 参数
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 向 `Logcat` 和 (Xposed) 宿主环境打印日志,级别 `W`。
|
||||
|
||||
`tag` 的默认参数为 `YukiHookAPI.Configs.debugTag`,你可以进行自定义。
|
||||
|
||||
## loggerE <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun loggerE(tag: String, msg: String, e: Throwable?, type: LoggerType)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0` `first`
|
||||
|
||||
`v1.1.0` `modified`
|
||||
|
||||
新增 `type` 参数
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 向 `Logcat` 和 (Xposed) 宿主环境打印日志,级别 `E`,可携带 `e` 异常信息,将打印异常堆栈。
|
||||
|
||||
`tag` 的默认参数为 `YukiHookAPI.Configs.debugTag`,你可以进行自定义。
|
||||
请迁移到 `YLog`
|
@@ -0,0 +1,40 @@
|
||||
---
|
||||
pageClass: code-page
|
||||
---
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
|
||||
:::
|
||||
|
||||
# YLogData <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
data class YLogData internal constructor(
|
||||
var timestamp: Long,
|
||||
var time: String,
|
||||
var tag: String,
|
||||
var priority: String,
|
||||
var packageName: String,
|
||||
var userId: Int,
|
||||
var msg: String,
|
||||
var throwable: Throwable?
|
||||
) : Serializable
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 调试日志数据实现类。
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
@@ -13,7 +19,7 @@ You can use the **Chrome Translation Plugin** to translate entire pages for refe
|
||||
# HookParam <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
class HookParam internal constructor(
|
||||
class HookParam private constructor(
|
||||
private val creatorInstance: YukiMemberHookCreator,
|
||||
private var paramId: String,
|
||||
private var param: YukiHookCallback.Param?
|
||||
@@ -34,6 +40,10 @@ class HookParam internal constructor(
|
||||
|
||||
新增 `paramId` 参数
|
||||
|
||||
`v1.2.0` `modified`
|
||||
|
||||
不再开放构造方法
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> Hook 方法、构造方法的目标对象实现类。
|
||||
@@ -119,17 +129,27 @@ val instanceOrNull: Any?
|
||||
## instanceClass <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
val instanceClass: Class<*>
|
||||
val instanceClass: Class<*>?
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0` `first`
|
||||
|
||||
`v1.2.0` `modified`
|
||||
|
||||
加入可空类型 (空安全)
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 获取当前 Hook 实例的类对象。
|
||||
|
||||
::: danger
|
||||
|
||||
如果你当前 Hook 的对象是一个静态,那么它将不存在实例的对象。
|
||||
|
||||
:::
|
||||
|
||||
## member <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
@@ -248,7 +268,7 @@ fun Throwable.throwToApp()
|
||||
|
||||
使用 `throwable` 获取当前设置的方法调用抛出异常。
|
||||
|
||||
仅会在回调方法的 `MemberHookCreator.beforeHook` 或 `MemberHookCreator.afterHook` 中生效。
|
||||
仅会在回调方法的 `MemberHookCreator.before` 或 `MemberHookCreator.after` 中生效。
|
||||
|
||||
::: danger
|
||||
|
||||
@@ -265,11 +285,8 @@ Hook 过程中的异常仅会作用于 (Xposed) 宿主环境,目标 Hook APP
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
injectMember {
|
||||
method {
|
||||
// ...
|
||||
}
|
||||
beforeHook {
|
||||
hook {
|
||||
before {
|
||||
RuntimeException("Test Exception").throwToApp()
|
||||
}
|
||||
}
|
||||
@@ -479,20 +496,19 @@ fun <T> callOriginal(): T?
|
||||
|
||||
此方法可以 `invoke` 原始未经 Hook 的 `Member` 对象,取决于原始 `Member` 的参数。
|
||||
|
||||
调用自身原始的方法不会再经过当前 `beforeHook`、`afterHook` 以及 `replaceUnit`、`replaceAny`。
|
||||
调用自身原始的方法不会再经过当前 `before`、`after` 以及 `replaceUnit`、`replaceAny`。
|
||||
|
||||
比如我们 Hook 的这个方法被这样调用 `test("test value")`,使用此方法会调用其中的 `"test value"` 作为参数。
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
injectMember {
|
||||
method {
|
||||
name = "test"
|
||||
param(StringClass)
|
||||
returnType = StringClass
|
||||
}
|
||||
afterHook {
|
||||
method {
|
||||
name = "test"
|
||||
param(StringClass)
|
||||
returnType = StringClass
|
||||
}.hook {
|
||||
after {
|
||||
// <方案1> 不使用泛型,不获取方法执行结果,调用将使用原方法传入的 args 自动传参
|
||||
callOriginal()
|
||||
// <方案2> 使用泛型,已知方法执行结果参数类型进行 cast
|
||||
@@ -530,20 +546,19 @@ fun <T> invokeOriginal(vararg args: Any?): T?
|
||||
|
||||
此方法可以 `invoke` 原始未经 Hook 的 `Member` 对象,可自定义需要调用的参数内容。
|
||||
|
||||
调用自身原始的方法不会再经过当前 `beforeHook`、`afterHook` 以及 `replaceUnit`、`replaceAny`。
|
||||
调用自身原始的方法不会再经过当前 `before`、`after` 以及 `replaceUnit`、`replaceAny`。
|
||||
|
||||
比如我们 Hook 的这个方法被这样调用 `test("test value")`,使用此方法可自定义其中的 `args` 作为参数。
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
injectMember {
|
||||
method {
|
||||
name = "test"
|
||||
param(StringClass)
|
||||
returnType = StringClass
|
||||
}
|
||||
afterHook {
|
||||
method {
|
||||
name = "test"
|
||||
param(StringClass)
|
||||
returnType = StringClass
|
||||
}.hook {
|
||||
after {
|
||||
// <方案1> 不使用泛型,不获取方法执行结果
|
||||
invokeOriginal("test value")
|
||||
// <方案2> 使用泛型,已知方法执行结果参数类型进行 cast,假设返回值为 String,失败会返回 null
|
||||
|
@@ -4,12 +4,22 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
|
||||
:::
|
||||
|
||||
---
|
||||
pageClass: code-page
|
||||
---
|
||||
|
||||
# PackageParam <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
@@ -27,7 +37,7 @@ open class PackageParam internal constructor(internal var wrapper: PackageParamW
|
||||
## appClassLoader <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
var appClassLoader:ClassLoader
|
||||
var appClassLoader:ClassLoader?
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
@@ -38,6 +48,10 @@ var appClassLoader:ClassLoader
|
||||
|
||||
可以动态修改此变量的值
|
||||
|
||||
`v1.2.0` `modified`
|
||||
|
||||
加入可空类型 (空安全)
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 获取、设置当前 Hook APP 的 `ClassLoader`。
|
||||
@@ -243,7 +257,7 @@ val moduleAppResources: YukiModuleResources
|
||||
## prefs <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
val prefs: YukiHookModulePrefs
|
||||
val prefs: YukiHookPrefsBridge
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
@@ -252,7 +266,7 @@ val prefs: YukiHookModulePrefs
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 获得当前使用的存取数据对象缓存实例。
|
||||
> 创建 `YukiHookPrefsBridge` 对象。
|
||||
|
||||
::: danger
|
||||
|
||||
@@ -263,7 +277,7 @@ val prefs: YukiHookModulePrefs
|
||||
## prefs <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun prefs(name: String): YukiHookModulePrefs
|
||||
fun prefs(name: String): YukiHookPrefsBridge
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
@@ -276,7 +290,7 @@ fun prefs(name: String): YukiHookModulePrefs
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 获得当前使用的存取数据对象缓存实例。
|
||||
> 创建 `YukiHookPrefsBridge` 对象。
|
||||
|
||||
你可以通过 `name` 来自定义 Sp 存储的名称。
|
||||
|
||||
@@ -298,7 +312,7 @@ val dataChannel: YukiHookDataChannel.NameSpace
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 获得当前使用的数据通讯桥命名空间对象。
|
||||
> 获取 `YukiHookDataChannel` 对象。
|
||||
|
||||
::: danger
|
||||
|
||||
@@ -412,7 +426,7 @@ fun loadApp(isExcludeSelf: Boolean, vararg hooker: YukiBaseHooker)
|
||||
|
||||
> 装载并 Hook 指定、全部包名的 APP。
|
||||
|
||||
`name` 为 APP 的包名,后方的两个参数一个可作为 `lambda` 方法体使用,一个可以直接装载子 Hooker。
|
||||
`name` 为 APP 的包名,后方的两个参数一个可作为 **lambda** 方法体使用,一个可以直接装载子 Hooker。
|
||||
|
||||
装载并 Hook 指定、全部包名的 APP。
|
||||
|
||||
@@ -422,7 +436,7 @@ fun loadApp(isExcludeSelf: Boolean, vararg hooker: YukiBaseHooker)
|
||||
|
||||
**Function Example**
|
||||
|
||||
你可以使用 `loadApp` 的 `lambda` 方法体形式或直接装载一个 Hooker。
|
||||
你可以使用 `loadApp` 的 **lambda** 方法体形式或直接装载一个 Hooker。
|
||||
|
||||
> The following example
|
||||
|
||||
@@ -450,7 +464,7 @@ loadApp(hooker = CustomHooker)
|
||||
|
||||
若要在全部可被 Hook 的 APP 中过滤掉模块自身,你只需加入 `isExcludeSelf = true`。
|
||||
|
||||
> 示例如下
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
// 使用 lambda
|
||||
@@ -507,7 +521,7 @@ fun loadZygote(vararg hooker: YukiBaseHooker)
|
||||
|
||||
> 装载 APP Zygote 事件。
|
||||
|
||||
方法中的两个参数一个可作为 `lambda` 方法体使用,一个可以直接装载子 Hooker。
|
||||
方法中的两个参数一个可作为 **lambda** 方法体使用,一个可以直接装载子 Hooker。
|
||||
|
||||
## loadSystem <span class="symbol">- method</span>
|
||||
|
||||
@@ -535,7 +549,7 @@ fun loadSystem(vararg hooker: YukiBaseHooker)
|
||||
|
||||
> 装载并 Hook 系统框架。
|
||||
|
||||
方法中的两个参数一个可作为 `lambda` 方法体使用,一个可以直接装载子 Hooker。
|
||||
方法中的两个参数一个可作为 **lambda** 方法体使用,一个可以直接装载子 Hooker。
|
||||
|
||||
## withProcess <span class="symbol">- method</span>
|
||||
|
||||
@@ -567,7 +581,7 @@ fun withProcess(name: String, vararg hooker: YukiBaseHooker)
|
||||
|
||||
> 装载并 Hook APP 的指定进程。
|
||||
|
||||
`name` 为 APP 的进程名称,后方的两个参数一个可作为 `lambda` 方法体使用,一个可以直接装载子 Hooker。
|
||||
`name` 为 APP 的进程名称,后方的两个参数一个可作为 **lambda** 方法体使用,一个可以直接装载子 Hooker。
|
||||
|
||||
## loadHooker <span class="symbol">- method</span>
|
||||
|
||||
@@ -605,7 +619,7 @@ inline fun searchClass(name: String, async: Boolean, initiate: ClassConditions):
|
||||
|
||||
建议启用 **async** 或设置 **name** 参数,**name** 参数将在 Hook APP (宿主) 不同版本中自动进行本地缓存以提升效率。
|
||||
|
||||
此功能尚在试验阶段,性能与稳定性可能仍然存在问题,使用过程遇到问题请向我们报告并帮助我们改进。
|
||||
此功能尚在实验阶段,性能与稳定性可能仍然存在问题,使用过程遇到问题请向我们报告并帮助我们改进。
|
||||
|
||||
:::
|
||||
|
||||
@@ -617,7 +631,7 @@ inline fun searchClass(name: String, async: Boolean, initiate: ClassConditions):
|
||||
|
||||
`v1.1.0` `deprecated`
|
||||
|
||||
请转移到 `toClass(...)` 方法
|
||||
请迁移到 `toClass(...)` 方法
|
||||
|
||||
<h2 class="deprecated">String.hasClass - i-ext-field</h2>
|
||||
|
||||
@@ -627,7 +641,7 @@ inline fun searchClass(name: String, async: Boolean, initiate: ClassConditions):
|
||||
|
||||
`v1.1.0` `deprecated`
|
||||
|
||||
请转移到 `hasClass(...)` 方法
|
||||
请迁移到 `hasClass(...)` 方法
|
||||
|
||||
## String+VariousClass.toClass <span class="symbol">- i-ext-method</span>
|
||||
|
||||
@@ -768,6 +782,50 @@ fun VariousClass.toClassOrNull(loader: ClassLoader?, initialize: Boolean): Class
|
||||
|
||||
用法请参考 [String+VariousClass.toClass](#string-variousclass-toclass-i-ext-method) 方法。
|
||||
|
||||
## lazyClass <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun lazyClass(name: String, initialize: Boolean, loader: ClassLoaderInitializer?): LazyClass.NonNull<Any>
|
||||
```
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun <reified T> lazyClass(name: String, initialize: Boolean, loader: ClassLoaderInitializer?): LazyClass.NonNull<T>
|
||||
```
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun lazyClass(variousClass: VariousClass, initialize: Boolean, loader: ClassLoaderInitializer?): LazyClass.NonNull<Any>
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 懒装载 `Class`。
|
||||
|
||||
## lazyClassOrNull <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun lazyClassOrNull(name: String, initialize: Boolean, loader: ClassLoaderInitializer?): LazyClass.Nullable<Any>
|
||||
```
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun <reified T> lazyClassOrNull(name: String, initialize: Boolean, loader: ClassLoaderInitializer?): LazyClass.Nullable<T>
|
||||
```
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun lazyClassOrNull(variousClass: VariousClass, initialize: Boolean, loader: ClassLoaderInitializer?): LazyClass.Nullable<Any>
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 懒装载 `Class`。
|
||||
|
||||
## String.hasClass <span class="symbol">- i-ext-method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
@@ -807,15 +865,7 @@ if("com.example.demo.DemoClass".hasClass(customClassLoader)) {
|
||||
}
|
||||
```
|
||||
|
||||
## findClass <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun findClass(name: String, loader: ClassLoader?): HookClass
|
||||
```
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun findClass(vararg name: String, loader: ClassLoader?): VariousClass
|
||||
```
|
||||
<h2 class="deprecated">findClass - method</h2>
|
||||
|
||||
**Change Records**
|
||||
|
||||
@@ -829,67 +879,11 @@ fun findClass(vararg name: String, loader: ClassLoader?): VariousClass
|
||||
|
||||
新增 `loader` 参数
|
||||
|
||||
**Function Illustrate**
|
||||
`v1.2.0` `deprecated`
|
||||
|
||||
> 通过完整包名+名称查找需要被 Hook 的 `Class`。
|
||||
请直接使用 `String.toClass(...)` 或 `VariousClass(...)`
|
||||
|
||||
::: warning
|
||||
|
||||
使用此方法会得到一个 **HookClass** 仅用于 Hook,若想查找 **Class** 请使用 [toClass](#string-variousclass-toclass-i-ext-method) 功能。
|
||||
|
||||
:::
|
||||
|
||||
**Function Example**
|
||||
|
||||
你可以使用三种方式查找你需要 Hook 的目标 `Class`。
|
||||
|
||||
你可以直接将被查找的 `Class` 完整包名+名称填入 `name` 中。
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
findClass(name = "com.example.demo.DemoClass")
|
||||
```
|
||||
|
||||
若你不确定多个版本的 `Class` 以及不同名称,你可以将多个完整包名+名称填入 `name` 中。
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
findClass("com.example.demo.DemoClass1", "com.example.demo.DemoClass2", "com.example.demo.DemoClass3")
|
||||
```
|
||||
|
||||
你还可以创建一个 `VariousClass`,将 `Class` 的完整包名+名称填入 `VariousClass` 的 `name` 中并填入 `various` 参数中。
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
val variousClass = VariousClass("com.example.demo.DemoClass1", "com.example.demo.DemoClass2", "com.example.demo.DemoClass3")
|
||||
```
|
||||
|
||||
若你当前需要查找的 `Class` 不属于 `appClassLoader`,你可以使用 `loader` 参数指定你要装载的 `ClassLoader`。
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
val outsideLoader: ClassLoader? = ... // 假设这就是你的 ClassLoader
|
||||
findClass(name = "com.example.demo.OutsideClass", loader = outsideLoader)
|
||||
```
|
||||
|
||||
同样地,在不确定多个版本的 `Class` 以及不同名称时,也可以使用 `loader` 参数指定你要装载的 `ClassLoader`。
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
val outsideLoader: ClassLoader? = ... // 假设这就是你的 ClassLoader
|
||||
findClass("com.example.demo.OutsideClass1", "com.example.demo.OutsideClass2", "com.example.demo.OutsideClass3", loader = outsideLoader)
|
||||
```
|
||||
|
||||
## String+Class+VariousClass+HookClass.hook <span class="symbol">- i-ext-method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun String.hook(initiate: YukiMemberHookCreator.() -> Unit): YukiMemberHookCreator.Result
|
||||
```
|
||||
## Class+VariousClass+HookClass.hook <span class="symbol">- i-ext-method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun Class<*>.hook(isForceUseAbsolute: Boolean, initiate: YukiMemberHookCreator.() -> Unit): YukiMemberHookCreator.Result
|
||||
@@ -933,76 +927,86 @@ inline fun HookClass.hook(initiate: YukiMemberHookCreator.() -> Unit): YukiMembe
|
||||
|
||||
添加了 `isForceUseAbsolute` 参数到 `Class.hook` 方法
|
||||
|
||||
`v1.2.0` `modified`
|
||||
|
||||
作废了 ~~`String.hook`~~ 方法
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 这是一切 Hook 的入口创建方法,Hook 方法、构造方法。
|
||||
> Hook 方法、构造方法。
|
||||
|
||||
**Function Example**
|
||||
## Member+BaseFinder.BaseResult.hook <span class="symbol">- i-ext-method</span>
|
||||
|
||||
如你所见,Hook 方法体的创建可使用 4 种方式。
|
||||
|
||||
通过字符串类名得到 `HookClass` 实例进行创建。
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
"com.example.demo.DemoClass".hook {
|
||||
// Your code here.
|
||||
}
|
||||
|
||||
```
|
||||
通过 `findClass` 得到 `HookClass` 实例进行创建。
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
findClass(name = "com.example.demo.DemoClass").hook {
|
||||
// Your code here.
|
||||
}
|
||||
```kotlin:no-line-numbers
|
||||
inline fun Member.hook(priority: YukiHookPriority): YukiMemberHookCreator.MemberHookCreator
|
||||
```
|
||||
|
||||
使用 `stub` 或直接拿到 `Class` 实例进行创建。
|
||||
|
||||
默认情况下 API 会将 `Class` 实例转换为类名并绑定到 `appClassLoader`,若失败,则会使用原始 `Class` 实例直接进行 Hook。
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
Stub::class.java.hook {
|
||||
// Your code here.
|
||||
}
|
||||
```kotlin:no-line-numbers
|
||||
inline fun Member.hook(priority: YukiHookPriority, initiate: YukiMemberHookCreator.MemberHookCreator.() -> Unit): YukiMemberHookCreator.MemberHookCreator.Result
|
||||
```
|
||||
|
||||
若当前 `Class` 不在 `appClassLoader` 且自动匹配无法找到该 `Class`,请启用 `isForceUseAbsolute`。
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
YourClass::class.java.hook(isForceUseAbsolute = true) {
|
||||
// Your code here.
|
||||
}
|
||||
```kotlin:no-line-numbers
|
||||
inline fun BaseFinder.BaseResult.hook(priority: YukiHookPriority): YukiMemberHookCreator.MemberHookCreator
|
||||
```
|
||||
|
||||
使用 `VariousClass` 实例进行创建。
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
VariousClass("com.example.demo.DemoClass1", "com.example.demo.DemoClass2").hook {
|
||||
// Your code here.
|
||||
}
|
||||
```kotlin:no-line-numbers
|
||||
inline fun BaseFinder.BaseResult.hook(priority: YukiHookPriority, initiate: YukiMemberHookCreator.MemberHookCreator.() -> Unit): YukiMemberHookCreator.MemberHookCreator.Result
|
||||
```
|
||||
|
||||
或者直接使用可变字符串数组进行创建。
|
||||
**Change Records**
|
||||
|
||||
> The following example
|
||||
`v1.2.0` `added`
|
||||
|
||||
```kotlin
|
||||
findClass("com.example.demo.DemoClass1", "com.example.demo.DemoClass2").hook {
|
||||
// Your code here.
|
||||
}
|
||||
**Function Illustrate**
|
||||
|
||||
> 直接 Hook 方法、构造方法。
|
||||
|
||||
::: warning
|
||||
|
||||
此功能尚在实验阶段,在 **1.x.x** 版本将暂定于此,在 **2.0.0** 版本将完全合并到新 API。
|
||||
|
||||
:::
|
||||
|
||||
## Array<Member>+List<Member>+BaseFinder.BaseResult.hookAll <span class="symbol">- i-ext-method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun Array<Member>.hookAll(priority: YukiHookPriority): YukiMemberHookCreator.MemberHookCreator
|
||||
```
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun Array<Member>.hookAll(priority: YukiHookPriority, initiate: YukiMemberHookCreator.MemberHookCreator.() -> Unit): YukiMemberHookCreator.MemberHookCreator.Result
|
||||
```
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun List<Member>.hookAll(priority: YukiHookPriority): YukiMemberHookCreator.MemberHookCreator
|
||||
```
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun List<Member>.hookAll(priority: YukiHookPriority, initiate: YukiMemberHookCreator.MemberHookCreator.() -> Unit): YukiMemberHookCreator.MemberHookCreator.Result
|
||||
```
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun BaseFinder.BaseResult.hookAll(priority: YukiHookPriority): YukiMemberHookCreator.MemberHookCreator
|
||||
```
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun BaseFinder.BaseResult.hookAll(priority: YukiHookPriority, initiate: YukiMemberHookCreator.MemberHookCreator.() -> Unit): YukiMemberHookCreator.MemberHookCreator.Result
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 直接 Hook 方法、构造方法 (批量)。
|
||||
|
||||
::: warning
|
||||
|
||||
此功能尚在实验阶段,在 **1.x.x** 版本将暂定于此,在 **2.0.0** 版本将完全合并到新 API。
|
||||
|
||||
:::
|
||||
|
||||
## HookResources.hook <span class="symbol">- i-ext-method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
@@ -1019,7 +1023,7 @@ inline fun HookResources.hook(initiate: YukiResourcesHookCreator.() -> Unit)
|
||||
|
||||
::: danger
|
||||
|
||||
请注意你需要确保当前 Hook Framework 支持且 **InjectYukiHookWithXposed.isUsingResourcesHook** 已启用。
|
||||
此功能将不再默认启用,如需启用,请手动设置 **InjectYukiHookWithXposed.isUsingResourcesHook**。
|
||||
|
||||
:::
|
||||
|
||||
@@ -1041,7 +1045,7 @@ resources().hook {
|
||||
|
||||
:::
|
||||
|
||||
将 Resources 的 Hook 设置为这样是为了与 `findClass(...).hook` 做到统一,使得调用起来逻辑不会混乱。
|
||||
将 Resources 的 Hook 设置为这样是为了与 `String.toClass(...).hook` 做到统一,使得调用起来逻辑不会混乱。
|
||||
|
||||
## AppLifecycle <span class="symbol">- class</span>
|
||||
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
@@ -20,4 +26,4 @@ You can use the **Chrome Translation Plugin** to translate entire pages for refe
|
||||
|
||||
> 这是一个预置反射类型的常量类,主要为 `Android` 相关组件的 `Class` 内容,跟随版本更新会逐一进行增加。
|
||||
|
||||
详情可 [点击这里](https://github.com/fankes/YukiHookAPI/blob/master/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/type/android/ComponentTypeFactory.kt) 进行查看。
|
||||
详情可 [点击这里](https://github.com/HighCapable/YukiHookAPI/blob/master/yukihookapi-core/src/main/java/com/highcapable/yukihookapi/hook/type/android/ComponentTypeFactory.kt) 进行查看。
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
@@ -20,4 +26,4 @@ You can use the **Chrome Translation Plugin** to translate entire pages for refe
|
||||
|
||||
> 这是一个预置反射类型的常量类,主要为 `Android` 相关 `Graphics` 的 `Class` 内容,跟随版本更新会逐一进行增加。
|
||||
|
||||
详情可 [点击这里](https://github.com/fankes/YukiHookAPI/blob/master/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/type/android/GraphicsTypeFactory.kt) 进行查看。
|
||||
详情可 [点击这里](https://github.com/HighCapable/YukiHookAPI/blob/master/yukihookapi-core/src/main/java/com/highcapable/yukihookapi/hook/type/android/GraphicsTypeFactory.kt) 进行查看。
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
@@ -20,4 +26,4 @@ You can use the **Chrome Translation Plugin** to translate entire pages for refe
|
||||
|
||||
> 这是一个预置反射类型的常量类,主要为 `Android` 相关 `Widget` 的 `Class` 内容,跟随版本更新会逐一进行增加。
|
||||
|
||||
详情可 [点击这里](https://github.com/fankes/YukiHookAPI/blob/master/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/type/android/ViewTypeFactory.kt) 进行查看。
|
||||
详情可 [点击这里](https://github.com/HighCapable/YukiHookAPI/blob/master/yukihookapi-core/src/main/java/com/highcapable/yukihookapi/hook/type/android/ViewTypeFactory.kt) 进行查看。
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
@@ -18,6 +24,6 @@ You can use the **Chrome Translation Plugin** to translate entire pages for refe
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 这是一个预置反射类型的常量类,主要为 `Java` 相关基本变量类型的 `Class` 内容,跟随版本更新会逐一进行增加。
|
||||
> 这是一个预置反射类型的常量类,主要为 Java 相关基本变量类型的 `Class` 内容,跟随版本更新会逐一进行增加。
|
||||
|
||||
详情可 [点击这里](https://github.com/fankes/YukiHookAPI/blob/master/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/type/java/VariableTypeFactory.kt) 进行查看。
|
||||
详情可 [点击这里](https://github.com/HighCapable/YukiHookAPI/blob/master/yukihookapi-core/src/main/java/com/highcapable/yukihookapi/hook/type/java/VariableTypeFactory.kt) 进行查看。
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
@@ -27,7 +33,7 @@ class YukiResources private constructor(private val baseInstance: XResources) :
|
||||
## LayoutInflatedParam <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
class LayoutInflatedParam(internal val baseParam: XC_LayoutInflated.LayoutInflatedParam)
|
||||
class LayoutInflatedParam(private val baseParam: XC_LayoutInflated.LayoutInflatedParam)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
@@ -37,7 +43,7 @@ class YukiHookDataChannel private constructor()
|
||||
## NameSpace <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inner class NameSpace internal constructor(private val context: Context?, private val packageName: String, private val isSecure: Boolean)
|
||||
inner class NameSpace internal constructor(private val context: Context?, private val packageName: String)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
@@ -48,6 +54,10 @@ inner class NameSpace internal constructor(private val context: Context?, privat
|
||||
|
||||
新增 `isSecure` 参数
|
||||
|
||||
`v1.1.9` `modified`
|
||||
|
||||
移除 `isSecure` 参数
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> `YukiHookDataChannel` 命名空间。
|
||||
@@ -66,23 +76,79 @@ inline fun with(initiate: NameSpace.() -> Unit): NameSpace
|
||||
|
||||
> 创建一个调用空间。
|
||||
|
||||
### dataMaxByteSize <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
var dataMaxByteSize: Int
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.9` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> `YukiHookDataChannel` 允许发送的最大数据字节大小。
|
||||
|
||||
默认为 `500 KB (500 * 1024)`,详情请参考 `receiverDataMaxByteSize` 的注释。
|
||||
|
||||
最小不能低于 `100 KB (100 * 1024)`,否则会被重新设置为 `100 KB (100 * 1024)`。
|
||||
|
||||
设置后将在全局生效,直到当前进程结束。
|
||||
|
||||
超出最大数据字节大小后的数据将被自动分段发送。
|
||||
|
||||
::: danger
|
||||
|
||||
请谨慎调整此参数,如果超出了系统能够允许的大小会引发 **TransactionTooLargeException** 异常。
|
||||
|
||||
:::
|
||||
|
||||
### dataMaxByteCompressionFactor <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
var dataMaxByteCompressionFactor: Int
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.9` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> `YukiHookDataChannel` 允许发送的最大数据字节大小倍数 (分段数据)。
|
||||
|
||||
默认为 `3`,详情请参考 `receiverDataMaxByteCompressionFactor` 的注释。
|
||||
|
||||
最小不能低于 `2`,否则会被重新设置为 `2`。
|
||||
|
||||
设置后将在全局生效,直到当前进程结束。
|
||||
|
||||
超出最大数据字节大小后的数据将按照此倍数自动划分 `receiverDataMaxByteSize` 的大小。
|
||||
|
||||
::: danger
|
||||
|
||||
请谨慎调整此参数,如果超出了系统能够允许的大小会引发 **TransactionTooLargeException** 异常。
|
||||
|
||||
:::
|
||||
|
||||
### allowSendTooLargeData <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun allowSendTooLargeData(): NameSpace
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
**Change Records**
|
||||
|
||||
`v1.1.5` `added`
|
||||
|
||||
**功能描述**
|
||||
**Function Illustrate**
|
||||
|
||||
> 解除发送数据的大小限制并禁止开启分段发送功能。
|
||||
|
||||
仅会在每次调用时生效,下一次没有调用此方法则此功能将被自动关闭。
|
||||
|
||||
你还需要在整个调用域中声明注解 `CauseProblemsApi` 以消除警告。
|
||||
你还需要在整个调用域中声明注解 `SendTooLargeChannelData` 以消除警告。
|
||||
|
||||
::: danger
|
||||
|
||||
@@ -199,7 +265,7 @@ fun checkingVersionEquals(priority: ChannelPriority?, result: (Boolean) -> Unit)
|
||||
### obtainLoggerInMemoryData <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun obtainLoggerInMemoryData(priority: ChannelPriority?, result: (ArrayList<YukiLoggerData>) -> Unit)
|
||||
fun obtainLoggerInMemoryData(priority: ChannelPriority?, result: (List<YLogData>) -> Unit)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
@@ -212,13 +278,13 @@ fun obtainLoggerInMemoryData(priority: ChannelPriority?, result: (ArrayList<Yuki
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 获取模块与宿主之间的 `ArrayList<YukiLoggerData>` 数据。
|
||||
> 获取模块与宿主之间的 `List<YLogData>` 数据。
|
||||
|
||||
由于模块与宿主处于不同的进程,我们可以使用数据通讯桥访问各自的调试日志数据。
|
||||
|
||||
::: danger
|
||||
|
||||
模块与宿主必须启用 [YukiHookLogger.Configs.isRecord](../../log/LoggerFactory#isrecord-field) 才能获取到调试日志数据。
|
||||
模块与宿主必须启用 [YLog.Configs.isRecord](../../log/YLog#isrecord-field) 才能获取到调试日志数据。
|
||||
|
||||
由于 Android 限制了数据传输大小的最大值,如果调试日志过多将会自动进行分段发送,数据越大速度越慢。
|
||||
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
@@ -26,4 +32,26 @@ open class ModuleAppActivity : Activity()
|
||||
|
||||
继承于此类的 `Activity` 可以同时在宿主与模块中启动。
|
||||
|
||||
在 (Xposed) 宿主环境需要在宿主启动时调用 `Context.registerModuleAppActivities` 进行注册。
|
||||
在 (Xposed) 宿主环境需要在宿主启动时调用 `Context.registerModuleAppActivities` 进行注册。
|
||||
|
||||
## proxyClassName <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
open val proxyClassName: String
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.10` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 设置当前代理的 `Activity` 类名。
|
||||
|
||||
留空则使用 `Context.registerModuleAppActivities` 时设置的类名
|
||||
|
||||
::: danger
|
||||
|
||||
代理的 **Activity** 类名必须存在于宿主的 AndroidMainifest 清单中。
|
||||
|
||||
:::
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
@@ -42,4 +48,26 @@ open val moduleTheme: Int
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 设置当前代理的 `Activity` 主题。
|
||||
> 设置当前代理的 `Activity` 主题。
|
||||
|
||||
## proxyClassName <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
open val proxyClassName: String
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.10` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 设置当前代理的 `Activity` 类名。
|
||||
|
||||
留空则使用 `Context.registerModuleAppActivities` 时设置的类名
|
||||
|
||||
::: danger
|
||||
|
||||
代理的 **Activity** 类名必须存在于宿主的 AndroidMainifest 清单中。
|
||||
|
||||
:::
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
|
@@ -4,31 +4,41 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
|
||||
:::
|
||||
|
||||
# YukiHookModulePrefs <span class="symbol">- class</span>
|
||||
# YukiHookPrefsBridge <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
class YukiHookModulePrefs private constructor(private var context: Context?)
|
||||
class YukiHookPrefsBridge private constructor(private var context: Context?)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0` `first`
|
||||
|
||||
`v1.1.9` `modified`
|
||||
|
||||
~~`YukiHookModulePrefs`~~ 更名为 `YukiHookPrefsBridge`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 实现 Xposed 模块的数据存取,对接 `SharedPreferences` 和 `XSharedPreferences`。
|
||||
> `YukiHookAPI` 对 `SharedPreferences`、`XSharedPreferences` 的扩展存储桥实现。
|
||||
|
||||
在不同环境智能选择存取使用的对象。
|
||||
|
||||
::: danger
|
||||
|
||||
此功能为实验性功能,仅在 LSPosed 环境测试通过,EdXposed 理论也可以使用但不再推荐。
|
||||
模块与宿主之前共享数据存储为实验性功能,仅在 LSPosed 环境测试通过,EdXposed 理论也可以使用但不再推荐。
|
||||
|
||||
:::
|
||||
|
||||
@@ -42,13 +52,7 @@ class YukiHookModulePrefs private constructor(private var context: Context?)
|
||||
|
||||
太极请参阅 [文件权限/配置/XSharedPreference](https://taichi.cool/zh/doc/for-xposed-dev.html#文件权限-配置-xsharedpreference)。
|
||||
|
||||
::: danger
|
||||
|
||||
当你在 Xposed 模块中存取数据的时候 **context** 必须不能是空的。
|
||||
|
||||
:::
|
||||
|
||||
若你正在使用 `PreferenceFragmentCompat`,请迁移到 `ModulePreferenceFragment` 以适配上述功能特性。
|
||||
对于在模块环境中使用 `PreferenceFragmentCompat`,`YukiHookAPI` 提供了 `ModulePreferenceFragment` 来实现同样的功能。
|
||||
|
||||
**Optional Configuration**
|
||||
|
||||
@@ -72,7 +76,7 @@ class YukiHookModulePrefs private constructor(private var context: Context?)
|
||||
|
||||
`v1.1.5` `deprecated`
|
||||
|
||||
请转移到 `isPreferencesAvailable`
|
||||
请迁移到 `isPreferencesAvailable`
|
||||
|
||||
<h2 class="deprecated">isRunInNewXShareMode - field</h2>
|
||||
|
||||
@@ -82,7 +86,7 @@ class YukiHookModulePrefs private constructor(private var context: Context?)
|
||||
|
||||
`v1.1.5` `deprecated`
|
||||
|
||||
请转移到 `isPreferencesAvailable`
|
||||
请迁移到 `isPreferencesAvailable`
|
||||
|
||||
## isPreferencesAvailable <span class="symbol">- field</span>
|
||||
|
||||
@@ -96,7 +100,7 @@ val isPreferencesAvailable: Boolean
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 获取当前 `YukiHookModulePrefs` 的可用状态。
|
||||
> 获取当前 `YukiHookPrefsBridge` 的可用状态。
|
||||
|
||||
在 (Xposed) 宿主环境中返回 `XSharedPreferences` 可用状态 (可读)。
|
||||
|
||||
@@ -105,7 +109,7 @@ val isPreferencesAvailable: Boolean
|
||||
## name <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun name(name: String): YukiHookModulePrefs
|
||||
fun name(name: String): YukiHookPrefsBridge
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
@@ -123,7 +127,7 @@ fun name(name: String): YukiHookModulePrefs
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
modulePrefs("custom_name").getString("custom_key")
|
||||
prefs("custom_name").getString("custom_key")
|
||||
```
|
||||
|
||||
在 (Xposed) 宿主环境 `PackageParam` 中的使用方法。
|
||||
@@ -134,23 +138,29 @@ modulePrefs("custom_name").getString("custom_key")
|
||||
prefs("custom_name").getString("custom_key")
|
||||
```
|
||||
|
||||
## direct <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun direct(): YukiHookModulePrefs
|
||||
```
|
||||
<h2 class="deprecated">direct - method</h2>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.5` `added`
|
||||
|
||||
`v1.1.11` `deprecated`
|
||||
|
||||
键值的直接缓存功能已被移除,因为其存在内存溢出 (OOM) 问题
|
||||
|
||||
## native <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun native(): YukiHookPrefsBridge
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.9` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 忽略缓存直接读取键值。
|
||||
|
||||
无论是否开启 `YukiHookAPI.Configs.isEnableModulePrefsCache`。
|
||||
|
||||
仅在 `XSharedPreferences` 下生效。
|
||||
> 忽略当前环境直接使用 `Context.getSharedPreferences` 存取数据。
|
||||
|
||||
## getString <span class="symbol">- method</span>
|
||||
|
||||
@@ -236,10 +246,26 @@ fun getFloat(key: String, value: Float): Float
|
||||
|
||||
> 获取 `Float` 键值。
|
||||
|
||||
## contains <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun contains(key: String): Boolean
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.9` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 判断当前是否包含 `key` 键值的数据。
|
||||
|
||||
智能识别对应环境读取键值数据。
|
||||
|
||||
## all <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun all(): HashMap<String, Any?>
|
||||
fun all(): MutableMap<String, Any?>
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
@@ -258,185 +284,85 @@ fun all(): HashMap<String, Any?>
|
||||
|
||||
:::
|
||||
|
||||
## remove <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun remove(key: String)
|
||||
```
|
||||
<h2 class="deprecated">remove - method</h2>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
`v1.1.9` `deprecated`
|
||||
|
||||
> 移除全部包含 `key` 的存储数据。
|
||||
请迁移到 `edit` 方法
|
||||
|
||||
::: warning
|
||||
|
||||
在 (Xposed) 宿主环境下只读,无法使用。
|
||||
|
||||
:::
|
||||
|
||||
## remove <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun <reified T> remove(prefs: PrefsData<T>)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.67` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 移除 `PrefsData.key` 的存储数据。
|
||||
|
||||
::: warning
|
||||
|
||||
在 (Xposed) 宿主环境下只读,无法使用。
|
||||
|
||||
:::
|
||||
|
||||
## clear <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun clear()
|
||||
```
|
||||
<h2 class="deprecated">clear - method</h2>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.77` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
`v1.1.9` `deprecated`
|
||||
|
||||
> 移除全部存储数据。
|
||||
请迁移到 `edit` 方法
|
||||
|
||||
::: warning
|
||||
|
||||
在 (Xposed) 宿主环境下只读,无法使用。
|
||||
|
||||
:::
|
||||
|
||||
## putString <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun putString(key: String, value: String)
|
||||
```
|
||||
<h2 class="deprecated">putString - method</h2>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
`v1.1.9` `deprecated`
|
||||
|
||||
> 存储 `String` 键值。
|
||||
请迁移到 `edit` 方法
|
||||
|
||||
::: warning
|
||||
|
||||
在 (Xposed) 宿主环境下只读,无法使用。
|
||||
|
||||
:::
|
||||
|
||||
## putStringSet <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun putStringSet(key: String, value: Set<String>)
|
||||
```
|
||||
<h2 class="deprecated">putStringSet - method</h2>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.77` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
`v1.1.9` `deprecated`
|
||||
|
||||
> 存储 `Set<String>` 键值。
|
||||
请迁移到 `edit` 方法
|
||||
|
||||
::: warning
|
||||
|
||||
在 (Xposed) 宿主环境下只读,无法使用。
|
||||
|
||||
:::
|
||||
|
||||
## putBoolean <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun putBoolean(key: String, value: Boolean)
|
||||
```
|
||||
<h2 class="deprecated">putBoolean - method</h2>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
`v1.1.9` `deprecated`
|
||||
|
||||
> 存储 `Boolean` 键值。
|
||||
请迁移到 `edit` 方法
|
||||
|
||||
::: warning
|
||||
|
||||
在 (Xposed) 宿主环境下只读,无法使用。
|
||||
|
||||
:::
|
||||
|
||||
## putInt <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun putInt(key: String, value: Int)
|
||||
```
|
||||
<h2 class="deprecated">putInt - method</h2>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
`v1.1.9` `deprecated`
|
||||
|
||||
> 存储 `Int` 键值。
|
||||
请迁移到 `edit` 方法
|
||||
|
||||
::: warning
|
||||
|
||||
在 (Xposed) 宿主环境下只读,无法使用。
|
||||
|
||||
:::
|
||||
|
||||
## putLong <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun putLong(key: String, value: Long)
|
||||
```
|
||||
<h2 class="deprecated">putLong - method</h2>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
`v1.1.9` `deprecated`
|
||||
|
||||
> 存储 `Long` 键值。
|
||||
请迁移到 `edit` 方法
|
||||
|
||||
::: warning
|
||||
|
||||
在 (Xposed) 宿主环境下只读,无法使用。
|
||||
|
||||
:::
|
||||
|
||||
## putFloat <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun putFloat(key: String, value: Float)
|
||||
```
|
||||
<h2 class="deprecated">putFloat - method</h2>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
`v1.1.9` `deprecated`
|
||||
|
||||
> 存储 `Float` 键值。
|
||||
|
||||
::: warning
|
||||
|
||||
在 (Xposed) 宿主环境下只读,无法使用。
|
||||
|
||||
:::
|
||||
请迁移到 `edit` 方法
|
||||
|
||||
## get <span class="symbol">- method</span>
|
||||
|
||||
@@ -452,19 +378,31 @@ inline fun <reified T> get(prefs: PrefsData<T>, value: T): T
|
||||
|
||||
> 智能获取指定类型的键值。
|
||||
|
||||
## put <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun <reified T> put(prefs: PrefsData<T>, value: T)
|
||||
```
|
||||
<h2 class="deprecated">put - method</h2>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.67` `added`
|
||||
|
||||
`v1.1.9` `deprecated`
|
||||
|
||||
请迁移到 `edit` 方法
|
||||
|
||||
## edit <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun edit(): Editor
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.9` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 智能存储指定类型的键值。
|
||||
> 创建新的 `Editor`。
|
||||
|
||||
在模块环境中或启用了 `isUsingNativeStorage` 后使用。
|
||||
|
||||
::: warning
|
||||
|
||||
@@ -472,24 +410,228 @@ inline fun <reified T> put(prefs: PrefsData<T>, value: T)
|
||||
|
||||
:::
|
||||
|
||||
## clearCache <span class="symbol">- method</span>
|
||||
## edit <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun clearCache()
|
||||
fun edit(initiate: Editor.() -> Unit)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.9` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 创建新的 `Editor`。
|
||||
|
||||
自动调用 `Editor.apply` 方法。
|
||||
|
||||
在模块环境中或启用了 `isUsingNativeStorage` 后使用。
|
||||
|
||||
::: warning
|
||||
|
||||
在 (Xposed) 宿主环境下只读,无法使用。
|
||||
|
||||
:::
|
||||
|
||||
<h2 class="deprecated">clearCache - method</h2>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.5` `added`
|
||||
|
||||
`v1.1.11` `deprecated`
|
||||
|
||||
键值的直接缓存功能已被移除,因为其存在内存溢出 (OOM) 问题
|
||||
|
||||
## Editor <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inner class Editor internal constructor()
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.9` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 清除 `XSharedPreferences` 中缓存的键值数据。
|
||||
> `YukiHookPrefsBridge` 的存储代理类。
|
||||
|
||||
无论是否开启 `YukiHookAPI.Configs.isEnableModulePrefsCache`。
|
||||
请使用 `edit` 方法来获取 `Editor`。
|
||||
|
||||
调用此方法将清除当前存储的全部键值缓存。
|
||||
在模块环境中或启用了 `isUsingNativeStorage` 后使用。
|
||||
|
||||
下次将从 `XSharedPreferences` 重新读取。
|
||||
::: warning
|
||||
|
||||
在 (Xposed) 宿主环境中使用。
|
||||
在 (Xposed) 宿主环境下只读,无法使用。
|
||||
|
||||
:::
|
||||
|
||||
### remove <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun remove(key: String): Editor
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.9` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 移除全部包含 `key` 的存储数据。
|
||||
|
||||
### remove <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun <reified T> remove(prefs: PrefsData<T>): Editor
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.9` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 移除 `PrefsData.key` 的存储数据。
|
||||
|
||||
### clear <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun clear(): Editor
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.9` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 移除全部存储数据。
|
||||
|
||||
### putString <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun putString(key: String, value: String): Editor
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.9` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 存储 `String` 键值。
|
||||
|
||||
### putStringSet <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun putStringSet(key: String, value: Set<String>): Editor
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.9` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 存储 `Set<String>` 键值。
|
||||
|
||||
### putBoolean <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun putBoolean(key: String, value: Boolean): Editor
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.9` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 存储 `Boolean` 键值。
|
||||
|
||||
### putInt <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun putInt(key: String, value: Int): Editor
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.9` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 存储 `Int` 键值。
|
||||
|
||||
### putLong <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun putLong(key: String, value: Long): Editor
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.9` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 存储 `Long` 键值。
|
||||
|
||||
### putFloat <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun putFloat(key: String, value: Float): Editor
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.9` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 存储 `Float` 键值。
|
||||
|
||||
### put <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun <reified T> put(prefs: PrefsData<T>, value: T): Editor
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.9` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 智能存储指定类型的键值。
|
||||
|
||||
### commit <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun commit(): Boolean
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.9` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 提交更改 (同步)。
|
||||
|
||||
### apply <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun apply()
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.1.9` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 提交更改 (异步)。
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
@@ -28,7 +34,7 @@ data class PrefsData<T>(var key: String, var value: T) : Serializable
|
||||
|
||||
> 键值对存储构造类。
|
||||
|
||||
这个类是对 `YukiHookModulePrefs` 的一个扩展用法。
|
||||
这个类是对 `YukiHookPrefsBridge` 的一个扩展用法。
|
||||
|
||||
**Function Example**
|
||||
|
||||
@@ -51,9 +57,9 @@ object DataConst {
|
||||
|
||||
```kotlin
|
||||
// 读取
|
||||
val data = modulePrefs.get(DataConst.TEST_KV_DATA_1)
|
||||
val data = prefs().get(DataConst.TEST_KV_DATA_1)
|
||||
// 写入
|
||||
modulePrefs.put(DataConst.TEST_KV_DATA_1, "written value")
|
||||
prefs().edit { put(DataConst.TEST_KV_DATA_1, "written value") }
|
||||
```
|
||||
|
||||
> 宿主示例如下
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
|
@@ -4,6 +4,12 @@ pageClass: code-page
|
||||
|
||||
::: warning
|
||||
|
||||
Due to maintenance costs, the `YukiHookAPI` will no longer update this document from version `1.3.0` and switch to the API document automatically generated by the Dokka plugin in version `2.0.0`.
|
||||
|
||||
:::
|
||||
|
||||
::: warning
|
||||
|
||||
The English translation of this page has not been completed, you are welcome to contribute translations to us.
|
||||
|
||||
You can use the **Chrome Translation Plugin** to translate entire pages for reference.
|
||||
@@ -24,7 +30,7 @@ interface IYukiHookXposedInit
|
||||
|
||||
作废了 ~~`YukiHookXposedInitProxy`~~ 名称但保留接口
|
||||
|
||||
转移到 `IYukiHookXposedInit` 新名称
|
||||
迁移到 `IYukiHookXposedInit` 新名称
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -106,4 +112,4 @@ fun onXposedEvent()
|
||||
|
||||
`v1.0.80` `deprecated`
|
||||
|
||||
请转移到 `IYukiHookXposedInit`
|
||||
请迁移到 `IYukiHookXposedInit`
|
@@ -4,24 +4,26 @@
|
||||
|
||||
Before using the following functions, in order to prevent Resource Id from conflicting with each other, you need to modify the Resource Id in the `build.gradle` of the current Xposed Module project.
|
||||
|
||||
- Kotlin Gradle DSL
|
||||
> Kotlin DSL
|
||||
|
||||
```kotlin
|
||||
android {
|
||||
androidResources.additionalParameters("--allow-reserved-package-id", "--package-id", "0x64")
|
||||
androidResources.additionalParameters += listOf("--allow-reserved-package-id", "--package-id", "0x64")
|
||||
}
|
||||
```
|
||||
|
||||
- Groovy
|
||||
> Groovy DSL
|
||||
|
||||
```groovy
|
||||
android {
|
||||
aaptOptions.additionalParameters '--allow-reserved-package-id', '--package-id', '0x64'
|
||||
androidResources.additionalParameters += ['--allow-reserved-package-id', '--package-id', '0x64']
|
||||
}
|
||||
```
|
||||
|
||||
::: warning
|
||||
|
||||
**aaptOptions.additionalParameters** in previous versions has been deprecated, please refer to the above writing method and keep your **Android Gradle Plugin** to the latest version.
|
||||
|
||||
The sample Resource Id value provided is for reference only, **0x7f** cannot be used, the default is **0x64**.
|
||||
|
||||
In order to prevent the existence of multiple Xposed Modules in the current Host App, it is recommended to customize your own Resource Id.
|
||||
@@ -35,12 +37,11 @@ After the Host App is hooked, we can directly inject the `Context` obtained in t
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
injectMember {
|
||||
method {
|
||||
name = "onCreate"
|
||||
param(BundleClass)
|
||||
}
|
||||
afterHook {
|
||||
resolve().firstMethod {
|
||||
name = "onCreate"
|
||||
parameters(Bundle::class)
|
||||
}.hook {
|
||||
after {
|
||||
instance<Activity>().also {
|
||||
// <Scenario 1> Inject Module App's Resources through Context
|
||||
it.injectModuleAppResources()
|
||||
@@ -89,12 +90,11 @@ After the Host App is hooked, we can directly register the `Activity` proxy of t
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
injectMember {
|
||||
method {
|
||||
name = "onCreate"
|
||||
param(BundleClass)
|
||||
}
|
||||
afterHook {
|
||||
resolve().firstMethod {
|
||||
name = "onCreate"
|
||||
parameters(Bundle::class)
|
||||
}.hook {
|
||||
after {
|
||||
instance<Activity>().registerModuleAppActivities()
|
||||
}
|
||||
}
|
||||
@@ -146,34 +146,45 @@ Alternatively, if you write a `stub` for the Host App's class, you can register
|
||||
registerModuleAppActivities(TestActivity::class.java)
|
||||
```
|
||||
|
||||
After the registration is complete, extends the `Activity` in the Module App you need to use the Host App to start by `ModuleAppActivity` or `ModuleAppCompatActivity`.
|
||||
After registration is completed, please implement the `ModuleActivity` interface using the `Activity` module in the host-started module.
|
||||
|
||||
These `Activity` now live seamlessly in the Host App without registration.
|
||||
These `Activity` (ies) now live seamlessly in the host without registration.
|
||||
|
||||
We recommend that you create `BaseActivity` as the base class for all modules `Activity`.
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
class HostTestActivity : ModuleAppActivity() {
|
||||
abstract class BaseActivity : AppCompatActivity(), ModuleActivity {
|
||||
|
||||
// Set up AppCompat Theme (if currently is [AppCompatActivity])
|
||||
override val moduleTheme get() = R.style.YourAppTheme
|
||||
|
||||
override fun getClassLoader() = delegate.getClassLoader()
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
delegate.onCreate(savedInstanceState)
|
||||
super.onCreate(savedInstanceState)
|
||||
// Module App's Resources have been injected automatically
|
||||
// You can directly use xml to load the layout
|
||||
setContentView(R.layout.activity_main)
|
||||
}
|
||||
|
||||
override fun onConfigurationChanged(newConfig: Configuration) {
|
||||
delegate.onConfigurationChanged(newConfig)
|
||||
super.onConfigurationChanged(newConfig)
|
||||
}
|
||||
|
||||
override fun onRestoreInstanceState(savedInstanceState: Bundle) {
|
||||
delegate.onRestoreInstanceState(savedInstanceState)
|
||||
super.onRestoreInstanceState(savedInstanceState)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
If you need to extends `ModuleAppCompatActivity`, you need to set the AppCompat theme manually.
|
||||
Then inherit the `Activity` you want to implement in `BaseActivity`.
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
class HostTestActivity : ModuleAppCompatActivity() {
|
||||
|
||||
// The theme name here is for reference only
|
||||
// Please fill in the theme name already in your Module App
|
||||
override val moduleTheme get() = R.style.Theme_AppCompat
|
||||
class HostTestActivity : BaseActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
@@ -193,6 +204,28 @@ val context: Context = ... // Assume this is your Context
|
||||
context.startActivity(context, HostTestActivity::class.java)
|
||||
```
|
||||
|
||||
The `proxy` parameter we set in the `registerModuleAppActivities` method above is the default global proxy `Activity`.
|
||||
|
||||
If you need to specify a delegated `Activity` to use another Host App's `Activity` as a proxy, you can refer to the following method.
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
class HostTestActivity : BaseActivity() {
|
||||
|
||||
// Specify an additional proxy Activity class name
|
||||
// Which must also exist in the Host App's AndroidManifest
|
||||
override val proxyClassName get() = "com.demo.test.activity.OtherActivity"
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
// Module App's Resources have been injected automatically
|
||||
// You can directly use xml to load the layout
|
||||
setContentView(R.layout.activity_main)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
::: tip
|
||||
|
||||
For more functions, please refer to the [Context.registerModuleAppActivities](../public/com/highcapable/yukihookapi/hook/factory/YukiHookFactory#context-registermoduleappactivities-ext-method) method.
|
||||
@@ -214,12 +247,11 @@ At this time, we want to use `MaterialAlertDialogBuilder` to create a dialog in
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
injectMember {
|
||||
method {
|
||||
name = "onCreate"
|
||||
param(BundleClass)
|
||||
}
|
||||
afterHook {
|
||||
resolve().firstMethod {
|
||||
name = "onCreate"
|
||||
parameters(Bundle::class)
|
||||
}.hook {
|
||||
after {
|
||||
// Use applyModuleTheme to create a theme resource in the current Module App
|
||||
val appCompatContext = instance<Activity>().applyModuleTheme(R.style.Theme_AppCompat)
|
||||
// Directly use this Context that wraps the Module App's theme to create a dialog
|
||||
@@ -239,12 +271,11 @@ Which requires at least Android 10 and above system version support and the curr
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
injectMember {
|
||||
method {
|
||||
name = "onCreate"
|
||||
param(BundleClass)
|
||||
}
|
||||
afterHook {
|
||||
resolve().firstMethod {
|
||||
name = "onCreate"
|
||||
parameters(Bundle::class)
|
||||
}.hook {
|
||||
after {
|
||||
// Define the theme resource in the current Module App
|
||||
var appCompatContext: ModuleContextThemeWrapper
|
||||
// <Scenario 1> Get the Configuration object directly to set
|
||||
@@ -274,7 +305,7 @@ This way, we can create dialogs in the Host App very simply using `MaterialAlert
|
||||
|
||||
Because some **androidx** dependent libraries or custom themes used by some apps may interfere with the actual style of the current **MaterialAlertDialog**, such as the button style of the dialog.
|
||||
|
||||
You can refer to the **Module App Demo** in this case and see [here is the sample code](https://github.com/fankes/YukiHookAPI/tree/master/demo-module/src/main/java/com/highcapable/yukihookapi/demo_module/hook/factory/ComponentCompatFactory.kt) to fix this problem.
|
||||
You can refer to the **Module App Demo** in this case and see [here is the sample code](https://github.com/HighCapable/YukiHookAPI/tree/master/samples/demo-module/src/main/java/com/highcapable/yukihookapi/demo_module/hook/factory/ComponentCompatFactory.kt) to fix this problem.
|
||||
|
||||
**ClassCastException** may occur when some apps are created, please manually specify a new **Configuration** instance to fix.
|
||||
|
||||
@@ -303,7 +334,7 @@ The exclusion list determines whether these `Class` need to be loaded by the Mod
|
||||
```kotlin
|
||||
// Exclude Class names belonging to the Host App
|
||||
// They will be loaded by the Host App's ClassLoader
|
||||
// ❗The following content is for demonstration only
|
||||
// The following content is for demonstration only
|
||||
// DO NOT USE IT DIRECTLY, please refer to your actual situation
|
||||
ModuleClassLoader.excludeHostClasses(
|
||||
"androidx.core.app.ActivityCompat",
|
||||
@@ -311,7 +342,7 @@ ModuleClassLoader.excludeHostClasses(
|
||||
)
|
||||
// Exclude Class names belonging to the Module App
|
||||
// They will be loaded by the ClassLoader of the Module App (the current Hook process)
|
||||
// ❗The following content is for demonstration only
|
||||
// The following content is for demonstration only
|
||||
// DO NOT USE IT DIRECTLY, please refer to your actual situation
|
||||
ModuleClassLoader.excludeModuleClasses(
|
||||
"com.demo.entry.HookEntry",
|
||||
|
@@ -2,28 +2,37 @@
|
||||
|
||||
> Log is the most important part of the debugging process, `YukiHookAPI` encapsulates a set of stable and efficient debugging log functions for developers.
|
||||
|
||||
::: tip
|
||||
|
||||
The logs of `KavaRef` can be managed separately by itself. For detailed configuration plans,
|
||||
you can refer to [here](https://highcapable.github.io/KavaRef/en/library/kavaref-core#log-management), which will jump to the `KavaRef` document.
|
||||
|
||||
`YukiHookAPI` has taken over the logging function of `KavaRef` by default, and you can also configure the logging function of `KavaRef` yourself.
|
||||
|
||||
:::
|
||||
|
||||
## Normal Logs
|
||||
|
||||
You can call `loggerD`, `loggerI`, `loggerW` to print normal logs to the console.
|
||||
You can call `YLog.debug`, `YLog.info`, `YLog.warn` to print normal logs to the console.
|
||||
|
||||
The usage method is as follows.
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
loggerD(msg = "This is a log")
|
||||
YLog.debug(msg = "This is a log")
|
||||
```
|
||||
|
||||
At this ponit, `YukiHookAPI` will call `android.util.Log` and log function in (Xposed) Host environment to print this log at the same time.
|
||||
|
||||
The default `TAG` of the log is the value you set in `YukiHookLogger.Configs.tag`.
|
||||
The default `TAG` of the log is the value you set in `YLog.Configs.tag`.
|
||||
|
||||
You can also customize this value dynamically, but it is not recommended to modify `TAG` easily to prevent logs from being filtered.
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
loggerD(tag = "YukiHookAPI", msg = "This is a log")
|
||||
YLog.debug(tag = "YukiHookAPI", msg = "This is a log")
|
||||
```
|
||||
|
||||
The printed result is as shown below.
|
||||
@@ -31,21 +40,21 @@ The printed result is as shown below.
|
||||
> The following example
|
||||
|
||||
```:no-line-numbers
|
||||
[YukiHookAPI][D][host package name]--> This is a log
|
||||
[YukiHookAPI][D][host package name] This is a log
|
||||
```
|
||||
|
||||
You can also use `LoggerType` to customize the type of log printing.
|
||||
You can also use `YLog.EnvType` to customize the type of log printing.
|
||||
|
||||
You can choose to use `android.util.Log` or the log function in the (Xposed) Host environment to print logs.
|
||||
|
||||
The default type is `LoggerType.BOTH`, which means that both methods are used to print logs.
|
||||
The default type is `YLog.EnvType.BOTH`, which means that both methods are used to print logs.
|
||||
|
||||
For example we only use `android.util.Log` to print logs.
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
loggerD(tag = "YukiHookAPI", msg = "This is a log", type = LoggerType.LOGD)
|
||||
YLog.debug(tag = "YukiHookAPI", msg = "This is a log", env = YLog.EnvType.LOGD)
|
||||
```
|
||||
|
||||
Or just use the log function that in the (Xposed) Host environment to print the log, this method can only be used in the (Xposed) Host environment.
|
||||
@@ -53,7 +62,7 @@ Or just use the log function that in the (Xposed) Host environment to print the
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
loggerD(tag = "YukiHookAPI", msg = "This is a log", type = LoggerType.XPOSED_ENVIRONMENT)
|
||||
YLog.debug(tag = "YukiHookAPI", msg = "This is a log", env = YLog.EnvType.XPOSED_ENVIRONMENT)
|
||||
```
|
||||
|
||||
If you want to intelligently distinguish the (Xposed) Host environment from the Module environment, you can write it in the following form.
|
||||
@@ -61,27 +70,27 @@ If you want to intelligently distinguish the (Xposed) Host environment from the
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
loggerD(tag = "YukiHookAPI", msg = "This is a log", type = LoggerType.SCOPE)
|
||||
YLog.debug(tag = "YukiHookAPI", msg = "This is a log", env = YLog.EnvType.SCOPE)
|
||||
```
|
||||
|
||||
In this way, the API will intelligently select the specified method type to print this log in different environments.
|
||||
|
||||
::: tip
|
||||
|
||||
For more functions, please refer to [loggerD](../public/com/highcapable/yukihookapi/hook/log/LoggerFactory#loggerd-method), [loggerI](../public/com/highcapable/yukihookapi/hook/log/LoggerFactory#loggeri-method) and [loggerW](../public/com/highcapable/yukihookapi/hook/log/LoggerFactory#loggerw-method) methods.
|
||||
For more functions, please refer to [YLog.debug](../public/com/highcapable/yukihookapi/hook/log/YLog#debug-method), [YLog.info](../public/com/highcapable/yukihookapi/hook/log/YLog#info-method) and [YLog.warn](../public/com/highcapable/yukihookapi/hook/log/YLog#warn-method) methods.
|
||||
|
||||
:::
|
||||
|
||||
## Error Logs
|
||||
|
||||
You can call `loggerE` to print `E` level logs to the console.
|
||||
You can call `YLog.error` to print `E` level logs to the console.
|
||||
|
||||
The usage method is as follows.
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
loggerE(msg = "This is an error")
|
||||
YLog.error(msg = "This is an error")
|
||||
```
|
||||
|
||||
The error log is the highest level, regardless of whether you have filtered only `E` level logs.
|
||||
@@ -92,7 +101,7 @@ For error-level logging, you can also append an exception stack.
|
||||
// Assume this is the exception that was thrown
|
||||
val throwable = Throwable(...)
|
||||
// Print log
|
||||
loggerE(msg = "This is an error", e = throwable)
|
||||
YLog.error(msg = "This is an error", e = throwable)
|
||||
```
|
||||
|
||||
The printed result is as shown below.
|
||||
@@ -100,7 +109,7 @@ The printed result is as shown below.
|
||||
> The following example
|
||||
|
||||
```:no-line-numbers
|
||||
[YukiHookAPI][E][host package name]--> This is an error
|
||||
[YukiHookAPI][E][host package name] This is an error
|
||||
```
|
||||
|
||||
At the same time, the log will help you print the entire exception stack.
|
||||
@@ -109,25 +118,25 @@ At the same time, the log will help you print the entire exception stack.
|
||||
|
||||
```:no-line-numbers
|
||||
java.lang.Throwable
|
||||
at com.demo.Test.<init>(...)
|
||||
at com.demo.Test.doTask(...)
|
||||
at com.demo.Test.stop(...)
|
||||
at com.demo.Test.init(...)
|
||||
at a.a.a(...)
|
||||
... 3 more
|
||||
at com.demo.Test.<init>(...)
|
||||
at com.demo.Test.doTask(...)
|
||||
at com.demo.Test.stop(...)
|
||||
at com.demo.Test.init(...)
|
||||
at a.a.a(...)
|
||||
... 3 more
|
||||
```
|
||||
|
||||
In the error log, you can also use `LoggerType` to specify the method type currently used to print the log.
|
||||
In the error log, you can also use `YLog.EnvType` to specify the method type currently used to print the log.
|
||||
|
||||
::: tip
|
||||
|
||||
For more functions, please refer to the [loggerE](../public/com/highcapable/yukihookapi/hook/log/LoggerFactory#loggere-method) method.
|
||||
For more functions, please refer to the [YLog.error](../public/com/highcapable/yukihookapi/hook/log/YLog#error-method) method.
|
||||
|
||||
:::
|
||||
|
||||
## Save Logs and Custom Elements
|
||||
|
||||
You can save all currently printed logs directly to a file using the `YukiHookLogger.saveToFile` method.
|
||||
You can save all currently printed logs directly to a file using the `YLog.saveToFile` method.
|
||||
|
||||
> The following example
|
||||
|
||||
@@ -135,25 +144,25 @@ You can save all currently printed logs directly to a file using the `YukiHookLo
|
||||
// Please note
|
||||
// The saved file path must have read and write permissions
|
||||
// Otherwise an exception will be thrown
|
||||
YukiHookLogger.saveToFile("/sdcard/Documents/debug_log.log")
|
||||
YLog.saveToFile("/sdcard/Documents/debug_log.log")
|
||||
```
|
||||
|
||||
You can also use `YukiHookLogger.contents` to get all the log file contents that have been printed so far.
|
||||
You can also use `YLog.contents` to get all the log file contents that have been printed so far.
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
// Get the contents of all log files that have been printed so far
|
||||
val fileContent = YukiHookLogger.contents
|
||||
val fileContent = YLog.contents
|
||||
```
|
||||
|
||||
If you need an array of real-time log data structures, you can directly get the content of `YukiHookLogger.inMemoryData`.
|
||||
If you need an array of real-time log data structures, you can directly get the content of `YLog.inMemoryData`.
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
// Get the currently printed real-time log data structure array
|
||||
YukiHookLogger.inMemoryData.forEach {
|
||||
YLog.inMemoryData.forEach {
|
||||
it.timestamp // Get timestamp
|
||||
it.time // Get UTC time
|
||||
it.priority // Get priority
|
||||
@@ -169,19 +178,19 @@ If you want to format or save the obtained custom log data to a file, you only n
|
||||
|
||||
```kotlin
|
||||
// Assume this is the custom log data you get
|
||||
val data: ArrayList<YukiLoggerData>
|
||||
val data: List<YLogData>
|
||||
// Format log data to String
|
||||
val dataString = YukiHookLogger.contents(data)
|
||||
val dataString = YLog.contents(data)
|
||||
// Save log data to file
|
||||
// Please note
|
||||
// The saved file path must have read and write permissions
|
||||
// Otherwise an exception will be thrown
|
||||
YukiHookLogger.saveToFile("/sdcard/Documents/debug_log.log", data)
|
||||
YLog.saveToFile("/sdcard/Documents/debug_log.log", data)
|
||||
```
|
||||
|
||||
::: danger
|
||||
|
||||
You need to enable **YukiHookLogger.Configs.isRecord** to get the contents of **YukiHookLogger.inMemoryData**.
|
||||
You need to enable **YLog.Configs.isRecord** to get the contents of **YLog.inMemoryData**.
|
||||
|
||||
The obtained log data is isolated from each other in the Host App and the Module App's process.
|
||||
|
||||
@@ -193,7 +202,7 @@ If you only want to get log data in real time through Module App or Host App, Pl
|
||||
|
||||
:::
|
||||
|
||||
You can also use `YukiHookLogger.Configs.elements` to customize the elements that debug logs display externally.
|
||||
You can also use `YLog.Configs.elements` to customize the elements that debug logs display externally.
|
||||
|
||||
This function requires `YukiHookAPI.Configs` to be configured in `onInit` of the Hook entry class.
|
||||
|
||||
@@ -211,6 +220,6 @@ override fun onInit() = configs {
|
||||
|
||||
::: tip
|
||||
|
||||
For more functions, please refer to [YukiHookLogger.inMemoryData](../public/com/highcapable/yukihookapi/hook/log/LoggerFactory#inmemorydata-field), [YukiHookLogger.contents](../public/com/highcapable/yukihookapi/hook/log/LoggerFactory#contents-field), [YukiHookLogger.contents](../public/com/highcapable/yukihookapi/hook/log/LoggerFactory#contents-method), [YukiHookLogger.saveToFile](../public/com/highcapable/yukihookapi/hook/log/LoggerFactory#savetofile-method) methods and [YukiHookLogger.Configs](../public/com/highcapable/yukihookapi/hook/log/LoggerFactory#configs-object).
|
||||
For more functions, please refer to [YLog.inMemoryData](../public/com/highcapable/yukihookapi/hook/log/YLog#inmemorydata-field), [YLog.contents](../public/com/highcapable/yukihookapi/hook/log/YLog#contents-field), [YLog.contents](../public/com/highcapable/yukihookapi/hook/log/YLog#contents-method), [YLog.saveToFile](../public/com/highcapable/yukihookapi/hook/log/YLog#savetofile-method) methods and [YLog.Configs](../public/com/highcapable/yukihookapi/hook/log/YLog#configs-object).
|
||||
|
||||
:::
|
@@ -1,12 +1,26 @@
|
||||
# Reflection Extensions
|
||||
# Reflection Extensions (Migrated)
|
||||
|
||||
> `YukiHookAPI` encapsulates a set of reflection API with near-zero reflection writing for developers, which can almost completely replace the usage of reflection API in Java.
|
||||
|
||||
The core part of this functionality has been decoupled into the [YukiReflection](https://github.com/fankes/YukiReflection) project, which can be used independently in any Android project.
|
||||
~~The core part of this functionality has been decoupled into the [YukiReflection](https://github.com/HighCapable/YukiReflection) project, which can be used independently in any Java or Android project.~~
|
||||
|
||||
Now `YukiReflection` is integrated into `YukiHookAPI` as a core dependency.
|
||||
~~Now `YukiReflection` is integrated into `YukiHookAPI` as a core dependency.~~
|
||||
|
||||
`YukiHookAPI` adds related extensions for Hook functions on the basis of `YukiReflection`, and there is no need to introduce this dependency to use `YukiHookAPI`.
|
||||
~~`YukiHookAPI` adds related extensions for Hook functions on the basis of `YukiReflection`, and there is no need to introduce this dependency to use `YukiHookAPI`.~~
|
||||
|
||||
::: warning
|
||||
|
||||
Starting with version `1.3.0`, `YukiHookAPI` has moved its own reflection API partially to
|
||||
[KavaRef](https://github.com/HighCapable/KavaRef), we no longer recommend the reflection API of `YukiHookAPI` itself, which have been marked as deprecated.
|
||||
|
||||
The `YukiReflection` project has been deprecated due to many unsolved black box issues, and we no longer recommend anyone to use it.
|
||||
|
||||
If you are still using the reflection API section of `YukiHookAPI`,
|
||||
please refer to the migration document [here](https://highcapable.github.io/KavaRef/zh-cn/config/migration) which will jump to the `KavaRef` document.
|
||||
|
||||
:::
|
||||
|
||||
<div style="opacity: 0.35">
|
||||
|
||||
## Class Extensions
|
||||
|
||||
@@ -78,6 +92,54 @@ For more functions, please refer to [classOf](../public/com/highcapable/yukihook
|
||||
|
||||
:::
|
||||
|
||||
### Lazy Loading
|
||||
|
||||
Suppose we want to get a `Class` that cannot be called directly, but we do not need this `Class` immediately.
|
||||
|
||||
At this time, you can use `lazyClass` to complete this function.
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
// Lazy loading of this Class
|
||||
// If you are currently in a PackageParam environment, then you do not need to consider ClassLoader
|
||||
val instance by lazyClass("com.demo.Test")
|
||||
// Customize the ClassLoader where the Class is located
|
||||
val customClassLoader: ClassLoader? = ... // Assume this is your ClassLoader
|
||||
val instance by lazyClass("com.demo.Test") { customClassLoader }
|
||||
// Call this Class at the appropriate time
|
||||
instance.method {
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
If the current `Class` does not exist, using the above method will throw an exception.
|
||||
|
||||
If you are not sure whether `Class` exists, you can refer to the following solution.
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
// Lazy loading of this Class
|
||||
// If you are currently in a PackageParam environment, then you do not need to consider ClassLoader
|
||||
// If not available, the result will be null but no exception will be thrown
|
||||
val instance by lazyClassOrNull("com.demo.Test")
|
||||
// Customize the ClassLoader where the Class is located
|
||||
val customClassLoader: ClassLoader? = ... // Assume this is your ClassLoader
|
||||
// If not available, the result will be null but no exception will be thrown
|
||||
val instance by lazyClassOrNull("com.demo.Test") { customClassLoader }
|
||||
// Call this Class at the appropriate time
|
||||
instance?.method {
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
::: tip
|
||||
|
||||
For more functions, please refer to [lazyClass](../public/com/highcapable/yukihookapi/hook/factory/ReflectionFactory#lazyclass-method), [lazyClassOrNull](../public/com/highcapable/yukihookapi/hook/factory/ReflectionFactory#lazyclassornull-method), [PackageParam → lazyClass](../public/com/highcapable/yukihookapi/hook/param/PackageParam#lazyclass-method), [PackageParam → lazyClassOrNull](../public/com/highcapable/yukihookapi/hook/param/PackageParam#lazyclassornull-method) methods.
|
||||
|
||||
:::
|
||||
|
||||
### Existential Judgment
|
||||
|
||||
Suppose we want to determine whether a `Class` exists.
|
||||
@@ -151,6 +213,14 @@ Please note that the more the same type **Class** is matched, the slower the spe
|
||||
|
||||
:::
|
||||
|
||||
::: danger
|
||||
|
||||
~~After **YukiHookAPI** **2.0.0** released, this function will be deprecated and will no longer be migrated to [YukiReflection](https://github.com/HighCapable/YukiReflection).~~
|
||||
|
||||
We welcome all developers to start using [DexKit](https://github.com/LuckyPray/DexKit), which is a high-performance runtime parsing library for **Dex** implemented in C++, which is more efficient than the Java layer in terms of performance, efficient and excellent, it is still in the development stage, your valuable suggestions are welcome.
|
||||
|
||||
:::
|
||||
|
||||
#### Get Started
|
||||
|
||||
Below is a simple usage example.
|
||||
@@ -1162,7 +1232,7 @@ instance.current {
|
||||
name = "stop"
|
||||
emptyParam()
|
||||
}.call()
|
||||
// ❗ Note that because current() returns the CurrentClass object itself
|
||||
// Note that because current() returns the CurrentClass object itself
|
||||
// It CANNOT BE CALLED like the following
|
||||
instance.current().current()
|
||||
```
|
||||
@@ -1290,15 +1360,12 @@ Here's how the `getString` method in this `Class` Hooks.
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
Test::class.java.hook {
|
||||
injectMember {
|
||||
method {
|
||||
name = "getString"
|
||||
emptyParam()
|
||||
returnType = StringClass
|
||||
}
|
||||
replaceTo("Hooked")
|
||||
}
|
||||
Test::class.java.method {
|
||||
name = "getString"
|
||||
emptyParam()
|
||||
returnType = StringClass
|
||||
}.hook {
|
||||
replaceTo("Hooked")
|
||||
}
|
||||
```
|
||||
|
||||
@@ -1439,34 +1506,8 @@ Test::class.java.method {
|
||||
}
|
||||
```
|
||||
|
||||
Take the current `Class` as an example, if [Multiple Find](#multiple-find) is used in conjunction with `RemedyPlan` when creating a Hook, you need to change the usage slightly.
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
injectMember {
|
||||
method {
|
||||
name = "doTask"
|
||||
emptyParam()
|
||||
}.remedys {
|
||||
method {
|
||||
name = "doTask"
|
||||
paramCount(0..1)
|
||||
}
|
||||
method {
|
||||
name = "doTask"
|
||||
paramCount(1..2)
|
||||
}
|
||||
}.all()
|
||||
beforeHook {}
|
||||
afterHook {}
|
||||
}
|
||||
```
|
||||
|
||||
::: tip
|
||||
|
||||
When creating a Hook, please refer to [MethodFinder.Process.all](../public/com/highcapable/yukihookapi/hook/core/finder/members/MethodFinder#all-method), [ConstructorFinder.Process.all]( ../public/com/highcapable/yukihookapi/hook/core/finder/members/ConstructorFinder#all-method) methods.
|
||||
|
||||
For more functions, please refer to [MethodFinder.RemedyPlan](../public/com/highcapable/yukihookapi/hook/core/finder/members/MethodFinder#remedyplan-class), [ConstructorFinder.RemedyPlan](../public/com/highcapable/yukihookapi/hook/core/finder/members/ConstructorFinder#remedyplan-class), [FieldFinder.RemedyPlan](../public/com/highcapable/yukihookapi/hook/core/finder/members/FieldFinder#remedyplan-class) .
|
||||
|
||||
:::
|
||||
@@ -1570,15 +1611,7 @@ For more functions, please refer to [VariousClass](../public/com/highcapable/yuk
|
||||
|
||||
If it is used when creating a Hook, it can be more convenient, and it can also automatically intercept the exception that `Class` cannot be found.
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
findClass("com.demo.ATest", "com.demo.BTest").hook {
|
||||
// Your code here.
|
||||
}
|
||||
```
|
||||
|
||||
You can also define this `Class` as a constant type to use.
|
||||
You can define this `Class` as a constant type to use.
|
||||
|
||||
> The following example
|
||||
|
||||
@@ -1591,12 +1624,6 @@ ABTestClass.hook {
|
||||
}
|
||||
```
|
||||
|
||||
::: tip
|
||||
|
||||
For more functions, please refer to the [PackageParam.findClass](../public/com/highcapable/yukihookapi/hook/param/PackageParam#findclass-method) method.
|
||||
|
||||
:::
|
||||
|
||||
### Calling Generics
|
||||
|
||||
In the process of reflection, we may encounter generic problems.
|
||||
@@ -1677,11 +1704,7 @@ For more functions, please refer to [CurrentClass.generic](../public/com/highcap
|
||||
|
||||
#### Restrictive Find Conditions
|
||||
|
||||
::: danger
|
||||
|
||||
In find conditions you can only use **index** function once except **order**.
|
||||
|
||||
:::
|
||||
In find conditions you can <u>**only**</u> use `index` function once except `order`.
|
||||
|
||||
> The following example
|
||||
|
||||
@@ -1689,7 +1712,7 @@ In find conditions you can only use **index** function once except **order**.
|
||||
method {
|
||||
name = "test"
|
||||
param(BooleanType).index(num = 2)
|
||||
// ❗ Wrong usage, please keep only one index method
|
||||
// Wrong usage, please keep only one index method
|
||||
returnType(StringClass).index(num = 1)
|
||||
}
|
||||
```
|
||||
@@ -1708,12 +1731,8 @@ method {
|
||||
|
||||
#### Necessary Find Conditions
|
||||
|
||||
::: danger
|
||||
|
||||
In common method find conditions, <u>**even methods without parameters need to set find conditions**</u>.
|
||||
|
||||
:::
|
||||
|
||||
Suppose we have the following `Class`.
|
||||
|
||||
> The following example
|
||||
@@ -1769,9 +1788,7 @@ In the past historical versions of the API, it was allowed to match the method w
|
||||
|
||||
:::
|
||||
|
||||
#### Abbreviated Find Conditions
|
||||
|
||||
> In the construction method find conditions, <u>**constructors without parameters do not need to fill in the find conditions**</u>.
|
||||
In the find conditions for constructors, <u>**even constructors without parameters need to set find conditions**</u>.
|
||||
|
||||
Suppose we have the following `Class`.
|
||||
|
||||
@@ -1786,7 +1803,7 @@ public class TestFoo {
|
||||
}
|
||||
```
|
||||
|
||||
We want to get the `public TestFoo()` constructor, which can be written as follows.
|
||||
To get the `public TestFoo()` constructor, we must write it in the following form.
|
||||
|
||||
> The following example
|
||||
|
||||
@@ -1794,31 +1811,57 @@ We want to get the `public TestFoo()` constructor, which can be written as follo
|
||||
TestFoo::class.java.constructor { emptyParam() }
|
||||
```
|
||||
|
||||
The above example can successfully obtain the `public TestFoo()` constructor, but it feels a bit cumbersome.
|
||||
The above example can successfully obtain the `public TestFoo()` constructor.
|
||||
|
||||
Unlike normal methods, since the constructor does not need to consider the `name`, when the constructor has no parameters, we can omit the `emptyParam` parameter.
|
||||
If you write `constructor()` and miss `emptyParam()`, the result found at this time will be the first one in bytecode order, <u>**may not be parameterless** </u>.
|
||||
|
||||
::: tip Compatibility Notes
|
||||
|
||||
In past historical versions of the API, if the constructor does not fill in any search parameters, the constructor will not be found directly.
|
||||
|
||||
<u>**This is a BUG and has been fixed in the latest version**</u>, please make sure you are using the latest API version.
|
||||
|
||||
:::
|
||||
|
||||
::: danger API Behavior Changes
|
||||
|
||||
In **1.2.0** and later versions, the behavior of **constructor()** is no longer **constructor { emptyParam() }** but **constructor {}**, please pay attention to the behavior change reasonably adjust the find parameters.
|
||||
|
||||
:::
|
||||
|
||||
#### No Find Conditions
|
||||
|
||||
Without setting find conditions, using `field()`, `constructor()`, `method()` will return all members under the current `Class`.
|
||||
|
||||
Using `get(...)` or `give()` will only get the first bit in bytecode order.
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
TestFoo::class.java.constructor()
|
||||
Test::class.java.field().get(...)
|
||||
Test::class.java.method().give()
|
||||
```
|
||||
|
||||
If you want to get all members, you can use `all(...)` or `giveAll()`
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
Test::class.java.field().all(...)
|
||||
Test::class.java.method().giveAll()
|
||||
```
|
||||
|
||||
::: tip Compatibility Notes
|
||||
|
||||
In the past historical versions of the API, if the constructor does not fill in any find conditions, the constructor will not be found directly.
|
||||
In past historical versions of the API, failure to set find conditions will throw an exception.
|
||||
|
||||
<u>**This is a bug, the latest version has been fixed**</u>, please make sure you are using the latest API version.
|
||||
This feature was added in **1.2.0** and later versions.
|
||||
|
||||
:::
|
||||
|
||||
#### Bytecode Type
|
||||
|
||||
::: danger
|
||||
|
||||
In the bytecode call result, the **cast** method can only specify the type corresponding to the bytecode.
|
||||
|
||||
:::
|
||||
In the bytecode call result, the **cast** method can <u>**only**</u> specify the type corresponding to the bytecode.
|
||||
|
||||
For example we want to get a field of type `Boolean` and cast it to `String`.
|
||||
|
||||
@@ -1830,7 +1873,7 @@ The following is the wrong way to use it.
|
||||
field {
|
||||
name = "test"
|
||||
type = BooleanType
|
||||
}.get().string() // ❗ Wrong usage, must be cast to the bytecode target type
|
||||
}.get().string() // Wrong usage, must be cast to the bytecode target type
|
||||
```
|
||||
|
||||
The following is the correct way to use it.
|
||||
@@ -1857,7 +1900,7 @@ field {
|
||||
}
|
||||
```
|
||||
|
||||
Expressing the type of `Boolean::class.javaPrimitiveType` in `Kotlin` is very long and inconvenient.
|
||||
Expressing the type of `Boolean::class.javaPrimitiveType` in Kotlin is very long and inconvenient.
|
||||
|
||||
Therefore, `YukiHookAPI` encapsulates common type calls for developers, including Android related types and Java common types and **primitive type keywords**.
|
||||
|
||||
@@ -1919,7 +1962,7 @@ At the same time, they all have their own corresponding package types in Java, s
|
||||
|
||||
Similarly, arrays also have corresponding wrapper types, which also need to be distinguished from Java **primitive type keywords**.
|
||||
|
||||
For example, the encapsulation type of **byte[]** is **ByteArrayType** or **ArrayClass(ByteType)**, and the encapsulation type of **Byte[]** is **ByteArrayClass** or **ArrayClass(ByteClass )**, these types are also <u>**unequal**</u>.
|
||||
For example, the encapsulation type of **byte[]** is **ByteArrayType** or **ArrayClass(ByteType)**, and the encapsulation type of **Byte[]** is **ByteArrayClass** or **ArrayClass(ByteClass)**, these types are also <u>**unequal**</u>.
|
||||
|
||||
:::
|
||||
|
||||
@@ -1929,4 +1972,6 @@ For more types, see [ComponentTypeFactory](../public/com/highcapable/yukihookapi
|
||||
|
||||
:::
|
||||
|
||||
At the same time, you are welcome to contribute more commonly used types.
|
||||
At the same time, you are welcome to contribute more commonly used types.
|
||||
|
||||
</div>
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user