|
@@ -1,4 +1,4 @@
|
|
-package cn.yyxx.commsdk.platform;
|
|
|
|
|
|
+package cn.yyxx.commsdk.impl.merge.platform;
|
|
|
|
|
|
import android.app.Activity;
|
|
import android.app.Activity;
|
|
import android.app.Application;
|
|
import android.app.Application;
|
|
@@ -6,7 +6,6 @@ import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.content.Intent;
|
|
import android.content.res.Configuration;
|
|
import android.content.res.Configuration;
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
-import android.os.NetworkOnMainThreadException;
|
|
|
|
|
|
|
|
|
|
|
|
import org.json.JSONObject;
|
|
import org.json.JSONObject;
|
|
@@ -14,12 +13,10 @@ import org.json.JSONObject;
|
|
import cn.yyxx.commsdk.base.entity.Function;
|
|
import cn.yyxx.commsdk.base.entity.Function;
|
|
|
|
|
|
|
|
|
|
-import cn.yyxx.commsdk.base.entity.SdkChargeInfo;
|
|
|
|
import cn.yyxx.commsdk.base.entity.SdkOrderInfo;
|
|
import cn.yyxx.commsdk.base.entity.SdkOrderInfo;
|
|
import cn.yyxx.commsdk.base.entity.SdkRoleInfo;
|
|
import cn.yyxx.commsdk.base.entity.SdkRoleInfo;
|
|
import cn.yyxx.commsdk.base.internal.ICallback;
|
|
import cn.yyxx.commsdk.base.internal.ICallback;
|
|
import cn.yyxx.commsdk.base.entity.bean.InitBean;
|
|
import cn.yyxx.commsdk.base.entity.bean.InitBean;
|
|
-import cn.yyxx.commsdk.base.internal.IRequestCallback;
|
|
|
|
import cn.yyxx.commsdk.base.internal.feature.IApplication;
|
|
import cn.yyxx.commsdk.base.internal.feature.IApplication;
|
|
import cn.yyxx.commsdk.base.internal.feature.IFeature;
|
|
import cn.yyxx.commsdk.base.internal.feature.IFeature;
|
|
import cn.yyxx.commsdk.base.internal.feature.ILifeCycle;
|
|
import cn.yyxx.commsdk.base.internal.feature.ILifeCycle;
|
|
@@ -56,34 +53,34 @@ public class PlatformSdk implements IFeature,ILifeCycle, IApplication,IOrder {
|
|
|
|
|
|
private Object getSdkProxyOperationManager(Context context) {
|
|
private Object getSdkProxyOperationManager(Context context) {
|
|
if (null == mSdkBridge) {
|
|
if (null == mSdkBridge) {
|
|
- mSdkBridge = SdkProxyOperationManager.initSdkProxyOperationManager(context);
|
|
|
|
|
|
+ mSdkBridge = SdkProxyPlatformManager.initSdkProxyPlatformManager(context);
|
|
}
|
|
}
|
|
return mSdkBridge;
|
|
return mSdkBridge;
|
|
}
|
|
}
|
|
|
|
|
|
private void checkSdkBridgeNull(){
|
|
private void checkSdkBridgeNull(){
|
|
if (null == mSdkBridge) {
|
|
if (null == mSdkBridge) {
|
|
- mSdkBridge = SdkProxyOperationManager.initSdkProxyOperationManager(context);
|
|
|
|
|
|
+ mSdkBridge = SdkProxyPlatformManager.initSdkProxyPlatformManager(context);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@Override
|
|
@Override
|
|
public void initialize(Activity activity, ICallback callback) {
|
|
public void initialize(Activity activity, ICallback callback) {
|
|
checkSdkBridgeNull();
|
|
checkSdkBridgeNull();
|
|
- SdkProxyOperationManager.call(Function.INITIALIZE, new Class[]{Activity.class,ICallback.class}, new Object[]{activity, callback});
|
|
|
|
|
|
+ SdkProxyPlatformManager.call(Function.INITIALIZE, new Class[]{Activity.class,ICallback.class}, new Object[]{activity, callback});
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void initializeSuccess() {
|
|
public void initializeSuccess() {
|
|
checkSdkBridgeNull();
|
|
checkSdkBridgeNull();
|
|
- SdkProxyOperationManager.call(Function.INITIALIZE_SUCCESS, new Class[]{}, new Object[]{});
|
|
|
|
|
|
+ SdkProxyPlatformManager.call(Function.INITIALIZE_SUCCESS, new Class[]{}, new Object[]{});
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void setLogoutListener(Activity activity, ICallback callback) {
|
|
public void setLogoutListener(Activity activity, ICallback callback) {
|
|
checkSdkBridgeNull();
|
|
checkSdkBridgeNull();
|
|
- SdkProxyOperationManager.call(Function.SET_LOGOUT_LISTENER, new Class[]{Activity.class, ICallback.class}, new Object[]{activity,callback});
|
|
|
|
|
|
+ SdkProxyPlatformManager.call(Function.SET_LOGOUT_LISTENER, new Class[]{Activity.class, ICallback.class}, new Object[]{activity,callback});
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -91,14 +88,14 @@ public class PlatformSdk implements IFeature,ILifeCycle, IApplication,IOrder {
|
|
|
|
|
|
checkSdkBridgeNull();
|
|
checkSdkBridgeNull();
|
|
|
|
|
|
- SdkProxyOperationManager.call(Function.LOGIN, new Class[]{Activity.class,InitBean.class, ICallback.class}, new Object[]{activity,initBean, callback});
|
|
|
|
|
|
+ SdkProxyPlatformManager.call(Function.LOGIN, new Class[]{Activity.class,InitBean.class, ICallback.class}, new Object[]{activity,initBean, callback});
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void logout() {
|
|
public void logout() {
|
|
checkSdkBridgeNull();
|
|
checkSdkBridgeNull();
|
|
- SdkProxyOperationManager.call(Function.LOGOUT, new Class[]{}, new Object[]{});
|
|
|
|
|
|
+ SdkProxyPlatformManager.call(Function.LOGOUT, new Class[]{}, new Object[]{});
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -106,20 +103,20 @@ public class PlatformSdk implements IFeature,ILifeCycle, IApplication,IOrder {
|
|
@Override
|
|
@Override
|
|
public boolean hasExitView(Activity activity) {
|
|
public boolean hasExitView(Activity activity) {
|
|
checkSdkBridgeNull();
|
|
checkSdkBridgeNull();
|
|
- return (Boolean) SdkProxyOperationManager.callback(Function.HAS_EXIT_VIEW, new Class[]{Activity.class}, new Object[]{activity});
|
|
|
|
|
|
+ return (Boolean) SdkProxyPlatformManager.callback(Function.HAS_EXIT_VIEW, new Class[]{Activity.class}, new Object[]{activity});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
public void openExitView(Activity activity, ICallback callback) {
|
|
public void openExitView(Activity activity, ICallback callback) {
|
|
checkSdkBridgeNull();
|
|
checkSdkBridgeNull();
|
|
- SdkProxyOperationManager.call(Function.OPEN_EXIT_VIEW, new Class[]{Activity.class, ICallback.class}, new Object[]{activity, callback});
|
|
|
|
|
|
+ SdkProxyPlatformManager.call(Function.OPEN_EXIT_VIEW, new Class[]{Activity.class, ICallback.class}, new Object[]{activity, callback});
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void uploadRoleInfo(Activity activity, String type, SdkRoleInfo roleInfo) {
|
|
public void uploadRoleInfo(Activity activity, String type, SdkRoleInfo roleInfo) {
|
|
checkSdkBridgeNull();
|
|
checkSdkBridgeNull();
|
|
- SdkProxyOperationManager.call(Function.UPLOAD_ROLE_INFO, new Class[]{Activity.class, String.class,SdkRoleInfo.class}, new Object[]{activity,type,roleInfo});
|
|
|
|
|
|
+ SdkProxyPlatformManager.call(Function.UPLOAD_ROLE_INFO, new Class[]{Activity.class, String.class,SdkRoleInfo.class}, new Object[]{activity,type,roleInfo});
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -132,56 +129,56 @@ public class PlatformSdk implements IFeature,ILifeCycle, IApplication,IOrder {
|
|
@Override
|
|
@Override
|
|
public void attachBaseContext(Application application, Context context) {
|
|
public void attachBaseContext(Application application, Context context) {
|
|
checkSdkBridgeNull();
|
|
checkSdkBridgeNull();
|
|
- SdkProxyOperationManager.call(Function.ATTACH_BASE_CONTEXT, new Class[]{Application.class, Context.class}, new Object[]{application, context});
|
|
|
|
|
|
+ SdkProxyPlatformManager.call(Function.ATTACH_BASE_CONTEXT, new Class[]{Application.class, Context.class}, new Object[]{application, context});
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void initApplication(Application application) {
|
|
public void initApplication(Application application) {
|
|
checkSdkBridgeNull();
|
|
checkSdkBridgeNull();
|
|
- SdkProxyOperationManager.call(Function.INIT_APPLICATION, new Class[]{Application.class}, new Object[]{application});
|
|
|
|
|
|
+ SdkProxyPlatformManager.call(Function.INIT_APPLICATION, new Class[]{Application.class}, new Object[]{application});
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void onStart(Activity activity) {
|
|
public void onStart(Activity activity) {
|
|
checkSdkBridgeNull();
|
|
checkSdkBridgeNull();
|
|
- SdkProxyOperationManager.call(Function.ON_START, new Class[]{Activity.class}, new Object[]{activity});
|
|
|
|
|
|
+ SdkProxyPlatformManager.call(Function.ON_START, new Class[]{Activity.class}, new Object[]{activity});
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void onResume(Activity activity) {
|
|
public void onResume(Activity activity) {
|
|
checkSdkBridgeNull();
|
|
checkSdkBridgeNull();
|
|
- SdkProxyOperationManager.call(Function.ON_RESUME, new Class[]{Activity.class}, new Object[]{activity});
|
|
|
|
|
|
+ SdkProxyPlatformManager.call(Function.ON_RESUME, new Class[]{Activity.class}, new Object[]{activity});
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void onReStart(Activity activity) {
|
|
public void onReStart(Activity activity) {
|
|
checkSdkBridgeNull();
|
|
checkSdkBridgeNull();
|
|
- SdkProxyOperationManager.call(Function.ON_RESTART, new Class[]{Activity.class}, new Object[]{activity});
|
|
|
|
|
|
+ SdkProxyPlatformManager.call(Function.ON_RESTART, new Class[]{Activity.class}, new Object[]{activity});
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void onPause(Activity activity) {
|
|
public void onPause(Activity activity) {
|
|
checkSdkBridgeNull();
|
|
checkSdkBridgeNull();
|
|
- SdkProxyOperationManager.call(Function.ON_PAUSE, new Class[]{Activity.class}, new Object[]{activity});
|
|
|
|
|
|
+ SdkProxyPlatformManager.call(Function.ON_PAUSE, new Class[]{Activity.class}, new Object[]{activity});
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void onStop(Activity activity) {
|
|
public void onStop(Activity activity) {
|
|
checkSdkBridgeNull();
|
|
checkSdkBridgeNull();
|
|
- SdkProxyOperationManager.call(Function.ON_STOP, new Class[]{Activity.class}, new Object[]{activity});
|
|
|
|
|
|
+ SdkProxyPlatformManager.call(Function.ON_STOP, new Class[]{Activity.class}, new Object[]{activity});
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) {
|
|
public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) {
|
|
checkSdkBridgeNull();
|
|
checkSdkBridgeNull();
|
|
- SdkProxyOperationManager.call(Function.ON_ACTIVITY_RESULT,
|
|
|
|
|
|
+ SdkProxyPlatformManager.call(Function.ON_ACTIVITY_RESULT,
|
|
new Class[]{Activity.class, Integer.class, Integer.class, Intent.class},
|
|
new Class[]{Activity.class, Integer.class, Integer.class, Intent.class},
|
|
new Object[]{activity, requestCode, resultCode, data});
|
|
new Object[]{activity, requestCode, resultCode, data});
|
|
|
|
|
|
@@ -190,47 +187,47 @@ public class PlatformSdk implements IFeature,ILifeCycle, IApplication,IOrder {
|
|
@Override
|
|
@Override
|
|
public void onNewIntent(Activity activity, Intent intent) {
|
|
public void onNewIntent(Activity activity, Intent intent) {
|
|
checkSdkBridgeNull();
|
|
checkSdkBridgeNull();
|
|
- SdkProxyOperationManager.call(Function.ON_NEW_INTENT, new Class[]{Activity.class, Intent.class}, new Object[]{activity, intent});
|
|
|
|
|
|
+ SdkProxyPlatformManager.call(Function.ON_NEW_INTENT, new Class[]{Activity.class, Intent.class}, new Object[]{activity, intent});
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void onConfigurationChanged(Activity activity, Configuration newConfigs) {
|
|
public void onConfigurationChanged(Activity activity, Configuration newConfigs) {
|
|
checkSdkBridgeNull();
|
|
checkSdkBridgeNull();
|
|
- SdkProxyOperationManager.call(Function.ON_CONFIGURATION_CHANGED, new Class[]{Activity.class,Configuration.class}, new Object[]{activity,newConfigs});
|
|
|
|
|
|
+ SdkProxyPlatformManager.call(Function.ON_CONFIGURATION_CHANGED, new Class[]{Activity.class,Configuration.class}, new Object[]{activity,newConfigs});
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void onWindowFocusChanged(Activity activity, boolean hasFocus) {
|
|
public void onWindowFocusChanged(Activity activity, boolean hasFocus) {
|
|
checkSdkBridgeNull();
|
|
checkSdkBridgeNull();
|
|
- SdkProxyOperationManager.call(Function.ON_WINDOW_FOCUS_CHANGED, new Class[]{Activity.class,boolean.class}, new Object[]{activity,hasFocus});
|
|
|
|
|
|
+ SdkProxyPlatformManager.call(Function.ON_WINDOW_FOCUS_CHANGED, new Class[]{Activity.class,boolean.class}, new Object[]{activity,hasFocus});
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void onDestroy(Activity activity) {
|
|
public void onDestroy(Activity activity) {
|
|
checkSdkBridgeNull();
|
|
checkSdkBridgeNull();
|
|
- SdkProxyOperationManager.call(Function.ON_DESTROY, new Class[]{Activity.class}, new Object[]{activity});
|
|
|
|
|
|
+ SdkProxyPlatformManager.call(Function.ON_DESTROY, new Class[]{Activity.class}, new Object[]{activity});
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void onCreate(Activity activity, Bundle savedInstanceState) {
|
|
public void onCreate(Activity activity, Bundle savedInstanceState) {
|
|
checkSdkBridgeNull();
|
|
checkSdkBridgeNull();
|
|
- SdkProxyOperationManager.call(Function.ON_CREATE, new Class[]{Activity.class, Bundle.class}, new Object[]{activity, savedInstanceState});
|
|
|
|
|
|
+ SdkProxyPlatformManager.call(Function.ON_CREATE, new Class[]{Activity.class, Bundle.class}, new Object[]{activity, savedInstanceState});
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void startPay(final Activity activity, final SdkOrderInfo sdkOrderInfo, ICallback callback) {
|
|
public void startPay(final Activity activity, final SdkOrderInfo sdkOrderInfo, ICallback callback) {
|
|
|
|
|
|
- SdkProxyOperationManager.call(Function.START_PAY, new Class[]{Activity.class, SdkOrderInfo.class,ICallback.class}, new Object[]{activity, sdkOrderInfo,callback});
|
|
|
|
|
|
+ SdkProxyPlatformManager.call(Function.START_PAY, new Class[]{Activity.class, SdkOrderInfo.class,ICallback.class}, new Object[]{activity, sdkOrderInfo,callback});
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public String getChannelOrderExt() {
|
|
public String getChannelOrderExt() {
|
|
- return (String) SdkProxyOperationManager.callback(Function.GET_CHANNEL_ORDER_EXT, new Class[]{},new Object[]{});
|
|
|
|
|
|
+ return (String) SdkProxyPlatformManager.callback(Function.GET_CHANNEL_ORDER_EXT, new Class[]{},new Object[]{});
|
|
}
|
|
}
|
|
}
|
|
}
|