郑重声明,本文纯属技术交流讨论,请勿用于商业用途及传播非法信息!转帖请保留原创地址。
jar文件链接:
链接: https://pan.baidu.com/s/1ctXQaU 密码: cndm
charles-proxy-4.2.dmg 网盘链接:(强烈推荐官网下载!!!)
链接: https://pan.baidu.com/s/1gfF2sSj 密码: i4ai
一、修改
RegisterFrame里跟进注册的aEdk
public RegisterFrame(Frame paramFrame)
{
super(paramFrame, true);
setTitle("Register Charles");
this.tName = new JTextField(20);
this.tSerial = new JTextField(20);
this.bRegister = new JButton("Register");
this.bCancel = new JButton("Cancel");
Container localContainer;
(localContainer = getContentPane()).setLayout(new MigLayout("wrap,fill", "[label][fill,grow]"));
localContainer.add(new JLabel("Registered Name:"));
localContainer.add(this.tName);
localContainer.add(new JLabel("License Key:"));
localContainer.add(this.tSerial);
localContainer.add(this.bCancel, "tag cancel,split 2,span,center");
localContainer.add(this.bRegister, "tag ok");
this.bCancel.addActionListener(new TkzI(this));
this.bRegister.addActionListener(new aEdk(this));
基本的逻辑并未改变,还是从WNzU.OjEP(paramActionEvent, str)) != null判断
final class aEdk
implements ActionListener
{
aEdk(RegisterFrame paramRegisterFrame) {}
public final void actionPerformed(ActionEvent paramActionEvent)
{
paramActionEvent = RegisterFrame.OjEP(this.OjEP).getText().trim();
String str = RegisterFrame.wfpb(this.OjEP).getText().trim();
if ((paramActionEvent.length() > 0) && (str.length() > 0))
{
Object localObject;
if ((localObject = WNzU.OjEP(paramActionEvent, str)) != null)
{
ExtendedJOptionPane.OjEP(this.OjEP, localObject, "Charles Registration", 2);
return;
}
ExtendedJOptionPane.OjEP(this.OjEP, "Thank you for registering. Charles will now close. Please start Charles again to continue.", "Charles Registration", 1);
(localObject = CharlesContext.getInstance()).getConfiguration().getRegistrationConfiguration().setName(paramActionEvent);
((CharlesContext)localObject).getConfiguration().getRegistrationConfiguration().setKey(str);
((CharlesContext)localObject).exit(0, true);
}
}
}
继续跟进WNzU,找到关键函数OjEP。虽然函数return了null,但数据被wfpb更改。
public static String OjEP(String paramString1, String paramString2)
{
try
{
paramString1 = new WNzU(paramString1, paramString2);
}
catch (LicenseException localLicenseException)
{
return (paramString1 = localLicenseException).getMessage();
}
paramString1 = paramString1;
wfpb = paramString1;
return null;
}
跟进wfpb相关函数
private static void OjEP(WNzU paramWNzU)
{
wfpb = paramWNzU;
}
public static void wfpb()
{
WNzU localWNzU;
wfpb = localWNzU = new WNzU();
}
public static boolean OjEP()
{
WNzU localWNzU;
return (localWNzU = wfpb).DZZn;
}
public static String DZZn()
{
WNzU localWNzU = wfpb;
switch (TkzI.OjEP[localWNzU.tVok.ordinal()])
{
case 1:
return localWNzU.TVrM;
case 2:
return localWNzU.TVrM + " - Site License";
case 3:
return localWNzU.TVrM + " - Multi-Site License";
}
return localWNzU.TVrM;
}
很明显有个布尔型和String类型的,把他们改成true和自己的String。还有个String类型的DZZn,一并也修改了。
public static String DZZn()
{
WNzU localWNzU = wfpb;
switch (TkzI.OjEP[localWNzU.tVok.ordinal()])
{
case 1:
return localWNzU.TVrM;
case 2:
return localWNzU.TVrM + " - Site License";
case 3:
return localWNzU.TVrM + " - Multi-Site License";
}
return localWNzU.TVrM;
}
下面的工作就是修复一些问题防止编译出错。
例如:
String str = (str = str = paramString1).replaceAll("[�����������������������]", " ");
例如
LicenseException相关的异常
二、重新编译
然后反编译成class,这里需要指定目录,因为WNzU是在com.xk72.charles包中。直接单独的文件编译时会报错,所以得指定package包的目录。
例如:
$ javac -cp /Users/johnhao/Downloads/charles-1 /Users/johnhao/Downloads/charles/WNzU.java
将class文件更新到jar包中。同样要注意目录问题,因为WNzU class是在目录com/xk72/charles/中,所以得在当前目录下创建一样的结构,防止把新的class更新到根目录下。
jar uf charles.jar com/xk72/charles/WNzU.class
三、替换原jar文件
应用 -> 显示包内容 -> Contents -> Java,或者直接到目录/Applications/Charles.app/Contents/Java/。替换掉即可用。第二次做练习,下次就直接贴jar文件了。
关注获取更多内容
网友评论