Skip to content

Commit

Permalink
Fix dokka && add sample
Browse files Browse the repository at this point in the history
  • Loading branch information
keta1 committed Jan 28, 2023
1 parent 1ab5c2c commit e32d51c
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
17 changes: 16 additions & 1 deletion EzXHelper/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,25 @@ dependencies {
compileOnly 'de.robv.android.xposed:api:82'
}

dokkaHtml.configure {
dokkaHtml {
dokkaSourceSets {
named("main") {
noAndroidSdkLink.set(false)
sourceRoots.from(file("src"), project(":jvm").file("src"))
samples.from(project(":sample").file("src/main/java/com/example/sample"))
}
}

doLast {
def docTree = fileTree(
dir: "${dokkaHtml.outputDirectory.get()}",
includes: ["**/*.html"])
docTree.each { file ->
def text = file.text
file.write(text.replace(
'<script src="https://unpkg.com/kotlin-playground@1"></script>',
'<script src="https://unpkg.com/kotlin-playground@1" data-server="https://kpi.ketal.icu"></script>'
))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ object ObjectUtils {
* @param fieldName field name
* @return field object or null
* @throws NoSuchFieldException if the field is not found
* @sample com.example.sample.getObjectOrNull
*/
@JvmStatic
@Throws(NoSuchFieldException::class)
Expand Down
2 changes: 1 addition & 1 deletion sample/src/main/java/com/example/sample/MainHook.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.example.sample.hook.BaseHook
import com.example.sample.hook.ExampleHook
import com.github.kyuubiran.ezxhelper.EzXHelper
import com.github.kyuubiran.ezxhelper.Log
import com.github.kyuubiran.ezxhelper.Log.logexIfThrow
import com.github.kyuubiran.ezxhelper.LogExtensions.logexIfThrow
import de.robv.android.xposed.IXposedHookLoadPackage
import de.robv.android.xposed.IXposedHookZygoteInit
import de.robv.android.xposed.callbacks.XC_LoadPackage
Expand Down
13 changes: 13 additions & 0 deletions sample/src/main/java/com/example/sample/ObjectUtilsSample.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.example.sample

import com.github.kyuubiran.ezxhelper.ObjectUtils

fun getObjectOrNull() {
val obj = object {
val field = "Hello World"
}
val field = ObjectUtils.getObjectOrNull(obj, "field")
println(field)
}


0 comments on commit e32d51c

Please sign in to comment.