fix(core): call recorder

Support v13.32.0.43

Signed-off-by: rhunk <101876869+rhunk@users.noreply.github.com>
This commit is contained in:
rhunk 2025-03-16 21:06:38 +01:00
parent c7a2d02687
commit 2ef0e54168

View File

@ -33,7 +33,9 @@ class CallRecorder : Feature("Call Recorder") {
val streamHandlers = ConcurrentHashMap<Int, MutableList<(data: ByteArray) -> Unit>>() // audioTrack -> handlers
val participants = CopyOnWriteArrayList<String>()
findClass("com.snapchat.talkcorev3.CallingSessionState").hookConstructor(HookStage.AFTER) { param ->
runCatching {
findClass("com.snapchat.talkcorev3.CallingSessionState")
}.getOrNull()?.hookConstructor(HookStage.AFTER) { param ->
val instance = param.thisObject<Any>()
val callingState = instance.getObjectFieldOrNull("mLocalUser")?.getObjectField("mCallingState")
@ -41,6 +43,13 @@ class CallRecorder : Feature("Call Recorder") {
participants.clear()
participants.addAll((instance.getObjectField("mParticipants") as Map<*, *>).keys.map { it.toString() })
}
} ?: findClass("com.snapchat.talkcorev3.TSCallingStateUpdateParams").hookConstructor(HookStage.AFTER) { param ->
val instance = param.thisObject<Any>()
if (instance.getObjectFieldOrNull("mInCall") == true) {
participants.clear()
participants.addAll((instance.getObjectField("mParticipants") as Set<*>).map { it.toString() })
}
}
AudioTrack::class.java.apply {