//
// Created by #Suyghur, on 2021/06/12.
//

#ifndef EYUANGAMESDK_KTX_TOOLKIT_H
#define EYUANGAMESDK_KTX_TOOLKIT_H


#include <jni.h>
#include <string>
#include "third_part/json/json.h"

class ToolKit {
public:
    static jbyteArray GetJByteArray(JNIEnv *env, const char *src);

    static jstring GetJString(JNIEnv *env, const char *src);

    static std::string JString2String(JNIEnv *env, jstring jstr);

    static int String2Int(const std::string &s);

    static std::string GetPackageName(JNIEnv *env, jobject context);

    static std::string GetServerVersion(JNIEnv *env);

    static std::string GetClientVersion(JNIEnv *env);

    static std::string GetVersionName(JNIEnv *env, jobject context);

    static std::string GetVersionCode(JNIEnv *env, jobject context);

    static std::string GetAndroidDeviceId(JNIEnv *env, jobject context);

    static int GetNetworkType(JNIEnv *env, jobject context);

    static std::string GetDeviceManufacturer();

    static std::string GetDeviceModel();

    static std::string GetDeviceSoftwareVersion();

    static std::string GetMobileBrand();

    static bool IsEmulator(JNIEnv *env, jobject context);

    static std::string ToJsonString(const Json::Value &root);

    static Json::Value ToJsonObject(const std::string &json);

    static char *StrReverse(const char *src);

};


#endif //EYUANGAMESDK_KTX_TOOLKIT_H
