0
点赞
收藏
分享

微信扫一扫

编译腾讯mars日志组件xlog

幺幺零 2022-02-27 阅读 76




下载python 2.7(本文档写作使用的2.7.15 x86版本,非x86_64版本)
2.7.15 x86版本下载地址:https://www.python.org/ftp/python/2.7.15/python-2.7.15.msi 若采用x86_64版本,xlog自带的解密脚本后面执行会报错,详见附录。
2.下载ndk11c
1)下载入口页面:https://developer.android.google.cn/ndk/downloads/older_releases编译腾讯mars日志组件xlog_android



下载后,解压到某个目录,然后将目录加入到环境变量中
增加NDK_HOME环境变量,然后将%NDK_HOME%加入到PATH中 编译腾讯mars日志组件xlog_github_02



下载mars源代码:
地址:https://github.com/Tencent/mars.git 在命令行中切换到mars\libraries下,执行:python build_android.py
第一个出现的菜单中选择“3”,第二个菜单根据需要依次选择不同的类型(对于arm平台一般需要4、5)进行编译,每次编译后需要把目标文件拷贝走(编译后生成的文件在目录mars\libraries\mars_xlog_sdk\libs中)。
编译腾讯mars日志组件xlog_android_03



编译后SDK下载:https://github.com/cxyzy1/mars/raw/master/android_xlog_sdk/xlog_so.rar



解码xlog日志文件(分两种情况)
首先把log文件从手机里导出至Mars源码log/crypt/文件夹下,在命令行切换到该目录下。




  • 文件未做加密
    执行:​​python decode_mars_nocrypt_log_file.py​
  • 文件做了加密(初始化时pubKey传入了值)
    执行:​​python decode_mars_crypt_log_file.py​​ 注意对于加密场景,执行上面命令前,需要安装pyelliptic,命令为:​​pip install pyelliptic==1.5.7​​。pip命令在C:\Python27\Scripts\目录下。
    附录: xlog编译及使用demo:https://github.com/luojiawei/Ljw_Mars_Xlog xlog开源地址:https://github.com/Tencent/mars 采用python x86_64版本在解密加密日志时会报如下错误:

Traceback (most recent call last):
File "decode_mars_crypt_log_file.py", line 9, in <module>
import pyelliptic
File "D:\Program Files\Python\Python27\lib\site-packages\pyelliptic\__init__.py", line 43, in <module>
from .openssl import OpenSSL
File "D:\Program Files\Python\Python27\lib\site-packages\pyelliptic\openssl.py", line 310, in <module>
OpenSSL = _OpenSSL(libname)
File "D:\Program Files\Python\Python27\lib\site-packages\pyelliptic\openssl.py", line 67, in __init__
self._lib = ctypes.CDLL(library)
File "D:\Program Files\Python\Python27\lib\ctypes\__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 193] %1 不是有效的 Win32



举报

相关推荐

0 条评论