├── .github └── workflows │ └── android.yml ├── .gitignore ├── README.md ├── agentweb-core ├── .gitignore ├── build.gradle ├── providedLibs │ └── alipaySdk-20180601.jar └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── just │ │ └── agentweb │ │ ├── AbsAgentWebSettings.java │ │ ├── AbsAgentWebUIController.java │ │ ├── Action.java │ │ ├── ActionActivity.java │ │ ├── AgentWeb.java │ │ ├── AgentWebConfig.java │ │ ├── AgentWebFileProvider.java │ │ ├── AgentWebJsInterfaceCompat.java │ │ ├── AgentWebPermissions.java │ │ ├── AgentWebSettingsImpl.java │ │ ├── AgentWebUIControllerImplBase.java │ │ ├── AgentWebUtils.java │ │ ├── AgentWebView.java │ │ ├── BaseIndicatorSpec.java │ │ ├── BaseIndicatorView.java │ │ ├── BaseJsAccessEntrace.java │ │ ├── DefaultChromeClient.java │ │ ├── DefaultDesignUIController.java │ │ ├── DefaultDownloadImpl.java │ │ ├── DefaultUIController.java │ │ ├── DefaultWebClient.java │ │ ├── DefaultWebCreator.java │ │ ├── DefaultWebLifeCycleImpl.java │ │ ├── EventHandlerImpl.java │ │ ├── EventInterceptor.java │ │ ├── HookManager.java │ │ ├── HttpHeaders.java │ │ ├── IAgentWebSettings.java │ │ ├── IEventHandler.java │ │ ├── IUrlLoader.java │ │ ├── IVideo.java │ │ ├── IWebIndicator.java │ │ ├── IWebLayout.java │ │ ├── IndicatorController.java │ │ ├── IndicatorHandler.java │ │ ├── JsAccessEntrace.java │ │ ├── JsAccessEntraceImpl.java │ │ ├── JsBaseInterfaceHolder.java │ │ ├── JsCallJava.java │ │ ├── JsCallback.java │ │ ├── JsInterfaceHolder.java │ │ ├── JsInterfaceHolderImpl.java │ │ ├── JsInterfaceObjectException.java │ │ ├── LayoutParamsOffer.java │ │ ├── LogUtils.java │ │ ├── LollipopFixedWebView.java │ │ ├── MiddlewareWebChromeBase.java │ │ ├── MiddlewareWebClientBase.java │ │ ├── NestedScrollAgentWebView.java │ │ ├── PermissionInterceptor.java │ │ ├── ProcessUtils.java │ │ ├── Provider.java │ │ ├── QuickCallJs.java │ │ ├── UrlCommonException.java │ │ ├── UrlLoaderImpl.java │ │ ├── VideoImpl.java │ │ ├── WebChromeClient.java │ │ ├── WebChromeClientDelegate.java │ │ ├── WebCreator.java │ │ ├── WebIndicator.java │ │ ├── WebLifeCycle.java │ │ ├── WebListenerManager.java │ │ ├── WebParentLayout.java │ │ ├── WebSecurityCheckLogic.java │ │ ├── WebSecurityController.java │ │ ├── WebSecurityControllerImpl.java │ │ ├── WebSecurityLogicImpl.java │ │ ├── WebViewClient.java │ │ └── WebViewClientDelegate.java │ └── res │ ├── layout │ └── agentweb_error_page.xml │ ├── values-zh │ └── strings.xml │ └── values │ ├── colors.xml │ ├── ids.xml │ ├── strings.xml │ └── style.xml ├── app ├── .gitignore ├── build.gradle ├── libs │ └── okgo-3.0.4.jar ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── me │ │ └── wizos │ │ └── loread │ │ └── ApplicationTest.java │ └── main │ ├── AndroidManifest.xml │ ├── assets │ ├── css │ │ ├── android_studio.css │ │ ├── article_theme_day.css │ │ ├── article_theme_night.css │ │ └── normalize.css │ ├── fonts │ │ └── roboto_light.ttf │ ├── iconfont.ttf │ ├── image │ │ ├── gif_player.png │ │ └── image_holder.png │ └── js │ │ ├── highlight.pack.js │ │ ├── lazyload.js │ │ ├── media.js │ │ ├── placeholder.min.js │ │ └── zepto.min.js │ ├── java │ └── me │ │ └── wizos │ │ └── loread │ │ ├── App.java │ │ ├── Contract.java │ │ ├── activity │ │ ├── ArticleActivity.java │ │ ├── BaseActivity.java │ │ ├── FeedActivity.java │ │ ├── LabActivity.java │ │ ├── MainActivity.java │ │ ├── MusicActivity.java │ │ ├── ProviderActivity.java │ │ ├── RuleGenerateActivity.java │ │ ├── SearchActivity.java │ │ ├── SettingActivity.java │ │ ├── SplashActivity.java │ │ ├── TTSActivity.java │ │ ├── WebActivity.java │ │ └── login │ │ │ ├── LoginFormState.java │ │ │ ├── LoginInoReaderActivity.java │ │ │ ├── LoginResult.java │ │ │ └── LoginTinyRSSActivity.java │ │ ├── adapter │ │ ├── ArticlePagedListAdapter.java │ │ ├── ArticleViewBinder.java │ │ └── ExpandedAdapter.java │ │ ├── bean │ │ ├── Enclosure.java │ │ ├── LogLevel.java │ │ ├── Token.java │ │ ├── UserAgent.java │ │ ├── domain │ │ │ ├── OutFeed.java │ │ │ └── OutTag.java │ │ ├── feedly │ │ │ ├── CategoryItem.java │ │ │ ├── Collection.java │ │ │ ├── ContentDirection.java │ │ │ ├── Counts.java │ │ │ ├── Entry.java │ │ │ ├── FeedItem.java │ │ │ ├── Origin.java │ │ │ ├── Profile.java │ │ │ ├── StreamContents.java │ │ │ ├── StreamIds.java │ │ │ ├── Subscription.java │ │ │ ├── Unreadcount.java │ │ │ ├── Visual.java │ │ │ └── input │ │ │ │ ├── EditCollection.java │ │ │ │ ├── EditFeed.java │ │ │ │ └── MarkerAction.java │ │ ├── fever │ │ │ ├── BaseResponse.java │ │ │ ├── Feed.java │ │ │ ├── Feeds.java │ │ │ ├── Group.java │ │ │ ├── GroupFeeds.java │ │ │ ├── Groups.java │ │ │ ├── Item.java │ │ │ ├── Items.java │ │ │ ├── SavedItemIds.java │ │ │ └── UnreadItemIds.java │ │ ├── inoreader │ │ │ ├── EditTag.java │ │ │ ├── GsItemContents.java │ │ │ ├── GsTag.java │ │ │ ├── GsTags.java │ │ │ ├── GsUnreadCount.java │ │ │ ├── ItemIds.java │ │ │ ├── ItemRefs.java │ │ │ ├── LoginResult.java │ │ │ ├── Readability.java │ │ │ ├── StreamContents.java │ │ │ ├── StreamPref.java │ │ │ ├── StreamPrefs.java │ │ │ ├── SubCategories.java │ │ │ ├── Subscription.java │ │ │ ├── Subscriptions.java │ │ │ ├── UnreadCounts.java │ │ │ ├── UserInfo.java │ │ │ └── itemContents │ │ │ │ ├── Item.java │ │ │ │ ├── Origin.java │ │ │ │ ├── Self.java │ │ │ │ └── Summary.java │ │ ├── loread │ │ │ ├── LoginParam.java │ │ │ ├── RequestJsonBody.java │ │ │ └── Response.java │ │ ├── proxynode │ │ │ ├── AnonymityLevel.java │ │ │ ├── ProxyNode.java │ │ │ └── ProxyType.java │ │ ├── search │ │ │ ├── QuickAdd.java │ │ │ ├── SearchFeedItem.java │ │ │ ├── SearchFeeds.java │ │ │ └── StreamFeed.java │ │ └── ttrss │ │ │ ├── request │ │ │ ├── GetArticles.java │ │ │ ├── GetCategories.java │ │ │ ├── GetFeeds.java │ │ │ ├── GetHeadlines.java │ │ │ ├── GetSavedItemIds.java │ │ │ ├── GetUnreadItemIds.java │ │ │ ├── LoginParam.java │ │ │ ├── RequestParam.java │ │ │ ├── SearchHeadlines.java │ │ │ ├── SearchMode.java │ │ │ ├── SubscribeToFeed.java │ │ │ ├── UnsubscribeFeed.java │ │ │ └── UpdateArticle.java │ │ │ └── result │ │ │ ├── ArticleItem.java │ │ │ ├── Attachment.java │ │ │ ├── CategoryItem.java │ │ │ ├── FeedItem.java │ │ │ ├── SubscribeToFeedResult.java │ │ │ ├── TTRSSLoginResult.java │ │ │ ├── TinyResponse.java │ │ │ └── UpdateArticleResult.java │ │ ├── behavior │ │ ├── BottomNavigationBehavior.java │ │ └── BottomNavigationViewBehavior.java │ │ ├── bridge │ │ ├── ArticleBridge.java │ │ └── WebBridge.java │ │ ├── config │ │ ├── AdBlock.java │ │ ├── ArticleActionConfig.java │ │ ├── ArticleExtractConfig.java │ │ ├── ArticleTags.java │ │ ├── HostConfig.java │ │ ├── LinkRewriteConfig.java │ │ ├── NetworkRefererConfig.java │ │ ├── NetworkUserAgentConfig.java │ │ ├── SaveDirectory.java │ │ ├── TestConfig.java │ │ ├── Unsubscribe.java │ │ ├── article_action_rule │ │ │ ├── ArticleActionRule.java │ │ │ └── Condition.java │ │ └── article_extract_rule │ │ │ ├── ArticleExtractRule.java │ │ │ └── Selector.java │ │ ├── db │ │ ├── Article.java │ │ ├── ArticleDao.java │ │ ├── ArticleTag.java │ │ ├── ArticleTagDao.java │ │ ├── Category.java │ │ ├── CategoryDao.java │ │ ├── CategoryView.java │ │ ├── Collection.java │ │ ├── CoreDB.java │ │ ├── CorePref.java │ │ ├── Entry.java │ │ ├── Feed.java │ │ ├── FeedCategory.java │ │ ├── FeedCategoryDao.java │ │ ├── FeedDao.java │ │ ├── FeedView.java │ │ ├── Tag.java │ │ ├── TagDao.java │ │ ├── User.java │ │ └── UserDao.java │ │ ├── extractor │ │ ├── Extractor.java │ │ ├── ExtractorUtil.java │ │ └── ModPage.java │ │ ├── gson │ │ ├── GsonEnum.java │ │ ├── GsonEnumTypeAdapter.java │ │ └── GsonUtil.java │ │ ├── network │ │ ├── HttpClientManager.java │ │ ├── StringConverterFactory.java │ │ ├── SyncWorker.java │ │ ├── api │ │ │ ├── AuthApi.java │ │ │ ├── BaseApi.java │ │ │ ├── FeedlyApi.java │ │ │ ├── FeedlyService.java │ │ │ ├── FeverApi.java │ │ │ ├── FeverService.java │ │ │ ├── InoReaderApi.java │ │ │ ├── InoReaderService.java │ │ │ ├── LoginInterface.java │ │ │ ├── LoreadApi.java │ │ │ ├── LoreadService.java │ │ │ ├── OAuthApi.java │ │ │ ├── TinyRSSApi.java │ │ │ └── TinyRSSService.java │ │ ├── callback │ │ │ └── CallbackX.java │ │ ├── glide │ │ │ └── OkHttpAppGlideModule.java │ │ └── interceptor │ │ │ ├── InoreaderHeaderInterceptor.java │ │ │ ├── LoggerInterceptor.java │ │ │ ├── LoreadTokenInterceptor.java │ │ │ ├── RedirectInterceptor.java │ │ │ ├── RefererInterceptor.java │ │ │ ├── RelyInterceptor.java │ │ │ ├── TTRSSTokenInterceptor.java │ │ │ ├── TokenAuthenticator.java │ │ │ └── TokenInterceptor.java │ │ ├── service │ │ ├── AudioService.java │ │ ├── MainService.java │ │ ├── MusicService.java │ │ └── NetworkStateReceiver.java │ │ ├── utils │ │ ├── ArticleUtil.java │ │ ├── ColorModifier.java │ │ ├── DataUtil.java │ │ ├── EncryptUtil.java │ │ ├── FileUtil.java │ │ ├── ImageUtil.java │ │ ├── ImgFileType.java │ │ ├── NetworkUtil.java │ │ ├── RGB.java │ │ ├── ScreenUtil.java │ │ ├── ScriptUtil.java │ │ ├── SnackbarUtil.java │ │ ├── StringJoiner.java │ │ ├── StringUtils.java │ │ ├── SymbolUtil.java │ │ ├── TimeUtil.java │ │ ├── Tool.java │ │ ├── UriUtil.java │ │ └── VideoInjectUtil.java │ │ ├── view │ │ ├── ExpandableListViewS.java │ │ ├── FriendlyCardView.java │ │ ├── IconFontView.java │ │ ├── SwipeRefreshLayoutS.java │ │ ├── WebViewS.java │ │ ├── colorful │ │ │ ├── Colorful.java │ │ │ ├── StatusBarUtil.java │ │ │ ├── StatusBarView.java │ │ │ └── setter │ │ │ │ ├── TextColorSetter.java │ │ │ │ ├── ViewBackgroundColorSetter.java │ │ │ │ ├── ViewBackgroundDrawableSetter.java │ │ │ │ ├── ViewGroupSetter.java │ │ │ │ └── ViewSetter.java │ │ ├── fastscroll │ │ │ ├── FastScrollDelegate.java │ │ │ ├── FastScrollListView.java │ │ │ ├── FastScrollRecyclerView.java │ │ │ └── ListViewS.java │ │ ├── slideback │ │ │ ├── SlideBack.java │ │ │ ├── SlideBackManager.java │ │ │ ├── SlideLayout.java │ │ │ ├── callback │ │ │ │ ├── SlideBackCallBack.java │ │ │ │ └── SlideCallBack.java │ │ │ └── widget │ │ │ │ ├── SlideBackIconView.java │ │ │ │ └── SlideBackInterceptLayout.java │ │ └── webview │ │ │ ├── DownloadListenerS.java │ │ │ ├── FastScrollWebView.java │ │ │ ├── LongClickPopWindow.java │ │ │ ├── NestedScrollWebView.java │ │ │ ├── SlowlyProgressBar.java │ │ │ └── VideoImpl.java │ │ └── viewmodel │ │ ├── ArticleViewModel.java │ │ ├── InoReaderUserViewModel.java │ │ └── TinyRSSUserViewModel.java │ └── res │ ├── anim │ ├── fade_in.xml │ ├── fade_out.xml │ ├── in_from_bottom.xml │ └── out_from_bottom.xml │ ├── drawable-v23 │ ├── logo_feedly_icon.xml │ ├── logo_inoreader_icon.xml │ └── logo_ttrss_icon.xml │ ├── drawable │ ├── corners_bg_checked.xml │ ├── corners_bg_uncheck.xml │ ├── custom_progress_bar_thumb.xml │ ├── custom_thumb_src.xml │ ├── flyme_style_switch_button_rectangle.xml │ ├── flyme_style_switch_button_round.xml │ ├── ic_arrow_auto_mark_readed.xml │ ├── ic_arrow_right.xml │ ├── ic_browser.xml │ ├── ic_close.xml │ ├── ic_copy_link.xml │ ├── ic_eye.xml │ ├── ic_favor.xml │ ├── ic_favor_fill.xml │ ├── ic_mark_down.xml │ ├── ic_mark_unread.xml │ ├── ic_mark_up.xml │ ├── ic_music.xml │ ├── ic_panorama.xml │ ├── ic_read.xml │ ├── ic_refresh.xml │ ├── ic_rename.xml │ ├── ic_share.xml │ ├── ic_state_all.xml │ ├── ic_state_star.xml │ ├── ic_state_unread.xml │ ├── ic_state_unstar.xml │ ├── ic_stop_loading.xml │ ├── ic_unsubscribe.xml │ ├── ic_user_agent.xml │ ├── ic_volume.xml │ ├── logo.png │ ├── logo_feedly.xml │ ├── logo_inoreader.xml │ ├── logo_tinytinyrss.png │ ├── progress_bg.xml │ ├── seekbar_audio.xml │ ├── selector_corners_bg.xml │ ├── selector_star.xml │ ├── splash_layers.xml │ ├── textview_border_day.xml │ └── textview_border_night.xml │ ├── layout │ ├── activity_article.xml │ ├── activity_feed.xml │ ├── activity_lab.xml │ ├── activity_login_inoreader.xml │ ├── activity_login_tiny_rss.xml │ ├── activity_main.xml │ ├── activity_main_list_item.xml │ ├── activity_music.xml │ ├── activity_provider.xml │ ├── activity_provider_low_version.xml │ ├── activity_rule_generate.xml │ ├── activity_search.xml │ ├── activity_search_list_header_result_count.xml │ ├── activity_search_list_header_word.xml │ ├── activity_search_list_item_feed.xml │ ├── activity_setting.xml │ ├── activity_tts.xml │ ├── activity_web.xml │ ├── bottom_sheet_category.xml │ ├── config_download_view.xml │ ├── main_bottom_sheet_more.xml │ ├── main_item_header.xml │ ├── md_simplelist_item.xml │ ├── setting_item_arrow.xml │ ├── setting_item_session.xml │ ├── setting_item_switch.xml │ ├── tag_expandable_item_child.xml │ ├── tag_expandable_item_group.xml │ └── webview_long_clicked_popwindow.xml │ ├── menu │ ├── menu_article.xml │ └── menu_web.xml │ ├── mipmap-hdpi │ └── ic_launcher.png │ ├── mipmap-mdpi │ └── ic_launcher.png │ ├── mipmap-xhdpi │ └── ic_launcher.png │ ├── mipmap-xxhdpi │ └── ic_launcher.png │ ├── mipmap-xxxhdpi │ └── ic_launcher.png │ ├── values-zh-rCN │ └── strings.xml │ ├── values │ ├── arrays.xml │ ├── attr.xml │ ├── attrs.xml │ ├── colors.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml │ └── xml │ ├── account_authenticator.xml │ ├── account_preferences.xml │ ├── account_sync_adapter.xml │ └── network_security_config.xml ├── build.gradle ├── config.json ├── doc └── overview.png ├── floatwindow ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── yhao │ │ └── floatwindow │ │ ├── adaptation │ │ ├── Miui.java │ │ └── Rom.java │ │ ├── base │ │ └── FloatLifecycle.java │ │ ├── constant │ │ ├── MoveType.java │ │ └── Screen.java │ │ ├── interfaces │ │ ├── FloatView.java │ │ ├── IFloatWindow.java │ │ ├── LifecycleListener.java │ │ ├── PermissionListener.java │ │ ├── ResumedListener.java │ │ └── ViewStateListener.java │ │ ├── permission │ │ └── FloatActivity.java │ │ ├── util │ │ ├── ActivityCounter.java │ │ ├── DensityUtil.java │ │ ├── LogUtil.java │ │ └── PermissionUtil.java │ │ └── view │ │ ├── FloatPhone.java │ │ ├── FloatToast.java │ │ ├── FloatWindow.java │ │ └── IFloatWindowImpl.java │ └── res │ └── values │ └── style.xml ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── luban ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── top │ │ └── zibin │ │ └── luban │ │ └── ApplicationTest.java │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── top │ │ └── zibin │ │ └── luban │ │ ├── Checker.java │ │ ├── CompressionPredicate.java │ │ ├── Engine.java │ │ ├── FileProvider.java │ │ ├── InputStreamProvider.java │ │ ├── Luban.java │ │ ├── OnCompressListener.java │ │ └── OnRenameListener.java │ └── res │ └── values │ └── strings.xml ├── privacy_and_security.md ├── settings.gradle ├── support ├── .gitignore ├── build.gradle ├── proguard-rules.txt └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── yanzhenjie │ │ └── recyclerview │ │ ├── AdapterWrapper.java │ │ ├── Controller.java │ │ ├── ExpandableAdapter.java │ │ ├── Horizontal.java │ │ ├── LeftHorizontal.java │ │ ├── OnItemClickListener.java │ │ ├── OnItemLongClickListener.java │ │ ├── OnItemMenuClickListener.java │ │ ├── OnItemSwipeListener.java │ │ ├── RightHorizontal.java │ │ ├── StickyCreator.java │ │ ├── StickyHeaderLayout.java │ │ ├── StickyViewHolder.java │ │ ├── SwipeDragLayout.java │ │ ├── SwipeMenu.java │ │ ├── SwipeMenuBridge.java │ │ ├── SwipeMenuCreator.java │ │ ├── SwipeMenuItem.java │ │ ├── SwipeMenuLayout.java │ │ ├── SwipeMenuView.java │ │ ├── SwipeRecyclerView.java │ │ ├── listview │ │ ├── FastScrollDelegate.java │ │ └── FastScrollRecyclerView.java │ │ ├── touch │ │ ├── DefaultItemTouchHelper.java │ │ ├── ItemTouchHelperCallback.java │ │ ├── OnItemMoveListener.java │ │ ├── OnItemMovementListener.java │ │ └── OnItemStateChangedListener.java │ │ └── widget │ │ ├── BorderItemDecoration.java │ │ ├── ColorDrawer.java │ │ ├── DefaultItemDecoration.java │ │ ├── DefaultLoadMoreView.java │ │ ├── Drawer.java │ │ └── StickyNestedScrollView.java │ └── res │ ├── layout │ ├── support_recycler_view_item.xml │ ├── support_recycler_view_item2.xml │ └── support_recycler_view_load_more.xml │ ├── values-zh-rHK │ └── strings.xml │ ├── values-zh-rTW │ └── strings.xml │ ├── values-zh │ └── strings.xml │ └── values │ ├── attrs.xml │ ├── colors.xml │ └── strings.xml └── swipelayout ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src └── main ├── AndroidManifest.xml ├── java └── com │ └── ditclear │ └── swipelayout │ └── SwipeDragLayout.java └── res └── values ├── attrs.xml └── strings.xml /.github/workflows/android.yml: -------------------------------------------------------------------------------- 1 | name: Loread CI 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v2 16 | - name: set up JDK 1.8 17 | uses: actions/setup-java@v1 18 | with: 19 | java-version: 1.8 20 | - name: Make Gradle executable 21 | run: chmod +x ./gradlew 22 | - name: Build with Gradle 23 | run: ./gradlew build 24 | 25 | - name: Release apk 26 | uses: ncipollo/release-action@v1.5.0 27 | with: 28 | artifacts: "build/app/outputs/apk/release/*.apk" 29 | token: ${{ secrets.GITHUB_RElEASE_TOKEN }} 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | .DS_Store 5 | /build 6 | /.idea 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 序 2 | 3 | > 路很长,纵然远望,却不知方向。 4 | 5 | > 抽支烟,思绪无常,奔跑着彷徨。 6 | 7 | > 逃不脱的苟且,到不了的远方… 8 | 9 | 10 | # 简介 11 | 12 | RSS 第三方客户端,支持 Inoreader、Feedly、TinyTinyRSS。 13 | 14 | 下载地址:[http://www.coolapk.com/apk/168423](http://www.coolapk.com/apk/168423) 15 | 16 | 17 | # 截图 18 | 19 | ![截图](doc/overview.png) 20 | 21 | 如上图,从左至右依次为“登录、首页、文章页、分类、快速设置、设置” 22 | 23 | 24 | # 功能 25 | 目前实现以下几个功能: 26 | 27 | - [x] 黑夜主题 28 | - [x] 获取全文:支持根据规则或智能识别全文 29 | - [x] 保存近期文章的阅读进度 30 | - [x] 左右切换文章 31 | - [x] 自动清理过期文章 32 | - [x] 不同状态下(未读/加星/全部),各分组内文章的数量 33 | - [x] ~~保存 离线状态下的一些网络请求(文章状态处理,图片下载),待有网再同步~~ 34 | 35 | 对文章列表项的手势操作: 36 | 37 | - [x] 左滑是切换文章的“已读/未读”状态 38 | - [x] 右滑是切换文章的“加星/取消加星”状态 39 | - [x] 长按是“上面的文章标记为已读,下面的文章标记为已读” 40 | 41 | PS: 42 | 43 | * 由于开发中本人也还在不断学习,难免有些历史遗留的错误代码以及注释,暂时未被清理,但不影响使用 44 | 45 | 46 | # 后期规划 47 | ### Bug 48 | - [x] 优化反色算法,解决灰反色问题 49 | - [ ] 优化音频莫名暂停问题 50 | - [ ] 优化 ROOM 库带来的问题 51 | 52 | ### 功能 53 | - [x] 支持全文搜索 54 | - [ ] 优化朗读、播放音乐的界面 55 | - [ ] 支持本地 RSS 56 | - [ ] 支持获取不支持 RSS 站点的文章 57 | - [ ] 支持更换主题 58 | - [ ] 支持设置排版:字体、字号、字距、行距、背景色 59 | - [ ] 支持长按视频,图片,iframe候展示菜单 60 | - [ ] 本地训练机器学习模型,判断文章喜好 61 | - [ ] 检查添加的订阅地址是否有相似的订阅 62 | 63 | ### 技术 64 | - [ ] 优化代码结构,拆成不同模块 65 | - [ ] 改用最新的技术,例如 Kotlin 66 | - [ ] 使用 CI 自动构建 APK 包 67 | 68 | 69 | # 库的使用 70 | 71 | * OkHttp, Gson, ROOM, Glide 等等 72 | -------------------------------------------------------------------------------- /agentweb-core/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /src/androidTest/ 3 | /src/test/ 4 | -------------------------------------------------------------------------------- /agentweb-core/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 29 5 | buildToolsVersion '29.0.3' 6 | 7 | defaultConfig { 8 | minSdkVersion 22 9 | targetSdkVersion 29 10 | versionCode 1 11 | versionName "1.0" 12 | 13 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 14 | 15 | } 16 | buildTypes { 17 | release { 18 | minifyEnabled false 19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 20 | } 21 | } 22 | lintOptions{ 23 | abortOnError false 24 | } 25 | repositories { 26 | flatDir { 27 | dirs 'libs', 'providedLibs' 28 | } 29 | } 30 | // defaultPublishConfig "debug" 31 | 32 | } 33 | dependencies { 34 | implementation fileTree(include: ['*.jar'], dir: 'libs') 35 | androidTestImplementation('androidx.test.espresso:espresso-core:3.2.0', { 36 | exclude group: 'com.android.support', module: 'support-annotations' 37 | }) 38 | testImplementation 'junit:junit:4.13' 39 | implementation 'com.download.library:Downloader:4.1.2' 40 | implementation 'com.google.android.material:material:1.1.0' 41 | implementation 'androidx.legacy:legacy-support-v4:1.0.0' 42 | implementation fileTree(include: ['*.jar'], dir: 'providedLibs') 43 | } 44 | 45 | -------------------------------------------------------------------------------- /agentweb-core/providedLibs/alipaySdk-20180601.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wizos/loread/bec024a07bee7bc4a7ac36970fd2e0aa253b4236/agentweb-core/providedLibs/alipaySdk-20180601.jar -------------------------------------------------------------------------------- /agentweb-core/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 11 | 14 | 15 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /agentweb-core/src/main/java/com/just/agentweb/AgentWebFileProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Justson(https://github.com/Justson/AgentWeb) 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 | 17 | package com.just.agentweb; 18 | 19 | import android.content.Context; 20 | import android.content.pm.ProviderInfo; 21 | 22 | import androidx.annotation.NonNull; 23 | import androidx.core.content.FileProvider; 24 | 25 | /** 26 | * @since 2.0.0 27 | * @author cenxiaozhong 28 | */ 29 | public class AgentWebFileProvider extends FileProvider { 30 | 31 | @Override 32 | public void attachInfo(@NonNull Context context, @NonNull ProviderInfo info) { 33 | super.attachInfo(context, info); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /agentweb-core/src/main/java/com/just/agentweb/BaseIndicatorSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Justson(https://github.com/Justson/AgentWeb) 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 | 17 | package com.just.agentweb; 18 | 19 | 20 | 21 | /** 22 | * @author cenxiaozhong 23 | * @since 1.0.0 24 | */ 25 | public interface BaseIndicatorSpec { 26 | 27 | void show(); 28 | 29 | void hide(); 30 | 31 | void reset(); 32 | 33 | void setProgress(int newProgress); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /agentweb-core/src/main/java/com/just/agentweb/EventInterceptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Justson(https://github.com/Justson/AgentWeb) 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 | 17 | package com.just.agentweb; 18 | 19 | /** 20 | * @author cenxiaozhong 21 | * @date 2017/6/3 22 | * @since 1.0.0 23 | */ 24 | public interface EventInterceptor { 25 | boolean event(); 26 | } 27 | -------------------------------------------------------------------------------- /agentweb-core/src/main/java/com/just/agentweb/HookManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Justson(https://github.com/Justson/AgentWeb) 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 | 17 | package com.just.agentweb; 18 | 19 | 20 | /** 21 | * @author cenxiaozhong 22 | * @since 1.0.0 23 | */ 24 | public class HookManager { 25 | 26 | public static AgentWeb hookAgentWeb(AgentWeb agentWeb, AgentWeb.AgentBuilder agentBuilder) { 27 | return agentWeb; 28 | } 29 | 30 | public static boolean permissionHook(String url,String[]permissions){ 31 | return true; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /agentweb-core/src/main/java/com/just/agentweb/IAgentWebSettings.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Justson(https://github.com/Justson/AgentWeb) 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 | 17 | package com.just.agentweb; 18 | 19 | import android.webkit.WebView; 20 | 21 | /** 22 | * @author cenxiaozhong 23 | * @since 1.0.0 24 | */ 25 | 26 | public interface IAgentWebSettings { 27 | 28 | IAgentWebSettings toSetting(WebView webView); 29 | 30 | T getWebSettings(); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /agentweb-core/src/main/java/com/just/agentweb/IEventHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Justson(https://github.com/Justson/AgentWeb) 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 | 17 | package com.just.agentweb; 18 | 19 | import android.view.KeyEvent; 20 | 21 | /** 22 | * @author cenxiaozhong 23 | * @since 1.0.0 24 | */ 25 | public interface IEventHandler { 26 | 27 | boolean onKeyDown(int keyCode, KeyEvent event); 28 | 29 | boolean back(); 30 | } 31 | -------------------------------------------------------------------------------- /agentweb-core/src/main/java/com/just/agentweb/IUrlLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Justson(https://github.com/Justson/AgentWeb) 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 | 17 | package com.just.agentweb; 18 | 19 | import java.util.Map; 20 | 21 | /** 22 | * @author cenxiaozhong 23 | * @date 2017/6/3 24 | * @update 4.0.0 25 | * @since 2.0.0 26 | */ 27 | public interface IUrlLoader { 28 | 29 | 30 | void loadUrl(String url); 31 | 32 | void loadUrl(String url, Map headers); 33 | 34 | void reload(); 35 | 36 | void loadData(String data, String mimeType, String encoding); 37 | 38 | void stopLoading(); 39 | 40 | void loadDataWithBaseURL(String baseUrl, String data, 41 | String mimeType, String encoding, String historyUrl); 42 | 43 | void postUrl(String url, byte[] params); 44 | 45 | HttpHeaders getHttpHeaders(); 46 | } 47 | -------------------------------------------------------------------------------- /agentweb-core/src/main/java/com/just/agentweb/IVideo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Justson(https://github.com/Justson/AgentWeb) 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 | 17 | package com.just.agentweb; 18 | 19 | import android.view.View; 20 | import android.webkit.WebChromeClient; 21 | 22 | 23 | /** 24 | * @author cenxiaozhong 25 | * @date 2017/6/10 26 | * @since 2.0.0 27 | */ 28 | public interface IVideo { 29 | 30 | 31 | void onShowCustomView(View view, WebChromeClient.CustomViewCallback callback); 32 | 33 | 34 | void onHideCustomView(); 35 | 36 | 37 | boolean isVideoState(); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /agentweb-core/src/main/java/com/just/agentweb/IWebIndicator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Justson(https://github.com/Justson/AgentWeb) 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 | 17 | package com.just.agentweb; 18 | 19 | /** 20 | * @author cenxiaozhong 21 | * @since 1.0.0 22 | */ 23 | 24 | 25 | public interface IWebIndicator { 26 | 27 | 28 | T offer(); 29 | } 30 | -------------------------------------------------------------------------------- /agentweb-core/src/main/java/com/just/agentweb/IWebLayout.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Justson(https://github.com/Justson/AgentWeb) 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 | 17 | package com.just.agentweb; 18 | 19 | import android.view.ViewGroup; 20 | import android.webkit.WebView; 21 | 22 | import androidx.annotation.NonNull; 23 | import androidx.annotation.Nullable; 24 | 25 | /** 26 | * Created by cenxiaozhong on 2017/7/1. 27 | */ 28 | /** 29 | * @author cenxiaozhong 30 | * @date 2017/7/1 31 | * @update 4.0.0 32 | * @since 1.0.0 33 | */ 34 | public interface IWebLayout { 35 | 36 | /** 37 | * 38 | * @return WebView 的父控件 39 | */ 40 | @NonNull 41 | V getLayout(); 42 | 43 | /** 44 | * 45 | * @return 返回 WebView 或 WebView 的子View ,返回null AgentWeb 内部会创建适当 WebView 46 | */ 47 | @Nullable 48 | T getWebView(); 49 | } 50 | -------------------------------------------------------------------------------- /agentweb-core/src/main/java/com/just/agentweb/IndicatorController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Justson(https://github.com/Justson/AgentWeb) 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 | 17 | package com.just.agentweb; 18 | 19 | import android.webkit.WebView; 20 | /** 21 | * @author cenxiaozhong 22 | * @update 4.0.0 23 | * @since 1.0.0 24 | */ 25 | 26 | public interface IndicatorController { 27 | 28 | void progress(WebView v, int newProgress); 29 | 30 | BaseIndicatorSpec offerIndicator(); 31 | 32 | void showIndicator(); 33 | 34 | void setProgress(int newProgress); 35 | 36 | void finish(); 37 | } 38 | -------------------------------------------------------------------------------- /agentweb-core/src/main/java/com/just/agentweb/JsAccessEntrace.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Justson(https://github.com/Justson/AgentWeb) 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 | 17 | package com.just.agentweb; 18 | 19 | import android.webkit.ValueCallback; 20 | 21 | /** 22 | * @author cenxiaozhong 23 | * @date 2017/5/14 24 | * @since 1.0.0 25 | */ 26 | public interface JsAccessEntrace extends QuickCallJs { 27 | 28 | 29 | void callJs(String js, ValueCallback callback); 30 | 31 | void callJs(String js); 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /agentweb-core/src/main/java/com/just/agentweb/JsInterfaceHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Justson(https://github.com/Justson/AgentWeb) 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 | 17 | package com.just.agentweb; 18 | 19 | import java.util.Map; 20 | 21 | /** 22 | * @author cenxiaozhong 23 | * @date 2017/5/13 24 | * @since 1.0.0 25 | */ 26 | public interface JsInterfaceHolder { 27 | 28 | JsInterfaceHolder addJavaObjects(Map maps); 29 | 30 | JsInterfaceHolder addJavaObject(String k, Object v); 31 | 32 | boolean checkObject(Object v); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /agentweb-core/src/main/java/com/just/agentweb/JsInterfaceObjectException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Justson(https://github.com/Justson/AgentWeb) 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 | 17 | package com.just.agentweb; 18 | 19 | 20 | /** 21 | * @author cenxiaozhong 22 | * @date 2017/5/13 23 | * @since 1.0.0 24 | */ 25 | public class JsInterfaceObjectException extends RuntimeException { 26 | JsInterfaceObjectException(String msg){ 27 | super(msg); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /agentweb-core/src/main/java/com/just/agentweb/LayoutParamsOffer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Justson(https://github.com/Justson/AgentWeb) 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 | 17 | package com.just.agentweb; 18 | 19 | import android.widget.FrameLayout; 20 | 21 | /** 22 | * @author cenxiaozhong 23 | * @date 2017/5/12 24 | * @since 1.0.0 25 | */ 26 | public interface LayoutParamsOffer { 27 | 28 | T offerLayoutParams(); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /agentweb-core/src/main/java/com/just/agentweb/PermissionInterceptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Justson(https://github.com/Justson/AgentWeb) 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 | 17 | package com.just.agentweb; 18 | 19 | /** 20 | * @author cenxiaozhong 21 | * @since 3.0.0 22 | */ 23 | public interface PermissionInterceptor { 24 | boolean intercept(String url, String[] permissions, String action); 25 | } 26 | -------------------------------------------------------------------------------- /agentweb-core/src/main/java/com/just/agentweb/Provider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Justson(https://github.com/Justson/AgentWeb) 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 | 17 | package com.just.agentweb; 18 | 19 | /** 20 | * @author cenxiaozhong 21 | * @date 2017/7/5 22 | * @since 1.0.0 23 | */ 24 | public interface Provider { 25 | T provide(); 26 | } 27 | -------------------------------------------------------------------------------- /agentweb-core/src/main/java/com/just/agentweb/QuickCallJs.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Justson(https://github.com/Justson/AgentWeb) 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 | 17 | package com.just.agentweb; 18 | 19 | import android.os.Build; 20 | import android.webkit.ValueCallback; 21 | 22 | import androidx.annotation.RequiresApi; 23 | 24 | 25 | /** 26 | * @author cenxiaozhong 27 | * @date 2017/5/29 28 | * @since 1.0.0 29 | */ 30 | public interface QuickCallJs { 31 | @RequiresApi(Build.VERSION_CODES.KITKAT) 32 | void quickCallJs(String method, ValueCallback callback, String... params); 33 | 34 | void quickCallJs(String method, String... params); 35 | 36 | void quickCallJs(String method); 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /agentweb-core/src/main/java/com/just/agentweb/UrlCommonException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Justson(https://github.com/Justson/AgentWeb) 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 | 17 | package com.just.agentweb; 18 | /** 19 | * @author cenxiaozhong 20 | * @since 1.0.0 21 | */ 22 | public class UrlCommonException extends RuntimeException { 23 | 24 | public UrlCommonException() { 25 | } 26 | 27 | public UrlCommonException(String msg) { 28 | super(msg); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /agentweb-core/src/main/java/com/just/agentweb/WebChromeClient.java: -------------------------------------------------------------------------------- 1 | package com.just.agentweb; 2 | 3 | /** 4 | * @author cenxiaozhong 5 | * @date 2019/4/13 6 | * @since 1.0.0 7 | */ 8 | public class WebChromeClient extends MiddlewareWebChromeBase{ 9 | public WebChromeClient() { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /agentweb-core/src/main/java/com/just/agentweb/WebCreator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Justson(https://github.com/Justson/AgentWeb) 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 | 17 | package com.just.agentweb; 18 | 19 | import android.webkit.WebView; 20 | import android.widget.FrameLayout; 21 | /** 22 | * @author cenxiaozhong 23 | * @since 1.0.0 24 | */ 25 | public interface WebCreator extends IWebIndicator { 26 | WebCreator create(); 27 | 28 | WebView getWebView(); 29 | 30 | FrameLayout getWebParentLayout(); 31 | } 32 | -------------------------------------------------------------------------------- /agentweb-core/src/main/java/com/just/agentweb/WebLifeCycle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Justson(https://github.com/Justson/AgentWeb) 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 | 17 | package com.just.agentweb; 18 | 19 | /** 20 | * @author cenxiaozhong 21 | * @date 2017/5/30 22 | * @since 1.0.0 23 | */ 24 | public interface WebLifeCycle { 25 | void onResume(); 26 | void onPause(); 27 | void onDestroy(); 28 | } 29 | -------------------------------------------------------------------------------- /agentweb-core/src/main/java/com/just/agentweb/WebListenerManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Justson(https://github.com/Justson/AgentWeb) 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 | 17 | package com.just.agentweb; 18 | 19 | import android.webkit.DownloadListener; 20 | import android.webkit.WebChromeClient; 21 | import android.webkit.WebView; 22 | import android.webkit.WebViewClient; 23 | 24 | /** 25 | * @author cenxiaozhong 26 | * @date 2017/5/13 27 | * @since 1.0.0 28 | */ 29 | public interface WebListenerManager { 30 | WebListenerManager setWebChromeClient(WebView webview, WebChromeClient webChromeClient); 31 | WebListenerManager setWebViewClient(WebView webView, WebViewClient webViewClient); 32 | WebListenerManager setDownloader(WebView webView, DownloadListener downloadListener); 33 | } 34 | -------------------------------------------------------------------------------- /agentweb-core/src/main/java/com/just/agentweb/WebSecurityCheckLogic.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Justson(https://github.com/Justson/AgentWeb) 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 | 17 | package com.just.agentweb; 18 | 19 | import android.webkit.WebView; 20 | 21 | import androidx.collection.ArrayMap; 22 | 23 | 24 | /** 25 | * @author cenxiaozhong 26 | */ 27 | public interface WebSecurityCheckLogic { 28 | void dealHoneyComb(WebView view); 29 | void dealJsInterface(ArrayMap objects, AgentWeb.SecurityType securityType); 30 | } 31 | -------------------------------------------------------------------------------- /agentweb-core/src/main/java/com/just/agentweb/WebSecurityController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Justson(https://github.com/Justson/AgentWeb) 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 | 17 | package com.just.agentweb; 18 | 19 | /** 20 | * @author cenxiaozhong 21 | */ 22 | public interface WebSecurityController { 23 | void check(T t); 24 | } 25 | -------------------------------------------------------------------------------- /agentweb-core/src/main/java/com/just/agentweb/WebViewClient.java: -------------------------------------------------------------------------------- 1 | package com.just.agentweb; 2 | 3 | /** 4 | * @author cenxiaozhong 5 | * @date 2019/4/13 6 | * @since 1.0.0 7 | */ 8 | public class WebViewClient extends MiddlewareWebClientBase { 9 | public WebViewClient() { 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /agentweb-core/src/main/res/layout/agentweb_error_page.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /agentweb-core/src/main/res/values-zh/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 该任务已经存在 , 请勿重复点击下载! 3 | 提示 4 | 您正在使用手机流量 , 继续下载该文件吗? 5 | 下载 6 | 取消 7 | 下载失败! 8 | 当前进度:%s 9 | 已下载:%s 10 | 您有一条新通知 11 | 文件下载 12 | 点击打开 13 | 即将开始下载文件 14 | 相机 15 | 文件 16 | 加载中 ... 17 | 您需要离开%s前往其他应用吗? 18 | 离开 19 | 选择的文件不能大于%sMB 20 | 出错啦! 点击空白处刷新 ~ 21 | 22 | -------------------------------------------------------------------------------- /agentweb-core/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #000000 4 | #ffffff 5 | #2e2e32 6 | -------------------------------------------------------------------------------- /agentweb-core/src/main/res/values/ids.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /agentweb-core/src/main/res/values/style.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build/ 2 | /src/androidTest/ 3 | /src/test/ 4 | /release/ 5 | -------------------------------------------------------------------------------- /app/libs/okgo-3.0.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wizos/loread/bec024a07bee7bc4a7ac36970fd2e0aa253b4236/app/libs/okgo-3.0.4.jar -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard replaceUrl here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:\Program Files\Android\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class userName to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/androidTest/java/me/wizos/loread/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/assets/css/android_studio.css: -------------------------------------------------------------------------------- 1 | /* 2 | Date: 24 Fev 2015 3 | Author: Pedro Oliveira 4 | */ 5 | 6 | .hljs { 7 | color: #a9b7c6; 8 | background: #282b2e; 9 | display: block; 10 | overflow-x: auto; 11 | padding: 0.5em; 12 | } 13 | 14 | .hljs-number, 15 | .hljs-literal, 16 | .hljs-symbol, 17 | .hljs-bullet { 18 | color: #6897BB; 19 | } 20 | 21 | .hljs-keyword, 22 | .hljs-selector-tag, 23 | .hljs-deletion { 24 | color: #cc7832; 25 | } 26 | 27 | .hljs-variable, 28 | .hljs-template-variable, 29 | .hljs-link { 30 | color: #629755; 31 | } 32 | 33 | .hljs-comment, 34 | .hljs-quote { 35 | color: #808080; 36 | } 37 | 38 | .hljs-meta { 39 | color: #bbb529; 40 | } 41 | 42 | .hljs-string, 43 | .hljs-attribute, 44 | .hljs-addition { 45 | color: #6A8759; 46 | } 47 | 48 | .hljs-section, 49 | .hljs-title, 50 | .hljs-type { 51 | color: #ffc66d; 52 | } 53 | 54 | .hljs-name, 55 | .hljs-selector-id, 56 | .hljs-selector-class { 57 | color: #e8bf6a; 58 | } 59 | 60 | .hljs-emphasis { 61 | font-style: italic; 62 | } 63 | 64 | .hljs-strong { 65 | font-weight: bold; 66 | } 67 | -------------------------------------------------------------------------------- /app/src/main/assets/css/article_theme_day.css: -------------------------------------------------------------------------------- 1 | /* #f8f8f8;灰白 2 | background-color:rgba(0,0,0,0);*/ 3 | 4 | body { 5 | //color: #333; 6 | color:#293845; 7 | background-color: #FFFFFF; 8 | } 9 | /* 标题 10 | =============================================================================*/ 11 | /* 12 | h1,h2 { 13 | color: #000; 14 | border-bottom: 1px dashed #ccc; 15 | } 16 | 17 | hr { 18 | //background-color:#f8f8f8; 19 | } 20 | */ 21 | 22 | /* 表格 23 | =============================================================================*/ 24 | table{ 25 | background-color: #f8f8f8; 26 | } 27 | table th, table td { 28 | border: 1px solid #ccc; 29 | } 30 | 31 | /* 代码 32 | =============================================================================*/ 33 | code, tt ,pre { 34 | border: 1px solid #eaeaea; 35 | background-color: #f8f8f8; 36 | } 37 | blockquote{ 38 | background: rgba(0, 0, 0, 0.04) !important; 39 | color: rgba(0, 0, 0, 0.5) !important; 40 | } -------------------------------------------------------------------------------- /app/src/main/assets/css/article_theme_night.css: -------------------------------------------------------------------------------- 1 | ::-webkit-scrollbar { 2 | width: 8px; 3 | height: 8px; 4 | background: #2c3e50; 5 | } 6 | 7 | ::-webkit-scrollbar-thumb { 8 | background: #888; 9 | } 10 | 11 | a { 12 | color: #c6cddb; 13 | } 14 | 15 | body{ 16 | color: #c6cddb; 17 | //background: #494f5c; 18 | background-color: #454952; 19 | } 20 | 21 | 22 | /* 表格 23 | =============================================================================*/ 24 | /*background-color: #141e21; 25 | border: 1px solid #203238;*/ 26 | pre { 27 | color: #eee; 28 | background: #2c3e50; 29 | } 30 | 31 | code { 32 | color: #eee; 33 | background: #7d828a; 34 | } 35 | table{ 36 | color: #eee; 37 | border: 1px solid rgba(0, 0, 0, 0.1) !important; 38 | background: rgba(0, 0, 0, 0.08) !important; 39 | /*background-color: #203238;*/ 40 | } 41 | tt { 42 | background-color: #141e21; 43 | border: 1px solid #203238; 44 | } 45 | 46 | table th, table td { 47 | //border: 1px solid #212121; 48 | border: 1px solid rgba(0, 0, 0, 0.1); 49 | } 50 | 51 | /* 降低亮度 */ 52 | img,video,iframe,embed { 53 | -webkit-filter:brightness(0.75); 54 | } 55 | blockquote{ 56 | background: rgba(0, 0, 0, 0.08) !important; 57 | border-left: 5px solid rgba(0, 0, 0, 0.3) !important; 58 | color: rgba(255, 255, 255, 0.6) !important; 59 | } 60 | 61 | -------------------------------------------------------------------------------- /app/src/main/assets/fonts/roboto_light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wizos/loread/bec024a07bee7bc4a7ac36970fd2e0aa253b4236/app/src/main/assets/fonts/roboto_light.ttf -------------------------------------------------------------------------------- /app/src/main/assets/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wizos/loread/bec024a07bee7bc4a7ac36970fd2e0aa253b4236/app/src/main/assets/iconfont.ttf -------------------------------------------------------------------------------- /app/src/main/assets/image/gif_player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wizos/loread/bec024a07bee7bc4a7ac36970fd2e0aa253b4236/app/src/main/assets/image/gif_player.png -------------------------------------------------------------------------------- /app/src/main/assets/image/image_holder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wizos/loread/bec024a07bee7bc4a7ac36970fd2e0aa253b4236/app/src/main/assets/image/image_holder.png -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/Contract.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread; 2 | 3 | /** 4 | * Created by Wizos on 2019/2/8. 5 | */ 6 | 7 | public class Contract { 8 | public static final String PROVIDER_LOCALRSS = "LocalRSS"; 9 | public static final String PROVIDER_INOREADER = "InoReader"; 10 | public static final String PROVIDER_FEEDLY = "Feedly"; 11 | public static final String PROVIDER_TINYRSS = "TinyTinyRSS"; 12 | public static final String PROVIDER_LOREAD = "Loread"; 13 | public static final String UID = "UID"; 14 | public static final String SCHEMA_HTTP = "http://"; 15 | public static final String SCHEMA_HTTPS = "https://"; 16 | public static final String SCHEMA_FILE = "file://"; 17 | public static final String SCHEMA_LOREAD = "loread://"; 18 | 19 | public static final String HTTP = "http"; 20 | public static final String HTTPS = "https"; 21 | 22 | public static final String isPortrait = "isPortrait"; 23 | // ACCOUNT_TYPE用于我们当前APP获取系统帐户的唯一标识,这个在account_preferences.xml中有,两处的声明必须是一致 24 | // public static final String ACCOUNT_TYPE = "me.wizos.loreadx"; 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/activity/RuleGenerateActivity.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.activity; 2 | 3 | import android.os.Bundle; 4 | 5 | import androidx.appcompat.app.AppCompatActivity; 6 | 7 | import me.wizos.loread.R; 8 | 9 | public class RuleGenerateActivity extends AppCompatActivity { 10 | 11 | @Override 12 | protected void onCreate(Bundle savedInstanceState) { 13 | super.onCreate(savedInstanceState); 14 | setContentView(R.layout.activity_rule_generate); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/activity/login/LoginResult.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.activity.login; 2 | 3 | import androidx.annotation.Nullable; 4 | 5 | /** 6 | * Authentication result : success (user details) or error message. 7 | */ 8 | public class LoginResult { 9 | @Nullable 10 | private boolean success; 11 | @Nullable 12 | private String data; 13 | 14 | public LoginResult() { 15 | } 16 | 17 | @Nullable 18 | public LoginResult setSuccess(boolean success) { 19 | this.success = success; 20 | return this; 21 | } 22 | 23 | @Nullable 24 | public boolean isSuccess() { 25 | return success; 26 | } 27 | 28 | @Nullable 29 | public String getData() { 30 | return data; 31 | } 32 | 33 | public LoginResult setData(@Nullable String data) { 34 | this.data = data; 35 | return this; 36 | } 37 | 38 | @Override 39 | public String toString() { 40 | return "LoginResult{" + 41 | "success=" + success + 42 | ", data='" + data + '\'' + 43 | '}'; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/Enclosure.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | /** 6 | * Created by Wizos on 2019/2/8. 7 | */ 8 | 9 | public class Enclosure { 10 | @SerializedName(value = "href", alternate = {"content_url"}) 11 | private String href; 12 | // 值有text/html、image/jpeg、application/rss+xml; charset=UTF-8(href是https://justyy.com/feed) 13 | @SerializedName(value = "type", alternate = {"content_type"}) 14 | private String type; 15 | 16 | public String getHref() { 17 | return href; 18 | } 19 | 20 | public void setHref(String href) { 21 | this.href = href; 22 | } 23 | 24 | public String getType() { 25 | return type; 26 | } 27 | 28 | public void setType(String type) { 29 | this.type = type; 30 | } 31 | 32 | public String toString() { 33 | return "Enclosure [href:" + href + ", type:" + type + "]"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/LogLevel.java: -------------------------------------------------------------------------------- 1 | //package me.wizos.loreadx.bean; 2 | // 3 | //public enum LogLevel { 4 | // debug("debug"),info("info"),warning("warning"),error("error"),none("none"); 5 | // 6 | // private String level; 7 | // 8 | // LogLevel(String level) { } 9 | // 10 | // public String getLevel() { 11 | // return level; 12 | // } 13 | // 14 | // public void setLevel(String level) { 15 | // this.level = level; 16 | // } 17 | //} 18 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/UserAgent.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean; 2 | 3 | 4 | /** 5 | * @author Wizos on 2018/6/28. 6 | */ 7 | 8 | public class UserAgent { 9 | private String name; 10 | private String value; 11 | 12 | public UserAgent(String name, String value) { 13 | this.name = name; 14 | this.value = value; 15 | } 16 | 17 | public String getName() { 18 | return name; 19 | } 20 | 21 | public void setName(String name) { 22 | this.name = name; 23 | } 24 | 25 | public String getValue() { 26 | return value; 27 | } 28 | 29 | public void setValue(String value) { 30 | this.value = value; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/domain/OutFeed.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.domain; 2 | 3 | /** 4 | * Created by Wizos on 2019/5/15. 5 | */ 6 | 7 | public class OutFeed { 8 | private String title; 9 | private String feedUrl; 10 | private String htmlUrl; 11 | 12 | public OutFeed(String title, String feedUrl, String htmlUrl) { 13 | this.title = title; 14 | this.feedUrl = feedUrl; 15 | this.htmlUrl = htmlUrl; 16 | } 17 | 18 | public String getTitle() { 19 | return title; 20 | } 21 | 22 | public void setTitle(String title) { 23 | this.title = title; 24 | } 25 | 26 | public String getFeedUrl() { 27 | return feedUrl; 28 | } 29 | 30 | public void setFeedUrl(String feedUrl) { 31 | this.feedUrl = feedUrl; 32 | } 33 | 34 | public String getHtmlUrl() { 35 | return htmlUrl; 36 | } 37 | 38 | public void setHtmlUrl(String htmlUrl) { 39 | this.htmlUrl = htmlUrl; 40 | } 41 | 42 | @Override 43 | public String toString() { 44 | return "OutFeed{" + 45 | "title='" + title + '\'' + 46 | ", feedUrl='" + feedUrl + '\'' + 47 | ", htmlUrl='" + htmlUrl + '\'' + 48 | '}'; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/domain/OutTag.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.domain; 2 | 3 | import java.util.ArrayList; 4 | 5 | /** 6 | * Created by Wizos on 2019/5/15. 7 | */ 8 | 9 | public class OutTag { 10 | private String title; 11 | private ArrayList outFeeds; 12 | 13 | public String getTitle() { 14 | return title; 15 | } 16 | 17 | public void setTitle(String title) { 18 | this.title = title; 19 | } 20 | 21 | public ArrayList getOutFeeds() { 22 | return outFeeds; 23 | } 24 | 25 | public void setOutFeeds(ArrayList outFeeds) { 26 | this.outFeeds = outFeeds; 27 | } 28 | 29 | public OutTag addOutFeed(OutFeed outFeed) { 30 | if (outFeeds == null) { 31 | outFeeds = new ArrayList<>(); 32 | } 33 | outFeeds.add(outFeed); 34 | return this; 35 | } 36 | 37 | 38 | @Override 39 | public String toString() { 40 | return "OutTag{" + 41 | "title='" + title + '\'' + 42 | ", outFeeds=" + outFeeds + 43 | '}'; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/feedly/CategoryItem.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.feedly; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import me.wizos.loread.db.Category; 6 | 7 | /** 8 | * Created by Wizos on 2019/2/8. 9 | */ 10 | 11 | public class CategoryItem { 12 | @SerializedName("id") 13 | private String id; 14 | 15 | @SerializedName("label") 16 | private String label; 17 | 18 | public String getId() { 19 | return id; 20 | } 21 | 22 | public void setId(String id) { 23 | this.id = id; 24 | } 25 | 26 | public String getLabel() { 27 | return label; 28 | } 29 | 30 | public void setLabel(String label) { 31 | this.label = label; 32 | } 33 | 34 | 35 | public Category convert() { 36 | Category category = new Category(); 37 | category.setId(id); 38 | category.setTitle(label); 39 | return category; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/feedly/ContentDirection.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.feedly; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | /** 6 | * Created by Wizos on 2019/2/8. 7 | */ 8 | 9 | public class ContentDirection { 10 | @SerializedName("content") 11 | String content; 12 | @SerializedName("direction") 13 | String direction; 14 | 15 | public String getContent() { 16 | return content; 17 | } 18 | 19 | public void setContent(String content) { 20 | this.content = content; 21 | } 22 | 23 | public String getDirection() { 24 | return direction; 25 | } 26 | 27 | public void setDirection(String direction) { 28 | this.direction = direction; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/feedly/Counts.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.feedly; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.util.ArrayList; 6 | 7 | /** 8 | * Created by Wizos on 2019/2/8. 9 | */ 10 | 11 | public class Counts { 12 | @SerializedName("unreadcounts") 13 | private ArrayList unreadcounts; 14 | @SerializedName("updated") 15 | private long updated; 16 | 17 | public ArrayList getUnreadcounts() { 18 | return unreadcounts; 19 | } 20 | 21 | public void setUnreadcounts(ArrayList unreadcounts) { 22 | this.unreadcounts = unreadcounts; 23 | } 24 | 25 | public long getUpdated() { 26 | return updated; 27 | } 28 | 29 | public void setUpdated(long updated) { 30 | this.updated = updated; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/feedly/Origin.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.feedly; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | /** 6 | * Created by Wizos on 2019/2/8. 7 | */ 8 | 9 | public class Origin { 10 | @SerializedName("streamId") 11 | String streamId; 12 | @SerializedName("title") 13 | String title; 14 | @SerializedName("htmlUrl") 15 | String htmlUrl; 16 | 17 | public String getStreamId() { 18 | return streamId; 19 | } 20 | 21 | public void setStreamId(String streamId) { 22 | this.streamId = streamId; 23 | } 24 | 25 | public String getHtmlUrl() { 26 | return htmlUrl; 27 | } 28 | 29 | public void setHtmlUrl(String htmlUrl) { 30 | this.htmlUrl = htmlUrl; 31 | } 32 | 33 | public String getTitle() { 34 | return title; 35 | } 36 | 37 | public void setTitle(String title) { 38 | this.title = title; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/feedly/StreamContents.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.feedly; 2 | 3 | import java.util.ArrayList; 4 | 5 | /** 6 | * Created by Wizos on 2019/2/8. 7 | */ 8 | 9 | public class StreamContents { 10 | private String id; 11 | private String title; 12 | private long updated; 13 | private String continuation; 14 | private ArrayList items; 15 | 16 | public String getId() { 17 | return id; 18 | } 19 | 20 | public void setId(String id) { 21 | this.id = id; 22 | } 23 | 24 | public long getUpdated() { 25 | return updated; 26 | } 27 | 28 | public void setUpdated(long updated) { 29 | this.updated = updated; 30 | } 31 | 32 | public String getContinuation() { 33 | return continuation; 34 | } 35 | 36 | public void setContinuation(String continuation) { 37 | this.continuation = continuation; 38 | } 39 | 40 | public ArrayList getItems() { 41 | return items; 42 | } 43 | 44 | public void setItems(ArrayList items) { 45 | this.items = items; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/feedly/StreamIds.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.feedly; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.util.ArrayList; 6 | 7 | /** 8 | * Created by Wizos on 2019/2/8. 9 | */ 10 | 11 | public class StreamIds { 12 | @SerializedName("ids") 13 | private ArrayList ids; 14 | 15 | @SerializedName("continuation") 16 | private String continuation; 17 | 18 | public ArrayList getIds() { 19 | return ids; 20 | } 21 | 22 | public void setIds(ArrayList ids) { 23 | this.ids = ids; 24 | } 25 | 26 | public String getContinuation() { 27 | return continuation; 28 | } 29 | 30 | public void setContinuation(String continuation) { 31 | this.continuation = continuation; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/feedly/Unreadcount.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.feedly; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | /** 6 | * Created by Wizos on 2019/2/8. 7 | */ 8 | 9 | public class Unreadcount { 10 | @SerializedName("id") 11 | private String id; 12 | @SerializedName("count") 13 | private int count; 14 | @SerializedName("updated") 15 | private long updated; 16 | 17 | public String getId() { 18 | return id; 19 | } 20 | 21 | public void setId(String id) { 22 | this.id = id; 23 | } 24 | 25 | public int getCount() { 26 | return count; 27 | } 28 | 29 | public void setCount(int count) { 30 | this.count = count; 31 | } 32 | 33 | public long getUpdated() { 34 | return updated; 35 | } 36 | 37 | public void setUpdated(long updated) { 38 | this.updated = updated; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/feedly/Visual.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.feedly; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | /** 6 | * Created by Wizos on 2019/2/24. 7 | */ 8 | 9 | public class Visual { 10 | /** 11 | * 可能为none 12 | */ 13 | @SerializedName("url") 14 | private Origin url; 15 | 16 | /** 17 | * 可空(可能性中) 18 | */ 19 | @SerializedName("contentType") 20 | private Origin contentType; 21 | 22 | /** 23 | * 可空(可能性高) 24 | */ 25 | @SerializedName("width") 26 | private int width; 27 | 28 | /** 29 | * 可空(可能性高) 30 | */ 31 | @SerializedName("height") 32 | private int height; 33 | 34 | public Origin getUrl() { 35 | return url; 36 | } 37 | 38 | public void setUrl(Origin url) { 39 | this.url = url; 40 | } 41 | 42 | public Origin getContentType() { 43 | return contentType; 44 | } 45 | 46 | public void setContentType(Origin contentType) { 47 | this.contentType = contentType; 48 | } 49 | 50 | public int getWidth() { 51 | return width; 52 | } 53 | 54 | public void setWidth(int width) { 55 | this.width = width; 56 | } 57 | 58 | public int getHeight() { 59 | return height; 60 | } 61 | 62 | public void setHeight(int height) { 63 | this.height = height; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/fever/BaseResponse.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.fever; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | public class BaseResponse { 6 | @SerializedName("api_version") 7 | private int apiVersion; 8 | @SerializedName("auth") 9 | private int auth; // 为 1 时,代表验证/授权成功 10 | @SerializedName("last_refreshed_on_time") 11 | private long lastRefreshedOnTime; 12 | @SerializedName("error") 13 | private String error; // NOT_LOGGED_IN 14 | 15 | public int getApiVersion() { 16 | return apiVersion; 17 | } 18 | 19 | public int getAuth() { 20 | return auth; 21 | } 22 | 23 | public long getLastRefreshedOnTime() { 24 | return lastRefreshedOnTime; 25 | } 26 | 27 | 28 | public boolean isSuccessful(){ 29 | return auth == 1; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/fever/Feeds.java: -------------------------------------------------------------------------------- 1 | //package me.wizos.loreadx.bean.fever; 2 | // 3 | //import com.google.gson.annotations.SerializedName; 4 | // 5 | //import java.util.List; 6 | // 7 | //public class Feeds extends BaseResponse { 8 | // @SerializedName("feeds") 9 | // private List feeds; 10 | // @SerializedName("feeds_groups") 11 | // private List feedsGroups; 12 | // 13 | // public List getFeeds() { 14 | // return feeds; 15 | // } 16 | // 17 | // public List getFeedsGroups() { 18 | // return feedsGroups; 19 | // } 20 | //} 21 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/fever/Group.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.fever; 2 | 3 | import android.text.TextUtils; 4 | 5 | import com.google.gson.annotations.SerializedName; 6 | 7 | import me.wizos.loread.db.Category; 8 | 9 | public class Group { 10 | private int id; 11 | private String title; 12 | @SerializedName("feed_ids") 13 | private String feedIds; 14 | 15 | public int getId() { 16 | return id; 17 | } 18 | 19 | public String getTitle() { 20 | return title; 21 | } 22 | 23 | public String[] getFeedIds(){ 24 | if(TextUtils.isEmpty(feedIds)){ 25 | return null; 26 | }else { 27 | return feedIds.split(","); 28 | } 29 | } 30 | 31 | public Category getCategry(){ 32 | Category category = new Category(); 33 | category.setId("user/" + id); 34 | category.setTitle(title); 35 | return category; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/fever/GroupFeeds.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.fever; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | public class GroupFeeds { 6 | @SerializedName("group_id") 7 | private int groupId; 8 | @SerializedName("feed_ids") 9 | private String feedIds; 10 | 11 | public int getGroupId() { 12 | return groupId; 13 | } 14 | 15 | public String getFeedIds() { 16 | return feedIds; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/fever/Groups.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.fever; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 超级组 Kindling 不在该响应中,它由所有 is_spark = 0 的 feed 组成 9 | * 超级组 Sparks 不在该响应中,它由所有 is_spark = 1 的 feed 组成 10 | */ 11 | 12 | public class Groups extends BaseResponse { 13 | @SerializedName("groups") 14 | private List groups; 15 | 16 | @SerializedName("feeds_groups") 17 | private List feedsGroups; 18 | 19 | public List getGroups() { 20 | return groups; 21 | } 22 | 23 | public List getFeedsGroups() { 24 | return feedsGroups; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/fever/Items.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.fever; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.util.List; 6 | 7 | public class Items extends BaseResponse { 8 | @SerializedName("total_items") 9 | private String totalItems; 10 | 11 | @SerializedName("items") 12 | private List items; 13 | 14 | public String getTotalItems() { 15 | return totalItems; 16 | } 17 | 18 | public List getItems() { 19 | return items; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/fever/SavedItemIds.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.fever; 2 | 3 | import android.text.TextUtils; 4 | 5 | import com.google.gson.annotations.SerializedName; 6 | 7 | public class SavedItemIds extends BaseResponse { 8 | @SerializedName("saved_item_ids") 9 | private String savedItemIds; 10 | 11 | public String[] getSavedItemIds(){ 12 | if(TextUtils.isEmpty(savedItemIds)){ 13 | return null; 14 | }else { 15 | return savedItemIds.split(","); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/fever/UnreadItemIds.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.fever; 2 | 3 | import android.text.TextUtils; 4 | 5 | import com.google.gson.annotations.SerializedName; 6 | 7 | public class UnreadItemIds extends BaseResponse { 8 | @SerializedName("unread_item_ids") 9 | private String unreadItemIds; 10 | public String[] getUreadItemIds(){ 11 | if(TextUtils.isEmpty(unreadItemIds)){ 12 | return null; 13 | }else { 14 | return unreadItemIds.split(","); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/inoreader/EditTag.java: -------------------------------------------------------------------------------- 1 | //package me.wizos.loreadx.bean.inoreader; 2 | // 3 | ///** 4 | // * Created by Wizos on 2019/5/12. 5 | // */ 6 | // 7 | //public class EditTag { 8 | // 9 | // private String ac; 10 | // 11 | //} 12 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/inoreader/GsTag.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.inoreader; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | /** 6 | * Created by Wizos on 2019/2/20. 7 | */ 8 | 9 | public class GsTag { 10 | @SerializedName("id") 11 | String id; 12 | @SerializedName("sortid") 13 | String sortid; 14 | 15 | public String getId() { 16 | return id; 17 | } 18 | 19 | public void setId(String id) { 20 | this.id = id; 21 | } 22 | 23 | public String getSortid() { 24 | return sortid; 25 | } 26 | 27 | public void setSortid(String sortid) { 28 | this.sortid = sortid; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/inoreader/GsTags.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.inoreader; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import org.parceler.Parcel; 6 | 7 | import java.util.ArrayList; 8 | 9 | import me.wizos.loread.db.Category; 10 | 11 | @Parcel 12 | public class GsTags { 13 | @SerializedName("tags") 14 | ArrayList categories; 15 | 16 | public ArrayList getCategories() { 17 | return categories; 18 | } 19 | 20 | public void setCategories(ArrayList categories) { 21 | this.categories = categories; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/inoreader/GsUnreadCount.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.inoreader; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.util.ArrayList; 6 | 7 | /** 8 | * Created by Wizos on 2016/3/11. 9 | */ 10 | public class GsUnreadCount { 11 | @SerializedName("max") 12 | int max; 13 | 14 | @SerializedName("unreadcounts") 15 | ArrayList unreadcounts; 16 | 17 | public int getMax() { 18 | return max; 19 | } 20 | 21 | public void setMax(int max) { 22 | this.max = max; 23 | } 24 | 25 | public ArrayList getUnreadcounts() { 26 | return unreadcounts; 27 | } 28 | 29 | public void setUnreadcounts(ArrayList unreadcounts) { 30 | this.unreadcounts = unreadcounts; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/inoreader/ItemIds.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.inoreader; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.util.ArrayList; 6 | 7 | /** 8 | * Created by Wizos on 2016/3/10. 9 | */ 10 | public class ItemIds { 11 | @SerializedName("items") 12 | ArrayList items; 13 | 14 | @SerializedName("itemRefs") 15 | ArrayList itemRefs; 16 | 17 | @SerializedName("continuation") 18 | String continuation; 19 | 20 | public ItemIds() { 21 | items = new ArrayList<>(); 22 | itemRefs = new ArrayList<>(); 23 | continuation = null; 24 | } 25 | 26 | 27 | public ArrayList getItems() { 28 | return items; 29 | } 30 | 31 | public void setItems(ArrayList items) { 32 | this.items = items; 33 | } 34 | 35 | public void setItemRefs(ArrayList itemRefs) { 36 | this.itemRefs = itemRefs; 37 | } 38 | 39 | public ArrayList getItemRefs() { 40 | return itemRefs; 41 | } 42 | 43 | public void setContinuation(String continuation) { 44 | this.continuation = continuation; 45 | } 46 | 47 | public String getContinuation() { 48 | return continuation; 49 | } 50 | 51 | public void addItemRefs(ArrayList itemRefs) { 52 | this.itemRefs.addAll(itemRefs); 53 | } 54 | 55 | 56 | } 57 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/inoreader/StreamPref.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.inoreader; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | /** 6 | * ID 和 Value 7 | * Created by Wizos on 2016/3/5. 8 | */ 9 | public class StreamPref { 10 | 11 | @SerializedName("value") 12 | String value; 13 | 14 | @SerializedName("id") 15 | String id; 16 | 17 | public String getValue() { 18 | return value; 19 | } 20 | 21 | public void setValue(String value) { 22 | this.value = value; 23 | } 24 | 25 | public String getId() { 26 | return id; 27 | } 28 | 29 | public void setId(String id) { 30 | this.id = id; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/inoreader/StreamPrefs.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.inoreader; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import org.parceler.Parcel; 6 | 7 | import java.util.ArrayList; 8 | import java.util.Map; 9 | 10 | @Parcel 11 | public class StreamPrefs { 12 | @SerializedName("streamprefs") 13 | Map> streamPrefs; 14 | 15 | public Map> getStreamPrefsMaps() { 16 | return streamPrefs; 17 | } 18 | 19 | public void setStreamPrefs(Map> streamPrefs) { 20 | this.streamPrefs = streamPrefs; 21 | System.out.println("【StreamPrefs类】" + streamPrefs); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/inoreader/SubCategories.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.inoreader; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | /** 6 | * Created by Wizos on 2016/3/11. 7 | */ 8 | public class SubCategories { 9 | @SerializedName("id") 10 | String id; 11 | 12 | @SerializedName("label") 13 | String label; 14 | 15 | public String getId() { 16 | return id; 17 | } 18 | 19 | public void setId(String id) { 20 | this.id = id; 21 | } 22 | 23 | public String getLabel() { 24 | return label; 25 | } 26 | 27 | public void setLabel(String label) { 28 | this.label = label; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/inoreader/Subscriptions.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.inoreader; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.util.ArrayList; 6 | 7 | /** 8 | * Created by Wizos on 2016/3/11. 9 | */ 10 | public class Subscriptions { 11 | @SerializedName("subscriptions") 12 | private ArrayList subscriptions; 13 | public ArrayList getSubscriptions() { 14 | return subscriptions; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/inoreader/UnreadCounts.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.inoreader; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | /** 6 | * Created by Wizos on 2016/3/11. 7 | */ 8 | public class UnreadCounts { 9 | 10 | @SerializedName("id") 11 | String id; 12 | 13 | @SerializedName("count") 14 | int count; 15 | 16 | @SerializedName("newestItemTimestampUsec") 17 | long newestItemTimestampUsec; 18 | 19 | public String getId() { 20 | return id; 21 | } 22 | 23 | public void setId(String id) { 24 | this.id = id; 25 | } 26 | 27 | public int getCount() { 28 | return count; 29 | } 30 | 31 | public void setCount(int count) { 32 | this.count = count; 33 | } 34 | 35 | public long getNewestItemTimestampUsec() { 36 | return newestItemTimestampUsec; 37 | } 38 | 39 | public void setNewestItemTimestampUsec(long newestItemTimestampUsec) { 40 | this.newestItemTimestampUsec = newestItemTimestampUsec; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/inoreader/itemContents/Origin.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.inoreader.itemContents; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import org.parceler.Parcel; 6 | 7 | @Parcel 8 | public class Origin { 9 | @SerializedName("streamId") 10 | String streamId; 11 | 12 | @SerializedName("title") 13 | String title; 14 | 15 | @SerializedName("htmlUrl") 16 | String htmlUrl; 17 | 18 | 19 | public String getHtmlUrl() { 20 | return htmlUrl; 21 | } 22 | 23 | public void setHtmlUrl(String htmlUrl) { 24 | this.htmlUrl = htmlUrl; 25 | } 26 | 27 | public String getStreamId() { 28 | return streamId; 29 | } 30 | 31 | public void setStreamId(String streamId) { 32 | this.streamId = streamId; 33 | } 34 | 35 | public String getTitle() { 36 | return title; 37 | } 38 | 39 | public void setTitle(String title) { 40 | this.title = title; 41 | } 42 | 43 | public String toString() { 44 | return "{\"streamId\": \"" + streamId + "\",\"title\": \"" + title + "\",\"htmlUrl\": \"" + htmlUrl + "\"}"; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/inoreader/itemContents/Self.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.inoreader.itemContents; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import org.parceler.Parcel; 6 | 7 | @Parcel 8 | public class Self { 9 | @SerializedName("href") 10 | String href; 11 | 12 | public String getHref() { 13 | return href; 14 | } 15 | 16 | public void setHref(String href) { 17 | this.href = href; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/inoreader/itemContents/Summary.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.inoreader.itemContents; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import org.parceler.Parcel; 6 | 7 | @Parcel 8 | public class Summary { 9 | @SerializedName("direction") 10 | String direction; 11 | 12 | @SerializedName("content") 13 | String content; 14 | 15 | public String getContent() { 16 | return content; 17 | } 18 | 19 | public void setContent(String content) { 20 | this.content = content; 21 | } 22 | 23 | public String getDirection() { 24 | return direction; 25 | } 26 | 27 | public void setDirection(String direction) { 28 | this.direction = direction; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/loread/LoginParam.java: -------------------------------------------------------------------------------- 1 | //package me.wizos.loread.bean.loread; 2 | // 3 | //public class LoginParam extends RequestJsonBody{ 4 | // private String user = "admin"; 5 | // private String password; 6 | // private String op = "login"; 7 | // 8 | // public String getUser() { 9 | // return user; 10 | // } 11 | // 12 | // public void setUser(String user) { 13 | // this.user = user; 14 | // } 15 | // 16 | // public String getPassword() { 17 | // return password; 18 | // } 19 | // 20 | // public void setPassword(String password) { 21 | // this.password = password; 22 | // } 23 | // 24 | // @Override 25 | // public String toString() { 26 | // return "login{" + 27 | // "user='" + user + '\'' + 28 | // ", password='" + password + '\'' + 29 | // ", op='" + op + '\'' + 30 | // '}'; 31 | // } 32 | //} 33 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/loread/RequestJsonBody.java: -------------------------------------------------------------------------------- 1 | //package me.wizos.loread.bean.loread; 2 | // 3 | //public class RequestJsonBody { 4 | // private String op; 5 | // private String sid; 6 | // 7 | // public void setSid(String sid) { 8 | // this.sid = sid; 9 | // } 10 | // public String getSid() { 11 | // return sid; 12 | // } 13 | // 14 | // public String getOp() { 15 | // return op; 16 | // } 17 | // 18 | // public void setOp(String op) { 19 | // this.op = op; 20 | // } 21 | //} 22 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/loread/Response.java: -------------------------------------------------------------------------------- 1 | //package me.wizos.loread.bean.loread; 2 | // 3 | //import com.google.gson.annotations.SerializedName; 4 | //import com.socks.library.KLog; 5 | // 6 | //public class Response { 7 | // private int code; 8 | // @SerializedName(value = "msg", alternate = {"error"}) 9 | // private String msg; 10 | // private T data; 11 | // 12 | // public boolean isSuccessful() { 13 | // if (code == 0) { 14 | // KLog.i("请求正常"); 15 | // return true; 16 | // } 17 | // KLog.i("请求异常:" + data); 18 | // return false; 19 | // } 20 | // 21 | // public int getCode() { 22 | // return code; 23 | // } 24 | // 25 | // public void setCode(int code) { 26 | // this.code = code; 27 | // } 28 | // 29 | // public T getData() { 30 | // return data; 31 | // } 32 | // 33 | // public void setData(T data) { 34 | // this.data = data; 35 | // } 36 | // 37 | // public String getMsg() { 38 | // return msg; 39 | // } 40 | // 41 | // public void setMsg(String msg) { 42 | // this.msg = msg; 43 | // } 44 | //} 45 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/proxynode/ProxyType.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.proxynode; 2 | 3 | import me.wizos.loread.gson.GsonEnum; 4 | 5 | public enum ProxyType implements GsonEnum { 6 | DIRECT("DIRECT"), HTTP("HTTP"), SOCKS("SOCKS"); 7 | private final String proxyType; 8 | ProxyType(String proxyType) { 9 | this.proxyType = proxyType; 10 | } 11 | 12 | 13 | public String getProxyType() { 14 | return proxyType; 15 | } 16 | 17 | public static ProxyType parse(String type) { 18 | switch (type) { 19 | case "DIRECT": 20 | return ProxyType.DIRECT; 21 | case "HTTP": 22 | return ProxyType.HTTP; 23 | case "SOCKS": 24 | return ProxyType.SOCKS; 25 | default: 26 | throw new IllegalArgumentException("There is not enum names with [" + type + "] of type AnonymityLevel exists! "); 27 | } 28 | } 29 | 30 | @Override 31 | public ProxyType deserialize(String jsonEnum) { 32 | return ProxyType.parse(jsonEnum); 33 | } 34 | 35 | @Override 36 | public String serialize() { 37 | return this.getProxyType(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/search/QuickAdd.java: -------------------------------------------------------------------------------- 1 | //package me.wizos.loreadx.bean.search; 2 | // 3 | //import com.google.gson.annotations.SerializedName; 4 | // 5 | ///** 6 | // * Created by Wizos on 2018/1/2. 7 | // */ 8 | // 9 | //public class QuickAdd { 10 | // @SerializedName("streamId") 11 | // String streamId; 12 | // @SerializedName("streamName") 13 | // String streamName; 14 | // @SerializedName("query") 15 | // String query; 16 | // @SerializedName("numResults") // 如果Feed由于某种原因未被添加,则numResults将为0。 即使用户已订阅,添加订阅源时也会为1。 17 | // int numResults; 18 | // 19 | // public String getStreamId() { 20 | // return streamId; 21 | // } 22 | // 23 | // public void setStreamId(String streamId) { 24 | // this.streamId = streamId; 25 | // } 26 | // 27 | // public String getStreamName() { 28 | // return streamName; 29 | // } 30 | // 31 | // public void setStreamName(String streamName) { 32 | // this.streamName = streamName; 33 | // } 34 | // 35 | // public String getQuery() { 36 | // return query; 37 | // } 38 | // 39 | // public void setQuery(String query) { 40 | // this.query = query; 41 | // } 42 | // 43 | // public int getNumResults() { 44 | // return numResults; 45 | // } 46 | // 47 | // public void setNumResults(int numResults) { 48 | // this.numResults = numResults; 49 | // } 50 | //} 51 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/search/StreamFeed.java: -------------------------------------------------------------------------------- 1 | //package me.wizos.loreadx.bean.search; 2 | // 3 | //import com.google.gson.annotations.SerializedName; 4 | // 5 | ///** 6 | // * Created by Wizos on 2017/12/31. 7 | // */ 8 | // 9 | //public class StreamFeed { 10 | // @SerializedName("title") 11 | // String title; 12 | // 13 | // @SerializedName("feedUrl") 14 | // String feedUrl; 15 | // 16 | // @SerializedName("iconUrl") 17 | // String iconUrl; 18 | // 19 | // @SerializedName("description") 20 | // String description; 21 | // 22 | // @SerializedName("subscribers") 23 | // int subscribers; 24 | // 25 | // @SerializedName("iconUrl") 26 | // int articlesPerWeek; 27 | //} 28 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/ttrss/request/GetArticles.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.ttrss.request; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.util.HashSet; 6 | import java.util.List; 7 | 8 | import me.wizos.loread.utils.StringUtils; 9 | 10 | public class GetArticles { 11 | private String sid; 12 | private String op = "getArticle"; 13 | @SerializedName("article_id") 14 | private String articleIds; 15 | 16 | public GetArticles(String sid) { 17 | this.sid = sid; 18 | } 19 | 20 | public void setArticleIds(String articleIds) { 21 | this.articleIds = articleIds; 22 | } 23 | public void setArticleIds(HashSet articleIdSet) { 24 | this.articleIds = StringUtils.join(",",articleIdSet); 25 | } 26 | public void setArticleIds(List articleIdList) { 27 | this.articleIds = StringUtils.join(",",articleIdList); 28 | } 29 | public void setSid(String sid) { 30 | this.sid = sid; 31 | } 32 | public String getSid() { 33 | return sid; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/ttrss/request/GetCategories.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.ttrss.request; 2 | 3 | public class GetCategories { 4 | private String sid; 5 | private String op = "getCategories"; 6 | private boolean unread_only = false; 7 | private boolean include_empty = true; 8 | 9 | public GetCategories(String sid) { 10 | this.sid = sid; 11 | } 12 | 13 | public String getSid() { 14 | return sid; 15 | } 16 | 17 | public void setSid(String sid) { 18 | this.sid = sid; 19 | } 20 | 21 | public boolean isUnread_only() { 22 | return unread_only; 23 | } 24 | 25 | public void setUnread_only(boolean unread_only) { 26 | this.unread_only = unread_only; 27 | } 28 | 29 | public boolean isInclude_empty() { 30 | return include_empty; 31 | } 32 | 33 | public void setInclude_empty(boolean include_empty) { 34 | this.include_empty = include_empty; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/ttrss/request/GetFeeds.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.ttrss.request; 2 | 3 | public class GetFeeds { 4 | private String sid; 5 | private String op = "getFeeds"; 6 | 7 | public GetFeeds(String sid) { 8 | this.sid = sid; 9 | } 10 | 11 | /** 12 | * 0 Uncategorized 13 | * -1 Special (e.g. Starred, Published, Archived, etc.) 14 | * -2 Labels 15 | * -3 All feeds, excluding virtual feeds (e.g. Labels and such) 16 | * -4 All feeds, including virtual feeds 17 | */ 18 | private int cat_id = -3; 19 | private boolean unread_only = false; 20 | 21 | 22 | public String getSid() { 23 | return sid; 24 | } 25 | 26 | public void setSid(String sid) { 27 | this.sid = sid; 28 | } 29 | 30 | public int getCat_id() { 31 | return cat_id; 32 | } 33 | 34 | public void setCat_id(int cat_id) { 35 | this.cat_id = cat_id; 36 | } 37 | 38 | public boolean isUnread_only() { 39 | return unread_only; 40 | } 41 | 42 | public void setUnread_only(boolean unread_only) { 43 | this.unread_only = unread_only; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/ttrss/request/GetSavedItemIds.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.ttrss.request; 2 | 3 | public class GetSavedItemIds { 4 | private String sid; 5 | private String op = "getSavedItemIds"; 6 | 7 | public GetSavedItemIds(String sid) { 8 | this.sid = sid; 9 | } 10 | 11 | public void setSid(String sid) { 12 | this.sid = sid; 13 | } 14 | public String getSid() { 15 | return sid; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/ttrss/request/GetUnreadItemIds.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.ttrss.request; 2 | 3 | public class GetUnreadItemIds { 4 | private String sid; 5 | private String op = "getUnreadItemIds"; 6 | 7 | public GetUnreadItemIds(String sid) { 8 | this.sid = sid; 9 | } 10 | 11 | public void setSid(String sid) { 12 | this.sid = sid; 13 | } 14 | public String getSid() { 15 | return sid; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/ttrss/request/LoginParam.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.ttrss.request; 2 | 3 | public class LoginParam { 4 | private String user = "admin"; 5 | private String password; 6 | private String op = "login"; 7 | 8 | public String getUser() { 9 | return user; 10 | } 11 | 12 | public void setUser(String user) { 13 | this.user = user; 14 | } 15 | 16 | public String getPassword() { 17 | return password; 18 | } 19 | 20 | public void setPassword(String password) { 21 | this.password = password; 22 | } 23 | 24 | @Override 25 | public String toString() { 26 | return "login{" + 27 | "user='" + user + '\'' + 28 | ", password='" + password + '\'' + 29 | ", op='" + op + '\'' + 30 | '}'; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/ttrss/request/RequestParam.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.ttrss.request; 2 | 3 | public class RequestParam { 4 | private String op; 5 | private String sid; 6 | 7 | public void setSid(String sid) { 8 | this.sid = sid; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/ttrss/request/SearchHeadlines.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.ttrss.request; 2 | 3 | public class SearchHeadlines { 4 | private String op = "getHeadlines"; 5 | private String sid; 6 | private String view_mode = "all_articles"; 7 | 8 | private String search_mode = "all_feeds"; 9 | // 搜索词 10 | private String search; 11 | 12 | /** 13 | * -1 starred 14 | * -2 published 15 | * -3 fresh 16 | * -4 all articles 17 | * 0 - archived 18 | * IDs < -10 labels 19 | */ 20 | private String feed_id = "-4"; 21 | /** 22 | * date_reverse - oldest first 23 | * feed_dates - newest first, goes by feed date 24 | * (nothing) - default 25 | */ 26 | private String order_by = "feed_dates"; 27 | 28 | private int limit = 50; 29 | private int skip; 30 | private String since_id; 31 | private boolean is_cat = false; 32 | 33 | private boolean show_content = true; 34 | private boolean include_attachments = true; 35 | private boolean has_sandbox = true; 36 | } 37 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/ttrss/request/SearchMode.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.ttrss.request; 2 | 3 | public enum SearchMode { 4 | all_feeds, 5 | this_feed, 6 | //(category containing requested feed) 7 | this_cat 8 | } 9 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/ttrss/request/SubscribeToFeed.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.ttrss.request; 2 | 3 | public class SubscribeToFeed { 4 | private String sid; 5 | private String op = "subscribeToFeed"; 6 | private String category_id; 7 | private String feed_url; 8 | 9 | public SubscribeToFeed(String sid) { 10 | this.sid = sid; 11 | } 12 | 13 | public String getSid() { 14 | return sid; 15 | } 16 | 17 | public void setSid(String sid) { 18 | this.sid = sid; 19 | } 20 | 21 | public String getCategory_id() { 22 | return category_id; 23 | } 24 | 25 | public void setCategory_id(String category_id) { 26 | this.category_id = category_id; 27 | } 28 | 29 | public String getFeed_url() { 30 | return feed_url; 31 | } 32 | 33 | public void setFeed_url(String feed_url) { 34 | this.feed_url = feed_url; 35 | } 36 | 37 | @Override 38 | public String toString() { 39 | return "SubscribeToFeed{" + 40 | "op='" + op + '\'' + 41 | ", sid='" + sid + '\'' + 42 | ", category_id='" + category_id + '\'' + 43 | ", feed_url='" + feed_url + '\'' + 44 | '}'; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/ttrss/request/UnsubscribeFeed.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.ttrss.request; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | public class UnsubscribeFeed { 6 | private String sid; 7 | private String op = "unsubscribeFeed"; 8 | @SerializedName("feed_id") 9 | private int feedId; 10 | 11 | public UnsubscribeFeed(String sid) { 12 | this.sid = sid; 13 | } 14 | 15 | public String getOp() { 16 | return op; 17 | } 18 | 19 | public void setOp(String op) { 20 | this.op = op; 21 | } 22 | 23 | public String getSid() { 24 | return sid; 25 | } 26 | 27 | public void setSid(String sid) { 28 | this.sid = sid; 29 | } 30 | 31 | public int getFeedId() { 32 | return feedId; 33 | } 34 | 35 | public void setFeedId(int feedId) { 36 | this.feedId = feedId; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/ttrss/result/Attachment.java: -------------------------------------------------------------------------------- 1 | //package me.wizos.loreadx.bean.ttrss.result; 2 | // 3 | //public class Attachment { 4 | // private String content_url; 5 | // private String content_type; 6 | // 7 | // public String getContent_url() { 8 | // return content_url; 9 | // } 10 | // 11 | // public String getContent_type() { 12 | // return content_type; 13 | // } 14 | //} 15 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/ttrss/result/SubscribeToFeedResult.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.ttrss.result; 2 | 3 | public class SubscribeToFeedResult { 4 | private int code; 5 | private int feed_id; 6 | } 7 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/ttrss/result/TTRSSLoginResult.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.ttrss.result; 2 | 3 | public class TTRSSLoginResult { 4 | private String session_id; 5 | private int api_level; 6 | 7 | public String getSession_id() { 8 | return session_id; 9 | } 10 | 11 | public void setSession_id(String session_id) { 12 | this.session_id = session_id; 13 | } 14 | 15 | public int getApi_level() { 16 | return api_level; 17 | } 18 | 19 | public void setApi_level(int api_level) { 20 | this.api_level = api_level; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bean/ttrss/result/UpdateArticleResult.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bean.ttrss.result; 2 | 3 | public class UpdateArticleResult { 4 | private String status; 5 | private int updated; 6 | 7 | public String getStatus() { 8 | return status; 9 | } 10 | 11 | public void setStatus(String status) { 12 | this.status = status; 13 | } 14 | 15 | public int getUpdated() { 16 | return updated; 17 | } 18 | 19 | public void setUpdated(int updated) { 20 | this.updated = updated; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/bridge/WebBridge.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.bridge; 2 | 3 | public interface WebBridge { 4 | String TAG = "WebBridge"; 5 | void log(String msg); 6 | void toggleScreenOrientation(); 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/config/article_action_rule/Condition.java: -------------------------------------------------------------------------------- 1 | //package me.wizos.loread.config.article_action_rule; 2 | // 3 | //public class Condition { 4 | // private String target; 5 | // private String attr; 6 | // //private String type; // keyword, regex; js 7 | // private String judge; // 匹配正则,未匹配正则;包含关键词,未包含关键词 8 | // private String value; 9 | // 10 | // public String getTarget() { 11 | // return target; 12 | // } 13 | // 14 | // public void setTarget(String target) { 15 | // this.target = target; 16 | // } 17 | // 18 | // public String getAttr() { 19 | // return attr; 20 | // } 21 | // 22 | // public void setAttr(String attr) { 23 | // this.attr = attr; 24 | // } 25 | // 26 | // public String getJudge() { 27 | // return judge; 28 | // } 29 | // 30 | // public void setJudge(String judge) { 31 | // this.judge = judge; 32 | // } 33 | // 34 | // public String getValue() { 35 | // return value; 36 | // } 37 | // 38 | // public void setValue(String value) { 39 | // this.value = value; 40 | // } 41 | //} 42 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/config/article_extract_rule/ArticleExtractRule.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.config.article_extract_rule; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | public class ArticleExtractRule { 6 | private Selector selector = Selector.css; 7 | 8 | @SerializedName("document_trim") 9 | private String documentTrim; 10 | 11 | private String content; 12 | 13 | @SerializedName("content_strip") 14 | private String contentStrip; 15 | 16 | @SerializedName("content_trim") 17 | private String contentTrim; 18 | 19 | public Selector getSelector() { 20 | return selector; 21 | } 22 | 23 | public String getDocumentTrim() { 24 | return documentTrim; 25 | } 26 | 27 | public String getContent() { 28 | return content; 29 | } 30 | 31 | public void setContent(String content) { 32 | this.content = content; 33 | } 34 | 35 | public String getContentStrip() { 36 | return contentStrip; 37 | } 38 | 39 | public String getContentTrim() { 40 | return contentTrim; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/config/article_extract_rule/Selector.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.config.article_extract_rule; 2 | 3 | public enum Selector { 4 | css("css"),xpath("xpath"),regex("regex"); 5 | 6 | private String selector; 7 | 8 | Selector(String selector) { } 9 | 10 | public String getSelector() { 11 | return selector; 12 | } 13 | 14 | public void setSelector(String selector) { 15 | this.selector = selector; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/db/CategoryView.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.db; 2 | 3 | import androidx.room.DatabaseView; 4 | 5 | /** 6 | indices = {@Index({"id","uid","title"})} , 7 | * Created by Wizos on 2020/3/17. 8 | */ 9 | 10 | @DatabaseView( 11 | "SELECT CATEGORY.uid,id,title,UNREAD_SUM AS unreadCount,STAR_SUM AS starCount,ALL_SUM AS allCount FROM CATEGORY " + 12 | "LEFT JOIN " + 13 | "(" + 14 | " SELECT uid,categoryId,sum(UNREAD_SUM) AS UNREAD_SUM,sum(STAR_SUM) AS STAR_SUM,sum(ALL_SUM) AS ALL_SUM FROM " + 15 | " (" + 16 | " SELECT FEEDCATEGORY.uid,categoryId,feedId,UNREAD_SUM,STAR_SUM,ALL_SUM FROM FEEDCATEGORY " + 17 | " LEFT JOIN (SELECT uid,id,unreadCount AS UNREAD_SUM, starCount AS STAR_SUM, allCount AS ALL_SUM FROM feedview) AS FEED ON feedcategory.uid = FEED.uid AND feedcategory.feedId = FEED.ID " + 18 | " ) AS FeedCategoryCount GROUP BY uid,CATEGORYID " + 19 | ") AS C ON CATEGORY.uid = C.uid AND CATEGORY.ID = C.CATEGORYID " 20 | ) 21 | public class CategoryView extends Category{ 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/db/Collection.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.db; 2 | 3 | import me.wizos.loread.bean.feedly.CategoryItem; 4 | 5 | // Category 和 Feed 的抽象 6 | public class Collection { 7 | private String id; 8 | private String title; 9 | private int count; 10 | 11 | public String getId() { 12 | return this.id; 13 | } 14 | 15 | public void setId(String id) { 16 | this.id = id; 17 | } 18 | 19 | public String getTitle() { 20 | return this.title; 21 | } 22 | 23 | public void setTitle(String title) { 24 | this.title = title; 25 | } 26 | 27 | public int getCount() { 28 | return this.count; 29 | } 30 | 31 | public void setCount(int count) { 32 | this.count = count; 33 | } 34 | 35 | public CategoryItem convert2CategoryItem() { 36 | CategoryItem category = new CategoryItem(); 37 | category.setId(id); 38 | category.setLabel(title); 39 | return category; 40 | } 41 | 42 | @Override 43 | public String toString() { 44 | return "Collection{" + 45 | "id='" + id + '\'' + 46 | ", title='" + title + '\'' + 47 | ", count=" + count + 48 | '}'; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/db/Entry.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.db; 2 | 3 | public class Entry { 4 | private String id; 5 | private String entry; 6 | 7 | public String getId() { 8 | return id; 9 | } 10 | 11 | public void setId(String id) { 12 | this.id = id; 13 | } 14 | 15 | public String getEntry() { 16 | return entry; 17 | } 18 | 19 | public void setEntry(String entry) { 20 | this.entry = entry; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/db/FeedView.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.db; 2 | 3 | import androidx.room.DatabaseView; 4 | 5 | import me.wizos.loread.App; 6 | 7 | /** 8 | * Feed 与 Category 是 多对多关系,即一个 Feed 可以存在与多个 Category 中,Category 也可以包含多个 Feed 9 | * Created by Wizos on 2020/3/17. 10 | */ 11 | @DatabaseView( 12 | "SELECT uid,id,title,feedUrl,htmlUrl,iconUrl,displayMode,UNREAD_SUM AS unreadCount,STAR_SUM AS starCount,ALL_SUM AS allCount,state FROM FEED" + 13 | " LEFT JOIN (SELECT uid AS article_uid, feedId, COUNT(1) AS UNREAD_SUM FROM article WHERE readStatus != " + App.STATUS_READED + " GROUP BY uid,feedId) A ON FEED.uid = A.article_uid AND FEED.id = A.feedId" + 14 | " LEFT JOIN (SELECT uid AS article_uid, feedId, COUNT(1) AS STAR_SUM FROM article WHERE starStatus = " + App.STATUS_STARED + " GROUP BY uid,feedId) B ON FEED.uid = B.article_uid AND FEED.id = B.feedId" + 15 | " LEFT JOIN (SELECT uid AS article_uid, feedId, COUNT(1) AS ALL_SUM FROM article GROUP BY uid,feedId) C ON FEED.uid = c.article_uid AND FEED.id = C.feedId" 16 | ) 17 | public class FeedView extends Feed{ 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/db/TagDao.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.db; 2 | 3 | import androidx.lifecycle.LiveData; 4 | import androidx.room.Dao; 5 | import androidx.room.Delete; 6 | import androidx.room.Insert; 7 | import androidx.room.OnConflictStrategy; 8 | import androidx.room.Query; 9 | import androidx.room.Transaction; 10 | import androidx.room.Update; 11 | 12 | import java.util.List; 13 | 14 | @Dao 15 | public interface TagDao { 16 | @Query("SELECT * FROM tag WHERE uid = :uid ORDER BY title COLLATE NOCASE ASC") 17 | List getAll(String uid); 18 | 19 | @Query("SELECT * FROM tag WHERE uid = :uid ORDER BY title COLLATE NOCASE ASC") 20 | LiveData> getAllLiveData(String uid); 21 | 22 | 23 | @Query("SELECT * FROM tag WHERE uid = :uid AND id = :id LIMIT 1") 24 | Tag getById(String uid, String id); 25 | 26 | 27 | @Insert(onConflict = OnConflictStrategy.REPLACE) 28 | @Transaction 29 | void insert(Tag... tags); 30 | @Insert(onConflict = OnConflictStrategy.REPLACE) 31 | @Transaction 32 | void insert(List tags); 33 | 34 | @Update 35 | @Transaction 36 | void update(Tag... tags); 37 | 38 | @Update 39 | @Transaction 40 | void update(List tags); 41 | 42 | @Delete 43 | @Transaction 44 | void delete(Tag... tags); 45 | 46 | @Query("DELETE FROM tag WHERE uid = (:uid)") 47 | void clear(String... uid); 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/db/UserDao.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.db; 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.Transaction; 9 | import androidx.room.Update; 10 | 11 | import java.util.List; 12 | 13 | @Dao 14 | public interface UserDao { 15 | @Query("SELECT * FROM user") 16 | List loadAll(); 17 | 18 | @Query("SELECT * FROM user WHERE id = :uid LIMIT 1") 19 | User getById(String uid); 20 | 21 | @Insert(onConflict = OnConflictStrategy.REPLACE) 22 | @Transaction 23 | void insert(User... users); 24 | 25 | @Update 26 | @Transaction 27 | void update(User... Users); 28 | 29 | @Delete 30 | @Transaction 31 | void delete(User... users); 32 | 33 | @Query("DELETE FROM user WHERE id = (:uid)") 34 | @Transaction 35 | void delete(String... uid); 36 | 37 | @Query("DELETE FROM user") 38 | @Transaction 39 | void clear(); 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/gson/GsonEnum.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.gson; 2 | 3 | public interface GsonEnum { 4 | String serialize(); 5 | E deserialize(String jsonEnum); 6 | } -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/gson/GsonEnumTypeAdapter.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.gson; 2 | 3 | import com.google.gson.JsonDeserializationContext; 4 | import com.google.gson.JsonDeserializer; 5 | import com.google.gson.JsonElement; 6 | import com.google.gson.JsonParseException; 7 | import com.google.gson.JsonPrimitive; 8 | import com.google.gson.JsonSerializationContext; 9 | import com.google.gson.JsonSerializer; 10 | 11 | import java.lang.reflect.Type; 12 | 13 | public class GsonEnumTypeAdapter implements JsonSerializer, JsonDeserializer { 14 | 15 | private final GsonEnum gsonEnum; 16 | 17 | public GsonEnumTypeAdapter(GsonEnum gsonEnum) { 18 | this.gsonEnum = gsonEnum; 19 | } 20 | 21 | @Override 22 | public JsonElement serialize(E src, Type typeOfSrc, JsonSerializationContext context) { 23 | if (null != src && src instanceof GsonEnum) { 24 | return new JsonPrimitive(((GsonEnum) src).serialize()); 25 | } 26 | return null; 27 | } 28 | 29 | @Override 30 | public E deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { 31 | if (null != json) { 32 | return gsonEnum.deserialize(json.getAsString()); 33 | } 34 | return null; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/gson/GsonUtil.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.gson; 2 | 3 | import com.google.gson.Gson; 4 | import com.google.gson.reflect.TypeToken; 5 | 6 | import java.io.InputStream; 7 | import java.io.InputStreamReader; 8 | import java.io.UnsupportedEncodingException; 9 | 10 | /** 11 | * author Wizos 12 | * created 2019/8/3 13 | */ 14 | public class GsonUtil { 15 | private static Gson gson = new Gson(); 16 | 17 | public static T fromJson(InputStream inputStream, TypeToken token) { 18 | try { 19 | return gson.fromJson(new InputStreamReader(inputStream, "UTF-8"), token.getType()); 20 | } catch (UnsupportedEncodingException e) { 21 | e.printStackTrace(); 22 | } 23 | return null; 24 | } 25 | 26 | public static T fromJson(String jsonText, TypeToken token) { 27 | try { 28 | return gson.fromJson(jsonText, token.getType()); 29 | } catch (Exception e) { 30 | e.printStackTrace(); 31 | } 32 | return null; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/network/StringConverterFactory.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.network; 2 | 3 | import java.io.IOException; 4 | import java.lang.annotation.Annotation; 5 | import java.lang.reflect.Type; 6 | 7 | import okhttp3.ResponseBody; 8 | import retrofit2.Converter; 9 | import retrofit2.Retrofit; 10 | 11 | public class StringConverterFactory extends Converter.Factory { 12 | //工厂方法,用于创建实例 13 | public static StringConverterFactory create() { 14 | return new StringConverterFactory(); 15 | } 16 | 17 | //response返回到本地后会被调用,这里先判断是否要拦截处理,不拦截则返回null 18 | // 判断是否处理的依据就是type参数,type就是上面接口出现的List了 19 | @Override 20 | public Converter responseBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit) { 21 | // KLog.e("响应的类型:" + type ); 22 | if (type == String.class) { 23 | return new StringBodyConverter(); 24 | } 25 | //如果返回null则不处理,交给别的Converter处理 26 | return null; 27 | } 28 | 29 | // 一个Converter类,T就是上面接口中的List了 30 | private static class StringBodyConverter implements Converter { 31 | StringBodyConverter() {} 32 | //在这个方法中处理response 33 | @Override 34 | public T convert(ResponseBody value) throws IOException { 35 | return (T) value.string(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/network/SyncWorker.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.network; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.annotation.NonNull; 6 | import androidx.work.Worker; 7 | import androidx.work.WorkerParameters; 8 | 9 | import com.jeremyliao.liveeventbus.LiveEventBus; 10 | 11 | import me.wizos.loread.App; 12 | import me.wizos.loread.utils.NetworkUtil; 13 | 14 | public class SyncWorker extends Worker { 15 | public final static String TAG = "SyncWorker"; 16 | public final static String SYNC_TASK_STATUS = "SyncStatus"; 17 | public final static String SYNC_PROCESS_FOR_SUBTITLE = "SyncProcess"; 18 | public final static String NEW_ARTICLE_NUMBER = "NewArticleNumber"; 19 | public SyncWorker(@NonNull Context context, @NonNull WorkerParameters workerParams) { 20 | super(context, workerParams); 21 | } 22 | 23 | @NonNull 24 | @Override 25 | public Result doWork() { 26 | if(!App.i().getUser().isAutoSync() || (App.i().getUser().isAutoSyncOnlyWifi() && !NetworkUtil.isWiFiUsed()) ){ 27 | return Result.success(); 28 | } 29 | LiveEventBus.get(SyncWorker.SYNC_TASK_STATUS).post(true); 30 | App.i().getApi().sync(); 31 | LiveEventBus.get(SyncWorker.SYNC_TASK_STATUS).post(false); 32 | return Result.success(); 33 | } 34 | 35 | @Override 36 | public void onStopped() { 37 | super.onStopped(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/network/api/AuthApi.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.network.api; 2 | 3 | public abstract class AuthApi extends BaseApi { 4 | private String authorization; 5 | public void setAuthorization(String authorization){ 6 | this.authorization = authorization; 7 | } 8 | public String getAuthorization(){ 9 | return authorization; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/network/api/LoginInterface.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.network.api; 2 | import me.wizos.loread.network.callback.CallbackX; 3 | 4 | public interface LoginInterface { 5 | void login(String accountId, String accountPd, CallbackX cb); 6 | } 7 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/network/api/OAuthApi.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.network.api; 2 | 3 | import java.io.IOException; 4 | 5 | import me.wizos.loread.network.callback.CallbackX; 6 | 7 | public abstract class OAuthApi extends AuthApi { 8 | 9 | abstract public String getOAuthUrl(); 10 | 11 | /** 12 | * 获取access_token,refresh_token,expires_in 13 | * 14 | * @param authorizationCode 15 | * @return 16 | * @throws IOException 17 | */ 18 | //abstract public String getAccessToken(String authorizationCode) throws IOException; 19 | abstract public void getAccessToken(String authorizationCode, CallbackX cb); 20 | /** 21 | * 刷新access_token,refresh_token,expires_in 22 | * 23 | * @return 24 | * @throws IOException 25 | */ 26 | abstract public String refreshingAccessToken(String refreshToken) throws IOException; 27 | abstract public void refreshingAccessToken(String refreshToken, CallbackX cb); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/network/callback/CallbackX.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.network.callback; 2 | 3 | /** 4 | * Created by Wizos on 2019/11/24. 5 | */ 6 | 7 | public interface CallbackX { 8 | void onSuccess(T result); 9 | void onFailure(E error); 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/network/interceptor/InoreaderHeaderInterceptor.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.network.interceptor; 2 | 3 | import org.jetbrains.annotations.NotNull; 4 | 5 | import java.io.IOException; 6 | 7 | import me.wizos.loread.network.api.InoReaderApi; 8 | import okhttp3.Interceptor; 9 | import okhttp3.Request; 10 | import okhttp3.Response; 11 | 12 | public class InoreaderHeaderInterceptor implements Interceptor { 13 | @NotNull 14 | @Override 15 | public Response intercept(Chain chain) throws IOException { 16 | Request.Builder builder = chain.request().newBuilder(); 17 | builder.addHeader("AppId", InoReaderApi.APP_ID); 18 | builder.addHeader("AppKey", InoReaderApi.APP_KEY); 19 | return chain.proceed(builder.build()); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/network/interceptor/RedirectInterceptor.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.network.interceptor; 2 | 3 | import android.text.TextUtils; 4 | 5 | import java.io.IOException; 6 | 7 | import me.wizos.loread.config.LinkRewriteConfig; 8 | import okhttp3.Interceptor; 9 | import okhttp3.Request; 10 | import okhttp3.Response; 11 | 12 | /** 13 | * 域名重定向 拦截器 14 | * 15 | * @author Wizos 16 | * @version 1.0 17 | * @date 2019/4/2 18 | */ 19 | 20 | public class RedirectInterceptor implements Interceptor { 21 | @Override 22 | public Response intercept(Chain chain) throws IOException { 23 | Request request = chain.request(); 24 | String newUrl = LinkRewriteConfig.i().getRedirectUrl( request.url().toString() ); 25 | if (!TextUtils.isEmpty(newUrl)) { 26 | // 创建一个新请求,并相应地修改它 27 | request = request.newBuilder().url(newUrl).build(); 28 | } 29 | return chain.proceed(request); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/network/interceptor/RefererInterceptor.java: -------------------------------------------------------------------------------- 1 | //package me.wizos.loread.network.interceptor; 2 | // 3 | //import androidx.annotation.NonNull; 4 | // 5 | //import com.socks.library.KLog; 6 | // 7 | //import java.io.IOException; 8 | // 9 | //import me.wizos.loread.config.RefererRule; 10 | //import me.wizos.loread.utils.StringUtils; 11 | //import okhttp3.Interceptor; 12 | //import okhttp3.Request; 13 | //import okhttp3.Response; 14 | // 15 | ///** 16 | // * Referer 拦截器 17 | // * 用于给指定网站增加referer 18 | // * 19 | // * @author Wizos 20 | // * @version 1.0 21 | // * @date 2019/4/2 22 | // */ 23 | // 24 | //public class RefererInterceptor implements Interceptor { 25 | // @Override 26 | // @NonNull 27 | // public Response intercept(Chain chain) throws IOException { 28 | // Request request = chain.request(); 29 | // String referer = RefererRule.i().guessRefererByUrl(request.url().toString()); 30 | // if (!StringUtils.isEmpty(referer)) { 31 | // request = request.newBuilder().header("referer", referer).build(); 32 | // } 33 | // KLog.i("拦截到的referer:" + request.url().toString() + " , " + referer ); 34 | // return chain.proceed(request); 35 | // } 36 | //} 37 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/service/NetworkStateReceiver.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.service; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.net.ConnectivityManager; 7 | 8 | import com.socks.library.KLog; 9 | 10 | import me.wizos.loread.utils.NetworkUtil; 11 | 12 | 13 | /** 14 | * Android 7.0 移除了三项隐式广播,因为隐式广播会在后台频繁启动已注册侦听这些广播的应用。删除这些广播可以显著提升设备性能和用户体验。 15 | * Android 7.0 以上不会收到 CONNECTIVITY_ACTION 广播,即使它们已有清单条目来请求接受这些事件的通知。 16 | * 在前台运行的应用如果使用 BroadcastReceiver 请求接收通知,则仍可以在主线程中侦听 CONNECTIVITY_CHANGE。 17 | *

18 | * Android 7.0 为了后台优化,推荐使用 JobScheduler 代替 BroadcastReceiver 来监听网络变化。 19 | * 20 | * @author Wizos on 2018/6/5. 21 | */ 22 | 23 | public class NetworkStateReceiver extends BroadcastReceiver { 24 | @Override 25 | public void onReceive(Context context, Intent intent) { 26 | KLog.e("接收到网络变化" + intent.getAction() + " . " + NetworkUtil.getNetWorkState()); 27 | if (ConnectivityManager.CONNECTIVITY_ACTION.equals(intent.getAction())) { 28 | NetworkUtil.getNetWorkState(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/utils/EncryptUtil.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.utils; 2 | 3 | import java.nio.charset.StandardCharsets; 4 | import java.security.MessageDigest; 5 | import java.security.NoSuchAlgorithmException; 6 | /** 7 | * 加密工具类 8 | * @author by Wizos on 2020/2/26. 9 | */ 10 | public class EncryptUtil { 11 | /** 12 | * 将字符串转成MD5值 13 | * 14 | * @param string 字符串 15 | * @return MD5 后的字符串 16 | */ 17 | public static String MD5(String string) { 18 | byte[] hash; 19 | try { 20 | hash = MessageDigest.getInstance("MD5").digest(string.getBytes(StandardCharsets.UTF_8)); 21 | } catch (NoSuchAlgorithmException e) { 22 | e.printStackTrace(); 23 | return null; 24 | } 25 | StringBuilder hex = new StringBuilder(hash.length * 2); 26 | for (byte b : hash) { 27 | if ((b & 0xFF) < 0x10) { 28 | hex.append("0"); 29 | } 30 | hex.append(Integer.toHexString(b & 0xFF)); 31 | } 32 | return hex.toString(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/utils/ImgFileType.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.utils; 2 | 3 | /** 4 | * Created by jiangzeyin on 2017/3/15. 5 | */ 6 | public enum ImgFileType { 7 | 8 | /** 9 | * JPEG,JPG 10 | */ 11 | JPEG("FFD8FF", "jpg"), 12 | 13 | /** 14 | * PNG 15 | */ 16 | PNG("89504E47", "png"), 17 | 18 | /** 19 | * GIF 20 | */ 21 | GIF("47494638", "gif"), 22 | 23 | /** 24 | * TIFF 25 | */ 26 | TIFF("49492A00"), 27 | 28 | /** 29 | * Windows bitmap 30 | */ 31 | BMP("424D"), 32 | 33 | 34 | WEBP("52494646"), 35 | 36 | /** 37 | * svg,还有一种是xml文件头 38 | */ 39 | SVG("3C73766720"); 40 | 41 | private String value = ""; 42 | private String ext = ""; 43 | 44 | ImgFileType(String value) { 45 | this.value = value; 46 | } 47 | 48 | ImgFileType(String value, String ext) { 49 | this(value); 50 | this.ext = ext; 51 | } 52 | 53 | public String getExt() { 54 | return ext; 55 | } 56 | 57 | public String getValue() { 58 | return value; 59 | } 60 | 61 | } -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/utils/RGB.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.utils; 2 | 3 | /** 4 | * Created by Wizos on 2018/7/10. 5 | */ 6 | 7 | public class RGB { 8 | int r; 9 | int g; 10 | int b; 11 | 12 | public RGB(int r, int g, int b) { 13 | this.r = r; 14 | this.g = g; 15 | this.b = b; 16 | } 17 | 18 | @Override 19 | public String toString() { 20 | return "RGB{" + 21 | "r=" + r + 22 | ", g=" + g + 23 | ", b=" + b + 24 | '}'; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/utils/ScriptUtil.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.utils; 2 | 3 | import com.socks.library.KLog; 4 | 5 | import javax.script.Bindings; 6 | import javax.script.ScriptEngine; 7 | import javax.script.ScriptEngineManager; 8 | import javax.script.ScriptException; 9 | 10 | 11 | public class ScriptUtil { 12 | private static ScriptUtil instance; 13 | private static ScriptEngine engine; 14 | private ScriptUtil() { } 15 | 16 | public static synchronized ScriptUtil init() { 17 | if (instance == null) { 18 | synchronized (ScriptUtil.class) { 19 | if (instance == null) { 20 | instance = new ScriptUtil(); 21 | engine = new ScriptEngineManager().getEngineByName("rhino"); 22 | } 23 | } 24 | } 25 | return instance; 26 | } 27 | 28 | public static ScriptUtil i(){ 29 | if( instance == null ){ 30 | init(); 31 | } 32 | return instance; 33 | } 34 | 35 | public boolean eval(String js, Bindings bindings){ 36 | try { 37 | engine.eval(js, bindings); 38 | return true; 39 | } catch (ScriptException e) { 40 | KLog.e("脚本执行错误" + e.getMessage() + "," +e.getFileName() + ","+ e.getColumnNumber() + "," + e.getLineNumber() ); 41 | e.printStackTrace(); 42 | return false; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/utils/VideoInjectUtil.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.utils; 2 | 3 | import me.wizos.loread.bridge.WebBridge; 4 | 5 | /** 6 | * @author by Wizos on 2018/6/29. 7 | */ 8 | 9 | public class VideoInjectUtil { 10 | /** 11 | * 注入全屏Js,对不同的视频网站分析相应的全屏控件——class标识 12 | * 13 | * @param url 加载的网页地址 14 | * @return 注入的js内容,若不是需要适配的网址则返回空javascript 15 | */ 16 | public static String fullScreenJsFun(String url) { 17 | String fullScreenFlags = null; 18 | // http://v.qq.com/txp/iframe/player.html?vid=v0151eygqka、http://v.qq.com/iframe/player.html?vid=v0151eygqka 19 | if (url.contains("qq.com/txp/iframe/player.html")) { 20 | fullScreenFlags = "txp_btn_fullscreen"; 21 | } else if (url.contains("sohu")) { 22 | fullScreenFlags = "x-fs-btn"; 23 | } else if (url.contains("letv")) { 24 | fullScreenFlags = "hv_ico_screen"; 25 | } 26 | if (null != fullScreenFlags) { 27 | return "javascript:document.getElementsByClassName('" + fullScreenFlags + "')[0].addEventListener('click',function(){" + WebBridge.TAG + ".toggleScreenOrientation();return false;});"; 28 | } else { 29 | return "javascript:"; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/view/IconFontView.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.view; 2 | 3 | import android.content.Context; 4 | import android.graphics.Typeface; 5 | import android.util.AttributeSet; 6 | 7 | import androidx.appcompat.widget.AppCompatTextView; 8 | 9 | 10 | /** 11 | * Created by Wizos on 2016/11/6. 12 | */ 13 | 14 | public class IconFontView extends AppCompatTextView { 15 | 16 | public IconFontView(Context context) { 17 | super(context); 18 | init(); 19 | } 20 | 21 | public IconFontView(Context context, AttributeSet attrs) { 22 | super(context, attrs); 23 | init(); 24 | } 25 | 26 | public IconFontView(Context context, AttributeSet attrs, int defStyleAttr) { 27 | super(context, attrs, defStyleAttr); 28 | init(); 29 | } 30 | 31 | private void init() { 32 | Typeface iconFont = Typeface.createFromAsset(getContext().getAssets(), "iconfont.ttf"); 33 | this.setTypeface(iconFont); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/view/colorful/StatusBarView.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.view.colorful; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.view.View; 6 | 7 | /** 8 | * Created by Jaeger on 16/6/8. 9 | *

10 | * Email: chjie.jaeger@gmail.com 11 | * GitHub: https://github.com/laobie 12 | */ 13 | public class StatusBarView extends View { 14 | public StatusBarView(Context context, AttributeSet attrs) { 15 | super(context, attrs); 16 | } 17 | 18 | public StatusBarView(Context context) { 19 | super(context); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/view/colorful/setter/TextColorSetter.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.view.colorful.setter; 2 | 3 | import android.content.res.Resources.Theme; 4 | import android.widget.TextView; 5 | 6 | /** 7 | * TextView 文本颜色Setter 8 | * 9 | * @author mrsimple 10 | */ 11 | public class TextColorSetter extends ViewSetter { 12 | 13 | public TextColorSetter(TextView textView, int resId) { 14 | super(textView, resId); 15 | } 16 | 17 | public TextColorSetter(int viewId, int resId) { 18 | super(viewId, resId); 19 | } 20 | 21 | @Override 22 | public void setValue(Theme newTheme, int themeId) { 23 | if (mView == null) { 24 | return; 25 | } 26 | ((TextView) mView).setTextColor(getColor(newTheme)); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/view/colorful/setter/ViewBackgroundColorSetter.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.view.colorful.setter; 2 | 3 | import android.content.res.Resources.Theme; 4 | import android.view.View; 5 | 6 | /** 7 | * View的背景色Setter 8 | * 9 | * @author mrsimple 10 | */ 11 | public class ViewBackgroundColorSetter extends ViewSetter { 12 | 13 | public ViewBackgroundColorSetter(View target, int resId) { 14 | super(target, resId); 15 | } 16 | 17 | public ViewBackgroundColorSetter(int viewId, int resId) { 18 | super(viewId, resId); 19 | } 20 | 21 | @Override 22 | public void setValue(Theme newTheme, int themeId) { 23 | if (mView != null) { 24 | int alpha = 255; 25 | if (mView.getBackground() != null) { 26 | alpha = mView.getBackground().getAlpha();// 自加。保留透明度信息。 27 | } 28 | mView.setBackgroundColor(getColor(newTheme)); 29 | mView.getBackground().setAlpha(alpha);// 自加。保留透明度信息。 30 | } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/view/colorful/setter/ViewBackgroundDrawableSetter.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.view.colorful.setter; 2 | 3 | import android.content.res.Resources.Theme; 4 | import android.content.res.TypedArray; 5 | import android.graphics.drawable.Drawable; 6 | import android.view.View; 7 | 8 | /** 9 | * View的背景Drawabler Setter 10 | * 11 | * @author mrsimple 12 | */ 13 | public final class ViewBackgroundDrawableSetter extends ViewSetter { 14 | 15 | public ViewBackgroundDrawableSetter(View targetView, int resId) { 16 | super(targetView, resId); 17 | } 18 | 19 | 20 | public ViewBackgroundDrawableSetter(int viewId, int resId) { 21 | super(viewId, resId); 22 | } 23 | 24 | @SuppressWarnings("deprecation") 25 | @Override 26 | public void setValue(Theme newTheme, int themeId) { 27 | if (mView == null) { 28 | return; 29 | } 30 | TypedArray a = newTheme.obtainStyledAttributes(themeId, 31 | new int[]{mAttrResId}); 32 | int attributeResourceId = a.getResourceId(0, 0); 33 | Drawable drawable = mView.getResources().getDrawable( 34 | attributeResourceId); 35 | a.recycle(); 36 | mView.setBackgroundDrawable(drawable); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/view/slideback/callback/SlideBackCallBack.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.view.slideback.callback; 2 | 3 | public interface SlideBackCallBack { 4 | void onSlideBack(); 5 | // void onViewSlideUpdate(int offset); 6 | } -------------------------------------------------------------------------------- /app/src/main/java/me/wizos/loread/view/slideback/callback/SlideCallBack.java: -------------------------------------------------------------------------------- 1 | package me.wizos.loread.view.slideback.callback; 2 | 3 | public abstract class SlideCallBack implements SlideBackCallBack { 4 | private SlideBackCallBack callBack; 5 | 6 | public SlideCallBack() { 7 | } 8 | 9 | public SlideCallBack(SlideBackCallBack callBack) { 10 | this.callBack = callBack; 11 | } 12 | 13 | @Override 14 | public void onSlideBack() { 15 | if (null != callBack) { 16 | callBack.onSlideBack(); 17 | } 18 | } 19 | // @Override 20 | // public void onViewSlideUpdate(int offset) { 21 | // if (null != callBack) { 22 | // callBack.onViewSlideUpdate(offset); 23 | // } 24 | // } 25 | 26 | /** 27 | * 滑动来源:
28 | * EDGE_LEFT 左侧侧滑
29 | * EDGE_RIGHT 右侧侧滑
30 | */ 31 | public abstract void onSlide(int edgeFrom); 32 | 33 | public abstract void onViewSlide(int edgeFrom, int offset); 34 | } -------------------------------------------------------------------------------- /app/src/main/res/anim/fade_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/anim/fade_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/anim/in_from_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/anim/out_from_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v23/logo_feedly_icon.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v23/logo_inoreader_icon.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v23/logo_ttrss_icon.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/corners_bg_checked.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/corners_bg_uncheck.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/custom_progress_bar_thumb.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/custom_thumb_src.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/flyme_style_switch_button_rectangle.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 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/flyme_style_switch_button_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_arrow_right.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_browser.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_close.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_copy_link.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_eye.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_favor.xml: -------------------------------------------------------------------------------- 1 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_favor_fill.xml: -------------------------------------------------------------------------------- 1 | 4 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_mark_down.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_mark_unread.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_mark_up.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_music.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_panorama.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_read.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_refresh.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_rename.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_share.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_state_all.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_state_star.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_state_unread.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_state_unstar.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_stop_loading.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_unsubscribe.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_user_agent.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_volume.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wizos/loread/bec024a07bee7bc4a7ac36970fd2e0aa253b4236/app/src/main/res/drawable/logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/logo_tinytinyrss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wizos/loread/bec024a07bee7bc4a7ac36970fd2e0aa253b4236/app/src/main/res/drawable/logo_tinytinyrss.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/progress_bg.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/seekbar_audio.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 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/selector_corners_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/selector_star.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/splash_layers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/textview_border_day.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/textview_border_night.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_search_list_header_result_count.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/layout/config_download_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 18 | 19 | 27 | 28 | 36 | -------------------------------------------------------------------------------- /app/src/main/res/layout/md_simplelist_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 23 | 24 | 25 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/layout/setting_item_session.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/layout/setting_item_switch.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 21 | 22 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_article.xml: -------------------------------------------------------------------------------- 1 |

5 | 6 | 13 | 14 | 20 | 26 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wizos/loread/bec024a07bee7bc4a7ac36970fd2e0aa253b4236/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wizos/loread/bec024a07bee7bc4a7ac36970fd2e0aa253b4236/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wizos/loread/bec024a07bee7bc4a7ac36970fd2e0aa253b4236/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wizos/loread/bec024a07bee7bc4a7ac36970fd2e0aa253b4236/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wizos/loread/bec024a07bee7bc4a7ac36970fd2e0aa253b4236/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | @color/white 8 | @color/dark_background 9 | 10 | 11 | 0 12 | 1 13 | 3 14 | 7 15 | 15 16 | 30 17 | 18 | 19 | 20 | 15 21 | 30 22 | 60 23 | 180 24 | 360 25 | 720 26 | 27 | 28 | 29 | 0 30 | 1 31 | 2 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/values/attrs.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 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 16dp 6 | 140dip 7 | 8sp 8 | 36dp 9 | 36dp 10 | 40dp 11 | 80dp 12 | 30dp 13 | 40dp 14 | 180dp 15 | 16dp 16 | 40dp 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/xml/account_authenticator.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/xml/account_preferences.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/xml/account_sync_adapter.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/xml/network_security_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | 4 | buildscript { 5 | repositories { 6 | maven { url "https://jitpack.io" } 7 | maven { url 'https://maven.google.com/' } 8 | google() 9 | jcenter() 10 | } 11 | dependencies { 12 | classpath 'com.android.tools.build:gradle:4.0.1' 13 | classpath fileTree(dir: 'plugin', include: ['*.jar']) 14 | } 15 | } 16 | 17 | allprojects { 18 | repositories { 19 | google() 20 | maven {url 'https://maven.google.com/'} 21 | jcenter() 22 | maven { url "https://jitpack.io" } 23 | // maven { url 'https://maven.aliyun.com/repository/google'} 24 | // maven { url 'https://maven.aliyun.com/repository/jcenter'} 25 | // maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' } 26 | // maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' } 27 | // maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' } 28 | // maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' } 29 | } 30 | } 31 | 32 | task clean(type: Delete) { 33 | delete rootProject.buildDir 34 | } 35 | -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "app": { 3 | "version": 13, 4 | "versionName": "2.3", 5 | "url": "http://wizos.me/test.apk", 6 | "content": "测试升级" 7 | } 8 | } -------------------------------------------------------------------------------- /doc/overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wizos/loread/bec024a07bee7bc4a7ac36970fd2e0aa253b4236/doc/overview.png -------------------------------------------------------------------------------- /floatwindow/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /src/androidTest/ 3 | /src/test/ 4 | -------------------------------------------------------------------------------- /floatwindow/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 28 5 | buildToolsVersion "28.0.3" 6 | 7 | 8 | defaultConfig { 9 | minSdkVersion 22 10 | targetSdkVersion 28 11 | versionCode 1 12 | versionName "1.0" 13 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 14 | 15 | } 16 | 17 | buildTypes { 18 | release { 19 | minifyEnabled false 20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 21 | } 22 | } 23 | 24 | } 25 | 26 | dependencies { 27 | implementation fileTree(dir: 'libs', include: ['*.jar']) 28 | androidTestImplementation('androidx.test.espresso:espresso-core:3.2.0', { 29 | exclude group: 'com.android.support', module: 'support-annotations' 30 | }) 31 | implementation 'androidx.appcompat:appcompat:1.1.0' 32 | testImplementation 'junit:junit:4.13' 33 | } 34 | 35 | -------------------------------------------------------------------------------- /floatwindow/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard replaceUrl 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 22 | -------------------------------------------------------------------------------- /floatwindow/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 10 | 11 | -------------------------------------------------------------------------------- /floatwindow/src/main/java/com/yhao/floatwindow/adaptation/Rom.java: -------------------------------------------------------------------------------- 1 | package com.yhao.floatwindow.adaptation; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.content.pm.PackageManager; 6 | 7 | import java.io.BufferedReader; 8 | import java.io.IOException; 9 | import java.io.InputStreamReader; 10 | 11 | /** 12 | * Created by yhao on 2017/12/30. 13 | * https://github.com/yhaolpz 14 | */ 15 | 16 | class Rom { 17 | 18 | static boolean isIntentAvailable(Intent intent, Context context) { 19 | return intent != null && context.getPackageManager().queryIntentActivities( 20 | intent, PackageManager.MATCH_DEFAULT_ONLY).size() > 0; 21 | } 22 | 23 | 24 | static String getProp(String name) { 25 | BufferedReader input = null; 26 | try { 27 | Process p = Runtime.getRuntime().exec("getprop " + name); 28 | input = new BufferedReader(new InputStreamReader(p.getInputStream()), 1024); 29 | String line = input.readLine(); 30 | input.close(); 31 | return line; 32 | } catch (IOException ex) { 33 | return null; 34 | } finally { 35 | if (input != null) { 36 | try { 37 | input.close(); 38 | } catch (IOException e) { 39 | e.printStackTrace(); 40 | } 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /floatwindow/src/main/java/com/yhao/floatwindow/constant/MoveType.java: -------------------------------------------------------------------------------- 1 | package com.yhao.floatwindow.constant; 2 | 3 | import androidx.annotation.IntDef; 4 | 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | 8 | /** 9 | * Created by yhao on 2017/12/22. 10 | * https://github.com/yhaolpz 11 | */ 12 | 13 | public class MoveType { 14 | public static final int fixed = 0; 15 | // 不可拖动 16 | public static final int inactive = 1; 17 | // 可拖动 18 | public static final int active = 2; 19 | // 可拖动,释放后自动贴边 (默认) 20 | public static final int slide = 3; 21 | // 可拖动,释放后自动回到原位置 22 | public static final int back = 4; 23 | 24 | @IntDef({fixed, inactive, active, slide, back}) 25 | @Retention(RetentionPolicy.SOURCE) 26 | public @interface MOVE_TYPE { 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /floatwindow/src/main/java/com/yhao/floatwindow/constant/Screen.java: -------------------------------------------------------------------------------- 1 | package com.yhao.floatwindow.constant; 2 | 3 | import androidx.annotation.IntDef; 4 | 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | 8 | /** 9 | * Created by yhao on 2017/12/23. 10 | * https://github.com/yhaolpz 11 | */ 12 | 13 | public class Screen { 14 | public static final int width = 0; 15 | public static final int height = 1; 16 | 17 | @IntDef({width, height}) 18 | @Retention(RetentionPolicy.SOURCE) 19 | public @interface screenType { 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /floatwindow/src/main/java/com/yhao/floatwindow/interfaces/FloatView.java: -------------------------------------------------------------------------------- 1 | package com.yhao.floatwindow.interfaces; 2 | 3 | import android.view.View; 4 | 5 | /** 6 | * Created by yhao on 17-11-14. 7 | * https://github.com/yhaolpz 8 | */ 9 | 10 | public interface FloatView { 11 | 12 | void setSize(int width, int height); 13 | 14 | void setView(View view); 15 | 16 | void setGravity(int gravity, int xOffset, int yOffset); 17 | 18 | void init(); 19 | 20 | void dismiss(); 21 | 22 | void updateXY(int x, int y); 23 | 24 | void updateX(int x); 25 | 26 | void updateY(int y); 27 | 28 | int getX(); 29 | 30 | int getY(); 31 | } 32 | -------------------------------------------------------------------------------- /floatwindow/src/main/java/com/yhao/floatwindow/interfaces/IFloatWindow.java: -------------------------------------------------------------------------------- 1 | package com.yhao.floatwindow.interfaces; 2 | 3 | import com.yhao.floatwindow.constant.Screen; 4 | 5 | /** 6 | * Created by yhao on 2017/12/22. 7 | * https://github.com/yhaolpz 8 | */ 9 | 10 | public interface IFloatWindow { 11 | void showByUser(); 12 | 13 | void hideByUser(); 14 | 15 | boolean isShowing(); 16 | 17 | int getX(); 18 | 19 | int getY(); 20 | 21 | void updateX(int x); 22 | 23 | void updateX(@Screen.screenType int screenType, float ratio); 24 | 25 | void updateY(int y); 26 | 27 | void updateY(@Screen.screenType int screenType, float ratio); 28 | 29 | void dismiss(); 30 | } 31 | -------------------------------------------------------------------------------- /floatwindow/src/main/java/com/yhao/floatwindow/interfaces/LifecycleListener.java: -------------------------------------------------------------------------------- 1 | package com.yhao.floatwindow.interfaces; 2 | 3 | /** 4 | * 5 | * @author yhao 6 | * @date 2017/12/22 7 | * https://github.com/yhaolpz 8 | */ 9 | 10 | public interface LifecycleListener { 11 | 12 | void onShow(); 13 | 14 | void onHide(); 15 | 16 | void onBackToDesktop(); 17 | 18 | void onPortrait(); 19 | 20 | void onLandscape(); 21 | } 22 | -------------------------------------------------------------------------------- /floatwindow/src/main/java/com/yhao/floatwindow/interfaces/PermissionListener.java: -------------------------------------------------------------------------------- 1 | package com.yhao.floatwindow.interfaces; 2 | 3 | /** 4 | * Created by yhao on 2017/11/14. 5 | * https://github.com/yhaolpz 6 | */ 7 | public interface PermissionListener { 8 | // void onReady(); 9 | void onSuccess(); 10 | void onFail(); 11 | } 12 | -------------------------------------------------------------------------------- /floatwindow/src/main/java/com/yhao/floatwindow/interfaces/ResumedListener.java: -------------------------------------------------------------------------------- 1 | package com.yhao.floatwindow.interfaces; 2 | 3 | /** 4 | * Created by yhao on 2017/12/30. 5 | * https://github.com/yhaolpz 6 | */ 7 | 8 | public interface ResumedListener { 9 | void onResumed(); 10 | } 11 | -------------------------------------------------------------------------------- /floatwindow/src/main/java/com/yhao/floatwindow/interfaces/ViewStateListener.java: -------------------------------------------------------------------------------- 1 | package com.yhao.floatwindow.interfaces; 2 | 3 | /** 4 | * Created by yhao on 2018/5/5 5 | * https://github.com/yhaolpz 6 | */ 7 | public interface ViewStateListener { 8 | void onPositionUpdate(int x, int y); 9 | 10 | void onShow(); 11 | 12 | void onHide(); 13 | 14 | void onShowByUser(); 15 | 16 | void onHideByUser(); 17 | 18 | void onDismiss(); 19 | 20 | void onMoveAnimStart(); 21 | 22 | void onMoveAnimEnd(); 23 | 24 | void onBackToDesktop(); 25 | } 26 | -------------------------------------------------------------------------------- /floatwindow/src/main/java/com/yhao/floatwindow/util/ActivityCounter.java: -------------------------------------------------------------------------------- 1 | package com.yhao.floatwindow.util; 2 | 3 | import android.app.Activity; 4 | import android.app.Application; 5 | import android.os.Bundle; 6 | 7 | /** 8 | * Created by Wizos on 2019/6/2. 9 | */ 10 | 11 | public class ActivityCounter implements Application.ActivityLifecycleCallbacks { 12 | private static int startCount; 13 | private static int resumeCount; 14 | 15 | @Override 16 | public void onActivityResumed(Activity activity) { 17 | } 18 | 19 | @Override 20 | public void onActivityPaused(final Activity activity) { 21 | resumeCount--; 22 | } 23 | 24 | @Override 25 | public void onActivityStarted(Activity activity) { 26 | startCount++; 27 | } 28 | 29 | @Override 30 | public void onActivityStopped(Activity activity) { 31 | startCount--; 32 | } 33 | 34 | @Override 35 | public void onActivityCreated(Activity activity, Bundle savedInstanceState) { 36 | } 37 | 38 | @Override 39 | public void onActivitySaveInstanceState(Activity activity, Bundle outState) { 40 | } 41 | 42 | @Override 43 | public void onActivityDestroyed(Activity activity) { 44 | } 45 | 46 | public static boolean isOnBackground() { 47 | return( resumeCount==0 || startCount == 0); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /floatwindow/src/main/java/com/yhao/floatwindow/util/LogUtil.java: -------------------------------------------------------------------------------- 1 | package com.yhao.floatwindow.util; 2 | 3 | import android.util.Log; 4 | 5 | 6 | /** 7 | * Created by yhao on 2017/12/29. 8 | * https://github.com/yhaolpz 9 | */ 10 | 11 | public class LogUtil { 12 | 13 | private static final String TAG = "FloatWindow"; 14 | 15 | public static void e(String message) { 16 | Log.e(TAG, message); 17 | } 18 | 19 | public static void d(String message) { 20 | Log.d(TAG, message); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /floatwindow/src/main/res/values/style.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | ## Project-wide Gradle settings. 2 | # 3 | # For more details on how to configure your build environment visit 4 | # http://www.gradle.org/docs/current/userguide/build_environment.html 5 | # 6 | # Specifies the JVM arguments used for the daemon process. 7 | # The setting is particularly useful for tweaking memory settings. 8 | # Default value: -Xmx1024m -XX:MaxPermSize=256m 9 | org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 10 | # 11 | # When configured, Gradle will run in incubating parallel mode. 12 | # This option should only be used with decoupled projects. More details, visit 13 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 14 | org.gradle.daemon=true 15 | org.gradle.parallel=true 16 | org.gradle.configondemand=true 17 | #Sat May 11 23:18:40 CST 2019 18 | 19 | android.enableD8=true 20 | android.enableJetifier=true 21 | android.useAndroidX=true 22 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wizos/loread/bec024a07bee7bc4a7ac36970fd2e0aa253b4236/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Aug 20 21:46:24 CST 2020 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip 7 | -------------------------------------------------------------------------------- /luban/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /src/androidTest/ 3 | -------------------------------------------------------------------------------- /luban/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | buildscript { 4 | repositories { 5 | google() 6 | maven { url "https://jitpack.io" } 7 | jcenter() 8 | } 9 | dependencies { 10 | classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' 11 | } 12 | } 13 | 14 | android { 15 | compileSdkVersion 29 16 | 17 | defaultConfig { 18 | minSdkVersion 22 19 | targetSdkVersion 29 20 | versionCode 1 21 | versionName "1.0" 22 | } 23 | buildTypes { 24 | release { 25 | minifyEnabled false 26 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 27 | } 28 | } 29 | } 30 | 31 | dependencies {} -------------------------------------------------------------------------------- /luban/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard replaceUrl here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/sweetspot/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class userName to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /luban/src/androidTest/java/top/zibin/luban/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package top.zibin.luban; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /luban/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /luban/src/main/java/top/zibin/luban/CompressionPredicate.java: -------------------------------------------------------------------------------- 1 | package top.zibin.luban; 2 | 3 | /** 4 | * Created on 2018/1/3 19:43 5 | * 6 | * @author andy 7 | *

8 | * A functional interface (callback) that returns true or false for the given input path should be compressed. 9 | */ 10 | 11 | public interface CompressionPredicate { 12 | 13 | /** 14 | * Determine the given input path should be compressed and return a boolean. 15 | * 16 | * @param path input path 17 | * @return the boolean result 18 | */ 19 | // boolean apply(String path); 20 | boolean apply(String path,InputStreamProvider inputStreamProvider); 21 | } 22 | -------------------------------------------------------------------------------- /luban/src/main/java/top/zibin/luban/FileProvider.java: -------------------------------------------------------------------------------- 1 | package top.zibin.luban; 2 | 3 | import java.io.File; 4 | 5 | /** 6 | * 自己增加的,为的是最后能在回调中区分文件到底有没有压缩 7 | * @author Wizos on 2018/12/27. 8 | */ 9 | 10 | public class FileProvider { 11 | public boolean hasCompressed = false; 12 | public File file; 13 | } 14 | -------------------------------------------------------------------------------- /luban/src/main/java/top/zibin/luban/InputStreamProvider.java: -------------------------------------------------------------------------------- 1 | package top.zibin.luban; 2 | 3 | import java.io.IOException; 4 | import java.io.InputStream; 5 | 6 | /** 7 | * 通过此接口获取输入流,以兼容文件、FileProvider方式获取到的图片 8 | *

9 | * Get the input stream through this interface, and obtain the picture using compatible files and FileProvider 10 | */ 11 | public interface InputStreamProvider { 12 | 13 | InputStream open() throws IOException; 14 | 15 | String getPath(); 16 | } 17 | -------------------------------------------------------------------------------- /luban/src/main/java/top/zibin/luban/OnCompressListener.java: -------------------------------------------------------------------------------- 1 | package top.zibin.luban; 2 | 3 | import java.io.File; 4 | 5 | public interface OnCompressListener { 6 | 7 | /** 8 | * Fired when the compression is started, override to handle in your own code 9 | */ 10 | void onStart(); 11 | 12 | /** 13 | * Fired when a compression returns successfully, override to handle in your own code 14 | */ 15 | void onSuccess(File file); 16 | 17 | /** 18 | * 自己增加的 19 | * 条件不符合,最后没有压缩 20 | */ 21 | void onUnChange(File file); 22 | /** 23 | * Fired when a compression fails to complete, override to handle in your own code 24 | */ 25 | void onError(Throwable e); 26 | } 27 | -------------------------------------------------------------------------------- /luban/src/main/java/top/zibin/luban/OnRenameListener.java: -------------------------------------------------------------------------------- 1 | package top.zibin.luban; 2 | 3 | /** 4 | * Author: zibin 5 | * Datetime: 2018/5/18 6 | *

7 | * 提供修改压缩图片命名接口 8 | *

9 | * A functional interface (callback) that used to rename the file after compress. 10 | */ 11 | public interface OnRenameListener { 12 | 13 | /** 14 | * 压缩前调用该方法用于修改压缩后文件名 15 | *

16 | * Call before compression begins. 17 | * 18 | * @param filePath 传入文件路径/ file path 19 | * @return 返回重命名后的字符串/ file name 20 | */ 21 | String rename(String filePath); 22 | } 23 | -------------------------------------------------------------------------------- /luban/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Luban 3 | 4 | -------------------------------------------------------------------------------- /privacy_and_security.md: -------------------------------------------------------------------------------- 1 | - Loread has no server to save your data. 2 | - Loread uses RSS server APIs to get feeds data for you. 3 | - Loread uses the Google Firebase library to improve app crash issues and performance. This only transmits app crash logs. 4 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':swipelayout', ':luban', ":support",':floatwindow',':agentweb-core' -------------------------------------------------------------------------------- /support/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /support/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.library" 2 | 3 | android { 4 | compileSdkVersion 29 5 | buildToolsVersion "29.0.3" 6 | 7 | defaultConfig { 8 | minSdkVersion 22 9 | targetSdkVersion 29 10 | consumerProguardFiles 'proguard-rules.txt' 11 | } 12 | 13 | resourcePrefix 'support_recycler' 14 | } 15 | 16 | dependencies { 17 | api 'androidx.recyclerview:recyclerview:1.1.0' 18 | } -------------------------------------------------------------------------------- /support/proguard-rules.txt: -------------------------------------------------------------------------------- 1 | #-keepclasseswithmembers class android.support.v7.widget.RecyclerView$ViewHolder { 2 | # public final android.view.View *; 3 | #} -------------------------------------------------------------------------------- /support/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | -------------------------------------------------------------------------------- /support/src/main/java/com/yanzhenjie/recyclerview/OnItemClickListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Yan Zhenjie 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 com.yanzhenjie.recyclerview; 17 | 18 | import android.view.View; 19 | 20 | /** 21 | * Created by YanZhenjie on 2017/7/21. 22 | */ 23 | public interface OnItemClickListener { 24 | 25 | /** 26 | * @param view target view. 27 | * @param adapterPosition position of item. 28 | */ 29 | void onItemClick(View view, int adapterPosition); 30 | } -------------------------------------------------------------------------------- /support/src/main/java/com/yanzhenjie/recyclerview/OnItemLongClickListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Yan Zhenjie 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 com.yanzhenjie.recyclerview; 17 | 18 | import android.view.View; 19 | 20 | /** 21 | * Created by YanZhenjie on 2017/7/21. 22 | */ 23 | public interface OnItemLongClickListener { 24 | 25 | /** 26 | * @param view target view. 27 | * @param adapterPosition position of item. 28 | */ 29 | void onItemLongClick(View view, int adapterPosition); 30 | } -------------------------------------------------------------------------------- /support/src/main/java/com/yanzhenjie/recyclerview/OnItemMenuClickListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Yan Zhenjie 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 com.yanzhenjie.recyclerview; 17 | 18 | /** 19 | * Created by Yan Zhenjie on 2016/7/26. 20 | */ 21 | public interface OnItemMenuClickListener { 22 | 23 | /** 24 | * @param menuBridge menu bridge. 25 | * @param adapterPosition position of item. 26 | */ 27 | void onItemClick(SwipeMenuBridge menuBridge, int adapterPosition); 28 | } -------------------------------------------------------------------------------- /support/src/main/java/com/yanzhenjie/recyclerview/OnItemSwipeListener.java: -------------------------------------------------------------------------------- 1 | package com.yanzhenjie.recyclerview; 2 | 3 | import android.view.View; 4 | 5 | /** 6 | * Created by Wizos on 2019/4/14. 7 | */ 8 | 9 | public interface OnItemSwipeListener { 10 | void onClose(View swipeMenu,int direction,int adapterPosition); 11 | void onCloseLeft(int adapterPosition); 12 | void onCloseRight(int adapterPosition); 13 | } 14 | -------------------------------------------------------------------------------- /support/src/main/java/com/yanzhenjie/recyclerview/StickyCreator.java: -------------------------------------------------------------------------------- 1 | //package com.yanzhenjie.recyclerview; 2 | // 3 | //import androidx.annotation.NonNull; 4 | //import androidx.recyclerview.widget.RecyclerView; 5 | //import android.view.View; 6 | // 7 | ///** 8 | // * Created by Wizos on 2019/4/20. 9 | // */ 10 | // 11 | //public interface StickyCreator { 12 | // int STICKY_HEADER_GONE = 0; 13 | // int STICKY_HEADER_VISIBLE = 1; 14 | // int STICKY_HEADER_PUSHED_UP = 2; 15 | // 16 | 17 | // // View setStickyHeaderView(ViewGroup view); 18 | // int getGroupCount(); 19 | // int getStickyHeaderState(int firstVisibleGroupPosition, int firstVisibleChildPosition); 20 | // void onBindStickyHeader(View header, int groupPosition, int childPosition, int alpha); 21 | // //void onStickyHeaderClick(RecyclerView parent, View stickyHeaderView, int stickyGroupPosition); 22 | // int getGroupPosition(int adapterPosition); 23 | // int getChildPosition(int adapterPosition); 24 | // boolean isGroup(int adapterPosition); 25 | //} 26 | -------------------------------------------------------------------------------- /support/src/main/java/com/yanzhenjie/recyclerview/StickyViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.yanzhenjie.recyclerview; 2 | 3 | import android.view.View; 4 | 5 | import androidx.annotation.NonNull; 6 | import androidx.recyclerview.widget.RecyclerView; 7 | 8 | /** 9 | * Created by Wizos on 2019/4/20. 10 | */ 11 | 12 | public class StickyViewHolder extends RecyclerView.ViewHolder { 13 | 14 | public StickyViewHolder(@NonNull View itemView) { 15 | super(itemView); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /support/src/main/java/com/yanzhenjie/recyclerview/SwipeMenuCreator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Yan Zhenjie 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 com.yanzhenjie.recyclerview; 17 | 18 | /** 19 | * Created by Yan Zhenjie on 2016/7/26. 20 | */ 21 | public interface SwipeMenuCreator { 22 | 23 | /** 24 | * Create menu for recyclerVie item. 25 | * 26 | * @param leftMenu the menu on the left. 27 | * @param rightMenu the menu on the right. 28 | * @param position the position of item. 29 | */ 30 | void onCreateMenu(SwipeMenu leftMenu, SwipeMenu rightMenu, int position); 31 | } -------------------------------------------------------------------------------- /support/src/main/res/values-zh-rHK/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 暫時沒有數據 20 | 沒有更多數據啦 21 | 點擊加載更多 22 | 加載出錯啦,請稍後重試 23 | 正在加載更多數據,請稍後 24 | 25 | -------------------------------------------------------------------------------- /support/src/main/res/values-zh-rTW/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 暫時沒有數據 20 | 沒有更多數據啦 21 | 點擊加載更多 22 | 加載出錯啦,請稍後重試 23 | 正在加載更多數據,請稍後 24 | 25 | -------------------------------------------------------------------------------- /support/src/main/res/values-zh/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 暂时没有数据 20 | 没有更多数据啦 21 | 点击加载更多 22 | 加载出错啦,请稍后重试 23 | 正在加载更多数据,请稍后 24 | 25 | -------------------------------------------------------------------------------- /support/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /support/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | #FF777777 20 | 21 | #55777777 22 | #B1777777 23 | #FF777777 24 | 25 | -------------------------------------------------------------------------------- /support/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | There is no data 20 | No more data 21 | Click to load more 22 | Error, please try again 23 | Loading, please wait later 24 | 25 | -------------------------------------------------------------------------------- /swipelayout/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /swipelayout/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 29 5 | 6 | defaultConfig { 7 | minSdkVersion 22 8 | targetSdkVersion 29 9 | versionCode 1 10 | versionName "1.0" 11 | } 12 | buildTypes { 13 | release { 14 | minifyEnabled false 15 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 16 | } 17 | } 18 | } 19 | 20 | dependencies { 21 | implementation fileTree(dir: 'libs', include: ['*.jar']) 22 | testImplementation 'junit:junit:4.13' 23 | implementation 'androidx.legacy:legacy-support-v4:1.0.0' 24 | } 25 | -------------------------------------------------------------------------------- /swipelayout/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard replaceUrl here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/vienan/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class userName to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /swipelayout/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /swipelayout/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /swipelayout/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | RSSLibrary 3 | 4 | --------------------------------------------------------------------------------