Skip to content

Commit

Permalink
Merge pull request #981 from UseHover/parse-accounts-bugfix
Browse files Browse the repository at this point in the history
Using regex from config to parse account list if available
  • Loading branch information
jumaallan authored Apr 3, 2023
2 parents 7c732a8 + 7825a36 commit 30552fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,9 @@ class TransactionReceiver : BroadcastReceiver(), KoinComponent {
}

private suspend fun parseAccounts(ussdAccountList: String) {
val pattern = Pattern.compile("^([\\d]{1,2})[>):.\\s]+(.+)\$", Pattern.MULTILINE)
var splitterPattern = action?.getStepByVar("accountName")?.optString("valid_response_regex")
if (splitterPattern == null) splitterPattern = "^\\s*([\\d]{1,2})[>):.\\s]+(.+)$"
val pattern = Pattern.compile(splitterPattern, Pattern.MULTILINE)
val matcher = pattern.matcher(ussdAccountList)

while (matcher.find()) {
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ glide = { module = "com.github.bumptech.glide:glide", version.ref = "glide" }
glide-compiler = { module = "com.github.bumptech.glide:compiler", version.ref = "glide" }
coil = "io.coil-kt:coil-compose:2.2.2"

hover = "com.hover:android-sdk:2.0.0-beta01"
hover = "com.hover:android-sdk:2.0.0-beta03"
volley = "com.android.volley:volley:1.2.1"
play-services = "com.google.android.gms:play-services-analytics:18.0.2"
picasso = "com.squareup.picasso:picasso:2.71828"
Expand Down

0 comments on commit 30552fc

Please sign in to comment.