混淆是这样子的# To enable ProGuard in your project, edit project.properties # to define the proguard.config property as described in that file. # # Add project specific ProGuard rules here. # By default, the flags in this file are appended to flags specified # in ${sdk.dir}/tools/proguard/proguard-android.txt # You can edit the include path and order by changing the ProGuard # include property in project.properties. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html# Add any project specific keep options here:# If your project uses WebView with JS, uncomment the following # and specify the fully qualified class name to the JavaScript interface # class: -keepclassmembers class fqcn.of.javascript.interface.for.webview { public *; }#youmi -libraryjars libs/YoumiSdk_v4.09_2014-06-16.jar -dontwarn net.youmi.android.** -keep class net.youmi.android.** { *; }#waps -libraryjars libs/AppOffer_2.2.0.jar -keep public class cn.waps.** {*;} -keep public interface cn.waps.** {*;} -dontwarn cn.waps.**#domob -libraryjars libs/dm_offer_wall2.1.3.jar -dontwarn cn.dm.** -keep class cn.dm.** { *; } -keep class cn.dm.android.ui.interaction.** {*;} -keepattributes *Annotation*#dianjoy -libraryjars libs/dlnetwork_v3.5.0.jar -dontwarn com.dlnetwork.** -keep class **.R$* { *; }#miidi -libraryjars libs/miidiad_android_wall_2_4_2.jar -keep public class net.miidiwall.SDK.** { *; }#winads -libraryjars libs/winads-offer-sdk.jar -keep public class com.winad.android.offers.** { *; } -keep public class com.baidu.location.** { *; }#mopan -libraryjars libs/mpad_wall_sdk_1_1_2.jar -keep class com.imopan.mpwall.** { *; }#umeng -libraryjars libs/umeng-analytics-v5.2.4.jar -keepclassmembers class * { public <init>(org.json.JSONObject); } -keepclassmembers enum * { public static **[] values(); public static ** valueOf(java.lang.String); } -keep public class com.appimc.money.R$*{ public static final int *; } Android本身的类不是默认就不混淆的吗?
java.io.IOException: Can't read [/home/plato/adt-linux/sdk/platforms/android-19/android.jar] (Can't process class [android/opengl/Visibility.class]你的问题主要是在这里,不能读取 android.jar, 你是使用什么工具进行混淆的, android tool 还是 ant 或者什么?
就是自带的啊。直接在proguard-project.txt写的。
你把这几个加进去看看-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
我是直接在adt里export出apk来。
-keep public class android.opengl.** {*;}再加一个这个,试试呢?
-keep public class android.opengl.** {*;}
混淆是这样子的# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html# Add any project specific keep options here:# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
-keepclassmembers class fqcn.of.javascript.interface.for.webview {
public *;
}#youmi
-libraryjars libs/YoumiSdk_v4.09_2014-06-16.jar
-dontwarn net.youmi.android.**
-keep class net.youmi.android.** {
*;
}#waps
-libraryjars libs/AppOffer_2.2.0.jar
-keep public class cn.waps.** {*;}
-keep public interface cn.waps.** {*;}
-dontwarn cn.waps.**#domob
-libraryjars libs/dm_offer_wall2.1.3.jar
-dontwarn cn.dm.**
-keep class cn.dm.** { *; }
-keep class cn.dm.android.ui.interaction.** {*;}
-keepattributes *Annotation*#dianjoy
-libraryjars libs/dlnetwork_v3.5.0.jar
-dontwarn com.dlnetwork.**
-keep class **.R$* { *;
}#miidi
-libraryjars libs/miidiad_android_wall_2_4_2.jar
-keep public class net.miidiwall.SDK.** {
*;
}#winads
-libraryjars libs/winads-offer-sdk.jar
-keep public class com.winad.android.offers.** {
*;
}
-keep public class com.baidu.location.** {
*;
}#mopan
-libraryjars libs/mpad_wall_sdk_1_1_2.jar
-keep class com.imopan.mpwall.** {
*;
}#umeng
-libraryjars libs/umeng-analytics-v5.2.4.jar
-keepclassmembers class * {
public <init>(org.json.JSONObject);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep public class com.appimc.money.R$*{
public static final int *;
}
Android本身的类不是默认就不混淆的吗?
我之前加了外部jar都没问题的,不知道什么时候开始不行了。
就是自带的啊。直接在proguard-project.txt写的。
-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
我是直接在adt里export出apk来。
有没有可能跟这个有关系,我这个工程应用了一个新浪微博的SDK工程(不是jar),他这个库工程里面有jar的。
这种形式处理下呢
这个也加了也不行。还有我刚才把新浪微博那个SDK demo也加了混淆,它demo里没有任何混淆代码,所以可以看出,它赢告不用混淆,所以不是新浪sdk的问题。
我吧这个proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 注释掉,就不报错了/