• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# API扫描工具使用说明
2## 简介
3
4API扫描工具支持三种入口,分别是可执行程序、VS Code插件、IntelliJ插件,使用者可以根据自己的需要选择合适的工具。可执行文件、IntelliJ插件、VS Code插件下载路径如下:
5
6[下载链接](暂无)
7
8下载文件说明如下:
9
10	│   │   |── api_scan_IntelliJ_plugin.jar       # IntelliJ插件
11	│   │   |── ApiScan-0.0.1.vsix                 # VS Code插件
12	│   │   |── Andr_N_Games_api.xlsx              # 风险接口
13	│   │   |── search-linux                       # Linux可执行程序
14	│   │   |── search-win.exe                     # Windows可执行程序
15	│   │   └── search-macos                       # Mac可执行程序
16
17## 工具介绍
18
19通过API扫描工具,开发者可以扫描输出三方库中存在,而OpenHarmony源码中不存在的风险接口,移植之前预知风险,降低移植难度,提高开发效率。
20
21![](./../figures/pic-api-frm.png)
22
23## 生成result文件
24
25### 可执行程序使用方法
26
27#### Linux
281、Ubuntu中存在将要扫描的三方库源码,如下所示:
29
30	harmony@Ubuntu-64:~/service$ ls /home/harmony/linshi/
31	opencv
32
332、将下载的search-linux可执行程序放置任意路径下,如下所示:
34
35	harmony@Ubuntu-64:~/service$ ls
36	search-linux
37
383、进入到search-linux可执行程序路径下,并执行可执行程序,执行命令如下:
39
40	harmony@Ubuntu-64:~/service$ ./search-linux -d /home/harmony/linshi/opencv/ -o ./
41	{
42	  function: Set(70) {
43	    'AndroidBitmap_getInfo',
44	    ......
45	    'ANativeWindow_release'
46	  },
47	  include: Set(3) { 'bitmap.h', 'input.h', 'log.h' }
48	}
49	output: result.xlsx
50	harmony@Ubuntu-64:~/service/napi_generator_8/hdc/api/API-Scan/example$
51
52其中,参数详情如下:
53	-d, 被扫描项目的路径;
54	-o, 可选参数,默认为当前路径下,输出结果存放路径。
55
564、运行成功后会在当前目录下生成result.xlsx文件,如下所示:
57
58	harmony@Ubuntu-64:~/service$ ls
59	result.xlsx  search-linux
60
61#### Windows
62
631、E:\workspace\杂七杂八\service\目录下存在将要扫描的项目opencv。
64
652、将下载的search-win.exe可执行程序放置任意路径下,如下所示:
66
67	E:\demo\api>dir /B
68	search-win.exe
69
703、进入search-win.exe可执行程序路径下,并执行可执行程序,执行过程如下:
71
72	E:\demo\api>search-win.exe -d E:\workspace\杂七杂八\service\opencv -o ./
73	{
74	  function: Set(70) {
75	    'AndroidBitmap_getInfo',
76	    ......
77	    'ANativeWindow_release'
78	  },
79	  include: Set(3) { 'bitmap.h', 'input.h', 'log.h' }
80	}
81	output: result.xlsx
82
83其中,参数详情如下:
84	-d, 被扫描项目的路径
85	-o, 可选参数,默认为当前路径下,输出结果存放路径。
86
874、运行成功后会在当前目录下生成result.xlsx文件,如下所示:
88
89	E:\demo\api>dir /B
90	result.xlsx
91	search-win.exe
92
93#### Mac
94
95方法步骤参考windows、Linux的使用方法。
96
97### VS Code插件使用方法
98
99具体的插件使用步骤,可以左键单击以下链接了解:
100
101[VS插件使用说明](https://gitee.com/openharmony/napi_generator/tree/master/hdc/api/api_scan_vs_plugin/docs/INSTRUCTION_ZH.md)
102
103### IntelliJ插件使用方法
104
105具体的插件使用步骤,可以左键单击以下链接了解:
106
107[IntelliJ插件使用说明](https://gitee.com/openharmony/napi_generator/tree/master/hdc/api/api_scan_IntelliJ_plugin/docs/INSTRUCTION_ZH.md)
108
109