2011-03-25 91 views
1

在我的android應用程序中使用了jacorb.jar和CORBA接口。當我嘗試使用ProGuard混淆代碼我得到了很多的警告像這樣的:使用CORBA模糊Android應用程序

[proguard] Warning: org.jacorb.orb.standardInterceptors.SASComponentInterceptor: can't find referenced 
class org.ietf.jgss.Oid 

,並作爲結果:

[proguard] Warning: there were 1223 unresolved references to classes or interfaces. 
[proguard]   You may need to specify additional library jars (using '-libraryjars'), 
[proguard]   or perhaps the '-dontskipnonpubliclibraryclasses' option. 
[proguard] Warning: there were 33 unresolved references to program class member 
s. 
[proguard]   Your input classes appear to be inconsistent. 
[proguard]   You may need to recompile them and try again. 
[proguard]   Alternatively, you may have to specify the options 
[proguard]   '-dontskipnonpubliclibraryclasses' and/or 
[proguard]   '-dontskipnonpubliclibraryclassmembers'. 

我proguard.cfg:

-injars  bin/classes 
-outjars  bin/classes-processed.jar 
-libraryjars C:/android-sdk-windows/platforms/android-7/android.jar 
-libraryjars libs 

-dontpreverify 
-repackageclasses '' 
-allowaccessmodification 
-optimizations !code/simplification/arithmetic 
-keepattributes *Annotation* 
-dontskipnonpubliclibraryclasses 
-dontskipnonpubliclibraryclassmembers 
-dontnote 

-keep class com.android.vending.billing.** 

-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.view.View { 
    public <init>(android.content.Context); 
    public <init>(android.content.Context, android.util.AttributeSet); 
    public <init>(android.content.Context, android.util.AttributeSet, int); 
    public void set*(...); 
} 

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

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

-keepclassmembers class * implements android.os.Parcelable { 
    static android.os.Parcelable$Creator CREATOR; 
} 

-keepclassmembers class **.R$* { 
    public static <fields>; 
} 

如何糾正這些警告並建立工作apk文件?

回答

2

Cfr。 ProGuard manual > Troubleshooting > Warning: can't find superclass or interface.

Jacorb似乎依賴於JGSS,它不是Android運行時的一部分。理論上,JGSS應該被指定爲一個庫包。但是,由於您的應用程序在沒有JGSS的情況下運行良好,因此假設這部分代碼從未被使用是公平的。然後,您可以關閉警告:

-dontwarn org.ietf.jgss.** 

ProGuard不會再抱怨這些缺失的類並繼續處理代碼。在控制檯輸出中的總結表明有很多類可能類似。

+0

我添加了-dontwarn選項,我沒有在我的應用程序中實際使用所有類。但另一種警告仍然存在: '[proguard]警告:org.jacorb.imr.util.AddServerWindow:無法在類org.jacorb.imr.util.AddServerWindow中找到引用方法'void pack()' ' 這些類保存在libs/jacorb.jar中。 我使用 '-keepclasseswithmembers class org.jacorb。**' 但它不起作用。 – Ola 2011-03-26 08:28:47

+0

參考。 ProGuard手冊>故障排除>警告:找不到參考字段/方法。您是否嘗試過使用-dontskipnonpubliclibraryclasses(在舊版本的ProGuard中)或者-dontskipnonpubliclibraryclassmembers? – 2011-03-29 19:58:45

+0

我試圖單獨和一起使用這個選項(我在一個問題中寫了它)。如果我忽略這些警告(使用'-ignorewarnings'' -dontshrink'' -dontoptimize'選項)應用程序服務無法啓動。 – Ola 2011-03-30 08:13:39

相關問題