Skip to content
This repository has been archived by the owner on Aug 26, 2019. It is now read-only.

Commit

Permalink
Add kokomade tip
Browse files Browse the repository at this point in the history
  • Loading branch information
seven332 committed Jul 26, 2019
1 parent 1cd5f7b commit 0248fd4
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/src/main/java/com/hippo/ehviewer/client/EhEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ public class EhEngine {
private static final String SAD_PANDA_TYPE = "image/gif";
private static final String SAD_PANDA_LENGTH = "9615";

private static final String KOKOMADE_URL = "https://exhentai.org/img/kokomade.jpg";

public static final MediaType MEDIA_TYPE_JSON = MediaType.parse("application/json; charset=utf-8");
private static final MediaType MEDIA_TYPE_JPEG = MediaType.parse("image/jpeg");

Expand All @@ -101,6 +103,11 @@ private static void doThrowException(Call call, int code, @Nullable Headers head
throw new EhException("Sad Panda");
}

// Check kokomade
if (body != null && body.contains(KOKOMADE_URL)) {
throw new EhException("今回はここまで\n\n" + GetText.getString(R.string.kokomade_tip));
}

if (e instanceof ParseException) {
if (body != null && !body.contains("<")) {
throw new EhException(body);
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@
<string name="error_please_login_first">请先登陆</string>
<string name="error_empty_html">页面内容为空</string>

<string name="kokomade_tip">设置->Eh->画廊站点->e-hentai</string>

<string name="app_waring">本应用中内容来自互联网,部分内容可能对您的生理及心理造成难以恢复的伤害。本应用作者不会对由本应用造成的任何后果负责。\n\n未成年人应在监护人指导下使用本应用。</string>
<string name="error_username_cannot_empty">用户名不可为空</string>
<string name="error_password_cannot_empty">密码不可为空</string>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-zh-rHK/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@
<string name="error_please_login_first">請先登陸</string>
<string name="error_empty_html">頁面內容為空</string>

<string name="kokomade_tip">設置->Eh->畫廊站點->e-hentai</string>

<string name="app_waring">本應用中內容來自互聯網,部分內容可能對您的生理及心理造成難以恢復的傷害。本應用作者不會對由本應用造成的任何後果負責。\n\n未成年人應在監護人指導下使用本應用。</string>
<string name="error_username_cannot_empty">用户名不可為空</string>
<string name="error_password_cannot_empty">密碼不可為空</string>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@
<string name="error_please_login_first">請先登陸</string>
<string name="error_empty_html">頁面內容為空</string>

<string name="kokomade_tip">設定->Eh->圖庫站台->e-hentai</string>

<string name="app_waring">本應用程式中內容來自網際網路,部分內容可能對您的生理及心理造成難以恢復的傷害。本應用程式的作者不會對由其所造成的任何影響負責。\n\n未成年人應在監護人指導下使用本應用程式。</string>
<string name="error_username_cannot_empty">使用者名稱欄位不能為空</string>
<string name="error_password_cannot_empty">密碼欄位不能為空</string>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@
<string name="error_please_login_first">Please login first</string>
<string name="error_empty_html">Empty page</string>

<string name="kokomade_tip">Settings->Eh->Gallery Site->e-hentai</string>

<string name="app_waring">The content of this application is from the Internet. Some of it may do physical or mental harm to you. You have learnt the risks above and would like to undertake them.</string>
<string name="error_username_cannot_empty">Username cannot be an empty string</string>
<string name="error_password_cannot_empty">Password cannot be an empty string</string>
Expand Down

0 comments on commit 0248fd4

Please sign in to comment.