diff --git a/Tools/ApkUncompress2/.gitignore b/Tools/ApkUncompress2/.gitignore new file mode 100644 index 000000000..ad0948b1c --- /dev/null +++ b/Tools/ApkUncompress2/.gitignore @@ -0,0 +1,2 @@ +/.vs/ +/artifacts/ diff --git a/Tools/ApkUncompress2/ApkUncompress2.csproj b/Tools/ApkUncompress2/ApkUncompress2.csproj new file mode 100644 index 000000000..deda2d715 --- /dev/null +++ b/Tools/ApkUncompress2/ApkUncompress2.csproj @@ -0,0 +1,16 @@ + + + + Exe + net9.0 + disable + enable + + + + + + + + + diff --git a/Tools/ApkUncompress2/ApkUncompress2.sln b/Tools/ApkUncompress2/ApkUncompress2.sln new file mode 100644 index 000000000..17e2b6c40 --- /dev/null +++ b/Tools/ApkUncompress2/ApkUncompress2.sln @@ -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 diff --git a/Tools/ApkUncompress2/Directory.Build.props b/Tools/ApkUncompress2/Directory.Build.props new file mode 100644 index 000000000..4ab79d3ab --- /dev/null +++ b/Tools/ApkUncompress2/Directory.Build.props @@ -0,0 +1,6 @@ + + + + $(MSBuildThisFileDirectory)artifacts + + diff --git a/Tools/ApkUncompress2/Program.cs b/Tools/ApkUncompress2/Program.cs new file mode 100644 index 000000000..22253bc62 --- /dev/null +++ b/Tools/ApkUncompress2/Program.cs @@ -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; + } + } +}