Skip to content

Commit 848ae15

Browse files
author
lemon
committed
add progurad rules
1 parent c0f00cc commit 848ae15

File tree

6 files changed

+56
-1
lines changed

6 files changed

+56
-1
lines changed
0 Bytes
Binary file not shown.

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,14 @@ You can set your policy according to the current page's url and the parameters y
102102
}
103103
```
104104

105+
4. Add the progurad rules to your file
106+
107+
```
108+
-keepclassmembers class tech.easily.easybridge.lib.EasyBridge{
109+
public *;
110+
}
111+
```
112+
105113
# <a name="README_CN">功能</a>
106114

107115
#### ✔️ 注入jsbridge添加重试机制
@@ -202,6 +210,14 @@ EasyBridge提供两种安全检查策略。其中全局的安全检查在EasyBri
202210
}
203211
```
204212

213+
4. 添加混淆规则:
214+
215+
```
216+
-keepclassmembers class tech.easily.easybridge.lib.EasyBridge{
217+
public *;
218+
}
219+
```
220+
205221
# EasyBridge
206222

207223
[EasyBridge](https://github.com/easilycoder/EasyBridge)是一个简单易用的js-bridge的工具库,提供了日常开发中,JavaScript与Java之间通讯的能力,与其他常见的js-bridge工具库实现方案不同,**EasyBridge**具备以下几个特点:

app/build.gradle

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,44 @@ android {
1616
versionName "1.0"
1717
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1818
}
19+
20+
signingConfigs {
21+
debug {
22+
storeFile file('keystore')
23+
storePassword "tech.easily"
24+
keyAlias "easybridge"
25+
keyPassword "tech.easily"
26+
}
27+
28+
release{
29+
storeFile file('keystore')
30+
storePassword "tech.easily"
31+
keyAlias "easybridge"
32+
keyPassword "tech.easily"
33+
}
34+
}
35+
36+
1937
buildTypes {
2038
release {
21-
minifyEnabled false
39+
shrinkResources true
40+
debuggable false
41+
zipAlignEnabled true
42+
minifyEnabled true
43+
signingConfig signingConfigs.release
2244
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2345
}
46+
47+
debug{
48+
signingConfig signingConfigs.debug
49+
zipAlignEnabled false
50+
minifyEnabled false
51+
shrinkResources false
52+
debuggable false
53+
}
2454
}
55+
56+
2557
}
2658

2759
dependencies {

app/keystore

2.03 KB
Binary file not shown.

app/proguard-rules.pro

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@
1919
# If you keep the line number information, uncomment this to
2020
# hide the original source file name.
2121
#-renamesourcefileattribute SourceFile
22+
-keepclassmembers class tech.easily.easybridge.lib.EasyBridge{
23+
public *;
24+
}

easybridge/proguard-rules.pro

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@
1919
# If you keep the line number information, uncomment this to
2020
# hide the original source file name.
2121
#-renamesourcefileattribute SourceFile
22+
23+
-keepclassmembers class tech.easily.easybridge.lib.EasyBridge{
24+
public *;
25+
}

0 commit comments

Comments
 (0)