feat:移除Mob-SDK(分享|link)
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
apply plugin: 'com.tencent.vasdolly'
|
apply plugin: 'com.tencent.vasdolly'
|
||||||
apply from: '../mob.gradle'
|
|
||||||
apply from: '../project.gradle'
|
apply from: '../project.gradle'
|
||||||
|
|
||||||
def onlyArm64 = Boolean.parseBoolean(only_arm64)
|
def onlyArm64 = Boolean.parseBoolean(only_arm64)
|
||||||
|
@@ -152,31 +152,31 @@
|
|||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity> <!-- 刘海屏适配 end -->
|
</activity> <!-- 刘海屏适配 end -->
|
||||||
<activity
|
<!-- <activity-->
|
||||||
android:name="com.mob.tools.MobUIShell"
|
<!-- android:name="com.mob.tools.MobUIShell"-->
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
<!-- android:configChanges="keyboardHidden|orientation|screenSize"-->
|
||||||
android:theme="@android:style/Theme.Translucent.NoTitleBar"
|
<!-- android:theme="@android:style/Theme.Translucent.NoTitleBar"-->
|
||||||
android:windowSoftInputMode="stateHidden|adjustResize" /> <!-- 云信配置 begin ##################################################### -->
|
<!-- android:windowSoftInputMode="stateHidden|adjustResize" /> <!– 云信配置 begin ##################################################### –>-->
|
||||||
<!--
|
<!--
|
||||||
APP key, 可以在这里设置,也可以在 SDKOptions 中提供。
|
APP key, 可以在这里设置,也可以在 SDKOptions 中提供。
|
||||||
如果 SDKOptions 中提供了,取 SDKOptions 中的值。
|
如果 SDKOptions 中提供了,取 SDKOptions 中的值。
|
||||||
-->
|
-->
|
||||||
<activity
|
<!-- <activity-->
|
||||||
android:name="com.vele.habuplay.lineapi.LineAuthenticationCallbackActivity"
|
<!-- android:name="com.vele.habuplay.lineapi.LineAuthenticationCallbackActivity"-->
|
||||||
android:exported="true"
|
<!-- android:exported="true"-->
|
||||||
android:launchMode="singleTask"
|
<!-- android:launchMode="singleTask"-->
|
||||||
android:noHistory="true">
|
<!-- android:noHistory="true">-->
|
||||||
|
|
||||||
<!-- 集成line客户端登录授权,需要添如下格式的过滤器 -->
|
<!-- <!– 集成line客户端登录授权,需要添如下格式的过滤器 –>-->
|
||||||
<intent-filter>
|
<!-- <intent-filter>-->
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<!-- <action android:name="android.intent.action.VIEW" />-->
|
||||||
|
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
<!-- <category android:name="android.intent.category.BROWSABLE" />-->
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<!-- <category android:name="android.intent.category.DEFAULT" />-->
|
||||||
|
|
||||||
<data android:scheme="lineauth" />
|
<!-- <data android:scheme="lineauth" />-->
|
||||||
</intent-filter>
|
<!-- </intent-filter>-->
|
||||||
</activity>
|
<!-- </activity>-->
|
||||||
<!--
|
<!--
|
||||||
声明云信后台服务,如需保持后台推送,使用独立进程效果会更好。
|
声明云信后台服务,如需保持后台推送,使用独立进程效果会更好。
|
||||||
ca46478c438dda51d25306f52fe7506b
|
ca46478c438dda51d25306f52fe7506b
|
||||||
@@ -1015,9 +1015,9 @@
|
|||||||
android:name="flutterEmbedding"
|
android:name="flutterEmbedding"
|
||||||
android:value="2" />
|
android:value="2" />
|
||||||
|
|
||||||
<meta-data
|
<!-- <meta-data-->
|
||||||
android:name="Mob-Https"
|
<!-- android:name="Mob-Https"-->
|
||||||
android:value="yes" />
|
<!-- android:value="yes" />-->
|
||||||
|
|
||||||
<provider
|
<provider
|
||||||
android:name="com.netease.nimlib.ipc.NIMContentProvider"
|
android:name="com.netease.nimlib.ipc.NIMContentProvider"
|
||||||
|
@@ -19,7 +19,6 @@ import com.bumptech.glide.request.target.ViewTarget;
|
|||||||
import com.example.lib_utils.LanguageUtils;
|
import com.example.lib_utils.LanguageUtils;
|
||||||
import com.coorchice.library.utils.LogUtils;
|
import com.coorchice.library.utils.LogUtils;
|
||||||
import com.hjq.toast.ToastUtils;
|
import com.hjq.toast.ToastUtils;
|
||||||
import com.mob.MobSDK;
|
|
||||||
import com.netease.nim.uikit.api.NimUIKit;
|
import com.netease.nim.uikit.api.NimUIKit;
|
||||||
import com.netease.nim.uikit.common.util.log.LogUtil;
|
import com.netease.nim.uikit.common.util.log.LogUtil;
|
||||||
import com.netease.nimlib.sdk.NIMClient;
|
import com.netease.nimlib.sdk.NIMClient;
|
||||||
@@ -268,9 +267,9 @@ public class XChatApplication extends BaseApp {
|
|||||||
lifeCycleHelper = new AppLifeCycleHelper();
|
lifeCycleHelper = new AppLifeCycleHelper();
|
||||||
}
|
}
|
||||||
registerActivityLifecycleCallback(lifeCycleHelper);
|
registerActivityLifecycleCallback(lifeCycleHelper);
|
||||||
initLinkedMe();
|
// initLinkedMe();
|
||||||
MobSDK.init(context);
|
// MobSDK.init(context);
|
||||||
MobSDK.submitPolicyGrantResult(true);
|
// MobSDK.submitPolicyGrantResult(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
LogUtils.d("init time = " + (System.currentTimeMillis() - startTime) + "ms");
|
LogUtils.d("init time = " + (System.currentTimeMillis() - startTime) + "ms");
|
||||||
@@ -281,11 +280,11 @@ public class XChatApplication extends BaseApp {
|
|||||||
((Application) BasicConfig.INSTANCE.getAppContext().getApplicationContext()).registerActivityLifecycleCallbacks(callbacks);
|
((Application) BasicConfig.INSTANCE.getAppContext().getApplicationContext()).registerActivityLifecycleCallbacks(callbacks);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 初始化linkedMe
|
// * 初始化linkedMe
|
||||||
*/
|
// */
|
||||||
private static void initLinkedMe() {
|
// private static void initLinkedMe() {
|
||||||
MobSDK.init(instance, "32fd2f8457880", "ef796ca85e8cd95a76929663de133214");
|
// MobSDK.init(instance, "32fd2f8457880", "ef796ca85e8cd95a76929663de133214");
|
||||||
// MobLink.setRestoreSceneListener(new RestoreSceneListener() {
|
// MobLink.setRestoreSceneListener(new RestoreSceneListener() {
|
||||||
// @Override
|
// @Override
|
||||||
// public Class<? extends Activity> willRestoreScene(Scene scene) {
|
// public Class<? extends Activity> willRestoreScene(Scene scene) {
|
||||||
@@ -300,7 +299,7 @@ public class XChatApplication extends BaseApp {
|
|||||||
// public void notFoundScene(Scene scene) {
|
// public void notFoundScene(Scene scene) {
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
private static void initEnv() {
|
private static void initEnv() {
|
||||||
|
@@ -55,7 +55,6 @@ import com.chwl.core.manager.IMNetEaseManager;
|
|||||||
import com.chwl.core.manager.RoomEvent;
|
import com.chwl.core.manager.RoomEvent;
|
||||||
import com.chwl.core.praise.PraiseModel;
|
import com.chwl.core.praise.PraiseModel;
|
||||||
import com.chwl.core.room.bean.RoomInfo;
|
import com.chwl.core.room.bean.RoomInfo;
|
||||||
import com.chwl.core.room.bean.RoomModeType;
|
|
||||||
import com.chwl.core.room.game.GameInfo;
|
import com.chwl.core.room.game.GameInfo;
|
||||||
import com.chwl.core.room.game.GameModel;
|
import com.chwl.core.room.game.GameModel;
|
||||||
import com.chwl.core.room.queuing_mic.event.HasAnimationEffect;
|
import com.chwl.core.room.queuing_mic.event.HasAnimationEffect;
|
||||||
|
@@ -153,9 +153,9 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
|||||||
// case SpConstants.FACEBOOK:
|
// case SpConstants.FACEBOOK:
|
||||||
// findViewById(R.id.tv_facebook_last_login).setVisibility(View.VISIBLE);
|
// findViewById(R.id.tv_facebook_last_login).setVisibility(View.VISIBLE);
|
||||||
// break;
|
// break;
|
||||||
case SpConstants.LINE:
|
// case SpConstants.LINE:
|
||||||
findViewById(R.id.tv_line_last_login).setVisibility(View.VISIBLE);
|
// findViewById(R.id.tv_line_last_login).setVisibility(View.VISIBLE);
|
||||||
break;
|
// break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -250,36 +250,36 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
|||||||
// reportLoginType(IReportConstants.ONE);
|
// reportLoginType(IReportConstants.ONE);
|
||||||
// LoginManager.getInstance().logInWithReadPermissions(this, Arrays.asList("public_profile"));
|
// LoginManager.getInstance().logInWithReadPermissions(this, Arrays.asList("public_profile"));
|
||||||
// break;
|
// break;
|
||||||
case R.id.cs_line:
|
// case R.id.cs_line:
|
||||||
reportLoginType(IReportConstants.TWO);
|
// reportLoginType(IReportConstants.TWO);
|
||||||
getDialogManager().showProgressDialog(this);
|
// getDialogManager().showProgressDialog(this);
|
||||||
AuthModel.get().lineLogin()
|
// AuthModel.get().lineLogin()
|
||||||
.compose(bindUntilEvent(ActivityEvent.DESTROY))
|
// .compose(bindUntilEvent(ActivityEvent.DESTROY))
|
||||||
.subscribe(new SingleObserver<String>() {
|
// .subscribe(new SingleObserver<String>() {
|
||||||
@Override
|
// @Override
|
||||||
public void onSubscribe(Disposable d) {
|
// public void onSubscribe(Disposable d) {
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void onSuccess(String result) {
|
// public void onSuccess(String result) {
|
||||||
reportLoginResult(IReportConstants.TWO, IReportConstants.ONE, "");
|
// reportLoginResult(IReportConstants.TWO, IReportConstants.ONE, "");
|
||||||
// HashMap<String, Object> map = new HashMap<>(2);
|
//// HashMap<String, Object> map = new HashMap<>(2);
|
||||||
// map.put(FirebaseAnalytics.Param.METHOD, getString(R.string.login_line));
|
//// map.put(FirebaseAnalytics.Param.METHOD, getString(R.string.login_line));
|
||||||
// ReportManager.get().reportEvent(FirebaseAnalytics.Event.LOGIN, map);
|
//// ReportManager.get().reportEvent(FirebaseAnalytics.Event.LOGIN, map);
|
||||||
// ReportManager.get().reportAdjustEvent(IReportConstants.ADJUST_LOGIN);
|
//// ReportManager.get().reportAdjustEvent(IReportConstants.ADJUST_LOGIN);
|
||||||
getDialogManager().dismissDialog();
|
// getDialogManager().dismissDialog();
|
||||||
SPUtils.putString(SpConstants.LOGIN_TYPE, SpConstants.LINE);
|
// SPUtils.putString(SpConstants.LOGIN_TYPE, SpConstants.LINE);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void onError(Throwable e) {
|
// public void onError(Throwable e) {
|
||||||
reportLoginResult(IReportConstants.TWO, IReportConstants.ZERO, e.getMessage());
|
// reportLoginResult(IReportConstants.TWO, IReportConstants.ZERO, e.getMessage());
|
||||||
getDialogManager().dismissDialog();
|
// getDialogManager().dismissDialog();
|
||||||
dealWithLoginError(e);
|
// dealWithLoginError(e);
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
break;
|
// break;
|
||||||
|
|
||||||
case R.id.cs_google:
|
case R.id.cs_google:
|
||||||
reportLoginType(IReportConstants.THREE);
|
reportLoginType(IReportConstants.THREE);
|
||||||
|
@@ -434,46 +434,46 @@ public class CommonWebViewActivity extends BaseActivity implements ShareDialog.O
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSharePlatformClick(Platform platform) {
|
public void onSharePlatformClick(Platform platform) {
|
||||||
if (mWebJsBeanInfo != null && mWebJsBeanInfo.getData() != null) {
|
// if (mWebJsBeanInfo != null && mWebJsBeanInfo.getData() != null) {
|
||||||
if (platform.getName().equals("GooglePlus")) {
|
// if (platform.getName().equals("GooglePlus")) {
|
||||||
try {
|
// try {
|
||||||
ClipboardManager cm = (ClipboardManager) this.getSystemService(Context.CLIPBOARD_SERVICE);
|
// ClipboardManager cm = (ClipboardManager) this.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||||
cm.setPrimaryClip(ClipData.newPlainText("text", mWebJsBeanInfo.getData().getLink()));
|
// cm.setPrimaryClip(ClipData.newPlainText("text", mWebJsBeanInfo.getData().getLink()));
|
||||||
toast(getString(R.string.have_copy));
|
// toast(getString(R.string.have_copy));
|
||||||
} catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
Logger.i("copyText", String.valueOf(e));
|
// Logger.i("copyText", String.valueOf(e));
|
||||||
toast(String.valueOf(e));
|
// toast(String.valueOf(e));
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
switch (mWebJsBeanInfo.getType()) {
|
// switch (mWebJsBeanInfo.getType()) {
|
||||||
case WebJsBeanInfo.IMAGE:
|
// case WebJsBeanInfo.IMAGE:
|
||||||
if (TextUtils.isEmpty(mWebJsBeanInfo.getData().getImgUrl())) {
|
// if (TextUtils.isEmpty(mWebJsBeanInfo.getData().getImgUrl())) {
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
ShareModel.get().shareImage(platform, mWebJsBeanInfo.getData().getImgUrl());
|
// ShareModel.get().shareImage(platform, mWebJsBeanInfo.getData().getImgUrl());
|
||||||
break;
|
// break;
|
||||||
default:
|
// default:
|
||||||
ShareModel.get().shareH5(mWebJsBeanInfo.getData(), platform).subscribe(new SingleObserver<String>() {
|
// ShareModel.get().shareH5(mWebJsBeanInfo.getData(), platform).subscribe(new SingleObserver<String>() {
|
||||||
@Override
|
// @Override
|
||||||
public void onSubscribe(Disposable d) {
|
// public void onSubscribe(Disposable d) {
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void onSuccess(String s) {
|
// public void onSuccess(String s) {
|
||||||
toast(s);
|
// toast(s);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void onError(Throwable e) {
|
// public void onError(Throwable e) {
|
||||||
toast(e.getMessage());
|
// toast(e.getMessage());
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
toast(ResUtil.getString(R.string.ui_webview_commonwebviewactivity_011));
|
// toast(ResUtil.getString(R.string.ui_webview_commonwebviewactivity_011));
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -12,15 +12,9 @@ import android.widget.TextView;
|
|||||||
|
|
||||||
import com.google.android.material.bottomsheet.BottomSheetDialog;
|
import com.google.android.material.bottomsheet.BottomSheetDialog;
|
||||||
import com.chwl.app.R;
|
import com.chwl.app.R;
|
||||||
import com.chwl.app.application.ReportManager;
|
|
||||||
import com.chwl.library.utils.SingleToastUtil;
|
import com.chwl.library.utils.SingleToastUtil;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
import cn.sharesdk.framework.Platform;
|
import cn.sharesdk.framework.Platform;
|
||||||
import cn.sharesdk.framework.ShareSDK;
|
|
||||||
import cn.sharesdk.google.GooglePlus;
|
|
||||||
import cn.sharesdk.line.Line;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author xiaoyu
|
* @author xiaoyu
|
||||||
@@ -104,15 +98,15 @@ public class ShareDialog extends BottomSheetDialog implements View.OnClickListen
|
|||||||
}
|
}
|
||||||
dismiss();
|
dismiss();
|
||||||
break;
|
break;
|
||||||
case R.id.tv_line:
|
// case R.id.tv_line:
|
||||||
if (onShareDialogItemClick != null) {
|
// if (onShareDialogItemClick != null) {
|
||||||
// HashMap<String, Object> map = new HashMap<>(2);
|
// HashMap<String, Object> map = new HashMap<>(2);
|
||||||
// map.put(FirebaseAnalytics.Param.CONTENT_TYPE, getString(R.string.share_line));
|
// map.put(FirebaseAnalytics.Param.CONTENT_TYPE, getString(R.string.share_line));
|
||||||
// ReportManager.get().reportEvent(FirebaseAnalytics.Event.SHARE, map);
|
// ReportManager.get().reportEvent(FirebaseAnalytics.Event.SHARE, map);
|
||||||
onShareDialogItemClick.onSharePlatformClick(ShareSDK.getPlatform(Line.NAME));
|
// onShareDialogItemClick.onSharePlatformClick(ShareSDK.getPlatform(Line.NAME));
|
||||||
}
|
// }
|
||||||
dismiss();
|
// dismiss();
|
||||||
break;
|
// break;
|
||||||
// case R.id.tv_facebook:
|
// case R.id.tv_facebook:
|
||||||
// if (onShareDialogItemClick != null) {
|
// if (onShareDialogItemClick != null) {
|
||||||
// HashMap<String, Object> map = new HashMap<>(2);
|
// HashMap<String, Object> map = new HashMap<>(2);
|
||||||
@@ -127,7 +121,7 @@ public class ShareDialog extends BottomSheetDialog implements View.OnClickListen
|
|||||||
// HashMap<String, Object> map = new HashMap<>(2);
|
// HashMap<String, Object> map = new HashMap<>(2);
|
||||||
// map.put(FirebaseAnalytics.Param.CONTENT_TYPE, getString(R.string.share_link));
|
// map.put(FirebaseAnalytics.Param.CONTENT_TYPE, getString(R.string.share_link));
|
||||||
// ReportManager.get().reportEvent(FirebaseAnalytics.Event.SHARE, map);
|
// ReportManager.get().reportEvent(FirebaseAnalytics.Event.SHARE, map);
|
||||||
onShareDialogItemClick.onSharePlatformClick(ShareSDK.getPlatform(GooglePlus.NAME));
|
// onShareDialogItemClick.onSharePlatformClick(ShareSDK.getPlatform(GooglePlus.NAME));
|
||||||
}
|
}
|
||||||
dismiss();
|
dismiss();
|
||||||
break;
|
break;
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
package com.vele.habuplay.lineapi;
|
package com.vele.habuplay.lineapi;
|
||||||
|
|
||||||
import cn.sharesdk.line.LineHandlerActivity;
|
//import cn.sharesdk.line.LineHandlerActivity;
|
||||||
|
|
||||||
public class LineAuthenticationCallbackActivity extends LineHandlerActivity {
|
//public class LineAuthenticationCallbackActivity extends LineHandlerActivity {
|
||||||
}
|
//}
|
||||||
|
@@ -13,7 +13,6 @@ buildscript {
|
|||||||
google()
|
google()
|
||||||
maven { url 'https://maven.aliyun.com/repository/public' }
|
maven { url 'https://maven.aliyun.com/repository/public' }
|
||||||
maven { url 'https://jitpack.io' }
|
maven { url 'https://jitpack.io' }
|
||||||
maven { url "https://mvn.mob.com/android" }
|
|
||||||
maven { url 'https://repo1.maven.org/maven2/' }
|
maven { url 'https://repo1.maven.org/maven2/' }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -26,9 +25,6 @@ buildscript {
|
|||||||
// android 资源混淆插件
|
// android 资源混淆插件
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
classpath 'com.tencent.vasdolly:plugin:3.0.3'
|
classpath 'com.tencent.vasdolly:plugin:3.0.3'
|
||||||
classpath "com.mob.sdk:MobSDK:2018.0319.1724"
|
|
||||||
// classpath 'com.google.gms:google-services:4.3.13'
|
|
||||||
// classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2,7 +2,6 @@ apply plugin: 'com.android.library'
|
|||||||
apply plugin: 'realm-android'
|
apply plugin: 'realm-android'
|
||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
apply plugin: 'kotlin-parcelize'
|
apply plugin: 'kotlin-parcelize'
|
||||||
apply from: '../mob.gradle'
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion COMPILE_SDK_VERSION.toInteger()
|
compileSdkVersion COMPILE_SDK_VERSION.toInteger()
|
||||||
|
4
core/src/main/java/cn/sharesdk/framework/Platform.java
Normal file
4
core/src/main/java/cn/sharesdk/framework/Platform.java
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
package cn.sharesdk.framework;
|
||||||
|
|
||||||
|
public class Platform {
|
||||||
|
}
|
@@ -69,10 +69,6 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import cn.sharesdk.framework.Platform;
|
import cn.sharesdk.framework.Platform;
|
||||||
import cn.sharesdk.framework.PlatformActionListener;
|
|
||||||
import cn.sharesdk.framework.ShareSDK;
|
|
||||||
import cn.sharesdk.google.GooglePlus;
|
|
||||||
import cn.sharesdk.line.Line;
|
|
||||||
import io.reactivex.Single;
|
import io.reactivex.Single;
|
||||||
import io.reactivex.SingleEmitter;
|
import io.reactivex.SingleEmitter;
|
||||||
import io.reactivex.SingleOnSubscribe;
|
import io.reactivex.SingleOnSubscribe;
|
||||||
@@ -330,127 +326,127 @@ public class AuthModel extends BaseModel implements IAuthModel {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* facebook登录
|
// * facebook登录
|
||||||
*
|
// *
|
||||||
* @return
|
// * @return
|
||||||
*/
|
// */
|
||||||
@Override
|
// @Override
|
||||||
public Single<String> facebookLogin(JSONObject object) {
|
// public Single<String> facebookLogin(JSONObject object) {
|
||||||
return Single.create((SingleOnSubscribe<JSONObject>) e -> {
|
// return Single.create((SingleOnSubscribe<JSONObject>) e -> {
|
||||||
String name = object.optString("name");
|
// String name = object.optString("name");
|
||||||
String gender = object.optString("gender"); //性别
|
// String gender = object.optString("gender"); //性别
|
||||||
//获取用户头像
|
// //获取用户头像
|
||||||
JSONObject object_pic = object.optJSONObject("picture");
|
// JSONObject object_pic = object.optJSONObject("picture");
|
||||||
JSONObject object_data = object_pic.optJSONObject("data");
|
// JSONObject object_data = object_pic.optJSONObject("data");
|
||||||
String photo = object_data.optString("url");
|
// String photo = object_data.optString("url");
|
||||||
|
//
|
||||||
thirdUserInfo = new ThirdUserInfo();
|
// thirdUserInfo = new ThirdUserInfo();
|
||||||
thirdUserInfo.setType(ThirdUserInfo.TYPE_FACEBOOK);
|
// thirdUserInfo.setType(ThirdUserInfo.TYPE_FACEBOOK);
|
||||||
thirdUserInfo.setPlatform("Facebook");
|
// thirdUserInfo.setPlatform("Facebook");
|
||||||
thirdUserInfo.setUserName(name);
|
// thirdUserInfo.setUserName(name);
|
||||||
thirdUserInfo.setUserGender(gender);
|
// thirdUserInfo.setUserGender(gender);
|
||||||
thirdUserInfo.setUserIcon(photo);
|
// thirdUserInfo.setUserIcon(photo);
|
||||||
e.onSuccess(object);
|
// e.onSuccess(object);
|
||||||
})
|
// })
|
||||||
.flatMap(platform -> {
|
// .flatMap(platform -> {
|
||||||
String openid = platform.optString("id");
|
// String openid = platform.optString("id");
|
||||||
String unionid = platform.optString("id");
|
// String unionid = platform.optString("id");
|
||||||
String avatar = thirdUserInfo.getUserIcon();
|
// String avatar = thirdUserInfo.getUserIcon();
|
||||||
if (avatar != null && avatar.equals("null")) {
|
// if (avatar != null && avatar.equals("null")) {
|
||||||
avatar = null;
|
// avatar = null;
|
||||||
}
|
// }
|
||||||
thirdUserInfo.setUserIcon(avatar);
|
// thirdUserInfo.setUserIcon(avatar);
|
||||||
String gender = thirdUserInfo.getUserGender();
|
// String gender = thirdUserInfo.getUserGender();
|
||||||
if (gender != null && !gender.trim().isEmpty()) {
|
// if (gender != null && !gender.trim().isEmpty()) {
|
||||||
gender = gender.replace("m", "1").replace("f", "2");
|
// gender = gender.replace("m", "1").replace("f", "2");
|
||||||
}
|
// }
|
||||||
thirdUserInfo.setUserGender(gender);
|
// thirdUserInfo.setUserGender(gender);
|
||||||
EventBus.getDefault().post(new LoginReportEvent(1));
|
// EventBus.getDefault().post(new LoginReportEvent(1));
|
||||||
return thirdLogin(openid, unionid, TYPE_FACEBOOK_LOGIN, "", "");
|
// return thirdLogin(openid, unionid, TYPE_FACEBOOK_LOGIN, "", "");
|
||||||
})
|
// })
|
||||||
.flatMap(s -> imLogin(currentAccountInfo))
|
// .flatMap(s -> imLogin(currentAccountInfo))
|
||||||
.subscribeOn(AndroidSchedulers.mainThread())
|
// .subscribeOn(AndroidSchedulers.mainThread())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
// .observeOn(AndroidSchedulers.mainThread())
|
||||||
.doOnSuccess(s -> EventBus.getDefault().post(new LoginEvent()));
|
// .doOnSuccess(s -> EventBus.getDefault().post(new LoginEvent()));
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* line
|
* line
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
// @Override
|
||||||
public Single<String> lineLogin() {
|
// public Single<String> lineLogin() {
|
||||||
return Single.create(new SingleOnSubscribe<Platform>() {
|
// return Single.create(new SingleOnSubscribe<Platform>() {
|
||||||
@Override
|
// @Override
|
||||||
public void subscribe(SingleEmitter<Platform> e) throws Exception {
|
// public void subscribe(SingleEmitter<Platform> e) throws Exception {
|
||||||
line = ShareSDK.getPlatform(Line.NAME);
|
// line = ShareSDK.getPlatform(Line.NAME);
|
||||||
//是否安装客户端
|
// //是否安装客户端
|
||||||
if (!DeviceUtils.isAppInstalled(getContext(), PackageNameConstants.LINE_NAME)) {
|
// if (!DeviceUtils.isAppInstalled(getContext(), PackageNameConstants.LINE_NAME)) {
|
||||||
e.onError(new Throwable(ResUtil.getString(R.string.xchat_android_core_auth_authmodel_06)));
|
// e.onError(new Throwable(ResUtil.getString(R.string.xchat_android_core_auth_authmodel_06)));
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
if (line.isAuthValid()) {
|
// if (line.isAuthValid()) {
|
||||||
line.removeAccount(true);
|
// line.removeAccount(true);
|
||||||
}
|
// }
|
||||||
line.setPlatformActionListener(new PlatformActionListener() {
|
// line.setPlatformActionListener(new PlatformActionListener() {
|
||||||
@Override
|
// @Override
|
||||||
public void onComplete(Platform platform, int i, HashMap<String, Object> hashMap) {
|
// public void onComplete(Platform platform, int i, HashMap<String, Object> hashMap) {
|
||||||
if (i == Platform.ACTION_USER_INFOR) {
|
// if (i == Platform.ACTION_USER_INFOR) {
|
||||||
String openid = platform.getDb().getUserId();
|
// String openid = platform.getDb().getUserId();
|
||||||
String unionid = platform.getDb().get("unionid");
|
// String unionid = platform.getDb().get("unionid");
|
||||||
Logger.i("openid:" + openid + " unionid:" + unionid + platform.getDb().getUserIcon());
|
// Logger.i("openid:" + openid + " unionid:" + unionid + platform.getDb().getUserIcon());
|
||||||
|
//
|
||||||
thirdUserInfo = new ThirdUserInfo();
|
// thirdUserInfo = new ThirdUserInfo();
|
||||||
thirdUserInfo.setType(ThirdUserInfo.TYPE_LINE);
|
// thirdUserInfo.setType(ThirdUserInfo.TYPE_LINE);
|
||||||
thirdUserInfo.setPlatform("LINE");
|
// thirdUserInfo.setPlatform("LINE");
|
||||||
thirdUserInfo.setUserName(platform.getDb().getUserName());
|
// thirdUserInfo.setUserName(platform.getDb().getUserName());
|
||||||
thirdUserInfo.setUserGender(platform.getDb().getUserGender());
|
// thirdUserInfo.setUserGender(platform.getDb().getUserGender());
|
||||||
thirdUserInfo.setUserIcon(platform.getDb().getUserIcon());
|
// thirdUserInfo.setUserIcon(platform.getDb().getUserIcon());
|
||||||
e.onSuccess(platform);
|
// e.onSuccess(platform);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void onError(Platform platform, int i, Throwable throwable) {
|
// public void onError(Platform platform, int i, Throwable throwable) {
|
||||||
e.onError(new Throwable(ResUtil.getString(R.string.xchat_android_core_auth_authmodel_07) + i));
|
// e.onError(new Throwable(ResUtil.getString(R.string.xchat_android_core_auth_authmodel_07) + i));
|
||||||
throwable.printStackTrace();
|
// throwable.printStackTrace();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void onCancel(Platform platform, int i) {
|
// public void onCancel(Platform platform, int i) {
|
||||||
e.onError(new Throwable(ResUtil.getString(R.string.xchat_android_core_auth_authmodel_08)));
|
// e.onError(new Throwable(ResUtil.getString(R.string.xchat_android_core_auth_authmodel_08)));
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
line.SSOSetting(false);
|
// line.SSOSetting(false);
|
||||||
line.showUser(null);
|
// line.showUser(null);
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
.flatMap(platform -> {
|
// .flatMap(platform -> {
|
||||||
String openid = platform.getDb().getUserId();
|
// String openid = platform.getDb().getUserId();
|
||||||
String unionid = platform.getDb().getUserId();
|
// String unionid = platform.getDb().getUserId();
|
||||||
String avatar = thirdUserInfo.getUserIcon();
|
// String avatar = thirdUserInfo.getUserIcon();
|
||||||
if (avatar != null && avatar.equals("null")) {
|
// if (avatar != null && avatar.equals("null")) {
|
||||||
avatar = null;
|
// avatar = null;
|
||||||
}
|
// }
|
||||||
thirdUserInfo.setUserIcon(avatar);
|
// thirdUserInfo.setUserIcon(avatar);
|
||||||
String gender = thirdUserInfo.getUserGender();
|
// String gender = thirdUserInfo.getUserGender();
|
||||||
if (gender != null && !gender.trim().isEmpty()) {
|
// if (gender != null && !gender.trim().isEmpty()) {
|
||||||
gender = gender.replace("m", "1").replace("f", "2");
|
// gender = gender.replace("m", "1").replace("f", "2");
|
||||||
}
|
// }
|
||||||
thirdUserInfo.setUserGender(gender);
|
// thirdUserInfo.setUserGender(gender);
|
||||||
EventBus.getDefault().post(new LoginReportEvent(2));
|
// EventBus.getDefault().post(new LoginReportEvent(2));
|
||||||
return thirdLogin(openid, unionid, TYPE_LINE_LOGIN, "", "");
|
// return thirdLogin(openid, unionid, TYPE_LINE_LOGIN, "", "");
|
||||||
})
|
// })
|
||||||
.flatMap(s -> imLogin(currentAccountInfo))
|
// .flatMap(s -> imLogin(currentAccountInfo))
|
||||||
.subscribeOn(AndroidSchedulers.mainThread())
|
// .subscribeOn(AndroidSchedulers.mainThread())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
// .observeOn(AndroidSchedulers.mainThread())
|
||||||
.compose(RxHelper.handleException())
|
// .compose(RxHelper.handleException())
|
||||||
.doOnSuccess(s -> EventBus.getDefault().post(new LoginEvent()));
|
// .doOnSuccess(s -> EventBus.getDefault().post(new LoginEvent()));
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Single<String> googleLogin(Activity activity) {
|
public Single<String> googleLogin(Activity activity) {
|
||||||
|
@@ -64,9 +64,9 @@ public interface IAuthModel extends IModel {
|
|||||||
*/
|
*/
|
||||||
Single<String> login(String phoneAreaCode, String account, String password, String code, String yiDunToken, String shuMeiDeviceId);
|
Single<String> login(String phoneAreaCode, String account, String password, String code, String yiDunToken, String shuMeiDeviceId);
|
||||||
|
|
||||||
Single<String> facebookLogin(JSONObject object);
|
// Single<String> facebookLogin(JSONObject object);
|
||||||
|
|
||||||
Single<String> lineLogin();
|
// Single<String> lineLogin();
|
||||||
|
|
||||||
// Single<String> googleLogin();
|
// Single<String> googleLogin();
|
||||||
|
|
||||||
|
@@ -4,7 +4,6 @@ import com.chwl.core.share.bean.ShareCommonInfo;
|
|||||||
import com.chwl.core.web.bean.WebJsBeanInfo;
|
import com.chwl.core.web.bean.WebJsBeanInfo;
|
||||||
import com.chwl.library.coremanager.IBaseCore;
|
import com.chwl.library.coremanager.IBaseCore;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import cn.sharesdk.framework.Platform;
|
import cn.sharesdk.framework.Platform;
|
||||||
import io.reactivex.Single;
|
import io.reactivex.Single;
|
||||||
|
@@ -33,9 +33,6 @@ import java.net.URLEncoder;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import cn.sharesdk.framework.Platform;
|
import cn.sharesdk.framework.Platform;
|
||||||
import cn.sharesdk.framework.PlatformActionListener;
|
|
||||||
import cn.sharesdk.google.GooglePlus;
|
|
||||||
import cn.sharesdk.line.Line;
|
|
||||||
import io.reactivex.Single;
|
import io.reactivex.Single;
|
||||||
import io.reactivex.SingleEmitter;
|
import io.reactivex.SingleEmitter;
|
||||||
import io.reactivex.SingleOnSubscribe;
|
import io.reactivex.SingleOnSubscribe;
|
||||||
@@ -70,71 +67,72 @@ public class ShareModel extends BaseModel implements IShareModel {
|
|||||||
return Single.create(new SingleOnSubscribe<String>() {
|
return Single.create(new SingleOnSubscribe<String>() {
|
||||||
@Override
|
@Override
|
||||||
public void subscribe(SingleEmitter<String> emitter) throws Exception {
|
public void subscribe(SingleEmitter<String> emitter) throws Exception {
|
||||||
if (null != webViewInfo && platform != null) {
|
emitter.onError(new Throwable());
|
||||||
Platform.ShareParams sp = new Platform.ShareParams();
|
// if (null != webViewInfo && platform != null) {
|
||||||
if (httpsUrl) {
|
// Platform.ShareParams sp = new Platform.ShareParams();
|
||||||
sp.setImageUrl(webViewInfo.getImgUrl().replace("http:", "https:"));
|
// if (httpsUrl) {
|
||||||
} else {
|
// sp.setImageUrl(webViewInfo.getImgUrl().replace("http:", "https:"));
|
||||||
sp.setImageUrl(webViewInfo.getImgUrl());
|
// } else {
|
||||||
}
|
// sp.setImageUrl(webViewInfo.getImgUrl());
|
||||||
String siteUrl = webViewInfo.getShowUrl();
|
|
||||||
String params = "shareUid=" + String.valueOf(AuthModel.get().getCurrentUid());
|
|
||||||
if (siteUrl.contains("?")) {
|
|
||||||
if (siteUrl.endsWith("?")) {
|
|
||||||
siteUrl += params;
|
|
||||||
} else {
|
|
||||||
siteUrl += "&" + params;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
siteUrl += "?" + params;
|
|
||||||
}
|
|
||||||
// //facebook
|
|
||||||
// if (platform.getName().equals(Facebook.NAME)) {
|
|
||||||
// sp.setTitle(webViewInfo.getTitle());
|
|
||||||
// sp.setText(webViewInfo.getDesc());
|
|
||||||
// sp.setUrl(siteUrl);
|
|
||||||
// sp.setShareType(Platform.SHARE_WEBPAGE);
|
|
||||||
// }
|
// }
|
||||||
//line
|
// String siteUrl = webViewInfo.getShowUrl();
|
||||||
// else
|
// String params = "shareUid=" + String.valueOf(AuthModel.get().getCurrentUid());
|
||||||
if (platform.getName().equals(Line.NAME)) {
|
// if (siteUrl.contains("?")) {
|
||||||
sp.setText(webViewInfo.getDesc() + "[" + webViewInfo.getLink() + "]");
|
// if (siteUrl.endsWith("?")) {
|
||||||
}
|
// siteUrl += params;
|
||||||
|
// } else {
|
||||||
platform.setPlatformActionListener(new PlatformActionListener() {
|
// siteUrl += "&" + params;
|
||||||
@Override
|
// }
|
||||||
public void onComplete(Platform platform, int i, HashMap<String, Object> hashMap) {
|
// } else {
|
||||||
String shareUrl = webViewInfo.getLink();
|
// siteUrl += "?" + params;
|
||||||
if (!shareUrl.contains("?")) {
|
// }
|
||||||
shareUrl += "?shareUid=" + String.valueOf(AuthModel.get().getCurrentUid());
|
//// //facebook
|
||||||
}
|
//// if (platform.getName().equals(Facebook.NAME)) {
|
||||||
String url = UriProvider.getLotteryActivityPage();
|
//// sp.setTitle(webViewInfo.getTitle());
|
||||||
if (url.contains(XChatConstants.SHARE_H5_URL) &&
|
//// sp.setText(webViewInfo.getDesc());
|
||||||
webViewInfo.getShowUrl() != null &&
|
//// sp.setUrl(siteUrl);
|
||||||
webViewInfo.getShowUrl().contains(XChatConstants.SHARE_H5_URL)) {
|
//// sp.setShareType(Platform.SHARE_WEBPAGE);
|
||||||
reportShare(null, 888, platform, shareUrl);
|
//// }
|
||||||
} else {
|
// //line
|
||||||
reportShare(null, 1, platform, shareUrl);
|
//// else
|
||||||
}
|
//// if (platform.getName().equals(Line.NAME)) {
|
||||||
emitter.onSuccess(MSG.success);
|
//// sp.setText(webViewInfo.getDesc() + "[" + webViewInfo.getLink() + "]");
|
||||||
}
|
//// }
|
||||||
|
//
|
||||||
@Override
|
// platform.setPlatformActionListener(new PlatformActionListener() {
|
||||||
public void onError(Platform platform, int i, Throwable throwable) {
|
// @Override
|
||||||
String errorMsg = MSG.failed;
|
// public void onComplete(Platform platform, int i, HashMap<String, Object> hashMap) {
|
||||||
if (throwable.getMessage().contains("not installed")) {
|
// String shareUrl = webViewInfo.getLink();
|
||||||
errorMsg = ResUtil.getString(R.string.not_install_app);
|
// if (!shareUrl.contains("?")) {
|
||||||
}
|
// shareUrl += "?shareUid=" + String.valueOf(AuthModel.get().getCurrentUid());
|
||||||
emitter.onError(new Throwable(errorMsg));
|
// }
|
||||||
}
|
// String url = UriProvider.getLotteryActivityPage();
|
||||||
|
// if (url.contains(XChatConstants.SHARE_H5_URL) &&
|
||||||
@Override
|
// webViewInfo.getShowUrl() != null &&
|
||||||
public void onCancel(Platform platform, int i) {
|
// webViewInfo.getShowUrl().contains(XChatConstants.SHARE_H5_URL)) {
|
||||||
emitter.onError(new Throwable(MSG.cancel));
|
// reportShare(null, 888, platform, shareUrl);
|
||||||
}
|
// } else {
|
||||||
});
|
// reportShare(null, 1, platform, shareUrl);
|
||||||
platform.share(sp);
|
// }
|
||||||
}
|
// emitter.onSuccess(MSG.success);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onError(Platform platform, int i, Throwable throwable) {
|
||||||
|
// String errorMsg = MSG.failed;
|
||||||
|
// if (throwable.getMessage().contains("not installed")) {
|
||||||
|
// errorMsg = ResUtil.getString(R.string.not_install_app);
|
||||||
|
// }
|
||||||
|
// emitter.onError(new Throwable(errorMsg));
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onCancel(Platform platform, int i) {
|
||||||
|
// emitter.onError(new Throwable(MSG.cancel));
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// platform.share(sp);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -155,65 +153,66 @@ public class ShareModel extends BaseModel implements IShareModel {
|
|||||||
return Single.create(new SingleOnSubscribe<String>() {
|
return Single.create(new SingleOnSubscribe<String>() {
|
||||||
@Override
|
@Override
|
||||||
public void subscribe(SingleEmitter<String> emitter) throws Exception {
|
public void subscribe(SingleEmitter<String> emitter) throws Exception {
|
||||||
|
emitter.onError(new Throwable());
|
||||||
//无UI API
|
//无UI API
|
||||||
if (platform != null) {
|
// if (platform != null) {
|
||||||
String name = platform.getName();
|
// String name = platform.getName();
|
||||||
final String siteUrl = UriProvider.IM_SERVER_URL + XChatConstants.SHARE_ROOM_URL +
|
// final String siteUrl = UriProvider.IM_SERVER_URL + XChatConstants.SHARE_ROOM_URL +
|
||||||
AuthModel.get().getCurrentUid() + "&uid=" + roomUid + "&room_name=" +
|
// AuthModel.get().getCurrentUid() + "&uid=" + roomUid + "&room_name=" +
|
||||||
URLEncoder.encode(title, "utf8") + "&room_id=" + roomId + "&room_avatar=" +
|
// URLEncoder.encode(title, "utf8") + "&room_id=" + roomId + "&room_avatar=" +
|
||||||
URLEncoder.encode(room_avatar, "utf8") + "&share_name=" +
|
// URLEncoder.encode(room_avatar, "utf8") + "&share_name=" +
|
||||||
URLEncoder.encode(UserModel.get().getCacheLoginUserInfo().getNick(), "utf8");
|
// URLEncoder.encode(UserModel.get().getCacheLoginUserInfo().getNick(), "utf8");
|
||||||
if (name.equals("GooglePlus")) {
|
// if (name.equals("GooglePlus")) {
|
||||||
try {
|
// try {
|
||||||
ClipboardManager cm = (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE);
|
// ClipboardManager cm = (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE);
|
||||||
cm.setPrimaryClip(ClipData.newPlainText("text", siteUrl));
|
// cm.setPrimaryClip(ClipData.newPlainText("text", siteUrl));
|
||||||
emitter.onSuccess("已複製");
|
// emitter.onSuccess("已複製");
|
||||||
} catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
Logger.info("copyText", String.valueOf(e));
|
// Logger.info("copyText", String.valueOf(e));
|
||||||
emitter.onError(new Throwable(String.valueOf(e)));
|
// emitter.onError(new Throwable(String.valueOf(e)));
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Platform.ShareParams sp = new Platform.ShareParams();
|
|
||||||
sp.setImageUrl(room_avatar);
|
|
||||||
|
|
||||||
//facebook
|
|
||||||
// if (platform.getName().equals(Facebook.NAME)) {
|
|
||||||
// sp.setTitle(XChatConstants.SHARE_ROOM_TITLE);
|
|
||||||
// sp.setText(XChatConstants.SHARE_ROOM_TEXT);
|
|
||||||
// sp.setUrl(siteUrl);
|
|
||||||
// sp.setShareType(Platform.SHARE_WEBPAGE);
|
|
||||||
// }
|
// }
|
||||||
//line
|
// } else {
|
||||||
// else
|
// Platform.ShareParams sp = new Platform.ShareParams();
|
||||||
if (platform.getName().equals(Line.NAME)) {
|
// sp.setImageUrl(room_avatar);
|
||||||
sp.setText(XChatConstants.SHARE_ROOM_TEXT + "[" + siteUrl + "]");
|
//
|
||||||
}
|
// //facebook
|
||||||
|
//// if (platform.getName().equals(Facebook.NAME)) {
|
||||||
platform.setPlatformActionListener(new PlatformActionListener() {
|
//// sp.setTitle(XChatConstants.SHARE_ROOM_TITLE);
|
||||||
@Override
|
//// sp.setText(XChatConstants.SHARE_ROOM_TEXT);
|
||||||
public void onComplete(Platform platform, int i, HashMap<String, Object> hashMap) {
|
//// sp.setUrl(siteUrl);
|
||||||
sendShareRoomTipMsg(roomUid);
|
//// sp.setShareType(Platform.SHARE_WEBPAGE);
|
||||||
reportShare(String.valueOf(roomUid), 1, platform, siteUrl);
|
//// }
|
||||||
emitter.onSuccess(MSG.success);
|
// //line
|
||||||
}
|
//// else
|
||||||
|
//// if (platform.getName().equals(Line.NAME)) {
|
||||||
@Override
|
//// sp.setText(XChatConstants.SHARE_ROOM_TEXT + "[" + siteUrl + "]");
|
||||||
public void onError(Platform platform, int i, Throwable throwable) {
|
//// }
|
||||||
String errorMsg = MSG.failed;
|
//
|
||||||
if (throwable.getMessage().contains("not installed")) {
|
// platform.setPlatformActionListener(new PlatformActionListener() {
|
||||||
errorMsg = ResUtil.getString(R.string.not_install_app);
|
// @Override
|
||||||
}
|
// public void onComplete(Platform platform, int i, HashMap<String, Object> hashMap) {
|
||||||
emitter.onError(new Throwable(errorMsg));
|
// sendShareRoomTipMsg(roomUid);
|
||||||
}
|
// reportShare(String.valueOf(roomUid), 1, platform, siteUrl);
|
||||||
|
// emitter.onSuccess(MSG.success);
|
||||||
@Override
|
// }
|
||||||
public void onCancel(Platform platform, int i) {
|
//
|
||||||
emitter.onError(new Throwable(MSG.cancel));
|
// @Override
|
||||||
}
|
// public void onError(Platform platform, int i, Throwable throwable) {
|
||||||
});
|
// String errorMsg = MSG.failed;
|
||||||
platform.share(sp);
|
// if (throwable.getMessage().contains("not installed")) {
|
||||||
}
|
// errorMsg = ResUtil.getString(R.string.not_install_app);
|
||||||
}
|
// }
|
||||||
|
// emitter.onError(new Throwable(errorMsg));
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onCancel(Platform platform, int i) {
|
||||||
|
// emitter.onError(new Throwable(MSG.cancel));
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// platform.share(sp);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -227,26 +226,26 @@ public class ShareModel extends BaseModel implements IShareModel {
|
|||||||
* @param shareUrl
|
* @param shareUrl
|
||||||
*/
|
*/
|
||||||
private void reportShare(String roomUid, int sharePageId, Platform platform, String shareUrl) {
|
private void reportShare(String roomUid, int sharePageId, Platform platform, String shareUrl) {
|
||||||
int shareType = 0;
|
// int shareType = 0;
|
||||||
if (platform.getName().equals(GooglePlus.NAME)) {
|
// if (platform.getName().equals(GooglePlus.NAME)) {
|
||||||
shareType = 1;
|
// shareType = 1;
|
||||||
} else if (platform.getName().equals(Line.NAME)) {
|
// } else if (platform.getName().equals(Line.NAME)) {
|
||||||
shareType = 2;
|
// shareType = 2;
|
||||||
// } else if (platform.getName().equals(Facebook.NAME)) {
|
// } else if (platform.getName().equals(Facebook.NAME)) {
|
||||||
// shareType = 3;
|
// shareType = 3;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
api.getShareRedPacket(
|
// api.getShareRedPacket(
|
||||||
String.valueOf(AuthModel.get().getCurrentUid()),
|
// String.valueOf(AuthModel.get().getCurrentUid()),
|
||||||
roomUid,
|
// roomUid,
|
||||||
String.valueOf(shareType),
|
// String.valueOf(shareType),
|
||||||
sharePageId + "",
|
// sharePageId + "",
|
||||||
shareUrl,
|
// shareUrl,
|
||||||
AuthModel.get().getTicket()
|
// AuthModel.get().getTicket()
|
||||||
)
|
// )
|
||||||
.subscribeOn(Schedulers.io())
|
// .subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
// .observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe();
|
// .subscribe();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -258,41 +257,42 @@ public class ShareModel extends BaseModel implements IShareModel {
|
|||||||
return Single.create(new SingleOnSubscribe<String>() {
|
return Single.create(new SingleOnSubscribe<String>() {
|
||||||
@Override
|
@Override
|
||||||
public void subscribe(SingleEmitter<String> emitter) throws Exception {
|
public void subscribe(SingleEmitter<String> emitter) throws Exception {
|
||||||
|
emitter.onError(new Throwable());
|
||||||
//无UI API
|
//无UI API
|
||||||
final String shareLink = UriProvider.IM_SERVER_URL + XChatConstants.SHARE_FAMILY_URL;
|
// final String shareLink = UriProvider.IM_SERVER_URL + XChatConstants.SHARE_FAMILY_URL;
|
||||||
Platform.ShareParams sp = new Platform.ShareParams();
|
// Platform.ShareParams sp = new Platform.ShareParams();
|
||||||
sp.setText(XChatConstants.SHARE_FAMILY_TEXT);
|
// sp.setText(XChatConstants.SHARE_FAMILY_TEXT);
|
||||||
sp.setTitle(XChatConstants.SHARE_FAMILY_TITLE + "“" + title + "”");
|
// sp.setTitle(XChatConstants.SHARE_FAMILY_TITLE + "“" + title + "”");
|
||||||
sp.setImageUrl(familyIcon);
|
// sp.setImageUrl(familyIcon);
|
||||||
|
//
|
||||||
sp.setSite(XChatConstants.SHARE_FAMILY_TEXT);
|
// sp.setSite(XChatConstants.SHARE_FAMILY_TEXT);
|
||||||
final String siteUrl = shareLink + "?shareUid=" + String.valueOf(AuthModel.get().getCurrentUid())
|
// final String siteUrl = shareLink + "?shareUid=" + String.valueOf(AuthModel.get().getCurrentUid())
|
||||||
+ "&familyId=" + familyId;
|
// + "&familyId=" + familyId;
|
||||||
sp.setSiteUrl(siteUrl);
|
// sp.setSiteUrl(siteUrl);
|
||||||
|
//
|
||||||
sp.setTitleUrl(siteUrl);
|
// sp.setTitleUrl(siteUrl);
|
||||||
|
//
|
||||||
sp.setUrl(siteUrl);
|
// sp.setUrl(siteUrl);
|
||||||
|
//
|
||||||
sp.setShareType(Platform.SHARE_WEBPAGE);
|
// sp.setShareType(Platform.SHARE_WEBPAGE);
|
||||||
platform.setPlatformActionListener(new PlatformActionListener() {
|
// platform.setPlatformActionListener(new PlatformActionListener() {
|
||||||
@Override
|
// @Override
|
||||||
public void onComplete(Platform platform, int i, HashMap<String, Object> hashMap) {
|
// public void onComplete(Platform platform, int i, HashMap<String, Object> hashMap) {
|
||||||
reportShare(null, 1, platform, siteUrl);
|
// reportShare(null, 1, platform, siteUrl);
|
||||||
emitter.onSuccess(MSG.success);
|
// emitter.onSuccess(MSG.success);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void onError(Platform platform, int i, Throwable throwable) {
|
// public void onError(Platform platform, int i, Throwable throwable) {
|
||||||
emitter.onError(new Throwable(MSG.cancel));
|
// emitter.onError(new Throwable(MSG.cancel));
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void onCancel(Platform platform, int i) {
|
// public void onCancel(Platform platform, int i) {
|
||||||
emitter.onError(new Throwable(MSG.failed));
|
// emitter.onError(new Throwable(MSG.failed));
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
platform.share(sp);
|
// platform.share(sp);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -303,41 +303,42 @@ public class ShareModel extends BaseModel implements IShareModel {
|
|||||||
return Single.create(new SingleOnSubscribe<String>() {
|
return Single.create(new SingleOnSubscribe<String>() {
|
||||||
@Override
|
@Override
|
||||||
public void subscribe(SingleEmitter<String> emitter) throws Exception {
|
public void subscribe(SingleEmitter<String> emitter) throws Exception {
|
||||||
//无UI API
|
emitter.onError(new Throwable());
|
||||||
final String shareLink = UriProvider.IM_SERVER_URL + XChatConstants.SHARE_TEAM_URL;
|
// //无UI API
|
||||||
Platform.ShareParams sp = new Platform.ShareParams();
|
// final String shareLink = UriProvider.IM_SERVER_URL + XChatConstants.SHARE_TEAM_URL;
|
||||||
sp.setText(XChatConstants.SHARE_TEAM_TEXT);
|
// Platform.ShareParams sp = new Platform.ShareParams();
|
||||||
sp.setTitle(XChatConstants.SHARE_TEAM_TITLE + "“" + title + "”");
|
// sp.setText(XChatConstants.SHARE_TEAM_TEXT);
|
||||||
sp.setImageUrl(teamIcon);
|
// sp.setTitle(XChatConstants.SHARE_TEAM_TITLE + "“" + title + "”");
|
||||||
|
// sp.setImageUrl(teamIcon);
|
||||||
sp.setSite(XChatConstants.SHARE_TEAM_TEXT);
|
//
|
||||||
final String siteUrl = shareLink + "?shareUid=" + String.valueOf(AuthModel.get().getCurrentUid())
|
// sp.setSite(XChatConstants.SHARE_TEAM_TEXT);
|
||||||
+ "&familyId=" + familyId;
|
// final String siteUrl = shareLink + "?shareUid=" + String.valueOf(AuthModel.get().getCurrentUid())
|
||||||
sp.setSiteUrl(siteUrl);
|
// + "&familyId=" + familyId;
|
||||||
|
// sp.setSiteUrl(siteUrl);
|
||||||
sp.setTitleUrl(siteUrl);
|
//
|
||||||
|
// sp.setTitleUrl(siteUrl);
|
||||||
sp.setUrl(siteUrl);
|
//
|
||||||
|
// sp.setUrl(siteUrl);
|
||||||
sp.setShareType(Platform.SHARE_WEBPAGE);
|
//
|
||||||
platform.setPlatformActionListener(new PlatformActionListener() {
|
// sp.setShareType(Platform.SHARE_WEBPAGE);
|
||||||
@Override
|
// platform.setPlatformActionListener(new PlatformActionListener() {
|
||||||
public void onComplete(Platform platform, int i, HashMap<String, Object> hashMap) {
|
// @Override
|
||||||
reportShare(null, 1, platform, siteUrl);
|
// public void onComplete(Platform platform, int i, HashMap<String, Object> hashMap) {
|
||||||
emitter.onSuccess(MSG.success);
|
// reportShare(null, 1, platform, siteUrl);
|
||||||
}
|
// emitter.onSuccess(MSG.success);
|
||||||
|
// }
|
||||||
@Override
|
//
|
||||||
public void onError(Platform platform, int i, Throwable throwable) {
|
// @Override
|
||||||
emitter.onError(new Throwable(MSG.failed));
|
// public void onError(Platform platform, int i, Throwable throwable) {
|
||||||
}
|
// emitter.onError(new Throwable(MSG.failed));
|
||||||
|
// }
|
||||||
@Override
|
//
|
||||||
public void onCancel(Platform platform, int i) {
|
// @Override
|
||||||
emitter.onError(new Throwable(MSG.cancel));
|
// public void onCancel(Platform platform, int i) {
|
||||||
}
|
// emitter.onError(new Throwable(MSG.cancel));
|
||||||
});
|
// }
|
||||||
platform.share(sp);
|
// });
|
||||||
|
// platform.share(sp);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -347,28 +348,29 @@ public class ShareModel extends BaseModel implements IShareModel {
|
|||||||
@Override
|
@Override
|
||||||
public Single<String> shareText(Platform platform, String text) {
|
public Single<String> shareText(Platform platform, String text) {
|
||||||
return Single.create(emitter -> {
|
return Single.create(emitter -> {
|
||||||
Platform.ShareParams sp = new Platform.ShareParams();
|
emitter.onError(new Throwable());
|
||||||
sp.setTitle("");
|
// Platform.ShareParams sp = new Platform.ShareParams();
|
||||||
sp.setText(text);
|
// sp.setTitle("");
|
||||||
sp.setImageUrl("");
|
// sp.setText(text);
|
||||||
sp.setShareType(Platform.SHARE_TEXT);
|
// sp.setImageUrl("");
|
||||||
platform.setPlatformActionListener(new PlatformActionListener() {
|
// sp.setShareType(Platform.SHARE_TEXT);
|
||||||
@Override
|
// platform.setPlatformActionListener(new PlatformActionListener() {
|
||||||
public void onComplete(Platform platform1, int i, HashMap<String, Object> hashMap) {
|
// @Override
|
||||||
emitter.onSuccess(MSG.success);
|
// public void onComplete(Platform platform1, int i, HashMap<String, Object> hashMap) {
|
||||||
}
|
// emitter.onSuccess(MSG.success);
|
||||||
|
// }
|
||||||
@Override
|
//
|
||||||
public void onError(Platform platform1, int i, Throwable throwable) {
|
// @Override
|
||||||
emitter.onError(new Throwable(MSG.failed));
|
// public void onError(Platform platform1, int i, Throwable throwable) {
|
||||||
}
|
// emitter.onError(new Throwable(MSG.failed));
|
||||||
|
// }
|
||||||
@Override
|
//
|
||||||
public void onCancel(Platform platform1, int i) {
|
// @Override
|
||||||
emitter.onError(new Throwable(MSG.cancel));
|
// public void onCancel(Platform platform1, int i) {
|
||||||
}
|
// emitter.onError(new Throwable(MSG.cancel));
|
||||||
});
|
// }
|
||||||
platform.share(sp);
|
// });
|
||||||
|
// platform.share(sp);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -408,55 +410,56 @@ public class ShareModel extends BaseModel implements IShareModel {
|
|||||||
|
|
||||||
public void shareImage(Platform platform, String url) {
|
public void shareImage(Platform platform, String url) {
|
||||||
//无UI API
|
//无UI API
|
||||||
final String shareLink = UriProvider.IM_SERVER_URL + XChatConstants.SHARE_TEAM_URL;
|
// final String shareLink = UriProvider.IM_SERVER_URL + XChatConstants.SHARE_TEAM_URL;
|
||||||
Platform.ShareParams sp = new Platform.ShareParams();
|
// Platform.ShareParams sp = new Platform.ShareParams();
|
||||||
sp.setImageUrl(url);
|
// sp.setImageUrl(url);
|
||||||
|
//
|
||||||
sp.setSite(XChatConstants.SHARE_TEAM_TEXT);
|
// sp.setSite(XChatConstants.SHARE_TEAM_TEXT);
|
||||||
|
//
|
||||||
sp.setShareType(Platform.SHARE_IMAGE);
|
// sp.setShareType(Platform.SHARE_IMAGE);
|
||||||
platform.setPlatformActionListener(new PlatformActionListener() {
|
// platform.setPlatformActionListener(new PlatformActionListener() {
|
||||||
@Override
|
// @Override
|
||||||
public void onComplete(Platform platform, int i, HashMap<String, Object> hashMap) {
|
// public void onComplete(Platform platform, int i, HashMap<String, Object> hashMap) {
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void onError(Platform platform, int i, Throwable throwable) {
|
// public void onError(Platform platform, int i, Throwable throwable) {
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void onCancel(Platform platform, int i) {
|
// public void onCancel(Platform platform, int i) {
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
platform.share(sp);
|
// platform.share(sp);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Single<String> shareImageForSignIn(Platform platform, String url) {
|
public Single<String> shareImageForSignIn(Platform platform, String url) {
|
||||||
|
|
||||||
return Single.create(emitter -> {
|
return Single.create(emitter -> {
|
||||||
Platform.ShareParams sp = new Platform.ShareParams();
|
emitter.onError(new Throwable());
|
||||||
sp.setImageUrl(url);
|
// Platform.ShareParams sp = new Platform.ShareParams();
|
||||||
|
// sp.setImageUrl(url);
|
||||||
sp.setSite(XChatConstants.SHARE_TEAM_TEXT);
|
//
|
||||||
|
// sp.setSite(XChatConstants.SHARE_TEAM_TEXT);
|
||||||
sp.setShareType(Platform.SHARE_IMAGE);
|
//
|
||||||
platform.setPlatformActionListener(new PlatformActionListener() {
|
// sp.setShareType(Platform.SHARE_IMAGE);
|
||||||
@Override
|
// platform.setPlatformActionListener(new PlatformActionListener() {
|
||||||
public void onComplete(Platform platform1, int i, HashMap<String, Object> hashMap) {
|
// @Override
|
||||||
emitter.onSuccess(MSG.success);
|
// public void onComplete(Platform platform1, int i, HashMap<String, Object> hashMap) {
|
||||||
}
|
// emitter.onSuccess(MSG.success);
|
||||||
|
// }
|
||||||
@Override
|
//
|
||||||
public void onError(Platform platform1, int i, Throwable throwable) {
|
// @Override
|
||||||
emitter.onError(new Throwable(MSG.failed));
|
// public void onError(Platform platform1, int i, Throwable throwable) {
|
||||||
}
|
// emitter.onError(new Throwable(MSG.failed));
|
||||||
|
// }
|
||||||
@Override
|
//
|
||||||
public void onCancel(Platform platform1, int i) {
|
// @Override
|
||||||
emitter.onError(new Throwable(MSG.cancel));
|
// public void onCancel(Platform platform1, int i) {
|
||||||
}
|
// emitter.onError(new Throwable(MSG.cancel));
|
||||||
});
|
// }
|
||||||
platform.share(sp);
|
// });
|
||||||
|
// platform.share(sp);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -465,36 +468,37 @@ public class ShareModel extends BaseModel implements IShareModel {
|
|||||||
public Single<String> shareCommon(Platform platform, ShareCommonInfo info, boolean toast) {
|
public Single<String> shareCommon(Platform platform, ShareCommonInfo info, boolean toast) {
|
||||||
|
|
||||||
return Single.create((SingleOnSubscribe<String>) emitter -> {
|
return Single.create((SingleOnSubscribe<String>) emitter -> {
|
||||||
Platform.ShareParams sp = new Platform.ShareParams();
|
emitter.onError(new Throwable());
|
||||||
sp.setTitle(info.getTitle());
|
// Platform.ShareParams sp = new Platform.ShareParams();
|
||||||
sp.setText(info.getContent());
|
// sp.setTitle(info.getTitle());
|
||||||
sp.setImageUrl(info.getImageUrl());
|
// sp.setText(info.getContent());
|
||||||
String siteUrl = info.getSiteUrl();
|
// sp.setImageUrl(info.getImageUrl());
|
||||||
|
// String siteUrl = info.getSiteUrl();
|
||||||
sp.setSite(info.getTitle());
|
//
|
||||||
sp.setSiteUrl(siteUrl);
|
// sp.setSite(info.getTitle());
|
||||||
|
// sp.setSiteUrl(siteUrl);
|
||||||
sp.setTitleUrl(siteUrl);
|
//
|
||||||
|
// sp.setTitleUrl(siteUrl);
|
||||||
sp.setUrl(siteUrl);
|
//
|
||||||
sp.setShareType(Platform.SHARE_WEBPAGE);
|
// sp.setUrl(siteUrl);
|
||||||
platform.setPlatformActionListener(new PlatformActionListener() {
|
// sp.setShareType(Platform.SHARE_WEBPAGE);
|
||||||
@Override
|
// platform.setPlatformActionListener(new PlatformActionListener() {
|
||||||
public void onComplete(Platform platform1, int i, HashMap<String, Object> hashMap) {
|
// @Override
|
||||||
emitter.onSuccess(MSG.success);
|
// public void onComplete(Platform platform1, int i, HashMap<String, Object> hashMap) {
|
||||||
}
|
// emitter.onSuccess(MSG.success);
|
||||||
|
// }
|
||||||
@Override
|
//
|
||||||
public void onError(Platform platform1, int i, Throwable throwable) {
|
// @Override
|
||||||
emitter.onError(new Throwable(MSG.failed));
|
// public void onError(Platform platform1, int i, Throwable throwable) {
|
||||||
}
|
// emitter.onError(new Throwable(MSG.failed));
|
||||||
|
// }
|
||||||
@Override
|
//
|
||||||
public void onCancel(Platform platform1, int i) {
|
// @Override
|
||||||
emitter.onError(new Throwable(MSG.cancel));
|
// public void onCancel(Platform platform1, int i) {
|
||||||
}
|
// emitter.onError(new Throwable(MSG.cancel));
|
||||||
});
|
// }
|
||||||
platform.share(sp);
|
// });
|
||||||
|
// platform.share(sp);
|
||||||
})
|
})
|
||||||
.doOnSuccess(s -> {
|
.doOnSuccess(s -> {
|
||||||
if (toast) {
|
if (toast) {
|
||||||
|
53
mob.gradle
53
mob.gradle
@@ -1,53 +0,0 @@
|
|||||||
apply plugin: 'com.mob.sdk'
|
|
||||||
|
|
||||||
MobSDK {
|
|
||||||
// appKey "32fd2f8457880"
|
|
||||||
// appSecret "ef796ca85e8cd95a76929663de133214"
|
|
||||||
appKey ""
|
|
||||||
appSecret ""
|
|
||||||
appBundleMode true
|
|
||||||
// MobLink {
|
|
||||||
// uriScheme "ananplay://sharesdk"
|
|
||||||
// appLinkHost "bvgw.t4m.cn"
|
|
||||||
// }
|
|
||||||
ShareSDK {
|
|
||||||
version '3.10.9'
|
|
||||||
//平台配置信息
|
|
||||||
gui false
|
|
||||||
devInfo {
|
|
||||||
GooglePlus {
|
|
||||||
appId "...com"
|
|
||||||
callbackUri "http://localhost"
|
|
||||||
officialVersion "default"
|
|
||||||
enable true
|
|
||||||
}
|
|
||||||
// GooglePlus {
|
|
||||||
// appId "280420698373-najdbkk7ju8lg8f6gg4bnll8nf7l0i2c.apps.googleusercontent.com"
|
|
||||||
// callbackUri "http://localhost"
|
|
||||||
// officialVersion "default"
|
|
||||||
// enable true
|
|
||||||
// }
|
|
||||||
Line {
|
|
||||||
appId ""
|
|
||||||
appSecret ""
|
|
||||||
enable true
|
|
||||||
}
|
|
||||||
// Line {
|
|
||||||
// appId "1655904857"
|
|
||||||
// appSecret "392a9cada6f63a88a0f34a8e479364e1"
|
|
||||||
// enable true
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
permissions {
|
|
||||||
exclude "android.permission.READ_PHONE_STATE", "android.permission.ACCESS_FINE_LOCATION",
|
|
||||||
"android.permission.ACCESS_COARSE_LOCATION", "android.permission.QUERY_ALL_PACKAGES",
|
|
||||||
"android.permission.GET_ACCOUNTS", "android.permission.ACCESS_WIFI_STATE",
|
|
||||||
"android.permission.READ_SMS", "android.permission.RECEIVE_SMS",
|
|
||||||
"android.permission.READ_CONTACTS"
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@@ -1,24 +0,0 @@
|
|||||||
package com.example.module_base
|
|
||||||
|
|
||||||
import androidx.test.platform.app.InstrumentationRegistry
|
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
|
||||||
|
|
||||||
import org.junit.Test
|
|
||||||
import org.junit.runner.RunWith
|
|
||||||
|
|
||||||
import org.junit.Assert.*
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Instrumented test, which will execute on an Android device.
|
|
||||||
*
|
|
||||||
* See [testing documentation](http://d.android.com/tools/testing).
|
|
||||||
*/
|
|
||||||
@RunWith(AndroidJUnit4::class)
|
|
||||||
class ExampleInstrumentedTest {
|
|
||||||
@Test
|
|
||||||
fun useAppContext() {
|
|
||||||
// Context of the app under test.
|
|
||||||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
|
|
||||||
assertEquals("com.example.module_base.test", appContext.packageName)
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,17 +0,0 @@
|
|||||||
package com.example.module_base
|
|
||||||
|
|
||||||
import org.junit.Test
|
|
||||||
|
|
||||||
import org.junit.Assert.*
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Example local unit test, which will execute on the development machine (host).
|
|
||||||
*
|
|
||||||
* See [testing documentation](http://d.android.com/tools/testing).
|
|
||||||
*/
|
|
||||||
class ExampleUnitTest {
|
|
||||||
@Test
|
|
||||||
fun addition_isCorrect() {
|
|
||||||
assertEquals(4, 2 + 2)
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,24 +0,0 @@
|
|||||||
package com.example.module_google
|
|
||||||
|
|
||||||
import androidx.test.platform.app.InstrumentationRegistry
|
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
|
||||||
|
|
||||||
import org.junit.Test
|
|
||||||
import org.junit.runner.RunWith
|
|
||||||
|
|
||||||
import org.junit.Assert.*
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Instrumented test, which will execute on an Android device.
|
|
||||||
*
|
|
||||||
* See [testing documentation](http://d.android.com/tools/testing).
|
|
||||||
*/
|
|
||||||
@RunWith(AndroidJUnit4::class)
|
|
||||||
class ExampleInstrumentedTest {
|
|
||||||
@Test
|
|
||||||
fun useAppContext() {
|
|
||||||
// Context of the app under test.
|
|
||||||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
|
|
||||||
assertEquals("com.example.module_google.test", appContext.packageName)
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,17 +0,0 @@
|
|||||||
package com.example.module_google
|
|
||||||
|
|
||||||
import org.junit.Test
|
|
||||||
|
|
||||||
import org.junit.Assert.*
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Example local unit test, which will execute on the development machine (host).
|
|
||||||
*
|
|
||||||
* See [testing documentation](http://d.android.com/tools/testing).
|
|
||||||
*/
|
|
||||||
class ExampleUnitTest {
|
|
||||||
@Test
|
|
||||||
fun addition_isCorrect() {
|
|
||||||
assertEquals(4, 2 + 2)
|
|
||||||
}
|
|
||||||
}
|
|
@@ -10,7 +10,7 @@
|
|||||||
<Twitter Enable="false" />
|
<Twitter Enable="false" />
|
||||||
<Evernote Enable="false" />
|
<Evernote Enable="false" />
|
||||||
<FourSquare Enable="false" />
|
<FourSquare Enable="false" />
|
||||||
<GooglePlus OfficialVersion="default" Enable="true" ClientID="...com" RedirectUrl="http://localhost" />
|
<GooglePlus Enable="false" />
|
||||||
<Instagram Enable="false" />
|
<Instagram Enable="false" />
|
||||||
<LinkedIn Enable="false" />
|
<LinkedIn Enable="false" />
|
||||||
<Tumblr Enable="false" />
|
<Tumblr Enable="false" />
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
<Yixin Enable="false" />
|
<Yixin Enable="false" />
|
||||||
<YixinMoments Enable="false" />
|
<YixinMoments Enable="false" />
|
||||||
<Mingdao Enable="false" />
|
<Mingdao Enable="false" />
|
||||||
<Line Enable="true" ChannelID="" ChannelSecret="" />
|
<Line Enable="false" />
|
||||||
<WhatsApp Enable="false" />
|
<WhatsApp Enable="false" />
|
||||||
<KakaoTalk Enable="false" />
|
<KakaoTalk Enable="false" />
|
||||||
<KakaoStory Enable="false" />
|
<KakaoStory Enable="false" />
|
||||||
|
Reference in New Issue
Block a user