Skip to content

Commit

Permalink
Code cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
ElJaviLuki committed Jun 29, 2022
1 parent 846bb4d commit 1db41ee
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 87 deletions.
9 changes: 5 additions & 4 deletions app/src/main/java/com/eljaviluki/grindrplus/Constants.kt
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package com.eljaviluki.grindrplus

import de.robv.android.xposed.XC_MethodReplacement
import de.robv.android.xposed.XC_MethodReplacement.*

object Constants {
const val GRINDR_PKG = "com.grindrapp.android"

object Returns {
val RETURN_TRUE: XC_MethodReplacement = XC_MethodReplacement.returnConstant(true)
val RETURN_FALSE: XC_MethodReplacement = XC_MethodReplacement.returnConstant(false)
val RETURN_INTEGER_MAX_VALUE: XC_MethodReplacement = XC_MethodReplacement.returnConstant(Int.MAX_VALUE)
val RETURN_LONG_MAX_VALUE: XC_MethodReplacement = XC_MethodReplacement.returnConstant(Long.MAX_VALUE)
val RETURN_TRUE: XC_MethodReplacement = returnConstant(true)
val RETURN_FALSE: XC_MethodReplacement = returnConstant(false)
val RETURN_INTEGER_MAX_VALUE: XC_MethodReplacement = returnConstant(Int.MAX_VALUE)
val RETURN_LONG_MAX_VALUE: XC_MethodReplacement = returnConstant(Long.MAX_VALUE)
}
}
4 changes: 2 additions & 2 deletions app/src/main/java/com/eljaviluki/grindrplus/Hooker.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import android.app.Application
import android.content.Context
import de.robv.android.xposed.IXposedHookLoadPackage
import de.robv.android.xposed.XC_MethodHook
import de.robv.android.xposed.XposedHelpers
import de.robv.android.xposed.XposedHelpers.*
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
import kotlin.time.Duration.Companion.minutes

Expand All @@ -14,7 +14,7 @@ class Hooker : IXposedHookLoadPackage {
override fun handleLoadPackage(lpparam: LoadPackageParam) {
if (lpparam.packageName != Constants.GRINDR_PKG) return
pkgParam = lpparam
XposedHelpers.findAndHookMethod(
findAndHookMethod(
Application::class.java,
"onCreate",
object : XC_MethodHook() {
Expand Down
Loading

0 comments on commit 1db41ee

Please sign in to comment.