LoginSignup
10

More than 5 years have passed since last update.

特定のクラス・インタフェースだけを Proguard で難読化する

Last updated at Posted at 2013-04-07

proguard-project.txt では難読化したくないクラスを -keep オプションで除外していくようになっていますが、除外するクラスを全部確実に指定するのは結構大変で、難読化しちゃいけないクラスを難読化してトラブルことが多いです。

そこで、逆に特定のクラス「だけ」を難読化し、デフォルトは難読化しないようにすることができます。

-keep class !com.example.** { *; }
-keep interface !com.example.** { *; }

上記のようにすると、com.example.** 以外のものをすべて難読化除外します。"!" をつけているところがミソです。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10