Bato.to: Add deep link support for v3x (#2971)

This commit is contained in:
Bartu Özen 2024-05-13 18:17:59 +03:00 committed by Draff
parent dbeb67b3e9
commit dc225dba18
3 changed files with 23 additions and 3 deletions

View File

@ -47,6 +47,9 @@
<data
android:pathPattern="/subject-overview/..*"
android:scheme="https" />
<data
android:pathPattern="/title/..*"
android:scheme="https" />
</intent-filter>
</activity>
</application>

View File

@ -1,7 +1,7 @@
ext {
extName = 'Bato.to'
extClass = '.BatoToFactory'
extVersionCode = 35
extVersionCode = 36
isNsfw = true
}

View File

@ -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
}
}
}