mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-12 04:13:57 +01:00
Compare commits
6 Commits
v1.0.0-dev
...
v1.0.0-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
85236c57b8 | ||
|
|
bf2b2ae791 | ||
|
|
9e1dac57e7 | ||
|
|
790c84a00e | ||
|
|
d32424bc42 | ||
|
|
084fc60d3f |
21
CHANGELOG.md
21
CHANGELOG.md
@@ -1,3 +1,24 @@
|
|||||||
|
# [1.0.0-dev.4](https://github.com/ReVancedTeam/revanced-patches/compare/v1.0.0-dev.3...v1.0.0-dev.4) (2022-03-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* use supplier instead of KClass ([08af6e5](https://github.com/ReVancedTeam/revanced-patches/commit/08af6e54af79ef9ef4fb3372a348ce9b6fba4d20))
|
||||||
|
* use supplier instead of KClass ([91aa019](https://github.com/ReVancedTeam/revanced-patches/commit/91aa019f8d3d87fbf7affeb7abc2b02ba87af5c3))
|
||||||
|
|
||||||
|
|
||||||
|
### BREAKING CHANGES
|
||||||
|
|
||||||
|
* signature of patches was changed
|
||||||
|
* signature of patches was changed
|
||||||
|
|
||||||
|
# [1.0.0-dev.3](https://github.com/ReVancedTeam/revanced-patches/compare/v1.0.0-dev.2...v1.0.0-dev.3) (2022-03-21)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* OldQualityLayout, HideSuggestions, HideReels, EnableSeekbarTapping ([04a7cff](https://github.com/ReVancedTeam/revanced-patches/commit/04a7cfff20d2734b1c92713de4e7e08a3b93ee85))
|
||||||
|
|
||||||
# [1.0.0-dev.2](https://github.com/ReVancedTeam/revanced-patches/compare/v1.0.0-dev.1...v1.0.0-dev.2) (2022-03-21)
|
# [1.0.0-dev.2](https://github.com/ReVancedTeam/revanced-patches/compare/v1.0.0-dev.1...v1.0.0-dev.2) (2022-03-21)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 1.0.0-dev.2
|
version = 1.0.0-dev.4
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
package app.revanced.patches
|
package app.revanced.patches
|
||||||
|
|
||||||
import app.revanced.patcher.patch.Patch
|
import app.revanced.patcher.patch.Patch
|
||||||
import app.revanced.patches.ads.VideoAds
|
import app.revanced.patches.ad.VideoAds
|
||||||
import app.revanced.patches.layouts.CreateButtonRemover
|
import app.revanced.patches.interaction.EnableSeekbarTapping
|
||||||
import app.revanced.patches.layouts.MinimizedPlayback
|
import app.revanced.patches.layout.*
|
||||||
import kotlin.reflect.KClass
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Index contains all the patches and should be imported when using this library.
|
* Index contains all the patches and should be imported when using this library.
|
||||||
@@ -15,9 +14,13 @@ object Index {
|
|||||||
* Array of patches.
|
* Array of patches.
|
||||||
* New patches should be added to the array.
|
* New patches should be added to the array.
|
||||||
*/
|
*/
|
||||||
val patches: Array<KClass<out Patch>> = arrayOf(
|
val patches: Array<() -> Patch> = arrayOf(
|
||||||
VideoAds::class,
|
::VideoAds,
|
||||||
MinimizedPlayback::class,
|
::MinimizedPlayback,
|
||||||
CreateButtonRemover::class
|
::CreateButtonRemover,
|
||||||
|
::HideReels,
|
||||||
|
::HideSuggestions,
|
||||||
|
::OldQualityLayout,
|
||||||
|
::EnableSeekbarTapping
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package app.revanced.patches.ads
|
package app.revanced.patches.ad
|
||||||
|
|
||||||
import app.revanced.patcher.cache.Cache
|
import app.revanced.patcher.cache.Cache
|
||||||
import app.revanced.patcher.patch.Patch
|
import app.revanced.patcher.patch.Patch
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package app.revanced.patches.interaction
|
||||||
|
|
||||||
|
import app.revanced.patcher.cache.Cache
|
||||||
|
import app.revanced.patcher.patch.Patch
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.writer.ASMWriter.insertAt
|
||||||
|
import org.objectweb.asm.Opcodes
|
||||||
|
import org.objectweb.asm.tree.*
|
||||||
|
|
||||||
|
class EnableSeekbarTapping : Patch("enable-seekbar-tapping") {
|
||||||
|
override fun execute(cache: Cache): PatchResult {
|
||||||
|
val patchData = cache.methods["enable-seekbar-tapping"]
|
||||||
|
val methodOPatchData = cache.methods["enable-seekbar-tapping-method-o"]
|
||||||
|
val methodPPatchData = cache.methods["enable-seekbar-tapping-method-p"]
|
||||||
|
|
||||||
|
val elseLabel = LabelNode()
|
||||||
|
patchData.method.instructions.insertAt(
|
||||||
|
patchData.scanData.endIndex,
|
||||||
|
InsnNode(Opcodes.ACONST_NULL),
|
||||||
|
MethodInsnNode(
|
||||||
|
Opcodes.INVOKESTATIC,
|
||||||
|
"fi/razerman/youtube/preferences/BooleanPreferences",
|
||||||
|
"isTapSeekingEnabled",
|
||||||
|
"()Z"
|
||||||
|
),
|
||||||
|
JumpInsnNode(Opcodes.IFEQ, elseLabel),
|
||||||
|
VarInsnNode(Opcodes.ALOAD, 0),
|
||||||
|
VarInsnNode(Opcodes.ILOAD, 6),
|
||||||
|
MethodInsnNode(
|
||||||
|
Opcodes.INVOKEVIRTUAL,
|
||||||
|
methodOPatchData.declaringClass.name,
|
||||||
|
methodOPatchData.method.name,
|
||||||
|
"(I)V"
|
||||||
|
),
|
||||||
|
VarInsnNode(Opcodes.ALOAD, 0),
|
||||||
|
VarInsnNode(Opcodes.ILOAD, 6),
|
||||||
|
MethodInsnNode(
|
||||||
|
Opcodes.INVOKEVIRTUAL,
|
||||||
|
methodPPatchData.declaringClass.name,
|
||||||
|
methodPPatchData.method.name,
|
||||||
|
"(I)V"
|
||||||
|
),
|
||||||
|
elseLabel
|
||||||
|
)
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package app.revanced.patches.layouts
|
package app.revanced.patches.layout
|
||||||
|
|
||||||
import app.revanced.patcher.cache.Cache
|
import app.revanced.patcher.cache.Cache
|
||||||
import app.revanced.patcher.patch.Patch
|
import app.revanced.patcher.patch.Patch
|
||||||
29
src/main/kotlin/app/revanced/patches/layout/HideReels.kt
Normal file
29
src/main/kotlin/app/revanced/patches/layout/HideReels.kt
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
package app.revanced.patches.layout
|
||||||
|
|
||||||
|
import app.revanced.patcher.cache.Cache
|
||||||
|
import app.revanced.patcher.patch.Patch
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.writer.ASMWriter.insertAt
|
||||||
|
import org.objectweb.asm.Opcodes
|
||||||
|
import org.objectweb.asm.tree.MethodInsnNode
|
||||||
|
import org.objectweb.asm.tree.VarInsnNode
|
||||||
|
|
||||||
|
class HideReels : Patch("hide-reels") {
|
||||||
|
override fun execute(cache: Cache): PatchResult {
|
||||||
|
val patchData = cache.methods["hide-reel-patch"]
|
||||||
|
|
||||||
|
patchData.method.instructions.insertAt(
|
||||||
|
patchData.scanData.endIndex + 1,
|
||||||
|
VarInsnNode(Opcodes.ALOAD, 18),
|
||||||
|
MethodInsnNode(
|
||||||
|
Opcodes.INVOKESTATIC,
|
||||||
|
"fi/razerman/youtube/XAdRemover",
|
||||||
|
"HideReels",
|
||||||
|
"(Landroid/view/View;)V"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package app.revanced.patches.layout
|
||||||
|
|
||||||
|
import app.revanced.patcher.cache.Cache
|
||||||
|
import app.revanced.patcher.patch.Patch
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultError
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.signature.Signature
|
||||||
|
import app.revanced.patcher.writer.ASMWriter.insertAt
|
||||||
|
import org.objectweb.asm.Opcodes
|
||||||
|
import org.objectweb.asm.Type
|
||||||
|
import org.objectweb.asm.tree.MethodInsnNode
|
||||||
|
import org.objectweb.asm.tree.VarInsnNode
|
||||||
|
|
||||||
|
class HideSuggestions : Patch("hide-suggestions") {
|
||||||
|
override fun execute(cache: Cache): PatchResult {
|
||||||
|
val method = cache.methods["hide-suggestions-patch"].findParentMethod(
|
||||||
|
Signature(
|
||||||
|
"hide-suggestions-method",
|
||||||
|
Type.VOID_TYPE,
|
||||||
|
Opcodes.ACC_PUBLIC or Opcodes.ACC_FINAL,
|
||||||
|
arrayOf(Type.BOOLEAN_TYPE),
|
||||||
|
arrayOf(
|
||||||
|
Opcodes.ALOAD,
|
||||||
|
Opcodes.ILOAD,
|
||||||
|
Opcodes.PUTFIELD,
|
||||||
|
Opcodes.ALOAD,
|
||||||
|
Opcodes.GETFIELD
|
||||||
|
)
|
||||||
|
)
|
||||||
|
) ?: return PatchResultError("Parent method hide-suggestions-method has not been found")
|
||||||
|
|
||||||
|
method.method.instructions.insertAt(
|
||||||
|
0,
|
||||||
|
VarInsnNode(Opcodes.ILOAD, 1),
|
||||||
|
MethodInsnNode(
|
||||||
|
Opcodes.INVOKESTATIC,
|
||||||
|
"java/lang/Boolean",
|
||||||
|
"valueOf",
|
||||||
|
"(Z)Ljava/lang/Boolean"
|
||||||
|
),
|
||||||
|
MethodInsnNode(
|
||||||
|
Opcodes.INVOKESTATIC,
|
||||||
|
"fi/razerman/youtube/XAdRemover",
|
||||||
|
"HideReels",
|
||||||
|
"(Landroid/view/View;)V"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package app.revanced.patches.layouts
|
package app.revanced.patches.layout
|
||||||
|
|
||||||
import app.revanced.patcher.cache.Cache
|
import app.revanced.patcher.cache.Cache
|
||||||
import app.revanced.patcher.patch.Patch
|
import app.revanced.patcher.patch.Patch
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package app.revanced.patches.layout
|
||||||
|
|
||||||
|
import app.revanced.patcher.cache.Cache
|
||||||
|
import app.revanced.patcher.patch.Patch
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultError
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.signature.Signature
|
||||||
|
import app.revanced.patcher.util.ExtraTypes
|
||||||
|
import app.revanced.patcher.writer.ASMWriter.insertAt
|
||||||
|
import org.objectweb.asm.Opcodes
|
||||||
|
import org.objectweb.asm.tree.JumpInsnNode
|
||||||
|
import org.objectweb.asm.tree.MethodInsnNode
|
||||||
|
import org.objectweb.asm.tree.VarInsnNode
|
||||||
|
|
||||||
|
class OldQualityLayout : Patch("old-quality-restore") {
|
||||||
|
override fun execute(cache: Cache): PatchResult {
|
||||||
|
val method = cache.methods["old-quality-patch"].findParentMethod(
|
||||||
|
Signature(
|
||||||
|
"old-quality-patch-method",
|
||||||
|
ExtraTypes.Any,
|
||||||
|
Opcodes.ACC_PUBLIC or Opcodes.ACC_FINAL,
|
||||||
|
arrayOf(),
|
||||||
|
arrayOf(
|
||||||
|
Opcodes.ALOAD,
|
||||||
|
Opcodes.GETFIELD,
|
||||||
|
Opcodes.ISTORE,
|
||||||
|
Opcodes.ICONST_3,
|
||||||
|
Opcodes.ISTORE
|
||||||
|
)
|
||||||
|
)
|
||||||
|
) ?: return PatchResultError("Parent method old-quality-patch-method has not been found")
|
||||||
|
|
||||||
|
method.method.instructions.insertAt(
|
||||||
|
0,
|
||||||
|
MethodInsnNode(
|
||||||
|
Opcodes.INVOKESTATIC,
|
||||||
|
"fi/razerman/youtube/XGlobals",
|
||||||
|
"useOldStyleQualitySettings",
|
||||||
|
"()Z"
|
||||||
|
),
|
||||||
|
VarInsnNode(Opcodes.ISTORE, 1),
|
||||||
|
VarInsnNode(Opcodes.ILOAD, 1),
|
||||||
|
JumpInsnNode(
|
||||||
|
Opcodes.IFNE,
|
||||||
|
(method.method.instructions[method.scanData.endIndex + 3] as JumpInsnNode).label
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user