9

I would not obfuscate all my project but just the mostly key class. how to write the proguard file to exclude all project and obfuscate only a single class or a single package ?

Giuseppe
  • 281
  • 3
  • 7
  • What is the reason to obfuscate only 1 class/package? Calls to this class/package should be obfuscated too! – RvdK Aug 10 '12 at 08:30

1 Answers1

0

Please read the answer before downvote. You need ! before your class.

Take a look at Proguard Manual: Keep option part and Android example .

Example :

 -keeppackagenames com.vtcmobile {
    ! com.yourpackage.CategoryParser // keep package com.vtcmobile excluded class com.vtcmobile.CategoryParser
    }

Edit: Use

-keeppackagenames [package_filter] Specifies not to obfuscate the given package names. The optional filter is a comma-separated list of package names. Package names can contain ?, *, and ** wildcards, and they can be preceded by the ! negator. Only applicable when obfuscating.

Trung Nguyen
  • 7,442
  • 2
  • 45
  • 87