mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-28 21:00:19 +02:00
chore: lint code
This commit is contained in:
parent
4fff1ca4cb
commit
db3d1c5740
@ -125,7 +125,8 @@ object DownloadActionsPatch : BaseBytecodePatch(
|
|||||||
reference?.definingClass == OFFLINE_PLAYLIST_ENDPOINT_OUTER_CLASS_DESCRIPTOR &&
|
reference?.definingClass == OFFLINE_PLAYLIST_ENDPOINT_OUTER_CLASS_DESCRIPTOR &&
|
||||||
reference.type == "Ljava/lang/String;"
|
reference.type == "Ljava/lang/String;"
|
||||||
}
|
}
|
||||||
val playlistIdReference = getInstruction<ReferenceInstruction>(playlistIdIndex).reference
|
val playlistIdReference =
|
||||||
|
getInstruction<ReferenceInstruction>(playlistIdIndex).reference
|
||||||
|
|
||||||
val targetIndex = indexOfFirstInstructionOrThrow {
|
val targetIndex = indexOfFirstInstructionOrThrow {
|
||||||
opcode == Opcode.CHECK_CAST &&
|
opcode == Opcode.CHECK_CAST &&
|
||||||
@ -134,13 +135,15 @@ object DownloadActionsPatch : BaseBytecodePatch(
|
|||||||
val targetRegister = getInstruction<OneRegisterInstruction>(targetIndex).registerA
|
val targetRegister = getInstruction<OneRegisterInstruction>(targetIndex).registerA
|
||||||
|
|
||||||
addInstructionsWithLabels(
|
addInstructionsWithLabels(
|
||||||
targetIndex + 1, """
|
targetIndex + 1,
|
||||||
|
"""
|
||||||
iget-object v$freeRegister, v$targetRegister, $playlistIdReference
|
iget-object v$freeRegister, v$targetRegister, $playlistIdReference
|
||||||
invoke-static {v$freeRegister}, $INTEGRATIONS_CLASS_DESCRIPTOR->inAppPlaylistDownloadMenuOnClick(Ljava/lang/String;)Z
|
invoke-static {v$freeRegister}, $INTEGRATIONS_CLASS_DESCRIPTOR->inAppPlaylistDownloadMenuOnClick(Ljava/lang/String;)Z
|
||||||
move-result v$freeRegister
|
move-result v$freeRegister
|
||||||
if-eqz v$freeRegister, :show_native_downloader
|
if-eqz v$freeRegister, :show_native_downloader
|
||||||
return-void
|
return-void
|
||||||
""", ExternalLabel("show_native_downloader", getInstruction(targetIndex + 1))
|
""",
|
||||||
|
ExternalLabel("show_native_downloader", getInstruction(targetIndex + 1))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,8 @@ object SpoofStreamingDataPatch : BaseBytecodePatch(
|
|||||||
BuildInitPlaybackRequestFingerprint.resultOrThrow().let {
|
BuildInitPlaybackRequestFingerprint.resultOrThrow().let {
|
||||||
it.mutableMethod.apply {
|
it.mutableMethod.apply {
|
||||||
val moveUriStringIndex = it.scanResult.patternScanResult!!.startIndex
|
val moveUriStringIndex = it.scanResult.patternScanResult!!.startIndex
|
||||||
val targetRegister = getInstruction<OneRegisterInstruction>(moveUriStringIndex).registerA
|
val targetRegister =
|
||||||
|
getInstruction<OneRegisterInstruction>(moveUriStringIndex).registerA
|
||||||
|
|
||||||
addInstructions(
|
addInstructions(
|
||||||
moveUriStringIndex + 1,
|
moveUriStringIndex + 1,
|
||||||
@ -79,8 +80,10 @@ object SpoofStreamingDataPatch : BaseBytecodePatch(
|
|||||||
|
|
||||||
BuildPlayerRequestURIFingerprint.resultOrThrow().let {
|
BuildPlayerRequestURIFingerprint.resultOrThrow().let {
|
||||||
it.mutableMethod.apply {
|
it.mutableMethod.apply {
|
||||||
val invokeToStringIndex = BuildPlayerRequestURIFingerprint.indexOfToStringInstruction(this)
|
val invokeToStringIndex =
|
||||||
val uriRegister = getInstruction<FiveRegisterInstruction>(invokeToStringIndex).registerC
|
BuildPlayerRequestURIFingerprint.indexOfToStringInstruction(this)
|
||||||
|
val uriRegister =
|
||||||
|
getInstruction<FiveRegisterInstruction>(invokeToStringIndex).registerC
|
||||||
|
|
||||||
addInstructions(
|
addInstructions(
|
||||||
invokeToStringIndex,
|
invokeToStringIndex,
|
||||||
@ -100,11 +103,13 @@ object SpoofStreamingDataPatch : BaseBytecodePatch(
|
|||||||
result.mutableMethod.apply {
|
result.mutableMethod.apply {
|
||||||
val buildRequestIndex =
|
val buildRequestIndex =
|
||||||
BuildRequestFingerprint.indexOfBuildUrlRequestInstruction(this)
|
BuildRequestFingerprint.indexOfBuildUrlRequestInstruction(this)
|
||||||
val requestBuilderRegister = getInstruction<FiveRegisterInstruction>(buildRequestIndex).registerC
|
val requestBuilderRegister =
|
||||||
|
getInstruction<FiveRegisterInstruction>(buildRequestIndex).registerC
|
||||||
|
|
||||||
val newRequestBuilderIndex =
|
val newRequestBuilderIndex =
|
||||||
BuildRequestFingerprint.indexOfNewUrlRequestBuilderInstruction(this)
|
BuildRequestFingerprint.indexOfNewUrlRequestBuilderInstruction(this)
|
||||||
val urlRegister = getInstruction<FiveRegisterInstruction>(newRequestBuilderIndex).registerD
|
val urlRegister =
|
||||||
|
getInstruction<FiveRegisterInstruction>(newRequestBuilderIndex).registerD
|
||||||
|
|
||||||
// Replace "requestBuilder.build()" with integrations call.
|
// Replace "requestBuilder.build()" with integrations call.
|
||||||
replaceInstruction(
|
replaceInstruction(
|
||||||
@ -143,10 +148,13 @@ object SpoofStreamingDataPatch : BaseBytecodePatch(
|
|||||||
CreateStreamingDataFingerprint.resultOrThrow().let { result ->
|
CreateStreamingDataFingerprint.resultOrThrow().let { result ->
|
||||||
result.mutableMethod.apply {
|
result.mutableMethod.apply {
|
||||||
val setStreamingDataIndex = result.scanResult.patternScanResult!!.startIndex
|
val setStreamingDataIndex = result.scanResult.patternScanResult!!.startIndex
|
||||||
val setStreamingDataField = getInstruction(setStreamingDataIndex).getReference<FieldReference>().toString()
|
val setStreamingDataField =
|
||||||
|
getInstruction(setStreamingDataIndex).getReference<FieldReference>().toString()
|
||||||
|
|
||||||
val playerProtoClass = getInstruction(setStreamingDataIndex + 1).getReference<FieldReference>()!!.definingClass
|
val playerProtoClass =
|
||||||
val protobufClass = ProtobufClassParseByteBufferFingerprint.resultOrThrow().mutableMethod.definingClass
|
getInstruction(setStreamingDataIndex + 1).getReference<FieldReference>()!!.definingClass
|
||||||
|
val protobufClass =
|
||||||
|
ProtobufClassParseByteBufferFingerprint.resultOrThrow().mutableMethod.definingClass
|
||||||
|
|
||||||
val getStreamingDataField = getInstructions().find { instruction ->
|
val getStreamingDataField = getInstructions().find { instruction ->
|
||||||
instruction.opcode == Opcode.IGET_OBJECT &&
|
instruction.opcode == Opcode.IGET_OBJECT &&
|
||||||
@ -155,10 +163,12 @@ object SpoofStreamingDataPatch : BaseBytecodePatch(
|
|||||||
?: throw PatchException("Could not find getStreamingDataField")
|
?: throw PatchException("Could not find getStreamingDataField")
|
||||||
|
|
||||||
val videoDetailsIndex = result.scanResult.patternScanResult!!.endIndex
|
val videoDetailsIndex = result.scanResult.patternScanResult!!.endIndex
|
||||||
val videoDetailsClass = getInstruction(videoDetailsIndex).getReference<FieldReference>()!!.type
|
val videoDetailsClass =
|
||||||
|
getInstruction(videoDetailsIndex).getReference<FieldReference>()!!.type
|
||||||
|
|
||||||
val insertIndex = videoDetailsIndex + 1
|
val insertIndex = videoDetailsIndex + 1
|
||||||
val videoDetailsRegister = getInstruction<TwoRegisterInstruction>(videoDetailsIndex).registerA
|
val videoDetailsRegister =
|
||||||
|
getInstruction<TwoRegisterInstruction>(videoDetailsIndex).registerA
|
||||||
|
|
||||||
val overrideRegister = getInstruction<TwoRegisterInstruction>(insertIndex).registerA
|
val overrideRegister = getInstruction<TwoRegisterInstruction>(insertIndex).registerA
|
||||||
val freeRegister = implementation!!.registerCount - parameters.size - 2
|
val freeRegister = implementation!!.registerCount - parameters.size - 2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user