{"id":15018015,"url":"https://github.com/katharostech/bevy_assetio_zip","last_synced_at":"2025-10-23T13:31:01.246Z","repository":{"id":57506282,"uuid":"335823500","full_name":"katharostech/bevy_assetio_zip","owner":"katharostech","description":"Bevy AssetIO plugin that can load assets from optionally obfuscated zip files","archived":false,"fork":false,"pushed_at":"2021-02-04T22:48:36.000Z","size":26,"stargazers_count":13,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-29T21:01:54.025Z","etag":null,"topics":["assets","bundle","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/katharostech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-04T03:10:36.000Z","updated_at":"2024-06-24T12:59:47.000Z","dependencies_parsed_at":"2022-08-29T20:20:42.267Z","dependency_job_id":null,"html_url":"https://github.com/katharostech/bevy_assetio_zip","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katharostech%2Fbevy_assetio_zip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katharostech%2Fbevy_assetio_zip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katharostech%2Fbevy_assetio_zip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katharostech%2Fbevy_assetio_zip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/katharostech","download_url":"https://codeload.github.com/katharostech/bevy_assetio_zip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237756254,"owners_count":19361030,"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":["assets","bundle","rust"],"created_at":"2024-09-24T19:51:19.338Z","updated_at":"2025-10-23T13:31:00.488Z","avatar_url":"https://github.com/katharostech.png","language":"Rust","funding_links":[],"categories":["Plugins and Crates"],"sub_categories":["Helpers"],"readme":"# bevy_assetio_zip\n\n[![Crates.io](https://img.shields.io/crates/v/bevy_assetio_zip)](https://crates.io/crates/bevy_assetio_zip)\n[![Docs.rs](https://docs.rs/bevy_assetio_zip/badge.svg)](https://docs.rs/bevy_assetio_zip)\n[![Katharos License](https://img.shields.io/badge/License-Katharos-blue)](https://github.com/katharostech/katharos-license)\n\nA Bevy [`AssetIo`](bevy::asset::AssetIo) implementation that allows reading from optionally\nobfuscated zip asset bundles. Using the [`bevy_assetio_zip_bundler`] crate you can also\nautomatically bundle your assets in the desired format in your `build.rs` script.\n\n[`bevy_assetio_zip_bundler`]: https://docs.rs/bevy_assetio_zip_bundler\n\n## Usage\n\nSimply enable the plugin when setting up your Bevy app to enable loading from asset bundle\nfiles.\n\n```rust\nApp::build()\n    // Any config must be inserted before adding plugins. This is optional.\n    .add_resource(AssetIoZipConfig {\n        // The name of the asset bundle file, excluding the extension, to load\n        file_name: \"assets\".into(), // This is the default\n    })\n    // Add the default plugins\n    .add_plugins_with(DefaultPlugins, |group| {\n        // With our additinoal asset IO plugin\n        group.add_before::\u003cbevy::asset::AssetPlugin, _\u003e(AssetIoZipPlugin)\n    })\n    .run();\n```\n\nOnce enabling the plugin, the game will now search for `assets.zip` and `assets.bin` files\nadjacent to the executable when attempting to load assets. If an asset is not found in the zip\nfile, it will attempt to load the asset using the default Bevy asset loader for the target\nplatform.\n\n## Types of Asset Bundles\n\nThere are two kinds of asset bundle files supported by this plugin, plain `.zip` files and\nobfuscated zip files ( which have a `.bin` extension ). Plain `.zip` files are typical zip files\nthat can be created with normal zip software. Obfuscated zip files can be created with\n[`bevy_assetio_zip_bundler`] and are simply a normal zip file that has had the bytes XOR-ed by\n`0b01010101`.\n\n\u003e **⚠️ WARNING:** Obfuscated zip files provide no real security or protection for your assets.\n\u003e It is trivial to decript the asset bundle even if it is obfuscated. Obfuscation of the zip is\n\u003e only a measure to prevent casual users from being able to immediately introspect the data.\n\n## Bundling Assets\n\nTo bundle your bevy assets you can use the [`bevy_assetio_zip_bundler`] crate. The easiest way\nto use it is to add this to your `build.rs` file:\n\n```rust\nfn main() {\n    bevy_assetio_zip_bundler::bundle_crate_assets();\n}\n```\n\nThis will automatically zip up your crate's `assets` folder and put it in your `target/` dir\nwhen compiling release builds. When distributing your application simply take your asset bundle\nand place it adjacent to the executable and Bevy will attempt to load assets from the bundle\nbefore falling back to the `assets` dir.\n\nYou can configure the name, obfuscation, and compression of the bundle by creating and\n`asset_config.toml` file next to your `Cargo.toml` file:\n\n```toml\n# Bundle assets even for debug builds\nbundle-for-debug-builds = true # Default: false\n\n# Obfuscate assets. This doesn't protect from reverse-engineering, but it makes it a little harder\n# for the average user to read them.\nobfuscate = true # Default: false\n\n# Compress the asset bundle using Bzip2 compression. Other options are \"deflate\" and \"none\".\ncompression = \"bzip2\" # Default: \"bzip2\"\n\n# The name of the file, not counting the exention, which will be different based on the `obfuscate`\n# setting. Obfuscated bundles will end in `.bin` and non-obfuscated bundles will end in `.zip`.\nfile-name = \"assets\" # Default: \"assets\"\n\n# Set the directory that asset bundle should be placed.\nout-dir = \"../target\" # Default \"./target\"\n```\n\nAlternatively, if you want to create your own tooling or customize the asset bundling process,\nyou can manually bundle the assets using the [`bevy_assetio_zip_bundler::bundle_assets`]\nfunction.\n\n[`bevy_assetio_zip_bundler::bundle_assets`]:\nhttps://docs.rs/bevy_assetio_zip_bundler/latest/bevy_assetio_zip_bundler/fn.bundle_assets.html\n\n## Bevy Versions\n\nSupported bevy versions per plugin version:\n\n| Bevy Version | Plugin Version                                     |\n| ------------ | -------------------------------------------------- |\n| 0.4          | 0.1                                                |\n| master       | 0.1 with the `bevy-unstable` feature ( see below ) |\n\n### Using Bevy From Master\n\nYou can use this crate with Bevy master by adding a patch to your `Cargo.toml` and by adding the\n`bevy-unstable` feature to this crate:\n\n```toml\n[dependencies]\n# Bevy version must be set to \"0.4\" and we will\n# override it in the patch below.\nbevy = \"0.4\"\nbevy_assetio_zip = { version = \"0.1\", features = [\"bevy-unstable\"] }\n\n[patch.crates-io]\nbevy = { git = \"https://github.com/bevyengine/bevy.git\" }\n```\n\nNote that as Bevy master may or may not introduce breaking API changes, this crate may or may\nnot compile when using the `bevy-unstable` feature.\n\n## License\n\nThis crate is licensed under the [Katharos License][k_license] which places certain restrictions\non what you are allowed to use it for. Please read and understand the terms before using this\ncrate for your project.\n\n[k_license]: https://github.com/katharostech/katharos-license\n\n[`Read`]: https://doc.rust-lang.org/stable/std/io/trait.Read.html\n[`Write`]: https://doc.rust-lang.org/stable/std/io/trait.Write.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkatharostech%2Fbevy_assetio_zip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkatharostech%2Fbevy_assetio_zip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkatharostech%2Fbevy_assetio_zip/lists"}