Git Product home page Git Product logo

atlas's Introduction

Atlas

Atlas is a plain-and-simple binary transformer for Java artifacts, providing a simple API to manipulate Jars as you see fit.

try (final Atlas atlas = new Atlas()) {
    atlas.install(ctx -> new JarEntryRemappingTransformer(
        new LorenzRemapper(mappings)
    ));
    atlas.run(Paths.get("input.jar"), Paths.get("output.jar"));
}

License

Atlas is made available under the Mozilla Public License 2.0, you can find a copy within Atlas' binary, or within this repository.

atlas's People

Contributors

denwav avatar jamierocks avatar minidigger avatar zml2008 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

atlas's Issues

Lambdas do not get remapped

When remapping a lambda, everything appears to get remapped properly except the name of the method to implement. (The invokedName parameter of LambdaMetafactory.metafactory.) This results in an AbstractMethodError when the lambda is called.

Concurrency issues

atlas has threading problems it seems. Its running into concurrent modification exceptions for getOrCreateClass on a mapping set
putting a synchronized(remapper) into the JarEntryRemappingTransformer solves it
was wondering why I was randomly missing classes, somewhere the exception gets eaten too

Possible to remove entries from a jar while transforming?

It doesn't seem to be possible to remove entries from a jar within a transformer as Atlas currently works -- would it be possible to allow this, by returning null out of a JarEntryTransformer or something similar?

This can allow stripping signature files or unnecessary libraries.

Cannot remap a group of files that depend on each other

So, I have a bunch of Minecraft mods that I need to remap. They might all inherit from eachother in unknown ways (Minecraft mods aren't exactly known for declaring their dependencies well.) I tried using for(...) atlas.use(path) followed by for(...) atlas.run(path, outPath) but that fails with an exception saying that a ZipFileSystem for that jar file already exists.

Cannot modify ASM api level without reflection

When attempting to transform a jar compiled with JDK 17, I get java.lang.UnsupportedOperationException: PermittedSubclasses requires ASM9.

This is due to Atlas using the constructor for ClassProviderInheritanceProvider without an API version:

new ClassProviderInheritanceProvider(new CompositeClassProvider(classpath))
, which defaults to ASM7: https://github.com/CadixDev/Bombe/blob/446e809ffce194eb70ae3f3f9bb7db4af63bf3de/bombe/src/main/java/org/cadixdev/bombe/analysis/asm/ClassProviderInheritanceProvider.java#L71

My temporary solution has been some ugly reflection:

atlas.install {
  // Replace the inheritance provider start
  val inheritanceProvider = AtlasTransformerContext::class.java.getDeclaredField("inheritanceProvider")
  inheritanceProvider.isAccessible = true
  val classProvider = ClassProviderInheritanceProvider::class.java.getDeclaredField("provider")
  classProvider.isAccessible = true
  inheritanceProvider.set(
    it,
    ClassProviderInheritanceProvider(
      Opcodes.ASM9,
      classProvider.get(inheritanceProvider.get(it)) as ClassProvider
    )
  )
  // Replace the inheritance provider end
  
  // return transformer to install...
}

Not sure if this should be fixed in Atlas or Bombe, so I am opening this issue. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.