Skip to content

Commit b1e040e

Browse files
committed
1
1
1 parent 6ef7f7b commit b1e040e

20 files changed

Lines changed: 1183 additions & 158 deletions

.github/workflows/build-test.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
name: Build Test
22

33
on:
4-
push:
5-
branches: [ main ]
6-
pull_request:
7-
branches: [ main ]
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: '要构建的版本号(需要先设置对应tag)'
8+
required: true
9+
default: '1.0.0'
10+
# push:
11+
# branches: [ main ]
12+
# pull_request:
13+
# branches: [ main ]
814

915
jobs:
1016
tests:
@@ -23,3 +29,9 @@ jobs:
2329

2430
- name: Build
2531
run: ./gradlew build dist
32+
33+
- name: Upload artifact
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: dist-files-${{ github.event.inputs.tag }}
37+
path: build/dist/

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ idea/
3232
*.log
3333
*.cfg
3434
*.orig
35+
local.properties

README.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
2-
## JADX Example plugin
3-
4-
Simple example of jadx plugin.
5-
Adds a jadx watermark comment to every generated java class
6-
7-
Install using location id: `github:jadx-decompiler:jadx-example-plugin`
8-
9-
In jadx-cli:
10-
```bash
11-
jadx plugins --install "github:jadx-decompiler:jadx-example-plugin"
12-
```
1+
"创建函数的控制流图(CFG),以图片格式显示。仅在 Ubuntu 上测试过。" +
2+
"\n\n使用方法:使用 Jadx-GUI 打开一个反编译后的 Java 代码界面,鼠标放在一个函数名上右键 -> 查看控制流图。" +
3+
"\n\n选项:生成控制流图的类型:普通,RAW(包含原始 Instructions), REGION(显示 Region 的划分)。" +
4+
"在 Jadx 的首选项中可以更改默认值。" +
5+
"\n\n需要安装:graphviz(用到了 'dot' 命令将 dot 格式转为 png)。" +
6+
"\n\n原理:使用 Jadx 的 DotGraphVisitor.dump() / dumpRaw() / dumpRegion() 创建 .dot 文件," +
7+
"然后使用 'dot -Tpng' 命令将其转为 png 图片并显示。"
8+
9+
"Generate method's CFG and display it as image. Tested on ubuntu." +
10+
"\n\nUsage: Open a decompiled Java code tab and right click on a method's name -> view CFG." +
11+
"\n\nOptions: Dump CFG as GENERAL, RAW (raw instructions) or REGION (region rectangles). " +
12+
"You can change the default dump type in the Jadx preferences dialog." +
13+
"\n\nPrerequisite: graphviz installed. (command 'dot' is used to convert .dot format to png)" +
14+
"\n\nHow it works: Create .dot file using Jadx's DotGraphVisitor.dump()/dumpRaw()/dumpRegion(). " +
15+
"Then convert it to png using 'dot -Tpng' command."

build.gradle.kts

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,33 @@ plugins {
1313
}
1414

1515
dependencies {
16-
val jadxVersion = "1.5.1"
16+
val jadxVersion = "1.5.3"
1717
val isJadxSnapshot = jadxVersion.endsWith("-SNAPSHOT")
1818

1919
// use compile only scope to exclude jadx-core and its dependencies from result jar
2020
compileOnly("io.github.skylot:jadx-core:$jadxVersion") {
2121
isChanging = isJadxSnapshot
2222
}
2323

24-
testImplementation("io.github.skylot:jadx-smali-input:$jadxVersion") {
25-
isChanging = isJadxSnapshot
26-
}
27-
testImplementation("ch.qos.logback:logback-classic:1.5.18")
28-
testImplementation("org.assertj:assertj-core:3.27.3")
29-
testImplementation("org.junit.jupiter:junit-jupiter:5.12.1")
30-
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
24+
compileOnly("io.github.skylot:jadx-gui:$jadxVersion") {
25+
isChanging = isJadxSnapshot
26+
}
27+
28+
compileOnly("org.slf4j:slf4j-api:2.0.17")
29+
// 来自 jadx-gui
30+
compileOnly("com.fifesoft:rsyntaxtextarea:3.6.0")
31+
compileOnly("com.formdev:flatlaf-extras:3.7")
32+
33+
implementation("org.piccolo2d:piccolo2d-core:3.0.1")
34+
implementation("org.piccolo2d:piccolo2d-extras:3.0.1")
35+
36+
// testImplementation("io.github.skylot:jadx-smali-input:$jadxVersion") {
37+
// isChanging = isJadxSnapshot
38+
// }
39+
// testImplementation("ch.qos.logback:logback-classic:1.5.18")
40+
// testImplementation("org.assertj:assertj-core:3.27.3")
41+
// testImplementation("org.junit.jupiter:junit-jupiter:5.12.1")
42+
// testRuntimeOnly("org.junit.platform:junit-platform-launcher")
3143
}
3244

3345
repositories {

settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11

2-
rootProject.name = "jadx-example-plugin"
2+
rootProject.name = "jadx-plugin-cfg-viewer"

src/main/java/jadx/plugins/example/AddCommentPass.java

Lines changed: 0 additions & 38 deletions
This file was deleted.

src/main/java/jadx/plugins/example/ExampleOptions.java

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/main/java/jadx/plugins/example/JadxExamplePlugin.java

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)