抖音X-Gorgon算法-可测试使用

  • 调用方法
private static Map getXGorgan(String url, String cookie, String userAgent) throws Exception {
        String key = "1YZhQz7KsJ28GdjU";
        String ip = ""; // 测试地址ip
        String signUrl = String.format("http" + "://%s:10199/s/sign?key=%s&url=%s&cookie=%s&userAgent=%s", ip, key,          
        URLEncoder.encode(url, "UTF-8"), URLEncoder.encode(cookie, "UTF-8"), URLEncoder.encode(userAgent, "UTF-8"));
        String body = HttpUtil.createGet(signUrl).timeout(10000).execute().body();
        JSONObject result = JSONUtil.parseObj(body);
        if(result.getInt("code") == 0){
            return (Map)result.getJSONObject("data");
        }else
            return null;
    }
  • 添加依赖
// maven


    cn.hutool
    hutool-all
    5.3.2

// gradle
// https://mvnrepository.com/artifact/cn.hutool/hutool-all
compile group: 'cn.hutool', name: 'hutool-all', version: '5.3.2'
  • 测试有问题可私聊

你可能感兴趣的:(Android,Java,算法解密)