cb91c8c41c
* Add new CLI args for mapping files and deprecate args regarding jobf files (will be moved to the cache dir in the future) * Add support for importing method arg mappings Also change `mapping-file` to `mappings-path`, since folders are supported, too * Add GUI for importing mappings * Also show save file dialog when exporting mappings * Fix crash on startup when `--mappings-path` parameter is set * Include imported renames when exporting mappings * Add "close mappings" menu entry * Don't instantiate MappingTree unless actually needed * Terminology: `import` → `open`; `export` → `save` * Save location of open mapping file into project data * Correctly reset cache when loading new mappings * Remove unused import * Save opened mappings' last modified date to reset cache when changed * Fix if statement * Correctly handle absence of mappings path in project data * Show overwrite warning for folders only if not empty * Prevent crash when imported mappings don't have any namespaces * Handle wrong mappings namespace count error * Replace unneeded public with private * Add option for saving open mappings directly to disk * Correctly propagate and throw exceptions during decompiler init * Respect opened mappings' existing namespaces; fix related crash * Deduplicate code, add `DalvikToJavaBytecodeUtils` class * Small cleanup; move more functionality to utility class * Support for importing class, field and method mappings * Handle mappings in RenameDialog * Fix checkstyle * Fix wrong naming order * Use modified mapping-io JAR from https://github.com/skylot/jadx/commit/18070eb7a649db0b0daef38d456316d5b4650072 That commit got rid of redundant embedded libraries * Add null checks * Check if mapping tree is null before running MappingsVisitor * Use working mapping-io build * Handle cache invalidation directly in DiskCodeCache class * Don't reset UserRenamesMappingsMode if project is just reloaded * Fix checkstyle Co-authored-by: Skylot <skylot@gmail.com>
148 lines
4.2 KiB
Groovy
148 lines
4.2 KiB
Groovy
plugins {
|
|
id 'application'
|
|
id 'edu.sc.seis.launch4j' version '2.5.4'
|
|
id 'com.github.johnrengelman.shadow' version '7.1.2'
|
|
id 'org.beryx.runtime' version '1.13.0'
|
|
}
|
|
|
|
dependencies {
|
|
implementation(project(':jadx-core'))
|
|
implementation(project(":jadx-cli"))
|
|
|
|
// jadx-script autocomplete support
|
|
implementation(project(":jadx-plugins::jadx-script:jadx-script-ide"))
|
|
implementation("org.jetbrains.kotlin:kotlin-scripting-common:1.7.20")
|
|
implementation 'com.fifesoft:autocomplete:3.3.0'
|
|
|
|
implementation 'com.beust:jcommander:1.82'
|
|
implementation 'ch.qos.logback:logback-classic:1.3.5'
|
|
|
|
implementation 'com.fifesoft:rsyntaxtextarea:3.3.2'
|
|
implementation files('libs/jfontchooser-1.0.5.jar')
|
|
implementation 'hu.kazocsaba:image-viewer:1.2.3'
|
|
|
|
implementation 'com.formdev:flatlaf:3.0'
|
|
implementation 'com.formdev:flatlaf-intellij-themes:3.0'
|
|
implementation 'com.formdev:flatlaf-extras:3.0'
|
|
implementation 'com.formdev:svgSalamander:1.1.4'
|
|
|
|
implementation 'com.google.code.gson:gson:2.10.1'
|
|
implementation 'org.apache.commons:commons-lang3:3.12.0'
|
|
implementation 'org.apache.commons:commons-text:1.10.0'
|
|
|
|
implementation 'io.reactivex.rxjava2:rxjava:2.2.21'
|
|
implementation "com.github.akarnokd:rxjava2-swing:0.3.7"
|
|
implementation 'com.android.tools.build:apksig:7.4.1'
|
|
implementation 'io.github.skylot:jdwp:2.0.0'
|
|
|
|
testImplementation project(":jadx-core").sourceSets.test.output
|
|
}
|
|
|
|
application {
|
|
applicationName = 'jadx-gui'
|
|
mainClass.set('jadx.gui.JadxGUI')
|
|
// The option -XX:+UseG1GC is only relevant for Java 8. Starting with Java 9 G1GC is already the default GC
|
|
applicationDefaultJvmArgs = ['-Xms128M', '-XX:MaxRAMPercentage=70.0', '-XX:+UseG1GC',
|
|
'-Dawt.useSystemAAFontSettings=lcd', '-Dswing.aatext=true',
|
|
'-Djava.util.Arrays.useLegacyMergeSort=true']
|
|
}
|
|
|
|
applicationDistribution.with {
|
|
into('') {
|
|
from '../'
|
|
include 'README.md'
|
|
include 'NOTICE'
|
|
include 'LICENSE'
|
|
}
|
|
}
|
|
|
|
jar {
|
|
manifest {
|
|
attributes(
|
|
"Main-Class": application.mainClass.get(),
|
|
"Class-Path": configurations.runtimeClasspath.collect { it.getName() }.join(' ')
|
|
)
|
|
}
|
|
}
|
|
|
|
shadow {
|
|
mainClassName = application.mainClass.get()
|
|
}
|
|
shadowJar {
|
|
mergeServiceFiles()
|
|
}
|
|
|
|
startScripts {
|
|
doLast {
|
|
def str = windowsScript.text
|
|
str = str.replaceAll('java.exe', 'javaw.exe')
|
|
str = str.replaceAll('"%JAVA_EXE%" %DEFAULT_JVM_OPTS%', 'start "jadx-gui" /B "%JAVA_EXE%" %DEFAULT_JVM_OPTS%')
|
|
windowsScript.text = str
|
|
}
|
|
}
|
|
|
|
launch4j {
|
|
mainClassName = application.mainClass.get()
|
|
copyConfigurable = project.tasks.shadowJar.outputs.files
|
|
jarTask = project.tasks.shadowJar
|
|
icon = "${projectDir}/src/main/resources/logos/jadx-logo.ico"
|
|
outfile = "jadx-gui-${version}.exe"
|
|
copyright = 'Skylot'
|
|
windowTitle = 'jadx'
|
|
companyName = 'jadx'
|
|
jreMinVersion = '11'
|
|
jvmOptions = ['-Dawt.useSystemAAFontSettings=lcd', '-Dswing.aatext=true', '-XX:+UseG1GC', '-Djava.util.Arrays.useLegacyMergeSort=true']
|
|
jreRuntimeBits = "64"
|
|
bundledJre64Bit = true
|
|
initialHeapPercent = 5
|
|
maxHeapSize = 4096
|
|
maxHeapPercent = 70
|
|
downloadUrl = 'https://www.oracle.com/java/technologies/downloads/#jdk17-windows'
|
|
bundledJrePath = project.hasProperty("bundleJRE") ? '%EXEDIR%/jre' : '%JAVA_HOME%'
|
|
}
|
|
|
|
runtime {
|
|
addOptions('--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages')
|
|
addModules(
|
|
'java.desktop',
|
|
'java.naming',
|
|
'java.xml',
|
|
)
|
|
jpackage {
|
|
imageOptions = ['--icon', "${projectDir}/src/main/resources/logos/jadx-logo.ico"]
|
|
skipInstaller = true
|
|
targetPlatformName = "win"
|
|
}
|
|
launcher {
|
|
noConsole = true
|
|
}
|
|
}
|
|
|
|
task copyDistWinWithJre(type: Copy, dependsOn: ['runtime', 'createExe']) {
|
|
group 'jadx'
|
|
destinationDir = new File(buildDir, "jadx-gui-${jadxVersion}-with-jre-win")
|
|
from(runtime.jreDir) {
|
|
include '**/*'
|
|
into 'jre'
|
|
}
|
|
from(createExe.outputs) {
|
|
include '*.exe'
|
|
}
|
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
|
}
|
|
|
|
task distWinWithJre(type: Zip, dependsOn: ['copyDistWinWithJre']) {
|
|
group 'jadx'
|
|
destinationDirectory = buildDir
|
|
archiveFileName = "jadx-gui-${jadxVersion}-with-jre-win.zip"
|
|
from(copyDistWinWithJre.outputs) {
|
|
include '**/*'
|
|
}
|
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
|
}
|
|
|
|
task addNewNLSLines(type: JavaExec) {
|
|
classpath = sourceSets.main.runtimeClasspath
|
|
mainClass.set('jadx.gui.utils.tools.NLSAddNewLines')
|
|
}
|