使用java破解wifi(win10环境)

简介

闲来无事,手机的无限流量很卡,于是想偷隔壁的wifi,写此程序,仅供娱乐。

Git地址

https://github.com/FangCheng666/zn_wifi_crack.git

代码如下

1.cmd工具类

package com.znkeji.zn_wifi_carck.utils;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: fangcheng
 * Date: 2019/3/24
 * Time: 16:21
 * Description: cmd 需要的工具类
 */
public class CmdUtils {

    /**
     * 该方法封装了执行cmd的方法
     *
     * @param cmd CMD命令
     * @param filePath 需要在哪个目录下执行
     */
    public static List<String> execute(String cmd, String filePath) {
        Process process = null;
        List<String> result = new ArrayList<String>();
        try {
            if (filePath != null) {
                process = Runtime.getRuntime().exec(cmd, null, new File(filePath));
            } else {
                process = Runtime.getRuntime().exec(cmd);
            }
            BufferedReader bReader = new BufferedReader(new InputStreamReader(process.getInputStream(), "gbk"));
            String line = null;
            while ((line = bReader.readLine()) != null) {
                result.add(line);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        return result;
    }

}

2.字符串工具类

package com.znkeji.zn_wifi_carck.utils;

/**
 * Created with IntelliJ IDEA.
 * User: fangcheng
 * Date: 2019/3/24
 * Time: 16:21
 * Description:字符串工具类
 */
public class StringUtils {

    /**
     * 字符串转换成为16进制(无需Unicode编码)
     * @param str
     * @return
     */
    public static String str2HexStr(String str) {
        char[] cha
  • 35
    点赞
  • 265
    收藏
    觉得还不错? 一键收藏
  • 77
    评论
评论 77
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值