diff --git a/native/templates/js-template-binary/.cocos-package.json b/native/extensions/anysdk/.cocos-package.json
similarity index 100%
rename from native/templates/js-template-binary/.cocos-package.json
rename to native/extensions/anysdk/.cocos-package.json
diff --git a/native/templates/js-template-binary/frameworks/runtime-src/Classes/SDKManager.cpp b/native/extensions/anysdk/js-bindings/SDKManager.cpp
similarity index 100%
rename from native/templates/js-template-binary/frameworks/runtime-src/Classes/SDKManager.cpp
rename to native/extensions/anysdk/js-bindings/SDKManager.cpp
diff --git a/native/templates/js-template-binary/frameworks/runtime-src/Classes/SDKManager.h b/native/extensions/anysdk/js-bindings/SDKManager.h
similarity index 100%
rename from native/templates/js-template-binary/frameworks/runtime-src/Classes/SDKManager.h
rename to native/extensions/anysdk/js-bindings/SDKManager.h
diff --git a/native/extensions/anysdk/platform/android/libs/libPluginProtocol.jar b/native/extensions/anysdk/platform/android/libs/libPluginProtocol.jar
new file mode 100644
index 0000000000..e4bb01132c
Binary files /dev/null and b/native/extensions/anysdk/platform/android/libs/libPluginProtocol.jar differ
diff --git a/native/templates/js-template-binary/frameworks/runtime-src/proj.android/res/drawable/plugin_btn_close.png b/native/extensions/anysdk/platform/android/res/drawable/plugin_btn_close.png
similarity index 100%
rename from native/templates/js-template-binary/frameworks/runtime-src/proj.android/res/drawable/plugin_btn_close.png
rename to native/extensions/anysdk/platform/android/res/drawable/plugin_btn_close.png
diff --git a/native/templates/js-template-binary/frameworks/runtime-src/proj.android/res/drawable/plugin_ui_ad.png b/native/extensions/anysdk/platform/android/res/drawable/plugin_ui_ad.png
similarity index 100%
rename from native/templates/js-template-binary/frameworks/runtime-src/proj.android/res/drawable/plugin_ui_ad.png
rename to native/extensions/anysdk/platform/android/res/drawable/plugin_ui_ad.png
diff --git a/native/templates/js-template-binary/frameworks/runtime-src/proj.android/res/layout/plugin_ads.xml b/native/extensions/anysdk/platform/android/res/layout/plugin_ads.xml
similarity index 100%
rename from native/templates/js-template-binary/frameworks/runtime-src/proj.android/res/layout/plugin_ads.xml
rename to native/extensions/anysdk/platform/android/res/layout/plugin_ads.xml
diff --git a/native/templates/js-template-binary/frameworks/runtime-src/proj.android/res/layout/plugin_login.xml b/native/extensions/anysdk/platform/android/res/layout/plugin_login.xml
similarity index 100%
rename from native/templates/js-template-binary/frameworks/runtime-src/proj.android/res/layout/plugin_login.xml
rename to native/extensions/anysdk/platform/android/res/layout/plugin_login.xml
diff --git a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/mipmap/plugin_btn_close.png b/native/extensions/anysdk/platform/android/res/mipmap/plugin_btn_close.png
similarity index 100%
rename from native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/mipmap/plugin_btn_close.png
rename to native/extensions/anysdk/platform/android/res/mipmap/plugin_btn_close.png
diff --git a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/mipmap/plugin_ui_ad.png b/native/extensions/anysdk/platform/android/res/mipmap/plugin_ui_ad.png
similarity index 100%
rename from native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/mipmap/plugin_ui_ad.png
rename to native/extensions/anysdk/platform/android/res/mipmap/plugin_ui_ad.png
diff --git a/native/templates/js-template-binary/frameworks/runtime-src/proj.android/res/values-en/plugin_string.xml b/native/extensions/anysdk/platform/android/res/values-en/plugin_string.xml
similarity index 100%
rename from native/templates/js-template-binary/frameworks/runtime-src/proj.android/res/values-en/plugin_string.xml
rename to native/extensions/anysdk/platform/android/res/values-en/plugin_string.xml
diff --git a/native/templates/js-template-binary/frameworks/runtime-src/proj.android/res/values/plugin_string.xml b/native/extensions/anysdk/platform/android/res/values/plugin_string.xml
similarity index 100%
rename from native/templates/js-template-binary/frameworks/runtime-src/proj.android/res/values/plugin_string.xml
rename to native/extensions/anysdk/platform/android/res/values/plugin_string.xml
diff --git a/native/extensions/anysdk/platform/android/res/values/strings.xml b/native/extensions/anysdk/platform/android/res/values/strings.xml
new file mode 100755
index 0000000000..c847de2851
--- /dev/null
+++ b/native/extensions/anysdk/platform/android/res/values/strings.xml
@@ -0,0 +1,4 @@
+
+
+ HelloJavascript
+
diff --git a/native/templates/js-template-binary/frameworks/runtime-src/proj.android/src/org/cocos2dx/javascript/SDKWrapper.java b/native/extensions/anysdk/platform/android/src/org/cocos2dx/javascript/SDKWrapper.java
similarity index 100%
rename from native/templates/js-template-binary/frameworks/runtime-src/proj.android/src/org/cocos2dx/javascript/SDKWrapper.java
rename to native/extensions/anysdk/platform/android/src/org/cocos2dx/javascript/SDKWrapper.java
diff --git a/native/templates/js-template-binary/cocos-project-template.json b/native/templates/js-template-binary/cocos-project-template.json
index 527cd0b984..d0054b8361 100755
--- a/native/templates/js-template-binary/cocos-project-template.json
+++ b/native/templates/js-template-binary/cocos-project-template.json
@@ -10,6 +10,22 @@
"include": [
"*.js"
]
+ },
+ {
+ "from":"extensions/anysdk/",
+ "to":"",
+ "include": [
+ ".cocos-package.json"
+ ]
+ },
+ {
+ "from":"extensions/anysdk/js-bindings/",
+ "to":"frameworks/runtime-src/Classes",
+ "include": [
+ "*.h",
+ "*.cpp",
+ "*.hpp"
+ ]
}
]
},
@@ -43,10 +59,10 @@
]
},
{
- "from":"extensions/anysdk/js-bindings/",
- "to":"frameworks/runtime-src/Classes",
- "include": [
- "*"
+ "from":"extensions/anysdk/platform/android",
+ "to":"frameworks/runtime-src/proj.android",
+ "exclude": [
+ "res/mipmap"
]
}
],
diff --git a/native/templates/js-template-binary/frameworks/runtime-src/proj.android/libs/libPluginProtocol.jar b/native/templates/js-template-binary/frameworks/runtime-src/proj.android/libs/libPluginProtocol.jar
deleted file mode 100644
index be90329829..0000000000
Binary files a/native/templates/js-template-binary/frameworks/runtime-src/proj.android/libs/libPluginProtocol.jar and /dev/null differ
diff --git a/native/templates/js-template-binary/src/jsb_anysdk.js b/native/templates/js-template-binary/src/jsb_anysdk.js
deleted file mode 100644
index 5ab0bbb478..0000000000
--- a/native/templates/js-template-binary/src/jsb_anysdk.js
+++ /dev/null
@@ -1,226 +0,0 @@
-anysdk.agentManager = anysdk.AgentManager.getInstance();
-
-anysdk.callWrapper = function(plugin, func){
- plugin[func.name] = (function(){
- var params = [];
- if(arguments){
- var l = arguments.length;
- for (var i = 0; i < l; i++) {
- var arg = arguments[i];
- var param = anysdk.PluginParam.create(arg);
- params.push(param);
- }
- }
-
- if(this.returnType == "void"){
- plugin.callFuncWithParam(this.name, params);
- }else if(this.returnType == "boolean"){
- return plugin.callBoolFuncWithParam(this.name, params);
- }else if(this.returnType == "int"){
- return plugin.callIntFuncWithParam(this.name, params);
- }else if(this.returnType == "float"){
- return plugin.callFloatFuncWithParam(this.name, params);
- }else {
- return plugin.callStringFuncWithParam(this.name, params);
- }
- }).bind(func);
-}
-
-anysdk.parseData = function(data){
- var jsonData = [];
- var substring = data.substring(1, data.length - 2)
- var array = substring.split(",");
- for (var i = 0; i < array.length; i++ ){
- var functionData = array[i].split("&");
- var funcParam = {};
- for(var j = 0; j < functionData.length; j++){
- var itemData = functionData[j].split("=");
- if(itemData.length > 1)
- {
- funcParam[itemData[0]] = itemData[1];
- }
- }
- jsonData.push(funcParam)
-
- }
- return jsonData;
-}
-
-anysdk.registerAPIs = function(plugin) {
- var functionString = anysdk.JSBRelation.getMethodsOfPlugin(plugin);
- var data = anysdk.parseData(functionString);
- for (var i = 0; i < data.length; i++ ){
- var name = data[i].name;
- if(name && !plugin[name]){
- cc.log("plugin: " + name + " auto binding");
- anysdk.callWrapper(plugin, data[i]);
- }
- }
-}
-anysdk.agentManager._loadAllPlugins = anysdk.agentManager.loadAllPlugins;
-anysdk.agentManager.loadAllPlugins = function (callback, target) {
- anysdk.agentManager._loadAllPlugins();
- if(callback){
- if (target){
- callback.call(target, 0, "loadAllPlugins finish");
- }else{
- callback(0, "loadAllPlugins finish");
- }
- }
-}
-
-anysdk.agentManager._getUserPlugin = anysdk.agentManager.getUserPlugin;
-anysdk.agentManager.getUserPlugin = function () {
- var plugin = this._getUserPlugin();
- if (plugin && !plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.isInitialized = true;
- plugin.setListener = function(callback, target){
- var onUserResult = function(plugin, code, msg){
- if (target){
- callback.call(target, code, msg);
- }else{
- callback(code, msg);
- }
- }
- plugin.setActionListener(onUserResult,this);
- };
- }
- return plugin;
-}
-
-anysdk.agentManager._getIAPPlugin = anysdk.agentManager.getIAPPlugin;
-anysdk.agentManager.getIAPPlugins = function () {
- var plugins = this._getIAPPlugin();
- if (plugins) {
- for (var item in plugins){
- if (plugins.hasOwnProperty(item)){
- var plugin = plugins[item];
- if (!plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.setListener = plugin.setResultListener;
- plugin.isInitialized = true;
- }
- }
- };
- };
- return plugins;
-}
-
-anysdk.agentManager.getIAPPlugin = function () {
- var iapPlugins = anysdk.agentManager.getIAPPlugins();
- if(iapPlugins != null){
- for(var item in iapPlugins){
- if (iapPlugins.hasOwnProperty(item)) {
- return iapPlugins[item];
- }
- }
- }
- return null;
-}
-
-
-anysdk.agentManager._getAdsPlugin = anysdk.agentManager.getAdsPlugin;
-anysdk.agentManager.getAdsPlugin = function () {
- var plugin = this._getAdsPlugin();
- if (plugin && !plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.setListener = plugin.setAdsListener;
- plugin.isInitialized = true;
- }
- return plugin;
-}
-
-anysdk.agentManager._getSocialPlugin = anysdk.agentManager.getSocialPlugin;
-anysdk.agentManager.getSocialPlugin = function () {
- var plugin = this._getSocialPlugin();
- if (plugin && !plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.isInitialized = true;
- }
- return plugin;
-}
-
-anysdk.agentManager._getSharePlugin = anysdk.agentManager.getSharePlugin;
-anysdk.agentManager.getSharePlugin = function () {
- var plugin = this._getSharePlugin();
- if (plugin && !plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.setListener = plugin.setResultListener;
- plugin.isInitialized = true;
- }
- return plugin;
-}
-
-anysdk.agentManager._getPushPlugin = anysdk.agentManager.getPushPlugin;
-anysdk.agentManager.getPushPlugin = function () {
- var plugin = this._getPushPlugin();
- if (plugin && !plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.setListener = plugin.setActionListener;
- plugin.isInitialized = true;
- plugin.setListener = function(callback, target){
- var onPushResult = function(plugin, code, msg){
- if (target){
- callback.call(target, code, msg);
- }else{
- callback(code, msg);
- }
- }
- plugin.setActionListener(onPushResult,this);
- };
- }
- return plugin;
-}
-
-anysdk.agentManager._getAnalyticsPlugin = anysdk.agentManager.getAnalyticsPlugin;
-anysdk.agentManager.getAnalyticsPlugin = function () {
- var plugin = this._getAnalyticsPlugin();
- if (plugin && !plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.isInitialized = true;
- }
- return plugin;
-}
-
-anysdk.agentManager._getRECPlugin = anysdk.agentManager.getRECPlugin;
-anysdk.agentManager.getRECPlugin = function () {
- var plugin = this._getRECPlugin();
- if (plugin && !plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.setListener = plugin.setResultListener;
- plugin.isInitialized = true;
- }
- return plugin;
-}
-
-anysdk.agentManager._getCustomPlugin = anysdk.agentManager.getCustomPlugin;
-anysdk.agentManager.getCustomPlugin = function () {
- var plugin = this._getCustomPlugin();
- if (plugin && !plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.setListener = plugin.setResultListener;
- plugin.isInitialized = true;
- }
- return plugin;
-}
-
-anysdk.agentManager._getCrashPlugin = anysdk.agentManager.getCrashPlugin;
-anysdk.agentManager.getCrashPlugin = function () {
- var plugin = this._getCrashPlugin();
- if (plugin && !plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.isInitialized = true;
- }
- return plugin;
-}
-
-anysdk.agentManager._getAdTrackingPlugin = anysdk.agentManager.getAdTrackingPlugin;
-anysdk.agentManager.getAdTrackingPlugin = function () {
- var plugin = this._getAdTrackingPlugin();
- if (plugin && !plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.isInitialized = true;
- }
- return plugin;
-}
\ No newline at end of file
diff --git a/native/templates/js-template-binary/src/jsb_anysdk_constants.js b/native/templates/js-template-binary/src/jsb_anysdk_constants.js
deleted file mode 100644
index b656eed151..0000000000
--- a/native/templates/js-template-binary/src/jsb_anysdk_constants.js
+++ /dev/null
@@ -1,403 +0,0 @@
-//for plugin type
-anysdk.PluginType = {
- kPluginAds:16,/**< enum value is the type of Ads. */
- kPluginAnalytics:1,/**< enum value is the type of Analytics. */
- kPluginIAP:8,/**< enum value is the type of IAP. */
- kPluginShare:2,/**< enum value is the type of Share. */
- kPluginUser:32,/**< enum value is the type of User. */
- kPluginSocial:4,/**< enum value is the type of Social. */
- kPluginPush:64,/**< enum value is the type of Push. */
- kPluginCrash:128,/**< enum value is the type of Crash. */
- kPluginCustom:256,/**< enum value is the type of Custom. */
- kPluginREC:512,/**< enum value is the type of REC. */
- kPluginAdTracking:1024/**< enum value is the type of AdTracking. */
-
-}; //plugin type
-
-//for Custom
-anysdk.CustomResultCode = {
- kCustomExtension:80000 /**< enum value is extension code . */
-} ;
-
-anysdk.RECResultCode = {
- kRECInitSuccess:0,/**< enum value is callback of succeeding in initing sdk . */
- kRECInitFail:1,/**< enum value is callback of failing to init sdk. */
- kRECStartRecording:2,/**< enum value is callback of starting to record. */
- kRECStopRecording:3,/**< enum value is callback of stoping to record. */
- kRECPauseRecording:4,/**< enum value is callback of pausing to record. */
- kRECResumeRecording:5,/**< enum value is callback of resuming to record. */
- kRECEnterSDKPage:6,/**< enum value is callback of failing to init sdk. */
- kRECQuitSDKPage:7,/**< enum value is callback of entering SDK`s page. */
- kRECShareSuccess:8,/**< enum value is callback of quiting SDK`s page. */
- kRECShareFail:9,/**< enum value is callback of failing to share. */
- kRECExtension:90000 /**< enum value is extension code . */
-} ;
-
-//for ads
-anysdk.AdsResultCode = {
- kAdsReceived:0, /**< enum the callback: the ad is received is at center. */
- kAdsShown:1, /**< enum the callback: the advertisement dismissed. */
- kAdsDismissed:2, /**< enum the callback: the advertisement dismissed. */
- kPointsSpendSucceed:3, /**< enum the callback: the points spend succeed. */
- kPointsSpendFailed:4, /**< enum the callback: the points spend failed. */
- kNetworkError:5, /**< enum the callback of Network error at center. */
- kUnknownError:6, /**< enum the callback of Unknown error. */
- kOfferWallOnPointsChanged:7, /**< enum the callback of Changing the point of offerwall. */
- kRewardedVideoWithReward:8,/**< enum the callback of receive the reward of rewardedvideo. */
- kInAppPurchaseFinished:9,/**< enum the callback of finishing IAP ad. */
- kAdsClicked:10,/**< enum the callback of the advertisement clicked. */
- kAdsExtension :40000 /**< enum value is extension code . */
-}; //ads result code
-
-anysdk.AdsPos = {
- kPosCenter:0, /**< enum the toolbar is at center. */
- kPosTop:1, /**< enum the toolbar is at top. */
- kPosTopLeft:2, /**< enum the toolbar is at topleft. */
- kPosTopRight:3, /**< enum the toolbar is at topright. */
- kPosBottom:4, /**< enum the toolbar is at bottom. */
- kPosBottomLeft:5, /**< enum the toolbar is at bottomleft. */
- kPosBottomRight:6 /**< enum the toolbar is at bottomright. */
-}; //ads pos
-
-anysdk.AdsType = {
- AD_TYPE_BANNER:0, /**< enum value is banner ads . */
- AD_TYPE_FULLSCREEN:1, /**< enum value is fullscreen ads . */
- AD_TYPE_MOREAPP:2, /**< enum value is moreapp ads . */
- AD_TYPE_OFFERWALL:3, /**< enum value is offerwall ads . */
- AD_TYPE_REWARDEDVIDEO:4,/**< enum value is rewarded video ads . */
- AD_TYPE_NATIVEEXPRESS:5,/**< enum value is Native express ads . */
- AD_TYPE_NATIVEADVANCED:6/**< enum value is Native advanced ads . */
-}; //ads type
-
-//for pay result code
-anysdk.PayResultCode = {
- kPaySuccess:0, /**< enum value is callback of succeeding in paying . */
- kPayFail:1, /**< enum value is callback of failing to pay . */
- kPayCancel:2, /**< enum value is callback of canceling to pay . */
- kPayNetworkError:3, /**< enum value is callback of network error . */
- kPayProductionInforIncomplete:4, /**< enum value is callback of incompleting info . */
- kPayInitSuccess:5, /**< enum value is callback of succeeding in initing sdk . */
- kPayInitFail:6, /**< enum value is callback of failing to init sdk . */
- kPayNowPaying:7, /**< enum value is callback of paying now . */
- kPayRechargeSuccess:8,/**< enum value is callback of succeeding in recharging. */
- kPayExtension : 30000, /**< enum value is extension code . */
- kPayNeedLoginAgain : 31002 /**< enum value is callback of logining again . */
-};
-
-anysdk.RequestResultCode = {
- kRequestSuccess:31000, /**unloadAllPlugins();
-}
-
-SDKManager* SDKManager::getInstance()
-{
- if (_pInstance == NULL) {
- _pInstance = new SDKManager();
- }
- return _pInstance;
-}
-
-void SDKManager::purge()
-{
- if (_pInstance)
- {
- delete _pInstance;
- _pInstance = NULL;
- }
-}
-
-void SDKManager::loadAllPlugins()
-{
- /**
- * appKey, appSecret and privateKey are the only three parameters generated
- * after the packing tool client finishes creating the game.
- * The oauthLoginServer parameter is the API address provided by the game service
- * to login verification
- */
- std::string oauthLoginServer = "OAUTH_LOGIN_SERVER";
- std::string appKey = "APP_KEY";
- std::string appSecret = "APP_SERCRET";
- std::string privateKey = "PRIVATE_KEY";
-
- AgentManager* pAgent = AgentManager::getInstance();
- pAgent->init(appKey,appSecret,privateKey,oauthLoginServer);
-
- //Initialize plug-ins, including SDKs.
- pAgent->loadAllPlugins();
-}
-
-
diff --git a/native/templates/js-template-default/frameworks/runtime-src/Classes/SDKManager.h b/native/templates/js-template-default/frameworks/runtime-src/Classes/SDKManager.h
deleted file mode 100644
index c2e83c9dbd..0000000000
--- a/native/templates/js-template-default/frameworks/runtime-src/Classes/SDKManager.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef __SDK_MANAGER_H__
-#define __SDK_MANAGER_H__
-
-#include "AgentManager.h"
-using namespace anysdk::framework;
-using namespace std;
-class SDKManager
-{
-public:
- static SDKManager* getInstance();
- static void purge();
-
- void loadAllPlugins();
-
-private:
- SDKManager();
- virtual ~SDKManager();
-
- static SDKManager* _pInstance;
-
- AgentManager* _pAgent;
-};
-
-#endif
diff --git a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/libs/libPluginProtocol.jar b/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/libs/libPluginProtocol.jar
deleted file mode 100644
index be90329829..0000000000
Binary files a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/libs/libPluginProtocol.jar and /dev/null differ
diff --git a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/layout/plugin_ads.xml b/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/layout/plugin_ads.xml
deleted file mode 100644
index 72dad5c589..0000000000
--- a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/layout/plugin_ads.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/layout/plugin_login.xml b/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/layout/plugin_login.xml
deleted file mode 100644
index 7ae073d288..0000000000
--- a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/layout/plugin_login.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/values-en/plugin_string.xml b/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/values-en/plugin_string.xml
deleted file mode 100644
index 1ab40a2fae..0000000000
--- a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/values-en/plugin_string.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
- Account login
- Account
- Password
- Login
- Cancel
- Do you confirm the payment?
- Pay
- Rank
- Achievement
- Platform center
- Show toolbar
- Hide toolbar
- Real-name registration
- Anti-addiction query
- Exit
- Pause the game
- Confirm
- Switch account
- Logout
- Submit the role information
- Test mode, not for official release!
- Just a moment please
- Data is communication
-
-
-
-
\ No newline at end of file
diff --git a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/values/plugin_string.xml b/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/values/plugin_string.xml
deleted file mode 100644
index 5040760b1e..0000000000
--- a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/res/values/plugin_string.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
- 账号登陆
- 账号
- 密码
- 登陆
- 取消
- 是否确认支付?
- 支付
- 排行榜
- 成就榜
- 平台中心
- 工具栏
- 隐藏工具栏
- 实名注册
- 防沉迷查询
- 退出
- 暂停游戏
- 确认
- 切换账号
- 登出
- 提交角色信息
- 测试模式,不能用于渠道发布
- 请稍等
- 数据通信中...
-
-
-
\ No newline at end of file
diff --git a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/src/org/cocos2dx/javascript/SDKWrapper.java b/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/src/org/cocos2dx/javascript/SDKWrapper.java
deleted file mode 100644
index 85a31b4d69..0000000000
--- a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/src/org/cocos2dx/javascript/SDKWrapper.java
+++ /dev/null
@@ -1,118 +0,0 @@
-package org.cocos2dx.javascript;
-
-import android.content.Context;
-import android.content.Intent;
-import android.opengl.GLSurfaceView;
-
-public class SDKWrapper {
- private final static boolean PACKAGE_AS = true;
- private static Class> mClass = null;
-
- private static SDKWrapper mInstace = null;
- public static SDKWrapper getInstance() {
- if (null == mInstace){
- mInstace = new SDKWrapper();
- try {
- String fullName = "com.anysdk.framework.PluginWrapper";
- mClass = Class.forName(fullName);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- return mInstace;
- }
-
- public void init(Context context) {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("init", Context.class).invoke(mClass, context);
- } catch (Exception e) {
- e.printStackTrace();
- }
- SDKWrapper.nativeLoadAllPlugins();
- }
-
- }
-
- public void setGLSurfaceView(GLSurfaceView view) {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("setGLSurfaceView", GLSurfaceView.class).invoke(mClass, view);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- public void onResume() {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("onResume").invoke(mClass);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- public void onPause() {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("onPause").invoke(mClass);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- public void onDestroy() {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("onDestroy").invoke(mClass);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- public void onActivityResult(int requestCode, int resultCode, Intent data) {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("onActivityResult", int.class, int.class, Intent.class).invoke(mClass, requestCode, resultCode, data);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- public void onNewIntent(Intent intent) {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("onNewIntent", Intent.class).invoke(mClass, intent);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- public void onRestart() {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("onRestart").invoke(mClass);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- public void onStop() {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("onStop").invoke(mClass);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- private static native void nativeLoadAllPlugins();
-}
diff --git a/native/templates/js-template-default/frameworks/runtime-src/proj.android/libs/libPluginProtocol.jar b/native/templates/js-template-default/frameworks/runtime-src/proj.android/libs/libPluginProtocol.jar
deleted file mode 100644
index be90329829..0000000000
Binary files a/native/templates/js-template-default/frameworks/runtime-src/proj.android/libs/libPluginProtocol.jar and /dev/null differ
diff --git a/native/templates/js-template-default/frameworks/runtime-src/proj.android/res/drawable/plugin_btn_close.png b/native/templates/js-template-default/frameworks/runtime-src/proj.android/res/drawable/plugin_btn_close.png
deleted file mode 100644
index e07bf269c7..0000000000
Binary files a/native/templates/js-template-default/frameworks/runtime-src/proj.android/res/drawable/plugin_btn_close.png and /dev/null differ
diff --git a/native/templates/js-template-default/frameworks/runtime-src/proj.android/res/drawable/plugin_ui_ad.png b/native/templates/js-template-default/frameworks/runtime-src/proj.android/res/drawable/plugin_ui_ad.png
deleted file mode 100644
index 346708cf30..0000000000
Binary files a/native/templates/js-template-default/frameworks/runtime-src/proj.android/res/drawable/plugin_ui_ad.png and /dev/null differ
diff --git a/native/templates/js-template-default/frameworks/runtime-src/proj.android/res/layout/plugin_ads.xml b/native/templates/js-template-default/frameworks/runtime-src/proj.android/res/layout/plugin_ads.xml
deleted file mode 100644
index 7974a4fcf1..0000000000
--- a/native/templates/js-template-default/frameworks/runtime-src/proj.android/res/layout/plugin_ads.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/native/templates/js-template-default/frameworks/runtime-src/proj.android/res/layout/plugin_login.xml b/native/templates/js-template-default/frameworks/runtime-src/proj.android/res/layout/plugin_login.xml
deleted file mode 100644
index 7ae073d288..0000000000
--- a/native/templates/js-template-default/frameworks/runtime-src/proj.android/res/layout/plugin_login.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/native/templates/js-template-default/frameworks/runtime-src/proj.android/res/values-en/plugin_string.xml b/native/templates/js-template-default/frameworks/runtime-src/proj.android/res/values-en/plugin_string.xml
deleted file mode 100644
index 1ab40a2fae..0000000000
--- a/native/templates/js-template-default/frameworks/runtime-src/proj.android/res/values-en/plugin_string.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
- Account login
- Account
- Password
- Login
- Cancel
- Do you confirm the payment?
- Pay
- Rank
- Achievement
- Platform center
- Show toolbar
- Hide toolbar
- Real-name registration
- Anti-addiction query
- Exit
- Pause the game
- Confirm
- Switch account
- Logout
- Submit the role information
- Test mode, not for official release!
- Just a moment please
- Data is communication
-
-
-
-
\ No newline at end of file
diff --git a/native/templates/js-template-default/frameworks/runtime-src/proj.android/res/values/plugin_string.xml b/native/templates/js-template-default/frameworks/runtime-src/proj.android/res/values/plugin_string.xml
deleted file mode 100644
index 5040760b1e..0000000000
--- a/native/templates/js-template-default/frameworks/runtime-src/proj.android/res/values/plugin_string.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
- 账号登陆
- 账号
- 密码
- 登陆
- 取消
- 是否确认支付?
- 支付
- 排行榜
- 成就榜
- 平台中心
- 工具栏
- 隐藏工具栏
- 实名注册
- 防沉迷查询
- 退出
- 暂停游戏
- 确认
- 切换账号
- 登出
- 提交角色信息
- 测试模式,不能用于渠道发布
- 请稍等
- 数据通信中...
-
-
-
\ No newline at end of file
diff --git a/native/templates/js-template-default/frameworks/runtime-src/proj.android/src/org/cocos2dx/javascript/SDKWrapper.java b/native/templates/js-template-default/frameworks/runtime-src/proj.android/src/org/cocos2dx/javascript/SDKWrapper.java
deleted file mode 100644
index 85a31b4d69..0000000000
--- a/native/templates/js-template-default/frameworks/runtime-src/proj.android/src/org/cocos2dx/javascript/SDKWrapper.java
+++ /dev/null
@@ -1,118 +0,0 @@
-package org.cocos2dx.javascript;
-
-import android.content.Context;
-import android.content.Intent;
-import android.opengl.GLSurfaceView;
-
-public class SDKWrapper {
- private final static boolean PACKAGE_AS = true;
- private static Class> mClass = null;
-
- private static SDKWrapper mInstace = null;
- public static SDKWrapper getInstance() {
- if (null == mInstace){
- mInstace = new SDKWrapper();
- try {
- String fullName = "com.anysdk.framework.PluginWrapper";
- mClass = Class.forName(fullName);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- return mInstace;
- }
-
- public void init(Context context) {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("init", Context.class).invoke(mClass, context);
- } catch (Exception e) {
- e.printStackTrace();
- }
- SDKWrapper.nativeLoadAllPlugins();
- }
-
- }
-
- public void setGLSurfaceView(GLSurfaceView view) {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("setGLSurfaceView", GLSurfaceView.class).invoke(mClass, view);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- public void onResume() {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("onResume").invoke(mClass);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- public void onPause() {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("onPause").invoke(mClass);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- public void onDestroy() {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("onDestroy").invoke(mClass);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- public void onActivityResult(int requestCode, int resultCode, Intent data) {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("onActivityResult", int.class, int.class, Intent.class).invoke(mClass, requestCode, resultCode, data);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- public void onNewIntent(Intent intent) {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("onNewIntent", Intent.class).invoke(mClass, intent);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- public void onRestart() {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("onRestart").invoke(mClass);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- public void onStop() {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("onStop").invoke(mClass);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- private static native void nativeLoadAllPlugins();
-}
diff --git a/native/templates/js-template-default/src/jsb_anysdk.js b/native/templates/js-template-default/src/jsb_anysdk.js
deleted file mode 100644
index 5ab0bbb478..0000000000
--- a/native/templates/js-template-default/src/jsb_anysdk.js
+++ /dev/null
@@ -1,226 +0,0 @@
-anysdk.agentManager = anysdk.AgentManager.getInstance();
-
-anysdk.callWrapper = function(plugin, func){
- plugin[func.name] = (function(){
- var params = [];
- if(arguments){
- var l = arguments.length;
- for (var i = 0; i < l; i++) {
- var arg = arguments[i];
- var param = anysdk.PluginParam.create(arg);
- params.push(param);
- }
- }
-
- if(this.returnType == "void"){
- plugin.callFuncWithParam(this.name, params);
- }else if(this.returnType == "boolean"){
- return plugin.callBoolFuncWithParam(this.name, params);
- }else if(this.returnType == "int"){
- return plugin.callIntFuncWithParam(this.name, params);
- }else if(this.returnType == "float"){
- return plugin.callFloatFuncWithParam(this.name, params);
- }else {
- return plugin.callStringFuncWithParam(this.name, params);
- }
- }).bind(func);
-}
-
-anysdk.parseData = function(data){
- var jsonData = [];
- var substring = data.substring(1, data.length - 2)
- var array = substring.split(",");
- for (var i = 0; i < array.length; i++ ){
- var functionData = array[i].split("&");
- var funcParam = {};
- for(var j = 0; j < functionData.length; j++){
- var itemData = functionData[j].split("=");
- if(itemData.length > 1)
- {
- funcParam[itemData[0]] = itemData[1];
- }
- }
- jsonData.push(funcParam)
-
- }
- return jsonData;
-}
-
-anysdk.registerAPIs = function(plugin) {
- var functionString = anysdk.JSBRelation.getMethodsOfPlugin(plugin);
- var data = anysdk.parseData(functionString);
- for (var i = 0; i < data.length; i++ ){
- var name = data[i].name;
- if(name && !plugin[name]){
- cc.log("plugin: " + name + " auto binding");
- anysdk.callWrapper(plugin, data[i]);
- }
- }
-}
-anysdk.agentManager._loadAllPlugins = anysdk.agentManager.loadAllPlugins;
-anysdk.agentManager.loadAllPlugins = function (callback, target) {
- anysdk.agentManager._loadAllPlugins();
- if(callback){
- if (target){
- callback.call(target, 0, "loadAllPlugins finish");
- }else{
- callback(0, "loadAllPlugins finish");
- }
- }
-}
-
-anysdk.agentManager._getUserPlugin = anysdk.agentManager.getUserPlugin;
-anysdk.agentManager.getUserPlugin = function () {
- var plugin = this._getUserPlugin();
- if (plugin && !plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.isInitialized = true;
- plugin.setListener = function(callback, target){
- var onUserResult = function(plugin, code, msg){
- if (target){
- callback.call(target, code, msg);
- }else{
- callback(code, msg);
- }
- }
- plugin.setActionListener(onUserResult,this);
- };
- }
- return plugin;
-}
-
-anysdk.agentManager._getIAPPlugin = anysdk.agentManager.getIAPPlugin;
-anysdk.agentManager.getIAPPlugins = function () {
- var plugins = this._getIAPPlugin();
- if (plugins) {
- for (var item in plugins){
- if (plugins.hasOwnProperty(item)){
- var plugin = plugins[item];
- if (!plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.setListener = plugin.setResultListener;
- plugin.isInitialized = true;
- }
- }
- };
- };
- return plugins;
-}
-
-anysdk.agentManager.getIAPPlugin = function () {
- var iapPlugins = anysdk.agentManager.getIAPPlugins();
- if(iapPlugins != null){
- for(var item in iapPlugins){
- if (iapPlugins.hasOwnProperty(item)) {
- return iapPlugins[item];
- }
- }
- }
- return null;
-}
-
-
-anysdk.agentManager._getAdsPlugin = anysdk.agentManager.getAdsPlugin;
-anysdk.agentManager.getAdsPlugin = function () {
- var plugin = this._getAdsPlugin();
- if (plugin && !plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.setListener = plugin.setAdsListener;
- plugin.isInitialized = true;
- }
- return plugin;
-}
-
-anysdk.agentManager._getSocialPlugin = anysdk.agentManager.getSocialPlugin;
-anysdk.agentManager.getSocialPlugin = function () {
- var plugin = this._getSocialPlugin();
- if (plugin && !plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.isInitialized = true;
- }
- return plugin;
-}
-
-anysdk.agentManager._getSharePlugin = anysdk.agentManager.getSharePlugin;
-anysdk.agentManager.getSharePlugin = function () {
- var plugin = this._getSharePlugin();
- if (plugin && !plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.setListener = plugin.setResultListener;
- plugin.isInitialized = true;
- }
- return plugin;
-}
-
-anysdk.agentManager._getPushPlugin = anysdk.agentManager.getPushPlugin;
-anysdk.agentManager.getPushPlugin = function () {
- var plugin = this._getPushPlugin();
- if (plugin && !plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.setListener = plugin.setActionListener;
- plugin.isInitialized = true;
- plugin.setListener = function(callback, target){
- var onPushResult = function(plugin, code, msg){
- if (target){
- callback.call(target, code, msg);
- }else{
- callback(code, msg);
- }
- }
- plugin.setActionListener(onPushResult,this);
- };
- }
- return plugin;
-}
-
-anysdk.agentManager._getAnalyticsPlugin = anysdk.agentManager.getAnalyticsPlugin;
-anysdk.agentManager.getAnalyticsPlugin = function () {
- var plugin = this._getAnalyticsPlugin();
- if (plugin && !plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.isInitialized = true;
- }
- return plugin;
-}
-
-anysdk.agentManager._getRECPlugin = anysdk.agentManager.getRECPlugin;
-anysdk.agentManager.getRECPlugin = function () {
- var plugin = this._getRECPlugin();
- if (plugin && !plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.setListener = plugin.setResultListener;
- plugin.isInitialized = true;
- }
- return plugin;
-}
-
-anysdk.agentManager._getCustomPlugin = anysdk.agentManager.getCustomPlugin;
-anysdk.agentManager.getCustomPlugin = function () {
- var plugin = this._getCustomPlugin();
- if (plugin && !plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.setListener = plugin.setResultListener;
- plugin.isInitialized = true;
- }
- return plugin;
-}
-
-anysdk.agentManager._getCrashPlugin = anysdk.agentManager.getCrashPlugin;
-anysdk.agentManager.getCrashPlugin = function () {
- var plugin = this._getCrashPlugin();
- if (plugin && !plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.isInitialized = true;
- }
- return plugin;
-}
-
-anysdk.agentManager._getAdTrackingPlugin = anysdk.agentManager.getAdTrackingPlugin;
-anysdk.agentManager.getAdTrackingPlugin = function () {
- var plugin = this._getAdTrackingPlugin();
- if (plugin && !plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.isInitialized = true;
- }
- return plugin;
-}
\ No newline at end of file
diff --git a/native/templates/js-template-default/src/jsb_anysdk_constants.js b/native/templates/js-template-default/src/jsb_anysdk_constants.js
deleted file mode 100644
index b656eed151..0000000000
--- a/native/templates/js-template-default/src/jsb_anysdk_constants.js
+++ /dev/null
@@ -1,403 +0,0 @@
-//for plugin type
-anysdk.PluginType = {
- kPluginAds:16,/**< enum value is the type of Ads. */
- kPluginAnalytics:1,/**< enum value is the type of Analytics. */
- kPluginIAP:8,/**< enum value is the type of IAP. */
- kPluginShare:2,/**< enum value is the type of Share. */
- kPluginUser:32,/**< enum value is the type of User. */
- kPluginSocial:4,/**< enum value is the type of Social. */
- kPluginPush:64,/**< enum value is the type of Push. */
- kPluginCrash:128,/**< enum value is the type of Crash. */
- kPluginCustom:256,/**< enum value is the type of Custom. */
- kPluginREC:512,/**< enum value is the type of REC. */
- kPluginAdTracking:1024/**< enum value is the type of AdTracking. */
-
-}; //plugin type
-
-//for Custom
-anysdk.CustomResultCode = {
- kCustomExtension:80000 /**< enum value is extension code . */
-} ;
-
-anysdk.RECResultCode = {
- kRECInitSuccess:0,/**< enum value is callback of succeeding in initing sdk . */
- kRECInitFail:1,/**< enum value is callback of failing to init sdk. */
- kRECStartRecording:2,/**< enum value is callback of starting to record. */
- kRECStopRecording:3,/**< enum value is callback of stoping to record. */
- kRECPauseRecording:4,/**< enum value is callback of pausing to record. */
- kRECResumeRecording:5,/**< enum value is callback of resuming to record. */
- kRECEnterSDKPage:6,/**< enum value is callback of failing to init sdk. */
- kRECQuitSDKPage:7,/**< enum value is callback of entering SDK`s page. */
- kRECShareSuccess:8,/**< enum value is callback of quiting SDK`s page. */
- kRECShareFail:9,/**< enum value is callback of failing to share. */
- kRECExtension:90000 /**< enum value is extension code . */
-} ;
-
-//for ads
-anysdk.AdsResultCode = {
- kAdsReceived:0, /**< enum the callback: the ad is received is at center. */
- kAdsShown:1, /**< enum the callback: the advertisement dismissed. */
- kAdsDismissed:2, /**< enum the callback: the advertisement dismissed. */
- kPointsSpendSucceed:3, /**< enum the callback: the points spend succeed. */
- kPointsSpendFailed:4, /**< enum the callback: the points spend failed. */
- kNetworkError:5, /**< enum the callback of Network error at center. */
- kUnknownError:6, /**< enum the callback of Unknown error. */
- kOfferWallOnPointsChanged:7, /**< enum the callback of Changing the point of offerwall. */
- kRewardedVideoWithReward:8,/**< enum the callback of receive the reward of rewardedvideo. */
- kInAppPurchaseFinished:9,/**< enum the callback of finishing IAP ad. */
- kAdsClicked:10,/**< enum the callback of the advertisement clicked. */
- kAdsExtension :40000 /**< enum value is extension code . */
-}; //ads result code
-
-anysdk.AdsPos = {
- kPosCenter:0, /**< enum the toolbar is at center. */
- kPosTop:1, /**< enum the toolbar is at top. */
- kPosTopLeft:2, /**< enum the toolbar is at topleft. */
- kPosTopRight:3, /**< enum the toolbar is at topright. */
- kPosBottom:4, /**< enum the toolbar is at bottom. */
- kPosBottomLeft:5, /**< enum the toolbar is at bottomleft. */
- kPosBottomRight:6 /**< enum the toolbar is at bottomright. */
-}; //ads pos
-
-anysdk.AdsType = {
- AD_TYPE_BANNER:0, /**< enum value is banner ads . */
- AD_TYPE_FULLSCREEN:1, /**< enum value is fullscreen ads . */
- AD_TYPE_MOREAPP:2, /**< enum value is moreapp ads . */
- AD_TYPE_OFFERWALL:3, /**< enum value is offerwall ads . */
- AD_TYPE_REWARDEDVIDEO:4,/**< enum value is rewarded video ads . */
- AD_TYPE_NATIVEEXPRESS:5,/**< enum value is Native express ads . */
- AD_TYPE_NATIVEADVANCED:6/**< enum value is Native advanced ads . */
-}; //ads type
-
-//for pay result code
-anysdk.PayResultCode = {
- kPaySuccess:0, /**< enum value is callback of succeeding in paying . */
- kPayFail:1, /**< enum value is callback of failing to pay . */
- kPayCancel:2, /**< enum value is callback of canceling to pay . */
- kPayNetworkError:3, /**< enum value is callback of network error . */
- kPayProductionInforIncomplete:4, /**< enum value is callback of incompleting info . */
- kPayInitSuccess:5, /**< enum value is callback of succeeding in initing sdk . */
- kPayInitFail:6, /**< enum value is callback of failing to init sdk . */
- kPayNowPaying:7, /**< enum value is callback of paying now . */
- kPayRechargeSuccess:8,/**< enum value is callback of succeeding in recharging. */
- kPayExtension : 30000, /**< enum value is extension code . */
- kPayNeedLoginAgain : 31002 /**< enum value is callback of logining again . */
-};
-
-anysdk.RequestResultCode = {
- kRequestSuccess:31000, /**unloadAllPlugins();
-}
-
-SDKManager* SDKManager::getInstance()
-{
- if (_pInstance == NULL) {
- _pInstance = new SDKManager();
- }
- return _pInstance;
-}
-
-void SDKManager::purge()
-{
- if (_pInstance)
- {
- delete _pInstance;
- _pInstance = NULL;
- }
-}
-
-void SDKManager::loadAllPlugins()
-{
- /**
- * appKey, appSecret and privateKey are the only three parameters generated
- * after the packing tool client finishes creating the game.
- * The oauthLoginServer parameter is the API address provided by the game service
- * to login verification
- */
- std::string oauthLoginServer = "OAUTH_LOGIN_SERVER";
- std::string appKey = "APP_KEY";
- std::string appSecret = "APP_SERCRET";
- std::string privateKey = "PRIVATE_KEY";
-
- AgentManager* pAgent = AgentManager::getInstance();
- pAgent->init(appKey,appSecret,privateKey,oauthLoginServer);
-
- //Initialize plug-ins, including SDKs.
- pAgent->loadAllPlugins();
-}
-
-
diff --git a/native/templates/js-template-link/frameworks/runtime-src/Classes/SDKManager.h b/native/templates/js-template-link/frameworks/runtime-src/Classes/SDKManager.h
deleted file mode 100644
index c2e83c9dbd..0000000000
--- a/native/templates/js-template-link/frameworks/runtime-src/Classes/SDKManager.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef __SDK_MANAGER_H__
-#define __SDK_MANAGER_H__
-
-#include "AgentManager.h"
-using namespace anysdk::framework;
-using namespace std;
-class SDKManager
-{
-public:
- static SDKManager* getInstance();
- static void purge();
-
- void loadAllPlugins();
-
-private:
- SDKManager();
- virtual ~SDKManager();
-
- static SDKManager* _pInstance;
-
- AgentManager* _pAgent;
-};
-
-#endif
diff --git a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/libs/libPluginProtocol.jar b/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/libs/libPluginProtocol.jar
deleted file mode 100644
index be90329829..0000000000
Binary files a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/libs/libPluginProtocol.jar and /dev/null differ
diff --git a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/res/layout/plugin_ads.xml b/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/res/layout/plugin_ads.xml
deleted file mode 100644
index 72dad5c589..0000000000
--- a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/res/layout/plugin_ads.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/res/layout/plugin_login.xml b/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/res/layout/plugin_login.xml
deleted file mode 100644
index 7ae073d288..0000000000
--- a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/res/layout/plugin_login.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/res/mipmap/plugin_btn_close.png b/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/res/mipmap/plugin_btn_close.png
deleted file mode 100644
index e07bf269c7..0000000000
Binary files a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/res/mipmap/plugin_btn_close.png and /dev/null differ
diff --git a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/res/mipmap/plugin_ui_ad.png b/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/res/mipmap/plugin_ui_ad.png
deleted file mode 100644
index 346708cf30..0000000000
Binary files a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/res/mipmap/plugin_ui_ad.png and /dev/null differ
diff --git a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/res/values-en/plugin_string.xml b/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/res/values-en/plugin_string.xml
deleted file mode 100644
index 1ab40a2fae..0000000000
--- a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/res/values-en/plugin_string.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
- Account login
- Account
- Password
- Login
- Cancel
- Do you confirm the payment?
- Pay
- Rank
- Achievement
- Platform center
- Show toolbar
- Hide toolbar
- Real-name registration
- Anti-addiction query
- Exit
- Pause the game
- Confirm
- Switch account
- Logout
- Submit the role information
- Test mode, not for official release!
- Just a moment please
- Data is communication
-
-
-
-
\ No newline at end of file
diff --git a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/res/values/plugin_string.xml b/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/res/values/plugin_string.xml
deleted file mode 100644
index 5040760b1e..0000000000
--- a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/res/values/plugin_string.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
- 账号登陆
- 账号
- 密码
- 登陆
- 取消
- 是否确认支付?
- 支付
- 排行榜
- 成就榜
- 平台中心
- 工具栏
- 隐藏工具栏
- 实名注册
- 防沉迷查询
- 退出
- 暂停游戏
- 确认
- 切换账号
- 登出
- 提交角色信息
- 测试模式,不能用于渠道发布
- 请稍等
- 数据通信中...
-
-
-
\ No newline at end of file
diff --git a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/src/org/cocos2dx/javascript/SDKWrapper.java b/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/src/org/cocos2dx/javascript/SDKWrapper.java
deleted file mode 100644
index 85a31b4d69..0000000000
--- a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/src/org/cocos2dx/javascript/SDKWrapper.java
+++ /dev/null
@@ -1,118 +0,0 @@
-package org.cocos2dx.javascript;
-
-import android.content.Context;
-import android.content.Intent;
-import android.opengl.GLSurfaceView;
-
-public class SDKWrapper {
- private final static boolean PACKAGE_AS = true;
- private static Class> mClass = null;
-
- private static SDKWrapper mInstace = null;
- public static SDKWrapper getInstance() {
- if (null == mInstace){
- mInstace = new SDKWrapper();
- try {
- String fullName = "com.anysdk.framework.PluginWrapper";
- mClass = Class.forName(fullName);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- return mInstace;
- }
-
- public void init(Context context) {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("init", Context.class).invoke(mClass, context);
- } catch (Exception e) {
- e.printStackTrace();
- }
- SDKWrapper.nativeLoadAllPlugins();
- }
-
- }
-
- public void setGLSurfaceView(GLSurfaceView view) {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("setGLSurfaceView", GLSurfaceView.class).invoke(mClass, view);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- public void onResume() {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("onResume").invoke(mClass);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- public void onPause() {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("onPause").invoke(mClass);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- public void onDestroy() {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("onDestroy").invoke(mClass);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- public void onActivityResult(int requestCode, int resultCode, Intent data) {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("onActivityResult", int.class, int.class, Intent.class).invoke(mClass, requestCode, resultCode, data);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- public void onNewIntent(Intent intent) {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("onNewIntent", Intent.class).invoke(mClass, intent);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- public void onRestart() {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("onRestart").invoke(mClass);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- public void onStop() {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("onStop").invoke(mClass);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- private static native void nativeLoadAllPlugins();
-}
diff --git a/native/templates/js-template-link/frameworks/runtime-src/proj.android/libs/libPluginProtocol.jar b/native/templates/js-template-link/frameworks/runtime-src/proj.android/libs/libPluginProtocol.jar
deleted file mode 100644
index be90329829..0000000000
Binary files a/native/templates/js-template-link/frameworks/runtime-src/proj.android/libs/libPluginProtocol.jar and /dev/null differ
diff --git a/native/templates/js-template-link/frameworks/runtime-src/proj.android/res/drawable/plugin_btn_close.png b/native/templates/js-template-link/frameworks/runtime-src/proj.android/res/drawable/plugin_btn_close.png
deleted file mode 100644
index e07bf269c7..0000000000
Binary files a/native/templates/js-template-link/frameworks/runtime-src/proj.android/res/drawable/plugin_btn_close.png and /dev/null differ
diff --git a/native/templates/js-template-link/frameworks/runtime-src/proj.android/res/drawable/plugin_ui_ad.png b/native/templates/js-template-link/frameworks/runtime-src/proj.android/res/drawable/plugin_ui_ad.png
deleted file mode 100644
index 346708cf30..0000000000
Binary files a/native/templates/js-template-link/frameworks/runtime-src/proj.android/res/drawable/plugin_ui_ad.png and /dev/null differ
diff --git a/native/templates/js-template-link/frameworks/runtime-src/proj.android/res/layout/plugin_ads.xml b/native/templates/js-template-link/frameworks/runtime-src/proj.android/res/layout/plugin_ads.xml
deleted file mode 100644
index 7974a4fcf1..0000000000
--- a/native/templates/js-template-link/frameworks/runtime-src/proj.android/res/layout/plugin_ads.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/native/templates/js-template-link/frameworks/runtime-src/proj.android/res/layout/plugin_login.xml b/native/templates/js-template-link/frameworks/runtime-src/proj.android/res/layout/plugin_login.xml
deleted file mode 100644
index 7ae073d288..0000000000
--- a/native/templates/js-template-link/frameworks/runtime-src/proj.android/res/layout/plugin_login.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/native/templates/js-template-link/frameworks/runtime-src/proj.android/res/values-en/plugin_string.xml b/native/templates/js-template-link/frameworks/runtime-src/proj.android/res/values-en/plugin_string.xml
deleted file mode 100644
index 1ab40a2fae..0000000000
--- a/native/templates/js-template-link/frameworks/runtime-src/proj.android/res/values-en/plugin_string.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
- Account login
- Account
- Password
- Login
- Cancel
- Do you confirm the payment?
- Pay
- Rank
- Achievement
- Platform center
- Show toolbar
- Hide toolbar
- Real-name registration
- Anti-addiction query
- Exit
- Pause the game
- Confirm
- Switch account
- Logout
- Submit the role information
- Test mode, not for official release!
- Just a moment please
- Data is communication
-
-
-
-
\ No newline at end of file
diff --git a/native/templates/js-template-link/frameworks/runtime-src/proj.android/res/values/plugin_string.xml b/native/templates/js-template-link/frameworks/runtime-src/proj.android/res/values/plugin_string.xml
deleted file mode 100644
index 5040760b1e..0000000000
--- a/native/templates/js-template-link/frameworks/runtime-src/proj.android/res/values/plugin_string.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
- 账号登陆
- 账号
- 密码
- 登陆
- 取消
- 是否确认支付?
- 支付
- 排行榜
- 成就榜
- 平台中心
- 工具栏
- 隐藏工具栏
- 实名注册
- 防沉迷查询
- 退出
- 暂停游戏
- 确认
- 切换账号
- 登出
- 提交角色信息
- 测试模式,不能用于渠道发布
- 请稍等
- 数据通信中...
-
-
-
\ No newline at end of file
diff --git a/native/templates/js-template-link/frameworks/runtime-src/proj.android/src/org/cocos2dx/javascript/SDKWrapper.java b/native/templates/js-template-link/frameworks/runtime-src/proj.android/src/org/cocos2dx/javascript/SDKWrapper.java
deleted file mode 100644
index 85a31b4d69..0000000000
--- a/native/templates/js-template-link/frameworks/runtime-src/proj.android/src/org/cocos2dx/javascript/SDKWrapper.java
+++ /dev/null
@@ -1,118 +0,0 @@
-package org.cocos2dx.javascript;
-
-import android.content.Context;
-import android.content.Intent;
-import android.opengl.GLSurfaceView;
-
-public class SDKWrapper {
- private final static boolean PACKAGE_AS = true;
- private static Class> mClass = null;
-
- private static SDKWrapper mInstace = null;
- public static SDKWrapper getInstance() {
- if (null == mInstace){
- mInstace = new SDKWrapper();
- try {
- String fullName = "com.anysdk.framework.PluginWrapper";
- mClass = Class.forName(fullName);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- return mInstace;
- }
-
- public void init(Context context) {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("init", Context.class).invoke(mClass, context);
- } catch (Exception e) {
- e.printStackTrace();
- }
- SDKWrapper.nativeLoadAllPlugins();
- }
-
- }
-
- public void setGLSurfaceView(GLSurfaceView view) {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("setGLSurfaceView", GLSurfaceView.class).invoke(mClass, view);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- public void onResume() {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("onResume").invoke(mClass);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- public void onPause() {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("onPause").invoke(mClass);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- public void onDestroy() {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("onDestroy").invoke(mClass);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- public void onActivityResult(int requestCode, int resultCode, Intent data) {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("onActivityResult", int.class, int.class, Intent.class).invoke(mClass, requestCode, resultCode, data);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- public void onNewIntent(Intent intent) {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("onNewIntent", Intent.class).invoke(mClass, intent);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- public void onRestart() {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("onRestart").invoke(mClass);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- public void onStop() {
- if (PACKAGE_AS) {
- try {
- mClass.getMethod("onStop").invoke(mClass);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- private static native void nativeLoadAllPlugins();
-}
diff --git a/native/templates/js-template-link/src/jsb_anysdk.js b/native/templates/js-template-link/src/jsb_anysdk.js
deleted file mode 100644
index 5ab0bbb478..0000000000
--- a/native/templates/js-template-link/src/jsb_anysdk.js
+++ /dev/null
@@ -1,226 +0,0 @@
-anysdk.agentManager = anysdk.AgentManager.getInstance();
-
-anysdk.callWrapper = function(plugin, func){
- plugin[func.name] = (function(){
- var params = [];
- if(arguments){
- var l = arguments.length;
- for (var i = 0; i < l; i++) {
- var arg = arguments[i];
- var param = anysdk.PluginParam.create(arg);
- params.push(param);
- }
- }
-
- if(this.returnType == "void"){
- plugin.callFuncWithParam(this.name, params);
- }else if(this.returnType == "boolean"){
- return plugin.callBoolFuncWithParam(this.name, params);
- }else if(this.returnType == "int"){
- return plugin.callIntFuncWithParam(this.name, params);
- }else if(this.returnType == "float"){
- return plugin.callFloatFuncWithParam(this.name, params);
- }else {
- return plugin.callStringFuncWithParam(this.name, params);
- }
- }).bind(func);
-}
-
-anysdk.parseData = function(data){
- var jsonData = [];
- var substring = data.substring(1, data.length - 2)
- var array = substring.split(",");
- for (var i = 0; i < array.length; i++ ){
- var functionData = array[i].split("&");
- var funcParam = {};
- for(var j = 0; j < functionData.length; j++){
- var itemData = functionData[j].split("=");
- if(itemData.length > 1)
- {
- funcParam[itemData[0]] = itemData[1];
- }
- }
- jsonData.push(funcParam)
-
- }
- return jsonData;
-}
-
-anysdk.registerAPIs = function(plugin) {
- var functionString = anysdk.JSBRelation.getMethodsOfPlugin(plugin);
- var data = anysdk.parseData(functionString);
- for (var i = 0; i < data.length; i++ ){
- var name = data[i].name;
- if(name && !plugin[name]){
- cc.log("plugin: " + name + " auto binding");
- anysdk.callWrapper(plugin, data[i]);
- }
- }
-}
-anysdk.agentManager._loadAllPlugins = anysdk.agentManager.loadAllPlugins;
-anysdk.agentManager.loadAllPlugins = function (callback, target) {
- anysdk.agentManager._loadAllPlugins();
- if(callback){
- if (target){
- callback.call(target, 0, "loadAllPlugins finish");
- }else{
- callback(0, "loadAllPlugins finish");
- }
- }
-}
-
-anysdk.agentManager._getUserPlugin = anysdk.agentManager.getUserPlugin;
-anysdk.agentManager.getUserPlugin = function () {
- var plugin = this._getUserPlugin();
- if (plugin && !plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.isInitialized = true;
- plugin.setListener = function(callback, target){
- var onUserResult = function(plugin, code, msg){
- if (target){
- callback.call(target, code, msg);
- }else{
- callback(code, msg);
- }
- }
- plugin.setActionListener(onUserResult,this);
- };
- }
- return plugin;
-}
-
-anysdk.agentManager._getIAPPlugin = anysdk.agentManager.getIAPPlugin;
-anysdk.agentManager.getIAPPlugins = function () {
- var plugins = this._getIAPPlugin();
- if (plugins) {
- for (var item in plugins){
- if (plugins.hasOwnProperty(item)){
- var plugin = plugins[item];
- if (!plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.setListener = plugin.setResultListener;
- plugin.isInitialized = true;
- }
- }
- };
- };
- return plugins;
-}
-
-anysdk.agentManager.getIAPPlugin = function () {
- var iapPlugins = anysdk.agentManager.getIAPPlugins();
- if(iapPlugins != null){
- for(var item in iapPlugins){
- if (iapPlugins.hasOwnProperty(item)) {
- return iapPlugins[item];
- }
- }
- }
- return null;
-}
-
-
-anysdk.agentManager._getAdsPlugin = anysdk.agentManager.getAdsPlugin;
-anysdk.agentManager.getAdsPlugin = function () {
- var plugin = this._getAdsPlugin();
- if (plugin && !plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.setListener = plugin.setAdsListener;
- plugin.isInitialized = true;
- }
- return plugin;
-}
-
-anysdk.agentManager._getSocialPlugin = anysdk.agentManager.getSocialPlugin;
-anysdk.agentManager.getSocialPlugin = function () {
- var plugin = this._getSocialPlugin();
- if (plugin && !plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.isInitialized = true;
- }
- return plugin;
-}
-
-anysdk.agentManager._getSharePlugin = anysdk.agentManager.getSharePlugin;
-anysdk.agentManager.getSharePlugin = function () {
- var plugin = this._getSharePlugin();
- if (plugin && !plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.setListener = plugin.setResultListener;
- plugin.isInitialized = true;
- }
- return plugin;
-}
-
-anysdk.agentManager._getPushPlugin = anysdk.agentManager.getPushPlugin;
-anysdk.agentManager.getPushPlugin = function () {
- var plugin = this._getPushPlugin();
- if (plugin && !plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.setListener = plugin.setActionListener;
- plugin.isInitialized = true;
- plugin.setListener = function(callback, target){
- var onPushResult = function(plugin, code, msg){
- if (target){
- callback.call(target, code, msg);
- }else{
- callback(code, msg);
- }
- }
- plugin.setActionListener(onPushResult,this);
- };
- }
- return plugin;
-}
-
-anysdk.agentManager._getAnalyticsPlugin = anysdk.agentManager.getAnalyticsPlugin;
-anysdk.agentManager.getAnalyticsPlugin = function () {
- var plugin = this._getAnalyticsPlugin();
- if (plugin && !plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.isInitialized = true;
- }
- return plugin;
-}
-
-anysdk.agentManager._getRECPlugin = anysdk.agentManager.getRECPlugin;
-anysdk.agentManager.getRECPlugin = function () {
- var plugin = this._getRECPlugin();
- if (plugin && !plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.setListener = plugin.setResultListener;
- plugin.isInitialized = true;
- }
- return plugin;
-}
-
-anysdk.agentManager._getCustomPlugin = anysdk.agentManager.getCustomPlugin;
-anysdk.agentManager.getCustomPlugin = function () {
- var plugin = this._getCustomPlugin();
- if (plugin && !plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.setListener = plugin.setResultListener;
- plugin.isInitialized = true;
- }
- return plugin;
-}
-
-anysdk.agentManager._getCrashPlugin = anysdk.agentManager.getCrashPlugin;
-anysdk.agentManager.getCrashPlugin = function () {
- var plugin = this._getCrashPlugin();
- if (plugin && !plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.isInitialized = true;
- }
- return plugin;
-}
-
-anysdk.agentManager._getAdTrackingPlugin = anysdk.agentManager.getAdTrackingPlugin;
-anysdk.agentManager.getAdTrackingPlugin = function () {
- var plugin = this._getAdTrackingPlugin();
- if (plugin && !plugin.isInitialized) {
- anysdk.registerAPIs(plugin);
- plugin.isInitialized = true;
- }
- return plugin;
-}
\ No newline at end of file
diff --git a/native/templates/js-template-link/src/jsb_anysdk_constants.js b/native/templates/js-template-link/src/jsb_anysdk_constants.js
deleted file mode 100644
index b656eed151..0000000000
--- a/native/templates/js-template-link/src/jsb_anysdk_constants.js
+++ /dev/null
@@ -1,403 +0,0 @@
-//for plugin type
-anysdk.PluginType = {
- kPluginAds:16,/**< enum value is the type of Ads. */
- kPluginAnalytics:1,/**< enum value is the type of Analytics. */
- kPluginIAP:8,/**< enum value is the type of IAP. */
- kPluginShare:2,/**< enum value is the type of Share. */
- kPluginUser:32,/**< enum value is the type of User. */
- kPluginSocial:4,/**< enum value is the type of Social. */
- kPluginPush:64,/**< enum value is the type of Push. */
- kPluginCrash:128,/**< enum value is the type of Crash. */
- kPluginCustom:256,/**< enum value is the type of Custom. */
- kPluginREC:512,/**< enum value is the type of REC. */
- kPluginAdTracking:1024/**< enum value is the type of AdTracking. */
-
-}; //plugin type
-
-//for Custom
-anysdk.CustomResultCode = {
- kCustomExtension:80000 /**< enum value is extension code . */
-} ;
-
-anysdk.RECResultCode = {
- kRECInitSuccess:0,/**< enum value is callback of succeeding in initing sdk . */
- kRECInitFail:1,/**< enum value is callback of failing to init sdk. */
- kRECStartRecording:2,/**< enum value is callback of starting to record. */
- kRECStopRecording:3,/**< enum value is callback of stoping to record. */
- kRECPauseRecording:4,/**< enum value is callback of pausing to record. */
- kRECResumeRecording:5,/**< enum value is callback of resuming to record. */
- kRECEnterSDKPage:6,/**< enum value is callback of failing to init sdk. */
- kRECQuitSDKPage:7,/**< enum value is callback of entering SDK`s page. */
- kRECShareSuccess:8,/**< enum value is callback of quiting SDK`s page. */
- kRECShareFail:9,/**< enum value is callback of failing to share. */
- kRECExtension:90000 /**< enum value is extension code . */
-} ;
-
-//for ads
-anysdk.AdsResultCode = {
- kAdsReceived:0, /**< enum the callback: the ad is received is at center. */
- kAdsShown:1, /**< enum the callback: the advertisement dismissed. */
- kAdsDismissed:2, /**< enum the callback: the advertisement dismissed. */
- kPointsSpendSucceed:3, /**< enum the callback: the points spend succeed. */
- kPointsSpendFailed:4, /**< enum the callback: the points spend failed. */
- kNetworkError:5, /**< enum the callback of Network error at center. */
- kUnknownError:6, /**< enum the callback of Unknown error. */
- kOfferWallOnPointsChanged:7, /**< enum the callback of Changing the point of offerwall. */
- kRewardedVideoWithReward:8,/**< enum the callback of receive the reward of rewardedvideo. */
- kInAppPurchaseFinished:9,/**< enum the callback of finishing IAP ad. */
- kAdsClicked:10,/**< enum the callback of the advertisement clicked. */
- kAdsExtension :40000 /**< enum value is extension code . */
-}; //ads result code
-
-anysdk.AdsPos = {
- kPosCenter:0, /**< enum the toolbar is at center. */
- kPosTop:1, /**< enum the toolbar is at top. */
- kPosTopLeft:2, /**< enum the toolbar is at topleft. */
- kPosTopRight:3, /**< enum the toolbar is at topright. */
- kPosBottom:4, /**< enum the toolbar is at bottom. */
- kPosBottomLeft:5, /**< enum the toolbar is at bottomleft. */
- kPosBottomRight:6 /**< enum the toolbar is at bottomright. */
-}; //ads pos
-
-anysdk.AdsType = {
- AD_TYPE_BANNER:0, /**< enum value is banner ads . */
- AD_TYPE_FULLSCREEN:1, /**< enum value is fullscreen ads . */
- AD_TYPE_MOREAPP:2, /**< enum value is moreapp ads . */
- AD_TYPE_OFFERWALL:3, /**< enum value is offerwall ads . */
- AD_TYPE_REWARDEDVIDEO:4,/**< enum value is rewarded video ads . */
- AD_TYPE_NATIVEEXPRESS:5,/**< enum value is Native express ads . */
- AD_TYPE_NATIVEADVANCED:6/**< enum value is Native advanced ads . */
-}; //ads type
-
-//for pay result code
-anysdk.PayResultCode = {
- kPaySuccess:0, /**< enum value is callback of succeeding in paying . */
- kPayFail:1, /**< enum value is callback of failing to pay . */
- kPayCancel:2, /**< enum value is callback of canceling to pay . */
- kPayNetworkError:3, /**< enum value is callback of network error . */
- kPayProductionInforIncomplete:4, /**< enum value is callback of incompleting info . */
- kPayInitSuccess:5, /**< enum value is callback of succeeding in initing sdk . */
- kPayInitFail:6, /**< enum value is callback of failing to init sdk . */
- kPayNowPaying:7, /**< enum value is callback of paying now . */
- kPayRechargeSuccess:8,/**< enum value is callback of succeeding in recharging. */
- kPayExtension : 30000, /**< enum value is extension code . */
- kPayNeedLoginAgain : 31002 /**< enum value is callback of logining again . */
-};
-
-anysdk.RequestResultCode = {
- kRequestSuccess:31000, /**