带有throws子句的混淆方法 [英] Obfuscating method with throws clause
问题描述
我正在使用ProGuard混淆我的代码.我的项目由几个模块组成,每个模块都是独立的.
I'm using ProGuard to obfuscate my code. My project is comprised of a few modules, each obfuscated independently.
一个库包含一个接口;
One library includes an interface;
public interface IFace {
public int methodA(boolean b) throws CustomException;
}
另一个库提供了一个实现
Another library provides an implmentation
public class IFaceImpl implements IFace {
@Override
public int methodA(boolean b) throws CustomException {
return 0;
}
}
首先创建具有接口的库,然后针对混淆版本构建第二个库.不幸的是,由于接口没有throws子句,因此@Override
上的编译失败.
The library with the interface is built first, and the second is built against the obfuscated version. Unfortunately the compile fails on the @Override
as the interface does not have the throws clause.
我可以保护接口及其所有成员,但是我不知道如何保留throws子句.
I have proguard keeping the interface and all its members, but I can't figure out how to keep the throws clause.
推荐答案
我知道了.
-keepattributes Exceptions
这篇关于带有throws子句的混淆方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!