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