前几天在网上看到有一个xml编辑的插件,做的挺好。但是pro版本要注册。下载了一个用着不错,功能挺多。最重要的是可以在Eclipse中使用。我现在连QQ都在Eclipse中使用了。
决定破解一下。找到了LicenseDialog,折腾了半天知道了使用的是RSA算法。昨晚在网上看到说超过1024bit,几乎就没有了破解的可能。决定放弃。找找别的办法。
BaseEditor.class中有一段
if(fPro && Config.LITE)
{
final Display display = XMLPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell().getDisplay();
final BaseEditor editor = this;
Thread thread = new Thread(new Runnable() {
public void run()
{
synchronized(this)
{
try
{
wait(1000L);
}
catch(InterruptedException _ex) { }
}
display.asyncExec(editor. new Runnable() {
public void run()
{
OkDialog okdialog = new OkDialog("License Reminder", "Sorry, this feature requires a PRO license.");
okdialog.open();
VersionAction.promptForLicense();
IWorkbenchPage iworkbenchpage = XMLPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
iworkbenchpage.closeEditor(editor, false);
}
// JavaClassFileOutputException: Invalid index accessing method local variables table of <init>
});
}
});
thread.start();
fPro肯定是true了,Config.LITE不能让他是true.看看Config怎么写的。
package com.objfac.xmleditor;
import java.lang.reflect.Field;
import java.util.Iterator;
import java.util.LinkedList;
// Referenced classes of package com.objfac.xmleditor:
// XMLPlugin
public class Config
{
/* member class not found */
class ConfigListener {}
public static final String VERSION = "2.0.11";
public static final String DELTA = "0";
public static final String eclipse = "e3.0M9";
public static final String SKU = "xp2.0.11M9";
public static boolean LITE = false;
public static final boolean FROZEN = false;
public static final boolean BETA = false;
public static final boolean SCHEMA_POOL = true;
public static final boolean DEBUG_DEPENDENCY_MANAGER = false;
private static LinkedList listeners;
public Config()
{
}
public static void set(int i)
{
try
{
Field field = com.objfac.xmleditor.Config.class.getDeclaredField("LITE");
field.set(null, i < 1 ? ((Object) (Boolean.FALSE)) : ((Object) (Boolean.TRUE)));
notifyListeners();
}
catch(Exception exception)
{
XMLPlugin.log(exception);
}
}
public static void add(ConfigListener configlistener)
{
if(listeners == null)
listeners = new LinkedList();
listeners.add(configlistener);
}
private static void notifyListeners()
{
if(listeners == null)
return;
for(Iterator iterator = listeners.iterator(); iterator.hasNext();)
try
{
ConfigListener configlistener = (ConfigListener)iterator.next();
configlistener.configChanged();
}
catch(Exception exception)
{
XMLPlugin.log(exception);
}
}
}
先将public static boolean LITE = true
改为public static boolean LITE = false
然后field.set(null, i < 1 ? ((Object) (Boolean.FALSE)) : ((Object) (Boolean.TRUE)));
改为field.set(null, i < 1 ? ((Object) (Boolean.FALSE)) : ((Object) (Boolean.FALSE)));
启动Eclipse,所有的限制都去掉了。
唉,看来java软件保护真是个问题。