generated from ReVanced/revanced-patches-template
-
-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat:
fix-metanav-scaling
patch (#831)
- Loading branch information
Caroline Joy Bell
committed
Oct 25, 2022
1 parent
ea1f86d
commit 24e0146
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
src/main/kotlin/app/revanced/patches/metanav/scaling/annotations/FixScalingCompatibility.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { | ||
} |
37 changes: 37 additions & 0 deletions
37
src/main/kotlin/app/revanced/patches/metanav/scaling/patch/FixScalingPatch.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} | ||
} |