工具整理

Bytecode-viewer

一款查看class文件的工具

使用: 目录定位到该jar包下面,然后使用如下命令:

java -jar Bytecode-Viewer-2.12.jar

sh脚本执行文件: Bytecode-Viewer.sh

脚本文件:

Bytecode-Viewer-2.12.jar

来源:https://github.com/Konloch/bytecode-viewer

Rectangle窗口大小调整

Rectangle是一个在mac上动态调整应用窗口的工具,比如我想在屏幕上同时展示多个应用,这个工具使用上非常好用。
Rectangle下载
alt text

Alfred工具

Alfred是一款在mac上全局搜索的工具,能指定搜索文件、文件夹、应用的一款工具。
建议你在设置中将要搜索的文件类型给勾选住: alt text 关于更多使用看官网,我的快捷键是双击command: alt text

动画差值器

在线预览:https://inloop.github.io/interpolator/

VsCode编辑器

  • 插件列表
    • PlantUML:对于写md的文件,比较不错
    • Peacock:一款能动态修改工作区的颜色,这样就能知道当前是哪个项目
    • Paste Image:能快速在项目目录复制图片,并粘贴到文档中
    • One Dark Pro:一款不错的Color Theme的主题插件
    • Material Icon Theme:一款不错的File Icon Theme(文件样式)的主题插件
    • Material Product Icons:一款不错的左边栏的功能按钮的样式主题
    • markdownlint:markdown语法的检测插件
    • Markdown All in One:写markdown语法高亮、快捷设置、快速生成目录的插件
    • indent-rainbow:代码可视化缩进工具
    • CodeSnap:拖动文件中文字,能快速生成代码格式的图片
    • Markdown Preview Enhanced:markdown预览插件,支持自定义样式进行预览

mac上快速拷贝文件

按住option键,然后鼠标右键点击,会出现"将**拷贝为文件路径",然后选中它就拷贝路径了。

codeLocator在agp8上使用xml跳转能力

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// 改用 CodeLocator core 内置的 hookInflater 机制实现 XML 跳转功能
dependencies {
    debugImplementation "com.bytedance.tools.codelocator:codelocator-core:2.0.4"
}
//在application中使用enableHookInflater(true)来设置开关
private fun initCodeLocator() {
    try {
        val config = CodeLocatorConfig.Builder()
            .enableHookInflater(true)  // 启用 LayoutInflater hook,替代 lancet 的 XML 插桩
            .build()
        CodeLocator.config(config)
    } catch (e: Throwable) {
        // CodeLocator 未集成时忽略
    }
}

//如果是在某些环境下不依赖codelocator,则初始化使用反射
private fun initCodeLocator() {
    try {
        // 通过反射构建 CodeLocatorConfig,避免编译期硬依赖
        val builderClass = Class.forName("com.bytedance.tools.codelocator.config.CodeLocatorConfig\$Builder")
        val builder = builderClass.getDeclaredConstructor().newInstance()
        val enableHookInflaterMethod = builderClass.getMethod("enableHookInflater", Boolean::class.java)
        enableHookInflaterMethod.invoke(builder, true)
        val buildMethod = builderClass.getMethod("build")
        val config = buildMethod.invoke(builder)

        // 调用 CodeLocator.config(config)
        val codeLocatorClass = Class.forName("com.bytedance.tools.codelocator.CodeLocator")
        val configClass = Class.forName("com.bytedance.tools.codelocator.config.CodeLocatorConfig")
        val configMethod = codeLocatorClass.getMethod("config", configClass)
        configMethod.invoke(null, config)
    } catch (e: ClassNotFoundException) {
        // enableCodeLocator=false 时 CodeLocator 类不存在,忽略
    } catch (e: Throwable) {
        // 其他异常忽略
    }
}
Licensed under CC BY-NC-SA 4.0
使用 Hugo 构建
主题 StackJimmy 设计