commit 3cd628f7cfa326e02b49f3804a5dbd07bc74ab96
parent 1a9d55b2176ff4de9f0abba909d6c2dd11fa5efa
Author: rhunk <101876869+rhunk@users.noreply.github.com>
Date: Wed, 11 Oct 2023 21:31:44 +0200
fix: bypass video length restriction
Diffstat:
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/global/BypassVideoLengthRestriction.kt b/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/global/BypassVideoLengthRestriction.kt
@@ -63,9 +63,11 @@ class BypassVideoLengthRestriction :
}
// chat camera roll grid
- findClass("com.snap.impala.common.media.MediaLibraryItem").hookConstructor(HookStage.BEFORE) { param ->
- //set the video length argument
- param.setArg(3, -1L)
+ findClass("com.snap.composer.memories.MemoriesPickerVideoDurationConfig").hookConstructor(HookStage.AFTER) { param ->
+ param.thisObject<Any>().apply {
+ setObjectField("_maxSingleItemDurationMs", null)
+ setObjectField("_maxTotalDurationMs", null)
+ }
}
}
}
diff --git a/core/src/main/kotlin/me/rhunk/snapenhance/core/scripting/impl/ScriptHooker.kt b/core/src/main/kotlin/me/rhunk/snapenhance/core/scripting/impl/ScriptHooker.kt
@@ -48,7 +48,7 @@ class ScriptHookCallback(
fun arg(index: Int) = hookAdapter.argNullable<Any>(index)
- fun setArg(index: Int, value: Any) {
+ fun setArg(index: Int, value: Any?) {
hookAdapter.setArg(index, value.toPrimitiveValue(lazy { parameterTypes[index].name }))
}