mirror of
https://github.com/revanced/revanced-patches
synced 2024-12-03 17:22:58 +01:00
refactor: use .single
for resourceMappings
This commit is contained in:
parent
5824c2cdfb
commit
f090ff1229
@ -58,7 +58,7 @@ class GeneralBytecodeAdsPatch : BytecodePatch() {
|
|||||||
"promoted_video_item_land",
|
"promoted_video_item_land",
|
||||||
"promoted_video_item_full_bleed",
|
"promoted_video_item_full_bleed",
|
||||||
).map { name ->
|
).map { name ->
|
||||||
ResourceIdMappingProviderResourcePatch.resourceMappings.first { it.name == name }.id
|
ResourceIdMappingProviderResourcePatch.resourceMappings.single { it.name == name }.id
|
||||||
}
|
}
|
||||||
|
|
||||||
private val stringReferences = arrayOf(
|
private val stringReferences = arrayOf(
|
||||||
|
@ -32,9 +32,9 @@ class HideAutoplayButton : BytecodePatch(
|
|||||||
val layoutGenMethod = LayoutConstructorFingerprint.result!!.mutableMethod
|
val layoutGenMethod = LayoutConstructorFingerprint.result!!.mutableMethod
|
||||||
|
|
||||||
val autonavToggle =
|
val autonavToggle =
|
||||||
ResourceIdMappingProviderResourcePatch.resourceMappings.first { it.type == "id" && it.name == "autonav_toggle" }
|
ResourceIdMappingProviderResourcePatch.resourceMappings.single { it.type == "id" && it.name == "autonav_toggle" }
|
||||||
val autonavPreviewStub =
|
val autonavPreviewStub =
|
||||||
ResourceIdMappingProviderResourcePatch.resourceMappings.first { it.type == "id" && it.name == "autonav_preview_stub" }
|
ResourceIdMappingProviderResourcePatch.resourceMappings.single { it.type == "id" && it.name == "autonav_preview_stub" }
|
||||||
|
|
||||||
val autonavToggleConstIndex =
|
val autonavToggleConstIndex =
|
||||||
layoutGenMethod.implementation!!.instructions.indexOfFirst { (it as? WideLiteralInstruction)?.wideLiteral == autonavToggle.id }
|
layoutGenMethod.implementation!!.instructions.indexOfFirst { (it as? WideLiteralInstruction)?.wideLiteral == autonavToggle.id }
|
||||||
|
@ -39,7 +39,7 @@ class CreateButtonRemoverPatch : BytecodePatch(
|
|||||||
val implementation = result.mutableMethod.implementation!!
|
val implementation = result.mutableMethod.implementation!!
|
||||||
|
|
||||||
val imageOnlyLayout =
|
val imageOnlyLayout =
|
||||||
ResourceIdMappingProviderResourcePatch.resourceMappings.first { it.type == "layout" && it.name == "image_only_tab" }
|
ResourceIdMappingProviderResourcePatch.resourceMappings.single { it.type == "layout" && it.name == "image_only_tab" }
|
||||||
|
|
||||||
val imageOnlyLayoutConstIndex =
|
val imageOnlyLayoutConstIndex =
|
||||||
implementation.instructions.indexOfFirst { (it as? WideLiteralInstruction)?.wideLiteral == imageOnlyLayout.id }
|
implementation.instructions.indexOfFirst { (it as? WideLiteralInstruction)?.wideLiteral == imageOnlyLayout.id }
|
||||||
|
Loading…
Reference in New Issue
Block a user