chore: update dependencies
This commit is contained in:
+13
-4
@@ -8,13 +8,22 @@ insert_final_newline = true
|
||||
indent_style = tab
|
||||
tab_width = 4
|
||||
|
||||
# IntelliJ Idea specific workarounds
|
||||
continuation_indent_size = 8
|
||||
ij_java_class_count_to_use_import_on_demand = 99
|
||||
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.java]
|
||||
ij_java_continuation_indent_size = 8
|
||||
ij_java_use_single_class_imports = true
|
||||
ij_java_class_count_to_use_import_on_demand = 999
|
||||
ij_java_names_count_to_use_import_on_demand = 999
|
||||
ij_java_packages_to_use_import_on_demand = *
|
||||
|
||||
[*.kt]
|
||||
ij_kotlin_continuation_indent_size = 8
|
||||
ij_kotlin_name_count_to_use_star_import = 999
|
||||
ij_kotlin_name_count_to_use_star_import_for_members = 999
|
||||
ij_kotlin_packages_to_use_import_on_demand = *
|
||||
|
||||
[*.yml]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
+17
-14
@@ -2,9 +2,10 @@
|
||||
|
||||
plugins {
|
||||
id 'com.github.ben-manes.versions' version '0.46.0'
|
||||
id 'se.patrikerdes.use-latest-versions' version '0.2.18'
|
||||
id 'com.diffplug.spotless' version '6.18.0'
|
||||
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.8.20'
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.8.21'
|
||||
}
|
||||
|
||||
ext.jadxVersion = System.getenv('JADX_VERSION') ?: "dev"
|
||||
@@ -16,6 +17,8 @@ allprojects {
|
||||
apply plugin: 'kotlin'
|
||||
apply plugin: 'checkstyle'
|
||||
apply plugin: 'com.diffplug.spotless'
|
||||
apply plugin: 'com.github.ben-manes.versions'
|
||||
apply plugin: 'se.patrikerdes.use-latest-versions'
|
||||
|
||||
version = jadxVersion
|
||||
|
||||
@@ -45,11 +48,11 @@ allprojects {
|
||||
|
||||
testImplementation 'ch.qos.logback:logback-classic:1.4.7'
|
||||
testImplementation 'org.hamcrest:hamcrest-library:2.2'
|
||||
testImplementation 'org.mockito:mockito-core:5.3.0'
|
||||
testImplementation 'org.mockito:mockito-core:5.3.1'
|
||||
testImplementation 'org.assertj:assertj-core:3.24.2'
|
||||
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2'
|
||||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.2'
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.3'
|
||||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.3'
|
||||
|
||||
testCompileOnly 'org.jetbrains:annotations:24.0.1'
|
||||
}
|
||||
@@ -96,17 +99,17 @@ allprojects {
|
||||
endWithNewline()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencyUpdates {
|
||||
resolutionStrategy {
|
||||
componentSelection { rules ->
|
||||
rules.all { ComponentSelection selection ->
|
||||
boolean rejected = ['alpha', 'beta', 'dev', 'rc', 'cr', 'm', 'atlassian'].any { qualifier ->
|
||||
selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
|
||||
}
|
||||
if (rejected) {
|
||||
selection.reject('Release candidate')
|
||||
dependencyUpdates {
|
||||
resolutionStrategy {
|
||||
componentSelection { rules ->
|
||||
rules.all { ComponentSelection selection ->
|
||||
boolean rejected = ['alpha', 'beta', 'dev', 'rc', 'cr', 'm', 'atlassian'].any { qualifier ->
|
||||
selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
|
||||
}
|
||||
if (rejected) {
|
||||
selection.reject('Release candidate')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@ dependencies {
|
||||
implementation 'com.google.code.gson:gson:2.10.1'
|
||||
|
||||
// TODO: move resources decoding to separate plugin module
|
||||
implementation 'com.android.tools.build:aapt2-proto:8.0.0-9289358'
|
||||
implementation 'com.google.protobuf:protobuf-java:3.22.3' // forcing latest version
|
||||
implementation 'com.android.tools.build:aapt2-proto:8.0.1-9289358'
|
||||
implementation 'com.google.protobuf:protobuf-java:3.22.4' // forcing latest version
|
||||
|
||||
testImplementation 'org.apache.commons:commons-lang3:3.12.0'
|
||||
|
||||
|
||||
@@ -15,12 +15,13 @@ dependencies {
|
||||
// jadx-script autocomplete support
|
||||
implementation(project(':jadx-plugins:jadx-script:jadx-script-ide'))
|
||||
implementation(project(':jadx-plugins:jadx-script:jadx-script-runtime'))
|
||||
implementation 'org.jetbrains.kotlin:kotlin-scripting-common:1.8.20'
|
||||
implementation 'org.jetbrains.kotlin:kotlin-scripting-common:1.8.21'
|
||||
implementation 'com.fifesoft:autocomplete:3.3.1'
|
||||
|
||||
// use KtLint for format and check jadx scripts
|
||||
implementation 'com.pinterest.ktlint:ktlint-core:0.48.2'
|
||||
implementation 'com.pinterest.ktlint:ktlint-ruleset-standard:0.48.2'
|
||||
implementation 'com.pinterest.ktlint:ktlint-core:0.49.0'
|
||||
implementation 'com.pinterest.ktlint:ktlint-rule-engine:0.49.0'
|
||||
implementation 'com.pinterest.ktlint:ktlint-ruleset-standard:0.49.0'
|
||||
|
||||
implementation 'com.beust:jcommander:1.82'
|
||||
implementation 'ch.qos.logback:logback-classic:1.4.7'
|
||||
@@ -41,7 +42,7 @@ dependencies {
|
||||
|
||||
implementation 'io.reactivex.rxjava2:rxjava:2.2.21'
|
||||
implementation "com.github.akarnokd:rxjava2-swing:0.3.7"
|
||||
implementation 'com.android.tools.build:apksig:8.0.0'
|
||||
implementation 'com.android.tools.build:apksig:8.0.1'
|
||||
implementation 'io.github.skylot:jdwp:2.0.0'
|
||||
|
||||
testImplementation project(":jadx-core").sourceSets.test.output
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
package jadx.gui.plugins.script
|
||||
|
||||
import com.pinterest.ktlint.core.Code
|
||||
import com.pinterest.ktlint.core.KtLintRuleEngine
|
||||
import com.pinterest.ktlint.core.LintError
|
||||
import com.pinterest.ktlint.core.api.EditorConfigOverride
|
||||
import com.pinterest.ktlint.core.api.editorconfig.INDENT_STYLE_PROPERTY
|
||||
import com.pinterest.ktlint.rule.engine.api.Code
|
||||
import com.pinterest.ktlint.rule.engine.api.EditorConfigOverride
|
||||
import com.pinterest.ktlint.rule.engine.api.KtLintRuleEngine
|
||||
import com.pinterest.ktlint.rule.engine.core.api.editorconfig.INDENT_STYLE_PROPERTY
|
||||
import com.pinterest.ktlint.ruleset.standard.StandardRuleSetProvider
|
||||
import org.ec4j.core.model.PropertyType
|
||||
import org.slf4j.Logger
|
||||
@@ -14,7 +13,7 @@ object KtLintUtils {
|
||||
|
||||
val LOG: Logger = LoggerFactory.getLogger(KtLintUtils::class.java)
|
||||
|
||||
val ktLint by lazy {
|
||||
private val ktLint by lazy {
|
||||
KtLintRuleEngine(
|
||||
ruleProviders = StandardRuleSetProvider().getRuleProviders(),
|
||||
editorConfigOverride = EditorConfigOverride.from(
|
||||
@@ -23,8 +22,8 @@ object KtLintUtils {
|
||||
)
|
||||
}
|
||||
|
||||
fun format(content: String, fileName: String): String {
|
||||
val code = Code.CodeSnippet(content, script = true)
|
||||
fun format(content: String): String {
|
||||
val code = Code.fromSnippet(content, script = true)
|
||||
return ktLint.format(code) { lintError, corrected ->
|
||||
if (!corrected) {
|
||||
LOG.warn("Format error: {}", lintError)
|
||||
@@ -32,10 +31,19 @@ object KtLintUtils {
|
||||
}
|
||||
}
|
||||
|
||||
fun lint(content: String, fileName: String): List<LintError> {
|
||||
val code = Code.CodeSnippet(content, script = true)
|
||||
val errors = mutableListOf<LintError>()
|
||||
ktLint.lint(code, errors::add)
|
||||
fun lint(content: String): List<JadxLintError> {
|
||||
val code = Code.fromSnippet(content, script = true)
|
||||
val errors = mutableListOf<JadxLintError>()
|
||||
ktLint.lint(code) { lintError ->
|
||||
errors.add(JadxLintError(lintError.line, lintError.col, lintError.ruleId.value, lintError.detail))
|
||||
}
|
||||
return errors
|
||||
}
|
||||
}
|
||||
|
||||
data class JadxLintError(
|
||||
val line: Int,
|
||||
val col: Int,
|
||||
val ruleId: String,
|
||||
val detail: String,
|
||||
)
|
||||
|
||||
@@ -19,8 +19,6 @@ import org.fife.ui.rtextarea.RTextScrollPane;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.pinterest.ktlint.core.LintError;
|
||||
|
||||
import kotlin.script.experimental.api.ScriptDiagnostic;
|
||||
import kotlin.script.experimental.api.ScriptDiagnostic.Severity;
|
||||
|
||||
@@ -170,9 +168,9 @@ public class ScriptContentPanel extends AbstractCodeContentPanel {
|
||||
scriptLog.warn("Compiler issue: {}", issue);
|
||||
}
|
||||
}
|
||||
List<LintError> lintErrs = Collections.emptyList();
|
||||
List<JadxLintError> lintErrs = Collections.emptyList();
|
||||
if (success) {
|
||||
lintErrs = getLintIssues(code, fileName);
|
||||
lintErrs = getLintIssues(code);
|
||||
}
|
||||
|
||||
errorService.clearErrors();
|
||||
@@ -194,10 +192,10 @@ public class ScriptContentPanel extends AbstractCodeContentPanel {
|
||||
}
|
||||
}
|
||||
|
||||
private List<LintError> getLintIssues(String code, String fileName) {
|
||||
private List<JadxLintError> getLintIssues(String code) {
|
||||
try {
|
||||
List<LintError> lintErrs = KtLintUtils.INSTANCE.lint(code, fileName);
|
||||
for (LintError error : lintErrs) {
|
||||
List<JadxLintError> lintErrs = KtLintUtils.INSTANCE.lint(code);
|
||||
for (JadxLintError error : lintErrs) {
|
||||
scriptLog.warn("Lint issue: {} ({}:{})(ruleId={})",
|
||||
error.getDetail(), error.getLine(), error.getCol(), error.getRuleId());
|
||||
}
|
||||
@@ -212,8 +210,7 @@ public class ScriptContentPanel extends AbstractCodeContentPanel {
|
||||
resetResultLabel();
|
||||
try {
|
||||
String code = scriptArea.getText();
|
||||
String fileName = scriptArea.getNode().getName();
|
||||
String formattedCode = KtLintUtils.INSTANCE.format(code, fileName);
|
||||
String formattedCode = KtLintUtils.INSTANCE.format(code);
|
||||
if (!code.equals(formattedCode)) {
|
||||
scriptArea.updateCode(formattedCode);
|
||||
resultLabel.setText("Code updated");
|
||||
|
||||
@@ -11,8 +11,6 @@ import org.fife.ui.rsyntaxtextarea.parser.ParserNotice;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.pinterest.ktlint.core.LintError;
|
||||
|
||||
import kotlin.script.experimental.api.ScriptDiagnostic;
|
||||
import kotlin.script.experimental.api.SourceCode;
|
||||
|
||||
@@ -98,8 +96,8 @@ public class ScriptErrorService extends AbstractParser {
|
||||
return ParserNotice.Level.ERROR;
|
||||
}
|
||||
|
||||
public void addLintErrors(List<LintError> errors) {
|
||||
for (LintError error : errors) {
|
||||
public void addLintErrors(List<JadxLintError> errors) {
|
||||
for (JadxLintError error : errors) {
|
||||
try {
|
||||
int line = error.getLine();
|
||||
int offset = scriptArea.getLineStartOffset(line - 1) + error.getCol() - 1;
|
||||
|
||||
@@ -444,7 +444,6 @@ public class MainWindow extends JFrame {
|
||||
// check if project file already saved with default name
|
||||
Path projectPath = getProjectPathForFile(singleFile);
|
||||
if (Files.exists(projectPath)) {
|
||||
LOG.info("Loading project {}", projectPath);
|
||||
openProject(projectPath, onFinish);
|
||||
return true;
|
||||
}
|
||||
@@ -463,6 +462,7 @@ public class MainWindow extends JFrame {
|
||||
}
|
||||
|
||||
private void openProject(Path path, Runnable onFinish) {
|
||||
LOG.debug("Loading project: {}", path);
|
||||
JadxProject jadxProject = JadxProject.load(this, path);
|
||||
if (jadxProject == null) {
|
||||
JOptionPane.showMessageDialog(
|
||||
|
||||
@@ -7,6 +7,6 @@ dependencies {
|
||||
implementation(kotlin("scripting-compiler-embeddable"))
|
||||
implementation(kotlin("scripting-ide-services"))
|
||||
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.0")
|
||||
implementation("io.github.microutils:kotlin-logging-jvm:3.0.5")
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ dependencies {
|
||||
implementation(kotlin("scripting-dependencies"))
|
||||
implementation(kotlin("scripting-dependencies-maven"))
|
||||
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.0")
|
||||
implementation("io.github.microutils:kotlin-logging-jvm:3.0.5")
|
||||
|
||||
runtimeOnly(project(":jadx-plugins:jadx-dex-input"))
|
||||
|
||||
Reference in New Issue
Block a user