Fix allMethods hooking replace bug

This commit is contained in:
2022-03-30 13:40:48 +08:00
parent cc8dbb8995
commit e895759172
5 changed files with 73 additions and 5 deletions

View File

@@ -47,6 +47,10 @@ class MainActivity : AppCompatActivity() {
appDemoFourthText.text = getRegularText(string = "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(string = "Find something interesting")
appDemoNinthText.text = Main().getTestResultLast()
appDemoTenthText.text = Main().getTestResultLast(string = "This is the last sentence")
appDemoButton.setOnClickListener { toast() }
}
}

View File

@@ -27,7 +27,15 @@
*/
package com.highcapable.yukihookapi.demo_app.utils
class Main(private val string: String) {
class Main(private val string: String = "") {
fun getString() = string
fun getTestResultFirst() = "The world is beautiful"
fun getTestResultFirst(string: String) = string
fun getTestResultLast() = "The world is fantastic"
fun getTestResultLast(string: String) = string
}