|
@@ -4,6 +4,7 @@ import android.app.Activity;
|
|
|
|
|
|
import android.os.Message;
|
|
|
|
|
|
+import android.util.Log;
|
|
|
import android.widget.Toast;
|
|
|
|
|
|
|
|
@@ -66,6 +67,7 @@ import static com.yyrh.constant.URLConstants.REALNAMERECORD;
|
|
|
import static com.yyrh.constant.URLConstants.RECHARGEINT;
|
|
|
import static com.yyrh.constant.URLConstants.REGISTERWITHPHONE;
|
|
|
import static com.yyrh.constant.URLConstants.RESETPWDWITHPHONE;
|
|
|
+import static com.yyrh.constant.URLConstants.RNUSERACTION;
|
|
|
import static com.yyrh.constant.URLConstants.RSAKEY;
|
|
|
import static com.yyrh.constant.URLConstants.UPLOADROLEINFO;
|
|
|
import static com.yyrh.constant.URLConstants.USERLOGIN;
|
|
@@ -76,7 +78,7 @@ public class NetRequestApi {
|
|
|
|
|
|
|
|
|
|
|
|
- HashMap<String, String> map = getCommonParams();
|
|
|
+ HashMap<String, String> map = getCommonParams(true);
|
|
|
|
|
|
String time = SignUtils.toURLEncoded(System.currentTimeMillis() / 1000 + "");
|
|
|
String paramSign = SignUtils.paramSign(map, time);
|
|
@@ -102,7 +104,7 @@ public class NetRequestApi {
|
|
|
|
|
|
@Override
|
|
|
public void onResponse(String response) {
|
|
|
-
|
|
|
+ YYLog.i(response);
|
|
|
try {
|
|
|
JSONObject json = new JSONObject(response);
|
|
|
int code = json.optInt("code", -1);
|
|
@@ -148,7 +150,7 @@ public class NetRequestApi {
|
|
|
public static void loginWithYy(boolean isShowPrg, final Activity activity, String account, String password,String login_token, final LoginCallback loginCallback) {
|
|
|
|
|
|
|
|
|
- HashMap<String, String> map = getCommonParams();
|
|
|
+ HashMap<String, String> map = getCommonParams(false);
|
|
|
|
|
|
|
|
|
map.put("smt_type", SignUtils.toURLEncoded(SDKSettings.isSimulator));
|
|
@@ -211,7 +213,7 @@ public class NetRequestApi {
|
|
|
|
|
|
SDKSettings.LOGINTAG = LOGIN;
|
|
|
|
|
|
- if (loginData.is_rn == 0) {
|
|
|
+ if (Utils.judgeStrNull(loginData.authentication)) {
|
|
|
SDKSettings.isVefityRealName = false;
|
|
|
} else {
|
|
|
SDKSettings.isVefityRealName = true;
|
|
@@ -232,7 +234,7 @@ public class NetRequestApi {
|
|
|
|
|
|
ProgressDialogUtils.show(activity, activity.getString(ResourceUtil.getStringId(activity, "hnyy_registering")));
|
|
|
|
|
|
- HashMap<String, String> map = getCommonParams();
|
|
|
+ HashMap<String, String> map = getCommonParams(false);
|
|
|
|
|
|
|
|
|
map.put("smt_type", SignUtils.toURLEncoded(SDKSettings.isSimulator));
|
|
@@ -255,8 +257,6 @@ public class NetRequestApi {
|
|
|
map.put("sign", paramSign);
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
UrlHttpUtil.post(activity,FASTREGISTER, map, new CallBackUtil.CallBackString() {
|
|
|
@Override
|
|
|
public void onFailure(int code, String errorMessage) {
|
|
@@ -284,8 +284,7 @@ public class NetRequestApi {
|
|
|
}
|
|
|
|
|
|
SDKSettings.loginData = LoginData.toBean(data);
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -299,7 +298,7 @@ public class NetRequestApi {
|
|
|
|
|
|
public static void loginWithChannel(final Activity activity, String channelLoginInfo, final LoginCallback loginCallback) {
|
|
|
|
|
|
- HashMap<String, String> map = getCommonParams();
|
|
|
+ HashMap<String, String> map = getCommonParams(false);
|
|
|
|
|
|
|
|
|
map.put("sdk_params", channelLoginInfo);
|
|
@@ -368,7 +367,7 @@ public class NetRequestApi {
|
|
|
String roleId, String roleName, String roleLevel, String serverId,
|
|
|
String serverName, String hasGold, String vipLevel, String role_power, String partyId, String partyName, String createTime, String charge) {
|
|
|
|
|
|
- HashMap<String, String> map = getCommonParams();
|
|
|
+ HashMap<String, String> map = getCommonParams(false);
|
|
|
|
|
|
|
|
|
if (type.equals(Constants.UPLOADTYPE_CREATEROLE)) {
|
|
@@ -417,7 +416,7 @@ public class NetRequestApi {
|
|
|
|
|
|
|
|
|
|
|
|
- UrlHttpUtil.post(activity,UPLOADROLEINFO, map, new CallBackUtil.CallBackString() {
|
|
|
+ UrlHttpUtil.post(UPLOADROLEINFO, map, new CallBackUtil.CallBackString() {
|
|
|
@Override
|
|
|
public void onFailure(int code, String errorMessage) {
|
|
|
|
|
@@ -493,7 +492,7 @@ public class NetRequestApi {
|
|
|
}
|
|
|
|
|
|
|
|
|
- HashMap<String, String> orderMap = getCommonParams();
|
|
|
+ HashMap<String, String> orderMap = getCommonParams(false);
|
|
|
|
|
|
|
|
|
orderMap.put("uname", loginData.uname);
|
|
@@ -588,7 +587,7 @@ public class NetRequestApi {
|
|
|
|
|
|
ProgressDialogUtils.show(activity, activity.getString(ResourceUtil.getStringId(activity, "hnyy_get_code")));
|
|
|
|
|
|
- HashMap<String, String> map = getCommonParams();
|
|
|
+ HashMap<String, String> map = getCommonParams(false);
|
|
|
|
|
|
|
|
|
map.put("phone", SignUtils.toURLEncoded(phone));
|
|
@@ -645,7 +644,7 @@ public class NetRequestApi {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- HashMap<String, String> map = getCommonParams();
|
|
|
+ HashMap<String, String> map = getCommonParams(false);
|
|
|
|
|
|
|
|
|
|
|
@@ -706,7 +705,7 @@ public class NetRequestApi {
|
|
|
|
|
|
public static void registerWithPhone(final Activity activity, String code, String userInfo, final UserPhoneLoginSetpwdFragment.PhoneRegisterCallback phoneRegisterCallback) {
|
|
|
|
|
|
- HashMap<String, String> map = getCommonParams();
|
|
|
+ HashMap<String, String> map = getCommonParams(false);
|
|
|
|
|
|
|
|
|
map.put("uname_pwd", userInfo);
|
|
@@ -785,7 +784,7 @@ public class NetRequestApi {
|
|
|
public static void resetPwdWithPhone(Activity activity, String phone, String code, String pwd, final UserRetrievePwdFragment.ResetPwdCallback resetPwdCallback) {
|
|
|
|
|
|
|
|
|
- HashMap<String, String> map = getCommonParams();
|
|
|
+ HashMap<String, String> map = getCommonParams(false);
|
|
|
|
|
|
|
|
|
String uname_pwd = null;
|
|
@@ -844,130 +843,12 @@ public class NetRequestApi {
|
|
|
|
|
|
}
|
|
|
|
|
|
- public static void upLoadUserRealNameInfo(String report_type, String channelRealNameInfo) {
|
|
|
- HashMap<String, String> map = getCommonParams();
|
|
|
-
|
|
|
-
|
|
|
- map.put("channel_uid", SignUtils.toURLEncoded(loginData.channel_uid));
|
|
|
- map.put("uname", SignUtils.toURLEncoded(loginData.uname));
|
|
|
- map.put("report_type", report_type);
|
|
|
- map.put("sdk_params", channelRealNameInfo);
|
|
|
-
|
|
|
-
|
|
|
- String time = SignUtils.toURLEncoded(System.currentTimeMillis() / 1000 + "");
|
|
|
- String paramSign = SignUtils.paramSign(map, time);
|
|
|
- map.put("time", time);
|
|
|
- map.put("sign", paramSign);
|
|
|
-
|
|
|
-
|
|
|
- UrlHttpUtil.post(REALNAMERECORD, map, new CallBackUtil.CallBackString() {
|
|
|
- @Override
|
|
|
- public void onFailure(int code, String errorMessage) {
|
|
|
-
|
|
|
-
|
|
|
- YYLog.i(errorMessage);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onResponse(String response) {
|
|
|
-
|
|
|
-
|
|
|
- ProgressDialogUtils.dismiss();
|
|
|
-
|
|
|
- JSONObject json = null;
|
|
|
-
|
|
|
- try {
|
|
|
- json = new JSONObject(response);
|
|
|
-
|
|
|
- } catch (JSONException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- int code = json.optInt("code", -1);
|
|
|
-
|
|
|
- if (code == 1) {
|
|
|
- String rn_bd = "";
|
|
|
- try {
|
|
|
- JSONObject data = json.getJSONObject("data");
|
|
|
- rn_bd = data.optString("rn_bd", "");
|
|
|
- } catch (JSONException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- loginData.rn_bd = rn_bd;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- public static void recordUserRealNameInfo(Activity activity, String report_type, String channelRealNameInfo) {
|
|
|
-
|
|
|
- HashMap<String, String> map = getCommonParams();
|
|
|
|
|
|
|
|
|
- map.put("channel_uid", SignUtils.toURLEncoded(loginData.channel_uid));
|
|
|
- map.put("uname", SignUtils.toURLEncoded(loginData.uname));
|
|
|
- map.put("report_type", report_type);
|
|
|
- map.put("sdk_params", channelRealNameInfo);
|
|
|
|
|
|
|
|
|
- String time = SignUtils.toURLEncoded(System.currentTimeMillis() / 1000 + "");
|
|
|
- String paramSign = SignUtils.paramSign(map, time);
|
|
|
- map.put("time", time);
|
|
|
- map.put("sign", paramSign);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- UrlHttpUtil.post(REALNAMERECORD, map, new CallBackUtil.CallBackString() {
|
|
|
- @Override
|
|
|
- public void onFailure(int code, String errorMessage) {
|
|
|
- ProgressDialogUtils.dismiss();
|
|
|
-
|
|
|
-
|
|
|
- YYLog.i(errorMessage);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onResponse(String response) {
|
|
|
-
|
|
|
-
|
|
|
- ProgressDialogUtils.dismiss();
|
|
|
-
|
|
|
- JSONObject json = null;
|
|
|
- String msg = "";
|
|
|
- try {
|
|
|
- json = new JSONObject(response);
|
|
|
- msg = json.optString("msg");
|
|
|
- } catch (JSONException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- int code = json.optInt("code", -1);
|
|
|
- if (code != 1) {
|
|
|
-
|
|
|
- SDKEntry.getSdkInstance().sdkCallback.realNameMsgCallback(false, "");
|
|
|
- } else {
|
|
|
- String rn_bd = "";
|
|
|
- try {
|
|
|
- JSONObject data = json.getJSONObject("data");
|
|
|
- rn_bd = data.optString("rn_bd", "");
|
|
|
- } catch (JSONException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- loginData.rn_bd = rn_bd;
|
|
|
- SDKEntry.getSdkInstance().sdkCallback.realNameMsgCallback(true, rn_bd);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
public static void queryOrder(String order_id, final HashMap<String, Object> payMap) {
|
|
|
- HashMap<String, String> map = getCommonParams();
|
|
|
+ HashMap<String, String> map = getCommonParams(false);
|
|
|
|
|
|
|
|
|
String query_params = (String) payMap.get("query_params");
|
|
@@ -1088,29 +969,65 @@ public class NetRequestApi {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- private static HashMap<String, String> getCommonParams() {
|
|
|
- HashMap<String, String> map = new HashMap();
|
|
|
+ public static void rnUserAction(String action){
|
|
|
+
|
|
|
+ if (Utils.judgeStrNull(SDKSettings.loginData.rn_si)){
|
|
|
+ YYLog.i(" rn_si is null");
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- map.put("game_code", SignUtils.toURLEncoded(SDKSettings.game_code));
|
|
|
- map.put("gcp_code", SignUtils.toURLEncoded(SDKSettings.gcp_code));
|
|
|
- map.put("cs_ver", SignUtils.toURLEncoded(SDKSettings.SDK_VERSION));
|
|
|
- map.put("system", SignUtils.toURLEncoded(SDKSettings.system));
|
|
|
- map.put("ifa", SignUtils.toURLEncoded(SDKSettings.imei));
|
|
|
- map.put("device_ver", SignUtils.toURLEncoded(SDKSettings.version));
|
|
|
- map.put("sp_code", SignUtils.toURLEncoded(SDKSettings.sp_code));
|
|
|
+ HashMap<String, String> map = getCommonParams(false);
|
|
|
+ map.put("si", loginData.rn_si);
|
|
|
+ map.put("bt",action);
|
|
|
+ map.put("uname", loginData.uname);
|
|
|
|
|
|
- map.put("device_model", SignUtils.toURLEncoded(SDKSettings.device_model));
|
|
|
- map.put("package_name", SDKSettings.package_name);
|
|
|
- map.put("ifa_type", SDKSettings.ifa_type);
|
|
|
- map.put("android_id", SDKSettings.android_id);
|
|
|
-
|
|
|
- if (!Utils.judgeStrNull(SDKSettings.o_cfg)) {
|
|
|
- map.put("o_cfg", SDKSettings.o_cfg);
|
|
|
- YYLog.i("o_cfg : " + SDKSettings.o_cfg);
|
|
|
- } else {
|
|
|
- YYLog.i("o_cfg is null");
|
|
|
+ String time = SignUtils.toURLEncoded(System.currentTimeMillis() / 1000 + "");
|
|
|
+ String paramSign = SignUtils.paramSign(map, time);
|
|
|
+ map.put("time", time);
|
|
|
+ map.put("sign", paramSign);
|
|
|
+
|
|
|
+
|
|
|
+ UrlHttpUtil.post(RNUSERACTION, map, new CallBackUtil.CallBackString() {
|
|
|
+ @Override
|
|
|
+ public void onFailure(int code, String errorMessage) {
|
|
|
+ YYLog.i(errorMessage);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onResponse(String response) {
|
|
|
+ YYLog.i(response);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+ private static HashMap<String, String> getCommonParams(boolean isInitApi) {
|
|
|
+ HashMap<String, String> map = new HashMap();
|
|
|
+ if (isInitApi){
|
|
|
+ map.put("game_code", SignUtils.toURLEncoded(SDKSettings.game_code));
|
|
|
+ map.put("gcp_code", SignUtils.toURLEncoded(SDKSettings.gcp_code));
|
|
|
+ map.put("cs_ver", SignUtils.toURLEncoded(SDKSettings.SDK_VERSION));
|
|
|
+ map.put("system", SignUtils.toURLEncoded(SDKSettings.system));
|
|
|
+ map.put("ifa", SignUtils.toURLEncoded(SDKSettings.imei));
|
|
|
+ map.put("device_ver", SignUtils.toURLEncoded(SDKSettings.version));
|
|
|
+ map.put("sp_code", SignUtils.toURLEncoded(SDKSettings.sp_code));
|
|
|
+
|
|
|
+ map.put("device_model", SignUtils.toURLEncoded(SDKSettings.device_model));
|
|
|
+ map.put("package_name", SDKSettings.package_name);
|
|
|
+ map.put("ifa_type", SDKSettings.ifa_type);
|
|
|
+ map.put("android_id", SDKSettings.android_id);
|
|
|
+ if (!Utils.judgeStrNull(SDKSettings.o_cfg)) {
|
|
|
+ map.put("o_cfg", SDKSettings.o_cfg);
|
|
|
+ YYLog.i("o_cfg : " + SDKSettings.o_cfg);
|
|
|
+ } else {
|
|
|
+ YYLog.i("o_cfg is null");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ map.put("access_token", SDKSettings.initConfig.access_token);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
return map;
|
|
|
}
|
|
|
|