mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-12 13:17:46 +02:00
refactor: integrations (#44)
This commit is contained in:
@ -28,7 +28,7 @@ class IntegrationsPatch : BytecodePatch(
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
if (data.findClass("Lapp/revanced/integrations/Globals") == null)
|
||||
if (data.findClass("Lapp/revanced/integrations/utils/Globals") == null)
|
||||
return PatchResultError("Integrations have not been merged yet. This patch can not succeed without the integrations.")
|
||||
|
||||
val result = InitSignature.result!!
|
||||
@ -38,8 +38,8 @@ class IntegrationsPatch : BytecodePatch(
|
||||
|
||||
result.method.addInstructions(
|
||||
result.scanResult.endIndex + 1, """
|
||||
invoke-static {v$count}, Lpl/jakubweg/StringRef;->setContext(Landroid/content/Context;)V
|
||||
sput-object v$count, Lapp/revanced/integrations/Globals;->context:Landroid/content/Context;
|
||||
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;
|
||||
"""
|
||||
)
|
||||
|
||||
@ -55,7 +55,7 @@ class IntegrationsPatch : BytecodePatch(
|
||||
null,
|
||||
ImmutableMethodImplementation(
|
||||
1, """
|
||||
invoke-static { }, Lapp/revanced/integrations/Globals;->getAppContext()Landroid/content/Context;
|
||||
invoke-static { }, Lapp/revanced/integrations/utils/Globals;->getAppContext()Landroid/content/Context;
|
||||
move-result-object v0
|
||||
return-object v0
|
||||
""".trimIndent().toInstructions(), null, null
|
||||
|
Reference in New Issue
Block a user