Skip to content

Commit

Permalink
Prepare APK uncompress 2
Browse files Browse the repository at this point in the history
  • Loading branch information
uholeschak committed Dec 20, 2024
1 parent 9d683ff commit aa7db58
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Tools/ApkUncompress2/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.vs/
/artifacts/
16 changes: 16 additions & 0 deletions Tools/ApkUncompress2/ApkUncompress2.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ELFSharp" Version="2.17.3" />
<PackageReference Include="K4os.Compression.LZ4" Version="1.3.8" />
<PackageReference Include="SharpZipLib" Version="1.4.2" />
</ItemGroup>

</Project>
22 changes: 22 additions & 0 deletions Tools/ApkUncompress2/ApkUncompress2.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.12.35527.113 d17.12
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApkUncompress2", "ApkUncompress2.csproj", "{30280DEF-046C-4B47-B0B9-845BE8618A2E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{30280DEF-046C-4B47-B0B9-845BE8618A2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{30280DEF-046C-4B47-B0B9-845BE8618A2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{30280DEF-046C-4B47-B0B9-845BE8618A2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{30280DEF-046C-4B47-B0B9-845BE8618A2E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions Tools/ApkUncompress2/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project>
<!-- See https://aka.ms/dotnet/msbuild/customize for more details on customizing your build -->
<PropertyGroup>
<ArtifactsPath>$(MSBuildThisFileDirectory)artifacts</ArtifactsPath>
</PropertyGroup>
</Project>
44 changes: 44 additions & 0 deletions Tools/ApkUncompress2/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using System;
using System.IO;

namespace ApkUncompress2
{
internal class App
{
static int Usage()
{
Console.WriteLine("Usage: decompress-assemblies {file.{dll,apk,aab}} [{file.{dll,apk,aab} ...]");
Console.WriteLine();
Console.WriteLine("DLL files passed on command line are uncompressed to the file directory with the `uncompressed-` prefix added to their name.");
Console.WriteLine("DLL files from AAB/APK archives are uncompressed to a subdirectory of the file directory named after the archive with extension removed");
return 1;
}

static int Main(string[] args)
{
if (args.Length == 0)
{
return Usage();
}

bool haveErrors = false;
foreach (string file in args)
{
string ext = Path.GetExtension(file);
string fullPath = Path.GetFullPath(file);
if (string.IsNullOrEmpty(fullPath))
{
continue;
}

string? outputPath = Path.GetDirectoryName(fullPath);
if (string.IsNullOrEmpty(outputPath))
{
continue;
}
}

return haveErrors ? 1 : 0;
}
}
}

0 comments on commit aa7db58

Please sign in to comment.