Compare commits

...

8 Commits

Author SHA1 Message Date
semantic-release-bot
c0f11e7848 chore(release): 2.182.1-dev.2 [skip ci]
## [2.182.1-dev.2](https://github.com/revanced/revanced-patches/compare/v2.182.1-dev.1...v2.182.1-dev.2) (2023-07-09)

### Bug Fixes

* **youtube/custom-video-speed:** don not implicitly depend on `old-video-quality-menu` patch ([9b2d89c](9b2d89cda5))
2023-07-09 14:18:55 +00:00
oSumAtrIX
9b2d89cda5 fix(youtube/custom-video-speed): don not implicitly depend on old-video-quality-menu patch 2023-07-09 16:15:55 +02:00
semantic-release-bot
0d96921226 chore(release): 2.182.1-dev.1 [skip ci]
## [2.182.1-dev.1](https://github.com/revanced/revanced-patches/compare/v2.182.0...v2.182.1-dev.1) (2023-07-08)

### Bug Fixes

* **youtube/custom-video-buffer:** remove non functional deprecated patch ([e5abe4f](e5abe4f0e5))
2023-07-08 18:37:45 +00:00
LisoUseInAIKyrios
e5abe4f0e5 fix(youtube/custom-video-buffer): remove non functional deprecated patch 2023-07-08 22:34:41 +04:00
semantic-release-bot
114cdf5571 chore(release): 2.182.0 [skip ci]
# [2.182.0](https://github.com/revanced/revanced-patches/compare/v2.181.0...v2.182.0) (2023-07-08)

### Bug Fixes

* **youtube/hide-layout-components:**  hide mix playlists ([4af3c46](4af3c462e3))

### Features

* **pixiv:** add `hide-ads` patch ([#2578](https://github.com/revanced/revanced-patches/issues/2578)) ([6c55d13](6c55d13c80))
* remove unnecessary notice ([1efe5de](1efe5de0ac))
* **slideforreddit:** add `change-oauth-client-id` patch ([#2571](https://github.com/revanced/revanced-patches/issues/2571)) ([f8f5326](f8f5326670))
* **youtube:** support version `18.23.35` ([#2461](https://github.com/revanced/revanced-patches/issues/2461)) ([34514b0](34514b04f1))
2023-07-08 02:36:59 +00:00
oSumAtrIX
31b61f5d70 chore: merge branch dev to main (#2582) 2023-07-08 04:32:55 +02:00
semantic-release-bot
438cd97278 chore(release): 2.182.0-dev.5 [skip ci]
# [2.182.0-dev.5](https://github.com/revanced/revanced-patches/compare/v2.182.0-dev.4...v2.182.0-dev.5) (2023-07-08)

### Bug Fixes

* **youtube/hide-layout-components:**  hide mix playlists ([4af3c46](4af3c462e3))
2023-07-08 02:32:31 +00:00
oSumAtrIX
4af3c462e3 fix(youtube/hide-layout-components): hide mix playlists 2023-07-08 04:27:45 +02:00
11 changed files with 114 additions and 58 deletions

View File

@@ -1,3 +1,39 @@
## [2.182.1-dev.2](https://github.com/revanced/revanced-patches/compare/v2.182.1-dev.1...v2.182.1-dev.2) (2023-07-09)
### Bug Fixes
* **youtube/custom-video-speed:** don not implicitly depend on `old-video-quality-menu` patch ([acfda46](https://github.com/revanced/revanced-patches/commit/acfda46bce2558df18a6fa562008e058df5ad31e))
## [2.182.1-dev.1](https://github.com/revanced/revanced-patches/compare/v2.182.0...v2.182.1-dev.1) (2023-07-08)
### Bug Fixes
* **youtube/custom-video-buffer:** remove non functional deprecated patch ([de233e2](https://github.com/revanced/revanced-patches/commit/de233e28246b1716b42bf331d2355ff4beed9564))
# [2.182.0](https://github.com/revanced/revanced-patches/compare/v2.181.0...v2.182.0) (2023-07-08)
### Bug Fixes
* **youtube/hide-layout-components:** hide mix playlists ([33a87bd](https://github.com/revanced/revanced-patches/commit/33a87bd6eac1639687ebdf96ef8924cd674f81e4))
### Features
* **pixiv:** add `hide-ads` patch ([#2578](https://github.com/revanced/revanced-patches/issues/2578)) ([862a7ec](https://github.com/revanced/revanced-patches/commit/862a7ec5b0767c28e79454a44218069d3e9cbac7))
* remove unnecessary notice ([7e9f0b2](https://github.com/revanced/revanced-patches/commit/7e9f0b2d02e910984f08777fefcd2ad7df6a21ee))
* **slideforreddit:** add `change-oauth-client-id` patch ([#2571](https://github.com/revanced/revanced-patches/issues/2571)) ([8cd60ee](https://github.com/revanced/revanced-patches/commit/8cd60eea36bd49514ed1c42bf362dce7e9675fca))
* **youtube:** support version `18.23.35` ([#2461](https://github.com/revanced/revanced-patches/issues/2461)) ([d20fde1](https://github.com/revanced/revanced-patches/commit/d20fde1e57077fe9a943f9782b415d7a0249b083))
# [2.182.0-dev.5](https://github.com/revanced/revanced-patches/compare/v2.182.0-dev.4...v2.182.0-dev.5) (2023-07-08)
### Bug Fixes
* **youtube/hide-layout-components:** hide mix playlists ([33a87bd](https://github.com/revanced/revanced-patches/commit/33a87bd6eac1639687ebdf96ef8924cd674f81e4))
# [2.182.0-dev.4](https://github.com/revanced/revanced-patches/compare/v2.182.0-dev.3...v2.182.0-dev.4) (2023-07-07)

View File

@@ -1,4 +1,4 @@
org.gradle.parallel = true
org.gradle.caching = true
kotlin.code.style = official
version = 2.182.0-dev.4
version = 2.182.1-dev.2

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,9 @@
package app.revanced.patches.youtube.layout.hide.general.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.Opcode
object ConvertElementToFlatBufferFingerprint : MethodFingerprint(
strings = listOf("Failed to convert Element to Flatbuffers: %s"),
opcodes = listOf(Opcode.IGET_OBJECT) // Patched at this opcodes index
)

View File

@@ -1,18 +1,24 @@
package app.revanced.patches.youtube.layout.hide.general.patch
import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.util.smali.ExternalLabel
import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
import app.revanced.patches.shared.settings.preference.impl.TextPreference
import app.revanced.patches.youtube.layout.hide.general.annotations.HideLayoutComponentsCompatibility
import app.revanced.patches.youtube.layout.hide.general.fingerprints.ConvertElementToFlatBufferFingerprint
import app.revanced.patches.youtube.misc.litho.filter.patch.LithoFilterPatch
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch.PreferenceScreen
@@ -23,8 +29,10 @@ import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch.P
@DependsOn([LithoFilterPatch::class, SettingsPatch::class])
@HideLayoutComponentsCompatibility
@Version("0.0.1")
class HideLayoutComponentsPatch : ResourcePatch {
override fun execute(context: ResourceContext): PatchResult {
class HideLayoutComponentsPatch : BytecodePatch(
listOf(ConvertElementToFlatBufferFingerprint)
) {
override fun execute(context: BytecodeContext): PatchResult {
PreferenceScreen.LAYOUT.addPreferences(
SwitchPreference(
"revanced_hide_gray_separator",
@@ -237,6 +245,35 @@ class HideLayoutComponentsPatch : ResourcePatch {
LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
// region Mix playlists
ConvertElementToFlatBufferFingerprint.result?.let {
val returnEmptyComponentIndex = it.scanResult.stringsScanResult!!.matches.first().index + 2
it.mutableMethod.apply {
// The last virtual register (not parameter). Used to store the byte array
// that may contain information about a mix playlist.
val freeRegister = (implementation!!.registerCount - 1) - parameterTypes.size - 1
// Check if the byte array contains anything about a mix playlist.
addInstructionsWithLabels(
it.scanResult.patternScanResult!!.startIndex,
"""
invoke-static {v$freeRegister}, $FILTER_CLASS_DESCRIPTOR->filterMixPlaylists([B)Z
move-result v$freeRegister
if-nez v$freeRegister, :return_empty_component
""",
ExternalLabel("return_empty_component", getInstruction(returnEmptyComponentIndex))
)
// Move the byte array to a free register.
addInstruction(0, "move-object/from16 v$freeRegister, p3")
}
} ?: return ConvertElementToFlatBufferFingerprint.toErrorResult()
// endregion
return PatchResultSuccess()
}

View File

@@ -1,7 +1,7 @@
package app.revanced.patches.youtube.misc.bottomsheet.hook.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patches.youtube.video.videoqualitymenu.patch.OldVideoQualityMenuResourcePatch
import app.revanced.patches.youtube.misc.bottomsheet.hook.patch.BottomSheetHookResourcePatch
import app.revanced.util.patch.LiteralValueFingerprint
import org.jf.dexlib2.AccessFlags
@@ -9,5 +9,5 @@ object CreateBottomSheetFingerprint : LiteralValueFingerprint(
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = listOf("L"),
returnType = "Landroid/widget/LinearLayout;",
literal = OldVideoQualityMenuResourcePatch.bottomSheetMargins
literal = BottomSheetHookResourcePatch.bottomSheetMargins
)

View File

@@ -12,7 +12,7 @@ import app.revanced.patches.youtube.misc.bottomsheet.hook.fingerprints.CreateBot
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@DependsOn([IntegrationsPatch::class])
@DependsOn([IntegrationsPatch::class, BottomSheetHookResourcePatch::class])
class BottomSheetHookPatch : BytecodePatch(
listOf(CreateBottomSheetFingerprint)
) {

View File

@@ -0,0 +1,23 @@
package app.revanced.patches.youtube.misc.bottomsheet.hook.patch
import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
@DependsOn([ResourceMappingPatch::class])
class BottomSheetHookResourcePatch : ResourcePatch {
override fun execute(context: ResourceContext): PatchResult {
bottomSheetMargins = ResourceMappingPatch.resourceMappings.find { it.name == "bottomSheetMargins" }?.id
?: return PatchResultError("Could not find resource")
return PatchResultSuccess()
}
internal companion object {
var bottomSheetMargins = -1L
}
}

View File

@@ -1,9 +0,0 @@
package app.revanced.patches.youtube.misc.videobuffer.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
// TODO: delete this
@Compatibility([Package("com.google.android.youtube", arrayOf("18.16.37", "18.19.35", "18.20.39", "18.23.35"))])
@Target(AnnotationTarget.CLASS)
internal annotation class CustomVideoBufferCompatibility

View File

@@ -1,36 +0,0 @@
package app.revanced.patches.youtube.misc.videobuffer.patch
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.settings.preference.impl.*
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
import app.revanced.patches.youtube.misc.videobuffer.annotations.CustomVideoBufferCompatibility
// TODO: delete this patch
@Patch(include = false)
@Name("custom-video-buffer")
@Description("Lets you change the buffers of videos.")
@DependsOn([SettingsPatch::class])
@CustomVideoBufferCompatibility
@Version("0.0.1")
class CustomVideoBufferPatch : BytecodePatch() {
override fun execute(context: BytecodeContext): PatchResult {
SettingsPatch.PreferenceScreen.MISC.addPreferences(
NonInteractivePreference(
StringResource("revanced_custom_video_buffer_disclaimer_title", "Custom video buffer"),
StringResource("revanced_custom_video_buffer_disclaimer_title_summary",
"These settings have been removed, because they were not functional for the duration of their existence"),
)
)
return PatchResultSuccess()
}
}

View File

@@ -29,14 +29,10 @@ class OldVideoQualityMenuResourcePatch : ResourcePatch {
// Used for the old type of the video quality menu.
videoQualityBottomSheetListFragmentTitle = findResource("video_quality_bottom_sheet_list_fragment_title")
// Used for the new type of the video quality menu.
bottomSheetMargins = findResource("bottom_sheet_margins")
return PatchResultSuccess()
}
internal companion object {
var videoQualityBottomSheetListFragmentTitle = -1L
var bottomSheetMargins = -1L
}
}