Giter Site home page Giter Site logo

luoxuwei / xxlog Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 300 KB

将腾讯mars 项目中xlog模块抽离成单独库,并进行重构,只保留核心功能,在架构和代码结构上进行简化和优化。去掉外部依赖和跨平台相关代码。

Kotlin 0.06% CMake 0.13% C 6.53% C++ 12.57% PHP 79.38% Python 0.64% Java 0.63% Shell 0.06%

xxlog's Introduction

XXLog

将腾讯mars 项目中xlog模块抽离成单独库,并进行重构,只保留核心功能,在架构和代码结构上进行简化和优化。去掉外部依赖和跨平台相关代码。

生成秘钥

1.安装pyelliptic 细节可以参考wiki。

2.运行key_gen.py

python2 ./gen_key.py

执行成功会打印出公钥和私钥:

save private key
xxxxxxxx

appender_open's parameter:
xxxxxxxxxxx

输出的appender_open's parameter就是公钥,是appenderOpen接口的参数,将私钥拷贝到log解压脚本decode_mars_crypt_log_file.py中覆盖PRIV_KEY字段

添加依赖

implementation "io.github.luoxuwei:xxlog:1.0.0"

Init

val externalFilesDir: File? = applicationContext.getExternalFilesDir(null)
val externalFilesDirPath =
     if (externalFilesDir != null) externalFilesDir.getAbsolutePath() else "/sdcard"
val logPath = externalFilesDirPath + "/xxlog"
val cachePath = applicationContext.getDir("xxlog", Context.MODE_PRIVATE).absolutePath;
val xlog = XXLog()
Log.setLogImp(xlog)
Log.setConsoleLogOpen(true)
Log.appenderOpen(XXLog.LEVEL_DEBUG, XXLog.AppednerModeAsync, cachePath, logPath, "xxlog", 0, "xxxxx");

解密

1.安装zstandard

pip2 install zstandard

2.执行decode_mars_crypt_log_file.py脚本解密:

python2 decode_mars_crypt_log_file.py xxlog_20211114.xlog

感谢

本项目基于腾讯mars 中xlog模块重构

xxlog's People

Contributors

luoxuwei avatar

Stargazers

lxzh avatar  avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.