Skip to content

Commit

Permalink
v1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
lalakii committed Jul 5, 2024
1 parent e1e5745 commit bf57a61
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion AndroidKeyGen.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions AndroidKeyGen.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static AndroidKeyGen.Program;

Expand Down
14 changes: 7 additions & 7 deletions AndroidKeyGen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,12 @@
<ItemGroup>
<None Include=".editorconfig" />
<None Include="app.manifest" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Portable.BouncyCastle">
<Version>1.9.0</Version>
</PackageReference>
<EmbeddedResource Include="Properties\res.gz" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="AndroidKeyGen.resx">
<DependentUpon>AndroidKeyGen.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BouncyCastle.Crypto.dll" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
Expand All @@ -81,9 +76,14 @@
<ItemGroup>
<None Include="github-mark.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="BouncyCastle.Cryptography">
<Version>2.4.0</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>cd "$(TargetDir)" &amp;&amp; del BouncyCastle.Crypto.dll
<PostBuildEvent>cd "$(TargetDir)" &amp;&amp; del BouncyCastle.Cryptography.dll

lalaki_sign "$(TargetPath)"</PostBuildEvent>
</PropertyGroup>
Expand Down
Binary file removed BouncyCastle.Crypto.dll
Binary file not shown.
20 changes: 14 additions & 6 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using Org.BouncyCastle.Asn1.Nist;
using System.Reflection;
using System.Windows.Forms;
using System.IO.Compression;

namespace AndroidKeyGen
{
Expand All @@ -23,14 +24,21 @@ internal static class Program
private static void Main()
{
var main = Assembly.GetExecutingAssembly();
foreach (string resName in main.GetManifestResourceNames())
foreach (var resName in main.GetManifestResourceNames())
{
Stream res = main.GetManifestResourceStream(resName);
if (resName.EndsWith(".dll"))
using (var res = main.GetManifestResourceStream(resName))
{
var ms = new MemoryStream();
res.CopyTo(ms);
AppDomain.CurrentDomain.AssemblyResolve += (_, __) => Assembly.Load(ms.ToArray());
if (resName.EndsWith(".gz"))
{
using (var gzDll = new GZipStream(res, CompressionMode.Decompress))
{
using (var ms = new MemoryStream())
{
gzDll.CopyTo(ms);
AppDomain.CurrentDomain.AssemblyResolve += (_, __) => Assembly.Load(ms.ToArray());
}
}
}
}
}
Application.EnableVisualStyles();
Expand Down
Binary file added Properties/res.gz
Binary file not shown.

0 comments on commit bf57a61

Please sign in to comment.