程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> 編程綜合問答 >> windows-,有木有大神Android 工程引用jar後代碼混淆錯誤

windows-,有木有大神Android 工程引用jar後代碼混淆錯誤

編輯:編程綜合問答
,有木有大神Android 工程引用jar後代碼混淆錯誤

-injars bin\adpush_jar.jar
-outjars adpush_0330package_pro.jar

-libraryjars 'D:\資料\adt-bundle-windows-x86-20130219\sdk\platforms\android-17\android.jar'

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

-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

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

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

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

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

-keep public class com.ad.view.AdMain {
public static com.ad.view.AdMain getInstance(android.content.Context);
}

Also keep - Enumerations. Keep the special static methods that are required in

enumeration classes.

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

Keep names - Native method names. Keep all native class/method names.

-keepclasseswithmembers,allowshrinking class * {
native ;
}
以上是jar包裡的cfg裡的代碼

代碼混淆後出現 如下錯誤:

Proguard returned with error code 1. See console
[2015-06-30 17:12:30 - test6] java.io.IOException: Can't read D:\workspace\test6\libs\adpush.jar)
[2015-06-30 17:12:30 - test6] at proguard.InputReader.readInput(InputReader.java:230)
[2015-06-30 17:12:30 - test6] at proguard.InputReader.readInput(InputReader.java:200)
[2015-06-30 17:12:30 - test6] at proguard.InputReader.readInput(InputReader.java:178)
[2015-06-30 17:12:30 - test6] at proguard.InputReader.execute(InputReader.java:78)
[2015-06-30 17:12:30 - test6] at proguard.ProGuard.readInput(ProGuard.java:196)
[2015-06-30 17:12:30 - test6] at proguard.ProGuard.execute(ProGuard.java:78)
[2015-06-30 17:12:30 - test6] at proguard.ProGuard.main(ProGuard.java:492)
[2015-06-30 17:12:30 - test6] Caused by: java.io.IOException: Can't process class com/ad/control/y.class
[2015-06-30 17:12:30 - test6] at proguard.io.ClassReader.read(ClassReader.java:112)
[2015-06-30 17:12:30 - test6] at proguard.io.FilteredDataEntryReader.read(FilteredDataEntryReader.java:87)
[2015-06-30 17:12:30 - test6] at proguard.io.JarReader.read(JarReader.java:65)
[2015-06-30 17:12:30 - test6] at proguard.io.DirectoryPump.readFiles(DirectoryPump.java:65)
[2015-06-30 17:12:30 - test6] at proguard.io.DirectoryPump.pumpDataEntries(DirectoryPump.java:53)
[2015-06-30 17:12:30 - test6] at proguard.InputReader.readInput(InputReader.java:226)
[2015-06-30 17:12:30 - test6] ... 6 more
[2015-06-30 17:12:30 - test6] Caused by: java.lang.RuntimeException
[2015-06-30 17:12:30 - test6] at proguard.classfile.io.RuntimeDataInput.readUnsignedShort(RuntimeDataInput.java:196)
[2015-06-30 17:12:30 - test6] at proguard.classfile.io.ProgramClassReader.visitFullFrame(ProgramClassReader.java:655)
[2015-06-30 17:12:30 - test6] at proguard.classfile.attribute.preverification.FullFrame.accept(FullFrame.java:114)
[2015-06-30 17:12:30 - test6] at proguard.classfile.io.ProgramClassReader.visitStackMapTableAttribute(ProgramClassReader.java:452)
[2015-06-30 17:12:30 - test6] at proguard.classfile.attribute.preverification.StackMapTableAttribute.accept(StackMapTableAttribute.java:71)
[2015-06-30 17:12:30 - test6] at proguard.classfile.io.ProgramClassReader.visitCodeAttribute(ProgramClassReader.java:422)
[2015-06-30 17:12:30 - test6] at proguard.classfile.attribute.CodeAttribute.accept(CodeAttribute.java:101)
[2015-06-30 17:12:30 - test6] at proguard.classfile.io.ProgramClassReader.visitProgramMethod(ProgramClassReader.java:200)
[2015-06-30 17:12:30 - test6] at proguard.classfile.io.ProgramClassReader.visitProgramClass(ProgramClassReader.java:142)
[2015-06-30 17:12:30 - test6] at proguard.classfile.ProgramClass.accept(ProgramClass.java:346)
[2015-06-30 17:12:30 - test6] at proguard.io.ClassReader.read(ClassReader.java:91)
[2015-06-30 17:12:30 - test6] ... 11 more

最佳回答:


把-optimizationpasses 5 改成-optimizationpasses 1或2 ,超過2次,會報錯

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved