0

I have an android project uses SQLCipher. I want to obfuscate it using proguard. It works When using -dontobfuscate. Otherwise I get the error: NoClassDefFoundError for sqlCipher. But I want to Obfuscate. My conf consists -dontobfuscate keyword now. It works but it doesnt use obfuscation. How can I do that ?

Thank you all for helping...

-Here is my conf:

-injars      bin/classes
-injars      libs
-outjars     bin/classes-processed.jar

-dontpreverify
-repackageclasses ''
-allowaccessmodification
-optimizationpasses 5
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*,!code/allocation/variable
-keepattributes *Annotation*

-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-verbose
-dontpreverify   

-keep public class net.sqlcipher.** {*;}    
-keep public class net.sqlcipher.database.** {*;}


-keep class javax.**  { *; }
-keep class org.**  { *; }
-keep class twitter4j.**  { *; }
-keep class java.lang.management.**  { *; }
-keep class com.google.code.**  { *; }
-keep class oauth.signpost.**  { *; }


-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider

-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService

-keep public class * extends android.view.View {
    public <init>(android.content.Context);
    public <init>(android.content.Context, android.util.AttributeSet);
    public <init>(android.content.Context, android.util.AttributeSet, int);
    public void set*(...);
}

-keep public class * extends android.app.Fragment
-keep public class * extends android.support.v4.Fragment

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet);
}

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet, int);
}

-keepclassmembers class * extends android.content.Context {
   public void *(android.view.View);
   public void *(android.view.MenuItem);
}

-keepclassmembers class * implements android.os.Parcelable {
    static ** CREATOR;
}

-keepclassmembers class **.R$* {
    public static <fields>;
}

-keepclassmembers class * {
    @android.webkit.JavascriptInterface <methods>;
}

-keepclassmembers enum * {
    public static **[] values();
      public static ** valueOf(java.lang.String);
  }


-keep class * extends java.util.ListResourceBundle {
    protected Object[][] getContents();
}

-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
    public static final *** NULL;
}

-keepnames @com.google.android.gms.common.annotation.KeepName class *
-keepclassmembernames class * {
    @com.google.android.gms.common.annotation.KeepName *;
}

-dontwarn android.support.**
-dontwarn **CompatHoneycomb

*EDITED: It works by removing public *

 -keep class net.sqlcipher.** {
    *;
}
Gamze Sezginoğlu
  • 181
  • 1
  • 1
  • 4
  • I'm confused. You want to enable obfuscation (i.e. remove `-dontobfuscate`) or why do you have the "*do not* obfuscate" option active? – zapl Feb 25 '14 at 08:27
  • When I remove it, log gives me error: NoclassdefError for sqlcipher. Thats what i am lookin for the hint: it is gonna work when i remove it. But you re right that I removed it from the question not to confuse anyone more... – Gamze Sezginoğlu Feb 25 '14 at 08:31
  • Ok so the problem you try to solve is that NoClassDefError, turn obfuscation back on and add the error to your question. – zapl Feb 25 '14 at 08:40

1 Answers1

0

The syntax is

-keep class

You should not have keep public

rds
  • 26,253
  • 19
  • 107
  • 134