From 8dedc9f555e8b6f7187a55876593a3c81f5bc3e0 Mon Sep 17 00:00:00 2001 From: Fankesyooni Date: Wed, 9 Feb 2022 02:02:43 +0800 Subject: [PATCH] ... --- .idea/compiler.xml | 3 +- .idea/gradle.xml | 3 +- .idea/misc.xml | 3 + .../yukihookapi/ExampleInstrumentedTest.kt | 24 --- app/src/main/assets/xposed_init | 1 - .../com/highcapable/yukihookapi/demo/App.kt | 52 ----- .../yukihookapi/demo/InjectLucky.kt | 55 ------ .../yukihookapi/demo/InjectNoParamTest.kt | 46 ----- .../yukihookapi/demo/InjectTestName.kt | 39 ---- .../yukihookapi/demo/MainActivity.kt | 111 ----------- .../yukihookapi/demo/hook/MainHooker.kt | 100 ---------- .../yukihookapi/demo/hook/SecondHooker.kt | 66 ------- .../yukihookapi/demo/hook/TestChildHooker.kt | 43 ---- .../demo/hook/inject/MainInjecter.kt | 187 ------------------ app/src/main/res/layout/activity_main.xml | 22 --- app/src/main/res/values/strings.xml | 3 - .../yukihookapi/ExampleUnitTest.kt | 17 -- {app => app_demo}/.gitignore | 0 app_demo/build.gradle | 54 +++++ {app => app_demo}/proguard-rules.pro | 0 app_demo/src/main/AndroidManifest.xml | 23 +++ .../yukihookapi/app_demo/ui/MainActivity.kt | 62 ++++++ .../yukihookapi/app_demo/utils/Main.kt | 12 +- .../drawable-v24/ic_launcher_foreground.xml | 0 .../res/drawable/ic_launcher_background.xml | 0 .../src/main/res/layout/activity_main.xml | 56 ++++++ .../res/mipmap-anydpi-v26/ic_launcher.xml | 0 .../mipmap-anydpi-v26/ic_launcher_round.xml | 0 .../src/main/res/mipmap-hdpi/ic_launcher.webp | Bin .../res/mipmap-hdpi/ic_launcher_round.webp | Bin .../src/main/res/mipmap-mdpi/ic_launcher.webp | Bin .../res/mipmap-mdpi/ic_launcher_round.webp | Bin .../main/res/mipmap-xhdpi/ic_launcher.webp | Bin .../res/mipmap-xhdpi/ic_launcher_round.webp | Bin .../main/res/mipmap-xxhdpi/ic_launcher.webp | Bin .../res/mipmap-xxhdpi/ic_launcher_round.webp | Bin .../main/res/mipmap-xxxhdpi/ic_launcher.webp | Bin .../res/mipmap-xxxhdpi/ic_launcher_round.webp | Bin .../src/main/res/values-night/themes.xml | 2 +- .../src/main/res/values/colors.xml | 0 app_demo/src/main/res/values/strings.xml | 3 + .../src/main/res/values/themes.xml | 2 +- module_demo/.gitignore | 1 + {app => module_demo}/build.gradle | 4 +- module_demo/proguard-rules.pro | 41 ++++ .../src/main/AndroidManifest.xml | 12 +- module_demo/src/main/assets/xposed_init | 1 + .../yukihookapi/module_demo/hook/MainHook.kt | 133 +++++++++++++ .../module_demo/ui/MainActivity.kt | 58 ++++++ .../drawable-v24/ic_launcher_foreground.xml | 30 +++ .../res/drawable/ic_launcher_background.xml | 170 ++++++++++++++++ .../src/main/res/layout/activity_main.xml | 34 ++++ .../res/mipmap-anydpi-v26/ic_launcher.xml | 5 + .../mipmap-anydpi-v26/ic_launcher_round.xml | 5 + .../src/main/res/mipmap-hdpi/ic_launcher.webp | Bin 0 -> 1404 bytes .../res/mipmap-hdpi/ic_launcher_round.webp | Bin 0 -> 2898 bytes .../src/main/res/mipmap-mdpi/ic_launcher.webp | Bin 0 -> 982 bytes .../res/mipmap-mdpi/ic_launcher_round.webp | Bin 0 -> 1772 bytes .../main/res/mipmap-xhdpi/ic_launcher.webp | Bin 0 -> 1900 bytes .../res/mipmap-xhdpi/ic_launcher_round.webp | Bin 0 -> 3918 bytes .../main/res/mipmap-xxhdpi/ic_launcher.webp | Bin 0 -> 2884 bytes .../res/mipmap-xxhdpi/ic_launcher_round.webp | Bin 0 -> 5914 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.webp | Bin 0 -> 3844 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.webp | Bin 0 -> 7778 bytes .../src/main/res/values-night/themes.xml | 16 ++ module_demo/src/main/res/values/colors.xml | 10 + module_demo/src/main/res/values/strings.xml | 3 + module_demo/src/main/res/values/themes.xml | 16 ++ settings.gradle | 3 +- .../YukiHookXposedProcessor.kt | 4 +- 70 files changed, 745 insertions(+), 790 deletions(-) delete mode 100644 app/src/androidTest/java/com/highcapable/yukihookapi/ExampleInstrumentedTest.kt delete mode 100644 app/src/main/assets/xposed_init delete mode 100644 app/src/main/java/com/highcapable/yukihookapi/demo/App.kt delete mode 100644 app/src/main/java/com/highcapable/yukihookapi/demo/InjectLucky.kt delete mode 100644 app/src/main/java/com/highcapable/yukihookapi/demo/InjectNoParamTest.kt delete mode 100644 app/src/main/java/com/highcapable/yukihookapi/demo/InjectTestName.kt delete mode 100644 app/src/main/java/com/highcapable/yukihookapi/demo/MainActivity.kt delete mode 100644 app/src/main/java/com/highcapable/yukihookapi/demo/hook/MainHooker.kt delete mode 100644 app/src/main/java/com/highcapable/yukihookapi/demo/hook/SecondHooker.kt delete mode 100644 app/src/main/java/com/highcapable/yukihookapi/demo/hook/TestChildHooker.kt delete mode 100644 app/src/main/java/com/highcapable/yukihookapi/demo/hook/inject/MainInjecter.kt delete mode 100644 app/src/main/res/layout/activity_main.xml delete mode 100644 app/src/main/res/values/strings.xml delete mode 100644 app/src/test/java/com/highcapable/yukihookapi/ExampleUnitTest.kt rename {app => app_demo}/.gitignore (100%) create mode 100644 app_demo/build.gradle rename {app => app_demo}/proguard-rules.pro (100%) create mode 100644 app_demo/src/main/AndroidManifest.xml create mode 100644 app_demo/src/main/java/com/highcapable/yukihookapi/app_demo/ui/MainActivity.kt rename app/src/main/java/com/highcapable/yukihookapi/demo/InjectTest.kt => app_demo/src/main/java/com/highcapable/yukihookapi/app_demo/utils/Main.kt (85%) rename {app => app_demo}/src/main/res/drawable-v24/ic_launcher_foreground.xml (100%) rename {app => app_demo}/src/main/res/drawable/ic_launcher_background.xml (100%) create mode 100644 app_demo/src/main/res/layout/activity_main.xml rename {app => app_demo}/src/main/res/mipmap-anydpi-v26/ic_launcher.xml (100%) rename {app => app_demo}/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml (100%) rename {app => app_demo}/src/main/res/mipmap-hdpi/ic_launcher.webp (100%) rename {app => app_demo}/src/main/res/mipmap-hdpi/ic_launcher_round.webp (100%) rename {app => app_demo}/src/main/res/mipmap-mdpi/ic_launcher.webp (100%) rename {app => app_demo}/src/main/res/mipmap-mdpi/ic_launcher_round.webp (100%) rename {app => app_demo}/src/main/res/mipmap-xhdpi/ic_launcher.webp (100%) rename {app => app_demo}/src/main/res/mipmap-xhdpi/ic_launcher_round.webp (100%) rename {app => app_demo}/src/main/res/mipmap-xxhdpi/ic_launcher.webp (100%) rename {app => app_demo}/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp (100%) rename {app => app_demo}/src/main/res/mipmap-xxxhdpi/ic_launcher.webp (100%) rename {app => app_demo}/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp (100%) rename {app => app_demo}/src/main/res/values-night/themes.xml (87%) rename {app => app_demo}/src/main/res/values/colors.xml (100%) create mode 100644 app_demo/src/main/res/values/strings.xml rename {app => app_demo}/src/main/res/values/themes.xml (87%) create mode 100644 module_demo/.gitignore rename {app => module_demo}/build.gradle (94%) create mode 100644 module_demo/proguard-rules.pro rename {app => module_demo}/src/main/AndroidManifest.xml (77%) create mode 100644 module_demo/src/main/assets/xposed_init create mode 100644 module_demo/src/main/java/com/highcapable/yukihookapi/module_demo/hook/MainHook.kt create mode 100644 module_demo/src/main/java/com/highcapable/yukihookapi/module_demo/ui/MainActivity.kt create mode 100644 module_demo/src/main/res/drawable-v24/ic_launcher_foreground.xml create mode 100644 module_demo/src/main/res/drawable/ic_launcher_background.xml create mode 100644 module_demo/src/main/res/layout/activity_main.xml create mode 100644 module_demo/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 module_demo/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100644 module_demo/src/main/res/mipmap-hdpi/ic_launcher.webp create mode 100644 module_demo/src/main/res/mipmap-hdpi/ic_launcher_round.webp create mode 100644 module_demo/src/main/res/mipmap-mdpi/ic_launcher.webp create mode 100644 module_demo/src/main/res/mipmap-mdpi/ic_launcher_round.webp create mode 100644 module_demo/src/main/res/mipmap-xhdpi/ic_launcher.webp create mode 100644 module_demo/src/main/res/mipmap-xhdpi/ic_launcher_round.webp create mode 100644 module_demo/src/main/res/mipmap-xxhdpi/ic_launcher.webp create mode 100644 module_demo/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp create mode 100644 module_demo/src/main/res/mipmap-xxxhdpi/ic_launcher.webp create mode 100644 module_demo/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp create mode 100644 module_demo/src/main/res/values-night/themes.xml create mode 100644 module_demo/src/main/res/values/colors.xml create mode 100644 module_demo/src/main/res/values/strings.xml create mode 100644 module_demo/src/main/res/values/themes.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml index cc12a2ed..c18ebdba 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -2,7 +2,8 @@ - + + diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 39c318f1..e1fb8620 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -10,7 +10,8 @@ diff --git a/app/src/androidTest/java/com/highcapable/yukihookapi/ExampleInstrumentedTest.kt b/app/src/androidTest/java/com/highcapable/yukihookapi/ExampleInstrumentedTest.kt deleted file mode 100644 index 30ed2ce8..00000000 --- a/app/src/androidTest/java/com/highcapable/yukihookapi/ExampleInstrumentedTest.kt +++ /dev/null @@ -1,24 +0,0 @@ -package com.highcapable.yukihookapi - -import androidx.test.platform.app.InstrumentationRegistry -import androidx.test.ext.junit.runners.AndroidJUnit4 - -import org.junit.Test -import org.junit.runner.RunWith - -import org.junit.Assert.* - -/** - * Instrumented test, which will execute on an Android device. - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -@RunWith(AndroidJUnit4::class) -class ExampleInstrumentedTest { - @Test - fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("com.highcapable.yukihookapi", appContext.packageName) - } -} \ No newline at end of file diff --git a/app/src/main/assets/xposed_init b/app/src/main/assets/xposed_init deleted file mode 100644 index 0512548b..00000000 --- a/app/src/main/assets/xposed_init +++ /dev/null @@ -1 +0,0 @@ -com.highcapable.yukihookapi.demo.hook.inject.MainInjecter_YukiHookXposedInit \ No newline at end of file diff --git a/app/src/main/java/com/highcapable/yukihookapi/demo/App.kt b/app/src/main/java/com/highcapable/yukihookapi/demo/App.kt deleted file mode 100644 index c5433cbd..00000000 --- a/app/src/main/java/com/highcapable/yukihookapi/demo/App.kt +++ /dev/null @@ -1,52 +0,0 @@ -/** - * MIT License - * - * Copyright (C) 2022 HighCapable - * - * This file is part of YukiHookAPI. - * - * 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/7. - */ -@file:Suppress("unused") - -package com.highcapable.yukihookapi.demo - -import android.app.Application -import android.content.Context -import com.highcapable.yukihookapi.YukiHookAPI -import com.highcapable.yukihookapi.demo.hook.MainHooker -import com.highcapable.yukihookapi.demo.hook.SecondHooker - -class App : Application() { - - override fun attachBaseContext(base: Context?) { - //// - // 装载你的 Hook 框架的代码 - //// - // 方式 1 - YukiHookAPI.encase(base) { - // Your code here. - } - // 方式 2 - YukiHookAPI.encase(base, MainHooker(), SecondHooker()) - super.attachBaseContext(base) - } -} \ No newline at end of file diff --git a/app/src/main/java/com/highcapable/yukihookapi/demo/InjectLucky.kt b/app/src/main/java/com/highcapable/yukihookapi/demo/InjectLucky.kt deleted file mode 100644 index 5acb7e59..00000000 --- a/app/src/main/java/com/highcapable/yukihookapi/demo/InjectLucky.kt +++ /dev/null @@ -1,55 +0,0 @@ -/** - * MIT License - * - * Copyright (C) 2022 HighCapable - * - * This file is part of YukiHookAPI. - * - * 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/8. - */ -package com.highcapable.yukihookapi.demo - -import androidx.annotation.Keep - -// for test -@Keep -class InjectLucky { - - // for test - @Keep - private var string = "没有" - - // for test - @Keep - constructor() { - string = "原始数据" - } - - // for test - @Keep - constructor(string: String = "原始数据复写") { - this.string = string - } - - // for test - @Keep - fun getString() = string -} \ No newline at end of file diff --git a/app/src/main/java/com/highcapable/yukihookapi/demo/InjectNoParamTest.kt b/app/src/main/java/com/highcapable/yukihookapi/demo/InjectNoParamTest.kt deleted file mode 100644 index d74c942f..00000000 --- a/app/src/main/java/com/highcapable/yukihookapi/demo/InjectNoParamTest.kt +++ /dev/null @@ -1,46 +0,0 @@ -/** - * MIT License - * - * Copyright (C) 2022 HighCapable - * - * This file is part of YukiHookAPI. - * - * 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/8. - */ -package com.highcapable.yukihookapi.demo - -import androidx.annotation.Keep - -// for test -@Keep -class InjectNoParamTest { - - @Keep - private var test = "没有" - - init { - test = "没修改的变量" - } - - // for test - @Keep - fun getString() = test -} \ No newline at end of file diff --git a/app/src/main/java/com/highcapable/yukihookapi/demo/InjectTestName.kt b/app/src/main/java/com/highcapable/yukihookapi/demo/InjectTestName.kt deleted file mode 100644 index dde98721..00000000 --- a/app/src/main/java/com/highcapable/yukihookapi/demo/InjectTestName.kt +++ /dev/null @@ -1,39 +0,0 @@ -/** - * MIT License - * - * Copyright (C) 2022 HighCapable - * - * This file is part of YukiHookAPI. - * - * 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/3. - */ -package com.highcapable.yukihookapi.demo - -import androidx.annotation.Keep - -// for test -@Keep -class InjectTestName(private val string: String) { - - // for test - @Keep - fun getString() = string -} \ No newline at end of file diff --git a/app/src/main/java/com/highcapable/yukihookapi/demo/MainActivity.kt b/app/src/main/java/com/highcapable/yukihookapi/demo/MainActivity.kt deleted file mode 100644 index 57a0089b..00000000 --- a/app/src/main/java/com/highcapable/yukihookapi/demo/MainActivity.kt +++ /dev/null @@ -1,111 +0,0 @@ -/** - * MIT License - * - * Copyright (C) 2022 HighCapable - * - * This file is part of YukiHookAPI. - * - * 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("SameParameterValue") - -package com.highcapable.yukihookapi.demo - -import android.os.Bundle -import android.widget.Button -import android.widget.Toast -import androidx.annotation.Keep -import androidx.appcompat.app.AlertDialog -import androidx.appcompat.app.AppCompatActivity -import com.highcapable.yukihookapi.hook.factory.modulePrefs -import com.highcapable.yukihookapi.hook.xposed.YukiHookModuleStatus - -@Keep -class MainActivity : AppCompatActivity() { - - @Keep - private var a = "没更改的变量" - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.activity_main) - // for test - findViewById