Skip to content

Commit

Permalink
Cross-platform support
Browse files Browse the repository at this point in the history
  • Loading branch information
wuyuansushen committed Mar 14, 2022
1 parent ad8336d commit d74bdce
Show file tree
Hide file tree
Showing 234 changed files with 278 additions and 225 deletions.
13 changes: 8 additions & 5 deletions zippasswd/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using System;
using System.IO;
using System.Runtime;
using System.Collections;
using System.Collections.Generic;
using ICSharpCode.SharpZipLib.Core;
using ICSharpCode.SharpZipLib.Zip;

Expand All @@ -10,8 +13,8 @@ public class Program
public static ZipEntryFactory zipEntryFactory=new ZipEntryFactory();
static void Main(string[] args)
{
const string suffix = ".aria2";
string pureName = "",prefixOfPath="";
const string suffix = @".aria2";
string pureName = @"",prefixOfPath=@"";
//Delete original destination file
DeleteFileAndDirectory(args[0]);
using (var fs = File.Create(args[0]))
Expand All @@ -36,7 +39,7 @@ static void Main(string[] args)
pureName=GetPureName(args[i]);

prefixOfPath = pureName.Substring(0, pureName.Length -
(pureName.Split('/').Last()).Length);
(pureName.Split(Path.PathSeparator).Last()).Length);

//Console.WriteLine($"prefix of path: {prefixOfPath.Length}");
//Console.WriteLine($"pure name: {pureName}");
Expand Down Expand Up @@ -105,7 +108,7 @@ public static string GetPureName(string inName)
{
var cleanName=inName.Trim();
string? tmpName = null;
if (cleanName.Last() == '/')
if (cleanName.Last() == Path.PathSeparator)
{
//Clean the last slash(/)
tmpName = cleanName.Substring(0, cleanName.Length - 1);
Expand Down Expand Up @@ -138,7 +141,7 @@ public static void DeleteFileAndDirectory(string fileDirectoryName)
{
}
}
static void Compress(string path,ZipOutputStream inputStream,string prefixGet="")
static void Compress(string path,ZipOutputStream inputStream,string prefixGet=@"")
{
var attr = File.GetAttributes(path);
if (!attr.HasFlag(FileAttributes.Directory))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<History>True|2021-12-26T15:36:16.4468407Z;True|2021-12-26T23:33:24.7877199+08:00;True|2021-12-26T19:14:39.6854686+08:00;True|2021-12-26T16:55:02.9742773+08:00;True|2021-12-17T00:35:06.0258819+08:00;True|2021-12-17T00:29:54.5736918+08:00;True|2021-12-15T19:09:15.1787933+08:00;True|2021-12-15T18:56:15.8897689+08:00;True|2021-12-15T18:42:58.1578277+08:00;True|2021-12-15T15:44:24.0008749+08:00;True|2021-12-15T15:35:18.6605612+08:00;True|2021-12-15T15:17:03.5093756+08:00;True|2021-12-15T15:05:44.8518564+08:00;True|2021-12-15T14:53:41.5586557+08:00;True|2021-12-15T14:41:57.7538455+08:00;True|2021-12-15T14:21:25.1222034+08:00;True|2021-12-15T14:05:53.8891846+08:00;True|2021-12-15T14:02:01.8879261+08:00;True|2021-12-15T13:56:15.6758647+08:00;True|2021-12-15T13:53:36.7776238+08:00;True|2021-12-15T13:52:50.8738231+08:00;True|2021-12-15T13:50:13.2352662+08:00;True|2021-12-15T13:48:43.0963196+08:00;True|2021-12-15T13:41:18.3722610+08:00;True|2021-12-15T13:32:54.2069122+08:00;True|2021-12-14T23:26:09.4587786+08:00;True|2021-12-14T23:24:26.1766231+08:00;True|2021-12-14T23:21:00.8948765+08:00;True|2021-12-14T23:06:37.6503068+08:00;True|2021-12-14T21:13:51.9116759+08:00;True|2021-12-14T21:09:31.0221262+08:00;True|2021-12-14T21:01:08.1398033+08:00;True|2021-12-14T14:13:12.1946485+08:00;True|2021-12-14T14:08:34.7372899+08:00;True|2021-12-14T14:04:56.5058104+08:00;True|2021-12-14T13:48:22.8013091+08:00;True|2021-12-14T13:09:37.0931070+08:00;True|2021-12-13T23:53:33.4222164+08:00;True|2021-12-13T23:17:31.4991133+08:00;True|2021-12-13T13:57:40.5176997+08:00;True|2021-12-13T13:56:44.1760940+08:00;</History>
<History>True|2022-03-14T04:56:15.7697029Z;True|2021-12-26T23:36:16.4468407+08:00;True|2021-12-26T23:33:24.7877199+08:00;True|2021-12-26T19:14:39.6854686+08:00;True|2021-12-26T16:55:02.9742773+08:00;True|2021-12-17T00:35:06.0258819+08:00;True|2021-12-17T00:29:54.5736918+08:00;True|2021-12-15T19:09:15.1787933+08:00;True|2021-12-15T18:56:15.8897689+08:00;True|2021-12-15T18:42:58.1578277+08:00;True|2021-12-15T15:44:24.0008749+08:00;True|2021-12-15T15:35:18.6605612+08:00;True|2021-12-15T15:17:03.5093756+08:00;True|2021-12-15T15:05:44.8518564+08:00;True|2021-12-15T14:53:41.5586557+08:00;True|2021-12-15T14:41:57.7538455+08:00;True|2021-12-15T14:21:25.1222034+08:00;True|2021-12-15T14:05:53.8891846+08:00;True|2021-12-15T14:02:01.8879261+08:00;True|2021-12-15T13:56:15.6758647+08:00;True|2021-12-15T13:53:36.7776238+08:00;True|2021-12-15T13:52:50.8738231+08:00;True|2021-12-15T13:50:13.2352662+08:00;True|2021-12-15T13:48:43.0963196+08:00;True|2021-12-15T13:41:18.3722610+08:00;True|2021-12-15T13:32:54.2069122+08:00;True|2021-12-14T23:26:09.4587786+08:00;True|2021-12-14T23:24:26.1766231+08:00;True|2021-12-14T23:21:00.8948765+08:00;True|2021-12-14T23:06:37.6503068+08:00;True|2021-12-14T21:13:51.9116759+08:00;True|2021-12-14T21:09:31.0221262+08:00;True|2021-12-14T21:01:08.1398033+08:00;True|2021-12-14T14:13:12.1946485+08:00;True|2021-12-14T14:08:34.7372899+08:00;True|2021-12-14T14:04:56.5058104+08:00;True|2021-12-14T13:48:22.8013091+08:00;True|2021-12-14T13:09:37.0931070+08:00;True|2021-12-13T23:53:33.4222164+08:00;True|2021-12-13T23:17:31.4991133+08:00;True|2021-12-13T13:57:40.5176997+08:00;True|2021-12-13T13:56:44.1760940+08:00;</History>
</PropertyGroup>
</Project>
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/Microsoft.CSharp.dll
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/Microsoft.VisualBasic.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.AppContext.dll
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Buffers.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Collections.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.ComponentModel.dll
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Console.dll
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Core.dll
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Data.Common.dll
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Data.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Drawing.dll
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Formats.Asn1.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.IO.Compression.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.IO.FileSystem.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.IO.Pipes.dll
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.IO.dll
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Linq.Parallel.dll
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Linq.Queryable.dll
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Linq.dll
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Memory.dll
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Net.Http.Json.dll
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Net.Http.dll
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Net.Mail.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Net.Ping.dll
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Net.Primitives.dll
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Net.Quic.dll
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Net.Requests.dll
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Net.Security.dll
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Net.Sockets.dll
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Net.WebClient.dll
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Net.WebProxy.dll
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Net.WebSockets.dll
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Net.dll
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Numerics.Vectors.dll
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Numerics.dll
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.ObjectModel.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Private.Uri.dll
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Private.Xml.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Reflection.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Runtime.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Security.dll
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.ServiceProcess.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Text.Json.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Threading.dll
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Transactions.dll
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.ValueTuple.dll
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Web.dll
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Windows.dll
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Xml.Linq.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Xml.XDocument.dll
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Xml.XPath.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.Xml.dll
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/System.dll
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/WindowsBase.dll
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/createdump
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/libSystem.Native.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/libclrjit.so
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/libcoreclr.so
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/libdbgshim.so
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/libhostfxr.so
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/libhostpolicy.so
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/libmscordaccore.so
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/libmscordbi.so
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/mscorlib.dll
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/netstandard.dll
Binary file not shown.
Binary file not shown.
Binary file modified zippasswd/bin/Release/net6.0/linux-x64/zippasswd
Binary file not shown.
Loading

0 comments on commit d74bdce

Please sign in to comment.