基础混淆

模板是网上找的,因为又太多重复不是到谁是作者了,作者看到请给我留言,我会第一时间写上作者名

# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

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

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-------------------------------------------定制化区域----------------------------------------------
#---------------------------------1.实体类---------------------------------

#-keep class com.demo.test.Entity.** { *; }

#-------------------------------------------------------------------------

#---------------------------------2.第三方包-------------------------------
#butterknife
-keep public class * implements butterknife.Unbinder { public <init>(**, android.view.View); }
-keep class butterknife.*
-keepclasseswithmembernames class * { @butterknife.* <methods>; }
-keepclasseswithmembernames class * { @butterknife.* <fields>; }

#Gson
-keepattributes Signature
# For using GSON @Expose annotation
-keepattributes *Annotation*
# Gson specific classes
-dontwarn sun.misc.**
#-keep class com.google.gson.stream.** { *; }
# Application classes that will be serialized/deserialized over Gson
-keep class com.google.gson.examples.android.model.** { *; }
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer

#UtilCode
-keep class com.blankj.utilcode.* { *; }
-keepclassmembers class com.blankj.utilcode.* { *; }
-dontwarn com.blankj.utilcode.**

#BRVAH
-keep class com.chad.library.adapter.** {
*;
}
-keep public class * extends com.chad.library.adapter.base.BaseQuickAdapter
-keep public class * extends com.chad.library.adapter.base.BaseViewHolder
-keepclassmembers  class **$** extends com.chad.library.adapter.base.BaseViewHolder {
     <init>(...);
}

#leakcanary
-dontwarn com.squareup.haha.guava.**
-dontwarn com.squareup.haha.perflib.**
-dontwarn com.squareup.haha.trove.**
-dontwarn com.squareup.leakcanary.**
-keep class com.squareup.haha.** { *; }
-keep class com.squareup.leakcanary.** { *; }

# Marshmallow removed Notification.setLatestEventInfo()
-dontwarn android.app.Notification


#-------------------------------------------------------------------------

#---------------------------------3.与js互相调用的类------------------------



#-------------------------------------------------------------------------

#---------------------------------4.反射相关的类和方法-----------------------



#----------------------------------------------------------------------------
#---------------------------------5.V7 V4 design-----------------------------
# support-v4
-dontwarn android.support.v4.**
-keep class android.support.v4.app.** { *; }
-keep interface android.support.v4.app.** { *; }
-keep class android.support.v4.** { *; }

# support-v7
-dontwarn android.support.v7.**
-keep class android.support.v7.internal.** { *; }
-keep interface android.support.v7.internal.** { *; }
-keep class android.support.v7.** { *; }

# support design
-dontwarn android.support.design.**
-keep class android.support.design.** { *; }
-keep interface android.support.design.** { *; }
-keep public class android.support.design.R$* { *; }
#-----------------------------------------------------------------------------------------------------

#-------------------------------------------基本不用动区域--------------------------------------------
#---------------------------------基本指令区----------------------------------
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-dontpreverify
-verbose
-ignorewarnings
-printmapping proguardMapping.txt
-optimizations !code/simplification/cast,!field/*,!class/merging/*
-keepattributes *Annotation*,InnerClasses
-keepattributes Signature
-keepattributes SourceFile,LineNumberTable
#----------------------------------------------------------------------------

#---------------------------------默认保留区---------------------------------
-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 * extends android.view.View
-keep public class com.android.vending.licensing.ILicensingService
-keep class android.support.** {*;}

-keepclasseswithmembernames class * {
    native <methods>;
}
-keepclassmembers class * extends android.app.Activity{
    public void *(android.view.View);
}
-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}
-keep public class * extends android.view.View{
    *** get*();
    void set*(***);
    public <init>(android.content.Context);
    public <init>(android.content.Context, android.util.AttributeSet);
    public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet);
    public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keep class * implements android.os.Parcelable {
  public static final android.os.Parcelable$Creator *;
}
-keepclassmembers class * implements java.io.Serializable {
    static final long serialVersionUID;
    private static final java.io.ObjectStreamField[] serialPersistentFields;
    private void writeObject(java.io.ObjectOutputStream);
    private void readObject(java.io.ObjectInputStream);
    java.lang.Object writeReplace();
    java.lang.Object readResolve();
}
-keep class **.R$* {
 *;
}
-keepclassmembers class * {
    void *(**On*Event);
}
#----------------------------------------------------------------------------

#---------------------------------webview------------------------------------
-keepclassmembers class fqcn.of.javascript.interface.for.Webview {
   public *;
}
-keepclassmembers class * extends android.webkit.WebViewClient {
    public void *(android.webkit.WebView, java.lang.String, android.graphics.Bitmap);
    public boolean *(android.webkit.WebView, java.lang.String);
}
-keepclassmembers class * extends android.webkit.WebViewClient {
    public void *(android.webkit.WebView, jav.lang.String);
}
#----------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------

发布了4 篇原创文章 · 获赞 2 · 访问量 3113
展开阅读全文

android 混淆后所有的Adapter里个getview都空指针了

01-06

01-06 21:02:55.407: E/AndroidRuntime(1914): java.lang.NullPointerException 01-06 21:02:55.407: E/AndroidRuntime(1914): at fxyy.lx.gqj.a.af.getView(Unknown Source) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.widget.AbsListView.obtainView(AbsListView.java:2255) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.widget.ListView.measureHeightOfChildren(ListView.java:1263) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.widget.ListView.onMeasure(ListView.java:1175) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.view.View.measure(View.java:16505) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.widget.LinearLayout.measureVertical(LinearLayout.java:695) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.widget.LinearLayout.onMeasure(LinearLayout.java:588) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.view.View.measure(View.java:16505) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.widget.LinearLayout.measureVertical(LinearLayout.java:695) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.widget.LinearLayout.onMeasure(LinearLayout.java:588) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.view.View.measure(View.java:16505) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.view.View.measure(View.java:16505) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.widget.LinearLayout.measureVertical(LinearLayout.java:695) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.widget.LinearLayout.onMeasure(LinearLayout.java:588) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.view.View.measure(View.java:16505) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310) 01-06 21:02:55.407: E/AndroidRuntime(1914): at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2294) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.view.View.measure(View.java:16505) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.widget.LinearLayout.measureVertical(LinearLayout.java:695) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.widget.LinearLayout.onMeasure(LinearLayout.java:588) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.view.View.measure(View.java:16505) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.widget.LinearLayout.measureVertical(LinearLayout.java:695) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.widget.LinearLayout.onMeasure(LinearLayout.java:588) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.view.View.measure(View.java:16505) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.view.View.measure(View.java:16505) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.widget.LinearLayout.measureVertical(LinearLayout.java:695) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.widget.LinearLayout.onMeasure(LinearLayout.java:588) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.view.View.measure(View.java:16505) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310) 01-06 21:02:55.407: E/AndroidRuntime(1914): at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2294) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.view.View.measure(View.java:16505) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1912) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1109) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1291) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:996) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5600) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:771) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.view.Choreographer.doCallbacks(Choreographer.java:574) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.view.Choreographer.doFrame(Choreographer.java:544) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:757) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.os.Handler.handleCallback(Handler.java:733) 01-06 21:02:55.407: E/AndroidRuntime(1914): at android.os.Handler.dispatchMessage(Handler.java:95) 01-06 21:02:55.407: E/AndroidRuntime(1914): at a 各位前辈,请指教 问答

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 编程工作室 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览