Skip to content

alexxxcs1/atosl-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

atosl-node

项目使用 create-neon 构建

具体实现使用了 atosl-rs

该库仅仅是将 atosl-rs 变为可直接node调用的依赖

关于符号化

iOS 崩溃日志在线符号化

安装

必要环境配置 NodeJs && Rust.

初始化:

$ npm install

编译 atosl-node

$ npm run build

该命令使用 cargo-cp-artifact 把Rust代码打包成 ./index.node.

使用

const atosl = require('./index.node');
// type atosl.parse = (
  option: {
    file: string              //文件完整路径 ( dylib || dwarf )
    load_address: string      //起始地址
    addresses: Array<string>  //运行地址
  },
  text_segment?: boolean      // 默认false
) => {
  success: boolean, 
  data: Array<{address: string, result: string}>
  message?: string
}
const data = atosl.parse({
    file: "/Users/packy/Desktop/TestAapp.dSYM/Contents/Resources/DWARF/Flutter",
    load_address: '0x109810000',
    addresses: [
        '0x0000000109ad88b0',
    ],
});
console.log(data);
/**
成功: 
{
  success: true,
  data: [
    {
      address: 4457334960,
      result: 'GrMtlCommandBuffer::getRenderCommandEncoder(MTLRenderPassDescriptor*, GrMtlPipelineState const*, GrMtlOpsRenderPass*) (in Flutter) + 408'
    },
  ],
  message: null,
}
失败: 
{
  success: false,
  data: [],
  message: 'Unsupported file format'
}
**/

可用命令

项目根目录下:

npm install

安装项目所需依赖

npm buildnpm build-debug

从Rust源码构建Node依赖 (index.node)

Rust构建参数cargo build需要通过 npm buildnpm build-* 命令执行. 例如: cargo feature:

npm run build -- --feature=beetle

npm build-release

npm build等同, 但是执行cargo release(https://doc.rust-lang.org/cargo/reference/profiles.html#release)

项目目录

atosl-node/
├── Cargo.toml
├── README.md
├── index.node
├── package.json
├── src/
    ├── atosl.rs
    ├── demangle.rs
|   └── lib.rs
└── target/

Cargo.toml

Rust项目的配置文件

index.node

构建产物

package.json

npm的配置文件

src/

Rust源码目录

src/atosl.rs

atosl主要调用方法

src/demangle.rs

atosl util

src/lib.rs

Rust项目入口文件

target/

二进制Rust产物

相关文档

Neon documentation.

Rust documentation.

Node documentation.

About

atos for linux node addon

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages