910. 用Kotlin破解Android版微信小游戏-跳一跳
成果
1077
跳一跳
微信小程序可以玩游戏了,我们来破解一下《跳一跳》这个官方出品的小游戏吧。
思路
用usb调试安卓手机,用adb截图并用鼠标测量距离,然后计算按压时间后模拟按压。
$ adb shell input swipe [duration(ms)] (Default: touchscreen) # 模拟长按
$ adb shell screencap # 保存截屏到手机
$ adb pull /sdcard/screen.png # 下载截屏文件到本地
得到手指按的时间 t
时间 = 距离 / 速度(常量) t = L / k
L = p2 - p1
获取到起始点和结束点的坐标
源码
开发环境: Kotlin,...