Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Revxrsal/Tuna-Bytes
An all-purpose mixins framework for Java bytecode manipulation at runtime, targeted at those with minimal understanding of the bytecode structure.
https://github.com/Revxrsal/Tuna-Bytes
bytecode bytecode-manipulation classloader java mixins
Last synced: about 2 months ago
JSON representation
An all-purpose mixins framework for Java bytecode manipulation at runtime, targeted at those with minimal understanding of the bytecode structure.
- Host: GitHub
- URL: https://github.com/Revxrsal/Tuna-Bytes
- Owner: Revxrsal
- License: apache-2.0
- Created: 2021-07-14T17:55:03.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-04-26T02:48:58.000Z (over 2 years ago)
- Last Synced: 2024-06-25T20:00:58.791Z (3 months ago)
- Topics: bytecode, bytecode-manipulation, classloader, java, mixins
- Language: Java
- Homepage:
- Size: 92.8 KB
- Stars: 22
- Watchers: 1
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![](https://jitpack.io/v/ReflxctionDev/Tuna-Bytes.svg)](https://jitpack.io/#ReflxctionDev/Tuna-Bytes)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)# Tuna Bytes
![A tuna byte :)](https://i.imgur.com/15VLkMI.jpg)
Tuna-bytes is an all-purpose powerful class and bytecode manipulation mixins for Java, which is intended at those with minimal understanding of the Java bytecode structure.## Features
- Full support for the notorious Java 9+ versions, as well as Java 8.
- Does not require access to the source code of classes, and works well even on third-party resources.
- Does not require any knowledge of the Java bytecode.
- Requires zero overhead to get started. Just add Tuna-Bytes as a dependency and as an annotation processor, and Tuna-Bytes will handle the rest.
- Does not require any additional Java execution arguments, like what Java agents do.## Index
Check the [wiki](https://github.com/ReflxctionDev/Tuna-Bytes/wiki) for a full overview on the library.
1. [Maven setup](https://github.com/ReflxctionDev/Tuna-Bytes/wiki/Maven-Setup)
2. [Gradle setup](https://github.com/ReflxctionDev/Tuna-Bytes/wiki/Gradle-Setup)
3. [Getting started](https://github.com/ReflxctionDev/Tuna-Bytes/wiki/Getting-started)
4. [**Example**: Overwrite a method](https://github.com/ReflxctionDev/Tuna-Bytes/wiki/Overwrite)
5. [**Example**: Inject into a method](https://github.com/ReflxctionDev/Tuna-Bytes/wiki/Injecting)
6. [**Example**: Create accessors for inaccessible fields and methods](https://github.com/ReflxctionDev/Tuna-Bytes/wiki/Accessors)
7. [**Example**: Mirroring a field or a method](https://github.com/ReflxctionDev/Tuna-Bytes/wiki/Mirroring)# Drawbacks
Just like any other bytecode manipulation library, **manipulating a class after is has been loaded is not possible** without things like instrumentation, agents or such. Tuna-bytes assumes that any class it is about to modify has not been loaded, and will otherwise throw an exception. To suppress `Class XX has already been loaded` exceptions, use `MixinsBootstrap.init(true)`