| | |
| | | public class H2EngineSDK |
| | | { |
| | | private static final String TAG = "H2EngineSDK"; |
| | | private static String APP_ID = ""; |
| | | |
| | | private static boolean PushEnable = true; |
| | | |
| | |
| | | switch (_code) |
| | | { |
| | | case CodeU2A.Init: |
| | | APP_ID = _json.getString("appID"); |
| | | init(_activity); |
| | | break; |
| | | case CodeU2A.CopyOneAsset: |
| | |
| | | case CodeU2A.FreePlatformPay: |
| | | |
| | | JSONObject _extraData = new JSONObject(); |
| | | _extraData.put("appid", APP_ID); |
| | | String _yjAppID = UniversalUtil.getMetaString(_activity, "yj_appid"); |
| | | _extraData.put("appid", _yjAppID); |
| | | _extraData.put("cpinfo", _json.getString("cpInfo")); |
| | | _extraData.put("cporderid", _json.getString("orderId")); |
| | | try |
| | | { |
| | | // YJPlatformUtil.getInstance().payExtend(_activity, |
| | | // _json.getString("title"), |
| | | // _json.getString("cpInfo"), |
| | | // (float) _json.getDouble("mount"), |
| | | // URLEncoder.encode(_extraData.toString(), |
| | | // "utf-8")); |
| | | if(_yjAppID.contains("mzgame")) |
| | | { |
| | | YJPlatformUtil.getInstance().pay(_activity, |
| | | _json.getString("title"), |
| | | _json.getString("cpInfo"), |
| | | (float) _json.getDouble("mount"), |
| | | URLEncoder.encode(_extraData.toString(), |
| | | "utf-8")); |
| | | }else{ |
| | | YJPlatformUtil.getInstance().charge(_activity, |
| | | _json.getString("title"), |
| | | (float) _json.getDouble("mount"), |
| | | URLEncoder.encode(_extraData.toString(), |
| | | "utf-8")); |
| | | } |
| | | |
| | | YJPlatformUtil.getInstance().pay(_activity, |
| | | _json.getString("title"), |
| | | _json.getString("cpInfo"), |
| | | (float) _json.getDouble("mount"), |
| | | URLEncoder.encode( _extraData.toString(),"utf-8")); |
| | | }catch (UnsupportedEncodingException e) |
| | | } catch (UnsupportedEncodingException e) |
| | | { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | _json.getString("sid"), |
| | | _json.getString("serverName"), |
| | | _json.getString("roleID"), |
| | | _json.getString( |
| | | "roleName").trim().replace(" ", |
| | | ""), |
| | | _json.getString("roleName").trim() |
| | | .replace(" ", ""), |
| | | _json.getString("level"), |
| | | _json.getString( |
| | | "familyName").trim().replace( |
| | | " ", ""), |
| | | _json.getString("familyName").trim() |
| | | .replace(" ", ""), |
| | | _json.getString("createTime"), |
| | | _json.getString("levelUpTime"), |
| | | _json.getString("vipLevel"), |
| | | _json.getString("money")); |
| | | break; |
| | |
| | | _json.getString("sid"), |
| | | _json.getString("serverName"), |
| | | _json.getString("roleID"), |
| | | _json.getString( |
| | | "roleName").trim().replace(" ", |
| | | ""), |
| | | _json.getString("roleName").trim() |
| | | .replace(" ", ""), |
| | | _json.getString("level"), |
| | | _json.getString( |
| | | "familyName").trim().replace( |
| | | " ", ""), |
| | | _json.getString("createTime"), |
| | | _json.getString("levelUpTime"), |
| | | _json.getString("familyName").trim() |
| | | .replace(" ", ""), |
| | | _json.getString("vipLevel"), |
| | | _json.getString("money")); |
| | | break; |
| | |
| | | _json.getString("sid"), |
| | | _json.getString("serverName"), |
| | | _json.getString("roleID"), |
| | | _json.getString("roleName").trim().replace( |
| | | " ", ""), |
| | | _json.getString("roleName").trim() |
| | | .replace(" ", ""), |
| | | _json.getString("level"), |
| | | _json.getString( |
| | | "familyName").trim().replace(" ", |
| | | ""), |
| | | _json.getString("familyName").trim() |
| | | .replace(" ", ""), |
| | | _json.getString("createTime"), |
| | | _json.getString("levelUpTime"), |
| | | _json.getString("vipLevel"), |
| | |
| | | _msgStruct.clear(); |
| | | _msgStruct.put("code", CodeA2U.SdkInitComplete); |
| | | _msgStruct.put("channelPlatform", "yj"); |
| | | _msgStruct.put("yj_appid", UniversalUtil.getMetaString(activity,"yj_appid")); |
| | | _msgStruct.put("yj_spid", UniversalUtil.getMetaString(activity,"yj_spid")); |
| | | _msgStruct.put("yj_appid", UniversalUtil.getMetaString(activity, "yj_appid")); |
| | | _msgStruct.put("yj_spid", UniversalUtil.getMetaString(activity, "yj_spid")); |
| | | _msgStruct.put("yj_branch", UniversalUtil.getMetaInt(activity, "yj_branch")); |
| | | UniversalUtil.sendMessageToUnity(_msgStruct); |
| | | |
| | | LogUtil.i(TAG, "初始化执行完毕"); |