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
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)
}
}
}
}

View File

@ -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 }))
}