2016-09-22 9 views
0

ProGuardでJavaプロジェクトを最適化/難読化しようとしています。 私はeclipseから実行可能なjarとしてプロジェクトを抽出しますが、うまく動作します。ProGuardでJavaコードの難読化に失敗しました

私はProGuardのでそれを圧縮しようとすると、私は最後に、特に、警告の数千人とエラーが出る:

Note: there were 1 classes trying to access generic signatures using reflection. 
     You should consider keeping the signature attributes 
     (using '-keepattributes Signature'). 

Note: there were 14 unresolved dynamic references to classes or interfaces. 
     You should check if you need to specify additional program jars. 
Note: there were 2 class casts of dynamically created class instances. 
     You might consider explicitly keeping the mentioned classes and/or 
     their implementations (using '-keep'). 

Note: there were 15 accesses to class members by means of introspection. 
     You should consider explicitly keeping the mentioned class members 
     (using '-keep' or '-keepclassmembers'). 

Warning: there were 13229 unresolved references to classes or interfaces. 
     You may need to add missing library jars or update their versions. 
     If your code works fine without the missing classes, you can suppress 
     the warnings with '-dontwarn' options. 
Warning: there were 61 instances of library classes depending on program classes. 
     You must avoid such dependencies, since the program classes will 
     be processed, while the library classes will remain unchanged. 
Warning: there were 18 unresolved references to program class members. 
     Your input classes appear to be inconsistent. 
     You may need to recompile the code. 

私は、プロジェクトで使用される外部LIBSが、それをエクスポートする時にjarファイルに追加されます日食から。 ( "jarファイルに必要なライブラリを展開する")。私はjarファイルを本当に遅くするので、 "jarファイルにrepack"オプションを使用しませんでした。

特にLIBSは、次のとおりです。

import org.apache.poi.ss.usermodel.Row; 
import org.apache.poi.ss.usermodel.Sheet; 
import org.apache.poi.ss.usermodel.Workbook; 
import org.apache.poi.ss.usermodel.WorkbookFactory; 
import org.apache.poi.xssf.usermodel.XSSFWorkbook; 

私はここでfondamentally何か間違ったことをやっていますか?

私はproguardの提案をうまく試していないし、私のコードは警告なしでEclipseでコンパイルします。

非常に大きなプロジェクトですので、私はMCVEを実際に提供することはできませんが、誰かが私の欠けているものについて正しい方向に向けることができれば、本当に感謝します。警告の

例:(それは一つ一つの方法のために行く)

http://pastebin.com/m9hX9LJA

明らかにこれは、しかし、私はいくつかの主要な明白なことをやっているかもしれない、あなたたちは修正するために、問題があまりにも一般的であるかもしれません私が実現していない間違い、それが私がこれで行っていることです。

答えて

0

メモは単なる提案ですが、警告は入力の不一致を指摘します。特に、13229の未解決の参照は、アプリケーションのメインコード(-injars)を提供していますが、ライブラリ(-injarsまたは-libraryjars)を提供していないことを示しています。私はEclipseのExtractまたはRepackオプションについてはわかりませんが、入力したjarファイルの内容を確認する必要があります。

ProGuardのマニュアル>トラブルシューティング>Warning: can't find referenced classを参照してください。

関連する問題