mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-04-30 06:34:37 +02:00
fix(YouTube - Hook download actions, Overlay buttons): Sometimes the AlertDialog does not show
This commit is contained in:
parent
df41f035b6
commit
cf90f7b94e
@ -8,6 +8,8 @@ import android.widget.ScrollView;
|
|||||||
import androidx.annotation.GuardedBy;
|
import androidx.annotation.GuardedBy;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.google.android.libraries.youtube.rendering.ui.pivotbar.PivotBar;
|
||||||
|
|
||||||
import org.apache.commons.collections4.BidiMap;
|
import org.apache.commons.collections4.BidiMap;
|
||||||
import org.apache.commons.collections4.bidimap.DualHashBidiMap;
|
import org.apache.commons.collections4.bidimap.DualHashBidiMap;
|
||||||
import org.apache.commons.lang3.BooleanUtils;
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
@ -125,6 +127,15 @@ public class PlaylistPatch extends VideoUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Injection point.
|
||||||
|
*/
|
||||||
|
public static void setPivotBar(PivotBar view) {
|
||||||
|
if (QUEUE_MANAGER) {
|
||||||
|
mContext = view.getContext();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Injection point.
|
* Injection point.
|
||||||
*/
|
*/
|
||||||
|
@ -52,3 +52,20 @@ internal fun indexOfSetVideoIdInstruction(method: Method) =
|
|||||||
opcode == Opcode.IPUT_OBJECT &&
|
opcode == Opcode.IPUT_OBJECT &&
|
||||||
getReference<FieldReference>()?.type == "Ljava/lang/String;"
|
getReference<FieldReference>()?.type == "Ljava/lang/String;"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal val setPivotBarVisibilityFingerprint = legacyFingerprint(
|
||||||
|
name = "setPivotBarVisibilityFingerprint",
|
||||||
|
accessFlags = AccessFlags.PRIVATE or AccessFlags.FINAL,
|
||||||
|
returnType = "V",
|
||||||
|
parameters = listOf("Z"),
|
||||||
|
opcodes = listOf(
|
||||||
|
Opcode.CHECK_CAST,
|
||||||
|
Opcode.IF_EQZ,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
internal val setPivotBarVisibilityParentFingerprint = legacyFingerprint(
|
||||||
|
name = "setPivotBarVisibilityFingerprint",
|
||||||
|
parameters = listOf("Z"),
|
||||||
|
strings = listOf("FEnotifications_inbox"),
|
||||||
|
)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package app.revanced.patches.youtube.utils.playlist
|
package app.revanced.patches.youtube.utils.playlist
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
@ -81,5 +82,19 @@ val playlistPatch = bytecodePatch(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setPivotBarVisibilityFingerprint
|
||||||
|
.matchOrThrow(setPivotBarVisibilityParentFingerprint)
|
||||||
|
.let {
|
||||||
|
it.method.apply {
|
||||||
|
val viewIndex = it.patternMatch!!.startIndex
|
||||||
|
val viewRegister = getInstruction<OneRegisterInstruction>(viewIndex).registerA
|
||||||
|
addInstruction(
|
||||||
|
viewIndex + 1,
|
||||||
|
"invoke-static {v$viewRegister}," +
|
||||||
|
" $EXTENSION_CLASS_DESCRIPTOR->setPivotBar(Lcom/google/android/libraries/youtube/rendering/ui/pivotbar/PivotBar;)V",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user