Skip to content

Commit 8eadee3

Browse files
committed
[update] 微博sdk升级到4.3.8 版本,发布新版本1.0.5
1 parent b5e7e74 commit 8eadee3

File tree

10 files changed

+31
-16
lines changed

10 files changed

+31
-16
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
![](http://cdn1.showjoy.com/shop/images/20180828/MLI1YQGFQLZBRO3VKH6U1535432744013.png)
55

6-
> 最新版本(1.0.1) Easier 、Lighter 、 More Business-Oriented
6+
> 最新版本(1.0.5) Easier 、Lighter 、 More Business-Oriented
77
88
以更简单、更轻量、更加面向业务需求为设计目标,提供 **微博****微信****QQ****Tim****QQ 轻聊版****钉钉** 的登陆分享功能支持;
99

@@ -15,7 +15,7 @@
1515

1616
<img style="margin-right:20px;height:20px" src="https://img.shields.io/circleci/project/github/badges/shields/master.svg"/>
1717

18-
<img style="margin-right:20px;height:20px" src="https://img.shields.io/badge/version-1.0.1-blue.svg?maxAge=2592000"/>
18+
<img style="margin-right:20px;height:20px" src="https://img.shields.io/badge/version-1.0.5-blue.svg?maxAge=2592000"/>
1919

2020
<img style="margin-right:20px;height:20px" src="https://img.shields.io/github/stars/chendongMarch/SocialSdkLibrary.svg"/>
2121

README_NO_PLUGIN.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
1010
```gradle
1111
// 依赖核心库
12-
implementation "com.zfy:social-sdk-core:1.0.1"
12+
implementation "com.zfy:social-sdk-core:1.0.4"
1313
// 依赖不同的平台库
14-
implementation "com.zfy:social-sdk-wx:1.0.1"
15-
implementation "com.zfy:social-sdk-dd:1.0.0"
16-
implementation "com.zfy:social-sdk-qq:1.0.0"
17-
implementation "com.zfy:social-sdk-wb:1.0.0"
14+
implementation "com.zfy:social-sdk-wx:1.0.2"
15+
implementation "com.zfy:social-sdk-dd:1.0.2"
16+
implementation "com.zfy:social-sdk-qq:1.0.2"
17+
implementation "com.zfy:social-sdk-wb:1.0.5"
1818
```
1919

2020
在代码中初始化:

SocialPlugin/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ publish {
2828
userOrg = 'zfy'
2929
groupId = 'com.zfy.social'
3030
artifactId = 'social-sdk-plugin'
31-
publishVersion = '1.0.3'
31+
publishVersion = '1.0.5'
3232
desc = 'SocialSdkPlugin'
3333
website = 'https://github.com/chendongMarch/SocialSdkLibrary'
3434
}

SocialPlugin/src/main/groovy/com.zfy.social.plugin/SocialPlugin.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,10 @@ class SocialPlugin implements Plugin<Project> {
135135
log "使用本地依赖,不使用远程依赖"
136136
return
137137
}
138-
def coreV = version(extension.core, "1.0.3")
138+
def coreV = version(extension.core, "1.0.4")
139139
def wxV = version(extension.wx, "1.0.2")
140140
def qqV = version(extension.qq, "1.0.2")
141-
def wbV = version(extension.wb, "1.0.2")
141+
def wbV = version(extension.wb, "1.0.5")
142142
def ddV = version(extension.dd, "1.0.2")
143143

144144
def coreLib = "com.zfy:social-sdk-core:${coreV}"

SocialSdkCore/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ publish {
1010
userOrg = 'zfy'
1111
groupId = 'com.zfy'
1212
artifactId = 'social-sdk-core'
13-
publishVersion = '1.0.3'
13+
publishVersion = '1.0.4'
1414
desc = 'SocialSdkCore'
1515
website = 'https://github.com/chendongMarch/SocialSdkLibrary'
1616
}

SocialSdkCore/src/main/java/com/zfy/social/core/manager/LoginManager.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import android.app.Activity;
44
import android.arch.lifecycle.Lifecycle;
55
import android.arch.lifecycle.LifecycleObserver;
6+
import android.arch.lifecycle.LifecycleOwner;
67
import android.arch.lifecycle.OnLifecycleEvent;
78
import android.content.Context;
89
import android.content.Intent;
@@ -46,6 +47,7 @@ public static void login(Activity act, int target, OnLoginStateListener listener
4647
*
4748
* @param act 发起登录的 activity
4849
* @param target 目标平台
50+
* @param obj 登录对象
4951
* @param listener 回调
5052
*/
5153
public static void login(Activity act, int target, LoginObj obj, OnLoginStateListener listener) {
@@ -145,6 +147,12 @@ private void preLogin(
145147
final LoginObj obj,
146148
final OnLoginStateListener listener) {
147149

150+
if (act instanceof LifecycleOwner) {
151+
Lifecycle lifecycle = ((LifecycleOwner) act).getLifecycle();
152+
if (lifecycle != null) {
153+
lifecycle.addObserver(this);
154+
}
155+
}
148156
listener.onState(act, LoginResult.stateOf(Result.STATE_START));
149157

150158
currentObj = obj;
@@ -154,7 +162,6 @@ private void preLogin(
154162
IPlatform platform = GlobalPlatform.newPlatformByTarget(act, target);
155163
GlobalPlatform.savePlatform(platform);
156164

157-
158165
if (target == Target.LOGIN_WX_SCAN) {
159166
wrapListener = new OnLoginListenerWrap(stateListener);
160167
GlobalPlatform.getCurrentPlatform().login(act, target, obj, wrapListener);

SocialSdkCore/src/main/java/com/zfy/social/core/manager/ShareManager.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,13 @@ private void preShare(
140140
final OnShareStateListener listener
141141
) {
142142

143+
if (act instanceof LifecycleOwner) {
144+
Lifecycle lifecycle = ((LifecycleOwner) act).getLifecycle();
145+
if (lifecycle != null) {
146+
lifecycle.addObserver(this);
147+
}
148+
}
149+
143150
listener.onState(act, ShareResult.startOf(shareTarget, currentObj));
144151

145152
if (cts != null) {
@@ -193,6 +200,7 @@ private void preDoShare(
193200
ShareObj shareObj,
194201
OnShareStateListener onShareListener
195202
) {
203+
196204
stateListener = onShareListener;
197205
try {
198206
ShareObjCheckUtil.checkShareObjParams(activity, shareTarget, shareObj);

SocialSdkCore/src/main/java/com/zfy/social/core/util/FileUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public static String mapResId2LocalPath(Context context, int resId) {
162162
}
163163

164164
public static File saveWxCode2File(byte[] buffer) throws IOException {
165-
File saveFile = new File(SocialSdk.opts().getCacheDir(), "code.jpg");
165+
File saveFile = new File(SocialSdk.opts().getCacheDir(), System.currentTimeMillis() + "_code.jpg");
166166
Bitmap bitmap = BitmapFactory.decodeByteArray(buffer, 0, buffer.length);
167167
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, new FileOutputStream(saveFile));
168168
BitmapUtil.recyclerBitmaps(bitmap);

SocialSdkWb/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ dependencies {
44
// compileOnly libs.social_core
55
compileOnly project(':SocialSdkCore')
66
compileOnly libs.appcompat_v7
7-
implementation 'com.sina.weibo.sdk:core:4.3.9:openDefaultRelease@aar' // 微博
7+
implementation 'com.sina.weibo.sdk:core:4.3.8:openDefaultRelease@aar' // 微博
88
}
99

1010
apply plugin: 'bintray-release'
1111
publish {
1212
userOrg = 'zfy'
1313
groupId = 'com.zfy'
1414
artifactId = 'social-sdk-weibo'
15-
publishVersion = '1.0.3'
15+
publishVersion = '1.0.5'
1616
desc = 'SocialSdkWb'
1717
website = 'https://github.com/chendongMarch/SocialSdkLibrary'
1818
}

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ buildscript {
99
jcenter()
1010
}
1111
dependencies {
12-
classpath 'com.zfy.social:social-sdk-plugin:1.0.3'
12+
classpath 'com.zfy.social:social-sdk-plugin:1.0.5'
1313
classpath 'com.android.tools.build:gradle:3.1.4'
1414
classpath 'com.novoda:bintray-release:0.8.1'
1515
}

0 commit comments

Comments
 (0)