Giter VIP home page Giter VIP logo

okhttploggerinterceptor-hook's Introduction

OkHttpLoggerInterceptor-hook

Xposed实现的OkHttp日志拦截器,可添加Header & Query参数

Log示例

 ┌───────────────────────────────────────────────────────
 │ --> POST http://******/user/detail?customQueryKey=customQueryValue http/1.1 (50-byte body)
 │ Content-Type: application/x-www-form-urlencoded
 │ Content-Length: 50
 │ customHeaderKey: customHeaderValue
 │ 
 │ userId=0&deviceId=8a746992663cb62d93e39b1eacc5cf10
 │ --> END POST (50-byte body)
 │ <-- 200  http://******/user/detail?customQueryKey=customQueryValue (278ms)
 │ Content-Type: application/json;charset=UTF-8
 │ Transfer-Encoding: chunked
 │ Date: Fri, 24 Apr 2020 02:21:42 GMT
 │ 
 │ {"code":1000,"message":"登录成功","result":{"userId":0,"username":"游客模式","password":null,"email":"[email protected]","presentAddress":"","avatar":"","sex":"保密","mobile":"","classes":0,"mustUrl":│"hSMGNEb3ZMMjlyYW5ndHA0TG1OdmJTOC9kWEpzUFE9Q=="}}
 │ <-- END HTTP (275-byte body)
 └────────────────────────────────────────────────────────

Build

new MyInterceptor.Builder()
                 .addHeader("customHeaderKey","customHeaderValue")
                 .addQueryParam("customQueryKey","customQueryValue")
                 .build(classLoader)

以上仅是简单实现,具体情况还得具体分析。 感谢珍惜大佬的XposedOkHttpCat XposedOkHttpCat地址:https://github.com/w296488320/XposedOkHttpCat

okhttploggerinterceptor-hook's People

Contributors

siyujie 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.