mirror of
https://github.com/revanced/revanced-patches
synced 2024-12-04 19:02:54 +01:00
fix(YouTube - GmsCore support): Check for availability earlier to prevent crashing without any notice
This commit is contained in:
parent
b288e45021
commit
dab8900e22
@ -1423,6 +1423,10 @@ public final class app/revanced/patches/youtube/misc/gms/GmsCoreSupportResourceP
|
|||||||
public fun execute (Lapp/revanced/patcher/data/ResourceContext;)V
|
public fun execute (Lapp/revanced/patcher/data/ResourceContext;)V
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final class app/revanced/patches/youtube/misc/gms/fingerprints/HomeActivityFingerprint : app/revanced/patches/shared/integrations/AbstractIntegrationsPatch$IntegrationsFingerprint {
|
||||||
|
public static final field INSTANCE Lapp/revanced/patches/youtube/misc/gms/fingerprints/HomeActivityFingerprint;
|
||||||
|
}
|
||||||
|
|
||||||
public final class app/revanced/patches/youtube/misc/integrations/IntegrationsPatch : app/revanced/patches/shared/integrations/AbstractIntegrationsPatch {
|
public final class app/revanced/patches/youtube/misc/integrations/IntegrationsPatch : app/revanced/patches/shared/integrations/AbstractIntegrationsPatch {
|
||||||
public static final field INSTANCE Lapp/revanced/patches/youtube/misc/integrations/IntegrationsPatch;
|
public static final field INSTANCE Lapp/revanced/patches/youtube/misc/integrations/IntegrationsPatch;
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,6 @@ import app.revanced.patches.youtube.misc.gms.Constants.REVANCED_YOUTUBE_PACKAGE_
|
|||||||
import app.revanced.patches.youtube.misc.gms.Constants.YOUTUBE_PACKAGE_NAME
|
import app.revanced.patches.youtube.misc.gms.Constants.YOUTUBE_PACKAGE_NAME
|
||||||
import app.revanced.patches.youtube.misc.gms.GmsCoreSupportResourcePatch.gmsCoreVendorOption
|
import app.revanced.patches.youtube.misc.gms.GmsCoreSupportResourcePatch.gmsCoreVendorOption
|
||||||
import app.revanced.patches.youtube.misc.gms.fingerprints.*
|
import app.revanced.patches.youtube.misc.gms.fingerprints.*
|
||||||
import app.revanced.patches.youtube.shared.fingerprints.WatchWhileActivityFingerprint
|
|
||||||
import app.revanced.util.exception
|
import app.revanced.util.exception
|
||||||
|
|
||||||
|
|
||||||
@ -50,17 +49,17 @@ object GmsCoreSupportPatch : AbstractGmsCoreSupportPatch(
|
|||||||
CastDynamiteModuleV2Fingerprint,
|
CastDynamiteModuleV2Fingerprint,
|
||||||
CastContextFetchFingerprint,
|
CastContextFetchFingerprint,
|
||||||
PrimeMethodFingerprint,
|
PrimeMethodFingerprint,
|
||||||
WatchWhileActivityFingerprint
|
HomeActivityFingerprint,
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override val gmsCoreVendor by gmsCoreVendorOption
|
override val gmsCoreVendor by gmsCoreVendorOption
|
||||||
|
|
||||||
override fun execute(context: BytecodeContext) {
|
override fun execute(context: BytecodeContext) {
|
||||||
// Check the availability of GmsCore.
|
// Check the availability of GmsCore.
|
||||||
WatchWhileActivityFingerprint.result?.mutableMethod?.addInstruction(
|
HomeActivityFingerprint.result?.mutableMethod?.addInstruction(
|
||||||
0,
|
0,
|
||||||
"invoke-static {}, Lapp/revanced/integrations/patches/GmsCoreSupport;->checkAvailability()V"
|
"invoke-static {}, Lapp/revanced/integrations/patches/GmsCoreSupport;->checkAvailability()V"
|
||||||
) ?: throw WatchWhileActivityFingerprint.exception
|
) ?: throw HomeActivityFingerprint.exception
|
||||||
|
|
||||||
super.execute(context)
|
super.execute(context)
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.gms.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patches.shared.integrations.AbstractIntegrationsPatch.IntegrationsFingerprint
|
||||||
|
|
||||||
|
object HomeActivityFingerprint : IntegrationsFingerprint(
|
||||||
|
customFingerprint = { methodDef, classDef ->
|
||||||
|
methodDef.name == "onCreate" && classDef.type.endsWith("Shell_HomeActivity;")
|
||||||
|
},
|
||||||
|
)
|
@ -16,4 +16,4 @@ object IntegrationsPatch : AbstractIntegrationsPatch(
|
|||||||
EmbeddedPlayerFingerprint,
|
EmbeddedPlayerFingerprint,
|
||||||
APIPlayerServiceFingerprint,
|
APIPlayerServiceFingerprint,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user