├── .github └── workflows │ ├── TVBoxOSC.jks │ └── test.yml ├── .gitignore ├── .idea ├── .name ├── codeStyles │ └── Project.xml ├── compiler.xml ├── inspectionProfiles │ └── Project_Default.xml ├── jarRepositories.xml └── misc.xml ├── LICENSE ├── README.md ├── app ├── build.gradle ├── libs │ ├── commons-lang3-3.12.0.jar │ ├── thunder.jar │ └── xwalk_shared_library-23.53.589.4.aar ├── proguard-python.pro ├── proguard-rules.pro ├── schemas │ └── com.github.tvbox.osc.data.AppDataBase │ │ ├── 1.json │ │ └── 3.json └── src │ ├── main │ ├── AndroidManifest.xml │ ├── assets │ │ ├── epg_data.json │ │ ├── js │ │ │ └── lib │ │ │ │ ├── cat.js │ │ │ │ ├── cheerio.min.js │ │ │ │ ├── crypto-js.js │ │ │ │ ├── gbk.js │ │ │ │ ├── net.js │ │ │ │ ├── similarity.js │ │ │ │ ├── utils.js │ │ │ │ └── 模板.js │ │ └── ua.db │ ├── java │ │ ├── com │ │ │ ├── github │ │ │ │ ├── catvod │ │ │ │ │ └── crawler │ │ │ │ │ │ ├── JarLoader.java │ │ │ │ │ │ ├── JsLoader.java │ │ │ │ │ │ ├── Spider.java │ │ │ │ │ │ ├── SpiderDebug.java │ │ │ │ │ │ ├── SpiderNull.java │ │ │ │ │ │ └── python │ │ │ │ │ │ └── IPyLoader.java │ │ │ │ └── tvbox │ │ │ │ │ └── osc │ │ │ │ │ ├── api │ │ │ │ │ └── ApiConfig.java │ │ │ │ │ ├── base │ │ │ │ │ ├── App.java │ │ │ │ │ ├── BaseActivity.java │ │ │ │ │ └── BaseLazyFragment.java │ │ │ │ │ ├── bean │ │ │ │ │ ├── AbsJson.java │ │ │ │ │ ├── AbsSortJson.java │ │ │ │ │ ├── AbsSortXml.java │ │ │ │ │ ├── AbsXml.java │ │ │ │ │ ├── Epginfo.java │ │ │ │ │ ├── IJKCode.java │ │ │ │ │ ├── IpScanningVo.java │ │ │ │ │ ├── LiveChannelGroup.java │ │ │ │ │ ├── LiveChannelItem.java │ │ │ │ │ ├── LiveDayListGroup.java │ │ │ │ │ ├── LiveEpgDate.java │ │ │ │ │ ├── LivePlayerManager.java │ │ │ │ │ ├── LiveSettingGroup.java │ │ │ │ │ ├── LiveSettingItem.java │ │ │ │ │ ├── Movie.java │ │ │ │ │ ├── MovieSort.java │ │ │ │ │ ├── ParseBean.java │ │ │ │ │ ├── SourceBean.java │ │ │ │ │ ├── Subtitle.java │ │ │ │ │ ├── SubtitleData.java │ │ │ │ │ └── VodInfo.java │ │ │ │ │ ├── cache │ │ │ │ │ ├── Cache.java │ │ │ │ │ ├── CacheDao.java │ │ │ │ │ ├── CacheManager.java │ │ │ │ │ ├── RoomDataManger.java │ │ │ │ │ ├── VodCollect.java │ │ │ │ │ ├── VodCollectDao.java │ │ │ │ │ ├── VodRecord.java │ │ │ │ │ └── VodRecordDao.java │ │ │ │ │ ├── callback │ │ │ │ │ ├── EmptyCallback.java │ │ │ │ │ └── LoadingCallback.java │ │ │ │ │ ├── data │ │ │ │ │ ├── AppDataBase.java │ │ │ │ │ └── AppDataManager.java │ │ │ │ │ ├── event │ │ │ │ │ ├── HistoryStateEvent.java │ │ │ │ │ ├── RefreshEvent.java │ │ │ │ │ ├── ServerEvent.java │ │ │ │ │ └── TopStateEvent.java │ │ │ │ │ ├── picasso │ │ │ │ │ ├── MyOkhttpDownLoader.java │ │ │ │ │ └── RoundTransformation.java │ │ │ │ │ ├── player │ │ │ │ │ ├── ExoMediaPlayerFactory.java │ │ │ │ │ ├── ExoPlayer.java │ │ │ │ │ ├── IjkMediaPlayer.java │ │ │ │ │ ├── MyVideoView.java │ │ │ │ │ ├── TrackInfo.java │ │ │ │ │ ├── TrackInfoBean.java │ │ │ │ │ ├── controller │ │ │ │ │ │ ├── BaseController.java │ │ │ │ │ │ ├── LiveController.java │ │ │ │ │ │ └── VodController.java │ │ │ │ │ ├── render │ │ │ │ │ │ ├── SurfaceRenderView.java │ │ │ │ │ │ └── SurfaceRenderViewFactory.java │ │ │ │ │ └── thirdparty │ │ │ │ │ │ ├── Kodi.java │ │ │ │ │ │ ├── MXPlayer.java │ │ │ │ │ │ ├── ReexPlayer.java │ │ │ │ │ │ ├── RemoteTVBox.java │ │ │ │ │ │ └── VlcPlayer.java │ │ │ │ │ ├── receiver │ │ │ │ │ ├── CustomWebReceiver.java │ │ │ │ │ └── SearchReceiver.java │ │ │ │ │ ├── server │ │ │ │ │ ├── ControlManager.java │ │ │ │ │ ├── DataReceiver.java │ │ │ │ │ ├── InputRequestProcess.java │ │ │ │ │ ├── RawRequestProcess.java │ │ │ │ │ ├── RemoteServer.java │ │ │ │ │ ├── RequestProcess.java │ │ │ │ │ └── ShellUtils.java │ │ │ │ │ ├── subtitle │ │ │ │ │ ├── DefaultSubtitleEngine.java │ │ │ │ │ ├── SubtitleEngine.java │ │ │ │ │ ├── SubtitleFinder.java │ │ │ │ │ ├── SubtitleLoadSuccessResult.java │ │ │ │ │ ├── SubtitleLoader.java │ │ │ │ │ ├── UIRenderTask.java │ │ │ │ │ ├── exception │ │ │ │ │ │ └── FatalParsingException.java │ │ │ │ │ ├── format │ │ │ │ │ │ ├── FormatASS.java │ │ │ │ │ │ ├── FormatSCC.java │ │ │ │ │ │ ├── FormatSRT.java │ │ │ │ │ │ ├── FormatSTL.java │ │ │ │ │ │ ├── FormatTTML.java │ │ │ │ │ │ └── TimedTextFileFormat.java │ │ │ │ │ ├── model │ │ │ │ │ │ ├── Region.java │ │ │ │ │ │ ├── Style.java │ │ │ │ │ │ ├── Subtitle.java │ │ │ │ │ │ ├── Time.java │ │ │ │ │ │ └── TimedTextObject.java │ │ │ │ │ ├── runtime │ │ │ │ │ │ ├── AppTaskExecutor.java │ │ │ │ │ │ ├── DefaultTaskExecutor.java │ │ │ │ │ │ └── TaskExecutor.java │ │ │ │ │ └── widget │ │ │ │ │ │ └── SimpleSubtitleView.java │ │ │ │ │ ├── ui │ │ │ │ │ ├── activity │ │ │ │ │ │ ├── CollectActivity.java │ │ │ │ │ │ ├── DetailActivity.java │ │ │ │ │ │ ├── FastSearchActivity.java │ │ │ │ │ │ ├── HistoryActivity.java │ │ │ │ │ │ ├── HomeActivity.java │ │ │ │ │ │ ├── LivePlayActivity.java │ │ │ │ │ │ ├── PlayActivity.java │ │ │ │ │ │ ├── PushActivity.java │ │ │ │ │ │ ├── SearchActivity.java │ │ │ │ │ │ └── SettingActivity.java │ │ │ │ │ ├── adapter │ │ │ │ │ │ ├── ApiHistoryDialogAdapter.java │ │ │ │ │ │ ├── BackupAdapter.java │ │ │ │ │ │ ├── CheckboxSearchAdapter.java │ │ │ │ │ │ ├── CollectAdapter.java │ │ │ │ │ │ ├── FastListAdapter.java │ │ │ │ │ │ ├── FastSearchAdapter.java │ │ │ │ │ │ ├── GridAdapter.java │ │ │ │ │ │ ├── GridFilterKVAdapter.java │ │ │ │ │ │ ├── HistoryAdapter.java │ │ │ │ │ │ ├── HomeHotVodAdapter.java │ │ │ │ │ │ ├── HomePageAdapter.java │ │ │ │ │ │ ├── LiveChannelGroupAdapter.java │ │ │ │ │ │ ├── LiveChannelItemAdapter.java │ │ │ │ │ │ ├── LiveEpgAdapter.java │ │ │ │ │ │ ├── LiveEpgDateAdapter.java │ │ │ │ │ │ ├── LiveSettingGroupAdapter.java │ │ │ │ │ │ ├── LiveSettingItemAdapter.java │ │ │ │ │ │ ├── MyEpgAdapter.java │ │ │ │ │ │ ├── ParseAdapter.java │ │ │ │ │ │ ├── PinyinAdapter.java │ │ │ │ │ │ ├── QuickSearchAdapter.java │ │ │ │ │ │ ├── SearchAdapter.java │ │ │ │ │ │ ├── SearchSubtitleAdapter.java │ │ │ │ │ │ ├── SearchWordAdapter.java │ │ │ │ │ │ ├── SelectDialogAdapter.java │ │ │ │ │ │ ├── SeriesAdapter.java │ │ │ │ │ │ ├── SeriesFlagAdapter.java │ │ │ │ │ │ ├── SettingMenuAdapter.java │ │ │ │ │ │ ├── SettingPageAdapter.java │ │ │ │ │ │ └── SortAdapter.java │ │ │ │ │ ├── dialog │ │ │ │ │ │ ├── AboutDialog.java │ │ │ │ │ │ ├── ApiDialog.java │ │ │ │ │ │ ├── ApiHistoryDialog.java │ │ │ │ │ │ ├── BackupDialog.java │ │ │ │ │ │ ├── BaseDialog.java │ │ │ │ │ │ ├── ConfirmClearDialog.java │ │ │ │ │ │ ├── DescDialog.java │ │ │ │ │ │ ├── GridFilterDialog.java │ │ │ │ │ │ ├── LivePasswordDialog.java │ │ │ │ │ │ ├── QuickSearchDialog.java │ │ │ │ │ │ ├── RemoteDialog.java │ │ │ │ │ │ ├── SearchCheckboxDialog.java │ │ │ │ │ │ ├── SearchRemoteTvDialog.java │ │ │ │ │ │ ├── SearchSubtitleDialog.java │ │ │ │ │ │ ├── SelectDialog.java │ │ │ │ │ │ ├── SubtitleDialog.java │ │ │ │ │ │ ├── TipDialog.java │ │ │ │ │ │ └── XWalkInitDialog.java │ │ │ │ │ ├── fragment │ │ │ │ │ │ ├── GridFragment.java │ │ │ │ │ │ ├── ModelSettingFragment.java │ │ │ │ │ │ ├── PlayFragment.java │ │ │ │ │ │ └── UserFragment.java │ │ │ │ │ └── tv │ │ │ │ │ │ ├── QRCodeGen.java │ │ │ │ │ │ └── widget │ │ │ │ │ │ ├── AudioWaveView.java │ │ │ │ │ │ ├── ChannelListView.java │ │ │ │ │ │ ├── DefaultTransformer.java │ │ │ │ │ │ ├── FixedSpeedScroller.java │ │ │ │ │ │ ├── LoadMoreView.java │ │ │ │ │ │ ├── MarqueeTextView.java │ │ │ │ │ │ ├── NoScrollViewPager.java │ │ │ │ │ │ ├── SearchKeyboard.java │ │ │ │ │ │ └── ViewObj.java │ │ │ │ │ ├── util │ │ │ │ │ ├── AES.java │ │ │ │ │ ├── AdBlocker.java │ │ │ │ │ ├── AppManager.java │ │ │ │ │ ├── AudioTrackMemory.java │ │ │ │ │ ├── CharsetUtils.java │ │ │ │ │ ├── DefaultConfig.java │ │ │ │ │ ├── EpgNameFuzzyMatch.java │ │ │ │ │ ├── EpgUtil.java │ │ │ │ │ ├── FastClickCheckUtil.java │ │ │ │ │ ├── FileUtils.java │ │ │ │ │ ├── HawkConfig.java │ │ │ │ │ ├── HistoryHelper.java │ │ │ │ │ ├── ImgUtil.java │ │ │ │ │ ├── IpScanning.java │ │ │ │ │ ├── LOG.java │ │ │ │ │ ├── LocalIPAddress.java │ │ │ │ │ ├── M3u8.java │ │ │ │ │ ├── MD5.java │ │ │ │ │ ├── OkGoHelper.java │ │ │ │ │ ├── PlayerHelper.java │ │ │ │ │ ├── Proxy.java │ │ │ │ │ ├── RegexUtils.java │ │ │ │ │ ├── SSL │ │ │ │ │ │ └── SSLSocketFactoryCompat.java │ │ │ │ │ ├── ScreenUtils.java │ │ │ │ │ ├── SearchHelper.java │ │ │ │ │ ├── StringUtils.java │ │ │ │ │ ├── SubtitleHelper.java │ │ │ │ │ ├── TLSSocketFactory.java │ │ │ │ │ ├── UA.java │ │ │ │ │ ├── UnicodeReader.java │ │ │ │ │ ├── VideoParseRuler.java │ │ │ │ │ ├── XWalkUtils.java │ │ │ │ │ ├── js │ │ │ │ │ │ ├── Async.java │ │ │ │ │ │ ├── Connect.java │ │ │ │ │ │ ├── Crypto.java │ │ │ │ │ │ ├── FunCall.java │ │ │ │ │ │ ├── Global.java │ │ │ │ │ │ ├── HtmlParser.java │ │ │ │ │ │ ├── JsSpider.java │ │ │ │ │ │ ├── Json.java │ │ │ │ │ │ ├── Req.java │ │ │ │ │ │ ├── Res.java │ │ │ │ │ │ ├── Trans.java │ │ │ │ │ │ ├── local.java │ │ │ │ │ │ └── rsa │ │ │ │ │ │ │ ├── DataUtils.java │ │ │ │ │ │ │ └── RSAEncrypt.java │ │ │ │ │ ├── live │ │ │ │ │ │ └── TxtSubscribe.java │ │ │ │ │ ├── parser │ │ │ │ │ │ ├── JsonParallel.java │ │ │ │ │ │ ├── SuperParse.java │ │ │ │ │ │ └── Utils.java │ │ │ │ │ ├── thunder │ │ │ │ │ │ ├── Jianpian.java │ │ │ │ │ │ └── Thunder.java │ │ │ │ │ └── urlhttp │ │ │ │ │ │ ├── BrotliInterceptor.java │ │ │ │ │ │ ├── CallBackUtil.java │ │ │ │ │ │ ├── OKCallBack.java │ │ │ │ │ │ ├── OKRequest.java │ │ │ │ │ │ ├── OkHttpUtil.java │ │ │ │ │ │ ├── RealRequest.java │ │ │ │ │ │ ├── RealResponse.java │ │ │ │ │ │ ├── RequestUtil.java │ │ │ │ │ │ ├── SSLSocketFactoryCompat.java │ │ │ │ │ │ ├── UrlHttpUtil.java │ │ │ │ │ │ └── internal │ │ │ │ │ │ └── BrotliSource.java │ │ │ │ │ └── viewmodel │ │ │ │ │ ├── SourceViewModel.java │ │ │ │ │ └── SubtitleViewModel.java │ │ │ └── p2p │ │ │ │ └── P2PClass.java │ │ └── okhttp3 │ │ │ └── dnsoverhttps │ │ │ ├── BootstrapDns.java │ │ │ ├── DnsOverHttps.java │ │ │ └── DnsRecordCodec.java │ └── res │ │ ├── drawable-hdpi │ │ └── app_icon.png │ │ ├── drawable-xhdpi │ │ ├── app_icon.png │ │ ├── vod_pause.png │ │ └── vod_play.png │ │ ├── drawable-xxhdpi │ │ └── app_icon.png │ │ ├── drawable-xxxhdpi │ │ └── app_icon.png │ │ ├── drawable │ │ ├── anim_loading.xml │ │ ├── app_banner.png │ │ ├── app_bg.png │ │ ├── bg_channel_list.xml │ │ ├── bg_dialog_rounded.xml │ │ ├── bg_progress_bar_out.xml │ │ ├── bg_scrollview.xml │ │ ├── bg_speed_indicator.xml │ │ ├── box_controller_top_bg.xml │ │ ├── button_detail_collect.xml │ │ ├── button_detail_play.xml │ │ ├── button_detail_quick_search.xml │ │ ├── button_detail_sort.xml │ │ ├── button_dialog_main.xml │ │ ├── button_dialog_vod.xml │ │ ├── button_home_sort_focus.xml │ │ ├── icon_back.png │ │ ├── icon_clear.xml │ │ ├── icon_collect.xml │ │ ├── icon_delete.xml │ │ ├── icon_empty.png │ │ ├── icon_error.xml │ │ ├── icon_filter.xml │ │ ├── icon_filter_color.xml │ │ ├── icon_history.xml │ │ ├── icon_img_placeholder.png │ │ ├── icon_live.xml │ │ ├── icon_loading.png │ │ ├── icon_lock.xml │ │ ├── icon_play.png │ │ ├── icon_pre.png │ │ ├── icon_push.xml │ │ ├── icon_search.xml │ │ ├── icon_setting.xml │ │ ├── icon_unlock.xml │ │ ├── icon_video.png │ │ ├── img_loading_placeholder.xml │ │ ├── input_dialog_api_input.xml │ │ ├── input_search.xml │ │ ├── item_bg_selector_left.xml │ │ ├── item_bg_selector_right.xml │ │ ├── item_right_bg.xml │ │ ├── preview_player_block.xml │ │ ├── scrollview.png │ │ ├── scrollviewleft.png │ │ ├── seekbar_style.xml │ │ ├── seekbar_thumb_normal.xml │ │ ├── seekbar_thumb_pressed.xml │ │ ├── shape_dialog_bg_main.xml │ │ ├── shape_dialog_filter_bg.xml │ │ ├── shape_dialog_pg_search_checkbox.xml │ │ ├── shape_live_channel_num.xml │ │ ├── shape_live_focus.xml │ │ ├── shape_live_select.xml │ │ ├── shape_play_bottom.xml │ │ ├── shape_play_mobile_center.xml │ │ ├── shape_player_control_vod_seek.xml │ │ ├── shape_player_control_vod_seek_thumb.xml │ │ ├── shape_player_control_vod_seek_thumb_normal.xml │ │ ├── shape_player_control_vod_seek_thumb_press.xml │ │ ├── shape_setting_model_focus.xml │ │ ├── shape_setting_sort_focus.xml │ │ ├── shape_source_flag_focus.xml │ │ ├── shape_source_flag_line.xml │ │ ├── shape_source_focus.xml │ │ ├── shape_source_series_focus.xml │ │ ├── shape_thumb_bottom_name.xml │ │ ├── shape_thumb_lang.xml │ │ ├── shape_thumb_note.xml │ │ ├── shape_thumb_year.xml │ │ ├── shape_user_delete.xml │ │ ├── shape_user_focus.xml │ │ ├── shape_user_search.xml │ │ └── transparent.xml │ │ ├── layout │ │ ├── activity_collect.xml │ │ ├── activity_detail.xml │ │ ├── activity_fast_search.xml │ │ ├── activity_history.xml │ │ ├── activity_home.xml │ │ ├── activity_live_play.xml │ │ ├── activity_play.xml │ │ ├── activity_push.xml │ │ ├── activity_search.xml │ │ ├── activity_setting.xml │ │ ├── box_vod_control_view.xml │ │ ├── dialog_about.xml │ │ ├── dialog_api.xml │ │ ├── dialog_api_history.xml │ │ ├── dialog_backup.xml │ │ ├── dialog_checkbox_search.xml │ │ ├── dialog_confirm.xml │ │ ├── dialog_desc.xml │ │ ├── dialog_grid_filter.xml │ │ ├── dialog_live_password.xml │ │ ├── dialog_quick_search.xml │ │ ├── dialog_remote.xml │ │ ├── dialog_search_remotetv.xml │ │ ├── dialog_search_subtitle.xml │ │ ├── dialog_select.xml │ │ ├── dialog_subtitle.xml │ │ ├── dialog_tip.xml │ │ ├── dialog_xwalk.xml │ │ ├── epglist_item.xml │ │ ├── fragment_grid.xml │ │ ├── fragment_model.xml │ │ ├── fragment_user.xml │ │ ├── item_dialog_api_history.xml │ │ ├── item_dialog_backup.xml │ │ ├── item_dialog_checkbox_search.xml │ │ ├── item_dialog_select.xml │ │ ├── item_grid.xml │ │ ├── item_grid_filter.xml │ │ ├── item_grid_filter_value.xml │ │ ├── item_home_sort.xml │ │ ├── item_keyboard.xml │ │ ├── item_list.xml │ │ ├── item_live.xml │ │ ├── item_live_channel.xml │ │ ├── item_live_channel_group.xml │ │ ├── item_live_setting.xml │ │ ├── item_live_setting_group.xml │ │ ├── item_play_parse.xml │ │ ├── item_quick_search_lite.xml │ │ ├── item_search.xml │ │ ├── item_search_lite.xml │ │ ├── item_search_subtitle_result.xml │ │ ├── item_search_word_hot.xml │ │ ├── item_search_word_split.xml │ │ ├── item_series.xml │ │ ├── item_series_flag.xml │ │ ├── item_series_group.xml │ │ ├── item_setting_menu.xml │ │ ├── item_user_hot_vod.xml │ │ ├── item_view_load_more.xml │ │ ├── layout_keyborad.xml │ │ ├── loadsir_empty_layout.xml │ │ ├── loadsir_loading_layout.xml │ │ ├── player_live_control_view.xml │ │ └── player_vod_control_view.xml │ │ ├── raw │ │ ├── index.html │ │ ├── jquery.js │ │ ├── script.js │ │ ├── style.css │ │ └── ui.css │ │ ├── values │ │ ├── attrs.xml │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ │ └── xml │ │ ├── file_paths.xml │ │ └── network_security_config.xml │ ├── normal │ └── java │ │ └── com │ │ └── github │ │ └── catvod │ │ └── crawler │ │ └── pyLoader.java │ └── python │ └── java │ └── com │ ├── github │ └── catvod │ │ └── crawler │ │ └── pyLoader.java │ └── undcover │ └── freedom │ └── pyramid │ ├── PyLog.java │ ├── PyToast.java │ ├── PythonLoader.java │ └── PythonSpider.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── player ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ ├── tv │ │ └── danmaku │ │ │ └── ijk │ │ │ └── media │ │ │ ├── player │ │ │ ├── AbstractMediaPlayer.java │ │ │ ├── AndroidMediaPlayer.java │ │ │ ├── IMediaPlayer.java │ │ │ ├── ISurfaceTextureHolder.java │ │ │ ├── ISurfaceTextureHost.java │ │ │ ├── IjkLibLoader.java │ │ │ ├── IjkMediaCodecInfo.java │ │ │ ├── IjkMediaMeta.java │ │ │ ├── IjkMediaPlayer.java │ │ │ ├── IjkTimedText.java │ │ │ ├── MediaInfo.java │ │ │ ├── MediaPlayerProxy.java │ │ │ ├── TextureMediaPlayer.java │ │ │ ├── annotations │ │ │ │ ├── AccessedByNative.java │ │ │ │ └── CalledByNative.java │ │ │ ├── demo │ │ │ │ └── IjkDemoActivity.java │ │ │ ├── exceptions │ │ │ │ └── IjkMediaException.java │ │ │ ├── ffmpeg │ │ │ │ └── FFmpegApi.java │ │ │ ├── misc │ │ │ │ ├── AndroidMediaFormat.java │ │ │ │ ├── AndroidTrackInfo.java │ │ │ │ ├── IAndroidIO.java │ │ │ │ ├── IMediaDataSource.java │ │ │ │ ├── IMediaFormat.java │ │ │ │ ├── ITrackInfo.java │ │ │ │ ├── IjkMediaFormat.java │ │ │ │ └── IjkTrackInfo.java │ │ │ └── pragma │ │ │ │ ├── DebugLog.java │ │ │ │ └── Pragma.java │ │ │ └── player_armv7a │ │ │ └── Pragma.java │ └── xyz │ │ └── doikki │ │ └── videoplayer │ │ ├── controller │ │ ├── BaseVideoController.java │ │ ├── ControlWrapper.java │ │ ├── GestureVideoController.java │ │ ├── IControlComponent.java │ │ ├── IGestureComponent.java │ │ ├── IVideoController.java │ │ ├── MediaPlayerControl.java │ │ └── OrientationHelper.java │ │ ├── exo │ │ ├── ExoMediaPlayer.java │ │ ├── ExoMediaPlayerFactory.java │ │ └── ExoMediaSourceHelper.java │ │ ├── ijk │ │ ├── IjkPlayer.java │ │ ├── IjkPlayerFactory.java │ │ └── RawDataSourceProvider.java │ │ ├── player │ │ ├── AbstractPlayer.java │ │ ├── AndroidMediaPlayer.java │ │ ├── AndroidMediaPlayerFactory.java │ │ ├── AudioFocusHelper.java │ │ ├── PlayerFactory.java │ │ ├── ProgressManager.java │ │ ├── VideoView.java │ │ ├── VideoViewConfig.java │ │ └── VideoViewManager.java │ │ ├── render │ │ ├── IRenderView.java │ │ ├── MeasureHelper.java │ │ ├── RenderViewFactory.java │ │ ├── TextureRenderView.java │ │ └── TextureRenderViewFactory.java │ │ └── util │ │ ├── CutoutUtil.java │ │ ├── L.java │ │ └── PlayerUtils.java │ ├── jniLibs │ └── armeabi-v7a │ │ ├── libijkffmpeg.so │ │ ├── libijksdl.so │ │ ├── libp2p.so │ │ ├── libplayer.so │ │ ├── libxl_stat.so │ │ └── libxl_thunder_sdk.so │ └── res │ ├── layout │ └── ijk_demo_activity.xml │ └── values │ ├── attrs.xml │ └── strings.xml ├── pyramid ├── build.gradle ├── consumer-rules.pro ├── proguard-rules.pro └── src │ ├── main │ └── AndroidManifest.xml │ └── python │ ├── app.py │ ├── base │ ├── htmlParser.py │ ├── localProxy.py │ └── spider.py │ ├── runner.py │ └── trigger.py ├── quickjs ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── whl │ │ └── quickjs │ │ ├── android │ │ └── QuickJSLoader.java │ │ └── wrapper │ │ ├── BindingContext.java │ │ ├── ContextSetter.java │ │ ├── Function.java │ │ ├── JSArray.java │ │ ├── JSCallFunction.java │ │ ├── JSConsole.java │ │ ├── JSFunction.java │ │ ├── JSObject.java │ │ ├── JSUtils.java │ │ ├── ModuleLoader.java │ │ ├── NativeCleaner.java │ │ ├── QuickJSContext.java │ │ ├── QuickJSException.java │ │ └── UriUtil.java │ └── jniLibs │ └── armeabi-v7a │ └── libquickjs-android-wrapper.so └── settings.gradle /.github/workflows/TVBoxOSC.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/q215613905/TVBoxOS/49e631437836a97cdf158544267de59855c11b6a/.github/workflows/TVBoxOSC.jks -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | TVBox -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | <<<<<<<<<<<<<>>>>>>>>>>>> 2 | # TVBox 3 | 4 | === Source Code - Editing the app default settings === 5 | 6 | //searchable:搜索开关 0:关闭 1:启用 7 | //filterable:首页可选 0:否 1:是 8 | //playerType:播放器类型 0:系统 1:IJK 2:EXO 9 | //采集接口类型 0:xml 1:json 3:jar 4:remote 10 | //parses解析类型 0:嗅探,自带播放器 1:解析,返回直链 11 | //直播参数说明 ua:用户自定义ua epg:节目网址 logo:台标网址 12 | 13 | { 14 | "spider": "./your.jar", 15 | "wallpaper": "./api/img", 16 | "sites": [], 17 | "parses": [], 18 | "hosts": [ 19 | "cache.ott.ystenlive.itv.cmvideo.cn=base-v4-free-mghy.e.cdn.chinamobile.com", 20 | "cache.ott.bestlive.itv.cmvideo.cn=ip" 21 | ], 22 | "lives": [], 23 | "rules": [], 24 | "doh": [ 25 | { 26 | "name": "騰訊", 27 | "url": "https://doh.pub/dns-query" 28 | }, 29 | { 30 | "name": "阿里", 31 | "url": "https://dns.alidns.com/dns-query" 32 | }, 33 | { 34 | "name": "360", 35 | "url": "https://doh.360.cn/dns-query" 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /app/libs/commons-lang3-3.12.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/q215613905/TVBoxOS/49e631437836a97cdf158544267de59855c11b6a/app/libs/commons-lang3-3.12.0.jar -------------------------------------------------------------------------------- /app/libs/thunder.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/q215613905/TVBoxOS/49e631437836a97cdf158544267de59855c11b6a/app/libs/thunder.jar -------------------------------------------------------------------------------- /app/libs/xwalk_shared_library-23.53.589.4.aar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/q215613905/TVBoxOS/49e631437836a97cdf158544267de59855c11b6a/app/libs/xwalk_shared_library-23.53.589.4.aar -------------------------------------------------------------------------------- /app/proguard-python.pro: -------------------------------------------------------------------------------- 1 | # Python支持 2 | -keep public class com.undcover.freedom.pyramid.** { *; } 3 | -dontwarn com.undcover.freedom.pyramid.** 4 | -keep public class com.chaquo.python.** { *; } 5 | -dontwarn com.chaquo.python.** 6 | -------------------------------------------------------------------------------- /app/src/main/assets/js/lib/net.js: -------------------------------------------------------------------------------- 1 | let req = (url, options) => http(url, Object.assign({ 2 | async: false 3 | }, options)); 4 | 5 | function http(url, options = {}) { 6 | if (options?.async === false) return _http(url, options) 7 | return new Promise(resolve => _http(url, Object.assign({ 8 | complete: res => resolve(res) 9 | }, options))).catch(err => { 10 | console.error(err.name, err.message, err.stack) 11 | return { 12 | ok: false, 13 | status: 500, 14 | url 15 | } 16 | }) 17 | }; -------------------------------------------------------------------------------- /app/src/main/assets/ua.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/q215613905/TVBoxOS/49e631437836a97cdf158544267de59855c11b6a/app/src/main/assets/ua.db -------------------------------------------------------------------------------- /app/src/main/java/com/github/catvod/crawler/SpiderDebug.java: -------------------------------------------------------------------------------- 1 | package com.github.catvod.crawler; 2 | 3 | public class SpiderDebug { 4 | public static void log(Throwable th) { 5 | try { 6 | android.util.Log.d("SpiderLog", th.getMessage(), th); 7 | } catch (Throwable th1) { 8 | 9 | } 10 | } 11 | 12 | public static void log(String msg) { 13 | try { 14 | android.util.Log.d("SpiderLog", msg); 15 | } catch (Throwable th1) { 16 | 17 | } 18 | } 19 | 20 | public static String ec(int i) { 21 | return ""; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/catvod/crawler/SpiderNull.java: -------------------------------------------------------------------------------- 1 | package com.github.catvod.crawler; 2 | 3 | public class SpiderNull extends Spider { 4 | } 5 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/catvod/crawler/python/IPyLoader.java: -------------------------------------------------------------------------------- 1 | package com.github.catvod.crawler.python; 2 | 3 | import com.github.catvod.crawler.Spider; 4 | 5 | import java.util.Map; 6 | 7 | public interface IPyLoader { 8 | void clear(); 9 | void setConfig(String jsonStr); 10 | void setRecentPyKey(String pyApi); 11 | Spider getSpider(String key, String cls, String ext); 12 | Object[] proxyInvoke(Map params); 13 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/bean/AbsSortJson.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.bean; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.io.Serializable; 6 | import java.util.ArrayList; 7 | 8 | public class AbsSortJson implements Serializable { 9 | 10 | @SerializedName(value = "class") 11 | public ArrayList classes; 12 | 13 | @SerializedName(value = "list") 14 | public ArrayList list; 15 | 16 | public AbsSortXml toAbsSortXml() { 17 | AbsSortXml absSortXml = new AbsSortXml(); 18 | MovieSort movieSort = new MovieSort(); 19 | movieSort.sortList = new ArrayList<>(); 20 | for (AbsJsonClass cls : classes) { 21 | MovieSort.SortData sortData = new MovieSort.SortData(); 22 | sortData.id = cls.type_id; 23 | sortData.name = cls.type_name; 24 | sortData.flag = cls.type_flag; 25 | movieSort.sortList.add(sortData); 26 | } 27 | if (list != null && !list.isEmpty()) { 28 | Movie movie = new Movie(); 29 | ArrayList videos = new ArrayList<>(); 30 | for (AbsJson.AbsJsonVod vod : list) { 31 | videos.add(vod.toXmlVideo()); 32 | } 33 | movie.videoList = videos; 34 | absSortXml.list = movie; 35 | } else { 36 | absSortXml.list = null; 37 | } 38 | absSortXml.classes = movieSort; 39 | return absSortXml; 40 | } 41 | 42 | public class AbsJsonClass implements Serializable { 43 | public String type_id; 44 | public String type_name; 45 | public String type_flag; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/bean/AbsSortXml.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.bean; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | import java.io.Serializable; 6 | import java.util.List; 7 | 8 | /** 9 | * @author pj567 10 | * @date :2020/12/18 11 | * @description: 12 | */ 13 | @XStreamAlias("rss") 14 | public class AbsSortXml implements Serializable { 15 | @XStreamAlias("class") 16 | public MovieSort classes; 17 | 18 | @XStreamAlias("list") 19 | public Movie list; 20 | 21 | public List videoList; 22 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/bean/AbsXml.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.bean; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * @author pj567 9 | * @date :2020/12/18 10 | * @description: 11 | */ 12 | @XStreamAlias("rss") 13 | public class AbsXml implements Serializable { 14 | @XStreamAlias("list") 15 | public Movie movie; 16 | 17 | @XStreamAlias("msg") 18 | public String msg; 19 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/bean/IJKCode.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.bean; 2 | 3 | import com.github.tvbox.osc.util.HawkConfig; 4 | import com.orhanobut.hawk.Hawk; 5 | 6 | import java.util.LinkedHashMap; 7 | 8 | /** 9 | * @author pj567 10 | * @date :2021/3/8 11 | * @description: 12 | */ 13 | public class IJKCode { 14 | private String name; 15 | private LinkedHashMap option; 16 | private boolean selected; 17 | 18 | public void selected(boolean selected) { 19 | this.selected = selected; 20 | if (selected) { 21 | Hawk.put(HawkConfig.IJK_CODEC, name); 22 | } 23 | } 24 | 25 | public boolean isSelected() { 26 | return selected; 27 | } 28 | 29 | public String getName() { 30 | return name; 31 | } 32 | 33 | public void setName(String name) { 34 | this.name = name; 35 | } 36 | 37 | public LinkedHashMap getOption() { 38 | return option; 39 | } 40 | 41 | public void setOption(LinkedHashMap option) { 42 | this.option = option; 43 | } 44 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/bean/IpScanningVo.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.bean; 2 | 3 | public class IpScanningVo { 4 | 5 | private String hostName; 6 | private String ip; 7 | 8 | public IpScanningVo(String hostName, String ip) { 9 | this.hostName = hostName; 10 | this.ip = ip; 11 | } 12 | 13 | public String getHostName() { 14 | return hostName; 15 | } 16 | 17 | public void setHostName(String hostName) { 18 | this.hostName = hostName; 19 | } 20 | 21 | public String getIp() { 22 | return ip; 23 | } 24 | 25 | public void setIp(String ip) { 26 | this.ip = ip; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/bean/LiveChannelGroup.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.bean; 2 | 3 | import java.util.ArrayList; 4 | 5 | public class LiveChannelGroup { 6 | /** 7 | * groupIndex : 分组索引号 8 | * groupName : 分组名称 9 | * password : 分组密码 10 | */ 11 | private int groupIndex; 12 | private String groupName; 13 | private String groupPassword; 14 | private ArrayList liveChannelItems; 15 | 16 | public int getGroupIndex() { 17 | return groupIndex; 18 | } 19 | 20 | public void setGroupIndex(int groupIndex) { 21 | this.groupIndex = groupIndex; 22 | } 23 | 24 | public String getGroupName() { 25 | return groupName; 26 | } 27 | 28 | public void setGroupName(String groupName) { 29 | this.groupName = groupName; 30 | } 31 | 32 | public ArrayList getLiveChannels() { 33 | return liveChannelItems; 34 | } 35 | 36 | public void setLiveChannels(ArrayList liveChannelItems) { 37 | this.liveChannelItems = liveChannelItems; 38 | } 39 | 40 | public String getGroupPassword() { 41 | return groupPassword; 42 | } 43 | 44 | public void setGroupPassword(String groupPassword) { 45 | this.groupPassword = groupPassword; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/bean/LiveDayListGroup.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.bean; 2 | 3 | public class LiveDayListGroup { 4 | private int groupIndex; 5 | private String groupName; 6 | 7 | 8 | public int getGroupIndex() { 9 | return groupIndex; 10 | } 11 | 12 | public void setGroupIndex(int groupIndex) { 13 | this.groupIndex = groupIndex; 14 | } 15 | 16 | public String getGroupName() { 17 | return groupName; 18 | } 19 | 20 | public void setGroupName(String groupName) { 21 | this.groupName = groupName; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/bean/LiveEpgDate.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.bean; 2 | import java.util.ArrayList; 3 | import java.util.Date; 4 | 5 | public class LiveEpgDate { 6 | 7 | private int index; 8 | private String datePresented; 9 | private Date dateParamVal; 10 | 11 | public int getIndex() { 12 | return index; 13 | } 14 | 15 | public void setIndex(int index) { 16 | this.index = index; 17 | } 18 | 19 | public String getDatePresented() { 20 | return datePresented; 21 | } 22 | 23 | public void setDatePresented(String datePresented) { 24 | this.datePresented = datePresented; 25 | } 26 | 27 | public Date getDateParamVal() { 28 | return dateParamVal; 29 | } 30 | 31 | public void setDateParamVal(Date dateParamVal) { 32 | this.dateParamVal = dateParamVal; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/bean/LiveSettingGroup.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.bean; 2 | 3 | import java.util.ArrayList; 4 | 5 | public class LiveSettingGroup { 6 | private int groupIndex; 7 | private String groupName; 8 | private ArrayList liveSettingItems; 9 | 10 | public int getGroupIndex() { 11 | return groupIndex; 12 | } 13 | 14 | public void setGroupIndex(int groupIndex) { 15 | this.groupIndex = groupIndex; 16 | } 17 | 18 | public String getGroupName() { 19 | return groupName; 20 | } 21 | 22 | public void setGroupName(String groupName) { 23 | this.groupName = groupName; 24 | } 25 | 26 | public ArrayList getLiveSettingItems() { 27 | return liveSettingItems; 28 | } 29 | 30 | public void setLiveSettingItems(ArrayList liveSettingItems) { 31 | this.liveSettingItems = liveSettingItems; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/bean/LiveSettingItem.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.bean; 2 | 3 | /** 4 | * @author pj567 5 | * @date :2021/1/12 6 | * @description: 7 | */ 8 | public class LiveSettingItem { 9 | private int itemIndex; 10 | private String itemName; 11 | private boolean itemSelected = false; 12 | 13 | public int getItemIndex() { 14 | return itemIndex; 15 | } 16 | 17 | public void setItemIndex(int itemIndex) { 18 | this.itemIndex = itemIndex; 19 | } 20 | 21 | public String getItemName() { 22 | return itemName; 23 | } 24 | 25 | public void setItemName(String itemName) { 26 | this.itemName = itemName; 27 | } 28 | 29 | public boolean isItemSelected() { 30 | return itemSelected; 31 | } 32 | 33 | public void setItemSelected(boolean itemSelected) { 34 | this.itemSelected = itemSelected; 35 | } 36 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/bean/Subtitle.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.bean; 2 | 3 | public class Subtitle { 4 | 5 | private String name; 6 | 7 | private String url; 8 | 9 | private boolean isZip; 10 | 11 | public boolean getIsZip() { 12 | return isZip; 13 | } 14 | 15 | public String getName() { 16 | return name; 17 | } 18 | 19 | public String getUrl() { 20 | return url; 21 | } 22 | 23 | public void setName(String name) { 24 | this.name = name; 25 | } 26 | 27 | public void setUrl(String url) { 28 | this.url = url; 29 | } 30 | 31 | public void setIsZip(boolean zip) { 32 | isZip = zip; 33 | } 34 | 35 | @Override 36 | public String toString() { 37 | return "Subtitle{" + 38 | "name='" + name + '\'' + 39 | ", url='" + url + '\'' + 40 | ", isZip=" + isZip + 41 | '}'; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/bean/SubtitleData.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.bean; 2 | 3 | import java.util.List; 4 | 5 | public class SubtitleData { 6 | 7 | private Boolean isNew; 8 | 9 | private List subtitleList; 10 | 11 | private Boolean isZip; 12 | 13 | public Boolean getIsNew() { 14 | return isNew; 15 | } 16 | 17 | public List getSubtitleList() { 18 | return subtitleList; 19 | } 20 | 21 | public Boolean getIsZip() { 22 | return isZip; 23 | } 24 | 25 | public void setIsNew(Boolean isNew) { 26 | this.isNew = isNew; 27 | } 28 | 29 | public void setSubtitleList(List subtitle) { 30 | this.subtitleList = subtitle; 31 | } 32 | 33 | public void setIsZip(Boolean zip) { 34 | isZip = zip; 35 | } 36 | 37 | @Override 38 | public String toString() { 39 | return "SubtitleData{" + 40 | "isNew='" + isNew + '\'' + 41 | '}'; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/cache/Cache.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.cache; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.room.Entity; 5 | import androidx.room.PrimaryKey; 6 | 7 | import java.io.Serializable; 8 | 9 | /** 10 | * 类描述: 11 | * 12 | * @author pj567 13 | * @since 2020/5/15 14 | */ 15 | @Entity(tableName = "cache") 16 | public class Cache implements Serializable { 17 | @PrimaryKey(autoGenerate = false) 18 | @NonNull 19 | public String key; 20 | public byte[] data; 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/cache/CacheDao.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.cache; 2 | 3 | import androidx.room.Dao; 4 | import androidx.room.Delete; 5 | import androidx.room.Insert; 6 | import androidx.room.OnConflictStrategy; 7 | import androidx.room.Query; 8 | import androidx.room.Update; 9 | 10 | /** 11 | * 类描述: 12 | * 13 | * @author pj567 14 | * @since 2020/5/15 15 | */ 16 | @Dao 17 | public interface CacheDao { 18 | @Insert(onConflict = OnConflictStrategy.REPLACE) 19 | long save(Cache cache); 20 | 21 | /** 22 | * 注意,冒号后面必须紧跟参数名,中间不能有空格。大于小于号和冒号中间是有空格的。 23 | * select *from cache where【表中列名】 =:【参数名】------>等于 24 | * where 【表中列名】 < :【参数名】 小于 25 | * where 【表中列名】 between :【参数名1】 and :【参数2】------->这个区间 26 | * where 【表中列名】like :参数名----->模糊查询 27 | * where 【表中列名】 in (:【参数名集合】)---->查询符合集合内指定字段值的记录 28 | * 29 | * @param key 30 | * @return 31 | */ 32 | 33 | //如果是一对多,这里可以写List 34 | @Query("select *from cache where `key`=:key") 35 | Cache getCache(String key); 36 | 37 | //只能传递对象昂,删除时根据Cache中的主键 来比对的 38 | @Delete 39 | int delete(Cache cache); 40 | 41 | //只能传递对象昂,删除时根据Cache中的主键 来比对的 42 | @Update(onConflict = OnConflictStrategy.REPLACE) 43 | int update(Cache cache); 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/cache/VodCollect.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.cache; 2 | 3 | import androidx.room.ColumnInfo; 4 | import androidx.room.Entity; 5 | import androidx.room.PrimaryKey; 6 | 7 | import java.io.Serializable; 8 | 9 | @Entity(tableName = "vodCollect") 10 | public class VodCollect implements Serializable { 11 | @PrimaryKey(autoGenerate = true) 12 | private int id; 13 | @ColumnInfo(name = "vodId") 14 | public String vodId; 15 | @ColumnInfo(name = "updateTime") 16 | public long updateTime; 17 | @ColumnInfo(name = "sourceKey") 18 | public String sourceKey; 19 | @ColumnInfo(name = "name") 20 | public String name; 21 | @ColumnInfo(name = "pic") 22 | public String pic; 23 | 24 | public int getId() { 25 | return id; 26 | } 27 | 28 | public void setId(int id) { 29 | this.id = id; 30 | } 31 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/cache/VodCollectDao.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.cache; 2 | 3 | import androidx.room.Dao; 4 | import androidx.room.Delete; 5 | import androidx.room.Insert; 6 | import androidx.room.OnConflictStrategy; 7 | import androidx.room.Query; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @author pj567 13 | * @date :2021/1/7 14 | * @description: 15 | */ 16 | @Dao 17 | public interface VodCollectDao { 18 | @Insert(onConflict = OnConflictStrategy.REPLACE) 19 | long insert(VodCollect record); 20 | 21 | @Query("select * from vodCollect order by updateTime desc") 22 | List getAll(); 23 | 24 | @Query("select * from vodCollect where `id`=:id") 25 | VodCollect getVodCollect(int id); 26 | 27 | @Query("delete from vodCollect where `id`=:id") 28 | void delete(int id); 29 | 30 | @Query("select * from vodCollect where `sourceKey`=:sourceKey and `vodId`=:vodId") 31 | VodCollect getVodCollect(String sourceKey, String vodId); 32 | 33 | @Delete 34 | int delete(VodCollect record); 35 | 36 | @Query("DELETE FROM vodCollect") 37 | void deleteAll(); 38 | 39 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/cache/VodRecord.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.cache; 2 | 3 | import androidx.room.ColumnInfo; 4 | import androidx.room.Entity; 5 | import androidx.room.PrimaryKey; 6 | 7 | import java.io.Serializable; 8 | 9 | /** 10 | * @author pj567 11 | * @date :2021/1/7 12 | * @description: 13 | */ 14 | @Entity(tableName = "vodRecord") 15 | public class VodRecord implements Serializable { 16 | @PrimaryKey(autoGenerate = true) 17 | private int id; 18 | @ColumnInfo(name = "vodId") 19 | public String vodId; 20 | @ColumnInfo(name = "updateTime") 21 | public long updateTime; 22 | @ColumnInfo(name = "sourceKey") 23 | public String sourceKey; 24 | public String dataJson; 25 | 26 | public int getId() { 27 | return id; 28 | } 29 | 30 | public void setId(int id) { 31 | this.id = id; 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/cache/VodRecordDao.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.cache; 2 | 3 | import androidx.room.Dao; 4 | import androidx.room.Delete; 5 | import androidx.room.Insert; 6 | import androidx.room.OnConflictStrategy; 7 | import androidx.room.Query; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @author pj567 13 | * @date :2021/1/7 14 | * @description: 15 | */ 16 | @Dao 17 | public interface VodRecordDao { 18 | @Insert(onConflict = OnConflictStrategy.REPLACE) 19 | long insert(VodRecord record); 20 | 21 | @Query("select * from vodRecord order by updateTime desc limit :size") 22 | List getAll(int size); 23 | 24 | @Query("select * from vodRecord where `sourceKey`=:sourceKey and `vodId`=:vodId") 25 | VodRecord getVodRecord(String sourceKey, String vodId); 26 | 27 | @Delete 28 | int delete(VodRecord record); 29 | 30 | @Query("select count(*) from vodRecord") 31 | int getCount(); 32 | 33 | @Query("DELETE FROM vodRecord") 34 | void deleteAll(); 35 | 36 | /** 37 | * 保留最新指定条数, 其他删除. 38 | * @param size 保留条数 39 | * @return 40 | */ 41 | @Query("DELETE FROM vodRecord where id NOT IN (SELECT id FROM vodRecord ORDER BY updateTime desc LIMIT :size)") 42 | int reserver(int size); 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/callback/EmptyCallback.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.callback; 2 | 3 | import com.github.tvbox.osc.R; 4 | import com.kingja.loadsir.callback.Callback; 5 | 6 | /** 7 | * @author pj567 8 | * @date :2020/12/24 9 | * @description: 10 | */ 11 | public class EmptyCallback extends Callback { 12 | @Override 13 | protected int onCreateView() { 14 | return R.layout.loadsir_empty_layout; 15 | } 16 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/callback/LoadingCallback.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.callback; 2 | 3 | import com.github.tvbox.osc.R; 4 | import com.kingja.loadsir.callback.Callback; 5 | 6 | /** 7 | * @author pj567 8 | * @date :2020/12/24 9 | * @description: 10 | */ 11 | public class LoadingCallback extends Callback { 12 | @Override 13 | protected int onCreateView() { 14 | return R.layout.loadsir_loading_layout; 15 | } 16 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/data/AppDataBase.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.data; 2 | 3 | import androidx.room.Database; 4 | import androidx.room.RoomDatabase; 5 | 6 | import com.github.tvbox.osc.cache.Cache; 7 | import com.github.tvbox.osc.cache.CacheDao; 8 | import com.github.tvbox.osc.cache.VodCollect; 9 | import com.github.tvbox.osc.cache.VodCollectDao; 10 | import com.github.tvbox.osc.cache.VodRecord; 11 | import com.github.tvbox.osc.cache.VodRecordDao; 12 | 13 | 14 | /** 15 | * 类描述: 16 | * 17 | * @author pj567 18 | * @since 2020/5/15 19 | */ 20 | @Database(entities = {Cache.class, VodRecord.class, VodCollect.class}, version = 1) 21 | public abstract class AppDataBase extends RoomDatabase { 22 | public abstract CacheDao getCacheDao(); 23 | 24 | public abstract VodRecordDao getVodRecordDao(); 25 | 26 | public abstract VodCollectDao getVodCollectDao(); 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/event/HistoryStateEvent.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.event; 2 | 3 | /** 4 | * @author pj567 5 | * @date :2020/12/21 6 | * @description: 7 | */ 8 | public class HistoryStateEvent { 9 | public final static int TYPE_TOP = 0; 10 | public int type; 11 | 12 | public HistoryStateEvent(int type) { 13 | this.type = type; 14 | } 15 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/event/RefreshEvent.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.event; 2 | 3 | /** 4 | * @author pj567 5 | * @date :2021/1/6 6 | * @description: 7 | */ 8 | public class RefreshEvent { 9 | public static final int TYPE_REFRESH = 0; 10 | public static final int TYPE_HISTORY_REFRESH = 1; 11 | public static final int TYPE_QUICK_SEARCH = 2; 12 | public static final int TYPE_QUICK_SEARCH_SELECT = 3; 13 | public static final int TYPE_QUICK_SEARCH_WORD = 4; 14 | public static final int TYPE_QUICK_SEARCH_WORD_CHANGE = 5; 15 | public static final int TYPE_SEARCH_RESULT = 6; 16 | public static final int TYPE_QUICK_SEARCH_RESULT = 7; 17 | public static final int TYPE_API_URL_CHANGE = 8; 18 | public static final int TYPE_PUSH_URL = 9; 19 | public static final int TYPE_EPG_URL_CHANGE = 10; 20 | public static final int TYPE_SETTING_SEARCH_TV = 11; 21 | public static final int TYPE_SUBTITLE_SIZE_CHANGE = 12; 22 | public static final int TYPE_FILTER_CHANGE = 13; 23 | public int type; 24 | public Object obj; 25 | 26 | public RefreshEvent(int type) { 27 | this.type = type; 28 | } 29 | 30 | public RefreshEvent(int type, Object obj) { 31 | this.type = type; 32 | this.obj = obj; 33 | } 34 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/event/ServerEvent.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.event; 2 | 3 | /** 4 | * @author pj567 5 | * @date :2021/1/5 6 | * @description: 7 | */ 8 | public class ServerEvent { 9 | public static final int SERVER_SUCCESS = 0; 10 | public static final int SERVER_CONNECTION = 1; 11 | public static final int SERVER_SEARCH = 2; 12 | public int type; 13 | public Object obj; 14 | 15 | public ServerEvent(int type) { 16 | this.type = type; 17 | } 18 | 19 | public ServerEvent(int type, Object obj) { 20 | this.type = type; 21 | this.obj = obj; 22 | } 23 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/event/TopStateEvent.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.event; 2 | 3 | /** 4 | * @author pj567 5 | * @date :2020/12/21 6 | * @description: 7 | */ 8 | public class TopStateEvent { 9 | public final static int TYPE_TOP = 0; 10 | public int type; 11 | 12 | public TopStateEvent(int type) { 13 | this.type = type; 14 | } 15 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/player/ExoMediaPlayerFactory.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.player; 2 | 3 | import android.content.Context; 4 | 5 | import xyz.doikki.videoplayer.player.PlayerFactory; 6 | 7 | public class ExoMediaPlayerFactory extends PlayerFactory { 8 | 9 | public static ExoMediaPlayerFactory create() { 10 | return new ExoMediaPlayerFactory(); 11 | } 12 | 13 | @Override 14 | public ExoPlayer createPlayer(Context context) { 15 | return new ExoPlayer(context); 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/player/MyVideoView.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.player; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | 6 | import androidx.annotation.NonNull; 7 | import androidx.annotation.Nullable; 8 | 9 | import xyz.doikki.videoplayer.player.AbstractPlayer; 10 | import xyz.doikki.videoplayer.player.VideoView; 11 | 12 | public class MyVideoView extends VideoView { 13 | public MyVideoView(@NonNull Context context) { 14 | super(context, null); 15 | } 16 | 17 | public MyVideoView(@NonNull Context context, @Nullable AttributeSet attrs) { 18 | super(context, attrs, 0); 19 | } 20 | 21 | public MyVideoView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) { 22 | super(context, attrs, defStyleAttr); 23 | } 24 | 25 | public AbstractPlayer getMediaPlayer() { 26 | return mMediaPlayer; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/player/TrackInfo.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.player; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class TrackInfo { 7 | private List audio; 8 | private List subtitle; 9 | 10 | public TrackInfo() { 11 | audio = new ArrayList<>(); 12 | subtitle = new ArrayList<>(); 13 | } 14 | 15 | public List getAudio() { 16 | return audio; 17 | } 18 | 19 | public int getAudioSelected(boolean track) { 20 | return getSelected(audio, track); 21 | } 22 | 23 | public int getSubtitleSelected(boolean track) { 24 | return getSelected(subtitle, track); 25 | } 26 | 27 | public int getSelected(List list, boolean track) { 28 | int i = 0; 29 | for (TrackInfoBean trackInfoBean : list) { 30 | if (trackInfoBean.selected) return track ? trackInfoBean.index : i; 31 | i++; 32 | } 33 | return 99999; 34 | } 35 | 36 | public void addAudio(TrackInfoBean audio) { 37 | this.audio.add(audio); 38 | } 39 | 40 | public List getSubtitle() { 41 | return subtitle; 42 | } 43 | 44 | public void addSubtitle(TrackInfoBean subtitle) { 45 | this.subtitle.add(subtitle); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/player/TrackInfoBean.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.player; 2 | 3 | public class TrackInfoBean { 4 | public String name; 5 | public String language; 6 | public int groupIndex; 7 | public int index; 8 | public boolean selected; 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/player/render/SurfaceRenderViewFactory.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.player.render; 2 | 3 | import android.content.Context; 4 | 5 | import xyz.doikki.videoplayer.render.IRenderView; 6 | import xyz.doikki.videoplayer.render.RenderViewFactory; 7 | 8 | public class SurfaceRenderViewFactory extends RenderViewFactory { 9 | 10 | public static SurfaceRenderViewFactory create() { 11 | return new SurfaceRenderViewFactory(); 12 | } 13 | 14 | @Override 15 | public IRenderView createRenderView(Context context) { 16 | return new SurfaceRenderView(context); 17 | } 18 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/receiver/SearchReceiver.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.receiver; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | 7 | import com.github.tvbox.osc.event.ServerEvent; 8 | import com.github.tvbox.osc.ui.activity.SearchActivity; 9 | import com.github.tvbox.osc.util.AppManager; 10 | 11 | import org.greenrobot.eventbus.EventBus; 12 | 13 | /** 14 | * @author pj567 15 | * @date :2021/1/5 16 | * @description: 17 | */ 18 | public class SearchReceiver extends BroadcastReceiver { 19 | public static String action = "android.content.movie.search.Action"; 20 | 21 | @Override 22 | public void onReceive(Context context, Intent intent) { 23 | if (action.equals(intent.getAction()) && intent.getExtras() != null) { 24 | if (AppManager.getInstance().getActivity(SearchActivity.class) != null) { 25 | AppManager.getInstance().backActivity(SearchActivity.class); 26 | EventBus.getDefault().post(new ServerEvent(ServerEvent.SERVER_SEARCH, intent.getExtras().getString("title"))); 27 | } else { 28 | Intent newIntent = new Intent(context, SearchActivity.class); 29 | newIntent.putExtra("title", intent.getExtras().getString("title")); 30 | newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); 31 | context.startActivity(newIntent); 32 | } 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/server/DataReceiver.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.server; 2 | 3 | /** 4 | * @author pj567 5 | * @date :2021/1/5 6 | * @description: 7 | */ 8 | public interface DataReceiver { 9 | 10 | /** 11 | * @param text 12 | */ 13 | void onTextReceived(String text); 14 | 15 | 16 | void onApiReceived(String url); 17 | 18 | void onPushReceived(String url); 19 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/server/RawRequestProcess.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.server; 2 | 3 | import android.content.Context; 4 | 5 | import java.io.IOException; 6 | import java.io.InputStream; 7 | import java.util.Map; 8 | 9 | import fi.iki.elonen.NanoHTTPD; 10 | 11 | /** 12 | * @author pj567 13 | * @date :2021/1/5 14 | * @description: 资源文件加载 15 | */ 16 | public class RawRequestProcess implements RequestProcess { 17 | private Context mContext; 18 | private String fileName; 19 | private int resourceId; 20 | private String mimeType; 21 | 22 | public RawRequestProcess(Context context, String fileName, int resourceId, String mimeType) { 23 | this.mContext = context; 24 | this.fileName = fileName; 25 | this.resourceId = resourceId; 26 | this.mimeType = mimeType; 27 | } 28 | 29 | @Override 30 | public boolean isRequest(NanoHTTPD.IHTTPSession session, String fileName) { 31 | return session.getMethod() == NanoHTTPD.Method.GET && this.fileName.equalsIgnoreCase(fileName); 32 | } 33 | 34 | @Override 35 | public NanoHTTPD.Response doResponse(NanoHTTPD.IHTTPSession session, String fileName, Map params, Map files) { 36 | InputStream inputStream = mContext.getResources().openRawResource(this.resourceId); 37 | try { 38 | return RemoteServer.newFixedLengthResponse(NanoHTTPD.Response.Status.OK, mimeType + "; charset=utf-8", inputStream, (long) inputStream.available()); 39 | } catch (IOException IOExc) { 40 | return RemoteServer.createPlainTextResponse(NanoHTTPD.Response.Status.INTERNAL_ERROR, "SERVER INTERNAL ERROR: IOException: " + IOExc.getMessage()); 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/server/RequestProcess.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.server; 2 | 3 | import java.util.Map; 4 | 5 | import fi.iki.elonen.NanoHTTPD; 6 | 7 | /** 8 | * @author pj567 9 | * @date :2021/1/5 10 | * @description: 11 | */ 12 | public interface RequestProcess { 13 | public static final int KEY_ACTION_PRESSED = 0; 14 | public static final int KEY_ACTION_DOWN = 1; 15 | public static final int KEY_ACTION_UP = 2; 16 | 17 | /** 18 | * isRequest 19 | * 20 | * @param session 21 | * @param fileName 22 | * @return 23 | */ 24 | boolean isRequest(NanoHTTPD.IHTTPSession session, String fileName); 25 | 26 | /** 27 | * doResponse 28 | * 29 | * @param session 30 | * @param fileName 31 | * @param params 32 | * @param files 33 | * @return 34 | */ 35 | NanoHTTPD.Response doResponse(NanoHTTPD.IHTTPSession session, String fileName, Map params, Map files); 36 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/subtitle/SubtitleLoadSuccessResult.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.subtitle; 2 | 3 | import com.github.tvbox.osc.subtitle.model.TimedTextObject; 4 | 5 | public class SubtitleLoadSuccessResult { 6 | public String fileName; 7 | public String content; 8 | public TimedTextObject timedTextObject; 9 | public String subtitlePath; 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/subtitle/model/Region.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Class that represents the .ASS and .SSA subtitle file format 3 | * 4 | *

5 | * Copyright (c) 2012 J. David Requejo
6 | * j[dot]david[dot]requejo[at] Gmail 7 | *

8 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software 9 | * and associated documentation files (the "Software"), to deal in the Software without restriction, 10 | * including without limitation the rights to use, copy, modify, merge, publish, distribute, 11 | * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software 12 | * is furnished to do so, subject to the following conditions: 13 | *

14 | * The above copyright notice and this permission notice shall be included in all copies 15 | * or substantial portions of the Software. 16 | *

17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 18 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 19 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 20 | * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 21 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22 | * DEALINGS IN THE SOFTWARE. 23 | * 24 | * @author J. David REQUEJO 25 | * 26 | */ 27 | 28 | package com.github.tvbox.osc.subtitle.model; 29 | 30 | public class Region { 31 | 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/subtitle/model/Subtitle.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Class that represents the .ASS and .SSA subtitle file format 3 | * 4 | *

5 | * Copyright (c) 2012 J. David Requejo
6 | * j[dot]david[dot]requejo[at] Gmail 7 | *

8 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software 9 | * and associated documentation files (the "Software"), to deal in the Software without restriction, 10 | * including without limitation the rights to use, copy, modify, merge, publish, distribute, 11 | * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software 12 | * is furnished to do so, subject to the following conditions: 13 | *

14 | * The above copyright notice and this permission notice shall be included in all copies 15 | * or substantial portions of the Software. 16 | *

17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 18 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 19 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 20 | * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 21 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22 | * DEALINGS IN THE SOFTWARE. 23 | * 24 | * @author J. David REQUEJO 25 | * 26 | */ 27 | 28 | package com.github.tvbox.osc.subtitle.model; 29 | 30 | public class Subtitle { 31 | 32 | public Style style; 33 | public Region region; 34 | 35 | public Time start; 36 | public Time end; 37 | 38 | public String content=""; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/subtitle/runtime/TaskExecutor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) of Avery 3 | * 4 | * _ooOoo_ 5 | * o8888888o 6 | * 88" . "88 7 | * (| -_- |) 8 | * O\ = /O 9 | * ____/`- -'\____ 10 | * .' \\| |// `. 11 | * / \\||| : |||// \ 12 | * / _||||| -:- |||||- \ 13 | * | | \\\ - /// | | 14 | * | \_| ''\- -/'' | | 15 | * \ .-\__ `-` ___/-. / 16 | * ___`. .' /- -.- -\ `. . __ 17 | * ."" '< `.___\_<|>_/___.' >'"". 18 | * | | : `- \`.;`\ _ /`;.`/ - ` : | | 19 | * \ \ `-. \_ __\ /__ _/ .-` / / 20 | * ======`-.____`-.___\_____/___.-`____.-'====== 21 | * `=- -=' 22 | * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 23 | * Buddha bless, there will never be bug!!! 24 | */ 25 | 26 | package com.github.tvbox.osc.subtitle.runtime; 27 | 28 | /** 29 | * @author AveryZhong. 30 | */ 31 | 32 | public abstract class TaskExecutor { 33 | 34 | public abstract void executeOnDeskIO(Runnable task); 35 | 36 | public void executeOnMainThread(Runnable task) { 37 | if (isMainThread()) { 38 | task.run(); 39 | } else { 40 | postToMainThread(task); 41 | } 42 | } 43 | 44 | public abstract void postToMainThread(Runnable task); 45 | 46 | public abstract boolean isMainThread(); 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/adapter/BackupAdapter.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.adapter; 2 | 3 | import com.chad.library.adapter.base.BaseQuickAdapter; 4 | import com.chad.library.adapter.base.BaseViewHolder; 5 | import com.github.tvbox.osc.R; 6 | 7 | import java.util.ArrayList; 8 | 9 | public class BackupAdapter extends BaseQuickAdapter { 10 | public BackupAdapter() { 11 | super(R.layout.item_dialog_backup, new ArrayList<>()); 12 | } 13 | 14 | @Override 15 | protected void convert(BaseViewHolder helper, String item) { 16 | helper.setText(R.id.tvName, item); 17 | helper.addOnClickListener(R.id.tvName); 18 | helper.addOnClickListener(R.id.tvDel); 19 | } 20 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/adapter/GridFilterKVAdapter.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.adapter; 2 | 3 | import com.chad.library.adapter.base.BaseQuickAdapter; 4 | import com.chad.library.adapter.base.BaseViewHolder; 5 | import com.github.tvbox.osc.R; 6 | 7 | import java.util.ArrayList; 8 | 9 | public class GridFilterKVAdapter extends BaseQuickAdapter { 10 | public GridFilterKVAdapter() { 11 | super(R.layout.item_grid_filter_value, new ArrayList<>()); 12 | } 13 | 14 | @Override 15 | protected void convert(BaseViewHolder helper, String item) { 16 | helper.setText(R.id.filterValue, item); 17 | } 18 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/adapter/ParseAdapter.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.adapter; 2 | 3 | import android.graphics.Color; 4 | import android.view.View; 5 | import android.widget.TextView; 6 | 7 | import com.chad.library.adapter.base.BaseQuickAdapter; 8 | import com.chad.library.adapter.base.BaseViewHolder; 9 | import com.github.tvbox.osc.R; 10 | import com.github.tvbox.osc.bean.ParseBean; 11 | 12 | import java.util.ArrayList; 13 | 14 | public class ParseAdapter extends BaseQuickAdapter { 15 | public ParseAdapter() { 16 | super(R.layout.item_play_parse, new ArrayList<>()); 17 | } 18 | 19 | @Override 20 | protected void convert(BaseViewHolder helper, ParseBean item) { 21 | TextView tvParse = helper.getView(R.id.tvParse); 22 | tvParse.setVisibility(View.VISIBLE); 23 | if (item.isDefault()) { 24 | tvParse.setTextColor(mContext.getResources().getColor(R.color.color_02F8E1)); 25 | } else { 26 | tvParse.setTextColor(Color.WHITE); 27 | } 28 | tvParse.setText(item.getName()); 29 | if (helper.getLayoutPosition() == 0) { 30 | helper.itemView.setNextFocusLeftId(R.id.screen_display); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/adapter/PinyinAdapter.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.adapter; 2 | 3 | import com.chad.library.adapter.base.BaseQuickAdapter; 4 | import com.chad.library.adapter.base.BaseViewHolder; 5 | import com.github.tvbox.osc.R; 6 | 7 | import java.util.ArrayList; 8 | 9 | public class PinyinAdapter extends BaseQuickAdapter { 10 | public PinyinAdapter() { 11 | super(R.layout.item_search_word_hot, new ArrayList<>()); 12 | } 13 | 14 | @Override 15 | protected void convert(BaseViewHolder helper, String item) { 16 | helper.setText(R.id.tvSearchWord, item); 17 | } 18 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/adapter/SearchSubtitleAdapter.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.adapter; 2 | 3 | import com.chad.library.adapter.base.BaseQuickAdapter; 4 | import com.chad.library.adapter.base.BaseViewHolder; 5 | import com.github.tvbox.osc.R; 6 | import com.github.tvbox.osc.bean.Subtitle; 7 | 8 | import java.util.ArrayList; 9 | 10 | public class SearchSubtitleAdapter extends BaseQuickAdapter { 11 | 12 | public SearchSubtitleAdapter() { 13 | super(R.layout.item_search_subtitle_result, new ArrayList<>()); 14 | } 15 | 16 | @Override 17 | protected void convert(BaseViewHolder helper, Subtitle item) { 18 | helper.setText(R.id.subtitleName, item.getName()); 19 | helper.setText(R.id.subtitleNameInfo, item.getIsZip() ? "压缩包" : "文件"); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/adapter/SearchWordAdapter.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.adapter; 2 | 3 | import com.chad.library.adapter.base.BaseQuickAdapter; 4 | import com.chad.library.adapter.base.BaseViewHolder; 5 | import com.github.tvbox.osc.R; 6 | 7 | import java.util.ArrayList; 8 | 9 | /** 10 | * @author pj567 11 | * @date :2020/12/23 12 | * @description: 13 | */ 14 | public class SearchWordAdapter extends BaseQuickAdapter { 15 | public SearchWordAdapter() { 16 | super(R.layout.item_search_word_split, new ArrayList<>()); 17 | } 18 | 19 | @Override 20 | protected void convert(BaseViewHolder helper, String item) { 21 | helper.setText(R.id.tvSearchWord, item); 22 | } 23 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/adapter/SettingMenuAdapter.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.adapter; 2 | 3 | import com.chad.library.adapter.base.BaseQuickAdapter; 4 | import com.chad.library.adapter.base.BaseViewHolder; 5 | import com.github.tvbox.osc.R; 6 | 7 | import java.util.ArrayList; 8 | 9 | /** 10 | * @author pj567 11 | * @date :2020/12/23 12 | * @description: 13 | */ 14 | public class SettingMenuAdapter extends BaseQuickAdapter { 15 | public SettingMenuAdapter() { 16 | super(R.layout.item_setting_menu, new ArrayList<>()); 17 | } 18 | 19 | @Override 20 | protected void convert(BaseViewHolder helper, String item) { 21 | helper.setText(R.id.tvName, item); 22 | helper.addOnClickListener(R.id.tvName); 23 | } 24 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/adapter/SortAdapter.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.adapter; 2 | 3 | import com.chad.library.adapter.base.BaseQuickAdapter; 4 | import com.chad.library.adapter.base.BaseViewHolder; 5 | import com.github.tvbox.osc.R; 6 | import com.github.tvbox.osc.bean.MovieSort; 7 | 8 | import java.util.ArrayList; 9 | 10 | /** 11 | * @author pj567 12 | * @date :2020/12/21 13 | * @description: 14 | */ 15 | public class SortAdapter extends BaseQuickAdapter { 16 | public SortAdapter() { 17 | super(R.layout.item_home_sort, new ArrayList<>()); 18 | } 19 | 20 | @Override 21 | protected void convert(BaseViewHolder helper, MovieSort.SortData item) { 22 | helper.setText(R.id.tvTitle, item.name); 23 | } 24 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/dialog/AboutDialog.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.dialog; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.annotation.NonNull; 6 | 7 | import com.github.tvbox.osc.R; 8 | 9 | import org.jetbrains.annotations.NotNull; 10 | 11 | public class AboutDialog extends BaseDialog { 12 | 13 | public AboutDialog(@NonNull @NotNull Context context) { 14 | super(context); 15 | setContentView(R.layout.dialog_about); 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/dialog/ApiHistoryDialog.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.dialog; 2 | 3 | import android.content.Context; 4 | import android.os.Bundle; 5 | import android.widget.TextView; 6 | 7 | import androidx.annotation.NonNull; 8 | 9 | import com.github.tvbox.osc.R; 10 | import com.github.tvbox.osc.ui.adapter.ApiHistoryDialogAdapter; 11 | import com.owen.tvrecyclerview.widget.TvRecyclerView; 12 | 13 | import org.jetbrains.annotations.NotNull; 14 | 15 | import java.util.List; 16 | 17 | public class ApiHistoryDialog extends BaseDialog { 18 | public ApiHistoryDialog(@NonNull @NotNull Context context) { 19 | super(context, R.style.CustomDialogStyleDim); 20 | setContentView(R.layout.dialog_api_history); 21 | } 22 | 23 | @Override 24 | protected void onCreate(Bundle savedInstanceState) { 25 | super.onCreate(savedInstanceState); 26 | } 27 | 28 | public void setTip(String tip) { 29 | ((TextView) findViewById(R.id.title)).setText(tip); 30 | } 31 | 32 | public void setAdapter(ApiHistoryDialogAdapter.SelectDialogInterface sourceBeanSelectDialogInterface, List data, int select) { 33 | ApiHistoryDialogAdapter adapter = new ApiHistoryDialogAdapter(sourceBeanSelectDialogInterface); 34 | adapter.setData(data, select); 35 | TvRecyclerView tvRecyclerView = ((TvRecyclerView) findViewById(R.id.list)); 36 | tvRecyclerView.setAdapter(adapter); 37 | tvRecyclerView.setSelectedPosition(select); 38 | tvRecyclerView.post(new Runnable() { 39 | @Override 40 | public void run() { 41 | tvRecyclerView.scrollToPosition(select); 42 | } 43 | }); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/dialog/DescDialog.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.dialog; 2 | 3 | import android.content.Context; 4 | import android.content.DialogInterface; 5 | import android.widget.TextView; 6 | import androidx.annotation.NonNull; 7 | import com.github.tvbox.osc.R; 8 | import org.greenrobot.eventbus.EventBus; 9 | import org.jetbrains.annotations.NotNull; 10 | 11 | public class DescDialog extends BaseDialog { 12 | 13 | public DescDialog(@NonNull @NotNull Context context) { 14 | super(context); 15 | setContentView(R.layout.dialog_desc); 16 | } 17 | 18 | public void setDescribe(String describe) { 19 | TextView tvDescribe = findViewById(R.id.describe); 20 | tvDescribe.setText(describe); 21 | tvDescribe.requestFocus(); 22 | tvDescribe.requestFocusFromTouch(); 23 | } 24 | 25 | private void init(Context context) { 26 | EventBus.getDefault().register(this); 27 | setOnDismissListener(new DialogInterface.OnDismissListener() { 28 | @Override 29 | public void onDismiss(DialogInterface dialog) { 30 | EventBus.getDefault().unregister(this); 31 | } 32 | }); 33 | } 34 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/dialog/RemoteDialog.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.dialog; 2 | 3 | import android.content.Context; 4 | import android.widget.ImageView; 5 | import android.widget.TextView; 6 | 7 | import androidx.annotation.NonNull; 8 | 9 | import com.github.tvbox.osc.R; 10 | import com.github.tvbox.osc.server.ControlManager; 11 | import com.github.tvbox.osc.ui.tv.QRCodeGen; 12 | 13 | import org.jetbrains.annotations.NotNull; 14 | 15 | import me.jessyan.autosize.utils.AutoSizeUtils; 16 | 17 | public class RemoteDialog extends BaseDialog { 18 | private ImageView ivQRCode; 19 | private TextView tvAddress; 20 | 21 | public RemoteDialog(@NonNull @NotNull Context context) { 22 | super(context); 23 | setContentView(R.layout.dialog_remote); 24 | setCanceledOnTouchOutside(false); 25 | ivQRCode = findViewById(R.id.ivQRCode); 26 | tvAddress = findViewById(R.id.tvAddress); 27 | refreshQRCode(); 28 | } 29 | 30 | private void refreshQRCode() { 31 | String address = ControlManager.get().getAddress(false); 32 | tvAddress.setText(String.format("手机/电脑扫描上方二维码或者直接浏览器访问地址\n%s", address)); 33 | ivQRCode.setImageBitmap(QRCodeGen.generateBitmap(address, AutoSizeUtils.mm2px(getContext(), 240), AutoSizeUtils.mm2px(getContext(), 240))); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/tv/widget/DefaultTransformer.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.tv.widget; 2 | 3 | import android.view.View; 4 | 5 | import androidx.viewpager.widget.ViewPager; 6 | 7 | /** 8 | * @author acer 9 | * @date 2018/8/22 11:46 10 | */ 11 | public class DefaultTransformer implements ViewPager.PageTransformer{ 12 | @Override 13 | public void transformPage(View page, float position) { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/tv/widget/FixedSpeedScroller.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.tv.widget; 2 | 3 | import android.content.Context; 4 | import android.view.animation.Interpolator; 5 | import android.widget.Scroller; 6 | 7 | /** 8 | * 9 | * @author acer 10 | * @date 2018/7/24 11 | */ 12 | 13 | public class FixedSpeedScroller extends Scroller { 14 | private int mDuration = 0; 15 | 16 | public void setmDuration(int mDuration) { 17 | this.mDuration = mDuration; 18 | } 19 | 20 | public FixedSpeedScroller(Context context) { 21 | super(context); 22 | } 23 | 24 | public FixedSpeedScroller(Context context, Interpolator interpolator) { 25 | super(context, interpolator); 26 | } 27 | 28 | public FixedSpeedScroller(Context context, Interpolator interpolator, boolean flywheel) { 29 | super(context, interpolator, flywheel); 30 | } 31 | 32 | 33 | @Override 34 | public void startScroll(int startX, int startY, int dx, int dy, int duration) { 35 | super.startScroll(startX, startY, dx, dy, mDuration); 36 | } 37 | 38 | @Override 39 | public void startScroll(int startX, int startY, int dx, int dy) { 40 | super.startScroll(startX, startY, dx, dy, mDuration); 41 | } 42 | } 43 | 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/tv/widget/LoadMoreView.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.tv.widget; 2 | 3 | 4 | import com.github.tvbox.osc.R; 5 | 6 | public final class LoadMoreView extends com.chad.library.adapter.base.loadmore.LoadMoreView { 7 | 8 | @Override 9 | public int getLayoutId() { 10 | return R.layout.item_view_load_more; 11 | } 12 | 13 | @Override 14 | protected int getLoadingViewId() { 15 | return R.id.load_more_loading_view; 16 | } 17 | 18 | @Override 19 | protected int getLoadFailViewId() { 20 | return R.id.load_more_load_fail_view; 21 | } 22 | 23 | @Override 24 | protected int getLoadEndViewId() { 25 | return R.id.load_more_load_end_view; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/tv/widget/MarqueeTextView.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.tv.widget; 2 | 3 | import android.annotation.SuppressLint; 4 | import android.content.Context; 5 | import android.text.TextUtils; 6 | import android.util.AttributeSet; 7 | import android.widget.TextView; 8 | 9 | import androidx.annotation.Nullable; 10 | 11 | /** 12 | * Created by acer on 2018/7/13. 13 | */ 14 | 15 | @SuppressLint("AppCompatCustomView") 16 | public class MarqueeTextView extends TextView{ 17 | public MarqueeTextView(Context context) { 18 | this(context, null); 19 | } 20 | 21 | public MarqueeTextView(Context context, @Nullable AttributeSet attrs) { 22 | this(context, attrs, 0); 23 | } 24 | 25 | public MarqueeTextView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { 26 | super(context, attrs, defStyleAttr); 27 | setSelected(true); 28 | setSingleLine(true); 29 | setMarqueeRepeatLimit(-1); 30 | setEllipsize(TextUtils.TruncateAt.MARQUEE); 31 | } 32 | 33 | @Override 34 | public boolean isFocused() { 35 | return true; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/tv/widget/NoScrollViewPager.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.tv.widget; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.view.KeyEvent; 6 | import android.view.MotionEvent; 7 | 8 | import androidx.annotation.NonNull; 9 | import androidx.annotation.Nullable; 10 | import androidx.viewpager.widget.ViewPager; 11 | 12 | /** 13 | * @author acer 14 | * @date 2018/7/24 15 | */ 16 | 17 | public class NoScrollViewPager extends ViewPager { 18 | 19 | public NoScrollViewPager(@NonNull Context context) { 20 | this(context, null); 21 | } 22 | 23 | public NoScrollViewPager(@NonNull Context context, @Nullable AttributeSet attrs) { 24 | super(context, attrs); 25 | } 26 | 27 | /** 28 | * 禁止viewpager里面内容导致页面切换 29 | * 30 | * @param event 31 | * @return 32 | */ 33 | @Override 34 | public boolean executeKeyEvent(KeyEvent event) { 35 | return false; 36 | } 37 | 38 | @Override 39 | public boolean onTouchEvent(MotionEvent ev) { 40 | return false; 41 | } 42 | 43 | @Override 44 | public boolean onInterceptTouchEvent(MotionEvent ev) { 45 | return false; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/tv/widget/ViewObj.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.tv.widget; 2 | 3 | import android.view.View; 4 | import android.view.ViewGroup; 5 | 6 | /** 7 | * 描述 8 | * 9 | * @author pj567 10 | * @since 2020/7/28 11 | */ 12 | public class ViewObj { 13 | private final View view; 14 | private final ViewGroup.MarginLayoutParams params; 15 | 16 | public ViewObj(View view, ViewGroup.MarginLayoutParams params) { 17 | this.view = view; 18 | this.params = params; 19 | } 20 | 21 | public void setMarginLeft(int left) { 22 | params.leftMargin = left; 23 | view.setLayoutParams(params); 24 | } 25 | 26 | public void setMarginTop(int top) { 27 | params.topMargin = top; 28 | view.setLayoutParams(params); 29 | } 30 | 31 | public void setMarginRight(int right) { 32 | params.rightMargin = right; 33 | view.setLayoutParams(params); 34 | } 35 | 36 | public void setMarginBottom(int bottom) { 37 | params.bottomMargin = bottom; 38 | view.setLayoutParams(params); 39 | } 40 | 41 | public void setWidth(int width) { 42 | params.width = width; 43 | view.setLayoutParams(params); 44 | } 45 | 46 | public void setHeight(int height) { 47 | params.height = height; 48 | view.setLayoutParams(params); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/util/AdBlocker.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.util; 2 | 3 | import android.webkit.WebResourceResponse; 4 | 5 | import java.io.ByteArrayInputStream; 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | public class AdBlocker { 10 | private static final List AD_HOSTS = new ArrayList<>(); 11 | 12 | public static void clear() { 13 | AD_HOSTS.clear(); 14 | } 15 | 16 | public static boolean isEmpty() { 17 | return AD_HOSTS.isEmpty(); 18 | } 19 | 20 | public static void addAdHost(String host) { 21 | AD_HOSTS.add(host); 22 | } 23 | 24 | public static boolean hasHost(String host) { 25 | return AD_HOSTS.contains(host); 26 | } 27 | 28 | public static boolean isAd(String url) { 29 | url = url.toLowerCase(); 30 | for (String adHost : AD_HOSTS) { 31 | if (url.contains(adHost)) { 32 | return true; 33 | } 34 | } 35 | return false; 36 | } 37 | 38 | public static WebResourceResponse createEmptyResource() { 39 | return new WebResourceResponse("text/plain", "utf-8", new ByteArrayInputStream("".getBytes())); 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/util/FastClickCheckUtil.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.util; 2 | 3 | import android.os.Handler; 4 | import android.view.View; 5 | 6 | /** 7 | * @author pj567 8 | * @date :2020/12/22 9 | * @description: 10 | */ 11 | public class FastClickCheckUtil { 12 | /** 13 | * 相同视图点击必须间隔0.5s才能有效 14 | * 15 | * @param view 目标视图 16 | */ 17 | public static void check(View view) { 18 | check(view, 500); 19 | } 20 | 21 | /** 22 | * 设置间隔点击规则,配置间隔点击时长 23 | * 24 | * @param view 目标视图 25 | * @param mills 点击间隔时间(毫秒) 26 | */ 27 | public static void check(final View view, int mills) { 28 | view.setClickable(false); 29 | new Handler().postDelayed(new Runnable() { 30 | @Override 31 | public void run() { 32 | view.setClickable(true); 33 | } 34 | }, mills); 35 | } 36 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/util/LOG.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.util; 2 | 3 | import android.util.Log; 4 | 5 | /** 6 | * @author pj567 7 | * @date :2020/12/18 8 | * @description: 9 | */ 10 | public class LOG { 11 | private static String TAG = "TVBox-runtime"; 12 | 13 | public static void e(String msg) { 14 | Log.e(TAG, "" + msg); 15 | } 16 | 17 | public static void i(String msg) { 18 | Log.i(TAG, "" + msg); 19 | } 20 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/util/RegexUtils.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.util; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | import java.util.regex.Pattern; 6 | 7 | public class RegexUtils { 8 | 9 | private static final Map patternCache = new HashMap<>(); 10 | public static Pattern getPattern(String regex) { 11 | Pattern pattern = patternCache.get(regex); 12 | if (pattern == null) { 13 | pattern = Pattern.compile(regex); 14 | patternCache.put(regex, pattern); 15 | } 16 | return pattern; 17 | } 18 | 19 | public static Pattern getPattern(String regex,int flag) { 20 | Pattern pattern = patternCache.get(regex); 21 | if (pattern == null) { 22 | pattern = Pattern.compile(regex,flag); 23 | patternCache.put(regex, pattern); 24 | } 25 | return pattern; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/util/SubtitleHelper.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.util; 2 | 3 | import android.app.Activity; 4 | 5 | import com.orhanobut.hawk.Hawk; 6 | 7 | public class SubtitleHelper { 8 | 9 | public static int getSubtitleTextAutoSize(Activity activity) { 10 | double screenSqrt = ScreenUtils.getSqrt(activity); 11 | int subtitleTextSize = 16; 12 | if (screenSqrt > 7.0 && screenSqrt <= 13.0) { 13 | subtitleTextSize = 24; 14 | } else if (screenSqrt > 13.0 && screenSqrt <= 50.0) { 15 | subtitleTextSize = 36; 16 | } else if (screenSqrt > 50.0) { 17 | subtitleTextSize = 46; 18 | } 19 | return subtitleTextSize; 20 | } 21 | 22 | public static int getTextSize(Activity activity) { 23 | int autoSize = getSubtitleTextAutoSize(activity); 24 | int subtitleConfigSize = Hawk.get(HawkConfig.SUBTITLE_TEXT_SIZE, autoSize); 25 | return subtitleConfigSize; 26 | } 27 | 28 | public static void setTextSize(int size) { 29 | Hawk.put(HawkConfig.SUBTITLE_TEXT_SIZE, size); 30 | } 31 | 32 | public static int getTimeDelay() { 33 | int subtitleConfigTimeDelay = Hawk.get(HawkConfig.SUBTITLE_TIME_DELAY, 0); 34 | return subtitleConfigTimeDelay; 35 | } 36 | 37 | public static void setTimeDelay(int delay) { 38 | Hawk.put(HawkConfig.SUBTITLE_TIME_DELAY, delay); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/util/js/FunCall.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.util.js; 2 | 3 | import com.whl.quickjs.wrapper.JSCallFunction; 4 | import com.whl.quickjs.wrapper.JSFunction; 5 | import com.whl.quickjs.wrapper.JSObject; 6 | 7 | import java.util.concurrent.Callable; 8 | 9 | public class FunCall implements Callable { 10 | 11 | private final JSObject jsObject; 12 | private final Object[] args; 13 | private final String name; 14 | private Object result; 15 | 16 | public static FunCall call(JSObject jsObject, String name, Object... args) { 17 | return new FunCall(jsObject, name, args); 18 | } 19 | 20 | private FunCall(JSObject jsObject, String name, Object... args) { 21 | this.jsObject = jsObject; 22 | this.name = name; 23 | this.args = args; 24 | } 25 | 26 | @Override 27 | public Object call() throws Exception { 28 | result = jsObject.getJSFunction(name).call(args); 29 | if (!(result instanceof JSObject)) return result; 30 | JSObject promise = (JSObject) result; 31 | JSFunction then = promise.getJSFunction("then"); 32 | if (then != null) then.call(jsCallFunction); 33 | return result; 34 | } 35 | 36 | private final JSCallFunction jsCallFunction = new JSCallFunction() { 37 | @Override 38 | public Object call(Object... args) { 39 | return result = args[0]; 40 | } 41 | }; 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/util/js/local.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.util.js; 2 | 3 | import androidx.annotation.Keep; 4 | import com.orhanobut.hawk.Hawk; 5 | import com.whl.quickjs.wrapper.Function; 6 | 7 | public class local {@Keep@Function 8 | public void delete(String str, String str2) { 9 | try { 10 | Hawk.delete("jsRuntime_" + str + "_" + str2); 11 | } catch (Exception e) { 12 | e.printStackTrace(); 13 | } 14 | }@Keep@Function 15 | public String get(String str, String str2) { 16 | try { 17 | return Hawk.get("jsRuntime_" + str + "_" + str2, ""); 18 | } catch (Exception e) { 19 | Hawk.delete(str); 20 | return str2; 21 | } 22 | }@Keep@Function 23 | public void set(String str, String str2, String str3) { 24 | try { 25 | Hawk.put("jsRuntime_" + str + "_" + str2, str3); 26 | } catch (Exception e) { 27 | e.printStackTrace(); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/util/js/rsa/DataUtils.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.util.js.rsa; 2 | 3 | import android.util.Base64; 4 | 5 | import java.nio.ByteBuffer; 6 | import java.nio.charset.StandardCharsets; 7 | 8 | /** 9 | * 数据工具类 10 | */ 11 | public class DataUtils { 12 | 13 | /** 14 | * 将 Base64 字符串 解码成 字节数组 15 | */ 16 | public static byte[] base64Decode(String data) { 17 | return Base64.decode(data.getBytes(), Base64.NO_WRAP); 18 | } 19 | 20 | /** 21 | * 将 字节数组 转换成 Base64 编码 22 | */ 23 | public static String base64Encode(byte[] data) { 24 | return Base64.encodeToString(data, Base64.NO_WRAP); 25 | } 26 | 27 | /** 28 | * 将字节数组转换成 int 类型 29 | */ 30 | public static int byte2Int(byte[] bytes) { 31 | ByteBuffer buffer = ByteBuffer.wrap(bytes); 32 | return buffer.getInt(); 33 | } 34 | 35 | /** 36 | * 将 int 转换成 byte 数组 37 | */ 38 | public static byte[] int2byte(int data) { 39 | ByteBuffer buffer = ByteBuffer.allocate(4); 40 | buffer.putInt(data); 41 | return buffer.array(); 42 | } 43 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/util/urlhttp/RealResponse.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.util.urlhttp; 2 | 3 | import java.io.InputStream; 4 | 5 | /** 6 | * Created by fighting on 2017/4/24. 7 | */ 8 | 9 | public class RealResponse { 10 | public InputStream inputStream; 11 | public InputStream errorStream; 12 | public int code; 13 | public long contentLength; 14 | public Exception exception; 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/util/urlhttp/internal/BrotliSource.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.util.urlhttp.internal; 2 | 3 | import org.brotli.dec.BrotliInputStream; 4 | 5 | import java.io.IOException; 6 | 7 | import okio.BufferedSource; 8 | import okio.Okio; 9 | import okio.Source; 10 | 11 | public final class BrotliSource { 12 | public static Source create(BufferedSource source) throws IOException { 13 | BrotliInputStream brotliInputStream = new BrotliInputStream(source.inputStream()); 14 | return Okio.source(brotliInputStream); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/okhttp3/dnsoverhttps/BootstrapDns.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Square, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package okhttp3.dnsoverhttps; 17 | 18 | import java.net.InetAddress; 19 | import java.net.UnknownHostException; 20 | import java.util.List; 21 | import okhttp3.Dns; 22 | 23 | /** 24 | * Internal Bootstrap DNS implementation for handling initial connection to DNS over HTTPS server. 25 | * 26 | * Returns hardcoded results for the known host. 27 | */ 28 | final class BootstrapDns implements Dns { 29 | private final String dnsHostname; 30 | private final List dnsServers; 31 | 32 | BootstrapDns(String dnsHostname, List dnsServers) { 33 | this.dnsHostname = dnsHostname; 34 | this.dnsServers = dnsServers; 35 | } 36 | 37 | @Override public List lookup(String hostname) throws UnknownHostException { 38 | if (!this.dnsHostname.equals(hostname)) { 39 | throw new UnknownHostException( 40 | "BootstrapDns called for " + hostname + " instead of " + dnsHostname); 41 | } 42 | 43 | return dnsServers; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/q215613905/TVBoxOS/49e631437836a97cdf158544267de59855c11b6a/app/src/main/res/drawable-hdpi/app_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/q215613905/TVBoxOS/49e631437836a97cdf158544267de59855c11b6a/app/src/main/res/drawable-xhdpi/app_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/vod_pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/q215613905/TVBoxOS/49e631437836a97cdf158544267de59855c11b6a/app/src/main/res/drawable-xhdpi/vod_pause.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/vod_play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/q215613905/TVBoxOS/49e631437836a97cdf158544267de59855c11b6a/app/src/main/res/drawable-xhdpi/vod_play.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/q215613905/TVBoxOS/49e631437836a97cdf158544267de59855c11b6a/app/src/main/res/drawable-xxhdpi/app_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/q215613905/TVBoxOS/49e631437836a97cdf158544267de59855c11b6a/app/src/main/res/drawable-xxxhdpi/app_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/anim_loading.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/app_banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/q215613905/TVBoxOS/49e631437836a97cdf158544267de59855c11b6a/app/src/main/res/drawable/app_banner.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/app_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/q215613905/TVBoxOS/49e631437836a97cdf158544267de59855c11b6a/app/src/main/res/drawable/app_bg.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_channel_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_dialog_rounded.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_progress_bar_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_scrollview.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_speed_indicator.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/box_controller_top_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_detail_collect.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_detail_play.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_detail_quick_search.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_detail_sort.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_dialog_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_dialog_vod.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_home_sort_focus.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/q215613905/TVBoxOS/49e631437836a97cdf158544267de59855c11b6a/app/src/main/res/drawable/icon_back.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_clear.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_collect.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_delete.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/q215613905/TVBoxOS/49e631437836a97cdf158544267de59855c11b6a/app/src/main/res/drawable/icon_empty.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_error.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_filter.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_filter_color.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_history.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_img_placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/q215613905/TVBoxOS/49e631437836a97cdf158544267de59855c11b6a/app/src/main/res/drawable/icon_img_placeholder.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/q215613905/TVBoxOS/49e631437836a97cdf158544267de59855c11b6a/app/src/main/res/drawable/icon_loading.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_lock.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/q215613905/TVBoxOS/49e631437836a97cdf158544267de59855c11b6a/app/src/main/res/drawable/icon_play.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_pre.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/q215613905/TVBoxOS/49e631437836a97cdf158544267de59855c11b6a/app/src/main/res/drawable/icon_pre.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_push.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_search.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_unlock.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/q215613905/TVBoxOS/49e631437836a97cdf158544267de59855c11b6a/app/src/main/res/drawable/icon_video.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img_loading_placeholder.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/input_dialog_api_input.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/input_search.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/item_bg_selector_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 9 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/item_bg_selector_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 9 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/item_right_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/preview_player_block.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/scrollview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/q215613905/TVBoxOS/49e631437836a97cdf158544267de59855c11b6a/app/src/main/res/drawable/scrollview.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/scrollviewleft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/q215613905/TVBoxOS/49e631437836a97cdf158544267de59855c11b6a/app/src/main/res/drawable/scrollviewleft.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/seekbar_style.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/seekbar_thumb_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 7 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/seekbar_thumb_pressed.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 7 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_dialog_bg_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_dialog_filter_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_dialog_pg_search_checkbox.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_live_channel_num.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_live_focus.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_live_select.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_play_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_play_mobile_center.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_player_control_vod_seek.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_player_control_vod_seek_thumb.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_player_control_vod_seek_thumb_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_player_control_vod_seek_thumb_press.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_setting_model_focus.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_setting_sort_focus.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_source_flag_focus.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_source_flag_line.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_source_focus.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_source_series_focus.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_thumb_bottom_name.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_thumb_lang.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_thumb_note.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_thumb_year.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_user_delete.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_user_focus.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_user_search.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/transparent.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | 12 | 16 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_setting.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 17 | 18 | 23 | 24 | 25 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_about.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_desc.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 17 | 18 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_grid_filter.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_remote.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 14 | 15 | 20 | 21 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_xwalk.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 13 | 14 | 26 | 27 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_grid.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_dialog_api_history.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 26 | 27 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_dialog_backup.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 26 | 27 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_dialog_checkbox_search.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 14 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_dialog_select.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_grid_filter.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 23 | 24 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_grid_filter_value.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_home_sort.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 22 | 23 | 32 | 33 | 42 | 43 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_keyboard.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_live.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 24 | 25 | 38 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_live_channel.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 24 | 25 | 36 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_live_channel_group.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_live_setting.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_live_setting_group.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_play_parse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_quick_search_lite.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_search_lite.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_search_word_hot.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_search_word_split.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_series.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_series_flag.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 25 | 26 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_series_group.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_setting_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_keyborad.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/loadsir_empty_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 12 | 13 | 17 | 18 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/layout/loadsir_loading_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/raw/ui.css: -------------------------------------------------------------------------------- 1 | body, 2 | html { 3 | height: 100%; 4 | -webkit-tap-highlight-color: transparent; 5 | } 6 | body { 7 | font-family: system-ui, -apple-system, Helvetica Neue, sans-serif; 8 | } 9 | .page, 10 | body { 11 | background-color: var(--weui-BG-0); 12 | } 13 | .page { 14 | position: absolute; 15 | top: 0; 16 | right: 0; 17 | bottom: 0; 18 | left: 0; 19 | overflow-y: auto; 20 | -webkit-overflow-scrolling: touch; 21 | box-sizing: border-box; 22 | z-index: 1; 23 | } -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | TVBox 4 | 00:00 | 00:00 5 | [ 1024 x 768 ] 6 | http:// 7 | 00:00:00 8 | 0Kb/s 9 | 更 多 10 | 00:00 11 | -------------------------------------------------------------------------------- /app/src/main/res/xml/file_paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 9 | 12 | 13 | 14 | 17 | 18 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/xml/network_security_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/normal/java/com/github/catvod/crawler/pyLoader.java: -------------------------------------------------------------------------------- 1 | package com.github.catvod.crawler; 2 | 3 | import android.util.Log; 4 | import com.github.catvod.crawler.python.IPyLoader; 5 | 6 | import java.util.Map; 7 | 8 | public class pyLoader implements IPyLoader { 9 | 10 | @Override 11 | public void clear() { 12 | Log.i("PyLoader", "normal flavor: clear() 调用,但不支持 Python 功能。"); 13 | } 14 | 15 | @Override 16 | public void setConfig(String jsonStr) { 17 | Log.i("PyLoader", "normal flavor: setConfig() 调用,但不支持 Python 功能。"); 18 | } 19 | 20 | @Override 21 | public void setRecentPyKey(String pyApi) { 22 | Log.i("PyLoader", "normal flavor: setRecentPyKey() 调用,但不支持 Python 功能。"); 23 | } 24 | 25 | @Override 26 | public Spider getSpider(String key, String cls, String ext) { 27 | Log.i("PyLoader", "normal flavor: getSpider() 调用,但不支持 Python 功能。"); 28 | return new SpiderNull(); 29 | } 30 | 31 | @Override 32 | public Object[] proxyInvoke(Map params) { 33 | Log.i("PyLoader", "normal flavor: proxyInvoke(params) 调用,但不支持 Python 功能。"); 34 | return null; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/src/python/java/com/undcover/freedom/pyramid/PyToast.java: -------------------------------------------------------------------------------- 1 | package com.undcover.freedom.pyramid; 2 | 3 | import android.content.Context; 4 | import android.widget.Toast; 5 | 6 | 7 | /** 8 | * Created by UndCover on 16/9/7. 9 | */ 10 | public class PyToast { 11 | private static Toast innerToast; 12 | private static Context mContext; 13 | private static PyToast sInstance; 14 | 15 | 16 | public static void init(Context context) { 17 | mContext = context; 18 | } 19 | 20 | /** 21 | * 在Application中 用于初始化 22 | * 23 | * @return 24 | */ 25 | public static PyToast getInstance() { 26 | if (sInstance == null) { 27 | synchronized (PyToast.class) { 28 | if (sInstance == null) { 29 | sInstance = new PyToast(); 30 | } 31 | } 32 | } 33 | return sInstance; 34 | } 35 | 36 | public static void showCancelableToast(String msg) { 37 | showCancelableToast(msg, Toast.LENGTH_SHORT); 38 | } 39 | 40 | /** 41 | * 快速显示Toast,无需排队等待 42 | * 43 | * @param msg 44 | * @param duration 45 | */ 46 | public static void showCancelableToast(String msg, int duration) { 47 | if (innerToast != null) { 48 | innerToast.cancel(); 49 | } 50 | 51 | innerToast = Toast.makeText(mContext, msg, duration); 52 | innerToast.show(); 53 | } 54 | 55 | public static void showMessage(String msg, int duration) { 56 | Toast.makeText(mContext, msg, duration).show(); 57 | } 58 | } -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | buildscript { 3 | repositories { 4 | gradlePluginPortal() 5 | google() 6 | mavenCentral() 7 | maven { url "https://jitpack.io" } 8 | maven { url "https://maven.aliyun.com/repository/releases" } 9 | maven { url "https://maven.aliyun.com/repository/public" } 10 | maven { url "https://storage.googleapis.com/r8-releases/raw" } 11 | maven { url "https://chaquo.com/maven" } 12 | } 13 | dependencies { 14 | classpath 'com.android.tools.build:gradle:7.2.2' 15 | 16 | // NOTE: Do not place your application dependencies here; they belong 17 | // in the individual module build.gradle files 18 | classpath "com.chaquo.python:gradle:12.0.1" 19 | } 20 | } 21 | 22 | allprojects { 23 | repositories { 24 | google() 25 | mavenCentral() 26 | maven { url "https://jitpack.io" } 27 | maven { url "https://maven.aliyun.com/repository/releases" } 28 | maven { url "https://maven.aliyun.com/repository/public" } 29 | gradlePluginPortal() 30 | } 31 | } 32 | 33 | task clean(type: Delete) { 34 | delete rootProject.buildDir 35 | } -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | # When configured, Gradle will run in incubating parallel mode. 10 | # This option should only be used with decoupled projects. More details, visit 11 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 12 | # org.gradle.parallel=true 13 | # AndroidX package structure to make it clearer which packages are bundled with the 14 | # Android operating system, and which are packaged with your app"s APK 15 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 16 | android.useAndroidX=true 17 | # Automatically convert third-party libraries to use AndroidX 18 | android.enableJetifier=true 19 | IsDebug=true 20 | #build on off 21 | org.gradle.jvmargs=-Xmx2048m --add-opens java.base/java.io=ALL-UNNAMED -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/q215613905/TVBoxOS/49e631437836a97cdf158544267de59855c11b6a/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Sep 21 09:53:05 CST 2021 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /player/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /player/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.library' 3 | } 4 | 5 | android { 6 | compileSdkVersion 33 7 | 8 | defaultConfig { 9 | minSdkVersion 16 10 | targetSdkVersion 28 11 | } 12 | 13 | buildTypes { 14 | all { 15 | ndk { 16 | abiFilters 'armeabi-v7a' 17 | } 18 | } 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 22 | } 23 | 24 | releaseSimon.initWith(release) 25 | releaseSimon { 26 | } 27 | } 28 | compileOptions { 29 | sourceCompatibility JavaVersion.VERSION_1_8 30 | targetCompatibility JavaVersion.VERSION_1_8 31 | } 32 | } 33 | 34 | dependencies { 35 | implementation "androidx.annotation:annotation:1.3.0" 36 | api "com.google.android.exoplayer:exoplayer-core:2.14.2" 37 | api "com.google.android.exoplayer:exoplayer-ui:2.14.2" 38 | api "com.google.android.exoplayer:exoplayer-dash:2.14.2" 39 | api "com.google.android.exoplayer:exoplayer-hls:2.14.2" 40 | api "com.google.android.exoplayer:exoplayer-rtsp:2.14.2" 41 | api "com.google.android.exoplayer:extension-rtmp:2.14.2" 42 | api "com.google.android.exoplayer:extension-okhttp:2.14.2" 43 | api 'xyz.doikki.android.dkplayer:dkplayer-ui:3.3.5' 44 | } -------------------------------------------------------------------------------- /player/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /player/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /player/src/main/java/tv/danmaku/ijk/media/player/ISurfaceTextureHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Bilibili 3 | * Copyright (C) 2015 Zhang Rui 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package tv.danmaku.ijk.media.player; 19 | 20 | import android.graphics.SurfaceTexture; 21 | 22 | public interface ISurfaceTextureHolder { 23 | void setSurfaceTexture(SurfaceTexture surfaceTexture); 24 | 25 | SurfaceTexture getSurfaceTexture(); 26 | 27 | void setSurfaceTextureHost(ISurfaceTextureHost surfaceTextureHost); 28 | } 29 | -------------------------------------------------------------------------------- /player/src/main/java/tv/danmaku/ijk/media/player/ISurfaceTextureHost.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Bilibili 3 | * Copyright (C) 2015 Zhang Rui 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package tv.danmaku.ijk.media.player; 19 | 20 | import android.graphics.SurfaceTexture; 21 | 22 | public interface ISurfaceTextureHost { 23 | void releaseSurfaceTexture(SurfaceTexture surfaceTexture); 24 | } 25 | -------------------------------------------------------------------------------- /player/src/main/java/tv/danmaku/ijk/media/player/IjkLibLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013-2014 Bilibili 3 | * Copyright (C) 2013-2014 Zhang Rui 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package tv.danmaku.ijk.media.player; 19 | 20 | public interface IjkLibLoader { 21 | void loadLibrary(String libName) throws UnsatisfiedLinkError, 22 | SecurityException; 23 | } 24 | -------------------------------------------------------------------------------- /player/src/main/java/tv/danmaku/ijk/media/player/MediaInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013-2014 Bilibili 3 | * Copyright (C) 2013-2014 Zhang Rui 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package tv.danmaku.ijk.media.player; 19 | 20 | public class MediaInfo { 21 | public String mMediaPlayerName; 22 | 23 | public String mVideoDecoder; 24 | public String mVideoDecoderImpl; 25 | 26 | public String mAudioDecoder; 27 | public String mAudioDecoderImpl; 28 | 29 | public IjkMediaMeta mMeta; 30 | } 31 | -------------------------------------------------------------------------------- /player/src/main/java/tv/danmaku/ijk/media/player/annotations/AccessedByNative.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013-2014 Bilibili 3 | * Copyright (C) 2013-2014 Zhang Rui 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package tv.danmaku.ijk.media.player.annotations; 19 | 20 | import java.lang.annotation.ElementType; 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.RetentionPolicy; 23 | import java.lang.annotation.Target; 24 | 25 | /** 26 | * is used by the JNI generator to create the necessary JNI 27 | * bindings and expose this method to native code. 28 | */ 29 | @Target(ElementType.FIELD) 30 | @Retention(RetentionPolicy.CLASS) 31 | public @interface AccessedByNative { 32 | } -------------------------------------------------------------------------------- /player/src/main/java/tv/danmaku/ijk/media/player/annotations/CalledByNative.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013-2014 Bilibili 3 | * Copyright (C) 2013-2014 Zhang Rui 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package tv.danmaku.ijk.media.player.annotations; 19 | 20 | import java.lang.annotation.ElementType; 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.RetentionPolicy; 23 | import java.lang.annotation.Target; 24 | 25 | /** 26 | * is used by the JNI generator to create the necessary JNI 27 | * bindings and expose this method to native code. 28 | */ 29 | @Target(ElementType.METHOD) 30 | @Retention(RetentionPolicy.CLASS) 31 | public @interface CalledByNative { 32 | /* 33 | * If present, tells which inner class the method belongs to. 34 | */ 35 | String value() default ""; 36 | } -------------------------------------------------------------------------------- /player/src/main/java/tv/danmaku/ijk/media/player/exceptions/IjkMediaException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013-2014 Bilibili 3 | * Copyright (C) 2013-2014 Zhang Rui 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package tv.danmaku.ijk.media.player.exceptions; 19 | 20 | public class IjkMediaException extends Exception { 21 | private static final long serialVersionUID = 7234796519009099506L; 22 | } 23 | -------------------------------------------------------------------------------- /player/src/main/java/tv/danmaku/ijk/media/player/ffmpeg/FFmpegApi.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.ijk.media.player.ffmpeg; 2 | 3 | public class FFmpegApi { 4 | public static native String av_base64_encode(byte in[]); 5 | } 6 | -------------------------------------------------------------------------------- /player/src/main/java/tv/danmaku/ijk/media/player/misc/IAndroidIO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Bilibili 3 | * Copyright (C) 2016 Raymond Zheng 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package tv.danmaku.ijk.media.player.misc; 19 | 20 | import java.io.IOException; 21 | 22 | @SuppressWarnings("RedundantThrows") 23 | public interface IAndroidIO { 24 | int open(String url) throws IOException; 25 | int read(byte[] buffer, int size) throws IOException; 26 | long seek(long offset, int whence) throws IOException; 27 | int close() throws IOException; 28 | } 29 | -------------------------------------------------------------------------------- /player/src/main/java/tv/danmaku/ijk/media/player/misc/IMediaDataSource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Bilibili 3 | * Copyright (C) 2015 Zhang Rui 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package tv.danmaku.ijk.media.player.misc; 19 | 20 | import java.io.IOException; 21 | 22 | @SuppressWarnings("RedundantThrows") 23 | public interface IMediaDataSource { 24 | int readAt(long position, byte[] buffer, int offset, int size) throws IOException; 25 | 26 | long getSize() throws IOException; 27 | 28 | void close() throws IOException; 29 | } 30 | -------------------------------------------------------------------------------- /player/src/main/java/tv/danmaku/ijk/media/player/misc/IMediaFormat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Bilibili 3 | * Copyright (C) 2015 Zhang Rui 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package tv.danmaku.ijk.media.player.misc; 19 | 20 | public interface IMediaFormat { 21 | // Common keys 22 | String KEY_MIME = "mime"; 23 | 24 | // Video Keys 25 | String KEY_WIDTH = "width"; 26 | String KEY_HEIGHT = "height"; 27 | 28 | String getString(String name); 29 | 30 | int getInteger(String name); 31 | } 32 | -------------------------------------------------------------------------------- /player/src/main/java/tv/danmaku/ijk/media/player/misc/ITrackInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Bilibili 3 | * Copyright (C) 2015 Zhang Rui 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package tv.danmaku.ijk.media.player.misc; 19 | 20 | public interface ITrackInfo { 21 | int MEDIA_TRACK_TYPE_AUDIO = 2; 22 | int MEDIA_TRACK_TYPE_METADATA = 5; 23 | int MEDIA_TRACK_TYPE_SUBTITLE = 4; 24 | int MEDIA_TRACK_TYPE_TIMEDTEXT = 3; 25 | int MEDIA_TRACK_TYPE_UNKNOWN = 0; 26 | int MEDIA_TRACK_TYPE_VIDEO = 1; 27 | 28 | IMediaFormat getFormat(); 29 | 30 | String getLanguage(); 31 | 32 | int getTrackType(); 33 | 34 | String getInfoInline(); 35 | } 36 | -------------------------------------------------------------------------------- /player/src/main/java/tv/danmaku/ijk/media/player/pragma/Pragma.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Bilibili 3 | * Copyright (C) 2013 Zhang Rui 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package tv.danmaku.ijk.media.player.pragma; 18 | 19 | /*- 20 | * configurated by app project 21 | */ 22 | public class Pragma { 23 | public static final boolean ENABLE_VERBOSE = true; 24 | } 25 | -------------------------------------------------------------------------------- /player/src/main/java/tv/danmaku/ijk/media/player_armv7a/Pragma.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Bilibili 3 | * Copyright (C) 2015 Zhang Rui 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package tv.danmaku.ijk.media.player_armv7a; 19 | 20 | public class Pragma { 21 | 22 | } 23 | -------------------------------------------------------------------------------- /player/src/main/java/xyz/doikki/videoplayer/controller/IGestureComponent.java: -------------------------------------------------------------------------------- 1 | package xyz.doikki.videoplayer.controller; 2 | 3 | public interface IGestureComponent extends IControlComponent { 4 | /** 5 | * 开始滑动 6 | */ 7 | void onStartSlide(); 8 | 9 | /** 10 | * 结束滑动 11 | */ 12 | void onStopSlide(); 13 | 14 | /** 15 | * 滑动调整进度 16 | * @param slidePosition 滑动进度 17 | * @param currentPosition 当前播放进度 18 | * @param duration 视频总长度 19 | */ 20 | void onPositionChange(int slidePosition, int currentPosition, int duration); 21 | 22 | /** 23 | * 滑动调整亮度 24 | * @param percent 亮度百分比 25 | */ 26 | void onBrightnessChange(int percent); 27 | 28 | /** 29 | * 滑动调整音量 30 | * @param percent 音量百分比 31 | */ 32 | void onVolumeChange(int percent); 33 | } 34 | -------------------------------------------------------------------------------- /player/src/main/java/xyz/doikki/videoplayer/controller/IVideoController.java: -------------------------------------------------------------------------------- 1 | package xyz.doikki.videoplayer.controller; 2 | 3 | public interface IVideoController { 4 | 5 | /** 6 | * 开始控制视图自动隐藏倒计时 7 | */ 8 | void startFadeOut(); 9 | 10 | /** 11 | * 取消控制视图自动隐藏倒计时 12 | */ 13 | void stopFadeOut(); 14 | 15 | /** 16 | * 控制视图是否处于显示状态 17 | */ 18 | boolean isShowing(); 19 | 20 | /** 21 | * 设置锁定状态 22 | * @param locked 是否锁定 23 | */ 24 | void setLocked(boolean locked); 25 | 26 | /** 27 | * 是否处于锁定状态 28 | */ 29 | boolean isLocked(); 30 | 31 | /** 32 | * 开始刷新进度 33 | */ 34 | void startProgress(); 35 | 36 | /** 37 | * 停止刷新进度 38 | */ 39 | void stopProgress(); 40 | 41 | /** 42 | * 显示控制视图 43 | */ 44 | void hide(); 45 | 46 | /** 47 | * 隐藏控制视图 48 | */ 49 | void show(); 50 | 51 | /** 52 | * 是否需要适配刘海 53 | */ 54 | boolean hasCutout(); 55 | 56 | /** 57 | * 获取刘海的高度 58 | */ 59 | int getCutoutHeight(); 60 | } 61 | -------------------------------------------------------------------------------- /player/src/main/java/xyz/doikki/videoplayer/controller/MediaPlayerControl.java: -------------------------------------------------------------------------------- 1 | package xyz.doikki.videoplayer.controller; 2 | 3 | import android.graphics.Bitmap; 4 | 5 | public interface MediaPlayerControl { 6 | 7 | void start(); 8 | 9 | void pause(); 10 | 11 | long getDuration(); 12 | 13 | long getCurrentPosition(); 14 | 15 | void seekTo(long pos); 16 | 17 | boolean isPlaying(); 18 | 19 | int getBufferedPercentage(); 20 | 21 | void startFullScreen(); 22 | 23 | void stopFullScreen(); 24 | 25 | boolean isFullScreen(); 26 | 27 | void setMute(boolean isMute); 28 | 29 | boolean isMute(); 30 | 31 | void setScreenScaleType(int screenScaleType); 32 | 33 | void setSpeed(float speed); 34 | 35 | float getSpeed(); 36 | 37 | long getTcpSpeed(); 38 | 39 | void replay(boolean resetPosition); 40 | 41 | void setMirrorRotation(boolean enable); 42 | 43 | Bitmap doScreenShot(); 44 | 45 | int[] getVideoSize(); 46 | 47 | void setRotation(float rotation); 48 | 49 | void startTinyScreen(); 50 | 51 | void stopTinyScreen(); 52 | 53 | boolean isTinyScreen(); 54 | } -------------------------------------------------------------------------------- /player/src/main/java/xyz/doikki/videoplayer/controller/OrientationHelper.java: -------------------------------------------------------------------------------- 1 | package xyz.doikki.videoplayer.controller; 2 | 3 | import android.content.Context; 4 | import android.view.OrientationEventListener; 5 | 6 | /** 7 | * 设备方向监听 8 | */ 9 | public class OrientationHelper extends OrientationEventListener { 10 | 11 | private long mLastTime; 12 | 13 | private OnOrientationChangeListener mOnOrientationChangeListener; 14 | 15 | public OrientationHelper(Context context) { 16 | super(context); 17 | } 18 | 19 | @Override 20 | public void onOrientationChanged(int orientation) { 21 | long currentTime = System.currentTimeMillis(); 22 | if (currentTime - mLastTime < 300) return;//300毫秒检测一次 23 | if (mOnOrientationChangeListener != null) { 24 | mOnOrientationChangeListener.onOrientationChanged(orientation); 25 | } 26 | mLastTime = currentTime; 27 | } 28 | 29 | 30 | public interface OnOrientationChangeListener { 31 | void onOrientationChanged(int orientation); 32 | } 33 | 34 | public void setOnOrientationChangeListener(OnOrientationChangeListener onOrientationChangeListener) { 35 | mOnOrientationChangeListener = onOrientationChangeListener; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /player/src/main/java/xyz/doikki/videoplayer/exo/ExoMediaPlayerFactory.java: -------------------------------------------------------------------------------- 1 | package xyz.doikki.videoplayer.exo; 2 | 3 | import android.content.Context; 4 | 5 | import xyz.doikki.videoplayer.player.PlayerFactory; 6 | 7 | public class ExoMediaPlayerFactory extends PlayerFactory { 8 | 9 | public static ExoMediaPlayerFactory create() { 10 | return new ExoMediaPlayerFactory(); 11 | } 12 | 13 | @Override 14 | public ExoMediaPlayer createPlayer(Context context) { 15 | return new ExoMediaPlayer(context); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /player/src/main/java/xyz/doikki/videoplayer/ijk/IjkPlayerFactory.java: -------------------------------------------------------------------------------- 1 | package xyz.doikki.videoplayer.ijk; 2 | 3 | import android.content.Context; 4 | 5 | import xyz.doikki.videoplayer.player.PlayerFactory; 6 | 7 | public class IjkPlayerFactory extends PlayerFactory { 8 | 9 | public static IjkPlayerFactory create() { 10 | return new IjkPlayerFactory(); 11 | } 12 | 13 | @Override 14 | public IjkPlayer createPlayer(Context context) { 15 | return new IjkPlayer(context); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /player/src/main/java/xyz/doikki/videoplayer/player/AndroidMediaPlayerFactory.java: -------------------------------------------------------------------------------- 1 | package xyz.doikki.videoplayer.player; 2 | 3 | import android.content.Context; 4 | 5 | /** 6 | * 创建{@link AndroidMediaPlayer}的工厂类,不推荐,系统的MediaPlayer兼容性较差,建议使用IjkPlayer或者ExoPlayer 7 | */ 8 | public class AndroidMediaPlayerFactory extends PlayerFactory { 9 | 10 | public static AndroidMediaPlayerFactory create() { 11 | return new AndroidMediaPlayerFactory(); 12 | } 13 | 14 | @Override 15 | public AndroidMediaPlayer createPlayer(Context context) { 16 | return new AndroidMediaPlayer(context); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /player/src/main/java/xyz/doikki/videoplayer/player/PlayerFactory.java: -------------------------------------------------------------------------------- 1 | package xyz.doikki.videoplayer.player; 2 | 3 | import android.content.Context; 4 | 5 | /** 6 | * 此接口使用方法: 7 | * 1.继承{@link AbstractPlayer}扩展自己的播放器。 8 | * 2.继承此接口并实现{@link #createPlayer(Context)},返回步骤1中的播放器。 9 | * 可参照{@link AndroidMediaPlayer}和{@link AndroidMediaPlayerFactory}的实现。 10 | */ 11 | public abstract class PlayerFactory

{ 12 | 13 | public abstract P createPlayer(Context context); 14 | } 15 | -------------------------------------------------------------------------------- /player/src/main/java/xyz/doikki/videoplayer/player/ProgressManager.java: -------------------------------------------------------------------------------- 1 | package xyz.doikki.videoplayer.player; 2 | 3 | /** 4 | * 播放进度管理器,继承此接口实现自己的进度管理器。 5 | */ 6 | public abstract class ProgressManager { 7 | 8 | /** 9 | * 此方法用于实现保存进度的逻辑 10 | * @param url 播放地址 11 | * @param progress 播放进度 12 | */ 13 | public abstract void saveProgress(String url, long progress); 14 | 15 | /** 16 | * 此方法用于实现获取保存的进度的逻辑 17 | * @param url 播放地址 18 | * @return 保存的播放进度 19 | */ 20 | public abstract long getSavedProgress(String url); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /player/src/main/java/xyz/doikki/videoplayer/render/IRenderView.java: -------------------------------------------------------------------------------- 1 | package xyz.doikki.videoplayer.render; 2 | 3 | import android.graphics.Bitmap; 4 | import android.view.View; 5 | 6 | import androidx.annotation.NonNull; 7 | 8 | import xyz.doikki.videoplayer.player.AbstractPlayer; 9 | 10 | public interface IRenderView { 11 | 12 | /** 13 | * 关联AbstractPlayer 14 | */ 15 | void attachToPlayer(@NonNull AbstractPlayer player); 16 | 17 | /** 18 | * 设置视频宽高 19 | * @param videoWidth 宽 20 | * @param videoHeight 高 21 | */ 22 | void setVideoSize(int videoWidth, int videoHeight); 23 | 24 | /** 25 | * 设置视频旋转角度 26 | * @param degree 角度值 27 | */ 28 | void setVideoRotation(int degree); 29 | 30 | /** 31 | * 设置screen scale type 32 | * @param scaleType 类型 33 | */ 34 | void setScaleType(int scaleType); 35 | 36 | /** 37 | * 获取真实的RenderView 38 | */ 39 | View getView(); 40 | 41 | /** 42 | * 截图 43 | */ 44 | Bitmap doScreenShot(); 45 | 46 | /** 47 | * 释放资源 48 | */ 49 | void release(); 50 | 51 | } -------------------------------------------------------------------------------- /player/src/main/java/xyz/doikki/videoplayer/render/RenderViewFactory.java: -------------------------------------------------------------------------------- 1 | package xyz.doikki.videoplayer.render; 2 | 3 | import android.content.Context; 4 | 5 | /** 6 | * 此接口用于扩展自己的渲染View。使用方法如下: 7 | * 1.继承IRenderView实现自己的渲染View。 8 | * 2.重写createRenderView返回步骤1的渲染View。 9 | * 可参考{@link TextureRenderView}和{@link TextureRenderViewFactory}的实现。 10 | */ 11 | public abstract class RenderViewFactory { 12 | 13 | public abstract IRenderView createRenderView(Context context); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /player/src/main/java/xyz/doikki/videoplayer/render/TextureRenderViewFactory.java: -------------------------------------------------------------------------------- 1 | package xyz.doikki.videoplayer.render; 2 | 3 | import android.content.Context; 4 | 5 | public class TextureRenderViewFactory extends RenderViewFactory { 6 | 7 | public static TextureRenderViewFactory create() { 8 | return new TextureRenderViewFactory(); 9 | } 10 | 11 | @Override 12 | public IRenderView createRenderView(Context context) { 13 | return new TextureRenderView(context); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /player/src/main/java/xyz/doikki/videoplayer/util/L.java: -------------------------------------------------------------------------------- 1 | package xyz.doikki.videoplayer.util; 2 | 3 | import android.util.Log; 4 | 5 | import xyz.doikki.videoplayer.player.VideoViewManager; 6 | 7 | /** 8 | * 日志类 9 | * Created by Doikki on 2017/6/5. 10 | */ 11 | 12 | public final class L { 13 | 14 | private L() { 15 | } 16 | 17 | private static final String TAG = "DKPlayer"; 18 | 19 | private static boolean isDebug = VideoViewManager.getConfig().mIsEnableLog; 20 | 21 | 22 | public static void d(String msg) { 23 | if (isDebug) { 24 | Log.d(TAG, msg); 25 | } 26 | } 27 | 28 | public static void e(String msg) { 29 | if (isDebug) { 30 | Log.e(TAG, msg); 31 | } 32 | } 33 | 34 | public static void i(String msg) { 35 | if (isDebug) { 36 | Log.i(TAG, msg); 37 | } 38 | } 39 | 40 | public static void w(String msg) { 41 | if (isDebug) { 42 | Log.w(TAG, msg); 43 | } 44 | } 45 | 46 | public static void setDebug(boolean isDebug) { 47 | L.isDebug = isDebug; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /player/src/main/jniLibs/armeabi-v7a/libijkffmpeg.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/q215613905/TVBoxOS/49e631437836a97cdf158544267de59855c11b6a/player/src/main/jniLibs/armeabi-v7a/libijkffmpeg.so -------------------------------------------------------------------------------- /player/src/main/jniLibs/armeabi-v7a/libijksdl.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/q215613905/TVBoxOS/49e631437836a97cdf158544267de59855c11b6a/player/src/main/jniLibs/armeabi-v7a/libijksdl.so -------------------------------------------------------------------------------- /player/src/main/jniLibs/armeabi-v7a/libp2p.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/q215613905/TVBoxOS/49e631437836a97cdf158544267de59855c11b6a/player/src/main/jniLibs/armeabi-v7a/libp2p.so -------------------------------------------------------------------------------- /player/src/main/jniLibs/armeabi-v7a/libplayer.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/q215613905/TVBoxOS/49e631437836a97cdf158544267de59855c11b6a/player/src/main/jniLibs/armeabi-v7a/libplayer.so -------------------------------------------------------------------------------- /player/src/main/jniLibs/armeabi-v7a/libxl_stat.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/q215613905/TVBoxOS/49e631437836a97cdf158544267de59855c11b6a/player/src/main/jniLibs/armeabi-v7a/libxl_stat.so -------------------------------------------------------------------------------- /player/src/main/jniLibs/armeabi-v7a/libxl_thunder_sdk.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/q215613905/TVBoxOS/49e631437836a97cdf158544267de59855c11b6a/player/src/main/jniLibs/armeabi-v7a/libxl_thunder_sdk.so -------------------------------------------------------------------------------- /player/src/main/res/layout/ijk_demo_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 |