Support regexp in icon matching

This commit is contained in:
Rafał Kobyłko 2023-11-25 17:19:15 +01:00
parent f6988d6afe
commit 09820987d8
3 changed files with 3 additions and 3 deletions

View File

@ -1,3 +1,3 @@
<resources>
<string name="android__app_name">2FAS.DEBUG</string>
<string name="android__app_name" translatable="false">2FAS.DEBUG</string>
</resources>

View File

@ -15,7 +15,7 @@
<string name="NSCameraUsageDescription">Used for scanning QR-codes</string>
<string name="NSFaceIDUsageDescription">You can unlock the application using Face ID</string>
<!-- MARK: - App -->
<string name="app__name">2FAS Authenticator</string>
<string name="app__name" translatable="false">2FAS Authenticator</string>
<string name="commons__2fas">2FA Authenticator (2FAS App)</string>
<string name="commons__OK">OK</string>
<string name="commons__add">Add</string>

View File

@ -35,7 +35,7 @@ data class SupportedService(
MatchRule.Matcher.StartsWith -> textToMatch.startsWith(rule.text, ignoreCase = rule.ignoreCase)
MatchRule.Matcher.EndsWith -> textToMatch.endsWith(rule.text, ignoreCase = rule.ignoreCase)
MatchRule.Matcher.Equals -> textToMatch.equals(rule.text, ignoreCase = rule.ignoreCase)
MatchRule.Matcher.Regex -> false // Match regex currently unsupported
MatchRule.Matcher.Regex -> rule.text.toRegex().containsMatchIn(textToMatch)
}
if (isMatcherFound) {