Skip to content

Commit 2737c48

Browse files
committed
Update AkinatorHelper
1 parent 6ba58b2 commit 2737c48

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

app/src/main/java/me/kyuubiran/akinatorhelper/util/AkinatorHelper.kt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
package me.kyuubiran.akinatorhelper.util
22

33
import com.github.kyuubiran.ezxhelper.utils.findMethod
4+
import com.github.kyuubiran.ezxhelper.utils.loadClass
45

56
object AkinatorHelper {
67
object Methods {
8+
private val C_AK_GAME_FACTORY by lazy {
9+
loadClass("com.digidust.elokence.akinator.factories.AkGameFactory")
10+
}
11+
712
private val mGetAkGameFactoryInstance by lazy {
8-
findMethod("com.digidust.elokence.akinator.factories.AkGameFactory") {
13+
findMethod(C_AK_GAME_FACTORY) {
914
name == "sharedInstance"
1015
}
1116
}
@@ -15,7 +20,7 @@ object AkinatorHelper {
1520
}
1621

1722
private val mIsGameUnlocked by lazy {
18-
findMethod("com.digidust.elokence.akinator.factories.AkGameFactory") {
23+
findMethod(C_AK_GAME_FACTORY) {
1924
name == "isUnlocked"
2025
}
2126
}
@@ -25,7 +30,7 @@ object AkinatorHelper {
2530
}
2631

2732
private val mSetGameLocked by lazy {
28-
findMethod("com.digidust.elokence.akinator.factories.AkGameFactory") {
33+
findMethod(C_AK_GAME_FACTORY) {
2934
name == "lockGame"
3035
}
3136
}
@@ -36,7 +41,7 @@ object AkinatorHelper {
3641

3742

3843
private val mSetGameUnlocked by lazy {
39-
findMethod("com.digidust.elokence.akinator.factories.AkGameFactory") {
44+
findMethod(C_AK_GAME_FACTORY) {
4045
name == "unlockGame"
4146
}
4247
}

app/src/main/java/me/kyuubiran/akinatorhelper/util/ConfigManager.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package me.kyuubiran.akinatorhelper.util
22

33
import android.content.Context
4+
import android.content.SharedPreferences
45
import com.github.kyuubiran.ezxhelper.init.InitFields.appContext
56

67
object ConfigManager {
7-
val sPrefs by lazy {
8+
val sPrefs: SharedPreferences by lazy {
89
appContext.getSharedPreferences("akinator_helper", Context.MODE_PRIVATE)
910
}
1011

0 commit comments

Comments
 (0)