Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using ProGuard with Android.

I am trying to use ProGuard with Android. I have found several ProGuard scrips to use, with the following one being an example (I have found several others that are the same or very similar). However, when I try and run ProGuard using this script, I get the error:

"Expecting java type before ';' in line 23 of file ..."

I am completely new to ProGuard. Can someone explain what is going wrong here

Thanks.

-injars      bin(!.svn/**)
-outjars     obfuscated
-libraryjars C:\android-sdk_r04-windows\android-sdk-windows\platforms\android-1.6\android.jar
-libraryjars C:\GoogleAnalyticsAndroid_0.7\libGoogleAnalytics.jar

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

-printmapping proguard.map
-keepattributes SourceFile,LineNumberTable

-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.android.vending.licensing.ILicensingService

-keepclasseswithmembernames class * {
    native ;
}

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

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

-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}
like image 664
John Gaby Avatar asked Dec 06 '25 12:12

John Gaby


1 Answers

The problem is here:

native ;

Try changing it to:

native <methods>;
like image 111
finnw Avatar answered Dec 08 '25 01:12

finnw



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!