cai-ji-hua / wechat_brain

头脑王者全自动答题辅助

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python头脑王者答题器

效果

原理说明

  1. 通过 Charles抓包,获取 https://question.hortor.net/question/bat/ 返回的json数据,并保存成文件

  1. 通过watchdog监测question.hortor.net/question/bat/目下文件的变化,去响应对应的方法
class FileEventHandler(FileSystemEventHandler):
	def __init__(self):
		FileSystemEventHandler.__init__(self)
	
	def on_created(self,event):
		global quiz
		if event.src_path.split('/')[-1] == 'findQuiz':
			with open('question.hortor.net/question/bat/findQuiz', encoding='utf-8') as f:
				quiz=read_question(f)
		elif event.src_path.split('/')[-1] == 'choose':
			sql.sql_write(quiz)
		elif event.src_path.split('/')[-1] == 'fightResult':
			print('fightresult')
			time.sleep(3)
			adbshell.back()
			time.sleep(3)
			adbshell.tap('start')

3.获取题目后,如果题目在数据库中,直接返回答案。否则通过百度搜索题目信息,并统计选项出现的次数,出现的最多的选项就当作答案。

4.通过adb shell input tab 模拟点击选项(自动版的只在小米6上试过)

==============================================

或者使用开源免费软件Fiddler代替Charles。 设置好信任证书后(为读取https链接内容),使用目录下的FiddlerRule.js文件作为抓包规则即可。

About

头脑王者全自动答题辅助


Languages

Language:JavaScript 71.4%Language:Python 28.6%