From 754ea095003ebb1baef175772df9989507b624f5 Mon Sep 17 00:00:00 2001 From: KawaiiZenbo <48113593+kawaiizenbo@users.noreply.github.com> Date: Mon, 25 Apr 2022 13:23:45 -0700 Subject: [PATCH 1/8] Update LICENSE --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index e2d878c..806e2ac 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 Chloe (kawaiizenbo) +Copyright (c) 2021 the KawaiiZenbos/the Gum Hive Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 798237219f6abd9fa0683c4db89b50f0054f71ab Mon Sep 17 00:00:00 2001 From: kawaiizenbo <48113593+kawaiizenbo@users.noreply.github.com> Date: Mon, 1 Aug 2022 11:14:37 -0700 Subject: [PATCH 2/8] make it not broken --- RepoFullDownloader-Core/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RepoFullDownloader-Core/Program.cs b/RepoFullDownloader-Core/Program.cs index e7475e9..eba2638 100644 --- a/RepoFullDownloader-Core/Program.cs +++ b/RepoFullDownloader-Core/Program.cs @@ -196,7 +196,7 @@ namespace RepoFullDownloader_Core } using (WebClient wc = new WebClient()) { - wc.DownloadFileAsync(new Uri(link + p.link), fileToDownload); + wc.DownloadFile(new Uri(link + p.link), fileToDownload); } Console.WriteLine("Successfully downloaded " + link + p.link + " as " + fileToDownload); } From 616bb2da7f9d53247aac0ae4316cdebdb5f213d6 Mon Sep 17 00:00:00 2001 From: kawaiizenbo <48113593+kawaiizenbo@users.noreply.github.com> Date: Thu, 4 Aug 2022 11:05:31 -0700 Subject: [PATCH 3/8] config overhaul/general fixup --- RepoFullDownloader-Core/DataClasses.cs | 62 ------------- RepoFullDownloader-Core/Program.cs | 115 ++++++++++++++++--------- 2 files changed, 74 insertions(+), 103 deletions(-) delete mode 100644 RepoFullDownloader-Core/DataClasses.cs diff --git a/RepoFullDownloader-Core/DataClasses.cs b/RepoFullDownloader-Core/DataClasses.cs deleted file mode 100644 index 22086b2..0000000 --- a/RepoFullDownloader-Core/DataClasses.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace RepoFullDownloader -{ - class Options - { - public bool originalFilenames { get; set; } = false; - public Repo[] repos { get; set; } = { - new Repo() - { - url = "http://repo.kawaiizenbo.me/", - type = "cydia" - }, - new Repo() - { - url = "http://apptapp.saurik.com/", - type = "installer" - }, - new Repo() - { - url = "http://apt.saurik.com/", - type = "dist", - distAttributes = new DistAttributes() - { - suites = "ios/", - components = "main", - } - } - }; - public int delay { get; set; } = 1; - } - - class Repo - { - public string url { get; set; } - public string type { get; set; } - public DistAttributes distAttributes { get; set; } = null; - } - - class DistAttributes - { - public string suites { get; set; } - public string components { get; set; } - } - - class CydiaPackage - { - public CydiaPackage(string _link, string _name, string _version) - { - this.link = _link; - this.name = _name; - this.version = _version; - } - public string link { get; set; } - public string name { get; set; } - public string version { get; set; } - } -} diff --git a/RepoFullDownloader-Core/Program.cs b/RepoFullDownloader-Core/Program.cs index eba2638..0c72ccd 100644 --- a/RepoFullDownloader-Core/Program.cs +++ b/RepoFullDownloader-Core/Program.cs @@ -3,21 +3,21 @@ using ICSharpCode.SharpZipLib.GZip; using PlistCS; -using RepoFullDownloader; - using System; using System.Collections.Generic; using System.IO; using System.Net; using System.Net.Http; -using System.Text.Json; +using System.Text.RegularExpressions; using System.Threading; namespace RepoFullDownloader_Core { class Program { - private static Options options = new Options(); + private static List repos = new List(); + private static bool originalFilenames; + private static int delayMS; static void Main(string[] args) { @@ -33,17 +33,19 @@ namespace RepoFullDownloader_Core { Directory.CreateDirectory("./output/"); } - // Load Options from 'options.json' - if (!File.Exists("./options.json")) + // Load Options from 'options.ini' + if (!File.Exists("./options.ini")) { - Console.WriteLine("Could not find options.json"); + Console.WriteLine("Could not find options.ini"); Console.WriteLine("Generating example..."); // generate example options - File.WriteAllText("./options.json", JsonSerializer.Serialize(new Options())); - return; + File.WriteAllText("options.ini", + "delayMS=1\n" + + "originalFilenames=false"); } - string optionsJson = File.ReadAllText("./options.json"); - options = JsonSerializer.Deserialize(optionsJson); + string[] options = File.ReadAllLines("options.ini"); + delayMS = int.Parse(options[0].Split('=')[1]); + originalFilenames = bool.Parse(options[1].Split('=')[1]); if (args.Length != 0) { string url = args[0]; @@ -67,31 +69,48 @@ namespace RepoFullDownloader_Core } else { - - foreach (Repo r in options.repos) + if (File.Exists("repos.txt")) { - if (r.type.ToLower() == "installer") + foreach (string r in File.ReadAllLines("repos.txt")) { - DownloadInstallerRepo(r.url); - } - else if (r.type.ToLower() == "cydia") - { - DownloadRepo(r.url); - } - else if (r.type.ToLower() == "dist") - { - if(r.distAttributes == null) + if (r.StartsWith('#')) continue; + string[] repoWAttributes = r.Split(' '); + try { - Console.WriteLine($"No dist attributes were defined for {r.url} :("); - return; + switch (repoWAttributes[1]) + { + case "installer": + DownloadInstallerRepo(repoWAttributes[0]); + break; + case "cydia": + DownloadRepo(repoWAttributes[0]); + break; + case "dist": + DownloadDistRepo(repoWAttributes[0], repoWAttributes[2], repoWAttributes[3]); + break; + default: + Console.WriteLine($"Invalid repo type {repoWAttributes[1]} on {repoWAttributes[0]}"); + break; + } + } + catch (Exception e) + { + Console.WriteLine($"Invalid formatting on {r}"); + Console.WriteLine(e); } - DownloadDistRepo(r.url, r.distAttributes); - } - else - { - Console.WriteLine($"Invalid repo type {r.type} on {r.url}"); } } + else + { + Console.WriteLine("Could not find repos.txt"); + Console.WriteLine("Generating example..."); + // generate example repo list + File.WriteAllText("repos.txt", + "http://repo.kawaiizenbo.me cydia\n" + + "http://apptapp.saurik.com installer\n" + + "http://apt.saurik.com dist ios/ main" + ); + } } // this is the part where it is over @@ -189,7 +208,7 @@ namespace RepoFullDownloader_Core try { string[] choppedUp = p.link.Split('/'); - string fileToDownload = options.originalFilenames ? $"./output/{cleanLink}/" + choppedUp[choppedUp.Length - 1].Replace("/", "_").Replace(":", "_") : $"./output/{cleanLink}/" + p.name.Replace("/", "_").Replace(":", "_") + "-" + p.version.Replace("/", "_").Replace(":", "_") + ".deb"; + string fileToDownload = originalFilenames ? $"./output/{cleanLink}/" + choppedUp[choppedUp.Length - 1].Replace("/", "_").Replace(":", "_") : $"./output/{cleanLink}/" + p.name.Replace("/", "_").Replace(":", "_") + "-" + p.version.Replace("/", "_").Replace(":", "_") + ".deb"; if (File.Exists(fileToDownload)) { fileToDownload += "_" + r.Next(0000, 9999); @@ -206,7 +225,7 @@ namespace RepoFullDownloader_Core Console.WriteLine(e.Message); failed.Add(link + p.link); } - Thread.Sleep(options.delay); + Thread.Sleep(delayMS); } Console.WriteLine("Finished downloading " + link); if(failed.Count != 0) File.WriteAllLines($"./output/{cleanLink}/failed.txt", failed); @@ -236,7 +255,8 @@ namespace RepoFullDownloader_Core Console.WriteLine("Could not download package list from " + link + ": " + e.Message); return; } - Dictionary plist = (Dictionary)Plist.readPlist($"./output/{cleanLink}/packages.plist"); + Dictionary plist = (Dictionary)Plist.readPlistSource(Regex.Replace(File.ReadAllText($"./output/{cleanLink}/packages.plist"), + "", "")); foreach (Dictionary d in (List)plist["packages"]) { Random r = new Random(); @@ -281,7 +301,7 @@ namespace RepoFullDownloader_Core } } - static void DownloadDistRepo(string link, DistAttributes da) + static void DownloadDistRepo(string link, string suites, string components) { // clean up link so no issues can ever arise if (!link.StartsWith("https://") && !link.StartsWith("http://")) @@ -295,15 +315,15 @@ namespace RepoFullDownloader_Core // make that good dist path string distPath; - if(!da.suites.EndsWith("/")) + if(!suites.EndsWith("/")) { - da.suites += "/"; + suites += "/"; } - if (!da.components.EndsWith("/")) + if (!components.EndsWith("/")) { - da.components += "/"; + components += "/"; } - distPath = da.suites + da.components; + distPath = suites + components; string poolpfLink = link + "dists/" + distPath + "binary-iphoneos-arm/"; string cleanLink = link.TrimEnd('/').Replace("http://", "").Replace("https://", "").Replace("/", "_").Replace(":", "_"); @@ -387,7 +407,7 @@ namespace RepoFullDownloader_Core try { string[] choppedUp = p.link.Split('/'); - string fileToDownload = options.originalFilenames ? $"./output/{cleanLink}-({distPath.Replace("/", "_").Replace(":", "_")})/" + choppedUp[choppedUp.Length - 1].Replace("/", "_").Replace(":", "_") : $"./output/{cleanLink}-({distPath.Replace("/", "_").Replace(":", "_")})/" + p.name.Replace("/", "_").Replace(":", "_") + "-" + p.version.Replace("/", "_").Replace(":", "_") + ".deb"; + string fileToDownload = originalFilenames ? $"./output/{cleanLink}-({distPath.Replace("/", "_").Replace(":", "_")})/" + choppedUp[choppedUp.Length - 1].Replace("/", "_").Replace(":", "_") : $"./output/{cleanLink}-({distPath.Replace("/", "_").Replace(":", "_")})/" + p.name.Replace("/", "_").Replace(":", "_") + "-" + p.version.Replace("/", "_").Replace(":", "_") + ".deb"; if (File.Exists(fileToDownload)) { fileToDownload += "_" + r.Next(0000, 9999); @@ -404,10 +424,23 @@ namespace RepoFullDownloader_Core Console.WriteLine(e.Message); failed.Add(link + p.link); } - Thread.Sleep(options.delay); + Thread.Sleep(delayMS); } Console.WriteLine("Finished downloading " + link); if (failed.Count != 0) File.WriteAllLines($"./output/{cleanLink}-({distPath.Replace("/", "_").Replace(":", "_")})/failed.txt", failed); } } + + class CydiaPackage + { + public CydiaPackage(string _link, string _name, string _version) + { + this.link = _link; + this.name = _name; + this.version = _version; + } + public string link { get; set; } + public string name { get; set; } + public string version { get; set; } + } } From d76e673a9718b63ad9cf4407c9fdfe63813eca47 Mon Sep 17 00:00:00 2001 From: kawaiizenbo <48113593+kawaiizenbo@users.noreply.github.com> Date: Thu, 4 Aug 2022 11:09:13 -0700 Subject: [PATCH 4/8] fgsdhgfgdghfdghfdghfhdfg --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2181e58..542b284 100644 --- a/README.md +++ b/README.md @@ -7,4 +7,7 @@ An internet connection. ## Command Line Options `dotnet RepoFullDownloader-Core.dll ` -Running with no URL will use the repo list from `options.json` +Running with no URL will use the repo list from `repos.txt` + +## Binaries +https://nightly.link/kawaiizenbo/RepoFullDownloader-Core/workflows/build/master/Build.zip From 067745e42d03a87b06138b079de3297fa6cc5169 Mon Sep 17 00:00:00 2001 From: kawaiizenbo <48113593+kawaiizenbo@users.noreply.github.com> Date: Sat, 6 Aug 2022 10:44:51 -0700 Subject: [PATCH 5/8] fix --- README.md | 2 +- RepoFullDownloader-Core/Program.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 542b284..440348c 100644 --- a/README.md +++ b/README.md @@ -10,4 +10,4 @@ An internet connection. Running with no URL will use the repo list from `repos.txt` ## Binaries -https://nightly.link/kawaiizenbo/RepoFullDownloader-Core/workflows/build/master/Build.zip +https://nightly.link/kawaiizenbo/RepoFullDownloader-Core/workflows/dotnet/master/Build.zip diff --git a/RepoFullDownloader-Core/Program.cs b/RepoFullDownloader-Core/Program.cs index 0c72ccd..4c48f7e 100644 --- a/RepoFullDownloader-Core/Program.cs +++ b/RepoFullDownloader-Core/Program.cs @@ -149,7 +149,7 @@ namespace RepoFullDownloader_Core { Console.WriteLine("Could not download " + link + "Packages.bz2: " + e.Message); Console.WriteLine("Attempting to download " + link + "Packages.gz"); - Stream packagesGz = webClient.GetStreamAsync(link + "Packages.bz2").Result; + Stream packagesGz = webClient.GetStreamAsync(link + "Packages.gz").Result; FileStream packagesGzDecompressed = File.Create($"./output/{cleanLink}/Packages"); GZip.Decompress(packagesGz, packagesGzDecompressed, true); } From 9fa899aeb0f07ef2cb520eae92b0604350fc3849 Mon Sep 17 00:00:00 2001 From: KawaiiZenbo <48113593+kawaiizenbo@users.noreply.github.com> Date: Tue, 9 Aug 2022 20:03:40 -0700 Subject: [PATCH 6/8] Delete LICENSE --- LICENSE | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 LICENSE diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 806e2ac..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 the KawaiiZenbos/the Gum Hive - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. From 1cfe7544ecfc82a1eb5e15eb8805b3a091bc2762 Mon Sep 17 00:00:00 2001 From: KawaiiZenbo <48113593+kawaiizenbo@users.noreply.github.com> Date: Wed, 10 Aug 2022 13:28:02 -0700 Subject: [PATCH 7/8] Create LICENSE --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ecc0572 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 KawaiiZenbo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 0b55ab83c43b46d3ce4adbaba825e796c7947381 Mon Sep 17 00:00:00 2001 From: Persephone Bubblegum-Holiday Date: Sun, 9 Feb 2025 13:41:22 -0700 Subject: [PATCH 8/8] remove github stuff --- .github/workflows/dotnet.yml | 30 ------------------------------ README.md | 7 ++----- 2 files changed, 2 insertions(+), 35 deletions(-) delete mode 100644 .github/workflows/dotnet.yml diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml deleted file mode 100644 index 0b0e6ea..0000000 --- a/.github/workflows/dotnet.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: .NET - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Setup .NET - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 3.1.x - - name: Restore dependencies - run: dotnet restore - - name: Build - run: dotnet build --no-restore - - name: Test - run: dotnet test --no-build --verbosity normal - - name: capture build artifacts - uses: actions/upload-artifact@v2 - with: - name: Build - path: RepoFullDownloader-Core/bin/Debug/netcoreapp3.1/ diff --git a/README.md b/README.md index 440348c..9f0cfdd 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# RepoFullDownloader-Core +# RepoFullDownloader Cross-Platform Cydia/Installer repo downloader ## Requirements @@ -7,7 +7,4 @@ An internet connection. ## Command Line Options `dotnet RepoFullDownloader-Core.dll ` -Running with no URL will use the repo list from `repos.txt` - -## Binaries -https://nightly.link/kawaiizenbo/RepoFullDownloader-Core/workflows/dotnet/master/Build.zip +Running with no URL will use the repo list from `repos.txt` \ No newline at end of file