From 091e27fb3ec82b083fdeb39d28c9ef8e93780b14 Mon Sep 17 00:00:00 2001 From: yang <2351386755@qq.com> Date: Mon, 12 Apr 2021 00:40:51 +0800 Subject: [PATCH] image --- .../yluo/ruisiapp/activity/AboutActivity.java | 2 +- .../yluo/ruisiapp/activity/PostActivity.java | 8 +++++++ .../yluo/ruisiapp/utils/LinkClickHandler.java | 3 +-- .../me/yluo/ruisiapp/utils/RuisUtils.java | 23 +++++++++++++++++++ 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/me/yluo/ruisiapp/activity/AboutActivity.java b/app/src/main/java/me/yluo/ruisiapp/activity/AboutActivity.java index a6bfb8c2..8c475c1f 100644 --- a/app/src/main/java/me/yluo/ruisiapp/activity/AboutActivity.java +++ b/app/src/main/java/me/yluo/ruisiapp/activity/AboutActivity.java @@ -46,7 +46,7 @@ protected void onCreate(Bundle savedInstanceState) { "bug反馈:
" + "1.到 本帖 回复
" + "2.本站 @谁用了FREEDOM
" + - "3.本站 @wangfuyang
" + + "3.邮件 2351386755@qq.com
" + "4.本站 @金鲨鱼
" + "5.github提交 点击这儿


" + "下载地址: 库安
"; diff --git a/app/src/main/java/me/yluo/ruisiapp/activity/PostActivity.java b/app/src/main/java/me/yluo/ruisiapp/activity/PostActivity.java index 8ef5b6dc..b9803562 100644 --- a/app/src/main/java/me/yluo/ruisiapp/activity/PostActivity.java +++ b/app/src/main/java/me/yluo/ruisiapp/activity/PostActivity.java @@ -726,6 +726,12 @@ protected List doInBackground(String... params) { } } + // 处理未点击添加到帖子里的图片 + // http://rsbbs.xidian.edu.cn/forum.php?mod=viewthread&tid=952530&page=1&mobile=2 + final Elements extraImages = temp.select("ul[class^=img_]").select("li"); + if (extraImages.size() > 0) { + contentels.append(extraImages.html()); + } SingleArticleData data; if (pageLoad == 1 && i == 0) {//内容 @@ -1262,6 +1268,8 @@ private void handleReply(boolean isok, String res) { showToast("您两次发表间隔太短了......"); } else if (res.contains("主题自动关闭")) { showLongToast("此主题已关闭回复,无法回复"); + } else if (!TextUtils.isEmpty(RuisUtils.getRuisiReqAjaxError(res))) { + showLongToast(RuisUtils.getRuisiReqAjaxError(res)); } else { showToast("由于未知原因发表失败"); } diff --git a/app/src/main/java/me/yluo/ruisiapp/utils/LinkClickHandler.java b/app/src/main/java/me/yluo/ruisiapp/utils/LinkClickHandler.java index 8c2bc889..45e36c08 100644 --- a/app/src/main/java/me/yluo/ruisiapp/utils/LinkClickHandler.java +++ b/app/src/main/java/me/yluo/ruisiapp/utils/LinkClickHandler.java @@ -95,11 +95,10 @@ public static void handleClick(final Context context, String url) { } } else { - if (!url.startsWith("http")) { + if (!url.startsWith("http") && !url.startsWith("mailto:")) { url = App.getBaseUrl() + url; } - CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder(); builder.setToolbarColor(ContextCompat.getColor(context, R.color.colorPrimary)); CustomTabsIntent customTabsIntent = builder.build(); diff --git a/app/src/main/java/me/yluo/ruisiapp/utils/RuisUtils.java b/app/src/main/java/me/yluo/ruisiapp/utils/RuisUtils.java index 18433280..52b0e3dc 100644 --- a/app/src/main/java/me/yluo/ruisiapp/utils/RuisUtils.java +++ b/app/src/main/java/me/yluo/ruisiapp/utils/RuisUtils.java @@ -168,6 +168,29 @@ public static String getErrorTextPC(String res) { return null; } + //
+ //

密码太弱,密码中必须包含数字

+ public static String getRuisiReqAjaxError(String res) { + if (!res.contains("id=\"messagetext\"")) { + return null; + } + + int index = res.indexOf("id=\"messagetext\""); + if (index < 0) { + return null; + } + + index = res.indexOf("

", index); + if (index < 0) { + return null; + } + + int startIndex = index + "

".length(); + int endIndex = res.indexOf("