feat(Android Widgets (Material U)): Remove Unlock paid widgets patch (#3286)

This commit is contained in:
1fexd 2023-11-17 20:41:45 +01:00 committed by GitHub
parent 1f6951c0e0
commit b44da1c701
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 0 additions and 84 deletions

View file

@ -1,52 +0,0 @@
package app.revanced.patches.twelvewidgets.unlock
import app.revanced.extensions.exception
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.removeInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patches.twelvewidgets.unlock.fingerprints.*
@Patch(
name = "Unlock paid widgets",
description = "Unlocks paid widgets of the app",
compatiblePackages = [CompatiblePackage("com.dci.dev.androidtwelvewidgets")]
)
@Suppress("unused")
object UnlockPaidWidgetsPatch : BytecodePatch(
setOf(
AgendaDaysWidgetUnlockFingerprint,
CalendarBigWidgetUnlockFingerprint,
CalendarWideDayEventsWidgetUnlockFingerprint,
CalendarWideTimelineWidgetUnlockFingerprint,
ScreentimeSmallWidgetUnlockFingerprint,
WeatherWidgetUnlockFingerprint
)
) {
override fun execute(context: BytecodeContext) {
listOf(
AgendaDaysWidgetUnlockFingerprint,
CalendarBigWidgetUnlockFingerprint,
CalendarWideDayEventsWidgetUnlockFingerprint,
CalendarWideTimelineWidgetUnlockFingerprint,
ScreentimeSmallWidgetUnlockFingerprint,
WeatherWidgetUnlockFingerprint
).map { fingerprint ->
fingerprint.result?.mutableMethod ?: throw fingerprint.exception
}.forEach { method ->
method.apply {
removeInstructions(4, 3)
addInstructions(
implementation?.instructions?.size!!,
"""
const/4 v1, 0x0
invoke-virtual {v0, v1}, Landroid/view/View;->setVisibility(I)V
return-object v0
"""
)
}
}
}
}

View file

@ -1,3 +0,0 @@
package app.revanced.patches.twelvewidgets.unlock.fingerprints
object AgendaDaysWidgetUnlockFingerprint : MethodUnlockFingerprint("AgendaDaysWidgetConfigureActivity")

View file

@ -1,3 +0,0 @@
package app.revanced.patches.twelvewidgets.unlock.fingerprints
object CalendarBigWidgetUnlockFingerprint : MethodUnlockFingerprint("CalendarBigWidgetConfigureActivity")

View file

@ -1,4 +0,0 @@
package app.revanced.patches.twelvewidgets.unlock.fingerprints
object CalendarWideDayEventsWidgetUnlockFingerprint :
MethodUnlockFingerprint("CalendarWideDayEventsWidgetConfigureActivity")

View file

@ -1,4 +0,0 @@
package app.revanced.patches.twelvewidgets.unlock.fingerprints
object CalendarWideTimelineWidgetUnlockFingerprint :
MethodUnlockFingerprint("CalendarWideTimelineWidgetConfigureActivity")

View file

@ -1,12 +0,0 @@
package app.revanced.patches.twelvewidgets.unlock.fingerprints
import app.revanced.patcher.fingerprint.MethodFingerprint
abstract class MethodUnlockFingerprint(private val className: String) : MethodFingerprint(
"L",
strings = listOf("binding.addButton"),
customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/$className;")
}
)

View file

@ -1,3 +0,0 @@
package app.revanced.patches.twelvewidgets.unlock.fingerprints
object ScreentimeSmallWidgetUnlockFingerprint : MethodUnlockFingerprint("ScreentimeSmallWidgetConfigureActivity")

View file

@ -1,3 +0,0 @@
package app.revanced.patches.twelvewidgets.unlock.fingerprints
object WeatherWidgetUnlockFingerprint : MethodUnlockFingerprint("WeatherWidgetConfigureActivity")