Skip to content

Instantly share code, notes, and snippets.

View henri-tremblay's full-sized avatar

Henri Tremblay henri-tremblay

View GitHub Profile
@raphw
raphw / WeakeningAgent.java
Last active January 23, 2021 11:40
A Java agent for fixing exports for an app that is not yet Java 9 aware.
import java.lang.instrument.Instrumentation;
import java.lang.reflect.Layer;
import java.lang.reflect.Module;
import java.util.*;
public class WeakeningAgent {
public static void premain(String argument, Instrumentation instrumentation) {
boolean full = argument != null && argument.equals("full");
Set<Module> importing = new HashSet<>(), exporting = new HashSet<>();