From 5a70d6b6e15e7d1b7307a21f4ecd9d5c85564d92 Mon Sep 17 00:00:00 2001 From: plant-saver3000 <309372019+plant-saver3000@users.noreply.github.com> Date: Sun, 26 Jul 2026 15:03:31 +0200 Subject: [PATCH 1/9] Support Kleinanzeigen 2026.30.0 --- gradle/libs.versions.toml | 3 + patches/build.gradle.kts | 1 + .../kleinanzeigen/ads/HideAdsPatch.kt | 4 +- .../kleinanzeigen/hidepur/Fingerprints.kt | 26 ++++--- .../kleinanzeigen/hidepur/HidePurPatch.kt | 49 ++++++------- .../sharetracking/Fingerprints.kt | 70 +++++++++++++++---- .../RemoveTrackingParamsPatch.kt | 4 +- settings.gradle.kts | 2 +- versions.json | 2 +- 9 files changed, 106 insertions(+), 55 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3175545..fe8d3db 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,8 +1,11 @@ [versions] morphe-patcher = "1.3.3" #noinspection GradleDependency +morphe-patches-library = "1.2.0" # built against morphe-patcher 1.3.3 smali = "b6365a84f4" gson = "2.13.2" [libraries] gson = { module = "com.google.code.gson:gson", version.ref = "gson" } +morphe-patcher = { module = "app.morphe:morphe-patcher", version.ref = "morphe-patcher" } +morphe-patches-library = { module = "app.morphe:morphe-patches-library", version.ref = "morphe-patches-library" } diff --git a/patches/build.gradle.kts b/patches/build.gradle.kts index 737c778..dbacb1e 100644 --- a/patches/build.gradle.kts +++ b/patches/build.gradle.kts @@ -21,6 +21,7 @@ kotlin { dependencies { // Used by JsonGenerator. implementation(libs.gson) + implementation(libs.morphe.patches.library) } tasks { diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt index 9fdbe0d..717326e 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt @@ -10,9 +10,7 @@ private val COMPAT = Compatibility( packageName = "com.ebay.kleinanzeigen", appIconColor = 0x2EAD33, targets = listOf( - AppTarget(version = "2026.16.1"), - AppTarget(version = "2026.14.2"), - AppTarget(version = "2026.14.0"), + AppTarget(version = "2026.30.0"), ), ) diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/Fingerprints.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/Fingerprints.kt index a816233..86cc273 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/Fingerprints.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/Fingerprints.kt @@ -1,16 +1,22 @@ package app.docbt.patched_up.kleinanzeigen.hidepur import app.morphe.patcher.Fingerprint +import app.morphe.patcher.methodCall +import app.morphe.patches.all.misc.resources.ResourceType +import app.morphe.patches.all.misc.resources.resourceLiteral -// setupSections (2026.9.0) / q (2026.12.0) in SettingsAndHelpFragment: -// parameter p7 = showAdFreeSubscription (bool). The single IF_EQZ p7 controls -// whether the Pur section container is VISIBLE or GONE. -// SettingsAndHelpFragment is never obfuscated — stable across versions. +// Resolves the Pur title string's ID at patch time from the current APK's +// own res/values/public.xml, instead of a fixed value which might change each APK release. +// So it self-corrects if aapt2 ever renumbers ka_gbl_pur between APK releases. +// +// filters[0] identifies the ROW (the Pur entry specifically, via its title +// resource); filters[1] identifies which of the ~14 setVisibility(I) calls +// in this method belongs to that row. Both are required — resourceLiteral +// alone only proves we're in the right method, not which instruction to patch. internal object SetupSectionsPurFingerprint : Fingerprint( - custom = { method, classDef -> - classDef.type == "Lebk/ui/preferences/settings/settings_and_help/SettingsAndHelpFragment;" && - !method.name.startsWith("access\$") && - method.parameterTypes.count { it == "Z" } >= 5 && - method.parameterTypes.any { it == "Ljava/lang/String;" } - }, + definingClass = "Lebk/ui/preferences/settings/settings_and_help/SettingsAndHelpFragment;", + filters = listOf( + resourceLiteral(ResourceType.STRING, "ka_gbl_pur"), + methodCall(smali = "Landroid/view/View;->setVisibility(I)V"), + ), ) diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt index 65b15a7..49e8237 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt @@ -1,21 +1,17 @@ package app.docbt.patched_up.kleinanzeigen.hidepur -import app.morphe.patcher.extensions.InstructionExtensions +import app.morphe.patcher.extensions.InstructionExtensions.addInstructions import app.morphe.patcher.patch.AppTarget import app.morphe.patcher.patch.Compatibility import app.morphe.patcher.patch.bytecodePatch -import com.android.tools.smali.dexlib2.Opcode -import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction +import app.morphe.patches.all.misc.resources.resourceMappingPatch +import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction private val COMPAT = Compatibility( name = "Kleinanzeigen", packageName = "com.ebay.kleinanzeigen", appIconColor = 0x2EAD33, - targets = listOf( - AppTarget(version = "2026.16.1"), - AppTarget(version = "2026.14.2"), - AppTarget(version = "2026.14.0"), - ), + targets = listOf(AppTarget(version = "2026.30.0")), ) @Suppress("unused") @@ -25,23 +21,28 @@ val hidePurPatch = bytecodePatch( ) { compatibleWith(COMPAT) + // resourceMappingPatch is required whenever a fingerprint uses resourceLiteral(): this patch builds + // the resource-name -> id lookup table (from public.xml) that the filter + // reads at match time. Omitting this dependency leaves the table empty and + // the fingerprint will fail to match with no obvious error pointing here. + dependsOn(resourceMappingPatch) + execute { - with(InstructionExtensions) { - // setupSections() (2026.9.0) / q() (2026.12.0) in SettingsAndHelpFragment: - // p7 = showAdFreeSubscription. The single IF_EQZ p7 sends to GONE when false, - // VISIBLE when true. Forcing vReg = 0 before IF_EQZ always hides the Pur entry. - val method = SetupSectionsPurFingerprint.method - var ifEqzIndex = -1 - var showAdFreeReg = -1 - for ((i, instr) in method.implementation!!.instructions.withIndex()) { - if (instr.opcode == Opcode.IF_EQZ) { - ifEqzIndex = i - showAdFreeReg = (instr as OneRegisterInstruction).registerA - break - } - } - check(ifEqzIndex != -1) { "IF_EQZ not found in setupSections/q" } - method.addInstruction(ifEqzIndex, "const/4 v$showAdFreeReg, 0x0") + SetupSectionsPurFingerprint.let { + // instructionMatches[1] = the second filter above (the setVisibility + // call for the Pur row specifically, not just any setVisibility call). + val setVisibilityMatch = it.instructionMatches[1] + val invoke = setVisibilityMatch.getInstruction() + val visibilityArgRegister = invoke.registerD // the `int` visibility arg register, not the View receiver + + // const/16, not const/4: const/4's literal is a signed 4-bit value + // (range -8..7), and View.GONE = 8 overflows that by exactly one. + // Using const/4 here compiles to invalid smali and fails silently + // downstream as "Collection is empty" during instruction assembly. + it.method.addInstructions( + setVisibilityMatch.index, + "const/16 v$visibilityArgRegister, 0x8", // View.GONE + ) } } } diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/Fingerprints.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/Fingerprints.kt index ccbbc63..ecd3dea 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/Fingerprints.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/Fingerprints.kt @@ -1,23 +1,67 @@ package app.docbt.patched_up.kleinanzeigen.sharetracking import app.morphe.patcher.Fingerprint +import app.morphe.patcher.patch.PatchException +import com.android.tools.smali.dexlib2.iface.ClassDef +import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction +import com.android.tools.smali.dexlib2.iface.reference.StringReference -// e.h() — builds the VIP ad share URL, switches utm_source by target app. -// "sharesheet" is the stable default source string (used for generic share sheet). -internal object ShareUrlBuilderFingerprint : Fingerprint( - strings = listOf("sharesheet"), - custom = { _, classDef -> classDef.type == "Lebk/ui/vip/compose/content/e;" }, -) +// Anchor strings: appear together in the share-target switch statement. +// Using several co-occurring strings instead of just "sharesheet" avoids +// false-positive matches against unrelated code elsewhere in the merged +// multi-dex APK that might also contain the word "sharesheet" on its own. +private val ANCHOR_STRINGS = setOf("sharesheet", "com.whatsapp", "com.pinterest", "com.facebook.orca") + +// True if any method in this class references all of ANCHOR_STRINGS +// (not necessarily the same method — they live in different switch +// branches of the same method in practice, but we don't rely on that). +private fun ClassDef.containsAnchorStrings(): Boolean { + val remaining = ANCHOR_STRINGS.toMutableSet() + for (method in methods) { + val instructions = method.implementation?.instructions ?: continue + for (instruction in instructions) { + val ref = (instruction as? ReferenceInstruction)?.reference as? StringReference ?: continue + remaining.remove(ref.string) + } + if (remaining.isEmpty()) return true + } + return remaining.isEmpty() +} // e.i(url, source) — appends UTM params to a URL and returns the result. -// Called by h() for ad sharing and directly for store sharing. -// Signature: (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; -// Identified by: same class as h(), returns String, takes exactly 2 String parameters. +// Class itself may be merged into an unrelated library namespace (e.g. OkHttp) +// by R8, and its name/package can change between versions — do not lock to type. +// Instead: identify the class via ANCHOR_STRINGS, then require the matched +// method to be the unique (String, String) -> String method in that class. internal object ShareUrlParamBuilderFingerprint : Fingerprint( custom = { method, classDef -> - classDef.type == "Lebk/ui/vip/compose/content/e;" && - method.returnType == "Ljava/lang/String;" && - method.parameterTypes.size == 2 && - method.parameterTypes.all { it.toString() == "Ljava/lang/String;" } + val isRightShape = + method.returnType == "Ljava/lang/String;" && + method.parameterTypes.size == 2 && + method.parameterTypes.all { it.toString() == "Ljava/lang/String;" } + + if (!isRightShape || !classDef.containsAnchorStrings()) { + false + } else { + val shapeMatches = classDef.methods.filter { m -> + m.returnType == "Ljava/lang/String;" && + m.parameterTypes.size == 2 && + m.parameterTypes.all { it.toString() == "Ljava/lang/String;" } + } + // The PatchException below is intentional and not just defensive boilerplate: + // if a future app version adds a second (String, String) -> String method to + // this class, we want the build to fail loudly with a clear message, rather + // than silently patching whichever method happens to be listed first — the + // exact class of bug that caused the original Hide Pur regression this patch + // set was built to avoid repeating. + if (shapeMatches.size != 1) { + throw PatchException( + "Expected exactly 1 method matching (String, String) -> String in " + + "${classDef.type}, but found ${shapeMatches.size}" + + if (shapeMatches.isEmpty()) "." else ": ${shapeMatches.joinToString { it.name }}." + ) + } + true + } }, ) diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt index 86480f3..2b2b661 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt @@ -10,9 +10,7 @@ private val COMPAT = Compatibility( packageName = "com.ebay.kleinanzeigen", appIconColor = 0x2EAD33, targets = listOf( - AppTarget(version = "2026.16.1"), - AppTarget(version = "2026.14.2"), - AppTarget(version = "2026.14.0"), + AppTarget(version = "2026.30.0"), ), ) diff --git a/settings.gradle.kts b/settings.gradle.kts index d8f66a6..c148b27 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -17,5 +17,5 @@ pluginManagement { } plugins { - id("app.morphe.patches") version "1.2.0" + id("app.morphe.patches") version "1.3.0" } diff --git a/versions.json b/versions.json index daec0c3..1932845 100644 --- a/versions.json +++ b/versions.json @@ -1,4 +1,4 @@ { "googleNews": "5.163.0.947799485", - "kleinanzeigen": "2026.16.1" + "kleinanzeigen": "2026.30.0" } From 11d578cef2170addd77a344d769c0bdbc55180d7 Mon Sep 17 00:00:00 2001 From: plant-saver3000 <309372019+plant-saver3000@users.noreply.github.com> Date: Sat, 5 Sep 2026 00:15:13 +0200 Subject: [PATCH 2/9] Support Kleinanzeigen 2026.36.0; Fix HidePur patch in newer versions --- .../kleinanzeigen/ads/HideAdsPatch.kt | 4 +- .../kleinanzeigen/hidepur/Fingerprints.kt | 16 ++------ .../kleinanzeigen/hidepur/HidePurPatch.kt | 41 +++++++++---------- .../RemoveTrackingParamsPatch.kt | 4 +- 4 files changed, 26 insertions(+), 39 deletions(-) diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt index 717326e..1702cce 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt @@ -9,9 +9,7 @@ private val COMPAT = Compatibility( name = "Kleinanzeigen", packageName = "com.ebay.kleinanzeigen", appIconColor = 0x2EAD33, - targets = listOf( - AppTarget(version = "2026.30.0"), - ), + targets = listOf(AppTarget(version = "2026.36.0")), ) @Suppress("unused") diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/Fingerprints.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/Fingerprints.kt index 86cc273..183ee55 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/Fingerprints.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/Fingerprints.kt @@ -1,22 +1,14 @@ package app.docbt.patched_up.kleinanzeigen.hidepur import app.morphe.patcher.Fingerprint -import app.morphe.patcher.methodCall import app.morphe.patches.all.misc.resources.ResourceType import app.morphe.patches.all.misc.resources.resourceLiteral -// Resolves the Pur title string's ID at patch time from the current APK's -// own res/values/public.xml, instead of a fixed value which might change each APK release. -// So it self-corrects if aapt2 ever renumbers ka_gbl_pur between APK releases. -// -// filters[0] identifies the ROW (the Pur entry specifically, via its title -// resource); filters[1] identifies which of the ~14 setVisibility(I) calls -// in this method belongs to that row. Both are required — resourceLiteral -// alone only proves we're in the right method, not which instruction to patch. -internal object SetupSectionsPurFingerprint : Fingerprint( - definingClass = "Lebk/ui/preferences/settings/settings_and_help/SettingsAndHelpFragment;", +// Anchors on the ka_gbl_pur string resource to locate the eligibility check +// that gates whether Pur is added to the Compose settings list. No class +// constraint: the containing class is an R8-merged utility with no stable name. +internal object HidePurEligibilityFingerprint : Fingerprint( filters = listOf( resourceLiteral(ResourceType.STRING, "ka_gbl_pur"), - methodCall(smali = "Landroid/view/View;->setVisibility(I)V"), ), ) diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt index 49e8237..c2895e3 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt @@ -5,13 +5,14 @@ import app.morphe.patcher.patch.AppTarget import app.morphe.patcher.patch.Compatibility import app.morphe.patcher.patch.bytecodePatch import app.morphe.patches.all.misc.resources.resourceMappingPatch -import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction +import com.android.tools.smali.dexlib2.Opcode +import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction private val COMPAT = Compatibility( name = "Kleinanzeigen", packageName = "com.ebay.kleinanzeigen", appIconColor = 0x2EAD33, - targets = listOf(AppTarget(version = "2026.30.0")), + targets = listOf(AppTarget(version = "2026.36.0")), ) @Suppress("unused") @@ -20,29 +21,27 @@ val hidePurPatch = bytecodePatch( description = "Hides the Pur ad-free subscription option from the settings menu.", ) { compatibleWith(COMPAT) - - // resourceMappingPatch is required whenever a fingerprint uses resourceLiteral(): this patch builds - // the resource-name -> id lookup table (from public.xml) that the filter - // reads at match time. Omitting this dependency leaves the table empty and - // the fingerprint will fail to match with no obvious error pointing here. dependsOn(resourceMappingPatch) execute { - SetupSectionsPurFingerprint.let { - // instructionMatches[1] = the second filter above (the setVisibility - // call for the Pur row specifically, not just any setVisibility call). - val setVisibilityMatch = it.instructionMatches[1] - val invoke = setVisibilityMatch.getInstruction() - val visibilityArgRegister = invoke.registerD // the `int` visibility arg register, not the View receiver + HidePurEligibilityFingerprint.let { + val method = it.method + val instructions = method.implementation!!.instructions.toList() + val literalIndex = it.instructionMatches[0].index + + // The Pur row is only appended inside `if (eligible) { list.add(...) }`. + // Walk backward from the ka_gbl_pur reference to find that specific + // gate, not forward from the top of the method. + val branchIndex = (literalIndex downTo 0).first { i -> + instructions[i].opcode == Opcode.IF_EQZ || instructions[i].opcode == Opcode.IF_NEZ + } + val gateReg = (instructions[branchIndex] as OneRegisterInstruction).registerA + + // Force the gate to always take the "ineligible" branch, regardless of + // whether the compiler emitted IF_EQZ or IF_NEZ for this check. + val forceValue = if (instructions[branchIndex].opcode == Opcode.IF_EQZ) "0x0" else "0x1" - // const/16, not const/4: const/4's literal is a signed 4-bit value - // (range -8..7), and View.GONE = 8 overflows that by exactly one. - // Using const/4 here compiles to invalid smali and fails silently - // downstream as "Collection is empty" during instruction assembly. - it.method.addInstructions( - setVisibilityMatch.index, - "const/16 v$visibilityArgRegister, 0x8", // View.GONE - ) + method.addInstructions(branchIndex, "const/4 v$gateReg, $forceValue") } } } diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt index 2b2b661..dba1e4a 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt @@ -9,9 +9,7 @@ private val COMPAT = Compatibility( name = "Kleinanzeigen", packageName = "com.ebay.kleinanzeigen", appIconColor = 0x2EAD33, - targets = listOf( - AppTarget(version = "2026.30.0"), - ), + targets = listOf(AppTarget(version = "2026.36.0")), ) @Suppress("unused") From 2c9cdebb42f2d47e210e97ace854c1a4ce299a5d Mon Sep 17 00:00:00 2001 From: plant-saver3000 <309372019+plant-saver3000@users.noreply.github.com> Date: Thu, 10 Sep 2026 18:58:20 +0200 Subject: [PATCH 3/9] Support Kleinanzeigen 2026.37.1; Tested against new version --- .../app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt | 2 +- .../app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt | 2 +- .../kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt | 2 +- versions.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt index 1702cce..b0277c6 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt @@ -9,7 +9,7 @@ private val COMPAT = Compatibility( name = "Kleinanzeigen", packageName = "com.ebay.kleinanzeigen", appIconColor = 0x2EAD33, - targets = listOf(AppTarget(version = "2026.36.0")), + targets = listOf(AppTarget(version = "2026.37.1")), ) @Suppress("unused") diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt index c2895e3..74ecb8c 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt @@ -12,7 +12,7 @@ private val COMPAT = Compatibility( name = "Kleinanzeigen", packageName = "com.ebay.kleinanzeigen", appIconColor = 0x2EAD33, - targets = listOf(AppTarget(version = "2026.36.0")), + targets = listOf(AppTarget(version = "2026.37.1")), ) @Suppress("unused") diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt index dba1e4a..3c3c80f 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt @@ -9,7 +9,7 @@ private val COMPAT = Compatibility( name = "Kleinanzeigen", packageName = "com.ebay.kleinanzeigen", appIconColor = 0x2EAD33, - targets = listOf(AppTarget(version = "2026.36.0")), + targets = listOf(AppTarget(version = "2026.37.1")), ) @Suppress("unused") diff --git a/versions.json b/versions.json index 1932845..074c7c8 100644 --- a/versions.json +++ b/versions.json @@ -1,4 +1,4 @@ { "googleNews": "5.163.0.947799485", - "kleinanzeigen": "2026.30.0" + "kleinanzeigen": "2026.37.1" } From 98054d48be1bef8df4c299dcb277353dec8373e5 Mon Sep 17 00:00:00 2001 From: plant-saver3000 <309372019+plant-saver3000@users.noreply.github.com> Date: Thu, 17 Sep 2026 02:03:24 +0200 Subject: [PATCH 4/9] feat(kleinanzeigen): Bump version to 2026.38.3 --- .../app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt | 2 +- .../app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt | 2 +- .../kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt | 2 +- versions.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt index b0277c6..4096c38 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt @@ -9,7 +9,7 @@ private val COMPAT = Compatibility( name = "Kleinanzeigen", packageName = "com.ebay.kleinanzeigen", appIconColor = 0x2EAD33, - targets = listOf(AppTarget(version = "2026.37.1")), + targets = listOf(AppTarget(version = "2026.38.3")), ) @Suppress("unused") diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt index 74ecb8c..052bb1e 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt @@ -12,7 +12,7 @@ private val COMPAT = Compatibility( name = "Kleinanzeigen", packageName = "com.ebay.kleinanzeigen", appIconColor = 0x2EAD33, - targets = listOf(AppTarget(version = "2026.37.1")), + targets = listOf(AppTarget(version = "2026.38.3")), ) @Suppress("unused") diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt index 3c3c80f..5667bd5 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt @@ -9,7 +9,7 @@ private val COMPAT = Compatibility( name = "Kleinanzeigen", packageName = "com.ebay.kleinanzeigen", appIconColor = 0x2EAD33, - targets = listOf(AppTarget(version = "2026.37.1")), + targets = listOf(AppTarget(version = "2026.38.3")), ) @Suppress("unused") diff --git a/versions.json b/versions.json index 074c7c8..fdce6fc 100644 --- a/versions.json +++ b/versions.json @@ -1,4 +1,4 @@ { "googleNews": "5.163.0.947799485", - "kleinanzeigen": "2026.37.1" + "kleinanzeigen": "2026.38.3" } From a9a91231d6e26c770742c456702cb150fa533d4f Mon Sep 17 00:00:00 2001 From: plant-saver3000 <309372019+plant-saver3000@users.noreply.github.com> Date: Sat, 19 Sep 2026 00:46:57 +0200 Subject: [PATCH 5/9] fix(kleinanzeigen): fix hide ads and hide Pur for V2026.38.3 --- .../docbt/patched_up/kleinanzeigen/ads/Fingerprints.kt | 9 +++++---- .../docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt | 9 ++++++--- .../patched_up/kleinanzeigen/hidepur/Fingerprints.kt | 6 +++--- .../patched_up/kleinanzeigen/hidepur/HidePurPatch.kt | 4 +++- .../sharetracking/RemoveTrackingParamsPatch.kt | 4 +++- 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/Fingerprints.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/Fingerprints.kt index b54a42d..d6f4119 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/Fingerprints.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/Fingerprints.kt @@ -3,9 +3,10 @@ package app.docbt.patched_up.kleinanzeigen.ads import app.morphe.patcher.Fingerprint // Liberty init method: initializes the ad/analytics SDK (Liberty SDK). -// "KEY_LIBERTY_REFRESH_INTERVAL" is a stable string inside the init method -// across versions: 2026.9.0 (KaLibertyConfig.initLiberty) and 2026.12.0 (liberty_config/a.c). -// The classDef.type.contains("/Liberty;") approach broke in 2026.12.0 due to obfuscation. +// "https://prebid-server.rubiconproject.com/openrtb2/auction" is a stable string inside the setup method +// across versions. Restricting to `returnType == "V"` (void) ensures we target the main +// initializer execution method rather than a configuration factory or getter. internal object LibertyInitFingerprint : Fingerprint( - strings = listOf("KEY_LIBERTY_REFRESH_INTERVAL"), + strings = listOf("https://prebid-server.rubiconproject.com/openrtb2/auction"), + custom = { method, _ -> method.returnType == "V" }, ) diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt index 4096c38..2713b4b 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt @@ -9,7 +9,9 @@ private val COMPAT = Compatibility( name = "Kleinanzeigen", packageName = "com.ebay.kleinanzeigen", appIconColor = 0x2EAD33, - targets = listOf(AppTarget(version = "2026.38.3")), + targets = listOf( + AppTarget(version = "2026.38.3"), + ), ) @Suppress("unused") @@ -20,8 +22,9 @@ val hideAdsPatch = bytecodePatch( compatibleWith(COMPAT) execute { - // Liberty init method initializes the ad/analytics SDK. - // Returning early before execution prevents all ads and analytics from loading. + // Liberty setup method initializes ad/analytics SDKs. + // Inserting a return-void instruction at index 0 exits the method early before any SDKs are configured, + // preventing all ads and analytics from loading. LibertyInitFingerprint.method.addInstruction(0, "return-void") } } diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/Fingerprints.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/Fingerprints.kt index 183ee55..a47396c 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/Fingerprints.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/Fingerprints.kt @@ -4,11 +4,11 @@ import app.morphe.patcher.Fingerprint import app.morphe.patches.all.misc.resources.ResourceType import app.morphe.patches.all.misc.resources.resourceLiteral -// Anchors on the ka_gbl_pur string resource to locate the eligibility check -// that gates whether Pur is added to the Compose settings list. No class -// constraint: the containing class is an R8-merged utility with no stable name. +// Anchors on both Pur title and subtitle resource IDs to reliably locate +// the settings list builder method across R8 refactoring passes. internal object HidePurEligibilityFingerprint : Fingerprint( filters = listOf( resourceLiteral(ResourceType.STRING, "ka_gbl_pur"), + resourceLiteral(ResourceType.STRING, "ka_settings_v2_top_ad_free_subscription_pur_subtitle"), ), ) diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt index 052bb1e..b27e06a 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt @@ -12,7 +12,9 @@ private val COMPAT = Compatibility( name = "Kleinanzeigen", packageName = "com.ebay.kleinanzeigen", appIconColor = 0x2EAD33, - targets = listOf(AppTarget(version = "2026.38.3")), + targets = listOf( + AppTarget(version = "2026.38.3"), + ), ) @Suppress("unused") diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt index 5667bd5..42653c4 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt @@ -9,7 +9,9 @@ private val COMPAT = Compatibility( name = "Kleinanzeigen", packageName = "com.ebay.kleinanzeigen", appIconColor = 0x2EAD33, - targets = listOf(AppTarget(version = "2026.38.3")), + targets = listOf( + AppTarget(version = "2026.38.3"), + ), ) @Suppress("unused") From e0e1b4b490101822584c157c1610ad1880912e72 Mon Sep 17 00:00:00 2001 From: plant-saver3000 <309372019+plant-saver3000@users.noreply.github.com> Date: Thu, 24 Sep 2026 23:52:13 +0200 Subject: [PATCH 6/9] feat(kleinanzeigen): Support version 2026.39.0 --- .../app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt | 2 +- .../app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt | 2 +- .../kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt | 2 +- versions.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt index 2713b4b..5d9a193 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt @@ -10,7 +10,7 @@ private val COMPAT = Compatibility( packageName = "com.ebay.kleinanzeigen", appIconColor = 0x2EAD33, targets = listOf( - AppTarget(version = "2026.38.3"), + AppTarget(version = "2026.39.0"), ), ) diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt index b27e06a..09c13ed 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt @@ -13,7 +13,7 @@ private val COMPAT = Compatibility( packageName = "com.ebay.kleinanzeigen", appIconColor = 0x2EAD33, targets = listOf( - AppTarget(version = "2026.38.3"), + AppTarget(version = "2026.39.0"), ), ) diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt index 42653c4..3ff5538 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt @@ -10,7 +10,7 @@ private val COMPAT = Compatibility( packageName = "com.ebay.kleinanzeigen", appIconColor = 0x2EAD33, targets = listOf( - AppTarget(version = "2026.38.3"), + AppTarget(version = "2026.39.0"), ), ) diff --git a/versions.json b/versions.json index fdce6fc..f8e2533 100644 --- a/versions.json +++ b/versions.json @@ -1,4 +1,4 @@ { "googleNews": "5.163.0.947799485", - "kleinanzeigen": "2026.38.3" + "kleinanzeigen": "2026.39.0" } From d456af1f52ffb39e9c3a42562d8fc7785bacf9d7 Mon Sep 17 00:00:00 2001 From: plant-saver3000 <309372019+plant-saver3000@users.noreply.github.com> Date: Sat, 3 Oct 2026 01:32:18 +0200 Subject: [PATCH 7/9] feat(kleinanzeigen): Support version 2026.40.1 --- .../app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt | 2 +- .../app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt | 2 +- .../kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt | 2 +- versions.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt index 5d9a193..28b31cc 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt @@ -10,7 +10,7 @@ private val COMPAT = Compatibility( packageName = "com.ebay.kleinanzeigen", appIconColor = 0x2EAD33, targets = listOf( - AppTarget(version = "2026.39.0"), + AppTarget(version = "2026.40.1"), ), ) diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt index 09c13ed..d560a4e 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt @@ -13,7 +13,7 @@ private val COMPAT = Compatibility( packageName = "com.ebay.kleinanzeigen", appIconColor = 0x2EAD33, targets = listOf( - AppTarget(version = "2026.39.0"), + AppTarget(version = "2026.40.1"), ), ) diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt index 3ff5538..8a7c01b 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt @@ -10,7 +10,7 @@ private val COMPAT = Compatibility( packageName = "com.ebay.kleinanzeigen", appIconColor = 0x2EAD33, targets = listOf( - AppTarget(version = "2026.39.0"), + AppTarget(version = "2026.40.1"), ), ) diff --git a/versions.json b/versions.json index f8e2533..f7fcaf6 100644 --- a/versions.json +++ b/versions.json @@ -1,4 +1,4 @@ { "googleNews": "5.163.0.947799485", - "kleinanzeigen": "2026.39.0" + "kleinanzeigen": "2026.40.1" } From c66a32fbb8a3783054028ffecdae0d5f85307b51 Mon Sep 17 00:00:00 2001 From: plant-saver3000 <309372019+plant-saver3000@users.noreply.github.com> Date: Thu, 8 Oct 2026 22:20:48 +0200 Subject: [PATCH 8/9] feat(kleinanzeigen): Support version 2026.41.0 --- .../app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt | 2 +- .../app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt | 2 +- .../kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt | 2 +- versions.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt index 28b31cc..5d0fcb0 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt @@ -10,7 +10,7 @@ private val COMPAT = Compatibility( packageName = "com.ebay.kleinanzeigen", appIconColor = 0x2EAD33, targets = listOf( - AppTarget(version = "2026.40.1"), + AppTarget(version = "2026.41.0"), ), ) diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt index d560a4e..3dbb388 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt @@ -13,7 +13,7 @@ private val COMPAT = Compatibility( packageName = "com.ebay.kleinanzeigen", appIconColor = 0x2EAD33, targets = listOf( - AppTarget(version = "2026.40.1"), + AppTarget(version = "2026.41.0"), ), ) diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt index 8a7c01b..40ad459 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt @@ -10,7 +10,7 @@ private val COMPAT = Compatibility( packageName = "com.ebay.kleinanzeigen", appIconColor = 0x2EAD33, targets = listOf( - AppTarget(version = "2026.40.1"), + AppTarget(version = "2026.41.0"), ), ) diff --git a/versions.json b/versions.json index f7fcaf6..b401020 100644 --- a/versions.json +++ b/versions.json @@ -1,4 +1,4 @@ { "googleNews": "5.163.0.947799485", - "kleinanzeigen": "2026.40.1" + "kleinanzeigen": "2026.41.0" } From c1916bff0092f2132ade55bc36f0365945a1598a Mon Sep 17 00:00:00 2001 From: plant-saver3000 <309372019+plant-saver3000@users.noreply.github.com> Date: Sat, 21 Nov 2026 00:39:40 +0100 Subject: [PATCH 9/9] feat(kleinanzeigen): Support version 2026.47.1 fix(kleinanzeigen): Remove tracking parameters for version 2026.47.1 --- .../kleinanzeigen/ads/HideAdsPatch.kt | 2 +- .../kleinanzeigen/hidepur/HidePurPatch.kt | 2 +- .../sharetracking/Fingerprints.kt | 78 ++++++++++++------- .../RemoveTrackingParamsPatch.kt | 6 +- versions.json | 2 +- 5 files changed, 56 insertions(+), 34 deletions(-) diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt index 5d0fcb0..8ac0f14 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/ads/HideAdsPatch.kt @@ -10,7 +10,7 @@ private val COMPAT = Compatibility( packageName = "com.ebay.kleinanzeigen", appIconColor = 0x2EAD33, targets = listOf( - AppTarget(version = "2026.41.0"), + AppTarget(version = "2026.47.1"), ), ) diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt index 3dbb388..dfca5f5 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/hidepur/HidePurPatch.kt @@ -13,7 +13,7 @@ private val COMPAT = Compatibility( packageName = "com.ebay.kleinanzeigen", appIconColor = 0x2EAD33, targets = listOf( - AppTarget(version = "2026.41.0"), + AppTarget(version = "2026.47.1"), ), ) diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/Fingerprints.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/Fingerprints.kt index ecd3dea..7536344 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/Fingerprints.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/Fingerprints.kt @@ -3,6 +3,7 @@ package app.docbt.patched_up.kleinanzeigen.sharetracking import app.morphe.patcher.Fingerprint import app.morphe.patcher.patch.PatchException import com.android.tools.smali.dexlib2.iface.ClassDef +import com.android.tools.smali.dexlib2.iface.Method import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction import com.android.tools.smali.dexlib2.iface.reference.StringReference @@ -10,7 +11,12 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference // Using several co-occurring strings instead of just "sharesheet" avoids // false-positive matches against unrelated code elsewhere in the merged // multi-dex APK that might also contain the word "sharesheet" on its own. -private val ANCHOR_STRINGS = setOf("sharesheet", "com.whatsapp", "com.pinterest", "com.facebook.orca") +private val ANCHOR_STRINGS = setOf( + "sharesheet", + "com.whatsapp", + "com.pinterest", + "com.facebook.orca", +) // True if any method in this class references all of ANCHOR_STRINGS // (not necessarily the same method — they live in different switch @@ -28,40 +34,56 @@ private fun ClassDef.containsAnchorStrings(): Boolean { return remaining.isEmpty() } -// e.i(url, source) — appends UTM params to a URL and returns the result. -// Class itself may be merged into an unrelated library namespace (e.g. OkHttp) -// by R8, and its name/package can change between versions — do not lock to type. -// Instead: identify the class via ANCHOR_STRINGS, then require the matched -// method to be the unique (String, String) -> String method in that class. -internal object ShareUrlParamBuilderFingerprint : Fingerprint( - custom = { method, classDef -> - val isRightShape = - method.returnType == "Ljava/lang/String;" && - method.parameterTypes.size == 2 && - method.parameterTypes.all { it.toString() == "Ljava/lang/String;" } +// True if this method references a UTM query parameter string used when +// appending tracking parameters to shared URLs. +// R8 can merge unrelated (String, String) -> String methods (such as URL +// builders for other features) into the same class, so checking for the UTM +// string isolates the method that builds share URLs with tracking parameters. +private fun Method.containsUtmString(): Boolean { + val instructions = implementation?.instructions ?: return false + return instructions.any { instruction -> + val ref = (instruction as? ReferenceInstruction)?.reference as? StringReference + ref?.string?.contains("utm_source=") == true + } +} - if (!isRightShape || !classDef.containsAnchorStrings()) { +// Checks whether a method has the expected (String, String) -> String shape. +private fun Method.hasRightShape(): Boolean = + returnType == "Ljava/lang/String;" && + parameterTypes.size == 2 && + parameterTypes.all { it.toString() == "Ljava/lang/String;" } + +// Matches the method that appends UTM parameters to a share URL and returns +// the resulting URL string. +// Because R8 may merge the class into an unrelated namespace (such as OkHttp) +// and rename classes or methods across versions, names and packages are not +// hardcoded. Instead: +// 1. Identify the containing class via ANCHOR_STRINGS. +// 2. Collect methods in that class with the right signature that also +// reference "utm_source=". +// 3. Require an unambiguous single match so R8-merged helpers with the same +// shape do not cause false positives or silent mis-patching. +internal object ShareUrlParamBuilderFingerprint : Fingerprint( + custom = { targetMethod, classDef -> + if (!targetMethod.hasRightShape() || !classDef.containsAnchorStrings()) { false } else { - val shapeMatches = classDef.methods.filter { m -> - m.returnType == "Ljava/lang/String;" && - m.parameterTypes.size == 2 && - m.parameterTypes.all { it.toString() == "Ljava/lang/String;" } + val matches = classDef.methods.filter { method -> + method.hasRightShape() && method.containsUtmString() } - // The PatchException below is intentional and not just defensive boilerplate: - // if a future app version adds a second (String, String) -> String method to - // this class, we want the build to fail loudly with a clear message, rather - // than silently patching whichever method happens to be listed first — the - // exact class of bug that caused the original Hide Pur regression this patch - // set was built to avoid repeating. - if (shapeMatches.size != 1) { + + // Fail loudly if 0 or more than 1 matching method exists in this class + // so a missing target or an added helper method is never patched silently. + if (matches.size != 1) { throw PatchException( - "Expected exactly 1 method matching (String, String) -> String in " + - "${classDef.type}, but found ${shapeMatches.size}" + - if (shapeMatches.isEmpty()) "." else ": ${shapeMatches.joinToString { it.name }}." + "Expected exactly 1 UTM builder matching (String, String) -> String in " + + "${classDef.type}, but found ${matches.size}" + + if (matches.isEmpty()) "." else ": ${matches.joinToString { it.name }}." ) } - true + + // Compare by value, not identity + targetMethod == matches.first() } }, ) diff --git a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt index 40ad459..0f3bc7a 100644 --- a/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt +++ b/patches/src/main/kotlin/app/docbt/patched_up/kleinanzeigen/sharetracking/RemoveTrackingParamsPatch.kt @@ -10,7 +10,7 @@ private val COMPAT = Compatibility( packageName = "com.ebay.kleinanzeigen", appIconColor = 0x2EAD33, targets = listOf( - AppTarget(version = "2026.41.0"), + AppTarget(version = "2026.47.1"), ), ) @@ -22,10 +22,10 @@ val removeTrackingParamsPatch = bytecodePatch( compatibleWith(COMPAT) execute { - // e.i(url, source) appends UTM params to the URL and returns it. + // method(url, source) appends UTM params to the URL and returns it. // Returning p0 (the first argument = the original URL) immediately // skips the UTM construction entirely. - // This covers both ad sharing (called from e.h()) and store sharing (direct call). + // This covers both ad sharing and store sharing (direct call). ShareUrlParamBuilderFingerprint.method.addInstruction(0, "return-object p0") } } diff --git a/versions.json b/versions.json index b401020..6e14e5b 100644 --- a/versions.json +++ b/versions.json @@ -1,4 +1,4 @@ { "googleNews": "5.163.0.947799485", - "kleinanzeigen": "2026.41.0" + "kleinanzeigen": "2026.47.1" }