Fix MangAdventure deeplinks (#8334)
This commit is contained in:
parent
1543a28487
commit
d1d027fd91
|
@ -1,27 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="eu.kanade.tachiyomi.extension">
|
||||
<application>
|
||||
<activity android:name="eu.kanade.tachiyomi.multisrc.mangadventure.MangAdventureActivity"
|
||||
android:theme="@android:style/Theme.NoDisplay"
|
||||
android:excludeFromRecents="true">
|
||||
<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="assortedscans.com"
|
||||
android:pathPattern="/reader/..*"
|
||||
android:scheme="https"/>
|
||||
<data android:host="www.assortedscans.com"
|
||||
android:pathPattern="/reader/..*"
|
||||
android:scheme="https"/>
|
||||
<data android:host="helveticascans.com"
|
||||
android:pathPattern="/reader/..*"
|
||||
android:scheme="https"/>
|
||||
<data android:host="www.helveticascans.com"
|
||||
android:pathPattern="/reader/..*"
|
||||
android:scheme="https"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>
|
|
@ -9,12 +9,12 @@
|
|||
<action android:name="android.intent.action.VIEW"/>
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
<category android:name="android.intent.category.BROWSABLE"/>
|
||||
<data android:host="arc-relight.com"
|
||||
<data android:host="${SOURCEHOST}"
|
||||
android:pathPattern="/reader/..*"
|
||||
android:scheme="https"/>
|
||||
<data android:host="www.arc-relight.com"
|
||||
android:scheme="${SOURCESCHEME}" />
|
||||
<data android:host="www.${SOURCEHOST}"
|
||||
android:pathPattern="/reader/..*"
|
||||
android:scheme="https"/>
|
||||
android:scheme="${SOURCESCHEME}" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.0 KiB |
Binary file not shown.
After Width: | Height: | Size: 5.5 KiB |
Binary file not shown.
After Width: | Height: | Size: 7.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 34 KiB |
|
@ -8,28 +8,27 @@ import android.util.Log
|
|||
import kotlin.system.exitProcess
|
||||
|
||||
/**
|
||||
* Springboard that accepts `{baseUrl}/reader/{slug}`
|
||||
* Springboard that accepts `{baseUrl}/reader/{slug}/`
|
||||
* intents and redirects them to the main Tachiyomi process.
|
||||
*/
|
||||
class MangAdventureActivity : Activity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
intent?.data?.pathSegments?.takeIf { it.size > 1 }?.let {
|
||||
val segments = intent?.data?.pathSegments
|
||||
if (segments != null && segments.size > 1) {
|
||||
val activity = Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.SEARCH"
|
||||
putExtra("query", MangAdventure.SLUG_QUERY + segments[1])
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
try {
|
||||
startActivity(
|
||||
Intent().apply {
|
||||
action = "eu.kanade.tachiyomi.SEARCH"
|
||||
putExtra("query", MangAdventure.SLUG_QUERY + it[1])
|
||||
putExtra("filter", packageName)
|
||||
}
|
||||
)
|
||||
startActivity(activity)
|
||||
} catch (ex: ActivityNotFoundException) {
|
||||
Log.e("MangAdventureActivity", ex.message, ex)
|
||||
}
|
||||
} ?: Log.e(
|
||||
"MangAdventureActivity",
|
||||
"Failed to parse URI from intent: $intent"
|
||||
)
|
||||
} else {
|
||||
Log.e("MangAdventureActivity", "Failed to parse URI from intent: $intent")
|
||||
}
|
||||
finish()
|
||||
exitProcess(0)
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ class MangAdventureGenerator : ThemeSourceGenerator {
|
|||
|
||||
override val themeClass = "MangAdventure"
|
||||
|
||||
override val baseVersionCode = 3
|
||||
override val baseVersionCode = 4
|
||||
|
||||
override val sources = listOf(
|
||||
SingleLang("Arc-Relight", "https://arc-relight.com", "en", className = "ArcRelight"),
|
||||
|
@ -18,6 +18,7 @@ class MangAdventureGenerator : ThemeSourceGenerator {
|
|||
)
|
||||
|
||||
companion object {
|
||||
@JvmStatic fun main(args: Array<String>) = MangAdventureGenerator().createAll()
|
||||
@JvmStatic
|
||||
fun main(args: Array<String>) = MangAdventureGenerator().createAll()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue