{"id":13841138,"url":"https://github.com/iqiyi/Lens","last_synced_at":"2025-07-11T12:30:29.724Z","repository":{"id":76043466,"uuid":"276796995","full_name":"iqiyi/Lens","owner":"iqiyi","description":"功能简介：一种开发帮助产品研发的效率工具。主要提供了：页面分析、任务分析、网络分析、DataDump、自定义hook 、Data Explorer 等功能。以帮助开发、测试、UI 等同学更便捷的排查和定位问题，提升开发效率。","archived":false,"fork":false,"pushed_at":"2020-11-02T02:15:14.000Z","size":3572,"stargazers_count":408,"open_issues_count":4,"forks_count":61,"subscribers_count":20,"default_branch":"master","last_synced_at":"2024-11-16T03:05:19.897Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iqiyi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-07-03T03:18:47.000Z","updated_at":"2024-10-14T03:53:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"5d4db893-0965-4fdb-9d72-bd17e4c1dfb8","html_url":"https://github.com/iqiyi/Lens","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iqiyi%2FLens","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iqiyi%2FLens/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iqiyi%2FLens/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iqiyi%2FLens/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iqiyi","download_url":"https://codeload.github.com/iqiyi/Lens/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225720396,"owners_count":17513595,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T17:01:03.179Z","updated_at":"2024-11-21T11:30:19.825Z","avatar_url":"https://github.com/iqiyi.png","language":"Java","funding_links":[],"categories":["Java","Java (504)"],"sub_categories":[],"readme":"Lens\n=======\n\n### 简介（wiki 搭建中）  \nLens 是一款功能强大的Android开发SDK。目前支持界面分析，任务分析, 网络分析，DataDump，DataExplorer等等功能。网络分析、任务分析等功能需要依赖hook框架。Lens 自身不支持hook能力，需注入Lens Hook Framework  实现后，才可使用hook相关的功能。  \n\nLens 是一个开放平台，任何可以为产品开发阶段赋能的创意，都可以作为一个独立的模块向里面添加。  \nLens 是一个框架，它提供了将app 内部数据直观展示出来的方案，也提供了若干接口，让APP 层可以定制展示自己需要的内容。（后面的wiki再进一步说明）  \n\nLens自18年8月创建，我们旨在为开发、测试、UI 赋能。Lens并不完善，代码也有待优化，欢迎小伙伴们提出建议。\n\n##### 基础功能简介(详情见wiki)  \nLens 是以浮窗形式展示在APP 上的。支持最小化模式、展开模式、关闭模式。浮窗可以在界面中随意拖动。浮窗中的任何一个功能模块，都支持在设置中打开或关闭，也可以在初始化代码中配置。   \n![img](art/image_2_hide.png)\n![img](art/img_1_setting.png)\n\n###### 界面分析  \n* 页面信息：展示页面的基本信息，如当前Activity、Fragment 嵌套关系等。展示页面视图层级关系、分析页面视图情况等。\n* 视图拾取：打开视图拾取开关后，点击页面视图，可选中视图。在界面上将会展示视图的基本信息，例如尺寸标注。控件的关键属性等。点击控件，可进入视图详情页面，进一步分析。  \n![img](art/img_4_view_info.png)\n![img](art/img_3_ac_info.png)\n###### 任务分析  \nLens 提供了接口，支持展示任一阶段内的任务执行的情况。支持Time Gap、Time Stamp，Threads Info信息展示。  \n![img](art/img_5_tasks.jpg)\n\n###### 网络分析 \nLens 提供了接口，支持抓取到的网络请求信息。支持设置测试环境等。\n\n###### DataExplorer  \n入口再Lens 浮窗`DB`, `SP`. 目前支持查看本app DB、SP 信息。 支持修改SP 数据。\n\n###### DataDump  \nLens 提供了接口，支持app的一些内部数据展示能力。用于更好的去分析、定位问题。Lens 内部实现了一些基本的数据dump 能力。也支持app 层自己实现定制化的data dump 数据对接。内部文件浏览功能正在开发中。  \n![img](art/img_7_sp.png)\n\n###### 对象监控  \nLens  支持关注任意对象。被关注的对象将会再浮窗模块中显示。点击对象可查看该对象的属性信息.   \n![img](art/img_8_obj.png)\n\n#### Setup  \n```Groovy\ndependencies {\n    debugImplementation 'com.iqiyi.lens:lens:1.2.4'\n    releaseImplementation 'com.iqiyi.lens:lens-no-op:1.2.4'\n}\n```\n\n#### Usage\n1. 可参考Demo 中LensApplicationDelegate 实现配置。（Wiki 中会详细说明方法含义）\n在主进程Application#attachBaseContext 中添加如下代码：\n```Java\nLens.init(this, false);\n```\n在主进程Application#OnCreate 中添加如下代码\n```Java\nLensUtil.buildConfig()\n                .defaultOpen(false)\n//                .enableDeviceInfo(true)\n//                .enableKeyLog(KeyLogConfig.builder().addFilter(\"Main\").setMaxLine(1000))\n//                .enableFPS(true)\n//                .enableLaunchTime(true)\n//                .setHookFrameWorkImpl(new HookFramework())\n                .enableActivityAnalyzer(true)\n                .enableNetworkAnalyze(false)\n                .enableCrashInfo(true)\n                .addCustomBlockEntrance(customBlockEntrance, new BlockFactory())\n                .addCustomJumpEntrance(customJumpEntrance, new JumpAction())\n                .initAsPluginMode(Lens.isSDKMode())\n                .enableViewInfo(true)\n                .show(Lens.wrapContext(mApplication), UIUtils.getScreenWidth(mApplication) / 5 * 3);\n```\n\n#### License  \nApache-2.0 License","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiqiyi%2FLens","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiqiyi%2FLens","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiqiyi%2FLens/lists"}