generated from ReVanced/revanced-patches-template
-
-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Allow choosing the vendor of GmsCore via patch options (#3347)
BREAKING CHANGE: Various APIs have been moved to `GmsCoreSupportAbstractPatch`
- Loading branch information
Showing
34 changed files
with
678 additions
and
813 deletions.
There are no files selected for viewing
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
6 changes: 6 additions & 0 deletions
6
src/main/kotlin/app/revanced/patches/music/misc/gms/Constants.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,6 @@ | ||
package app.revanced.patches.music.misc.gms | ||
|
||
object Constants { | ||
internal const val REVANCED_MUSIC_PACKAGE_NAME = "app.revanced.android.apps.youtube.music" | ||
internal const val MUSIC_PACKAGE_NAME = "com.google.android.apps.youtube.music" | ||
} |
34 changes: 34 additions & 0 deletions
34
src/main/kotlin/app/revanced/patches/music/misc/gms/GmsCoreSupportPatch.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,34 @@ | ||
package app.revanced.patches.music.misc.gms | ||
|
||
import app.revanced.patches.music.misc.gms.Constants.MUSIC_PACKAGE_NAME | ||
import app.revanced.patches.music.misc.gms.Constants.REVANCED_MUSIC_PACKAGE_NAME | ||
import app.revanced.patches.music.misc.gms.GmsCoreSupportResourcePatch.gmsCoreVendorOption | ||
import app.revanced.patches.music.misc.gms.fingerprints.* | ||
import app.revanced.patches.shared.misc.gms.AbstractGmsCoreSupportPatch | ||
import app.revanced.patches.youtube.misc.gms.fingerprints.CastContextFetchFingerprint | ||
|
||
@Suppress("unused") | ||
object GmsCoreSupportPatch : AbstractGmsCoreSupportPatch( | ||
fromPackageName = REVANCED_MUSIC_PACKAGE_NAME, | ||
toPackageName = MUSIC_PACKAGE_NAME, | ||
primeMethodFingerprint = PrimeMethodFingerprint, | ||
earlyReturnFingerprints = setOf( | ||
ServiceCheckFingerprint, | ||
GooglePlayUtilityFingerprint, | ||
CastDynamiteModuleFingerprint, | ||
CastDynamiteModuleV2Fingerprint, | ||
CastContextFetchFingerprint, | ||
), | ||
abstractGmsCoreSupportResourcePatch = GmsCoreSupportResourcePatch, | ||
compatiblePackages = setOf(CompatiblePackage("com.google.android.apps.youtube.music")), | ||
fingerprints = setOf( | ||
ServiceCheckFingerprint, | ||
GooglePlayUtilityFingerprint, | ||
CastDynamiteModuleFingerprint, | ||
CastDynamiteModuleV2Fingerprint, | ||
CastContextFetchFingerprint, | ||
PrimeMethodFingerprint, | ||
) | ||
) { | ||
override val gmsCoreVendor by gmsCoreVendorOption | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/kotlin/app/revanced/patches/music/misc/gms/GmsCoreSupportResourcePatch.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,11 @@ | ||
package app.revanced.patches.music.misc.gms | ||
|
||
import app.revanced.patches.music.misc.gms.Constants.MUSIC_PACKAGE_NAME | ||
import app.revanced.patches.music.misc.gms.Constants.REVANCED_MUSIC_PACKAGE_NAME | ||
import app.revanced.patches.shared.misc.gms.AbstractGmsCoreSupportResourcePatch | ||
|
||
object GmsCoreSupportResourcePatch : AbstractGmsCoreSupportResourcePatch( | ||
fromPackageName = MUSIC_PACKAGE_NAME, | ||
toPackageName = REVANCED_MUSIC_PACKAGE_NAME, | ||
spoofedPackageSignature = "afb0fed5eeaebdd86f56a97742f4b6b33ef59875" | ||
) |
2 changes: 1 addition & 1 deletion
2
...erprints/CastDynamiteModuleFingerprint.kt → ...erprints/CastDynamiteModuleFingerprint.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
2 changes: 1 addition & 1 deletion
2
...prints/CastDynamiteModuleV2Fingerprint.kt → ...prints/CastDynamiteModuleV2Fingerprint.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
34 changes: 17 additions & 17 deletions
34
...gerprints/GooglePlayUtilityFingerprint.kt → ...gerprints/GooglePlayUtilityFingerprint.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 |
---|---|---|
@@ -1,18 +1,18 @@ | ||
package app.revanced.patches.music.misc.microg.fingerprints | ||
|
||
import app.revanced.patcher.extensions.or | ||
import app.revanced.patcher.fingerprint.MethodFingerprint | ||
import com.android.tools.smali.dexlib2.AccessFlags | ||
|
||
internal object GooglePlayUtilityFingerprint : MethodFingerprint( | ||
"I", | ||
AccessFlags.PUBLIC or AccessFlags.STATIC, | ||
listOf("L", "I"), | ||
strings = listOf( | ||
"This should never happen.", | ||
"MetadataValueReader", | ||
"GooglePlayServicesUtil", | ||
"com.android.vending", | ||
"android.hardware.type.embedded" | ||
) | ||
package app.revanced.patches.music.misc.gms.fingerprints | ||
|
||
import app.revanced.patcher.extensions.or | ||
import app.revanced.patcher.fingerprint.MethodFingerprint | ||
import com.android.tools.smali.dexlib2.AccessFlags | ||
|
||
internal object GooglePlayUtilityFingerprint : MethodFingerprint( | ||
"I", | ||
AccessFlags.PUBLIC or AccessFlags.STATIC, | ||
listOf("L", "I"), | ||
strings = listOf( | ||
"This should never happen.", | ||
"MetadataValueReader", | ||
"GooglePlayServicesUtil", | ||
"com.android.vending", | ||
"android.hardware.type.embedded" | ||
) | ||
) |
4 changes: 2 additions & 2 deletions
4
...c/microg/fingerprints/PrimeFingerprint.kt → ...ms/fingerprints/PrimeMethodFingerprint.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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
package app.revanced.patches.youtube.misc.microg.fingerprints | ||
package app.revanced.patches.music.misc.gms.fingerprints | ||
|
||
|
||
import app.revanced.patcher.fingerprint.MethodFingerprint | ||
|
||
internal object PrimeFingerprint : MethodFingerprint( | ||
internal object PrimeMethodFingerprint : MethodFingerprint( | ||
strings = listOf("com.google.android.GoogleCamera", "com.android.vending") | ||
) |
29 changes: 14 additions & 15 deletions
29
...g/fingerprints/ServiceCheckFingerprint.kt → ...s/fingerprints/ServiceCheckFingerprint.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 |
---|---|---|
@@ -1,15 +1,14 @@ | ||
package app.revanced.patches.music.misc.microg.fingerprints | ||
|
||
import app.revanced.patcher.extensions.or | ||
import app.revanced.patcher.fingerprint.annotation.FuzzyPatternScanMethod | ||
import app.revanced.patcher.fingerprint.MethodFingerprint | ||
import com.android.tools.smali.dexlib2.AccessFlags | ||
|
||
|
||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value. | ||
internal object ServiceCheckFingerprint : MethodFingerprint( | ||
"V", | ||
AccessFlags.PUBLIC or AccessFlags.STATIC, | ||
listOf("L", "I"), | ||
strings = listOf("Google Play Services not available") | ||
) | ||
package app.revanced.patches.music.misc.gms.fingerprints | ||
|
||
import app.revanced.patcher.extensions.or | ||
import app.revanced.patcher.fingerprint.annotation.FuzzyPatternScanMethod | ||
import app.revanced.patcher.fingerprint.MethodFingerprint | ||
import com.android.tools.smali.dexlib2.AccessFlags | ||
|
||
|
||
internal object ServiceCheckFingerprint : MethodFingerprint( | ||
"V", | ||
AccessFlags.PUBLIC or AccessFlags.STATIC, | ||
listOf("L", "I"), | ||
strings = listOf("Google Play Services not available") | ||
) |
70 changes: 0 additions & 70 deletions
70
src/main/kotlin/app/revanced/patches/music/misc/microg/MicroGBytecodePatch.kt
This file was deleted.
Oops, something went wrong.
40 changes: 0 additions & 40 deletions
40
src/main/kotlin/app/revanced/patches/music/misc/microg/MicroGResourcePatch.kt
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
src/main/kotlin/app/revanced/patches/music/misc/microg/shared/Constants.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.