refactor: cleanup MicroGResourcePatch.kt

This commit is contained in:
Sculas 2022-08-02 20:17:46 +02:00
parent 125bfd294c
commit e58b96a6f4
No known key found for this signature in database
GPG key ID: 1530BFF96D1EEB89

View file

@ -34,16 +34,18 @@ class MicroGResourcePatch : ResourcePatch() {
it.file.firstChild.appendChild(settingsElement)
}
val settings_fragment = data.get("res/xml/settings_fragment.xml")
val text = settings_fragment.readText()
settings_fragment.writeText(
text.replace("android:targetPackage=\"com.google.android.youtube", "android:targetPackage=\"$REVANCED_PACKAGE_NAME")
val settingsFragment = data["res/xml/settings_fragment.xml"]
settingsFragment.writeText(
settingsFragment.readText().replace(
"android:targetPackage=\"com.google.android.youtube",
"android:targetPackage=\"$REVANCED_PACKAGE_NAME"
)
)
val manifest = data.get("AndroidManifest.xml").readText()
data.get("AndroidManifest.xml").writeText(
manifest.replace(
val manifest = data["AndroidManifest.xml"]
manifest.writeText(
manifest.readText()
.replace(
"package=\"com.google.android.youtube", "package=\"$REVANCED_PACKAGE_NAME"
).replace(
"android:label=\"@string/application_name", "android:label=\"$REVANCED_APP_NAME"