Attt / Anyproxy-fgo-rule

用于劫持修改fgo战斗请求响应的规则文件,配合Anyproxy使用。
76 stars 26 forks source link

在安卓手机本机跑科技服务器 #6

Open ZizhuoWang opened 6 years ago

ZizhuoWang commented 6 years ago

对于安卓5.0以上的安卓手机,我们可以用termux在本机跑科技服务器,从而彻底摆脱电脑或者云服务器。 以下是操作步骤:

  1. 下载安装termux
  2. 打开termux,它会联网安装环境。
  3. apt update,用官方源就行,不要用ustc的termux源,早就废了。
  4. apt install git nodejs nano 安装git、nodejs、nano
  5. npm install -g anyproxy 用npm安装anyproxy
  6. anyproxy-ca,之后提示是否创建证书,直接回车创建在/data/data/com.termux/files/home/.anyproxy/certificates/rootCA.crt。
  7. git clone https://github.com/Attt/Anyproxy-fgo-rule.git,把科技代码放在本地。
  8. termux-setup-storage,之后会提示是否授权termux访问本机媒体和文件,选择是,会在家目录新建storage文件夹通向手机存储。使得本来不共通的数据变得可以访问。
  9. cp /data/data/com.termux/files/home/.anyproxy/certificates/rootCA.crt /data/data/com.termux/files/home/storage/downloads/termux.crt,我这里改成了termux.crt,不改也行。
  10. 系统设置-系统安全-从SD卡安装里在download文件夹下找到termux.crt并安装。在termux里,update-ca-certificates不好使,跟普通的linux不一样,我们只要让安卓本身认识这个证书就好,不再需要让termux认识证书(termux可能用的就是系统证书,只能说一石二鸟)。
  11. nano Anyproxy-fgo-rule/any-fgo.sh,编辑any-fgo.sh,将fgo.js替换成/data/data/com.termux/files/home/Anyproxy-fgo-rule/fgo.js,绝对路径总是不会出错的。之后可以根据喜好编辑Anyproxy-fgo-rule/fgo.js来加撤退胜利等功能。
  12. chmod +x Anyproxy-fgo-rule/any-fgo.sh,加上可执行权限
  13. Anyproxy-fgo-rule/any-fgo.sh,开始运行科技。注意,termux里的netstat不好使,你可能看不到任何端口,想kill掉进程直接用ps -ef看吧,没几个进程,node那个就是。想看是否启动了anyproxy,直接浏览器打开127.0.0.1:8889看就好。
  14. 在WLAN设置里把http代理改成127.0.0.1,端口8888,可以在第三个选项规定127.0.0.1不走代理。如果是4G的话,就新建APN,其他选项保持和默认APN相同,只改代理和端口。
  15. 最后注意一点,要定时清理termux家目录下的.anyproxy/caches/下面的缓存,不然你手机存储要炸。直接rm -rf .anyproxy/caches/*就行,那些都是请求缓存,删了之后你在anyproxy网页上就看不到请求的具体内容了,对科技没啥影响。
ZizhuoWang commented 6 years ago

我也是超级大闲人2333 我之前想过用安卓上的抓包软件做本地科技,后来发现那些软件都是弱子,只能看不能改,有的连看都不能看,大部分也都不能解析https。 干脆用了termux,反正安卓底层也是linux上跑虚拟机,应该可以做到linux能做的事。 iOS可能越了狱可以做到相似的事情吧,毕竟基于unix的darwin分支,nodejs也可以跨平台。

Assummm commented 6 years ago

d70c43aaac66e1d356c18f12d28bdefd求解决

Assummm commented 6 years ago

为什么会出错

Assummm commented 6 years ago

大佬,在吗?

ZizhuoWang commented 6 years ago

手机问题,我没碰到过。 现在科技暂时凉了,别搞了。

Assummm commented 6 years ago

那我这个问题怎么解决啊!科技什么时候修复?修复给我发个教程。我肝疼最主要的是打不过。

Attt commented 6 years ago

@Assummm 已更新

hhs008 commented 6 years ago

@Attt 大佬,今年下午突然就201错误了。我上午还用的好好的…

ZizhuoWang commented 6 years ago

GTMD Bilibili

Assummm commented 6 years ago

有没有科技啊!我TM打不过巨猪。

sunhaitaosw commented 5 years ago

我想问问out.log这样写着每打两局就不行了(台服)nohup: appending output to nohup.out WARNING: linker: Unsupported flags DT_FLAGS_1=0x8 WARNING: linker: Unsupported flags DT_FLAGS_1=0x8 [AnyProxy WARN][2018-12-02 10:11:37]: ROOT CA NOT INSTALLED YET [AnyProxy ERROR][2018-12-02 10:12:37]: Error: Client network socket disconnected before secure TLS connection was established (node:9672) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. [AnyProxy ERROR][2018-12-02 10:17:06]: Error: connect ETIMEDOUT 31.13.97.248:443 [AnyProxy ERROR][2018-12-02 10:17:06]: Error: connect ETIMEDOUT 31.13.97.248:443 [AnyProxy ERROR][2018-12-02 10:19:19]: Error: connect ETIMEDOUT 31.13.97.248:443 [AnyProxy ERROR][2018-12-02 10:20:51]: got an uncaught exception, is there anything goes wrong in your rule file ? Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:139:27)

heqyoufree commented 5 years ago

链接重置问题参见https://github.com/alibaba/anyproxy/pull/427