Skip to content

Commit

Permalink
Read assemblies from store type 2
Browse files Browse the repository at this point in the history
  • Loading branch information
uholeschak committed Dec 22, 2024
1 parent c37bb48 commit e866c44
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 29 deletions.
27 changes: 11 additions & 16 deletions BmwDeepObd/ActivityCommon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11510,23 +11510,11 @@ public bool ExtraktPackageAssemblies(string outputPath, bool forceUpdate = false
Directory.Delete(outputPath, true);
}

string ext = Path.GetExtension(packageFilePath);
bool result = false;
ApkUncompress.ApkUncompressCommon apkUncompress = new ApkUncompress.ApkUncompressCommon();
if (string.Compare(".apk", ext, StringComparison.OrdinalIgnoreCase) == 0)
ApkUncompress2.ApkUncompressCommon apkUncompress = new ApkUncompress2.ApkUncompressCommon();
if (apkUncompress.UncompressFromAPK(packageFilePath, outputPath))
{
if (apkUncompress.UncompressFromAPK(packageFilePath, ApkUncompress.ApkUncompressCommon.AssembliesPathApk, null, outputPath))
{
result = true;
}
}

if (string.Compare(".aab", ext, StringComparison.OrdinalIgnoreCase) == 0)
{
if (apkUncompress.UncompressFromAPK(packageFilePath, ApkUncompress.ApkUncompressCommon.AssembliesPathAab, null, outputPath))
{
result = true;
}
result = true;
}

if (result && Directory.Exists(outputPath))
Expand Down Expand Up @@ -11601,7 +11589,7 @@ public static List<string> GetCurrentAbiDirs()
if (isArm)
{
// the release version uses _ and debug uses -
return is64Bit ? ["arm64_v8a", "arm64-v8a"] : ["armeabi_v7a", "armeabi-v7a"];
return is64Bit ? ["arm64", "arm64_v8a", "arm64-v8a"] : ["armeabi", "armeabi_v7a", "armeabi-v7a"];
}

// only the _ variant is used for release and debug
Expand Down Expand Up @@ -11634,6 +11622,13 @@ public static List<string> GetCurrentAbiDirs()
if (!File.Exists(location))
{
string fileName = Path.GetFileName(location);
string ext = Path.GetExtension(fileName);

if (string.IsNullOrEmpty(ext) || string.Compare(ext, ".dll", StringComparison.OrdinalIgnoreCase) != 0)
{
fileName += ".dll";
}

location = Path.Combine(assembliesDir, fileName);
if (!File.Exists(location))
{
Expand Down
26 changes: 14 additions & 12 deletions BmwDeepObd/BmwDeepObd.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@
<AndroidKeyStore>False</AndroidKeyStore>
<AndroidEnableMultiDex>True</AndroidEnableMultiDex>
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
<AndroidUseAssemblyStore>False</AndroidUseAssemblyStore>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<NoWarn>1701;1702;CS8632</NoWarn>
<AndroidPackageFormat>apk</AndroidPackageFormat>
<AndroidKeyStore>False</AndroidKeyStore>
<AndroidLinkTool>r8</AndroidLinkTool>
<AndroidEnableMultiDex>True</AndroidEnableMultiDex>
<AndroidUseAssemblyStore>True</AndroidUseAssemblyStore>
</PropertyGroup>
<ItemGroup>
<AndroidAsset Remove="Assets\AboutAssets.txt" />
Expand Down Expand Up @@ -57,16 +55,19 @@
<Compile Include="..\EdiabasLib\UdsFileReader\DataReader.cs" Link="DataReader.cs" />
<Compile Include="..\EdiabasLib\UdsFileReader\UdsReader.cs" Link="UdsReader.cs" />
<Compile Include="..\EdiabasLib\UdsFileReader\VehicleInfoVag.cs" Link="VehicleInfoVag.cs" />
<Compile Include="..\Tools\ApkUncompress\ApkUncompressCommon.cs" Link="ApkUncompressCommon.cs" />
<Compile Include="..\Tools\ApkUncompress\AssemblyStore\AssemblyStoreAssembly.cs" Link="AssemblyStoreAssembly.cs" />
<Compile Include="..\Tools\ApkUncompress\AssemblyStore\AssemblyStoreExplorer.cs" Link="AssemblyStoreExplorer.cs" />
<Compile Include="..\Tools\ApkUncompress\AssemblyStore\AssemblyStoreExplorerLogLevel.cs" Link="AssemblyStoreExplorerLogLevel.cs" />
<Compile Include="..\Tools\ApkUncompress\AssemblyStore\AssemblyStoreHashEntry.cs" Link="AssemblyStoreHashEntry.cs" />
<Compile Include="..\Tools\ApkUncompress\AssemblyStore\AssemblyStoreManifestEntry.cs" Link="AssemblyStoreManifestEntry.cs" />
<Compile Include="..\Tools\ApkUncompress\AssemblyStore\AssemblyStoreManifestReader.cs" Link="AssemblyStoreManifestReader.cs" />
<Compile Include="..\Tools\ApkUncompress\AssemblyStore\AssemblyStoreReader.cs" Link="AssemblyStoreReader.cs" />
<Compile Include="..\Tools\ApkUncompress\Utilities\AndroidTargetArch.cs" Link="AndroidTargetArch.cs" />
<Compile Include="..\Tools\ApkUncompress\Utilities\MonoAndroidHelper.Basic.cs" Link="MonoAndroidHelper.Basic.cs" />
<Compile Include="..\Tools\ApkUncompress2\ApkUncompressCommon.cs" Link="ApkUncompress\ApkUncompressCommon.cs" />
<Compile Include="..\Tools\ApkUncompress2\AssemblyStore\AssemblyStoreExplorer.cs" Link="ApkUncompress\AssemblyStoreExplorer.cs" />
<Compile Include="..\Tools\ApkUncompress2\AssemblyStore\AssemblyStoreItem.cs" Link="ApkUncompress\AssemblyStoreItem.cs" />
<Compile Include="..\Tools\ApkUncompress2\AssemblyStore\AssemblyStoreReader.cs" Link="ApkUncompress\AssemblyStoreReader.cs" />
<Compile Include="..\Tools\ApkUncompress2\AssemblyStore\ELFPayloadError.cs" Link="ApkUncompress\ELFPayloadError.cs" />
<Compile Include="..\Tools\ApkUncompress2\AssemblyStore\FileFormat.cs" Link="ApkUncompress\FileFormat.cs" />
<Compile Include="..\Tools\ApkUncompress2\AssemblyStore\Log.cs" Link="ApkUncompress\Log.cs" />
<Compile Include="..\Tools\ApkUncompress2\AssemblyStore\StoreReader_V1.cs" Link="ApkUncompress\StoreReader_V1.cs" />
<Compile Include="..\Tools\ApkUncompress2\AssemblyStore\StoreReader_V2.Classes.cs" Link="ApkUncompress\StoreReader_V2.Classes.cs" />
<Compile Include="..\Tools\ApkUncompress2\AssemblyStore\StoreReader_V2.cs" Link="ApkUncompress\StoreReader_V2.cs" />
<Compile Include="..\Tools\ApkUncompress2\AssemblyStore\Utils.cs" Link="ApkUncompress\Utils.cs" />
<Compile Include="..\Tools\ApkUncompress2\Utilities\AndroidTargetArch.cs" Link="ApkUncompress\AndroidTargetArch.cs" />
<Compile Include="..\Tools\ApkUncompress2\Utilities\MonoAndroidHelper.Basic.cs" Link="ApkUncompress\MonoAndroidHelper.Basic.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Sample\Sample.zip" />
Expand Down Expand Up @@ -109,6 +110,7 @@
<Folder Include="HexFiles\Type7\" />
<Folder Include="HexFiles\Type8\" />
<Folder Include="HexFiles\Type16\" />
<Folder Include="ApkUncompress\" />
<Folder Include="VehicleInfo\" />
</ItemGroup>
<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion BmwDeepObd/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project>
<PropertyGroup>
<DefineConstants>$(DefineConstants);ANDROID_AUTO</DefineConstants>
<DefineConstants>$(DefineConstants);ANDROID_AUTO</DefineConstants>
<AndroidUseAssemblyStore>True</AndroidUseAssemblyStore>
</PropertyGroup>
<Target Name="PatchRemoveRegisterAttributeBefore" BeforeTargets="_RemoveRegisterAttribute">
<PropertyGroup>
Expand Down

0 comments on commit e866c44

Please sign in to comment.