mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-22 19:09:12 +02:00
clean up
This commit is contained in:
parent
d8535c1872
commit
1c941e5663
@ -16,7 +16,13 @@ internal class JsonGenerator : PatchesFileGenerator {
|
||||
it.use,
|
||||
it.requiresIntegrations,
|
||||
it.options.values.map { option ->
|
||||
JsonPatch.Option(option.key, option.value, option.title, option.description, option.required)
|
||||
JsonPatch.Option(
|
||||
option.key,
|
||||
option.value,
|
||||
option.title,
|
||||
option.description,
|
||||
option.required
|
||||
)
|
||||
}
|
||||
)
|
||||
}.let {
|
||||
|
@ -14,7 +14,11 @@ internal interface PatchesFileGenerator {
|
||||
).also { loader ->
|
||||
if (loader.isEmpty()) throw IllegalStateException("No patches found")
|
||||
}.let { bundle ->
|
||||
arrayOf(JsonGenerator(), ReadmeGenerator()).forEach { generator -> generator.generate(bundle) }
|
||||
arrayOf(JsonGenerator(), ReadmeGenerator()).forEach { generator ->
|
||||
generator.generate(
|
||||
bundle
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -6,8 +6,8 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.patch.PatchException
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch
|
||||
import app.revanced.patches.music.utils.returnyoutubedislike.fingerprints.DislikeFingerprint
|
||||
import app.revanced.patches.music.utils.returnyoutubedislike.fingerprints.LikeFingerprint
|
||||
|
@ -2,8 +2,8 @@ package app.revanced.patches.music.utils.returnyoutubedislike
|
||||
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.music.utils.settings.SettingsPatch
|
||||
import app.revanced.util.resources.MusicResourceHelper.RETURN_YOUTUBE_DISLIKE_SETTINGS_KEY
|
||||
import app.revanced.util.resources.MusicResourceHelper.addReVancedMusicPreference
|
||||
|
@ -15,6 +15,7 @@ object HideCommentAdsPatch : BytecodePatch(
|
||||
private const val INTEGRATION_METHOD_DESCRIPTOR =
|
||||
"Lapp/revanced/reddit/patches/GeneralAdsPatch;" +
|
||||
"->hideCommentAds()Z"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
HideCommentAdsFingerprint.result?.let {
|
||||
with(
|
||||
|
@ -42,6 +42,7 @@ object HideAdsPatch : BytecodePatch(
|
||||
private const val INTEGRATIONS_NEW_METHOD_DESCRIPTOR =
|
||||
"Lapp/revanced/reddit/patches/GeneralAdsPatch;" +
|
||||
"->hideNewPostAds()Z"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
// region Filter promoted ads (does not work in popular or latest feed)
|
||||
|
||||
|
@ -25,6 +25,7 @@ object NavigationButtonsPatch : BytecodePatch(
|
||||
private const val INTEGRATIONS_METHOD_DESCRIPTOR =
|
||||
"Lapp/revanced/reddit/patches/NavigationButtonsPatch;" +
|
||||
"->hideNavigationButtons(Landroid/view/ViewGroup;)V"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
|
||||
BottomNavScreenFingerprint.result?.let {
|
||||
|
@ -26,6 +26,7 @@ object PlaceButtonPatch : BytecodePatch(
|
||||
private const val INTEGRATIONS_METHOD_DESCRIPTOR =
|
||||
"Lapp/revanced/reddit/patches/PlaceButtonPatch;" +
|
||||
"->hidePlaceButton(Landroid/view/View;)V"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
|
||||
HomePagerScreenFingerprint.result?.let {
|
||||
|
@ -26,6 +26,7 @@ object ScreenshotPopupPatch : BytecodePatch(
|
||||
private const val INTEGRATIONS_METHOD_DESCRIPTOR =
|
||||
"Lapp/revanced/reddit/patches/ScreenshotPopupPatch;" +
|
||||
"->disableScreenshotPopup()Z"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
|
||||
ScreenshotTakenBannerFingerprint.result?.let {
|
||||
|
@ -23,6 +23,7 @@ object OpenLinksDirectlyPatch : BytecodePatch(
|
||||
private const val INTEGRATIONS_METHOD_DESCRIPTOR =
|
||||
"Lapp/revanced/reddit/patches/OpenLinksDirectlyPatch;" +
|
||||
"->parseRedirectUri(Landroid/net/Uri;)Landroid/net/Uri;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
ScreenNavigatorFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
|
@ -25,6 +25,7 @@ object OpenLinksExternallyPatch : BytecodePatch(
|
||||
) {
|
||||
private const val INTEGRATIONS_METHOD_DESCRIPTOR =
|
||||
"Lapp/revanced/reddit/patches/OpenLinksExternallyPatch;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
ScreenNavigatorFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
|
@ -25,6 +25,7 @@ object SanitizeUrlQueryPatch : BytecodePatch(
|
||||
private const val SANITIZE_METHOD_DESCRIPTOR =
|
||||
"Lapp/revanced/reddit/patches/SanitizeUrlQueryPatch;" +
|
||||
"->stripQueryParameters()Z"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
ShareLinkFormatterFingerprint.result?.let { result ->
|
||||
result.mutableMethod.apply {
|
||||
|
@ -75,6 +75,7 @@ object ComponentParserPatch : BytecodePatch(
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
lateinit var emptyComponentLabel: String
|
||||
lateinit var insertMethod: MutableMethod
|
||||
|
||||
|
@ -29,6 +29,7 @@ object LithoThemePatch : BytecodePatch(
|
||||
} ?: throw LithoThemeFingerprint.exception
|
||||
|
||||
}
|
||||
|
||||
private var offset = 0
|
||||
|
||||
private var insertIndex: Int = 0
|
||||
|
@ -61,5 +61,6 @@ abstract class AbstractOpusCodecsPatch(
|
||||
} ?: throw CodecSelectorFingerprint.exception
|
||||
|
||||
}
|
||||
|
||||
lateinit var targetReference: Reference
|
||||
}
|
||||
|
@ -5,11 +5,11 @@ import app.revanced.patcher.patch.PatchException
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.patch.options.types.StringPatchOption.Companion.stringPatchOption
|
||||
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
||||
import app.revanced.util.resources.ResourceHelper.addEntryValues
|
||||
import app.revanced.util.resources.ResourceUtils
|
||||
import app.revanced.util.resources.ResourceUtils.copyResources
|
||||
import app.revanced.patcher.patch.options.types.StringPatchOption.Companion.stringPatchOption
|
||||
|
||||
@Patch(
|
||||
name = "Custom double tap length",
|
||||
|
@ -126,7 +126,11 @@ object ShortsComponentPatch : BytecodePatch(
|
||||
it.mutableMethod.apply {
|
||||
val insertIndex = getWideLiteralIndex(ReelPlayerInfoPanel) + 3
|
||||
|
||||
hideButtons(insertIndex, 1, "hideShortsPlayerInfoPanel(Landroid/view/ViewGroup;)Landroid/view/ViewGroup;")
|
||||
hideButtons(
|
||||
insertIndex,
|
||||
1,
|
||||
"hideShortsPlayerInfoPanel(Landroid/view/ViewGroup;)Landroid/view/ViewGroup;"
|
||||
)
|
||||
}
|
||||
} ?: throw ShortsInfoPanelFingerprint.exception
|
||||
|
||||
@ -161,11 +165,27 @@ object ShortsComponentPatch : BytecodePatch(
|
||||
val secondaryIndex = getWideLiteralIndex(ReelPlayerBadge2) + 3
|
||||
|
||||
if (primaryIndex > secondaryIndex) {
|
||||
hideButtons(primaryIndex, 1, "hideShortsPlayerPaidPromotionBanner(Landroid/view/ViewStub;)Landroid/view/ViewStub;")
|
||||
hideButtons(secondaryIndex, 1, "hideShortsPlayerPaidPromotionBanner(Landroid/view/ViewStub;)Landroid/view/ViewStub;")
|
||||
hideButtons(
|
||||
primaryIndex,
|
||||
1,
|
||||
"hideShortsPlayerPaidPromotionBanner(Landroid/view/ViewStub;)Landroid/view/ViewStub;"
|
||||
)
|
||||
hideButtons(
|
||||
secondaryIndex,
|
||||
1,
|
||||
"hideShortsPlayerPaidPromotionBanner(Landroid/view/ViewStub;)Landroid/view/ViewStub;"
|
||||
)
|
||||
} else {
|
||||
hideButtons(secondaryIndex, 1, "hideShortsPlayerPaidPromotionBanner(Landroid/view/ViewStub;)Landroid/view/ViewStub;")
|
||||
hideButtons(primaryIndex, 1, "hideShortsPlayerPaidPromotionBanner(Landroid/view/ViewStub;)Landroid/view/ViewStub;")
|
||||
hideButtons(
|
||||
secondaryIndex,
|
||||
1,
|
||||
"hideShortsPlayerPaidPromotionBanner(Landroid/view/ViewStub;)Landroid/view/ViewStub;"
|
||||
)
|
||||
hideButtons(
|
||||
primaryIndex,
|
||||
1,
|
||||
"hideShortsPlayerPaidPromotionBanner(Landroid/view/ViewStub;)Landroid/view/ViewStub;"
|
||||
)
|
||||
}
|
||||
}
|
||||
} ?: throw ShortsPaidPromotionFingerprint.exception
|
||||
@ -194,7 +214,11 @@ object ShortsComponentPatch : BytecodePatch(
|
||||
val targetIndex = getWideLiteralIndex(ReelPivotButton)
|
||||
val insertIndex = getTargetIndexDownTo(targetIndex, Opcode.INVOKE_STATIC) + 2
|
||||
|
||||
hideButtons(insertIndex, 0, "hideShortsPlayerPivotButton(Ljava/lang/Object;)Ljava/lang/Object;")
|
||||
hideButtons(
|
||||
insertIndex,
|
||||
0,
|
||||
"hideShortsPlayerPivotButton(Ljava/lang/Object;)Ljava/lang/Object;"
|
||||
)
|
||||
}
|
||||
} ?: throw ShortsPivotFingerprint.exception
|
||||
|
||||
|
@ -12,7 +12,7 @@ import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
||||
|
||||
object ReturnYouTubeDislikeShortsPatch : BytecodePatch(
|
||||
setOf(ShortsTextViewFingerprint)
|
||||
setOf(ShortsTextViewFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
ShortsTextViewFingerprint.result?.let {
|
||||
|
@ -3,10 +3,8 @@ package app.revanced.patches.youtube.utils.settings
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.patch.mapping.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.patch.settings.AbstractSettingsResourcePatch
|
||||
import app.revanced.patches.youtube.utils.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch
|
||||
import app.revanced.util.resources.IconHelper.YOUTUBE_LAUNCHER_ICON_ARRAY
|
||||
import app.revanced.util.resources.IconHelper.copyFiles
|
||||
import app.revanced.util.resources.IconHelper.makeDirectoryAndCopyFiles
|
||||
|
Loading…
x
Reference in New Issue
Block a user