Commit 976a33bed3074f7efc64914d2c6b9904b5c9eca8
1 parent
184007b8
登录修改
Showing
100 changed files
with
415 additions
and
10 deletions
Too many changes to show.
To preserve performance only 100 of 104 files are displayed.
cloud/share/.gitignore renamed to cloud/third_tool/.gitignore
cloud/share/build.gradle renamed to cloud/third_tool/build.gradle
cloud/share/libs/open_sdk_r6008_lite.jar renamed to cloud/third_tool/libs/open_sdk_r6008_lite.jar
No preview for this file type
cloud/share/proguard-rules.pro renamed to cloud/third_tool/proguard-rules.pro
cloud/share/src/debug/AndroidManifest.xml renamed to cloud/third_tool/src/debug/AndroidManifest.xml
cloud/share/src/debug/java/com/cnlive/strike/debug/wxapi/WXEntryActivity.java renamed to cloud/third_tool/src/debug/java/com/cnlive/strike/debug/wxapi/WXEntryActivity.java
| 1 | package com.cnlive.strike.debug.wxapi; | 1 | package com.cnlive.strike.debug.wxapi; |
| 2 | 2 | ||
| 3 | import android.app.Activity; | 3 | import android.app.Activity; |
| 4 | -import android.content.ComponentName; | ||
| 5 | import android.content.Intent; | 4 | import android.content.Intent; |
| 6 | import android.content.SharedPreferences; | 5 | import android.content.SharedPreferences; |
| 7 | import android.os.Bundle; | 6 | import android.os.Bundle; |
| 8 | -import android.os.Handler; | ||
| 9 | -import android.os.Message; | ||
| 10 | import android.text.TextUtils; | 7 | import android.text.TextUtils; |
| 11 | -import android.util.Log; | ||
| 12 | import android.widget.Toast; | 8 | import android.widget.Toast; |
| 13 | 9 | ||
| 14 | import com.cnlive.core.libs.base.application.AppConfig; | 10 | import com.cnlive.core.libs.base.application.AppConfig; |
| @@ -17,13 +13,12 @@ import com.cnlive.share.BuildConfig; | @@ -17,13 +13,12 @@ import com.cnlive.share.BuildConfig; | ||
| 17 | import com.cnlive.share.arouter.ARouterUtil; | 13 | import com.cnlive.share.arouter.ARouterUtil; |
| 18 | import com.cnlive.share.data.ShareIntegralTypeInfo; | 14 | import com.cnlive.share.data.ShareIntegralTypeInfo; |
| 19 | import com.cnlive.share.data.WeChatInfo; | 15 | import com.cnlive.share.data.WeChatInfo; |
| 20 | -import com.cnlive.share.observable.WechatLoginObservable; | 16 | +import com.cnlive.login.observer.WechatLoginObservable; |
| 21 | import com.cnlive.share.observable.WechatShareObservable; | 17 | import com.cnlive.share.observable.WechatShareObservable; |
| 22 | import com.cnlive.share.util.DateTimeUtil; | 18 | import com.cnlive.share.util.DateTimeUtil; |
| 23 | import com.cnlive.share.util.OkHttpUtils; | 19 | import com.cnlive.share.util.OkHttpUtils; |
| 24 | import com.cnlive.strike.user.auth.UserService; | 20 | import com.cnlive.strike.user.auth.UserService; |
| 25 | import com.google.gson.Gson; | 21 | import com.google.gson.Gson; |
| 26 | -import com.tencent.mm.opensdk.constants.ConstantsAPI; | ||
| 27 | import com.tencent.mm.opensdk.modelbase.BaseReq; | 22 | import com.tencent.mm.opensdk.modelbase.BaseReq; |
| 28 | import com.tencent.mm.opensdk.modelbase.BaseResp; | 23 | import com.tencent.mm.opensdk.modelbase.BaseResp; |
| 29 | import com.tencent.mm.opensdk.modelmsg.SendAuth; | 24 | import com.tencent.mm.opensdk.modelmsg.SendAuth; |
| @@ -34,8 +29,6 @@ import com.tencent.mm.opensdk.openapi.WXAPIFactory; | @@ -34,8 +29,6 @@ import com.tencent.mm.opensdk.openapi.WXAPIFactory; | ||
| 34 | import org.json.JSONException; | 29 | import org.json.JSONException; |
| 35 | import org.json.JSONObject; | 30 | import org.json.JSONObject; |
| 36 | 31 | ||
| 37 | -import java.lang.ref.WeakReference; | ||
| 38 | - | ||
| 39 | /** | 32 | /** |
| 40 | * 作者: 吴奎庆 | 33 | * 作者: 吴奎庆 |
| 41 | * <p> | 34 | * <p> |
cloud/share/src/main/AndroidManifest.xml renamed to cloud/third_tool/src/main/AndroidManifest.xml
cloud/third_tool/src/main/java/com/cnlive/login/action/UserThirdAction.java
0 → 100644
| 1 | +package com.cnlive.login.action; | ||
| 2 | + | ||
| 3 | +import android.content.Context; | ||
| 4 | + | ||
| 5 | +import com.cnlive.strike.user.model.CNLiveUserInfo; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * created by hanyayun | ||
| 9 | + * on 2019/12/4 | ||
| 10 | + */ | ||
| 11 | +public class UserThirdAction { | ||
| 12 | + | ||
| 13 | + | ||
| 14 | + public static void otherLogin(Context context, String thirdPartyPlat, String thirdPartyId, Event<CNLiveUserInfo> event) { | ||
| 15 | + Logic.create() | ||
| 16 | + .action(UserThirdUtilAction.otherLogin(context, thirdPartyPlat, thirdPartyId)) | ||
| 17 | + .action(loginAppAction(context, "", "", true)) | ||
| 18 | + .action(loginIMAction()) | ||
| 19 | + .start(event); | ||
| 20 | + } | ||
| 21 | + | ||
| 22 | + | ||
| 23 | + public static void otherLoginBindMobile(Context context, String phone, String countryCode, String ems, | ||
| 24 | + String thirdPartyPlat, String thirdPartyId, String nickName, String gender, | ||
| 25 | + String location, String faceUrl, Event<CNLiveUserInfo> event) { | ||
| 26 | + Logic.create() | ||
| 27 | + .action(UserThirdUtilAction.otherLoginBindMobile(context, phone, countryCode, ems, | ||
| 28 | + thirdPartyPlat, thirdPartyId, nickName, gender, location, faceUrl)) | ||
| 29 | + .action(loginAppAction(context, "", "", true)) | ||
| 30 | + .action(loginIMAction()) | ||
| 31 | + .start(event); | ||
| 32 | + } | ||
| 33 | +} |
cloud/third_tool/src/main/java/com/cnlive/login/action/UserThirdUtilAction.java
0 → 100644
| 1 | +package com.cnlive.login.action; | ||
| 2 | + | ||
| 3 | +import android.content.Context; | ||
| 4 | + | ||
| 5 | +import com.cnlive.core.libs.base.application.AppConfig; | ||
| 6 | +import com.cnlive.core.network.model.UserData; | ||
| 7 | + | ||
| 8 | +import java.util.HashMap; | ||
| 9 | +import java.util.Map; | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * created by hanyayun | ||
| 13 | + * on 2019/12/4 | ||
| 14 | + */ | ||
| 15 | +public class UserThirdUtilAction { | ||
| 16 | + | ||
| 17 | + /** | ||
| 18 | + * 其他平台账户登录 | ||
| 19 | + * | ||
| 20 | + * @param context | ||
| 21 | + * @param thirdPartyPlat 平台类型 1:sina 2:qq 3:weixin 4:renren | ||
| 22 | + * @param thirdPartyId 第三方用户ID | ||
| 23 | + * [qq: 建议使用openid, wx: 建议使用unionid, sina: 建议使用idstr]; | ||
| 24 | + * 注意:同一用户在登录Sp下不同app时,thirdPartyId必须相同 | ||
| 25 | + */ | ||
| 26 | + public static Logic.Action<Object, BaseInfo<UserData>> otherLogin(Context context, String thirdPartyPlat, String thirdPartyId) { | ||
| 27 | + return (data, callback) -> { | ||
| 28 | + Map<String, String> requestMap = new HashMap<>(); | ||
| 29 | + | ||
| 30 | + requestMap.put("appId", AppConfig.getAppId()); | ||
| 31 | + requestMap.put("thirdPartyPlat", thirdPartyPlat); | ||
| 32 | + requestMap.put("thirdPartyId", thirdPartyId); | ||
| 33 | + requestMap.put("frmId", AppConfig.getAppChannel()); | ||
| 34 | + requestMap.put("clientPlat", "a"); | ||
| 35 | + | ||
| 36 | + return ApiRequest.service(ApiServiceOpen.class, service -> service.loginIn3rdForWJJ(requestMap)).subscribe(context, callback); | ||
| 37 | + }; | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + /** | ||
| 41 | + * 其他平台账户版定手机号并登录 | ||
| 42 | + * | ||
| 43 | + * @param context | ||
| 44 | + * @param thirdPartyPlat 平台类型 1:sina 2:qq 3:weixin 4:renren | ||
| 45 | + * @param thirdPartyId 第三方用户ID | ||
| 46 | + * [qq: 建议使用openid, wx: 建议使用unionid, sina: 建议使用idstr]; | ||
| 47 | + * 注意:同一用户在登录Sp下不同app时,thirdPartyId必须相同 | ||
| 48 | + */ | ||
| 49 | + | ||
| 50 | + | ||
| 51 | + public static Logic.Action<Object, BaseInfo<UserData>> otherLoginBindMobile(Context context, | ||
| 52 | + String phone, | ||
| 53 | + String countryCode, | ||
| 54 | + String ems, | ||
| 55 | + String thirdPartyPlat, | ||
| 56 | + String thirdPartyId, | ||
| 57 | + String nickName, | ||
| 58 | + String gender, | ||
| 59 | + String location, | ||
| 60 | + String faceUrl) { | ||
| 61 | + return (data, callback) -> { | ||
| 62 | + Map<String, String> requestMap = new HashMap<>(); | ||
| 63 | + | ||
| 64 | + requestMap.put("frmId", AppConfig.getAppChannel()); | ||
| 65 | + requestMap.put("clientPlat", "a"); | ||
| 66 | + requestMap.put("uuid", AppConfig.getAppUUID()); | ||
| 67 | + | ||
| 68 | + requestMap.put("appId", AppConfig.getAppId()); | ||
| 69 | + requestMap.put("mobile", phone); | ||
| 70 | + requestMap.put("countryCode", countryCode); | ||
| 71 | + requestMap.put("verificationCode", ems); | ||
| 72 | + | ||
| 73 | + requestMap.put("thirdPartyPlat", thirdPartyPlat); | ||
| 74 | + requestMap.put("thirdPartyId", thirdPartyId); | ||
| 75 | + requestMap.put("nickName", nickName); | ||
| 76 | + requestMap.put("gender", gender); | ||
| 77 | + requestMap.put("location", location); | ||
| 78 | + requestMap.put("faceUrl", faceUrl); | ||
| 79 | + | ||
| 80 | + | ||
| 81 | + return ApiRequest.service(ApiServiceOpen.class, service -> service.loginIn3rdAndMobileForWJJ(requestMap)).subscribe(context, callback); | ||
| 82 | + }; | ||
| 83 | + } | ||
| 84 | +} |
cloud/user/src/main/java/com/cnlive/strike/user/frame/data/OtherUserInfo.java renamed to cloud/third_tool/src/main/java/com/cnlive/login/model/OtherUserInfo.java
cloud/third_tool/src/main/java/com/cnlive/login/model/ThirdLoginInfo.java
0 → 100644
| 1 | +package com.cnlive.login.model; | ||
| 2 | + | ||
| 3 | + | ||
| 4 | +/** | ||
| 5 | + * 作者: 吴奎庆 | ||
| 6 | + * <p> | ||
| 7 | + * 时间: 2019/9/19 | ||
| 8 | + * <p> | ||
| 9 | + * 简介: | ||
| 10 | + */ | ||
| 11 | +public class ThirdLoginInfo { | ||
| 12 | + //类型 1 成功 2失败 | ||
| 13 | + private int type; | ||
| 14 | + //错误信息 | ||
| 15 | + private String message; | ||
| 16 | + //登陆信息 | ||
| 17 | + OtherUserInfo otherUserInfo; | ||
| 18 | + | ||
| 19 | + public ThirdLoginInfo() { | ||
| 20 | + } | ||
| 21 | + | ||
| 22 | + public ThirdLoginInfo(int type, String message, OtherUserInfo otherUserInfo) { | ||
| 23 | + this.type = type; | ||
| 24 | + this.message = message; | ||
| 25 | + this.otherUserInfo = otherUserInfo; | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + public int getType() { | ||
| 29 | + return type; | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + public void setType(int type) { | ||
| 33 | + this.type = type; | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + public String getMessage() { | ||
| 37 | + return message; | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + public void setMessage(String message) { | ||
| 41 | + this.message = message; | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + public OtherUserInfo getOtherUserInfo() { | ||
| 45 | + return otherUserInfo; | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + public void setOtherUserInfo(OtherUserInfo otherUserInfo) { | ||
| 49 | + this.otherUserInfo = otherUserInfo; | ||
| 50 | + } | ||
| 51 | +} |
cloud/third_tool/src/main/java/com/cnlive/login/observer/ThirdLoginObservable.java
0 → 100644
| 1 | +package com.cnlive.login.observer; | ||
| 2 | + | ||
| 3 | + | ||
| 4 | +import com.cnlive.login.model.ThirdLoginInfo; | ||
| 5 | + | ||
| 6 | +import java.util.Observable; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * 作者: 吴奎庆 | ||
| 10 | + * <p> | ||
| 11 | + * 时间: 2019/9/19 | ||
| 12 | + * <p> | ||
| 13 | + * 简介: | ||
| 14 | + */ | ||
| 15 | +public class ThirdLoginObservable extends Observable { | ||
| 16 | + | ||
| 17 | + private static ThirdLoginObservable instance; | ||
| 18 | + | ||
| 19 | + public static ThirdLoginObservable getInstance() { | ||
| 20 | + synchronized (ThirdLoginObservable.class) { | ||
| 21 | + if (instance == null) { | ||
| 22 | + instance = new ThirdLoginObservable(); | ||
| 23 | + } | ||
| 24 | + } | ||
| 25 | + return instance; | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + public void update(ThirdLoginInfo userInfo){ | ||
| 29 | + setChanged(); | ||
| 30 | + notifyObservers(userInfo); | ||
| 31 | + } | ||
| 32 | +} |
cloud/share/src/main/java/com/cnlive/share/observable/WechatLoginObservable.java renamed to cloud/third_tool/src/main/java/com/cnlive/login/observer/WechatLoginObservable.java
cloud/third_tool/src/main/java/com/cnlive/login/utils/ThirdLoginUtil.java
0 → 100644
| 1 | +package com.cnlive.login.utils; | ||
| 2 | + | ||
| 3 | +import android.content.Context; | ||
| 4 | +import android.text.TextUtils; | ||
| 5 | + | ||
| 6 | +import com.cnlive.login.model.OtherUserInfo; | ||
| 7 | +import com.cnlive.login.model.ThirdLoginInfo; | ||
| 8 | +import com.cnlive.login.observer.ThirdLoginObservable; | ||
| 9 | +import com.sina.weibo.sdk.auth.Oauth2AccessToken; | ||
| 10 | +import com.sina.weibo.sdk.net.HttpManager; | ||
| 11 | +import com.sina.weibo.sdk.net.WeiboParameters; | ||
| 12 | +import com.tencent.connect.UserInfo; | ||
| 13 | +import com.tencent.tauth.IUiListener; | ||
| 14 | +import com.tencent.tauth.Tencent; | ||
| 15 | +import com.tencent.tauth.UiError; | ||
| 16 | + | ||
| 17 | +import org.json.JSONException; | ||
| 18 | +import org.json.JSONObject; | ||
| 19 | + | ||
| 20 | +import io.reactivex.Observable; | ||
| 21 | +import io.reactivex.ObservableEmitter; | ||
| 22 | +import io.reactivex.ObservableOnSubscribe; | ||
| 23 | +import io.reactivex.Observer; | ||
| 24 | +import io.reactivex.android.schedulers.AndroidSchedulers; | ||
| 25 | +import io.reactivex.disposables.Disposable; | ||
| 26 | +import io.reactivex.schedulers.Schedulers; | ||
| 27 | + | ||
| 28 | +import static com.tencent.connect.common.Constants.PARAM_ACCESS_TOKEN; | ||
| 29 | +import static com.tencent.connect.common.Constants.PARAM_EXPIRES_IN; | ||
| 30 | +import static com.tencent.open.SocialConstants.PARAM_OPEN_ID; | ||
| 31 | + | ||
| 32 | +/** | ||
| 33 | + * 作者: 吴奎庆 | ||
| 34 | + * <p> | ||
| 35 | + * 时间: 2019/9/19 | ||
| 36 | + * <p> | ||
| 37 | + * 简介: 三方登陆的工具类 | ||
| 38 | + */ | ||
| 39 | +public class ThirdLoginUtil { | ||
| 40 | + /** | ||
| 41 | + * 获取微博信息 | ||
| 42 | + * | ||
| 43 | + * @param context | ||
| 44 | + * @param oauth2AccessToken | ||
| 45 | + */ | ||
| 46 | + public static void getWeiBoInfo(Context context, Oauth2AccessToken oauth2AccessToken) { | ||
| 47 | + | ||
| 48 | + Oauth2AccessToken mAccessToken = oauth2AccessToken; | ||
| 49 | + //从这里获取用户输入的 电话号码信息 | ||
| 50 | + if (mAccessToken.isSessionValid()) { | ||
| 51 | + // 显示 Token | ||
| 52 | + Observable.create(new ObservableOnSubscribe<String>() { | ||
| 53 | + @Override | ||
| 54 | + public void subscribe(ObservableEmitter<String> emitter) throws Exception { | ||
| 55 | + | ||
| 56 | + WeiboParameters parameters = new WeiboParameters("3884700821"); | ||
| 57 | + parameters.put("access_token", oauth2AccessToken.getToken()); | ||
| 58 | + parameters.put("uid", oauth2AccessToken.getUid()); | ||
| 59 | + String message = HttpManager.openUrl(context, "https://api.weibo.com/2/users/show.json", "GET", parameters); | ||
| 60 | + emitter.onNext(message); | ||
| 61 | + } | ||
| 62 | + }).subscribeOn(Schedulers.io()) | ||
| 63 | + .observeOn(AndroidSchedulers.mainThread()) | ||
| 64 | + .subscribe(new Observer<String>() { | ||
| 65 | + @Override | ||
| 66 | + public void onSubscribe(Disposable d) { | ||
| 67 | + | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + @Override | ||
| 71 | + public void onNext(String message) { | ||
| 72 | + try { | ||
| 73 | + | ||
| 74 | + JSONObject jsonObject = new JSONObject(message); | ||
| 75 | + if (jsonObject == null) return; | ||
| 76 | + String id = jsonObject.getString("idstr"); | ||
| 77 | + String name = jsonObject.getString("name"); | ||
| 78 | + String urlface = jsonObject.getString("avatar_large"); | ||
| 79 | + String location = jsonObject.getString("location"); | ||
| 80 | + String gender = jsonObject.getString("gender"); | ||
| 81 | + if (TextUtils.isEmpty(id)) return; | ||
| 82 | + | ||
| 83 | + OtherUserInfo userInfo = new OtherUserInfo(); | ||
| 84 | + userInfo.setFaceUrl(urlface); | ||
| 85 | + userInfo.setGender(gender); | ||
| 86 | + userInfo.setNickName(name); | ||
| 87 | + userInfo.setLocation(location); | ||
| 88 | + userInfo.setThirdPartyId(id); | ||
| 89 | + userInfo.setLoginType("1"); | ||
| 90 | + | ||
| 91 | + ThirdLoginInfo thirdLoginInfo = new ThirdLoginInfo(); | ||
| 92 | + thirdLoginInfo.setType(1); | ||
| 93 | + thirdLoginInfo.setOtherUserInfo(userInfo); | ||
| 94 | + ThirdLoginObservable.getInstance().update(thirdLoginInfo); | ||
| 95 | + | ||
| 96 | + } catch (Exception e) { | ||
| 97 | + ThirdLoginObservable.getInstance().update(new ThirdLoginInfo(2, "登陆失败", null)); | ||
| 98 | + } | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + @Override | ||
| 102 | + public void onError(Throwable e) { | ||
| 103 | + ThirdLoginObservable.getInstance().update(new ThirdLoginInfo(2, "登陆失败", null)); | ||
| 104 | + } | ||
| 105 | + | ||
| 106 | + @Override | ||
| 107 | + public void onComplete() { | ||
| 108 | + | ||
| 109 | + } | ||
| 110 | + }); | ||
| 111 | + } else { | ||
| 112 | + // 以下几种情况,您会收到 Code: | ||
| 113 | + // 1. 当您未在平台上注册的应用程序的包名与签名时; | ||
| 114 | + // 2. 当您注册的应用程序包名与签名不正确时; | ||
| 115 | + // 3. 当您在平台上注册的包名和签名与您当前测试的应用的包名和签名不匹配时。 | ||
| 116 | + String code = oauth2AccessToken.getBundle().getString("code"); | ||
| 117 | + String message = "null"; | ||
| 118 | + if (!TextUtils.isEmpty(code)) { | ||
| 119 | + message = message + "\nObtained the code: " + code; | ||
| 120 | + } | ||
| 121 | + ThirdLoginObservable.getInstance().update(new ThirdLoginInfo(2, "登陆失败", null)); | ||
| 122 | + } | ||
| 123 | + | ||
| 124 | + } | ||
| 125 | + | ||
| 126 | + | ||
| 127 | + public static void getQQInfo(Context context, Tencent mTencent, Object obj) { | ||
| 128 | + JSONObject jsonObject = (JSONObject) obj; | ||
| 129 | + if (jsonObject != null) { | ||
| 130 | + try { | ||
| 131 | + int ret = jsonObject.getInt("ret"); | ||
| 132 | + if (ret == 0) { | ||
| 133 | + //此处登录授权成功 | ||
| 134 | + String openId = jsonObject.getString(PARAM_OPEN_ID); | ||
| 135 | + String access_token = jsonObject.getString(PARAM_ACCESS_TOKEN); | ||
| 136 | + String expires = jsonObject.getString(PARAM_EXPIRES_IN); | ||
| 137 | + mTencent.setOpenId(openId); | ||
| 138 | + mTencent.setAccessToken(access_token, expires); | ||
| 139 | + //获取用户信息 | ||
| 140 | + getUserInfo(context, mTencent, openId); | ||
| 141 | + } else { | ||
| 142 | + ThirdLoginObservable.getInstance().update(new ThirdLoginInfo(2, "登陆失败", null)); | ||
| 143 | + } | ||
| 144 | + } catch (JSONException e) { | ||
| 145 | + e.printStackTrace(); | ||
| 146 | + } | ||
| 147 | + } | ||
| 148 | + } | ||
| 149 | + | ||
| 150 | + | ||
| 151 | + private static void getUserInfo(Context context, Tencent mTencent, String openId) { | ||
| 152 | + UserInfo info = new UserInfo(context, mTencent.getQQToken()); | ||
| 153 | + info.getUserInfo(new IUiListener() { | ||
| 154 | + @Override | ||
| 155 | + public void onComplete(Object value) { | ||
| 156 | + JSONObject jsonObject = (JSONObject) value; | ||
| 157 | + if (jsonObject == null) return; | ||
| 158 | + | ||
| 159 | + try { | ||
| 160 | + String name = jsonObject.getString("nickname"); | ||
| 161 | + String urlface = jsonObject.getString("figureurl_qq"); | ||
| 162 | + String gender = jsonObject.getString("gender"); | ||
| 163 | + String province = jsonObject.getString("province"); | ||
| 164 | + String city = jsonObject.getString("city"); | ||
| 165 | + | ||
| 166 | + if (TextUtils.isEmpty(openId)) return; | ||
| 167 | + | ||
| 168 | + OtherUserInfo otherUserInfo = new OtherUserInfo(); | ||
| 169 | + otherUserInfo.setFaceUrl(urlface); | ||
| 170 | + | ||
| 171 | + otherUserInfo.setNickName(name); | ||
| 172 | + if (TextUtils.isEmpty(city)) { | ||
| 173 | + otherUserInfo.setLocation(province); | ||
| 174 | + } else { | ||
| 175 | + otherUserInfo.setLocation(city); | ||
| 176 | + } | ||
| 177 | + | ||
| 178 | + if ("男".equals(gender)) { | ||
| 179 | + otherUserInfo.setGender("m"); | ||
| 180 | + } else if ("女".equals(gender)) { | ||
| 181 | + otherUserInfo.setGender("f"); | ||
| 182 | + } else { | ||
| 183 | + otherUserInfo.setGender("n"); | ||
| 184 | + } | ||
| 185 | + | ||
| 186 | + otherUserInfo.setThirdPartyId(openId); | ||
| 187 | + otherUserInfo.setLoginType("2"); | ||
| 188 | + ThirdLoginInfo thirdLoginInfo = new ThirdLoginInfo(); | ||
| 189 | + thirdLoginInfo.setType(1); | ||
| 190 | + thirdLoginInfo.setOtherUserInfo(otherUserInfo); | ||
| 191 | + ThirdLoginObservable.getInstance().update(thirdLoginInfo); | ||
| 192 | + | ||
| 193 | + } catch (JSONException e) { | ||
| 194 | + ThirdLoginObservable.getInstance().update(new ThirdLoginInfo(2, "登陆失败", null)); | ||
| 195 | + } | ||
| 196 | + } | ||
| 197 | + | ||
| 198 | + @Override | ||
| 199 | + public void onError(UiError uiError) { | ||
| 200 | + ThirdLoginObservable.getInstance().update(new ThirdLoginInfo(2, "登陆失败", null)); | ||
| 201 | + } | ||
| 202 | + | ||
| 203 | + @Override | ||
| 204 | + public void onCancel() { | ||
| 205 | + } | ||
| 206 | + }); | ||
| 207 | + } | ||
| 208 | + | ||
| 209 | +} |
cloud/share/src/main/java/com/cnlive/share/QQListener.java renamed to cloud/third_tool/src/main/java/com/cnlive/share/QQListener.java
cloud/share/src/main/java/com/cnlive/share/adapter/DataBindingAdapter.java renamed to cloud/third_tool/src/main/java/com/cnlive/share/adapter/DataBindingAdapter.java
cloud/share/src/main/java/com/cnlive/share/api/ApiShareService.java renamed to cloud/third_tool/src/main/java/com/cnlive/share/api/ApiShareService.java
cloud/share/src/main/java/com/cnlive/share/arouter/ARouterUtil.java renamed to cloud/third_tool/src/main/java/com/cnlive/share/arouter/ARouterUtil.java
cloud/share/src/main/java/com/cnlive/share/data/FullVideoShareItemData.java renamed to cloud/third_tool/src/main/java/com/cnlive/share/data/FullVideoShareItemData.java
cloud/share/src/main/java/com/cnlive/share/data/IconInfo.java renamed to cloud/third_tool/src/main/java/com/cnlive/share/data/IconInfo.java
cloud/share/src/main/java/com/cnlive/share/data/ShareInfo.java renamed to cloud/third_tool/src/main/java/com/cnlive/share/data/ShareInfo.java
cloud/share/src/main/java/com/cnlive/share/data/ShareIntegralTypeInfo.java renamed to cloud/third_tool/src/main/java/com/cnlive/share/data/ShareIntegralTypeInfo.java
cloud/share/src/main/java/com/cnlive/share/data/WeChatInfo.java renamed to cloud/third_tool/src/main/java/com/cnlive/share/data/WeChatInfo.java
cloud/share/src/main/java/com/cnlive/share/model/ShareReleaseInfoUtil.java renamed to cloud/third_tool/src/main/java/com/cnlive/share/model/ShareReleaseInfoUtil.java
cloud/share/src/main/java/com/cnlive/share/model/ShareStateInfo.java renamed to cloud/third_tool/src/main/java/com/cnlive/share/model/ShareStateInfo.java
cloud/share/src/main/java/com/cnlive/share/model/ShortLinkInfo.java renamed to cloud/third_tool/src/main/java/com/cnlive/share/model/ShortLinkInfo.java
cloud/share/src/main/java/com/cnlive/share/observable/ShareClickObservable.java renamed to cloud/third_tool/src/main/java/com/cnlive/share/observable/ShareClickObservable.java
cloud/share/src/main/java/com/cnlive/share/observable/ShareStateObservable.java renamed to cloud/third_tool/src/main/java/com/cnlive/share/observable/ShareStateObservable.java
cloud/share/src/main/java/com/cnlive/share/observable/ShareWjjStateObservable.java renamed to cloud/third_tool/src/main/java/com/cnlive/share/observable/ShareWjjStateObservable.java
cloud/share/src/main/java/com/cnlive/share/observable/WechatShareObservable.java renamed to cloud/third_tool/src/main/java/com/cnlive/share/observable/WechatShareObservable.java
cloud/share/src/main/java/com/cnlive/share/ui/FullVideoShareView.java renamed to cloud/third_tool/src/main/java/com/cnlive/share/ui/FullVideoShareView.java
cloud/share/src/main/java/com/cnlive/share/ui/ShareActivity.java renamed to cloud/third_tool/src/main/java/com/cnlive/share/ui/ShareActivity.java
cloud/share/src/main/java/com/cnlive/share/ui/ShareDialogListAdapter.java renamed to cloud/third_tool/src/main/java/com/cnlive/share/ui/ShareDialogListAdapter.java
cloud/share/src/main/java/com/cnlive/share/ui/ShareImgActivity.java renamed to cloud/third_tool/src/main/java/com/cnlive/share/ui/ShareImgActivity.java
cloud/share/src/main/java/com/cnlive/share/ui/WechatAppletActivity.java renamed to cloud/third_tool/src/main/java/com/cnlive/share/ui/WechatAppletActivity.java
cloud/share/src/main/java/com/cnlive/share/ui/dialog/ShareDialog.java renamed to cloud/third_tool/src/main/java/com/cnlive/share/ui/dialog/ShareDialog.java
cloud/share/src/main/java/com/cnlive/share/util/BindingAdapterUtil.java renamed to cloud/third_tool/src/main/java/com/cnlive/share/util/BindingAdapterUtil.java
cloud/share/src/main/java/com/cnlive/share/util/DateTimeUtil.java renamed to cloud/third_tool/src/main/java/com/cnlive/share/util/DateTimeUtil.java
cloud/share/src/main/java/com/cnlive/share/util/OkHttpUtils.java renamed to cloud/third_tool/src/main/java/com/cnlive/share/util/OkHttpUtils.java
cloud/share/src/main/java/com/cnlive/share/util/ShareOtherUtil.java renamed to cloud/third_tool/src/main/java/com/cnlive/share/util/ShareOtherUtil.java
cloud/share/src/main/java/com/cnlive/share/util/ShareUtils.java renamed to cloud/third_tool/src/main/java/com/cnlive/share/util/ShareUtils.java
| @@ -128,6 +128,7 @@ public class ShareUtils { | @@ -128,6 +128,7 @@ public class ShareUtils { | ||
| 128 | } | 128 | } |
| 129 | String url = Util.processUrlData(shareInfo.getUrl(), mContext, false); | 129 | String url = Util.processUrlData(shareInfo.getUrl(), mContext, false); |
| 130 | WXWebpageObject webpage = new WXWebpageObject(); | 130 | WXWebpageObject webpage = new WXWebpageObject(); |
| 131 | + //TODO 上传maven考虑正式版测试版 | ||
| 131 | IWXAPI api = WXAPIFactory.createWXAPI(mContext, AppConfig.getWechatAppid()); | 132 | IWXAPI api = WXAPIFactory.createWXAPI(mContext, AppConfig.getWechatAppid()); |
| 132 | webpage.webpageUrl = url; | 133 | webpage.webpageUrl = url; |
| 133 | WXMediaMessage msg = new WXMediaMessage(webpage); | 134 | WXMediaMessage msg = new WXMediaMessage(webpage); |
cloud/share/src/main/java/com/cnlive/share/util/Util.java renamed to cloud/third_tool/src/main/java/com/cnlive/share/util/Util.java
cloud/share/src/main/res/anim/share_activity_in.xml renamed to cloud/third_tool/src/main/res/anim/share_activity_in.xml
cloud/share/src/main/res/anim/share_activity_out.xml renamed to cloud/third_tool/src/main/res/anim/share_activity_out.xml
cloud/share/src/main/res/anim/share_slide_in_bottom.xml renamed to cloud/third_tool/src/main/res/anim/share_slide_in_bottom.xml
cloud/share/src/main/res/anim/share_slide_out_bottom.xml renamed to cloud/third_tool/src/main/res/anim/share_slide_out_bottom.xml
cloud/share/src/main/res/drawable-hdpi/browser.webp renamed to cloud/third_tool/src/main/res/drawable-hdpi/browser.webp
No preview for this file type
cloud/share/src/main/res/drawable-hdpi/download_album.webp renamed to cloud/third_tool/src/main/res/drawable-hdpi/download_album.webp
No preview for this file type
cloud/share/src/main/res/drawable-hdpi/drd_quxiao.webp renamed to cloud/third_tool/src/main/res/drawable-hdpi/drd_quxiao.webp
No preview for this file type
cloud/share/src/main/res/drawable-hdpi/pengyouquan.webp renamed to cloud/third_tool/src/main/res/drawable-hdpi/pengyouquan.webp
No preview for this file type
cloud/share/src/main/res/drawable-hdpi/qq.webp renamed to cloud/third_tool/src/main/res/drawable-hdpi/qq.webp
No preview for this file type
cloud/share/src/main/res/drawable-hdpi/report_icon.webp renamed to cloud/third_tool/src/main/res/drawable-hdpi/report_icon.webp
No preview for this file type
cloud/share/src/main/res/drawable-hdpi/shenghuoquan.webp renamed to cloud/third_tool/src/main/res/drawable-hdpi/shenghuoquan.webp
No preview for this file type
cloud/share/src/main/res/drawable-hdpi/ssdk_oks_ptr_ptr.webp renamed to cloud/third_tool/src/main/res/drawable-hdpi/ssdk_oks_ptr_ptr.webp
No preview for this file type
cloud/share/src/main/res/drawable-hdpi/wechat.webp renamed to cloud/third_tool/src/main/res/drawable-hdpi/wechat.webp
No preview for this file type
cloud/share/src/main/res/drawable-hdpi/weibo.webp renamed to cloud/third_tool/src/main/res/drawable-hdpi/weibo.webp
No preview for this file type
cloud/share/src/main/res/drawable-hdpi/wjjhaoyou.webp renamed to cloud/third_tool/src/main/res/drawable-hdpi/wjjhaoyou.webp
No preview for this file type
cloud/share/src/main/res/drawable-xhdpi/browser.webp renamed to cloud/third_tool/src/main/res/drawable-xhdpi/browser.webp
No preview for this file type
cloud/share/src/main/res/drawable-xhdpi/download_album.webp renamed to cloud/third_tool/src/main/res/drawable-xhdpi/download_album.webp
No preview for this file type
cloud/share/src/main/res/drawable-xhdpi/drd_pengyouquan.webp renamed to cloud/third_tool/src/main/res/drawable-xhdpi/drd_pengyouquan.webp
No preview for this file type
cloud/share/src/main/res/drawable-xhdpi/drd_qq.webp renamed to cloud/third_tool/src/main/res/drawable-xhdpi/drd_qq.webp
No preview for this file type
cloud/share/src/main/res/drawable-xhdpi/drd_quxiao.webp renamed to cloud/third_tool/src/main/res/drawable-xhdpi/drd_quxiao.webp
No preview for this file type
cloud/share/src/main/res/drawable-xhdpi/drd_weixin.webp renamed to cloud/third_tool/src/main/res/drawable-xhdpi/drd_weixin.webp
No preview for this file type
cloud/share/src/main/res/drawable-xhdpi/pengyouquan.webp renamed to cloud/third_tool/src/main/res/drawable-xhdpi/pengyouquan.webp
No preview for this file type
cloud/share/src/main/res/drawable-xhdpi/qq.webp renamed to cloud/third_tool/src/main/res/drawable-xhdpi/qq.webp
No preview for this file type
cloud/share/src/main/res/drawable-xhdpi/report_icon.webp renamed to cloud/third_tool/src/main/res/drawable-xhdpi/report_icon.webp
No preview for this file type
cloud/share/src/main/res/drawable-xhdpi/share_logo_share_module.webp renamed to cloud/third_tool/src/main/res/drawable-xhdpi/share_logo_share_module.webp
No preview for this file type
cloud/share/src/main/res/drawable-xhdpi/shenghuoquan.webp renamed to cloud/third_tool/src/main/res/drawable-xhdpi/shenghuoquan.webp
No preview for this file type
cloud/share/src/main/res/drawable-xhdpi/wechat.webp renamed to cloud/third_tool/src/main/res/drawable-xhdpi/wechat.webp
No preview for this file type
cloud/share/src/main/res/drawable-xhdpi/weibo.webp renamed to cloud/third_tool/src/main/res/drawable-xhdpi/weibo.webp
No preview for this file type
cloud/share/src/main/res/drawable-xhdpi/white.webp renamed to cloud/third_tool/src/main/res/drawable-xhdpi/white.webp
No preview for this file type
cloud/share/src/main/res/drawable-xhdpi/wjjhaoyou.webp renamed to cloud/third_tool/src/main/res/drawable-xhdpi/wjjhaoyou.webp
No preview for this file type
cloud/share/src/main/res/drawable-xxhdpi/browser.webp renamed to cloud/third_tool/src/main/res/drawable-xxhdpi/browser.webp
No preview for this file type
cloud/share/src/main/res/drawable-xxhdpi/download_album.webp renamed to cloud/third_tool/src/main/res/drawable-xxhdpi/download_album.webp
No preview for this file type
cloud/share/src/main/res/drawable-xxhdpi/pengyouquan.webp renamed to cloud/third_tool/src/main/res/drawable-xxhdpi/pengyouquan.webp
No preview for this file type
cloud/share/src/main/res/drawable-xxhdpi/qq.webp renamed to cloud/third_tool/src/main/res/drawable-xxhdpi/qq.webp
No preview for this file type
cloud/share/src/main/res/drawable-xxhdpi/report_icon.webp renamed to cloud/third_tool/src/main/res/drawable-xxhdpi/report_icon.webp
No preview for this file type
cloud/share/src/main/res/drawable-xxhdpi/shenghuoquan.webp renamed to cloud/third_tool/src/main/res/drawable-xxhdpi/shenghuoquan.webp
No preview for this file type
cloud/share/src/main/res/drawable-xxhdpi/wechat.webp renamed to cloud/third_tool/src/main/res/drawable-xxhdpi/wechat.webp
No preview for this file type
cloud/share/src/main/res/drawable-xxhdpi/weibo.webp renamed to cloud/third_tool/src/main/res/drawable-xxhdpi/weibo.webp
No preview for this file type
cloud/share/src/main/res/drawable-xxhdpi/wjjhaoyou.webp renamed to cloud/third_tool/src/main/res/drawable-xxhdpi/wjjhaoyou.webp
No preview for this file type
cloud/share/src/main/res/drawable/ssdk_oks_classic_platform_cell_back.xml renamed to cloud/third_tool/src/main/res/drawable/ssdk_oks_classic_platform_cell_back.xml
cloud/share/src/main/res/drawable/ssdk_oks_classic_progressbar.xml renamed to cloud/third_tool/src/main/res/drawable/ssdk_oks_classic_progressbar.xml
cloud/share/src/main/res/layout/activity_share_dialog.xml renamed to cloud/third_tool/src/main/res/layout/activity_share_dialog.xml
cloud/share/src/main/res/layout/activity_share_img.xml renamed to cloud/third_tool/src/main/res/layout/activity_share_img.xml
cloud/share/src/main/res/layout/layout_full_video_share.xml renamed to cloud/third_tool/src/main/res/layout/layout_full_video_share.xml
cloud/share/src/main/res/layout/layout_share_dialog.xml renamed to cloud/third_tool/src/main/res/layout/layout_share_dialog.xml
cloud/share/src/main/res/layout/list_item_full_video_share.xml renamed to cloud/third_tool/src/main/res/layout/list_item_full_video_share.xml
cloud/share/src/main/res/layout/share_dialog_item.xml renamed to cloud/third_tool/src/main/res/layout/share_dialog_item.xml
cloud/share/src/main/res/values-en/ssdk_country_arrays.xml renamed to cloud/third_tool/src/main/res/values-en/ssdk_country_arrays.xml
cloud/share/src/main/res/values-en/ssdk_oks_strings.xml renamed to cloud/third_tool/src/main/res/values-en/ssdk_oks_strings.xml
cloud/share/src/main/res/values-en/ssdk_strings.xml renamed to cloud/third_tool/src/main/res/values-en/ssdk_strings.xml
cloud/share/src/main/res/values/colors.xml renamed to cloud/third_tool/src/main/res/values/colors.xml
cloud/share/src/main/res/values/ssdk_country_arrays.xml renamed to cloud/third_tool/src/main/res/values/ssdk_country_arrays.xml
cloud/share/src/main/res/values/ssdk_instapaper_strings.xml renamed to cloud/third_tool/src/main/res/values/ssdk_instapaper_strings.xml
cloud/share/src/main/res/values/ssdk_oks_color_drawables.xml renamed to cloud/third_tool/src/main/res/values/ssdk_oks_color_drawables.xml
cloud/share/src/main/res/values/ssdk_oks_strings.xml renamed to cloud/third_tool/src/main/res/values/ssdk_oks_strings.xml
cloud/share/src/main/res/values/ssdk_strings.xml renamed to cloud/third_tool/src/main/res/values/ssdk_strings.xml
cloud/share/src/main/res/values/strings.xml renamed to cloud/third_tool/src/main/res/values/strings.xml
cloud/share/src/main/res/values/styles.xml renamed to cloud/third_tool/src/main/res/values/styles.xml