Revert module changes (closes #1129)

This commit is contained in:
Eugene Cheung 2019-05-24 23:03:28 -04:00
parent 084960736e
commit e267352b13
No known key found for this signature in database
GPG Key ID: E1FD745328866B0A
11 changed files with 66 additions and 63 deletions

View File

@ -1,37 +0,0 @@
package eu.kanade.tachiyomi.lib.urlhandler
import android.app.Activity
import android.content.ActivityNotFoundException
import android.content.Intent
import android.os.Bundle
import android.util.Log
abstract class UrlHandlerActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val pathSegments = intent?.data?.pathSegments
if (pathSegments != null && pathSegments.size > 1) {
val query = getQueryFromPathSegments(pathSegments)
val mainIntent = Intent().apply {
action = "eu.kanade.tachiyomi.SEARCH"
putExtra("query", query)
putExtra("filter", packageName)
}
try {
startActivity(mainIntent)
} catch (e: ActivityNotFoundException) {
Log.e(localClassName, e.toString())
}
} else {
Log.e(localClassName, "Could not parse uri from intent: $intent")
}
finish()
System.exit(0)
}
abstract fun getQueryFromPathSegments(pathSegments: List<String>): String
}

View File

@ -24,6 +24,6 @@ repositories {
} }
dependencies { dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" compileOnly "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compileOnly 'com.squareup.okhttp3:okhttp:3.10.0' compileOnly 'com.squareup.okhttp3:okhttp:3.10.0'
} }

View File

@ -1,3 +1,3 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="eu.kanade.tachiyomi.lib"> package="eu.kanade.tachiyomi.lib.ratelimit">
</manifest> </manifest>

View File

@ -6,8 +6,8 @@ new File(rootDir, "src").eachDir { dir ->
} }
} }
include ':extension-lib' include ':lib-ratelimit'
project(':extension-lib').projectDir = new File("lib/extension-lib") project(':lib-ratelimit').projectDir = new File("lib/ratelimit")
include ':duktape-stub' include ':duktape-stub'
project(':duktape-stub').projectDir = new File("lib/duktape-stub") project(':duktape-stub').projectDir = new File("lib/duktape-stub")

View File

@ -5,12 +5,12 @@ ext {
appName = 'Tachiyomi: MangaDex' appName = 'Tachiyomi: MangaDex'
pkgNameSuffix = 'all.mangadex' pkgNameSuffix = 'all.mangadex'
extClass = '.MangadexFactory' extClass = '.MangadexFactory'
extVersionCode = 59 extVersionCode = 60
libVersion = '1.2' libVersion = '1.2'
} }
dependencies { dependencies {
implementation project(':extension-lib') implementation project(':lib-ratelimit')
compileOnly project(':preference-stub') compileOnly project(':preference-stub')
compileOnly 'com.google.code.gson:gson:2.8.2' compileOnly 'com.google.code.gson:gson:2.8.2'
compileOnly 'com.github.salomonbrys.kotson:kotson:2.5.0' compileOnly 'com.github.salomonbrys.kotson:kotson:2.5.0'

View File

@ -1,6 +1,10 @@
package eu.kanade.tachiyomi.extension.all.mangadex package eu.kanade.tachiyomi.extension.all.mangadex
import eu.kanade.tachiyomi.lib.urlhandler.UrlHandlerActivity import android.app.Activity
import android.content.ActivityNotFoundException
import android.content.Intent
import android.os.Bundle
import android.util.Log
/** /**
* Springboard that accepts https://mangadex.com/title/xxx intents and redirects them to * Springboard that accepts https://mangadex.com/title/xxx intents and redirects them to
@ -11,11 +15,30 @@ import eu.kanade.tachiyomi.lib.urlhandler.UrlHandlerActivity
* Main goal was to make it easier to open manga in Tachiyomi in spite of the DDoS blocking * Main goal was to make it easier to open manga in Tachiyomi in spite of the DDoS blocking
* the usual search screen from working. * the usual search screen from working.
*/ */
class MangadexUrlActivity : UrlHandlerActivity() { class MangadexUrlActivity : Activity() {
override fun getQueryFromPathSegments(pathSegments: List<String>): String { override fun onCreate(savedInstanceState: Bundle?) {
val id = pathSegments[1] super.onCreate(savedInstanceState)
return "${Mangadex.PREFIX_ID_SEARCH}$id" val pathSegments = intent?.data?.pathSegments
if (pathSegments != null && pathSegments.size > 1) {
val titleid = pathSegments[1]
val mainIntent = Intent().apply {
action = "eu.kanade.tachiyomi.SEARCH"
putExtra("query", "${Mangadex.PREFIX_ID_SEARCH}$titleid")
putExtra("filter", packageName)
}
try {
startActivity(mainIntent)
} catch (e: ActivityNotFoundException) {
Log.e("MangadexUrlActivity", e.toString())
}
} else {
Log.e("MangadexUrlActivity", "could not parse uri from intent $intent")
}
finish()
System.exit(0)
} }
} }

View File

@ -5,12 +5,8 @@ ext {
appName = 'Tachiyomi: NHentai' appName = 'Tachiyomi: NHentai'
pkgNameSuffix = 'all.nhentai' pkgNameSuffix = 'all.nhentai'
extClass = '.NHEnglish; .NHJapanese; .NHChinese' extClass = '.NHEnglish; .NHJapanese; .NHChinese'
extVersionCode = 12 extVersionCode = 13
libVersion = '1.2' libVersion = '1.2'
} }
dependencies {
implementation project(':extension-lib')
}
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,16 +1,37 @@
package eu.kanade.tachiyomi.extension.all.nhentai package eu.kanade.tachiyomi.extension.all.nhentai
import eu.kanade.tachiyomi.lib.urlhandler.UrlHandlerActivity import android.app.Activity
import android.content.ActivityNotFoundException
import android.content.Intent
import android.os.Bundle
import android.util.Log
/** /**
* Springboard that accepts https://nhentai.net/g/xxxxxx intents and redirects them to * Springboard that accepts https://nhentai.net/g/xxxxxx intents and redirects them to
* the main Tachiyomi process. * the main Tachiyomi process.
*/ */
class NHUrlActivity : UrlHandlerActivity() { class NHUrlActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
override fun getQueryFromPathSegments(pathSegments: List<String>): String { super.onCreate(savedInstanceState)
val pathSegments = intent?.data?.pathSegments
if (pathSegments != null && pathSegments.size > 1) {
val id = pathSegments[1] val id = pathSegments[1]
return "${NHentai.PREFIX_ID_SEARCH}$id" val mainIntent = Intent().apply {
action = "eu.kanade.tachiyomi.SEARCH"
putExtra("query", "${NHentai.PREFIX_ID_SEARCH}$id")
putExtra("filter", packageName)
} }
try {
startActivity(mainIntent)
} catch (e: ActivityNotFoundException) {
Log.e("NHUrlActivity", e.toString())
}
} else {
Log.e("NHUrlActivity", "could not parse uri from intent $intent")
}
finish()
System.exit(0)
}
} }

View File

@ -5,12 +5,12 @@ ext {
appName = 'Tachiyomi: Mintmanga' appName = 'Tachiyomi: Mintmanga'
pkgNameSuffix = 'ru.mintmanga' pkgNameSuffix = 'ru.mintmanga'
extClass = '.Mintmanga' extClass = '.Mintmanga'
extVersionCode = 11 extVersionCode = 12
libVersion = '1.2' libVersion = '1.2'
} }
dependencies { dependencies {
implementation project(':extension-lib') implementation project(':lib-ratelimit')
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -5,12 +5,12 @@ ext {
appName = 'Tachiyomi: Readmanga' appName = 'Tachiyomi: Readmanga'
pkgNameSuffix = 'ru.readmanga' pkgNameSuffix = 'ru.readmanga'
extClass = '.Readmanga' extClass = '.Readmanga'
extVersionCode = 11 extVersionCode = 12
libVersion = '1.2' libVersion = '1.2'
} }
dependencies { dependencies {
implementation project(':extension-lib') implementation project(':lib-ratelimit')
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"