0
當我在Android上使用proguard時,在處理接口後發現proguard,throws接口方法被刪除。Proguard處理接口將刪除接口方法拋出
前:
public interface Factory {
Card create(Profile profile) throws CardException;
}
proguard-rules.pro:
-keep interface Factory { *; }
後:
public interface Factory {
Card create(Profile var1);
}
你可以看到,該方法的拋出被刪除。
我不知道優化,混淆器或縮小原因的原因。
如果CardException是你的自定義類,所以你也必須聲明它的ProGuard。 –
是的,我做過。 -keep public class * extends java.lang.Exception – Benjy
看到這個https://stackoverflow.com/questions/1115515/obfuscating-method-with-throws-clause -keepattributes異常 – ChillingVan