How to hide final public Static in proguard?

Asked

Viewed 112 times

0

I have the following class

package br.com.app1.urls;

public class Urlapp {

public static final String URL_LOGAR ="url/login";

public static final String URL_CADASTRAR_INCIDENTES ="url/incidentes";

}

would like to know how to configure in proguard not to display url

My proguard is like this

-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontwarn android.support.**
-verbose

-dontoptimize
-dontpreverify


-keepattributes *Annotation*
-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 com.google.vending.licensing.ILicensingService
-keep public class com.android.vending.licensing.ILicensingService
-keep public class * extends android.support.v4.app.Fragment
-keep public class * extends android.app.Fragment

-keep class br.com.patrulhar.WS_JSON.Const { public static *; }

-keepclasseswithmembernames class * {
    native <methods>;
}

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

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

 -keepclassmembers public class * extends android.view.View {
  void set*(***);
  *** get*();
 }

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

-keep class * implements android.os.Parcelable {
    *;
}

-keep class * implements android.os.Parcelable {
  public static final android.os.Parcelable$Creator *;
}

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

1 answer

0

William,

I didn’t want to give you that answer but it’s true. Proguard, at least for now, nay obfuscate Strings (constants) as they exist in your code and the statement is in the Proguard FAQ:

Does Proguard Encrypt string constants? No.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.