开发者

How to exclude .so files from proguard?

开发者 https://www.devze.com 2023-03-24 12:29 出处:网络
This is my current proguard config file for my Android project: -optimizationpasses 5 -dontusemixedcaseclassnames

This is my current proguard config file for my Android project:

-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-repackageclasses
-libraryjars "libs/**.so"
-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
-keep public class com.android.vending.licensing.ILicensingService

-keep public class com.scoreloop.** {*;}
-keep public class com.facebook.** {*;}
-keep public class com.google.ads.** {*;}

-keepclasseswithmembernames class * {
    native <methods>;
}

-ke开发者_开发百科epclasseswithmembernames class * {
    public <init>(android.content.Context, android.util.AttributeSet);
}

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

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

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

-assumenosideeffects class android.util.Log {
    public static *** i(...);
    public static *** v(...);
    public static *** d(...);
}

What would be the correct way to prevent Proguard from trying to mess with the shared objects? I'm currently getting an error as soon as I add them to my project, and try to export an application: You should check if you need to specify additional program jars. After I add the -libraryjars line it's giving me: java.io.IOException: Can't read [proguard.ClassPathEntry@56f0474c] (No such file or directory). How would I fix my Proguard config file?


Cfr. ProGuard manual > Troubleshooting

The console output above "You should check if you need to specify additional program jars." actually tells what is wrong.

0

精彩评论

暂无评论...
验证码 换一张
取 消