Giter VIP home page Giter VIP logo

doidea-asm's Introduction

说明

使用 Javaagent + ASM 实现无侵入动态修改类方法。ASM 使用 JDK 自带的版本,无需引入其他依赖,大幅减小 jar 包文件大小。

可应用在 IDEA 启动时,未激活/未试用/试用到期状态下,自动去掉 Licenses(许可证)弹窗,达到【无限试用】的效果。

目前仅短期测试了以下版本正常使用,其他开发工具/版本请自行修改测试。

  • IDEA 2023.3.6
  • IDEA 2024.1.1
  • IDEA 2024.1.2

本项目仅供技术参考学习!有条件的请支持正版或申请优惠渠道!


使用

  1. 官网下载对应版本的 IDEA,建议下载压缩包版本
  2. 下载部署 Oracle JDK 17 / Open JDK 17 环境
  3. 下载配置 Maven 3.6.3 (或更高版本)
  4. git clone url 克隆项目到本地
  5. IDEA 打开项目(打开 doidea-asm 文件夹即可),Maven package 打包
  6. target 目录下的 doidea-asm-1.0.0.jar 为可用 jar 包,复制到一个目录,比如:E:\DevRes\doidea
  7. idea64.exe.vmoptions 添加以下 3 条配置,即可生效
    1. -javaagent:E:\DevRes\doidea\doidea-asm-1.0.0.jar
    2. --add-opens=java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED
    3. --add-opens=java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED

  • 在 XxxTransformer 类文件中 import jdk.internal.org.objectweb.asm.*; 可能会报错,但不影响 Maven package 打包
  • import jdk.internal.org.objectweb.asm.*; 这一行,按 Alt + Enter,选择 --add-exports java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED 添加到模块编译器选项,即可不报错
  • 也可以到 文件-设置-构建、执行、部署-编译器-Java编译器 最下方的 模块-编译选项 中手动配置

参考


doidea-asm's People

Contributors

m1yellow avatar

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.