- tests: add TestSupport with a single RESULT: PASS/FAIL verdict protocol
- tests: assert on native return values and captured output, not runner markers
- tests: replace the brittle "Bytes: 399" marker with a class-file magic check
- tests: read the shared case list from tests/cases.txt
- tests: add run-tests.sh and copy-bin.sh, run the tests on Linux too
- tests: exclude the Loop.java demo from the compiled test output
- CI: set up JDK 25 and run the integration tests in the build-linux job
- Docs: refresh the AGENTS.md test/CI sections and rule 5
- ptrace-inject-cpp: remove the submodule, its .gitmodules entry and config section
- includes/ptrace-inject-cpp: add the injection library sources, public header and LICENSE
- includes/ptrace-inject-cpp: add CMakeLists defining the ptrace_inject static library
- cmake: build includes/ptrace-inject-cpp on non-Windows instead of the submodule
- docs: list the vendored library in the AGENTS.md layout
- ci: add submodules: recursive to the build-linux checkout; without it the
ptrace-inject-cpp directory is empty and configure fails on add_subdirectory
- cmake: build the ptrace-inject-cpp submodule on non-Windows with its CLI and
examples disabled, and link ptrace_inject::ptrace_inject into the injector
- injector: replace the placeholder injector_linux.c with injector_linux.cpp,
a CLI that injects a shared library into -p PID or -n NAME and forwards the
library's log output to stderr
- ci: add build-linux on ubuntu-latest (GCC + Ninja): configure, build, package, no tests
- ci: upload dist/JuiceAgent_*.tar.gz as JuiceAgent-linux-x64 (14-day retention)
- docs: describe the Windows and Linux jobs in AGENTS.md
- readme: note in Quick Start that Linux builds are not attached to GitHub Releases
- readme: add a Download subsection to Linux Support with the Jenkins job URL
- readme-zh: mirror the same changes in Chinese
- script: add package.sh, packing injector/libloader.so/libagent.so into dist/JuiceAgent_vX.Y.Z_x64_linux.tar.gz
- docs: record the Linux package output in AGENTS.md
- readme: add the Linux platform overview, components and build requirements
- readme: describe ptrace + remote dlopen and the $HOME/.juiceagent config default
- readme-zh: mirror the same changes in Chinese
- libloader: add platform/linux/Entry.cpp that starts the loader from a constructor
- libloader: read the config path from JuiceAgent_ConfigPath, falling back to $HOME/.juiceagent
- libloader: default JuiceAgentNativeLibraryPath to libagent.so on non-Windows
- injector: print a notice that the Linux injector is not open source yet
- cmake: guard Windows-only link dir and projects (ReflectiveDLLInjection, libinject)
- agent/loader: select win32 or linux JVM headers by platform, link jvm only on Windows
- loader: glob platform/linux sources for non-Windows builds
- injector: add a Linux entry point stub selected on non-Windows
- jvm: vendor Linux jni_md.h and jawt_md.h
- docs: add the agent-facing quick start (environment check, requirements, config.toml, injection, verification)
- readme: point new users at the agent guide and show how to prompt an agent
- readme-zh: mirror the same note in Chinese
- document the build/test/release flow for agents working in this repo
- record the hard-won rules: libloader must stay exception-free (reflective loading breaks unwind), config reads are non-throwing, no MinGW runtime DLL deps, and tests must be asserted on output
- docs/update: add v5.0.1 release notes (bilingual) for the libloader crash fix, the typed event bus and the new CI
- docs/update: add the 5.0.1 entry to the changelog
- loader: libloader is reflectively loaded, so its unwind tables are never registered with the OS and a C++ exception thrown inside it cannot be caught - it crashed the target JVM with EXCEPTION_ILLEGAL_INSTRUCTION when config.toml was missing a required key. Replace the throwing config reads with contains() + get(key, default) + early return, and drop the ineffective try/catch in entrypoint()
- config: parse config.toml without exceptions (toml++ parse_result) and remove the throwing get()/getPath()/getArray() overloads
- build: compile libloader with -fno-exceptions (+ SPDLOG_NO_EXCEPTIONS) so exception-capable code fails the build instead of crashing at runtime
- loader: wrap entrypoint() in try/catch; it runs from DllMain inside the target JVM process, so an uncaught exception (e.g. a missing required key in config.toml) would take the target process down
- ci: build with -static-libgcc -static-libstdc++ (matching w64devkit, the local toolchain) so the DLLs do not depend on a libstdc++-6.dll that could be shadowed by an incompatible one on the runner
- ci: bundle only the non-system DLLs actually imported, taken from the compiler that built them, and print the import list for diagnosis
- ci: copy libstdc++-6/libgcc_s_seh-1/libwinpthread-1 next to the built binaries so the tests can load libagent.dll; without them every test failed with a load error on the runner
- tests: run-tests.ps1 now prints a failing test's captured output, so a failure is diagnosable even though the test program exits 0
- ci: build with MinGW-w64 (MSYS2) + Ninja on windows-latest and run the integration tests
- tests: add run-tests.ps1, which compiles the modules, refreshes tests/resources, then runs every test and asserts on its output (the tests exit 0 even on failure, so exit codes are not enough)
- libagent: add EventBus::subscribeFront to insert a listener ahead of the existing ones for the same event
- libagent: add IService::listenFront, tracked like listen() so unlistenAll() still cleans it up; for cases where listener ordering matters (e.g. a transformer pipeline)
- libagent: rewrite EventBus as a type-safe dispatcher keyed by event type; listeners are invoked with the concrete event type instead of 'const void*', and the bus is mutex-protected
- libagent: services subscribe/unsubscribe by event type (IService::listen no longer takes an EventId)
- libagent: remove the unused MethodEntry/MethodExit events and EventMethodEntry/EventMethodExit structs
- build: drop the in-tree eventpp headers (23 files) and its license
- config: drop get_loader_config / print_loader_config and the LoaderConfig struct, which were unused and still referenced the v1 key JuiceAgent.Loader.JuiceAgentNativeLibraryPath
- config: drop the now-unneeded ConfigStruct.hpp and Utils.hpp includes (consumers include Utils.hpp directly)
- docs: add config.md documenting the v2 schema ([JuiceAgent] / [JarLoader]), key defaults and the BuiltIn / CustomJar modes
- docs: rewrite advanced.md around the JarLoader.Mode = CustomJar workflow instead of the removed JUICEAGENT_API_* environment variables
- readme: migrate the Quick Start config example from v1 to v2 and link docs/config.md, list inject-via-java-api under Examples
- examples: update inject-via-java-api HowToUse docs (.md/.txt, EN/ZH) to the v2 config
- tests: rewrite copy-bin.bat with native COPY /Y, cwd-independent paths and error handling so it no longer fails silently when a test JVM is locking resources\libagent.dll
- tests: load Target before calling getClassBytesByName, which only resolves classes that are already loaded
- libagent: gate JarLoaderService::onLoaded on the JarLoader.Enabled key (default false) so the module can be turned off from config
- examples: set Enabled = true in inject-via-java-api, load-via-injector-exe and retransform-class config.toml
- examples: update config.toml to the v2 schema ([JarLoader] with Mode / InjectionDir / JarPath / EntryClass / EntryMethod) for inject-via-java-api, load-via-injector-exe and retransform-class
- libagent: read JarLoader.* instead of JuiceAgent.Modules.JarLoader.*, use Config::isValid() and the new get()/getPath() accessors
- libagent: rename call_java_impl to call_static_java_method
- Loader: dispatch initialize() on JarLoader.Mode; BuiltIn serializes the config and calls JuiceAgentBootstrap.start, CustomJar calls the configured EntryClass.EntryMethod
- Utils: normalize class names to the JNI internal form ('.' -> '/') so JNI FindClass accepts Java binary names like Example.Main (fixes NoClassDefFoundError on custom jar entry)
- Utils: rework Serializer, drop the unused Deserializer/LocalRef, add to_java_string_array / toDelimitedString and a no-argument call_static_java_method overload
- Config: remove the unused serialize_loader_config helper
- Split jar loading into load_builtin (extract and register the bundled JuiceAgent API jar) and load_custom (register a user-supplied jar) in a new JarLoader.cpp
- Check JuiceAgent.Version against CONFIG_VERSION and dispatch on JarLoader.Mode (BuiltIn / CustomJar) during preload
- Pass the parsed Config into Loader::initialize and add CONFIG_VERSION in JuiceAgent.hpp
- Restore Config::Utils loader-config helpers on top of the new getPath API
- Log parse failures in the Config constructor via spdlog::error
- Log missing keys and type mismatches (error when throwing, warn when falling back to defaults)
- Replace vendored single-header toml11 (includes/toml.hpp) with the toml++ library (includes/toml++)
- Rewrite Config to use toml::parse_file and expose typed get/getArray/getPath/contains accessors, storing parse errors instead of logging them
- Update bundled license to toml++
Add script/package.bat and script/package.cmake to package build/bin artifacts into a versioned zip under dist/.
Version.txt now uses Major/Minor/Patch key-value format so the script can parse it, and dist/ is ignored.
Config no longer falls back to the current working directory when no
runtime directory is specified, so an empty runtime dir leaves the config
invalid instead of silently parsing config.toml from the CWD.
- skip empty include/exclude entries in Remapper::shouldRemap to avoid
calling back() on an empty std::string (undefined behavior)
- null-check new_class_data_len/new_classbytes in JuiceRemapperService
before writing remapped bytes back to the JVMTI callback
- add Agent::initialized_ guard so init() is a no-op on second call,
preventing duplicate service instantiation and listeners
- add thread-safe include/exclude sets to Remapper; shouldRemap matches
exact name, package prefix (trailing '/'), or nested class ('\$' after
the prefix), with exclude taking priority
- remapping stays OFF by default: an empty include set remaps nothing;
it is only enabled once addInclude is called (no config include)
- implement addInclude/addExclude/removeInclude/removeExclude/
clearIncludes/clearExcludes JNI bindings
- apply shouldRemap filter in JuiceRemapperService::onClassFileLoadHook
- add JuiceRemapperService that listens for ClassFileLoadHook and calls
the Java static Remap.remap(String, byte[]) via cached JNI declarations,
then writes the returned bytes back to the JVMTI callback
- add JNI bindings (initNative, add/remove/clear include/exclude) with
Remapper singleton init state and cached jclass/jmethodID stored in
Remapper (global.hpp)
- cache static class/method declarations lazily in initNative to avoid
repeated FindClass/GetStaticMethodID
- add generated JuiceRemapper JNI header and runtime-remap example config
Java_cn_xiaozhou233_juiceagent_api_JuiceAgent_init now checks the return
values of Agent::preload and Agent::init and returns JNI_FALSE when either
fails, instead of always reporting success to Java.
- fill EventPreLoad/EventLoaded struct members instead of leaving them
as uninitialized garbage; post PreLoad only after the agent environment
(JavaVM/JNIEnv/JVMTI) is set so listeners can query Agent state
- store (EventId, Handle) pairs in IService and add unlistenAll() to
remove registered listeners on shutdown, preventing dangling callbacks
into destroyed services; BytecodeService and JarLoaderService now call
it from onShutdown
- add JarLoaderService registered via JUICEAGENT_REGISTER_SERVICE; it
listens for EventId::Loaded, reads JuiceAgent.Modules.JarLoader config
from config.toml, serializes it and calls the Java JarLoader.loadJar
module to inject the jar into the JVM
- post EventPreLoad during Agent::preload and EventLoaded after services
initialize so services can react to agent lifecycle
- introduce thread-safe BytecodeStore singleton for pending captures,
captured bytecode cache, and pending patches; replaces ad-hoc global
mutex/map pairs
- implement BytecodeService capture/patch listeners that operate on
the store; keep JVMTI Allocate outside of store locks and put failed
patches back so they can be retried
- add JNI bindings: getClassBytes(ByName), redefineClass(ByName),
retransformClass(ByName); use JVMTI GetLoadedClasses for name-based
lookup instead of JNI FindClass, validate array length vs declared
length in redefineClass
- add ServiceRegistry and JUICEAGENT_REGISTER_SERVICE macro so each
service self-registers at static init; initializeAll() no longer
includes concrete service headers
- move BytecodeService class entirely into its .cpp (no header needed,
only accessed via IService)
- split ClassFileLoadHook handling into captureBytecodes and
patchBytecodes listeners, registered in order
- introduce EventBus singleton wrapping eventpp::EventDispatcher with
typed event ids and const void* payloads
- post EventClassFileLoadHook from ClassFileLoadHook callback
- add IService base with typed listen<>() helper that binds a member
function directly to an event, no virtual onEvent dispatch
- add ServiceManager to register, initialize and shutdown services
- add BytecodeService that subscribes to ClassFileLoadHook
- wire Services::initializeAll() into Agent::init()
- Re-add addToBootstrap/SystemClassLoaderSearch, addToClassLoader, defineClass,
getLoadedClasses, getClassByName on the new Agent singleton
- Add utils.hpp with check_env/get_class_name helpers
- Pull utils.hpp into jni_common.hpp umbrella header
- Make runtime_dir optional in JuiceAgent.init (tolerate null jstring)
- Load config.toml into Agent and expose getConfig/setConfig
- Warn instead of failing when runtime directory or config is missing
- Replace eventbus/services with Agent preload/init lifecycle
- Move JNI header to shared includes; add jni_common.hpp umbrella header
- Reduce ClassFileLoadHook to a stub for later implementation
- Add eventpp dependency
- Document custom API JAR workflow (WIP)
- Move loader logic to core/ and rename plantform/ to platform/
- Remove config.toml parsing from loader; pass runtime_dir to Bootstrap directly
- Rewrite JvmAttach: RAII detach, drop dead thread_local, merge acquire helpers
- Fix initialize() missing namespace qualification
- Make GLOB sources pick up new files with CONFIGURE_DEPENDS
- Rename JNI class from InjectorNative to Injector in libinject.c
- Add JNI header for cn.xiaozhou233.juiceagent.injector.Injector
- Add inject-via-java-api example with HowToUse.txt and 如何使用.txt