forked from NationalSecurityAgency/ghidra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
99 lines (86 loc) · 3.73 KB
/
build.gradle
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/* ###
* IP: GHIDRA
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
apply from: "$rootProject.projectDir/gradle/distributableGhidraModule.gradle"
apply from: "$rootProject.projectDir/gradle/javaProject.gradle"
apply from: "$rootProject.projectDir/gradle/helpProject.gradle"
apply from: "$rootProject.projectDir/gradle/jacocoProject.gradle"
apply from: "$rootProject.projectDir/gradle/javaTestProject.gradle"
apply from: "$rootProject.projectDir/gradle/nativeProject.gradle"
apply from: "buildNatives.gradle"
apply plugin: 'eclipse'
eclipse.project.name = 'Features FileFormats'
dependencies {
api project(':Base')
api project(':Recognizers')
api project(':PDB')
// Used by "Android DEX to JAR" file system
api ':dex-ir:2.1'
api ':dex-reader:2.1'
api ':dex-reader-api:2.1'
api ':dex-translator:2.1'
api 'org.ow2.asm:asm-debug-all:5.0.3'
// Used by "Android DEX to SMALI" file system
api 'org.smali:baksmali:2.5.2' // requires guava-27.1-android or later
api 'org.smali:dexlib2:2.5.2' // requires guava-27.1-android or later
api 'org.smali:util:2.5.2' // requires guava-27.1-android or later
// Used by "Android XML" file system
api ':AXMLPrinter2'
// Used by "ZIP" and "7zip" file systems
api 'net.sf.sevenzipjbinding:sevenzipjbinding:16.02-2.01'
runtimeOnly 'net.sf.sevenzipjbinding:sevenzipjbinding-all-platforms:16.02-2.01'
// include code from src/test/slow in Base
testImplementation project(path: ':Base', configuration: 'integrationTestArtifacts')
}
// Include buildable native source in distribution
rootProject.assembleDistribution {
from (this.project.projectDir.toString()) {
include "src/lzfse/**"
into { getZipPath(this.project) }
}
}
// ***********************************************************************************************
// Sevenzip native library extract task
// ***********************************************************************************************
// The following extracts native libraries from upstream's sevenzipjbinding allPlatform jar
// and places the uncompressed native libraries into a ghidra folder so that they can be used to
// initialize the sevenzipjbinding library without needing to extract the native libraries at run time.
// This is necessary due to bugs in upstream's initSevenZipFromPlatformJAR() that can cause core
// dumps in java processes that have previously loaded the native library. See comments
// at the top of ghidra.file.formats.sevenzip.SevenZipCustomInitializer.
// This gradle task can be removed when SevenZipCustomInitializer is no longer needed.
String getSevenZipJarPath() {
List<String> libs = getExternalRuntimeDependencies(project);
for(String lib: libs) {
if (lib.contains("sevenzipjbinding-all-platforms")) {
return lib;
}
}
return null
}
task extractSevenZipNativeLibs(type: Copy) {
String jarPath = getSevenZipJarPath();
from zipTree(jarPath)
include "Linux-amd64/*.so"
include "Windows-amd64/*.dll"
include "Mac-x86_64/*.dylib"
exclude "META-INF"
exclude "Linux-i386"
exclude "Windows-x86"
into ("build/data/sevenzipnativelibs")
}
rootProject.prepDev.dependsOn extractSevenZipNativeLibs
jar.dependsOn extractSevenZipNativeLibs
// end of sevenzip native library extract task code