Skip to content

Commit 5d8526a

Browse files
AriesHoo@126.comAriesHoo@126.com
AriesHoo@126.com
authored and
AriesHoo@126.com
committed
优化: 优化FastManager初始化init逻辑,FastLib自动初始化;解决多进程异常问题
优化: 将eventbus、bga-swipebacklayout、UIWidget:tab-layout 使用compileOnly开发者根据需要导入
1 parent 1eb4b39 commit 5d8526a

File tree

6 files changed

+24
-24
lines changed

6 files changed

+24
-24
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ Demo中使用到的网络请求api来源于[豆瓣API V2](https://developers.dou
4747

4848
## 重大更新日志 其它版本参看[Release](https://github.com/AriesHoo/FastLib/releases)
4949

50-
* 2.3.1
50+
* 2.3.2
5151

52-
* 优化: 优化FastManager初始化init逻辑,FastLib自动初始化
52+
* 优化: 优化FastManager初始化init逻辑,FastLib自动初始化解决多进程异常问题
5353
* 优化: 将eventbus、bga-swipebacklayout、UIWidget:tab-layout 使用compileOnly开发者根据需要导入
5454

5555
* 2.2.13
@@ -167,7 +167,7 @@ allprojects {
167167

168168
```
169169
dependencies {
170-
implementation 'com.github.AriesHoo:FastLib:2.3.1'
170+
implementation 'com.github.AriesHoo:FastLib:2.3.2'
171171
}
172172
```
173173

@@ -186,7 +186,7 @@ dependencies {
186186
<dependency>
187187
<groupId>com.github.AriesHoo</groupId>
188188
<artifactId>FastLib</artifactId>
189-
<version>2.3.1</version>
189+
<version>2.3.2</version>
190190
</dependency>
191191
```
192192

apk/sample.apk

82 Bytes
Binary file not shown.

apk/update

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"versionCode": 245,
3-
"versionName": "2.3.1",
2+
"versionCode": 246,
3+
"versionName": "2.3.2",
44
"url": "https://raw.githubusercontent.com/AriesHoo/FastLib/dev/apk/sample.apk",
55
"force": false,
66
"size": "3.74M",

app/build.gradle

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
apply plugin: 'com.android.application'
22

3-
def ext = rootProject.ext
43
android {
5-
compileSdkVersion ext.compileSdkVersion
4+
compileSdkVersion rootProject.compileSdkVersion
65
defaultConfig {
76
applicationId "com.aries.library.fast.demo"
8-
minSdkVersion ext.minSdkVersion
9-
targetSdkVersion ext.targetSdkVersion
10-
versionCode ext.versionCode
11-
versionName ext.versionName
7+
minSdkVersion rootProject.minSdkVersion
8+
targetSdkVersion rootProject.targetSdkVersion
9+
versionCode rootProject.versionCode
10+
versionName rootProject.versionName
1211
multiDexEnabled true
1312
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1413
buildConfigField "Boolean", "LOG_ENABALE", "true"
@@ -77,7 +76,7 @@ android {
7776
dependencies {
7877
implementation fileTree(include: ['*.jar'], dir: 'libs')
7978
implementation project(':library')
80-
// implementation 'com.github.AriesHoo:FastLib:2.3.1'
79+
// implementation 'com.github.AriesHoo:FastLib:2.3.2'
8180
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.3'
8281
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.3'
8382
testImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.3'

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ ext{
3232
targetSdkVersion = 28
3333
supportVersion = "1.0.0"
3434
widgetVersion = "3.2.24"
35-
versionCode = 245
36-
versionName = "2.3.1"
35+
versionCode = 246
36+
versionName = "2.3.2"
3737
}

library/src/main/java/com/aries/library/fast/FastManager.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,15 @@
4343
*/
4444
public class FastManager {
4545

46-
// 通过FastFileProvider进行初始化
47-
// static {
48-
// Application application = FastUtil.getApplication();
49-
// if (application != null) {
50-
// LoggerManager.i("FastManager", "initSuccess");
51-
// init(application);
52-
// }
53-
// }
46+
//原本在Provider中默认进行初始化,如果app出现多进程使用该模式可避免调用异常出现
47+
static {
48+
Application application = FastUtil.getApplication();
49+
if (application != null) {
50+
LoggerManager.i("FastManager", "initSuccess");
51+
init(application);
52+
}
53+
}
54+
5455
private static volatile FastManager sInstance;
5556

5657
private FastManager() {
@@ -136,7 +137,7 @@ public Application getApplication() {
136137
* @return
137138
*/
138139
static FastManager init(Application application) {
139-
LoggerManager.i("init");
140+
LoggerManager.i("init_mApplication:" + mApplication + ";application;" + application);
140141
//保证只执行一次初始化属性
141142
if (mApplication == null && application != null) {
142143
mApplication = application;

0 commit comments

Comments
 (0)