-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
358d4ab
commit 926e4c7
Showing
44 changed files
with
762 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
obfuscator/test_data/tests/java-obfuscator-test/JavaObfuscatorTest/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# java-obfuscator-test | ||
|
||
Slightly modified tests from [huzpsb/JavaObfuscatorTest](https://github.com/huzpsb/JavaObfuscatorTest) |
2 changes: 2 additions & 0 deletions
2
obfuscator/test_data/tests/java-obfuscator-test/JavaObfuscatorTest/Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
public class Test { | ||
} |
4 changes: 4 additions & 0 deletions
4
obfuscator/test_data/tests/java-obfuscator-test/JavaObfuscatorTest/pack/Clazz.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package pack; | ||
|
||
public class Clazz { | ||
} |
118 changes: 118 additions & 0 deletions
118
obfuscator/test_data/tests/java-obfuscator-test/JavaObfuscatorTest/pack/Main.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
package pack; | ||
|
||
import pack.tests.basics.accu.Digi; | ||
import pack.tests.basics.cross.Top; | ||
import pack.tests.basics.ctrl.Ctrl; | ||
import pack.tests.basics.inner.Test; | ||
import pack.tests.basics.overwirte.Sub; | ||
import pack.tests.basics.runable.Task; | ||
import pack.tests.basics.sub.Solver; | ||
import pack.tests.bench.Calc; | ||
import pack.tests.reflects.annot.annot; | ||
import pack.tests.reflects.counter.Count; | ||
import pack.tests.reflects.field.FTest; | ||
import pack.tests.reflects.loader.LRun; | ||
import pack.tests.reflects.res.Accesor; | ||
import pack.tests.reflects.retrace.Tracer; | ||
import pack.tests.security.SecTest; | ||
|
||
import java.io.File; | ||
|
||
public class Main { | ||
public static void main(String[] args) throws Exception { | ||
System.out.println("Obfuscator Test Program"); | ||
System.out.println("Author: huzpsb"); | ||
System.out.println("Version: 1.0r"); | ||
System.out.println("Link: https://github.com/huzpsb/JavaObfuscatorTest"); | ||
System.out.println("-------------Test #1: Basics-------------"); | ||
System.out.print("Test 1.1: Inheritance "); | ||
try { | ||
new Sub().run(); | ||
} catch (Throwable t) { | ||
System.out.println("ERROR"); | ||
} | ||
System.out.print("Test 1.2: Cross "); | ||
try { | ||
new Top().run(); | ||
} catch (Throwable t) { | ||
System.out.println("ERROR"); | ||
} | ||
System.out.print("Test 1.3: Throw "); | ||
try { | ||
new Ctrl().run(); | ||
} catch (Throwable t) { | ||
System.out.println("ERROR"); | ||
} | ||
System.out.print("Test 1.4: Accuracy "); | ||
try { | ||
new Digi().run(); | ||
} catch (Throwable t) { | ||
System.out.println("ERROR"); | ||
} | ||
System.out.print("Test 1.5: SubClass "); | ||
try { | ||
new Solver(); | ||
} catch (Throwable t) { | ||
System.out.println("ERROR"); | ||
} | ||
System.out.print("Test 1.6: Pool "); | ||
try { | ||
new Task().run(); | ||
} catch (Throwable t) { | ||
System.out.println("ERROR"); | ||
} | ||
System.out.print("Test 1.7: InnerClass "); | ||
try { | ||
new Test().run(); | ||
} catch (Throwable t) { | ||
System.out.println("ERROR"); | ||
} | ||
System.out.println("-------------Test #2: Reflects-------------"); | ||
System.out.print("Test 2.1: Counter "); | ||
try { | ||
new Count().run(); | ||
} catch (Throwable t) { | ||
System.out.println("ERROR"); | ||
} | ||
System.out.print("Test 2.2: Chinese 通过LMAO\b\b\b\b \n"); | ||
System.out.print("Test 2.3: Resource "); | ||
try { | ||
new Accesor().run(); | ||
} catch (Throwable t) { | ||
System.out.println("ERROR"); | ||
} | ||
System.out.print("Test 2.4: Field "); | ||
try { | ||
new FTest().run(); | ||
} catch (Throwable t) { | ||
System.out.println("ERROR"); | ||
} | ||
System.out.print("Test 2.5: Loader "); | ||
try { | ||
new LRun().run(); | ||
} catch (Throwable t) { | ||
System.out.println("ERROR"); | ||
} | ||
System.out.print("Test 2.6: ReTrace "); | ||
try { | ||
new Tracer().run(); | ||
} catch (Throwable t) { | ||
System.out.println("ERROR"); | ||
} | ||
System.out.print("Test 2.7: Annotation "); | ||
try { | ||
new annot().run(); | ||
} catch (Throwable t) { | ||
System.out.println("ERROR"); | ||
} | ||
System.out.print("Test 2.8: Sec "); | ||
try { | ||
new SecTest().run(); | ||
} catch (Throwable t) { | ||
System.out.println("ERROR"); | ||
} | ||
System.out.println("-------------Test #3: Efficiency-------------"); | ||
Calc.runAll(); | ||
System.out.println("-------------Tests r Finished-------------"); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
.../test_data/tests/java-obfuscator-test/JavaObfuscatorTest/pack/tests/basics/accu/Digi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package pack.tests.basics.accu; | ||
|
||
public class Digi { | ||
public void run() { | ||
double fl = 0d; | ||
int co = 0; | ||
float fx = 1.1f; | ||
while (true) { | ||
fl += 0.000000000000000001d; | ||
co++; | ||
if (co > 100 || (float) fl == 0.00000000000000002f) | ||
break; | ||
} | ||
if (co == 20) { | ||
fx += 1.3f; | ||
if (fx == 2.4f) { | ||
System.out.println("PASS"); | ||
return; | ||
} | ||
System.out.println("FAIL"); | ||
} else { | ||
System.out.println("FAIL"); | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...est_data/tests/java-obfuscator-test/JavaObfuscatorTest/pack/tests/basics/cross/Abst1.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package pack.tests.basics.cross; | ||
|
||
public abstract class Abst1 { | ||
public abstract int add(int a, int b); | ||
|
||
public int mul(int a, int b) { | ||
return a * b; | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...test_data/tests/java-obfuscator-test/JavaObfuscatorTest/pack/tests/basics/cross/Inte.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package pack.tests.basics.cross; | ||
|
||
public interface Inte { | ||
public int mul(int a, int b); | ||
} |
19 changes: 19 additions & 0 deletions
19
.../test_data/tests/java-obfuscator-test/JavaObfuscatorTest/pack/tests/basics/cross/Top.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package pack.tests.basics.cross; | ||
|
||
public class Top extends Abst1 implements Inte { | ||
|
||
public void run() { | ||
if (add(1, 2) == 3) { | ||
if (mul(2, 3) == 6) { | ||
System.out.println("PASS"); | ||
return; | ||
} | ||
} | ||
System.out.println("FAIL"); | ||
} | ||
|
||
@Override | ||
public int add(int a, int b) { | ||
return a + b; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
.../test_data/tests/java-obfuscator-test/JavaObfuscatorTest/pack/tests/basics/ctrl/Ctrl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package pack.tests.basics.ctrl; | ||
|
||
public class Ctrl { | ||
private String ret = "FAIL"; | ||
|
||
public void runt() { | ||
if ("a".equals("b")) { | ||
} else { | ||
throw new UnsupportedOperationException(); | ||
} | ||
} | ||
|
||
public void runf() { | ||
try { | ||
runt(); | ||
} catch (RuntimeException e) { | ||
ret = "PASS"; | ||
} | ||
try { | ||
runt(); | ||
ret = "FAIL"; | ||
} catch (Exception e) { | ||
|
||
} | ||
} | ||
|
||
public void run() { | ||
runf(); | ||
System.out.println(ret); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...test_data/tests/java-obfuscator-test/JavaObfuscatorTest/pack/tests/basics/inner/Exec.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package pack.tests.basics.inner; | ||
|
||
public class Exec { | ||
public int fuss = 1; | ||
|
||
public void addF() { | ||
fuss += 2; | ||
} | ||
|
||
public class Inner { | ||
int i; | ||
|
||
public Inner(int p) { | ||
i = p; | ||
} | ||
|
||
public void doAdd() { | ||
addF(); | ||
fuss += i; | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...test_data/tests/java-obfuscator-test/JavaObfuscatorTest/pack/tests/basics/inner/Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package pack.tests.basics.inner; | ||
|
||
public class Test { | ||
public void run() { | ||
Exec exec = new Exec(); | ||
Exec.Inner inner1 = exec.new Inner(3); | ||
inner1.doAdd(); | ||
Exec.Inner inner2 = exec.new Inner(100); | ||
inner2.doAdd(); | ||
if (exec.fuss == 108) | ||
System.out.println("PASS"); | ||
else | ||
System.out.println("ERROR"); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
..._data/tests/java-obfuscator-test/JavaObfuscatorTest/pack/tests/basics/overwirte/Face.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package pack.tests.basics.overwirte; | ||
|
||
public interface Face { | ||
String face(int i); | ||
} |
Oops, something went wrong.