From dba0d0c1ae354327e5c76477905e0619710a6d4c Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sat, 19 Aug 2023 01:50:29 +0200 Subject: [PATCH] build(Needs bump): Bump dependencies --- build.gradle.kts | 2 +- .../app/revanced/extensions/Extensions.kt | 25 ++++++++--- .../kotlin/app/revanced/meta/JsonGenerator.kt | 3 -- .../app/revanced/meta/PatchesFileGenerator.kt | 19 ++++---- .../patch/ExportAllActivitiesPatch.kt | 8 +--- .../patch/PredictiveBackGesturePatch.kt | 6 +-- .../patch/EnableAndroidDebuggingPatch.kt | 4 +- .../patch/OverrideCertificatePinningPatch.kt | 8 +--- .../patch/ChangePackageNamePatch.kt | 6 +-- .../RemoveCaptureRestrictionResourcePatch.kt | 6 +-- .../misc/pro/patch/ProUnlockPatch.kt | 8 +--- .../candylinkvpn/patch/UnlockProPatch.kt | 8 +--- .../patch/BootloaderDetectionPatch.kt | 8 +--- .../root/patch/RootDetectionPatch.kt | 8 +--- .../patch/RemoveDeviceRestrictions.kt | 8 +--- .../hexeditor/ad/patch/HexEditorAdsPatch.kt | 6 +-- .../misc/pro/patch/UnlockProPatch.kt | 6 +-- .../root/patch/RootDetectionPatch.kt | 6 +-- .../signature/patch/SpoofSignaturePatch.kt | 5 +-- .../inshorts/ad/patch/InshortsAdsPatch.kt | 8 +--- .../timeline/patch/HideTimelineAdsPatch.kt | 12 ++---- .../patches/irplus/ad/patch/IrplusAdsPatch.kt | 6 +-- .../login/patch/DisableMandatoryLoginPatch.kt | 6 +-- .../misc/premium/patch/UnlockPremiumPatch.kt | 6 +-- .../license/patch/LicenseValidationPatch.kt | 6 +-- .../patch/SignatureVerificationPatch.kt | 6 +-- .../misc/pro/patch/UnlockProVersionPatch.kt | 6 +-- .../ads/inbox/patch/HideInboxAdsPatch.kt | 8 +--- ...tchingEmojiToStickerInMessageInputField.kt | 6 +-- .../patch/DisableTypingIndicator.kt | 6 +-- .../moneymanager/patch/UnlockProPatch.kt | 5 +-- .../ad/video/patch/MusicVideoAdsPatch.kt | 6 +-- .../audio/codecs/patch/CodecsUnlockPatch.kt | 7 +-- .../patch/ExclusiveAudioPatch.kt | 6 +-- .../patch/PermanentRepeatPatch.kt | 8 +--- .../patch/PermanentShufflePatch.kt | 8 +--- .../compactheader/patch/CompactHeaderPatch.kt | 6 +-- .../patch/MinimizedPlaybackPatch.kt | 6 +-- .../premium/patch/HideGetPremiumPatch.kt | 6 +-- .../patch/RemoveUpgradeButtonPatch.kt | 5 +-- .../patch/BypassCertificateChecksPatch.kt | 8 +--- .../patch/bytecode/MicroGBytecodePatch.kt | 43 +++++++++---------- .../patch/resource/MicroGResourcePatch.kt | 5 +-- .../patch/BackgroundPlayPatch.kt | 6 +-- .../misc/pro/patch/UnlockProPatch.kt | 6 +-- .../patch/RemoveBroadcastsRestrictionPatch.kt | 6 +-- .../misc/pro/patch/UnlockProPatch.kt | 8 +--- .../nyx/misc/pro/patch/UnlockProPatch.kt | 6 +-- .../patch/SignatureDetectionPatch.kt | 6 +-- .../misc/unlockplus/patch/UnlockPlusPatch.kt | 8 +--- .../patches/pixiv/ads/patch/HideAdsPatch.kt | 8 +--- .../reddit/ad/banner/patch/HideBannerPatch.kt | 6 +-- .../ad/comments/patch/HideCommentAdsPatch.kt | 5 +-- .../reddit/ad/general/patch/HideAdsPatch.kt | 6 +-- .../customclients/AbstractSpoofClientPatch.kt | 26 +++++------ .../baconreader/api/patch/SpoofClientPatch.kt | 6 +-- .../api/patch/SpoofClientPatch.kt | 6 +-- .../api/patch/SpoofClientPatch.kt | 6 +-- .../ads/patch/DisableAdsPatch.kt | 8 +--- .../api/patch/SpoofClientPatch.kt | 6 +-- .../patch/DisablePiracyDetectionPatch.kt | 8 +--- .../redditisfun/api/patch/SpoofClientPatch.kt | 10 +---- .../api/patch/SpoofClientPatch.kt | 6 +-- .../slide/api/patch/SpoofClientPatch.kt | 6 +-- .../ads/patch/DisableAdsPatch.kt | 8 +--- .../DisableSyncForLemmyBottomSheetPatch.kt | 6 +-- .../api/patch/SpoofClientPatch.kt | 8 +--- .../patch/DisablePiracyDetectionPatch.kt | 6 +-- .../patch/DisableScreenshotPopupPatch.kt | 8 +--- .../premiumicon/patch/PremiumIconPatch.kt | 5 +-- .../url/patch/SanitizeUrlQueryPatch.kt | 8 +--- .../patch/RemoveDebuggingDetectionPatch.kt | 5 +-- .../patch/AbstractIntegrationsPatch.kt | 29 ++++--------- .../misc/patch/ResourceMappingPatch.kt | 6 +-- .../patch/VerticalScrollPatch.kt | 8 +--- .../patch/AbstractSettingsResourcePatch.kt | 8 +--- .../songpal/badge/patch/BadgeTabPatch.kt | 8 +--- .../patch/RemoveNotificationBadgePatch.kt | 8 +--- .../spotify/layout/theme/patch/ThemePatch.kt | 8 ++-- .../lite/ondemand/patch/OnDemandPatch.kt | 7 +-- .../patch/PremiumNavbarTabPatch.kt | 6 +-- .../themeunlock/patch/UnlockThemePatch.kt | 6 +-- .../patches/tiktok/ad/patch/HideAdsPatch.kt | 9 ++-- .../feedfilter/patch/FeedFilterPatch.kt | 5 +-- .../downloads/patch/DownloadsPatch.kt | 10 ++--- .../seekbar/patch/ShowSeekbarPatch.kt | 7 +-- .../speed/patch/PlaybackSpeedPatch.kt | 6 +-- .../patch/DisableLoginRequirementPatch.kt | 5 +-- .../fixgoogle/patch/FixGoogleLoginPatch.kt | 5 +-- .../misc/settings/patch/SettingsPatch.kt | 14 +++--- .../misc/spoof/sim/patch/SpoofSimPatch.kt | 6 +-- .../patches/trakt/patch/UnlockProPatch.kt | 10 ++--- .../unlock/patch/UnlockPaidWidgetsPatch.kt | 8 +--- .../twitch/ad/audio/patch/AudioAdsPatch.kt | 6 +-- .../ad/embedded/patch/EmbeddedAdsPatch.kt | 10 ++--- .../twitch/ad/video/patch/VideoAdsPatch.kt | 12 ++---- .../patch/ShowDeletedMessagesPatch.kt | 12 ++---- .../patch/AutoClaimChannelPointsPatch.kt | 8 +--- .../twitch/debug/patch/DebugModePatch.kt | 8 +--- .../settings/bytecode/patch/SettingsPatch.kt | 14 +++--- .../dynamiccolor/patch/DynamicColorPatch.kt | 10 ++--- .../misc/hook/json/patch/JsonHookPatch.kt | 16 +++---- .../misc/hook/patch/BaseHookPatchPatch.kt | 9 +--- .../vsco/misc/pro/patch/UnlockProPatch.kt | 8 +--- .../patch/FirebaseGetCertPatch.kt | 6 +-- .../promocode/patch/PromoCodeUnlockPatch.kt | 6 +-- .../misc/unlockpro/patch/UnlockProPatch.kt | 6 +-- .../ad/general/bytecode/patch/HideAdsPatch.kt | 6 +-- .../resource/patch/HideAdsResourcePatch.kt | 6 +-- .../HideGetPremiumVideoAdvertisementPatch.kt | 8 +--- .../youtube/ad/video/patch/VideoAdsPatch.kt | 6 +-- .../patch/CopyVideoUrlBytecodePatch.kt | 6 +-- .../patch/CopyVideoUrlResourcePatch.kt | 6 +-- .../patch/ExternalDownloadsBytecodePatch.kt | 6 +-- .../patch/ExternalDownloadsResourcePatch.kt | 6 +-- .../patch/EnableSeekbarTappingPatch.kt | 10 ++--- .../EnableSeekbarTappingResourcePatch.kt | 5 +-- .../bytecode/SwipeControlsBytecodePatch.kt | 7 +-- .../resource/SwipeControlsResourcePatch.kt | 5 +-- .../autocaptions/patch/AutoCaptionsPatch.kt | 6 +-- .../header/patch/PremiumHeadingPatch.kt | 12 ++---- .../icon/patch/CustomBrandingPatch.kt | 4 +- .../buttons/action/patch/HideButtonsPatch.kt | 6 +-- .../autoplay/patch/HideAutoplayButtonPatch.kt | 8 +--- .../captions/patch/HideCaptionsButtonPatch.kt | 6 +-- .../buttons/cast/patch/HideCastButtonPatch.kt | 12 ++---- .../patch/NavigationButtonsPatch.kt | 11 ++--- .../patch/ResolvePivotBarFingerprintsPatch.kt | 13 +++--- .../hide/patch/HidePlayerButtonsPatch.kt | 7 +-- .../bytecode/patch/AlbumCardsPatch.kt | 8 +--- .../resource/patch/AlbumCardsResourcePatch.kt | 6 +-- .../bytecode/patch/BreakingNewsPatch.kt | 8 +--- .../patch/BreakingNewsResourcePatch.kt | 6 +-- .../hide/comments/patch/CommentsPatch.kt | 6 +-- .../bytecode/patch/CrowdfundingBoxPatch.kt | 8 +--- .../patch/CrowdfundingBoxResourcePatch.kt | 6 +-- .../bytecode/patch/HideEndscreenCardsPatch.kt | 6 +-- .../patch/HideEndscreenCardsResourcePatch.kt | 6 +-- .../filterbar/patch/HideFilterBarPatch.kt | 6 +-- .../patch/HideFilterBarResourcePatch.kt | 6 +-- .../HideFloatingMicrophoneButtonPatch.kt | 8 +--- ...deFloatingMicrophoneButtonResourcePatch.kt | 9 ++-- .../patch/HideLayoutComponentsPatch.kt | 8 +--- .../infocards/patch/HideInfoCardsPatch.kt | 6 +-- .../patch/HideInfocardsResourcePatch.kt | 6 +-- .../bytecode/patch/HideLoadMoreButtonPatch.kt | 8 +--- .../patch/HideLoadMoreButtonResourcePatch.kt | 6 +-- .../bytecode/patch/HideEmailAddressPatch.kt | 8 +--- .../patch/HideEmailAddressResourcePatch.kt | 6 +-- .../patch/HidePlayerFlyoutMenuPatch.kt | 6 +-- .../bytecode/patch/HidePlayerOverlayPatch.kt | 8 +--- .../patch/HidePlayerOverlayResourcePatch.kt | 6 +-- .../hide/seekbar/patch/HideSeekbarPatch.kt | 6 +-- .../patch/HideShortsComponentsPatch.kt | 16 +++---- .../HideShortsComponentsResourcePatch.kt | 6 +-- .../hide/time/patch/HideTimestampPatch.kt | 8 +--- .../watermark/patch/HideWatermarkPatch.kt | 10 ++--- .../popup/patch/PlayerPopupPanelsPatch.kt | 8 +--- .../patch/PlayerControlsBackgroundPatch.kt | 6 +-- .../patch/ReturnYouTubeDislikePatch.kt | 16 +++---- .../ReturnYouTubeDislikeResourcePatch.kt | 6 +-- .../searchbar/patch/WideSearchbarPatch.kt | 9 +--- .../patch/SeekbarColorBytecodePatch.kt | 13 ++---- .../resource/SeekbarColorResourcePatch.kt | 11 +++-- .../resource/SeekbarPreferencesPatch.kt | 4 +- .../patch/SponsorBlockBytecodePatch.kt | 19 +++----- .../patch/SponsorBlockResourcePatch.kt | 6 +-- .../bytecode/patch/SpoofAppVersionPatch.kt | 8 +--- .../patch/DisableShortsOnStartupPatch.kt | 6 +-- .../patch/TabletMiniPlayerPatch.kt | 15 +++---- .../bytecode/patch/LithoColorHookPatch.kt | 8 +--- .../bytecode/patch/ThemeBytecodePatch.kt | 4 +- .../theme/resource/ThemeResourcePatch.kt | 10 ++--- .../AlternativeThumbnailsCompatibility.kt | 2 +- ...tURLRequestCallbackOnFailureFingerprint.kt | 2 +- ...estCallbackOnResponseStartedFingerprint.kt | 2 +- ...RLRequestCallbackOnSucceededFingerprint.kt | 2 +- .../MessageDigestImageUrlFingerprint.kt | 2 +- .../MessageDigestImageUrlParentFingerprint.kt | 2 +- .../patch/AlternativeThumbnailsPatch.kt | 36 +++++----------- .../misc/autorepeat/patch/AutoRepeatPatch.kt | 13 +++--- .../hook/patch/BottomSheetHookPatch.kt | 8 +--- .../patch/BottomSheetHookResourcePatch.kt | 10 ++--- .../misc/debugging/patch/DebuggingPatch.kt | 6 +-- .../patch/FixBackToExitGesturePatch.kt | 17 ++------ .../fix/playback/patch/ClientSpoofPatch.kt | 8 +--- .../patch/SpoofSignatureVerificationPatch.kt | 15 +++---- ...SpoofSignatureVerificationResourcePatch.kt | 6 +-- .../open/patch/OpenLinksExternallyPatch.kt | 8 +--- .../litho/filter/patch/LithoFilterPatch.kt | 14 +++--- .../patch/bytecode/MicroGBytecodePatch.kt | 6 +-- .../patch/resource/MicroGResourcePatch.kt | 6 +-- .../patch/MinimizedPlaybackPatch.kt | 15 +++---- .../patch/PlayerControlsBytecodePatch.kt | 8 +--- .../patch/BottomControlsResourcePatch.kt | 8 +--- .../patch/PlayerOverlaysHookPatch.kt | 5 +-- .../playertype/patch/PlayerTypeHookPatch.kt | 10 ++--- .../settings/bytecode/patch/SettingsPatch.kt | 8 +--- .../resource/patch/SettingsResourcePatch.kt | 8 +--- .../zoomhaptics/patch/ZoomHapticsPatch.kt | 6 +-- .../hdrbrightness/patch/HDRBrightnessPatch.kt | 6 +-- .../patch/VideoInformationPatch.kt | 9 +--- .../patch/RememberVideoQualityPatch.kt | 20 ++++----- .../youtube/video/speed/PlaybackSpeed.kt | 5 +-- .../custom/patch/CustomPlaybackSpeedPatch.kt | 14 +++--- .../patch/RememberPlaybackSpeedPatch.kt | 8 +--- .../video/videoid/patch/VideoIdPatch.kt | 6 +-- .../patch/OldVideoQualityMenuPatch.kt | 6 +-- .../patch/OldVideoQualityMenuResourcePatch.kt | 10 ++--- .../ad/general/patch/HideAdsPatch.kt | 8 +--- .../unlockpremium/patch/UnlockPremiunPatch.kt | 5 +-- .../util/microg/MicroGBytecodeHelper.kt | 24 +++++------ .../AbstractTransformInstructionsPatch.kt | 6 +-- .../revanced/util/resources/ResourceUtils.kt | 2 +- 214 files changed, 473 insertions(+), 1271 deletions(-) rename src/main/kotlin/app/revanced/patches/all/activity/{exportAll => exportall}/patch/ExportAllActivitiesPatch.kt (84%) rename src/main/kotlin/app/revanced/patches/youtube/layout/{alternativethumbnails => thumbnails}/annotations/AlternativeThumbnailsCompatibility.kt (79%) rename src/main/kotlin/app/revanced/patches/youtube/layout/{alternativethumbnails/bytecode => thumbnails}/fingerprints/CronetURLRequestCallbackOnFailureFingerprint.kt (85%) rename src/main/kotlin/app/revanced/patches/youtube/layout/{alternativethumbnails/bytecode => thumbnails}/fingerprints/CronetURLRequestCallbackOnResponseStartedFingerprint.kt (88%) rename src/main/kotlin/app/revanced/patches/youtube/layout/{alternativethumbnails/bytecode => thumbnails}/fingerprints/CronetURLRequestCallbackOnSucceededFingerprint.kt (85%) rename src/main/kotlin/app/revanced/patches/youtube/layout/{alternativethumbnails/bytecode => thumbnails}/fingerprints/MessageDigestImageUrlFingerprint.kt (79%) rename src/main/kotlin/app/revanced/patches/youtube/layout/{alternativethumbnails/bytecode => thumbnails}/fingerprints/MessageDigestImageUrlParentFingerprint.kt (82%) rename src/main/kotlin/app/revanced/patches/youtube/layout/{alternativethumbnails/bytecode => thumbnails}/patch/AlternativeThumbnailsPatch.kt (78%) diff --git a/build.gradle.kts b/build.gradle.kts index 7b793352..88bcaec7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -25,7 +25,7 @@ repositories { } dependencies { - implementation("app.revanced:revanced-patcher:13.0.0") + implementation("app.revanced:revanced-patcher:14.0.0") implementation("com.android.tools.smali:smali:3.0.3") // Required because build fails without it. // TODO: Find a way to remove this dependency. diff --git a/src/main/kotlin/app/revanced/extensions/Extensions.kt b/src/main/kotlin/app/revanced/extensions/Extensions.kt index 1998cf1d..649cf6c2 100644 --- a/src/main/kotlin/app/revanced/extensions/Extensions.kt +++ b/src/main/kotlin/app/revanced/extensions/Extensions.kt @@ -1,9 +1,10 @@ package app.revanced.extensions -import app.revanced.patcher.extensions.MethodFingerprintExtensions.name +import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction +import app.revanced.patcher.extensions.MethodFingerprintExtensions.name import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint -import app.revanced.patcher.patch.PatchResultError +import app.revanced.patcher.patch.PatchException import app.revanced.patcher.util.proxy.mutableTypes.MutableClass import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch @@ -13,13 +14,12 @@ import com.android.tools.smali.dexlib2.iface.instruction.WideLiteralInstruction import com.android.tools.smali.dexlib2.util.MethodUtil import org.w3c.dom.Node -// TODO: populate this to all patches /** - * Convert a [MethodFingerprint] to a [PatchResultError]. + * Return [PatchException] from a [MethodFingerprint]. * - * @return A [PatchResultError] for the [MethodFingerprint]. + * @return The [PatchException] for the [MethodFingerprint]. */ -internal fun MethodFingerprint.toErrorResult() = PatchResultError("Failed to resolve $name") +internal fun MethodFingerprint.toErrorResult() = PatchException("Failed to resolve $name") /** * Find the [MutableMethod] from a given [Method] in a [MutableClass]. @@ -82,3 +82,16 @@ fun Method.indexOfFirstConstantInstructionValue(constantValue: Long): Int { fun Method.containsConstantInstructionValue(constantValue: Long): Boolean { return indexOfFirstConstantInstructionValue(constantValue) >= 0 } + +/** + * traverse the class hierarchy starting from the given root class + * + * @param targetClass the class to start traversing the class hierarchy from + * @param callback function that is called for every class in the hierarchy + */ +fun BytecodeContext.traverseClassHierarchy(targetClass: MutableClass, callback: MutableClass.() -> Unit) { + callback(targetClass) + this.findClass(targetClass.superclass ?: return)?.mutableClass?.let { + traverseClassHierarchy(it, callback) + } +} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/meta/JsonGenerator.kt b/src/main/kotlin/app/revanced/meta/JsonGenerator.kt index cebf57d9..3be7793f 100644 --- a/src/main/kotlin/app/revanced/meta/JsonGenerator.kt +++ b/src/main/kotlin/app/revanced/meta/JsonGenerator.kt @@ -6,7 +6,6 @@ import app.revanced.patcher.extensions.PatchExtensions.description import app.revanced.patcher.extensions.PatchExtensions.include import app.revanced.patcher.extensions.PatchExtensions.options import app.revanced.patcher.extensions.PatchExtensions.patchName -import app.revanced.patcher.extensions.PatchExtensions.version import app.revanced.patcher.patch.PatchOption import com.google.gson.GsonBuilder import java.io.File @@ -17,7 +16,6 @@ internal class JsonGenerator : PatchesFileGenerator { JsonPatch( it.patchName, it.description ?: "This patch has no description.", - it.version ?: "0.0.0", !it.include, it.options?.map { option -> JsonPatch.Option( @@ -48,7 +46,6 @@ internal class JsonGenerator : PatchesFileGenerator { private class JsonPatch( val name: String, val description: String, - val version: String, val excluded: Boolean, val options: Array