Compare commits

...
73 Commits
Author SHA1 Message Date
seven332 78db7ecbc5 1.0.23 2017-06-01 22:31:41 +08:00
seven332 4896a1edbc Use HashMap instead of WeakHashMap for GlobalStuffMap 2017-06-01 22:30:02 +08:00
seven332 61b2075302 Add e-hentai.org to intent-filter
Close #249
2017-05-25 01:04:35 +08:00
seven332 b21fe89ea1 1.0.22 2017-05-23 16:35:42 +08:00
seven332 4af054a9cd Update gradle tools 2017-05-23 16:35:19 +08:00
seven332 3f579060b5 Fix GalleryDetailParser parsing gallery cover 2017-05-23 16:31:26 +08:00
seven332 1e87279310 Avoid saving large data in ContentLayout 2017-05-23 16:21:05 +08:00
seven332 5fae1df78c Update libraries 2017-04-22 20:48:26 +08:00
seven332 84949442ee Add ISSUE_TEMPLATE English translate 2017-04-07 19:48:21 +08:00
seven332 3b395380c7 Merge remote-tracking branch 'origin/master' 2017-04-05 20:26:00 +08:00
seven332 3e3de0ff2a Update gradle library 2017-04-05 20:24:45 +08:00
seven332 da802c5371 Update ISSUE_TEMPLATE 2017-04-05 20:23:20 +08:00
seven332 24405f7c44 Merge pull request #251 from danthe100/mycommits
Fixed Spanish translation
2017-03-30 22:09:41 -05:00
Dante Garcia 9ed826a87e Fixed certain errors 2017-03-30 12:01:03 -05:00
seven332 9c5c9dfa95 Add ISSUE_TEMPLATE 2017-03-27 23:26:21 +08:00
seven332 6eb29c783a 1.0.21 2017-03-20 22:36:05 +08:00
seven332 cb11ecc9f0 Fix category parsing 2017-03-20 22:34:05 +08:00
seven332 bf5feaacd1 Merge pull request #242 from sorz/master
Add fingerprint unlock
2017-03-18 01:41:53 -05:00
seven332 0ef4088b88 Update gradle 2017-03-17 23:12:11 +08:00
sorz 1e87d34806 Add translations for fingerprint setting
Spanish by Google Translate
2017-03-16 01:52:54 +11:00
sorz 0b35fb01ee Add fingerprint on SecurityScene 2017-03-16 01:11:19 +11:00
sorz 7f1d590fbd Add fingerprint protection switch 2017-03-15 22:38:47 +11:00
seven332 97ce2bbe54 Apply Spanish strings.xml to all countries 2017-02-23 16:54:06 +08:00
seven332 d8a6424ecc Merge pull request #235 from danthe100/mycommits
Added translation into Spanish
2017-02-23 13:10:04 +08:00
Dante Garcia fdc199cc49 Added translation into Spanish 2017-02-22 20:18:17 -05:00
seven332 a02fe88765 1.0.20 2017-02-09 21:45:24 +08:00
seven332 6488de75f1 Adjust gallery detail actions order 2017-02-09 21:40:24 +08:00
seven332 439f199a10 Sanitize torrent filename 2017-02-09 21:36:44 +08:00
seven332 e535b2fa09 Fix TorrentParser 2017-02-09 21:30:07 +08:00
seven332 81ae752975 Fix Chinese translations 2017-02-09 21:24:28 +08:00
seven332 5dd584776a Fix Chinese translations 2017-02-09 21:19:36 +08:00
seven332 f617e62b85 Add android-chinese-string 2017-02-09 21:09:58 +08:00
Lin, Yi-Li 4d95a7163f use snackbar to tell users that H@H client is required for this feature 2017-01-29 17:27:56 +09:00
Lin, Yi-Li b5cae76de5 able to request archive download 2017-01-29 02:00:02 +09:00
seven332 9065e7457a 1.0.19 2017-01-26 13:30:48 +08:00
seven332 08ab9159a5 Fix RecyclerView crashing 2017-01-26 11:39:56 +08:00
seven332 6b5b961986 1.0.18 2017-01-25 13:22:09 +08:00
seven332 6a96035149 Avoid RecyclerView scrolling after detached 2017-01-25 13:19:23 +08:00
seven332 1ce035591a Fix GalleryPageParser 2017-01-25 00:13:55 +08:00
seven332 6cc78802ee 1.0.17 2017-01-24 19:41:23 +08:00
seven332 636c011c23 Rename XXX_G to XXX_E 2017-01-24 19:39:05 +08:00
seven332 92490ca1a6 e-hentai switched to HTTPS 2017-01-24 19:34:24 +08:00
seven332 b6a5d237ac Add EhUrl.getFixedPreviewThumbUrl() 2017-01-24 19:22:58 +08:00
seven332 8be0b5c588 Don't use jack anymore 2016-12-31 19:29:33 +08:00
seven332 fcbe129b6e Fix URL_PREFIX_THUMB_EX 2016-12-30 12:10:59 +08:00
seven332 befbcd6720 Add fix thumb url 2016-12-29 21:50:26 +08:00
seven332 ee5062d4c7 Add round icon 2016-12-19 00:38:26 +08:00
seven332 a4392523d6 1.0.16 2016-12-15 02:06:46 +08:00
seven332 b3371304bf Sync media store after saving image 2016-12-15 02:05:23 +08:00
seven332 38911c2d34 Be compatible with some bad share mechanism
Some apps need file path to share it, but it's not necessary at all.
2016-12-15 01:59:49 +08:00
seven332 6c5ad068d2 Update gradle tools and libraries 2016-12-15 01:30:32 +08:00
seven332 868521f19f Try to get image reload key more than once 2016-12-15 01:13:58 +08:00
seven332 c4cd965306 Add excluding japanese original
Eh site doesn't support it, but just modifying the cookie works fine.
2016-12-03 19:38:49 +08:00
seven332 639adaf7fa Close #201, list local favorites by favorited time 2016-10-29 00:05:18 +08:00
seven332 e174ee0b2c Ensure dao gen called 2016-10-22 00:42:41 +08:00
seven332 04da83f950 Set targetSdkVersion to 25 2016-10-22 00:16:06 +08:00
seven332 84a35e9283 1.0.15 2016-10-18 00:10:10 +08:00
seven332 a907db43be Update libraries 2016-10-18 00:06:09 +08:00
seven332 890be41aa5 Update gradle tool 2016-08-13 18:49:57 +08:00
seven332 f3db305cee Add https in intent-filter 2016-08-13 18:48:57 +08:00
seven332 4626ab1ec4 Update image search url 2016-07-31 19:27:59 +08:00
seven332 a44b070120 1.0.14 2016-07-28 14:28:23 +08:00
seven332 1760fb65e2 Use LinearLayout instead of android.support.v7.widget.ButtonBarLayout 2016-07-28 14:25:01 +08:00
seven332 47d28beddd 1.0.13 2016-07-28 00:17:39 +08:00
seven332 8d39829e54 Update libraries 2016-07-28 00:17:06 +08:00
seven332 2cb8319c91 Check download image size 2016-07-27 23:34:09 +08:00
seven332 27ca88f0c2 Use https for ex and forums 2016-07-27 23:32:31 +08:00
seven332 9aa033c31b Add https support for url parser 2016-07-27 23:27:27 +08:00
seven332 1f1d968766 Make error message different 2016-07-27 23:24:53 +08:00
seven332 3b8ba148dc Save temp share image to internal folder 2016-06-20 23:27:03 +08:00
seven332 5448bdf7bb Use FileProvider to share image
For apps targeting Android N, file:// URIs outside app is not supported any more.
2016-06-18 22:08:29 +08:00
seven332 e7cfd8831e Set targetSdkVersion to 24, upgrade libraries 2016-06-18 21:04:26 +08:00
seven332 148588e53a Show version name in about 2016-06-10 20:37:27 +08:00
71 changed files with 2629 additions and 205 deletions

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
感谢您提交 Issue,请在提交前仔细阅读以下信息。
Issue 的内容仅可为
* Bug 反馈
* 功能申请
若您希望得到使用指导(譬如如何删除快速搜索),请至 [G+ 社区](https://plus.google.com/u/1/communities/103823982034655188459) 发贴。若有其他问题,可在应用内找到开发者的邮箱地址,使用电子邮件与开发者交流。
若内容为 Bug 反馈,请先查看 [release 页面](https://github.com/seven332/EhViewer/releases),以帮助确认该 bug 是否存在于最新版中;同时应详细描述 bug 内容与重现方法,必要时可附加截图,但请确定截图符合风序良俗。
功能申请包括添加新功能与改进现有功能。
一个 Issue 只包含一个 Bug 反馈或者功能申请。若有多个需求,请提交多个 Issue。
尽量不提交重复的 Issue,可先进行搜索。对于重复的 Issue,开发者可能会直接关闭并添加 Duplicate 标签。
Thank you for taking the time to submit an issue. Before you proceed, please consider the following.
An issue can only be about:
* Bug Report
* Feature Request
If you need application instructions, please post your question in [G+ community](https://plus.google.com/u/1/communities/103823982034655188459). If you have other questions, please get the developer's email address in the application, and send him/her an email.
One issue one bug report or feature request.
+21 -27
View File
@@ -1,27 +1,21 @@
import com.android.build.gradle.internal.tasks.DefaultAndroidTask
apply plugin: 'com.android.application'
apply plugin: 'android-chinese-string'
android {
compileSdkVersion 23
buildToolsVersion "24.0.0 rc4"
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.hippo.ehviewer"
minSdkVersion 14
targetSdkVersion 23
versionCode 65
versionName "1.0.12"
targetSdkVersion 25
versionCode 76
versionName "1.0.23"
vectorDrawables.useSupportLibrary = true
resConfigs "zh", "zh-rCN", "zh-rHK", "zh-rTW"
jackOptions {
enabled true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
incremental true
resConfigs "zh", "zh-rCN", "zh-rHK", "zh-rTW",
"es"
}
lintOptions {
@@ -48,8 +42,8 @@ task copyNotice(type: Copy) {
finalizedBy ":daogenerator:executeDaoGenerator"
}
tasks.withType(AbstractCompile) {
compileTask -> compileTask.dependsOn copyNotice
tasks.withType(DefaultAndroidTask) {
task -> task.dependsOn copyNotice
}
clean {
@@ -58,29 +52,29 @@ clean {
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile "com.android.support:appcompat-v7:$supportLibrary"
compile "com.android.support:design:$supportLibrary"
compile 'com.github.amlcurran.showcaseview:library:5.4.3'
compile 'com.github.seven332:animator:0.1.0'
compile 'com.github.seven332:beerbelly:0.1.4'
compile 'com.github.seven332:conaco:0.1.5-eh'
compile 'com.github.seven332:drawerlayout:0.1.0'
compile 'com.github.seven332:easyrecyclerview:0.1.0'
compile 'com.github.seven332:drawerlayout:0.2.1'
compile 'com.github.seven332:easyrecyclerview:0.1.1'
compile 'com.github.seven332:glgallery:0.1.2'
compile 'com.github.seven332:glview:0.1.0'
compile 'com.github.seven332:glview-image:0.1.0'
compile 'com.github.seven332:hotspot:0.1.0'
compile 'com.github.seven332:image:0.1.9-jpeg-png-gif'
compile 'com.github.seven332:okhttp:3.3.1-eh'
compile 'com.github.seven332:image:0.1.12'
compile 'com.github.seven332:okhttp:3.5.0'
compile 'com.github.seven332:refreshlayout:0.1.0'
compile 'com.github.seven332:ripple:0.1.1'
compile 'com.github.seven332:ripple:0.1.2'
compile 'com.github.seven332:streampipe:0.1.0'
compile 'com.github.seven332:tuxiang:0.1.2'
compile 'com.github.seven332:unifile:0.1.4'
compile 'com.github.seven332:unifile:0.2.0'
compile 'com.github.seven332:yorozuya:0.1.2'
compile 'com.github.seven332:yorozuya-thread:0.1.1'
compile 'com.github.seven332:yorozuya-collect:0.1.4'
compile 'com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.9.1'
compile 'com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.9.2'
compile 'org.ccil.cowan.tagsoup:tagsoup:1.2.1'
compile 'org.greenrobot:greendao:2.2.0'
compile 'org.jsoup:jsoup:1.9.2'
Regular → Executable
+15 -1
View File
@@ -22,12 +22,14 @@
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
<application
android:name="com.hippo.ehviewer.EhApplication"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:allowBackup="true"
@@ -51,7 +53,9 @@
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="http"/>
<data android:scheme="https"/>
<data android:host="exhentai.org"/>
<data android:host="e-hentai.org"/>
<data android:host="g.e-hentai.org"/>
<data android:host="lofi.e-hentai.org"/>
</intent-filter>
@@ -130,8 +134,18 @@
<service
android:name="com.hippo.ehviewer.download.DownloadService"
android:icon="@mipmap/ic_launcher"
android:label="@string/download_service_label"/>
<provider
android:name="com.hippo.content.FileProvider"
android:authorities="com.hippo.ehviewer.fileprovider"
android:grantUriPermissions="true"
android:exported="false">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths"/>
</provider>
</application>
</manifest>
@@ -0,0 +1,816 @@
/*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.content;
import android.content.ClipData;
import android.content.ContentProvider;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ProviderInfo;
import android.content.res.XmlResourceParser;
import android.database.Cursor;
import android.database.MatrixCursor;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.os.ParcelFileDescriptor;
import android.provider.MediaStore;
import android.support.v4.content.ContextCompat;
import android.text.TextUtils;
import android.webkit.MimeTypeMap;
import org.xmlpull.v1.XmlPullParserException;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import static org.xmlpull.v1.XmlPullParser.END_DOCUMENT;
import static org.xmlpull.v1.XmlPullParser.START_TAG;
/**
* FileProvider is a special subclass of {@link ContentProvider} that facilitates secure sharing
* of files associated with an app by creating a <code>content://</code> {@link Uri} for a file
* instead of a <code>file:///</code> {@link Uri}.
* <p>
* A content URI allows you to grant read and write access using
* temporary access permissions. When you create an {@link Intent} containing
* a content URI, in order to send the content URI
* to a client app, you can also call {@link Intent#setFlags(int) Intent.setFlags()} to add
* permissions. These permissions are available to the client app for as long as the stack for
* a receiving {@link android.app.Activity} is active. For an {@link Intent} going to a
* {@link android.app.Service}, the permissions are available as long as the
* {@link android.app.Service} is running.
* <p>
* In comparison, to control access to a <code>file:///</code> {@link Uri} you have to modify the
* file system permissions of the underlying file. The permissions you provide become available to
* <em>any</em> app, and remain in effect until you change them. This level of access is
* fundamentally insecure.
* <p>
* The increased level of file access security offered by a content URI
* makes FileProvider a key part of Android's security infrastructure.
* <p>
* This overview of FileProvider includes the following topics:
* </p>
* <ol>
* <li><a href="#ProviderDefinition">Defining a FileProvider</a></li>
* <li><a href="#SpecifyFiles">Specifying Available Files</a></li>
* <li><a href="#GetUri">Retrieving the Content URI for a File</li>
* <li><a href="#Permissions">Granting Temporary Permissions to a URI</a></li>
* <li><a href="#ServeUri">Serving a Content URI to Another App</a></li>
* </ol>
* <h3 id="ProviderDefinition">Defining a FileProvider</h3>
* <p>
* Since the default functionality of FileProvider includes content URI generation for files, you
* don't need to define a subclass in code. Instead, you can include a FileProvider in your app
* by specifying it entirely in XML. To specify the FileProvider component itself, add a
* <code><a href="{@docRoot}guide/topics/manifest/provider-element.html">&lt;provider&gt;</a></code>
* element to your app manifest. Set the <code>android:name</code> attribute to
* <code>android.support.v4.content.FileProvider</code>. Set the <code>android:authorities</code>
* attribute to a URI authority based on a domain you control; for example, if you control the
* domain <code>mydomain.com</code> you should use the authority
* <code>com.mydomain.fileprovider</code>. Set the <code>android:exported</code> attribute to
* <code>false</code>; the FileProvider does not need to be public. Set the
* <a href="{@docRoot}guide/topics/manifest/provider-element.html#gprmsn"
* >android:grantUriPermissions</a> attribute to <code>true</code>, to allow you
* to grant temporary access to files. For example:
* <pre class="prettyprint">
*&lt;manifest&gt;
* ...
* &lt;application&gt;
* ...
* &lt;provider
* android:name="android.support.v4.content.FileProvider"
* android:authorities="com.mydomain.fileprovider"
* android:exported="false"
* android:grantUriPermissions="true"&gt;
* ...
* &lt;/provider&gt;
* ...
* &lt;/application&gt;
*&lt;/manifest&gt;</pre>
* <p>
* If you want to override any of the default behavior of FileProvider methods, extend
* the FileProvider class and use the fully-qualified class name in the <code>android:name</code>
* attribute of the <code>&lt;provider&gt;</code> element.
* <h3 id="SpecifyFiles">Specifying Available Files</h3>
* A FileProvider can only generate a content URI for files in directories that you specify
* beforehand. To specify a directory, specify the its storage area and path in XML, using child
* elements of the <code>&lt;paths&gt;</code> element.
* For example, the following <code>paths</code> element tells FileProvider that you intend to
* request content URIs for the <code>images/</code> subdirectory of your private file area.
* <pre class="prettyprint">
*&lt;paths xmlns:android="http://schemas.android.com/apk/res/android"&gt;
* &lt;files-path name="my_images" path="images/"/&gt;
* ...
*&lt;/paths&gt;
*</pre>
* <p>
* The <code>&lt;paths&gt;</code> element must contain one or more of the following child elements:
* </p>
* <dl>
* <dt>
* <pre class="prettyprint">
*&lt;files-path name="<i>name</i>" path="<i>path</i>" /&gt;
*</pre>
* </dt>
* <dd>
* Represents files in the <code>files/</code> subdirectory of your app's internal storage
* area. This subdirectory is the same as the value returned by {@link Context#getFilesDir()
* Context.getFilesDir()}.
* </dd>
* <dt>
* <pre>
*&lt;cache-path name="<i>name</i>" path="<i>path</i>" /&gt;
*</pre>
* <dt>
* <dd>
* Represents files in the cache subdirectory of your app's internal storage area. The root path
* of this subdirectory is the same as the value returned by {@link Context#getCacheDir()
* getCacheDir()}.
* </dd>
* <dt>
* <pre class="prettyprint">
*&lt;external-path name="<i>name</i>" path="<i>path</i>" /&gt;
*</pre>
* </dt>
* <dd>
* Represents files in the root of the external storage area. The root path of this subdirectory
* is the same as the value returned by
* {@link Environment#getExternalStorageDirectory() Environment.getExternalStorageDirectory()}.
* </dd>
* <dt>
* <pre class="prettyprint">
*&lt;external-files-path name="<i>name</i>" path="<i>path</i>" /&gt;
*</pre>
* </dt>
* <dd>
* Represents files in the root of your app's external storage area. The root path of this
* subdirectory is the same as the value returned by
* {@code Context#getExternalFilesDir(String) Context.getExternalFilesDir(null)}.
* </dd>
* <dt>
* <pre class="prettyprint">
*&lt;external-cache-path name="<i>name</i>" path="<i>path</i>" /&gt;
*</pre>
* </dt>
* <dd>
* Represents files in the root of your app's external cache area. The root path of this
* subdirectory is the same as the value returned by
* {@link Context#getExternalCacheDir() Context.getExternalCacheDir()}.
* </dd>
* </dl>
* <p>
* These child elements all use the same attributes:
* </p>
* <dl>
* <dt>
* <code>name="<i>name</i>"</code>
* </dt>
* <dd>
* A URI path segment. To enforce security, this value hides the name of the subdirectory
* you're sharing. The subdirectory name for this value is contained in the
* <code>path</code> attribute.
* </dd>
* <dt>
* <code>path="<i>path</i>"</code>
* </dt>
* <dd>
* The subdirectory you're sharing. While the <code>name</code> attribute is a URI path
* segment, the <code>path</code> value is an actual subdirectory name. Notice that the
* value refers to a <b>subdirectory</b>, not an individual file or files. You can't
* share a single file by its file name, nor can you specify a subset of files using
* wildcards.
* </dd>
* </dl>
* <p>
* You must specify a child element of <code>&lt;paths&gt;</code> for each directory that contains
* files for which you want content URIs. For example, these XML elements specify two directories:
* <pre class="prettyprint">
*&lt;paths xmlns:android="http://schemas.android.com/apk/res/android"&gt;
* &lt;files-path name="my_images" path="images/"/&gt;
* &lt;files-path name="my_docs" path="docs/"/&gt;
*&lt;/paths&gt;
*</pre>
* <p>
* Put the <code>&lt;paths&gt;</code> element and its children in an XML file in your project.
* For example, you can add them to a new file called <code>res/xml/file_paths.xml</code>.
* To link this file to the FileProvider, add a
* <a href="{@docRoot}guide/topics/manifest/meta-data-element.html">&lt;meta-data&gt;</a> element
* as a child of the <code>&lt;provider&gt;</code> element that defines the FileProvider. Set the
* <code>&lt;meta-data&gt;</code> element's "android:name" attribute to
* <code>android.support.FILE_PROVIDER_PATHS</code>. Set the element's "android:resource" attribute
* to <code>&#64;xml/file_paths</code> (notice that you don't specify the <code>.xml</code>
* extension). For example:
* <pre class="prettyprint">
*&lt;provider
* android:name="android.support.v4.content.FileProvider"
* android:authorities="com.mydomain.fileprovider"
* android:exported="false"
* android:grantUriPermissions="true"&gt;
* &lt;meta-data
* android:name="android.support.FILE_PROVIDER_PATHS"
* android:resource="&#64;xml/file_paths" /&gt;
*&lt;/provider&gt;
*</pre>
* <h3 id="GetUri">Generating the Content URI for a File</h3>
* <p>
* To share a file with another app using a content URI, your app has to generate the content URI.
* To generate the content URI, create a new {@link File} for the file, then pass the {@link File}
* to {@link #getUriForFile(Context, String, File) getUriForFile()}. You can send the content URI
* returned by {@link #getUriForFile(Context, String, File) getUriForFile()} to another app in an
* {@link android.content.Intent}. The client app that receives the content URI can open the file
* and access its contents by calling
* {@link android.content.ContentResolver#openFileDescriptor(Uri, String)
* ContentResolver.openFileDescriptor} to get a {@link ParcelFileDescriptor}.
* <p>
* For example, suppose your app is offering files to other apps with a FileProvider that has the
* authority <code>com.mydomain.fileprovider</code>. To get a content URI for the file
* <code>default_image.jpg</code> in the <code>images/</code> subdirectory of your internal storage
* add the following code:
* <pre class="prettyprint">
*File imagePath = new File(Context.getFilesDir(), "images");
*File newFile = new File(imagePath, "default_image.jpg");
*Uri contentUri = getUriForFile(getContext(), "com.mydomain.fileprovider", newFile);
*</pre>
* As a result of the previous snippet,
* {@link #getUriForFile(Context, String, File) getUriForFile()} returns the content URI
* <code>content://com.mydomain.fileprovider/my_images/default_image.jpg</code>.
* <h3 id="Permissions">Granting Temporary Permissions to a URI</h3>
* To grant an access permission to a content URI returned from
* {@link #getUriForFile(Context, String, File) getUriForFile()}, do one of the following:
* <ul>
* <li>
* Call the method
* {@link Context#grantUriPermission(String, Uri, int)
* Context.grantUriPermission(package, Uri, mode_flags)} for the <code>content://</code>
* {@link Uri}, using the desired mode flags. This grants temporary access permission for the
* content URI to the specified package, according to the value of the
* the <code>mode_flags</code> parameter, which you can set to
* {@link Intent#FLAG_GRANT_READ_URI_PERMISSION}, {@link Intent#FLAG_GRANT_WRITE_URI_PERMISSION}
* or both. The permission remains in effect until you revoke it by calling
* {@link Context#revokeUriPermission(Uri, int) revokeUriPermission()} or until the device
* reboots.
* </li>
* <li>
* Put the content URI in an {@link Intent} by calling {@link Intent#setData(Uri) setData()}.
* </li>
* <li>
* Next, call the method {@link Intent#setFlags(int) Intent.setFlags()} with either
* {@link Intent#FLAG_GRANT_READ_URI_PERMISSION} or
* {@link Intent#FLAG_GRANT_WRITE_URI_PERMISSION} or both.
* </li>
* <li>
* Finally, send the {@link Intent} to
* another app. Most often, you do this by calling
* {@link android.app.Activity#setResult(int, android.content.Intent) setResult()}.
* <p>
* Permissions granted in an {@link Intent} remain in effect while the stack of the receiving
* {@link android.app.Activity} is active. When the stack finishes, the permissions are
* automatically removed. Permissions granted to one {@link android.app.Activity} in a client
* app are automatically extended to other components of that app.
* </p>
* </li>
* </ul>
* <h3 id="ServeUri">Serving a Content URI to Another App</h3>
* <p>
* There are a variety of ways to serve the content URI for a file to a client app. One common way
* is for the client app to start your app by calling
* {@link android.app.Activity#startActivityForResult(Intent, int, Bundle) startActivityResult()},
* which sends an {@link Intent} to your app to start an {@link android.app.Activity} in your app.
* In response, your app can immediately return a content URI to the client app or present a user
* interface that allows the user to pick a file. In the latter case, once the user picks the file
* your app can return its content URI. In both cases, your app returns the content URI in an
* {@link Intent} sent via {@link android.app.Activity#setResult(int, Intent) setResult()}.
* </p>
* <p>
* You can also put the content URI in a {@link android.content.ClipData} object and then add the
* object to an {@link Intent} you send to a client app. To do this, call
* {@link Intent#setClipData(ClipData) Intent.setClipData()}. When you use this approach, you can
* add multiple {@link android.content.ClipData} objects to the {@link Intent}, each with its own
* content URI. When you call {@link Intent#setFlags(int) Intent.setFlags()} on the {@link Intent}
* to set temporary access permissions, the same permissions are applied to all of the content
* URIs.
* </p>
* <p class="note">
* <strong>Note:</strong> The {@link Intent#setClipData(ClipData) Intent.setClipData()} method is
* only available in platform version 16 (Android 4.1) and later. If you want to maintain
* compatibility with previous versions, you should send one content URI at a time in the
* {@link Intent}. Set the action to {@link Intent#ACTION_SEND} and put the URI in data by calling
* {@link Intent#setData setData()}.
* </p>
* <h3 id="">More Information</h3>
* <p>
* To learn more about FileProvider, see the Android training class
* <a href="{@docRoot}training/secure-file-sharing/index.html">Sharing Files Securely with URIs</a>.
* </p>
*/
public class FileProvider extends ContentProvider {
private static final String[] COLUMNS = {
MediaStore.MediaColumns.DISPLAY_NAME,
MediaStore.MediaColumns.SIZE,
MediaStore.MediaColumns.DATA
};
private static final String
META_DATA_FILE_PROVIDER_PATHS = "android.support.FILE_PROVIDER_PATHS";
private static final String TAG_ROOT_PATH = "root-path";
private static final String TAG_FILES_PATH = "files-path";
private static final String TAG_CACHE_PATH = "cache-path";
private static final String TAG_EXTERNAL = "external-path";
private static final String TAG_EXTERNAL_FILES = "external-files-path";
private static final String TAG_EXTERNAL_CACHE = "external-cache-path";
private static final String ATTR_NAME = "name";
private static final String ATTR_PATH = "path";
private static final File DEVICE_ROOT = new File("/");
// @GuardedBy("sCache")
private static HashMap<String, PathStrategy> sCache = new HashMap<String, PathStrategy>();
private PathStrategy mStrategy;
/**
* The default FileProvider implementation does not need to be initialized. If you want to
* override this method, you must provide your own subclass of FileProvider.
*/
@Override
public boolean onCreate() {
return true;
}
/**
* After the FileProvider is instantiated, this method is called to provide the system with
* information about the provider.
*
* @param context A {@link Context} for the current component.
* @param info A {@link ProviderInfo} for the new provider.
*/
@Override
public void attachInfo(Context context, ProviderInfo info) {
super.attachInfo(context, info);
// Sanity check our security
if (info.exported) {
throw new SecurityException("Provider must not be exported");
}
if (!info.grantUriPermissions) {
throw new SecurityException("Provider must grant uri permissions");
}
mStrategy = getPathStrategy(context, info.authority);
}
/**
* Return a content URI for a given {@link File}. Specific temporary
* permissions for the content URI can be set with
* {@link Context#grantUriPermission(String, Uri, int)}, or added
* to an {@link Intent} by calling {@link Intent#setData(Uri) setData()} and then
* {@link Intent#setFlags(int) setFlags()}; in both cases, the applicable flags are
* {@link Intent#FLAG_GRANT_READ_URI_PERMISSION} and
* {@link Intent#FLAG_GRANT_WRITE_URI_PERMISSION}. A FileProvider can only return a
* <code>content</code> {@link Uri} for file paths defined in their <code>&lt;paths&gt;</code>
* meta-data element. See the Class Overview for more information.
*
* @param context A {@link Context} for the current component.
* @param authority The authority of a {@link FileProvider} defined in a
* {@code <provider>} element in your app's manifest.
* @param file A {@link File} pointing to the filename for which you want a
* <code>content</code> {@link Uri}.
* @return A content URI for the file.
* @throws IllegalArgumentException When the given {@link File} is outside
* the paths supported by the provider.
*/
public static Uri getUriForFile(Context context, String authority, File file) {
final PathStrategy strategy = getPathStrategy(context, authority);
return strategy.getUriForFile(file);
}
/**
* Use a content URI returned by
* {@link #getUriForFile(Context, String, File) getUriForFile()} to get information about a file
* managed by the FileProvider.
* FileProvider reports the column names defined in {@link android.provider.MediaStore.MediaColumns}:
* <ul>
* <li>{@link android.provider.MediaStore.MediaColumns#DISPLAY_NAME}</li>
* <li>{@link android.provider.MediaStore.MediaColumns#SIZE}</li>
* <li>{@link android.provider.MediaStore.MediaColumns#DATA}</li>
* </ul>
* For more information, see
* {@link ContentProvider#query(Uri, String[], String, String[], String)
* ContentProvider.query()}.
*
* @param uri A content URI returned by {@link #getUriForFile}.
* @param projection The list of columns to put into the {@link Cursor}. If null all columns are
* included.
* @param selection Selection criteria to apply. If null then all data that matches the content
* URI is returned.
* @param selectionArgs An array of {@link java.lang.String}, containing arguments to bind to
* the <i>selection</i> parameter. The <i>query</i> method scans <i>selection</i> from left to
* right and iterates through <i>selectionArgs</i>, replacing the current "?" character in
* <i>selection</i> with the value at the current position in <i>selectionArgs</i>. The
* values are bound to <i>selection</i> as {@link java.lang.String} values.
* @param sortOrder A {@link java.lang.String} containing the column name(s) on which to sort
* the resulting {@link Cursor}.
* @return A {@link Cursor} containing the results of the query.
*
*/
@Override
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs,
String sortOrder) {
// ContentProvider has already checked granted permissions
final File file = mStrategy.getFileForUri(uri);
if (projection == null) {
projection = COLUMNS;
}
String[] cols = new String[projection.length];
Object[] values = new Object[projection.length];
int i = 0;
for (String col : projection) {
if (MediaStore.MediaColumns.DISPLAY_NAME.equals(col)) {
cols[i] = MediaStore.MediaColumns.DISPLAY_NAME;
values[i++] = file.getName();
} else if (MediaStore.MediaColumns.SIZE.equals(col)) {
cols[i] = MediaStore.MediaColumns.SIZE;
values[i++] = file.length();
} else if (MediaStore.MediaColumns.DATA.equals(col)) {
cols[i] = MediaStore.MediaColumns.DATA;
values[i++] = file.getPath();
}
}
cols = copyOf(cols, i);
values = copyOf(values, i);
final MatrixCursor cursor = new MatrixCursor(cols, 1);
cursor.addRow(values);
return cursor;
}
/**
* Returns the MIME type of a content URI returned by
* {@link #getUriForFile(Context, String, File) getUriForFile()}.
*
* @param uri A content URI returned by
* {@link #getUriForFile(Context, String, File) getUriForFile()}.
* @return If the associated file has an extension, the MIME type associated with that
* extension; otherwise <code>application/octet-stream</code>.
*/
@Override
public String getType(Uri uri) {
// ContentProvider has already checked granted permissions
final File file = mStrategy.getFileForUri(uri);
final int lastDot = file.getName().lastIndexOf('.');
if (lastDot >= 0) {
final String extension = file.getName().substring(lastDot + 1);
final String mime = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
if (mime != null) {
return mime;
}
}
return "application/octet-stream";
}
/**
* By default, this method throws an {@link java.lang.UnsupportedOperationException}. You must
* subclass FileProvider if you want to provide different functionality.
*/
@Override
public Uri insert(Uri uri, ContentValues values) {
throw new UnsupportedOperationException("No external inserts");
}
/**
* By default, this method throws an {@link java.lang.UnsupportedOperationException}. You must
* subclass FileProvider if you want to provide different functionality.
*/
@Override
public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
throw new UnsupportedOperationException("No external updates");
}
/**
* Deletes the file associated with the specified content URI, as
* returned by {@link #getUriForFile(Context, String, File) getUriForFile()}. Notice that this
* method does <b>not</b> throw an {@link java.io.IOException}; you must check its return value.
*
* @param uri A content URI for a file, as returned by
* {@link #getUriForFile(Context, String, File) getUriForFile()}.
* @param selection Ignored. Set to {@code null}.
* @param selectionArgs Ignored. Set to {@code null}.
* @return 1 if the delete succeeds; otherwise, 0.
*/
@Override
public int delete(Uri uri, String selection, String[] selectionArgs) {
// ContentProvider has already checked granted permissions
final File file = mStrategy.getFileForUri(uri);
return file.delete() ? 1 : 0;
}
/**
* By default, FileProvider automatically returns the
* {@link ParcelFileDescriptor} for a file associated with a <code>content://</code>
* {@link Uri}. To get the {@link ParcelFileDescriptor}, call
* {@link android.content.ContentResolver#openFileDescriptor(Uri, String)
* ContentResolver.openFileDescriptor}.
*
* To override this method, you must provide your own subclass of FileProvider.
*
* @param uri A content URI associated with a file, as returned by
* {@link #getUriForFile(Context, String, File) getUriForFile()}.
* @param mode Access mode for the file. May be "r" for read-only access, "rw" for read and
* write access, or "rwt" for read and write access that truncates any existing file.
* @return A new {@link ParcelFileDescriptor} with which you can access the file.
*/
@Override
public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException {
// ContentProvider has already checked granted permissions
final File file = mStrategy.getFileForUri(uri);
final int fileMode = modeToMode(mode);
return ParcelFileDescriptor.open(file, fileMode);
}
/**
* Return {@link PathStrategy} for given authority, either by parsing or
* returning from cache.
*/
private static PathStrategy getPathStrategy(Context context, String authority) {
PathStrategy strat;
synchronized (sCache) {
strat = sCache.get(authority);
if (strat == null) {
try {
strat = parsePathStrategy(context, authority);
} catch (IOException e) {
throw new IllegalArgumentException(
"Failed to parse " + META_DATA_FILE_PROVIDER_PATHS + " meta-data", e);
} catch (XmlPullParserException e) {
throw new IllegalArgumentException(
"Failed to parse " + META_DATA_FILE_PROVIDER_PATHS + " meta-data", e);
}
sCache.put(authority, strat);
}
}
return strat;
}
/**
* Parse and return {@link PathStrategy} for given authority as defined in
* {@link #META_DATA_FILE_PROVIDER_PATHS} {@code <meta-data>}.
*
* @see #getPathStrategy(Context, String)
*/
private static PathStrategy parsePathStrategy(Context context, String authority)
throws IOException, XmlPullParserException {
final SimplePathStrategy strat = new SimplePathStrategy(authority);
final ProviderInfo info = context.getPackageManager()
.resolveContentProvider(authority, PackageManager.GET_META_DATA);
final XmlResourceParser in = info.loadXmlMetaData(
context.getPackageManager(), META_DATA_FILE_PROVIDER_PATHS);
if (in == null) {
throw new IllegalArgumentException(
"Missing " + META_DATA_FILE_PROVIDER_PATHS + " meta-data");
}
int type;
while ((type = in.next()) != END_DOCUMENT) {
if (type == START_TAG) {
final String tag = in.getName();
final String name = in.getAttributeValue(null, ATTR_NAME);
String path = in.getAttributeValue(null, ATTR_PATH);
File target = null;
if (TAG_ROOT_PATH.equals(tag)) {
target = DEVICE_ROOT;
} else if (TAG_FILES_PATH.equals(tag)) {
target = context.getFilesDir();
} else if (TAG_CACHE_PATH.equals(tag)) {
target = context.getCacheDir();
} else if (TAG_EXTERNAL.equals(tag)) {
target = Environment.getExternalStorageDirectory();
} else if (TAG_EXTERNAL_FILES.equals(tag)) {
File[] externalFilesDirs = ContextCompat.getExternalFilesDirs(context, null);
if (externalFilesDirs.length > 0) {
target = externalFilesDirs[0];
}
} else if (TAG_EXTERNAL_CACHE.equals(tag)) {
File[] externalCacheDirs = ContextCompat.getExternalCacheDirs(context);
if (externalCacheDirs.length > 0) {
target = externalCacheDirs[0];
}
}
if (target != null) {
strat.addRoot(name, buildPath(target, path));
}
}
}
return strat;
}
/**
* Strategy for mapping between {@link File} and {@link Uri}.
* <p>
* Strategies must be symmetric so that mapping a {@link File} to a
* {@link Uri} and then back to a {@link File} points at the original
* target.
* <p>
* Strategies must remain consistent across app launches, and not rely on
* dynamic state. This ensures that any generated {@link Uri} can still be
* resolved if your process is killed and later restarted.
*
* @see SimplePathStrategy
*/
interface PathStrategy {
/**
* Return a {@link Uri} that represents the given {@link File}.
*/
public Uri getUriForFile(File file);
/**
* Return a {@link File} that represents the given {@link Uri}.
*/
public File getFileForUri(Uri uri);
}
/**
* Strategy that provides access to files living under a narrow whitelist of
* filesystem roots. It will throw {@link SecurityException} if callers try
* accessing files outside the configured roots.
* <p>
* For example, if configured with
* {@code addRoot("myfiles", context.getFilesDir())}, then
* {@code context.getFileStreamPath("foo.txt")} would map to
* {@code content://myauthority/myfiles/foo.txt}.
*/
static class SimplePathStrategy implements PathStrategy {
private final String mAuthority;
private final HashMap<String, File> mRoots = new HashMap<String, File>();
public SimplePathStrategy(String authority) {
mAuthority = authority;
}
/**
* Add a mapping from a name to a filesystem root. The provider only offers
* access to files that live under configured roots.
*/
public void addRoot(String name, File root) {
if (TextUtils.isEmpty(name)) {
throw new IllegalArgumentException("Name must not be empty");
}
try {
// Resolve to canonical path to keep path checking fast
root = root.getCanonicalFile();
} catch (IOException e) {
throw new IllegalArgumentException(
"Failed to resolve canonical path for " + root, e);
}
mRoots.put(name, root);
}
@Override
public Uri getUriForFile(File file) {
String path;
try {
path = file.getCanonicalPath();
} catch (IOException e) {
throw new IllegalArgumentException("Failed to resolve canonical path for " + file);
}
// Find the most-specific root path
Map.Entry<String, File> mostSpecific = null;
for (Map.Entry<String, File> root : mRoots.entrySet()) {
final String rootPath = root.getValue().getPath();
if (path.startsWith(rootPath) && (mostSpecific == null
|| rootPath.length() > mostSpecific.getValue().getPath().length())) {
mostSpecific = root;
}
}
if (mostSpecific == null) {
throw new IllegalArgumentException(
"Failed to find configured root that contains " + path);
}
// Start at first char of path under root
final String rootPath = mostSpecific.getValue().getPath();
if (rootPath.endsWith("/")) {
path = path.substring(rootPath.length());
} else {
path = path.substring(rootPath.length() + 1);
}
// Encode the tag and path separately
path = Uri.encode(mostSpecific.getKey()) + '/' + Uri.encode(path, "/");
return new Uri.Builder().scheme("content")
.authority(mAuthority).encodedPath(path).build();
}
@Override
public File getFileForUri(Uri uri) {
String path = uri.getEncodedPath();
final int splitIndex = path.indexOf('/', 1);
final String tag = Uri.decode(path.substring(1, splitIndex));
path = Uri.decode(path.substring(splitIndex + 1));
final File root = mRoots.get(tag);
if (root == null) {
throw new IllegalArgumentException("Unable to find configured root for " + uri);
}
File file = new File(root, path);
try {
file = file.getCanonicalFile();
} catch (IOException e) {
throw new IllegalArgumentException("Failed to resolve canonical path for " + file);
}
if (!file.getPath().startsWith(root.getPath())) {
throw new SecurityException("Resolved path jumped beyond configured root");
}
return file;
}
}
/**
* Copied from ContentResolver.java
*/
private static int modeToMode(String mode) {
int modeBits;
if ("r".equals(mode)) {
modeBits = ParcelFileDescriptor.MODE_READ_ONLY;
} else if ("w".equals(mode) || "wt".equals(mode)) {
modeBits = ParcelFileDescriptor.MODE_WRITE_ONLY
| ParcelFileDescriptor.MODE_CREATE
| ParcelFileDescriptor.MODE_TRUNCATE;
} else if ("wa".equals(mode)) {
modeBits = ParcelFileDescriptor.MODE_WRITE_ONLY
| ParcelFileDescriptor.MODE_CREATE
| ParcelFileDescriptor.MODE_APPEND;
} else if ("rw".equals(mode)) {
modeBits = ParcelFileDescriptor.MODE_READ_WRITE
| ParcelFileDescriptor.MODE_CREATE;
} else if ("rwt".equals(mode)) {
modeBits = ParcelFileDescriptor.MODE_READ_WRITE
| ParcelFileDescriptor.MODE_CREATE
| ParcelFileDescriptor.MODE_TRUNCATE;
} else {
throw new IllegalArgumentException("Invalid mode: " + mode);
}
return modeBits;
}
private static File buildPath(File base, String... segments) {
File cur = base;
for (String segment : segments) {
if (segment != null) {
cur = new File(cur, segment);
}
}
return cur;
}
private static String[] copyOf(String[] original, int newLength) {
final String[] result = new String[newLength];
System.arraycopy(original, 0, result, 0, newLength);
return result;
}
private static Object[] copyOf(Object[] original, int newLength) {
final Object[] result = new Object[newLength];
System.arraycopy(original, 0, result, 0, newLength);
return result;
}
}
@@ -54,8 +54,8 @@ import com.hippo.yorozuya.SimpleHandler;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.WeakHashMap;
import java.util.concurrent.TimeUnit;
import okhttp3.Cookie;
@@ -76,7 +76,7 @@ public class EhApplication extends SceneApplication implements Thread.UncaughtEx
private Thread.UncaughtExceptionHandler mDefaultHandler;
private final IntIdGenerator mIdGenerator = new IntIdGenerator();
private final WeakHashMap<Integer, Object> mGlobalStuffMap = new WeakHashMap<>();
private final HashMap<Integer, Object> mGlobalStuffMap = new HashMap<>();
private EhCookieStore mEhCookieStore;
private EhClient mEhClient;
private OkHttpClient mOkHttpClient;
@@ -449,7 +449,7 @@ public class EhDB {
public static synchronized List<GalleryInfo> getAllLocalFavorites() {
LocalFavoritesDao dao = sDaoSession.getLocalFavoritesDao();
List<LocalFavoriteInfo> list = dao.queryBuilder().orderAsc(LocalFavoritesDao.Properties.Time).list();
List<LocalFavoriteInfo> list = dao.queryBuilder().orderDesc(LocalFavoritesDao.Properties.Time).list();
List<GalleryInfo> result = new ArrayList<>();
result.addAll(list);
return result;
@@ -458,7 +458,7 @@ public class EhDB {
public static synchronized List<GalleryInfo> searchLocalFavorites(String query) {
query = SqlUtils.sqlEscapeString("%" + query+ "%");
LocalFavoritesDao dao = sDaoSession.getLocalFavoritesDao();
List<LocalFavoriteInfo> list = dao.queryBuilder().orderAsc(LocalFavoritesDao.Properties.Time)
List<LocalFavoriteInfo> list = dao.queryBuilder().orderDesc(LocalFavoritesDao.Properties.Time)
.where(LocalFavoritesDao.Properties.Title.like(query)).list();
List<GalleryInfo> result = new ArrayList<>();
result.addAll(list);
+17
View File
@@ -300,6 +300,13 @@ public class Settings {
return getIntFromStr(KEY_THUMB_RESOLUTION, DEFAULT_THUMB_RESOLUTION);
}
private static final String KEY_FIX_THUMB_URL = "fix_thumb_url";
private static final boolean DEFAULT_FIX_THUMB_URL = false;
public static boolean getFixThumbUrl() {
return getBoolean(KEY_FIX_THUMB_URL, DEFAULT_FIX_THUMB_URL);
}
private static final String KEY_SHOW_JPN_TITLE = "show_jpn_title";
private static final boolean DEFAULT_SHOW_JPN_TITLE = false;
@@ -904,6 +911,16 @@ public class Settings {
putString(KEY_SECURITY, value);
}
public static final String KEY_ENABLE_FINGERPRINT = "enable_fingerprint";
public static boolean getEnableFingerprint() {
return getBoolean(KEY_ENABLE_FINGERPRINT, false);
}
public static void putEnableFingerprint(boolean value) {
putBoolean(KEY_ENABLE_FINGERPRINT, value);
}
public static final String KEY_READ_CACHE_SIZE = "read_cache_size";
public static final int DEFAULT_READ_CACHE_SIZE = 160;
@@ -59,6 +59,8 @@ public class EhClient {
public static final int METHOD_GET_PROFILE = 14;
public static final int METHOD_VOTE_COMMENT = 15;
public static final int METHOD_IMAGE_SEARCH = 16;
public static final int METHOD_ARCHIVE_LIST = 17;
public static final int METHOD_DOWNLOAD_ARCHIVE = 18;
private final ThreadPoolExecutor mRequestThreadPool;
private final OkHttpClient mOkHttpClient;
@@ -184,6 +186,10 @@ public class EhClient {
return EhEngine.voteComment(this, mOkHttpClient, (Long) params[0], (String) params[1], (Long) params[2], (String) params[3], (Long) params[4], (Integer) params[5]);
case METHOD_IMAGE_SEARCH:
return EhEngine.imageSearch(this, mOkHttpClient, (File) params[0], (Boolean) params[1], (Boolean) params[2], (Boolean) params[3]);
case METHOD_ARCHIVE_LIST:
return EhEngine.getArchiveList(this, mOkHttpClient, (String) params[0]);
case METHOD_DOWNLOAD_ARCHIVE:
return EhEngine.downloadArchive(this, mOkHttpClient, (Long) params[0], (String) params[1], (String) params[2], (String) params[3]);
default:
return new IllegalStateException("Can't detect method " + mMethod);
}
@@ -299,6 +299,7 @@ public class EhConfig implements Cloneable {
public static final int NAMESPACES_MALE = 0x40;
public static final int NAMESPACES_FEMALE = 0x80;
public static final String JAPANESE_ORIGINAL = "0";
public static final String JAPANESE_TRANSLATED = "1024";
public static final String JAPANESE_REWRITE = "2048";
public static final String ENGLISH_ORIGINAL = "1";
@@ -35,7 +35,7 @@ public class EhCookieStore extends CookieDBStore {
new Cookie.Builder()
.name(EhConfig.KEY_CONTENT_WARNING)
.value(EhConfig.CONTENT_WARNING_NOT_SHOW)
.domain(EhUrl.DOMAIN_G)
.domain(EhUrl.DOMAIN_E)
.path("/")
.expiresAt(Long.MAX_VALUE)
.build();
@@ -83,7 +83,7 @@ public class EhCookieStore extends CookieDBStore {
Object tag = request.tag();
String host = url.host();
boolean checkTips = domainMatch(host, EhUrl.DOMAIN_G);
boolean checkTips = domainMatch(host, EhUrl.DOMAIN_E);
boolean checkUconfig = (domainMatch(host, EhUrl.DOMAIN_E) || domainMatch(host, EhUrl.DOMAIN_EX)) && tag instanceof EhConfig;
if (checkTips || checkUconfig) {
@@ -30,7 +30,9 @@ import com.hippo.ehviewer.client.data.GalleryInfo;
import com.hippo.ehviewer.client.data.PreviewSet;
import com.hippo.ehviewer.client.exception.CancelledException;
import com.hippo.ehviewer.client.exception.EhException;
import com.hippo.ehviewer.client.exception.NoHAtHClientException;
import com.hippo.ehviewer.client.exception.ParseException;
import com.hippo.ehviewer.client.parser.ArchiveParser;
import com.hippo.ehviewer.client.parser.FavoritesParser;
import com.hippo.ehviewer.client.parser.ForumsParser;
import com.hippo.ehviewer.client.parser.GalleryApiParser;
@@ -56,6 +58,8 @@ import org.jsoup.nodes.Document;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import okhttp3.Call;
import okhttp3.FormBody;
@@ -78,6 +82,8 @@ public class EhEngine {
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");
private static final Pattern PATTERN_NEED_HATH_CLIENT = Pattern.compile("(You must have a H@H client assigned to your account to use this feature\\.)");
public static EhFilter sEhFilter;
public static void initialize() {
@@ -200,6 +206,10 @@ public class EhEngine {
}
}
for (GalleryInfo info : list) {
info.thumb = EhUrl.getFixedPreviewThumbUrl(info.thumb);
}
return result;
}
@@ -448,6 +458,10 @@ public class EhEngine {
fillGalleryListByApi(task, okHttpClient, result.galleryInfoList);
}
for (GalleryInfo info : result.galleryInfoList) {
info.thumb = EhUrl.getFixedPreviewThumbUrl(info.thumb);
}
return result;
}
@@ -555,6 +569,10 @@ public class EhEngine {
fillGalleryListByApi(task, okHttpClient, result.galleryInfoList);
}
for (GalleryInfo info : result.galleryInfoList) {
info.thumb = EhUrl.getFixedPreviewThumbUrl(info.thumb);
}
return result;
}
@@ -587,9 +605,82 @@ public class EhEngine {
return result;
}
public static Pair<String, Pair<String, String>[]> getArchiveList(@Nullable EhClient.Task task, OkHttpClient okHttpClient,
String url) throws Exception {
Log.d(TAG, url);
Request request = new EhRequestBuilder(url, null != task ? task.getEhConfig() : Settings.getEhConfig()).build();
Call call = okHttpClient.newCall(request);
// Put call
if (null != task) {
task.setCall(call);
}
String body = null;
Headers headers = null;
Pair<String, Pair<String, String>[]> result;
int code = -1;
try {
Response response = call.execute();
code = response.code();
headers = response.headers();
body = response.body().string();
result = ArchiveParser.parse(body);
} catch (Exception e) {
throwException(call, code, headers, body, e);
throw e;
}
return result;
}
public static Void downloadArchive(@Nullable EhClient.Task task, OkHttpClient okHttpClient,
long gid, String token, String or, String res) throws Exception {
if (or == null || or.length() == 0) {
throw new EhException("Invalid form param or: " + or);
}
if (res == null || res.length() == 0) {
throw new EhException("Invalid res: " + res);
}
FormBody.Builder builder = new FormBody.Builder();
builder.add("hathdl_xres", res);
String url = EhUrl.getDownloadArchive(gid, token, or);
Log.d(TAG, url);
Request request = new EhRequestBuilder(url, null != task ? task.getEhConfig() : Settings.getEhConfig())
.post(builder.build())
.build();
Call call = okHttpClient.newCall(request);
// Put call
if (null != task) {
task.setCall(call);
}
String body = null;
Headers headers = null;
int code = -1;
try {
Response response = call.execute();
code = response.code();
headers = response.headers();
body = response.body().string();
throwException(call, code, headers, body, null);
} catch (Exception e) {
throwException(call, code, headers, body, e);
throw e;
}
Matcher m = PATTERN_NEED_HATH_CLIENT.matcher(body);
if (m.find()) {
throw new NoHAtHClientException("No H@H client");
}
return null;
}
public static List<GalleryInfo> getWhatsHot(@Nullable EhClient.Task task,
OkHttpClient okHttpClient) throws Exception {
String url = EhUrl.HOST_G;
String url = EhUrl.HOST_E;
Log.d(TAG, url);
Request request = new EhRequestBuilder(url, null != task ? task.getEhConfig() : Settings.getEhConfig()).build();
Call call = okHttpClient.newCall(request);
@@ -619,6 +710,10 @@ public class EhEngine {
fillGalleryListByApi(task, okHttpClient, list);
}
for (GalleryInfo info : list) {
info.thumb = EhUrl.getFixedPreviewThumbUrl(info.thumb);
}
return list;
}
@@ -802,6 +897,10 @@ public class EhEngine {
}
}
for (GalleryInfo info : list) {
info.thumb = EhUrl.getFixedPreviewThumbUrl(info.thumb);
}
return result;
}
@@ -21,31 +21,40 @@ import android.support.annotation.NonNull;
import com.hippo.ehviewer.Settings;
import com.hippo.network.UrlBuilder;
import java.util.List;
import java.util.ListIterator;
import okhttp3.HttpUrl;
public class EhUrl {
public static final int SITE_G = 0;
public static final int SITE_E = 0;
public static final int SITE_EX = 1;
public static final String DOMAIN_EX = "exhentai.org";
public static final String DOMAIN_E = "e-hentai.org";
public static final String DOMAIN_G = "g.e-hentai.org";
public static final String DOMAIN_LOFI = "lofi.e-hentai.org";
public static final String HOST_E = "http://" + DOMAIN_E + "/";
public static final String HOST_EX = "http://" + DOMAIN_EX + "/";
public static final String HOST_G = "http://" + DOMAIN_G + "/";
public static final String HOST_EX = "https://" + DOMAIN_EX + "/";
public static final String HOST_E = "https://" + DOMAIN_E + "/";
public static final String API_SIGN_IN = "http://forums.e-hentai.org/index.php?act=Login&CODE=01";
public static final String API_SIGN_IN = "https://forums.e-hentai.org/index.php?act=Login&CODE=01";
public static final String API_G = HOST_G + "api.php";
public static final String API_E = HOST_E + "api.php";
public static final String API_EX = HOST_EX + "api.php";
public static final String URL_SIGN_IN = "http://forums.e-hentai.org/index.php?act=Login";
public static final String URL_REGISTER = "http://forums.e-hentai.org/index.php?act=Reg&CODE=00";
public static final String URL_FAVORITES_G = HOST_G + "favorites.php";
public static final String URL_IMAGE_SEARCH_E = "https://upload.e-hentai.org/image_lookup.php";
public static final String URL_IMAGE_SEARCH_EX = "https://exhentai.org/upload/image_lookup.php";
public static final String URL_SIGN_IN = "https://forums.e-hentai.org/index.php?act=Login";
public static final String URL_REGISTER = "https://forums.e-hentai.org/index.php?act=Reg&CODE=00";
public static final String URL_FAVORITES_E = HOST_E + "favorites.php";
public static final String URL_FAVORITES_EX = HOST_EX + "favorites.php";
public static final String URL_FORUMS = "https://forums.e-hentai.org/";
private static final String URL_PREFIX_THUMB_E = "https://ehgt.org/t/";
private static final String URL_PREFIX_THUMB_EX = "https://exhentai.org/t/";
public static String getGalleryDetailUrl(long gid, String token) {
return getGalleryDetailUrl(gid, token, 0, false);
}
@@ -53,8 +62,8 @@ public class EhUrl {
public static String getHost() {
switch (Settings.getGallerySite()) {
default:
case SITE_G:
return HOST_G;
case SITE_E:
return HOST_E;
case SITE_EX:
return HOST_EX;
}
@@ -63,8 +72,8 @@ public class EhUrl {
public static String getFavoritesUrl() {
switch (Settings.getGallerySite()) {
default:
case SITE_G:
return URL_FAVORITES_G;
case SITE_E:
return URL_FAVORITES_E;
case SITE_EX:
return URL_FAVORITES_EX;
}
@@ -73,8 +82,8 @@ public class EhUrl {
public static String getApiUrl() {
switch (Settings.getGallerySite()) {
default:
case SITE_G:
return API_G;
case SITE_E:
return API_E;
case SITE_EX:
return API_EX;
}
@@ -99,6 +108,10 @@ public class EhUrl {
return getHost() + "gallerypopups.php?gid=" + gid + "&t=" + token + "&act=addfav";
}
public static String getDownloadArchive(long gid, String token, String or) {
return getHost() + "archiver.php?gid=" + gid + "&token=" + token + "&or=" + or;
}
public static String getTagDefinitionUrl(String tag) {
return "https://ehwiki.org/wiki/" + tag.replace(' ', '_');
}
@@ -107,10 +120,50 @@ public class EhUrl {
public static String getImageSearchUrl() {
switch (Settings.getGallerySite()) {
default:
case SITE_G:
return "http://ul.e-hentai.org/image_lookup.php";
case SITE_E:
return URL_IMAGE_SEARCH_E;
case SITE_EX:
return "http://ul.exhentai.org/image_lookup.php";
return URL_IMAGE_SEARCH_EX;
}
}
public static String getThumbUrlPrefix() {
switch (Settings.getGallerySite()) {
default:
//case SITE_E:
return URL_PREFIX_THUMB_E;
//case SITE_EX:
// return URL_PREFIX_THUMB_EX;
}
}
public static String getFixedPreviewThumbUrl(String originUrl) {
HttpUrl url = HttpUrl.parse(originUrl);
if (url == null) return originUrl;
List<String> pathSegments = url.pathSegments();
if (pathSegments == null || pathSegments.size() < 3) return originUrl;
ListIterator<String> iterator = pathSegments.listIterator(pathSegments.size());
// The last segments, like
// 317a1a254cd9c3269e71b2aa2671fe8d28c91097-260198-640-480-png_250.jpg
if (!iterator.hasPrevious()) return originUrl;
String lastSegment = iterator.previous();
// The second last segments, like
// 7a
if (!iterator.hasPrevious()) return originUrl;
String secondLastSegment = iterator.previous();
// The third last segments, like
// 31
if (!iterator.hasPrevious()) return originUrl;
String thirdLastSegment = iterator.previous();
// Check path segments
if (lastSegment != null && secondLastSegment != null
&& thirdLastSegment != null
&& lastSegment.startsWith(thirdLastSegment)
&& lastSegment.startsWith(secondLastSegment, thirdLastSegment.length())) {
return getThumbUrlPrefix() + thirdLastSegment + "/" + secondLastSegment + "/" + lastSegment;
} else {
return originUrl;
}
}
}
@@ -27,6 +27,7 @@ public class GalleryDetail extends GalleryInfo {
public String apiKey;
public int torrentCount;
public String torrentUrl;
public String archiveUrl;
public String parent;
public String visible;
public String language;
@@ -50,6 +51,7 @@ public class GalleryDetail extends GalleryInfo {
super.writeToParcel(dest, flags);
dest.writeInt(this.torrentCount);
dest.writeString(this.torrentUrl);
dest.writeString(this.archiveUrl);
dest.writeString(this.parent);
dest.writeString(this.visible);
dest.writeString(this.language);
@@ -71,6 +73,7 @@ public class GalleryDetail extends GalleryInfo {
super(in);
this.torrentCount = in.readInt();
this.torrentUrl = in.readString();
this.archiveUrl = in.readString();
this.parent = in.readString();
this.visible = in.readString();
this.language = in.readString();
@@ -0,0 +1,25 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client.exception;
public class NoHAtHClientException extends EhException {
public NoHAtHClientException(String detailMessage) {
super(detailMessage);
}
}
@@ -0,0 +1,48 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.client.parser;
import android.util.Pair;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class ArchiveParser {
private static final Pattern PATTERN_FORM = Pattern.compile("<form id=\"hathdl_form\" action=\"[^\"]*?or=([^=\"]*?)\" method=\"post\">");
private static final Pattern PATTERN_ARCHIVE = Pattern.compile("<a href=\"[^\"]*\" onclick=\"return do_hathdl\\('([0-9]+|org)'\\)\">([^<]+)</a>");
@SuppressWarnings("unchecked")
public static Pair<String, Pair<String, String>[]> parse(String body) {
Matcher m = PATTERN_FORM.matcher(body);
if (!m.find()) {
return new Pair<String, Pair<String, String>[]>("", new Pair[0]);
}
String paramOr = m.group(1);
List<Pair<String, String>> archiveList = new ArrayList<>();
m = PATTERN_ARCHIVE.matcher(body);
while (m.find()) {
String res = ParserUtils.trim(m.group(1));
String name = ParserUtils.trim(m.group(2));
Pair<String, String> item = new Pair<>(res, name);
archiveList.add(item);
}
return new Pair<String, Pair<String, String>[]>(paramOr, archiveList.toArray(new Pair[archiveList.size()]));
}
}
@@ -20,6 +20,8 @@ import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import com.hippo.ehviewer.Settings;
import com.hippo.ehviewer.client.EhUrl;
import com.hippo.ehviewer.client.EhUtils;
import com.hippo.ehviewer.client.data.GalleryComment;
import com.hippo.ehviewer.client.data.GalleryDetail;
@@ -56,6 +58,8 @@ public class GalleryDetailParser {
private static final Pattern PATTERN_ERROR = Pattern.compile("<div class=\"d\">\n<p>([^<]+)</p>");
private static final Pattern PATTERN_DETAIL = Pattern.compile("var gid = (\\d+);.+?var token = \"([a-f0-9]+)\";.+?var apiuid = ([\\-\\d]+);.+?var apikey = \"([a-f0-9]+)\";", Pattern.DOTALL);
private static final Pattern PATTERN_TORRENT = Pattern.compile("<a[^<>]*onclick=\"return popUp\\('([^']+)'[^)]+\\)\">Torrent Download \\( (\\d+) \\)</a>");
private static final Pattern PATTERN_ARCHIVE = Pattern.compile("<a[^<>]*onclick=\"return popUp\\('([^']+)'[^)]+\\)\">Archive Download</a>");
private static final Pattern PATTERN_COVER = Pattern.compile("width:(\\d+)px; height:(\\d+)px.+?url\\((.+?)\\)");
private static final Pattern PATTERN_TAG_GROUP = Pattern.compile("<tr><td[^<>]+>([\\w\\s]+):</td><td>(?:<div[^<>]+><a[^<>]+>[\\w\\s]+</a></div>)+</td></tr>");
private static final Pattern PATTERN_TAG = Pattern.compile("<div[^<>]+><a[^<>]+>([\\w\\s]+)</a></div>");
private static final Pattern PATTERN_COMMENT = Pattern.compile("<div class=\"c3\">Posted on ([^<>]+) by: &nbsp; <a[^<>]+>([^<>]+)</a>.+?<div class=\"c6\"[^>]*>(.+?)</div><div class=\"c[78]\"");
@@ -124,13 +128,20 @@ public class GalleryDetailParser {
gd.torrentUrl = "";
}
matcher = PATTERN_ARCHIVE.matcher(body);
if (matcher.find()) {
gd.archiveUrl = StringUtils.unescapeXml(StringUtils.trim(matcher.group(1)));
} else {
gd.archiveUrl = "";
}
try {
Element gm = JsoupUtils.getElementByClass(d, "gm");
// Thumb url
Element gd1 = gm.getElementById("gd1");
try {
gd.thumb = EhUtils.handleThumbUrlResolution(StringUtils.trim(gd1.child(0).attr("src")));
gd.thumb = parseCoverStyle(StringUtils.trim(gd1.child(0).attr("style")));
} catch (Exception e) {
gd.thumb = "";
}
@@ -154,7 +165,9 @@ public class GalleryDetailParser {
// Category
Element gdc = gm.getElementById("gdc");
try {
gd.category = EhUtils.getCategory(gdc.child(0).child(0).attr("alt"));
String href = gdc.child(0).attr("href");
String category = href.substring(href.lastIndexOf('/') + 1);
gd.category = EhUtils.getCategory(category);
} catch (Exception e) {
gd.category = EhUtils.UNKNOWN;
}
@@ -219,6 +232,16 @@ public class GalleryDetailParser {
}
}
// width:250px; height:356px; background:transparent url(https://exhentai.org/t/fe/1f/fe1fcfa9bf8fba2f03982eda0aa347cc9d6a6372-145921-1050-1492-jpg_250.jpg) 0 0 no-repeat
private static String parseCoverStyle(String str) {
Matcher matcher = PATTERN_COVER.matcher(str);
if (matcher.find()) {
return EhUtils.handleThumbUrlResolution(matcher.group(3));
} else {
return "";
}
}
private static void parseDetailInfo(GalleryDetail gd, Element e, String body) {
Elements es = e.children();
if (es.size() < 2) {
@@ -511,6 +534,9 @@ public class GalleryDetailParser {
String pageUrl = element.attr("href");
element = element.child(0);
String imageUrl = element.attr("src");
if (Settings.getFixThumbUrl()) {
imageUrl = EhUrl.getFixedPreviewThumbUrl(imageUrl);
}
int index = Integer.parseInt(element.attr("alt")) - 1;
largePreviewSet.addItem(index, imageUrl, pageUrl);
}
@@ -529,8 +555,13 @@ public class GalleryDetailParser {
LargePreviewSet largePreviewSet = new LargePreviewSet();
while (m.find()) {
largePreviewSet.addItem(ParserUtils.parseInt(m.group(2)) - 1,
ParserUtils.trim(m.group(3)), ParserUtils.trim(m.group(1)));
int index = ParserUtils.parseInt(m.group(2)) - 1;
String imageUrl = ParserUtils.trim(m.group(3));
String pageUrl = ParserUtils.trim(m.group(1));
if (Settings.getFixThumbUrl()) {
imageUrl = EhUrl.getFixedPreviewThumbUrl(imageUrl);
}
largePreviewSet.addItem(index, imageUrl, pageUrl);
}
if (largePreviewSet.size() == 0) {
@@ -29,8 +29,8 @@ import java.util.regex.Pattern;
*/
public final class GalleryDetailUrlParser {
public static final Pattern URL_PATTERN = Pattern.compile("http://(?:" +
EhUrl.DOMAIN_EX + "|" + EhUrl.DOMAIN_G + "|" + EhUrl.DOMAIN_LOFI + ")/g/(\\d+)/(\\w+)");
public static final Pattern URL_PATTERN = Pattern.compile("https?://(?:" +
EhUrl.DOMAIN_EX + "|" + EhUrl.DOMAIN_E + "|" + EhUrl.DOMAIN_LOFI + ")/g/(\\d+)/(\\w+)");
@Nullable
public static Result parse(String url) {
@@ -143,18 +143,18 @@ public class GalleryListParser {
// Title (required)
Element it5 = JsoupUtils.getElementByClass(e, "it5");
if (null == it5) {
Log.e(TAG, "Can't parse gallery info title");
Log.e(TAG, "Can't parse gallery info title, step 1");
return null;
}
Elements es = it5.children();
if (null == es || es.size() <= 0) {
Log.e(TAG, "Can't parse gallery info title");
Log.e(TAG, "Can't parse gallery info title, step 2");
return null;
}
Element a = es.get(0);
GalleryDetailUrlParser.Result result = GalleryDetailUrlParser.parse(a.attr("href"));
if (null == result) {
Log.e(TAG, "Can't parse gallery info title");
Log.e(TAG, "Can't parse gallery info title, step 3");
return null;
}
gi.gid = result.gid;
@@ -29,7 +29,7 @@ import java.net.URLDecoder;
public final class GalleryListUrlParser {
private static final String[] VALID_HOSTS = {EhUrl.DOMAIN_EX, EhUrl.DOMAIN_G, EhUrl.DOMAIN_LOFI};
private static final String[] VALID_HOSTS = {EhUrl.DOMAIN_EX, EhUrl.DOMAIN_E, EhUrl.DOMAIN_LOFI};
private static final String PATH_NORMAL = "/";
private static final String PATH_UPLOADER = "/uploader/";
@@ -26,7 +26,7 @@ import java.util.regex.Pattern;
public class GalleryPageParser {
private static final Pattern PATTERN_IMAGE_URL = Pattern.compile("<(?:/iframe|div id=\"i3\")[^>]*><a[^>]+><img[^>]*src=\"(.+?)\"");
private static final Pattern PATTERN_IMAGE_URL = Pattern.compile("<img[^>]*src=\"([^\"]+)\" style");
private static final Pattern PATTERN_SKIP_HATH_KEY = Pattern.compile("onclick=\"return nl\\('([^\\)]+)'\\)");
private static final Pattern PATTERN_ORIGIN_IMAGE_URL = Pattern.compile("<a href=\"([^\"]+)fullimg.php([^\"]+)\">");
@@ -26,8 +26,8 @@ import java.util.regex.Pattern;
*/
public final class GalleryPageUrlParser {
public static final Pattern URL_PATTERN = Pattern.compile("http://(?:" +
EhUrl.DOMAIN_EX + "|" + EhUrl.DOMAIN_G + "|" + EhUrl.DOMAIN_LOFI + ")/s/(\\w+)/(\\d+)-(\\d+)");
public static final Pattern URL_PATTERN = Pattern.compile("https?://(?:" +
EhUrl.DOMAIN_EX + "|" + EhUrl.DOMAIN_E + "|" + EhUrl.DOMAIN_LOFI + ")/s/(\\w+)/(\\d+)-(\\d+)");
public static Result parse(String url) {
if (url == null) {
@@ -25,7 +25,7 @@ import java.util.regex.Pattern;
public class TorrentParser {
private static final Pattern PATTERN_TORRENT = Pattern.compile("<td colspan=\"5\"> &nbsp; <a href=\"([^\"]+)\">([^<]+)</a></td>");
private static final Pattern PATTERN_TORRENT = Pattern.compile("<td colspan=\"5\"> &nbsp; <a href=\"([^\"]+)\"[^<]+>([^<]+)</a></td>");
@SuppressWarnings("unchecked")
public static Pair<String, String>[] parse(String body) {
@@ -0,0 +1,57 @@
/*
* Copyright 2016 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.preference;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.preference.Preference;
import android.util.AttributeSet;
import com.hippo.ehviewer.R;
public class VersionPreference extends Preference {
public VersionPreference(Context context) {
super(context);
init(context);
}
public VersionPreference(Context context, AttributeSet attrs) {
super(context, attrs);
init(context);
}
public VersionPreference(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(context);
}
private void init(Context context) {
setTitle(R.string.settings_about_version);
String version;
try {
PackageInfo pInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
version = pInfo.versionName;
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
version = context.getString(R.string.error_unknown);
}
setSummary(version);
}
}
@@ -1007,14 +1007,27 @@ public final class SpiderQueen implements Runnable {
mGid = mGalleryInfo.gid;
}
private GalleryPageParser.Result getImageUrl(long gid, int index, String pToken,
String skipHathKey) throws Exception {
String url = EhUrl.getPageUrl(gid, index, pToken);
if (skipHathKey != null) {
url = url + "?nl=" + skipHathKey;
private String getPageUrl(long gid, int index, String pToken,
String oldPageUrl, String skipHathKey) {
String pageUrl;
if (oldPageUrl != null) {
pageUrl = oldPageUrl;
} else {
pageUrl = EhUrl.getPageUrl(gid, index, pToken);
}
// Add skipHathKey
if (skipHathKey != null) {
if (pageUrl.contains("?")) {
pageUrl += "&nl=" + skipHathKey;
} else {
pageUrl += "?nl=" + skipHathKey;
}
}
return pageUrl;
}
GalleryPageParser.Result result = EhEngine.getGalleryPage(null, mHttpClient, url);
private GalleryPageParser.Result getImageUrl(int index, String pageUrl) throws Exception {
GalleryPageParser.Result result = EhEngine.getGalleryPage(null, mHttpClient, pageUrl);
if (StringUtils.endsWith(result.imageUrl, URL_509_SUFFIX_ARRAY)) {
// Get 509
// Notify listeners
@@ -1027,21 +1040,25 @@ public final class SpiderQueen implements Runnable {
// false for stop
private boolean downloadImage(long gid, int index, String pToken, boolean force) {
List<String> skipHathKeys = new ArrayList<>(5);
String skipHathKey = null;
String imageUrl;
String error = null;
String pageUrl = null;
boolean interrupt = false;
boolean leakSkipHathKey = false;
// Try twice
for (int i = 0; i < 2; i++) {
if (i > 0 && TextUtils.isEmpty(skipHathKey)) {
// No need to get image url twice without skip hath key
for (int i = 0; i < 5; i++) {
if (leakSkipHathKey) {
break;
}
pageUrl = getPageUrl(gid, index, pToken, pageUrl, skipHathKey);
GalleryPageParser.Result result = null;
try {
result = getImageUrl(gid, index, pToken, skipHathKey);
result = getImageUrl(index, pageUrl);
} catch (Image509Exception e) {
error = GetText.getString(R.string.error_509);
} catch (Exception e) {
@@ -1053,6 +1070,7 @@ public final class SpiderQueen implements Runnable {
}
// Check interrupted
if (Thread.currentThread().isInterrupted()) {
error = "Interrupted";
interrupt = true;
break;
}
@@ -1063,11 +1081,22 @@ public final class SpiderQueen implements Runnable {
imageUrl = result.imageUrl;
}
skipHathKey = result.skipHathKey;
if (!TextUtils.isEmpty(skipHathKey)) {
if (skipHathKeys.contains(skipHathKey)) {
// Duplicate skip hath key, don't run next turn
leakSkipHathKey = true;
} else {
skipHathKeys.add(skipHathKey);
}
} else {
// No skip hath key, don't run next turn
leakSkipHathKey = true;
}
// If it is force request, skip first image
if (force && i == 0) {
continue;
}
//if (force && i == 0) {
// continue;
//}
if (DEBUG_LOG) {
Log.d(TAG, imageUrl);
@@ -1086,6 +1115,7 @@ public final class SpiderQueen implements Runnable {
if (response.code() >= 400) {
// Maybe 404
response.body().close();
error = "Bad code: " + response.code();
continue;
}
ResponseBody responseBody = response.body();
@@ -1132,9 +1162,21 @@ public final class SpiderQueen implements Runnable {
}
os.flush();
// check download size
if (contentLength >= 0) {
if (receivedSize < contentLength) {
Log.e(TAG, "Can't download all of image data");
error = "Incomplete";
continue;
} else if (receivedSize > contentLength) {
Log.w(TAG, "Received data is more than contentLength");
}
}
// Check interrupted
if (Thread.currentThread().isInterrupted()) {
interrupt = true;
error = "Interrupted";
break;
}
@@ -1265,7 +1307,7 @@ public final class SpiderQueen implements Runnable {
if (pToken == null) {
// Interrupted
// Get token failed
updatePageState(index, STATE_FAILED, null);
updatePageState(index, STATE_FAILED, "Interrupted");
return false;
}
@@ -61,6 +61,7 @@ public class ExcludedLanguagesActivity extends ToolbarActivity
};
private static final String[] LANGUAGES = {
EhConfig.JAPANESE_ORIGINAL,
EhConfig.JAPANESE_TRANSLATED,
EhConfig.JAPANESE_REWRITE,
EhConfig.ENGLISH_ORIGINAL,
@@ -207,8 +208,8 @@ public class ExcludedLanguagesActivity extends ToolbarActivity
String pattern = LANGUAGES[j];
if (pattern.equals(language)) {
// Get it
int row = (j + 1) / 3;
int column = (j + 1) % 3;
int row = j / 3;
int column = j % 3;
mSelections[row][column] = true;
break;
}
@@ -282,22 +283,19 @@ public class ExcludedLanguagesActivity extends ToolbarActivity
finish();
} else if (v == mOk) {
StringBuilder sb = new StringBuilder();
int i = -1;
int i = 0;
boolean first = true;
for (boolean[] selections : mSelections) {
for (boolean b : selections) {
i++;
if (i == 0) {
continue;
}
if (b) {
if (!first) {
sb.append("x");
} else {
first = false;
}
sb.append(LANGUAGES[i - 1]);
sb.append(LANGUAGES[i]);
}
i++;
}
}
@@ -383,11 +381,6 @@ public class ExcludedLanguagesActivity extends ToolbarActivity
@Override
public void onBindViewHolder(LanguageHolder holder, int position) {
holder.language.setText(LANGUAGE_STR_IDS[position]);
if (position == 0) {
holder.original.setVisibility(View.INVISIBLE);
} else {
holder.original.setVisibility(View.VISIBLE);
}
boolean[] selections = mSelections[position];
holder.original.setChecked(selections[0]);
holder.translated.setChecked(selections[1]);
@@ -20,6 +20,7 @@ import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.annotation.SuppressLint;
import android.content.ContentResolver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
@@ -234,7 +235,7 @@ public class GalleryActivity extends EhActivity implements SeekBar.OnSeekBarChan
}
@Override
@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "WrongConstant"})
protected void onCreate(@Nullable Bundle savedInstanceState) {
if (Settings.getReadingFullscreen() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window w = getWindow();
@@ -828,29 +829,42 @@ public class GalleryActivity extends EhActivity implements SeekBar.OnSeekBarChan
return;
}
File dir = AppConfig.getExternalTempDir();
File dir = AppConfig.getExternalImageDir();
if (null == dir) {
Toast.makeText(this, R.string.error_cant_create_temp_file, Toast.LENGTH_SHORT).show();
return;
}
UniFile file;
if (null == (file = mGalleryProvider.save(page, UniFile.fromFile(dir), Long.toString(System.currentTimeMillis())))) {
if (null == (file = mGalleryProvider.save(page, UniFile.fromFile(dir), mGalleryProvider.getImageFilename(page)))) {
Toast.makeText(this, R.string.error_cant_save_image, Toast.LENGTH_SHORT).show();
return;
}
String filename = file.getName();
if (filename == null) {
Toast.makeText(this, R.string.error_cant_save_image, Toast.LENGTH_SHORT).show();
return;
}
// TODO Create ContentProvider for some app are not grand storage write permission
Uri uri = file.getUri();
String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(
MimeTypeMap.getFileExtensionFromUrl(uri.toString()));
MimeTypeMap.getFileExtensionFromUrl(filename));
if (TextUtils.isEmpty(mimeType)) {
mimeType = "image/jpeg";
}
Uri uri = new Uri.Builder()
.scheme(ContentResolver.SCHEME_CONTENT)
.authority("com.hippo.ehviewer.fileprovider")
.appendPath("image")
.appendPath(filename)
.build();
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_STREAM, uri);
intent.setType(mimeType);
startActivity(Intent.createChooser(intent, getString(R.string.share_image)));
// Sync media store
sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, file.getUri()));
}
private void saveImage(int page) {
@@ -870,6 +884,9 @@ public class GalleryActivity extends EhActivity implements SeekBar.OnSeekBarChan
}
Toast.makeText(this, getString(R.string.image_saved, file.getUri()), Toast.LENGTH_SHORT).show();
// Sync media store
sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, file.getUri()));
}
private void showPageDialog(final int page) {
+18 -1
View File
@@ -16,11 +16,13 @@
package com.hippo.ehviewer.ui;
import android.hardware.fingerprint.FingerprintManager;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.view.MenuItem;
import android.view.View;
import android.widget.CheckBox;
import com.hippo.ehviewer.R;
import com.hippo.ehviewer.Settings;
@@ -36,6 +38,8 @@ public class SetSecurityActivity extends ToolbarActivity implements View.OnClick
private View mCancel;
@Nullable
private View mSet;
@Nullable
private CheckBox mFingerprint;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
@@ -46,6 +50,7 @@ public class SetSecurityActivity extends ToolbarActivity implements View.OnClick
mPatternView = (LockPatternView) ViewUtils.$$(this, R.id.pattern_view);
mCancel = ViewUtils.$$(this, R.id.cancel);
mSet = ViewUtils.$$(this, R.id.set);
mFingerprint = (CheckBox) ViewUtils.$$(this, R.id.fingerprint_checkbox);
String pattern = Settings.getSecurity();
if (!TextUtils.isEmpty(pattern)) {
@@ -53,6 +58,16 @@ public class SetSecurityActivity extends ToolbarActivity implements View.OnClick
LockPatternUtils.stringToPattern(pattern));
}
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
FingerprintManager fingerprintManager = getSystemService(FingerprintManager.class);
// The line below prevents the false positive inspection from Android Studio
// noinspection ResourceType
if (fingerprintManager.hasEnrolledFingerprints()) {
mFingerprint.setVisibility(View.VISIBLE);
mFingerprint.setChecked(Settings.getEnableFingerprint());
}
}
mCancel.setOnClickListener(this);
mSet.setOnClickListener(this);
}
@@ -79,7 +94,7 @@ public class SetSecurityActivity extends ToolbarActivity implements View.OnClick
if (v == mCancel) {
finish();
} else if (v == mSet) {
if (null != mPatternView) {
if (null != mPatternView && null != mFingerprint) {
String security;
if (mPatternView.getCellSize() <= 1) {
security = "";
@@ -87,6 +102,8 @@ public class SetSecurityActivity extends ToolbarActivity implements View.OnClick
security = mPatternView.getPatternString();
}
Settings.putSecurity(security);
Settings.putEnableFingerprint(mFingerprint.getVisibility() == View.VISIBLE &&
mFingerprint.isChecked() && !security.isEmpty());
}
finish();
}
@@ -389,7 +389,6 @@ public class FavoritesScene extends BaseScene implements
if (1 == mHelper.getShownViewIndex()) {
mHasFirstRefresh = false;
}
mHelper = null;
}
if (null != mRecyclerView) {
mRecyclerView.stopScroll();
@@ -74,6 +74,7 @@ import com.hippo.ehviewer.client.data.GalleryInfo;
import com.hippo.ehviewer.client.data.GalleryTagGroup;
import com.hippo.ehviewer.client.data.ListUrlBuilder;
import com.hippo.ehviewer.client.data.PreviewSet;
import com.hippo.ehviewer.client.exception.NoHAtHClientException;
import com.hippo.ehviewer.client.parser.RateGalleryParser;
import com.hippo.ehviewer.dao.DownloadInfo;
import com.hippo.ehviewer.dao.Filter;
@@ -100,6 +101,7 @@ import com.hippo.widget.LoadImageView;
import com.hippo.widget.ObservedTextView;
import com.hippo.widget.ProgressView;
import com.hippo.widget.SimpleGridAutoSpanLayout;
import com.hippo.yorozuya.FileUtils;
import com.hippo.yorozuya.IOUtils;
import com.hippo.yorozuya.SimpleHandler;
import com.hippo.yorozuya.ViewUtils;
@@ -202,6 +204,8 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
@Nullable
private TextView mTorrent;
@Nullable
private TextView mArchive;
@Nullable
private TextView mShare;
@Nullable
private TextView mRate;
@@ -250,6 +254,9 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
private Pair<String, String>[] mTorrentList;
private String mArchiveFormParamOr;
private Pair<String, String>[] mArchiveList;
@State
private int mState = STATE_INIT;
@@ -464,18 +471,21 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
mHeart = (TextView) ViewUtils.$$(mHeartGroup, R.id.heart);
mHeartOutline = (TextView) ViewUtils.$$(mHeartGroup, R.id.heart_outline);
mTorrent = (TextView) ViewUtils.$$(mActions, R.id.torrent);
mArchive = (TextView) ViewUtils.$$(mActions, R.id.archive);
mShare = (TextView) ViewUtils.$$(mActions, R.id.share);
mRate = (TextView) ViewUtils.$$(mActions, R.id.rate);
mSimilar = (TextView) ViewUtils.$$(mActions, R.id.similar);
mSearchCover = (TextView) ViewUtils.$$(mActions, R.id.search_cover);
Ripple.addRipple(mHeartGroup, false);
Ripple.addRipple(mTorrent, false);
Ripple.addRipple(mArchive, false);
Ripple.addRipple(mShare, false);
Ripple.addRipple(mRate, false);
Ripple.addRipple(mSimilar, false);
Ripple.addRipple(mSearchCover, false);
mHeartGroup.setOnClickListener(this);
mTorrent.setOnClickListener(this);
mArchive.setOnClickListener(this);
mShare.setOnClickListener(this);
mRate.setOnClickListener(this);
mSimilar.setOnClickListener(this);
@@ -564,6 +574,7 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
mHeart = null;
mHeartOutline = null;
mTorrent = null;
mArchive = null;
mShare = null;
mRate = null;
mSimilar = null;
@@ -647,6 +658,8 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
setActionDrawable(mHeartOutline, heartOutline);
Drawable torrent = DrawableManager.getDrawable(context, R.drawable.v_utorrent_primary_x48);
setActionDrawable(mTorrent, torrent);
Drawable archive = DrawableManager.getDrawable(context, R.drawable.v_archive_primary_x48);
setActionDrawable(mArchive, archive);
Drawable share = DrawableManager.getDrawable(context, R.drawable.v_share_primary_x48);
setActionDrawable(mShare, share);
Drawable rate = DrawableManager.getDrawable(context, R.drawable.v_thumb_up_primary_x48);
@@ -1166,6 +1179,21 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
.show();
helper.setDialog(dialog, mGalleryDetail.torrentUrl);
}
} else if (mArchive == v) {
if (mGalleryDetail == null) {
return;
}
if (mGalleryDetail.apiUid < 0) {
showTip(R.string.sign_in_first, LENGTH_SHORT);
return;
}
ArchiveListDialogHelper helper = new ArchiveListDialogHelper();
Dialog dialog = new AlertDialog.Builder(context)
.setTitle(R.string.dialog_archive_title)
.setView(R.layout.dialog_archive_list)
.setOnDismissListener(helper)
.show();
helper.setDialog(dialog, mGalleryDetail.archiveUrl);
} else if (mRate == v) {
if (mGalleryDetail == null) {
return;
@@ -1546,6 +1574,150 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
}
}
private class DownloadArchiveListener extends EhCallback<GalleryDetailScene, Void> {
public DownloadArchiveListener(Context context, int stageId, String sceneTag) {
super(context, stageId, sceneTag);
}
@Override
public void onSuccess(Void result) {
showTip(R.string.download_archive_started, LENGTH_SHORT);
}
@Override
public void onFailure(Exception e) {
if (e instanceof NoHAtHClientException) {
showTip(R.string.download_archive_failure_no_hath, LENGTH_SHORT);
} else {
showTip(R.string.download_archive_failure, LENGTH_SHORT);
}
}
@Override
public void onCancel() {}
@Override
public boolean isInstance(SceneFragment scene) {
return scene instanceof GalleryDetailScene;
}
}
private class ArchiveListDialogHelper implements AdapterView.OnItemClickListener,
DialogInterface.OnDismissListener, EhClient.Callback<Pair<String, Pair<String, String>[]>> {
@Nullable
private ProgressView mProgressView;
@Nullable
private TextView mErrorText;
@Nullable
private ListView mListView;
@Nullable
private EhRequest mRequest;
@Nullable
private Dialog mDialog;
public void setDialog(@Nullable Dialog dialog, String url) {
mDialog = dialog;
mProgressView = (ProgressView) ViewUtils.$$(dialog, R.id.progress);
mErrorText = (TextView) ViewUtils.$$(dialog, R.id.text);
mListView = (ListView) ViewUtils.$$(dialog, R.id.list_view);
mListView.setOnItemClickListener(this);
Context context = getContext2();
if (context != null) {
if (mArchiveList == null) {
mErrorText.setVisibility(View.GONE);
mListView.setVisibility(View.GONE);
mRequest = new EhRequest().setMethod(EhClient.METHOD_ARCHIVE_LIST)
.setArgs(url)
.setCallback(this);
EhApplication.getEhClient(context).execute(mRequest);
} else {
bind(mArchiveList);
}
}
}
private void bind(Pair<String, String>[] data) {
if (null == mDialog || null == mProgressView || null == mErrorText || null == mListView) {
return;
}
if (0 == data.length) {
mProgressView.setVisibility(View.GONE);
mErrorText.setVisibility(View.VISIBLE);
mListView.setVisibility(View.GONE);
mErrorText.setText(R.string.no_archives);
} else {
String[] nameArray = new String[data.length];
for (int i = 0, n = data.length; i < n; i++) {
nameArray[i] = data[i].second;
}
mProgressView.setVisibility(View.GONE);
mErrorText.setVisibility(View.GONE);
mListView.setVisibility(View.VISIBLE);
mListView.setAdapter(new ArrayAdapter<>(mDialog.getContext(), R.layout.item_select_dialog, nameArray));
}
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Context context = getContext2();
MainActivity activity = getActivity2();
if (null != context && null != activity && null != mArchiveList && position < mArchiveList.length) {
String res = mArchiveList[position].first;
EhRequest request = new EhRequest();
request.setMethod(EhClient.METHOD_DOWNLOAD_ARCHIVE);
request.setArgs(mGalleryDetail.gid, mGalleryDetail.token, mArchiveFormParamOr, res);
request.setCallback(new DownloadArchiveListener(context, activity.getStageId(), getTag()));
EhApplication.getEhClient(context).execute(request);
}
if (mDialog != null) {
mDialog.dismiss();
mDialog = null;
}
}
@Override
public void onDismiss(DialogInterface dialog) {
if (mRequest != null) {
mRequest.cancel();
mRequest = null;
}
mDialog = null;
mProgressView = null;
mErrorText = null;
mListView = null;
}
@Override
public void onSuccess(Pair<String, Pair<String, String>[]> result) {
if (mRequest != null) {
mRequest = null;
mArchiveFormParamOr = result.first;
mArchiveList = result.second;
bind(result.second);
}
}
@Override
public void onFailure(Exception e) {
mRequest = null;
Context context = getContext2();
if (null != context && null != mProgressView && null != mErrorText && null != mListView) {
mProgressView.setVisibility(View.GONE);
mErrorText.setVisibility(View.VISIBLE);
mListView.setVisibility(View.GONE);
mErrorText.setText(ExceptionUtils.getReadableString(e));
}
}
@Override
public void onCancel() { mRequest = null; }
}
private class TorrentListDialogHelper implements AdapterView.OnItemClickListener,
DialogInterface.OnDismissListener, EhClient.Callback<Pair<String, String>[]> {
@@ -1612,7 +1784,8 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
String name = mTorrentList[position].second;
// Use system download service
DownloadManager.Request r = new DownloadManager.Request(Uri.parse(url));
r.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, name + ".torrent");
r.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS,
FileUtils.sanitizeFilename(name + ".torrent"));
r.allowScanningByMediaScanner();
r.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
DownloadManager dm = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);
@@ -518,7 +518,6 @@ public final class GalleryListScene extends BaseScene
if (1 == mHelper.getShownViewIndex()) {
mHasFirstRefresh = false;
}
mHelper = null;
}
if (null != mRecyclerView) {
mRecyclerView.stopScroll();
@@ -174,7 +174,6 @@ public class GalleryPreviewsScene extends ToolbarScene implements EasyRecyclerVi
if (1 == mHelper.getShownViewIndex()) {
mHasFirstRefresh = false;
}
mHelper = null;
}
if (null != mRecyclerView) {
mRecyclerView.stopScroll();
+88
View File
@@ -19,11 +19,15 @@ package com.hippo.ehviewer.ui.scene;
import android.content.Context;
import android.hardware.Sensor;
import android.hardware.SensorManager;
import android.hardware.fingerprint.FingerprintManager;
import android.os.Build;
import android.os.Bundle;
import android.os.CancellationSignal;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.hippo.ehviewer.R;
import com.hippo.ehviewer.Settings;
@@ -42,15 +46,21 @@ public class SecurityScene extends SolidScene implements
LockPatternView.OnPatternListener, ShakeDetector.OnShakeListener {
private static final int MAX_RETRY_TIMES = 5;
private static final long ERROR_TIMEOUT_MILLIS = 1200;
private static final long SUCCESS_DELAY_MILLIS = 100;
private static final String KEY_RETRY_TIMES = "retry_times";
@Nullable
private LockPatternView mPatternView;
private ImageView mFingerprintIcon;
private SensorManager mSensorManager;
private Sensor mAccelerometer;
private ShakeDetector mShakeDetector;
private FingerprintManager mFingerprintManager;
private CancellationSignal mFingerprintCancellationSignal;
private int mRetryTimes;
@@ -73,6 +83,9 @@ public class SecurityScene extends SolidScene implements
mShakeDetector.setOnShakeListener(this);
}
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
mFingerprintManager = context.getSystemService(FingerprintManager.class);
}
if (null == savedInstanceState) {
mRetryTimes = MAX_RETRY_TIMES;
@@ -97,6 +110,38 @@ public class SecurityScene extends SolidScene implements
if (null != mShakeDetector) {
mSensorManager.registerListener(mShakeDetector, mAccelerometer, SensorManager.SENSOR_DELAY_UI);
}
if (isFingerprintAuthAvailable()) {
mFingerprintCancellationSignal = new CancellationSignal();
// The line below prevents the false positive inspection from Android Studio
// noinspection ResourceType
mFingerprintManager.authenticate(null, mFingerprintCancellationSignal, 0,
new FingerprintManager.AuthenticationCallback() {
@Override
public void onAuthenticationError(int errMsgId, CharSequence errString) {
fingerprintError(true);
}
@Override
public void onAuthenticationFailed() {
fingerprintError(false);
}
@Override
public void onAuthenticationSucceeded(
FingerprintManager.AuthenticationResult result) {
mFingerprintIcon.setImageResource(R.drawable.ic_fingerprint_success);
mFingerprintIcon.postDelayed(new Runnable() {
@Override
public void run() {
startSceneForCheckStep(CHECK_STEP_SECURITY, getArguments());
finish();
}
}, SUCCESS_DELAY_MILLIS);
}
}, null);
}
}
@Override
@@ -106,6 +151,10 @@ public class SecurityScene extends SolidScene implements
if (null != mShakeDetector) {
mSensorManager.unregisterListener(mShakeDetector);
}
if (isFingerprintAuthAvailable() && mFingerprintCancellationSignal != null) {
mFingerprintCancellationSignal.cancel();
mFingerprintCancellationSignal = null;
}
}
@Override
@@ -123,6 +172,11 @@ public class SecurityScene extends SolidScene implements
mPatternView = (LockPatternView) ViewUtils.$$(view, R.id.pattern_view);
mPatternView.setOnPatternListener(this);
mFingerprintIcon = (ImageView) ViewUtils.$$(view, R.id.fingerprint_icon);
if (Settings.getEnableFingerprint() && isFingerprintAuthAvailable()) {
mFingerprintIcon.setVisibility(View.VISIBLE);
mFingerprintIcon.setImageResource(R.drawable.ic_fp_40px);
}
return view;
}
@@ -176,4 +230,38 @@ public class SecurityScene extends SolidScene implements
finish();
}
}
private boolean isFingerprintAuthAvailable() {
// The line below prevents the false positive inspection from Android Studio
// noinspection ResourceType
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
&& Settings.getEnableFingerprint()
&& mFingerprintManager != null
&& mFingerprintManager.isHardwareDetected()
&& mFingerprintManager.hasEnrolledFingerprints();
}
private Runnable mResetFingerprintRunnable = new Runnable() {
@Override
public void run() {
if (mFingerprintIcon != null)
mFingerprintIcon.setImageResource(R.drawable.ic_fp_40px);
}
};
private void fingerprintError(boolean unrecoverable) {
// Do not decrease mRetryTimes here since Android system will handle it :)
mFingerprintIcon.setImageResource(R.drawable.ic_fingerprint_error);
mFingerprintIcon.removeCallbacks(mResetFingerprintRunnable);
if (unrecoverable) {
mFingerprintIcon.postDelayed(new Runnable() {
@Override
public void run() {
mFingerprintIcon.setVisibility(View.INVISIBLE);
}
}, ERROR_TIMEOUT_MILLIS);
} else {
mFingerprintIcon.postDelayed(mResetFingerprintRunnable, ERROR_TIMEOUT_MILLIS);
}
}
}
@@ -74,7 +74,7 @@ public class SelectSiteScene extends SolidScene implements View.OnClickListener
switch (id) {
case R.id.site_e:
Settings.putSelectSite(false);
Settings.putGallerySite(EhUrl.SITE_G);
Settings.putGallerySite(EhUrl.SITE_E);
startSceneForCheckStep(CHECK_STEP_SELECT_SITE, getArguments());
finish();
break;
@@ -226,8 +226,8 @@ public final class SignInScene extends SolidScene implements EditText.OnEditorAc
} else if (mSignInViaCookies == v) {
startScene(new Announcer(CookieSignInScene.class).setRequestCode(this, REQUEST_CODE_COOKIE));
} else if (mSkipSigningIn == v) {
// Set gallery size SITE_G if skip sign in
Settings.putGallerySite(EhUrl.SITE_G);
// Set gallery size SITE_E if skip sign in
Settings.putGallerySite(EhUrl.SITE_E);
redirectTo();
}
}
@@ -35,6 +35,7 @@ import com.hippo.easyrecyclerview.EasyRecyclerView;
import com.hippo.easyrecyclerview.FastScroller;
import com.hippo.easyrecyclerview.HandlerDrawable;
import com.hippo.easyrecyclerview.LayoutManagerUtils;
import com.hippo.ehviewer.EhApplication;
import com.hippo.ehviewer.R;
import com.hippo.refreshlayout.RefreshLayout;
import com.hippo.util.DrawableManager;
@@ -457,9 +458,11 @@ public class ContentLayout extends FrameLayout {
showContent();
// RecyclerView scroll
mRecyclerView.stopScroll();
LayoutManagerUtils.scrollToPositionWithOffset(mRecyclerView.getLayoutManager(), 0, 0);
onScrollToPosition(0);
if (mRecyclerView.isAttachedToWindow()) {
mRecyclerView.stopScroll();
LayoutManagerUtils.scrollToPositionWithOffset(mRecyclerView.getLayoutManager(), 0, 0);
onScrollToPosition(0);
}
}
break;
case TYPE_PRE_PAGE:
@@ -485,7 +488,7 @@ public class ContentLayout extends FrameLayout {
mRefreshLayout.setFooterRefreshing(false);
showContent();
if (mCurrentTaskType == TYPE_PRE_PAGE) {
if (mCurrentTaskType == TYPE_PRE_PAGE && mRecyclerView.isAttachedToWindow()) {
// RecyclerView scroll, to top
mRecyclerView.stopScroll();
LayoutManagerUtils.scrollToPositionWithOffset(mRecyclerView.getLayoutManager(), 0, 0);
@@ -510,15 +513,17 @@ public class ContentLayout extends FrameLayout {
mRefreshLayout.setFooterRefreshing(false);
showContent();
// RecyclerView scroll
if (mCurrentTaskType == TYPE_PRE_PAGE_KEEP_POS) {
mRecyclerView.stopScroll();
LayoutManagerUtils.scrollToPositionProperly(mRecyclerView.getLayoutManager(), getContext(),
dataSize - 1, mOnScrollToPositionListener);
} else {
mRecyclerView.stopScroll();
LayoutManagerUtils.scrollToPositionWithOffset(mRecyclerView.getLayoutManager(), 0, 0);
onScrollToPosition(0);
if (mRecyclerView.isAttachedToWindow()) {
// RecyclerView scroll
if (mCurrentTaskType == TYPE_PRE_PAGE_KEEP_POS) {
mRecyclerView.stopScroll();
LayoutManagerUtils.scrollToPositionProperly(mRecyclerView.getLayoutManager(), getContext(),
dataSize - 1, mOnScrollToPositionListener);
} else {
mRecyclerView.stopScroll();
LayoutManagerUtils.scrollToPositionWithOffset(mRecyclerView.getLayoutManager(), 0, 0);
onScrollToPosition(0);
}
}
}
break;
@@ -542,7 +547,7 @@ public class ContentLayout extends FrameLayout {
mRefreshLayout.setFooterRefreshing(false);
showContent();
if (mCurrentTaskType == TYPE_NEXT_PAGE) {
if (mCurrentTaskType == TYPE_NEXT_PAGE && mRecyclerView.isAttachedToWindow()) {
// RecyclerView scroll
mRecyclerView.stopScroll();
LayoutManagerUtils.scrollToPositionWithOffset(mRecyclerView.getLayoutManager(), oldDataSize, 0);
@@ -567,13 +572,15 @@ public class ContentLayout extends FrameLayout {
mRefreshLayout.setFooterRefreshing(false);
showContent();
if (mCurrentTaskType == TYPE_NEXT_PAGE_KEEP_POS) {
mRecyclerView.stopScroll();
mRecyclerView.smoothScrollBy(0, mNextPageScrollSize);
} else {
mRecyclerView.stopScroll();
LayoutManagerUtils.scrollToPositionWithOffset(mRecyclerView.getLayoutManager(), oldDataSize, 0);
onScrollToPosition(oldDataSize);
if (mRecyclerView.isAttachedToWindow()) {
if (mCurrentTaskType == TYPE_NEXT_PAGE_KEEP_POS) {
mRecyclerView.stopScroll();
mRecyclerView.smoothScrollBy(0, mNextPageScrollSize);
} else {
mRecyclerView.stopScroll();
LayoutManagerUtils.scrollToPositionWithOffset(mRecyclerView.getLayoutManager(), oldDataSize, 0);
onScrollToPosition(oldDataSize);
}
}
}
break;
@@ -614,10 +621,12 @@ public class ContentLayout extends FrameLayout {
mRefreshLayout.setFooterRefreshing(false);
showContent();
// RecyclerView scroll
mRecyclerView.stopScroll();
LayoutManagerUtils.scrollToPositionWithOffset(mRecyclerView.getLayoutManager(), 0, 0);
onScrollToPosition(0);
if (mRecyclerView.isAttachedToWindow()) {
// RecyclerView scroll
mRecyclerView.stopScroll();
LayoutManagerUtils.scrollToPositionWithOffset(mRecyclerView.getLayoutManager(), 0, 0);
onScrollToPosition(0);
}
}
break;
case TYPE_REFRESH_PAGE:
@@ -651,7 +660,7 @@ public class ContentLayout extends FrameLayout {
showContent();
// RecyclerView scroll
if (newIndexEnd > oldIndexEnd && newIndexEnd > 0) {
if (newIndexEnd > oldIndexEnd && newIndexEnd > 0 && mRecyclerView.isAttachedToWindow()) {
mRecyclerView.stopScroll();
LayoutManagerUtils.scrollToPositionWithOffset(mRecyclerView.getLayoutManager(), newIndexEnd - 1, 0);
onScrollToPosition(newIndexEnd - 1);
@@ -848,14 +857,24 @@ public class ContentLayout extends FrameLayout {
}
}
private int mSavedDataId = IntIdGenerator.INVALID_ID;
private Parcelable saveInstanceState(Parcelable superState) {
Bundle bundle = new Bundle();
bundle.putParcelable(KEY_SUPER, superState);
int shownView = mViewTransition.getShownViewIndex();
bundle.putInt(KEY_SHOWN_VIEW, shownView);
bundle.putString(KEY_TIP, mTipView.getText().toString());
// TODO What if data is large
bundle.putParcelableArrayList(KEY_DATA, mData);
// TODO It's a bad design
EhApplication app = (EhApplication) getContext().getApplicationContext();
if (mSavedDataId != IntIdGenerator.INVALID_ID) {
app.removeGlobalStuff(mSavedDataId);
mSavedDataId = IntIdGenerator.INVALID_ID;
}
mSavedDataId = app.putGlobalStuff(mData);
bundle.putInt(KEY_DATA, mSavedDataId);
bundle.putInt(KEY_NEXT_ID, mIdGenerator.nextId());
bundle.putParcelable(KEY_PAGE_DIVIDER, mPageDivider);
bundle.putInt(KEY_START_PAGE, mStartPage);
@@ -869,7 +888,17 @@ public class ContentLayout extends FrameLayout {
Bundle bundle = (Bundle) state;
mViewTransition.showView(bundle.getInt(KEY_SHOWN_VIEW), false);
mTipView.setText(bundle.getString(KEY_TIP));
mData = bundle.getParcelableArrayList(KEY_DATA);
mSavedDataId = bundle.getInt(KEY_DATA);
EhApplication app = (EhApplication) getContext().getApplicationContext();
if (mSavedDataId != IntIdGenerator.INVALID_ID) {
ArrayList<E> data = (ArrayList<E>) app.removeGlobalStuff(mSavedDataId);
mSavedDataId = IntIdGenerator.INVALID_ID;
if (data != null) {
mData = data;
}
}
mIdGenerator.setNextId(bundle.getInt(KEY_NEXT_ID));
mPageDivider = bundle.getParcelable(KEY_PAGE_DIVIDER);
mStartPage = bundle.getInt(KEY_START_PAGE);
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

+28
View File
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2015 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="40.0dp"
android:height="40.0dp"
android:viewportWidth="40.0"
android:viewportHeight="40.0">
<path
android:pathData="M20.0,0.0C8.96,0.0 0.0,8.95 0.0,20.0s8.96,20.0 20.0,20.0c11.04,0.0 20.0,-8.95 20.0,-20.0S31.04,0.0 20.0,0.0z"
android:fillColor="#F4511E"/>
<path
android:pathData="M21.33,29.33l-2.67,0.0l0.0,-2.67l2.67,0.0L21.33,29.33zM21.33,22.67l-2.67,0.0l0.0,-12.0l2.67,0.0L21.33,22.67z"
android:fillColor="#FFFFFF"/>
</vector>
+28
View File
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2015 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="40.0dp"
android:height="40.0dp"
android:viewportWidth="40.0"
android:viewportHeight="40.0">
<path
android:pathData="M20.0,20.0m-20.0,0.0a20.0,20.0 0.0,1.0 1.0,40.0 0.0a20.0,20.0 0.0,1.0 1.0,-40.0 0.0"
android:fillColor="#009688"/>
<path
android:pathData="M11.2,21.41l1.63,-1.619999 4.17,4.169998 10.59,-10.589999 1.619999,1.63 -12.209999,12.209999z"
android:fillColor="#FFFFFF"/>
</vector>
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:height="48dp"
android:width="48dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="?attr/colorPrimary"
android:pathData="@string/pd_archive"/>
</vector>
+11 -2
View File
@@ -40,7 +40,16 @@
android:layout_height="0dp"
android:layout_weight="1"/>
<android.support.v7.widget.ButtonBarLayout
<CheckBox
android:id="@+id/fingerprint_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="20dp"
android:visibility="gone"
android:text="@string/enable_fingerprint" />
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/buttonPanel"
android:layout_width="match_parent"
@@ -69,7 +78,7 @@
android:layout_weight="1"
android:text="@string/set"/>
</android.support.v7.widget.ButtonBarLayout>
</LinearLayout>
</LinearLayout>
<FrameLayout
+11 -2
View File
@@ -51,7 +51,16 @@
</com.hippo.widget.MaxSizeContainer>
</FrameLayout>
<android.support.v7.widget.ButtonBarLayout
<CheckBox
android:id="@+id/fingerprint_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="20dp"
android:visibility="gone"
android:text="@string/enable_fingerprint" />
<LinearLayout
android:id="@+id/buttonPanel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -79,5 +88,5 @@
android:layout_weight="1"
android:text="@string/set"/>
</android.support.v7.widget.ButtonBarLayout>
</LinearLayout>
</LinearLayout>
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="@dimen/abc_dialog_padding_top_material"
android:paddingBottom="@dimen/abc_dialog_padding_top_material">
<com.hippo.widget.ProgressView
android:id="@+id/progress"
style="@style/ProgressView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"/>
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"/>
<ListView
android:id="@+id/list_view"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</FrameLayout>
@@ -32,8 +32,8 @@
android:scrollbars="vertical"
android:overScrollMode="ifContentScrolls"
android:fadingEdge="none"
android:paddingTop="@dimen/abc_dialog_list_padding_vertical_material"
android:paddingBottom="@dimen/abc_dialog_list_padding_vertical_material"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:clipToPadding="false"
style="@style/Indicating"/>
@@ -67,10 +67,11 @@
</FrameLayout>
<TextView
android:id="@+id/torrent"
android:id="@+id/rate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="@string/rate"
android:drawablePadding="8dp"
android:textColor="@color/primary_text_light"/>
@@ -84,11 +85,19 @@
android:textColor="@color/primary_text_light"/>
<TextView
android:id="@+id/rate"
android:id="@+id/torrent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="@string/rate"
android:drawablePadding="8dp"
android:textColor="@color/primary_text_light"/>
<TextView
android:id="@+id/archive"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/archive"
android:gravity="center_horizontal"
android:drawablePadding="8dp"
android:textColor="@color/primary_text_light"/>
+2 -2
View File
@@ -57,7 +57,7 @@
</com.hippo.widget.MaxSizeContainer>
<android.support.v7.widget.ButtonBarLayout
<LinearLayout
android:id="@+id/buttonPanel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -88,5 +88,5 @@
android:textStyle="bold"
android:text="@string/accept"/>
</android.support.v7.widget.ButtonBarLayout>
</LinearLayout>
</LinearLayout>
@@ -103,7 +103,7 @@
</ScrollView>
</com.hippo.widget.MaxSizeContainer>
<android.support.v7.widget.ButtonBarLayout
<LinearLayout
android:id="@+id/buttonPanel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -130,5 +130,5 @@
android:textStyle="bold"
android:text="@android:string/ok"/>
</android.support.v7.widget.ButtonBarLayout>
</LinearLayout>
</LinearLayout>
+2 -2
View File
@@ -57,7 +57,7 @@
</ScrollView>
</com.hippo.widget.MaxSizeContainer>
<android.support.v7.widget.ButtonBarLayout
<LinearLayout
android:id="@+id/buttonPanel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -88,5 +88,5 @@
android:textStyle="bold"
android:text="@string/send"/>
</android.support.v7.widget.ButtonBarLayout>
</LinearLayout>
</LinearLayout>
+2 -2
View File
@@ -83,7 +83,7 @@
android:layout_height="0dp"
android:layout_weight="1"/>
<android.support.v7.widget.ButtonBarLayout
<LinearLayout
android:id="@+id/buttonPanel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -114,7 +114,7 @@
android:textStyle="bold"
android:text="@string/sign_in"/>
</android.support.v7.widget.ButtonBarLayout>
</LinearLayout>
<TextView
android:id="@+id/sign_in_via_webview"
+19 -4
View File
@@ -27,12 +27,27 @@
android:layout_gravity="center"
android:layout_margin="32dp"
app:maxWidth="320dp"
app:maxHeight="320dp">
app:maxHeight="360dp">
<com.hippo.widget.lockpattern.LockPatternView
android:id="@+id/pattern_view"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
android:layout_height="wrap_content"
android:orientation="vertical">
<com.hippo.widget.lockpattern.LockPatternView
android:id="@+id/pattern_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<ImageView
android:id="@+id/fingerprint_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_fp_40px"
android:layout_gravity="center_horizontal"
android:visibility="gone" />
</LinearLayout>
</com.hippo.widget.MaxSizeContainer>
</FrameLayout>
@@ -92,7 +92,7 @@
</ScrollView>
</com.hippo.widget.MaxSizeContainer>
<android.support.v7.widget.ButtonBarLayout
<LinearLayout
android:id="@+id/buttonPanel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -119,5 +119,5 @@
android:textStyle="bold"
android:text="@android:string/ok"/>
</android.support.v7.widget.ButtonBarLayout>
</LinearLayout>
</LinearLayout>
+2 -2
View File
@@ -56,7 +56,7 @@
</com.hippo.widget.MaxSizeContainer>
<android.support.v7.widget.ButtonBarLayout
<LinearLayout
android:id="@+id/buttonPanel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -87,5 +87,5 @@
android:textStyle="bold"
android:text="@string/accept"/>
</android.support.v7.widget.ButtonBarLayout>
</LinearLayout>
</LinearLayout>
+2 -2
View File
@@ -14,7 +14,7 @@
~ limitations under the License.
-->
<android.support.v7.widget.ButtonBarLayout
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -35,4 +35,4 @@
android:layout_height="wrap_content"
android:layout_weight="1"/>
</android.support.v7.widget.ButtonBarLayout>
</LinearLayout>
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

+622
View File
@@ -0,0 +1,622 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="app_name">EhViewer</string>
<!-- Category -->
<string name="homepage">Pagina de Inicio</string>
<string name="whats_hot">Destacado</string>
<string name="favourite">Favoritos</string>
<string name="history">Historial</string>
<string name="downloads">Descargas</string>
<string name="settings">Configuraciones</string>
<string name="username">Usuario</string>
<string name="password">Contraseña</string>
<string name="sign_in">Iniciar Sesión</string>
<string name="register">Registrarse</string>
<string name="sign_in_via_webview">Iniciar Sesión via WebView</string>
<string name="sign_in_via_cookies">Iniciar Sesión via cookies</string>
<string name="display_name_dialog_title">Ingresar un Nombre a Mostrar</string>
<string name="display_name">Nombre a mostrar</string>
<string name="display_name_is_empty">El nombre a mostrar esta vacio</string>
<string name="sign_in_first">Inicie Sesión Primeramente</string>
<string name="default_display_name">Little Hippo</string>
<string name="cookie_explain">Un cookie es una pequeña pieza de datos almacendados en el navegadow web. Busque si no conoce lo que es o como obtenerlo.\n\nPor favor ingresar cookies especiales para iniciar sesión.</string>
<string name="text_is_empty">El texto esta vacio</string>
<string name="waring">Advertencia.</string>
<string name="wrong_cookie_warning">Parece que las cookies que ingresaste son erroneas. Debe revisarlos.</string>
<string name="i_will_check_it">Comprobar ahora</string>
<string name="i_dont_think_so">No creo eso</string>
<string name="found_cookies">Cookies encontradas!</string>
<string name="invalid_download_location">Parece que la ubicacion de descarga no esta disponible. Configure esta opccion en Configuraciones.</string>
<string name="cellular_network_warning">Conectado a redes moviles</string>
<string name="error_bad_status_code">Bad status code: %d</string>
<string name="error_timeout">Sin tiempo</string>
<string name="error_unknown_host">Host desconocido</string>
<string name="error_redirection">Demasiadas redirecciones</string>
<string name="error_socket">Error de Red</string>
<string name="error_unknown">Raro</string>
<string name="error_cant_find_activity">No se encuentra la Aplicacion</string>
<string name="error_cannot_parse_the_url">No se puede analizar el URL</string>
<string name="error_not_folder_path">Sin ruta del directorio</string>
<string name="error_no_provider">Sin proveedor</string>
<string name="error_decoding_failed">Decodificacion fallida</string>
<string name="error_not_found">No encontrado</string>
<string name="error_empty">Vacio</string>
<string name="error_invalid_zip_file">Archivo ZIP invalido</string>
<string name="error_reading_failed">Lectura Fallida</string>
<string name="error_out_of_range">Fuera de rango</string>
<string name="error_write_failed">Falla en la escritura</string>
<string name="error_parse_error">Analisis Erroneo</string>
<string name="error_509">509</string>
<string name="error_invalid_url">Url invalida</string>
<string name="error_get_ptoken_error">Error al obtener token</string>
<string name="error_invalid_specify_gallery">Keyword should looks like \"618395 0439fa3666\" for specify gallery</string>
<string name="error_cant_create_temp_file">Imposible crear archivo temporal.</string>
<string name="error_cant_save_image">Imposible guardar la imagen</string>
<string name="error_invalid_number">Numero invalido</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">El usuario no puede estar vacio</string>
<string name="skip_signing_in">Saltar inicio de sesion</string>
<string name="sign_in_failed">Inicio de sesion fallido</string>
<string name="sign_in_failed_plain">Tal ves sea debiado a un error de actualizacion de el sitio web o algo mal sucedio.Pude intentar iniciar sesion via WebView, ingresar una cookie o saltar el inicio de sesion presionando el boton de abajo.\nPero pude salir un \"Panda Triste\" despues de saltar el inicio de sesion. Intente \"Ingresar via cookies\" primero si ha iniciado sesion en la version 0.6.x de HeViewer.</string>
<string name="press_twice_exit">Presione una ves mas para salir</string>
<string name="content_layout_restore_tip">Click para reintentar</string>
<string name="write_rationale">EhViewer solicitara el permiso WRITE_EXTERNAL_STORAGE para descargar galerias. ¿Desea conceder el permiso?</string>
<string name="you_rejected_me">Duele</string>
<string name="analytics_explain">Would you mind if the developer collected your device information and your usage? It will help the developer a lot.&lt;br&gt;&lt;br&gt;Data analysis service is provided by Google Analytics. Its privacy policy can be found at &lt;a href=&quot;https://www.google.com/policies/privacy/&quot;&gt;https://www.google.com/policies/privacy/&lt;/a&gt;.&lt;br&gt;&lt;br&gt;If you agree to join data analysis, your device information and your usage will be collected, including but not limited to Android API version, equipment model, language residence, the application version, conversion time, function times. The developer promise that these information will NOT be collected, including phone number, e-mail address, IMEI.&lt;br&gt;&lt;br&gt;Your information will not be collected until you agree to join data analysis.&lt;br&gt;&lt;br&gt;The collected information will be analyzed by Google Analytics. The analysis report can only be viewed by the developer of this application.</string>
<string name="get_it">Lo tengo</string>
<string name="accept">Aceptar</string>
<string name="reject">Rechazar</string>
<!-- Crash -->
<string name="send">Enviar</string>
<string name="crash_explain">Esta aplicacion se crasheo la ultima vez. Desea enviar un logcat a el desarrollador para una mejor experiencia en el futuro? (via e-mail)</string>
<!-- Select scene -->
<string name="select_scene">Que Galeria quiere seleccionar?</string>
<string name="select_scene_explain">e-hentai: Disponible para cualquier persona.\nexhentai: Solo para usuarios que iniciaron sesión.</string>
<string name="no_select">Por favor selecciona un sitio</string>
<!-- Update -->
<string name="update">Actualizar.</string>
<string name="update_plain">Version: %1$s\nSize: %2$s\n\n%3$s</string>
<string name="update_to_date">EhViewer esta Actualizado</string>
<!-- Gallery List -->
<string name="gallery_list_search_bar_hint_exhentai">Buscar ExHentai</string>
<string name="gallery_list_search_bar_hint_e_hentai">Buscar E-Hentai</string>
<string name="gallery_list_empty_hit">El Mundo es Grande y el Panda se sienta solo</string>
<string name="search">Buscar</string>
<string name="keyword_search">busqueda por palabras clave</string>
<string name="image_search">Busqueda de Imagen</string>
<string name="search_normal">Busqueda Normal</string>
<string name="search_advance">Opciones Avanzadas</string>
<string name="search_image">Busqueda de Imagenes</string>
<string name="search_normal_search">Busqueda General</string>
<string name="search_specify_uploader">Uploader Especificos</string>
<string name="search_specify_tag">Etiquetas Especificas</string>
<string name="search_specify_gallery">Galerias Especificas</string>
<string name="search_enable_advance">Habilitar opciones avanzadas</string>
<string name="search_tip">Busqueda Normal: Solo busca.\n\nUploader Especifico: Lista de galerias que subio el uploader. Otras opcciones seran ignoradas.\n\nSpecify tag: List galleries which contains the tag. Only one tag accepted. Otras opcciones seran ignoradas.\n\nGaleria Especifica: Ir a la Galeria. La palabra clave debe ser \"gid token\".</string>
<string name="search_sname">Buscar Galerias</string>
<string name="search_stags">Buscar Etiquetas de Galerias</string>
<string name="search_sdesc">Buscar Descripccion de Galeria</string>
<string name="search_storr">Buscar por Nombres de Torrent</string>
<string name="search_sto">Mostrar Solo Galerias con Torrents</string>
<string name="search_sdt1">Buscar Etiquetas Low-Power</string>
<string name="search_sdt2">Buscar etiquetas pobres</string>
<string name="search_sh">Mostrar Galerias Borradas</string>
<string name="search_sr">Valoracion Minima:</string>
<string name="select_image">Seleccionar Imagen</string>
<string name="search_uss">Usar busqueda similar</string>
<string name="search_osc">Buscar solo portadas</string>
<string name="search_se">Mostrar Borrados</string>
<string name="select_image_first">Seleccione la imagen primero</string>
<string name="quick_search">Busqueda Rápida</string>
<string name="quick_search_tip">Click \"+\" para añadir a la busqueda rapida</string>
<string name="add_quick_search_dialog_title">Añadir Busqueda Rápida</string>
<string name="name_is_empty">Nombre vacio</string>
<string name="delete_quick_search_title">Eliminar Busqueda Rápida</string>
<string name="delete_quick_search_message">Eliminar \"%s\"?</string>
<string name="no_quick_search">La busqueda rapida se muestra acá</string>
<string name="add_quick_search_tip">El estado de la lista de galerias se guardara como busqueda rapida. Aplique la busqueda primero si usted desea guardar el estado del panel de busqueda.</string>
<string name="readme">LEEME</string>
<string name="image_search_not_quick_search">No se puede añadir la busqueda por imagenes la la busqueda rapida</string>
<string name="duplicate_quick_search">Busqueda rapida duplicada. El nombre es \"%s\".</string>
<string name="duplicate_name">Nombre duplicado existente</string>
<string name="go_to_hint">Pagina %1$d, total %2$d paginas</string>
<!-- search_min_rating -->
<string name="star_2">2 stars</string>
<string name="star_3">3 stars</string>
<string name="star_4">4 stars</string>
<string name="star_5">5 stars</string>
<!-- Gallery detail -->
<string name="error_cannot_find_gallery">No se encuenta la galeria</string>
<string name="download">Descargas</string>
<string name="read">Leer</string>
<string name="more_information">Mas Informacion</string>
<plurals name="page_count">
<item quantity="one">%d page</item>
<item quantity="other">%d pages</item>
</plurals>
<string name="favored_times">\u2665 %d</string>
<string name="rating_text">%1$s (%2$.2f, %3$d)</string>
<string name="favorites">Favoritos</string>
<string name="torrent_count">Torrent (%d)</string>
<string name="share">Compartir</string>
<string name="rate">Valorar</string>
<string name="similar_gallery">Similar</string>
<string name="search_cover">Buscar Portada</string>
<string name="no_tags">Sin etiquetas</string>
<string name="no_comments">Sin Comentarios</string>
<string name="no_more_comments">No hay mas comentarios</string>
<string name="more_comment">Mas comentarios</string>
<string name="no_previews">Sin vistas previas</string>
<string name="no_more_previews">No hay mas vistas previas</string>
<string name="more_previews">Mas vistas previas</string>
<string name="refresh">Refrescar</string>
<string name="open_in_other_app">Abrir en otra app</string>
<string name="rate_successfully">Valoracion Completada</string>
<string name="rate_failed">Valoracion fallida</string>
<string name="no_torrents">Sin torrents</string>
<string name="torrents">Torrents</string>
<string name="favorited">Favorito</string>
<string name="not_favorited">Sin favoritos</string>
<string name="add_favorites_dialog_title">Añadir a Faviritos</string>
<string name="remember_favorite_collection">Recordar Favoritos</string>
<string name="remove_from_favorite_success">Eliminado de favoritos</string>
<string name="add_to_favorite_failure">No se a podido agregar a favoritos</string>
<string name="remove_from_favorite_failure">Error al borrar de favoritos</string>
<string name="block_the_uploader">Añadir el cargador \"%s\" a la lista de filtros?</string>
<string name="filter_added">Filtro añadido</string>
<!-- Rating -->
<string name="rating10">PIEZA MAESTRA</string>
<string name="rating9">INGREIBLE</string>
<string name="rating8">GRANDIOSO</string>
<string name="rating7">BUENO</string>
<string name="rating6">OKAY</string>
<string name="rating5">MEDIOCRE</string>
<string name="rating4">MALO</string>
<string name="rating3">HORRIBLE</string>
<string name="rating2">DOLOROSO</string>
<string name="rating1">INAGUANTABLE</string>
<string name="rating0">DESASTRE</string>
<!-- Gallery Info -->
<string name="gallery_info">Informacion de la Galleria</string>
<string name="copied_to_clipboard">Copiado al portapapeles</string>
<string name="header_key">Clave</string>
<string name="header_value">Valor</string>
<string name="key_gid">Guia</string>
<string name="key_token">Clave</string>
<string name="key_url">Url</string>
<string name="key_title">Titulo</string>
<string name="key_title_jpn">Titulo Japones</string>
<string name="key_thumb">Thumb</string>
<string name="key_category">Categoria</string>
<string name="key_uploader">Uploader</string>
<string name="key_posted">Publicado</string>
<string name="key_parent">Padre</string>
<string name="key_visible">Visible</string>
<string name="key_language">Languaje</string>
<string name="key_pages">Paginas</string>
<string name="key_size">Tamañp</string>
<string name="key_favorite_count">Numero de favoritos</string>
<string name="key_favorited">Favorito</string>
<string name="key_rating_count">Numero de Valoraciones</string>
<string name="key_rating">Rating</string>
<string name="key_torrents">Torrents</string>
<string name="key_torrent_url">Url de Torrent</string>
<!-- Gallery Comments -->
<string name="gallery_comments">Comentarios de la Galeria</string>
<string name="no_one_comments_gallery">Sin comentarios en esta galeria</string>
<string name="comment_successfully">Comentario exitoso</string>
<string name="copy_comment_text">Copiar el texto del comentario</string>
<string name="vote_up">Voto positivo</string>
<string name="cancel_vote_up">Cancelar voto positivo</string>
<string name="vote_down">Voto negativo</string>
<string name="vote_up_successfully">Voto positivo completado</string>
<string name="cancel_vote_up_successfully">Voto positivo cancelado satisfactoriamente</string>
<string name="vote_down_successfully">Vote negativo completado</string>
<string name="cancel_vote_down_successfully">Voto negativo cancelado satisfactoriamente</string>
<string name="vote_failed">Voto fallido</string>
<string name="check_vote_status">Verificar estado del voto</string>
<!-- Gallery Previews -->
<string name="gallery_previews">Vista previa de la galeria</string>
<string name="go_to">Ir a</string>
<!-- Download -->
<string name="scene_download_title">Descargar - %s</string>
<string name="no_download_info">Las descargas de arhivos se mostraran acá</string>
<string name="download_state_wait">Esperando</string>
<string name="download_state_downloading">Descargando</string>
<string name="download_state_downloaded">Descargado</string>
<string name="download_state_failed_2">%d incompleto</string>
<string name="download_state_finish">Completada</string>
<string name="stat_509_alert_title">Alerta 509</string>
<string name="stat_509_alert_text">Limite de imagen alcanzado. Por favor deje de descargar y relajese un poco.</string>
<string name="stat_download_done_title">Descarga Terminada.</string>
<string name="stat_download_done_text_succeeded">%d Completado</string>
<string name="stat_download_done_text_failed">%d fallido</string>
<string name="stat_download_done_text_mix">%1$d completado, %2$d fallido</string>
<string name="stat_download_done_line_succeeded">Completado: %s</string>
<string name="stat_download_done_line_failed">Fallido: %s</string>
<string name="download_remove_dialog_title">Borrar elemneto descargado</string>
<string name="download_remove_dialog_message">Borrar %s de la lista de descarga ?</string>
<string name="download_remove_dialog_message_2">Borrar %d elemntos de la lista de descarga?</string>
<string name="download_remove_dialog_check_text">Eliminar imagenes</string>
<string name="stat_download_action_stop_all">Detener todo</string>
<string name="drawer_download_label_title">Etiquetas</string>
<string name="default_download_label_name">Predeterminado.</string>
<string name="download_move_dialog_title">Mover</string>
<string name="download_labels">Descargar etiquetas</string>
<string name="download_start_all">Iniciar todo</string>
<string name="download_stop_all">Detener todo</string>
<string name="download_service_label">EhViewer Servicio de Descarga</string>
<string name="download_speed_text">%s</string>
<string name="download_speed_text_2">%1$s, %2$s izquierda</string>
<string name="remember_download_label">Recordar descargas</string>
<string name="default_download_label">Etiqueta predeterminada de descarga</string>
<string name="added_to_download_list">Añadido a la lista de descargas</string>
<!-- Download label -->
<string name="no_download_label">Las etiquetas de descarga se mostraran acá</string>
<string name="add">Añadir</string>
<string name="new_label_title">Nueva Etiqueta</string>
<string name="label_text_is_empty">Nombre de la etiqueta vacia</string>
<string name="label_text_is_invalid">\"Defecto\" Es una etiqueta invalida</string>
<string name="label_text_exist">Etiqueta existente</string>
<string name="rename_label_title">Renombrar etiqueta</string>
<string name="delete_label_title">Eliminar Etiqueta</string>
<string name="delete_label_message">Eliminar \"%s\"?</string>
<!-- History -->
<string name="no_history">El historial de lectura esta acá</string>
<string name="clear_all_history">Limpiar todo el historial?</string>
<!-- Filter -->
<string name="filter">Filtros</string>
<string name="no_filter">Los filtros se motraran acá</string>
<string name="filter_title">Titulo</string>
<string name="filter_uploader">Uploader</string>
<string name="filter_tag">Tag</string>
<string name="filter_tag_namespace">Tag namespace</string>
<string name="delete_title_filter">Eliminar filtro de titulo \"%s\"?</string>
<string name="delete_uploader_filter">Eliminar flitrod de uploader \"%s\"?</string>
<string name="delete_tag_filter">Eliminar filtro de etiquetas \"%s\"?</string>
<string name="delete_filter">Eliminar filtro \"%s\"?</string>
<string name="tip">Tip</string>
<string name="add_filter">Añadir Filtros</string>
<string name="show_definition">Mostrar definicion</string>
<string name="filter_text">Filter text</string>
<string name="filter_tip">Title Filter: exclude the gallery whose title contains the word.\n\nUploader Filter: exclude the gallery which was uploaded by the uploader.\n\nTag Filter: exclude the gallery which contain the tag, it takes more time to get gallery list.\n\nTag Namespace Filter: exclude the gallery which contain the tag namespace, it takes more time to get gallery list.</string>
<!-- Set Security -->
<string name="set_pattern_protection">Establecer Proteccion po Patrón</string>
<string name="set_pattern_protection_tip">Dibujar un patrón para establecer la proteccion por patrón. \nDejar en blanco para quitar la proteccion por patrón.</string>
<string name="set">Establecer</string>
<!-- Gallery Activity -->
<string name="page_menu_title">Pagina %d</string>
<string name="page_menu_refresh">@string/refresh</string>
<string name="page_menu_share">@string/share</string>
<string name="page_menu_save">Guardar</string>
<string name="page_menu_add_bookmark">Añadir a marcadores</string>
<string name="gallery_menu_title">Menu</string>
<string name="share_image">Compartir imagen</string>
<string name="image_saved">Imagen guardada en %s</string>
<string name="settings_eh">EH</string>
<string name="settings_eh_sign_out">Cerrar Sesion.</string>
<string name="settings_eh_sign_out_summary">Reiniciar la aplicaccion para inicia sesion</string>
<string name="settings_eh_sign_out_warning">Esta seguro de cerrar la sesion?</string>
<string name="settings_eh_sign_out_yes">@android:string/ok</string>
<string name="settings_eh_sign_out_tip">Sesion cerrada, reinicie la aplicacion para inicar sesion</string>
<string name="settings_eh_gallery_site">Sitio de la Galeria</string>
<string name="settings_eh_list_mode">Modo de Lista</string>
<string name="settings_eh_list_mode_detail">Detallado</string>
<string name="settings_eh_list_mode_thumb">Vista previa</string>
<string name="settings_eh_detail_size">Detalles de tamaño</string>
<string name="settings_eh_detail_size_long">Largo</string>
<string name="settings_eh_detail_size_short">Corto</string>
<string name="settings_eh_thumb_size">Tamaño de vista previa</string>
<string name="settings_eh_thumb_size_large">Largo</string>
<string name="settings_eh_thumb_size_middle">Medio</string>
<string name="settings_eh_thumb_size_small">Pequeño</string>
<string name="settings_eh_thumb_resolution">Resolucion de vista previa</string>
<string name="settings_eh_thumb_resolution_summary">%s, las resoluciones especiales podrian causar vistas previas falidas</string>
<string name="settings_eh_thumb_resolution_auto">Auto</string>
<string name="settings_eh_fix_thumb_url">Reparar URL de vistas previas</string>
<string name="settings_eh_default_categories">Categorias en la Pagina de Inicio</string>
<string name="settings_eh_default_categories_summary">Las categorias se muetras en la Pgina de Inicio por defecto.</string>
<string name="settings_eh_excluded_languages">Idiomas excluidos</string>
<string name="settings_eh_excluded_languages_summary">Ocultar galerias en ciertos idiomas de las busquedas y la lista de galerias</string>
<string name="settings_eh_excluded_tag_namespaces">Excluir etiquetas variables</string>
<string name="settings_eh_excluded_tag_namespaces_summary">Excluir ciertas variables de una busqueda de etiquetas por defecto</string>
<string name="settings_eh_hath_proxy">H@H proxy</string>
<string name="settings_eh_hath_proxy_summary_1">%1$s %2$s:%3$d</string>
<string name="settings_eh_hath_proxy_summary_2">Sin Establecer</string>
<string name="settings_eh_show_jpn_title">Mostrar titulo japones</string>
<string name="settings_eh_show_jpn_title_summary_on">Intentar mostrar titulo Japones. Pude tomar mas tiempo al obtener la lista de galerias</string>
<string name="settings_eh_show_jpn_title_summary_off">Mostrar titulo por defecto, usuamente es en ingles</string>
<string name="settings_eh_filter">Filtros</string>
<string name="settings_eh_filter_summary">Filtrar por titulo, uploader,etiqueta y etiquetas variables</string>
<string name="settings_eh_cellular_network_warning">Advertencia de redes moviles</string>
<string name="settings_read">Leer</string>
<string name="settings_read_screen_rotation">Orientacion de la Pantala</string>
<string name="settings_read_screen_rotation_default">Defecto</string>
<string name="settings_read_screen_rotation_portrait">Retrato</string>
<string name="settings_read_screen_rotation_landscape">Paisaje</string>
<string name="settings_read_reading_direction">Direccion de Lectura</string>
<string name="settings_read_reading_direction_left_to_right">Izquierda a Derecha</string>
<string name="settings_read_reading_direction_right_to_Left">Derecha a Izquierda</string>
<string name="settings_read_reading_direction_top_to_bottom">Arriba hacia Abajo</string>
<string name="settings_read_page_scaling">Escala de pagina</string>
<string name="settings_read_page_scaling_actual_size">Tamaño actual</string>
<string name="settings_read_page_scaling_fit_to_width">Ajustar a lo ancho</string>
<string name="settings_read_page_scaling_fit_to_height">Ajustar a la altura</string>
<string name="settings_read_page_scaling_fit_to_screen">Ajustar a la pantalla</string>
<string name="settings_read_page_scaling_fixed_scale">Escala fija</string>
<string name="settings_read_start_position">Posicion de Inicio</string>
<string name="settings_read_start_position_top_left">Arriba a la izquierda</string>
<string name="settings_read_start_position_top_right">Abajo a la derecha</string>
<string name="settings_read_start_position_bottom_left">Abajo a la izquierda</string>
<string name="settings_read_start_position_bottom_right">Abajo a la derecha</string>
<string name="settings_read_start_position_center">Centro</string>
<string name="settings_read_keep_screen_on">Pantalla siempre encendida</string>
<string name="settings_read_show_clock">Mostrar Hora</string>
<string name="settings_read_show_progress">Mostrar Progreso</string>
<string name="settings_read_show_battery">Mostrar Bateria</string>
<string name="settings_read_volume_page">Usar teclas de volumen para pasar paginas</string>
<string name="settings_read_reading_fullscreen">Pantalla Completa</string>
<string name="settings_read_custom_screen_lightness">Brillo de pantalla perzonalizado</string>
<string name="settings_read_screen_lightness">Brillo de la pantalla</string>
<string name="settings_download">Descargas</string>
<string name="settings_download_download_location">Localizacion de descargas</string>
<string name="settings_download_invalid_download_location">Ruta de descarga invalida</string>
<string name="settings_download_cant_get_download_location">No se puede obtener ruta de descargas</string>
<string name="settings_download_pick_dir_kk">No puedes escribir ningun tipo de datos en tu memoria SD externa en Android 4.4+ a no ser que la hayas hakeado. Pero &lt;SD card&gt;/Android/data/com.hippo.ehviewer es especial, puedes escribir en ello.</string>
<string name="settings_download_pick_dir_l">Anroid 5.0+ proporciona una nueva API para escribir en una tarjeta SD externa. Haga click en el boton \"DOCUMENT\" si desea establecer la ruta de descarga en una tarjeta SD.</string>
<string name="settings_download_document">Document</string>
<string name="settings_download_continue">Continuar</string>
<string name="settings_download_media_scan">Permitir escaneo de medios</string>
<string name="settings_download_media_scan_summary_on">Por favor mantenga sus aplicaciones de galeria lejor de otras personas (si no quiere que vean sus descargas)</string>
<string name="settings_download_media_scan_summary_off">Las aplicaciones de galeria de imagenes ignoraran la ruta de descargas de galerias</string>
<string name="settings_download_multi_thread_download">Multi hilos al descargar</string>
<string name="settings_download_multi_thread_download_summary">Maximo de %s imagenes</string>
<string name="settings_download_preload_image">Precargar Imagen</string>
<string name="settings_download_preload_image_summary">Precargar las siguientes %s imagenes</string>
<string name="settings_download_image_resolution">Resolucion de la imagen</string>
<string name="settings_download_image_resolution_summary">%s, resoluciones mayores a 1280x podrian no funcionar</string>
<string name="settings_download_image_resolution_auto">Auto</string>
<string name="settings_download_download_origin_image">Descargar imagen original</string>
<string name="settings_download_download_origin_image_summary">Es peligroso! Puede obtener el error 509</string>
<string name="settings_download_restore_download_items">Restaurar los elemntos de descarga</string>
<string name="settings_download_restore_download_items_summary">Restaurar todos los elemntos de descarga en la ubicacion de descarga</string>
<string name="settings_download_restoring">Restaurando...</string>
<string name="settings_download_restore_not_found">No se han encontrado elemntos para restaurar</string>
<string name="settings_download_restore_failed">restauracion fallida</string>
<string name="settings_download_restore_successfully">Restauracion de %d elementos completados</string>
<string name="settings_download_clean_redundancy">Borrar descargas redundantes</string>
<string name="settings_download_clean_redundancy_summary">Eliminar galeria de imagenes si no esta en la lista de descargas pero si en la direccion de descargas</string>
<string name="settings_download_clean_redundancy_no_redundancy">Sin redundancia</string>
<string name="settings_download_clean_redundancy_done">Borrado de redundancia completado, Borrados %d elemtos totales</string>
<string name="settings_advanced">Avanzado</string>
<string name="settings_advanced_save_parse_error_body">Guardar contenido en HTML al analizar el error</string>
<string name="settings_advanced_save_parse_error_body_summary">El contenido HTML puede ser sensible a la privacidad</string>
<string name="settings_advanced_dump_logcat">Dump logcat</string>
<string name="settings_advanced_dump_logcat_summary">Guardar logcat en almacenamiento externo</string>
<string name="settings_advanced_dump_logcat_failed">Dump logcat fallado</string>
<string name="settings_advanced_dump_logcat_to">Logcat guardado en %s</string>
<string name="settings_advanced_clear_download_path_cache">Borrar cache de la ruta de descarga</string>
<string name="settings_advanced_clear_download_path_cache_summary">Gallery download path might be wrong and it need to be redownload. Clearing download path cache might solve the problem.</string>
<string name="settings_advanced_clear_download_path_cache_message">Borrar cache de la ruta de descarga?</string>
<string name="settings_advanced_clear_memory_cache">Borrar cache de memoria</string>
<string name="settings_advanced_clear_memory_cache_summary">Borrar vistas previas, galerias, informacion y cache de memoria</string>
<string name="settings_advanced_read_cache_size">Leer el tamaño de la cahce</string>
<string name="settings_advanced_pattern_protection_title">Proteccion por patrón</string>
<string name="settings_advanced_pattern_protection_not_set">No se ha configurado la proteccion por patrón</string>
<string name="settings_advanced_pattern_protection_set">La proteccion por patrón ha sido configurado</string>
<string name="settings_advanced_export_data">Exportar datos</string>
<string name="settings_advanced_export_data_summary">Guardar datos en almacenamiento externo, tales como la lista de descarga, lista de busqueda raida, etc</string>
<string name="settings_advanced_export_data_to">Datos esportados en %s</string>
<string name="settings_advanced_export_data_failed">Exportacion de datos fallado</string>
<string name="settings_advanced_import_data">importar datos</string>
<string name="settings_advanced_import_data_summary">Cargar datos guardados anteriormente</string>
<string name="settings_advanced_import_data_successfully">Importacion de datos completo</string>
<string name="settings_about">Acerca de</string>
<string name="settings_about_author">Autor</string>
<string name="settings_about_google_plus">Comunidad en Google+</string>
<string name="settings_about_website">PaginaWeb</string>
<string name="settings_about_source">Codigo Fuente</string>
<string name="settings_about_changelog">Registro de Cambios.</string>
<string name="settings_about_help">Ayuda</string>
<string name="settings_about_license">Licencia</string>
<string name="settings_about_license_summary">EhViewer es posible gracias a varios proyectos de codigo abierto</string>
<string name="settings_about_donate">Donar</string>
<string name="settings_about_donate_summary">Alipay: seven332$163.com</string>
<string name="settings_about_donate_message">Tu donacion me ayuda a desarrollar mas y mejores aplicaciones.\n\nAlipay: seven332$163.com</string>
<string name="settings_about_donate_toast">Email copiado a el portapapeles</string>
<string name="settings_about_enable_analytics">Habilitar analytics</string>
<string name="settings_about_about_analytics">Acerca de analytics</string>
<string name="settings_about_version">Version de Compilacion</string>
<string name="settings_about_check_for_updates">Verificar Actualizaciones.</string>
<string name="settings_about_beta_update_channel">Canal de actualizaciones Beta</string>
<string name="settings_about_beta_update_channel_summary">Versiones Beta pueden fallar en tu dispositivo.</string>
<string name="enable">Hablilitar</string>
<string name="enabled">Hablilitado</string>
<string name="ip">IP</string>
<string name="port">Puerto</string>
<string name="Passkey">Clave Maestra</string>
<string name="domain_not_supported">Dominio no soportado</string>
<string name="invalid_port">Puerto Invalido</string>
<string name="cant_get_data_dir">No se puede obtener el directorio de datos</string>
<string name="cant_find_any_data">No se pueden encuentran datos</string>
<string name="cant_read_the_file">No se puede leer el archivo</string>
<!-- ExcludedLanguagesScene -->
<string name="excluded_languages">Excluir idiomas</string>
<string name="select_all">Seleccionar todo</string>
<string name="deselect_all">Ninguno</string>
<string name="invert_selection">Invertir</string>
<string name="language">Idioma</string>
<string name="original">Original</string>
<string name="translated">Traducido</string>
<string name="rewrite">Reescribir</string>
<string name="language_japanese">Japones</string>
<string name="language_english">ingles</string>
<string name="language_chinese">Chino</string>
<string name="language_dutch">Holandes</string>
<string name="language_french">Frances</string>
<string name="language_german">Aleman</string>
<string name="language_hungarian">Hungaro</string>
<string name="language_italian">Italiano</string>
<string name="language_korean">Koreano</string>
<string name="language_polish">Polaco</string>
<string name="language_portuguese">Portugues</string>
<string name="language_russian">Ruso</string>
<string name="language_spanish">Español</string>
<string name="language_thai">Tailandes</string>
<string name="language_vietnamese">Vietnamita</string>
<string name="language_na">N/A</string>
<string name="language_other">Otros</string>
<string name="please_wait">Espere</string>
<!-- License -->
<string name="license">Licencia</string>
<!-- Dir Picker-->
<!-- Favorites -->
<string name="cloud_favorites">Favoritos en la nube</string>
<string name="local_favorites">Favoritos Locales</string>
<string name="favorites_search_bar_hint">Buscar %s</string>
<string name="favorites_title">%s</string>
<string name="favorites_title_2">%1$s - %2$s</string>
<string name="delete_favorites_dialog_title">Eliminar de favoritos</string>
<string name="delete_favorites_dialog_message">Eliminar %d Elementos de favoritos?</string>
<string name="move_favorites_dialog_title">Mover favoritos</string>
<string name="default_favorites_collection">Colección de favoritos por defecto</string>
<string name="let_me_select">Permiteme seleccionar</string>
<string name="favorites_info">Informacion de favoritos</string>
<string name="collections">Colecciones</string>
<string name="need_sign_in">Inicio de sesion requerido</string>
<!-- Progress Scene -->
<!-- Guide -->
<string name="guide_quick_search_title">Busqueda Rapida</string>
<string name="guide_quick_search_text">Desliza a la derecha para abrir el panel de busqueda rapida</string>
<string name="guide_collections_title">Colecciones</string>
<string name="guide_collections_text">Desliza hacia la derecha para elegir favoritos</string>
<string name="guide_download_labels_title">Descargas</string>
<string name="guide_download_labels_text">Desliza hacia la derecha para abrir el panel de descarga</string>
<string name="guide_download_thumb_title">Detalles de galeria</string>
<string name="guide_download_thumb_text">Click en la imagen para ver detalles de la galeria</string>
<string name="guide_gallery_left">Giro de Pagina</string>
<string name="guide_gallery_right">Giro de Pagina</string>
<string name="guide_gallery_menu">Menu</string>
<string name="guide_gallery_progress">Progreso</string>
<string name="guide_gallery_long_click">Click largo para abrir el menu de pagina</string>
<!-- Readable Time -->
<string name="from_the_future">Desde el futuro</string>
<string name="just_now">Ahora!</string>
<plurals name="some_minutes_ago">
<item quantity="one">A minute ago</item>
<item quantity="other">%d minutes ago</item>
</plurals>
<plurals name="some_hours_ago">
<item quantity="one">An hour ago</item>
<item quantity="other">%d hours ago</item>
</plurals>
<string name="yesterday">Ayer.</string>
<string name="some_days_ago">%d dias atras</string>
<plurals name="second">
<item quantity="one">sec</item>
<item quantity="other">secs</item>
</plurals>
<plurals name="minute">
<item quantity="one">min</item>
<item quantity="other">mins</item>
</plurals>
<plurals name="hour">
<item quantity="one">hour</item>
<item quantity="other">hours</item>
</plurals>
<plurals name="day">
<item quantity="one">day</item>
<item quantity="other">days</item>
</plurals>
<plurals name="year">
<item quantity="one">year</item>
<item quantity="other">years</item>
</plurals>
<string name="no_archives">Sin Archivos</string>
<string name="download_archive_started">Descarga de arcivos iniciada</string>
<string name="download_archive_failure">Error al descargar archivo</string>
<string name="download_archive_failure_no_hath">Nesecita un cliente H@H para descargar archivo</string>
<string name="add_to_favorite_success">Añadido a favoritos</string>
<string name="add_to_favourites">Agregar a favoritos</string>
<string name="cancel_vote_down">Cancelar voto negativo</string>
<string name="clear_all">Limpiar Todo</string>
<string name="comment_failed">Comentario Fallido</string>
<string name="count">Contar</string>
<string name="archive">Archivo</string>
<string name="delete">Eliminar</string>
<string name="dir_picker">Seleccionar directorio</string>
<string name="directory_not_writable">No se puede escribir en el directorio</string>
<string name="disabled">Deshabilitado</string>
<string name="download_state_failed">Descarga fallida</string>
<string name="download_state_none">Descarga Parada</string>
<string name="error_password_cannot_empty">La contraseña no puede estar vacia</string>
<string name="error_something_wrong_happened">Sucedio algo malo</string>
<string name="dialog_archive_title">H@H Downloader</string>
</resources>
+20 -11
View File
@@ -29,10 +29,10 @@
<string name="username">用户名</string>
<string name="password">密码</string>
<string name="sign_in">登陆</string>
<string name="sign_in">登录</string>
<string name="register">注册</string>
<string name="sign_in_via_webview">通过网页登陆</string>
<string name="sign_in_via_cookies">通过 Cookie 登陆</string>
<string name="sign_in_via_webview">通过网页登录</string>
<string name="sign_in_via_cookies">通过 Cookie 登录</string>
<string name="display_name_dialog_title">输入昵称</string>
<string name="display_name">昵称</string>
<string name="display_name_is_empty">昵称为空</string>
@@ -40,7 +40,7 @@
<string name="default_display_name">Little Hippo</string>
<string name="cookie_explain">Cookie 是存储在浏览器里的一小块数据。如果您不清楚 Cookie 什么或者怎么获取 Cookie,最好搜索一下。\n\n请输入特定的 Cookie 来登陆。</string>
<string name="cookie_explain">Cookie 是存储在浏览器里的一小块数据。如果您不清楚 Cookie 什么或者怎么获取 Cookie,最好搜索一下。\n\n请输入特定的 Cookie 来登录。</string>
<string name="text_is_empty">文本为空</string>
<string name="waring">警告</string>
<string name="wrong_cookie_warning">看起来您输入的 Cookie 是错误的,最好检查一下。</string>
@@ -81,9 +81,9 @@
<string name="app_waring">本应用中内容来自互联网,部分内容可能对您的生理及心理造成难以恢复的伤害。本应用作者不会对由本应用造成的任何后果负责。</string>
<string name="error_username_cannot_empty">用户名不可为空</string>
<string name="error_password_cannot_empty">密码不可为空</string>
<string name="skip_signing_in">跳过登陆</string>
<string name="sign_in_failed">登陆失败</string>
<string name="sign_in_failed_plain">这可能是网站更新导致的,也有可能是发生了奇怪的事情。您可以选择在登陆按钮下方通过网页登陆或者输入 cookie,或者跳过登陆。跳过登陆可能导致无法正常使用应用。如果你已经在 0.6.x 版登陆过了,请优先尝试选择“通过 Cookie 登陆”。</string>
<string name="skip_signing_in">跳过登录</string>
<string name="sign_in_failed">登录失败</string>
<string name="sign_in_failed_plain">这可能是网站更新导致的,也有可能是发生了奇怪的事情。您可以选择在登录按钮下方通过网页登录或者输入 cookie,或者跳过登录。跳过登录可能导致无法正常使用应用。如果你已经在 0.6.x 版登录过了,请优先尝试选择“通过 Cookie 登录”。</string>
<string name="press_twice_exit">再按一次退出</string>
<string name="content_layout_restore_tip">点击重试</string>
<string name="write_rationale">EhViewer 将申请设备存储空间访问权限以便下载画廊。您愿意授权吗?</string>
@@ -99,7 +99,7 @@
<!-- Select scene -->
<string name="select_scene">你想选择哪个画廊站点?</string>
<string name="select_scene_explain">e-hentai:对任何人开放\nexhentai:仅对登陆用户开放</string>
<string name="select_scene_explain">e-hentai:对任何人开放\nexhentai:仅对登录用户开放</string>
<string name="no_select">请选择一个站点</string>
<!-- Update -->
@@ -341,6 +341,7 @@
<string name="set_pattern_protection">设置图案保护</string>
<string name="set_pattern_protection_tip">绘制图案来设置图案保护\n留空来取消图案保护</string>
<string name="set">设置</string>
<string name="enable_fingerprint">允许使用指纹解锁</string>
<!-- Gallery Activity -->
<string name="page_menu_title">第 %d 页</string>
@@ -354,11 +355,11 @@
<!-- Settings -->
<string name="settings_eh">EH</string>
<string name="settings_eh_sign_out">退出登陆</string>
<string name="settings_eh_sign_out_summary">退出登陆后重启应用以便再次登陆</string>
<string name="settings_eh_sign_out">退出登录</string>
<string name="settings_eh_sign_out_summary">退出登录后重启应用以便再次登录</string>
<string name="settings_eh_sign_out_warning">天哪,我的老伙计,你要退出登录吗?我是说,你真的要退出登录吗?</string>
<string name="settings_eh_sign_out_yes">是的,我是说,真的</string>
<string name="settings_eh_sign_out_tip">已退出登陆,重启应用以便再次登陆</string>
<string name="settings_eh_sign_out_tip">已退出登录,重启应用以便再次登录</string>
<string name="settings_eh_gallery_site">画廊站点</string>
<string name="settings_eh_list_mode">列表模式</string>
<string name="settings_eh_list_mode_detail">详情</string>
@@ -373,6 +374,7 @@
<string name="settings_eh_thumb_resolution">缩略图分辨率</string>
<string name="settings_eh_thumb_resolution_summary">%s,指定分辨率可能使获取缩略图失败</string>
<string name="settings_eh_thumb_resolution_auto">自动</string>
<string name="settings_eh_fix_thumb_url">修正缩略图链接</string>
<string name="settings_eh_default_categories">主页分类显示</string>
<string name="settings_eh_default_categories_summary">默认在主页所显示的分类</string>
<string name="settings_eh_excluded_tag_namespaces">排除标签组</string>
@@ -489,6 +491,7 @@
<string name="settings_about_donate_toast">邮箱地址已复制到剪切板</string>
<string name="settings_about_enable_analytics">启用数据统计</string>
<string name="settings_about_about_analytics">关于数据统计</string>
<string name="settings_about_version">版本号</string>
<string name="settings_about_check_for_updates">检查更新</string>
<string name="settings_about_beta_update_channel">更新测试版</string>
<string name="settings_about_beta_update_channel_summary">测试版可能在你的设备上出现不可预知的错误</string>
@@ -603,5 +606,11 @@
<plurals name="year">
<item quantity="other">年</item>
</plurals>
<string name="dialog_archive_title">通过 H@H 下载</string>
<string name="no_archives">没有压缩包</string>
<string name="download_archive_started">开始下载压缩包</string>
<string name="download_archive_failure">无法下载压缩包</string>
<string name="archive">压缩包</string>
<string name="download_archive_failure_no_hath">下载压缩包需要 H@H 客户端</string>
</resources>
+20 -11
View File
@@ -29,10 +29,10 @@
<string name="username">用户名</string>
<string name="password">密碼</string>
<string name="sign_in">登陸</string>
<string name="sign_in">登錄</string>
<string name="register">註冊</string>
<string name="sign_in_via_webview">通過網頁登陸</string>
<string name="sign_in_via_cookies">通過 Cookie 登陸</string>
<string name="sign_in_via_webview">通過網頁登錄</string>
<string name="sign_in_via_cookies">通過 Cookie 登錄</string>
<string name="display_name_dialog_title">輸入暱稱</string>
<string name="display_name">暱稱</string>
<string name="display_name_is_empty">暱稱為空</string>
@@ -40,7 +40,7 @@
<string name="default_display_name">Little Hippo</string>
<string name="cookie_explain">Cookie 是存儲在瀏覽器裏的一小塊數據。如果您不清楚 Cookie 什麼或者怎麼獲取 Cookie,最好搜索一下。\n\n請輸入特定的 Cookie 來登陸。</string>
<string name="cookie_explain">Cookie 是存儲在瀏覽器裏的一小塊數據。如果您不清楚 Cookie 什麼或者怎麼獲取 Cookie,最好搜索一下。\n\n請輸入特定的 Cookie 來登錄。</string>
<string name="text_is_empty">文本為空</string>
<string name="waring">警告</string>
<string name="wrong_cookie_warning">看起來您輸入的 Cookie 是錯誤的,最好檢查一下。</string>
@@ -81,9 +81,9 @@
<string name="app_waring">本應用中內容來自互聯網,部分內容可能對您的生理及心理造成難以恢復的傷害。本應用作者不會對由本應用造成的任何後果負責。</string>
<string name="error_username_cannot_empty">用户名不可為空</string>
<string name="error_password_cannot_empty">密碼不可為空</string>
<string name="skip_signing_in">跳過登陸</string>
<string name="sign_in_failed">登陸失敗</string>
<string name="sign_in_failed_plain">這可能是網站更新導致的,也有可能是發生了奇怪的事情。您可以選擇在登陸按鈕下方通過網頁登陸或者輸入 cookie,或者跳過登陸。跳過登陸可能導致無法正常使用應用。如果你已經在 0.6.x 版登陸過了,請優先嚐試選擇“通過 Cookie 登陸”。</string>
<string name="skip_signing_in">跳過登錄</string>
<string name="sign_in_failed">登錄失敗</string>
<string name="sign_in_failed_plain">這可能是網站更新導致的,也有可能是發生了奇怪的事情。您可以選擇在登錄按鈕下方通過網頁登錄或者輸入 cookie,或者跳過登錄。跳過登錄可能導致無法正常使用應用。如果你已經在 0.6.x 版登錄過了,請優先嚐試選擇“通過 Cookie 登錄”。</string>
<string name="press_twice_exit">再按一次退出</string>
<string name="content_layout_restore_tip">點擊重試</string>
<string name="write_rationale">EhViewer 將申請設備存儲空間訪問權限以便下載畫廊。您願意授權嗎?</string>
@@ -99,7 +99,7 @@
<!-- Select scene -->
<string name="select_scene">你想選擇哪個畫廊站點?</string>
<string name="select_scene_explain">e-hentai:對任何人開放\nexhentai:僅對登陸用户開放</string>
<string name="select_scene_explain">e-hentai:對任何人開放\nexhentai:僅對登錄用户開放</string>
<string name="no_select">請選擇一個站點</string>
<!-- Update -->
@@ -341,6 +341,7 @@
<string name="set_pattern_protection">設置圖案保護</string>
<string name="set_pattern_protection_tip">繪製圖案來設置圖案保護\n留空來取消圖案保護</string>
<string name="set">設置</string>
<string name="enable_fingerprint">允許使用指紋解鎖</string>
<!-- Gallery Activity -->
<string name="page_menu_title">第 %d 頁</string>
@@ -354,11 +355,11 @@
<!-- Settings -->
<string name="settings_eh">EH</string>
<string name="settings_eh_sign_out">退出登陸</string>
<string name="settings_eh_sign_out_summary">退出登陸後重啟應用以便再次登陸</string>
<string name="settings_eh_sign_out">退出登錄</string>
<string name="settings_eh_sign_out_summary">退出登錄後重啟應用以便再次登錄</string>
<string name="settings_eh_sign_out_warning">天哪,我的老夥計,你要退出登錄嗎?我是説,你真的要退出登錄嗎?</string>
<string name="settings_eh_sign_out_yes">是的,我是説,真的</string>
<string name="settings_eh_sign_out_tip">已退出登陸,重啟應用以便再次登陸</string>
<string name="settings_eh_sign_out_tip">已退出登錄,重啟應用以便再次登錄</string>
<string name="settings_eh_gallery_site">畫廊站點</string>
<string name="settings_eh_list_mode">列表模式</string>
<string name="settings_eh_list_mode_detail">詳情</string>
@@ -373,6 +374,7 @@
<string name="settings_eh_thumb_resolution">縮略圖分辨率</string>
<string name="settings_eh_thumb_resolution_summary">%s,指定分辨率可能使獲取縮略圖失敗</string>
<string name="settings_eh_thumb_resolution_auto">自動</string>
<string name="settings_eh_fix_thumb_url">修正縮略圖鏈接</string>
<string name="settings_eh_default_categories">主頁分類顯示</string>
<string name="settings_eh_default_categories_summary">默認在主頁所顯示的分類</string>
<string name="settings_eh_excluded_tag_namespaces">排除標籤組</string>
@@ -489,6 +491,7 @@
<string name="settings_about_donate_toast">郵箱地址已複製到剪切板</string>
<string name="settings_about_enable_analytics">啟用數據統計</string>
<string name="settings_about_about_analytics">關於數據統計</string>
<string name="settings_about_version">版本號</string>
<string name="settings_about_check_for_updates">檢查更新</string>
<string name="settings_about_beta_update_channel">更新測試版</string>
<string name="settings_about_beta_update_channel_summary">測試版可能在你的設備上出現不可預知的錯誤</string>
@@ -603,5 +606,11 @@
<plurals name="year">
<item quantity="other">年</item>
</plurals>
<string name="dialog_archive_title">通過 H@H 下載</string>
<string name="no_archives">沒有壓縮包</string>
<string name="download_archive_started">開始下載壓縮包</string>
<string name="download_archive_failure">無法下載壓縮包</string>
<string name="archive">壓縮包</string>
<string name="download_archive_failure_no_hath">下載壓縮包需要 H@H 客户端</string>
</resources>
+20 -11
View File
@@ -29,10 +29,10 @@
<string name="username">使用者名稱</string>
<string name="password">密碼</string>
<string name="sign_in">登陸</string>
<string name="sign_in">登入</string>
<string name="register">註冊</string>
<string name="sign_in_via_webview">通過網頁登陸</string>
<string name="sign_in_via_cookies">通過 Cookie 登陸</string>
<string name="sign_in_via_webview">通過網頁登入</string>
<string name="sign_in_via_cookies">通過 Cookie 登入</string>
<string name="display_name_dialog_title">輸入暱稱</string>
<string name="display_name">暱稱</string>
<string name="display_name_is_empty">暱稱為空</string>
@@ -40,7 +40,7 @@
<string name="default_display_name">Little Hippo</string>
<string name="cookie_explain">Cookie 是儲存在瀏覽器裡的一小塊資料。如果您不清楚 Cookie 什麼或者怎麼獲取 Cookie,最好搜尋一下。\n\n請輸入特定的 Cookie 來登陸。</string>
<string name="cookie_explain">Cookie 是儲存在瀏覽器裡的一小塊資料。如果您不清楚 Cookie 什麼或者怎麼獲取 Cookie,最好搜尋一下。\n\n請輸入特定的 Cookie 來登入。</string>
<string name="text_is_empty">文字為空</string>
<string name="waring">警告</string>
<string name="wrong_cookie_warning">看起來您輸入的 Cookie 是錯誤的,最好檢查一下。</string>
@@ -81,9 +81,9 @@
<string name="app_waring">本應用中內容來自網際網路,部分內容可能對您的生理及心理造成難以恢復的傷害。本應用作者不會對由本應用造成的任何後果負責。</string>
<string name="error_username_cannot_empty">使用者名稱不可為空</string>
<string name="error_password_cannot_empty">密碼不可為空</string>
<string name="skip_signing_in">跳過登陸</string>
<string name="sign_in_failed">登陸失敗</string>
<string name="sign_in_failed_plain">這可能是網站更新導致的,也有可能是發生了奇怪的事情。您可以選擇在登陸按鈕下方通過網頁登陸或者輸入 cookie,或者跳過登陸。跳過登陸可能導致無法正常使用應用。如果你已經在 0.6.x 版登陸過了,請優先嚐試選擇“通過 Cookie 登陸”。</string>
<string name="skip_signing_in">跳過登入</string>
<string name="sign_in_failed">登入失敗</string>
<string name="sign_in_failed_plain">這可能是網站更新導致的,也有可能是發生了奇怪的事情。您可以選擇在登入按鈕下方通過網頁登入或者輸入 cookie,或者跳過登入。跳過登入可能導致無法正常使用應用。如果你已經在 0.6.x 版登入過了,請優先嚐試選擇“通過 Cookie 登入”。</string>
<string name="press_twice_exit">再按一次退出</string>
<string name="content_layout_restore_tip">點選重試</string>
<string name="write_rationale">EhViewer 將申請裝置儲存空間訪問許可權以便下載畫廊。您願意授權嗎?</string>
@@ -99,7 +99,7 @@
<!-- Select scene -->
<string name="select_scene">你想選擇哪個畫廊站點?</string>
<string name="select_scene_explain">e-hentai:對任何人開放\nexhentai:僅對登陸使用者開放</string>
<string name="select_scene_explain">e-hentai:對任何人開放\nexhentai:僅對登入使用者開放</string>
<string name="no_select">請選擇一個站點</string>
<!-- Update -->
@@ -341,6 +341,7 @@
<string name="set_pattern_protection">設定圖案保護</string>
<string name="set_pattern_protection_tip">繪製圖案來設定圖案保護\n留空來取消圖案保護</string>
<string name="set">設定</string>
<string name="enable_fingerprint">允許使用指紋解鎖</string>
<!-- Gallery Activity -->
<string name="page_menu_title">第 %d 頁</string>
@@ -354,11 +355,11 @@
<!-- Settings -->
<string name="settings_eh">EH</string>
<string name="settings_eh_sign_out">退出登陸</string>
<string name="settings_eh_sign_out_summary">退出登陸後重啟應用以便再次登陸</string>
<string name="settings_eh_sign_out">退出登入</string>
<string name="settings_eh_sign_out_summary">退出登入後重啟應用以便再次登入</string>
<string name="settings_eh_sign_out_warning">天哪,我的老夥計,你要退出登入嗎?我是說,你真的要退出登入嗎?</string>
<string name="settings_eh_sign_out_yes">是的,我是說,真的</string>
<string name="settings_eh_sign_out_tip">已退出登陸,重啟應用以便再次登陸</string>
<string name="settings_eh_sign_out_tip">已退出登入,重啟應用以便再次登入</string>
<string name="settings_eh_gallery_site">畫廊站點</string>
<string name="settings_eh_list_mode">列表模式</string>
<string name="settings_eh_list_mode_detail">詳情</string>
@@ -373,6 +374,7 @@
<string name="settings_eh_thumb_resolution">縮圖解析度</string>
<string name="settings_eh_thumb_resolution_summary">%s,指定解析度可能使獲取縮圖失敗</string>
<string name="settings_eh_thumb_resolution_auto">自動</string>
<string name="settings_eh_fix_thumb_url">修正縮圖連結</string>
<string name="settings_eh_default_categories">主頁分類顯示</string>
<string name="settings_eh_default_categories_summary">預設在主頁所顯示的分類</string>
<string name="settings_eh_excluded_tag_namespaces">排除標籤組</string>
@@ -489,6 +491,7 @@
<string name="settings_about_donate_toast">郵箱地址已複製到剪下板</string>
<string name="settings_about_enable_analytics">啟用資料統計</string>
<string name="settings_about_about_analytics">關於資料統計</string>
<string name="settings_about_version">版本號</string>
<string name="settings_about_check_for_updates">檢查更新</string>
<string name="settings_about_beta_update_channel">更新測試版</string>
<string name="settings_about_beta_update_channel_summary">測試版可能在你的裝置上出現不可預知的錯誤</string>
@@ -603,5 +606,11 @@
<plurals name="year">
<item quantity="other">年</item>
</plurals>
<string name="dialog_archive_title">通過 H@H 下載</string>
<string name="no_archives">沒有壓縮包</string>
<string name="download_archive_started">開始下載壓縮包</string>
<string name="download_archive_failure">無法下載壓縮包</string>
<string name="archive">壓縮包</string>
<string name="download_archive_failure_no_hath">下載壓縮包需要 H@H 客戶端</string>
</resources>
+1
View File
@@ -77,5 +77,6 @@
<string name="pd_sad_panda_nose" translatable="false">M12,17C12.8,17,13.5,17.4,13.5,18S12.8,19,12,19S10.5,18.6,10.5,18S11.2,17,12,17Z</string>
<string name="pd_sad_panda" translatable="false">M21.1,7.8C22.2,7.4,23,6.3,23,5C23,3.3,21.7,2,20,2C18.9,2,17.9,2.6,17.4,3.6L21.1,7.8M6.6,3.6C6.1,2.6,5.1,2,4,2C2.3,2,1,3.3,1,5C1,6.3,1.8,7.4,2.9,7.8L6.6,3.6M10.1,13L8,15.1C7.4,15.7,6.5,15.7,5.9,15.1L5.9,15.1C5.3,14.5,5.3,13.6,5.9,13L8,10.9C8.6,10.3,9.5,10.3,10.1,10.9L10.1,10.9C10.7,11.5,10.7,12.4,10.1,13M16,15.1L13.9,13C13.3,12.4,13.3,11.5,13.9,10.9L13.9,10.9C14.5,10.3,15.4,10.3,16,10.9L18.1,13C18.7,13.6,18.7,14.5,18.1,15.1L18.1,15.1C17.5,15.7,16.6,15.7,16,15.1M12,17C12.8,17,13.5,17.4,13.5,18S12.8,19,12,19S10.5,18.6,10.5,18S11.2,17,12,17Z</string>
<string name="pd_sad_panda_face" translatable="false">M17.4,3.6C15.8,2.6,14,2,12,2S8.2,2.6,6.6,3.6L2.9,7.8C2.3,9.1,2,10.5,2,12C2,17.5,6.5,22,12,22S22,17.5,22,12C22,10.5,21.7,9.1,21.1,7.8L17.4,3.6Z</string>
<string name="pd_archive" translatable="false">M19.35,10.04C18.67,6.59 15.64,4 12,4 9.11,4 6.6,5.64 5.35,8.04 2.34,8.36 0,10.91 0,14c0,3.31 2.69,6 6,6h13c2.76,0 5,-2.24 5,-5 0,-2.64 -2.05,-4.78 -4.65,-4.96zM10,17l-3.5,-3.5 1.41,-1.41L10,14.17 15.18,9l1.41,1.41L10,17z</string>
</resources>
+9
View File
@@ -385,6 +385,7 @@
<string name="set_pattern_protection">Set pattern protection</string>
<string name="set_pattern_protection_tip">Draw a pattern to set pattern protection\nLeave blank to clear pattern protection</string>
<string name="set">Set</string>
<string name="enable_fingerprint">Also allow unlock with fingerprint</string>
<!-- Gallery Activity -->
<string name="page_menu_title">Page %d</string>
@@ -416,6 +417,7 @@
<string name="settings_eh_thumb_resolution">Thumb resolution</string>
<string name="settings_eh_thumb_resolution_summary">%s, special resolutions might cause getting thumb failed</string>
<string name="settings_eh_thumb_resolution_auto">Auto</string>
<string name="settings_eh_fix_thumb_url">Fix thumb url</string>
<string name="settings_eh_default_categories">Categories on Homepage</string>
<string name="settings_eh_default_categories_summary">The categories shown as default on Homepage</string>
<string name="settings_eh_excluded_languages">Excluded languages</string>
@@ -533,6 +535,7 @@
<string name="settings_about_donate_toast">Email address copied to clipboard</string>
<string name="settings_about_enable_analytics">Enable analytics</string>
<string name="settings_about_about_analytics">About analytics</string>
<string name="settings_about_version">Build version</string>
<string name="settings_about_check_for_updates">Check for updates</string>
<string name="settings_about_beta_update_channel">Beta update channel</string>
<string name="settings_about_beta_update_channel_summary">Beta release might be broken on your devices</string>
@@ -653,5 +656,11 @@
<item quantity="one">year</item>
<item quantity="other">years</item>
</plurals>
<string name="dialog_archive_title">H@H Downloader</string>
<string name="no_archives">No Archives</string>
<string name="download_archive_started">Archive download started</string>
<string name="download_archive_failure">Failed to download archive</string>
<string name="archive">Archive</string>
<string name="download_archive_failure_no_hath">Need H@H client for archive download</string>
</resources>
+3
View File
@@ -54,6 +54,9 @@
android:summary="@string/settings_about_license_summary"
app:activity="com.hippo.ehviewer.ui.LicenseActivity"/>
<com.hippo.ehviewer.preference.VersionPreference
android:key="version"/>
<Preference
android:key="check_for_updates"
android:title="@string/settings_about_check_for_updates"/>
+5
View File
@@ -64,6 +64,11 @@
app:entryValues="@array/thumb_resolution_entry_values"
android:defaultValue="0"/>
<com.hippo.preference.SwitchPreference
android:key="fix_thumb_url"
android:title="@string/settings_eh_fix_thumb_url"
android:defaultValue="false"/>
<com.hippo.ehviewer.preference.DefaultCategoryPreference
android:key="default_categories"
android:title="@string/settings_eh_default_categories"
+22
View File
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<path xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="image" path="EhViewer/image"/>
</path>
+19 -1
View File
@@ -3,9 +3,11 @@
buildscript {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.android.tools.build:gradle:2.3.2'
classpath 'com.github.seven332:android-chinese-string-gradle-plugin:0.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -22,3 +24,19 @@ allprojects {
task clean(type: Delete) {
delete rootProject.buildDir
}
ext {
supportLibrary = '25.3.1'
}
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
// Keep all android support library update to date
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "$supportLibrary"
}
}
}
}
+6 -6
View File
@@ -1,6 +1,6 @@
#Mon Jan 18 22:31:05 CST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-all.zip
#Mon Jan 18 22:31:05 CST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip