Bato.to: Add deep link support for v3x (#2971)
This commit is contained in:
parent
dbeb67b3e9
commit
dc225dba18
|
@ -47,6 +47,9 @@
|
||||||
<data
|
<data
|
||||||
android:pathPattern="/subject-overview/..*"
|
android:pathPattern="/subject-overview/..*"
|
||||||
android:scheme="https" />
|
android:scheme="https" />
|
||||||
|
<data
|
||||||
|
android:pathPattern="/title/..*"
|
||||||
|
android:scheme="https" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
</application>
|
</application>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
ext {
|
ext {
|
||||||
extName = 'Bato.to'
|
extName = 'Bato.to'
|
||||||
extClass = '.BatoToFactory'
|
extClass = '.BatoToFactory'
|
||||||
extVersionCode = 35
|
extVersionCode = 36
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,8 +42,25 @@ class BatoToUrlActivity : Activity() {
|
||||||
|
|
||||||
private fun fromBatoTo(pathSegments: MutableList<String>): String? {
|
private fun fromBatoTo(pathSegments: MutableList<String>): String? {
|
||||||
return if (pathSegments.size >= 2) {
|
return if (pathSegments.size >= 2) {
|
||||||
val id = pathSegments[1]
|
val path = pathSegments[1] as java.lang.String?
|
||||||
"ID:$id"
|
if (path != null) {
|
||||||
|
var index = -1
|
||||||
|
for (i in path.indices) {
|
||||||
|
if (path[i] == '-') {
|
||||||
|
index = i
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val id = if (index == -1) {
|
||||||
|
path
|
||||||
|
} else {
|
||||||
|
path.substring(0, index)
|
||||||
|
}
|
||||||
|
"ID:$id"
|
||||||
|
} else {
|
||||||
|
null
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue