mirror of
https://github.com/revanced/revanced-patches
synced 2024-08-31 11:35:34 +02:00
chore: update matching method names for microg
patch
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
parent
32b8ac5fca
commit
159f7f3c3d
@ -21,7 +21,7 @@ import app.revanced.patcher.util.smali.toInstructions
|
||||
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
||||
import app.revanced.patches.youtube.misc.microg.patch.resource.enum.StringReplaceMode
|
||||
import app.revanced.patches.youtube.misc.microg.shared.Constants.BASE_MICROG_PACKAGE_NAME
|
||||
import app.revanced.patches.youtube.misc.microg.shared.Constants.BASE_REVANCED_PACKAGE_NAME
|
||||
import app.revanced.patches.youtube.misc.microg.shared.Constants.REVANCED_PACKAGE_NAME
|
||||
import app.revanced.patches.youtube.misc.microg.signatures.GooglePlayUtilitySignature
|
||||
import app.revanced.patches.youtube.misc.microg.signatures.IntegrityCheckSignature
|
||||
import app.revanced.patches.youtube.misc.microg.signatures.PrimeSignature
|
||||
@ -98,7 +98,7 @@ class MicroGBytecodePatch : BytecodePatch(
|
||||
|
||||
val newString =
|
||||
if (replaceMode == StringReplaceMode.REPLACE_WITH_REVANCED) stringValue.replace(
|
||||
"com.google.android.youtube", BASE_REVANCED_PACKAGE_NAME
|
||||
"com.google.android.youtube", REVANCED_PACKAGE_NAME
|
||||
)
|
||||
else stringValue.replace("com.google", BASE_MICROG_PACKAGE_NAME)
|
||||
|
||||
@ -167,7 +167,7 @@ class MicroGBytecodePatch : BytecodePatch(
|
||||
}
|
||||
|
||||
implementation.replaceInstruction(
|
||||
index, "const-string v$register, \"$BASE_REVANCED_PACKAGE_NAME\"".toInstruction()
|
||||
index, "const-string v$register, \"$REVANCED_PACKAGE_NAME\"".toInstruction()
|
||||
)
|
||||
}
|
||||
}
|
@ -10,34 +10,34 @@ import app.revanced.patcher.patch.implementation.misc.PatchResult
|
||||
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
||||
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
||||
import app.revanced.patches.youtube.misc.microg.shared.Constants.BASE_MICROG_PACKAGE_NAME
|
||||
import app.revanced.patches.youtube.misc.microg.shared.Constants.BASE_REVANCED_PACKAGE_NAME
|
||||
import app.revanced.patches.youtube.misc.microg.shared.Constants.REVANCED_PACKAGE_NAME
|
||||
|
||||
@Patch
|
||||
@Name("microg-bytecode-patch")
|
||||
@Description("Bytecode patch to allow YouTube ReVanced to run without root and under a different package name.")
|
||||
@Name("microg-resource-patch")
|
||||
@Description("Resource patch to allow YouTube ReVanced to run without root and under a different package name.")
|
||||
@MicroGPatchCompatibility
|
||||
@Version("0.0.1")
|
||||
class MicroGResourcePatch : ResourcePatch() {
|
||||
override fun execute(data: ResourceData): PatchResult {
|
||||
data.writer("AndroidManifest.xml").write(
|
||||
data.reader("AndroidManifest.xml").readText().replace(
|
||||
"package=\"com.google.android.youtube\"", "package=\"$BASE_REVANCED_PACKAGE_NAME\""
|
||||
"package=\"com.google.android.youtube\"", "package=\"$REVANCED_PACKAGE_NAME\""
|
||||
).replace(
|
||||
" android:label=\"@string/application_name\" ", " android:label=\"{APP_NAME}\" "
|
||||
).replace(
|
||||
"<uses-permission android:name=\"com.google.android.youtube.permission.C2D_MESSAGE\"",
|
||||
"<uses-permission android:name=\"$BASE_REVANCED_PACKAGE_NAME.permission.C2D_MESSAGE\""
|
||||
"<uses-permission android:name=\"$REVANCED_PACKAGE_NAME.permission.C2D_MESSAGE\""
|
||||
).replace(
|
||||
"<permission android:name=\"com.google.android.youtube.permission.C2D_MESSAGE\"",
|
||||
"<permission android:name=\"$BASE_REVANCED_PACKAGE_NAME.permission.C2D_MESSAGE\""
|
||||
"<permission android:name=\"$REVANCED_PACKAGE_NAME.permission.C2D_MESSAGE\""
|
||||
).replace(
|
||||
"<provider android:authorities=\"com.google.android.youtube.lifecycle-trojan\"",
|
||||
"<provider android:authorities=\"$BASE_REVANCED_PACKAGE_NAME.lifecycle-trojan\""
|
||||
"<provider android:authorities=\"$REVANCED_PACKAGE_NAME.lifecycle-trojan\""
|
||||
).replace(
|
||||
"\"com.google.android.youtube.fileprovider\"", "\"$BASE_REVANCED_PACKAGE_NAME.fileprovider\""
|
||||
"\"com.google.android.youtube.fileprovider\"", "\"$REVANCED_PACKAGE_NAME.fileprovider\""
|
||||
).replace(
|
||||
"<provider android:authorities=\"com.google.android.youtube.photopicker_images\"",
|
||||
"<provider android:authorities=\"$BASE_REVANCED_PACKAGE_NAME.photopicker_images\""
|
||||
"<provider android:authorities=\"$REVANCED_PACKAGE_NAME.photopicker_images\""
|
||||
).replace("com.google.android.c2dm", "$BASE_MICROG_PACKAGE_NAME.android.c2dm").replace(
|
||||
" </queries>",
|
||||
" <package android:name=\"$BASE_MICROG_PACKAGE_NAME.android.gms\"/>\n </queries>"
|
||||
@ -46,10 +46,10 @@ class MicroGResourcePatch : ResourcePatch() {
|
||||
|
||||
val replacement = arrayOf(
|
||||
Pair(
|
||||
"com.google.android.youtube.SuggestionProvider", "$BASE_REVANCED_PACKAGE_NAME.SuggestionProvider"
|
||||
"com.google.android.youtube.SuggestionProvider", "$REVANCED_PACKAGE_NAME.SuggestionProvider"
|
||||
),
|
||||
Pair(
|
||||
"com.google.android.youtube.fileprovider", "$BASE_REVANCED_PACKAGE_NAME.fileprovider"
|
||||
"com.google.android.youtube.fileprovider", "$REVANCED_PACKAGE_NAME.fileprovider"
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -2,5 +2,5 @@ package app.revanced.patches.youtube.misc.microg.shared
|
||||
|
||||
object Constants {
|
||||
internal const val BASE_MICROG_PACKAGE_NAME = "com.mgoogle"
|
||||
internal const val BASE_REVANCED_PACKAGE_NAME = "app.revanced.android.youtube"
|
||||
internal const val REVANCED_PACKAGE_NAME = "app.revanced.android.youtube"
|
||||
}
|
@ -12,7 +12,7 @@ import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("google-play-utility-signature")
|
||||
@MatchingMethod(
|
||||
"Llpe;", "b"
|
||||
"Llss;", "b"
|
||||
)
|
||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||
@MicroGPatchCompatibility
|
||||
|
@ -12,7 +12,7 @@ import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("google-play-sig-check-signature")
|
||||
@MatchingMethod(
|
||||
"Ldsf;", "d"
|
||||
"Ldwn;", "d"
|
||||
)
|
||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||
@MicroGPatchCompatibility
|
||||
|
@ -9,7 +9,7 @@ import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibi
|
||||
|
||||
@Name("google-play-prime-signature")
|
||||
@MatchingMethod(
|
||||
"Louy;", "e"
|
||||
"Lpag;", "d"
|
||||
)
|
||||
@DirectPatternScanMethod
|
||||
@MicroGPatchCompatibility
|
||||
|
@ -12,7 +12,7 @@ import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("google-play-service-checker-signature")
|
||||
@MatchingMethod(
|
||||
"Llpe;", "d"
|
||||
"Llss;", "d"
|
||||
)
|
||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||
@MicroGPatchCompatibility
|
||||
|
Loading…
Reference in New Issue
Block a user