Explorar el Código

1.添加o_cfg请求参数
2.添加渠道支付回调接口
3.兼容andorid_id为 0000000000000000 的问题
4.减少日志输出

kaiweicai hace 2 años
padre
commit
8591f553c8
Se han modificado 47 ficheros con 1559 adiciones y 103 borrados
  1. 6 4
      demo/build.gradle
  2. 2 1
      demo/src/main/AndroidManifest.xml
  3. 3 1
      demo/src/main/java/com/yyxx/commsdk/demo/DemoActivity.kt
  4. 5 4
      keystore.properties
  5. 1 1
      library_base/publish.gradle
  6. 2 5
      library_base/src/main/java/cn/yyxx/commsdk/Version.java
  7. 1 1
      library_base/src/main/java/cn/yyxx/commsdk/base/YYXXCommSdk.java
  8. 1 0
      library_base/src/main/java/cn/yyxx/commsdk/base/entity/Function.java
  9. 4 0
      library_base/src/main/java/cn/yyxx/commsdk/base/internal/feature/IFeature.java
  10. 1 1
      library_channel/publish.gradle
  11. 3 0
      library_channel/src/main/java/cn/yyxx/commsdk/impl/ChannelSdkImpl.java
  12. 9 2
      library_channel/src/main/java/cn/yyxx/commsdk/impl/merge/LoginViewModel.java
  13. 10 1
      library_channel/src/main/java/cn/yyxx/commsdk/impl/merge/channel/ChannelSdk.java
  14. 9 5
      library_channel/src/main/java/cn/yyxx/commsdk/impl/merge/platform/PlatformSdk.java
  15. 1 0
      library_channel_repository/huawei/.gitignore
  16. 46 0
      library_channel_repository/huawei/build.gradle
  17. 21 0
      library_channel_repository/huawei/proguard-rules.pro
  18. 29 0
      library_channel_repository/huawei/src/main/AndroidManifest.xml
  19. 27 0
      library_channel_repository/huawei/src/main/assets/agconnect-services.json
  20. 5 0
      library_channel_repository/huawei/src/main/assets/yyxx_game/yyxx_cfg.properties
  21. 169 0
      library_channel_repository/huawei/src/main/java/cn/yyxx/commsdk/impl/merge/channel/ChannelBridge.java
  22. 826 0
      library_channel_repository/huawei/src/main/java/cn/yyxx/commsdk/impl/merge/channel/huawei/ChannelBridgeImpl.java
  23. 96 0
      library_channel_repository/huawei/src/main/java/cn/yyxx/commsdk/impl/merge/channel/huawei/RealAssertUtils.java
  24. 67 0
      library_channel_repository/huawei/src/main/java/cn/yyxx/commsdk/impl/merge/channel/msa/MsaDeviceHandler.java
  25. 19 0
      library_channel_repository/huawei/src/main/java/cn/yyxx/commsdk/impl/merge/channel/utils/ParamsUtils.java
  26. 5 0
      library_channel_repository/oppo/src/main/java/cn/yyxx/commsdk/impl/merge/channel/ChannelBridge.java
  27. 6 1
      library_channel_repository/oppo/src/main/java/cn/yyxx/commsdk/impl/merge/channel/oppo/ChannelBridgeImpl.java
  28. 1 1
      library_core/publish.gradle
  29. 7 2
      library_core/src/main/cpp/tool_kit.cpp
  30. 35 2
      library_core/src/main/cpp/yyxxgame.cpp
  31. 3 0
      library_core/src/main/java/cn/yyxx/commsdk/core/SdkDrive.java
  32. 13 10
      library_core/src/main/java/cn/yyxx/commsdk/core/common/CommonOperationManager.java
  33. 15 10
      library_core/src/main/java/cn/yyxx/commsdk/core/entity/SdkLoginInfo.java
  34. 3 2
      library_core/src/main/java/cn/yyxx/commsdk/core/impl/SdkBridgeImpl.java
  35. 25 15
      library_core/src/main/java/cn/yyxx/commsdk/core/network/SdkRequest.java
  36. 29 32
      library_core/src/main/java/cn/yyxx/commsdk/core/network/VolleyRequest.java
  37. 9 0
      library_core/src/main/java/cn/yyxx/commsdk/core/utils/ParamsUtils.java
  38. 5 0
      library_platform/hnqj/src/main/java/cn/yyxx/commsdk/impl/merge/platform/SdkPlatformBridge.java
  39. 5 0
      library_platform/hnqj/src/main/java/cn/yyxx/commsdk/impl/merge/platform/hnqj/impl/SdkPlatformImpl.java
  40. 2 2
      library_platform/hnqj/src/main/res/layout/qj_usercenter_dialog.xml
  41. 5 0
      library_platform/hnyy/src/main/java/cn/yyxx/commsdk/impl/merge/platform/SdkPlatformBridge.java
  42. 5 0
      library_platform/hnyy/src/main/java/cn/yyxx/commsdk/impl/merge/platform/hnyy/impl/SdkPlatformImpl.java
  43. 5 0
      library_platform/shxy/src/main/java/cn/yyxx/commsdk/impl/merge/platform/SdkPlatformBridge.java
  44. 5 0
      library_platform/shxy/src/main/java/cn/yyxx/commsdk/impl/merge/platform/shxy/impl/SdkPlatformImpl.java
  45. 5 0
      library_platform/xinrui/src/main/java/cn/yyxx/commsdk/impl/merge/platform/SdkPlatformBridge.java
  46. 5 0
      library_platform/xinrui/src/main/java/cn/yyxx/commsdk/impl/merge/platform/xinrui/impl/SdkPlatformImpl.java
  47. 3 0
      settings.gradle

+ 6 - 4
demo/build.gradle

@@ -12,11 +12,11 @@ android {
     buildToolsVersion rootProject.ext.android.buildToolsVersion
 
     defaultConfig {
-        applicationId 'com.yyxx.commsdk.demo'
+        applicationId 'com.yyxx.qyj2.huawei'
         minSdk rootProject.ext.android.minSdk
         targetSdk 26
-        versionCode 1
-        versionName "0.0.1"
+        versionCode 20000
+        versionName "20.2.0"
 
         multiDexEnabled true
 
@@ -78,10 +78,12 @@ dependencies {
 
 //    implementation project(path: ':library_platform:shxy')
 
-    implementation project(path: ':library_platform:xinrui')
+//    implementation project(path: ':library_platform:xinrui')
 
 //    implementation project(path: ':library_channel_repository:oppo')
 
+        implementation project(path: ':library_channel_repository:huawei')
+
     implementation project(path: ':library_base')
 
 }

+ 2 - 1
demo/src/main/AndroidManifest.xml

@@ -19,7 +19,8 @@
 
 
     <application
-        android:name="cn.yyxx.commsdk.base.YYXXApplication"
+        android:debuggable="true"
+        android:requestLegacyExternalStorage="true"        android:name="cn.yyxx.commsdk.base.YYXXApplication"
         android:allowBackup="true"
         android:icon="@mipmap/ic_launcher"
         android:label="@string/app_name"

+ 3 - 1
demo/src/main/java/com/yyxx/commsdk/demo/DemoActivity.kt

@@ -190,7 +190,9 @@ class DemoActivity : Activity(), View.OnClickListener {
                     YYXXCommSdk.getInstance().reportGameEvent("主线任务1", getGameEvent());
                 }
                 9 ->{
-                    YYXXCommSdk.getInstance().getOaid();
+                    YYXXCommSdk.getInstance().getOaid()
+                    YYXXCommSdk.getInstance().onActivityResult(this@DemoActivity,0,13,null)
+
                 }
 
             }

+ 5 - 4
keystore.properties

@@ -1,4 +1,5 @@
-storePassword=shzd1y28_yyxx2021
-keyPassword=shzd1y28_yyxx2021
-keyAlias=alias.shzd_yyxx2021
-storeFile=../zkeystore/shzd_yyxx.keystore
+storePassword=yyrh123456
+keyPassword=yyrh123456
+keyAlias=yyrh
+storeFile=/Users/kaiweicai/Documents/Android/keystore/yyrh.jks
+

+ 1 - 1
library_base/publish.gradle

@@ -4,7 +4,7 @@ apply plugin: 'signing'
 ext {
     PUBLISH_GROUP_ID = 'io.github.yyxxgame.sdk'
     PUBLISH_ARTIFACT_ID = 'yyxx-comm-base'
-    PUBLISH_VERSION = '3.0.300'
+    PUBLISH_VERSION = '3.0.304'
 }
 
 

+ 2 - 5
library_base/src/main/java/cn/yyxx/commsdk/Version.java

@@ -1,9 +1,6 @@
 package cn.yyxx.commsdk;
 
-/**
- * @author #Suyghur.
- * Created on 2021/12/25
- */
+
 public class Version {
-    public static final String VERSION_NAME = "3.0.300";
+    public static final String VERSION_NAME = "3.0.304";
 }

+ 1 - 1
library_base/src/main/java/cn/yyxx/commsdk/base/YYXXCommSdk.java

@@ -407,7 +407,7 @@ public final class YYXXCommSdk {
         }
 
         SdkBridgeManager.call(Function.ON_ACTIVITY_RESULT,
-                new Class[]{Activity.class, Integer.class, Integer.class, Intent.class},
+                new Class[]{Activity.class, int.class, int.class, Intent.class},
                 new Object[]{activity, requestCode, resultCode, intent});
     }
 

+ 1 - 0
library_base/src/main/java/cn/yyxx/commsdk/base/entity/Function.java

@@ -20,6 +20,7 @@ public @interface Function {
     String CHARGE = "charge";
     String START_PAY = "startPay";
     String GET_CHANNEL_ORDER_EXT = "getChannelOrderExt";
+    String GET_CHANNEL_O_CFG = "getChannelOcfg";
     String UPLOAD_ROLE_INFO = "uploadRoleInfo";
     String INIT_MSA_DEVICE_IDS = "initMsaDeviceIds";
     String GET_OAID ="getOaid";

+ 4 - 0
library_base/src/main/java/cn/yyxx/commsdk/base/internal/feature/IFeature.java

@@ -37,4 +37,8 @@ public interface IFeature {
 
     void initMsaDeviceIds(Context context, final IMsaDeviceCallback iMsaDeviceCallback);
 
+    String getChannelOcfg(Activity activity);
+
+
+
 }

+ 1 - 1
library_channel/publish.gradle

@@ -4,7 +4,7 @@ apply plugin: 'signing'
 ext {
     PUBLISH_GROUP_ID = 'io.github.yyxxgame.sdk'
     PUBLISH_ARTIFACT_ID = 'yyxx-comm-channel'
-    PUBLISH_VERSION = '3.0.300'
+    PUBLISH_VERSION = '3.0.304'
 }
 
 

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

@@ -101,6 +101,9 @@ public class ChannelSdkImpl {
         return impl.hasExitView(activity);
     }
 
+    public String getChannelOcfg(Activity activity){
+       return impl.getChannelOcfg(activity);
+    }
     public String getChannelOrderExt(){
         if (impl instanceof IOrder) {
             return ((IOrder) impl).getChannelOrderExt();

+ 9 - 2
library_channel/src/main/java/cn/yyxx/commsdk/impl/merge/LoginViewModel.java

@@ -10,9 +10,12 @@ 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;
 
+import cn.yyxx.commsdk.core.ui.dialog.LoadingDialogUtils;
+import cn.yyxx.commsdk.core.utils.ResourceUtil;
 import cn.yyxx.commsdk.impl.merge.user.UserSession;
 import cn.yyxx.commsdk.impl.merge.user.UserSessionManager;
 import cn.yyxx.support.JsonUtils;
@@ -177,11 +180,15 @@ public class LoginViewModel {
         });
     }
 
-    public void verifyChannelinfo(Activity activity,String channelInfo){
+    public void verifyChannelInfo(Activity activity, String channelInfo){
+
+        LoadingDialogUtils.getInstance().show(activity);
+
         SdkRequest.getInstance().verfifyChannelLoginInfo(activity, channelInfo, new IRequestCallback() {
             @Override
             public void onResponse(ResultInfo resultInfo) {
                 {
+                    LoadingDialogUtils.getInstance().hide();
                     if (resultInfo.code == ResultInfo.CODE_SUCCESS && !TextUtils.isEmpty(resultInfo.data)){
 
                         SdkLoginInfo.getInstance().initLoginInfo(resultInfo.data);
@@ -201,7 +208,7 @@ public class LoginViewModel {
         SdkRequest.getInstance().requestChannelExtInfo(activity,host,info, new IRequestCallback() {
             @Override
             public void onResponse(ResultInfo resultInfo) {
-
+                callback.onResult(resultInfo.code,resultInfo.data);
             }
         });
     }

+ 10 - 1
library_channel/src/main/java/cn/yyxx/commsdk/impl/merge/channel/ChannelSdk.java

@@ -132,6 +132,15 @@ public class ChannelSdk implements IFeature,ILifeCycle, IApplication,IOrder {
 
     }
 
+    @Override
+    public String getChannelOcfg(Activity activity) {
+
+        checkSdkBridgeNull();
+
+        return (String) SdkProxyChannelManager.callback(Function.GET_CHANNEL_O_CFG, new Class[]{Activity.class}, new Object[]{activity});
+
+    }
+
 
     @Override
     public void attachBaseContext(Application application, Context context) {
@@ -186,7 +195,7 @@ public class ChannelSdk implements IFeature,ILifeCycle, IApplication,IOrder {
     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 Class[]{Activity.class, int.class, int.class, Intent.class},
                 new Object[]{activity, requestCode, resultCode, data});
         
     }

+ 9 - 5
library_channel/src/main/java/cn/yyxx/commsdk/impl/merge/platform/PlatformSdk.java

@@ -24,10 +24,6 @@ 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 PlatformSdk implements IFeature,ILifeCycle, IApplication,IOrder {
 
     private static PlatformSdk platformSdk;
@@ -133,6 +129,13 @@ public class PlatformSdk implements IFeature,ILifeCycle, IApplication,IOrder {
 
     }
 
+    @Override
+    public String getChannelOcfg(Activity activity) {
+        checkSdkBridgeNull();
+        return  (String) SdkProxyPlatformManager.callback(Function.GET_CHANNEL_O_CFG,  new Class[]{Activity.class}, new Object[]{activity});
+
+    }
+
 
     @Override
     public void attachBaseContext(Application application, Context context) {
@@ -187,7 +190,7 @@ public class PlatformSdk implements IFeature,ILifeCycle, IApplication,IOrder {
     public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) {
         checkSdkBridgeNull();
         SdkProxyPlatformManager.call(Function.ON_ACTIVITY_RESULT,
-                new Class[]{Activity.class, Integer.class, Integer.class, Intent.class},
+                new Class[]{Activity.class, int.class, int.class, Intent.class},
                 new Object[]{activity, requestCode, resultCode, data});
         
     }
@@ -238,4 +241,5 @@ public class PlatformSdk implements IFeature,ILifeCycle, IApplication,IOrder {
     public String getChannelOrderExt() {
         return (String) SdkProxyPlatformManager.callback(Function.GET_CHANNEL_ORDER_EXT, new Class[]{},new Object[]{});
     }
+
 }

+ 1 - 0
library_channel_repository/huawei/.gitignore

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

+ 46 - 0
library_channel_repository/huawei/build.gradle

@@ -0,0 +1,46 @@
+apply plugin: 'com.android.library'
+android {
+    compileSdkVersion 28
+
+
+
+    defaultConfig {
+        minSdkVersion 17
+        targetSdkVersion 23
+        versionCode 1
+        versionName "1.0"
+
+    }
+    buildTypes {
+        release {
+            minifyEnabled false
+            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+        }
+    }
+
+}
+
+
+dependencies {
+
+    api fileTree(dir: 'libs', include: ['*.jar'])
+
+    api 'com.huawei.hms:base:6.3.0.301'
+    api 'com.huawei.hms:hwid:6.4.0.300'
+    api 'com.huawei.hms:iap:6.3.0.300'
+    api 'com.huawei.hms:game:6.2.0.301'
+    api 'com.huawei.hms:hianalytics:6.4.1.302'
+
+
+    api 'com.huawei.hms:ads-identifier:3.4.39.302'
+    api 'com.huawei.hms:ads-installreferrer:3.4.39.302'
+
+
+    compileOnly project(':library_base')
+
+    compileOnly project(':library_core')
+
+
+    compileOnly project(':library_channel')
+
+}

+ 21 - 0
library_channel_repository/huawei/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

+ 29 - 0
library_channel_repository/huawei/src/main/AndroidManifest.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.merge.yyxx.huawei">
+
+
+    <application>
+
+
+
+        <meta-data
+            android:name="com.huawei.hms.client.channel.androidMarket"
+            android:value="false"
+            />
+    </application>
+
+
+    <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
+    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
+    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
+
+    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
+    <uses-permission android:name="android.permission.BLUETOOTH"/>
+
+    <uses-permission
+        android:name="com.huawei.appmarket.service.commondata.permission.GET_COMMON_DATA" />
+
+</manifest>

+ 27 - 0
library_channel_repository/huawei/src/main/assets/agconnect-services.json

@@ -0,0 +1,27 @@
+{
+	"agcgw":{
+		"backurl":"connect-drcn.dbankcloud.cn",
+		"url":"connect-drcn.hispace.hicloud.com"
+	},
+	"client":{
+		"cp_id":"890086200300022659",
+		"product_id":"9105385871708146003",
+		"client_id":"207609245833626624",
+		"client_secret":"6F94EAF0B2DC9381D923F4430274AA1E09DC02283B2CFB5C42AB6A1A67C6C277",
+		"app_id":"101215129",
+		"package_name":"com.yyxx.qyj2.huawei",
+		"api_key":"CV6QVxagVDKVisaDUdxsPfJ0syCSveoIFbZD2LVgAktXDr34ERfYRx1rNgV20PkOXTM9nperi09/WcMNdg4ZTlW01AGP"
+	},
+	"service":{
+		"analytics":{
+			"collector_url":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
+			"resource_id":"p1",
+			"channel_id":""
+		},
+		"ml":{
+			"mlservice_url":"ml-api-drcn.ai.dbankcloud.com,ml-api-drcn.ai.dbankcloud.cn"
+		}
+	},
+	"region":"CN",
+	"configuration_version":"1.0"
+}

+ 5 - 0
library_channel_repository/huawei/src/main/assets/yyxx_game/yyxx_cfg.properties

@@ -0,0 +1,5 @@
+YYXX_GCP_CODE=Y010402
+YYXX_ONLINE_ENV=http://testsdkapi.yyxxgame.com
+YYXX_PLATFORM=HUAWEI
+#channel params
+

+ 169 - 0
library_channel_repository/huawei/src/main/java/cn/yyxx/commsdk/impl/merge/channel/ChannelBridge.java

@@ -0,0 +1,169 @@
+package cn.yyxx.commsdk.impl.merge.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.IMsaDeviceCallback;
+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.merge.channel.huawei.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(Activity activity, int loginStatus) {
+        impl.initializeSuccess(activity,loginStatus);
+    }
+
+    @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 initMsaDeviceIds(Context context, IMsaDeviceCallback iMsaDeviceCallback) {
+        impl.initMsaDeviceIds(context,iMsaDeviceCallback);
+    }
+
+    @Override
+    public String getChannelOcfg(Activity activity) {
+        return impl.getChannelOcfg(activity);
+    }
+
+
+    @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.onRestart(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();
+    }
+}

+ 826 - 0
library_channel_repository/huawei/src/main/java/cn/yyxx/commsdk/impl/merge/channel/huawei/ChannelBridgeImpl.java

@@ -0,0 +1,826 @@
+package cn.yyxx.commsdk.impl.merge.channel.huawei;
+
+import android.app.Activity;
+import android.app.Application;
+import android.content.ContentResolver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentSender;
+import android.content.SharedPreferences;
+import android.content.res.Configuration;
+import android.database.Cursor;
+import android.net.Uri;
+import android.os.Bundle;
+import android.text.TextUtils;
+import android.util.Log;
+
+
+import com.huawei.agconnect.config.AGConnectServicesConfig;
+import com.huawei.agconnect.config.LazyInputStream;
+import com.huawei.hmf.tasks.OnFailureListener;
+import com.huawei.hmf.tasks.OnSuccessListener;
+import com.huawei.hmf.tasks.Task;
+import com.huawei.hms.common.ApiException;
+import com.huawei.hms.iap.Iap;
+import com.huawei.hms.iap.IapApiException;
+import com.huawei.hms.iap.entity.ConsumeOwnedPurchaseReq;
+import com.huawei.hms.iap.entity.ConsumeOwnedPurchaseResult;
+import com.huawei.hms.iap.entity.InAppPurchaseData;
+import com.huawei.hms.iap.entity.IsEnvReadyResult;
+import com.huawei.hms.iap.entity.OrderStatusCode;
+import com.huawei.hms.iap.entity.OwnedPurchasesReq;
+import com.huawei.hms.iap.entity.OwnedPurchasesResult;
+import com.huawei.hms.iap.entity.ProductInfoReq;
+import com.huawei.hms.iap.entity.ProductInfoResult;
+import com.huawei.hms.iap.entity.PurchaseIntentReq;
+import com.huawei.hms.iap.entity.PurchaseIntentResult;
+import com.huawei.hms.jos.AntiAddictionCallback;
+import com.huawei.hms.jos.AppParams;
+import com.huawei.hms.jos.AppUpdateClient;
+import com.huawei.hms.jos.JosApps;
+import com.huawei.hms.jos.JosAppsClient;
+import com.huawei.hms.jos.games.AppPlayerInfo;
+import com.huawei.hms.jos.games.Games;
+import com.huawei.hms.jos.games.PlayersClient;
+import com.huawei.hms.jos.games.player.Player;
+import com.huawei.hms.support.account.AccountAuthManager;
+import com.huawei.hms.support.account.request.AccountAuthParams;
+import com.huawei.hms.support.account.request.AccountAuthParamsHelper;
+import com.huawei.hms.support.account.service.AccountAuthService;
+import com.huawei.hms.support.api.client.Status;
+import com.huawei.hms.support.hwid.HuaweiIdAuthManager;
+import com.huawei.hms.support.hwid.result.AuthHuaweiId;
+import com.huawei.updatesdk.service.appmgr.bean.ApkUpgradeInfo;
+import com.huawei.updatesdk.service.otaupdate.CheckUpdateCallBack;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import cn.yyxx.commsdk.base.constants.Constants;
+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.IMsaDeviceCallback;
+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.impl.merge.LoginViewModel;
+import cn.yyxx.commsdk.impl.merge.channel.msa.MsaDeviceHandler;
+import cn.yyxx.commsdk.impl.merge.channel.utils.ParamsUtils;
+
+/**
+ * @author #Suyghur.
+ * Created on 2021/12/25
+ */
+public class ChannelBridgeImpl implements IFeature, ILifeCycle, IApplication, IOrder {
+
+
+
+    LoginViewModel loginViewModel;
+
+    private String trackId;
+
+    public final static  String  TAG = "HuaWeiSDK";
+
+    public final static  String  AD_TAG = "huawei_pkg_data";
+
+    private boolean hasInit = false;
+
+
+    String notifyUrl = "";
+
+
+    private static final int INDEX_REFERRER = 0;
+
+    private static final int INDEX_ENTER_AG_TIME = 1;
+    private static final int INDEX_START_DOWNLOAD_TIME = 2;
+    private static final int INDEX_TRACKID = 4;
+    private static final String PROVIDER_URI = "content://com.huawei.appmarket.commondata/item/5";
+
+
+
+
+    private AccountAuthParams mAuthParam;
+    private AccountAuthService mAuthManager;
+
+    private String playerId;
+
+
+
+    //login
+    public static final int REQUEST_SIGN_IN_LOGIN = 1002;
+
+    //login
+    public static final int REQUEST_IAP = 6666;
+
+    private Activity activity;
+
+    public ChannelBridgeImpl(Context context){
+
+    }
+
+    @Override
+    public void attachBaseContext(Application application, Context context) {
+        /**
+        AGConnectOptionsBuilder agConnectOptionsBuilder = new AGConnectOptionsBuilder();
+        try {
+            agConnectOptionsBuilder.setRoutePolicy(AGCRoutePolicy.CHINA)
+                    .setInputStream(context.getAssets().open("agconnect-services.json"));
+
+            AGConnectInstance.initialize(application, agConnectOptionsBuilder);
+
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+        // 初始化AGC框架
+**/
+
+        AGConnectServicesConfig config = AGConnectServicesConfig.fromContext(context);
+        config.overlayWith(new LazyInputStream(context) {
+            public InputStream get(Context context) {
+                try {
+                    return context.getAssets().open("agconnect-services.json");
+                } catch (IOException e) {
+                    return null;
+                }
+            }
+        });
+
+    }
+
+    @Override
+    public void initApplication(Application application) {
+
+
+
+
+
+    }
+
+    @Override
+    public void initialize(Activity activity, ICallback callback) {
+        init(activity);
+        checkUpdate(activity);
+        trackId = getTrackId(activity);
+
+        if (judgeStrNull(trackId)){
+            Logger.i(TAG,"is null");
+        }else{
+            Logger.i(TAG,trackId);
+        }
+
+        hasInit = true;
+    }
+
+    public void init(Activity ac) {
+
+        JosAppsClient appsClient = JosApps.getJosAppsClient(ac);
+        AppParams appParams = new AppParams();
+        appParams.setAuthScope(AccountAuthParams.DEFAULT_AUTH_REQUEST_PARAM_GAME);
+        appParams.setAntiAddictionCallback(new AntiAddictionCallback() {
+            @Override
+            public void onExit() {
+                System.exit(0);
+            }
+        });
+        appsClient.init(appParams);
+        activity = ac;
+
+    }
+    public void checkUpdate(final Activity ac) {
+        AppUpdateClient client = JosApps.getAppUpdateClient(ac);
+        client.checkAppUpdate(ac, new CheckUpdateCallBack() {
+            @Override
+            public void onUpdateInfo(Intent intent) {
+
+                if (intent != null) {
+                    Serializable info = intent.getSerializableExtra("updatesdk_update_info");
+                    if (info instanceof ApkUpgradeInfo) {
+
+                        ApkUpgradeInfo apkUpgradeInfo = (ApkUpgradeInfo) info;
+
+                    }
+                }
+            }
+
+            @Override
+            public void onMarketInstallInfo(Intent intent) {
+
+            }
+
+            @Override
+            public void onMarketStoreError(int i) {
+
+            }
+
+            @Override
+            public void onUpdateStoreError(int i) {
+
+            }
+        });
+    }
+
+    /**
+     * 获取 trackid
+
+     * @return json 格式字符串
+     */
+    private String getTrackId(Activity activity) {
+        String pkgName = getPackageName(activity);
+        String trackId = null;
+        Cursor cursor = null;
+        Uri uri = Uri.parse(PROVIDER_URI);
+        ContentResolver contentResolver = activity.getContentResolver();
+        String packageName[] = new String[] { pkgName };
+        try {
+            cursor = contentResolver.query(uri, null, null, packageName, null);
+
+            if (cursor != null) {
+                cursor.moveToFirst();
+                Logger.i(TAG, "packageName=" + pkgName);
+                if (cursor.getColumnCount() > INDEX_TRACKID) {
+                    // 10.5.0.300 及之后版本
+                    Logger.i(TAG, "version is Version greater than 10.5.0.300");
+                    Logger.i(TAG, "referrer=" + cursor.getString(INDEX_REFERRER));
+                    Logger.i(TAG, "enter appgallery time=" +
+                            cursor.getString(INDEX_ENTER_AG_TIME));
+                    Logger.i(TAG, "donwload time=" +
+                            cursor.getString(INDEX_START_DOWNLOAD_TIME));
+                    Logger.i(TAG, "track id=" + cursor.getString(INDEX_TRACKID));
+                    trackId = cursor.getString(INDEX_TRACKID);
+                } else if (cursor.getColumnCount() > INDEX_START_DOWNLOAD_TIME){
+                    // 兼容旧版本
+                    Logger.i(TAG, "version is Version less than 10.5.0.300");
+                    trackId = cursor.getString(INDEX_REFERRER);
+                    Logger.i(TAG, "referrer=" + cursor.getString(INDEX_REFERRER));
+                    Logger.i(TAG, "enter appgallery time=" +
+                            cursor.getString(INDEX_ENTER_AG_TIME));
+                    Logger.i(TAG, "donwload time=" +
+                            cursor.getString(INDEX_START_DOWNLOAD_TIME));
+                    return trackId;
+                } else {
+                    // 不支持归因信息
+                    Logger.e(TAG, "appgallery not support");
+                }
+            }
+        }finally {
+            if (cursor != null) {
+                cursor.close();
+            }
+
+        }
+        // 如果 trackid 是 json 格式,打印具体内容
+        if (!TextUtils.isEmpty(trackId)) {
+            try {
+                JSONObject attributionMap = new JSONObject(trackId);
+
+                Logger.i(TAG, "json channel id=" + attributionMap.getString("channel"));
+                Logger.i(TAG, "json callback=" + attributionMap.get("callback"));
+                Logger.i(TAG, "json taskid=" + attributionMap.get("taskid"));
+
+            } catch (JSONException e) {
+                e.printStackTrace();
+            }
+            Logger.i(TAG, "trackId is json  :" + trackId);
+        }
+
+        return trackId;
+    }
+
+    @Override
+    public void initializeSuccess(Activity activity, int loginStatus) {
+
+    }
+
+    @Override
+    public void setLogoutListener(Activity activity, ICallback callback) {
+
+    }
+
+    @Override
+    public void login(final Activity activity, InitBean initBean, ICallback callback) {
+
+        loginViewModel  = new LoginViewModel(callback);
+
+        signIn(activity);
+
+    }
+
+    private void signIn(Activity activity) {
+        mAuthParam = new AccountAuthParamsHelper(AccountAuthParams.DEFAULT_AUTH_REQUEST_PARAM)
+                .setIdToken()
+                .setAccessToken()
+                .createParams();
+        mAuthManager = AccountAuthManager.getService(activity, mAuthParam);
+        activity.startActivityForResult(mAuthManager.getSignInIntent(),REQUEST_SIGN_IN_LOGIN);
+
+
+    }
+
+
+
+    @Override
+    public void logout() {
+        signOut();
+    }
+    /**
+     * Codelab Code
+     * sign Out by signOut
+     */
+    private void signOut() {
+        Task<Void> signOutTask = mAuthManager.signOut();
+        signOutTask.addOnSuccessListener(new OnSuccessListener<Void>() {
+            @Override
+            public void onSuccess(Void aVoid) {
+                Logger.i(TAG, "signOut Success");
+            }
+        }).addOnFailureListener(new OnFailureListener() {
+            @Override
+            public void onFailure(Exception e) {
+                Logger.i(TAG, "signOut fail");
+            }
+        });
+    }
+
+    @Override
+    public boolean hasExitView(Activity activity) {
+        return false;
+    }
+
+    @Override
+    public void openExitView(Activity activity, ICallback iCallback) {
+        iCallback.onResult(ResultInfo.CODE_SUCCESS,"EXIT GAME.");
+    }
+
+    @Override
+    public void uploadRoleInfo(Activity activity, String type, SdkRoleInfo roleInfo) {
+
+
+        if (type == Constants.UPLOAD_TYPE_ENTER_GAME){
+            savePlayerInfo(activity,roleInfo.getServerName(),roleInfo.getRoleLevel(),roleInfo.getRoleName(),roleInfo.getPartyName());
+        }
+    }
+
+    public void savePlayerInfo(Activity ac, String serverName,String roleLevel,String roleName,String partyName) {
+        if (TextUtils.isEmpty(playerId)) {
+
+            return;
+        }
+        PlayersClient client = Games.getPlayersClient(ac);
+        AppPlayerInfo appPlayerInfo = new AppPlayerInfo();
+        appPlayerInfo.area = serverName;
+        appPlayerInfo.rank = roleLevel;
+        appPlayerInfo.role = roleName;
+        appPlayerInfo.sociaty = partyName;
+        appPlayerInfo.playerId = playerId;
+        Task<Void> task = client.savePlayerInfo(appPlayerInfo);
+        task.addOnSuccessListener(new OnSuccessListener<Void>() {
+            @Override
+            public void onSuccess(Void v) {
+
+            }
+        }).addOnFailureListener(new OnFailureListener() {
+            @Override
+            public void onFailure(Exception e) {
+                if (e instanceof ApiException) {
+                    String result = "rtnCode:" + ((ApiException) e).getStatusCode();
+
+                }
+            }
+        });
+    }
+
+    @Override
+    public void reportGameEvent(String event, JSONObject message) {
+
+    }
+
+    @Override
+    public void initMsaDeviceIds(Context context, IMsaDeviceCallback iMsaDeviceCallback) {
+        MsaDeviceHandler.initMsaDeviceIds(context,iMsaDeviceCallback);
+    }
+
+    @Override
+    public String getChannelOcfg(Activity activity) {
+
+        String huawei_pkg_data = RealAssertUtils.getSharedPreferences(activity,AD_TAG,AD_TAG);
+
+        Logger.i(AD_TAG + " : ", huawei_pkg_data);
+
+        if (judgeStrNull(huawei_pkg_data)){
+
+            Logger.i(AD_TAG + " : ","is null, frist open the game.");
+
+            String gcp_code = ParamsUtils.getCfgParam(activity,"YYXX_GCP_CODE");
+            if (judgeStrNull(gcp_code)){
+                return null;
+            }else{
+
+                String sp_code  = RealAssertUtils.GetApplicationMetaData(activity,"YYXX_COMM_SP_CODE");
+                JSONObject json = new JSONObject();
+                try {
+                    json.put("gcp_code",gcp_code);
+                    if (!judgeStrNull(sp_code)){
+                        json.put("sp_code",sp_code);
+                    }
+
+                } catch (JSONException e) {
+                    e.printStackTrace();
+                }
+                RealAssertUtils.saveSharedPreferences(activity,AD_TAG,AD_TAG,json.toString());
+                return json.toString();
+            }
+        }else{
+            return huawei_pkg_data;
+        }
+
+
+    }
+
+
+    @Override
+    public void onStart(Activity activity) {
+
+    }
+
+    @Override
+    public void onResume(Activity activity) {
+        showFloatWindowNewWay(activity);
+    }
+
+    @Override
+    public void onRestart(Activity activity) {
+
+    }
+
+    @Override
+    public void onPause(Activity activity) {
+        hideFloatWindowNewWay(activity);
+    }
+
+    @Override
+    public void onStop(Activity activity) {
+
+    }
+
+    @Override
+    public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) {
+        if (requestCode == REQUEST_SIGN_IN_LOGIN) {
+            //login success
+            //get user message by parseAuthResultFromIntent
+            Task<AuthHuaweiId> authHuaweiIdTask = HuaweiIdAuthManager.parseAuthResultFromIntent(data);
+            if (authHuaweiIdTask.isSuccessful()) {
+                currentPlayerInfo(activity);
+
+            } else {
+                Logger.i(TAG, "signIn failed: " + ((ApiException) authHuaweiIdTask.getException()).getStatusCode());
+            }
+        }
+    }
+
+
+    private void currentPlayerInfo(final Activity ac) {
+
+        PlayersClient client = Games.getPlayersClient(ac);
+        Task<Player> task = client.getCurrentPlayer();
+        task.addOnSuccessListener(new OnSuccessListener<Player>() {
+            @Override
+            public void onSuccess(Player player) {
+                String ts = player.getSignTs();
+                playerId = player.getPlayerId();
+                String playerLevel = player.getLevel() + "";
+                String playerSSign = player.getPlayerSign();
+
+
+                JSONObject json = new JSONObject();
+                try {
+                    json.put("ts",ts);
+                    json.put("playerId",playerId);
+                    json.put("playerLevel",playerLevel);
+                    json.put("playerSSign",playerSSign);
+
+
+                    if (!judgeStrNull(trackId)){
+                        json.put("ntrackId",trackId);
+                    }
+
+                } catch (JSONException e) {
+                    e.printStackTrace();
+                }
+
+
+                if (playerId != null && playerLevel != null &&playerLevel != null && playerSSign != null){
+                    loginViewModel.verifyChannelInfo(ac,json.toString());
+                }
+
+
+
+
+            }
+        }).addOnFailureListener(new OnFailureListener() {
+            @Override
+            public void onFailure(Exception e) {
+                // 获取玩家信息失败
+                if (e instanceof ApiException) {
+                    if (((ApiException) e).getStatusCode() == 7018){
+                        init(ac);
+                    }
+
+                }
+            }
+        });
+    }
+
+
+    @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 order_id = sdkOrderInfo.getOrder_id();
+
+
+        String trdext = sdkOrderInfo.getOrder_ext();
+        String productId = "";
+
+
+
+
+        try {
+            JSONObject json = new JSONObject(trdext);
+            notifyUrl = json.getString("notifyUrl");
+            productId = json.getString("productId");
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+
+        final PurchaseIntentReq request = new PurchaseIntentReq();
+
+        request.setDeveloperPayload(order_id);
+        request.setPriceType(0);
+        request.setProductId(productId);
+
+
+
+        Task<IsEnvReadyResult> task = Iap.getIapClient(activity).isEnvReady();
+        task.addOnSuccessListener(new OnSuccessListener<IsEnvReadyResult>() {
+            @Override
+            public void onSuccess(IsEnvReadyResult result) {
+                // 获取接口请求的结果
+
+                obtainOwnedPurchases(activity,request);
+
+            }
+        }).addOnFailureListener(new OnFailureListener() {
+            @Override
+            public void onFailure(Exception e) {
+                if (e instanceof IapApiException) {
+                    IapApiException apiException = (IapApiException) e;
+                    // Status不支持序列化操作
+                    Status status = apiException.getStatus();
+                    String error =  status.getErrorString();
+                    if (status.getStatusCode() == OrderStatusCode.ORDER_HWID_NOT_LOGIN) {
+                        // 未登录帐号
+                        if (status.hasResolution()) {
+                            try {
+                                // 6666是您自定义的常量
+                                // 启动IAP返回的登录页面
+                                status.startResolutionForResult(activity, REQUEST_IAP);
+
+                            } catch (IntentSender.SendIntentException exp) {
+                            }
+                        }
+                    } else if (status.getStatusCode() == OrderStatusCode.ORDER_ACCOUNT_AREA_NOT_SUPPORTED) {
+
+                    }
+                } else {
+                    // 其他外部错误
+
+                }
+            }
+        });
+
+        }
+
+
+    void obtainOwnedPurchases(Activity activity, final PurchaseIntentReq purchaseIntentReq){
+
+        OwnedPurchasesReq req = new OwnedPurchasesReq();
+        req.setPriceType(0);
+        Task<OwnedPurchasesResult> task = Iap.getIapClient(activity).obtainOwnedPurchases(req);
+        task.addOnSuccessListener(new OnSuccessListener<OwnedPurchasesResult>() {
+            @Override
+            public void onSuccess(OwnedPurchasesResult result) {
+                // Obtain the execution result.
+                if (!result.getInAppPurchaseDataList().isEmpty()) {
+
+                    for (int i = 0; i < result.getInAppPurchaseDataList().size(); i++) {
+                        String inAppPurchaseData = result.getInAppPurchaseDataList().get(i);
+                        String InAppSignature = result.getInAppSignature().get(i);
+                        onPaySuccessNotify(activity,inAppPurchaseData,InAppSignature,notifyUrl);
+                    }
+                }else{
+                    obtainProductInfo(activity,purchaseIntentReq);
+                }
+            }
+        }).addOnFailureListener(new OnFailureListener() {
+            @Override
+            public void onFailure(Exception e) {
+                if (e instanceof IapApiException) {
+                    IapApiException apiException = (IapApiException)e;
+                    Status status = apiException.getStatus();
+                    int returnCode = apiException.getStatusCode();
+                } else {
+                    // Other external errors
+                }
+            }
+        });
+    }
+
+
+    void obtainProductInfo(final Activity activity, final PurchaseIntentReq req){
+        ProductInfoReq productInfoReq = new ProductInfoReq();
+        productInfoReq.setPriceType(0);
+        List<String> productList = new ArrayList<>();
+        productList.add(req.getProductId());
+        productInfoReq.setProductIds(productList);
+        Iap.getIapClient(activity).obtainProductInfo(productInfoReq).addOnSuccessListener(new OnSuccessListener<ProductInfoResult>() {
+            @Override
+            public void onSuccess(ProductInfoResult productInfoResult) {
+                createPurchaseIntent(req,activity);
+            }
+        }).addOnFailureListener(new OnFailureListener() {
+            @Override
+            public void onFailure(Exception e) {
+                Logger.i(TAG, "查询商品异常");
+
+            }
+        });
+    }
+
+
+    private void createPurchaseIntent(PurchaseIntentReq req, final Activity activity){
+
+// 调用createPurchaseIntent接口创建托管商品订单
+        Task<PurchaseIntentResult> task = Iap.getIapClient(activity).createPurchaseIntent(req);
+        task.addOnSuccessListener(new OnSuccessListener<PurchaseIntentResult>() {
+            @Override
+            public void onSuccess(PurchaseIntentResult result) {
+                // 获取创建订单的结果
+                Status status = result.getStatus();
+                if (status.hasResolution()) {
+                    try {
+                        // 6666是您自定义的常量
+                        // 启动IAP返回的收银台页面
+                        status.startResolutionForResult(activity, REQUEST_IAP);
+                    } catch (IntentSender.SendIntentException exp) {
+                    }
+                }
+            }
+        }).addOnFailureListener(new OnFailureListener() {
+            @Override
+            public void onFailure(Exception e) {
+                if (e instanceof IapApiException) {
+
+                    IapApiException apiException = (IapApiException) e;
+
+                } else {
+                    // 其他外部错误
+                }
+            }
+        });
+    }
+
+    private void onPaySuccessNotify(Activity activity,String inAppPurchaseData,String inAppPurchaseDataSignature,String notifyUrl){
+
+        if (judgeStrNull(inAppPurchaseData)){
+
+            return;
+        }
+        JSONObject json  = new JSONObject();
+        try {
+            json.put("hwData",inAppPurchaseData);
+            json.put("hwSign",inAppPurchaseDataSignature);
+
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+
+        loginViewModel.requestChannelExtInfo(activity,notifyUrl, json, new ICallback() {
+            @Override
+            public void onResult(int code, String result) {
+                if (code == ResultInfo.CODE_SUCCESS){
+
+                        InAppPurchaseData inAppPurchaseDataBean = null;
+                        try {
+                            inAppPurchaseDataBean = new InAppPurchaseData(inAppPurchaseData);
+                        } catch (JSONException e) {
+                            e.printStackTrace();
+                        }
+                        String token = inAppPurchaseDataBean.getPurchaseToken();
+                        consumeOwnedPurchase(activity,token);
+
+                    }
+
+            }
+        });
+
+
+    }
+
+
+    public void consumeOwnedPurchase(Activity activity,String purchaseToken){
+        // Constructs a ConsumeOwnedPurchaseReq object.
+
+        ConsumeOwnedPurchaseReq req = new ConsumeOwnedPurchaseReq();
+        req.setPurchaseToken(purchaseToken);
+// to call the consumeOwnedPurchase API.
+// To get the Activity instance that calls this API.
+
+        Task<ConsumeOwnedPurchaseResult> task = Iap.getIapClient(activity).consumeOwnedPurchase(req);
+        task.addOnSuccessListener(new OnSuccessListener<ConsumeOwnedPurchaseResult>() {
+            @Override
+            public void onSuccess(ConsumeOwnedPurchaseResult result) {
+                // Obtain the result
+                Logger.i("消耗成功");
+            }
+        }).addOnFailureListener(new OnFailureListener() {
+            @Override
+            public void onFailure(Exception e) {
+                if (e instanceof IapApiException) {
+                    IapApiException apiException = (IapApiException)e;
+                    Status status = apiException.getStatus();
+                    int returnCode = apiException.getStatusCode();
+                    Logger.i("消耗失败:"+status);
+                } else {
+                    // Other external errors
+                }
+            }
+        });
+    }
+
+
+    @Override
+    public String getChannelOrderExt() {
+        return null;
+    }
+
+    private boolean judgeStrNull(String str) {
+        return (str == null || str.equals(""));
+    }
+
+
+    public static String getPackageName(Activity ac) {
+
+        String pkgName = ac.getPackageName();
+        return pkgName;
+    }
+
+
+    private void hideFloatWindowNewWay(Activity activity) {
+        Games.getBuoyClient(activity).hideFloatWindow();
+    }
+    private void showFloatWindowNewWay(Activity ac) {
+        if (!hasInit) {
+            init(ac);
+        }
+        Games.getBuoyClient(ac).showFloatWindow();
+    }
+}

+ 96 - 0
library_channel_repository/huawei/src/main/java/cn/yyxx/commsdk/impl/merge/channel/huawei/RealAssertUtils.java

@@ -0,0 +1,96 @@
+package cn.yyxx.commsdk.impl.merge.channel.huawei;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageManager;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+public class RealAssertUtils {
+    public static String getParamCnfValuebyKey(Context context,
+                                               String filename, String key) {
+        try {
+            return readAssertFileWithKey(context, filename, key);
+        } catch (IOException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        return "";
+    }
+
+    public static String readAssertFileWithKey(Context context,
+                                               String file_name, String key) throws IOException {
+        String web_str = "";
+
+        InputStream input_stream = context.getAssets().open(file_name);
+
+        InputStreamReader inputStreamReader = new InputStreamReader(
+                input_stream);
+
+        BufferedReader reader = new BufferedReader(inputStreamReader);
+
+        String tempString = null;
+
+        while ((tempString = reader.readLine()) != null) {
+
+            if (tempString.contains(key)) {
+
+                web_str = tempString.substring(tempString.indexOf("=") + 1,
+                        tempString.length());
+                break;
+            }
+        }
+        reader.close();
+
+        return web_str;
+    }
+
+    public static String GetApplicationMetaData(Context context, String metaName) {
+        Object metaData = "";
+
+        if (null == metaName || metaName.isEmpty()) {
+
+            return "";
+        }
+        try {
+            ApplicationInfo info = context.getPackageManager()
+                    .getApplicationInfo(context.getPackageName(),
+                            PackageManager.GET_META_DATA);
+            metaData = info.metaData.get(metaName);
+            // 是否有引用
+            if (null != metaData && metaData.toString().contains("ref=")) {
+                String newMetaName = metaData.toString().split("=")[1];
+                metaData = GetApplicationMetaData(context, newMetaName);
+            }
+        } catch (PackageManager.NameNotFoundException e) {
+
+        }
+        if (null == metaData) {
+            metaData = "";
+        }
+        return metaData.toString();
+    }
+
+    public static String getSharedPreferences(Context context,String head,String key){
+        SharedPreferences sp = context.getSharedPreferences(head, Activity.MODE_PRIVATE);
+        return  sp.getString(key, "") ;
+    }
+
+
+    public static void saveSharedPreferences( Context context,String head, String key, String value) {
+        SharedPreferences sp = context
+                .getSharedPreferences(head,
+                        Activity.MODE_PRIVATE);
+        // 实例化SharedPreferences.Editor对象(第二步)
+        SharedPreferences.Editor editor = sp.edit();
+        // 用putString的方法保存数据
+        editor.putString(key, value);
+        // 提交当前数据
+        editor.commit();
+    }
+}

+ 67 - 0
library_channel_repository/huawei/src/main/java/cn/yyxx/commsdk/impl/merge/channel/msa/MsaDeviceHandler.java

@@ -0,0 +1,67 @@
+package cn.yyxx.commsdk.impl.merge.channel.msa;
+
+import android.content.Context;
+import android.util.Log;
+
+
+import com.huawei.hms.ads.identifier.AdvertisingIdClient;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import cn.yyxx.commsdk.base.internal.IMsaDeviceCallback;
+import cn.yyxx.commsdk.base.utils.Logger;
+
+
+/**
+ * @author #Suyghur.
+ * Created on 2021/04/23
+ */
+public class MsaDeviceHandler {
+
+    private static final String VERSION = "1.0.25";
+
+    public static String oaid = "";
+    public static String vaid = "";
+    public static String aaid = "";
+
+    public static void initMsaDeviceIds(Context context, final IMsaDeviceCallback callback)  {
+        new Thread(){
+            @Override
+            public void run() {
+                AdvertisingIdClient.Info info = null;
+                try {
+                    info = AdvertisingIdClient.getAdvertisingIdInfo(context);
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+                if (null != info) {
+                    if (info.isLimitAdTrackingEnabled()){
+                        callback.onIdsRead(-1, "获取oaid失败", null);
+                        Log.i("oaid","获取oaid失败");
+                    }else {
+                        oaid = info.getId();
+
+                        Map<String, String> ids = new HashMap<>();
+
+                        ids.put("oaid", oaid);
+                        ids.put("vaid", "");
+                        ids.put("aaid", "");
+
+                        callback.onIdsRead(0, "获取MsaIds成功", ids);
+
+                        Log.i("oaid","获取oaid成功,返回结果:" +oaid);
+                    }
+                }else{
+                    Log.i("oaid","不支持获取oaid");
+                    callback.onIdsRead(-1, "不支持获取oaid", null);
+
+                }
+
+            }
+        }.start();
+
+
+    }
+}

+ 19 - 0
library_channel_repository/huawei/src/main/java/cn/yyxx/commsdk/impl/merge/channel/utils/ParamsUtils.java

@@ -0,0 +1,19 @@
+package cn.yyxx.commsdk.impl.merge.channel.utils;
+
+import android.content.Context;
+
+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);
+    }
+}

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

@@ -96,6 +96,11 @@ public class ChannelBridge implements IFeature, ILifeCycle, IApplication, IOrder
         impl.initMsaDeviceIds(context,iMsaDeviceCallback);
     }
 
+    @Override
+    public String getChannelOcfg(Activity activity) {
+        return null;
+    }
+
 
     @Override
     public void onStart(Activity activity) {

+ 6 - 1
library_channel_repository/oppo/src/main/java/cn/yyxx/commsdk/impl/merge/channel/oppo/ChannelBridgeImpl.java

@@ -138,7 +138,7 @@ public class ChannelBridgeImpl implements IFeature, ILifeCycle, IApplication, IO
 
                          }
 
-                        loginViewModel.verifyChannelinfo(activity,json.toString());
+                        loginViewModel.verifyChannelInfo(activity,json.toString());
 
 
                     } catch (JSONException e) {
@@ -235,6 +235,11 @@ public class ChannelBridgeImpl implements IFeature, ILifeCycle, IApplication, IO
         MsaDeviceHandler.initMsaDeviceIds(context,iMsaDeviceCallback);
     }
 
+    @Override
+    public String getChannelOcfg(Activity activity) {
+        return null;
+    }
+
     @Override
     public void onStart(Activity activity) {
 

+ 1 - 1
library_core/publish.gradle

@@ -4,7 +4,7 @@ apply plugin: 'signing'
 ext {
     PUBLISH_GROUP_ID = 'io.github.yyxxgame.sdk'
     PUBLISH_ARTIFACT_ID = 'yyxx-comm-core'
-    PUBLISH_VERSION = '3.0.302'
+    PUBLISH_VERSION = '3.0.304'
 }
 
 

+ 7 - 2
library_core/src/main/cpp/tool_kit.cpp

@@ -112,7 +112,7 @@ std::string ToolKit::GetSpCode(JNIEnv *env, jobject context) {
     const char *method_name = "getMetaDataValue";
     const char *sig = "(Landroid/content/Context;Ljava/lang/String;)Ljava/lang/String;";
     jmethodID mid = env->GetStaticMethodID(clz, method_name, sig);
-    jstring key = env->NewStringUTF("yyrh_sp_code");
+    jstring key = env->NewStringUTF("YYXX_COMM_SP_CODE");
     auto result = (jstring) env->CallStaticObjectMethod(clz, mid, context, key);
     env->DeleteLocalRef(clz);
     env->DeleteLocalRef(key);
@@ -164,7 +164,12 @@ std::string ToolKit::GetDeviceModel() {
 }
 
 std::string ToolKit::GetAndroidDeviceId(JNIEnv *env, jobject context) {
-    jclass clz = env->FindClass("cn/yyxx/support/device/DeviceInfoUtils");
+
+
+
+
+
+    jclass clz = env->FindClass("cn/yyxx/commsdk/core/utils/ParamsUtils");
     if (clz == nullptr) {
         LOGE("DeviceInfoUtils is nullptr !!!");
         return "";

+ 35 - 2
library_core/src/main/cpp/yyxxgame.cpp

@@ -22,6 +22,35 @@ extern "C" {
 void InitSdkDrive(JNIEnv *env, jobject clz, jobject context) {
     CommMap::GetInstance()->Init(env, context);
 
+}
+
+jstring InvokeParamSignWithoutAes(JNIEnv *env,jobject clz,jstring data){
+    const char  *_data = env->GetStringUTFChars(data,JNI_FALSE);
+    time_t t;
+    long ts = time(&t);
+    Json::Value root = ToolKit::ToJsonObject(_data);
+    std::string timestamp = std::to_string(ts);
+    std::string sort_signature = ToolKit::GetJsonSortSignature(root);
+    sort_signature.append("&time=").append(timestamp).append(API_KEY);
+    std::string sign = md5(sort_signature);
+
+    root["time"]= timestamp;
+    root["sign"]= sign;
+
+    std::string request_data = ToolKit::ToJsonString(root);
+
+    jstring result = env->NewStringUTF(request_data.c_str());
+
+
+
+
+    if (_data) {
+        env->ReleaseStringUTFChars(data, _data);
+    }
+
+    return result;
+
+
 }
 jstring InvokeJobWithoutParams(JNIEnv *env,jobject clz,jstring data){
     const char  *_data = env->GetStringUTFChars(data,JNI_FALSE);
@@ -31,7 +60,7 @@ jstring InvokeJobWithoutParams(JNIEnv *env,jobject clz,jstring data){
     std::string timestamp = std::to_string(ts);
     std::string sort_signature = ToolKit::GetJsonSortSignature(root);
     sort_signature.append("&time=").append(timestamp).append(API_KEY);
-    YYLog::D(env, "before md5: " + sort_signature);
+
     std::string sign = md5(sort_signature);
 
     root["time"]= timestamp;
@@ -74,7 +103,7 @@ jstring InvokeJob(JNIEnv *env,jobject clz,jstring data){
     std::string timestamp = std::to_string(ts);
     std::string sort_signature = ToolKit::GetJsonSortSignature(root);
     sort_signature.append("&time=").append(timestamp).append(API_KEY);
-    YYLog::D(env, "before md5: " + sort_signature);
+
     std::string sign = md5(sort_signature);
 
     root["time"]= timestamp;
@@ -130,6 +159,10 @@ static JNINativeMethod gMethods[] = {
 
         {"initDrive",  "(Landroid/content/Context;)V",            (void *) InitSdkDrive},
         {"invokeJobWithoutParams", "(Ljava/lang/String;)Ljava/lang/String;",  (void *) InvokeJobWithoutParams},
+
+        {"invokeParamSignWithoutAes", "(Ljava/lang/String;)Ljava/lang/String;",  (void *) InvokeParamSignWithoutAes},
+
+
 //        {"setParam",   "(Ljava/lang/String;Ljava/lang/String;)V", (void *) SetParam},
 //        {"getParam",   "(Ljava/lang/String;)Ljava/lang/String;",  (void *) GetParam},
         {"invokeJob",  "(Ljava/lang/String;)Ljava/lang/String;",  (void *) InvokeJob},

+ 3 - 0
library_core/src/main/java/cn/yyxx/commsdk/core/SdkDrive.java

@@ -20,6 +20,9 @@ public class SdkDrive {
 
     public native String invokeJobWithoutParams(String data);
 
+    public native String invokeParamSignWithoutAes(String data);
+
+
 //    public native void setParam(String key, String value);
 
 //    public native String getParam(String key);

+ 13 - 10
library_core/src/main/java/cn/yyxx/commsdk/core/common/CommonOperationManager.java

@@ -136,7 +136,7 @@ public class CommonOperationManager {
 
     }
 
-    public void initialize(Activity activity, ICallback callback){
+    public void initialize(Activity activity,String o_cfg, ICallback callback){
 
         LoadingDialogUtils.getInstance().show(activity,activity.getString(ResourceUtil.getStringId(activity,"yyxx_comm_initing")));
 
@@ -167,14 +167,14 @@ public class CommonOperationManager {
                                 Logger.e("读取到ids,共延迟" + timeCount + "s初始化接口,将进行初始化...");
                             }
 
-                            startInitSdk(activity, callback);
+                            startInitSdk(activity,o_cfg, callback);
                         }
                     });
                 }
             }).start();
         } else {
             Logger.i("读取到ids,开始初始化");
-            startInitSdk(activity, callback);
+            startInitSdk(activity,o_cfg,callback);
         }
 
 
@@ -183,17 +183,18 @@ public class CommonOperationManager {
 
     }
 
-    private void startInitSdk(Activity activity, ICallback callback) {
+    private void startInitSdk(Activity activity,String o_cfg, ICallback callback) {
 
 
-        SdkRequest.getInstance().initSdk(activity, new IRequestCallback() {
+        SdkRequest.getInstance().initSdk(activity,o_cfg,new IRequestCallback() {
             @Override
             public void onResponse(ResultInfo resultInfo) {
                 LoadingDialogUtils.getInstance().hide();
                 if (resultInfo.code ==ResultInfo.CODE_SUCCESS){
                     initBean = InitBean.toBean(resultInfo.data,activity);
                     SdkDrive.setClientSignature(initBean.access_token);
-                    Logger.d(initBean.toString());
+                    Logger.i("初始化成功");
+                    Logger.logHandler(initBean.toString());
                     callback.onResult(resultInfo.CODE_SUCCESS,activity.getString(ResourceUtil.getStringId(activity,"yyxx_comm_init_success")));
                 }else if (resultInfo.code ==ResultInfo.CODE_FAIL){
                     callback.onResult(resultInfo.CODE_FAIL,activity.getString(ResourceUtil.getStringId(activity,"yyxx_comm_init_fail")));
@@ -267,6 +268,8 @@ public class CommonOperationManager {
                 ifa = oaid;
 
                 ifa_type =  "2";
+
+
         }else{
             if (PermissionKit.isGranted(context,Permission.READ_PHONE_STATE)){
                 @SuppressLint("ServiceCast") TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELECOM_SERVICE);
@@ -279,10 +282,10 @@ public class CommonOperationManager {
             ifa_type = "1";
         }
 
-        if (ifa.isEmpty()){
+        if (ifa.isEmpty() || ifa.equals("0000000000000000")){
             ifa = Settings.Secure.getString(context.getApplicationContext().getContentResolver(), Settings.Secure.ANDROID_ID);
             ifa_type = "3";
-            if (ifa.isEmpty()){
+            if (ifa.isEmpty() || ifa.equals("0000000000000000")){
                 ifa = userSimulateImei(context);
                 ifa_type = "0";
             }
@@ -300,7 +303,7 @@ public class CommonOperationManager {
     }
 
 
-    static String userSimulateImei(Context context){
+    public static String userSimulateImei(Context context){
 
 
         String simulateImei = MMKVUtils.getInstance().commonKV.decodeString("simulateImei","");
@@ -320,7 +323,7 @@ public class CommonOperationManager {
 
 
     //获得独一无二的Psuedo ID
-    public static String simulateUniqueId() {
+    static String simulateUniqueId() {
         String serial = null;
 
         String m_szDevIDShort = "" +

+ 15 - 10
library_core/src/main/java/cn/yyxx/commsdk/core/entity/SdkLoginInfo.java

@@ -49,18 +49,23 @@ public class SdkLoginInfo {
         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 (links != null){
+
+                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(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");
             }

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

@@ -101,8 +101,9 @@ public final class SdkBridgeImpl {
         }
 
         SdkProxyManager.call(Function.INITIALIZE,  new Class[]{Activity.class, ICallback.class}, new Object[]{activity,callback});
+        String o_cfg = (String)SdkProxyManager.callback(Function.GET_CHANNEL_O_CFG,  new Class[]{Activity.class}, new Object[]{activity});
 
-        CommonOperationManager.getInstance().initialize(activity, new ICallback() {
+        CommonOperationManager.getInstance().initialize(activity,o_cfg, new ICallback() {
             @Override
             public void onResult(int code, String result) {
                 callback.onResult(code,result);
@@ -258,7 +259,7 @@ public final class SdkBridgeImpl {
         }
         
         SdkProxyManager.call(Function.ON_ACTIVITY_RESULT,
-                new Class[]{Activity.class, Integer.class, Integer.class, Intent.class},
+                new Class[]{Activity.class, int.class, int.class, Intent.class},
                 new Object[]{activity, requestCode, resultCode, intent});
         
     }

+ 25 - 15
library_core/src/main/java/cn/yyxx/commsdk/core/network/SdkRequest.java

@@ -14,10 +14,13 @@ import cn.yyxx.commsdk.base.entity.SdkRoleInfo;
 import cn.yyxx.commsdk.base.internal.ICallback;
 import cn.yyxx.commsdk.base.internal.IRequestCallback;
 
+import cn.yyxx.commsdk.base.utils.Logger;
 import cn.yyxx.commsdk.core.SdkDrive;
 import cn.yyxx.commsdk.core.common.CommonOperationManager;
 import cn.yyxx.commsdk.core.entity.SdkLoginInfo;
+import cn.yyxx.commsdk.core.ui.dialog.LoadingDialogUtils;
 import cn.yyxx.commsdk.core.utils.ManifestUtils;
+import cn.yyxx.commsdk.core.utils.ResourceUtil;
 import cn.yyxx.support.AppUtils;
 import cn.yyxx.support.PropertiesUtils;
 
@@ -52,21 +55,26 @@ public class SdkRequest {
         }
 
         String paramText = SdkDrive.getInstance().invokeJobWithoutParams(json.toString());
-        VolleyRequest.post(context, HOST, paramText, callback);
+        VolleyRequest.postWithText(context, HOST, paramText, callback);
     }
 
-    public void initSdk(Context context, IRequestCallback callback) {
+    public void initSdk(Context context,String o_cfg, IRequestCallback callback) {
 
         JSONObject ifa_info = CommonOperationManager.getInstance().getIfa(context);
 
+
         try {
             ifa_info.put("route_path", Hosts.BASIC_URL_INIT_SDK);
+            if (!TextUtils.isEmpty(o_cfg)){
+                ifa_info.put("o_cfg", o_cfg);
+            }
         } catch (JSONException e) {
             e.printStackTrace();
         }
 
+
         String paramText = SdkDrive.getInstance().invokeJob(ifa_info.toString());
-        VolleyRequest.post(context, HOST, paramText, callback);
+        VolleyRequest.postWithText(context, HOST, paramText, callback);
     }
 
     public void reigsterAccount(Context context, String account, String password, IRequestCallback callback) {
@@ -86,7 +94,7 @@ public class SdkRequest {
 
         String paramText = SdkDrive.getInstance().invokeJob(json.toString());
 
-        VolleyRequest.post(context, HOST, paramText, callback);
+        VolleyRequest.postWithText(context, HOST, paramText, callback);
     }
 
     public void accountLogin(Context context, String account, String password, String login_token, IRequestCallback callback) {
@@ -114,7 +122,7 @@ public class SdkRequest {
 
         String paramText = SdkDrive.getInstance().invokeJob(json.toString());
 
-        VolleyRequest.post(context, HOST, paramText, callback);
+        VolleyRequest.postWithText(context, HOST, paramText, callback);
     }
 
     public void getPhoneCaptcha(Context context, String phoneNum, String action, IRequestCallback callback) {
@@ -132,7 +140,7 @@ public class SdkRequest {
 
         String paramText = SdkDrive.getInstance().invokeJob(json.toString());
 
-        VolleyRequest.post(context, HOST, paramText, callback);
+        VolleyRequest.postWithText(context, HOST, paramText, callback);
     }
 
 
@@ -151,7 +159,7 @@ public class SdkRequest {
 
         String paramText = SdkDrive.getInstance().invokeJob(json.toString());
 
-        VolleyRequest.post(context, HOST, paramText, callback);
+        VolleyRequest.postWithText(context, HOST, paramText, callback);
     }
 
     public void setPassword(Context context, String account, String password, String code, IRequestCallback callback) {
@@ -172,7 +180,7 @@ public class SdkRequest {
 
         String paramText = SdkDrive.getInstance().invokeJob(json.toString());
 
-        VolleyRequest.post(context, HOST, paramText, callback);
+        VolleyRequest.postWithText(context, HOST, paramText, callback);
 
     }
 
@@ -192,7 +200,7 @@ public class SdkRequest {
 
         String paramText = SdkDrive.getInstance().invokeJob(json.toString());
 
-        VolleyRequest.post(context, HOST, paramText, callback);
+        VolleyRequest.postWithText(context, HOST, paramText, callback);
 
     }
 
@@ -229,7 +237,7 @@ public class SdkRequest {
 
         String paramText = SdkDrive.getInstance().invokeJob(json.toString());
 
-        VolleyRequest.post(context, HOST, paramText, callback);
+        VolleyRequest.postWithText(context, HOST, paramText, callback);
 
     }
 
@@ -266,7 +274,7 @@ public class SdkRequest {
 
         String paramText = SdkDrive.getInstance().invokeJob(json.toString());
 
-        VolleyRequest.post(context, HOST, paramText, callback);
+        VolleyRequest.postWithText(context, HOST, paramText, callback);
     }
 
     public void queryOrder(Context context, String order_id,String query_params, IRequestCallback callback) {
@@ -281,7 +289,7 @@ public class SdkRequest {
 
         String paramText = SdkDrive.getInstance().invokeJob(json.toString());
 
-        VolleyRequest.post(context, HOST, paramText, callback);
+        VolleyRequest.postWithText(context, HOST, paramText, callback);
 
     }
 
@@ -297,7 +305,7 @@ public class SdkRequest {
 
         String paramText = SdkDrive.getInstance().invokeJob(json.toString());
 
-        VolleyRequest.post(context, HOST, paramText, callback);
+        VolleyRequest.postWithText(context, HOST, paramText, callback);
 
     }
 
@@ -318,13 +326,15 @@ public class SdkRequest {
 
         String paramText = SdkDrive.getInstance().invokeJob(json.toString());
 
-        VolleyRequest.post(context, HOST, paramText, callback);
+        VolleyRequest.postWithText(context, HOST, paramText, callback);
 
 
     }
 
     public void requestChannelExtInfo(Context context,String host,JSONObject info, IRequestCallback callback){
-        VolleyRequest.post(context,host,info,callback);
+
+        String channeExtInfo = SdkDrive.getInstance().invokeParamSignWithoutAes(info.toString());
+        VolleyRequest.postWhithJson(context,host,channeExtInfo,callback);
     }
 
 

+ 29 - 32
library_core/src/main/java/cn/yyxx/commsdk/core/network/VolleyRequest.java

@@ -39,7 +39,7 @@ public class VolleyRequest {
 
 
 
-    public static void post(Context context, String url, JSONObject jsonObject, final IRequestCallback callback) {
+    public static void postWhithJson(Context context, String url,String params , final IRequestCallback callback) {
         try {
 //            StringBuilder raw = new StringBuilder();
 //            raw.append("access_token=").append(jsonObject.getString("access_token"))
@@ -51,43 +51,29 @@ public class VolleyRequest {
 //            String sign = Md5Utils.encodeByMD5(raw.toString().toLowerCase());
 //            jsonObject.put("sign", sign);
             Logger.d("请求地址 : " + url);
-            Logger.d("请求参数 : " + jsonObject.toString());
-
-            JsonRequest<JSONObject> request = new JsonObjectRequest(Request.Method.POST, url, jsonObject, new Response.Listener<JSONObject>() {
-                @Override
-                public void onResponse(JSONObject response) {
 
 
+            StringRequest  request = new StringRequest(Request.Method.POST, url, new Response.Listener<String>() {
+                @Override
+                public void onResponse(String s) {
+                    /**
+                     * 通用接口,返回数据不做任何解析
+                     */
 
 
                     ResultInfo resultInfo = new ResultInfo();
+                    resultInfo.code = ResultInfo.CODE_SUCCESS;
+                    resultInfo.msg = s;
+                    resultInfo.data = s;
 
-                    if (response != null) {
-                        try {
-                            resultInfo.code = response.getInt("code");
-                            resultInfo.msg = response.getString("msg");
-                            if (JsonUtils.hasJsonKey(response, "data")) {
-                                resultInfo.data = response.getString("data");
-                            } else {
-                                resultInfo.data = "";
-                            }
-                        } catch (JSONException e) {
-                            e.printStackTrace();
-                            resultInfo.code = -1;
-                            resultInfo.msg = "数据解析异常";
-                            resultInfo.data = "";
-                        }
-                    } else {
-                        resultInfo.code = -1;
-                        resultInfo.msg = "接口请求异常";
-                        resultInfo.data = "";
-                    }
+                    Logger.logHandler("返回内容 : " + resultInfo);
 
-                    Logger.d("onResponse : " + resultInfo);
                     if (callback != null) {
                         callback.onResponse(resultInfo);
                     }
                 }
+
+
             }, new Response.ErrorListener() {
                 @Override
                 public void onErrorResponse(VolleyError volleyError) {
@@ -104,6 +90,18 @@ public class VolleyRequest {
                     headers.put("Content-Type", "application/json;charset=UTF-8");
                     return headers;
                 }
+
+
+                @Override
+                public byte[] getBody() {
+                    byte[] bd= new byte[0];
+                    try {
+                        bd = params.getBytes(getParamsEncoding());
+                    } catch (UnsupportedEncodingException e) {
+                        e.printStackTrace();
+                    }
+                    return bd;
+                }
             };
             request.setRetryPolicy(new DefaultRetryPolicy(MAX_TIMEOUT, 1, 1.0f));
             VolleySingleton.getInstance(context.getApplicationContext()).addToRequestQueue(context.getApplicationContext(), request);
@@ -112,12 +110,12 @@ public class VolleyRequest {
         }
     }
 
-    public static void post(Context context, String url,String params, final IRequestCallback callback) {
+    public static void postWithText(Context context, String url,String params, final IRequestCallback callback) {
         try {
 
 
             Logger.d("请求地址 : " + url);
-            Logger.d("请求参数 : " + params + "\n");
+
             StringRequest request = new StringRequest(Request.Method.POST,url, new Response.Listener<String>() {
                 @Override
                 public void onResponse(String s) {
@@ -152,9 +150,8 @@ public class VolleyRequest {
                         resultInfo.msg = "接口请求异常";
                         resultInfo.data = "";
                     }
-                    Logger.logHandler("返回内容 : " + resultInfo.toString());
-                    Logger.d("onResponse : " + resultInfo.toString());
-                    if (callback != null) {
+                    Logger.logHandler("返回内容 : " + resultInfo);
+                     if (callback != null) {
                         callback.onResponse(resultInfo);
                     }
                 }

+ 9 - 0
library_core/src/main/java/cn/yyxx/commsdk/core/utils/ParamsUtils.java

@@ -2,7 +2,9 @@ package cn.yyxx.commsdk.core.utils;
 
 import android.content.Context;
 
+import cn.yyxx.commsdk.core.common.CommonOperationManager;
 import cn.yyxx.support.PropertiesUtils;
+import cn.yyxx.support.device.DeviceInfoUtils;
 
 public class ParamsUtils {
     private static String  CONFIG_FILE  =  "yyxx_cfg.properties";
@@ -30,4 +32,11 @@ public class ParamsUtils {
     public static String getChannelName(Context context){
         return PropertiesUtils.getValue4Properties(context,CONFIG_FILE,ASSETS_PATH, YYXX_PLATFORM);
     }
+    public static String getAndroidDeviceId(Context context){
+        String android_id = DeviceInfoUtils.getAndroidDeviceId(context);
+        if (android_id.isEmpty() || android_id.equals("0000000000000000")){
+            android_id =CommonOperationManager.userSimulateImei(context);
+        }
+        return  android_id;
+    }
 }

+ 5 - 0
library_platform/hnqj/src/main/java/cn/yyxx/commsdk/impl/merge/platform/SdkPlatformBridge.java

@@ -97,6 +97,11 @@ public class SdkPlatformBridge implements IFeature, ILifeCycle, IApplication,IOr
         impl.initMsaDeviceIds(context,iMsaDeviceCallback);
     }
 
+    @Override
+    public String getChannelOcfg(Activity activity) {
+        return impl.getChannelOcfg(activity);
+    }
+
 
     @Override
     public void onStart(Activity activity) {

+ 5 - 0
library_platform/hnqj/src/main/java/cn/yyxx/commsdk/impl/merge/platform/hnqj/impl/SdkPlatformImpl.java

@@ -166,6 +166,11 @@ public class SdkPlatformImpl implements IFeature, ILifeCycle, IApplication, IOrd
         MsaDeviceHandler.initMsaDeviceIds(context,iMsaDeviceCallback);
     }
 
+    @Override
+    public String getChannelOcfg(Activity activity) {
+        return null;
+    }
+
 
     public static SdkPlatformImpl getInstance(Context context){
         if (manager == null) {

+ 2 - 2
library_platform/hnqj/src/main/res/layout/qj_usercenter_dialog.xml

@@ -38,10 +38,10 @@
             android:id="@+id/close_btn"
             android:layout_width="25dp"
             android:layout_height="25dp"
+            android:layout_marginLeft="15dp"
+            android:layout_marginTop="15dp"
             android:layout_toRightOf="@id/wb_user_info"
             android:background="@mipmap/qj_usercenter_close"
-            android:layout_marginTop="15dp"
-            android:layout_marginLeft="15dp"
 
 
             />

+ 5 - 0
library_platform/hnyy/src/main/java/cn/yyxx/commsdk/impl/merge/platform/SdkPlatformBridge.java

@@ -97,6 +97,11 @@ public class SdkPlatformBridge implements IFeature, ILifeCycle, IApplication,IOr
         impl.initMsaDeviceIds(context,iMsaDeviceCallback);
     }
 
+    @Override
+    public String getChannelOcfg(Activity activity) {
+        return impl.getChannelOcfg(activity);
+    }
+
 
     @Override
     public void onStart(Activity activity) {

+ 5 - 0
library_platform/hnyy/src/main/java/cn/yyxx/commsdk/impl/merge/platform/hnyy/impl/SdkPlatformImpl.java

@@ -167,6 +167,11 @@ public class SdkPlatformImpl implements IFeature, ILifeCycle, IApplication, IOrd
         MsaDeviceHandler.initMsaDeviceIds(context,iMsaDeviceCallback);
     }
 
+    @Override
+    public String getChannelOcfg(Activity activity) {
+        return null;
+    }
+
 
     public static SdkPlatformImpl getInstance(Context context){
         if (manager == null) {

+ 5 - 0
library_platform/shxy/src/main/java/cn/yyxx/commsdk/impl/merge/platform/SdkPlatformBridge.java

@@ -97,6 +97,11 @@ public class SdkPlatformBridge implements IFeature, ILifeCycle, IApplication,IOr
         impl.initMsaDeviceIds(context,iMsaDeviceCallback);
     }
 
+    @Override
+    public String getChannelOcfg(Activity activity) {
+        return impl.getChannelOcfg(activity);
+    }
+
 
     @Override
     public void onStart(Activity activity) {

+ 5 - 0
library_platform/shxy/src/main/java/cn/yyxx/commsdk/impl/merge/platform/shxy/impl/SdkPlatformImpl.java

@@ -166,6 +166,11 @@ public class SdkPlatformImpl implements IFeature, ILifeCycle, IApplication, IOrd
         MsaDeviceHandler.initMsaDeviceIds(context,iMsaDeviceCallback);
     }
 
+    @Override
+    public String getChannelOcfg(Activity activity) {
+        return null;
+    }
+
 
     public static SdkPlatformImpl getInstance(Context context){
         if (manager == null) {

+ 5 - 0
library_platform/xinrui/src/main/java/cn/yyxx/commsdk/impl/merge/platform/SdkPlatformBridge.java

@@ -97,6 +97,11 @@ public class SdkPlatformBridge implements IFeature, ILifeCycle, IApplication,IOr
         impl.initMsaDeviceIds(context,iMsaDeviceCallback);
     }
 
+    @Override
+    public String getChannelOcfg(Activity activity) {
+        return impl.getChannelOcfg(activity);
+    }
+
 
     @Override
     public void onStart(Activity activity) {

+ 5 - 0
library_platform/xinrui/src/main/java/cn/yyxx/commsdk/impl/merge/platform/xinrui/impl/SdkPlatformImpl.java

@@ -166,6 +166,11 @@ public class SdkPlatformImpl implements IFeature, ILifeCycle, IApplication, IOrd
         MsaDeviceHandler.initMsaDeviceIds(context,iMsaDeviceCallback);
     }
 
+    @Override
+    public String getChannelOcfg(Activity activity) {
+        return null;
+    }
+
 
     public static SdkPlatformImpl getInstance(Context context){
         if (manager == null) {

+ 3 - 0
settings.gradle

@@ -4,6 +4,8 @@ dependencyResolutionManagement {
         google()
         mavenCentral()
         jcenter()
+        maven {url 'https://developer.huawei.com/repo/'}
+
     }
 }
 
@@ -16,6 +18,7 @@ include ':library_channel_repository'
 include ':library_platform'
 include ':library_platform:hnyy'
 include ':library_channel_repository:oppo'
+include ':library_channel_repository:huawei'
 include ':library_platform:hnqj'
 include ':library_platform:shxy'
 include ':library_platform:xinrui'