https://github.com/codeskyblue/airfps
For mobile phone game to get FPS: frame per second.
https://github.com/codeskyblue/airfps
Last synced: 3 months ago
JSON representation
For mobile phone game to get FPS: frame per second.
- Host: GitHub
- URL: https://github.com/codeskyblue/airfps
- Owner: codeskyblue
- License: gpl-2.0
- Created: 2015-01-21T01:45:47.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-02-10T07:57:00.000Z (over 10 years ago)
- Last Synced: 2024-12-27T12:44:51.603Z (5 months ago)
- Language: C
- Size: 457 KB
- Stars: 10
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## airfps
Get FPS(frame per second) on android. Root privileges required.## Still developing
Not working for now.目前遇到了点瓶颈。只hook函数eglSwapBuffers看来还不够。(忽略了点细节,只要在adb开发选项中把硬件刷新关了就可以了)
需要从基础工作开始研究了。
1. [ELF格式解析](study-diary/ELF.md)
2. [ptrace学习](study-diary/ptrace.md)
3. [inject函数的编写](study-diary/inject.md)
4. [注入1+1 != 2](study-diary/hook.md)## 编译指南
代码中用了Golang,Android-NDK. [Golang-mobile](https://github.com/golang/mobile)的官网推荐用dockerdocker pull golang/mobile
docker run -v $GOPATH/src:/src golang/mobile /bin/bash -c 'cd /src/your/project && ./make.bash'不过手工搭建个环境也不复杂,参考着[Dockerfile](https://github.com/golang/mobile/blob/master/Dockerfile)中的描述一点点的来就可以。
Golang需要1.4+的版本,直接下载个就好不要忘了把CGO打开,我有时就会忘了`export CGO_ENABLED=1`
## 感谢
* [未完成的项目realfps](https://github.com/cuitteam/RealFPS)
* [fpsmeter反编译分析](http://blog.csdn.net/freshui/article/details/9245511#comments)
* [jinzhuojun的CSDN-如何写出一个显示fps的东西](http://blog.csdn.net/jinzhuojun/article/details/10428435)
* [hook的原理](http://bbs.pediy.com/showthread.php?t=157419)## Demo
function `__android_log_print` should not appear in `hook_entry` function.
cd study-diary
make install
cd ..
make
adb shell
cd /data/local/tmp/
export LD_LIBRARY_PATH=$PWD
./baradb shell
./airfps -l libfps.so -pname ./bar # hack
./airfps -l libfps.so -pname ./bar # unhack
./airfps -l libfps.so -pname ./bar # hacksu
cd /data/local/tmp
./airfps -l libfps.so -rf eglSwapBuffers -rl /system/lib/libsurfaceflinger.soadb shell
tail -f /data/local/tmp/log.txt## LICENSE
Under [GPL v2](LICENSE)