I have a problem with obfuscation on card.io.

I'm changing the strings on strings.xml with the tags given on card.io official page and while I'm debugging, the app uses the changed strings. But when i export signed apk with proguard, the app uses its own strings. Could you help me? What am I missing?

This is my proguard.cfg content: (I use the sample app's proguard file.)

-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*

-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

-keepclasseswithmembernames class * {
    native <methods>;
}

-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.app.Activity {
   public void *(android.view.View);
}

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

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

-keep class io.card.** 
-keepclassmembers class io.card.** {
   *;
}

## Good practice so that you don't end up logging sensitive info.
# Remove debug, verbose, and info Log calls
-assumenosideeffects class android.util.Log {
    public static *** d(...);
    public static *** v(...);
    public static *** i(...);
    ## Uncomment to remove warnings and errors as well
    # public static *** w(...);
    # public static *** e(...);
}
有帮助吗?

解决方案

Jeff from card.io here.

card.io no longer supports the strings.xml file as of version 3.1.0+, because the SDK provides translations. Are you using the latest version?

If not, please download the latest SDK. You can either rely on the device language settings to automatically bring up the correct localizations, or force a locale with CardIOActivity.EXTRA_LANGUAGE_OR_LOCALE (see javadocs).

其他提示

To add to Jeff's response, if there's a problem with a translation, we'd like to fix it! Please file bugs here.

I've also updated the example app to remove the strings examples. Thanks for letting us know that it was out of date.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top