diff --git a/patches/src/main/kotlin/app/revanced/patches/tiktok/misc/extension/ExtensionPatch.kt b/patches/src/main/kotlin/app/revanced/patches/tiktok/misc/extension/ExtensionPatch.kt index 5101f3d52..81d253055 100644 --- a/patches/src/main/kotlin/app/revanced/patches/tiktok/misc/extension/ExtensionPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/tiktok/misc/extension/ExtensionPatch.kt @@ -2,4 +2,4 @@ package app.revanced.patches.tiktok.misc.extension import app.revanced.patches.shared.misc.extension.sharedExtensionPatch -val sharedExtensionPatch = sharedExtensionPatch("tiktok", initHook, jatoInitHook) +val sharedExtensionPatch = sharedExtensionPatch("tiktok", initHook, jatoInitHook, storeRegionInitHook) diff --git a/patches/src/main/kotlin/app/revanced/patches/tiktok/misc/extension/Hooks.kt b/patches/src/main/kotlin/app/revanced/patches/tiktok/misc/extension/Hooks.kt index 75382f92c..db1912677 100644 --- a/patches/src/main/kotlin/app/revanced/patches/tiktok/misc/extension/Hooks.kt +++ b/patches/src/main/kotlin/app/revanced/patches/tiktok/misc/extension/Hooks.kt @@ -3,9 +3,7 @@ package app.revanced.patches.tiktok.misc.extension import app.revanced.patches.shared.misc.extension.extensionHook import com.android.tools.smali.dexlib2.AccessFlags -internal val initHook = extensionHook( - insertIndexResolver = { 0 } -) { +internal val initHook = extensionHook { custom { method, classDef -> classDef.type == "Lcom/ss/android/ugc/aweme/main/MainActivity;" && method.name == "onCreate" @@ -16,14 +14,24 @@ internal val initHook = extensionHook( * 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" + * This class is called from startup code titled "BPEA RunnableGuardLancet". */ internal val jatoInitHook = extensionHook( - insertIndexResolver = { 0 }, contextRegisterResolver = { "p1" } ) { + parameters("Landroid/content/Context;") custom { method, classDef -> classDef.type == "Lcom/ss/android/ugc/aweme/legoImp/task/JatoInitTask;" && method.name == "run" } } + +internal val storeRegionInitHook = extensionHook( + contextRegisterResolver = { "p1" } +) { + parameters("Landroid/content/Context;") + custom { method, classDef -> + classDef.type == "Lcom/ss/android/ugc/aweme/legoImp/task/StoreRegionInitTask;" && + method.name == "run" + } +}