feat: Publish as a library (#3356)
This commit is contained in:
+7
-6
@@ -8,9 +8,9 @@ import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.playercontrols.BottomControlsResourcePatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.util.resources.ResourceUtils
|
||||
import app.revanced.util.resources.ResourceUtils.copyResources
|
||||
import app.revanced.util.resources.ResourceUtils.mergeStrings
|
||||
import app.revanced.util.ResourceGroup
|
||||
import app.revanced.util.copyResources
|
||||
import app.revanced.util.mergeStrings
|
||||
|
||||
@Patch(
|
||||
dependencies = [
|
||||
@@ -18,7 +18,7 @@ import app.revanced.util.resources.ResourceUtils.mergeStrings
|
||||
BottomControlsResourcePatch::class
|
||||
]
|
||||
)
|
||||
object CopyVideoUrlResourcePatch : ResourcePatch() {
|
||||
internal object CopyVideoUrlResourcePatch : ResourcePatch() {
|
||||
override fun execute(context: ResourceContext) {
|
||||
SettingsPatch.PreferenceScreen.INTERACTIONS.addPreferences(
|
||||
PreferenceScreen(
|
||||
@@ -42,11 +42,12 @@ object CopyVideoUrlResourcePatch : ResourcePatch() {
|
||||
)
|
||||
)
|
||||
|
||||
context.copyResources("copyvideourl", ResourceUtils.ResourceGroup(
|
||||
context.copyResources("copyvideourl", ResourceGroup(
|
||||
resourceDirectoryName = "drawable",
|
||||
"revanced_yt_copy.xml",
|
||||
"revanced_yt_copy_timestamp.xml"
|
||||
))
|
||||
)
|
||||
)
|
||||
|
||||
// merge strings
|
||||
context.mergeStrings("copyvideourl/host/values/strings.xml")
|
||||
|
||||
+5
-5
@@ -6,9 +6,9 @@ import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.*
|
||||
import app.revanced.patches.youtube.misc.playercontrols.BottomControlsResourcePatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.util.resources.ResourceUtils
|
||||
import app.revanced.util.resources.ResourceUtils.copyResources
|
||||
import app.revanced.util.resources.ResourceUtils.mergeStrings
|
||||
import app.revanced.util.ResourceGroup
|
||||
import app.revanced.util.copyResources
|
||||
import app.revanced.util.mergeStrings
|
||||
|
||||
@Patch(
|
||||
dependencies = [
|
||||
@@ -16,7 +16,7 @@ import app.revanced.util.resources.ResourceUtils.mergeStrings
|
||||
SettingsPatch::class
|
||||
]
|
||||
)
|
||||
object ExternalDownloadsResourcePatch : ResourcePatch() {
|
||||
internal object ExternalDownloadsResourcePatch : ResourcePatch() {
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
SettingsPatch.PreferenceScreen.INTERACTIONS.addPreferences(
|
||||
@@ -46,7 +46,7 @@ object ExternalDownloadsResourcePatch : ResourcePatch() {
|
||||
context.mergeStrings("downloads/host/values/strings.xml")
|
||||
|
||||
// Copy resources
|
||||
context.copyResources("downloads", ResourceUtils.ResourceGroup("drawable", "revanced_yt_download_button.xml"))
|
||||
context.copyResources("downloads", ResourceGroup("drawable", "revanced_yt_download_button.xml"))
|
||||
|
||||
// Add download button node
|
||||
BottomControlsResourcePatch.addControls("downloads/host/layout/${BottomControlsResourcePatch.TARGET_RESOURCE_NAME}")
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package app.revanced.patches.youtube.interaction.seekbar
|
||||
|
||||
import app.revanced.extensions.exception
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package app.revanced.patches.youtube.interaction.seekbar
|
||||
|
||||
import app.revanced.extensions.exception
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package app.revanced.patches.youtube.interaction.seekbar
|
||||
|
||||
import app.revanced.extensions.exception
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
@@ -38,7 +38,7 @@ object EnableSlideToSeekPatch : BytecodePatch(
|
||||
DoubleSpeedSeekNoticeFingerprint
|
||||
)
|
||||
) {
|
||||
const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/patches/SlideToSeekPatch;"
|
||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/patches/SlideToSeekPatch;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SettingsPatch.PreferenceScreen.INTERACTIONS.addPreferences(
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ package app.revanced.patches.youtube.interaction.seekbar.fingerprints
|
||||
import app.revanced.util.patch.LiteralValueFingerprint
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
object DoubleSpeedSeekNoticeFingerprint : LiteralValueFingerprint(
|
||||
internal object DoubleSpeedSeekNoticeFingerprint : LiteralValueFingerprint(
|
||||
returnType = "Z",
|
||||
parameters = emptyList(),
|
||||
opcodes = listOf(Opcode.MOVE_RESULT),
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ package app.revanced.patches.youtube.interaction.seekbar.fingerprints
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
object IsSwipingUpFingerprint : MethodFingerprint(
|
||||
internal object IsSwipingUpFingerprint : MethodFingerprint(
|
||||
returnType = "Z",
|
||||
parameters = listOf("Landroid/view/MotionEvent;", "J"),
|
||||
opcodes = listOf(
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import com.android.tools.smali.dexlib2.AccessFlags
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
@FuzzyPatternScanMethod(3)
|
||||
object OnTouchEventHandlerFingerprint : MethodFingerprint(
|
||||
internal object OnTouchEventHandlerFingerprint : MethodFingerprint(
|
||||
returnType = "Z",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.PUBLIC,
|
||||
parameters = listOf("L"),
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.NarrowLiteralInstruction
|
||||
|
||||
|
||||
object SeekbarTappingFingerprint : MethodFingerprint(
|
||||
internal object SeekbarTappingFingerprint : MethodFingerprint(
|
||||
returnType = "Z",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
parameters = listOf("L"),
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ package app.revanced.patches.youtube.interaction.seekbar.fingerprints
|
||||
import app.revanced.util.patch.LiteralValueFingerprint
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
object SlideToSeekFingerprint : LiteralValueFingerprint(
|
||||
internal object SlideToSeekFingerprint : LiteralValueFingerprint(
|
||||
returnType = "Z",
|
||||
parameters = emptyList(),
|
||||
opcodes = listOf(Opcode.MOVE_RESULT),
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
package app.revanced.patches.youtube.interaction.swipecontrols
|
||||
|
||||
import app.revanced.extensions.transformMethods
|
||||
import app.revanced.extensions.traverseClassHierarchy
|
||||
import app.revanced.util.transformMethods
|
||||
import app.revanced.util.traverseClassHierarchy
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
|
||||
+4
-4
@@ -5,13 +5,13 @@ import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.*
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.util.resources.ResourceUtils
|
||||
import app.revanced.util.resources.ResourceUtils.copyResources
|
||||
import app.revanced.util.ResourceGroup
|
||||
import app.revanced.util.copyResources
|
||||
|
||||
@Patch(
|
||||
dependencies = [SettingsPatch::class]
|
||||
)
|
||||
object SwipeControlsResourcePatch : ResourcePatch() {
|
||||
internal object SwipeControlsResourcePatch : ResourcePatch() {
|
||||
override fun execute(context: ResourceContext) {
|
||||
SettingsPatch.PreferenceScreen.INTERACTIONS.addPreferences(
|
||||
PreferenceScreen(
|
||||
@@ -94,7 +94,7 @@ object SwipeControlsResourcePatch : ResourcePatch() {
|
||||
|
||||
context.copyResources(
|
||||
"swipecontrols",
|
||||
ResourceUtils.ResourceGroup(
|
||||
ResourceGroup(
|
||||
"drawable",
|
||||
"ic_sc_brightness_auto.xml",
|
||||
"ic_sc_brightness_manual.xml",
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
object SwipeControlsHostActivityFingerprint : MethodFingerprint(
|
||||
internal object SwipeControlsHostActivityFingerprint : MethodFingerprint(
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
||||
parameters = listOf(),
|
||||
customFingerprint = { methodDef, _ ->
|
||||
|
||||
Reference in New Issue
Block a user