版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_39800144/article/details/100525139
本文介绍:jad,sc的使用
5.jad反编译
可以使用jad反编译class文件,中文字符会被编解码。 这里以com.runlion.fsp.credit.service.impl包下为例NCSourceServiceImpl类为例: 我们可以看到整个类的ClassLoader,从哪里加载的,以及类的完整信息;
代码语言:javascript复制$ jad com.runlion.fsp.credit.service.impl.NCSourceServiceImpl
代码语言:javascript复制$ jad com.runlion.fsp.credit.service.impl.NCSourceServiceImpl
ClassLoader:
-org.springframework.boot.loader.LaunchedURLClassLoader@681a9515
-sun.misc.Launcher$AppClassLoader@70dea4e
-sun.misc.Launcher$ExtClassLoader@30f39991
Location:
file:/home/fsp/servers/credit-web-1.0-RELEASE.jar!/BOOT-INF/classes!/
/*
* Decompiled with CFR 0_132.
*
* Could not load the following classes:
* com.alibaba.fastjson.JSON
省略。。。。。。
* org.springframework.stereotype.Service
*/
package com.runlion.fsp.credit.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
省略。。。。。。
import org.springframework.stereotype.Service;
@Service(value="nCSourceServiceImpl")
public class NCSourceServiceImpl
implements NCSourceService {
private static final Logger log = LoggerFactory.getLogger(NCSourceServiceImpl.class);
@Value(value="${nc.credit.queryYearDiscount.address}")
private String queryYearDiscountAddress;
@Value(value="${nc.credit.queryYearDiscount.method}")
private String queryYearDiscountMethod;
@Value(value="${nc.credit.querySupplierCorpCredit.address}")
private String querySupplierCorpCredit;
@Value(value="${nc.credit.querySupplierAllCorpCredit.address}")
private String querySupplierAllCorpCredit;
public BigDecimal getDealNoBackMnyFromNC(String custcode, String companycode) {
log.info("u3010u6388u4fe1u8c03u7528NCu67e5u8be2u7d2fu8ba1u672au9000u91d1u989du3011u4eceNCu83b7u53d6u7ecfu9500u5546u7d2fu8ba1u672au9000u91d1u989d,u5165u53c2u4e3acustcode=" custcode ",companycode=" companycode ",u5730u5740u4e3auff1a" this.queryYearDiscountAddress);
OMElement omElement = null;
BigDecimal noBackMny = BigDecimal.ZERO;
try {
ServiceClient serviceClient = new ServiceClient();
String url = this.queryYearDiscountAddress;
EndpointReference targetEPR = new EndpointReference(url);
省略。。。。。。
6.sc 查看
使用sc命令查看一个类的加载情况
代码语言:javascript复制$ sc com.runlion.fsp.credit.controller.web.CreditController
com.runlion.fsp.credit.controller.web.CreditController
Affect(row-cnt:1) cost in 10 ms.
$
输出当前类的详细信息,包括这个类所加载的原始文件来源、类的声明、加载的ClassLoader等详细信息。
代码语言:javascript复制$ sc -d com.runlion.fsp.credit.controller.web.CreditController
class-info com.runlion.fsp.credit.controller.web.CreditController
code-source file:/home/fsp/servers/credit-web-1.0-RELEASE.jar!/BOOT-INF/classes!/
name com.runlion.fsp.credit.controller.web.CreditController
isInterface false
isAnnotation false
isEnum false
isAnonymousClass false
isArray false
isLocalClass false
isMemberClass false
isPrimitive false
isSynthetic false
simple-name CreditController
modifier public
annotation org.springframework.web.bind.annotation.RestController,org.springframework.web.bind.annotation.RequestMapping
interfaces
super-class -java.lang.Object
class-loader -org.springframework.boot.loader.LaunchedURLClassLoader@681a9515
-sun.misc.Launcher$AppClassLoader@70dea4e
-sun.misc.Launcher$ExtClassLoader@30f39991
classLoaderHash 681a9515
Affect(row-cnt:1) cost in 13 ms.