mirror of https://github.com/axmolengine/axmol.git
issue #2224 : Modify the implementation of plugin alipay & nd91.
This commit is contained in:
parent
9f61f92017
commit
35bc7a51d8
|
@ -1,81 +0,0 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2012-2013 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
#ifndef __CCX_IAP_ALIPAY_H__
|
||||
#define __CCX_IAP_ALIPAY_H__
|
||||
|
||||
#include "ProtocolIAP.h"
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
namespace cocos2d { namespace plugin {
|
||||
|
||||
class IAPAlipay : public ProtocolIAP
|
||||
{
|
||||
PLUGIN_REGISTER_DECL(IAPAlipay)
|
||||
public:
|
||||
/**
|
||||
@brief plugin initialization
|
||||
*/
|
||||
virtual bool init();
|
||||
|
||||
/**
|
||||
@brief config the developer info
|
||||
@param devInfo This parameter is the info of developer, must contains key:
|
||||
AlipayPartner The partner id of alipay account
|
||||
AlipaySeller The seller id of alipay account
|
||||
AlipayRsaPrivate The RSA private key of alipay account
|
||||
AlipayPublic The public key of alipay account
|
||||
AlipayNotifyUrl The notify url of developer (must not be empty)
|
||||
AlipayPluginName The apk file name of Alipay (must not be empty)
|
||||
@warning Must invoke this interface before other interfaces.
|
||||
And invoked only once.
|
||||
*/
|
||||
virtual void configDeveloperInfo(TIAPDeveloperInfo devInfo);
|
||||
|
||||
/**
|
||||
@brief pay for product
|
||||
@param info The info of product, must contains key:
|
||||
productName The name of product
|
||||
productPrice The price of product(must can be parse to float)
|
||||
productDesc The description of product
|
||||
@warning For different plugin, the parameter should have other keys to pay.
|
||||
Look at the manual of plugins.
|
||||
*/
|
||||
virtual void payForProduct(TProductInfo info);
|
||||
|
||||
/**
|
||||
@brief Set whether needs to output logs to console.
|
||||
@param debug if true debug mode enabled, or debug mode disabled.
|
||||
*/
|
||||
virtual void setDebugMode(bool debug);
|
||||
|
||||
virtual const char* getPluginVersion() { return "v0.1.01"; };
|
||||
virtual const char* getSDKVersion();
|
||||
|
||||
virtual ~IAPAlipay();
|
||||
};
|
||||
|
||||
}} // namespace cocos2d { namespace plugin {
|
||||
|
||||
#endif /* __CCX_IAP_ALIPAY_H__ */
|
|
@ -1,60 +0,0 @@
|
|||
[alipay]
|
||||
# the prefix to be added to the generated functions. You might or might not use this in your own
|
||||
# templates
|
||||
prefix = pluginx_alipay
|
||||
|
||||
# create a target namespace (in javascript, this would create some code like the equiv. to `ns = ns || {}`)
|
||||
# all classes will be embedded in that namespace
|
||||
target_namespace = plugin
|
||||
|
||||
android_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include/linux -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.6/include -I%(androidndkdir)s/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/lib/gcc/arm-linux-androideabi/4.6/include
|
||||
android_flags = -D_SIZE_T_DEFINED_
|
||||
|
||||
clang_headers = -I%(clangllvmdir)s/lib/clang/3.1/include
|
||||
clang_flags = -nostdinc -x c++
|
||||
|
||||
cocos_headers = -I%(pluginxdir)s/protocols/include -I%(pluginxdir)s/plugins/alipay/include
|
||||
|
||||
cocos_flags = -DANDROID
|
||||
|
||||
cxxgenerator_headers = -I%(cxxgeneratordir)s/targets/spidermonkey/common
|
||||
|
||||
# extra arguments for clang
|
||||
extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s
|
||||
|
||||
# what headers to parse
|
||||
headers = %(pluginxdir)s/plugins/alipay/include/IAPAlipay.h
|
||||
|
||||
# what classes to produce code for. You can use regular expressions here. When testing the regular
|
||||
# expression, it will be enclosed in "^$", like this: "^CCMenu*$".
|
||||
classes = IAPAlipay
|
||||
|
||||
# what should we skip? in the format ClassName::[function function]
|
||||
# ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also
|
||||
# regular expressions, they will not be surrounded by "^$". If you want to skip a whole class, just
|
||||
# add a single "*" as functions. See bellow for several examples. A special class name is "*", which
|
||||
# will apply to all class names. This is a convenience wildcard to be able to skip similar named
|
||||
# functions from all classes.
|
||||
|
||||
skip = *::[createPlugin]
|
||||
|
||||
rename_functions =
|
||||
|
||||
rename_classes =
|
||||
|
||||
# for all class names, should we remove something when registering in the target VM?
|
||||
remove_prefix =
|
||||
|
||||
# classes for which there will be no "parent" lookup
|
||||
classes_have_no_parents =
|
||||
|
||||
# base classes which will be skipped when their sub-classes found them.
|
||||
base_classes_to_skip =
|
||||
|
||||
# classes that create no constructor
|
||||
# CCSet is special and we will use a hand-written constructor
|
||||
abstract_classes = IAPAlipay
|
||||
|
||||
# Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'.
|
||||
script_control_cpp = yes
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2012-2013 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
#include "IAPAlipay.h"
|
||||
#include "PluginUtils.h"
|
||||
|
||||
namespace cocos2d { namespace plugin {
|
||||
|
||||
PLUGIN_REGISTER_IMPL(IAPAlipay)
|
||||
|
||||
IAPAlipay::~IAPAlipay()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@brief plugin initialization
|
||||
*/
|
||||
bool IAPAlipay::init()
|
||||
{
|
||||
return PluginUtils::initJavaPlugin(this, "org.cocos2dx.plugin.IAPAlipay");
|
||||
}
|
||||
|
||||
/**
|
||||
@brief config the developer info
|
||||
@param devInfo This parameter is the info of developer, must contains key:
|
||||
AlipayPartner The partner id of alipay account
|
||||
AlipaySeller The seller id of alipay account
|
||||
AlipayRsaPrivate The RSA private key of alipay account
|
||||
AlipayPublic The public key of alipay account
|
||||
AlipayNotifyUrl The notify url of developer (must not be empty)
|
||||
AlipayPluginName The apk file name of Alipay (must not be empty)
|
||||
@warning Must invoke this interface before other interfaces.
|
||||
And invoked only once.
|
||||
*/
|
||||
void IAPAlipay::configDeveloperInfo(TIAPDeveloperInfo devInfo)
|
||||
{
|
||||
ProtocolIAP::configDeveloperInfo(devInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
@brief pay for product
|
||||
@param info The info of product, must contains key:
|
||||
productName The name of product
|
||||
productPrice The price of product(must can be parse to float)
|
||||
productDesc The description of product
|
||||
@warning For different plugin, the parameter should have other keys to pay.
|
||||
Look at the manual of plugins.
|
||||
*/
|
||||
void IAPAlipay::payForProduct(TProductInfo info)
|
||||
{
|
||||
ProtocolIAP::payForProduct(info);
|
||||
}
|
||||
|
||||
const char* IAPAlipay::getSDKVersion()
|
||||
{
|
||||
return ProtocolIAP::getSDKVersion();
|
||||
}
|
||||
|
||||
void IAPAlipay::setDebugMode(bool debug)
|
||||
{
|
||||
ProtocolIAP::setDebugMode(debug);
|
||||
}
|
||||
|
||||
}} // namespace cocos2d { namespace plugin {
|
|
@ -30,16 +30,4 @@
|
|||
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
<linkedResources>
|
||||
<link>
|
||||
<name>android</name>
|
||||
<type>2</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/platform/android</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>include</name>
|
||||
<type>2</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/include</locationURI>
|
||||
</link>
|
||||
</linkedResources>
|
||||
</projectDescription>
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
# set params
|
||||
PLUGIN_ANDROID_ROOT=$(cd "$(dirname "$0")"; pwd)
|
||||
|
||||
if [ ! "${PLUGIN_ROOT}" ]; then
|
||||
PLUGIN_ROOT="$PLUGIN_ANDROID_ROOT"/../..
|
||||
fi
|
||||
|
||||
# build
|
||||
"$ANDROID_NDK_ROOT"/ndk-build -C "$PLUGIN_ANDROID_ROOT" \
|
||||
NDK_MODULE_PATH="$PLUGIN_ROOT"
|
||||
|
||||
echo
|
||||
if [ "0" != "$?" ]; then
|
||||
echo "Build error occoured!!!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "Native build action success."
|
||||
exit 0
|
|
@ -1,29 +0,0 @@
|
|||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := PluginAlipayStatic
|
||||
|
||||
LOCAL_MODULE_FILENAME := libPluginAlipayStatic
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(addprefix ../../platform/android/, \
|
||||
IAPAlipay.cpp \
|
||||
) \
|
||||
|
||||
LOCAL_CFLAGS :=
|
||||
|
||||
LOCAL_EXPORT_CFLAGS :=
|
||||
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../include
|
||||
|
||||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include
|
||||
|
||||
LOCAL_WHOLE_STATIC_LIBRARIES := PluginProtocolStatic
|
||||
|
||||
LOCAL_LDLIBS := -landroid
|
||||
LOCAL_LDLIBS += -llog
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
$(call import-module, protocols/proj.android/jni)
|
|
@ -1,7 +0,0 @@
|
|||
# it is needed for ndk-r5
|
||||
APP_STL := gnustl_static
|
||||
APP_CPPFLAGS += -frtti
|
||||
APP_MODULES := PluginAlipayStatic
|
||||
APP_ABI :=armeabi
|
||||
#APP_ABI :=x86
|
||||
#APP_ABI :=mips mips-r2 mips-r2-sf armeabi
|
|
@ -28,8 +28,6 @@ import java.text.SimpleDateFormat;
|
|||
import java.util.Date;
|
||||
import java.util.Hashtable;
|
||||
|
||||
import org.cocos2dx.plugin.InterfaceIAP.IAPAdapter;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
|
@ -41,7 +39,7 @@ import android.os.Message;
|
|||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
|
||||
public class IAPAlipay implements IAPAdapter {
|
||||
public class IAPAlipay implements InterfaceIAP {
|
||||
|
||||
private static final String LOG_TAG = "IAPAlipay";
|
||||
private static Activity mContext = null;
|
||||
|
@ -97,7 +95,7 @@ public class IAPAlipay implements IAPAdapter {
|
|||
public void payForProduct(Hashtable<String, String> info) {
|
||||
LogD("payForProduct invoked " + info.toString());
|
||||
if (! networkReachable()) {
|
||||
payResult(InterfaceIAP.PAYRESULT_FAIL, "网络不可用");
|
||||
payResult(IAPWrapper.PAYRESULT_FAIL, "网络不可用");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -108,7 +106,7 @@ public class IAPAlipay implements IAPAdapter {
|
|||
MobileSecurePayHelper mspHelper = new MobileSecurePayHelper(mContext);
|
||||
boolean bInstalled = mspHelper.detectMobile_sp();
|
||||
if (! bInstalled) {
|
||||
payResult(InterfaceIAP.PAYRESULT_FAIL, "未安装支付宝插件");
|
||||
payResult(IAPWrapper.PAYRESULT_FAIL, "未安装支付宝插件");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -138,12 +136,12 @@ public class IAPAlipay implements IAPAdapter {
|
|||
closeProgress();
|
||||
mProgress = BaseHelper.showProgress(mContext, null, "正在支付", false, true);
|
||||
} else {
|
||||
payResult(InterfaceIAP.PAYRESULT_FAIL, "支付失败");
|
||||
payResult(IAPWrapper.PAYRESULT_FAIL, "支付失败");
|
||||
return;
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
LogE("Remote call failed", ex);
|
||||
payResult(InterfaceIAP.PAYRESULT_FAIL, "remote call failed");
|
||||
payResult(IAPWrapper.PAYRESULT_FAIL, "remote call failed");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -200,21 +198,21 @@ public class IAPAlipay implements IAPAdapter {
|
|||
int retVal = resultChecker.checkSign();
|
||||
// 返回验签结果以及交易状态
|
||||
if (retVal == ResultChecker.RESULT_CHECK_SIGN_FAILED) {
|
||||
payResult(InterfaceIAP.PAYRESULT_FAIL, "签名验证失败");
|
||||
payResult(IAPWrapper.PAYRESULT_FAIL, "签名验证失败");
|
||||
} else if (retVal == ResultChecker.RESULT_CHECK_SIGN_SUCCEED && resultChecker.isPayOk()) {
|
||||
payResult(InterfaceIAP.PAYRESULT_SUCCESS, "支付成功");
|
||||
payResult(IAPWrapper.PAYRESULT_SUCCESS, "支付成功");
|
||||
} else {
|
||||
payResult(InterfaceIAP.PAYRESULT_FAIL, "支付失败");
|
||||
payResult(IAPWrapper.PAYRESULT_FAIL, "支付失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
payResult(InterfaceIAP.PAYRESULT_FAIL, "结果解析失败");
|
||||
payResult(IAPWrapper.PAYRESULT_FAIL, "结果解析失败");
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
mAdapter.closeProgress();
|
||||
payResult(InterfaceIAP.PAYRESULT_FAIL, "支付失败");
|
||||
payResult(IAPWrapper.PAYRESULT_FAIL, "支付失败");
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -335,7 +333,12 @@ public class IAPAlipay implements IAPAdapter {
|
|||
}
|
||||
|
||||
private static void payResult(int ret, String msg) {
|
||||
InterfaceIAP.onPayResult(mAdapter, ret, msg);
|
||||
IAPWrapper.onPayResult(mAdapter, ret, msg);
|
||||
LogD("Alipay result : " + ret + " msg : " + msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginVersion() {
|
||||
return "0.2.0";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,82 +0,0 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2012-2013 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
#ifndef __CCX_IAP_ND91_H__
|
||||
#define __CCX_IAP_ND91_H__
|
||||
|
||||
#include "ProtocolIAP.h"
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
namespace cocos2d { namespace plugin {
|
||||
|
||||
class IAPNd91 : public ProtocolIAP
|
||||
{
|
||||
PLUGIN_REGISTER_DECL(IAPNd91)
|
||||
public:
|
||||
/**
|
||||
@brief plugin initialization
|
||||
*/
|
||||
virtual bool init();
|
||||
|
||||
/**
|
||||
@brief config the developer info
|
||||
@param devInfo This parameter is the info of developer, must contains key:
|
||||
Nd91AppId The app id of nd91
|
||||
Nd91AppKey The app key of nd91
|
||||
Nd91Orientation The orientation of your app(use value : portrait, landscape, auto)
|
||||
default value is portrait
|
||||
@warning Must invoke this interface before other interfaces.
|
||||
And invoked only once.
|
||||
*/
|
||||
virtual void configDeveloperInfo(TIAPDeveloperInfo devInfo);
|
||||
|
||||
/**
|
||||
@brief pay for product
|
||||
@param info The info of product, must contains key:
|
||||
productName The name of product
|
||||
productPrice The price of product(must can be parse to float)
|
||||
productDesc The description of product
|
||||
Nd91ProductId The product id of product for nd91
|
||||
Nd91ProductCount The product number will buy(1--10000, default value 1)
|
||||
Nd91OriginalPrice The original price of product(default value is same with productPrice)
|
||||
@warning For different plugin, the parameter should have other keys to pay.
|
||||
Look at the manual of plugins.
|
||||
*/
|
||||
virtual void payForProduct(TProductInfo info);
|
||||
|
||||
/**
|
||||
@brief Set whether needs to output logs to console.
|
||||
@param debug if true debug mode enabled, or debug mode disabled.
|
||||
*/
|
||||
virtual void setDebugMode(bool debug);
|
||||
|
||||
virtual const char* getPluginVersion() { return "v0.1.01"; };
|
||||
virtual const char* getSDKVersion();
|
||||
|
||||
virtual ~IAPNd91();
|
||||
};
|
||||
|
||||
}} // namespace cocos2d { namespace plugin {
|
||||
|
||||
#endif /* __CCX_IAP_ND91_H__ */
|
|
@ -1,59 +0,0 @@
|
|||
[nd91]
|
||||
# the prefix to be added to the generated functions. You might or might not use this in your own
|
||||
# templates
|
||||
prefix = pluginx_nd91
|
||||
|
||||
# create a target namespace (in javascript, this would create some code like the equiv. to `ns = ns || {}`)
|
||||
# all classes will be embedded in that namespace
|
||||
target_namespace = plugin
|
||||
|
||||
android_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include/linux -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.6/include -I%(androidndkdir)s/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/lib/gcc/arm-linux-androideabi/4.6/include
|
||||
android_flags = -D_SIZE_T_DEFINED_
|
||||
|
||||
clang_headers = -I%(clangllvmdir)s/lib/clang/3.1/include
|
||||
clang_flags = -nostdinc -x c++
|
||||
|
||||
cocos_headers = -I%(pluginxdir)s/protocols/include -I%(pluginxdir)s/plugins/nd91/include
|
||||
|
||||
cocos_flags = -DANDROID
|
||||
|
||||
cxxgenerator_headers = -I%(cxxgeneratordir)s/targets/spidermonkey/common
|
||||
|
||||
# extra arguments for clang
|
||||
extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s
|
||||
|
||||
# what headers to parse
|
||||
headers = %(pluginxdir)s/plugins/nd91/include/IAPNd91.h
|
||||
|
||||
# what classes to produce code for. You can use regular expressions here. When testing the regular
|
||||
# expression, it will be enclosed in "^$", like this: "^CCMenu*$".
|
||||
classes = IAPNd91
|
||||
|
||||
# what should we skip? in the format ClassName::[function function]
|
||||
# ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also
|
||||
# regular expressions, they will not be surrounded by "^$". If you want to skip a whole class, just
|
||||
# add a single "*" as functions. See bellow for several examples. A special class name is "*", which
|
||||
# will apply to all class names. This is a convenience wildcard to be able to skip similar named
|
||||
# functions from all classes.
|
||||
|
||||
skip = *::[createPlugin]
|
||||
|
||||
rename_functions =
|
||||
|
||||
rename_classes =
|
||||
|
||||
# for all class names, should we remove something when registering in the target VM?
|
||||
remove_prefix =
|
||||
|
||||
# classes for which there will be no "parent" lookup
|
||||
classes_have_no_parents =
|
||||
|
||||
# base classes which will be skipped when their sub-classes found them.
|
||||
base_classes_to_skip =
|
||||
|
||||
# classes that create no constructor
|
||||
# CCSet is special and we will use a hand-written constructor
|
||||
abstract_classes = IAPNd91
|
||||
|
||||
# Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'.
|
||||
script_control_cpp = yes
|
|
@ -1,11 +0,0 @@
|
|||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
|
@ -1,85 +0,0 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2012-2013 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
#include "IAPNd91.h"
|
||||
#include "PluginUtils.h"
|
||||
|
||||
namespace cocos2d { namespace plugin {
|
||||
|
||||
PLUGIN_REGISTER_IMPL(IAPNd91)
|
||||
|
||||
IAPNd91::~IAPNd91()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@brief plugin initialization
|
||||
*/
|
||||
bool IAPNd91::init()
|
||||
{
|
||||
return PluginUtils::initJavaPlugin(this, "org.cocos2dx.plugin.IAPNd91");
|
||||
}
|
||||
|
||||
/**
|
||||
@brief config the developer info
|
||||
@param devInfo This parameter is the info of developer, must contains key:
|
||||
Nd91AppId The app id of nd91
|
||||
Nd91AppKey The app key of nd91
|
||||
Nd91Orientation The orientation of your app(use value : portrait, landscape, auto)
|
||||
default value is portrait
|
||||
@warning Must invoke this interface before other interfaces.
|
||||
And invoked only once.
|
||||
*/
|
||||
void IAPNd91::configDeveloperInfo(TIAPDeveloperInfo devInfo)
|
||||
{
|
||||
ProtocolIAP::configDeveloperInfo(devInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
@brief pay for product
|
||||
@param info The info of product, must contains key:
|
||||
productName The name of product
|
||||
productPrice The price of product(must can be parse to float)
|
||||
productDesc The description of product
|
||||
Nd91ProductId The product id of product for nd91
|
||||
Nd91ProductCount The product number will buy(1--10000)
|
||||
Nd91OriginalPrice The original price of product
|
||||
@warning For different plugin, the parameter should have other keys to pay.
|
||||
Look at the manual of plugins.
|
||||
*/
|
||||
void IAPNd91::payForProduct(TProductInfo info)
|
||||
{
|
||||
ProtocolIAP::payForProduct(info);
|
||||
}
|
||||
|
||||
const char* IAPNd91::getSDKVersion()
|
||||
{
|
||||
return ProtocolIAP::getSDKVersion();
|
||||
}
|
||||
|
||||
void IAPNd91::setDebugMode(bool debug)
|
||||
{
|
||||
ProtocolIAP::setDebugMode(debug);
|
||||
}
|
||||
|
||||
}} // namespace cocos2d { namespace plugin {
|
|
@ -30,16 +30,4 @@
|
|||
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
<linkedResources>
|
||||
<link>
|
||||
<name>android</name>
|
||||
<type>2</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/platform/android</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>include</name>
|
||||
<type>2</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/include</locationURI>
|
||||
</link>
|
||||
</linkedResources>
|
||||
</projectDescription>
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue