mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-09 02:54:37 +02:00
fix(GmsCore support): Patched apps are not added to Cloud Messaging https://github.com/inotia00/ReVanced_Extended/issues/2691
This commit is contained in:
parent
0fb493410e
commit
297dd62a1f
@ -109,16 +109,6 @@ public class SpoofStreamingDataPatch {
|
||||
return SPOOF_STREAMING_DATA;
|
||||
}
|
||||
|
||||
/**
|
||||
* Injection point.
|
||||
*/
|
||||
public static Object isSpoofingEnabled(Object original) {
|
||||
if (!SPOOF_STREAMING_DATA) {
|
||||
return original;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Injection point.
|
||||
* This method is only invoked when playing a livestream on an iOS client.
|
||||
|
@ -14,14 +14,11 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMu
|
||||
import app.revanced.patches.shared.extension.Constants.SPOOF_PATH
|
||||
import app.revanced.patches.shared.formatStreamModelConstructorFingerprint
|
||||
import app.revanced.util.findInstructionIndicesReversedOrThrow
|
||||
import app.revanced.util.findMethodOrThrow
|
||||
import app.revanced.util.fingerprint.definingClassOrThrow
|
||||
import app.revanced.util.fingerprint.injectLiteralInstructionBooleanCall
|
||||
import app.revanced.util.fingerprint.matchOrThrow
|
||||
import app.revanced.util.fingerprint.methodOrThrow
|
||||
import app.revanced.util.fingerprint.mutableClassOrThrow
|
||||
import app.revanced.util.getReference
|
||||
import app.revanced.util.getWalkerMethod
|
||||
import app.revanced.util.indexOfFirstInstructionOrThrow
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
@ -370,35 +367,4 @@ fun baseSpoofStreamingDataPatch(
|
||||
executeBlock()
|
||||
|
||||
}
|
||||
|
||||
finalize {
|
||||
gmsServiceBrokerFingerprint.methodOrThrow()
|
||||
.addInstructionsWithLabels(
|
||||
0, """
|
||||
invoke-static {}, $EXTENSION_CLASS_DESCRIPTOR->isSpoofingEnabled()Z
|
||||
move-result v0
|
||||
if-eqz v0, :ignore
|
||||
return-void
|
||||
:ignore
|
||||
nop
|
||||
"""
|
||||
)
|
||||
|
||||
gmsServiceBrokerExceptionFingerprint.matchOrThrow().let {
|
||||
val walkerIndex = it.patternMatch!!.startIndex
|
||||
val walkerMethod = it.getWalkerMethod(walkerIndex)
|
||||
|
||||
walkerMethod.apply {
|
||||
val insertIndex = indexOfFirstInstructionOrThrow(Opcode.CHECK_CAST)
|
||||
val insertRegister = getInstruction<OneRegisterInstruction>(insertIndex).registerA
|
||||
|
||||
addInstructions(
|
||||
insertIndex + 1, """
|
||||
invoke-static {v$insertRegister}, $EXTENSION_CLASS_DESCRIPTOR->isSpoofingEnabled(Ljava/lang/Object;)Ljava/lang/Object;
|
||||
move-result-object v$insertRegister
|
||||
"""
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -198,20 +198,4 @@ internal val hlsCurrentTimeFingerprint = legacyFingerprint(
|
||||
literals = listOf(HLS_CURRENT_TIME_FEATURE_FLAG),
|
||||
)
|
||||
|
||||
internal val gmsServiceBrokerFingerprint = legacyFingerprint(
|
||||
name = "gmsServiceBrokerFingerprint",
|
||||
returnType = "V",
|
||||
strings = listOf("mServiceBroker is null, client disconnected")
|
||||
)
|
||||
|
||||
internal val gmsServiceBrokerExceptionFingerprint = legacyFingerprint(
|
||||
name = "gmsServiceBrokerExceptionFingerprint",
|
||||
returnType = "V",
|
||||
parameters = listOf("Ljava/lang/Exception;"),
|
||||
opcodes = listOf(
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.RETURN_VOID
|
||||
),
|
||||
strings = listOf("Exception must not be null")
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user