File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
package/android/src/main/java/com/margelo/nitro/nitroversioncheck Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -62,9 +62,11 @@ class HybridVersionCheck : HybridVersionCheckSpec() {
6262 connection.readTimeout = TIMEOUT_MS
6363 connection.setRequestProperty(" User-Agent" , " Mozilla/5.0" )
6464 val html = connection.inputStream.bufferedReader().use { it.readText() }
65- val regex = Regex (""" \]\]\],\s*"(\d+\.\d+[\d.]*\d)"""" )
66- val match = regex.find(html)
67- match?.groupValues?.get(1 )
65+ val versionPatterns = listOf (
66+ Regex (""" \]\]\],\s*"(\d+\.\d+[\d.]*\d)"""" ),
67+ Regex (""" "141":\[\[\["(\d+\.\d+[\d.]*\d)"""" )
68+ )
69+ versionPatterns.firstNotNullOfOrNull { it.find(html)?.groupValues?.get(1 ) }
6870 ? : throw Exception (" Could not parse latest version from Play Store page" )
6971 } catch (e: Exception ) {
7072 throw Exception (" Failed to fetch latest version: ${e.message} " , e)
You can’t perform that action at this time.
0 commit comments