fix(TikTok): Resolve startup app crash

This commit is contained in:
LisoUseInAIKyrios 2025-02-19 15:53:12 +02:00
parent 5811cb5a14
commit d7000768a5
2 changed files with 17 additions and 1 deletions

View File

@ -2,4 +2,4 @@ package app.revanced.patches.tiktok.misc.extension
import app.revanced.patches.shared.misc.extension.sharedExtensionPatch
val sharedExtensionPatch = sharedExtensionPatch("tiktok", initHook)
val sharedExtensionPatch = sharedExtensionPatch("tiktok", initHook, jatoInitHook)

View File

@ -12,3 +12,19 @@ internal val initHook = extensionHook(
method.name == "<init>"
}
}
/**
* In some cases the extension code can be called before
* the app main activity onCreate is called.
*
* This class is called from startup code titled "BPEA RunnableGuardLancet"
*/
internal val jatoInitHook = extensionHook(
insertIndexResolver = { 0 },
contextRegisterResolver = { "p1" }
) {
custom { method, classDef ->
classDef.type == "Lcom/ss/android/ugc/aweme/legoImp/task/JatoInitTask;" &&
method.name == "run"
}
}