Prechádzať zdrojové kódy

添加渠道接入功能,测试接入oppo渠道。

kaiweicai 2 rokov pred
rodič
commit
425dcc9c87
52 zmenil súbory, kde vykonal 1446 pridanie a 79 odobranie
  1. 4 2
      demo/build.gradle
  2. 0 1
      library_base/build.gradle
  3. 1 1
      library_channel/build.gradle
  4. 4 0
      library_channel/src/main/java/cn/yyxx/commsdk/impl/ChannelSdkGenerator.java
  5. 1 1
      library_channel/src/main/java/cn/yyxx/commsdk/impl/ChannelSdkImpl.java
  6. 230 0
      library_channel/src/main/java/cn/yyxx/commsdk/impl/channel/ChannelSdk.java
  7. 0 1
      library_channel/src/main/java/cn/yyxx/commsdk/impl/channel/ChannelSdkYYXX.java
  8. 58 0
      library_channel/src/main/java/cn/yyxx/commsdk/impl/channel/SdkProxyChannelManager.java
  9. 1 1
      library_channel/src/main/java/cn/yyxx/commsdk/impl/entity/ChannelId.java
  10. 4 0
      library_channel_repository/build.gradle
  11. 1 0
      library_channel_repository/oppo/.gitignore
  12. 49 0
      library_channel_repository/oppo/build.gradle
  13. 0 0
      library_channel_repository/oppo/consumer-rules.pro
  14. BIN
      library_channel_repository/oppo/libs/android-support-v4.jar
  15. BIN
      library_channel_repository/oppo/libs/core-1.1.0.aar
  16. BIN
      library_channel_repository/oppo/libs/gamesdk-20220310.aar
  17. BIN
      library_channel_repository/oppo/libs/gamesdk-common-20220310.aar
  18. BIN
      library_channel_repository/oppo/libs/oaid_sdk_1.0.25.aar
  19. 21 0
      library_channel_repository/oppo/proguard-rules.pro
  20. 17 0
      library_channel_repository/oppo/src/main/AndroidManifest.xml
  21. BIN
      library_channel_repository/oppo/src/main/assets/nearme/oppo_game_service_305002.so
  22. BIN
      library_channel_repository/oppo/src/main/assets/opay_version
  23. 17 0
      library_channel_repository/oppo/src/main/assets/supplierconfig.json
  24. 7 0
      library_channel_repository/oppo/src/main/assets/yyxx_game/yyxx_cfg.properties
  25. 40 0
      library_channel_repository/oppo/src/main/java/cn/yyxx/commsdk/LoginViewModel.java
  26. 158 0
      library_channel_repository/oppo/src/main/java/cn/yyxx/commsdk/impl/channel/ChannelBridge.java
  27. 0 0
      library_channel_repository/oppo/src/main/java/cn/yyxx/commsdk/impl/channel/msa/MsaDeviceHandler.java
  28. 362 0
      library_channel_repository/oppo/src/main/java/cn/yyxx/commsdk/impl/channel/oppo/ChannelBridgeImpl.java
  29. 20 0
      library_channel_repository/oppo/src/main/java/cn/yyxx/commsdk/impl/channel/utils/ParamsUtils.java
  30. 0 4
      library_channel_repository/src/main/AndroidManifest.xml
  31. 0 8
      library_channel_repository/src/main/java/cn/yyxx/commsdk/impl/ChannelBridge.java
  32. 4 3
      library_core/src/main/java/cn/yyxx/commsdk/core/common/CommonOperationManager.java
  33. 18 2
      library_core/src/main/java/cn/yyxx/commsdk/core/entity/SdkLoginInfo.java
  34. 1 1
      library_core/src/main/java/cn/yyxx/commsdk/core/impl/SdkBridgeImpl.java
  35. 2 1
      library_core/src/main/java/cn/yyxx/commsdk/core/network/Hosts.java
  36. 40 0
      library_core/src/main/java/cn/yyxx/commsdk/core/network/SdkRequest.java
  37. 2 2
      library_core/src/main/java/cn/yyxx/commsdk/core/ui/dialog/LoadingDialogUtils.java
  38. 1 1
      library_core/src/main/java/cn/yyxx/commsdk/core/ui/dialog/SingleButtonDialog.java
  39. 7 1
      library_core/src/main/java/cn/yyxx/commsdk/core/utils/ParamsUtils.java
  40. 1 15
      library_core/src/main/res/values/yyxx_comm_styles.xml
  41. 3 3
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/SdkPlatformBridge.java
  42. 4 5
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/HNYYLoginActivity.java
  43. 228 0
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/dialog/EmailDialog.java
  44. 4 2
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/UserAccountLoginFragment.java
  45. 3 4
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/UserPhoneLoginFragment.java
  46. 2 2
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/UserPhoneLoginSetpwdFragment.java
  47. 2 2
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/UserRegisterFragment.java
  48. 2 2
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/UserRetrievePwdFragment.java
  49. 3 2
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/UserSwitchAccountLoginFragment.java
  50. 121 6
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/impl/SdkPlatformImpl.java
  51. 2 6
      library_platform/src/main/java/cn/yyxx/commsdk/platform/LoginViewModel.java
  52. 1 0
      settings.gradle

+ 4 - 2
demo/build.gradle

@@ -73,7 +73,9 @@ dependencies {
     implementation project(path: ':library_core')
     implementation project(path: ':library_channel')
     implementation project(path: ':library_platform')
-    implementation project(path: ':library_platform:platform_hnyy')
-    api files('../libs/oaid_sdk_1.0.25.aar')
+//    implementation project(path: ':library_platform:platform_hnyy')
+
+    implementation project(path: ':library_channel_repository:oppo')
+
 
 }

+ 0 - 1
library_base/build.gradle

@@ -37,7 +37,6 @@ dependencies {
     api files('../libs/yyxx_support_1.0.2.jar')
 //    api files('../libs/ali_authsdk_2.12.1.jar')
     api files('../libs/android-support-v4.jar')
-    api files('../libs/oaid_sdk_1.0.25.aar')
 
 }
 

+ 1 - 1
library_channel/build.gradle

@@ -35,7 +35,7 @@ dependencies {
     compileOnly project(':library_base')
     compileOnly project(':library_platform')
 
-    compileOnly project(':library_channel_repository')
+    compileOnly project(':library_channel_repository:oppo')
     compileOnly project(':library_platform:platform_hnyy')
 
 }

+ 4 - 0
library_channel/src/main/java/cn/yyxx/commsdk/impl/ChannelSdkGenerator.java

@@ -3,6 +3,7 @@ package cn.yyxx.commsdk.impl;
 import android.content.Context;
 
 import cn.yyxx.commsdk.base.internal.feature.IFeature;
+import cn.yyxx.commsdk.impl.channel.ChannelSdk;
 import cn.yyxx.commsdk.impl.channel.ChannelSdkYYXX;
 import cn.yyxx.commsdk.impl.entity.ChannelId;
 
@@ -18,6 +19,9 @@ public class ChannelSdkGenerator {
             case ChannelId.YYXX:
                 instance = new ChannelSdkYYXX();
                 break;
+            case ChannelId.OPPO:
+                instance = new ChannelSdk(context);
+                break;
         }
 
         return instance;

+ 1 - 1
library_channel/src/main/java/cn/yyxx/commsdk/impl/ChannelSdkImpl.java

@@ -28,7 +28,7 @@ import cn.yyxx.commsdk.base.internal.feature.IOrder;
 public class ChannelSdkImpl {
 
     private IFeature impl;
-    private int channelId = 0;
+    private int channelId = 1;
 
     public ChannelSdkImpl(Context context) {
         //TODO 从配置文件读取channelId

+ 230 - 0
library_channel/src/main/java/cn/yyxx/commsdk/impl/channel/ChannelSdk.java

@@ -0,0 +1,230 @@
+package cn.yyxx.commsdk.impl.channel;
+
+import android.app.Activity;
+import android.app.Application;
+import android.content.Context;
+import android.content.Intent;
+import android.content.res.Configuration;
+import android.os.Bundle;
+
+import org.json.JSONObject;
+
+import cn.yyxx.commsdk.base.entity.Function;
+import cn.yyxx.commsdk.base.entity.SdkOrderInfo;
+import cn.yyxx.commsdk.base.entity.SdkRoleInfo;
+import cn.yyxx.commsdk.base.entity.bean.InitBean;
+import cn.yyxx.commsdk.base.internal.ICallback;
+import cn.yyxx.commsdk.base.internal.feature.IApplication;
+import cn.yyxx.commsdk.base.internal.feature.IFeature;
+import cn.yyxx.commsdk.base.internal.feature.ILifeCycle;
+import cn.yyxx.commsdk.base.internal.feature.IOrder;
+
+
+/**
+ * @author #Suyghur.
+ * Created on 2021/12/25
+ */
+public class ChannelSdk implements IFeature,ILifeCycle, IApplication,IOrder {
+
+    private static ChannelSdk platformSdk;
+
+    private Context context;
+
+    private Object mSdkBridge = null;
+
+
+    public ChannelSdk(Context context){
+        this.context = context;
+    }
+
+    public static ChannelSdk getInstance(Context context){
+        if (platformSdk == null) {
+            synchronized (ChannelSdk.class) {
+                if (platformSdk == null) {
+                    platformSdk = new ChannelSdk(context);
+                }
+            }
+        }
+        return platformSdk;
+    }
+
+    private Object getSdkProxyOperationManager(Context context) {
+        if (null == mSdkBridge) {
+            mSdkBridge = SdkProxyChannelManager.initSdkProxyChannelManager(context);
+        }
+        return mSdkBridge;
+    }
+
+    private void checkSdkBridgeNull(){
+        if (null == mSdkBridge) {
+            mSdkBridge = SdkProxyChannelManager.initSdkProxyChannelManager(context);
+        }
+    }
+    @Override
+    public void initialize(Activity activity, ICallback callback) {
+        checkSdkBridgeNull();
+        SdkProxyChannelManager.call(Function.INITIALIZE, new Class[]{Activity.class,ICallback.class}, new Object[]{activity, callback});
+
+    }
+
+    @Override
+    public void initializeSuccess() {
+        checkSdkBridgeNull();
+        SdkProxyChannelManager.call(Function.INITIALIZE_SUCCESS,  new Class[]{}, new Object[]{});
+
+    }
+
+    @Override
+    public void setLogoutListener(Activity activity, ICallback callback) {
+        checkSdkBridgeNull();
+        SdkProxyChannelManager.call(Function.SET_LOGOUT_LISTENER,  new Class[]{Activity.class, ICallback.class}, new Object[]{activity,callback});
+
+    }
+
+    public void login(Activity activity, InitBean initBean, ICallback callback){
+
+        checkSdkBridgeNull();
+
+        SdkProxyChannelManager.call(Function.LOGIN, new Class[]{Activity.class,InitBean.class, ICallback.class}, new Object[]{activity,initBean, callback});
+
+    }
+
+    @Override
+    public void logout() {
+        checkSdkBridgeNull();
+        SdkProxyChannelManager.call(Function.LOGOUT, new Class[]{}, new Object[]{});
+
+    }
+
+
+    @Override
+    public boolean hasExitView(Activity activity) {
+        checkSdkBridgeNull();
+        return (Boolean) SdkProxyChannelManager.callback(Function.HAS_EXIT_VIEW, new Class[]{Activity.class}, new Object[]{activity});
+    }
+
+
+    public void openExitView(Activity activity, ICallback callback) {
+        checkSdkBridgeNull();
+        SdkProxyChannelManager.call(Function.OPEN_EXIT_VIEW, new Class[]{Activity.class, ICallback.class}, new Object[]{activity, callback});
+
+    }
+
+    @Override
+    public void uploadRoleInfo(Activity activity, String type, SdkRoleInfo roleInfo) {
+        checkSdkBridgeNull();
+        SdkProxyChannelManager.call(Function.UPLOAD_ROLE_INFO, new Class[]{Activity.class, String.class,SdkRoleInfo.class}, new Object[]{activity,type,roleInfo});
+
+    }
+
+    @Override
+    public void reportGameEvent(String event, JSONObject message) {
+
+    }
+
+
+    @Override
+    public void attachBaseContext(Application application, Context context) {
+        checkSdkBridgeNull();
+        SdkProxyChannelManager.call(Function.ATTACH_BASE_CONTEXT,  new Class[]{Application.class, Context.class}, new Object[]{application, context});
+
+    }
+
+    @Override
+    public void initApplication(Application application) {
+        checkSdkBridgeNull();
+        SdkProxyChannelManager.call(Function.INIT_APPLICATION,  new Class[]{Application.class}, new Object[]{application});
+
+    }
+
+    @Override
+    public void onStart(Activity activity) {
+        checkSdkBridgeNull();
+        SdkProxyChannelManager.call(Function.ON_START, new Class[]{Activity.class}, new Object[]{activity});
+
+    }
+
+    @Override
+    public void onResume(Activity activity) {
+        checkSdkBridgeNull();
+        SdkProxyChannelManager.call(Function.ON_RESUME, new Class[]{Activity.class}, new Object[]{activity});
+
+    }
+
+    @Override
+    public void onReStart(Activity activity) {
+        checkSdkBridgeNull();
+        SdkProxyChannelManager.call(Function.ON_RESTART, new Class[]{Activity.class}, new Object[]{activity});
+
+    }
+
+    @Override
+    public void onPause(Activity activity) {
+        checkSdkBridgeNull();
+        SdkProxyChannelManager.call(Function.ON_PAUSE, new Class[]{Activity.class}, new Object[]{activity});
+
+    }
+
+    @Override
+    public void onStop(Activity activity) {
+        checkSdkBridgeNull();
+        SdkProxyChannelManager.call(Function.ON_STOP, new Class[]{Activity.class}, new Object[]{activity});
+
+    }
+
+    @Override
+    public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) {
+        checkSdkBridgeNull();
+        SdkProxyChannelManager.call(Function.ON_ACTIVITY_RESULT,
+                new Class[]{Activity.class, Integer.class, Integer.class, Intent.class},
+                new Object[]{activity, requestCode, resultCode, data});
+        
+    }
+
+    @Override
+    public void onNewIntent(Activity activity, Intent intent) {
+        checkSdkBridgeNull();
+        SdkProxyChannelManager.call(Function.ON_NEW_INTENT, new Class[]{Activity.class, Intent.class}, new Object[]{activity, intent});
+
+    }
+
+    @Override
+    public void onConfigurationChanged(Activity activity, Configuration newConfigs) {
+        checkSdkBridgeNull();
+        SdkProxyChannelManager.call(Function.ON_CONFIGURATION_CHANGED, new Class[]{Activity.class,Configuration.class}, new Object[]{activity,newConfigs});
+
+    }
+
+    @Override
+    public void onWindowFocusChanged(Activity activity, boolean hasFocus) {
+        checkSdkBridgeNull();
+        SdkProxyChannelManager.call(Function.ON_WINDOW_FOCUS_CHANGED, new Class[]{Activity.class,boolean.class}, new Object[]{activity,hasFocus});
+
+    }
+
+    @Override
+    public void onDestroy(Activity activity) {
+        checkSdkBridgeNull();
+        SdkProxyChannelManager.call(Function.ON_DESTROY, new Class[]{Activity.class}, new Object[]{activity});
+
+    }
+
+    @Override
+    public void onCreate(Activity activity, Bundle savedInstanceState) {
+        checkSdkBridgeNull();
+        SdkProxyChannelManager.call(Function.ON_CREATE, new Class[]{Activity.class, Bundle.class}, new Object[]{activity, savedInstanceState});
+
+    }
+
+    @Override
+    public void startPay(final Activity activity, final SdkOrderInfo sdkOrderInfo, ICallback callback) {
+
+        SdkProxyChannelManager.call(Function.START_PAY, new Class[]{Activity.class, SdkOrderInfo.class,ICallback.class}, new Object[]{activity, sdkOrderInfo,callback});
+
+    }
+
+    @Override
+    public String getChannelOrderExt() {
+        return (String) SdkProxyChannelManager.callback(Function.GET_CHANNEL_ORDER_EXT, new Class[]{},new Object[]{});
+    }
+}

+ 0 - 1
library_channel/src/main/java/cn/yyxx/commsdk/impl/channel/ChannelSdkYYXX.java

@@ -60,7 +60,6 @@ public class ChannelSdkYYXX implements IFeature, ILifeCycle,IApplication,IOrder
     @Override
     public void logout() {
         PlatformSdk.getInstance(activity).logout();
-
     }
 
 

+ 58 - 0
library_channel/src/main/java/cn/yyxx/commsdk/impl/channel/SdkProxyChannelManager.java

@@ -0,0 +1,58 @@
+package cn.yyxx.commsdk.impl.channel;
+
+import android.content.Context;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+
+/**
+ * @author #Suyghur.
+ * Created on 2021/12/25
+ */
+final class SdkProxyChannelManager {
+    static Object sdkBridge = null;
+    static Class<?> clzBridge = null;
+
+    public static Object initSdkProxyChannelManager(Context context) {
+        if (sdkBridge != null) {
+            return sdkBridge;
+        }
+
+        try {
+            clzBridge = Class.forName("cn.yyxx.commsdk.impl.channel.ChannelBridge");
+            //获取构造函数的构造器
+            Constructor<?> constructor = clzBridge.getDeclaredConstructor(Context.class);
+            sdkBridge = constructor.newInstance(context);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return sdkBridge;
+    }
+
+    public static void call(String methodName, Class<?>[] types, Object[] values) {
+        if (sdkBridge == null) {
+            return;
+        }
+        try {
+
+            Method method = clzBridge.getMethod(methodName, types);
+            method.invoke(sdkBridge, values);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static Object callback(String methodName, Class<?>[] types, Object[] values) {
+        if (sdkBridge == null) {
+            return null;
+        }
+        try {
+            Method method = clzBridge.getMethod(methodName, types);
+            return method.invoke(sdkBridge, values);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+}

+ 1 - 1
library_channel/src/main/java/cn/yyxx/commsdk/impl/entity/ChannelId.java

@@ -7,5 +7,5 @@ package cn.yyxx.commsdk.impl.entity;
 public class ChannelId {
 
     public static final int YYXX = 0;
-    public static final int XI_YUAN = 1;
+    public static final int OPPO = 1;
 }

+ 4 - 0
library_channel_repository/build.gradle

@@ -32,5 +32,9 @@ android {
 }
 
 dependencies {
+    compileOnly project(':library_base')
+
+    compileOnly project(':library_core')
+
 
 }

+ 1 - 0
library_channel_repository/oppo/.gitignore

@@ -0,0 +1 @@
+/build

+ 49 - 0
library_channel_repository/oppo/build.gradle

@@ -0,0 +1,49 @@
+plugins {
+    id 'com.android.library'
+}
+
+android {
+    compileSdk 31
+
+    defaultConfig {
+        minSdk 21
+        targetSdk 31
+
+         consumerProguardFiles "consumer-rules.pro"
+    }
+
+    buildTypes {
+        release {
+            minifyEnabled false
+            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+        }
+    }
+    compileOptions {
+        sourceCompatibility JavaVersion.VERSION_1_7
+        targetCompatibility JavaVersion.VERSION_1_7
+    }
+}
+
+dependencies {
+
+
+
+    api files('../oppo/libs/core-1.1.0.aar')
+
+    api files('../oppo/libs/gamesdk-20220310.aar')
+
+    api files('../oppo/libs/gamesdk-common-20220310.aar')
+
+
+    api files('../oppo/libs/oaid_sdk_1.0.25.aar')
+
+
+
+    compileOnly project(':library_base')
+
+    compileOnly project(':library_core')
+
+
+
+
+}

+ 0 - 0
library_channel_repository/oppo/consumer-rules.pro


BIN
library_channel_repository/oppo/libs/android-support-v4.jar


BIN
library_channel_repository/oppo/libs/core-1.1.0.aar


BIN
library_channel_repository/oppo/libs/gamesdk-20220310.aar


BIN
library_channel_repository/oppo/libs/gamesdk-common-20220310.aar


BIN
library_channel_repository/oppo/libs/oaid_sdk_1.0.25.aar


+ 21 - 0
library_channel_repository/oppo/proguard-rules.pro

@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile

+ 17 - 0
library_channel_repository/oppo/src/main/AndroidManifest.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.fjsh.yyxx.nearme.gamecenter">
+<application>
+
+    <!-- nearme game sdk config goes here -->
+    <meta-data android:name="debug_mode"
+        android:value="false" /> <!-- 调试开关,发布时候设置false -->
+    <meta-data android:name="is_offline_game"
+        android:value="false" /> <!-- true:单机游戏 false:网游 -->
+    <meta-data android:name="app_key"
+        android:value="8c6960417e714e38bacdc481ef72b5fc" />
+
+    <uses-library android:name="org.apache.http.legacy" android:required="false" />
+
+</application>
+</manifest>

BIN
library_channel_repository/oppo/src/main/assets/nearme/oppo_game_service_305002.so


BIN
library_channel_repository/oppo/src/main/assets/opay_version


+ 17 - 0
library_channel_repository/oppo/src/main/assets/supplierconfig.json

@@ -0,0 +1,17 @@
+{
+  "supplier":{
+    "vivo":{
+      "appid":"vivo"
+    },
+    "xiaomi":{
+
+    },
+    "huawei":{
+
+    },
+    "oppo":{
+
+    }
+  }
+
+}

+ 7 - 0
library_channel_repository/oppo/src/main/assets/yyxx_game/yyxx_cfg.properties

@@ -0,0 +1,7 @@
+YYXX_GCP_CODE=P0101001
+YYXX_SP_CODE=
+YYXX_ONLINE_ENV=http://testsdkapi.yyxxgame.com
+YYXX_PLATFORM=OPPO
+#channel params
+
+APP_SECRET=3bde9c8431e94622b5cac402840945ac

+ 40 - 0
library_channel_repository/oppo/src/main/java/cn/yyxx/commsdk/LoginViewModel.java

@@ -0,0 +1,40 @@
+package cn.yyxx.commsdk;
+
+import android.app.Activity;
+import android.text.TextUtils;
+
+import cn.yyxx.commsdk.base.entity.ResultInfo;
+import cn.yyxx.commsdk.base.internal.ICallback;
+import cn.yyxx.commsdk.base.internal.IRequestCallback;
+import cn.yyxx.commsdk.core.entity.SdkLoginInfo;
+import cn.yyxx.commsdk.core.network.SdkRequest;
+
+public class LoginViewModel {
+
+    public static ICallback mImplCallback = null;
+
+    public LoginViewModel(ICallback callback) {
+        mImplCallback = callback;
+    }
+
+
+    public void verifyChannelinfo(Activity activity,String channelInfo){
+        SdkRequest.getInstance().verfifyChannelLoginInfo(activity, channelInfo, new IRequestCallback() {
+            @Override
+            public void onResponse(ResultInfo resultInfo) {
+                {
+                    if (resultInfo.code == ResultInfo.CODE_SUCCESS && !TextUtils.isEmpty(resultInfo.data)){
+
+                        SdkLoginInfo.getInstance().initLoginInfo(resultInfo.data);
+                        mImplCallback.onResult(resultInfo.code,SdkLoginInfo.getInstance().token);
+
+                    }else{
+                        mImplCallback.onResult(resultInfo.code,resultInfo.msg);
+
+                    }
+
+                }
+            }
+        });
+    }
+}

+ 158 - 0
library_channel_repository/oppo/src/main/java/cn/yyxx/commsdk/impl/channel/ChannelBridge.java

@@ -0,0 +1,158 @@
+package cn.yyxx.commsdk.impl.channel;
+
+import android.app.Activity;
+import android.app.Application;
+import android.content.Context;
+import android.content.Intent;
+import android.content.res.Configuration;
+import android.os.Bundle;
+
+import org.json.JSONObject;
+
+import cn.yyxx.commsdk.base.entity.SdkOrderInfo;
+import cn.yyxx.commsdk.base.entity.SdkRoleInfo;
+import cn.yyxx.commsdk.base.entity.bean.InitBean;
+import cn.yyxx.commsdk.base.internal.ICallback;
+import cn.yyxx.commsdk.base.internal.feature.IApplication;
+import cn.yyxx.commsdk.base.internal.feature.IFeature;
+import cn.yyxx.commsdk.base.internal.feature.ILifeCycle;
+import cn.yyxx.commsdk.base.internal.feature.IOrder;
+import cn.yyxx.commsdk.impl.channel.oppo.ChannelBridgeImpl;
+
+public class ChannelBridge implements IFeature, ILifeCycle, IApplication, IOrder {
+
+    private ChannelBridgeImpl impl = null;
+
+    public ChannelBridge(Context context) {
+        if (null == impl) {
+            impl = new ChannelBridgeImpl(context);
+        }
+    }
+
+
+
+
+    @Override
+    public void attachBaseContext(Application application, Context context) {
+        impl.attachBaseContext(application,context);
+    }
+
+    @Override
+    public void initApplication(Application application) {
+        impl.initApplication(application);
+
+    }
+
+    @Override
+    public void initialize(Activity activity, ICallback callback) {
+        impl.initialize(activity,callback);
+    }
+
+    @Override
+    public void initializeSuccess() {
+        impl.initializeSuccess();
+    }
+
+    @Override
+    public void setLogoutListener(Activity activity, ICallback callback) {
+        impl.setLogoutListener(activity,callback);
+    }
+
+    @Override
+    public void login(final Activity activity, InitBean initBean, final ICallback callback) {
+        impl.login(activity,initBean,callback);
+    }
+
+    @Override
+    public void logout() {
+        impl.logout();
+    }
+
+
+
+    @Override
+    public boolean hasExitView(Activity activity) {
+        return impl.hasExitView(activity);
+    }
+
+    @Override
+    public void openExitView(Activity activity,ICallback callback) {
+        impl.openExitView(activity,callback);
+    }
+
+    @Override
+    public void uploadRoleInfo(Activity activity, String type, SdkRoleInfo roleInfo) {
+        impl.uploadRoleInfo(activity,type,roleInfo);
+    }
+
+    @Override
+    public void reportGameEvent(String event, JSONObject message) {
+        impl.reportGameEvent(event,message);
+    }
+
+
+    @Override
+    public void onStart(Activity activity) {
+        impl.onStart(activity);
+    }
+
+    @Override
+    public void onResume(Activity activity) {
+        impl.onResume(activity);
+    }
+
+    @Override
+    public void onReStart(Activity activity) {
+        impl.onResume(activity);
+    }
+
+    @Override
+    public void onPause(Activity activity) {
+        impl.onPause(activity);
+    }
+
+    @Override
+    public void onStop(Activity activity) {
+        impl.onStop(activity);
+    }
+
+    @Override
+    public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) {
+        impl.onActivityResult(activity,requestCode,resultCode,data);
+    }
+
+    @Override
+    public void onNewIntent(Activity activity, Intent intent) {
+        impl.onNewIntent(activity,intent);
+    }
+
+    @Override
+    public void onConfigurationChanged(Activity activity, Configuration newconfig) {
+        impl.onConfigurationChanged(activity,newconfig);
+    }
+
+    @Override
+    public void onWindowFocusChanged(Activity activity, boolean hasFocus) {
+        impl.onWindowFocusChanged(activity,hasFocus);
+    }
+
+    @Override
+    public void onDestroy(Activity activity) {
+        impl.onDestroy(activity);
+
+    }
+
+    @Override
+    public void onCreate(Activity activity, Bundle savedInstanceState) {
+        impl.onCreate(activity,savedInstanceState);
+    }
+
+
+    public void startPay(Activity activity, SdkOrderInfo sdkOrderInfo,ICallback callback) {
+        impl.startPay(activity,sdkOrderInfo,callback);
+    }
+
+    public String getChannelOrderExt() {
+        return  impl.getChannelOrderExt();
+    }
+}

+ 0 - 0
library_channel/src/main/java/cn/yyxx/commsdk/impl/channel/msa/MsaDeviceHandler.java → library_channel_repository/oppo/src/main/java/cn/yyxx/commsdk/impl/channel/msa/MsaDeviceHandler.java


+ 362 - 0
library_channel_repository/oppo/src/main/java/cn/yyxx/commsdk/impl/channel/oppo/ChannelBridgeImpl.java

@@ -0,0 +1,362 @@
+package cn.yyxx.commsdk.impl.channel.oppo;
+
+import android.app.Activity;
+import android.app.Application;
+import android.content.Context;
+import android.content.Intent;
+import android.content.res.Configuration;
+import android.os.Bundle;
+import android.text.TextUtils;
+
+import com.nearme.game.sdk.GameCenterSDK;
+import com.nearme.game.sdk.callback.ApiCallback;
+import com.nearme.game.sdk.callback.GameExitCallback;
+import com.nearme.game.sdk.common.model.biz.PayInfo;
+import com.nearme.game.sdk.common.model.biz.ReportUserGameInfoParam;
+import com.nearme.game.sdk.common.model.biz.ReqUserInfoParam;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import cn.yyxx.commsdk.base.entity.ResultInfo;
+import cn.yyxx.commsdk.base.entity.SdkOrderInfo;
+import cn.yyxx.commsdk.base.entity.SdkRoleInfo;
+import cn.yyxx.commsdk.base.entity.bean.InitBean;
+import cn.yyxx.commsdk.base.internal.ICallback;
+import cn.yyxx.commsdk.base.internal.feature.IApplication;
+import cn.yyxx.commsdk.base.internal.feature.IFeature;
+import cn.yyxx.commsdk.base.internal.feature.ILifeCycle;
+import cn.yyxx.commsdk.base.internal.feature.IOrder;
+import cn.yyxx.commsdk.LoginViewModel;
+import cn.yyxx.commsdk.impl.channel.utils.ParamsUtils;
+import cn.yyxx.support.PropertiesUtils;
+
+/**
+ * @author #Suyghur.
+ * Created on 2021/12/25
+ */
+public class ChannelBridgeImpl implements IFeature, ILifeCycle, IApplication, IOrder {
+
+    String adId = "",channel = "";
+
+    LoginViewModel loginViewModel;
+
+    public ChannelBridgeImpl(Context context){
+
+    }
+
+    @Override
+    public void attachBaseContext(Application application, Context context) {
+
+    }
+
+    @Override
+    public void initApplication(Application application) {
+
+
+
+
+        String appSecret = ParamsUtils.getCfgParam(application,"APP_SECRET");
+
+
+
+        GameCenterSDK.init(appSecret, application);
+
+    }
+
+    @Override
+    public void initialize(Activity activity, ICallback callback) {
+
+    }
+
+    @Override
+    public void initializeSuccess() {
+
+    }
+
+    @Override
+    public void setLogoutListener(Activity activity, ICallback callback) {
+
+    }
+
+    @Override
+    public void login(final Activity activity, InitBean initBean, ICallback callback) {
+
+        loginViewModel  = new LoginViewModel(callback);
+        GameCenterSDK.getInstance().doLogin(activity, new ApiCallback() {
+
+            @Override
+            public void onSuccess(String s) {
+                GameCenterSDK.getInstance().doGetTokenAndSsoid(
+                        new ApiCallback() {
+
+
+                            @Override
+                            public void onSuccess(final String resultMsg) {
+                                verfiyWtithAdid(activity,resultMsg);
+                            }
+
+                            @Override
+                            public void onFailure(String arg0, int arg1) {
+                                // TODO Auto-generated method stub
+
+                            }
+                        });
+            }
+
+            @Override
+            public void onFailure(String s, int i) {
+
+            }
+        });
+    }
+
+    void verfiyWtithAdid(final Activity activity, final String resultMsg){
+        try {
+            JSONObject json  = new JSONObject(resultMsg);
+
+            String token = json.optString("token");
+            String ssoid = json.optString("ssoid");
+
+
+            GameCenterSDK.getInstance().doGetUserInfo(new ReqUserInfoParam(token,ssoid), new ApiCallback() {
+                @Override
+                public void onSuccess(String s) {
+
+                    try {
+                        JSONObject json  = new JSONObject(s);
+                        adId = json.getString("adId");
+                        channel = json.getString("channel");
+                        if (!TextUtils.isEmpty(adId) || !TextUtils.isEmpty(channel)){
+
+                            json.put("adId",adId);
+                            json.put("channel",channel);
+
+                         }
+
+                        loginViewModel.verifyChannelinfo(activity,json.toString());
+
+
+                    } catch (JSONException e) {
+                        e.printStackTrace();
+                    }
+
+                }
+
+                @Override
+                public void onFailure(String s, int i) {
+
+                 }
+            });
+
+
+
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    public void logout() {
+
+    }
+
+    @Override
+    public boolean hasExitView(Activity activity) {
+        return true;
+    }
+
+    @Override
+    public void openExitView(Activity activity, final ICallback callback) {
+        GameCenterSDK.getInstance().onExit(activity, new GameExitCallback() {
+            @Override
+            public void exitGame() {
+                callback.onResult(ResultInfo.CODE_SUCCESS,"Exit Game.");
+            }
+        });
+    }
+
+    @Override
+    public void uploadRoleInfo(Activity activity, String type, SdkRoleInfo roleInfo) {
+
+        String role_power = roleInfo.getRolePower();
+        String roleLevel = roleInfo.getRoleLevel();
+        String roleId = roleInfo.getRoleId();
+        String roleName = roleInfo.getRoleName();
+        String serverId = roleInfo.getServerId();
+        String serverName = roleInfo.getServerName();
+        String vipLevel = roleInfo.getVipLevel();
+
+
+        int i_roleLevel = Integer.valueOf(roleLevel).intValue();
+
+        Map<String,Number> map = new HashMap();
+
+        if (roleInfo.getRolePower().length() > 9){
+
+
+            map.put("combatValue",Integer.valueOf("999999999").intValue());
+
+        }else{
+
+
+            map.put("combatValue",Integer.valueOf(role_power).intValue());
+
+        }
+
+
+
+        GameCenterSDK.getInstance().doReportUserGameInfoData(new ReportUserGameInfoParam(roleId, roleName, i_roleLevel, serverId, serverName, vipLevel, map), new ApiCallback() {
+            @Override
+            public void onSuccess(String s) {
+
+            }
+
+            @Override
+            public void onFailure(String s, int i) {
+
+            }
+        });
+
+
+    }
+
+    @Override
+    public void reportGameEvent(String event, JSONObject message) {
+
+    }
+
+    @Override
+    public void onStart(Activity activity) {
+
+    }
+
+    @Override
+    public void onResume(Activity activity) {
+
+    }
+
+    @Override
+    public void onReStart(Activity activity) {
+
+    }
+
+    @Override
+    public void onPause(Activity activity) {
+
+    }
+
+    @Override
+    public void onStop(Activity activity) {
+
+    }
+
+    @Override
+    public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) {
+
+    }
+
+    @Override
+    public void onNewIntent(Activity activity, Intent intent) {
+
+    }
+
+    @Override
+    public void onConfigurationChanged(Activity activity, Configuration newconfig) {
+
+    }
+
+    @Override
+    public void onWindowFocusChanged(Activity activity, boolean hasFocus) {
+
+    }
+
+    @Override
+    public void onDestroy(Activity activity) {
+
+    }
+
+    @Override
+    public void onCreate(Activity activity, Bundle savedInstanceState) {
+
+    }
+
+    @Override
+    public void startPay(Activity activity, SdkOrderInfo sdkOrderInfo, final ICallback callback) {
+
+
+        String pay_money = sdkOrderInfo.getSdkChargeInfo().getPay_money();
+        String order_id = sdkOrderInfo.getOrder_id();
+        int i_pay_money = Integer.valueOf(pay_money).intValue();
+
+        String order_desc = sdkOrderInfo.getSdkChargeInfo().getOrder_desc();
+        String order_name = sdkOrderInfo.getSdkChargeInfo().getOrder_name();
+
+
+
+
+
+        String ext = sdkOrderInfo.getOrder_id();
+
+        String payExt = sdkOrderInfo.getOrder_ext();
+        String callbackUrl=null;
+
+        if (!ext.equals(""))
+        {
+            try {
+                JSONObject vivoExtraInfo = new JSONObject(payExt);
+                callbackUrl = vivoExtraInfo.optString("notifyUrl", "");
+
+            } catch (JSONException e) {
+
+
+                return ;
+            }
+        }
+
+
+        PayInfo payInfo = new PayInfo(order_id, order_id, i_pay_money);
+        payInfo.setProductDesc(order_desc);
+        payInfo.setProductName(order_name);
+        payInfo.setCallbackUrl(callbackUrl);
+
+
+
+
+
+        GameCenterSDK.getInstance().doPay(activity, payInfo, new ApiCallback() {
+            @Override
+            public void onSuccess(String s) {
+                callback.onResult(ResultInfo.CODE_SUCCESS,s);
+            }
+
+            @Override
+            public void onFailure(String s, int i) {
+                callback.onResult(ResultInfo.CODE_FAIL,s);
+            }
+        });
+
+
+
+    }
+
+    @Override
+    public String getChannelOrderExt() {
+
+        if (TextUtils.isEmpty(adId) || TextUtils.isEmpty(channel)){
+            return "";
+        }else {
+            JSONObject json = new JSONObject();
+            try {
+                json.put("adId",adId);
+                json.put("channel",channel);
+            } catch (JSONException e) {
+                e.printStackTrace();
+            }
+            return json.toString();
+        }
+    }
+}

+ 20 - 0
library_channel_repository/oppo/src/main/java/cn/yyxx/commsdk/impl/channel/utils/ParamsUtils.java

@@ -0,0 +1,20 @@
+package cn.yyxx.commsdk.impl.channel.utils;
+
+import android.content.Context;
+
+import cn.yyxx.commsdk.core.utils.ManifestUtils;
+import cn.yyxx.support.PropertiesUtils;
+
+public class ParamsUtils {
+    private static String  CONFIG_FILE  =  "yyxx_cfg.properties";
+
+
+
+
+
+    private static String ASSETS_PATH = "yyxx_game";
+
+    public static String getCfgParam(Context context,String key){
+        return PropertiesUtils.getValue4Properties(context,CONFIG_FILE,ASSETS_PATH, key);
+    }
+}

+ 0 - 4
library_channel_repository/src/main/AndroidManifest.xml

@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest package="cn.yyxx.commsdk.channel_repository">
-
-</manifest>

+ 0 - 8
library_channel_repository/src/main/java/cn/yyxx/commsdk/impl/ChannelBridge.java

@@ -1,8 +0,0 @@
-package cn.yyxx.commsdk.impl;
-
-/**
- * @author #Suyghur.
- * Created on 2021/12/25
- */
-public class ChannelBridge {
-}

+ 4 - 3
library_core/src/main/java/cn/yyxx/commsdk/core/common/CommonOperationManager.java

@@ -84,12 +84,13 @@ public class CommonOperationManager {
         String isShowPolicy = MMKVUtils.getInstance().commonKV.decodeString("isShowPolicy","");
         if (isShowPolicy.isEmpty()){
 
-//            LoadingDialogUtils.getInstance().show(activity);
+            LoadingDialogUtils.getInstance().show(activity);
+
             SdkRequest.getInstance().initAgreement(activity, new IRequestCallback() {
                 @Override
                 public void onResponse(ResultInfo resultInfo) {
 
-//                    LoadingDialogUtils.getInstance().hide();
+                    LoadingDialogUtils.getInstance().hide();
 
                     if (resultInfo.code == 400){
                         showExitDialog(activity);
@@ -112,7 +113,7 @@ public class CommonOperationManager {
                         return;
                     }
 
-                    new PrivacyPolicyDialog(activity,  ResourceUtil.getStyleId(activity, "yyxx_base_dialog"),policy_url, new PrivacyPolicyDialog.OnClosePageListener() {
+                    new PrivacyPolicyDialog(activity,  ResourceUtil.getStyleId(activity, "yyxx_comm_base_dialog"),policy_url, new PrivacyPolicyDialog.OnClosePageListener() {
                         @Override
                         public void onUserAgreePolicy() {
 

+ 18 - 2
library_core/src/main/java/cn/yyxx/commsdk/core/entity/SdkLoginInfo.java

@@ -1,5 +1,7 @@
 package cn.yyxx.commsdk.core.entity;
 
+import android.text.TextUtils;
+
 import org.json.JSONException;
 import org.json.JSONObject;
 
@@ -9,8 +11,8 @@ public class SdkLoginInfo {
 
     private static SdkLoginInfo mInstance;
 
-    public String authentication = "",user_center= "",login_token= "",rn_si= "",uname= "",channel_uid ="",token= "";
-
+    public String authentication = "",user_center= "",solo_email = "",login_token= "",rn_si= "",uname= "",channel_uid ="",token= "";
+    public boolean isVefityRealName = false;
     private SdkLoginInfo() {
 
     }
@@ -29,25 +31,36 @@ public class SdkLoginInfo {
     public void  reset(){
         authentication = "";
         user_center= "";
+        solo_email = "";
         login_token= "";
         rn_si= "";
         uname= "";
         token= "";
         channel_uid = "";
+        isVefityRealName = false;
 
     }
 
 
     public void initLoginInfo(String json){
+
+        reset();
+
         try {
             JSONObject jsonObject = new JSONObject(json);
             JSONObject links = jsonObject.optJSONObject("links");
             if (JsonUtils.hasJsonKey(links, "authentication")) {
                 authentication = links.optString("authentication");
+                if (TextUtils.isEmpty(authentication)){
+                    isVefityRealName = true;
+                }
             }
             if (JsonUtils.hasJsonKey(links, "user_center")) {
                 user_center = links.optString("user_center");
             }
+            if (JsonUtils.hasJsonKey(links, "solo_email")) {
+                solo_email = links.optString("solo_email");
+            }
             if (JsonUtils.hasJsonKey(jsonObject, "login_token")) {
                 login_token = jsonObject.optString("login_token");
             }
@@ -71,16 +84,19 @@ public class SdkLoginInfo {
 
     }
 
+
     @Override
     public String toString() {
         return "SdkLoginInfo{" +
                 "authentication='" + authentication + '\'' +
                 ", user_center='" + user_center + '\'' +
+                ", solo_email='" + solo_email + '\'' +
                 ", login_token='" + login_token + '\'' +
                 ", rn_si='" + rn_si + '\'' +
                 ", uname='" + uname + '\'' +
                 ", channel_uid='" + channel_uid + '\'' +
                 ", token='" + token + '\'' +
+                ", isVefityRealName=" + isVefityRealName +
                 '}';
     }
 }

+ 1 - 1
library_core/src/main/java/cn/yyxx/commsdk/core/impl/SdkBridgeImpl.java

@@ -142,7 +142,7 @@ public final class SdkBridgeImpl {
                         startPay(activity,sdkOrderInfo,callback);
                     }else{
                         if (!TextUtils.isEmpty(sdkOrderInfo.getPay_web_url())){
-                            new CommPayDialog(activity, ResourceUtil.getStyleId(activity, "yyxx_base_dialog"),sdkOrderInfo).show();
+                            new CommPayDialog(activity, ResourceUtil.getStyleId(activity, "yyxx_comm_base_dialog"),sdkOrderInfo).show();
                         }
                     }
                 }else{

+ 2 - 1
library_core/src/main/java/cn/yyxx/commsdk/core/network/Hosts.java

@@ -17,10 +17,11 @@ public class Hosts {
     public static final String  BASIC_URL_USER_LOGIN =  "user_login";
     public static final String  BASIC_URL_UPLOAD_ROLEINFO =   "report_role_info";
     public static final String  BASIC_URL_RECHARGE_INIT= "recharge_init";
-    public static final String  BASIC_URL_CHANNEL_LOGIN = HOST +  "/channel_login";
+    public static final String  BASIC_URL_CHANNEL_LOGIN = "channel_login";
     public static final String  BASIC_URL_GET_CAPTCHA = "phone_captcha";
     public static final String  BASIC_URL_PHONE_REGISTER =  "phone_register";
     public static final String  BASIC_URL_PHONE_RESETPWD =   "phone_reset_pwd";
+    public static final String  BASIC_URL_UPLOAD_USER_ONLINE_ACTION = "rn_user_action";
 
     public static final String  BASIC_URL_ORDER_QUERY = "order_query";
     public static final String  BASIC_URL_AGREEMENT_INIT = HOST +  "/agreement_init";

+ 40 - 0
library_core/src/main/java/cn/yyxx/commsdk/core/network/SdkRequest.java

@@ -290,6 +290,46 @@ public class SdkRequest {
         VolleyRequest.post(context, HOST, paramText, callback);
 
     }
+
+    public void uploadUserOnlineAction(Context context, String action,String si, IRequestCallback callback) {
+        JSONObject json = new JSONObject();
+        try {
+            json.put("route_path", Hosts.BASIC_URL_UPLOAD_USER_ONLINE_ACTION);
+            json.put("si",si);
+            json.put("bt",action);
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+
+        String paramText = SdkDrive.getInstance().invokeJob(json.toString());
+
+        VolleyRequest.post(context, HOST, paramText, callback);
+
+    }
+
+
+    public void verfifyChannelLoginInfo(Context context,String channelLoginInfo, IRequestCallback callback){
+
+        JSONObject json = new JSONObject();
+
+        try {
+            json.put("route_path", Hosts.BASIC_URL_CHANNEL_LOGIN);
+            json.put("sdk_params", channelLoginInfo);
+
+
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+
+
+        String paramText = SdkDrive.getInstance().invokeJob(json.toString());
+
+        VolleyRequest.post(context, HOST, paramText, callback);
+
+
+    }
+
+
 }
 
 

+ 2 - 2
library_core/src/main/java/cn/yyxx/commsdk/core/ui/dialog/LoadingDialogUtils.java

@@ -44,8 +44,8 @@ public class LoadingDialogUtils {
     public void show(Context context){
         if (null == context || ((Activity)context).isFinishing()) return;
         if (isLoading)return;
-        dialog = new AlertDialog.Builder(context, ResourceUtil.getStyleId(context, "hnyy_progress_dialog")).create();
-        View view = LayoutInflater.from(context).inflate(ResourceUtil.getLayoutId(context, "hnyy_dialog_progress"),null);
+        dialog = new AlertDialog.Builder(context, ResourceUtil.getStyleId(context, "yyxx_comm_loading_dialog")).create();
+        View view = LayoutInflater.from(context).inflate(ResourceUtil.getLayoutId(context, "yyxx_comm_loading_dialog"),null);
         TextView text = view.findViewById(ResourceUtil.getId(context, "id_tv_loadingmsg"));
         text.setVisibility(View.GONE);
         Window window = dialog.getWindow();

+ 1 - 1
library_core/src/main/java/cn/yyxx/commsdk/core/ui/dialog/SingleButtonDialog.java

@@ -37,7 +37,7 @@ public class SingleButtonDialog extends Dialog {
 		public SingleButtonDialog Create(String msg){
 			{
 				LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
-				dialog = new SingleButtonDialog(context, ResourceUtil.getStyleId(context,"yyxx_base_dialog"));
+				dialog = new SingleButtonDialog(context, ResourceUtil.getStyleId(context,"yyxx_comm_base_dialog"));
 				View layout;
 
 				layout =  inflater.inflate(ResourceUtil.getLayoutId(context, "yyxx_comm_ios_style_dialog"),null);

+ 7 - 1
library_core/src/main/java/cn/yyxx/commsdk/core/utils/ParamsUtils.java

@@ -11,6 +11,10 @@ public class ParamsUtils {
 
     private static String  YYXX_ONLINE_ENV  =  "YYXX_ONLINE_ENV";
 
+    private static String  YYXX_PLATFORM  =  "YYXX_PLATFORM";
+
+
+
 
     private static String ASSETS_PATH = "yyxx_game";
     public static String getGameCode(Context context){
@@ -22,6 +26,8 @@ public class ParamsUtils {
     }
     public static String getHost(Context context){
         return PropertiesUtils.getValue4Properties(context,CONFIG_FILE,ASSETS_PATH, YYXX_ONLINE_ENV);
-
+    }
+    public static String getChannelName(Context context){
+        return PropertiesUtils.getValue4Properties(context,CONFIG_FILE,ASSETS_PATH, YYXX_PLATFORM);
     }
 }

+ 1 - 15
library_core/src/main/res/values/yyxx_comm_styles.xml

@@ -7,23 +7,9 @@
 
 
 
-    <style name="yyxx_privacy_dialog" parent="@android:style/Theme.Dialog">
-        <item name="android:windowFrame">@null</item>
-        <!-- 边框 -->
-        <item name="android:windowIsFloating">true</item>
-        <!-- 是否浮现在activity之上 -->
-        <item name="android:windowIsTranslucent">false</item>
-        <!-- 半透明 -->
-        <item name="android:windowNoTitle">false</item>
-        <!-- 无标题 -->
-        <item name="android:windowBackground">@color/yyxx_comm_transparent</item>
-
-
-        <!-- 模糊 -->
-    </style>
 
 
-    <style name="yyxx_base_dialog" parent="@android:style/Theme.Dialog">
+    <style name="yyxx_comm_base_dialog" parent="@android:style/Theme.Dialog">
     <item name="android:windowFrame">@null</item>
     <!-- 边框 -->
     <item name="android:windowIsFloating">true</item>

+ 3 - 3
library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/SdkPlatformBridge.java

@@ -22,7 +22,7 @@ import cn.yyxx.commsdk.base.internal.feature.ILifeCycle;
 import cn.yyxx.commsdk.base.internal.feature.IOrder;
 import cn.yyxx.commsdk.platform.hnyy.impl.SdkPlatformImpl;
 
-public class SdkPlatformBridge implements IFeature, ILifeCycle, IApplication {
+public class SdkPlatformBridge implements IFeature, ILifeCycle, IApplication,IOrder {
 
     private SdkPlatformImpl impl = null;
 
@@ -150,11 +150,11 @@ public class SdkPlatformBridge implements IFeature, ILifeCycle, IApplication {
         impl.onCreate(activity,savedInstanceState);
     }
 
-
+    @Override
     public void startPay(Activity activity, SdkOrderInfo sdkOrderInfo,ICallback callback) {
         impl.startPay(activity,sdkOrderInfo,callback);
     }
-
+    @Override
     public String getChannelOrderExt() {
         return  impl.getChannelOrderExt();
     }

+ 4 - 5
library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/HNYYLoginActivity.java

@@ -13,7 +13,6 @@ import android.view.WindowManager;
 
 import cn.yyxx.commsdk.base.internal.ICallback;
 
-import cn.yyxx.commsdk.platform.LoginViewModel;
 import cn.yyxx.commsdk.platform.hnyy.dialog.AutoLoginDialog;
 import cn.yyxx.commsdk.platform.hnyy.fragment.UserAccountLoginFragment;
 import cn.yyxx.commsdk.platform.hnyy.fragment.UserPhoneLoginFragment;
@@ -39,7 +38,7 @@ public class HNYYLoginActivity extends BaseLoginActivity {
     private UserRetrievePwdFragment userRetrievePwdFragment;
     private UserSwitchAccountLoginFragment userSwitchAccountLoginFragment;
 
-    public static LoginViewModel loginViewModel;
+
 
 
 
@@ -79,7 +78,7 @@ public class HNYYLoginActivity extends BaseLoginActivity {
     }
 
     public static void start(Activity activity, ICallback callback) {
-        loginViewModel = new LoginViewModel(callback);
+
         activity.startActivity(new Intent(activity, HNYYLoginActivity.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
     }
 
@@ -143,7 +142,7 @@ public class HNYYLoginActivity extends BaseLoginActivity {
     }
 
     private void autoLogin(final Activity activity) {
-        AutoLoginDialog.Builder builder = new AutoLoginDialog.Builder(activity,loginViewModel);
+        AutoLoginDialog.Builder builder = new AutoLoginDialog.Builder(activity,SdkPlatformImpl.loginViewModel);
         builder.setPositiveButton(new DialogInterface.OnClickListener() {
             @Override
             public void onClick(DialogInterface dialog, int which) {
@@ -161,7 +160,7 @@ public class HNYYLoginActivity extends BaseLoginActivity {
             public void onLoginSuccess() {
                 if (!isFinishing()) {
                      finish();
-                    SdkPlatformImpl.getInstance(activity).showFloat();
+                     SdkPlatformImpl.getInstance(activity).loginSuccess();
                 }
             }
             @Override

+ 228 - 0
library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/dialog/EmailDialog.java

@@ -0,0 +1,228 @@
+package cn.yyxx.commsdk.platform.hnyy.dialog;
+
+
+
+import android.content.Context;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Bundle;
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.View;
+import android.view.Window;
+import android.view.WindowManager;
+import android.webkit.DownloadListener;
+import android.webkit.WebSettings;
+import android.webkit.WebView;
+import android.webkit.WebViewClient;
+import android.widget.ImageView;
+
+
+
+import java.net.URISyntaxException;
+
+import cn.yyxx.commsdk.core.utils.ResourceUtil;
+import cn.yyxx.commsdk.platform.hnyy.action.PageJsInteraction;
+import cn.yyxx.commsdk.platform.hnyy.fragment.widget.TosUtil;
+import cn.yyxx.support.AppUtils;
+
+
+public class EmailDialog extends JsBaseDialog {
+
+
+    private ImageView close_btn;
+    private Context context;
+    private WebView webView;
+    private WebSettings webSettings;
+
+    private String url;
+
+
+    public EmailDialog(Context context) {
+        super(context);
+        this.context = context;
+    }
+
+
+    public EmailDialog(Context context, int theme, String url) {
+        super(context, theme);
+        this.context = context;
+        this.url = url;
+
+    }
+
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+
+        if (!AppUtils.isLandscape(context)){
+
+            setContentView(ResourceUtil.getLayoutId(context,
+                    "hnyy_usercenter_portait_dialog"));
+
+        }else{
+            setContentView(ResourceUtil.getLayoutId(context,
+                    "hnyy_email_dialog"));
+        }
+
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
+            Window window = getWindow();
+            window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+                    | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
+            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
+
+
+            WindowManager.LayoutParams lp = getWindow().getAttributes();
+            lp.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
+            getWindow().setAttributes(lp);
+        }
+
+
+
+        setCancelable(false);
+
+
+
+        webView = findViewById(ResourceUtil.getId(context,
+                "wb_user_info"));
+
+        close_btn = findViewById(ResourceUtil.getId(context,
+                "close_btn"));
+
+
+
+        close_btn.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+
+
+
+                webView.destroy();
+                dismiss();
+
+            }
+        });
+
+        webSettings = webView.getSettings();
+        webSettings.setAllowFileAccess(true);
+        webSettings.setJavaScriptEnabled(true);
+        webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
+        webSettings.setBuiltInZoomControls(false);// 设置支持缩放
+        webSettings.setDomStorageEnabled(true);
+        webView.setHorizontalScrollBarEnabled(false);//水平不显示
+        webView.setVerticalScrollBarEnabled(false); //垂直不显示
+
+        webView.addJavascriptInterface(new PageJsInteraction(this), "yyrhsdk");
+        webView.setWebViewClient(new WebViewClient(){
+            @Override
+            public void onPageFinished(WebView view, String url) {
+                super.onPageFinished(view, url);
+
+            }
+
+            @Override
+            public boolean shouldOverrideUrlLoading(WebView view, String url) {
+
+
+
+
+                if (url.startsWith("http:") || url.startsWith("https")) {
+                    return super.shouldOverrideUrlLoading(view, url);
+                } else if (url.startsWith("mqqwpa://")) {
+
+                    Intent intent = null;
+                    try {
+                        intent = Intent.parseUri(url, Intent.URI_INTENT_SCHEME);
+                        context.startActivity(intent);
+                    } catch (URISyntaxException e) {
+                        e.printStackTrace();
+                    }
+
+                    webView.goBack();
+                    return true;
+
+                }else{
+                    return true;
+                }
+            }
+
+        });
+
+        webView.setDownloadListener(new DownloadListener() {
+            @Override
+            public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) {
+                Uri uri = Uri.parse(url);
+                Intent intent = new Intent(Intent.ACTION_VIEW, uri);
+                context.startActivity(intent);
+            }
+        });
+
+
+        webView.setBackgroundColor(0);
+        webView.getBackground().setAlpha(0);
+
+
+        webView.loadUrl(url);
+    }
+
+
+
+
+
+
+    @Override
+    public void zfColse() {
+        super.zfColse();
+        dismiss();
+    }
+
+    @Override
+    public void showJsMsg(String message) {
+        super.showJsMsg(message);
+        new TosUtil(context,TosUtil.TOAST_ERROR,  message).show();
+    }
+
+
+
+    @Override
+    public void openq0q0(String url) {
+        super.openq0q0(url);
+
+        {
+            Log.i("openq0q0", url);
+            if (TextUtils.isEmpty(url)) {
+                return;
+            }
+            if (url.equals("mqqwpa://")) {
+                try {
+
+                    Intent intent = context.getPackageManager().getLaunchIntentForPackage("com.tencent.mobileqq");
+                    context.startActivity(intent);
+
+                } catch (Exception e) {
+                    e.printStackTrace();
+
+                }
+            } else {
+                Intent intent = null;
+                try {
+                    intent = Intent.parseUri(url, Intent.URI_INTENT_SCHEME);
+                    context.startActivity(intent);
+                } catch (URISyntaxException e) {
+                    e.printStackTrace();
+                }
+
+            }
+
+
+        }
+    }
+
+    @Override
+    public void dismiss() {
+        super.dismiss();
+    }
+}

+ 4 - 2
library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/UserAccountLoginFragment.java

@@ -218,14 +218,16 @@ public class UserAccountLoginFragment extends BaseFragment {
         }
 
 
-        loginImpl.loginViewModel.accountLogin(getActivity(), account, pwd, login_token, new ICallback() {
+        SdkPlatformImpl.loginViewModel.accountLogin(getActivity(), account, pwd, login_token, new ICallback() {
             @Override
             public void onResult(int code, String result) {
                 if (code == ResultInfo.CODE_SUCCESS){
 
                     if (!getActivity().isFinishing()) {
                         getActivity().finish();
-                        SdkPlatformImpl.getInstance(getActivity()).showFloat();
+
+                        SdkPlatformImpl.getInstance(getActivity()).loginSuccess();
+
                     }
 
                  }else{

+ 3 - 4
library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/UserPhoneLoginFragment.java

@@ -157,7 +157,7 @@ public class UserPhoneLoginFragment extends BaseFragment {
 
         }
 
-        loginImpl.loginViewModel.phoneLoginWithSms(getActivity(), account, code, new PhoneLoginCallBack() {
+        SdkPlatformImpl.loginViewModel.phoneLoginWithSms(getActivity(), account, code, new PhoneLoginCallBack() {
 
             @Override
             public void onPhoneLoginSuccess(String msg) {
@@ -165,8 +165,7 @@ public class UserPhoneLoginFragment extends BaseFragment {
 
                     if (!getActivity().isFinishing()) {
                         getActivity().finish();
-                        SdkPlatformImpl.getInstance(getActivity()).showFloat();
-
+                        SdkPlatformImpl.getInstance(activity).loginSuccess();
                     }
 
             }
@@ -191,7 +190,7 @@ public class UserPhoneLoginFragment extends BaseFragment {
 
 
     private void  getPhoneCaptcha(Activity activity, String phoneNum, String action){
-        loginImpl.loginViewModel.getPhoneCaptcha(activity, phoneNum, action, new ICallback() {
+        SdkPlatformImpl.loginViewModel.getPhoneCaptcha(activity, phoneNum, action, new ICallback() {
             @Override
             public void onResult(int code, String result) {
                 if (code == ResultInfo.CODE_SUCCESS){

+ 2 - 2
library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/UserPhoneLoginSetpwdFragment.java

@@ -143,13 +143,13 @@ public class UserPhoneLoginSetpwdFragment extends BaseFragment {
 
         }
 
-        loginImpl.loginViewModel.setPassword(activity, account, pwd, code, new ICallback() {
+        SdkPlatformImpl.loginViewModel.setPassword(activity, account, pwd, code, new ICallback() {
             @Override
             public void onResult(int code, String result) {
                 if (code == ResultInfo.CODE_SUCCESS){
                     if (!getActivity().isFinishing()) {
                         getActivity().finish();
-                        SdkPlatformImpl.getInstance(getActivity()).showFloat();
+                        SdkPlatformImpl.getInstance(activity).loginSuccess();
 
                     }
 

+ 2 - 2
library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/UserRegisterFragment.java

@@ -189,14 +189,14 @@ public class UserRegisterFragment extends BaseFragment {
             return;
         }
 
-        loginImpl.loginViewModel.accountRegister(getActivity(), account, pwd, new ICallback() {
+        SdkPlatformImpl.loginViewModel.accountRegister(getActivity(), account, pwd, new ICallback() {
             @Override
             public void onResult(int code, String result) {
                 if (code == ResultInfo.CODE_SUCCESS){
 
                     if (!getActivity().isFinishing()) {
                         getActivity().finish();
-                        SdkPlatformImpl.getInstance(getActivity()).showFloat();
+                        SdkPlatformImpl.getInstance(getActivity()).loginSuccess();
 
                     }
 

+ 2 - 2
library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/UserRetrievePwdFragment.java

@@ -113,7 +113,7 @@ public class UserRetrievePwdFragment extends BaseFragment {
 
 
     private void  getPhoneCaptcha(Activity activity, String phoneNum, String action){
-        loginImpl.loginViewModel.getPhoneCaptcha(activity, phoneNum, action, new ICallback() {
+        SdkPlatformImpl.loginViewModel.getPhoneCaptcha(activity, phoneNum, action, new ICallback() {
             @Override
             public void onResult(int code, String result) {
                 if (code == ResultInfo.CODE_SUCCESS){
@@ -165,7 +165,7 @@ public class UserRetrievePwdFragment extends BaseFragment {
     }
 
     private void resetPwdWithPhone(final Activity activity, final String phoneNum, String code, final String pwd) {
-        loginImpl.loginViewModel.resetPassword(activity,phoneNum,code,pwd, new ICallback() {
+        SdkPlatformImpl.loginViewModel.resetPassword(activity,phoneNum,code,pwd, new ICallback() {
             @Override
             public void onResult(int code, String result) {
                 if (code == ResultInfo.CODE_SUCCESS){

+ 3 - 2
library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/UserSwitchAccountLoginFragment.java

@@ -137,13 +137,14 @@ public class UserSwitchAccountLoginFragment extends BaseFragment{
         }
         clickLoginTime = System.currentTimeMillis();
 
-        loginImpl.loginViewModel.accountLogin(getActivity(),account, pwd,login_token, new ICallback(){
+        SdkPlatformImpl.loginViewModel.accountLogin(getActivity(),account, pwd,login_token, new ICallback(){
             @Override
             public void onResult(int code, String result) {
                 if (code == ResultInfo.CODE_SUCCESS){
                     if (!getActivity().isFinishing()) {
                         getActivity().finish();
-                        SdkPlatformImpl.getInstance(getActivity()).showFloat();
+                        SdkPlatformImpl.getInstance(getActivity()).loginSuccess();
+
                     }
 
                 }else{

+ 121 - 6
library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/impl/SdkPlatformImpl.java

@@ -12,8 +12,9 @@ import android.text.TextUtils;
 import org.json.JSONException;
 import org.json.JSONObject;
 
+import java.util.concurrent.TimeUnit;
+
 import cn.yyxx.commsdk.base.entity.ResultInfo;
-import cn.yyxx.commsdk.base.entity.SdkChargeInfo;
 import cn.yyxx.commsdk.base.entity.SdkOrderInfo;
 import cn.yyxx.commsdk.base.entity.SdkRoleInfo;
 import cn.yyxx.commsdk.base.entity.bean.InitBean;
@@ -23,15 +24,22 @@ import cn.yyxx.commsdk.base.internal.feature.IApplication;
 import cn.yyxx.commsdk.base.internal.feature.IFeature;
 import cn.yyxx.commsdk.base.internal.feature.ILifeCycle;
 import cn.yyxx.commsdk.base.internal.feature.IOrder;
+import cn.yyxx.commsdk.base.utils.Logger;
 import cn.yyxx.commsdk.core.entity.SdkLoginInfo;
+import cn.yyxx.commsdk.core.network.SdkRequest;
 import cn.yyxx.commsdk.core.utils.ResourceUtil;
+import cn.yyxx.commsdk.platform.LoginViewModel;
 import cn.yyxx.commsdk.platform.PlatformSdk;
 import cn.yyxx.commsdk.platform.hnyy.HNYYLoginActivity;
 import cn.yyxx.commsdk.platform.hnyy.dialog.CustomExitGameDialog;
+import cn.yyxx.commsdk.platform.hnyy.dialog.EmailDialog;
 import cn.yyxx.commsdk.platform.hnyy.dialog.HnPayDialog;
+import cn.yyxx.commsdk.platform.hnyy.dialog.WvPageListDialog;
 import cn.yyxx.commsdk.platform.hnyy.floating.FloatViewManager;
+import cn.yyxx.support.scheduler.ScheduledWorker;
 
-public class SdkPlatformImpl implements IFeature, ILifeCycle, IApplication {
+public class SdkPlatformImpl implements IFeature, ILifeCycle, IApplication, IOrder
+{
     public static InitBean initConfig = null ;
 
     private static SdkPlatformImpl manager;
@@ -39,13 +47,18 @@ public class SdkPlatformImpl implements IFeature, ILifeCycle, IApplication {
 
     private  ICallback logoutCallback;
 
-    private Context context;
 
 
 
+    public static LoginViewModel loginViewModel;
+
+    public static ScheduledWorker sScheduledWorker = null;
+
+
     private static Activity activity;
+
     public SdkPlatformImpl(Context context){
-        this.context = context;
+
     }
 
 
@@ -76,6 +89,7 @@ public class SdkPlatformImpl implements IFeature, ILifeCycle, IApplication {
     @Override
     public void login(final Activity activity, InitBean initBean, final ICallback callback) {
         initConfig  = initBean;
+        loginViewModel = new LoginViewModel(callback);
         HNYYLoginActivity.start(activity,callback);
     }
 
@@ -84,6 +98,20 @@ public class SdkPlatformImpl implements IFeature, ILifeCycle, IApplication {
         SdkLoginInfo.getInstance().reset();
         hideFloat();
         initConfig.isSwitchAccount = true;
+
+        if (sScheduledWorker != null) {
+            sScheduledWorker.cancel();
+            SdkRequest.getInstance().uploadUserOnlineAction(activity, "0", SdkLoginInfo.getInstance().rn_si, new IRequestCallback() {
+                @Override
+                public void onResponse(ResultInfo resultInfo) {
+                    if (resultInfo.code == ResultInfo.CODE_SUCCESS){
+                        Logger.i("上报角色在线状态成功");
+                    }else{
+                        Logger.i("上报角色在线状态失败");
+                    }
+                }
+            });
+        }
     }
 
 
@@ -192,6 +220,9 @@ public class SdkPlatformImpl implements IFeature, ILifeCycle, IApplication {
     @Override
     public void onDestroy(Activity activity) {
         releaseFloat();
+        if (sScheduledWorker != null) {
+            sScheduledWorker.cancel();
+        }
     }
 
     @Override
@@ -230,11 +261,13 @@ public class SdkPlatformImpl implements IFeature, ILifeCycle, IApplication {
             }
         });
 
-
-
     }
 
+    public void loginSuccess(){
+        operateRealNameDialog(activity);
+    }
 
+    @Override
     public void startPay(Activity activity, SdkOrderInfo sdkOrderInfo, final ICallback callback) {
 
         if (!TextUtils.isEmpty(sdkOrderInfo.getPay_web_url())){
@@ -268,9 +301,91 @@ public class SdkPlatformImpl implements IFeature, ILifeCycle, IApplication {
 
     }
 
+    void operateRealNameDialog(Activity activity){
+        if (initConfig.isOpenRealName && !SdkLoginInfo.getInstance().isVefityRealName){
+
+                new WvPageListDialog(activity, ResourceUtil.getStyleId(activity, "hnyy_half_black_dialog"), SdkLoginInfo.getInstance().authentication,
+                        new WvPageListDialog.OnClosePageListener() {
+                            @Override
+                            public void onClose() {
+
+                            }
+
+                            @Override
+                            public void onDissmiss() {
+
+                                startLoginOperation();
+                            }
+
+
+                            @Override
+                            public void onRealNameSuccess() {
+
+
+                            }
+                        }, initConfig.isForceRealName).show();
+
+
+        }else{
+
+            startLoginOperation();
+        }
+    }
+
+    void startLoginOperation(){
+        showFloat();
+        loginViewModel.mImplCallback.onResult(ResultInfo.CODE_SUCCESS,SdkLoginInfo.getInstance().token);
+        startRoleOnlineWorker();
+        openEmailDialog();
+    }
+    void openEmailDialog(){
+        if (TextUtils.isEmpty(SdkLoginInfo.getInstance().solo_email)) {
+            return;
+        }
+        activity.runOnUiThread(new Runnable() {
+            @Override
+            public void run() {
+
+                new EmailDialog(activity, ResourceUtil.getStyleId(activity, "hnyy_half_black_dialog"), SdkLoginInfo.getInstance().solo_email).show();
 
+            }
+        });
+    }
+
+    private void startRoleOnlineWorker(){
+        if (TextUtils.isEmpty(SdkLoginInfo.getInstance().rn_si)){
+            Logger.i(" rn_si is null");
+            return;
+        }
+        if (sScheduledWorker == null) {
+            sScheduledWorker = new ScheduledWorker(1);
+        }
+        sScheduledWorker.cancel();
+        int time = initConfig.rn_bh;
+        Logger.i(" ------ 开始防沉迷计时任务  : " + time);
+        sScheduledWorker.invokeAtFixedRate(new Runnable() {
+            @Override
+            public void run() {
+
+                Logger.i(" ------ 用户角色心跳 ------");
 
+                SdkRequest.getInstance().uploadUserOnlineAction(activity, "2", SdkLoginInfo.getInstance().rn_si, new IRequestCallback() {
+                    @Override
+                    public void onResponse(ResultInfo resultInfo) {
+                        if (resultInfo.code == ResultInfo.CODE_SUCCESS){
+                            Logger.i("上报角色在线状态成功");
+                        }else{
+                            Logger.i("上报角色在线状态失败");
+                        }
+                    }
+                });
 
+            }
+        }, time, time, TimeUnit.SECONDS);
+    }
+
+
+    @Override
     public String getChannelOrderExt() {
         return "";
     }

+ 2 - 6
library_platform/src/main/java/cn/yyxx/commsdk/platform/LoginViewModel.java

@@ -10,7 +10,6 @@ import cn.yyxx.commsdk.base.entity.ResultInfo;
 import cn.yyxx.commsdk.base.internal.ICallback;
 import cn.yyxx.commsdk.base.internal.IRequestCallback;
 import cn.yyxx.commsdk.base.internal.PhoneLoginCallBack;
-import cn.yyxx.commsdk.base.utils.Logger;
 import cn.yyxx.commsdk.core.entity.SdkLoginInfo;
 import cn.yyxx.commsdk.core.network.SdkRequest;
 
@@ -20,7 +19,7 @@ import cn.yyxx.support.JsonUtils;
 
 public class LoginViewModel {
 
-    private static ICallback mImplCallback = null;
+    public static ICallback mImplCallback = null;
 
     public LoginViewModel(ICallback callback) {
         mImplCallback = callback;
@@ -39,7 +38,6 @@ public class LoginViewModel {
                     session.password = password;
                     session.login_token = SdkLoginInfo.getInstance().login_token;
                     UserSessionManager.getInstance().saveSession(session);
-                    mImplCallback.onResult(resultInfo.code,SdkLoginInfo.getInstance().token);
 
                 }else{
                     mImplCallback.onResult(resultInfo.code,resultInfo.msg);
@@ -67,7 +65,6 @@ public class LoginViewModel {
 
                     UserSessionManager.getInstance().saveSession(session);
 
-                    mImplCallback.onResult(resultInfo.code,SdkLoginInfo.getInstance().token);
 
                 }else{
 
@@ -116,7 +113,6 @@ public class LoginViewModel {
                                 UserSessionManager.getInstance().saveSession(session);
                                 phoneLoginCallback.onPhoneLoginSuccess(resultInfo.msg);
 
-                                mImplCallback.onResult(resultInfo.code,SdkLoginInfo.getInstance().token);
 
                             }
                         }
@@ -148,7 +144,6 @@ public class LoginViewModel {
                     session.password = password;
                     session.login_token = SdkLoginInfo.getInstance().login_token;
                     UserSessionManager.getInstance().saveSession(session);
-                    mImplCallback.onResult(resultInfo.code,SdkLoginInfo.getInstance().token);
 
                 }else{
 
@@ -184,4 +179,5 @@ public class LoginViewModel {
 
 
 
+
 }

+ 1 - 0
settings.gradle

@@ -15,3 +15,4 @@ include ':library_channel'
 include ':library_channel_repository'
 include ':library_platform'
 include ':library_platform:platform_hnyy'
+include ':library_channel_repository:oppo'