├── settings.gradle.kts ├── gradle.properties ├── gradle ├── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties └── libs.versions.toml ├── .github ├── config.yml ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── feature-request.yml │ └── bug-report.yml └── workflows │ ├── pull_request.yml │ └── release.yml ├── src └── main │ ├── resources │ └── bilibili │ │ ├── appicon │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_round.png │ │ │ ├── ic_launcher_background.png │ │ │ ├── ic_launcher_foreground.png │ │ │ ├── ic_launcher_monochrome.png │ │ │ └── ic_launcher_foreground_round.png │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_round.png │ │ │ ├── ic_launcher_background.png │ │ │ ├── ic_launcher_foreground.png │ │ │ ├── ic_launcher_monochrome.png │ │ │ └── ic_launcher_foreground_round.png │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_round.png │ │ │ ├── ic_launcher_background.png │ │ │ ├── ic_launcher_foreground.png │ │ │ ├── ic_launcher_monochrome.png │ │ │ └── ic_launcher_foreground_round.png │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_round.png │ │ │ ├── ic_launcher_background.png │ │ │ ├── ic_launcher_foreground.png │ │ │ ├── ic_launcher_monochrome.png │ │ │ └── ic_launcher_foreground_round.png │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_round.png │ │ │ ├── ic_launcher_background.png │ │ │ ├── ic_launcher_foreground.png │ │ │ ├── ic_launcher_monochrome.png │ │ │ └── ic_launcher_foreground_round.png │ │ └── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ ├── drawable │ │ └── biliroaming_bg_transparent.webp │ │ ├── xml │ │ ├── biliroaming_setting_customize_bottom.xml │ │ ├── biliroaming_setting_customize_drawer.xml │ │ ├── biliroaming_setting_home_tab.xml │ │ ├── biliroaming_setting_filter_story.xml │ │ ├── biliroaming_setting_live_popups.xml │ │ ├── biliroaming_setting_block_follow.xml │ │ ├── biliroaming_setting_player_version.xml │ │ ├── biliroaming_setting_backup.xml │ │ ├── biliroaming_setting_subtitle_translate_server.xml │ │ ├── biliroaming_setting_customize_space.xml │ │ ├── biliroaming_setting_filter_search_type.xml │ │ ├── biliroaming_setting_display_size.xml │ │ ├── biliroaming_setting_upos.xml │ │ ├── biliroaming_setting_half_screen_quality.xml │ │ ├── biliroaming_setting_full_screen_quality.xml │ │ ├── biliroaming_setting_full_screen_quality_mobile.xml │ │ ├── biliroaming_setting_filter_dynamic_by_type.xml │ │ ├── biliroaming_setting_filter_home_by_type.xml │ │ ├── biliroaming_setting_external_downloader.xml │ │ ├── biliroaming_setting_filter_home.xml │ │ ├── biliroaming_setting_filter_comment.xml │ │ ├── biliroaming_setting_space.xml │ │ ├── biliroaming_setting_block_module.xml │ │ ├── biliroaming_setting_filter_popular.xml │ │ ├── biliroaming_setting_customize_search.xml │ │ ├── biliroaming_setting_about.xml │ │ ├── biliroaming_setting_video_detail_filter.xml │ │ ├── biliroaming_setting_customize_live_room.xml │ │ ├── biliroaming_setting_customize_mine.xml │ │ └── biliroaming_setting_unlock_area_limit.xml │ │ └── host │ │ └── values │ │ └── strings_raw.xml │ └── kotlin │ └── app │ └── revanced │ ├── generator │ ├── PatchesFileGenerator.kt │ ├── Main.kt │ └── JsonPatchesFileGenerator.kt │ ├── patches │ ├── bilibili │ │ ├── misc │ │ │ ├── copy │ │ │ │ └── fingerprints │ │ │ │ │ ├── CommentCopyOldFingerprint.kt │ │ │ │ │ ├── Comment3CopyFingerprint.kt │ │ │ │ │ ├── CommentCopyNewFingerprint.kt │ │ │ │ │ ├── DescCopyFingerprint.kt │ │ │ │ │ ├── ConversationCopyFingerprint.kt │ │ │ │ │ └── BaseCommentCopyFingerprint.kt │ │ │ ├── json │ │ │ │ └── fingerprints │ │ │ │ │ ├── JSONFingerprint.kt │ │ │ │ │ ├── PegasusParserFingerprint.kt │ │ │ │ │ ├── CardClickProcessorFingerprint.kt │ │ │ │ │ └── CardClickProcessorNewFingerprint.kt │ │ │ ├── okhttp │ │ │ │ └── fingerprints │ │ │ │ │ ├── HttpUrlFingerprint.kt │ │ │ │ │ ├── RequestFingerprint.kt │ │ │ │ │ ├── ResponseFingerprint.kt │ │ │ │ │ ├── MediaTypeGetFingerprint.kt │ │ │ │ │ ├── BufferFingerprint.kt │ │ │ │ │ ├── HeadersFingerprint.kt │ │ │ │ │ ├── ResponseBodyFingerprint.kt │ │ │ │ │ ├── BodyWrapperFingerprint.kt │ │ │ │ │ └── RealCallFingerprint.kt │ │ │ ├── other │ │ │ │ ├── fingerprints │ │ │ │ │ ├── SectionFingerprint.kt │ │ │ │ │ ├── BLRouteBuilderFingerprint.kt │ │ │ │ │ ├── RouteRequestFingerprint.kt │ │ │ │ │ ├── PublishToFollowingConfigFingerprint.kt │ │ │ │ │ ├── AttachChannelInfoFingerprint.kt │ │ │ │ │ ├── LiveRoomTouchDispatchViewModelFingerprint.kt │ │ │ │ │ ├── QualityViewHolderFingerprint.kt │ │ │ │ │ ├── ShareToFingerprint.kt │ │ │ │ │ ├── MainCommonServiceImplFingerprint.kt │ │ │ │ │ ├── TeenagersModeFingerprint.kt │ │ │ │ │ ├── LiveRoomSetFloatWindowFingerprint.kt │ │ │ │ │ ├── AppendTrackingInfoFingerprint.kt │ │ │ │ │ ├── SpaceBindAccountStateFingerprint.kt │ │ │ │ │ ├── OnOgvDownloadFingerprint.kt │ │ │ │ │ ├── MineBindAccountStateFingerprint.kt │ │ │ │ │ ├── FavFolderOnDataSuccessNewFingerprint.kt │ │ │ │ │ ├── FavFolderOnDataSuccessFingerprint.kt │ │ │ │ │ └── OgvSearchResultFingerprint.kt │ │ │ │ └── patch │ │ │ │ │ ├── NoManageSpaceActivityPatch.kt │ │ │ │ │ ├── PublishToFollowingPatch.kt │ │ │ │ │ ├── TeenagerModePatch.kt │ │ │ │ │ ├── ForbidLiveRoomSlideLeftPatch.kt │ │ │ │ │ ├── PlayManifestCompatibilityPatch.kt │ │ │ │ │ ├── SaveCommentImagePatch.kt │ │ │ │ │ ├── InjectDataProviderPatch.kt │ │ │ │ │ ├── ForbidSwitchLiveRoomPatch.kt │ │ │ │ │ ├── CrashHandlerPatch.kt │ │ │ │ │ ├── AutoLikePatch.kt │ │ │ │ │ ├── BLRoutePatch.kt │ │ │ │ │ ├── FavFolderDialogPatch.kt │ │ │ │ │ ├── TrialQualityPatch.kt │ │ │ │ │ ├── UpgradePatch.kt │ │ │ │ │ ├── BlockThaiCommentPatch.kt │ │ │ │ │ ├── CustomSplashPatch.kt │ │ │ │ │ ├── LiveRoomPatch.kt │ │ │ │ │ ├── NumberFormatPatch.kt │ │ │ │ │ └── AppendSignatureInfoPatch.kt │ │ │ ├── theme │ │ │ │ └── fingerprints │ │ │ │ │ ├── ThemeColorsFingerprint.kt │ │ │ │ │ ├── ThemeProcessorFingerprint.kt │ │ │ │ │ ├── ThemeHelperFingerprint.kt │ │ │ │ │ ├── WebActivityBuildUriFingerprint.kt │ │ │ │ │ ├── SkinListFingerprint.kt │ │ │ │ │ ├── ThemeClickFingerprint.kt │ │ │ │ │ ├── ThemeNameFingerprint.kt │ │ │ │ │ └── BuiltInThemesFingerprint.kt │ │ │ ├── integrations │ │ │ │ ├── fingerprints │ │ │ │ │ ├── BrotliFingerprint.kt │ │ │ │ │ ├── BLKVFingerprint.kt │ │ │ │ │ ├── AppCompatActivityFingerprint.kt │ │ │ │ │ ├── BaseMainFrameFragmentFingerprint.kt │ │ │ │ │ ├── InitFingerprint.kt │ │ │ │ │ └── DanmakuFontSwitchPreferenceFingerprint.kt │ │ │ │ └── patch │ │ │ │ │ ├── BrotliPatch.kt │ │ │ │ │ ├── ModifyModifierPatch.kt │ │ │ │ │ ├── ProtoBufPrintPatch.kt │ │ │ │ │ └── IntegrationsPatch.kt │ │ │ ├── protobuf │ │ │ │ ├── fingerprints │ │ │ │ │ ├── MossServiceFingerprint.kt │ │ │ │ │ └── MossMiddlewareGaiaFingerprint.kt │ │ │ │ └── patch │ │ │ │ │ ├── CommentReplyUrlPatch.kt │ │ │ │ │ └── UnlockProtobufPatch.kt │ │ │ ├── toast │ │ │ │ └── fingerprints │ │ │ │ │ └── LessonsModeToastFingerprint.kt │ │ │ ├── notification │ │ │ │ └── fingerprints │ │ │ │ │ ├── NotificationStyleAbFingerprint.kt │ │ │ │ │ ├── LiveNotificationHelperFingerprint.kt │ │ │ │ │ ├── HeadsetMediaSessionCallbackFingerprint.kt │ │ │ │ │ └── MediaSessionCallbackApi21Fingerprint.kt │ │ │ ├── config │ │ │ │ └── fingerprints │ │ │ │ │ ├── ABSourceFingerprint.kt │ │ │ │ │ └── ConfigSourceFingerprint.kt │ │ │ ├── settings │ │ │ │ ├── fingerprints │ │ │ │ │ ├── PreferenceManagerFingerprint.kt │ │ │ │ │ └── HdOnPreferenceClickFingerprint.kt │ │ │ │ └── patch │ │ │ │ │ ├── HdPreferenceFragmentPatch.kt │ │ │ │ │ └── HdPreferenceClickFixPatch.kt │ │ │ ├── drawer │ │ │ │ └── fingerprints │ │ │ │ │ ├── DrawerLayoutParamsFingerprint.kt │ │ │ │ │ ├── DrawerIsOpenFingerprint.kt │ │ │ │ │ └── DrawerControlFingerprint.kt │ │ │ ├── darkswitch │ │ │ │ └── fingerprints │ │ │ │ │ └── SwitchDarkModeFingerprint.kt │ │ │ ├── appicon │ │ │ │ └── AppIconPatch.kt │ │ │ ├── network │ │ │ │ └── OverrideCertificatePinningPatch.kt │ │ │ └── webview │ │ │ │ └── patch │ │ │ │ └── WebViewPatch.kt │ │ ├── video │ │ │ ├── player │ │ │ │ ├── fingerprints │ │ │ │ │ ├── MusicPlayerPanelFingerprint.kt │ │ │ │ │ ├── StoryMenuFingerprint.kt │ │ │ │ │ ├── PlayerGestureListenerFingerprint.kt │ │ │ │ │ ├── ResetResizeFunctionWidgetFingerprint.kt │ │ │ │ │ ├── NewShareServiceFingerprint.kt │ │ │ │ │ ├── PlayerOnPreparedFingerprint.kt │ │ │ │ │ ├── PlayerSpeedWidgetFingerprint.kt │ │ │ │ │ ├── PlaybackSpeedSettingFingerprint.kt │ │ │ │ │ ├── SpeedFunctionWidgetFingerprint.kt │ │ │ │ │ ├── MenuFuncSegmentFingerprint.kt │ │ │ │ │ ├── IjkMediaPlayerOptionsFingerprint.kt │ │ │ │ │ ├── TripleSpeedServiceFingerprint.kt │ │ │ │ │ ├── ShowPlayerToastFingerprint.kt │ │ │ │ │ ├── TripleSpeedServiceUniteFingerprint.kt │ │ │ │ │ ├── PlayerGestureRotateFingerprint.kt │ │ │ │ │ └── BangumiKeyDownHandlerFingerprint.kt │ │ │ │ └── patch │ │ │ │ │ ├── BangumiKeyDownHandlerPatch.kt │ │ │ │ │ ├── DefaultPlaybackSpeedPatch.kt │ │ │ │ │ └── LongPressPlaybackSpeedPatch.kt │ │ │ ├── quality │ │ │ │ ├── fingerprints │ │ │ │ │ └── PlayerSettingHelperFingerprint.kt │ │ │ │ └── patch │ │ │ │ │ └── VideoQualityPatch.kt │ │ │ └── subtitle │ │ │ │ └── fingerprints │ │ │ │ ├── PlayerContainerFingerprint.kt │ │ │ │ ├── FunctionWidgetServiceFingerprint.kt │ │ │ │ ├── FunctionWidgetTokenFingerprint.kt │ │ │ │ ├── PlayerSubtitleFunctionWidgetFingerprint.kt │ │ │ │ └── SetDmViewReplyFingerprint.kt │ │ ├── layout │ │ │ ├── fingerprints │ │ │ │ └── FullStoryWidgetFingerprint.kt │ │ │ └── patch │ │ │ │ ├── HideFollowButtonPatch.kt │ │ │ │ └── RemoveVipSectionPatch.kt │ │ ├── patcher │ │ │ └── patch │ │ │ │ └── MultiMethodBytecodePatch.kt │ │ └── ads │ │ │ └── patch │ │ │ └── UpRcmdAdsPatch.kt │ ├── all │ │ ├── misc │ │ │ ├── debugging │ │ │ │ └── EnableAndroidDebuggingPatch.kt │ │ │ ├── packagename │ │ │ │ └── ChangePackageNamePatch.kt │ │ │ └── transformation │ │ │ │ └── BaseTransformInstructionsPatch.kt │ │ ├── screencapture │ │ │ └── removerestriction │ │ │ │ ├── RemoveCaptureRestrictionResourcePatch.kt │ │ │ │ └── RemoveCaptureRestrictionPatch.kt │ │ ├── interaction │ │ │ └── gestures │ │ │ │ └── PredictiveBackGesturePatch.kt │ │ └── activity │ │ │ └── exportall │ │ │ └── ExportAllActivitiesPatch.kt │ └── shared │ │ └── misc │ │ ├── mapping │ │ └── ResourceMappingPatch.kt │ │ └── integrations │ │ └── BaseIntegrationsPatch.kt │ └── util │ └── patch │ └── LiteralValueFingerprint.kt ├── .gitattributes ├── package.json ├── .releaserc ├── assets └── revanced-logo │ └── revanced-logo-round.svg └── .gitignore /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "BiliRoamingX-patches" 2 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.parallel=true 2 | org.gradle.caching=true 3 | kotlin.code.style=official 4 | version=1.19.2 5 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /.github/config.yml: -------------------------------------------------------------------------------- 1 | firstPRMergeComment: > 2 | Thank you for contributing to ReVanced. Join us on [Discord](https://revanced.app/discord) if you want to receive a contributor role. 3 | -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/appicon/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/appicon/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/appicon/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/appicon/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/appicon/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /src/main/resources/bilibili/drawable/biliroaming_bg_transparent.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/drawable/biliroaming_bg_transparent.webp -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/appicon/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/appicon/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/appicon/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/appicon/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/appicon/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-hdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/appicon/mipmap-hdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/appicon/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-hdpi/ic_launcher_monochrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/appicon/mipmap-hdpi/ic_launcher_monochrome.png -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-mdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/appicon/mipmap-mdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/appicon/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-mdpi/ic_launcher_monochrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/appicon/mipmap-mdpi/ic_launcher_monochrome.png -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-xhdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/appicon/mipmap-xhdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/appicon/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-xhdpi/ic_launcher_monochrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/appicon/mipmap-xhdpi/ic_launcher_monochrome.png -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-xxhdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/appicon/mipmap-xxhdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/appicon/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-xxhdpi/ic_launcher_monochrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/appicon/mipmap-xxhdpi/ic_launcher_monochrome.png -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-xxxhdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/appicon/mipmap-xxxhdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/appicon/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-xxxhdpi/ic_launcher_monochrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/appicon/mipmap-xxxhdpi/ic_launcher_monochrome.png -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-hdpi/ic_launcher_foreground_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/appicon/mipmap-hdpi/ic_launcher_foreground_round.png -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-mdpi/ic_launcher_foreground_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/appicon/mipmap-mdpi/ic_launcher_foreground_round.png -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-xhdpi/ic_launcher_foreground_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/appicon/mipmap-xhdpi/ic_launcher_foreground_round.png -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-xxhdpi/ic_launcher_foreground_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/appicon/mipmap-xxhdpi/ic_launcher_foreground_round.png -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-xxxhdpi/ic_launcher_foreground_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjns/BiliRoamingX-patches/HEAD/src/main/resources/bilibili/appicon/mipmap-xxxhdpi/ic_launcher_foreground_round.png -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/generator/PatchesFileGenerator.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.generator 2 | 3 | import app.revanced.patcher.PatchSet 4 | 5 | internal interface PatchesFileGenerator { 6 | fun generate(patches: PatchSet) 7 | } 8 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/copy/fingerprints/CommentCopyOldFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.copy.fingerprints 2 | 3 | object CommentCopyOldFingerprint : BaseCommentCopyFingerprint("Landroid/view/View;") 4 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # 2 | # https://help.github.com/articles/dealing-with-line-endings/ 3 | # 4 | # Linux start script should use lf 5 | /gradlew text eol=lf 6 | 7 | # These are Windows script files and should use crlf 8 | *.bat text eol=crlf 9 | 10 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: 🗨 Discussions 4 | url: https://github.com/revanced/revanced-suggestions/discussions 5 | about: Have something unspecific to ReVanced Patches in mind? Search for or start a new discussion! -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/copy/fingerprints/Comment3CopyFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.copy.fingerprints 2 | 3 | object Comment3CopyFingerprint : BaseCommentCopyFingerprint( 4 | "Lcom/bilibili/app/comment3/data/model/CommentItem;" 5 | ) 6 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/json/fingerprints/JSONFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.json.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object JSONFingerprint : MethodFingerprint(strings = listOf("toJSON error")) 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "@saithodev/semantic-release-backmerge": "^3.1.0", 4 | "@semantic-release/changelog": "^6.0.2", 5 | "@semantic-release/git": "^10.0.1", 6 | "gradle-semantic-release-plugin": "^1.7.6", 7 | "semantic-release": "^20.1.0" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/copy/fingerprints/CommentCopyNewFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.copy.fingerprints 2 | 3 | object CommentCopyNewFingerprint : BaseCommentCopyFingerprint( 4 | "Lcom/bilibili/app/comm/comment2/phoenix/view/CommentMessageWidget;" 5 | ) 6 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/okhttp/fingerprints/HttpUrlFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.okhttp.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object HttpUrlFingerprint : MethodFingerprint(strings = listOf("javaWhitespace")) 6 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/okhttp/fingerprints/RequestFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.okhttp.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object RequestFingerprint : MethodFingerprint(strings = listOf("Request{method=")) 6 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/okhttp/fingerprints/ResponseFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.okhttp.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object ResponseFingerprint : MethodFingerprint(strings = listOf("Response{protocol=")) 6 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/other/fingerprints/SectionFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.other.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object SectionFingerprint : MethodFingerprint( 6 | strings = listOf("ActionViewHolder") 7 | ) 8 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/okhttp/fingerprints/MediaTypeGetFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.okhttp.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object MediaTypeGetFingerprint : MethodFingerprint(strings = listOf("No subtype found for:")) 6 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/json/fingerprints/PegasusParserFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.json.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object PegasusParserFingerprint : MethodFingerprint( 6 | strings = listOf("card_type is empty"), 7 | ) 8 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/okhttp/fingerprints/BufferFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.okhttp.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object BufferFingerprint : MethodFingerprint( 6 | strings = listOf("already attached to a buffer"), 7 | ) 8 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/other/fingerprints/BLRouteBuilderFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.other.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object BLRouteBuilderFingerprint : MethodFingerprint( 6 | strings = listOf("Builder(targetUri=") 7 | ) 8 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/other/fingerprints/RouteRequestFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.other.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object RouteRequestFingerprint : MethodFingerprint( 6 | strings = listOf("RouteRequest(targetUri=") 7 | ) 8 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/theme/fingerprints/ThemeColorsFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.theme.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object ThemeColorsFingerprint : MethodFingerprint( 6 | strings = listOf("GarbThemeColors(garb=") 7 | ) 8 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/video/player/fingerprints/MusicPlayerPanelFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.video.player.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object MusicPlayerPanelFingerprint : MethodFingerprint( 6 | strings = listOf("turn_left", "video") 7 | ) 8 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/integrations/fingerprints/BrotliFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.integrations.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object BrotliFingerprint : MethodFingerprint( 6 | strings = listOf("Brotli decoder initialization failed") 7 | ) 8 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/okhttp/fingerprints/HeadersFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.okhttp.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object HeadersFingerprint : MethodFingerprint( 6 | strings = listOf("Expected alternating header names and values") 7 | ) 8 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/okhttp/fingerprints/ResponseBodyFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.okhttp.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object ResponseBodyFingerprint : MethodFingerprint( 6 | strings = listOf("Cannot buffer entire body for content length: ") 7 | ) 8 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/video/player/fingerprints/StoryMenuFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.video.player.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object StoryMenuFingerprint : MethodFingerprint( 6 | strings = listOf("story_action_normal_share", "story_setting_normal_share") 7 | ) 8 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/other/fingerprints/PublishToFollowingConfigFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.other.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object PublishToFollowingConfigFingerprint : MethodFingerprint( 6 | strings = listOf("PublishToFollowingConfig(visible=") 7 | ) 8 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/protobuf/fingerprints/MossServiceFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.protobuf.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object MossServiceFingerprint : MethodFingerprint( 6 | strings = listOf("moss.service", "MossService start to build engine.") 7 | ) 8 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/video/player/fingerprints/PlayerGestureListenerFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.video.player.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object PlayerGestureListenerFingerprint : MethodFingerprint( 6 | strings = listOf("player.player.gesture.rotate.player") 7 | ) 8 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/video/player/fingerprints/ResetResizeFunctionWidgetFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.video.player.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object ResetResizeFunctionWidgetFingerprint : MethodFingerprint( 6 | strings = listOf("ResetResizeFunctionWidget") 7 | ) 8 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/protobuf/fingerprints/MossMiddlewareGaiaFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.protobuf.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object MossMiddlewareGaiaFingerprint : MethodFingerprint( 6 | strings = listOf("moss.middleware.gaia", "Call onVoucher for") 7 | ) 8 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/toast/fingerprints/LessonsModeToastFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.toast.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object LessonsModeToastFingerprint : MethodFingerprint( 6 | strings = listOf("main.lessonmodel.enterdetail.change-pswd-success.click") 7 | ) 8 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/video/player/fingerprints/NewShareServiceFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.video.player.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object NewShareServiceFingerprint : MethodFingerprint( 6 | strings = listOf("pgc.pgc-video-detail.half-player-more-option.0.click") 7 | ) 8 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/json/fingerprints/CardClickProcessorFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.json.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object CardClickProcessorFingerprint : MethodFingerprint( 6 | strings = listOf("action:feed:dislike_reason", "action:feed:dislike_toast") 7 | ) 8 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/other/fingerprints/AttachChannelInfoFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.other.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object AttachChannelInfoFingerprint : MethodFingerprint( 6 | strings = listOf("Channel info has already exist."), 7 | returnType = "V" 8 | ) 9 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/video/player/fingerprints/PlayerOnPreparedFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.video.player.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object PlayerOnPreparedFingerprint : MethodFingerprint( 6 | strings = listOf("PlayerCoreServiceV2", "[ijk][callback]player onPrepared") 7 | ) 8 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/video/player/fingerprints/PlayerSpeedWidgetFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.video.player.fingerprints 2 | 3 | import app.revanced.patches.bilibili.patcher.fingerprint.MultiMethodFingerprint 4 | 5 | object PlayerSpeedWidgetFingerprint : MultiMethodFingerprint( 6 | strings = listOf("player.player.speed.0.player") 7 | ) 8 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/okhttp/fingerprints/BodyWrapperFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.okhttp.fingerprints 2 | 3 | import app.revanced.patches.bilibili.patcher.fingerprint.MultiMethodFingerprint 4 | 5 | object BodyWrapperFingerprint : MultiMethodFingerprint( 6 | strings = listOf("Cannot read raw response body of a converted body."), 7 | ) 8 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/other/fingerprints/LiveRoomTouchDispatchViewModelFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.other.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object LiveRoomTouchDispatchViewModelFingerprint : MethodFingerprint( 6 | strings = listOf("LiveRoomTouchDispatchViewModel_slideRightToLeft") 7 | ) 8 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/video/player/fingerprints/PlaybackSpeedSettingFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.video.player.fingerprints 2 | 3 | import app.revanced.patches.bilibili.patcher.fingerprint.MultiMethodFingerprint 4 | 5 | object PlaybackSpeedSettingFingerprint : MultiMethodFingerprint( 6 | strings = listOf("player.player.full-more.speed.player") 7 | ) 8 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/video/player/fingerprints/SpeedFunctionWidgetFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.video.player.fingerprints 2 | 3 | import app.revanced.patches.bilibili.patcher.fingerprint.MultiMethodFingerprint 4 | 5 | object SpeedFunctionWidgetFingerprint : MultiMethodFingerprint( 6 | strings = listOf("player.player.choose-speed.0.player") 7 | ) 8 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/other/fingerprints/QualityViewHolderFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.other.fingerprints 2 | 3 | import app.revanced.patches.bilibili.patcher.fingerprint.MultiMethodFingerprint 4 | 5 | object QualityViewHolderFingerprint : MultiMethodFingerprint( 6 | strings = listOf("last_4k_hint_show_timestamp", "player.qn_4k_tip") 7 | ) 8 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/integrations/fingerprints/BLKVFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.integrations.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object BLKVFingerprint : MethodFingerprint( 6 | strings = listOf(".blkv"), 7 | parameters = listOf("Landroid/content/Context;", "Ljava/lang/String;", "Z", "I") 8 | ) 9 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/video/quality/fingerprints/PlayerSettingHelperFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.video.quality.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object PlayerSettingHelperFingerprint : MethodFingerprint( 6 | returnType = "I", 7 | strings = listOf("PlayerSettingHelper", "get free data failed") 8 | ) 9 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/video/subtitle/fingerprints/PlayerContainerFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.video.subtitle.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object PlayerContainerFingerprint : MethodFingerprint( 6 | strings = listOf("class=%s is not core service"), 7 | parameters = listOf("Ljava/lang/Class;"), 8 | ) 9 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/other/fingerprints/ShareToFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.other.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object ShareToFingerprint : MethodFingerprint( 6 | strings = listOf("share.helper.inner"), 7 | returnType = "V", 8 | parameters = listOf("Ljava/lang/String;") 9 | ) 10 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/theme/fingerprints/ThemeProcessorFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.theme.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object ThemeProcessorFingerprint : MethodFingerprint( 6 | strings = listOf("theme2-account"), 7 | parameters = listOf("Ltv/danmaku/bili/ui/theme/api/BiliSkinList;") 8 | ) 9 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/other/fingerprints/MainCommonServiceImplFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.other.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object MainCommonServiceImplFingerprint : MethodFingerprint( 6 | strings = listOf("is_use_upload_image_api"), 7 | parameters = listOf(), 8 | returnType = "Z" 9 | ) 10 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/other/fingerprints/TeenagersModeFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.other.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object TeenagersModeFingerprint : MethodFingerprint( 6 | strings = listOf("restrictedmode.teenagers_alert_api_config", "teenagers_mode_show_dialog_interval"), 7 | returnType = "Z" 8 | ) 9 | -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/integrations/fingerprints/AppCompatActivityFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.integrations.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object AppCompatActivityFingerprint : MethodFingerprint( 6 | strings = listOf("androidx:appcompat"), 7 | parameters = listOf(), 8 | returnType = "V" 9 | ) 10 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/video/player/fingerprints/MenuFuncSegmentFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.video.player.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object MenuFuncSegmentFingerprint : MethodFingerprint( 6 | strings = listOf("pref_key_share_listen_show_new"), 7 | customFingerprint = { _, classDef -> '$' !in classDef.type } 8 | ) 9 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/theme/fingerprints/ThemeHelperFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.theme.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object ThemeHelperFingerprint : MethodFingerprint( 6 | strings = listOf("theme_entries_last_key"), 7 | returnType = "I", 8 | parameters = listOf("Landroid/content/Context;") 9 | ) 10 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/video/subtitle/fingerprints/FunctionWidgetServiceFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.video.subtitle.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object FunctionWidgetServiceFingerprint : MethodFingerprint( 6 | strings = listOf("illegal function type"), 7 | parameters = listOf("I"), 8 | returnType = "I" 9 | ) 10 | -------------------------------------------------------------------------------- /src/main/resources/bilibili/appicon/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/video/subtitle/fingerprints/FunctionWidgetTokenFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.video.subtitle.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object FunctionWidgetTokenFingerprint : MethodFingerprint( 6 | strings = listOf("id=", ";clazz="), 7 | parameters = listOf(), 8 | returnType = "Ljava/lang/String;" 9 | ) 10 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/copy/fingerprints/DescCopyFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.copy.fingerprints 2 | 3 | import app.revanced.patches.bilibili.patcher.fingerprint.MultiMethodFingerprint 4 | 5 | object DescCopyFingerprint : MultiMethodFingerprint( 6 | returnType = "V", 7 | parameters = listOf("Z", "Ljava/lang/String;"), 8 | strings = listOf("clipboard", "text") 9 | ) 10 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/notification/fingerprints/NotificationStyleAbFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.notification.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object NotificationStyleAbFingerprint : MethodFingerprint( 6 | strings = listOf("ff_background_use_system_media_controls"), 7 | returnType = "Z", 8 | parameters = listOf() 9 | ) 10 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/integrations/fingerprints/BaseMainFrameFragmentFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.integrations.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object BaseMainFrameFragmentFingerprint : MethodFingerprint( 6 | strings = listOf("home.menu_update_enable"), 7 | parameters = listOf("Ljava/util/List;"), 8 | returnType = "V" 9 | ) 10 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/video/player/fingerprints/IjkMediaPlayerOptionsFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.video.player.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object IjkMediaPlayerOptionsFingerprint : MethodFingerprint( 6 | strings = listOf("enable-decoder-switch", "enable-use-https-when-forbidden"), 7 | parameters = listOf(), 8 | returnType = "V" 9 | ) 10 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/video/player/fingerprints/TripleSpeedServiceFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.video.player.fingerprints 2 | 3 | import app.revanced.patches.bilibili.patcher.fingerprint.MultiMethodFingerprint 4 | 5 | object TripleSpeedServiceFingerprint : MultiMethodFingerprint( 6 | strings = listOf("player.player.gesture.speedup.player"), 7 | returnType = "V", 8 | parameters = listOf() 9 | ) 10 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/config/fingerprints/ABSourceFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.config.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object ABSourceFingerprint : MethodFingerprint( 6 | strings = listOf("getMBean()Lcom/bilibili/lib/blconfig/internal/ABBean;"), 7 | customFingerprint = { methodDef, _ -> 8 | methodDef.name == "" 9 | } 10 | ) 11 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/video/player/fingerprints/ShowPlayerToastFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.video.player.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object ShowPlayerToastFingerprint : MethodFingerprint( 6 | strings = listOf("extra_title", "player show toast:"), 7 | parameters = listOf("Ltv/danmaku/biliplayerv2/widget/toast/PlayerToast;"), 8 | returnType = "V" 9 | ) 10 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/video/player/fingerprints/TripleSpeedServiceUniteFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.video.player.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object TripleSpeedServiceUniteFingerprint : MethodFingerprint( 6 | strings = listOf("player.player.gesture.speedup.player"), 7 | returnType = "Ljava/lang/Object;", 8 | parameters = listOf("Ljava/lang/Object;") 9 | ) 10 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/settings/fingerprints/PreferenceManagerFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.settings.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object PreferenceManagerFingerprint : MethodFingerprint( 6 | strings = listOf("_has_set_default_values"), 7 | parameters = listOf("Landroid/content/Context;", "Ljava/lang/String;", "I", "I", "Z"), 8 | returnType = "V" 9 | ) 10 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/config/fingerprints/ConfigSourceFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.config.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object ConfigSourceFingerprint : MethodFingerprint( 6 | strings = listOf("AES/CBC/PKCS7Padding"), 7 | customFingerprint = { methodDef, classDef -> 8 | methodDef.name == "" && classDef.interfaces.isNotEmpty() 9 | } 10 | ) 11 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/notification/fingerprints/LiveNotificationHelperFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.notification.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object LiveNotificationHelperFingerprint : MethodFingerprint( 6 | strings = listOf("buildLiveNotification"), 7 | returnType = "Landroid/app/Notification;", 8 | parameters = listOf("Landroid/graphics/Bitmap;") 9 | ) 10 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/other/fingerprints/LiveRoomSetFloatWindowFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.other.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object LiveRoomSetFloatWindowFingerprint : MethodFingerprint( 6 | strings = listOf("live_float_window_is_open", "bundle_key_player_params_controller_enable_live_window_play"), 7 | parameters = listOf("Z"), 8 | returnType = "V" 9 | ) 10 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/theme/fingerprints/WebActivityBuildUriFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.theme.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object WebActivityBuildUriFingerprint : MethodFingerprint( 6 | strings = listOf("native.theme", "night"), 7 | customFingerprint = { _, classDef -> 8 | classDef.type == "Ltv/danmaku/bili/ui/webview/MWebActivity;" 9 | } 10 | ) 11 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/other/fingerprints/AppendTrackingInfoFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.other.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object AppendTrackingInfoFingerprint : MethodFingerprint( 6 | strings = listOf("share_medium", "share_source", "bbid", "ts"), 7 | returnType = "Ljava/lang/String;", 8 | parameters = listOf("Ljava/lang/String;", "Ljava/lang/String;") 9 | ) 10 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/video/subtitle/fingerprints/PlayerSubtitleFunctionWidgetFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.video.subtitle.fingerprints 2 | 3 | import app.revanced.patches.bilibili.patcher.fingerprint.MultiMethodFingerprint 4 | 5 | object PlayerSubtitleFunctionWidgetFingerprint : MultiMethodFingerprint( 6 | strings = listOf("PlayerSubtitleFunctionWidget"), 7 | parameters = listOf(), 8 | returnType = "Ljava/lang/String;" 9 | ) 10 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/video/subtitle/fingerprints/SetDmViewReplyFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.video.subtitle.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object SetDmViewReplyFingerprint : MethodFingerprint( 6 | strings = listOf("danmaku_switch", "player.damaku.senior.mode"), 7 | parameters = listOf("Lcom/bapis/bilibili/community/service/dm/v1/DmViewReply;"), 8 | returnType = "V", 9 | ) 10 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/integrations/fingerprints/InitFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.integrations.fingerprints 2 | 3 | import app.revanced.patches.shared.misc.integrations.BaseIntegrationsPatch 4 | 5 | object InitFingerprint : BaseIntegrationsPatch.IntegrationsFingerprint( 6 | customFingerprint = { methodDef, _ -> 7 | methodDef.definingClass == "Lcom/bilibili/gripper/BiliApp;" && methodDef.name == "onCreate" 8 | } 9 | ) 10 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/notification/fingerprints/HeadsetMediaSessionCallbackFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.notification.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object HeadsetMediaSessionCallbackFingerprint : MethodFingerprint( 6 | strings = listOf("onMediaButtonEvent has a exception keyEventMessage:"), 7 | parameters = listOf("Landroid/content/Intent;"), 8 | returnType = "Z" 9 | ) 10 | -------------------------------------------------------------------------------- /src/main/resources/bilibili/xml/biliroaming_setting_customize_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/bilibili/xml/biliroaming_setting_customize_drawer.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | 9 | -------------------------------------------------------------------------------- /gradle/libs.versions.toml: -------------------------------------------------------------------------------- 1 | [versions] 2 | revanced-patcher = "19.3.1" 3 | smali = "3.0.3" 4 | gson = "2.10.1" 5 | kotlin = "1.9.23" 6 | 7 | [libraries] 8 | revanced-patcher = { module = "kofua.app.revanced:revanced-patcher", version.ref = "revanced-patcher" } 9 | smali = { module = "com.android.tools.smali:smali", version.ref = "smali" } 10 | gson = { module = "com.google.code.gson:gson", version.ref = "gson" } 11 | 12 | [plugins] 13 | kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } 14 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/theme/fingerprints/SkinListFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.theme.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object SkinListFingerprint : MethodFingerprint( 6 | returnType = "V", 7 | parameters = listOf("Ltv/danmaku/bili/ui/theme/api/BiliSkinList;", "Z"), 8 | customFingerprint = { _, classDef -> 9 | classDef.type == "Ltv/danmaku/bili/ui/theme/ThemeStoreActivity;" 10 | } 11 | ) 12 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/copy/fingerprints/ConversationCopyFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.copy.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object ConversationCopyFingerprint : MethodFingerprint( 6 | returnType = "V", 7 | strings = listOf("clipboard", "im.chat-group.msg.repost.click"), 8 | customFingerprint = { _, classDef -> 9 | classDef.type == "Lcom/bilibili/bplus/im/conversation/ConversationActivity;" 10 | } 11 | ) 12 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/notification/fingerprints/MediaSessionCallbackApi21Fingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.notification.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object MediaSessionCallbackApi21Fingerprint : MethodFingerprint( 6 | strings = listOf("android.support.v4.media.session.action.PLAY_FROM_URI", "Could not unparcel the data."), 7 | parameters = listOf("Ljava/lang/String;", "Landroid/os/Bundle;"), 8 | returnType = "V" 9 | ) 10 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/generator/Main.kt: -------------------------------------------------------------------------------- 1 | @file:JvmName("Main") 2 | 3 | package app.revanced.generator 4 | 5 | import app.revanced.patcher.PatchBundleLoader 6 | import java.io.File 7 | 8 | internal fun main() = PatchBundleLoader.Jar( 9 | File("build/libs/").listFiles { it -> it.name.endsWith(".jar") }!!.first(), 10 | ).also { loader -> 11 | if (loader.isEmpty()) throw IllegalStateException("No patches found") 12 | }.let { bundle -> 13 | arrayOf(JsonPatchesFileGenerator()).forEach { generator -> generator.generate(bundle) } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/drawer/fingerprints/DrawerLayoutParamsFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.drawer.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object DrawerLayoutParamsFingerprint : MethodFingerprint( 6 | customFingerprint = { methodDef, classDef -> 7 | methodDef.definingClass.startsWith("Landroidx/drawerlayout/widget/DrawerLayout") 8 | && classDef.superclass == "Landroid/view/ViewGroup\$MarginLayoutParams;" 9 | } 10 | ) 11 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/integrations/fingerprints/DanmakuFontSwitchPreferenceFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.integrations.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object DanmakuFontSwitchPreferenceFingerprint : MethodFingerprint( 6 | strings = listOf("danmaku_setting_use_recommend_font", "chronos_enable_dfm_v3"), 7 | parameters = listOf("Landroid/content/Context;"), 8 | customFingerprint = { methodDef, _ -> 9 | methodDef.name == "" 10 | } 11 | ) 12 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/layout/fingerprints/FullStoryWidgetFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.layout.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | open class FullStoryWidgetFingerprint(tagName: String) : MethodFingerprint( 6 | strings = listOf(tagName, "player.player.story-button.0.player") 7 | ) 8 | 9 | object PlayerFullStoryWidgetFingerprint : FullStoryWidgetFingerprint("PlayerFullStoryWidget") 10 | object GeminiPlayerFullStoryWidgetFingerprint : FullStoryWidgetFingerprint("GeminiPlayerFullStoryWidget") 11 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/other/fingerprints/SpaceBindAccountStateFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.other.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object SpaceBindAccountStateFingerprint : MethodFingerprint( 6 | strings = listOf("-", "0"), 7 | parameters = listOf("Lcom/bilibili/app/authorspace/api/BiliMemberCard;"), 8 | returnType = "V", 9 | customFingerprint = { _, classDef -> 10 | classDef.type == "Lcom/bilibili/app/authorspace/ui/SpaceHeaderFragment2;" 11 | } 12 | ) 13 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/theme/fingerprints/ThemeClickFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.theme.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object ThemeClickFingerprint : MethodFingerprint( 6 | strings = listOf("activity://main/login/"), 7 | returnType = "V", 8 | parameters = listOf("Landroid/view/View;"), 9 | customFingerprint = { methodDef, classDef -> 10 | methodDef.name == "onClick" 11 | && classDef.type.startsWith("Ltv/danmaku/bili/ui/theme/ThemeStoreActivity$") 12 | } 13 | ) 14 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/other/fingerprints/OnOgvDownloadFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.other.fingerprints 2 | 3 | import app.revanced.patches.bilibili.patcher.fingerprint.MultiMethodFingerprint 4 | 5 | object OnOgvDownloadFingerprint : MultiMethodFingerprint( 6 | strings = listOf("pgc.pgc-video-detail.downloadbutton.0"), 7 | returnType = "V", 8 | customFingerprint = { methodDef, _ -> 9 | methodDef.parameterTypes.let { 10 | it.size == 2 && it[0] == "Landroid/content/Context;" && it[1].endsWith("OGVCacheFromType;") 11 | } 12 | } 13 | ) 14 | -------------------------------------------------------------------------------- /src/main/resources/bilibili/xml/biliroaming_setting_home_tab.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 10 | 11 | -------------------------------------------------------------------------------- /src/main/resources/bilibili/xml/biliroaming_setting_filter_story.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 10 | 11 | -------------------------------------------------------------------------------- /src/main/resources/bilibili/xml/biliroaming_setting_live_popups.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 10 | 11 | -------------------------------------------------------------------------------- /src/main/resources/bilibili/xml/biliroaming_setting_block_follow.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 10 | 11 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/json/fingerprints/CardClickProcessorNewFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.json.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object CardClickProcessorNewFingerprint : MethodFingerprint( 6 | strings = listOf("tm.recommend.0.0"), 7 | returnType = "V", 8 | customFingerprint = { methodDef, _ -> 9 | methodDef.parameterTypes.let { 10 | it.size == 4 && it[1] == "Lcom/bilibili/pegasus/data/FeedbackType;" 11 | && it[3] == "Lcom/bilibili/app/comm/list/common/data/DislikeReason;" 12 | } 13 | } 14 | ) 15 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/other/fingerprints/MineBindAccountStateFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.other.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object MineBindAccountStateFingerprint : MethodFingerprint( 6 | strings = listOf("-", "0"), 7 | parameters = listOf("Ltv/danmaku/bili/ui/main2/api/AccountMine;", "Z"), 8 | returnType = "V", 9 | customFingerprint = { _, classDef -> 10 | classDef.type == "Ltv/danmaku/bili/ui/main2/mine/HomeUserCenterFragment;" || classDef.type == "Ltv/danmaku/bilibilihd/ui/main/mine/HdHomeUserCenterFragment;" 11 | } 12 | ) 13 | -------------------------------------------------------------------------------- /src/main/resources/bilibili/xml/biliroaming_setting_player_version.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /src/main/resources/bilibili/xml/biliroaming_setting_backup.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/resources/bilibili/xml/biliroaming_setting_subtitle_translate_server.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/theme/fingerprints/ThemeNameFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.theme.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | import com.android.tools.smali.dexlib2.Opcode 5 | 6 | object ThemeNameFingerprint : MethodFingerprint( 7 | strings = listOf("purple"), 8 | opcodes = listOf( 9 | Opcode.CONST_16, 10 | Opcode.NEW_ARRAY, 11 | Opcode.INVOKE_STATIC, 12 | Opcode.MOVE_RESULT_OBJECT, 13 | Opcode.CONST_STRING, 14 | Opcode.INVOKE_STATIC, 15 | Opcode.MOVE_RESULT_OBJECT, 16 | ), 17 | customFingerprint = { methodDef, _ -> 18 | methodDef.name == "" 19 | } 20 | ) 21 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/okhttp/fingerprints/RealCallFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.okhttp.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | import com.android.tools.smali.dexlib2.Opcode 5 | 6 | object RealCallFingerprint : MethodFingerprint( 7 | strings = listOf("Canceled"), 8 | parameters = listOf(), 9 | opcodes = listOf( 10 | Opcode.NEW_INSTANCE, 11 | Opcode.INVOKE_DIRECT, 12 | Opcode.IGET_OBJECT, 13 | Opcode.INVOKE_VIRTUAL, 14 | Opcode.MOVE_RESULT_OBJECT, 15 | ), 16 | customFingerprint = { methodDef, _ -> 17 | methodDef.returnType == ResponseFingerprint.result!!.classDef.type 18 | } 19 | ) 20 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/theme/fingerprints/BuiltInThemesFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.theme.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | import com.android.tools.smali.dexlib2.Opcode 5 | import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c 6 | 7 | object BuiltInThemesFingerprint : MethodFingerprint( 8 | customFingerprint = { methodDef, _ -> 9 | methodDef.name == "" && methodDef.implementation?.instructions?.count { inst -> 10 | inst.opcode == Opcode.INVOKE_VIRTUAL && inst is Instruction35c 11 | && inst.reference.toString() == "Lcom/bilibili/lib/ui/garb/Garb;->setDarkMode(Z)V" 12 | } == 2 13 | } 14 | ) 15 | -------------------------------------------------------------------------------- /src/main/resources/bilibili/xml/biliroaming_setting_customize_space.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/resources/bilibili/xml/biliroaming_setting_filter_search_type.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/resources/bilibili/xml/biliroaming_setting_display_size.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/resources/bilibili/xml/biliroaming_setting_upos.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/darkswitch/fingerprints/SwitchDarkModeFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.darkswitch.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | object SwitchDarkModeFingerprint : MethodFingerprint( 6 | strings = listOf("default"), 7 | returnType = "V", 8 | parameters = listOf("Z"), 9 | customFingerprint = { _, classDef -> 10 | classDef.type.endsWith("HomeUserCenterFragment;") 11 | } 12 | ) 13 | 14 | object HdNewSwitchDarkModeFingerprint : MethodFingerprint( 15 | strings = listOf("default"), 16 | returnType = "V", 17 | parameters = listOf("Z"), 18 | customFingerprint = { _, classDef -> 19 | classDef.type == "Ltv/danmaku/bilibilihd/ui/main/mine/common/HdCommonBaseFragment;" 20 | } 21 | ) 22 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/all/misc/debugging/EnableAndroidDebuggingPatch.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.all.misc.debugging 2 | 3 | import app.revanced.patcher.data.ResourceContext 4 | import app.revanced.patcher.patch.ResourcePatch 5 | import app.revanced.patcher.patch.annotation.Patch 6 | import app.revanced.util.get 7 | import app.revanced.util.set 8 | 9 | @Patch( 10 | name = "Enable Android debugging", 11 | description = "Enables Android debugging capabilities. This can slow down the app.", 12 | use = false 13 | ) 14 | @Suppress("unused") 15 | object EnableAndroidDebuggingPatch : ResourcePatch() { 16 | override fun execute(context: ResourceContext) { 17 | context.document["AndroidManifest.xml"].use { dom -> 18 | dom["application"]["android:debuggable"] = "true" 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/all/screencapture/removerestriction/RemoveCaptureRestrictionResourcePatch.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.all.screencapture.removerestriction 2 | 3 | import app.revanced.patcher.data.ResourceContext 4 | import app.revanced.patcher.patch.ResourcePatch 5 | import app.revanced.patcher.patch.annotation.Patch 6 | import app.revanced.util.get 7 | import app.revanced.util.set 8 | 9 | @Patch(description = "Sets allowAudioPlaybackCapture in manifest to true.") 10 | internal object RemoveCaptureRestrictionResourcePatch : ResourcePatch() { 11 | override fun execute(context: ResourceContext) { 12 | // create an xml editor instance 13 | context.document["AndroidManifest.xml"].use { dom -> 14 | dom["application"]["android:allowAudioPlaybackCapture"] = "true" 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/patcher/patch/MultiMethodBytecodePatch.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.patcher.patch 2 | 3 | import app.revanced.patcher.data.BytecodeContext 4 | import app.revanced.patcher.fingerprint.MethodFingerprint 5 | import app.revanced.patcher.patch.BytecodePatch 6 | import app.revanced.patches.bilibili.patcher.fingerprint.MultiMethodFingerprint 7 | import app.revanced.patches.bilibili.patcher.fingerprint.MultiMethodFingerprint.Companion.resolve 8 | 9 | abstract class MultiMethodBytecodePatch( 10 | val fingerprints: Set = setOf(), 11 | val multiFingerprints: Set = setOf() 12 | ) : BytecodePatch(fingerprints) { 13 | override fun execute(context: BytecodeContext) { 14 | multiFingerprints.resolve(context, context.classes) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/resources/bilibili/xml/biliroaming_setting_half_screen_quality.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/resources/bilibili/xml/biliroaming_setting_full_screen_quality.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 13 | 14 | -------------------------------------------------------------------------------- /.github/workflows/pull_request.yml: -------------------------------------------------------------------------------- 1 | name: Open a PR to main 2 | 3 | on: 4 | push: 5 | branches: 6 | - dev 7 | workflow_dispatch: 8 | 9 | env: 10 | MESSAGE: Merge branch `${{ github.head_ref || github.ref_name }}` to `main` 11 | 12 | jobs: 13 | pull-request: 14 | name: Open pull request 15 | runs-on: ubuntu-latest 16 | steps: 17 | - name: Checkout 18 | uses: actions/checkout@v4 19 | - name: Open pull request 20 | uses: repo-sync/pull-request@v2 21 | with: 22 | destination_branch: 'main' 23 | pr_title: 'chore: ${{ env.MESSAGE }}' 24 | pr_body: | 25 | This pull request will ${{ env.MESSAGE }}. 26 | 27 | ## Dependencies before merge 28 | 29 | - [ ] https://github.com/revanced/revanced-integrations 30 | pr_draft: true 31 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/all/interaction/gestures/PredictiveBackGesturePatch.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.all.interaction.gestures 2 | 3 | import app.revanced.patcher.data.ResourceContext 4 | import app.revanced.patcher.patch.ResourcePatch 5 | import app.revanced.patcher.patch.annotation.Patch 6 | import app.revanced.util.get 7 | import app.revanced.util.set 8 | 9 | @Patch( 10 | name = "Predictive back gesture", 11 | description = "Enables the predictive back gesture introduced on Android 13.", 12 | use = false 13 | ) 14 | @Suppress("unused") 15 | object PredictiveBackGesturePatch : ResourcePatch() { 16 | override fun execute(context: ResourceContext) { 17 | context.document["AndroidManifest.xml"].use { dom -> 18 | dom["application"]["android:enableOnBackInvokedCallback"] = "true" 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/resources/bilibili/xml/biliroaming_setting_full_screen_quality_mobile.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/other/fingerprints/FavFolderOnDataSuccessNewFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.other.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | import com.android.tools.smali.dexlib2.AccessFlags 5 | import com.android.tools.smali.dexlib2.Opcode 6 | 7 | object FavFolderOnDataSuccessNewFingerprint : MethodFingerprint( 8 | returnType = "V", 9 | parameters = listOf("Lcom/bilibili/playerbizcommonv2/utils/PlaySetPageData;"), 10 | accessFlags = AccessFlags.PRIVATE.value or AccessFlags.FINAL.value, 11 | opcodes = listOf( 12 | Opcode.INVOKE_VIRTUAL, 13 | Opcode.IF_EQZ, 14 | Opcode.INVOKE_VIRTUAL, 15 | Opcode.MOVE_RESULT_OBJECT, 16 | Opcode.IF_EQZ, 17 | Opcode.INVOKE_STATIC, 18 | Opcode.MOVE_RESULT_OBJECT 19 | ) 20 | ) 21 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/drawer/fingerprints/DrawerIsOpenFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.drawer.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction11n 5 | 6 | object DrawerIsOpenFingerprint : MethodFingerprint( 7 | returnType = "Z", 8 | strings = listOf("is not a drawer"), 9 | parameters = listOf("Landroid/view/View;"), 10 | customFingerprint = { methodDef, _ -> 11 | methodDef.definingClass == "Landroidx/drawerlayout/widget/DrawerLayout;" 12 | && methodDef.implementation?.instructions?.find { 13 | it is Instruction11n 14 | }?.let { 15 | it as Instruction11n 16 | it.registerA == 0 && it.wideLiteral == 0x1L 17 | } ?: false 18 | } 19 | ) 20 | -------------------------------------------------------------------------------- /src/main/resources/bilibili/xml/biliroaming_setting_filter_dynamic_by_type.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/resources/bilibili/xml/biliroaming_setting_filter_home_by_type.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/other/fingerprints/FavFolderOnDataSuccessFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.other.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | import com.android.tools.smali.dexlib2.AccessFlags 5 | import com.android.tools.smali.dexlib2.Opcode 6 | 7 | object FavFolderOnDataSuccessFingerprint : MethodFingerprint( 8 | returnType = "V", 9 | parameters = listOf("Lcom/bilibili/playset/api/PlaySetPageData;"), 10 | accessFlags = AccessFlags.PUBLIC.value, 11 | opcodes = listOf( 12 | Opcode.IGET_OBJECT, 13 | Opcode.INVOKE_VIRTUAL, 14 | Opcode.CONST_4, 15 | Opcode.IF_EQZ, 16 | Opcode.IGET_OBJECT, 17 | Opcode.IF_EQZ, 18 | Opcode.INVOKE_INTERFACE, 19 | Opcode.MOVE_RESULT, 20 | Opcode.IF_EQZ, 21 | Opcode.GOTO_16, 22 | ) 23 | ) 24 | -------------------------------------------------------------------------------- /src/main/resources/bilibili/xml/biliroaming_setting_external_downloader.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/video/player/fingerprints/PlayerGestureRotateFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.video.player.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | import com.android.tools.smali.dexlib2.Opcode 5 | 6 | object PlayerGestureRotateFingerprint : MethodFingerprint( 7 | returnType = "Z", 8 | opcodes = listOf( 9 | Opcode.IGET_BOOLEAN, 10 | Opcode.CONST_4, 11 | Opcode.IF_NEZ, 12 | Opcode.RETURN, 13 | Opcode.IF_NEZ, 14 | Opcode.RETURN, 15 | Opcode.INVOKE_VIRTUAL, 16 | Opcode.MOVE_RESULT, 17 | Opcode.CONST_4, 18 | Opcode.CMPL_FLOAT, 19 | Opcode.IF_LEZ 20 | ), 21 | customFingerprint = { methodDef, classDef -> 22 | methodDef.parameterTypes.size == 1 23 | && classDef.type == PlayerGestureListenerFingerprint.result!!.classDef.type 24 | } 25 | ) 26 | -------------------------------------------------------------------------------- /src/main/resources/bilibili/xml/biliroaming_setting_filter_home.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/other/patch/NoManageSpaceActivityPatch.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.other.patch 2 | 3 | import app.revanced.patcher.data.ResourceContext 4 | import app.revanced.patcher.patch.ResourcePatch 5 | import app.revanced.patcher.patch.annotation.CompatiblePackage 6 | import app.revanced.patcher.patch.annotation.Patch 7 | import app.revanced.util.get 8 | 9 | @Patch( 10 | name = "Remove managerSpaceActivity", 11 | description = "移除管理存储空间入口", 12 | compatiblePackages = [ 13 | CompatiblePackage(name = "tv.danmaku.bili"), 14 | CompatiblePackage(name = "tv.danmaku.bilibilihd"), 15 | CompatiblePackage(name = "com.bilibili.app.in") 16 | ] 17 | ) 18 | object NoManageSpaceActivityPatch : ResourcePatch() { 19 | override fun execute(context: ResourceContext) { 20 | context.document["AndroidManifest.xml"].use { 21 | it["application"].removeAttribute("android:manageSpaceActivity") 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/drawer/fingerprints/DrawerControlFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.drawer.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction11n 5 | 6 | open class DrawerControlFingerprint(open: Boolean) : MethodFingerprint( 7 | returnType = "V", 8 | strings = listOf("is not a sliding drawer"), 9 | parameters = listOf("Landroid/view/View;", "Z"), 10 | customFingerprint = { methodRef, _ -> 11 | methodRef.definingClass == "Landroidx/drawerlayout/widget/DrawerLayout;" 12 | && methodRef.implementation?.instructions?.any { 13 | it is Instruction11n && it.registerA == 1 14 | && it.wideLiteral == if (open) 0x0L else 0x4L 15 | } ?: false 16 | } 17 | ) 18 | 19 | object OpenDrawerControlFingerprint : DrawerControlFingerprint(true) 20 | object CloseDrawerControlFingerprint : DrawerControlFingerprint(false) 21 | -------------------------------------------------------------------------------- /src/main/resources/bilibili/xml/biliroaming_setting_filter_comment.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 11 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/copy/fingerprints/BaseCommentCopyFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.copy.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | import com.android.tools.smali.dexlib2.AccessFlags 5 | import com.android.tools.smali.dexlib2.Opcode 6 | 7 | open class BaseCommentCopyFingerprint(identityType: String) : MethodFingerprint( 8 | returnType = "Z", 9 | parameters = listOf("Landroid/view/View;"), 10 | opcodes = listOf( 11 | Opcode.IGET_OBJECT, 12 | Opcode.IGET_OBJECT, 13 | Opcode.INVOKE_STATIC, 14 | Opcode.MOVE_RESULT, 15 | Opcode.RETURN 16 | ), 17 | customFingerprint = { methodDef, classDef -> 18 | methodDef.name == "onLongClick" && classDef.interfaces == listOf("Landroid/view/View\$OnLongClickListener;") 19 | && classDef.fields.toList().let { fields -> 20 | fields.count() == 2 && fields.all { AccessFlags.SYNTHETIC.isSet(it.accessFlags) } 21 | && fields.any { it.type == identityType } 22 | } 23 | } 24 | ) 25 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/other/fingerprints/OgvSearchResultFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.other.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | 5 | /** 6 | * from pink 7 | */ 8 | object OgvSearchResultFingerprint : MethodFingerprint( 9 | strings = listOf("pgc.bangumi-search.0.0.pv"), 10 | customFingerprint = { _, classDef -> 11 | classDef.type == "Lcom/bilibili/search/ogv/OgvSearchResultFragment;" 12 | } 13 | ) 14 | 15 | /** 16 | * from pink, search2 17 | */ 18 | object OgvSearchResultV2Fingerprint : MethodFingerprint( 19 | strings = listOf("pgc.bangumi-search.0.0.pv"), 20 | customFingerprint = { _, classDef -> 21 | classDef.type == "Lcom/bilibili/search2/ogv/OgvSearchResultFragment;" 22 | } 23 | ) 24 | 25 | /** 26 | * from hd 27 | */ 28 | object BangumiSearchResultFingerprint : MethodFingerprint( 29 | strings = listOf("pgc.bangumi-search.0.0.pv"), 30 | customFingerprint = { _, classDef -> 31 | classDef.type == "Lcom/bilibili/search/result/bangumi/ogv/BangumiSearchResultFragment;" 32 | } 33 | ) 34 | -------------------------------------------------------------------------------- /src/main/resources/bilibili/xml/biliroaming_setting_space.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 14 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/shared/misc/mapping/ResourceMappingPatch.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.shared.misc.mapping 2 | 3 | import app.revanced.patcher.data.ResourceContext 4 | import app.revanced.patcher.patch.ResourcePatch 5 | import app.revanced.util.children 6 | import app.revanced.util.get 7 | 8 | 9 | object ResourceMappingPatch : ResourcePatch() { 10 | lateinit var resourceMappings: List 11 | private set 12 | 13 | override fun execute(context: ResourceContext) { 14 | val mappings = mutableListOf() 15 | 16 | context.document[context["res/values/public.xml", false].inputStream()].use { dom -> 17 | dom["resources"].children().forEach { 18 | val type = it["type"] 19 | val name = it["name"] 20 | val id = it["id"].substring(2).toInt(16) 21 | if (!name.startsWith("APKTOOL")) 22 | mappings.add(ResourceElement(type, name, id)) 23 | } 24 | } 25 | 26 | resourceMappings = mappings 27 | } 28 | 29 | data class ResourceElement(val type: String, val name: String, val id: Int) 30 | } 31 | -------------------------------------------------------------------------------- /src/main/resources/bilibili/xml/biliroaming_setting_block_module.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | 19 | 20 | -------------------------------------------------------------------------------- /.releaserc: -------------------------------------------------------------------------------- 1 | { 2 | "branches": [ 3 | "main", 4 | { 5 | "name": "dev", 6 | "prerelease": true 7 | } 8 | ], 9 | "plugins": [ 10 | [ 11 | "@semantic-release/commit-analyzer", { 12 | "releaseRules": [ 13 | { "type": "build", "scope": "Needs bump", "release": "patch" } 14 | ] 15 | } 16 | ], 17 | "@semantic-release/release-notes-generator", 18 | "@semantic-release/changelog", 19 | "gradle-semantic-release-plugin", 20 | [ 21 | "@semantic-release/git", 22 | { 23 | "assets": [ 24 | "README.md", 25 | "CHANGELOG.md", 26 | "gradle.properties", 27 | "patches.json" 28 | ] 29 | } 30 | ], 31 | [ 32 | "@semantic-release/github", 33 | { 34 | "assets": [ 35 | { 36 | "path": "build/libs/*.jar" 37 | }, 38 | { 39 | "path": "patches.json" 40 | } 41 | ], 42 | successComment: false 43 | } 44 | ], 45 | [ 46 | "@saithodev/semantic-release-backmerge", 47 | { 48 | backmergeBranches: [{"from": "main", "to": "dev"}], 49 | clearWorkspace: true 50 | } 51 | ] 52 | ] 53 | } 54 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/video/player/fingerprints/BangumiKeyDownHandlerFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.video.player.fingerprints 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | import com.android.tools.smali.dexlib2.Opcode 5 | 6 | object BangumiKeyDownHandlerFingerprint : MethodFingerprint( 7 | returnType = "Z", 8 | opcodes = listOf( 9 | Opcode.INVOKE_DIRECT, 10 | Opcode.MOVE_RESULT, 11 | Opcode.CONST_4, 12 | Opcode.IF_EQZ, 13 | Opcode.RETURN, 14 | Opcode.CONST_4, 15 | Opcode.CONST_4, 16 | Opcode.IF_EQ, 17 | Opcode.CONST_16, 18 | Opcode.IF_EQ, 19 | Opcode.CONST_16, 20 | Opcode.IF_EQ, 21 | Opcode.CONST_16, 22 | Opcode.IF_EQ, 23 | Opcode.CONST_16, 24 | Opcode.IF_EQ, 25 | Opcode.CONST_16, 26 | Opcode.IF_EQ, 27 | Opcode.CONST_16, 28 | Opcode.IF_EQ, 29 | Opcode.CONST_16, 30 | Opcode.IF_EQ, 31 | Opcode.CONST_16, 32 | Opcode.IF_EQ, 33 | Opcode.RETURN, 34 | ), 35 | customFingerprint = { methodDef, _ -> 36 | methodDef.parameterTypes.let { 37 | it.size == 3 && it[0] == "I" && it[1] == it[2] 38 | } 39 | } 40 | ) 41 | -------------------------------------------------------------------------------- /src/main/resources/bilibili/xml/biliroaming_setting_filter_popular.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 11 | 14 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/video/player/patch/BangumiKeyDownHandlerPatch.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.video.player.patch 2 | 3 | import app.revanced.patcher.data.BytecodeContext 4 | import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction 5 | import app.revanced.patcher.patch.BytecodePatch 6 | import app.revanced.patcher.patch.annotation.CompatiblePackage 7 | import app.revanced.patcher.patch.annotation.Patch 8 | import app.revanced.patches.bilibili.video.player.fingerprints.BangumiKeyDownHandlerFingerprint 9 | import app.revanced.util.exception 10 | import com.android.tools.smali.dexlib2.Opcode 11 | 12 | @Patch( 13 | name = "Enable Key mapping", 14 | description = "HD版启用番剧页面键盘按键映射", 15 | compatiblePackages = [CompatiblePackage(name = "tv.danmaku.bilibilihd")] 16 | ) 17 | object BangumiKeyDownHandlerPatch : BytecodePatch(setOf(BangumiKeyDownHandlerFingerprint)) { 18 | override fun execute(context: BytecodeContext) { 19 | BangumiKeyDownHandlerFingerprint.result?.mutableMethod?.run { 20 | val returnIndex = implementation!!.instructions.withIndex().firstNotNullOf { (index, inst) -> 21 | if (inst.opcode == Opcode.RETURN) index else null 22 | } 23 | replaceInstruction(returnIndex, "nop") 24 | } ?: throw BangumiKeyDownHandlerFingerprint.exception 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/protobuf/patch/CommentReplyUrlPatch.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.protobuf.patch 2 | 3 | import app.revanced.patcher.data.BytecodeContext 4 | import app.revanced.patcher.extensions.InstructionExtensions.addInstruction 5 | import app.revanced.patcher.patch.BytecodePatch 6 | import app.revanced.patcher.patch.PatchException 7 | import app.revanced.patcher.patch.annotation.CompatiblePackage 8 | import app.revanced.patcher.patch.annotation.Patch 9 | 10 | @Patch( 11 | name = "Comment word search url", 12 | description = "屏蔽评论关键词搜索功能", 13 | compatiblePackages = [ 14 | CompatiblePackage(name = "tv.danmaku.bili"), 15 | CompatiblePackage(name = "tv.danmaku.bilibilihd"), 16 | CompatiblePackage(name = "com.bilibili.app.in") 17 | ] 18 | ) 19 | object CommentReplyUrlPatch : BytecodePatch() { 20 | override fun execute(context: BytecodeContext) { 21 | context.findClass("Lcom/bapis/bilibili/main/community/reply/v1/Content;") 22 | ?.mutableClass?.methods?.find { it.name == "internalGetUrls" }?.addInstruction( 23 | 1, """ 24 | invoke-static {v0}, Lapp/revanced/bilibili/patches/CommentReplyUrlPatch;->filterUrls(Lcom/google/protobuf/MapFieldLite;)V 25 | """.trimIndent() 26 | ) ?: throw PatchException("can not found internalGetUrls method") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/resources/bilibili/xml/biliroaming_setting_customize_search.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 13 | 17 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/main/resources/bilibili/xml/biliroaming_setting_about.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 12 | 16 | 20 | 21 | 22 | 23 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | branches: 7 | - main 8 | - dev 9 | 10 | jobs: 11 | release: 12 | name: Release 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Checkout 16 | uses: actions/checkout@v4 17 | with: 18 | # Make sure the release step uses its own credentials: 19 | # https://github.com/cycjimmy/semantic-release-action#private-packages 20 | persist-credentials: false 21 | fetch-depth: 0 22 | 23 | - name: Cache Gradle 24 | uses: burrunan/gradle-cache-action@v1 25 | 26 | - name: Build 27 | env: 28 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 29 | run: ./gradlew generateMeta clean 30 | 31 | - name: Setup Node.js 32 | uses: actions/setup-node@v4 33 | with: 34 | node-version: "lts/*" 35 | cache: 'npm' 36 | 37 | - name: Install dependencies 38 | run: npm install 39 | 40 | - name: Import GPG key 41 | uses: crazy-max/ghaction-import-gpg@v6 42 | with: 43 | gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} 44 | passphrase: ${{ secrets.GPG_PASSPHRASE }} 45 | fingerprint: ${{ env.GPG_FINGERPRINT }} 46 | 47 | - name: Release 48 | env: 49 | GITHUB_TOKEN: ${{ secrets.REPOSITORY_PUSH_ACCESS }} 50 | run: npm exec semantic-release 51 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/ads/patch/UpRcmdAdsPatch.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.ads.patch 2 | 3 | import app.revanced.patcher.data.BytecodeContext 4 | import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels 5 | import app.revanced.patcher.patch.BytecodePatch 6 | import app.revanced.patcher.patch.annotation.CompatiblePackage 7 | import app.revanced.patcher.patch.annotation.Patch 8 | 9 | @Patch( 10 | name = "Block up recommend ads", 11 | description = "屏蔽UP主推荐广告", 12 | compatiblePackages = [ 13 | CompatiblePackage(name = "tv.danmaku.bili"), 14 | CompatiblePackage(name = "tv.danmaku.bilibilihd"), 15 | CompatiblePackage(name = "com.bilibili.app.in") 16 | ] 17 | ) 18 | object UpRcmdAdsPatch : BytecodePatch() { 19 | override fun execute(context: BytecodeContext) { 20 | context.findClass("Lcom/bapis/bilibili/ad/v1/SourceContentDto;")?.let { c -> 21 | c.mutableClass.methods.find { it.name == "getAdContent" }?.addInstructionsWithLabels( 22 | 0, """ 23 | invoke-static {}, Lapp/revanced/bilibili/patches/UpRcmdAdsPatch;->blockUpRcmdAds()Z 24 | move-result v0 25 | if-eqz v0, :jump 26 | const/4 v0, 0x0 27 | return-object v0 28 | :jump 29 | nop 30 | """.trimIndent() 31 | ) 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/other/patch/PublishToFollowingPatch.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.other.patch 2 | 3 | import app.revanced.patcher.data.BytecodeContext 4 | import app.revanced.patcher.extensions.InstructionExtensions.addInstructions 5 | import app.revanced.patcher.patch.BytecodePatch 6 | import app.revanced.patcher.patch.annotation.CompatiblePackage 7 | import app.revanced.patcher.patch.annotation.Patch 8 | import app.revanced.patches.bilibili.misc.other.fingerprints.PublishToFollowingConfigFingerprint 9 | 10 | @Patch( 11 | name = "Disable auto select", 12 | description = "禁止自动转到动态", 13 | compatiblePackages = [ 14 | CompatiblePackage(name = "tv.danmaku.bili"), 15 | CompatiblePackage(name = "tv.danmaku.bilibilihd"), 16 | CompatiblePackage(name = "com.bilibili.app.in") 17 | ] 18 | ) 19 | object PublishToFollowingPatch : BytecodePatch(setOf(PublishToFollowingConfigFingerprint)) { 20 | override fun execute(context: BytecodeContext) { 21 | PublishToFollowingConfigFingerprint.result?.mutableClass?.methods?.find { m -> 22 | m.name == "" && m.parameterTypes.let { ts -> ts.size == 4 && ts.all { it == "Z" } } 23 | }?.addInstructions( 24 | 0, """ 25 | invoke-static {p3}, Lapp/revanced/bilibili/patches/PublishToFollowingPatch;->shouldAutoSelectOnce(Z)Z 26 | move-result p3 27 | """.trimIndent() 28 | ) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/other/patch/TeenagerModePatch.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.other.patch 2 | 3 | import app.revanced.patcher.data.BytecodeContext 4 | import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels 5 | import app.revanced.patcher.patch.BytecodePatch 6 | import app.revanced.patcher.patch.annotation.CompatiblePackage 7 | import app.revanced.patcher.patch.annotation.Patch 8 | import app.revanced.patches.bilibili.misc.other.fingerprints.TeenagersModeFingerprint 9 | import app.revanced.util.exception 10 | 11 | @Patch( 12 | name = "Teenager mode", 13 | description = "禁用青少年模式弹窗", 14 | compatiblePackages = [ 15 | CompatiblePackage(name = "tv.danmaku.bili"), 16 | CompatiblePackage(name = "tv.danmaku.bilibilihd"), 17 | CompatiblePackage(name = "com.bilibili.app.in") 18 | ] 19 | ) 20 | object TeenagerModePatch : BytecodePatch(setOf(TeenagersModeFingerprint)) { 21 | override fun execute(context: BytecodeContext) { 22 | TeenagersModeFingerprint.result?.mutableMethod?.addInstructionsWithLabels( 23 | 0, """ 24 | invoke-static {}, Lapp/revanced/bilibili/patches/TeenagerModePatch;->shouldDisable()Z 25 | move-result v0 26 | if-eqz v0, :jump 27 | const/4 v0, 0x0 28 | return v0 29 | :jump 30 | nop 31 | """.trimIndent() 32 | ) ?: throw TeenagersModeFingerprint.exception 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/integrations/patch/BrotliPatch.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.integrations.patch 2 | 3 | import app.revanced.patcher.data.BytecodeContext 4 | import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction 5 | import app.revanced.patcher.patch.BytecodePatch 6 | import app.revanced.patcher.patch.annotation.CompatiblePackage 7 | import app.revanced.patcher.patch.annotation.Patch 8 | import app.revanced.patches.bilibili.misc.integrations.fingerprints.BrotliFingerprint 9 | import app.revanced.util.exception 10 | 11 | @Patch( 12 | name = "Brotli", 13 | description = "集成Brotli", 14 | compatiblePackages = [ 15 | CompatiblePackage(name = "tv.danmaku.bili"), 16 | CompatiblePackage(name = "tv.danmaku.bilibilihd"), 17 | CompatiblePackage(name = "com.bilibili.app.in") 18 | ] 19 | ) 20 | object BrotliPatch : BytecodePatch(setOf(BrotliFingerprint)) { 21 | override fun execute(context: BytecodeContext) { 22 | BrotliFingerprint.result?.classDef?.run { 23 | val brotliClass = context.findClass("Lapp/revanced/bilibili/api/BrotliInputStream;")!! 24 | brotliClass.mutableClass.setSuperClass(this.type) 25 | brotliClass.mutableClass.methods.first { it.name == "" }.replaceInstruction( 26 | 0, """ 27 | invoke-direct {p0, p1}, ${this.type}->(Ljava/io/InputStream;)V 28 | """.trimIndent() 29 | ) 30 | } ?: throw BrotliFingerprint.exception 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/integrations/patch/ModifyModifierPatch.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.integrations.patch 2 | 3 | import app.revanced.patcher.data.BytecodeContext 4 | import app.revanced.patcher.patch.BytecodePatch 5 | import app.revanced.patcher.patch.annotation.CompatiblePackage 6 | import app.revanced.patcher.patch.annotation.Patch 7 | import app.revanced.patches.bilibili.utils.toPublic 8 | import com.android.tools.smali.dexlib2.AccessFlags 9 | 10 | @Patch( 11 | name = "Modify modifier", 12 | description = "修改类或类成员修饰符,方便操作", 13 | compatiblePackages = [ 14 | CompatiblePackage(name = "tv.danmaku.bili"), 15 | CompatiblePackage(name = "tv.danmaku.bilibilihd"), 16 | CompatiblePackage(name = "com.bilibili.app.in") 17 | ] 18 | ) 19 | object ModifyModifierPatch : BytecodePatch() { 20 | override fun execute(context: BytecodeContext) { 21 | context.findClass("Ltv/danmaku/bili/ui/main2/resource/MainResourceManager\$TabResponse;") 22 | ?.mutableClass?.accessFlags = AccessFlags.PUBLIC.value 23 | context.findClass("Ltv/danmaku/bili/ui/main2/resource/MainResourceManager\$TabData;") 24 | ?.mutableClass?.accessFlags = AccessFlags.PUBLIC.value 25 | context.findClass("Ltv/danmaku/bili/ui/main2/resource/MainResourceManager\$Tab;")?.mutableClass?.run { 26 | accessFlags = AccessFlags.PUBLIC.value 27 | methods.first { it.name == "" }.run { 28 | accessFlags = accessFlags.toPublic() 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/other/patch/ForbidLiveRoomSlideLeftPatch.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.other.patch 2 | 3 | import app.revanced.patcher.data.BytecodeContext 4 | import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels 5 | import app.revanced.patcher.patch.BytecodePatch 6 | import app.revanced.patcher.patch.annotation.CompatiblePackage 7 | import app.revanced.patcher.patch.annotation.Patch 8 | import app.revanced.patches.bilibili.misc.other.fingerprints.LiveRoomTouchDispatchViewModelFingerprint 9 | import app.revanced.util.exception 10 | 11 | @Patch( 12 | name = "Forbid live room slide left", 13 | description = "禁止直播间向左滑动弹出抽屉", 14 | compatiblePackages = [CompatiblePackage(name = "tv.danmaku.bili")] 15 | ) 16 | object ForbidLiveRoomSlideLeftPatch : BytecodePatch(setOf(LiveRoomTouchDispatchViewModelFingerprint)) { 17 | override fun execute(context: BytecodeContext) { 18 | LiveRoomTouchDispatchViewModelFingerprint.result?.mutableClass?.methods?.find { 19 | it.parameterTypes.isEmpty() && it.returnType == "V" && it.name != "" && it.name != "" 20 | }?.addInstructionsWithLabels( 21 | 0, """ 22 | invoke-static {}, Lapp/revanced/bilibili/patches/LiveRoomPatch;->disableSlideLeft()Z 23 | move-result v0 24 | if-eqz v0, :do_nothing 25 | return-void 26 | :do_nothing 27 | nop 28 | """.trimIndent() 29 | ) ?: throw LiveRoomTouchDispatchViewModelFingerprint.exception 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/other/patch/PlayManifestCompatibilityPatch.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.other.patch 2 | 3 | import app.revanced.patcher.data.ResourceContext 4 | import app.revanced.patcher.patch.ResourcePatch 5 | import app.revanced.patcher.patch.annotation.CompatiblePackage 6 | import app.revanced.patcher.patch.annotation.Patch 7 | import app.revanced.util.children 8 | import app.revanced.util.get 9 | import app.revanced.util.insertBefore 10 | import app.revanced.util.set 11 | 12 | @Patch( 13 | name = "Play manifest compatibility", 14 | description = "Play版 AndroidManifest 声明缺失补全", 15 | compatiblePackages = [CompatiblePackage(name = "com.bilibili.app.in")] 16 | ) 17 | object PlayManifestCompatibilityPatch : ResourcePatch() { 18 | private val missingPerms = arrayOf( 19 | "android.permission.REQUEST_INSTALL_PACKAGES", 20 | "android.permission.QUERY_ALL_PACKAGES", 21 | ) 22 | 23 | override fun execute(context: ResourceContext) { 24 | context.document["AndroidManifest.xml"].use { dom -> 25 | val manifest = dom["manifest"] 26 | val permTag = "uses-permission" 27 | val nameAttr = "android:name" 28 | missingPerms.forEach { perm -> 29 | if (manifest.children().none { it.tagName == permTag && it[nameAttr] == perm }) { 30 | manifest.insertBefore(dom["application"], permTag) { 31 | this[nameAttr] = perm 32 | } 33 | } 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/util/patch/LiteralValueFingerprint.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.util.patch 2 | 3 | import app.revanced.patcher.fingerprint.MethodFingerprint 4 | import app.revanced.util.containsWideLiteralInstructionValue 5 | import com.android.tools.smali.dexlib2.Opcode 6 | 7 | /** 8 | * A fingerprint to resolve methods that contain a specific literal value. 9 | * 10 | * @param returnType The method's return type compared using String.startsWith. 11 | * @param accessFlags The method's exact access flags using values of AccessFlags. 12 | * @param parameters The parameters of the method. Partial matches allowed and follow the same rules as returnType. 13 | * @param opcodes An opcode pattern of the method's instructions. Wildcard or unknown opcodes can be specified by null. 14 | * @param strings A list of the method's strings compared each using String.contains. 15 | * @param literalSupplier A supplier for the literal value to check for. 16 | */ 17 | abstract class LiteralValueFingerprint( 18 | returnType: String? = null, 19 | accessFlags: Int? = null, 20 | parameters: Iterable? = null, 21 | opcodes: Iterable? = null, 22 | strings: Iterable? = null, 23 | // Has to be a supplier because the fingerprint is created before patches can set literals. 24 | literalSupplier: () -> Long 25 | ) : MethodFingerprint( 26 | returnType = returnType, 27 | accessFlags = accessFlags, 28 | parameters = parameters, 29 | opcodes = opcodes, 30 | strings = strings, 31 | customFingerprint = { methodDef, _ -> 32 | methodDef.containsWideLiteralInstructionValue(literalSupplier()) 33 | } 34 | ) 35 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/bilibili/misc/other/patch/SaveCommentImagePatch.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.bilibili.misc.other.patch 2 | 3 | import app.revanced.patcher.data.BytecodeContext 4 | import app.revanced.patcher.extensions.InstructionExtensions.addInstruction 5 | import app.revanced.patcher.patch.BytecodePatch 6 | import app.revanced.patcher.patch.PatchException 7 | import app.revanced.patcher.patch.annotation.CompatiblePackage 8 | import app.revanced.patcher.patch.annotation.Patch 9 | import com.android.tools.smali.dexlib2.Opcode 10 | 11 | @Patch( 12 | name = "Save comment images", 13 | description = "保存评论图片补丁", 14 | compatiblePackages = [ 15 | CompatiblePackage(name = "tv.danmaku.bili"), 16 | CompatiblePackage(name = "tv.danmaku.bilibilihd"), 17 | CompatiblePackage(name = "com.bilibili.app.in") 18 | ] 19 | ) 20 | object SaveCommentImagePatch : BytecodePatch() { 21 | override fun execute(context: BytecodeContext) { 22 | context.findClass("Lcom/bilibili/lib/imageviewer/fragment/ImageFragment;") 23 | ?.mutableClass?.methods?.find { it.name == "onViewCreated" }?.run { 24 | val insertIndex = implementation!!.instructions.indexOfLast { it.opcode == Opcode.RETURN_VOID } 25 | addInstruction( 26 | insertIndex, """ 27 | invoke-static {p0}, Lapp/revanced/bilibili/patches/CommentImagePatch;->bindClickListener(Lcom/bilibili/lib/imageviewer/fragment/ImageFragment;)V 28 | """.trimIndent() 29 | ) 30 | } ?: throw PatchException("can not found ImageFragment#onViewCreated method") 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/patches/all/activity/exportall/ExportAllActivitiesPatch.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.patches.all.activity.exportall 2 | 3 | import app.revanced.patcher.data.ResourceContext 4 | import app.revanced.patcher.patch.ResourcePatch 5 | import app.revanced.patcher.patch.annotation.Patch 6 | 7 | @Patch( 8 | name = "Export all activities", 9 | description = "Makes all app activities exportable.", 10 | use = false 11 | ) 12 | @Suppress("unused") 13 | object ExportAllActivitiesPatch : ResourcePatch() { 14 | private const val EXPORTED_FLAG = "android:exported" 15 | override fun execute(context: ResourceContext) { 16 | context.xmlEditor["AndroidManifest.xml"].use { editor -> 17 | val document = editor.file 18 | val activities = document.getElementsByTagName("activity") 19 | 20 | for (i in 0..activities.length) { 21 | activities.item(i)?.apply { 22 | val exportedAttribute = attributes.getNamedItem(EXPORTED_FLAG) 23 | 24 | if (exportedAttribute != null) { 25 | if (exportedAttribute.nodeValue != "true") 26 | exportedAttribute.nodeValue = "true" 27 | } 28 | // Reason why the attribute is added in the case it does not exist: 29 | // https://github.com/revanced/revanced-patches/pull/1751/files#r1141481604 30 | else document.createAttribute(EXPORTED_FLAG) 31 | .apply { value = "true" } 32 | .let(attributes::setNamedItem) 33 | } 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/kotlin/app/revanced/generator/JsonPatchesFileGenerator.kt: -------------------------------------------------------------------------------- 1 | package app.revanced.generator 2 | 3 | import app.revanced.patcher.PatchSet 4 | import app.revanced.patcher.patch.Patch 5 | import com.google.gson.GsonBuilder 6 | import java.io.File 7 | 8 | internal class JsonPatchesFileGenerator : PatchesFileGenerator { 9 | override fun generate(patches: PatchSet) = patches.map { 10 | JsonPatch( 11 | it.name!!, 12 | it.description, 13 | it.compatiblePackages, 14 | it.use, 15 | it.requiresIntegrations, 16 | it.options.values.map { option -> 17 | JsonPatch.Option( 18 | option.key, 19 | option.default, 20 | option.values, 21 | option.title, 22 | option.description, 23 | option.required, 24 | ) 25 | }, 26 | ) 27 | }.let { 28 | File("patches.json").writeText(GsonBuilder().serializeNulls().create().toJson(it)) 29 | } 30 | 31 | @Suppress("unused") 32 | private class JsonPatch( 33 | val name: String? = null, 34 | val description: String? = null, 35 | val compatiblePackages: Set? = null, 36 | val use: Boolean = true, 37 | val requiresIntegrations: Boolean = false, 38 | val options: List