Skip to content

Commit 7654e54

Browse files
committed
将混淆配置打包在aar中
1 parent c970207 commit 7654e54

File tree

5 files changed

+22
-23
lines changed

5 files changed

+22
-23
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ xUtils 包含了orm, http(s), image, view注解, 但依然很轻量级(251K),
2121
* 支持圆角, 圆形, 方形等裁剪, 支持自动旋转...
2222

2323
#### 4. `view注解`: view注解模块仅仅400多行代码却灵活的支持了各种View注入和事件绑定.
24-
* 事件注解支持且不受混淆影响...(参考sample的混淆配置)
24+
* 事件注解支持且不受混淆影响...([参考混淆配置](xutils/consumer-rules.pro))
2525
* 支持绑定拥有多个方法的listener
2626

2727
#### 使用Gradle构建时添加以下依赖即可:
2828
```javascript
29-
implementation 'org.xutils:xutils:3.8.11'
29+
implementation 'org.xutils:xutils:3.8.12'
3030
```
3131

3232
#### 混淆配置参考示例项目sample的配置

sample/proguard-rules.pro

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,4 @@
1414
# class:
1515
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
1616
# public *;
17-
#}
18-
19-
################### region for xUtils
20-
-keepattributes Signature,*Annotation*
21-
-keep public class org.xutils.** {
22-
public protected *;
23-
}
24-
-keep public interface org.xutils.** {
25-
public protected *;
26-
}
27-
-keepclassmembers class * extends org.xutils.** {
28-
public protected *;
29-
}
30-
-keepclassmembers @org.xutils.db.annotation.* class * {*;}
31-
-keepclassmembers @org.xutils.http.annotation.* class * {*;}
32-
-keepclassmembers class * {
33-
@org.xutils.view.annotation.Event <methods>;
34-
}
35-
#################### end region
17+
#}

sample/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
<string name="remove">移除</string>
66
<string name="stop">停止</string>
77
<string name="start">开始下载</string>
8-
<string name="test_download_url">http://dl.bintray.com/wyouflf/maven/org/xutils/xutils/3.8.11/xutils-3.8.11.aar</string>
8+
<string name="test_download_url">http://dl.bintray.com/wyouflf/maven/org/xutils/xutils/3.8.12/xutils-3.8.12.aar</string>
99
</resources>

xutils/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apply plugin: 'com.jfrog.bintray'
55
def siteUrl = 'https://github.com/wyouflf/xUtils3'
66
def gitUrl = 'https://github.com/wyouflf/xUtils3.git'
77
group = "org.xutils"
8-
version = "3.8.11"
8+
version = "3.8.12"
99

1010
android {
1111
compileSdkVersion 29
@@ -15,6 +15,8 @@ android {
1515
minSdkVersion 14
1616
versionCode 20200616
1717
versionName version
18+
19+
consumerProguardFiles "consumer-rules.pro"
1820
}
1921
buildTypes {
2022
debug {

xutils/consumer-rules.pro

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
-keepattributes Signature,*Annotation*
2+
-keep public class org.xutils.** {
3+
public protected *;
4+
}
5+
-keep public interface org.xutils.** {
6+
public protected *;
7+
}
8+
-keepclassmembers class * extends org.xutils.** {
9+
public protected *;
10+
}
11+
-keepclassmembers @org.xutils.db.annotation.* class * {*;}
12+
-keepclassmembers @org.xutils.http.annotation.* class * {*;}
13+
-keepclassmembers class * {
14+
@org.xutils.view.annotation.Event <methods>;
15+
}

0 commit comments

Comments
 (0)