找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 文档 工具 设计
查看: 151|回复: 0

羊了个羊 9.21 最新Java通过代码

[复制链接]

2万

主题

1249

回帖

2万

积分

超级版主

教育辅助界扛把子

附加身份标识
精华
1
热心
7
听众
1
威望
48
贡献
14309
违规
0
书币
49983
注册时间
2020-4-8

论坛元老灌水之王

发表于 2022-9-29 00:30 | 显示全部楼层 |阅读模式
java代码,测过可以无限刷通关


[Java] 纯文本查看 复制代码
import cn.hutool.core.codec.Base64;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
 
import java.io.*;
import java.net.URL;
import java.net.URLConnection;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
 
public class YLYUHttp {
 
    static ExecutorService threadPool= Executors.newFixedThreadPool(10);
 
    static String loginOppoURL = "https://cat-match.easygame2021.com/sheep/v1/user/login_oppo" ;
    static String matchTypeURL = "https://cat-match.easygame2021.com/sheep/v1/game/map_info_ex?matchType=3" ;
 
    static String t = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2OTQ3ODI5NjIsIm5iZiI6MTY2MzY4MDc2MiwiaWF0IjoxNjYzNjc4OTYyLCJqdGkiOiJDTTpjYXRfbWF0Y2g6bHQxMjM0NTYiLCJvcGVuX2lkIjoiIiwidWlkIjo4MTMxOTUyOSwiZGVidWciOiIiLCJsYW5nIjoiIn0.GHT4Oi_3lbLYrsnaXyFSL6Xhv1azQVre6N82_z56-lU";
    public static void main(String[] args) {
 
        //String uid = "230058077";
         String uid = "81315929";
        getToken(t);
 
    }
 
    public static String getToken(String t ) {
        try {
 
        } catch (Exception e) {
            e.printStackTrace();
 
        }
        return null;
    }
 
 
 
 
 
//    public static void  sucees(String uid){
//        if(uid.length() < 10 && uid.matches("[0-9]+")){
//            String tokne = getToken(uid);
//            System.out.println(tokne);
//            int num = 0;
//            for(int i=0 ; i< 10 ; i++){
//                num = send( tokne) + num;
//                try {
//                    Thread.sleep(500);
//                    System.out.print(num);
//                } catch (InterruptedException e) {
//                    e.printStackTrace();
//                }
//            }
//            System.out.println( " [通关 "+num+" 次 ,成功] ");
//        }else {
//            System.out.println("不是数字");
//        }
//    }
 
 
    public static String autoGame(String t) {
        try {
            HashMap<String, Object> paramMap = new HashMap<>();
            paramMap.put("t", t);
            paramMap.put("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 MicroMessenger/6.5.2.501 NetType/WIFI MiniGame WindowsWechat");
            paramMap.put("Referer", "https://servicewechat.com/wx141bfb9b73c970a9/23/page-frame.html");
 
            String matchType = HttpUtil.get(matchTypeURL+ "&t=" +t);
 
            String mad5 = JSONObject.parseObject(matchType).getJSONObject("data").getJSONArray("map_md5").getString(1);
            String url = "https://cat-match-static.easygame2021.com/maps/" + mad5 + ".txt";
 
            String s = HttpUtil.get(url);
 
            JSONObject jsonObject = JSONObject.parseObject(s);
            JSONObject levelData = jsonObject.getJSONObject("levelData");
            Iterator<String> iterator = levelData.keySet().iterator();
 
            int totalSize = 0;
            while (iterator.hasNext()) {
                String next = iterator.next();
                JSONArray jsonArray = levelData.getJSONArray(next);
                totalSize += jsonArray.size();
            }
            JSONArray jsonArray = new JSONArray();
            for (int i = 0; i < totalSize; i++) {
                JSONObject data = new JSONObject();
                data.put("chessIndex", Math.min(i, 127));
                data.put("timeTag", Math.min(i, 127));
                jsonArray.add(data);
            }
            List<Byte> bytes = Lists.newArrayList();
            bytes.add((byte) 8);
            bytes.add((byte) 3);
            for (int i = 0; i < jsonArray.size(); i++) {
                JSONObject jsonObject1 = jsonArray.getJSONObject(i);
                bytes.add((byte) 34);
                bytes.add((byte) 4);
                bytes.add((byte) 8);
                bytes.add(jsonObject1.getByte("chessIndex"));
                bytes.add((byte) 16);
                bytes.add(jsonObject1.getByte("chessIndex"));
            }
            byte[] dataByte = new byte[bytes.size()];
            for (int i = 0; i < bytes.size(); i++) {
                dataByte[i] = bytes.get(i);
            }
 
            String gameOverExUrl = "https://cat-match.easygame2021.com/sheep/v1/game/game_over_ex" ;
            HashMap<String, Object> paramMap1 = new HashMap<>();
            paramMap1.put("rank_score",1);
            paramMap1.put("rank_state",1);
            paramMap1.put("rank_time",1);
            paramMap1.put("rank_role",1);
            paramMap1.put("skin",1);
            paramMap1.put("t",t);
            paramMap1.put("MatchPlayInfo", Base64.encode(dataByte));
 
 
            String json = JSONObject.toJSONString(paramMap1);
            System.out.println(json);
            String s1  =   sendPost(gameOverExUrl,json,paramMap);;
 
            System.out.println(s1);
 
            return  "";
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("获取token失败");
            return "01";
        }
    }
 
 
 
 
 
 
 
//    public static void  sucees(String uid){
//        if(uid.length() < 10 && uid.matches("[0-9]+")){
//            String tokne = getToken(uid);
//            System.out.println(tokne);
//            int num = 0;
//            for(int i=0 ; i< 10 ; i++){
//                num = send( tokne) + num;
//                try {
//                    Thread.sleep(500);
//                    System.out.print(num);
//                } catch (InterruptedException e) {
//                    e.printStackTrace();
//                }
//            }
//            System.out.println( " [通关 "+num+" 次 ,成功] ");
//        }else {
//            System.out.println("不是数字");
//        }
//    }
 
 
    public static String sendPost(String url, String param, Map<String, Object> header) throws UnsupportedEncodingException, IOException {
        PrintWriter out = null;
        BufferedReader in = null;
        String result = "";
        URL realUrl = new URL(url);
        // 打开和URL之间的连接
        URLConnection conn = realUrl.openConnection();
        //设置超时时间
        conn.setConnectTimeout(5000);
        conn.setReadTimeout(15000);
        // 设置通用的请求属性
        if (header!=null) {
            for (Map.Entry<String, Object> entry : header.entrySet()) {
                conn.setRequestProperty(entry.getKey(), entry.getValue().toString());
            }
        }
 
        conn.setRequestProperty("accept", "*/*");
        conn.setRequestProperty("connection", "Keep-Alive");
        conn.setRequestProperty("Content-Type", "application/json; charset=utf-8");
        // 发送POST请求必须设置如下两行
        conn.setDoOutput(true);
        conn.setDoInput(true);
        // 获取URLConnection对象对应的输出流
        out = new PrintWriter(conn.getOutputStream());
        // 发送请求参数
        out.print(param);
        // flush输出流的缓冲
        out.flush();
        // 定义BufferedReader输入流来读取URL的响应
        in = new BufferedReader(
                new InputStreamReader(conn.getInputStream(), "utf8"));
        String line;
        while ((line = in.readLine()) != null) {
            result += line;
        }
        if(out!=null){
            out.close();
        }
        if(in!=null){
            in.close();
        }
        return result;
    }
}

Great works are not done by strength, but by persistence! 历尽艰辛的飞升者,成了围剿孙悟空的十万天兵之一。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则 需要先绑定手机号


免责声明:
本站所发布的第三方软件及资源(包括但不仅限于文字/图片/音频/视频等仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。如果您喜欢某程序或某个资源,请支持正版软件及版权方利益,注册或购买,得到更好的正版服务。如有侵权请邮件与我们联系处理。

Mail To: admin@cdsy.xyz

QQ|Archiver|手机版|小黑屋|城东书院 ( 湘ICP备19021508号-1|湘公网安备 43102202000103号 )

GMT+8, 2024-11-21 22:31 , Processed in 0.052665 second(s), 27 queries .

Powered by Discuz! CDSY.XYZ

Copyright © 2019-2023, Tencent Cloud.

快速回复 返回顶部 返回列表