Skip to content

Commit

Permalink
Update AkinatorHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
KyuubiRan committed Dec 28, 2021
1 parent 6ba58b2 commit 2737c48
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
package me.kyuubiran.akinatorhelper.util

import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.loadClass

object AkinatorHelper {
object Methods {
private val C_AK_GAME_FACTORY by lazy {
loadClass("com.digidust.elokence.akinator.factories.AkGameFactory")
}

private val mGetAkGameFactoryInstance by lazy {
findMethod("com.digidust.elokence.akinator.factories.AkGameFactory") {
findMethod(C_AK_GAME_FACTORY) {
name == "sharedInstance"
}
}
Expand All @@ -15,7 +20,7 @@ object AkinatorHelper {
}

private val mIsGameUnlocked by lazy {
findMethod("com.digidust.elokence.akinator.factories.AkGameFactory") {
findMethod(C_AK_GAME_FACTORY) {
name == "isUnlocked"
}
}
Expand All @@ -25,7 +30,7 @@ object AkinatorHelper {
}

private val mSetGameLocked by lazy {
findMethod("com.digidust.elokence.akinator.factories.AkGameFactory") {
findMethod(C_AK_GAME_FACTORY) {
name == "lockGame"
}
}
Expand All @@ -36,7 +41,7 @@ object AkinatorHelper {


private val mSetGameUnlocked by lazy {
findMethod("com.digidust.elokence.akinator.factories.AkGameFactory") {
findMethod(C_AK_GAME_FACTORY) {
name == "unlockGame"
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package me.kyuubiran.akinatorhelper.util

import android.content.Context
import android.content.SharedPreferences
import com.github.kyuubiran.ezxhelper.init.InitFields.appContext

object ConfigManager {
val sPrefs by lazy {
val sPrefs: SharedPreferences by lazy {
appContext.getSharedPreferences("akinator_helper", Context.MODE_PRIVATE)
}

Expand Down

0 comments on commit 2737c48

Please sign in to comment.