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