Package com.belerweb.social.qq.mail.bean

Examples of com.belerweb.social.qq.mail.bean.ValidationCode


    request.addHeader(new BasicHeader("Accept-Language", "zh-cn,zh"));
    HttpResponse response = http.execute(request);
    if (!Http.isRequestSuccess(response)) {
      throw new SocialException("Step 4, check if validation code failed.");
    }
    return new ValidationCode(Http.responseToString(response));
  }
View Full Code Here


    return IOUtils.toByteArray(response.getEntity().getContent());
  }

  private void login() throws ClientProtocolException, IOException, DecoderException, HttpException {
    openLogin();
    ValidationCode validationCode = loginCheck();
    String code = validationCode.getCode();
    if (validationCode.need()) {
      LOGGER.debug("Qzone visitor need validation code.");
      code = yundama.decode(getValidationCode(), YundamaType.ALPHANUMERIC).getResult();
      LOGGER.debug("Qzone visitor validation code is {}.", code);
    }

    String p = DigestUtils.md5Hex(password).toUpperCase();
    byte[] byte1 = Hex.decodeHex(p.toCharArray());
    byte[] byte2 = Hex.decodeHex(validationCode.getUid().toCharArray());
    byte[] bytes = new byte[byte1.length + byte2.length];
    System.arraycopy(byte1, 0, bytes, 0, byte1.length);
    System.arraycopy(byte2, 0, bytes, byte1.length, byte2.length);
    p = DigestUtils.md5Hex(bytes).toUpperCase();
    p = DigestUtils.md5Hex(p + code.toUpperCase()).toUpperCase();
View Full Code Here

  /**
   * QQ邮箱登录,如果登录成功则返回sid,登录失败抛出异常
   */
  public String login() throws SocialException {
    ValidationCode validationCode = check();
    String vc = validationCode.getCode();
    if (validationCode.need()) {
      vc = yundama.decode(getValidationCode(), YundamaType.ALPHABETIC4).getResult();
    }

    try {
      String code = DigestUtils.md5Hex(password).toUpperCase();
      byte[] byte1 = Hex.decodeHex(code.toCharArray());
      byte[] byte2 = Hex.decodeHex(validationCode.getUid().toCharArray());
      byte[] bytes = new byte[byte1.length + byte2.length];
      System.arraycopy(byte1, 0, bytes, 0, byte1.length);
      System.arraycopy(byte2, 0, bytes, byte1.length, byte2.length);
      code = DigestUtils.md5Hex(bytes).toUpperCase();
      code = DigestUtils.md5Hex(code + vc.toUpperCase()).toUpperCase();
View Full Code Here

          || response.getEntity() == null) {
        throw new SocialException(String.valueOf(statusLine));
      }
      String result = IOUtils.toString(response.getEntity().getContent());
      request.releaseConnection();
      return new ValidationCode(result);
    } catch (ClientProtocolException e) {
      throw new SocialException(e);
    } catch (IOException e) {
      throw new SocialException(e);
    }
View Full Code Here

    request.addHeader(new BasicHeader("Accept-Language", "zh-cn,zh"));
    HttpResponse response = http.execute(request);
    if (!Http.isRequestSuccess(response)) {
      throw new SocialException("Step 4, check if validation code failed.");
    }
    return new ValidationCode(Http.responseToString(response));
  }
View Full Code Here

    return IOUtils.toByteArray(response.getEntity().getContent());
  }

  private void login() throws ClientProtocolException, IOException, DecoderException, HttpException {
    openLogin();
    ValidationCode validationCode = loginCheck();
    String code = validationCode.getCode();
    if (validationCode.need()) {
      code = yundama.decode(getValidationCode(), YundamaType.ALPHANUMERIC).getResult();
    }

    String p = DigestUtils.md5Hex(password).toUpperCase();
    byte[] byte1 = Hex.decodeHex(p.toCharArray());
    byte[] byte2 = Hex.decodeHex(validationCode.getUid().toCharArray());
    byte[] bytes = new byte[byte1.length + byte2.length];
    System.arraycopy(byte1, 0, bytes, 0, byte1.length);
    System.arraycopy(byte2, 0, bytes, byte1.length, byte2.length);
    p = DigestUtils.md5Hex(bytes).toUpperCase();
    p = DigestUtils.md5Hex(p + code.toUpperCase()).toUpperCase();
View Full Code Here

TOP

Related Classes of com.belerweb.social.qq.mail.bean.ValidationCode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.