Upstream merge

Internal permission change
Fix url adder
This commit is contained in:
NerdNumber9 2017-05-04 23:38:17 -04:00
parent 3f758d5981
commit 9dbb59f337
616 changed files with 4186 additions and 230 deletions

0
.github/CONTRIBUTING.md vendored Normal file → Executable file
View File

0
.github/ISSUE_TEMPLATE.md vendored Normal file → Executable file
View File

2
.gitignore vendored Normal file → Executable file
View File

@ -7,3 +7,5 @@
*iml *iml
*.iml *.iml
*/build */build
/mainframer.sh
*.apk

0
.travis.yml Normal file → Executable file
View File

0
LICENSE Normal file → Executable file
View File

46
README.md Normal file → Executable file
View File

@ -1,24 +1,52 @@
| Build | Download | F-Droid | <div style="text-align:center"><img src ="https://raw.githubusercontent.com/NerdNumber9/TachiyomiEH/master/branding/teh-banner.png" /></div>
|-------|----------|-------------| <br>
| [![TeamCity (simple build status)](https://img.shields.io/teamcity/https/teamcity.kanade.eu/s/tachiyomi_Build.svg)](https://teamcity.kanade.eu/project.html?projectId=tachiyomi) [![Travis](https://img.shields.io/travis/inorichi/tachiyomi.svg)](https://travis-ci.org/inorichi/tachiyomi) | [![stable release](https://img.shields.io/github/release/inorichi/tachiyomi.svg?maxAge=3600&label=stable)](https://github.com/inorichi/tachiyomi/releases) [![latest dev build](https://img.shields.io/badge/dev-latest%20build-blue.svg)](http://tachiyomi.kanade.eu/latest/app-debug.apk) | [![fdroid release](https://img.shields.io/badge/stable-f--droid.org-blue.svg)](https://f-droid.org/repository/browse/?fdid=eu.kanade.tachiyomi) [![fdroid dev](https://img.shields.io/badge/dev-wiki-blue.svg)](//github.com/inorichi/tachiyomi/wiki/FDroid-for-dev-versions) |
## [Report an issue](https://github.com/inorichi/tachiyomi/blob/master/.github/CONTRIBUTING.md) TachiyomiEH is a free and open source E-Hentai, ExHentai and PervEden galleries reader for Android.
**Before reporting a new issue, take a look at the [FAQ](https://github.com/inorichi/tachiyomi/wiki/FAQ), the [changelog](https://github.com/inorichi/tachiyomi/releases) and the already opened issues.** TachiyomiEH is a fork of the [original Tachiyomi app](https://github.com/inorichi/tachiyomi).
### E-Hentai Thread
[https://forums.e-hentai.org/index.php?showtopic=185421](https://forums.e-hentai.org/index.php?showtopic=185421)
Tachiyomi is a free and open source manga reader for Android. # Download
[![stable release](https://img.shields.io/github/release/NerdNumber9/TachiyomiEH.svg?maxAge=3600&label=stable)](https://github.com/NerdNumber9/TachiyomiEH/releases)
Keep in mind it's still a beta, so expect it to crash sometimes.
# Features # Features
* Online and offline reading * Online and offline reading
* Configurable reader with multiple viewers and settings * Configurable reader with multiple viewers and settings
* MyAnimeList support * MyAnimeList support
* Resume from the next unread chapter * Track your reading position
* Chapter filtering * Chapter filtering
* Schedule searching for updates * Schedule searching for updates
* Categories to organize your library * Categories to organize your library
* Log into ExHentai
* Read both NSFW and SFW manga/doujinshi
* Full offline tag/namespace searching support
* Batch import galleries
* Automatically open E-Hentai/ExHentai links
* Lock the app with a PIN code
### Built-in manga sources
##### SFW
* Batoto
* Mangahere
* Mangafox
* Kissmanga
* Readmanga
* Mintmanga
* Mangachan
* Readmangatoday
* Mangasee
* Wiemanga
##### NSFW
* E-Hentai
* ExHentai
* PervEden
* nhentai
TachiyomiEH is fully compatible with Tachiyomi source extensions.
Backups from Tachiyomi are also compatible with TachiyomiEH (and vice versa).
## License ## License

1
app/.gitignore vendored Normal file → Executable file
View File

@ -2,3 +2,4 @@
*iml *iml
*.iml *.iml
custom.gradle custom.gradle
google-services.json

34
app/build.gradle Normal file → Executable file
View File

@ -33,18 +33,22 @@ android {
buildToolsVersion "25.0.2" buildToolsVersion "25.0.2"
publishNonDefault true publishNonDefault true
dexOptions {
javaMaxHeapSize "4g"
}
defaultConfig { defaultConfig {
applicationId "eu.kanade.tachiyomi" applicationId "eu.kanade.tachiyomi.eh2"
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 25 targetSdkVersion 25
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
versionCode 22 versionCode 5003
versionName "0.5.2" versionName "v5.0.3-EH"
buildConfigField "String", "COMMIT_COUNT", "\"${getCommitCount()}\"" buildConfigField "String", "COMMIT_COUNT", "\"${getCommitCount()}\""
buildConfigField "String", "COMMIT_SHA", "\"${getGitSha()}\"" buildConfigField "String", "COMMIT_SHA", "\"${getGitSha()}\""
buildConfigField "String", "BUILD_TIME", "\"${getBuildTime()}\"" buildConfigField "String", "BUILD_TIME", "\"${getBuildTime()}\""
buildConfigField "boolean", "INCLUDE_UPDATER", "false" buildConfigField "boolean", "INCLUDE_UPDATER", "true"
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
@ -198,15 +202,31 @@ dependencies {
compile 'me.zhanghai.android.systemuihelper:library:1.0.0' compile 'me.zhanghai.android.systemuihelper:library:1.0.0'
compile 'de.hdodenhof:circleimageview:2.1.0' compile 'de.hdodenhof:circleimageview:2.1.0'
//Firebase (EH)
final firebase_version = '10.0.1'
releaseCompile "com.google.firebase:firebase-core:$firebase_version"
releaseCompile "com.google.firebase:firebase-messaging:$firebase_version"
releaseCompile "com.google.firebase:firebase-crash:$firebase_version"
//SnappyDB (EH)
compile 'io.paperdb:paperdb:2.0'
//JVE (Regex) (EH)
compile 'ru.lanwen.verbalregex:java-verbal-expressions:1.4'
//Pin lock view
compile 'com.andrognito.pinlockview:pinlockview:1.0.1'
// Tests // Tests
testCompile 'junit:junit:4.12' //Paper DB screws up tests
/*testCompile 'junit:junit:4.12'
testCompile 'org.assertj:assertj-core:1.7.1' testCompile 'org.assertj:assertj-core:1.7.1'
testCompile 'org.mockito:mockito-core:1.10.19' testCompile 'org.mockito:mockito-core:1.10.19'
final robolectric_version = '3.1.4' final robolectric_version = '3.1.4'
testCompile "org.robolectric:robolectric:$robolectric_version" testCompile "org.robolectric:robolectric:$robolectric_version"
testCompile "org.robolectric:shadows-multidex:$robolectric_version" testCompile "org.robolectric:shadows-multidex:$robolectric_version"
testCompile "org.robolectric:shadows-play-services:$robolectric_version" testCompile "org.robolectric:shadows-play-services:$robolectric_version"*/
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
} }
@ -271,3 +291,5 @@ afterEvaluate {
} }
} }
} }
//Firebase (EH)
apply plugin: 'com.google.gms.google-services'

7
app/proguard-rules.pro vendored Normal file → Executable file
View File

@ -97,3 +97,10 @@
# Duktape # Duktape
-keep class com.squareup.duktape.** { *; } -keep class com.squareup.duktape.** { *; }
# [EH]
-keep class exh.** { *; }
# Keep google stuff
-dontwarn com.google.android.gms.**
-dontwarn com.google.firebase.**

58
app/src/main/AndroidManifest.xml Normal file → Executable file
View File

@ -13,6 +13,9 @@
android:name="android.permission.READ_PHONE_STATE" android:name="android.permission.READ_PHONE_STATE"
tools:node="remove" /> tools:node="remove" />
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" /> <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
<uses-permission android:name="android.permission.GET_TASKS"/>
<uses-permission android:name="android.permission.PACKAGE_USAGE_STATS"
tools:ignore="ProtectedPermissions" />
<application <application
android:name=".App" android:name=".App"
@ -117,6 +120,61 @@
android:name="eu.kanade.tachiyomi.data.glide.AppGlideModule" android:name="eu.kanade.tachiyomi.data.glide.AppGlideModule"
android:value="GlideModule" /> android:value="GlideModule" />
<!-- EH -->
<activity
android:name="exh.ui.login.LoginActivity"
android:label="@string/label_login"
android:parentActivityName=".ui.setting.SettingsActivity" >
</activity>
<activity
android:name="exh.ui.intercept.InterceptActivity"
android:label="TachiyomiEH">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:host="g.e-hentai.org"
android:pathPrefix="/g/"
android:scheme="http"/>
<data
android:host="g.e-hentai.org"
android:pathPrefix="/g/"
android:scheme="https"/>
<data
android:host="e-hentai.org"
android:pathPrefix="/g/"
android:scheme="http"/>
<data
android:host="e-hentai.org"
android:pathPrefix="/g/"
android:scheme="https"/>
<data
android:host="exhentai.org"
android:pathPrefix="/g/"
android:scheme="http"/>
<data
android:host="exhentai.org"
android:pathPrefix="/g/"
android:scheme="https"/>
</intent-filter>
</activity>
<activity
android:name="exh.ui.migration.MigrationCompletionActivity"
android:label="Complete migration">
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="application/json"/>
</intent-filter>
</activity>
<activity android:name="exh.ui.lock.LockActivity"
android:label="Application locked"/>
</application> </application>
</manifest> </manifest>

0
app/src/main/assets/fonts/PTSans-Narrow.ttf Normal file → Executable file
View File

0
app/src/main/assets/fonts/PTSans-NarrowBold.ttf Normal file → Executable file
View File

0
app/src/main/ic_launcher-web.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

16
app/src/main/java/eu/kanade/tachiyomi/App.kt Normal file → Executable file
View File

@ -9,20 +9,12 @@ import eu.kanade.tachiyomi.data.backup.BackupCreatorJob
import eu.kanade.tachiyomi.data.library.LibraryUpdateJob import eu.kanade.tachiyomi.data.library.LibraryUpdateJob
import eu.kanade.tachiyomi.data.updater.UpdateCheckerJob import eu.kanade.tachiyomi.data.updater.UpdateCheckerJob
import eu.kanade.tachiyomi.util.LocaleHelper import eu.kanade.tachiyomi.util.LocaleHelper
import org.acra.ACRA import io.paperdb.Paper
import org.acra.annotation.ReportsCrashes
import timber.log.Timber import timber.log.Timber
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.InjektScope import uy.kohesive.injekt.api.InjektScope
import uy.kohesive.injekt.registry.default.DefaultRegistrar import uy.kohesive.injekt.registry.default.DefaultRegistrar
@ReportsCrashes(
formUri = "http://tachiyomi.kanade.eu/crash_report",
reportType = org.acra.sender.HttpSender.Type.JSON,
httpMethod = org.acra.sender.HttpSender.Method.PUT,
buildConfigClass = BuildConfig::class,
excludeMatchingSharedPreferencesKeys = arrayOf(".*username.*", ".*password.*", ".*token.*")
)
open class App : Application() { open class App : Application() {
override fun onCreate() { override fun onCreate() {
@ -32,8 +24,8 @@ open class App : Application() {
if (BuildConfig.DEBUG) Timber.plant(Timber.DebugTree()) if (BuildConfig.DEBUG) Timber.plant(Timber.DebugTree())
setupAcra()
setupJobManager() setupJobManager()
Paper.init(this) //Setup metadata DB (EH)
LocaleHelper.updateConfiguration(this, resources.configuration) LocaleHelper.updateConfiguration(this, resources.configuration)
} }
@ -50,10 +42,6 @@ open class App : Application() {
LocaleHelper.updateConfiguration(this, newConfig, true) LocaleHelper.updateConfiguration(this, newConfig, true)
} }
protected open fun setupAcra() {
ACRA.init(this)
}
protected open fun setupJobManager() { protected open fun setupJobManager() {
JobManager.create(this).addJobCreator { tag -> JobManager.create(this).addJobCreator { tag ->
when (tag) { when (tag) {

0
app/src/main/java/eu/kanade/tachiyomi/AppModule.kt Normal file → Executable file
View File

0
app/src/main/java/eu/kanade/tachiyomi/Constants.kt Normal file → Executable file
View File

View File

0
app/src/main/java/eu/kanade/tachiyomi/data/cache/ChapterCache.kt vendored Normal file → Executable file
View File

0
app/src/main/java/eu/kanade/tachiyomi/data/cache/CoverCache.kt vendored Normal file → Executable file
View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

@ -9,6 +9,7 @@ import com.f2prateek.rx.preferences.RxSharedPreferences
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.track.TrackService import eu.kanade.tachiyomi.data.track.TrackService
import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.Source
import exh.ui.migration.MigrationStatus
import java.io.File import java.io.File
fun <T> Preference<T>.getOrDefault(): T = get() ?: defaultValue()!! fun <T> Preference<T>.getOrDefault(): T = get() ?: defaultValue()!!
@ -88,7 +89,7 @@ class PreferencesHelper(val context: Context) {
fun catalogueAsList() = rxPrefs.getBoolean(keys.catalogueAsList, false) fun catalogueAsList() = rxPrefs.getBoolean(keys.catalogueAsList, false)
fun enabledLanguages() = rxPrefs.getStringSet(keys.enabledLanguages, setOf("en")) fun enabledLanguages() = rxPrefs.getStringSet(keys.enabledLanguages, setOf("all"))
fun sourceUsername(source: Source) = prefs.getString(keys.sourceUsername(source.id), "") fun sourceUsername(source: Source) = prefs.getString(keys.sourceUsername(source.id), "")
@ -160,4 +161,38 @@ class PreferencesHelper(val context: Context) {
fun defaultCategory() = prefs.getInt(keys.defaultCategory, -1) fun defaultCategory() = prefs.getInt(keys.defaultCategory, -1)
//EH
fun enableExhentai() = rxPrefs.getBoolean("enable_exhentai", false)
fun secureEXH() = rxPrefs.getBoolean("secure_exh", true)
fun imageQuality() = rxPrefs.getString("ehentai_quality", "auto")
fun useHentaiAtHome() = rxPrefs.getBoolean("enable_hah", true)
fun useJapaneseTitle() = rxPrefs.getBoolean("use_jp_title", false)
fun ehSearchSize() = rxPrefs.getString("ex_search_size", "rc_0")
fun thumbnailRows() = rxPrefs.getString("ex_thumb_rows", "tr_2")
fun migrateLibraryAsked() = rxPrefs.getBoolean("ex_migrate_library", false)
fun migrationStatus() = rxPrefs.getInteger("migration_status", MigrationStatus.NOT_INITIALIZED)
fun hasPerformedURLMigration() = rxPrefs.getBoolean("performed_url_migration", false)
fun hasPerformedSourceMigration() = rxPrefs.getBoolean("performed_source_migration", false)
//EH Cookies
fun memberIdVal() = rxPrefs.getString("eh_ipb_member_id", null)
fun passHashVal() = rxPrefs.getString("eh_ipb_pass_hash", null)
fun igneousVal() = rxPrefs.getString("eh_igneous", null)
//Lock
fun lockHash() = rxPrefs.getString("lock_hash", null)
fun lockSalt() = rxPrefs.getString("lock_salt", null)
fun lockLength() = rxPrefs.getInteger("lock_length", -1)
} }

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

@ -23,7 +23,7 @@ interface GithubService {
} }
} }
@GET("/repos/inorichi/tachiyomi/releases/latest") @GET("/repos/NerdNumber9/tachiyomi/releases/latest")
fun getLatestVersion(): Observable<GithubRelease> fun getLatestVersion(): Observable<GithubRelease>
} }

View File

@ -12,7 +12,7 @@ class GithubUpdateChecker() {
*/ */
fun checkForUpdate(): Observable<GithubUpdateResult> { fun checkForUpdate(): Observable<GithubUpdateResult> {
return service.getLatestVersion().map { release -> return service.getLatestVersion().map { release ->
val newVersion = release.version.replace("[^\\d.]".toRegex(), "") val newVersion = release.version
// Check if latest version is different from current version // Check if latest version is different from current version
if (newVersion != BuildConfig.VERSION_NAME) { if (newVersion != BuildConfig.VERSION_NAME) {

View File

Some files were not shown because too many files have changed in this diff Show More