{"id":14963597,"url":"https://github.com/dotnet/android-libzipsharp","last_synced_at":"2025-07-15T07:33:37.196Z","repository":{"id":9353239,"uuid":"61309402","full_name":"dotnet/android-libzipsharp","owner":"dotnet","description":"A managed wrapper (and then some) around libzip (https://libzip.org/)","archived":false,"fork":false,"pushed_at":"2025-01-16T08:48:15.000Z","size":553,"stargazers_count":29,"open_issues_count":4,"forks_count":12,"subscribers_count":45,"default_branch":"main","last_synced_at":"2025-01-30T07:42:36.853Z","etag":null,"topics":["dotnet","libzip","mono","native-libraries"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dotnet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE-OF-CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-16T16:31:34.000Z","updated_at":"2025-01-16T08:48:15.000Z","dependencies_parsed_at":"2024-04-05T10:25:59.665Z","dependency_job_id":"1bba4497-ffab-4ecd-a6dc-b76583c2a08e","html_url":"https://github.com/dotnet/android-libzipsharp","commit_stats":{"total_commits":177,"total_committers":12,"mean_commits":14.75,"dds":0.536723163841808,"last_synced_commit":"f7dd2fb8d07e001d36ca2957b7cc3fed5b85064b"},"previous_names":["dotnet/android-libzipsharp","xamarin/libzipsharp"],"tags_count":50,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnet%2Fandroid-libzipsharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnet%2Fandroid-libzipsharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnet%2Fandroid-libzipsharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnet%2Fandroid-libzipsharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dotnet","download_url":"https://codeload.github.com/dotnet/android-libzipsharp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237092790,"owners_count":19254273,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dotnet","libzip","mono","native-libraries"],"created_at":"2024-09-24T13:31:51.519Z","updated_at":"2025-02-04T09:31:46.997Z","avatar_url":"https://github.com/dotnet.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LibZipSharp\nA managed wrapper (and then some) around libzip (https://libzip.org/)\n\n[![Build Status](https://devdiv.visualstudio.com/DevDiv/_apis/build/status/xamarin.LibZipSharp?repoName=xamarin%2FLibZipSharp\u0026branchName=main)](https://devdiv.visualstudio.com/DevDiv/_build/latest?definitionId=11678\u0026repoName=xamarin%2FLibZipSharp\u0026branchName=main)\n\n\nThe core of `LibZipSharp` is the `ZipArchive` class. You can use this class\nto create/extract/update zip file. \n\n## Create a new Zip\n\nTo create a new archive use the `FileMode.CreateNew`, this will behave\nexactly as it does with normal `File` operations. An exception will be\nthrown if the file already exists. \n\n```\nusing (var zip = ZipArchive.Open (\"test.zip\", FileMode.CreateNew)) {\n}\n```\n\n## Open am existing Zip\n\nTo open an existing zip file use `FileMode.Open`.\n\n```\nusing (var zip = ZipArchive.Open (\"test.zip\", FileMode.Open)) {\n}\n```\n\n## Add files to Zip\n\nThere are a number of methods which can be used to add items to \nthe zip file. The simplest is `AddFile`. This takes a file path.\nIf filename is an absolute path, it will be converted to a relative\none by removing the root of the path (i.e. the leading `/` part on \nUnix systems and the `x:\\\\` part on Windows). You can also pass an \n`archivePath` parameter where you can specify the name/path which file\nwill have within the archive. \n\n```\nusing (var zip = ZipArchive.Open (\"test.zip\", FileMode.CreateNew)) {\n    zip.AddFile (\"somefile.txt\");\n}\n```\n\nYou can also add data directly from a `MemoryStream` via the `AddEntry`\nmethod. This takes an `entryName` and a `MemoryStream`. Note the `MemoryStream`\nwill be disposed of when the zip file is finally written to disk. \n\n```\nvar ms = new MemoryStream ();\n// write data to stream.\nusing (var zip = ZipArchive.Open (\"test.zip\", FileMode.CreateNew)) {\n    zip.AddEntry (\"foo\", ms);\n}\n```\n\nYou can also add text directly via the `AddEntry` method. This method \ntakes an `entryName` and `text` parameters. The `entryName` defines \nwhat the item in the zip file will be called. The `text` defines the contents\non the entry. There is also an `encoding` parameter where you can define\nthe `Encoding` of the file. \n\n```\nusing (var zip = ZipArchive.Open (\"test.zip\", FileMode.CreateNew)) {\n    zip.AddEntry (\"foo\", \"contents of the file\", Encoding.UTF8);\n}\n```\n\n# Shipping the native libraries.\n\nBy default the native libraries will NOT be copied into the output directory\nof your app. `.Net Core` apps will pick these files up automatically. However\nfor Mono you will need the `libzip.*` files in the same directory as the \nfinal app for this library to work. Setting the `LibZipSharpBundleAllNativeLibraries`\nMSBuild property to `true` will make sure the native libraries for \nALL supported platforms are copied to the output directory.\n\nYou can do this via the command line\n\n```\n/p:LibZipSharpBundleAllNativeLibraries=True\n```\n\nor by adding the following to you `csproj`.\n\n```\n\u003cLibZipSharpBundleAllNativeLibraries\u003etrue\u003c/LibZipSharpBundleAllNativeLibraries\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotnet%2Fandroid-libzipsharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdotnet%2Fandroid-libzipsharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotnet%2Fandroid-libzipsharp/lists"}