Encrypt and decrypt sdkbox_config.json

Precondition

Solution of SDKBox

1. encrypt sdkbox_config.json

# encrypt
sdkbox encrypt -i sdkbox_config.json -o sdkbox_config.json --key your_key

# decrypt
sdkbox decrypt -i sdkbox_config.json -o sdkbox_config.json --key your_key

2. set decrypt key

// AppDelegate.cpp
#include <sdkbox/Sdkbox.h>


sdkbox::init("", "your_key"); // the first argument must set "",
                              // if you don't need remote config
sdkbox::IAP::init();
sdkbox::PluginAdMob::init();

Solution of yours

// AppDelegate.cpp
#include <sdkbox/Sdkbox.h>

std::string content = __decrypt__("your_encrypt_content");
sdkbox::setConfig(content); // the content of 'sdkbox_config.json'
sdkbox::IAP::init();
sdkbox::PluginAdMob::init();

Use Cocos Creator's Solution

Steps:

...
#include "SDKBoxJSHelper.h"
...

bool AppDelegate::applicationDidFinishLaunching()
{
    ...

    jsb_register_all_modules();
    se->addRegisterCallback(register_all_SDKBoxJS_helper);

    ...

    return true;
}

module.exports =
{
    "android": {
        "iap": {
            ...
        }
        ...
    },
    "ios": {
        "iap": {
            ...
        }
        ...
    }
}

const sdkbox_config = require('../SDKBox/sdkbox_config')
...
sdkbox.setConfig(JSON.stringify(sdkbox_config)); // make sure call this before sdkbox pluign init
...
sdkbox.PluginXXX.init();
...