proguard 使 apk 完整并进行转储、映射、种子但不混淆

Posted

技术标签:

【中文标题】proguard 使 apk 完整并进行转储、映射、种子但不混淆【英文标题】:proguard make apk complete and make dump,mapping,seed but not obfuscating 【发布时间】:2017-06-10 04:03:30 【问题描述】:

Eclipse 版本

    我使用 proguard 所以输出 dump.txt mapping.txt seed.txt

    make APK 项目名称 -> 导出 -> android -> 导出 singned Android 应用

    输出 apk -> 反编译但不混淆

为什么不混淆?告诉我

来源

project.properties

proguard.config=proguard.cfg

proguard.cfg

# This is a configuration file for ProGuard.
# http://proguard.sourceforge.net/index.html#manual/usage.html


-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-verbose

# Optimization is turned off by default. Dex does not like code run
# through the ProGuard optimize and preverify steps (and performs some
# of these optimizations on its own).
-dontoptimize
-dontpreverify
# Note that if you want to enable optimization, you cannot just
# include optimization flags in your own project configuration file;
# instead you will need to point to the
# "proguard-android-optimize.txt" file instead of this one from your
# project.properties file.

-keepattributes *Annotation*
-keep public class com.google.vending.licensing.ILicensingService
-keep public class com.android.vending.licensing.ILicensingService

# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
-keepclasseswithmembernames class * 
    native <methods>;


# keep setters in Views so that animations can still work.
# see http://proguard.sourceforge.net/manual/examples.html#beans
-keepclassmembers public class * extends android.view.View 
   void set*(***);
   *** get*();


# We want to keep methods in Activity that could be used in the XML attribute onClick
-keepclassmembers class * extends android.app.Activity 
   public void *(android.view.View);


# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
-keepclassmembers enum * 
    public static **[] values();
    public static ** valueOf(java.lang.String);


-keepclassmembers class * implements android.os.Parcelable 
  public static final android.os.Parcelable$Creator CREATOR;


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


# The support library contains references to newer platform versions.
# Don't warn about those in case this app is linking against an older
# platform version.  We know about them, and they are safe.
-dontwarn android.support.**

# Understand the @Keep support annotation.
-keep class android.support.annotation.Keep

-keep @android.support.annotation.Keep class * *;

-keepclasseswithmembers class * 
    @android.support.annotation.Keep <methods>;


-keepclasseswithmembers class * 
    @android.support.annotation.Keep <fields>;


-keepclasseswithmembers class * 
    @android.support.annotation.Keep <init>(...);




-allowaccessmodification 
-repackageclasses ""



-dontshrink

# Retain declared checked exceptions for use by a Proxy instance.
-dontwarn org.w3c.dom.bootstrap.DOMImplementationRegistry

 

#################################################################################################
# My Code
-dontwarn android.support.v4.**
-dontwarn okio.**
-dontwarn com.squareup.okhttp.**
-dontwarn org.apache.**

 


 
 

【问题讨论】:

【参考方案1】:

Eclipse 仍在使用 ADT 而不是 Gradle 来导出 Android 应用程序。您可以在 Eclipse 中使用 Gradle,正如我在此处所述:https://***.com/a/47112271/5981535

【讨论】:

以上是关于proguard 使 apk 完整并进行转储、映射、种子但不混淆的主要内容,如果未能解决你的问题,请参考以下文章

Android Studio中的proguard映射文件在哪里[重复]

自动上传 ProGuard 映射文件到游戏控制台

Proguard 声称会混淆 .apk,但不会

Android Proguard混淆打包经验总结

如何对使用 ProGuard 混淆的 Android APK 进行逆向工程/反编译?

由于 proguard 规则,生成签名 APK 时出错