From d7000768a5e5a688c9f4e48858ac34e352222c1e Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Wed, 19 Feb 2025 15:53:12 +0200 Subject: [PATCH 1/4] fix(TikTok): Resolve startup app crash --- .../tiktok/misc/extension/ExtensionPatch.kt | 2 +- .../patches/tiktok/misc/extension/Hooks.kt | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) 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 66efc7f513..5101f3d524 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) +val sharedExtensionPatch = sharedExtensionPatch("tiktok", initHook, jatoInitHook) 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 24a49dd352..8ef26fc3f5 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 @@ -12,3 +12,19 @@ internal val initHook = extensionHook( method.name == "" } } + +/** + * 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" + } +} From a0e000c886deb8e87cf53de9147b5552ce1d4741 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 19 Feb 2025 13:57:05 +0000 Subject: [PATCH 2/4] chore: Release v5.13.0-dev.4 [skip ci] # [5.13.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v5.13.0-dev.3...v5.13.0-dev.4) (2025-02-19) ### Bug Fixes * **TikTok:** Resolve startup app crash ([d700076](https://github.com/ReVanced/revanced-patches/commit/d7000768a5e5a688c9f4e48858ac34e352222c1e)) --- CHANGELOG.md | 7 +++++++ gradle.properties | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b02acea38a..8726a0344a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [5.13.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v5.13.0-dev.3...v5.13.0-dev.4) (2025-02-19) + + +### Bug Fixes + +* **TikTok:** Resolve startup app crash ([d700076](https://github.com/ReVanced/revanced-patches/commit/d7000768a5e5a688c9f4e48858ac34e352222c1e)) + # [5.13.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v5.13.0-dev.2...v5.13.0-dev.3) (2025-02-19) diff --git a/gradle.properties b/gradle.properties index 33beba4907..ac59d8befe 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,4 +3,4 @@ org.gradle.jvmargs = -Xms512M -Xmx2048M org.gradle.parallel = true android.useAndroidX = true kotlin.code.style = official -version = 5.13.0-dev.3 +version = 5.13.0-dev.4 From c14bc244550de30eca975ca7c09e8eb0c47534b5 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Wed, 19 Feb 2025 16:36:07 +0200 Subject: [PATCH 3/4] fix(TikTok): Resolve startup app crash --- .../app/revanced/patches/tiktok/misc/extension/Hooks.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 8ef26fc3f5..75382f92cb 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 @@ -4,12 +4,11 @@ import app.revanced.patches.shared.misc.extension.extensionHook import com.android.tools.smali.dexlib2.AccessFlags internal val initHook = extensionHook( - insertIndexResolver = { 1 }, // Insert after call to super class. + insertIndexResolver = { 0 } ) { - accessFlags(AccessFlags.PUBLIC, AccessFlags.CONSTRUCTOR) custom { method, classDef -> - classDef.endsWith("/AwemeHostApplication;") && - method.name == "" + classDef.type == "Lcom/ss/android/ugc/aweme/main/MainActivity;" && + method.name == "onCreate" } } From 6b54879282216fb47fefa4f2d038407929fb1eba Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 19 Feb 2025 14:39:51 +0000 Subject: [PATCH 4/4] chore: Release v5.13.0-dev.5 [skip ci] # [5.13.0-dev.5](https://github.com/ReVanced/revanced-patches/compare/v5.13.0-dev.4...v5.13.0-dev.5) (2025-02-19) ### Bug Fixes * **TikTok:** Resolve startup app crash ([c14bc24](https://github.com/ReVanced/revanced-patches/commit/c14bc244550de30eca975ca7c09e8eb0c47534b5)) --- CHANGELOG.md | 7 +++++++ gradle.properties | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8726a0344a..26c02d8eec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [5.13.0-dev.5](https://github.com/ReVanced/revanced-patches/compare/v5.13.0-dev.4...v5.13.0-dev.5) (2025-02-19) + + +### Bug Fixes + +* **TikTok:** Resolve startup app crash ([c14bc24](https://github.com/ReVanced/revanced-patches/commit/c14bc244550de30eca975ca7c09e8eb0c47534b5)) + # [5.13.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v5.13.0-dev.3...v5.13.0-dev.4) (2025-02-19) diff --git a/gradle.properties b/gradle.properties index ac59d8befe..ed80c7321a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,4 +3,4 @@ org.gradle.jvmargs = -Xms512M -Xmx2048M org.gradle.parallel = true android.useAndroidX = true kotlin.code.style = official -version = 5.13.0-dev.4 +version = 5.13.0-dev.5