Commit 7b4321ec authored by Skylot's avatar Skylot

gui: fix build for java 10 and update dependencies (#291)

parent 188bfd1a
......@@ -18,7 +18,6 @@ build/
classes/
idea/
.gradle/
gradle.properties
jadx-output/
*-tmp/
......
language: java
jdk:
- oraclejdk8
sudo: false
dist: trusty
before_install:
- wget https://github.com/sormuras/bach/raw/master/install-jdk.sh
- chmod +x gradlew
env:
- TERM=dumb GRADLE_OPTS="-Dorg.gradle.daemon=false"
global:
- TERM=dumb
before_install:
- chmod +x gradlew
matrix:
include:
- env: JDK=oracle-8
jdk: oraclejdk8
- env: JDK=oracle-10
install: . ./install-jdk.sh -F 10 -L BCL
script:
- sed -i " 1 s/.*/&-b$TRAVIS_BUILD_NUMBER-$(git rev-parse --short HEAD)/" version
- cat version
- sed -i "s/BUILD_VERSION/$(head -c -1 version)/g" bintray.json
- ./gradlew clean build
- java -version
- sed -i " 1 s/.*/&-b$TRAVIS_BUILD_NUMBER-$(git rev-parse --short HEAD)/" version
- cat version
- sed -i "s/BUILD_VERSION/$(head -c -1 version)/g" bintray.json
- ./gradlew clean build
after_success:
- ./gradlew clean build jacocoTestReport
- bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
- ./gradlew clean sonarqube -Dsonar.host.url=$SONAR_HOST -Dsonar.organization=$SONAR_ORG -Dsonar.login=$SONAR_TOKEN
- ./gradlew clean dist
- test $JDK = "oracle-8" && ./gradlew clean build jacocoTestReport && bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
- test $JDK = "oracle-8" && ./gradlew clean sonarqube -Dsonar.host.url=$SONAR_HOST -Dsonar.organization=$SONAR_ORG -Dsonar.login=$SONAR_TOKEN || echo "Skip sonar build and upload"
deploy:
provider: bintray
edge:
branch: v1.8.47
file: bintray.json
user: skylot
key: $BINTRAY_KEY
skip_cleanup: true
on:
branch: master
tags: false
before_deploy:
- ./gradlew clean dist
sudo: false
deploy:
provider: bintray
edge:
branch: v1.8.47
file: bintray.json
user: skylot
key: $BINTRAY_KEY
skip_cleanup: true
on:
branch: master
tags: false
condition: $JDK = oracle-8
notifications:
email:
- skylot@gmail.com
email:
- skylot@gmail.com
......@@ -41,7 +41,7 @@ allprojects {
testCompile 'ch.qos.logback:logback-classic:1.2.3'
testCompile 'junit:junit:4.12'
testCompile 'org.hamcrest:hamcrest-library:1.3'
testCompile 'org.mockito:mockito-core:2.15.0'
testCompile 'org.mockito:mockito-core:2.18.3'
testCompile 'org.spockframework:spock-core:1.1-groovy-2.4'
testCompile 'cglib:cglib-nodep:3.2.6'
}
......@@ -53,7 +53,7 @@ allprojects {
}
jacoco {
toolVersion = "0.8.0"
toolVersion = "0.8.1"
}
jacocoTestReport {
reports {
......
org.gradle.daemon=false
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.5.1-bin.zip
......@@ -5,7 +5,7 @@ applicationName = 'jadx'
dependencies {
compile(project(':jadx-core'))
compile 'com.beust:jcommander:1.72'
compile 'com.beust:jcommander:1.74'
compile 'ch.qos.logback:logback-classic:1.2.3'
}
......
......@@ -5,12 +5,12 @@ dependencies {
compile files('lib/dx-1.14.jar')
compile 'commons-io:commons-io:2.6'
compile 'org.ow2.asm:asm:6.0'
compile 'org.jetbrains:annotations:15.0'
compile 'uk.com.robust-it:cloning:1.9.9'
compile 'org.ow2.asm:asm:6.2'
compile 'org.jetbrains:annotations:16.0.2'
compile 'uk.com.robust-it:cloning:1.9.10'
testCompile 'org.smali:smali:2.2.2'
testCompile 'org.smali:baksmali:2.2.2'
testCompile 'org.smali:smali:2.2.3'
testCompile 'org.smali:baksmali:2.2.3'
testCompile 'org.apache.commons:commons-lang3:3.7'
}
......
......@@ -249,14 +249,9 @@ public class ModVisitor extends AbstractVisitor {
|| !parentClass.getInnerClasses().contains(classNode)) {
return;
}
if (!classNode.getAccessFlags().isStatic()
&& (callMth.getArgsCount() == 0
|| !callMth.getArgumentsTypes().get(0).equals(parentClass.getClassInfo().getType()))) {
return;
}
// TODO: calculate this constructor and other constructor usage
Map<InsnArg, FieldNode> argsMap = getArgsToFieldsMapping(callMthNode, co);
if (argsMap.isEmpty()) {
if (argsMap.isEmpty() && !callMthNode.getArguments(true).isEmpty()) {
return;
}
......@@ -285,9 +280,14 @@ public class ModVisitor extends AbstractVisitor {
private static Map<InsnArg, FieldNode> getArgsToFieldsMapping(MethodNode callMthNode, ConstructorInsn co) {
Map<InsnArg, FieldNode> map = new LinkedHashMap<>();
ClassNode parentClass = callMthNode.getParentClass();
MethodInfo callMth = callMthNode.getMethodInfo();
ClassNode cls = callMthNode.getParentClass();
ClassNode parentClass = cls.getParentClass();
List<RegisterArg> argList = callMthNode.getArguments(false);
int startArg = parentClass.getAccessFlags().isStatic() ? 0 : 1;
int startArg = 0;
if (callMth.getArgsCount() != 0 && callMth.getArgumentsTypes().get(0).equals(parentClass.getClassInfo().getType())) {
startArg = 1;
}
int argsCount = argList.size();
for (int i = startArg; i < argsCount; i++) {
RegisterArg arg = argList.get(i);
......@@ -298,7 +298,7 @@ public class ModVisitor extends AbstractVisitor {
FieldNode fieldNode = null;
if (useInsn.getType() == InsnType.IPUT) {
FieldInfo field = (FieldInfo) ((IndexInsnNode) useInsn).getIndex();
fieldNode = parentClass.searchField(field);
fieldNode = cls.searchField(field);
if (fieldNode == null || !fieldNode.getAccessFlags().isSynthetic()) {
return Collections.emptyMap();
}
......
......@@ -208,8 +208,8 @@ public class SimplifyVisitor extends AbstractVisitor {
} // end of if constructor is for StringBuilder
} // end of if we found a constructor early in the chain
} catch (Throwable e) {
LOG.debug("Can't convert string concatenation: {} insn: {}", mth, insn, e);
} catch (Exception e) {
LOG.warn("Can't convert string concatenation: {} insn: {}", mth, insn, e);
}
}
return null;
......
......@@ -6,6 +6,7 @@ import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import org.jetbrains.annotations.TestOnly;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -32,6 +33,7 @@ import jadx.core.utils.exceptions.CodegenException;
import jadx.core.utils.exceptions.JadxRuntimeException;
@Deprecated
@TestOnly
public class DebugUtils {
private static final Logger LOG = LoggerFactory.getLogger(DebugUtils.class);
......
plugins {
id 'edu.sc.seis.launch4j' version '2.4.3'
id 'com.github.johnrengelman.shadow' version '2.0.2'
id 'edu.sc.seis.launch4j' version '2.4.4'
id 'com.github.johnrengelman.shadow' version '2.0.4'
}
apply plugin: 'application'
......@@ -11,14 +11,14 @@ dependencies {
compile(project(":jadx-core"))
compile(project(":jadx-cli"))
compile 'com.fifesoft:rsyntaxtextarea:2.6.1'
compile 'com.google.code.gson:gson:2.8.2'
compile 'com.google.code.gson:gson:2.8.5'
compile files('libs/jfontchooser-1.0.5.jar')
compile 'hu.kazocsaba:image-viewer:1.2.3'
compile 'org.apache.commons:commons-lang3:3.7'
compile 'io.reactivex.rxjava2:rxjava:2.1.13'
compile "com.github.akarnokd:rxjava2-swing:0.2.12"
compile 'io.reactivex.rxjava2:rxjava:2.1.14'
compile "com.github.akarnokd:rxjava2-swing:0.2.13"
}
applicationDistribution.with {
......@@ -63,7 +63,6 @@ launch4j {
initialHeapPercent = 5
maxHeapSize = 4096
maxHeapPercent = 70
}
test {
......
......@@ -30,7 +30,7 @@ class CodePanel extends ContentPanel {
add(searchBar, BorderLayout.NORTH);
add(scrollPane);
KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_F, InputEvent.CTRL_MASK);
KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_F, InputEvent.CTRL_DOWN_MASK);
Utils.addKeyBinding(codeArea, key, "SearchAction", new SearchAction());
}
......
package jadx.gui.utils;
import javax.swing.*;
import javax.swing.event.UndoableEditEvent;
import javax.swing.event.UndoableEditListener;
import javax.swing.text.JTextComponent;
import javax.swing.undo.UndoManager;
import java.awt.*;
......@@ -102,26 +100,22 @@ public class TextStandardActions {
}
private void addKeyActions() {
KeyStroke undoKey = KeyStroke.getKeyStroke(KeyEvent.VK_Z, InputEvent.CTRL_MASK);
KeyStroke undoKey = KeyStroke.getKeyStroke(KeyEvent.VK_Z, InputEvent.CTRL_DOWN_MASK);
textComponent.getInputMap().put(undoKey, undoAction);
KeyStroke redoKey = KeyStroke.getKeyStroke(KeyEvent.VK_R, InputEvent.CTRL_MASK);
KeyStroke redoKey = KeyStroke.getKeyStroke(KeyEvent.VK_R, InputEvent.CTRL_DOWN_MASK);
textComponent.getInputMap().put(redoKey, redoAction);
}
private void registerListeners() {
textComponent.addMouseListener(new MouseAdapter() {
@Override
public void mouseReleased(MouseEvent e) {
if (e.getModifiers() == InputEvent.BUTTON3_MASK
&& e.getSource() == textComponent) {
if (e.getButton() == 3 && e.getSource() == textComponent) {
process(e);
}
}
});
textComponent.getDocument().addUndoableEditListener(new UndoableEditListener() {
public void undoableEditHappened(UndoableEditEvent event) {
undoManager.addEdit(event.getEdit());
}
});
textComponent.getDocument().addUndoableEditListener(event -> undoManager.addEdit(event.getEdit()));
}
private void process(MouseEvent e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment