示例#1
0
 private boolean doActionForLoginSand() {
   int retry_times = 10;
   String sand = null;
   for (int i = 0; i < retry_times && sand == null; i++) {
     Map<String, String> header = obtainRequestHeader();
     String sandJsonString = RpcHelper.doInvokeRpc(URL_FOR_LOGIN_SAND, header, null);
     try {
       JSONObject sandJson = new JSONObject(sandJsonString);
       sand = sandJson.getString("loginRand");
     } catch (JSONException e) {
       e.printStackTrace();
       sand = null;
     }
   }
   loginRand = sand;
   return !TextUtils.isEmpty(loginRand);
 }
示例#2
0
 private boolean doActionForLogin() {
   Map<String, String> header = obtainRequestHeader();
   String content = RpcHelper.doInvokeRpcByPost(URL_FOR_REAL_LOGIN, header, getParamList());
   if (TextUtils.isEmpty(content)) {
     return false;
   }
   if (content.contains(FLAG_CONTENT_SUCCESS)) {
     mShowName = parseShowName(content);
     mShowGender = parseGender(content);
     mRespons.msg = "登陆成功";
     return true;
   } else if (content.contains(FLAG_CONTENT_MAINTAIN)) {
     Log.d(TAG, FLAG_CONTENT_MAINTAIN);
     mRespons.msg = "系统维护中,维护时间为23:00-07:00。";
     return true;
   }
   return false;
 }
示例#3
0
 public String initLogin() {
   return RpcHelper.doInvokeRpc(
       "https://dynamic.12306.cn/otsweb/loginAction.do?method=init", null, null);
 }