changed the anthorize and update proguard
This commit is contained in:
@@ -44,6 +44,8 @@ android {
|
||||
}
|
||||
release {
|
||||
minifyEnabled false
|
||||
zipAlignEnabled false
|
||||
shrinkResources false
|
||||
signingConfig signingConfigs.release
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
|
||||
130
app/proguard-rules.pro
vendored
130
app/proguard-rules.pro
vendored
@@ -19,3 +19,133 @@
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
|
||||
#
|
||||
#-------------------------------------------基本不用动区域----------------------------------------------
|
||||
#
|
||||
#
|
||||
# -----------------------------基本 -----------------------------
|
||||
|
||||
# 指定代码的压缩级别 0 - 7(指定代码进行迭代优化的次数,在Android里面默认是5,这条指令也只有在可以优化时起作用。)
|
||||
-optimizationpasses 5
|
||||
# 混淆时不会产生形形色色的类名(混淆时不使用大小写混合类名)
|
||||
-dontusemixedcaseclassnames
|
||||
# 指定不去忽略非公共的库类(不跳过library中的非public的类)
|
||||
-dontskipnonpubliclibraryclasses
|
||||
# 指定不去忽略包可见的库类的成员
|
||||
-dontskipnonpubliclibraryclassmembers
|
||||
#不进行优化,建议使用此选项,
|
||||
-dontoptimize
|
||||
# 不进行预校验,Android不需要,可加快混淆速度。
|
||||
-dontpreverify
|
||||
|
||||
# 屏蔽警告,暂不开启。用于抛出异常
|
||||
#-ignorewarnings
|
||||
# 指定混淆是采用的算法,后面的参数是一个过滤器
|
||||
# 这个过滤器是谷歌推荐的算法,一般不做更改
|
||||
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
|
||||
# 保护代码中的Annotation不被混淆
|
||||
-keepattributes *Annotation*,InnerClasses,Signature,EnclosingMethod
|
||||
# 避免混淆泛型, 这在JSON实体映射时非常重要
|
||||
-keepattributes Signature
|
||||
# 抛出异常时保留代码行号
|
||||
-keepattributes SourceFile,LineNumberTable
|
||||
#优化时允许访问并修改有修饰符的类和类的成员,这可以提高优化步骤的结果。
|
||||
# 比如,当内联一个公共的getter方法时,这也可能需要外地公共访问。
|
||||
# 虽然java二进制规范不需要这个,要不然有的虚拟机处理这些代码会有问题。当有优化和使用-repackageclasses时才适用。
|
||||
#指示语:不能用这个指令处理库中的代码,因为有的类和类成员没有设计成public ,而在api中可能变成public
|
||||
-allowaccessmodification
|
||||
# 混淆时记录日志(打印混淆的详细信息)
|
||||
# 这句话能够使我们的项目混淆后产生映射文件
|
||||
# 包含有类名->混淆后类名的映射关系
|
||||
-verbose
|
||||
|
||||
|
||||
#
|
||||
# ----------------------------- 默认保留 -----------------------------
|
||||
#
|
||||
#----------------------------------------------------
|
||||
# 保持哪些类不被混淆
|
||||
#继承activity,application,service,broadcastReceiver,contentprovider....不进行混淆
|
||||
|
||||
-keep public class * extends android.app.Activity
|
||||
-keep public class * extends android.app.Fragment
|
||||
-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
|
||||
|
||||
-dontwarn android.support.design.**
|
||||
-keep public class android.support.design.R$* { *; }
|
||||
|
||||
-keepclasseswithmembernames class * {
|
||||
native <methods>;
|
||||
}
|
||||
|
||||
#这个主要是在layout 中写的onclick方法android:onclick="onClick",不进行混淆
|
||||
#表示不混淆Activity中参数是View的方法
|
||||
-keepclassmembers class * extends android.app.Activity{
|
||||
public void *(android.view.View);
|
||||
}
|
||||
#表示不混淆枚举中的values()和valueOf()方法
|
||||
-keepclassmembers enum * {
|
||||
public static **[] values();
|
||||
public static ** valueOf(java.lang.String);
|
||||
}
|
||||
|
||||
#表示不混淆任何一个View中的setXxx()和getXxx()方法,
|
||||
#因为属性动画需要有相应的setter和getter的方法实现,混淆了就无法工作了。
|
||||
-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);
|
||||
}
|
||||
|
||||
#表示不混淆Parcelable
|
||||
-keep class * implements android.os.Parcelable {
|
||||
public static final android.os.Parcelable *;
|
||||
}
|
||||
|
||||
# 这指定了继承Serizalizable的类的如下成员不被移除混淆
|
||||
-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();
|
||||
}
|
||||
|
||||
# 保留R下面的资源
|
||||
-keep class **.R$* {
|
||||
*;
|
||||
}
|
||||
|
||||
#不混淆资源类下static的
|
||||
-keepclassmembers class **.R$* {
|
||||
public static <fields>;
|
||||
}
|
||||
|
||||
# 对于带有回调函数的onXXEvent、**On*Listener的,不能被混淆
|
||||
-keepclassmembers class * {
|
||||
void *(**On*Event);
|
||||
void *(**On*Listener);
|
||||
}
|
||||
|
||||
#(可选)避免Log打印输出
|
||||
-assumenosideeffects class android.util.Log {
|
||||
public static *** v(...);
|
||||
public static *** d(...);
|
||||
public static *** i(...);
|
||||
public static *** w(...);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<shape>
|
||||
<corners android:bottomLeftRadius="@dimen/dp_30" />
|
||||
<gradient android:endColor="#805CC1FF" android:startColor="#803E7FFC" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape>
|
||||
<corners android:bottomLeftRadius="@dimen/dp_30" />
|
||||
<gradient android:endColor="#5CC1FF" android:startColor="#3E7FFC" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="@dimen/dp_30" />
|
||||
<gradient
|
||||
android:endColor="#3F4057"
|
||||
android:startColor="#50526E " />
|
||||
</shape>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<shape>
|
||||
<corners android:bottomRightRadius="@dimen/dp_30" />
|
||||
<gradient android:endColor="#803F4057" android:startColor="#8050526E" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape>
|
||||
<corners android:bottomRightRadius="@dimen/dp_30" />
|
||||
<gradient android:endColor="#3F4057" android:startColor="#50526E " />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:topLeftRadius="@dimen/dp_30" android:topRightRadius="@dimen/dp_30" />
|
||||
<gradient
|
||||
android:endColor="#2A2B38"
|
||||
android:startColor="#3F4057" />
|
||||
</shape>
|
||||
@@ -0,0 +1,210 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/clAuthorizeTopParent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#CC000000">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/clLoadingAuthorizeContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/dp_301"
|
||||
android:layout_marginTop="@dimen/dp_100"
|
||||
android:layout_marginRight="@dimen/dp_301"
|
||||
android:layout_marginBottom="@dimen/dp_100"
|
||||
android:background="@drawable/module_authorize_selector_dark_corner"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/clAuthorizeLoading"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivAuthorizeLoading"
|
||||
android:layout_width="@dimen/dp_147"
|
||||
android:layout_height="@dimen/dp_147"
|
||||
android:src="@mipmap/module_authorize_loading"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAuthorizeLoading"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_44"
|
||||
android:text="@string/module_authorize_agreement_loading"
|
||||
android:textColor="#99FFFFFF"
|
||||
android:textSize="@dimen/dp_44"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivAuthorizeLoading" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/clLoadingErrorContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/dp_301"
|
||||
android:layout_marginTop="@dimen/dp_100"
|
||||
android:layout_marginRight="@dimen/dp_301"
|
||||
android:layout_marginBottom="@dimen/dp_100"
|
||||
android:background="@drawable/module_authorize_selector_dark_corner"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAuthorizeLoadingError"
|
||||
android:layout_width="@dimen/dp_461"
|
||||
android:layout_height="@dimen/dp_97"
|
||||
android:layout_marginTop="@dimen/dp_33"
|
||||
android:background="@drawable/module_authorize_selector_blue_corner"
|
||||
android:gravity="center"
|
||||
android:text="@string/module_authorize_agreement_retry"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_44"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvAuthorizeLoadingError" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivAuthorizeLoadingError"
|
||||
android:layout_width="@dimen/dp_147"
|
||||
android:layout_height="@dimen/dp_147"
|
||||
android:layout_marginTop="@dimen/dp_254"
|
||||
android:src="@mipmap/module_authorize_loading_error"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAuthorizeLoadingError"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_33"
|
||||
android:text="@string/module_authorize_agreement_error"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_44"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivAuthorizeLoadingError" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/clAuthorizeContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/dp_301"
|
||||
android:layout_marginTop="@dimen/dp_110"
|
||||
android:layout_marginRight="@dimen/dp_301"
|
||||
android:layout_marginBottom="@dimen/dp_110"
|
||||
android:background="@drawable/module_authorize_selector_dark_corner"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAuthorizeAgree"
|
||||
android:layout_width="0px"
|
||||
android:layout_height="@dimen/dp_123"
|
||||
android:background="@drawable/module_authorize_selector_blue_left_corner"
|
||||
android:gravity="center"
|
||||
android:text="@string/module_authorize_agreement_agree"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_40"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintHorizontal_weight="1"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/btnAuthorizeDisAgree" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAuthorizeDisAgree"
|
||||
android:layout_width="0px"
|
||||
android:layout_height="@dimen/dp_123"
|
||||
android:background="@drawable/module_authorize_selector_dark_right_corner"
|
||||
android:gravity="center"
|
||||
android:text="@string/module_authorize_agreement_disagree"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_40"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintHorizontal_weight="1"
|
||||
app:layout_constraintLeft_toRightOf="@+id/btnAuthorizeAgree"
|
||||
app:layout_constraintRight_toRightOf="parent" />
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="0px"
|
||||
android:layout_height="0px"
|
||||
android:layout_marginBottom="@dimen/dp_139"
|
||||
android:scrollbarSize="@dimen/dp_442"
|
||||
android:layout_marginTop="@dimen/dp_139"
|
||||
android:scrollbarTrackHorizontal="@drawable/module_authorize_scrollbar"
|
||||
android:scrollbarThumbVertical="@drawable/module_authorize_scrollbar"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvAuthorizeTitle">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/dp_55"
|
||||
android:layout_marginRight="@dimen/dp_55"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAuthorizeContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:lineSpacingExtra="@dimen/dp_15"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_36" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAuthorizeButtonContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_36" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAuthorizeLastContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_36" />
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAuthorizeTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_62"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_55"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user