fix: bypass video length restriction

This commit is contained in:
rhunk 2023-10-11 21:31:44 +02:00
parent 1a9d55b217
commit 3cd628f7cf
2 changed files with 6 additions and 4 deletions

View File

@ -63,9 +63,11 @@ class BypassVideoLengthRestriction :
} }
// chat camera roll grid // chat camera roll grid
findClass("com.snap.impala.common.media.MediaLibraryItem").hookConstructor(HookStage.BEFORE) { param -> findClass("com.snap.composer.memories.MemoriesPickerVideoDurationConfig").hookConstructor(HookStage.AFTER) { param ->
//set the video length argument param.thisObject<Any>().apply {
param.setArg(3, -1L) setObjectField("_maxSingleItemDurationMs", null)
setObjectField("_maxTotalDurationMs", null)
}
} }
} }
} }

View File

@ -48,7 +48,7 @@ class ScriptHookCallback(
fun arg(index: Int) = hookAdapter.argNullable<Any>(index) 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 })) hookAdapter.setArg(index, value.toPrimitiveValue(lazy { parameterTypes[index].name }))
} }