diff --git a/README.md b/README.md index 2b21f122..90dc11f0 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ Grindr Plus is a Xposed Module that allows you to unlock some features in Grindr - See 'Read' and 'Typing...' message states. - Allow taking screenshots in any part of the app (including albums and expiring photos). - Unlimited expiring photos. +- Remove expiration on incoming expiring photos, allowing to see them any number of times you want. - Extra profile fields in the so-called CruiseViewHolder ('Profile ID', and exact time of 'Last seen') - Make videocalls even if you didn't start a chat with the recipient. - Access to some user-hidden features (developer features) diff --git a/app/src/main/java/com/eljaviluki/grindrplus/Constants.kt b/app/src/main/java/com/eljaviluki/grindrplus/Constants.kt index 36261888..65c8d70c 100644 --- a/app/src/main/java/com/eljaviluki/grindrplus/Constants.kt +++ b/app/src/main/java/com/eljaviluki/grindrplus/Constants.kt @@ -9,5 +9,6 @@ object Constants { 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) } } \ No newline at end of file diff --git a/app/src/main/java/com/eljaviluki/grindrplus/Hooker.kt b/app/src/main/java/com/eljaviluki/grindrplus/Hooker.kt index b1af0d09..59886c7b 100644 --- a/app/src/main/java/com/eljaviluki/grindrplus/Hooker.kt +++ b/app/src/main/java/com/eljaviluki/grindrplus/Hooker.kt @@ -34,8 +34,10 @@ class Hooker : IXposedHookLoadPackage { //I've set this to max 3 min. If we make an UI for Hook Settings, we'll let the user to change this. Hooks.hookOnlineIndicatorDuration(3.minutes) Hooks.unlimitedTaps() + Hooks.removeExpirationOnExpiringPhotos() } - }) + } + ) } companion object { diff --git a/app/src/main/java/com/eljaviluki/grindrplus/Hooks.kt b/app/src/main/java/com/eljaviluki/grindrplus/Hooks.kt index 011b1e7a..bdf434ce 100644 --- a/app/src/main/java/com/eljaviluki/grindrplus/Hooks.kt +++ b/app/src/main/java/com/eljaviluki/grindrplus/Hooks.kt @@ -388,4 +388,19 @@ object Hooks { Constants.Returns.RETURN_TRUE ) } + + /** + * Hook the method that returns the duration of the expiring photos. + * This way, the photos will not expire and you will be able to see them any time you want. + * + * @author ElJaviLuki + */ + fun removeExpirationOnExpiringPhotos() { + val class_ExpiringImageBody = XposedHelpers.findClass(GApp.model.ExpiringImageBody, Hooker.pkgParam!!.classLoader) + XposedHelpers.findAndHookMethod( + class_ExpiringImageBody, + GApp.model.ExpiringImageBody_.getDuration, + Constants.Returns.RETURN_LONG_MAX_VALUE + ) + } } \ No newline at end of file diff --git a/app/src/main/java/com/eljaviluki/grindrplus/Obfuscation.kt b/app/src/main/java/com/eljaviluki/grindrplus/Obfuscation.kt index 1727ffd1..7aa0544e 100644 --- a/app/src/main/java/com/eljaviluki/grindrplus/Obfuscation.kt +++ b/app/src/main/java/com/eljaviluki/grindrplus/Obfuscation.kt @@ -24,6 +24,11 @@ class Obfuscation { object model { private const val _model = Constants.GRINDR_PKG + ".model" + const val ExpiringImageBody = "$_model.ExpiringImageBody" + object ExpiringImageBody_ { + const val getDuration = "getDuration" + } + const val ExpiringPhotoStatusResponse = "$_model.ExpiringPhotoStatusResponse" object ExpiringPhotoStatusResponse_ { const val getTotal = "getTotal"