diff --git a/BmwDeepObd/ActivityCommon.cs b/BmwDeepObd/ActivityCommon.cs index a295066b3..1317b0c47 100644 --- a/BmwDeepObd/ActivityCommon.cs +++ b/BmwDeepObd/ActivityCommon.cs @@ -10912,13 +10912,13 @@ public static string GetAssetEcuFilename() try { - Regex regex = new Regex(@"^Ecu.*\.bin$", RegexOptions.IgnoreCase); AssetManager assets = GetPackageContext()?.Assets; if (assets != null) { string[] assetFiles = assets.List(string.Empty); if (assetFiles != null) { + Regex regex = new Regex(@"^Ecu.*\.bin$", RegexOptions.IgnoreCase | RegexOptions.Compiled); foreach (string fileName in assetFiles) { if (regex.IsMatch(fileName)) diff --git a/BmwDeepObd/AndroidManifest.xml b/BmwDeepObd/AndroidManifest.xml index 52c6dc5a6..c7f6e8580 100644 --- a/BmwDeepObd/AndroidManifest.xml +++ b/BmwDeepObd/AndroidManifest.xml @@ -1,5 +1,5 @@  - + diff --git a/BmwDeepObd/MainActivity.cs b/BmwDeepObd/MainActivity.cs index 24504f9e2..c19b94a96 100644 --- a/BmwDeepObd/MainActivity.cs +++ b/BmwDeepObd/MainActivity.cs @@ -6463,9 +6463,10 @@ private bool ExtractSampleFiles(bool force = false) string[] assetFiles = assets.List(string.Empty); if (assetFiles != null) { + Regex regex = new Regex(@"^Sample.*\.zip$", RegexOptions.IgnoreCase | RegexOptions.Compiled); foreach (string fileName in assetFiles) { - if (fileName.EndsWith("Sample.zip", StringComparison.OrdinalIgnoreCase)) + if (regex.IsMatch(fileName)) { resourceName = fileName; break;