mybatis破解教程

1、下载java字节码编辑器(jbe)
下载地址:http://download.csdn.net/detail/lanyu19950216/9465596

2、下载mybatis插件
下载地址:https://plugins.jetbrains.com/plugin/7293

3、解压出mybatis插件中mybatis_plus.jar中comseventh7mybatisserviceJavaService.class和comseventh7mybatisutilJavaUtils.class

4、运行jbe,使用jbe打开JavaService.class,找到Methods->stop,删除异常表,如图
mybatis-1.png

5、切换到Code Editor,删除原有代码,输入return,然后点击Save method保存
mybatis-2.png

6、JavaUtils.class修改方法同上,具体需要修改的代码及修改后的代码,请看http://blog.lanyus.com/archives/115.html

修改好的版本可以在这里下载

http://download.csdn.net/detail/lanyu19950216/9465573
http://download.csdn.net/detail/lanyu19950216/9465590

标签: none

已有 16 条评论

  1. 翅膀仔 翅膀仔

    stop那个方法是不是应该改成下面这样?
    aload_0
    iconst_1
    putfield com/seventh7/mybatis/service/JavaService/stopped Z
    goto 6
    astore_1
    return
    不然原有逻辑就变了(虽然没去深究原来逻辑的含义是什么...)

    不过总之感谢作者,深表佩服。

    1. @翅膀仔,从名字来看,这个的逻辑就是停止执行,所以猜测下直接return,结果命中了

      1. 翅膀仔 翅膀仔

        @ilanyu
        直接return的话没有修改那个全局变量,其他线程读取的时候认为还在执行,会不会触发什么bug?

        话说有没有批量把class反编译成java源码的工具,想研究看看他怎么实现的...

        1. @翅膀仔,jd-gui这个

        2. @翅膀仔

          应该是这样写的

          public void stop()
          {
          this.stopped = true; //是否已停止执行
          try
          {
          MybatisSetting.getInstance().setLicenseData(LicenseData.EMPTY); //清空授权数据
          }
          catch (IOException localIOException) {}
          }

  2. 翅膀仔 翅膀仔

    修改这两个文件之后发现这个插件有崩溃的bug,不知道是我自己的问题还是什么(按博主的写法和我自己的写法都试了,都会崩溃)。

    重现方法是,linux环境,添加这个插件,重启idea,关闭idea后,再打开。然后在spring项目中打开接口(interface)文件,就崩溃了。
    卸载mybatis后就没有这个问题。

    是只有我有还是有人也遇到了...
    找时间跟下这个问题...

    1. @翅膀仔

      下载我破解的和官方原版的都试试

      1. starlin starlin

        @ilanyu
        下了博主在csdn上的,也会有这样的情况

        1. @starlin
          原版呢

          1. starlin starlin

            @ilanyu
            原版的不会,不过只是退出一次,后面就好了

      2. starlin starlin

        @ilanyu
        更正下,博主的原版我理解的是正版了,理解错了
        csdn上的两个版本都试过了,第一次跳转的时候都会退出,后面再次跳转的时候就不会

    2. 翔妖除魔 翔妖除魔

      @翅膀仔
      我也遇到这个问题了. 我的是 Macos 上的 Idea2016.1

      Windows上好像没有问题.

    3. yangjy yangjy

      @翅膀仔我也遇到这个问题了。你后面是怎么处理?

  3. 乌鸦 乌鸦

    hello,用了你的版本,win10环境,2016版本,启动报错,然后生成代码时候报错如下:
    org/mybatis/generator/api/ShellCallback
    java.lang.NoClassDefFoundError: org/mybatis/generator/api/ShellCallback
    at com.seventh7.mybatis.generate0.RunGeneratorAction.actionPerformed(RunGeneratorAction.java:45)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:191)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter$1.run(ActionMenuItem.java:311)
    at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:958)
    at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:124)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:281)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:109)
    at com.intellij.ui.plaf.beg.BegMenuItemUI.a(BegMenuItemUI.java:513)
    at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:45)
    at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:533)
    at java.awt.Component.processMouseEvent(Component.java:6535)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
    at java.awt.Component.processEvent(Component.java:6300)
    at java.awt.Container.processEvent(Container.java:2236)
    at java.awt.Component.dispatchEventImpl(Component.java:4891)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Component.dispatchEvent(Component.java:4713)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
    at java.awt.Container.dispatchEventImpl(Container.java:2280)
    at java.awt.Window.dispatchEventImpl(Window.java:2750)
    at java.awt.Component.dispatchEvent(Component.java:4713)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at com.intellij.ide.IdeEventQueue.h(IdeEventQueue.java:857)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:654)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:386)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    Caused by: java.lang.ClassNotFoundException: org.mybatis.generator.api.ShellCallback PluginClassLoader[com.seventh7.plugin.mybatis, 2.7]
    at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:64)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 45 more

    1. @乌鸦
      java.lang.NoClassDefFoundError: org/mybatis/generator/api/ShellCallback
      不是写了错误信息了?
      等官方修复

  4. MR.X MR.X

    大大,2.92版本好像失效了,用这个方法破解的安装完毕重启的时候会报错

评论已关闭