2016-02-19 101 views
3

最近,我使用SMP SDK - SAP技術爲Android構建了一個應用程序。出於安全原因,我不得不混淆開發應用程序的所有代碼&罐子。我試圖混淆所有的罐子,但我有以下錯誤。 尋找最好的方式來在沒有/使用progaurd的情況下以任何其他方式混淆整個應用程序。使用Proguard爲Android應用程序混淆SMP庫

[2016-02-19 16:28:58 - SMP_Bank_Project] Warning: com.sap.mobile.lib.request.DBWrapper: can't find referenced class com.sap.mobile.lib.persistence.PersistenceManagerImpl 
[2016-02-19 16:28:58 - SMP_Bank_Project] Warning: com.sap.mobile.lib.request.DBWrapper: can't find referenced class com.sap.mobile.lib.persistence.PersistenceManagerImpl 
[2016-02-19 16:28:58 - SMP_Bank_Project] Warning: com.sap.mobile.lib.request.DBWrapper: can't find referenced class com.sap.mobile.lib.persistence.dao.model.RequestSchema 
[2016-02-19 16:28:58 - SMP_Bank_Project] Warning: com.sap.mobile.lib.request.DBWrapper: can't find referenced class com.sap.mobile.lib.persistence.dao.model.RequestSchema 
[2016-02-19 16:28:58 - SMP_Bank_Project] Warning: com.sap.mobile.lib.request.DBWrapper: can't find referenced class com.sap.mobile.lib.persistence.PersistenceManagerImpl 
[2016-02-19 16:28:58 - SMP_Bank_Project] Warning: com.sap.mobile.lib.request.DBWrapper: can't find referenced class com.sap.mobile.lib.persistence.dao.model.RequestSchema 
[2016-02-19 16:28:58 - SMP_Bank_Project] Warning: com.sap.mobile.lib.request.DBWrapper: can't find referenced class com.sap.mobile.lib.persistence.dao.model.RequestSchema 
[2016-02-19 16:28:58 - SMP_Bank_Project] Warning: com.sap.mobile.lib.request.DBWrapper: can't find referenced class com.sap.mobile.lib.persistence.dao.model.RequestSchema 
[2016-02-19 16:28:58 - SMP_Bank_Project] Warning: com.sap.mobile.lib.request.DBWrapper: can't find referenced class com.sap.mobile.lib.persistence.dao.model.RequestSchema 
[2016-02-19 16:28:58 - SMP_Bank_Project] Warning: com.sap.mobile.lib.request.DBWrapper: can't find referenced class com.sap.mobile.lib.persistence.dao.model.RequestSchema 
[2016-02-19 16:28:58 - SMP_Bank_Project] Warning: com.sap.mobile.lib.request.DBWrapper: can't find referenced class com.sap.mobile.lib.persistence.PersistenceManagerImpl 
[2016-02-19 16:28:58 - SMP_Bank_Project] Warning: com.sap.mobile.lib.request.DBWrapper: can't find referenced class com.sap.mobile.lib.persistence.dao.model.RouteManagerSchema 
[2016-02-19 16:28:58 - SMP_Bank_Project] Warning: com.sap.mobile.lib.request.DBWrapper: can't find referenced class com.sap.mobile.lib.persistence.dao.model.RouteManagerSchema 
[2016-02-19 16:28:58 - SMP_Bank_Project] Warning: com.sap.mobile.lib.request.DBWrapper: can't find referenced class com.sap.mobile.lib.persistence.dao.model.RouteManagerSchema 
[2016-02-19 16:28:58 - SMP_Bank_Project] Warning: com.sap.mobile.lib.request.DBWrapper: can't find referenced class com.sap.mobile.lib.persistence.PersistenceManagerImpl 
[2016-02-19 16:28:58 - SMP_Bank_Project] Warning: com.sap.mobile.lib.request.DBWrapper: can't find referenced class com.sap.mobile.lib.persistence.PersistenceManagerImpl 
[2016-02-19 16:28:58 - SMP_Bank_Project] Warning: com.sap.mobile.lib.request.DBWrapper: can't find referenced class com.sap.mobile.lib.persistence.PersistenceManagerImpl 
[2016-02-19 16:28:58 - SMP_Bank_Project] Warning: com.sap.mobile.lib.request.DBWrapper: can't find referenced class com.sap.mobile.lib.persistence.PersistenceManagerImpl 
[2016-02-19 16:28:58 - SMP_Bank_Project] Warning: com.sap.mobile.lib.request.DBWrapper: can't find referenced class com.sap.mobile.lib.persistence.dao.model.IDbSchema 
[2016-02-19 16:28:58 - SMP_Bank_Project] Warning: com.sap.mobile.lib.request.DBWrapper: can't find referenced class com.sap.mobile.lib.persistence.dao.model.RequestSchema 
[2016-02-19 16:28:58 - SMP_Bank_Project] Warning: com.sap.smp.rest.AppSettings: can't find referenced class com.sybase.persistence.DataVault$DVPasswordPolicy 
[2016-02-19 16:28:58 - SMP_Bank_Project] Warning: com.sap.smp.rest.AppSettings: can't find referenced class com.sybase.persistence.DataVault$DVPasswordPolicy 
[2016-02-19 16:28:58 - SMP_Bank_Project] Warning: com.sap.smp.rest.AppSettings: can't find referenced class com.sybase.persistence.DataVault$DVPasswordPolicy 
[2016-02-19 16:28:58 - SMP_Bank_Project] Warning: com.sap.smp.rest.AppSettings: can't find referenced class com.sybase.persistence.DataVault 
[2016-02-19 16:28:58 - SMP_Bank_Project] Warning: com.sap.smp.rest.AppSettings: can't find referenced class com.sybase.persistence.DataVault$DVPasswordPolicy 
[2016-02-19 16:28:58 - SMP_Bank_Project] Warning: com.sap.smp.rest.AppSettings: [2016-02-19 16:28:58 - SMP_Bank_Project]  You should check if you need to specify additional program jars. 
[2016-02-19 16:28:58 - SMP_Bank_Project] Warning: there were 69 unresolved references to classes or interfaces. 
[2016-02-19 16:28:58 - SMP_Bank_Project]   You may need to specify additional library jars (using '-libraryjars'). 
[2016-02-19 16:28:58 - SMP_Bank_Project] java.io.IOException: Please correct the above warnings first. 
[2016-02-19 16:28:58 - SMP_Bank_Project] at proguard.Initializer.execute(Initializer.java:321) 
[2016-02-19 16:28:58 - SMP_Bank_Project] at proguard.ProGuard.initialize(ProGuard.java:211) 
[2016-02-19 16:28:58 - SMP_Bank_Project] at proguard.ProGuard.execute(ProGuard.java:86) 
[2016-02-19 16:28:58 - SMP_Bank_Project] at proguard.ProGuard.main(ProGuard.java:492) 

Progaurd.txt文件

# 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 *; 
#} 

-libraryjars ${external.libs.dir}:${libraryjarpath} 

-keep class com.sap.smp.** 
-dontwarn com.sap.smp.* 
-keep class com.sap.mobile.** 
-dontwarn com.sap.mobile.* 

-keep class com.sap.smp.rest.AppSettings.** 
-dontwarn com.sap.smp.rest.AppSettings.* 

-printmapping mapping.txt 

回答

0

試試這個保持com.sap包的所有類和它的子包。

-keep class com.sap.** { 
    public protected private *; 
} 
-dontwarn com.sap.** 
相關問題