tool_kit.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef YYXXCOMMSDK_TOOL_KIT_H
  2. #define YYXXCOMMSDK_TOOL_KIT_H
  3. #include <jni.h>
  4. #include <string>
  5. #include "external/json/json.h"
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. class ToolKit{
  10. public:
  11. static jbyteArray GetJbyteArray(JNIEnv *Env, const char *src);
  12. static jstring GetJString(JNIEnv *env, const char *src);
  13. static std::string JString2String(JNIEnv *env, jstring src);
  14. static std::string GetGameCode(JNIEnv *env,jobject context);
  15. static std::string GetSpCode(JNIEnv *env, jobject context);
  16. static std::string GetClientVersion(JNIEnv *env, jobject context);
  17. static std::string GetPackageName(JNIEnv *env, jobject context);
  18. static std::string GetDeviceSoftwareVersion();
  19. static std::string GetDeviceModel();
  20. static std::string GetAndroidDeviceId(JNIEnv *env, jobject context);
  21. static jstring RsaEncrypt(JNIEnv *env,const char *data);
  22. static std::string ToJsonString(const Json::Value &root);
  23. static Json::Value ToJsonObject(const std::string &json);
  24. static std::string GetJsonSortSignature(const Json::Value &root);
  25. static std::string GenerateRandString(int len);
  26. };
  27. #ifdef __cplusplus
  28. }
  29. #endif
  30. #endif