Skip to content

Commit 16ddce5

Browse files
committed
update gradle
1 parent 1251903 commit 16ddce5

File tree

10 files changed

+22
-112
lines changed

10 files changed

+22
-112
lines changed

UpdateLog.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
2017.12.05 支持使用网络图片作为参数,内置下载功能。

build.gradle

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,10 @@ apply plugin: 'com.android.library'
22

33
android {
44
compileSdkVersion 25
5-
// 升级到 gradle3.0 不需要使用buildToolsVersion
6-
// buildToolsVersion 25
7-
5+
buildToolsVersion '25.3.0'
86
defaultConfig {
97
minSdkVersion 15
10-
targetSdkVersion 25
11-
versionCode 1
12-
versionName "1.0"
13-
// 占位
8+
targetSdkVersion 23
149
manifestPlaceholders.qq_id = "1104910200"
1510
}
1611

src/main/java/com/march/socialsdk/SocialSdk.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public static void init(SocialSdkConfig config) {
2828
sSocialSdkConfig = config;
2929
}
3030

31-
3231
public static IJsonAdapter getJsonAdapter() {
3332
if (sJsonAdapter == null) {
3433
throw new IllegalStateException("为了不引入其他的json解析依赖,特地将这部分放出去,必须添加一个对应的 json 解析工具,参考代码 sample/GsonJsonAdapter.java");

src/main/java/com/march/socialsdk/helper/IntentShareHelper.java

Lines changed: 0 additions & 83 deletions
This file was deleted.

src/main/java/com/march/socialsdk/manager/LoginManager.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import android.content.Intent;
66

77
import com.march.socialsdk.exception.SocialException;
8-
import com.march.socialsdk.utils.AuthTokenKeeper;
8+
import com.march.socialsdk.utils.TokenStoreUtils;
99
import com.march.socialsdk.utils.LogUtils;
1010
import com.march.socialsdk.listener.OnLoginListener;
1111
import com.march.socialsdk.model.LoginResult;
@@ -105,12 +105,12 @@ public void onFailure(SocialException e) {
105105
}
106106

107107
public static void clearAllToken(Context context) {
108-
AuthTokenKeeper.clearToken(context, Target.LOGIN_QQ);
109-
AuthTokenKeeper.clearToken(context, Target.LOGIN_WX);
110-
AuthTokenKeeper.clearToken(context, Target.LOGIN_WB);
108+
TokenStoreUtils.clearToken(context, Target.LOGIN_QQ);
109+
TokenStoreUtils.clearToken(context, Target.LOGIN_WX);
110+
TokenStoreUtils.clearToken(context, Target.LOGIN_WB);
111111
}
112112

113113
public static void clearToken(Context context, @Target.LoginTarget int loginTarget) {
114-
AuthTokenKeeper.clearToken(context, loginTarget);
114+
TokenStoreUtils.clearToken(context, loginTarget);
115115
}
116116
}

src/main/java/com/march/socialsdk/platform/tencent/QQLoginHelper.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import android.content.Intent;
55

66
import com.march.socialsdk.exception.SocialException;
7-
import com.march.socialsdk.utils.AuthTokenKeeper;
7+
import com.march.socialsdk.utils.TokenStoreUtils;
88
import com.march.socialsdk.utils.JsonUtils;
99
import com.march.socialsdk.utils.LogUtils;
1010
import com.march.socialsdk.listener.OnLoginListener;
@@ -52,7 +52,7 @@ void handleResultData(Intent data) {
5252

5353
// 登录
5454
public void login() {
55-
QQAccessToken qqToken = AuthTokenKeeper.getQQToken(activity);
55+
QQAccessToken qqToken = TokenStoreUtils.getQQToken(activity);
5656
if (qqToken != null) {
5757
mTencentApi.setAccessToken(qqToken.getAccess_token(), qqToken.getExpires_in() + "");
5858
mTencentApi.setOpenId(qqToken.getOpenid());
@@ -76,7 +76,7 @@ public void onComplete(Object o) {
7676
QQAccessToken qqToken = JsonUtils.getObject(jsonResponse.toString(), QQAccessToken.class);
7777
LogUtils.e(TAG, "获取到 qq token = " + qqToken.toString());
7878
// 保存token
79-
AuthTokenKeeper.saveQQToken(activity, qqToken);
79+
TokenStoreUtils.saveQQToken(activity, qqToken);
8080

8181
mTencentApi.setAccessToken(qqToken.getAccess_token(), qqToken.getExpires_in() + "");
8282
mTencentApi.setOpenId(qqToken.getOpenid());

src/main/java/com/march/socialsdk/platform/wechat/WxLoginHelper.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import android.support.annotation.NonNull;
55

66
import com.march.socialsdk.exception.SocialException;
7-
import com.march.socialsdk.utils.AuthTokenKeeper;
7+
import com.march.socialsdk.utils.TokenStoreUtils;
88
import com.march.socialsdk.utils.JsonUtils;
99
import com.march.socialsdk.utils.LogUtils;
1010
import com.march.socialsdk.listener.OnLoginListener;
@@ -66,7 +66,7 @@ public void login(String secretKey, OnLoginListener loginListener) {
6666
this.loginListener = loginListener;
6767
this.secretKey = secretKey;
6868
// 检测本地token的机制
69-
WeChatAccessToken storeToken = AuthTokenKeeper.getWxToken(context);
69+
WeChatAccessToken storeToken = TokenStoreUtils.getWxToken(context);
7070
if (storeToken != null && storeToken.isValid()) {
7171
checkAccessTokenValid(storeToken);
7272
} else {
@@ -99,7 +99,7 @@ public void onSuccess(@NonNull WeChatAccessToken newToken) {
9999
// 获取到access_token
100100
if (newToken.isNoError()) {
101101
LogUtils.e(TAG, "刷新token成功 token = " + newToken);
102-
AuthTokenKeeper.saveWxToken(context, newToken);
102+
TokenStoreUtils.saveWxToken(context, newToken);
103103
// 刷新完成,获取用户信息
104104
getUserInfoByValidToken(token);
105105
} else {
@@ -128,7 +128,7 @@ public void getAccessTokenByCode(String code) {
128128
public void onSuccess(@NonNull WeChatAccessToken token) {
129129
// 获取到access_token
130130
if (token.isNoError()) {
131-
AuthTokenKeeper.saveWxToken(context, token);
131+
TokenStoreUtils.saveWxToken(context, token);
132132
getUserInfoByValidToken(token);
133133
} else {
134134
SocialException exception = new SocialException("获取access_token失败 code = " + token.getErrcode() + " msg = " + token.getErrmsg());

src/main/java/com/march/socialsdk/platform/weibo/WbAuthHelper.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import android.os.Bundle;
66

77
import com.march.socialsdk.exception.SocialException;
8-
import com.march.socialsdk.utils.AuthTokenKeeper;
8+
import com.march.socialsdk.utils.TokenStoreUtils;
99
import com.march.socialsdk.utils.LogUtils;
1010
import com.sina.weibo.sdk.auth.Oauth2AccessToken;
1111
import com.sina.weibo.sdk.auth.WeiboAuthListener;
@@ -32,7 +32,7 @@ public interface OnAuthOverListener {
3232
}
3333

3434
public static void auth(Activity activity, SsoHandler mSsoHandler, OnAuthOverListener listener) {
35-
Oauth2AccessToken token = AuthTokenKeeper.getWbToken(activity);
35+
Oauth2AccessToken token = TokenStoreUtils.getWbToken(activity);
3636
if (token != null && token.isSessionValid()) {
3737
listener.onAuth(token);
3838
} else {
@@ -66,7 +66,7 @@ public void onComplete(Bundle values) {
6666
//String phoneNum = mAccessToken.getPhoneNum();
6767
if (mAccessToken.isSessionValid()) {
6868
// 授权成功
69-
AuthTokenKeeper.saveWbToken(context, mAccessToken);
69+
TokenStoreUtils.saveWbToken(context, mAccessToken);
7070
listener.onAuth(mAccessToken);
7171
} else {
7272
// 以下几种情况,您会收到 Code:

src/main/java/com/march/socialsdk/utils/AuthTokenKeeper.java renamed to src/main/java/com/march/socialsdk/utils/TokenStoreUtils.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
* @author chendong
1818
*/
1919

20-
public class AuthTokenKeeper {
20+
public class TokenStoreUtils {
2121

22-
public static final String TOKEN_STORE = "TOKEN_STORE";
22+
private static final String TOKEN_STORE = "TOKEN_STORE";
2323

24-
public static final String WECHAT_TOKEN_KEY = "WECHAT_TOKEN_KEY";
25-
public static final String SINA_TOKEN_KEY = "SINA_TOKEN_KEY";
26-
public static final String QQ_TOKEN_KEY = "QQ_TOKEN_KEY";
24+
private static final String WECHAT_TOKEN_KEY = "WECHAT_TOKEN_KEY";
25+
private static final String SINA_TOKEN_KEY = "SINA_TOKEN_KEY";
26+
private static final String QQ_TOKEN_KEY = "QQ_TOKEN_KEY";
2727

2828
private static SharedPreferences getSp(Context context) {
2929
return context.getSharedPreferences(TOKEN_STORE + context.getString(R.string.app_name), Context.MODE_PRIVATE);
-2.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)