comm_map.cpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //
  2. // Created by #Suyghur, on 2021/06/21.
  3. //
  4. #include <params_kit.h>
  5. #include <toolkit.h>
  6. #include "include/comm_map.h"
  7. CommMap::CommMap() = default;
  8. CommMap::~CommMap() = default;
  9. CommMap *CommMap::GetInstance() {
  10. static CommMap instance;
  11. return &instance;
  12. }
  13. void CommMap::Init(JNIEnv *env, jobject context) {
  14. //biz
  15. comm_params["gcp_code"] = ParamsKit::GetGcpCode(env, context);
  16. comm_params["game_code"] = ParamsKit::GetGameCode(env, context);
  17. comm_params["game_name"] = ToolKit::GetAppName(env, context);
  18. comm_params["package_name"] = ToolKit::GetPackageName(env, context);
  19. //vers
  20. comm_params["server_version"] = ToolKit::GetServerVersion(env);
  21. comm_params["client_version"] = ToolKit::GetClientVersion(env);
  22. comm_params["game_version"] = ToolKit::GetVersionName(env, context);
  23. //device
  24. if (ToolKit::IsEmulator(env, context)) {
  25. comm_params["simulator"] = 1;
  26. } else {
  27. comm_params["simulator"] = 0;
  28. }
  29. comm_params["aid"] = "";
  30. comm_params["android_id"] = ToolKit::GetAndroidDeviceId(env, context);
  31. comm_params["network"] = ToolKit::GetNetworkType(env, context);
  32. comm_params["os"] = 1;
  33. comm_params["os_version"] = ToolKit::GetDeviceSoftwareVersion();
  34. comm_params["mobile_model"] = ToolKit::GetDeviceModel();
  35. comm_params["mobile_mfrs"] = ToolKit::GetDeviceManufacturer();
  36. comm_params["mobile_brand"] = ToolKit::GetMobileBrand();
  37. }