增加generate_clientid

This commit is contained in:
CounterFire2023 2023-08-17 16:55:01 +08:00
parent 18b5d82244
commit ef730baa16
2 changed files with 24 additions and 13 deletions

View File

@ -1447,6 +1447,15 @@ std::string decrypt_aes(std::string &content, std::string &key)
{
return aes_decrypt(content.c_str(), key.c_str());
}
std::string generate_clientid(std::string &msg)
{
std::string pk = "02aaaafbd375639879d6a694893dd14413662d90c59abaceb6cc4c791aa0834352";
// attach client id to msg
std::string msg_str = msg;
msg_str += "_clientid";
std::string str_encrypt = rencrypt(pk.c_str(), msg_str.c_str());
return str_encrypt;
}
bool jsb_register_global_variables(se::Object *global)
{

View File

@ -27,27 +27,29 @@
#include <string>
namespace se {
namespace se
{
class Object;
class Class;
class Value;
}
extern se::Object* __jsbObj;
extern se::Object* __glObj;
extern se::Object *__jsbObj;
extern se::Object *__glObj;
bool jsb_register_global_variables(se::Object* global);
bool jsb_register_global_variables(se::Object *global);
void jsb_init_file_operation_delegate();
bool jsb_enable_debugger(const std::string& debuggerServerAddr, uint32_t port, bool isWaitForConnect = false);
bool jsb_set_extend_property(const char* ns, const char* clsName);
bool jsb_run_script(const std::string& filePath, se::Value* rval = nullptr);
bool jsb_run_code(const std::string& coder, se::Value* rval = nullptr);
bool jsb_run_script_module(const std::string& filePath, se::Value* rval = nullptr);
bool jsb_enable_debugger(const std::string &debuggerServerAddr, uint32_t port, bool isWaitForConnect = false);
bool jsb_set_extend_property(const char *ns, const char *clsName);
bool jsb_run_script(const std::string &filePath, se::Value *rval = nullptr);
bool jsb_run_code(const std::string &coder, se::Value *rval = nullptr);
bool jsb_run_script_module(const std::string &filePath, se::Value *rval = nullptr);
void jsb_set_xxtea_key(const std::string& key);
void jsb_set_xxtea_key(const std::string &key);
bool jsb_global_load_image(const std::string& path, const se::Value& callbackVal);
bool jsb_global_load_image(const std::string &path, const se::Value &callbackVal);
std::string encrypt_aes(std::string& content, std::string& key);
std::string decrypt_aes(std::string& content, std::string& key);
std::string encrypt_aes(std::string &content, std::string &key);
std::string decrypt_aes(std::string &content, std::string &key);
std::string generate_clientid(std::string &content);