Skip to content

Commit

Permalink
Update proguard rules.
Browse files Browse the repository at this point in the history
  • Loading branch information
chenenyu committed Nov 13, 2021
1 parent 69cc877 commit 73a9b14
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Sample/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ android {
buildTypes {
debug {
// 测试混淆
minifyEnabled false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
Expand Down
5 changes: 4 additions & 1 deletion Sample/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@
#-renamesourcefileattribute SourceFile

# Router
-keep class * implements com.chenenyu.router.template.ParamInjector
#-keep class * implements com.chenenyu.router.template.InterceptorTable
#-keep class * implements com.chenenyu.router.template.ParamInjector
#-keep class * implements com.chenenyu.router.template.RouteTable
#-keep class * implements com.chenenyu.router.template.TargetInterceptorsTable

2 changes: 1 addition & 1 deletion Sample/module1/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ android {
}

buildTypes {
release {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
requireActivity().finish();
});

Router.injectParams(Module1Fragment.this);
Router.injectParams(this);

Log.d(Module1Fragment.class.getSimpleName(), "test1=" + test1);
}
Expand Down
2 changes: 1 addition & 1 deletion Sample/module2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ android {
}

buildTypes {
release {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
Expand Down
4 changes: 4 additions & 0 deletions router/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@
#-renamesourcefileattribute SourceFile

# Router
-keep class * implements com.chenenyu.router.template.InterceptorTable
-keep class * implements com.chenenyu.router.template.ParamInjector
-keep class * implements com.chenenyu.router.template.RouteTable
-keep class * implements com.chenenyu.router.template.TargetInterceptorsTable
-keepnames class * extends androidx.fragment.app.Fragment

0 comments on commit 73a9b14

Please sign in to comment.