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) it.file.firstChild.appendChild(settingsElement)
} }
val settings_fragment = data.get("res/xml/settings_fragment.xml") val settingsFragment = data["res/xml/settings_fragment.xml"]
val text = settings_fragment.readText() settingsFragment.writeText(
settings_fragment.writeText( settingsFragment.readText().replace(
text.replace("android:targetPackage=\"com.google.android.youtube", "android:targetPackage=\"$REVANCED_PACKAGE_NAME") "android:targetPackage=\"com.google.android.youtube",
"android:targetPackage=\"$REVANCED_PACKAGE_NAME"
)
) )
val manifest = data.get("AndroidManifest.xml").readText() val manifest = data["AndroidManifest.xml"]
manifest.writeText(
data.get("AndroidManifest.xml").writeText( manifest.readText()
manifest.replace( .replace(
"package=\"com.google.android.youtube", "package=\"$REVANCED_PACKAGE_NAME" "package=\"com.google.android.youtube", "package=\"$REVANCED_PACKAGE_NAME"
).replace( ).replace(
"android:label=\"@string/application_name", "android:label=\"$REVANCED_APP_NAME" "android:label=\"@string/application_name", "android:label=\"$REVANCED_APP_NAME"