Skip to content

Commit

Permalink
Moved sample to asset
Browse files Browse the repository at this point in the history
  • Loading branch information
uholeschak committed Dec 31, 2024
1 parent 14400c5 commit 773ee76
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion BmwDeepObd/ActivityCommon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion BmwDeepObd/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.3.240" package="de.holeschak.bmw_deep_obd" android:installLocation="auto" android:versionCode="541">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.3.241" package="de.holeschak.bmw_deep_obd" android:installLocation="auto" android:versionCode="542">
<application android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:theme="@style/MyTheme" android:windowSoftInputMode="stateHidden" android:hasFragileUserData="true" android:fullBackupContent="@xml/auto_backup_rules" android:dataExtractionRules="@xml/backup_rules">
<provider android:name="androidx.core.content.FileProvider" android:authorities="${applicationId}.fileprovider" android:exported="false" android:grantUriPermissions="true">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" />
Expand Down
3 changes: 2 additions & 1 deletion BmwDeepObd/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 773ee76

Please sign in to comment.