fix: some more refactoring of integrations, add hide-watermark patch (#63)

* refactor: integrations

* add HideWatermark patch

* add hidewatermark patch

* fix bug

* use latest patcher version

* Fix sig name

* update to fingerprints

* make cleaner patch

* add 17.24.35 support for hide-watermark
This commit is contained in:
Joey Peter
2022-06-27 22:09:17 +02:00
committed by GitHub
parent a7ee89d497
commit feb09c56f4
6 changed files with 110 additions and 3 deletions

View File

@ -28,7 +28,7 @@ class IntegrationsPatch : BytecodePatch(
)
) {
override fun execute(data: BytecodeData): PatchResult {
if (data.findClass("Lapp/revanced/integrations/utils/Globals") == null)
if (data.findClass("Lapp/revanced/integrations/utils/ReVancedUtils") == null)
return PatchResultError("Integrations have not been merged yet. This patch can not succeed without the integrations.")
val result = InitFingerprint.result!!
@ -40,7 +40,7 @@ class IntegrationsPatch : BytecodePatch(
method.addInstructions(
0, """
invoke-static {v$count}, Lapp/revanced/integrations/sponsorblock/StringRef;->setContext(Landroid/content/Context;)V
sput-object v$count, Lapp/revanced/integrations/utils/Globals;->context:Landroid/content/Context;
sput-object v$count, Lapp/revanced/integrations/utils/ReVancedUtils;->context:Landroid/content/Context;
"""
)
@ -56,7 +56,7 @@ class IntegrationsPatch : BytecodePatch(
null,
ImmutableMethodImplementation(
1, """
invoke-static { }, Lapp/revanced/integrations/utils/Globals;->getAppContext()Landroid/content/Context;
invoke-static { }, Lapp/revanced/integrations/utils/ReVancedUtils;->getAppContext()Landroid/content/Context;
move-result-object v0
return-object v0
""".toInstructions(), null, null