android wifidog

83 篇文章 0 订阅

一. 配置wifidog.conf

1. adb shell

1. ls /sys/class/net/

2. 找到ap0,wlan0,或br0之类的接口

3. ifconfig ap0,注ap0,对应换成接口列表中的接口名;收到如:ap0: ip 192.168.43.1 mask 255.255.255.0 flags [up broadcast running multicast]之类的返回表明使用此接口

4. 在wifidog.conf中把GatewayInterface改为ap0,如果是其它接口改对应改为其它接口名

 

二.安装wifidog及相关工具

1. adb push wdctl /system/bin/

2. adb push wifidog /system/bin/

3. adb push wifidog.conf /etc/

4. adb shell chmod 777 /system/bin/wdctl

5. adb shell chmod 777 /system/bin/wifidog

6. adb shell chmod 777 /etc/wifidog.conf

 

三.启动wifidog;注:需先开启wifi热点,参数-d 999 -f为调试用,参数/data目录需有操作权限,可修改为其它目录;需先进入adb shell再执行命令,否则可能失败

1. adb shell

2. wifidog -d 999 -f -w /data/wdctl.sock -i /data/wifidog.sock

 

四.关闭wifidog;注:/data/wdctl.sock为启动wifidog时的参数

1. adb shell wdctl -s /data/wdctl.sock stop

 

五.自动认证

1. 连上热点的设备访问 http://192.168.43.1:2060/wifidog/auth?token=simple;

192.168.43.1这个地址等于手机wifi获得的网关地址ip。

 

2. 输出结果是json: {"suc":1/0,"why":"msg"}

suc=1表示登录成功,0表示失败。

 

六.认证服务器(MiFi默认展板.htm)

跳转网址由wifidog.conf里面Hostname+Path+LoginScriptPathFragment组成,网页实现接收gw_address,gw_port,gw_id,ip和mac参数后调用自动认证,示例如下:

http://wifind.nextwifi.com//wiclickcms/index.php/mifiPortal/login_v2?gw_address=192.168.43.1&gw_port=2060&gw_id=020822345008&ip=192.168.43.15&mac=4c:18:9a:51:e2:c7

 

七. 系统集成

1. 把wifidog.sh的脚本打包到/system/bin/目录

2. 在mt6735_l1/system/core/rootdir/init.rc中添加服务

   service wifidog /system/bin/wifidog.sh

       class main

       user root

       group root

       oneshot

3. 关闭SELinux功能

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值