Skip to content

Commit

Permalink
feat: fix-metanav-scaling patch (#831)
Browse files Browse the repository at this point in the history
  • Loading branch information
Caroline Joy Bell committed Oct 25, 2022
1 parent ea1f86d commit 24e0146
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package app.revanced.patches.metanav.scaling.annotations

import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package

@Compatibility([Package("com.metanav", arrayOf("1.0"))])
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
annotation class FixScalingCompatibility {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package app.revanced.patches.metanav.scaling.patch

import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.metanav.scaling.annotations.FixScalingCompatibility
import org.w3c.dom.Element

/**
* Fixes the scaling in the Metaverse Navigator app for Persona 5, aka "metaNav"
*
* @author halotroop2288
*/
@Patch
@Name("fix-metanav-scaling")
@Description("Scales the content properly.")
@FixScalingCompatibility
@Version("0.0.1")
class FixScalingPatch : ResourcePatch {
override fun execute(context: ResourceContext): PatchResult {
context.xmlEditor["assets/startScreenCanvas.html"].use { editor ->
val svgNode = editor
.file
.getElementsByTagName("svg")
.item(0) as Element

svgNode.setAttribute("height", "750")
}

return PatchResultSuccess()
}
}

0 comments on commit 24e0146

Please sign in to comment.