Skip to content

Commit

Permalink
发布3.2.0版本
Browse files Browse the repository at this point in the history
  • Loading branch information
xuexiangjys committed Aug 8, 2021
1 parent feb3be6 commit dfcb4fb
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 12 deletions.
33 changes: 29 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ allprojects {
dependencies {
...
// XPage
implementation 'com.github.xuexiangjys.XPage:xpage-lib:3.1.1'
annotationProcessor 'com.github.xuexiangjys.XPage:xpage-compiler:3.1.1'
implementation 'com.github.xuexiangjys.XPage:xpage-lib:3.2.0'
annotationProcessor 'com.github.xuexiangjys.XPage:xpage-compiler:3.2.0'
// ButterKnife的sdk
implementation 'com.jakewharton:butterknife:10.1.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
Expand Down Expand Up @@ -110,8 +110,8 @@ apply plugin: 'kotlin-kapt'
dependencies {
...
//XPage
implementation 'com.github.xuexiangjys.XPage:xpage-lib:3.1.1'
kapt 'com.github.xuexiangjys.XPage:xpage-compiler:3.1.1'
implementation 'com.github.xuexiangjys.XPage:xpage-lib:3.2.0'
kapt 'com.github.xuexiangjys.XPage:xpage-compiler:3.2.0'
//ButterKnife的sdk
implementation 'com.jakewharton:butterknife:10.1.0'
kapt 'com.jakewharton:butterknife-compiler:10.1.0'
Expand Down Expand Up @@ -367,6 +367,31 @@ if (tabAFragment != null) {

## 混淆配置

* 3.2.0及以上版本,使用的是gson进行序列化的,所以配置如下:

```
# gson
-keepattributes Signature
-keepattributes *Annotation*
-dontwarn sun.misc.**
-keep class com.google.gson.examples.android.model.** { <fields>; }
-keep class * extends com.google.gson.TypeAdapter
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer
-keepclassmembers,allowobfuscation class * {
@com.google.gson.annotations.SerializedName <fields>;
}
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
# xpage
-keep class com.xuexiang.xpage.annotation.** { *; }
-keep class com.xuexiang.xpage.config.** { *; }
```

* 3.1.1及以下版本,使用的是fastjson进行序列化的,所以配置如下:

```
# fastjson
-dontwarn com.alibaba.fastjson.**
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/com/xuexiang/xpagedemo/MyApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import android.app.Application;

import com.xuexiang.xpage.AutoPageConfiguration;
import com.xuexiang.xpage.PageConfig;
import com.xuexiang.xpage.base.XPageActivity;
import com.xuexiang.xrouter.launcher.XRouter;
Expand All @@ -25,7 +24,7 @@ public void onCreate() {
// //页面注册,默认不设置的话使用的就是自动注册
// .setPageConfiguration(new AutoPageConfiguration())
//开启调试
.debug("PageLog")
.debug(isDebug())
//设置默认的容器Activity
.setContainActivityClazz(XPageActivity.class)
//初始化页面配置
Expand Down
8 changes: 4 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ allprojects {
dependencies {
...
// XPage
implementation 'com.github.xuexiangjys.XPage:xpage-lib:3.1.1'
annotationProcessor 'com.github.xuexiangjys.XPage:xpage-compiler:3.1.1'
implementation 'com.github.xuexiangjys.XPage:xpage-lib:3.2.0'
annotationProcessor 'com.github.xuexiangjys.XPage:xpage-compiler:3.2.0'
// ButterKnife的sdk
implementation 'com.jakewharton:butterknife:10.1.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
Expand Down Expand Up @@ -76,8 +76,8 @@ apply plugin: 'kotlin-kapt'
dependencies {
...
//XPage
implementation 'com.github.xuexiangjys.XPage:xpage-lib:3.1.1'
kapt 'com.github.xuexiangjys.XPage:xpage-compiler:3.1.1'
implementation 'com.github.xuexiangjys.XPage:xpage-lib:3.2.0'
kapt 'com.github.xuexiangjys.XPage:xpage-compiler:3.2.0'
//ButterKnife的sdk
implementation 'com.jakewharton:butterknife:10.1.0'
kapt 'com.jakewharton:butterknife-compiler:10.1.0'
Expand Down
10 changes: 10 additions & 0 deletions xpage-lib/src/main/java/com/xuexiang/xpage/PageConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ public void init(Application application) {
initPages(application);
}

/**
* 设置是否打开调试
*
* @param isDebug 是否打开调试
*/
public PageConfig debug(boolean isDebug) {
PageLog.debug(isDebug);
return this;
}

/**
* 设置调试模式
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public static void setPriority(int priority) {
/**
* 设置是否打开调试
*
* @param isDebug
* @param isDebug 是否打开调试
*/
public static void debug(boolean isDebug) {
if (isDebug) {
Expand All @@ -114,7 +114,7 @@ public static void debug(boolean isDebug) {
/**
* 设置调试模式
*
* @param tag
* @param tag 日志标记
*/
public static void debug(String tag) {
if (!TextUtils.isEmpty(tag)) {
Expand Down

0 comments on commit dfcb4fb

Please sign in to comment.