https://github.com/MaulingMonkey/jni-bindgen
Generate Rust JVM FFI wrappers around APIs defined by .jar or .class files, because maintaining your own hand-written bindings is an exercise in boredom, soundness bugs, and pain.
https://github.com/MaulingMonkey/jni-bindgen
android jni jvm rust
Last synced: 3 months ago
JSON representation
Generate Rust JVM FFI wrappers around APIs defined by .jar or .class files, because maintaining your own hand-written bindings is an exercise in boredom, soundness bugs, and pain.
- Host: GitHub
- URL: https://github.com/MaulingMonkey/jni-bindgen
- Owner: MaulingMonkey
- License: apache-2.0
- Created: 2019-08-01T05:05:25.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-06T11:58:05.000Z (over 2 years ago)
- Last Synced: 2024-10-31T01:02:19.261Z (9 months ago)
- Topics: android, jni, jvm, rust
- Language: Rust
- Homepage:
- Size: 8.29 MB
- Stars: 79
- Watchers: 4
- Forks: 9
- Open Issues: 30
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# jni-bindgen
[](https://github.com/MaulingMonkey/jni-bindgen)
[](https://github.com/MaulingMonkey/jni-bindgen/actions?query=workflow%3Arust)
[](https://github.com/MaulingMonkey/jni-bindgen/search?q=unsafe+extension%3Ars)
[](https://gist.github.com/MaulingMonkey/c81a9f18811079f19326dac4daa5a359#minimum-supported-rust-versions-msrv)
[](https://github.com/MaulingMonkey/jni-bindgen/issues)
[](https://github.com/MaulingMonkey/jni-bindgen)
[](https://deps.rs/repo/github/MaulingMonkey/jni-bindgen)**Work in progress, only barely kinda partially usable**
Vaguely inspired by, but otherwise unrelated to, [bindgen](https://github.com/rust-lang/rust-bindgen) and
[wasm-bindgen](https://github.com/rustwasm/wasm-bindgen)'s WebIDL stuff.Generate Rust JVM FFI wrappers around APIs defined by `.jar` or `.class` files, because maintaining your own
hand-written bindings is an exercise in boredom, soundness bugs, and pain.## Goals
* Provide a means of using Android system APIs specifically.
* Provide a means of using Java, Kotlin, Scala, or other JVM based APIs.
* Automatically link API documentation, so people might actually read it.
* Eliminate the need to manually write unsound, unreviewed, and [unaudited](https://github.com/dpc/crev) `unsafe { ... }` APIs## Local Crates
| [github.com](https://github.com) | [crates.io](https://crates.io) | [docs.rs](https://docs.rs) | Description |
| ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------- |
| [jni-android-sys](https://github.com/MaulingMonkey/jni-bindgen/tree/master/jni-android-sys) | [](https://crates.io/crates/jni-android-sys) | [](https://docs.rs/jni-android-sys/) | Bindings to Android Java APIs
| [jni-bindgen](https://github.com/MaulingMonkey/jni-bindgen/tree/master/jni-bindgen) | [](https://crates.io/crates/jni-bindgen) | N/A | Generator of Java API bindings
| [jni-glue](https://github.com/MaulingMonkey/jni-bindgen/tree/master/jni-glue) | [](https://crates.io/crates/jni-glue) | [](https://docs.rs/jni-glue/) | Utility functions for Java API bindings## External Crates / Plugins
| [github.com](https://github.com) | package | docs | License | Where |
| -------------------------------- | ------- | ---- | ------- | ----- |
| [jni-sys](https://github.com/sfackler/rust-jni-sys) | [](https://crates.io/crates/jni-sys) | [](https://docs.rs/jni-sys/) | [](https://github.com/sfackler/rust-jni-sys/blob/master/README.md#license)
| [jreflection](https://github.com/MaulingMonkey/jreflection) | [](https://crates.io/crates/jreflection) | [](https://docs.rs/jreflection/) | [](https://github.com/MaulingMonkey/jreflection/blob/master/Readme.md#license) | Bindgen
| [rust-android-gradle](https://github.com/mozilla/rust-android-gradle) | [](https://plugins.gradle.org/plugin/org.mozilla.rust-android-gradle.rust-android) | [README.md](https://github.com/mozilla/rust-android-gradle/blob/master/README.md) | [](https://github.com/MaulingMonkey/rust-android-gradle/blob/master/LICENSE) | Examples## License
Licensed under either of
* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)at your option.
## Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.