refactor: cleanup MicroGResourcePatch.kt
This commit is contained in:
parent
125bfd294c
commit
e58b96a6f4
|
@ -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"
|
||||||
|
|
Loading…
Reference in a new issue