Skip to content

Commit

Permalink
feat: update gradle and some flow transformers
Browse files Browse the repository at this point in the history
  • Loading branch information
ItzSomebody committed Jul 12, 2019
1 parent 3ee7247 commit 3591cfa
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 35 deletions.
57 changes: 27 additions & 30 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,47 +1,44 @@
plugins {
id 'com.github.johnrengelman.shadow' version '5.1.0'
id 'java'
}

group 'me.itzsomebody'
version '2.0.0-SNAPSHOT'

apply plugin: 'java'

defaultTasks 'clean', 'shadowJar'
sourceCompatibility = 1.8
def main = 'me.itzsomebody.radon.Main'

jar {
baseName = project.name

manifest {
attributes 'Main-Class': 'me.itzsomebody.radon.Main'
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

task fatJar(type: Jar) {
baseName = project.name + '-shaded'

manifest {
attributes 'Main-Class': 'me.itzsomebody.radon.Main'
}

from { configurations.compile.collect { !it.isDirectory() && it.getName().endsWith(".jar") ? zipTree(it) : it } }
with jar
jar {
manifest { attributes 'Main-Class': main }
}

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
shadowJar() {
classifier = null

relocate 'org.objectweb.asm', 'me.itzsomebody.radon.asm.lib'
exclude 'module-info.class'
manifest { attributes 'Main-Class': main }
}

repositories {
mavenCentral()
maven { // Needed for SnakeYAML
url "http://oss.sonatype.org/content/groups/public/"
}
maven { url "http://oss.sonatype.org/content/groups/public/" } // SnakeYAML
}

dependencies {
compile 'org.ow2.asm:asm:7.0'
compile 'org.ow2.asm:asm-tree:7.0'
compile 'org.ow2.asm:asm-commons:7.0'
compile 'org.ow2.asm:asm-util:7.0'
compile 'org.yaml:snakeyaml:1.20-SNAPSHOT'
testCompile 'junit:junit:4.12'
testCompile 'org.powermock:powermock-api-mockito:1.6.6'
testCompile 'org.powermock:powermock-module-junit4:1.6.6'
implementation 'org.ow2.asm:asm:7.1'
implementation 'org.ow2.asm:asm-tree:7.1'
implementation 'org.ow2.asm:asm-commons:7.1'
implementation 'org.ow2.asm:asm-util:7.1'
implementation 'org.yaml:snakeyaml:1.20-SNAPSHOT'

testImplementation 'junit:junit:4.12'
testImplementation 'org.powermock:powermock-api-mockito:1.6.6'
testImplementation 'org.powermock:powermock-module-junit4:1.6.6'
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -305,4 +305,4 @@ private static int doMethodEmulation(String desc) {

return result;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
*/
public class BlockSplitter extends FlowObfuscation {
// used to limit number of recursive calls on doSplit()
private static final int LIMIT_SIZE = 10;
private static final int LIMIT_SIZE = 11;

@Override
public void transform() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public enum FlowObfuscationSetting {
REPLACE_GOTO(Boolean.class, new GotoReplacer()),
INSERT_BOGUS_SWITCH_JUMPS(Boolean.class, new BogusSwitchJumpInserter()),
INSERT_BOGUS_JUMPS(Boolean.class, new BogusJumpInserter()),
MUTILATE_NULL_CHECK(Boolean.class, new NullCheckMutilator()),
SPLIT_BLOCKS(Boolean.class, new BlockSplitter()),
FAKE_CATCH_BLOCKS(Boolean.class, new FakeCatchBlocks()),
MUTILATE_NULL_CHECK(Boolean.class, new NullCheckMutilator());
FAKE_CATCH_BLOCKS(Boolean.class, new FakeCatchBlocks());

private final Class expectedType;
private final FlowObfuscation flowObfuscation;
Expand Down

0 comments on commit 3591cfa

Please sign in to comment.